intel-gpu-tools-1.3/0000775000175100017510000000000012016622744011430 500000000000000intel-gpu-tools-1.3/aclocal.m40000664000175100017510000151067512016622040013214 00000000000000# generated automatically by aclocal 1.11.6 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, # Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, [m4_warning([this file was generated for autoconf 2.69. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically `autoreconf'.])]) # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. m4_define([_LT_COPYING], [dnl # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. # # GNU Libtool is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of # the License, or (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, or # obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ]) # serial 57 LT_INIT # LT_PREREQ(VERSION) # ------------------ # Complain and exit if this libtool version is less that VERSION. m4_defun([LT_PREREQ], [m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, [m4_default([$3], [m4_fatal([Libtool version $1 or higher is required], 63)])], [$2])]) # _LT_CHECK_BUILDDIR # ------------------ # Complain if the absolute build directory name contains unusual characters m4_defun([_LT_CHECK_BUILDDIR], [case `pwd` in *\ * | *\ *) AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; esac ]) # LT_INIT([OPTIONS]) # ------------------ AC_DEFUN([LT_INIT], [AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl AC_BEFORE([$0], [LTDL_INIT])dnl m4_require([_LT_CHECK_BUILDDIR])dnl dnl Autoconf doesn't catch unexpanded LT_ macros by default: m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 dnl unless we require an AC_DEFUNed macro: AC_REQUIRE([LTOPTIONS_VERSION])dnl AC_REQUIRE([LTSUGAR_VERSION])dnl AC_REQUIRE([LTVERSION_VERSION])dnl AC_REQUIRE([LTOBSOLETE_VERSION])dnl m4_require([_LT_PROG_LTMAIN])dnl _LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl _LT_SETUP # Only expand once: m4_define([LT_INIT]) ])# LT_INIT # Old names: AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PROG_LIBTOOL], []) dnl AC_DEFUN([AM_PROG_LIBTOOL], []) # _LT_CC_BASENAME(CC) # ------------------- # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. m4_defun([_LT_CC_BASENAME], [for cc_temp in $1""; do case $cc_temp in compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` ]) # _LT_FILEUTILS_DEFAULTS # ---------------------- # It is okay to use these file commands and assume they have been set # sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. m4_defun([_LT_FILEUTILS_DEFAULTS], [: ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} ])# _LT_FILEUTILS_DEFAULTS # _LT_SETUP # --------- m4_defun([_LT_SETUP], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl _LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl dnl _LT_DECL([], [host_alias], [0], [The host system])dnl _LT_DECL([], [host], [0])dnl _LT_DECL([], [host_os], [0])dnl dnl _LT_DECL([], [build_alias], [0], [The build system])dnl _LT_DECL([], [build], [0])dnl _LT_DECL([], [build_os], [0])dnl dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl dnl AC_REQUIRE([AC_PROG_LN_S])dnl test -z "$LN_S" && LN_S="ln -s" _LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl dnl AC_REQUIRE([LT_CMD_MAX_LEN])dnl _LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl m4_require([_LT_CMD_RELOAD])dnl m4_require([_LT_CHECK_MAGIC_METHOD])dnl m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_WITH_SYSROOT])dnl _LT_CONFIG_LIBTOOL_INIT([ # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi ]) if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi _LT_CHECK_OBJDIR m4_require([_LT_TAG_COMPILER])dnl case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld="$lt_cv_prog_gnu_ld" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o _LT_CC_BASENAME([$compiler]) # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then _LT_PATH_MAGIC fi ;; esac # Use C for the default configuration in the libtool script LT_SUPPORTED_TAG([CC]) _LT_LANG_C_CONFIG _LT_LANG_DEFAULT_CONFIG _LT_CONFIG_COMMANDS ])# _LT_SETUP # _LT_PREPARE_SED_QUOTE_VARS # -------------------------- # Define a few sed substitution that help us do robust quoting. m4_defun([_LT_PREPARE_SED_QUOTE_VARS], [# Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([["`\\]]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ]) # _LT_PROG_LTMAIN # --------------- # Note that this code is called both from `configure', and `config.status' # now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, # `config.status' has no value for ac_aux_dir unless we are using Automake, # so we pass a copy along to make sure it has a sensible value anyway. m4_defun([_LT_PROG_LTMAIN], [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) ltmain="$ac_aux_dir/ltmain.sh" ])# _LT_PROG_LTMAIN # So that we can recreate a full libtool script including additional # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS # in macros and then make a single call at the end using the `libtool' # label. # _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) # ---------------------------------------- # Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL_INIT], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_INIT], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_INIT]) # _LT_CONFIG_LIBTOOL([COMMANDS]) # ------------------------------ # Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) # _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) # ----------------------------------------------------- m4_defun([_LT_CONFIG_SAVE_COMMANDS], [_LT_CONFIG_LIBTOOL([$1]) _LT_CONFIG_LIBTOOL_INIT([$2]) ]) # _LT_FORMAT_COMMENT([COMMENT]) # ----------------------------- # Add leading comment marks to the start of each line, and a trailing # full-stop to the whole comment if one is not present already. m4_define([_LT_FORMAT_COMMENT], [m4_ifval([$1], [ m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) )]) # _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) # ------------------------------------------------------------------- # CONFIGNAME is the name given to the value in the libtool script. # VARNAME is the (base) name used in the configure script. # VALUE may be 0, 1 or 2 for a computed quote escaped value based on # VARNAME. Any other value will be used directly. m4_define([_LT_DECL], [lt_if_append_uniq([lt_decl_varnames], [$2], [, ], [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], [m4_ifval([$1], [$1], [$2])]) lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) m4_ifval([$4], [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) lt_dict_add_subkey([lt_decl_dict], [$2], [tagged?], [m4_ifval([$5], [yes], [no])])]) ]) # _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) # -------------------------------------------------------- m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) # lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_tag_varnames], [_lt_decl_filter([tagged?], [yes], $@)]) # _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) # --------------------------------------------------------- m4_define([_lt_decl_filter], [m4_case([$#], [0], [m4_fatal([$0: too few arguments: $#])], [1], [m4_fatal([$0: too few arguments: $#: $1])], [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], [lt_dict_filter([lt_decl_dict], $@)])[]dnl ]) # lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) # -------------------------------------------------- m4_define([lt_decl_quote_varnames], [_lt_decl_filter([value], [1], $@)]) # lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_dquote_varnames], [_lt_decl_filter([value], [2], $@)]) # lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_varnames_tagged], [m4_assert([$# <= 2])dnl _$0(m4_quote(m4_default([$1], [[, ]])), m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) m4_define([_lt_decl_varnames_tagged], [m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) # lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_all_varnames], [_$0(m4_quote(m4_default([$1], [[, ]])), m4_if([$2], [], m4_quote(lt_decl_varnames), m4_quote(m4_shift($@))))[]dnl ]) m4_define([_lt_decl_all_varnames], [lt_join($@, lt_decl_varnames_tagged([$1], lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl ]) # _LT_CONFIG_STATUS_DECLARE([VARNAME]) # ------------------------------------ # Quote a variable value, and forward it to `config.status' so that its # declaration there will have the same value as in `configure'. VARNAME # must have a single quote delimited value for this to work. m4_define([_LT_CONFIG_STATUS_DECLARE], [$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) # _LT_CONFIG_STATUS_DECLARATIONS # ------------------------------ # We delimit libtool config variables with single quotes, so when # we write them to config.status, we have to be sure to quote all # embedded single quotes properly. In configure, this macro expands # each variable declared with _LT_DECL (and _LT_TAGDECL) into: # # ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAGS # ---------------- # Output comment and list of tags supported by the script m4_defun([_LT_LIBTOOL_TAGS], [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl available_tags="_LT_TAGS"dnl ]) # _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) # ----------------------------------- # Extract the dictionary values for VARNAME (optionally with TAG) and # expand to a commented shell variable setting: # # # Some comment about what VAR is for. # visible_name=$lt_internal_name m4_define([_LT_LIBTOOL_DECLARE], [_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [description])))[]dnl m4_pushdef([_libtool_name], m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), [0], [_libtool_name=[$]$1], [1], [_libtool_name=$lt_[]$1], [2], [_libtool_name=$lt_[]$1], [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl ]) # _LT_LIBTOOL_CONFIG_VARS # ----------------------- # Produce commented declarations of non-tagged libtool config variables # suitable for insertion in the LIBTOOL CONFIG section of the `libtool' # script. Tagged libtool config variables (even for the LIBTOOL CONFIG # section) are produced by _LT_LIBTOOL_TAG_VARS. m4_defun([_LT_LIBTOOL_CONFIG_VARS], [m4_foreach([_lt_var], m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAG_VARS(TAG) # ------------------------- m4_define([_LT_LIBTOOL_TAG_VARS], [m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) # _LT_TAGVAR(VARNAME, [TAGNAME]) # ------------------------------ m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) # _LT_CONFIG_COMMANDS # ------------------- # Send accumulated output to $CONFIG_STATUS. Thanks to the lists of # variables for single and double quote escaping we saved from calls # to _LT_DECL, we can put quote escaped variables declarations # into `config.status', and then the shell code to quote escape them in # for loops in `config.status'. Finally, any additional code accumulated # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. m4_defun([_LT_CONFIG_COMMANDS], [AC_PROVIDE_IFELSE([LT_OUTPUT], dnl If the libtool generation code has been placed in $CONFIG_LT, dnl instead of duplicating it all over again into config.status, dnl then we will have config.status run $CONFIG_LT later, so it dnl needs to know what name is stored there: [AC_CONFIG_COMMANDS([libtool], [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], dnl If the libtool generation code is destined for config.status, dnl expand the accumulated commands and init code now: [AC_CONFIG_COMMANDS([libtool], [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) ])#_LT_CONFIG_COMMANDS # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], [ # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' _LT_CONFIG_STATUS_DECLARATIONS LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$[]1 _LTECHO_EOF' } # Quote evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_quote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_dquote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done _LT_OUTPUT_LIBTOOL_INIT ]) # _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) # ------------------------------------ # Generate a child script FILE with all initialization necessary to # reuse the environment learned by the parent script, and make the # file executable. If COMMENT is supplied, it is inserted after the # `#!' sequence but before initialization text begins. After this # macro, additional text can be appended to FILE to form the body of # the child script. The macro ends with non-zero status if the # file could not be fully written (such as if the disk is full). m4_ifdef([AS_INIT_GENERATED], [m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], [m4_defun([_LT_GENERATED_FILE_INIT], [m4_require([AS_PREPARE])]dnl [m4_pushdef([AS_MESSAGE_LOG_FD])]dnl [lt_write_fail=0 cat >$1 <<_ASEOF || lt_write_fail=1 #! $SHELL # Generated by $as_me. $2 SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$1 <<\_ASEOF || lt_write_fail=1 AS_SHELL_SANITIZE _AS_PREPARE exec AS_MESSAGE_FD>&1 _ASEOF test $lt_write_fail = 0 && chmod +x $1[]dnl m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT # LT_OUTPUT # --------- # This macro allows early generation of the libtool script (before # AC_OUTPUT is called), incase it is used in configure for compilation # tests. AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} AC_MSG_NOTICE([creating $CONFIG_LT]) _LT_GENERATED_FILE_INIT(["$CONFIG_LT"], [# Run this file to recreate a libtool stub with the current configuration.]) cat >>"$CONFIG_LT" <<\_LTEOF lt_cl_silent=false exec AS_MESSAGE_LOG_FD>>config.log { echo AS_BOX([Running $as_me.]) } >&AS_MESSAGE_LOG_FD lt_cl_help="\ \`$as_me' creates a local libtool stub from the current configuration, for use in further configure time tests before the real libtool is generated. Usage: $[0] [[OPTIONS]] -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files Report bugs to ." lt_cl_version="\ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. Copyright (C) 2011 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." while test $[#] != 0 do case $[1] in --version | --v* | -V ) echo "$lt_cl_version"; exit 0 ;; --help | --h* | -h ) echo "$lt_cl_help"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --quiet | --q* | --silent | --s* | -q ) lt_cl_silent=: ;; -*) AC_MSG_ERROR([unrecognized option: $[1] Try \`$[0] --help' for more information.]) ;; *) AC_MSG_ERROR([unrecognized argument: $[1] Try \`$[0] --help' for more information.]) ;; esac shift done if $lt_cl_silent; then exec AS_MESSAGE_FD>/dev/null fi _LTEOF cat >>"$CONFIG_LT" <<_LTEOF _LT_OUTPUT_LIBTOOL_COMMANDS_INIT _LTEOF cat >>"$CONFIG_LT" <<\_LTEOF AC_MSG_NOTICE([creating $ofile]) _LT_OUTPUT_LIBTOOL_COMMANDS AS_EXIT(0) _LTEOF chmod +x "$CONFIG_LT" # configure is writing to config.log, but config.lt does its own redirection, # appending to config.log, which fails on DOS, as config.log is still kept # open by configure. Here we exec the FD to /dev/null, effectively closing # config.log, so it can be properly (re)opened and appended to by config.lt. lt_cl_success=: test "$silent" = yes && lt_config_lt_args="$lt_config_lt_args --quiet" exec AS_MESSAGE_LOG_FD>/dev/null $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false exec AS_MESSAGE_LOG_FD>>config.log $lt_cl_success || AS_EXIT(1) ])# LT_OUTPUT # _LT_CONFIG(TAG) # --------------- # If TAG is the built-in tag, create an initial libtool script with a # default configuration from the untagged config vars. Otherwise add code # to config.status for appending the configuration named by TAG from the # matching tagged config vars. m4_defun([_LT_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_CONFIG_SAVE_COMMANDS([ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl m4_if(_LT_TAG, [C], [ # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi cfgfile="${ofile}T" trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # _LT_COPYING _LT_LIBTOOL_TAGS # ### BEGIN LIBTOOL CONFIG _LT_LIBTOOL_CONFIG_VARS _LT_LIBTOOL_TAG_VARS # ### END LIBTOOL CONFIG _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac _LT_PROG_LTMAIN # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) _LT_PROG_REPLACE_SHELLFNS mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ], [cat <<_LT_EOF >> "$ofile" dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded dnl in a comment (ie after a #). # ### BEGIN LIBTOOL TAG CONFIG: $1 _LT_LIBTOOL_TAG_VARS(_LT_TAG) # ### END LIBTOOL TAG CONFIG: $1 _LT_EOF ])dnl /m4_if ], [m4_if([$1], [], [ PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile'], []) ])dnl /_LT_CONFIG_SAVE_COMMANDS ])# _LT_CONFIG # LT_SUPPORTED_TAG(TAG) # --------------------- # Trace this macro to discover what tags are supported by the libtool # --tag option, using: # autoconf --trace 'LT_SUPPORTED_TAG:$1' AC_DEFUN([LT_SUPPORTED_TAG], []) # C support is built-in for now m4_define([_LT_LANG_C_enabled], []) m4_define([_LT_TAGS], []) # LT_LANG(LANG) # ------------- # Enable libtool support for the given language if not already enabled. AC_DEFUN([LT_LANG], [AC_BEFORE([$0], [LT_OUTPUT])dnl m4_case([$1], [C], [_LT_LANG(C)], [C++], [_LT_LANG(CXX)], [Go], [_LT_LANG(GO)], [Java], [_LT_LANG(GCJ)], [Fortran 77], [_LT_LANG(F77)], [Fortran], [_LT_LANG(FC)], [Windows Resource], [_LT_LANG(RC)], [m4_ifdef([_LT_LANG_]$1[_CONFIG], [_LT_LANG($1)], [m4_fatal([$0: unsupported language: "$1"])])])dnl ])# LT_LANG # _LT_LANG(LANGNAME) # ------------------ m4_defun([_LT_LANG], [m4_ifdef([_LT_LANG_]$1[_enabled], [], [LT_SUPPORTED_TAG([$1])dnl m4_append([_LT_TAGS], [$1 ])dnl m4_define([_LT_LANG_]$1[_enabled], [])dnl _LT_LANG_$1_CONFIG($1)])dnl ])# _LT_LANG m4_ifndef([AC_PROG_GO], [ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_GO. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # m4_defun([AC_PROG_GO], [AC_LANG_PUSH(Go)dnl AC_ARG_VAR([GOC], [Go compiler command])dnl AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl _AC_ARG_VAR_LDFLAGS()dnl AC_CHECK_TOOL(GOC, gccgo) if test -z "$GOC"; then if test -n "$ac_tool_prefix"; then AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) fi fi if test -z "$GOC"; then AC_CHECK_PROG(GOC, gccgo, gccgo, false) fi ])#m4_defun ])#m4_ifndef # _LT_LANG_DEFAULT_CONFIG # ----------------------- m4_defun([_LT_LANG_DEFAULT_CONFIG], [AC_PROVIDE_IFELSE([AC_PROG_CXX], [LT_LANG(CXX)], [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) AC_PROVIDE_IFELSE([AC_PROG_F77], [LT_LANG(F77)], [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) AC_PROVIDE_IFELSE([AC_PROG_FC], [LT_LANG(FC)], [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal dnl pulling things in needlessly. AC_PROVIDE_IFELSE([AC_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([LT_PROG_GCJ], [LT_LANG(GCJ)], [m4_ifdef([AC_PROG_GCJ], [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([A][M_PROG_GCJ], [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([LT_PROG_GCJ], [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) AC_PROVIDE_IFELSE([AC_PROG_GO], [LT_LANG(GO)], [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) AC_PROVIDE_IFELSE([LT_PROG_RC], [LT_LANG(RC)], [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) ])# _LT_LANG_DEFAULT_CONFIG # Obsolete macros: AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_CXX], []) dnl AC_DEFUN([AC_LIBTOOL_F77], []) dnl AC_DEFUN([AC_LIBTOOL_FC], []) dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) dnl AC_DEFUN([AC_LIBTOOL_RC], []) # _LT_TAG_COMPILER # ---------------- m4_defun([_LT_TAG_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl _LT_DECL([LTCC], [CC], [1], [A C compiler])dnl _LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl _LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl _LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC ])# _LT_TAG_COMPILER # _LT_COMPILER_BOILERPLATE # ------------------------ # Check for compiler boilerplate output or warnings with # the simple compiler test code. m4_defun([_LT_COMPILER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ])# _LT_COMPILER_BOILERPLATE # _LT_LINKER_BOILERPLATE # ---------------------- # Check for linker boilerplate output or warnings with # the simple link test code. m4_defun([_LT_LINKER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ])# _LT_LINKER_BOILERPLATE # _LT_REQUIRED_DARWIN_CHECKS # ------------------------- m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ case $host_os in rhapsody* | darwin*) AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) AC_CHECK_TOOL([LIPO], [lipo], [:]) AC_CHECK_TOOL([OTOOL], [otool], [:]) AC_CHECK_TOOL([OTOOL64], [otool64], [:]) _LT_DECL([], [DSYMUTIL], [1], [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) _LT_DECL([], [NMEDIT], [1], [Tool to change global to local symbols on Mac OS X]) _LT_DECL([], [LIPO], [1], [Tool to manipulate fat objects and archives on Mac OS X]) _LT_DECL([], [OTOOL], [1], [ldd/readelf like tool for Mach-O binaries on Mac OS X]) _LT_DECL([], [OTOOL64], [1], [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], [lt_cv_apple_cc_single_mod=no if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test $_lt_result -eq 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -rf libconftest.dylib* rm -f conftest.* fi]) AC_CACHE_CHECK([for -exported_symbols_list linker flag], [lt_cv_ld_exported_symbols_list], [lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [lt_cv_ld_exported_symbols_list=yes], [lt_cv_ld_exported_symbols_list=no]) LDFLAGS="$save_LDFLAGS" ]) AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], [lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then lt_cv_ld_force_load=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM ]) case $host_os in rhapsody* | darwin1.[[012]]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[[012]]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ]) # _LT_DARWIN_LINKER_FEATURES([TAG]) # --------------------------------- # Checks for linker and compiler features on darwin m4_defun([_LT_DARWIN_LINKER_FEATURES], [ m4_require([_LT_REQUIRED_DARWIN_CHECKS]) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported if test "$lt_cv_ld_force_load" = "yes"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) else _LT_TAGVAR(whole_archive_flag_spec, $1)='' fi _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=func_echo_all _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" m4_if([$1], [CXX], [ if test "$lt_cv_apple_cc_single_mod" != "yes"; then _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" fi ],[]) else _LT_TAGVAR(ld_shlibs, $1)=no fi ]) # _LT_SYS_MODULE_PATH_AIX([TAGNAME]) # ---------------------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. # Store the results from the different compilers for each TAGNAME. # Allow to override them for all tags through lt_cv_aix_libpath. m4_defun([_LT_SYS_MODULE_PATH_AIX], [m4_require([_LT_DECL_SED])dnl if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ lt_aix_libpath_sed='[ /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }]' _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi],[]) if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib" fi ]) aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) fi ])# _LT_SYS_MODULE_PATH_AIX # _LT_SHELL_INIT(ARG) # ------------------- m4_define([_LT_SHELL_INIT], [m4_divert_text([M4SH-INIT], [$1 ])])# _LT_SHELL_INIT # _LT_PROG_ECHO_BACKSLASH # ----------------------- # Find how we can fake an echo command that does not interpret backslash. # In particular, with Autoconf 2.60 or later we add some code to the start # of the generated configure script which will find a shell with a builtin # printf (which we can use as an echo command). m4_defun([_LT_PROG_ECHO_BACKSLASH], [ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO AC_MSG_CHECKING([how to print strings]) # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $[]1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } case "$ECHO" in printf*) AC_MSG_RESULT([printf]) ;; print*) AC_MSG_RESULT([print -r]) ;; *) AC_MSG_RESULT([cat]) ;; esac m4_ifdef([_AS_DETECT_SUGGESTED], [_AS_DETECT_SUGGESTED([ test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test "X`printf %s $ECHO`" = "X$ECHO" \ || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) ])# _LT_PROG_ECHO_BACKSLASH # _LT_WITH_SYSROOT # ---------------- AC_DEFUN([_LT_WITH_SYSROOT], [AC_MSG_CHECKING([for sysroot]) AC_ARG_WITH([sysroot], [ --with-sysroot[=DIR] Search for dependent libraries within DIR (or the compiler's sysroot if not specified).], [], [with_sysroot=no]) dnl lt_sysroot will always be passed unquoted. We quote it here dnl in case the user passed a directory name. lt_sysroot= case ${with_sysroot} in #( yes) if test "$GCC" = yes; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) AC_MSG_RESULT([${with_sysroot}]) AC_MSG_ERROR([The sysroot must be an absolute path.]) ;; esac AC_MSG_RESULT([${lt_sysroot:-no}]) _LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl [dependent libraries, and in which our libraries should be installed.])]) # _LT_ENABLE_LOCK # --------------- m4_defun([_LT_ENABLE_LOCK], [AC_ARG_ENABLE([libtool-lock], [AS_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; *-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD="${LD-ld}_sol2" fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" ])# _LT_ENABLE_LOCK # _LT_PROG_AR # ----------- m4_defun([_LT_PROG_AR], [AC_CHECK_TOOLS(AR, [ar], false) : ${AR=ar} : ${AR_FLAGS=cru} _LT_DECL([], [AR], [1], [The archiver]) _LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], [lt_cv_ar_at_file=no AC_COMPILE_IFELSE([AC_LANG_PROGRAM], [echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([lt_ar_try]) if test "$ac_status" -eq 0; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a AC_TRY_EVAL([lt_ar_try]) if test "$ac_status" -ne 0; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a ]) ]) if test "x$lt_cv_ar_at_file" = xno; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi _LT_DECL([], [archiver_list_spec], [1], [How to feed a file listing to the archiver]) ])# _LT_PROG_AR # _LT_CMD_OLD_ARCHIVE # ------------------- m4_defun([_LT_CMD_OLD_ARCHIVE], [_LT_PROG_AR AC_CHECK_TOOL(STRIP, strip, :) test -z "$STRIP" && STRIP=: _LT_DECL([], [STRIP], [1], [A symbol stripping program]) AC_CHECK_TOOL(RANLIB, ranlib, :) test -z "$RANLIB" && RANLIB=: _LT_DECL([], [RANLIB], [1], [Commands used to install an old-style archive]) # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac _LT_DECL([], [old_postinstall_cmds], [2]) _LT_DECL([], [old_postuninstall_cmds], [2]) _LT_TAGDECL([], [old_archive_cmds], [2], [Commands used to build an old-style archive]) _LT_DECL([], [lock_old_archive_extraction], [0], [Whether to use a lock for old archive extraction]) ])# _LT_CMD_OLD_ARCHIVE # _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([_LT_COMPILER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi fi $RM conftest* ]) if test x"[$]$2" = xyes; then m4_if([$5], , :, [$5]) else m4_if([$6], , :, [$6]) fi ])# _LT_COMPILER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) # _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------- # Check whether the given linker option works AC_DEFUN([_LT_LINKER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $3" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi else $2=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" ]) if test x"[$]$2" = xyes; then m4_if([$4], , :, [$4]) else m4_if([$5], , :, [$5]) fi ])# _LT_LINKER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) # LT_CMD_MAX_LEN #--------------- AC_DEFUN([LT_CMD_MAX_LEN], [AC_REQUIRE([AC_CANONICAL_HOST])dnl # find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac ]) if test -n $lt_cv_sys_max_cmd_len ; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) fi max_cmd_len=$lt_cv_sys_max_cmd_len _LT_DECL([], [max_cmd_len], [0], [What is the maximum length of a command?]) ])# LT_CMD_MAX_LEN # Old name: AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) # _LT_HEADER_DLFCN # ---------------- m4_defun([_LT_HEADER_DLFCN], [AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl ])# _LT_HEADER_DLFCN # _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # ---------------------------------------------------------------- m4_defun([_LT_TRY_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test "$cross_compiling" = yes; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF [#line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; }] _LT_EOF if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_dlunknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_TRY_DLOPEN_SELF # LT_SYS_DLOPEN_SELF # ------------------ AC_DEFUN([LT_SYS_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; *) AC_CHECK_FUNC([shl_load], [lt_cv_dlopen="shl_load"], [AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen="dlopen"], [AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], [AC_CHECK_LIB([svld], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], [AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) ]) ]) ]) ]) ]) ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi _LT_DECL([dlopen_support], [enable_dlopen], [0], [Whether dlopen is supported]) _LT_DECL([dlopen_self], [enable_dlopen_self], [0], [Whether dlopen of programs is supported]) _LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], [Whether dlopen of statically linked programs is supported]) ])# LT_SYS_DLOPEN_SELF # Old name: AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) # _LT_COMPILER_C_O([TAGNAME]) # --------------------------- # Check to see if options -c and -o are simultaneously supported by compiler. # This macro does not hard code the compiler like AC_PROG_CC_C_O. m4_defun([_LT_COMPILER_C_O], [m4_require([_LT_DECL_SED])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes fi fi chmod u+w . 2>&AS_MESSAGE_LOG_FD $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* ]) _LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], [Does compiler simultaneously support -c and -o options?]) ])# _LT_COMPILER_C_O # _LT_COMPILER_FILE_LOCKS([TAGNAME]) # ---------------------------------- # Check to see if we can do hard links to lock some files if needed m4_defun([_LT_COMPILER_FILE_LOCKS], [m4_require([_LT_ENABLE_LOCK])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_COMPILER_C_O([$1]) hard_links="nottested" if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no AC_MSG_RESULT([$hard_links]) if test "$hard_links" = no; then AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi _LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) ])# _LT_COMPILER_FILE_LOCKS # _LT_CHECK_OBJDIR # ---------------- m4_defun([_LT_CHECK_OBJDIR], [AC_CACHE_CHECK([for objdir], [lt_cv_objdir], [rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null]) objdir=$lt_cv_objdir _LT_DECL([], [objdir], [0], [The name of the directory that contains temporary libtool files])dnl m4_pattern_allow([LT_OBJDIR])dnl AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/", [Define to the sub-directory in which libtool stores uninstalled libraries.]) ])# _LT_CHECK_OBJDIR # _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) # -------------------------------------- # Check hardcoding attributes. m4_defun([_LT_LINKER_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_TAGVAR(hardcode_action, $1)= if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || test -n "$_LT_TAGVAR(runpath_var, $1)" || test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then # We can hardcode non-existent directories. if test "$_LT_TAGVAR(hardcode_direct, $1)" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no && test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then # Linking always hardcodes the temporary library directory. _LT_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) if test "$_LT_TAGVAR(hardcode_action, $1)" = relink || test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi _LT_TAGDECL([], [hardcode_action], [0], [How to hardcode a shared library path into an executable]) ])# _LT_LINKER_HARDCODE_LIBPATH # _LT_CMD_STRIPLIB # ---------------- m4_defun([_LT_CMD_STRIPLIB], [m4_require([_LT_DECL_EGREP]) striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [striplib], [1]) ])# _LT_CMD_STRIPLIB # _LT_SYS_DYNAMIC_LINKER([TAG]) # ----------------------------- # PORTME Fill in your ld.so characteristics m4_defun([_LT_SYS_DYNAMIC_LINKER], [AC_REQUIRE([AC_CANONICAL_HOST])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_OBJDUMP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;; *) lt_sed_strip_eq="s,=/,/,g" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[[lt_foo]]++; } if (lt_freq[[lt_foo]] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's,/\([[A-Za-z]]:\),\1,g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi]) library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[[4-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[[45]]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' library_names_spec='${libname}.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec="$LIB" if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[[23]].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=yes sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[[3-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], [lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], [lt_cv_shlibpath_overrides_runpath=yes])]) LDFLAGS=$save_LDFLAGS libdir=$save_libdir ]) shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[[89]] | openbsd2.[[89]].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac AC_MSG_RESULT([$dynamic_linker]) test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi _LT_DECL([], [variables_saved_for_relink], [1], [Variables whose values should be saved in libtool wrapper scripts and restored at link time]) _LT_DECL([], [need_lib_prefix], [0], [Do we need the "lib" prefix for modules?]) _LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) _LT_DECL([], [version_type], [0], [Library versioning type]) _LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) _LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) _LT_DECL([], [shlibpath_overrides_runpath], [0], [Is shlibpath searched before the hard-coded library search path?]) _LT_DECL([], [libname_spec], [1], [Format of library name prefix]) _LT_DECL([], [library_names_spec], [1], [[List of archive names. First name is the real one, the rest are links. The last name is the one that the linker finds with -lNAME]]) _LT_DECL([], [soname_spec], [1], [[The coded name of the library, if different from the real name]]) _LT_DECL([], [install_override_mode], [1], [Permission mode override for installation of shared libraries]) _LT_DECL([], [postinstall_cmds], [2], [Command to use after installation of a shared archive]) _LT_DECL([], [postuninstall_cmds], [2], [Command to use after uninstallation of a shared archive]) _LT_DECL([], [finish_cmds], [2], [Commands used to finish a libtool library installation in a directory]) _LT_DECL([], [finish_eval], [1], [[As "finish_cmds", except a single script fragment to be evaled but not shown]]) _LT_DECL([], [hardcode_into_libs], [0], [Whether we should hardcode library paths into libraries]) _LT_DECL([], [sys_lib_search_path_spec], [2], [Compile-time system search path for libraries]) _LT_DECL([], [sys_lib_dlsearch_path_spec], [2], [Run-time system search path for libraries]) ])# _LT_SYS_DYNAMIC_LINKER # _LT_PATH_TOOL_PREFIX(TOOL) # -------------------------- # find a file program which can recognize shared library AC_DEFUN([_LT_PATH_TOOL_PREFIX], [m4_require([_LT_DECL_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="m4_if([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$1; then lt_cv_path_MAGIC_CMD="$ac_dir/$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac]) MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi _LT_DECL([], [MAGIC_CMD], [0], [Used to examine libraries when file_magic_cmd begins with "file"])dnl ])# _LT_PATH_TOOL_PREFIX # Old name: AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) # _LT_PATH_MAGIC # -------------- # find a file program which can recognize a shared library m4_defun([_LT_PATH_MAGIC], [_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# _LT_PATH_MAGIC # LT_PATH_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([LT_PATH_LD], [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PROG_ECHO_BACKSLASH])dnl AC_ARG_WITH([gnu-ld], [AS_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test "$withval" = no || with_gnu_ld=yes], [with_gnu_ld=no])dnl ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; 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* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; esac ]) file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown _LT_DECL([], [deplibs_check_method], [1], [Method to check whether dependent libraries are shared objects]) _LT_DECL([], [file_magic_cmd], [1], [Command to use when deplibs_check_method = "file_magic"]) _LT_DECL([], [file_magic_glob], [1], [How to find potential files when deplibs_check_method = "file_magic"]) _LT_DECL([], [want_nocaseglob], [1], [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) ])# _LT_CHECK_MAGIC_METHOD # LT_PATH_NM # ---------- # find the pathname to a BSD- or MS-compatible name lister AC_DEFUN([LT_PATH_NM], [AC_REQUIRE([AC_PROG_CC])dnl AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done : ${lt_cv_path_NM=no} fi]) if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols" ;; *) DUMPBIN=: ;; esac fi AC_SUBST([DUMPBIN]) if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm AC_SUBST([NM]) _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], [lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) cat conftest.out >&AS_MESSAGE_LOG_FD if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest*]) ])# LT_PATH_NM # Old names: AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_PROG_NM], []) dnl AC_DEFUN([AC_PROG_NM], []) # _LT_CHECK_SHAREDLIB_FROM_LINKLIB # -------------------------------- # how to determine the name of the shared library # associated with a specific link library. # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) m4_require([_LT_DECL_DLLTOOL]) AC_CACHE_CHECK([how to associate runtime and link libraries], lt_cv_sharedlib_from_linklib_cmd, [lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh # decide which to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd="$ECHO" ;; esac ]) sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO _LT_DECL([], [sharedlib_from_linklib_cmd], [1], [Command to associate shared and link libraries]) ])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB # _LT_PATH_MANIFEST_TOOL # ---------------------- # locate the manifest tool m4_defun([_LT_PATH_MANIFEST_TOOL], [AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], [lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&AS_MESSAGE_LOG_FD if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest*]) if test "x$lt_cv_path_mainfest_tool" != xyes; then MANIFEST_TOOL=: fi _LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl ])# _LT_PATH_MANIFEST_TOOL # LT_LIB_M # -------- # check for math library AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM="-lm") ;; esac AC_SUBST([LIBM]) ])# LT_LIB_M # Old name: AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_CHECK_LIBM], []) # _LT_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------- m4_defun([_LT_COMPILER_NO_RTTI], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test "$GCC" = yes; then case $cc_basename in nvcc*) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; *) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; esac _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi _LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], [Compiler flag to turn off builtin functions]) ])# _LT_COMPILER_NO_RTTI # _LT_CMD_GLOBAL_SYMBOLS # ---------------------- m4_defun([_LT_CMD_GLOBAL_SYMBOLS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([LT_PATH_NM])dnl AC_REQUIRE([LT_PATH_LD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_TAG_COMPILER])dnl # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output from $compiler object]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [ # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[[BCDEGRST]]' # Regexp to match symbols that can be accessed directly from C. sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[[ABCDGISTW]]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[[ABCDEGRST]]' fi ;; irix* | nonstopux*) symcode='[[BCDEGRST]]' ;; osf*) symcode='[[BCDEGQRST]]' ;; solaris*) symcode='[[BDRT]]' ;; sco3.2v5*) symcode='[[DT]]' ;; sysv4.2uw2*) symcode='[[DT]]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[[ABDT]]' ;; sysv4) symcode='[[DFNSTU]]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[[ABCDGIRSTW]]' ;; esac # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx]" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. nlist=conftest.nm if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT@&t@_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT@&t@_DLSYM_CONST #else # define LT@&t@_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT@&t@_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[[]] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done ]) if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then nm_file_list_spec='@' fi _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], [Take the output of nm and produce a listing of raw symbols and C names]) _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], [Transform the output of nm in a proper C declaration]) _LT_DECL([global_symbol_to_c_name_address], [lt_cv_sys_global_symbol_to_c_name_address], [1], [Transform the output of nm in a C name address pair]) _LT_DECL([global_symbol_to_c_name_address_lib_prefix], [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], [Transform the output of nm in a C name address pair when lib prefix is needed]) _LT_DECL([], [nm_file_list_spec], [1], [Specify filename containing input files for $NM]) ]) # _LT_CMD_GLOBAL_SYMBOLS # _LT_COMPILER_PIC([TAGNAME]) # --------------------------- m4_defun([_LT_COMPILER_PIC], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_wl, $1)= _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)= m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else case $host_os in aix[[4-9]]*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; dgux*) case $cc_basename in ec++*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' if test "$host_cpu" != ia64; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # KAI C++ Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64 which still supported -KPIC. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL 8.0, 9.0 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd* | netbsdelf*-gnu) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx*) # Digital/Compaq C++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc*) # Lucid _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test "$GCC" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; hpux9* | hpux10* | hpux11*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # Lahey Fortran 8.1. lf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' ;; nagfor*) # NAG Fortran compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; ccc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='' ;; *Sun\ F* | *Sun*Fortran*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; *Intel*\ [[CF]]*Compiler*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; *Portland\ Group*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; esac ;; newsos6) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; rdos*) _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; solaris*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; esac ;; sunos4*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; unicos*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; uts4*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" ;; esac AC_CACHE_CHECK([for $compiler option to produce PIC], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) _LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], [Additional compiler flags for building library objects]) _LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], [How to pass a linker flag through the compiler]) # # Check to make sure the static flag actually works. # wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" _LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), $lt_tmp_static_flag, [], [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], [Compiler flag to prevent dynamic linking]) ])# _LT_COMPILER_PIC # _LT_LINKER_SHLIBS([TAGNAME]) # ---------------------------- # See if the linker supports building shared libraries. m4_defun([_LT_LINKER_SHLIBS], [AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) m4_if([$1], [CXX], [ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] case $host_os in aix[[4-9]]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global defined # symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" ;; cygwin* | mingw* | cegcc*) case $cc_basename in cl*) _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] ;; esac ;; linux* | k*bsd*-gnu | gnu*) _LT_TAGVAR(link_all_deplibs, $1)=no ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac ], [ runpath_var= _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_cmds, $1)= _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(old_archive_from_new_cmds, $1)= _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_TAGVAR(thread_safe_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_TAGVAR(include_expsyms, $1)= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. dnl Note also adjust exclude_expsyms for C++ above. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; linux* | k*bsd*-gnu | gnu*) _LT_TAGVAR(link_all_deplibs, $1)=no ;; esac _LT_TAGVAR(ld_shlibs, $1)=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test "$with_gnu_ld" = yes; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no case `$LD -v 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[[3-9]]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 _LT_TAGVAR(whole_archive_flag_spec, $1)= tmp_sharedflag='--shared' ;; xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; sunos4*) _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then runpath_var= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. _LT_TAGVAR(hardcode_minus_L, $1)=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_TAGVAR(hardcode_direct, $1)=unsupported fi ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global # defined symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' if test "$GCC" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi _LT_TAGVAR(link_all_deplibs, $1)=no else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; bsdi[[45]]*) _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; hpux9*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; hpux10*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes fi ;; hpux11*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) m4_if($1, [], [ # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) _LT_LINKER_OPTION([if $CC understands -b], _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) ;; esac fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], [lt_cv_irix_exported_symbol], [save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" AC_LINK_IFELSE( [AC_LANG_SOURCE( [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], [C++], [[int foo (void) { return 0; }]], [Fortran 77], [[ subroutine foo end]], [Fortran], [[ subroutine foo end]])])], [lt_cv_irix_exported_symbol=yes], [lt_cv_irix_exported_symbol=no]) LDFLAGS="$save_LDFLAGS"]) if test "$lt_cv_irix_exported_symbol" = yes; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' fi else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes _LT_TAGVAR(link_all_deplibs, $1)=yes ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' else case $host_os in openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' ;; esac fi else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; solaris*) _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' fi ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(ld_shlibs, $1)=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym' ;; esac fi fi ]) AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld _LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl _LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl _LT_DECL([], [extract_expsyms_cmds], [2], [The commands to extract the exported symbol list from a shared archive]) # # Do we need to explicitly link libc? # case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_TAGVAR(archive_cmds_need_lc, $1)=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $_LT_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. AC_CACHE_CHECK([whether -lc should be explicitly linked in], [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), [$RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if AC_TRY_EVAL(ac_compile) 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) _LT_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) then lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no else lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* ]) _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) ;; esac fi ;; esac _LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], [Whether or not to add -lc for building shared libraries]) _LT_TAGDECL([allow_libtool_libs_with_static_runtimes], [enable_shared_with_static_runtimes], [0], [Whether or not to disallow shared libs when runtime libs are static]) _LT_TAGDECL([], [export_dynamic_flag_spec], [1], [Compiler flag to allow reflexive dlopens]) _LT_TAGDECL([], [whole_archive_flag_spec], [1], [Compiler flag to generate shared objects directly from archives]) _LT_TAGDECL([], [compiler_needs_object], [1], [Whether the compiler copes with passing no objects directly]) _LT_TAGDECL([], [old_archive_from_new_cmds], [2], [Create an old-style archive from a shared archive]) _LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], [Create a temporary old-style archive to link instead of a shared archive]) _LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) _LT_TAGDECL([], [archive_expsym_cmds], [2]) _LT_TAGDECL([], [module_cmds], [2], [Commands used to build a loadable module if different from building a shared archive.]) _LT_TAGDECL([], [module_expsym_cmds], [2]) _LT_TAGDECL([], [with_gnu_ld], [1], [Whether we are building with GNU ld or not]) _LT_TAGDECL([], [allow_undefined_flag], [1], [Flag that allows shared libraries with undefined symbols to be built]) _LT_TAGDECL([], [no_undefined_flag], [1], [Flag that enforces no undefined symbols]) _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], [Flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]) _LT_TAGDECL([], [hardcode_libdir_separator], [1], [Whether we need a single "-rpath" flag with a separated argument]) _LT_TAGDECL([], [hardcode_direct], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_direct_absolute], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary and the resulting library dependency is "absolute", i.e impossible to change by setting ${shlibpath_var} if the library is relocated]) _LT_TAGDECL([], [hardcode_minus_L], [0], [Set to "yes" if using the -LDIR flag during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_shlibpath_var], [0], [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_automatic], [0], [Set to "yes" if building a shared library automatically hardcodes DIR into the library and all subsequent libraries and executables linked against it]) _LT_TAGDECL([], [inherit_rpath], [0], [Set to yes if linker adds runtime paths of dependent libraries to runtime path list]) _LT_TAGDECL([], [link_all_deplibs], [0], [Whether libtool must link a program against all its dependency libraries]) _LT_TAGDECL([], [always_export_symbols], [0], [Set to "yes" if exported symbols are required]) _LT_TAGDECL([], [export_symbols_cmds], [2], [The commands to list exported symbols]) _LT_TAGDECL([], [exclude_expsyms], [1], [Symbols that should not be listed in the preloaded symbols]) _LT_TAGDECL([], [include_expsyms], [1], [Symbols that must always be exported]) _LT_TAGDECL([], [prelink_cmds], [2], [Commands necessary for linking programs (against libraries) with templates]) _LT_TAGDECL([], [postlink_cmds], [2], [Commands necessary for finishing linking programs]) _LT_TAGDECL([], [file_list_spec], [1], [Specify filename containing input files]) dnl FIXME: Not yet implemented dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], dnl [Compiler flag to generate thread safe objects]) ])# _LT_LINKER_SHLIBS # _LT_LANG_C_CONFIG([TAG]) # ------------------------ # Ensure that the configuration variables for a C compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_C_CONFIG], [m4_require([_LT_DECL_EGREP])dnl lt_save_CC="$CC" AC_LANG_PUSH(C) # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' _LT_TAG_COMPILER # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) LT_SYS_DLOPEN_SELF _LT_CMD_STRIPLIB # Report which library types will actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_CONFIG($1) fi AC_LANG_POP CC="$lt_save_CC" ])# _LT_LANG_C_CONFIG # _LT_LANG_CXX_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a C++ compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_CXX_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then AC_PROG_CXXCPP else _lt_caught_CXX_error=yes fi AC_LANG_PUSH(C++) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_caught_CXX_error" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} CFLAGS=$CXXFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration LT_PATH_LD # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) _LT_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' if test "$GXX" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. _LT_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty # executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared # libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in ,cl* | no,cl*) # Native MSVC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ func_to_tool_file "$lt_outputfile"~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF _LT_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_TAGVAR(ld_shlibs, $1)=yes ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; hpux9*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) ;; *) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' fi fi _LT_TAGVAR(link_all_deplibs, $1)=yes ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) _LT_TAGVAR(ld_shlibs, $1)=yes ;; openbsd2*) # C++ shared libraries are fairly broken _LT_TAGVAR(ld_shlibs, $1)=no ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; cxx*) case $host in osf3*) _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' ;; *) _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ $RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ;; esac _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' case $host in osf3*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ '"$_LT_TAGVAR(old_archive_cmds, $1)" _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ '"$_LT_TAGVAR(reload_cmds, $1)" ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(GCC, $1)="$GXX" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test "$_lt_caught_CXX_error" != yes AC_LANG_POP ])# _LT_LANG_CXX_CONFIG # _LT_FUNC_STRIPNAME_CNF # ---------------------- # func_stripname_cnf prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # # This function is identical to the (non-XSI) version of func_stripname, # except this one can be used by m4 code that may be executed by configure, # rather than the libtool script. m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl AC_REQUIRE([_LT_DECL_SED]) AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) func_stripname_cnf () { case ${2} in .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } # func_stripname_cnf ])# _LT_FUNC_STRIPNAME_CNF # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) # --------------------------------- # Figure out "hidden" library dependencies from verbose # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # objects, libraries and library flags. m4_defun([_LT_SYS_HIDDEN_LIBDEPS], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl # Dependencies to place before and after the object being linked: _LT_TAGVAR(predep_objects, $1)= _LT_TAGVAR(postdep_objects, $1)= _LT_TAGVAR(predeps, $1)= _LT_TAGVAR(postdeps, $1)= _LT_TAGVAR(compiler_lib_search_path, $1)= dnl we can't use the lt_simple_compile_test_code here, dnl because it contains code intended for an executable, dnl not a library. It's possible we should let each dnl tag define a new lt_????_link_test_code variable, dnl but it's only used here... m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF int a; void foo (void) { a = 0; } _LT_EOF ], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF ], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer*4 a a=0 return end _LT_EOF ], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer a a=0 return end _LT_EOF ], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF public class foo { private int a; public void bar (void) { a = 0; } }; _LT_EOF ], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF package foo func foo() { } _LT_EOF ]) _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; *\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; esac dnl Parse the compiler output and extract the necessary dnl objects, libraries and library flags. if AC_TRY_EVAL(ac_compile); then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case ${prev}${p} in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test $p = "-L" || test $p = "-R"; then prev=$p continue fi # Expand the sysroot to ease extracting the directories later. if test -z "$prev"; then case $p in -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; esac fi case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac if test "$pre_test_object_deps_done" = no; then case ${prev} in -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" else _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$_LT_TAGVAR(postdeps, $1)"; then _LT_TAGVAR(postdeps, $1)="${prev}${p}" else _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" fi fi prev= ;; *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test "$pre_test_object_deps_done" = no; then if test -z "$_LT_TAGVAR(predep_objects, $1)"; then _LT_TAGVAR(predep_objects, $1)="$p" else _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" fi else if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then _LT_TAGVAR(postdep_objects, $1)="$p" else _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling $1 test program" fi $RM -f confest.$objext CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken m4_if([$1], [CXX], [case $host_os in interix[[3-9]]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. _LT_TAGVAR(predep_objects,$1)= _LT_TAGVAR(postdep_objects,$1)= _LT_TAGVAR(postdeps,$1)= ;; linux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac # Adding this requires a known-good setup of shared libraries for # Sun compiler versions before 5.6, else PIC objects from an old # archive will be linked into the output, leading to subtle bugs. if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; esac ]) case " $_LT_TAGVAR(postdeps, $1) " in *" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; esac _LT_TAGVAR(compiler_lib_search_dirs, $1)= if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` fi _LT_TAGDECL([], [compiler_lib_search_dirs], [1], [The directories searched by this compiler when creating a shared library]) _LT_TAGDECL([], [predep_objects], [1], [Dependencies to place before and after the objects being linked to create a shared library]) _LT_TAGDECL([], [postdep_objects], [1]) _LT_TAGDECL([], [predeps], [1]) _LT_TAGDECL([], [postdeps], [1]) _LT_TAGDECL([], [compiler_lib_search_path], [1], [The library search path used internally by the compiler when linking a shared library]) ])# _LT_SYS_HIDDEN_LIBDEPS # _LT_LANG_F77_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a Fortran 77 compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_F77_CONFIG], [AC_LANG_PUSH(Fortran 77) if test -z "$F77" || test "X$F77" = "Xno"; then _lt_disable_F77=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the F77 compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_F77" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${F77-"f77"} CFLAGS=$FFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) GCC=$G77 if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$G77" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC="$lt_save_CC" CFLAGS="$lt_save_CFLAGS" fi # test "$_lt_disable_F77" != yes AC_LANG_POP ])# _LT_LANG_F77_CONFIG # _LT_LANG_FC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for a Fortran compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_FC_CONFIG], [AC_LANG_PUSH(Fortran) if test -z "$FC" || test "X$FC" = "Xno"; then _lt_disable_FC=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for fc test sources. ac_ext=${ac_fc_srcext-f} # Object file extension for compiled fc test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the FC compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_FC" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${FC-"f95"} CFLAGS=$FCFLAGS compiler=$CC GCC=$ac_cv_fc_compiler_gnu _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS fi # test "$_lt_disable_FC" != yes AC_LANG_POP ])# _LT_LANG_FC_CONFIG # _LT_LANG_GCJ_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Java Compiler compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_GCJ_CONFIG], [AC_REQUIRE([LT_PROG_GCJ])dnl AC_LANG_SAVE # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GCJ-"gcj"} CFLAGS=$GCJFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)="$LD" _LT_CC_BASENAME([$compiler]) # GCJ did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GCJ_CONFIG # _LT_LANG_GO_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Go compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_GO_CONFIG], [AC_REQUIRE([LT_PROG_GO])dnl AC_LANG_SAVE # Source file extension for Go test sources. ac_ext=go # Object file extension for compiled Go test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="package main; func main() { }" # Code to be used in simple link tests lt_simple_link_test_code='package main; func main() { }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GOC-"gccgo"} CFLAGS=$GOFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)="$LD" _LT_CC_BASENAME([$compiler]) # Go did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GO_CONFIG # _LT_LANG_RC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for the Windows resource compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_RC_CONFIG], [AC_REQUIRE([LT_PROG_RC])dnl AC_LANG_SAVE # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' # Code to be used in simple link tests lt_simple_link_test_code="$lt_simple_compile_test_code" # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC= CC=${RC-"windres"} CFLAGS= compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes if test -n "$compiler"; then : _LT_CONFIG($1) fi GCC=$lt_save_GCC AC_LANG_RESTORE CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_RC_CONFIG # LT_PROG_GCJ # ----------- AC_DEFUN([LT_PROG_GCJ], [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj,) test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS)])])[]dnl ]) # Old name: AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_GCJ], []) # LT_PROG_GO # ---------- AC_DEFUN([LT_PROG_GO], [AC_CHECK_TOOL(GOC, gccgo,) ]) # LT_PROG_RC # ---------- AC_DEFUN([LT_PROG_RC], [AC_CHECK_TOOL(RC, windres,) ]) # Old name: AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_RC], []) # _LT_DECL_EGREP # -------------- # If we don't have a new enough Autoconf to choose the best grep # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_EGREP], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_REQUIRE([AC_PROG_FGREP])dnl test -z "$GREP" && GREP=grep _LT_DECL([], [GREP], [1], [A grep program that handles long lines]) _LT_DECL([], [EGREP], [1], [An ERE matcher]) _LT_DECL([], [FGREP], [1], [A literal string matcher]) dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too AC_SUBST([GREP]) ]) # _LT_DECL_OBJDUMP # -------------- # If we don't have a new enough Autoconf to choose the best objdump # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_OBJDUMP], [AC_CHECK_TOOL(OBJDUMP, objdump, false) test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) AC_SUBST([OBJDUMP]) ]) # _LT_DECL_DLLTOOL # ---------------- # Ensure DLLTOOL variable is set. m4_defun([_LT_DECL_DLLTOOL], [AC_CHECK_TOOL(DLLTOOL, dlltool, false) test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program]) AC_SUBST([DLLTOOL]) ]) # _LT_DECL_SED # ------------ # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. m4_defun([_LT_DECL_SED], [AC_PROG_SED test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" _LT_DECL([], [SED], [1], [A sed program that does not truncate output]) _LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], [Sed that helps us avoid accidentally triggering echo(1) options like -n]) ])# _LT_DECL_SED m4_ifndef([AC_PROG_SED], [ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_SED. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # m4_defun([AC_PROG_SED], [AC_MSG_CHECKING([for a sed that does not truncate output]) AC_CACHE_VAL(lt_cv_path_SED, [# Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done IFS=$as_save_IFS lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f $lt_ac_sed && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test $lt_ac_count -gt 10 && break lt_ac_count=`expr $lt_ac_count + 1` if test $lt_ac_count -gt $lt_ac_max; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done ]) SED=$lt_cv_path_SED AC_SUBST([SED]) AC_MSG_RESULT([$SED]) ])#AC_PROG_SED ])#m4_ifndef # Old name: AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_SED], []) # _LT_CHECK_SHELL_FEATURES # ------------------------ # Find out whether the shell is Bourne or XSI compatible, # or has some other useful features. m4_defun([_LT_CHECK_SHELL_FEATURES], [AC_MSG_CHECKING([whether the shell understands some XSI constructs]) # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,b/c, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes AC_MSG_RESULT([$xsi_shell]) _LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell']) AC_MSG_CHECKING([whether the shell understands "+="]) lt_shell_append=no ( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes AC_MSG_RESULT([$lt_shell_append]) _LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append']) if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi _LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac _LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl ])# _LT_CHECK_SHELL_FEATURES # _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY) # ------------------------------------------------------ # In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and # '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY. m4_defun([_LT_PROG_FUNCTION_REPLACE], [dnl { sed -e '/^$1 ()$/,/^} # $1 /c\ $1 ()\ {\ m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1]) } # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: ]) # _LT_PROG_REPLACE_SHELLFNS # ------------------------- # Replace existing portable implementations of several shell functions with # equivalent extended shell implementations where those features are available.. m4_defun([_LT_PROG_REPLACE_SHELLFNS], [if test x"$xsi_shell" = xyes; then _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac]) _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl func_basename_result="${1##*/}"]) _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac func_basename_result="${1##*/}"]) _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are # positional parameters, so assign one to ordinary parameter first. func_stripname_result=${3} func_stripname_result=${func_stripname_result#"${1}"} func_stripname_result=${func_stripname_result%"${2}"}]) _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl func_split_long_opt_name=${1%%=*} func_split_long_opt_arg=${1#*=}]) _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl func_split_short_opt_arg=${1#??} func_split_short_opt_name=${1%"$func_split_short_opt_arg"}]) _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl case ${1} in *.lo) func_lo2o_result=${1%.lo}.${objext} ;; *) func_lo2o_result=${1} ;; esac]) _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo]) _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))]) _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}]) fi if test x"$lt_shell_append" = xyes; then _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"]) _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl func_quote_for_eval "${2}" dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \ eval "${1}+=\\\\ \\$func_quote_for_eval_result"]) # Save a `func_append' function call where possible by direct use of '+=' sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: else # Save a `func_append' function call even when '+=' is not available sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$_lt_function_replace_fail" = x":"; then AC_MSG_WARN([Unable to substitute extended shell functions in $ofile]) fi ]) # _LT_PATH_CONVERSION_FUNCTIONS # ----------------------------- # Determine which file name conversion functions should be used by # func_to_host_file (and, implicitly, by func_to_host_path). These are needed # for certain cross-compile configurations and native mingw. m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_MSG_CHECKING([how to convert $build file names to $host format]) AC_CACHE_VAL(lt_cv_to_host_file_cmd, [case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac ]) to_host_file_cmd=$lt_cv_to_host_file_cmd AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) _LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], [0], [convert $build file names to $host format])dnl AC_MSG_CHECKING([how to convert $build file names to toolchain format]) AC_CACHE_VAL(lt_cv_to_tool_file_cmd, [#assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac ]) to_tool_file_cmd=$lt_cv_to_tool_file_cmd AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) _LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], [0], [convert $build files to toolchain format])dnl ])# _LT_PATH_CONVERSION_FUNCTIONS # Helper functions for option handling. -*- Autoconf -*- # # Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, # Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 7 ltoptions.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) # _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) # ------------------------------------------ m4_define([_LT_MANGLE_OPTION], [[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) # _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) # --------------------------------------- # Set option OPTION-NAME for macro MACRO-NAME, and if there is a # matching handler defined, dispatch to it. Other OPTION-NAMEs are # saved as a flag. m4_define([_LT_SET_OPTION], [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), _LT_MANGLE_DEFUN([$1], [$2]), [m4_warning([Unknown $1 option `$2'])])[]dnl ]) # _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) # ------------------------------------------------------------ # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. m4_define([_LT_IF_OPTION], [m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) # _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) # ------------------------------------------------------- # Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME # are set. m4_define([_LT_UNLESS_OPTIONS], [m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), [m4_define([$0_found])])])[]dnl m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 ])[]dnl ]) # _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) # ---------------------------------------- # OPTION-LIST is a space-separated list of Libtool options associated # with MACRO-NAME. If any OPTION has a matching handler declared with # LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about # the unknown option and exit. m4_defun([_LT_SET_OPTIONS], [# Set options m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [_LT_SET_OPTION([$1], _LT_Option)]) m4_if([$1],[LT_INIT],[ dnl dnl Simply set some default values (i.e off) if boolean options were not dnl specified: _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no ]) _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no ]) dnl dnl If no reference was made to various pairs of opposing options, then dnl we run the default mode handler for the pair. For example, if neither dnl `shared' nor `disable-shared' was passed, we enable building of shared dnl archives by default: _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], [_LT_ENABLE_FAST_INSTALL]) ]) ])# _LT_SET_OPTIONS # _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) # ----------------------------------------- m4_define([_LT_MANGLE_DEFUN], [[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) # LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) # ----------------------------------------------- m4_define([LT_OPTION_DEFINE], [m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl ])# LT_OPTION_DEFINE # dlopen # ------ LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes ]) AU_DEFUN([AC_LIBTOOL_DLOPEN], [_LT_SET_OPTION([LT_INIT], [dlopen]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `dlopen' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) # win32-dll # --------- # Declare package support for building win32 dll's. LT_OPTION_DEFINE([LT_INIT], [win32-dll], [enable_win32_dll=yes case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; esac test -z "$AS" && AS=as _LT_DECL([], [AS], [1], [Assembler program])dnl test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl ])# win32-dll AU_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_REQUIRE([AC_CANONICAL_HOST])dnl _LT_SET_OPTION([LT_INIT], [win32-dll]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `win32-dll' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) # _LT_ENABLE_SHARED([DEFAULT]) # ---------------------------- # implement the --enable-shared flag, and supports the `shared' and # `disable-shared' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_SHARED], [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([shared], [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) _LT_DECL([build_libtool_libs], [enable_shared], [0], [Whether or not to build shared libraries]) ])# _LT_ENABLE_SHARED LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) # Old names: AC_DEFUN([AC_ENABLE_SHARED], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) ]) AC_DEFUN([AC_DISABLE_SHARED], [_LT_SET_OPTION([LT_INIT], [disable-shared]) ]) AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_SHARED], []) dnl AC_DEFUN([AM_DISABLE_SHARED], []) # _LT_ENABLE_STATIC([DEFAULT]) # ---------------------------- # implement the --enable-static flag, and support the `static' and # `disable-static' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_STATIC], [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([static], [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_static=]_LT_ENABLE_STATIC_DEFAULT) _LT_DECL([build_old_libs], [enable_static], [0], [Whether or not to build static libraries]) ])# _LT_ENABLE_STATIC LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) # Old names: AC_DEFUN([AC_ENABLE_STATIC], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) ]) AC_DEFUN([AC_DISABLE_STATIC], [_LT_SET_OPTION([LT_INIT], [disable-static]) ]) AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_STATIC], []) dnl AC_DEFUN([AM_DISABLE_STATIC], []) # _LT_ENABLE_FAST_INSTALL([DEFAULT]) # ---------------------------------- # implement the --enable-fast-install flag, and support the `fast-install' # and `disable-fast-install' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_FAST_INSTALL], [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([fast-install], [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) _LT_DECL([fast_install], [enable_fast_install], [0], [Whether or not to optimize for fast installation])dnl ])# _LT_ENABLE_FAST_INSTALL LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) # Old names: AU_DEFUN([AC_ENABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `fast-install' option into LT_INIT's first parameter.]) ]) AU_DEFUN([AC_DISABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], [disable-fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `disable-fast-install' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) # _LT_WITH_PIC([MODE]) # -------------------- # implement the --with-pic flag, and support the `pic-only' and `no-pic' # LT_INIT options. # MODE is either `yes' or `no'. If omitted, it defaults to `both'. m4_define([_LT_WITH_PIC], [AC_ARG_WITH([pic], [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for lt_pkg in $withval; do IFS="$lt_save_ifs" if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS="$lt_save_ifs" ;; esac], [pic_mode=default]) test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl ])# _LT_WITH_PIC LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) # Old name: AU_DEFUN([AC_LIBTOOL_PICMODE], [_LT_SET_OPTION([LT_INIT], [pic-only]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `pic-only' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) m4_define([_LTDL_MODE], []) LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], [m4_define([_LTDL_MODE], [nonrecursive])]) LT_OPTION_DEFINE([LTDL_INIT], [recursive], [m4_define([_LTDL_MODE], [recursive])]) LT_OPTION_DEFINE([LTDL_INIT], [subproject], [m4_define([_LTDL_MODE], [subproject])]) m4_define([_LTDL_TYPE], []) LT_OPTION_DEFINE([LTDL_INIT], [installable], [m4_define([_LTDL_TYPE], [installable])]) LT_OPTION_DEFINE([LTDL_INIT], [convenience], [m4_define([_LTDL_TYPE], [convenience])]) # ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 6 ltsugar.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) # lt_join(SEP, ARG1, [ARG2...]) # ----------------------------- # Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their # associated separator. # Needed until we can rely on m4_join from Autoconf 2.62, since all earlier # versions in m4sugar had bugs. m4_define([lt_join], [m4_if([$#], [1], [], [$#], [2], [[$2]], [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) m4_define([_lt_join], [m4_if([$#$2], [2], [], [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) # lt_car(LIST) # lt_cdr(LIST) # ------------ # Manipulate m4 lists. # These macros are necessary as long as will still need to support # Autoconf-2.59 which quotes differently. m4_define([lt_car], [[$1]]) m4_define([lt_cdr], [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], [$#], 1, [], [m4_dquote(m4_shift($@))])]) m4_define([lt_unquote], $1) # lt_append(MACRO-NAME, STRING, [SEPARATOR]) # ------------------------------------------ # Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. # Note that neither SEPARATOR nor STRING are expanded; they are appended # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). # No SEPARATOR is output if MACRO-NAME was previously undefined (different # than defined and empty). # # This macro is needed until we can rely on Autoconf 2.62, since earlier # versions of m4sugar mistakenly expanded SEPARATOR but not STRING. m4_define([lt_append], [m4_define([$1], m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) # lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) # ---------------------------------------------------------- # Produce a SEP delimited list of all paired combinations of elements of # PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list # has the form PREFIXmINFIXSUFFIXn. # Needed until we can rely on m4_combine added in Autoconf 2.62. m4_define([lt_combine], [m4_if(m4_eval([$# > 3]), [1], [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl [[m4_foreach([_Lt_prefix], [$2], [m4_foreach([_Lt_suffix], ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) # ----------------------------------------------------------------------- # Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited # by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. m4_define([lt_if_append_uniq], [m4_ifdef([$1], [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], [lt_append([$1], [$2], [$3])$4], [$5])], [lt_append([$1], [$2], [$3])$4])]) # lt_dict_add(DICT, KEY, VALUE) # ----------------------------- m4_define([lt_dict_add], [m4_define([$1($2)], [$3])]) # lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) # -------------------------------------------- m4_define([lt_dict_add_subkey], [m4_define([$1($2:$3)], [$4])]) # lt_dict_fetch(DICT, KEY, [SUBKEY]) # ---------------------------------- m4_define([lt_dict_fetch], [m4_ifval([$3], m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) # lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) # ----------------------------------------------------------------- m4_define([lt_if_dict_fetch], [m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], [$5], [$6])]) # lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) # -------------------------------------------------------------- m4_define([lt_dict_filter], [m4_if([$5], [], [], [lt_join(m4_quote(m4_default([$4], [[, ]])), lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl ]) # ltversion.m4 -- version numbers -*- Autoconf -*- # # Copyright (C) 2004 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # @configure_input@ # serial 3337 ltversion.m4 # This file is part of GNU Libtool m4_define([LT_PACKAGE_VERSION], [2.4.2]) m4_define([LT_PACKAGE_REVISION], [1.3337]) AC_DEFUN([LTVERSION_VERSION], [macro_version='2.4.2' macro_revision='1.3337' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) # lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 5 lt~obsolete.m4 # These exist entirely to fool aclocal when bootstrapping libtool. # # In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) # which have later been changed to m4_define as they aren't part of the # exported API, or moved to Autoconf or Automake where they belong. # # The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN # in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us # using a macro with the same name in our local m4/libtool.m4 it'll # pull the old libtool.m4 in (it doesn't see our shiny new m4_define # and doesn't know about Autoconf macros at all.) # # So we provide this file, which has a silly filename so it's always # included after everything else. This provides aclocal with the # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything # because those macros already exist, or will be overwritten later. # We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. # # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. # Yes, that means every name once taken will need to remain here until # we give up compatibility with versions before 1.7, at which point # we need to keep only those names which we still refer to. # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- # serial 1 (pkg-config-0.24) # # Copyright © 2004 Scott James Remnant . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # PKG_PROG_PKG_CONFIG([MIN-VERSION]) # ---------------------------------- AC_DEFUN([PKG_PROG_PKG_CONFIG], [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) fi if test -n "$PKG_CONFIG"; then _pkg_min_version=m4_default([$1], [0.9.0]) AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) PKG_CONFIG="" fi fi[]dnl ])# PKG_PROG_PKG_CONFIG # PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) # # Check to see whether a particular set of modules exists. Similar # to PKG_CHECK_MODULES(), but does not set variables or print errors. # # Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) # only at the first occurence in configure.ac, so if the first place # it's called might be skipped (such as if it is within an "if", you # have to call PKG_CHECK_EXISTS manually # -------------------------------------------------------------- AC_DEFUN([PKG_CHECK_EXISTS], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl if test -n "$PKG_CONFIG" && \ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then m4_default([$2], [:]) m4_ifvaln([$3], [else $3])dnl fi]) # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) # --------------------------------------------- m4_define([_PKG_CONFIG], [if test -n "$$1"; then pkg_cv_[]$1="$$1" elif test -n "$PKG_CONFIG"; then PKG_CHECK_EXISTS([$3], [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes ], [pkg_failed=yes]) else pkg_failed=untried fi[]dnl ])# _PKG_CONFIG # _PKG_SHORT_ERRORS_SUPPORTED # ----------------------------- AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], [AC_REQUIRE([PKG_PROG_PKG_CONFIG]) if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi[]dnl ])# _PKG_SHORT_ERRORS_SUPPORTED # PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], # [ACTION-IF-NOT-FOUND]) # # # Note that if there is a possibility the first call to # PKG_CHECK_MODULES might not happen, you should be sure to include an # explicit call to PKG_PROG_PKG_CONFIG in your configure.ac # # # -------------------------------------------------------------- AC_DEFUN([PKG_CHECK_MODULES], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl pkg_failed=no AC_MSG_CHECKING([for $1]) _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) _PKG_CONFIG([$1][_LIBS], [libs], [$2]) m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS and $1[]_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details.]) if test $pkg_failed = yes; then AC_MSG_RESULT([no]) _PKG_SHORT_ERRORS_SUPPORTED if test $_pkg_short_errors_supported = yes; then $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` else $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD m4_default([$4], [AC_MSG_ERROR( [Package requirements ($2) were not met: $$1_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. _PKG_TEXT])[]dnl ]) elif test $pkg_failed = untried; then AC_MSG_RESULT([no]) m4_default([$4], [AC_MSG_FAILURE( [The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. _PKG_TEXT To get pkg-config, see .])[]dnl ]) else $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS $1[]_LIBS=$pkg_cv_[]$1[]_LIBS AC_MSG_RESULT([yes]) $3 fi[]dnl ])# PKG_CHECK_MODULES dnl xorg-macros.m4. Generated from xorg-macros.m4.in xorgversion.m4 by configure. dnl dnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. dnl dnl Permission is hereby granted, free of charge, to any person obtaining a dnl copy of this software and associated documentation files (the "Software"), dnl to deal in the Software without restriction, including without limitation dnl the rights to use, copy, modify, merge, publish, distribute, sublicense, dnl and/or sell copies of the Software, and to permit persons to whom the dnl Software is furnished to do so, subject to the following conditions: dnl dnl The above copyright notice and this permission notice (including the next dnl paragraph) shall be included in all copies or substantial portions of the dnl Software. dnl dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR dnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, dnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL dnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER dnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING dnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER dnl DEALINGS IN THE SOFTWARE. # XORG_MACROS_VERSION(required-version) # ------------------------------------- # Minimum version: 1.1.0 # # If you're using a macro added in Version 1.1 or newer, include this in # your configure.ac with the minimum required version, such as: # XORG_MACROS_VERSION(1.1) # # To ensure that this macro is defined, also add: # m4_ifndef([XORG_MACROS_VERSION], # [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])]) # # # See the "minimum version" comment for each macro you use to see what # version you require. m4_defun([XORG_MACROS_VERSION],[ m4_define([vers_have], [1.17]) m4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.]))) m4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.]))) m4_if(m4_cmp(maj_have, maj_needed), 0,, [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])]) m4_if(m4_version_compare(vers_have, [$1]), -1, [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])]) m4_undefine([vers_have]) m4_undefine([maj_have]) m4_undefine([maj_needed]) ]) # XORG_MACROS_VERSION # XORG_PROG_RAWCPP() # ------------------ # Minimum version: 1.0.0 # # Find cpp program and necessary flags for use in pre-processing text files # such as man pages and config files AC_DEFUN([XORG_PROG_RAWCPP],[ AC_REQUIRE([AC_PROG_CPP]) AC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib]) # Check for flag to avoid builtin definitions - assumes unix is predefined, # which is not the best choice for supporting other OS'es, but covers most # of the ones we need for now. AC_MSG_CHECKING([if $RAWCPP requires -undef]) AC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp redefine unix ?]])]) if test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then AC_MSG_RESULT([no]) else if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then RAWCPPFLAGS=-undef AC_MSG_RESULT([yes]) # under Cygwin unix is still defined even with -undef elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then RAWCPPFLAGS="-undef -ansi" AC_MSG_RESULT([yes, with -ansi]) else AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef. I don't know what to do.]) fi fi rm -f conftest.$ac_ext AC_MSG_CHECKING([if $RAWCPP requires -traditional]) AC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp preserve "whitespace"?]])]) if test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then AC_MSG_RESULT([no]) else if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then RAWCPPFLAGS="${RAWCPPFLAGS} -traditional" AC_MSG_RESULT([yes]) else AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional. I don't know what to do.]) fi fi rm -f conftest.$ac_ext AC_SUBST(RAWCPPFLAGS) ]) # XORG_PROG_RAWCPP # XORG_MANPAGE_SECTIONS() # ----------------------- # Minimum version: 1.0.0 # # Determine which sections man pages go in for the different man page types # on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files. # Not sure if there's any better way than just hardcoding by OS name. # Override default settings by setting environment variables # Added MAN_SUBSTS in version 1.8 # Added AC_PROG_SED in version 1.8 AC_DEFUN([XORG_MANPAGE_SECTIONS],[ AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AC_PROG_SED]) if test x$APP_MAN_SUFFIX = x ; then APP_MAN_SUFFIX=1 fi if test x$APP_MAN_DIR = x ; then APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)' fi if test x$LIB_MAN_SUFFIX = x ; then LIB_MAN_SUFFIX=3 fi if test x$LIB_MAN_DIR = x ; then LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)' fi if test x$FILE_MAN_SUFFIX = x ; then case $host_os in solaris*) FILE_MAN_SUFFIX=4 ;; *) FILE_MAN_SUFFIX=5 ;; esac fi if test x$FILE_MAN_DIR = x ; then FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)' fi if test x$MISC_MAN_SUFFIX = x ; then case $host_os in solaris*) MISC_MAN_SUFFIX=5 ;; *) MISC_MAN_SUFFIX=7 ;; esac fi if test x$MISC_MAN_DIR = x ; then MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)' fi if test x$DRIVER_MAN_SUFFIX = x ; then case $host_os in solaris*) DRIVER_MAN_SUFFIX=7 ;; *) DRIVER_MAN_SUFFIX=4 ;; esac fi if test x$DRIVER_MAN_DIR = x ; then DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)' fi if test x$ADMIN_MAN_SUFFIX = x ; then case $host_os in solaris*) ADMIN_MAN_SUFFIX=1m ;; *) ADMIN_MAN_SUFFIX=8 ;; esac fi if test x$ADMIN_MAN_DIR = x ; then ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)' fi AC_SUBST([APP_MAN_SUFFIX]) AC_SUBST([LIB_MAN_SUFFIX]) AC_SUBST([FILE_MAN_SUFFIX]) AC_SUBST([MISC_MAN_SUFFIX]) AC_SUBST([DRIVER_MAN_SUFFIX]) AC_SUBST([ADMIN_MAN_SUFFIX]) AC_SUBST([APP_MAN_DIR]) AC_SUBST([LIB_MAN_DIR]) AC_SUBST([FILE_MAN_DIR]) AC_SUBST([MISC_MAN_DIR]) AC_SUBST([DRIVER_MAN_DIR]) AC_SUBST([ADMIN_MAN_DIR]) XORG_MAN_PAGE="X Version 11" AC_SUBST([XORG_MAN_PAGE]) MAN_SUBSTS="\ -e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \ -e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \ -e 's|__xservername__|Xorg|g' \ -e 's|__xconfigfile__|xorg.conf|g' \ -e 's|__projectroot__|\$(prefix)|g' \ -e 's|__apploaddir__|\$(appdefaultdir)|g' \ -e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \ -e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \ -e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \ -e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \ -e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \ -e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'" AC_SUBST([MAN_SUBSTS]) ]) # XORG_MANPAGE_SECTIONS # XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION]) # ------------------------ # Minimum version: 1.7.0 # # Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent # provided by xorg-sgml-doctools, if installed. AC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[ AC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])]) XORG_SGML_PATH= PKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])], [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`], [m4_ifval([$1],[:], [if test x"$cross_compiling" != x"yes" ; then AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent], [XORG_SGML_PATH=$prefix/share/sgml]) fi]) ]) # Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing # the path and the name of the doc stylesheet if test "x$XORG_SGML_PATH" != "x" ; then AC_MSG_RESULT([$XORG_SGML_PATH]) STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11 XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl else AC_MSG_RESULT([no]) fi AC_SUBST(XORG_SGML_PATH) AC_SUBST(STYLESHEET_SRCDIR) AC_SUBST(XSL_STYLESHEET) AM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"]) ]) # XORG_CHECK_SGML_DOCTOOLS # XORG_CHECK_LINUXDOC # ------------------- # Minimum version: 1.0.0 # # Defines the variable MAKE_TEXT if the necessary tools and # files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt. # Whether or not the necessary tools and files are found can be checked # with the AM_CONDITIONAL "BUILD_LINUXDOC" AC_DEFUN([XORG_CHECK_LINUXDOC],[ AC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS]) AC_REQUIRE([XORG_WITH_PS2PDF]) AC_PATH_PROG(LINUXDOC, linuxdoc) AC_MSG_CHECKING([whether to build documentation]) if test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then BUILDDOC=yes else BUILDDOC=no fi AM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes]) AC_MSG_RESULT([$BUILDDOC]) AC_MSG_CHECKING([whether to build pdf documentation]) if test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then BUILDPDFDOC=yes else BUILDPDFDOC=no fi AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes]) AC_MSG_RESULT([$BUILDPDFDOC]) MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f" MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps" MAKE_PDF="$PS2PDF" MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B html --split=0" AC_SUBST(MAKE_TEXT) AC_SUBST(MAKE_PS) AC_SUBST(MAKE_PDF) AC_SUBST(MAKE_HTML) ]) # XORG_CHECK_LINUXDOC # XORG_CHECK_DOCBOOK # ------------------- # Minimum version: 1.0.0 # # Checks for the ability to build output formats from SGML DocBook source. # For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC" # indicates whether the necessary tools and files are found and, if set, # $(MAKE_XXX) blah.sgml will produce blah.xxx. AC_DEFUN([XORG_CHECK_DOCBOOK],[ AC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS]) BUILDTXTDOC=no BUILDPDFDOC=no BUILDPSDOC=no BUILDHTMLDOC=no AC_PATH_PROG(DOCBOOKPS, docbook2ps) AC_PATH_PROG(DOCBOOKPDF, docbook2pdf) AC_PATH_PROG(DOCBOOKHTML, docbook2html) AC_PATH_PROG(DOCBOOKTXT, docbook2txt) AC_MSG_CHECKING([whether to build text documentation]) if test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x && test x$BUILD_TXTDOC != xno; then BUILDTXTDOC=yes fi AM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes]) AC_MSG_RESULT([$BUILDTXTDOC]) AC_MSG_CHECKING([whether to build PDF documentation]) if test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x && test x$BUILD_PDFDOC != xno; then BUILDPDFDOC=yes fi AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes]) AC_MSG_RESULT([$BUILDPDFDOC]) AC_MSG_CHECKING([whether to build PostScript documentation]) if test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x && test x$BUILD_PSDOC != xno; then BUILDPSDOC=yes fi AM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes]) AC_MSG_RESULT([$BUILDPSDOC]) AC_MSG_CHECKING([whether to build HTML documentation]) if test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x && test x$BUILD_HTMLDOC != xno; then BUILDHTMLDOC=yes fi AM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes]) AC_MSG_RESULT([$BUILDHTMLDOC]) MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT" MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS" MAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF" MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML" AC_SUBST(MAKE_TEXT) AC_SUBST(MAKE_PS) AC_SUBST(MAKE_PDF) AC_SUBST(MAKE_HTML) ]) # XORG_CHECK_DOCBOOK # XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT]) # ---------------- # Minimum version: 1.5.0 # Minimum version for optional DEFAULT argument: 1.11.0 # # Documentation tools are not always available on all platforms and sometimes # not at the appropriate level. This macro enables a module to test for the # presence of the tool and obtain it's path in separate variables. Coupled with # the --with-xmlto option, it allows maximum flexibilty in making decisions # as whether or not to use the xmlto package. When DEFAULT is not specified, # --with-xmlto assumes 'auto'. # # Interface to module: # HAVE_XMLTO: used in makefiles to conditionally generate documentation # XMLTO: returns the path of the xmlto program found # returns the path set by the user in the environment # --with-xmlto: 'yes' user instructs the module to use xmlto # 'no' user instructs the module not to use xmlto # # Added in version 1.10.0 # HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation # xmlto for text output requires either lynx, links, or w3m browsers # # If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path. # AC_DEFUN([XORG_WITH_XMLTO],[ AC_ARG_VAR([XMLTO], [Path to xmlto command]) m4_define([_defopt], m4_default([$2], [auto])) AC_ARG_WITH(xmlto, AS_HELP_STRING([--with-xmlto], [Use xmlto to regenerate documentation (default: ]_defopt[)]), [use_xmlto=$withval], [use_xmlto=]_defopt) m4_undefine([_defopt]) if test "x$use_xmlto" = x"auto"; then AC_PATH_PROG([XMLTO], [xmlto]) if test "x$XMLTO" = "x"; then AC_MSG_WARN([xmlto not found - documentation targets will be skipped]) have_xmlto=no else have_xmlto=yes fi elif test "x$use_xmlto" = x"yes" ; then AC_PATH_PROG([XMLTO], [xmlto]) if test "x$XMLTO" = "x"; then AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH]) fi have_xmlto=yes elif test "x$use_xmlto" = x"no" ; then if test "x$XMLTO" != "x"; then AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified]) fi have_xmlto=no else AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no']) fi # Test for a minimum version of xmlto, if provided. m4_ifval([$1], [if test "$have_xmlto" = yes; then # scrape the xmlto version AC_MSG_CHECKING([the xmlto version]) xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3` AC_MSG_RESULT([$xmlto_version]) AS_VERSION_COMPARE([$xmlto_version], [$1], [if test "x$use_xmlto" = xauto; then AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed]) have_xmlto=no else AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed]) fi]) fi]) # Test for the ability of xmlto to generate a text target have_xmlto_text=no cat > conftest.xml << "EOF" EOF AS_IF([test "$have_xmlto" = yes], [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1], [have_xmlto_text=yes], [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])]) rm -f conftest.xml AM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes]) AM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes]) ]) # XORG_WITH_XMLTO # XORG_WITH_XSLTPROC([MIN-VERSION], [DEFAULT]) # -------------------------------------------- # Minimum version: 1.12.0 # Minimum version for optional DEFAULT argument: 1.12.0 # # XSLT (Extensible Stylesheet Language Transformations) is a declarative, # XML-based language used for the transformation of XML documents. # The xsltproc command line tool is for applying XSLT stylesheets to XML documents. # It is used under the cover by xmlto to generate html files from DocBook/XML. # The XSLT processor is often used as a standalone tool for transformations. # It should not be assumed that this tool is used only to work with documnetation. # When DEFAULT is not specified, --with-xsltproc assumes 'auto'. # # Interface to module: # HAVE_XSLTPROC: used in makefiles to conditionally generate documentation # XSLTPROC: returns the path of the xsltproc program found # returns the path set by the user in the environment # --with-xsltproc: 'yes' user instructs the module to use xsltproc # 'no' user instructs the module not to use xsltproc # have_xsltproc: returns yes if xsltproc found in PATH or no # # If the user sets the value of XSLTPROC, AC_PATH_PROG skips testing the path. # AC_DEFUN([XORG_WITH_XSLTPROC],[ AC_ARG_VAR([XSLTPROC], [Path to xsltproc command]) # Preserves the interface, should it be implemented later m4_ifval([$1], [m4_warn([syntax], [Checking for xsltproc MIN-VERSION is not implemented])]) m4_define([_defopt], m4_default([$2], [auto])) AC_ARG_WITH(xsltproc, AS_HELP_STRING([--with-xsltproc], [Use xsltproc for the transformation of XML documents (default: ]_defopt[)]), [use_xsltproc=$withval], [use_xsltproc=]_defopt) m4_undefine([_defopt]) if test "x$use_xsltproc" = x"auto"; then AC_PATH_PROG([XSLTPROC], [xsltproc]) if test "x$XSLTPROC" = "x"; then AC_MSG_WARN([xsltproc not found - cannot transform XML documents]) have_xsltproc=no else have_xsltproc=yes fi elif test "x$use_xsltproc" = x"yes" ; then AC_PATH_PROG([XSLTPROC], [xsltproc]) if test "x$XSLTPROC" = "x"; then AC_MSG_ERROR([--with-xsltproc=yes specified but xsltproc not found in PATH]) fi have_xsltproc=yes elif test "x$use_xsltproc" = x"no" ; then if test "x$XSLTPROC" != "x"; then AC_MSG_WARN([ignoring XSLTPROC environment variable since --with-xsltproc=no was specified]) fi have_xsltproc=no else AC_MSG_ERROR([--with-xsltproc expects 'yes' or 'no']) fi AM_CONDITIONAL([HAVE_XSLTPROC], [test "$have_xsltproc" = yes]) ]) # XORG_WITH_XSLTPROC # XORG_WITH_PERL([MIN-VERSION], [DEFAULT]) # ---------------------------------------- # Minimum version: 1.15.0 # # PERL (Practical Extraction and Report Language) is a language optimized for # scanning arbitrary text files, extracting information from those text files, # and printing reports based on that information. # # When DEFAULT is not specified, --with-perl assumes 'auto'. # # Interface to module: # HAVE_PERL: used in makefiles to conditionally scan text files # PERL: returns the path of the perl program found # returns the path set by the user in the environment # --with-perl: 'yes' user instructs the module to use perl # 'no' user instructs the module not to use perl # have_perl: returns yes if perl found in PATH or no # # If the user sets the value of PERL, AC_PATH_PROG skips testing the path. # AC_DEFUN([XORG_WITH_PERL],[ AC_ARG_VAR([PERL], [Path to perl command]) # Preserves the interface, should it be implemented later m4_ifval([$1], [m4_warn([syntax], [Checking for perl MIN-VERSION is not implemented])]) m4_define([_defopt], m4_default([$2], [auto])) AC_ARG_WITH(perl, AS_HELP_STRING([--with-perl], [Use perl for extracting information from files (default: ]_defopt[)]), [use_perl=$withval], [use_perl=]_defopt) m4_undefine([_defopt]) if test "x$use_perl" = x"auto"; then AC_PATH_PROG([PERL], [perl]) if test "x$PERL" = "x"; then AC_MSG_WARN([perl not found - cannot extract information and report]) have_perl=no else have_perl=yes fi elif test "x$use_perl" = x"yes" ; then AC_PATH_PROG([PERL], [perl]) if test "x$PERL" = "x"; then AC_MSG_ERROR([--with-perl=yes specified but perl not found in PATH]) fi have_perl=yes elif test "x$use_perl" = x"no" ; then if test "x$PERL" != "x"; then AC_MSG_WARN([ignoring PERL environment variable since --with-perl=no was specified]) fi have_perl=no else AC_MSG_ERROR([--with-perl expects 'yes' or 'no']) fi AM_CONDITIONAL([HAVE_PERL], [test "$have_perl" = yes]) ]) # XORG_WITH_PERL # XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT]) # ---------------- # Minimum version: 1.5.0 # Minimum version for optional DEFAULT argument: 1.11.0 # # Documentation tools are not always available on all platforms and sometimes # not at the appropriate level. This macro enables a module to test for the # presence of the tool and obtain it's path in separate variables. Coupled with # the --with-asciidoc option, it allows maximum flexibilty in making decisions # as whether or not to use the asciidoc package. When DEFAULT is not specified, # --with-asciidoc assumes 'auto'. # # Interface to module: # HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation # ASCIIDOC: returns the path of the asciidoc program found # returns the path set by the user in the environment # --with-asciidoc: 'yes' user instructs the module to use asciidoc # 'no' user instructs the module not to use asciidoc # # If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path. # AC_DEFUN([XORG_WITH_ASCIIDOC],[ AC_ARG_VAR([ASCIIDOC], [Path to asciidoc command]) m4_define([_defopt], m4_default([$2], [auto])) AC_ARG_WITH(asciidoc, AS_HELP_STRING([--with-asciidoc], [Use asciidoc to regenerate documentation (default: ]_defopt[)]), [use_asciidoc=$withval], [use_asciidoc=]_defopt) m4_undefine([_defopt]) if test "x$use_asciidoc" = x"auto"; then AC_PATH_PROG([ASCIIDOC], [asciidoc]) if test "x$ASCIIDOC" = "x"; then AC_MSG_WARN([asciidoc not found - documentation targets will be skipped]) have_asciidoc=no else have_asciidoc=yes fi elif test "x$use_asciidoc" = x"yes" ; then AC_PATH_PROG([ASCIIDOC], [asciidoc]) if test "x$ASCIIDOC" = "x"; then AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH]) fi have_asciidoc=yes elif test "x$use_asciidoc" = x"no" ; then if test "x$ASCIIDOC" != "x"; then AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified]) fi have_asciidoc=no else AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no']) fi m4_ifval([$1], [if test "$have_asciidoc" = yes; then # scrape the asciidoc version AC_MSG_CHECKING([the asciidoc version]) asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2` AC_MSG_RESULT([$asciidoc_version]) AS_VERSION_COMPARE([$asciidoc_version], [$1], [if test "x$use_asciidoc" = xauto; then AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed]) have_asciidoc=no else AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed]) fi]) fi]) AM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes]) ]) # XORG_WITH_ASCIIDOC # XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT]) # -------------------------------- # Minimum version: 1.5.0 # Minimum version for optional DEFAULT argument: 1.11.0 # # Documentation tools are not always available on all platforms and sometimes # not at the appropriate level. This macro enables a module to test for the # presence of the tool and obtain it's path in separate variables. Coupled with # the --with-doxygen option, it allows maximum flexibilty in making decisions # as whether or not to use the doxygen package. When DEFAULT is not specified, # --with-doxygen assumes 'auto'. # # Interface to module: # HAVE_DOXYGEN: used in makefiles to conditionally generate documentation # DOXYGEN: returns the path of the doxygen program found # returns the path set by the user in the environment # --with-doxygen: 'yes' user instructs the module to use doxygen # 'no' user instructs the module not to use doxygen # # If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path. # AC_DEFUN([XORG_WITH_DOXYGEN],[ AC_ARG_VAR([DOXYGEN], [Path to doxygen command]) m4_define([_defopt], m4_default([$2], [auto])) AC_ARG_WITH(doxygen, AS_HELP_STRING([--with-doxygen], [Use doxygen to regenerate documentation (default: ]_defopt[)]), [use_doxygen=$withval], [use_doxygen=]_defopt) m4_undefine([_defopt]) if test "x$use_doxygen" = x"auto"; then AC_PATH_PROG([DOXYGEN], [doxygen]) if test "x$DOXYGEN" = "x"; then AC_MSG_WARN([doxygen not found - documentation targets will be skipped]) have_doxygen=no else have_doxygen=yes fi elif test "x$use_doxygen" = x"yes" ; then AC_PATH_PROG([DOXYGEN], [doxygen]) if test "x$DOXYGEN" = "x"; then AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH]) fi have_doxygen=yes elif test "x$use_doxygen" = x"no" ; then if test "x$DOXYGEN" != "x"; then AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified]) fi have_doxygen=no else AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no']) fi m4_ifval([$1], [if test "$have_doxygen" = yes; then # scrape the doxygen version AC_MSG_CHECKING([the doxygen version]) doxygen_version=`$DOXYGEN --version 2>/dev/null` AC_MSG_RESULT([$doxygen_version]) AS_VERSION_COMPARE([$doxygen_version], [$1], [if test "x$use_doxygen" = xauto; then AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed]) have_doxygen=no else AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed]) fi]) fi]) AM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes]) ]) # XORG_WITH_DOXYGEN # XORG_WITH_GROFF([DEFAULT]) # ---------------- # Minimum version: 1.6.0 # Minimum version for optional DEFAULT argument: 1.11.0 # # Documentation tools are not always available on all platforms and sometimes # not at the appropriate level. This macro enables a module to test for the # presence of the tool and obtain it's path in separate variables. Coupled with # the --with-groff option, it allows maximum flexibilty in making decisions # as whether or not to use the groff package. When DEFAULT is not specified, # --with-groff assumes 'auto'. # # Interface to module: # HAVE_GROFF: used in makefiles to conditionally generate documentation # HAVE_GROFF_MM: the memorandum macros (-mm) package # HAVE_GROFF_MS: the -ms macros package # GROFF: returns the path of the groff program found # returns the path set by the user in the environment # --with-groff: 'yes' user instructs the module to use groff # 'no' user instructs the module not to use groff # # Added in version 1.9.0: # HAVE_GROFF_HTML: groff has dependencies to output HTML format: # pnmcut pnmcrop pnmtopng pnmtops from the netpbm package. # psselect from the psutils package. # the ghostcript package. Refer to the grohtml man pages # # If the user sets the value of GROFF, AC_PATH_PROG skips testing the path. # # OS and distros often splits groff in a basic and full package, the former # having the groff program and the later having devices, fonts and macros # Checking for the groff executable is not enough. # # If macros are missing, we cannot assume that groff is useless, so we don't # unset HAVE_GROFF or GROFF env variables. # HAVE_GROFF_?? can never be true while HAVE_GROFF is false. # AC_DEFUN([XORG_WITH_GROFF],[ AC_ARG_VAR([GROFF], [Path to groff command]) m4_define([_defopt], m4_default([$1], [auto])) AC_ARG_WITH(groff, AS_HELP_STRING([--with-groff], [Use groff to regenerate documentation (default: ]_defopt[)]), [use_groff=$withval], [use_groff=]_defopt) m4_undefine([_defopt]) if test "x$use_groff" = x"auto"; then AC_PATH_PROG([GROFF], [groff]) if test "x$GROFF" = "x"; then AC_MSG_WARN([groff not found - documentation targets will be skipped]) have_groff=no else have_groff=yes fi elif test "x$use_groff" = x"yes" ; then AC_PATH_PROG([GROFF], [groff]) if test "x$GROFF" = "x"; then AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH]) fi have_groff=yes elif test "x$use_groff" = x"no" ; then if test "x$GROFF" != "x"; then AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified]) fi have_groff=no else AC_MSG_ERROR([--with-groff expects 'yes' or 'no']) fi # We have groff, test for the presence of the macro packages if test "x$have_groff" = x"yes"; then AC_MSG_CHECKING([for ${GROFF} -ms macros]) if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then groff_ms_works=yes else groff_ms_works=no fi AC_MSG_RESULT([$groff_ms_works]) AC_MSG_CHECKING([for ${GROFF} -mm macros]) if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then groff_mm_works=yes else groff_mm_works=no fi AC_MSG_RESULT([$groff_mm_works]) fi # We have groff, test for HTML dependencies, one command per package if test "x$have_groff" = x"yes"; then AC_PATH_PROGS(GS_PATH, [gs gswin32c]) AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng]) AC_PATH_PROG(PSSELECT_PATH, [psselect]) if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then have_groff_html=yes else have_groff_html=no AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages]) fi fi # Set Automake conditionals for Makefiles AM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes]) AM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes]) AM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes]) AM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes]) ]) # XORG_WITH_GROFF # XORG_WITH_FOP([MIN-VERSION], [DEFAULT]) # --------------------------------------- # Minimum version: 1.6.0 # Minimum version for optional DEFAULT argument: 1.11.0 # Minimum version for optional MIN-VERSION argument: 1.15.0 # # Documentation tools are not always available on all platforms and sometimes # not at the appropriate level. This macro enables a module to test for the # presence of the tool and obtain it's path in separate variables. Coupled with # the --with-fop option, it allows maximum flexibilty in making decisions # as whether or not to use the fop package. When DEFAULT is not specified, # --with-fop assumes 'auto'. # # Interface to module: # HAVE_FOP: used in makefiles to conditionally generate documentation # FOP: returns the path of the fop program found # returns the path set by the user in the environment # --with-fop: 'yes' user instructs the module to use fop # 'no' user instructs the module not to use fop # # If the user sets the value of FOP, AC_PATH_PROG skips testing the path. # AC_DEFUN([XORG_WITH_FOP],[ AC_ARG_VAR([FOP], [Path to fop command]) m4_define([_defopt], m4_default([$2], [auto])) AC_ARG_WITH(fop, AS_HELP_STRING([--with-fop], [Use fop to regenerate documentation (default: ]_defopt[)]), [use_fop=$withval], [use_fop=]_defopt) m4_undefine([_defopt]) if test "x$use_fop" = x"auto"; then AC_PATH_PROG([FOP], [fop]) if test "x$FOP" = "x"; then AC_MSG_WARN([fop not found - documentation targets will be skipped]) have_fop=no else have_fop=yes fi elif test "x$use_fop" = x"yes" ; then AC_PATH_PROG([FOP], [fop]) if test "x$FOP" = "x"; then AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH]) fi have_fop=yes elif test "x$use_fop" = x"no" ; then if test "x$FOP" != "x"; then AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified]) fi have_fop=no else AC_MSG_ERROR([--with-fop expects 'yes' or 'no']) fi # Test for a minimum version of fop, if provided. m4_ifval([$1], [if test "$have_fop" = yes; then # scrape the fop version AC_MSG_CHECKING([for fop minimum version]) fop_version=`$FOP -version 2>/dev/null | cut -d' ' -f3` AC_MSG_RESULT([$fop_version]) AS_VERSION_COMPARE([$fop_version], [$1], [if test "x$use_fop" = xauto; then AC_MSG_WARN([fop version $fop_version found, but $1 needed]) have_fop=no else AC_MSG_ERROR([fop version $fop_version found, but $1 needed]) fi]) fi]) AM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes]) ]) # XORG_WITH_FOP # XORG_WITH_PS2PDF([DEFAULT]) # ---------------- # Minimum version: 1.6.0 # Minimum version for optional DEFAULT argument: 1.11.0 # # Documentation tools are not always available on all platforms and sometimes # not at the appropriate level. This macro enables a module to test for the # presence of the tool and obtain it's path in separate variables. Coupled with # the --with-ps2pdf option, it allows maximum flexibilty in making decisions # as whether or not to use the ps2pdf package. When DEFAULT is not specified, # --with-ps2pdf assumes 'auto'. # # Interface to module: # HAVE_PS2PDF: used in makefiles to conditionally generate documentation # PS2PDF: returns the path of the ps2pdf program found # returns the path set by the user in the environment # --with-ps2pdf: 'yes' user instructs the module to use ps2pdf # 'no' user instructs the module not to use ps2pdf # # If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path. # AC_DEFUN([XORG_WITH_PS2PDF],[ AC_ARG_VAR([PS2PDF], [Path to ps2pdf command]) m4_define([_defopt], m4_default([$1], [auto])) AC_ARG_WITH(ps2pdf, AS_HELP_STRING([--with-ps2pdf], [Use ps2pdf to regenerate documentation (default: ]_defopt[)]), [use_ps2pdf=$withval], [use_ps2pdf=]_defopt) m4_undefine([_defopt]) if test "x$use_ps2pdf" = x"auto"; then AC_PATH_PROG([PS2PDF], [ps2pdf]) if test "x$PS2PDF" = "x"; then AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped]) have_ps2pdf=no else have_ps2pdf=yes fi elif test "x$use_ps2pdf" = x"yes" ; then AC_PATH_PROG([PS2PDF], [ps2pdf]) if test "x$PS2PDF" = "x"; then AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH]) fi have_ps2pdf=yes elif test "x$use_ps2pdf" = x"no" ; then if test "x$PS2PDF" != "x"; then AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified]) fi have_ps2pdf=no else AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no']) fi AM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes]) ]) # XORG_WITH_PS2PDF # XORG_ENABLE_DOCS (enable_docs=yes) # ---------------- # Minimum version: 1.6.0 # # Documentation tools are not always available on all platforms and sometimes # not at the appropriate level. This macro enables a builder to skip all # documentation targets except traditional man pages. # Combined with the specific tool checking macros XORG_WITH_*, it provides # maximum flexibilty in controlling documentation building. # Refer to: # XORG_WITH_XMLTO --with-xmlto # XORG_WITH_ASCIIDOC --with-asciidoc # XORG_WITH_DOXYGEN --with-doxygen # XORG_WITH_FOP --with-fop # XORG_WITH_GROFF --with-groff # XORG_WITH_PS2PDF --with-ps2pdf # # Interface to module: # ENABLE_DOCS: used in makefiles to conditionally generate documentation # --enable-docs: 'yes' user instructs the module to generate docs # 'no' user instructs the module not to generate docs # parm1: specify the default value, yes or no. # AC_DEFUN([XORG_ENABLE_DOCS],[ m4_define([docs_default], m4_default([$1], [yes])) AC_ARG_ENABLE(docs, AS_HELP_STRING([--enable-docs], [Enable building the documentation (default: ]docs_default[)]), [build_docs=$enableval], [build_docs=]docs_default) m4_undefine([docs_default]) AM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes]) AC_MSG_CHECKING([whether to build documentation]) AC_MSG_RESULT([$build_docs]) ]) # XORG_ENABLE_DOCS # XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes) # ---------------- # Minimum version: 1.6.0 # # This macro enables a builder to skip all developer documentation. # Combined with the specific tool checking macros XORG_WITH_*, it provides # maximum flexibilty in controlling documentation building. # Refer to: # XORG_WITH_XMLTO --with-xmlto # XORG_WITH_ASCIIDOC --with-asciidoc # XORG_WITH_DOXYGEN --with-doxygen # XORG_WITH_FOP --with-fop # XORG_WITH_GROFF --with-groff # XORG_WITH_PS2PDF --with-ps2pdf # # Interface to module: # ENABLE_DEVEL_DOCS: used in makefiles to conditionally generate developer docs # --enable-devel-docs: 'yes' user instructs the module to generate developer docs # 'no' user instructs the module not to generate developer docs # parm1: specify the default value, yes or no. # AC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[ m4_define([devel_default], m4_default([$1], [yes])) AC_ARG_ENABLE(devel-docs, AS_HELP_STRING([--enable-devel-docs], [Enable building the developer documentation (default: ]devel_default[)]), [build_devel_docs=$enableval], [build_devel_docs=]devel_default) m4_undefine([devel_default]) AM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes]) AC_MSG_CHECKING([whether to build developer documentation]) AC_MSG_RESULT([$build_devel_docs]) ]) # XORG_ENABLE_DEVEL_DOCS # XORG_ENABLE_SPECS (enable_specs=yes) # ---------------- # Minimum version: 1.6.0 # # This macro enables a builder to skip all functional specification targets. # Combined with the specific tool checking macros XORG_WITH_*, it provides # maximum flexibilty in controlling documentation building. # Refer to: # XORG_WITH_XMLTO --with-xmlto # XORG_WITH_ASCIIDOC --with-asciidoc # XORG_WITH_DOXYGEN --with-doxygen # XORG_WITH_FOP --with-fop # XORG_WITH_GROFF --with-groff # XORG_WITH_PS2PDF --with-ps2pdf # # Interface to module: # ENABLE_SPECS: used in makefiles to conditionally generate specs # --enable-specs: 'yes' user instructs the module to generate specs # 'no' user instructs the module not to generate specs # parm1: specify the default value, yes or no. # AC_DEFUN([XORG_ENABLE_SPECS],[ m4_define([spec_default], m4_default([$1], [yes])) AC_ARG_ENABLE(specs, AS_HELP_STRING([--enable-specs], [Enable building the specs (default: ]spec_default[)]), [build_specs=$enableval], [build_specs=]spec_default) m4_undefine([spec_default]) AM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes]) AC_MSG_CHECKING([whether to build functional specifications]) AC_MSG_RESULT([$build_specs]) ]) # XORG_ENABLE_SPECS # XORG_ENABLE_UNIT_TESTS (enable_unit_tests=auto) # ---------------------------------------------- # Minimum version: 1.13.0 # # This macro enables a builder to enable/disable unit testing # It makes no assumption about the test cases implementation # Test cases may or may not use Automake "Support for test suites" # They may or may not use the software utility library GLib # # When used in conjunction with XORG_WITH_GLIB, use both AM_CONDITIONAL # ENABLE_UNIT_TESTS and HAVE_GLIB. Not all unit tests may use glib. # The variable enable_unit_tests is used by other macros in this file. # # Interface to module: # ENABLE_UNIT_TESTS: used in makefiles to conditionally build tests # enable_unit_tests: used in configure.ac for additional configuration # --enable-unit-tests: 'yes' user instructs the module to build tests # 'no' user instructs the module not to build tests # parm1: specify the default value, yes or no. # AC_DEFUN([XORG_ENABLE_UNIT_TESTS],[ AC_BEFORE([$0], [XORG_WITH_GLIB]) AC_BEFORE([$0], [XORG_LD_WRAP]) AC_REQUIRE([XORG_MEMORY_CHECK_FLAGS]) m4_define([_defopt], m4_default([$1], [auto])) AC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests], [Enable building unit test cases (default: ]_defopt[)]), [enable_unit_tests=$enableval], [enable_unit_tests=]_defopt) m4_undefine([_defopt]) AM_CONDITIONAL(ENABLE_UNIT_TESTS, [test "x$enable_unit_tests" != xno]) AC_MSG_CHECKING([whether to build unit test cases]) AC_MSG_RESULT([$enable_unit_tests]) ]) # XORG_ENABLE_UNIT_TESTS # XORG_ENABLE_INTEGRATION_TESTS (enable_unit_tests=auto) # ------------------------------------------------------ # Minimum version: 1.17.0 # # This macro enables a builder to enable/disable integration testing # It makes no assumption about the test cases' implementation # Test cases may or may not use Automake "Support for test suites" # # Please see XORG_ENABLE_UNIT_TESTS for unit test support. Unit test support # usually requires less dependencies and may be built and run under less # stringent environments than integration tests. # # Interface to module: # ENABLE_INTEGRATION_TESTS: used in makefiles to conditionally build tests # enable_integration_tests: used in configure.ac for additional configuration # --enable-integration-tests: 'yes' user instructs the module to build tests # 'no' user instructs the module not to build tests # parm1: specify the default value, yes or no. # AC_DEFUN([XORG_ENABLE_INTEGRATION_TESTS],[ AC_REQUIRE([XORG_MEMORY_CHECK_FLAGS]) m4_define([_defopt], m4_default([$1], [auto])) AC_ARG_ENABLE(integration-tests, AS_HELP_STRING([--enable-integration-tests], [Enable building integration test cases (default: ]_defopt[)]), [enable_integration_tests=$enableval], [enable_integration_tests=]_defopt) m4_undefine([_defopt]) AM_CONDITIONAL([ENABLE_INTEGRATION_TESTS], [test "x$enable_integration_tests" != xno]) AC_MSG_CHECKING([whether to build unit test cases]) AC_MSG_RESULT([$enable_integration_tests]) ]) # XORG_ENABLE_INTEGRATION_TESTS # XORG_WITH_GLIB([MIN-VERSION], [DEFAULT]) # ---------------------------------------- # Minimum version: 1.13.0 # # GLib is a library which provides advanced data structures and functions. # This macro enables a module to test for the presence of Glib. # # When used with ENABLE_UNIT_TESTS, it is assumed GLib is used for unit testing. # Otherwise the value of $enable_unit_tests is blank. # # Please see XORG_ENABLE_INTEGRATION_TESTS for integration test support. Unit # test support usually requires less dependencies and may be built and run under # less stringent environments than integration tests. # # Interface to module: # HAVE_GLIB: used in makefiles to conditionally build targets # with_glib: used in configure.ac to know if GLib has been found # --with-glib: 'yes' user instructs the module to use glib # 'no' user instructs the module not to use glib # AC_DEFUN([XORG_WITH_GLIB],[ AC_REQUIRE([PKG_PROG_PKG_CONFIG]) m4_define([_defopt], m4_default([$2], [auto])) AC_ARG_WITH(glib, AS_HELP_STRING([--with-glib], [Use GLib library for unit testing (default: ]_defopt[)]), [with_glib=$withval], [with_glib=]_defopt) m4_undefine([_defopt]) have_glib=no # Do not probe GLib if user explicitly disabled unit testing if test "x$enable_unit_tests" != x"no"; then # Do not probe GLib if user explicitly disabled it if test "x$with_glib" != x"no"; then m4_ifval( [$1], [PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $1], [have_glib=yes], [have_glib=no])], [PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])] ) fi fi # Not having GLib when unit testing has been explicitly requested is an error if test "x$enable_unit_tests" = x"yes"; then if test "x$have_glib" = x"no"; then AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found]) fi fi # Having unit testing disabled when GLib has been explicitly requested is an error if test "x$enable_unit_tests" = x"no"; then if test "x$with_glib" = x"yes"; then AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found]) fi fi # Not having GLib when it has been explicitly requested is an error if test "x$with_glib" = x"yes"; then if test "x$have_glib" = x"no"; then AC_MSG_ERROR([--with-glib=yes specified but glib-2.0 not found]) fi fi AM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes]) ]) # XORG_WITH_GLIB # XORG_LD_WRAP([required|optional]) # --------------------------------- # Minimum version: 1.13.0 # # Check if linker supports -wrap, passed via compiler flags # # When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing. # Otherwise the value of $enable_unit_tests is blank. # # Argument added in 1.16.0 - default is "required", to match existing behavior # of returning an error if enable_unit_tests is yes, and ld -wrap is not # available, an argument of "optional" allows use when some unit tests require # ld -wrap and others do not. # AC_DEFUN([XORG_LD_WRAP],[ XORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no], [AC_LANG_PROGRAM([#include void __wrap_exit(int status) { return; }], [exit(0);])]) # Not having ld wrap when unit testing has been explicitly requested is an error if test "x$enable_unit_tests" = x"yes" -a "x$1" != "xoptional"; then if test "x$have_ld_wrap" = x"no"; then AC_MSG_ERROR([--enable-unit-tests=yes specified but ld -wrap support is not available]) fi fi AM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes]) # ]) # XORG_LD_WRAP # XORG_CHECK_LINKER_FLAGS # ----------------------- # SYNOPSIS # # XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE], [PROGRAM-SOURCE]) # # DESCRIPTION # # Check whether the given linker FLAGS work with the current language's # linker, or whether they give an error. # # ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on # success/failure. # # PROGRAM-SOURCE is the program source to link with, if needed # # NOTE: Based on AX_CHECK_COMPILER_FLAGS. # # LICENSE # # Copyright (c) 2009 Mike Frysinger # Copyright (c) 2009 Steven G. Johnson # Copyright (c) 2009 Matteo Frigo # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation, either version 3 of the License, or (at your # option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General # Public License for more details. # # You should have received a copy of the GNU General Public License along # with this program. If not, see . # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure # scripts that are the output of Autoconf when processing the Macro. You # need not follow the terms of the GNU General Public License when using # or distributing such scripts, even though portions of the text of the # Macro appear in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf # Macro released by the Autoconf Archive. When you make and distribute a # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well.# AC_DEFUN([XORG_CHECK_LINKER_FLAGS], [AC_MSG_CHECKING([whether the linker accepts $1]) dnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname: AS_LITERAL_IF([$1], [AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_[$1]), [ ax_save_FLAGS=$LDFLAGS LDFLAGS="$1" AC_LINK_IFELSE([m4_default([$4],[AC_LANG_PROGRAM()])], AS_TR_SH(xorg_cv_linker_flags_[$1])=yes, AS_TR_SH(xorg_cv_linker_flags_[$1])=no) LDFLAGS=$ax_save_FLAGS])], [ax_save_FLAGS=$LDFLAGS LDFLAGS="$1" AC_LINK_IFELSE([AC_LANG_PROGRAM()], eval AS_TR_SH(xorg_cv_linker_flags_[$1])=yes, eval AS_TR_SH(xorg_cv_linker_flags_[$1])=no) LDFLAGS=$ax_save_FLAGS]) eval xorg_check_linker_flags=$AS_TR_SH(xorg_cv_linker_flags_[$1]) AC_MSG_RESULT($xorg_check_linker_flags) if test "x$xorg_check_linker_flags" = xyes; then m4_default([$2], :) else m4_default([$3], :) fi ]) # XORG_CHECK_LINKER_FLAGS # XORG_MEMORY_CHECK_FLAGS # ----------------------- # Minimum version: 1.16.0 # # This macro attempts to find appropriate memory checking functionality # for various platforms which unit testing code may use to catch various # forms of memory allocation and access errors in testing. # # Interface to module: # XORG_MALLOC_DEBUG_ENV - environment variables to set to enable debugging # Usually added to TESTS_ENVIRONMENT in Makefile.am # # If the user sets the value of XORG_MALLOC_DEBUG_ENV, it is used verbatim. # AC_DEFUN([XORG_MEMORY_CHECK_FLAGS],[ AC_REQUIRE([AC_CANONICAL_HOST]) AC_ARG_VAR([XORG_MALLOC_DEBUG_ENV], [Environment variables to enable memory checking in tests]) # Check for different types of support on different platforms case $host_os in solaris*) AC_CHECK_LIB([umem], [umem_alloc], [malloc_debug_env='LD_PRELOAD=libumem.so UMEM_DEBUG=default']) ;; *-gnu*) # GNU libc - Value is used as a single byte bit pattern, # both directly and inverted, so should not be 0 or 255. malloc_debug_env='MALLOC_PERTURB_=15' ;; darwin*) malloc_debug_env='MallocPreScribble=1 MallocScribble=1 DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib' ;; *bsd*) malloc_debug_env='MallocPreScribble=1 MallocScribble=1' ;; esac # User supplied flags override default flags if test "x$XORG_MALLOC_DEBUG_ENV" != "x"; then malloc_debug_env="$XORG_MALLOC_DEBUG_ENV" fi AC_SUBST([XORG_MALLOC_DEBUG_ENV],[$malloc_debug_env]) ]) # XORG_WITH_LINT # XORG_CHECK_MALLOC_ZERO # ---------------------- # Minimum version: 1.0.0 # # Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if # malloc(0) returns NULL. Packages should add one of these cflags to # their AM_CFLAGS (or other appropriate *_CFLAGS) to use them. AC_DEFUN([XORG_CHECK_MALLOC_ZERO],[ AC_ARG_ENABLE(malloc0returnsnull, AS_HELP_STRING([--enable-malloc0returnsnull], [malloc(0) returns NULL (default: auto)]), [MALLOC_ZERO_RETURNS_NULL=$enableval], [MALLOC_ZERO_RETURNS_NULL=auto]) AC_MSG_CHECKING([whether malloc(0) returns NULL]) if test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then AC_RUN_IFELSE([AC_LANG_PROGRAM([ #include ],[ char *m0, *r0, *c0, *p; m0 = malloc(0); p = malloc(10); r0 = realloc(p,0); c0 = calloc(0,10); exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1); ])], [MALLOC_ZERO_RETURNS_NULL=yes], [MALLOC_ZERO_RETURNS_NULL=no], [MALLOC_ZERO_RETURNS_NULL=yes]) fi AC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL]) if test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL" XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC" else MALLOC_ZERO_CFLAGS="" XMALLOC_ZERO_CFLAGS="" XTMALLOC_ZERO_CFLAGS="" fi AC_SUBST([MALLOC_ZERO_CFLAGS]) AC_SUBST([XMALLOC_ZERO_CFLAGS]) AC_SUBST([XTMALLOC_ZERO_CFLAGS]) ]) # XORG_CHECK_MALLOC_ZERO # XORG_WITH_LINT() # ---------------- # Minimum version: 1.1.0 # # This macro enables the use of a tool that flags some suspicious and # non-portable constructs (likely to be bugs) in C language source code. # It will attempt to locate the tool and use appropriate options. # There are various lint type tools on different platforms. # # Interface to module: # LINT: returns the path to the tool found on the platform # or the value set to LINT on the configure cmd line # also an Automake conditional # LINT_FLAGS: an Automake variable with appropriate flags # # --with-lint: 'yes' user instructs the module to use lint # 'no' user instructs the module not to use lint (default) # # If the user sets the value of LINT, AC_PATH_PROG skips testing the path. # If the user sets the value of LINT_FLAGS, they are used verbatim. # AC_DEFUN([XORG_WITH_LINT],[ AC_ARG_VAR([LINT], [Path to a lint-style command]) AC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command]) AC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint], [Use a lint-style source code checker (default: disabled)])], [use_lint=$withval], [use_lint=no]) # Obtain platform specific info like program name and options # The lint program on FreeBSD and NetBSD is different from the one on Solaris case $host_os in *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*) lint_name=splint lint_options="-badflag" ;; *freebsd* | *netbsd*) lint_name=lint lint_options="-u -b" ;; *solaris*) lint_name=lint lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2" ;; esac # Test for the presence of the program (either guessed by the code or spelled out by the user) if test "x$use_lint" = x"yes" ; then AC_PATH_PROG([LINT], [$lint_name]) if test "x$LINT" = "x"; then AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH]) fi elif test "x$use_lint" = x"no" ; then if test "x$LINT" != "x"; then AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified]) fi else AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.]) fi # User supplied flags override default flags if test "x$LINT_FLAGS" != "x"; then lint_options=$LINT_FLAGS fi AC_SUBST([LINT_FLAGS],[$lint_options]) AM_CONDITIONAL(LINT, [test "x$LINT" != x]) ]) # XORG_WITH_LINT # XORG_LINT_LIBRARY(LIBNAME) # -------------------------- # Minimum version: 1.1.0 # # Sets up flags for building lint libraries for checking programs that call # functions in the library. # # Interface to module: # LINTLIB - Automake variable with the name of lint library file to make # MAKE_LINT_LIB - Automake conditional # # --enable-lint-library: - 'yes' user instructs the module to created a lint library # - 'no' user instructs the module not to create a lint library (default) AC_DEFUN([XORG_LINT_LIBRARY],[ AC_REQUIRE([XORG_WITH_LINT]) AC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library], [Create lint library (default: disabled)])], [make_lint_lib=$enableval], [make_lint_lib=no]) if test "x$make_lint_lib" = x"yes" ; then LINTLIB=llib-l$1.ln if test "x$LINT" = "x"; then AC_MSG_ERROR([Cannot make lint library without --with-lint]) fi elif test "x$make_lint_lib" != x"no" ; then AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.]) fi AC_SUBST(LINTLIB) AM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno]) ]) # XORG_LINT_LIBRARY # XORG_COMPILER_BRAND # ------------------- # Minimum version: 1.14.0 # # Checks for various brands of compilers and sets flags as appropriate: # GNU gcc - relies on AC_PROG_CC (via AC_PROG_CC_C99) to set GCC to "yes" # GNU g++ - relies on AC_PROG_CXX to set GXX to "yes" # clang compiler - sets CLANGCC to "yes" # Intel compiler - sets INTELCC to "yes" # Sun/Oracle Solaris Studio cc - sets SUNCC to "yes" # AC_DEFUN([XORG_COMPILER_BRAND], [ AC_LANG_CASE( [C], [ AC_REQUIRE([AC_PROG_CC_C99]) ], [C++], [ AC_REQUIRE([AC_PROG_CXX]) ] ) AC_CHECK_DECL([__clang__], [CLANGCC="yes"], [CLANGCC="no"]) AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"]) AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"]) ]) # XORG_COMPILER_BRAND # XORG_TESTSET_CFLAG(, , [, ...]) # --------------- # Minimum version: 1.16.0 # # Test if the compiler works when passed the given flag as a command line argument. # If it succeeds, the flag is appeneded to the given variable. If not, it tries the # next flag in the list until there are no more options. # # Note that this does not guarantee that the compiler supports the flag as some # compilers will simply ignore arguments that they do not understand, but we do # attempt to weed out false positives by using -Werror=unknown-warning-option and # -Werror=unused-command-line-argument # AC_DEFUN([XORG_TESTSET_CFLAG], [ m4_if([$#], 0, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])]) m4_if([$#], 1, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])]) AC_LANG_COMPILER_REQUIRE AC_LANG_CASE( [C], [ AC_REQUIRE([AC_PROG_CC_C99]) define([PREFIX], [C]) define([CACHE_PREFIX], [cc]) define([COMPILER], [$CC]) ], [C++], [ define([PREFIX], [CXX]) define([CACHE_PREFIX], [cxx]) define([COMPILER], [$CXX]) ] ) [xorg_testset_save_]PREFIX[FLAGS]="$PREFIX[FLAGS]" if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "x" ; then PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option" AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unknown-warning-option], [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option], AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])], [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=yes], [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=no])) [xorg_testset_]CACHE_PREFIX[_unknown_warning_option]=$[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option] PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]" fi if test "x$[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]" = "x" ; then if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "xyes" ; then PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option" fi PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument" AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unused-command-line-argument], [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument], AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])], [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=yes], [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=no])) [xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]=$[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument] PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]" fi found="no" m4_foreach([flag], m4_cdr($@), [ if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument" fi PREFIX[FLAGS]="$PREFIX[FLAGS] ]flag[" dnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname AC_MSG_CHECKING([if ]COMPILER[ supports]flag[]) cacheid=AS_TR_SH([xorg_cv_]CACHE_PREFIX[_flag_]flag[]) AC_CACHE_VAL($cacheid, [AC_LINK_IFELSE([AC_LANG_PROGRAM([int i;])], [eval $cacheid=yes], [eval $cacheid=no])]) PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]" eval supported=\$$cacheid AC_MSG_RESULT([$supported]) if test "$supported" = "yes" ; then $1="$$1 ]flag[" found="yes" fi fi ]) ]) # XORG_TESTSET_CFLAG # XORG_COMPILER_FLAGS # --------------- # Minimum version: 1.16.0 # # Defines BASE_CFLAGS or BASE_CXXFLAGS to contain a set of command line # arguments supported by the selected compiler which do NOT alter the generated # code. These arguments will cause the compiler to print various warnings # during compilation AND turn a conservative set of warnings into errors. # # The set of flags supported by BASE_CFLAGS and BASE_CXXFLAGS will grow in # future versions of util-macros as options are added to new compilers. # AC_DEFUN([XORG_COMPILER_FLAGS], [ AC_REQUIRE([XORG_COMPILER_BRAND]) AC_ARG_ENABLE(selective-werror, AS_HELP_STRING([--disable-selective-werror], [Turn off selective compiler errors. (default: enabled)]), [SELECTIVE_WERROR=$enableval], [SELECTIVE_WERROR=yes]) AC_LANG_CASE( [C], [ define([PREFIX], [C]) ], [C++], [ define([PREFIX], [CXX]) ] ) # -v is too short to test reliably with XORG_TESTSET_CFLAG if test "x$SUNCC" = "xyes"; then [BASE_]PREFIX[FLAGS]="-v" else [BASE_]PREFIX[FLAGS]="" fi # This chunk of warnings were those that existed in the legacy CWARNFLAGS XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wall]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-arith]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-declarations]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wformat=2], [-Wformat]) AC_LANG_CASE( [C], [ XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wstrict-prototypes]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-prototypes]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnested-externs]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wbad-function-cast]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wold-style-definition]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wdeclaration-after-statement]) ] ) # This chunk adds additional warnings that could catch undesired effects. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wunused]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wuninitialized]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wshadow]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-noreturn]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-format-attribute]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wredundant-decls]) # These are currently disabled because they are noisy. They will be enabled # in the future once the codebase is sufficiently modernized to silence # them. For now, I don't want them to drown out the other warnings. # XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op]) # XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wparentheses]) # XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align]) # Turn some warnings into errors, so we don't accidently get successful builds # when there are problems that should be fixed. if test "x$SELECTIVE_WERROR" = "xyes" ; then XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=implicit], [-errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=nonnull]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=init-self]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=main]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=missing-braces]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=sequence-point]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=return-type], [-errwarn=E_FUNC_HAS_NO_RETURN_STMT]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=trigraphs]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=array-bounds]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=write-strings]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=address]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=int-to-pointer-cast], [-errwarn=E_BAD_PTR_INT_COMBINATION]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=pointer-to-int-cast]) # Also -errwarn=E_BAD_PTR_INT_COMBINATION else AC_MSG_WARN([You have chosen not to turn some select compiler warnings into errors. This should not be necessary. Please report why you needed to do so in a bug report at $PACKAGE_BUGREPORT]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wimplicit]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnonnull]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Winit-self]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmain]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-braces]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wsequence-point]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wreturn-type]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wtrigraphs]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Warray-bounds]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wwrite-strings]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Waddress]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wint-to-pointer-cast]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-to-int-cast]) fi AC_SUBST([BASE_]PREFIX[FLAGS]) ]) # XORG_COMPILER_FLAGS # XORG_CWARNFLAGS # --------------- # Minimum version: 1.2.0 # Deprecated since: 1.16.0 (Use XORG_COMPILER_FLAGS instead) # # Defines CWARNFLAGS to enable C compiler warnings. # # This function is deprecated because it defines -fno-strict-aliasing # which alters the code generated by the compiler. If -fno-strict-aliasing # is needed, then it should be added explicitly in the module when # it is updated to use BASE_CFLAGS. # AC_DEFUN([XORG_CWARNFLAGS], [ AC_REQUIRE([XORG_COMPILER_FLAGS]) AC_REQUIRE([XORG_COMPILER_BRAND]) AC_LANG_CASE( [C], [ CWARNFLAGS="$BASE_CFLAGS" if test "x$GCC" = xyes ; then CWARNFLAGS="$CWARNFLAGS -fno-strict-aliasing" fi AC_SUBST(CWARNFLAGS) ] ) ]) # XORG_CWARNFLAGS # XORG_STRICT_OPTION # ----------------------- # Minimum version: 1.3.0 # # Add configure option to enable strict compilation flags, such as treating # warnings as fatal errors. # If --enable-strict-compilation is passed to configure, adds strict flags to # $BASE_CFLAGS or $BASE_CXXFLAGS and the deprecated $CWARNFLAGS. # # Starting in 1.14.0 also exports $STRICT_CFLAGS for use in other tests or # when strict compilation is unconditionally desired. AC_DEFUN([XORG_STRICT_OPTION], [ AC_REQUIRE([XORG_CWARNFLAGS]) AC_REQUIRE([XORG_COMPILER_FLAGS]) AC_ARG_ENABLE(strict-compilation, AS_HELP_STRING([--enable-strict-compilation], [Enable all warnings from compiler and make them errors (default: disabled)]), [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no]) AC_LANG_CASE( [C], [ define([PREFIX], [C]) ], [C++], [ define([PREFIX], [CXX]) ] ) [STRICT_]PREFIX[FLAGS]="" XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-pedantic]) XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror], [-errwarn]) # Earlier versions of gcc (eg: 4.2) support -Werror=attributes, but do not # activate it with -Werror, so we add it here explicitly. XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror=attributes]) if test "x$STRICT_COMPILE" = "xyes"; then [BASE_]PREFIX[FLAGS]="$[BASE_]PREFIX[FLAGS] $[STRICT_]PREFIX[FLAGS]" AC_LANG_CASE([C], [CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"]) fi AC_SUBST([STRICT_]PREFIX[FLAGS]) AC_SUBST([BASE_]PREFIX[FLAGS]) AC_LANG_CASE([C], AC_SUBST([CWARNFLAGS])) ]) # XORG_STRICT_OPTION # XORG_DEFAULT_OPTIONS # -------------------- # Minimum version: 1.3.0 # # Defines default options for X.Org modules. # AC_DEFUN([XORG_DEFAULT_OPTIONS], [ AC_REQUIRE([AC_PROG_INSTALL]) XORG_COMPILER_FLAGS XORG_CWARNFLAGS XORG_STRICT_OPTION XORG_RELEASE_VERSION XORG_CHANGELOG XORG_INSTALL XORG_MANPAGE_SECTIONS m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])], [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])]) ]) # XORG_DEFAULT_OPTIONS # XORG_INSTALL() # ---------------- # Minimum version: 1.4.0 # # Defines the variable INSTALL_CMD as the command to copy # INSTALL from $prefix/share/util-macros. # AC_DEFUN([XORG_INSTALL], [ AC_REQUIRE([PKG_PROG_PKG_CONFIG]) macros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros` INSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \ mv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \ || (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \ echo 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)" AC_SUBST([INSTALL_CMD]) ]) # XORG_INSTALL dnl Copyright 2005 Red Hat, Inc dnl dnl Permission to use, copy, modify, distribute, and sell this software and its dnl documentation for any purpose is hereby granted without fee, provided that dnl the above copyright notice appear in all copies and that both that dnl copyright notice and this permission notice appear in supporting dnl documentation. dnl dnl The above copyright notice and this permission notice shall be included dnl in all copies or substantial portions of the Software. dnl dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. dnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR dnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, dnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR dnl OTHER DEALINGS IN THE SOFTWARE. dnl dnl Except as contained in this notice, the name of the copyright holders shall dnl not be used in advertising or otherwise to promote the sale, use or dnl other dealings in this Software without prior written authorization dnl from the copyright holders. dnl # XORG_RELEASE_VERSION # -------------------- # Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use. AC_DEFUN([XORG_RELEASE_VERSION],[ AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR], [`echo $PACKAGE_VERSION | cut -d . -f 1`], [Major version of this package]) PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1` if test "x$PVM" = "x"; then PVM="0" fi AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR], [$PVM], [Minor version of this package]) PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1` if test "x$PVP" = "x"; then PVP="0" fi AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL], [$PVP], [Patch version of this package]) ]) # XORG_CHANGELOG() # ---------------- # Minimum version: 1.2.0 # # Defines the variable CHANGELOG_CMD as the command to generate # ChangeLog from git. # # AC_DEFUN([XORG_CHANGELOG], [ CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \ mv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \ || (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \ echo 'git directory not found: installing possibly empty changelog.' >&2)" AC_SUBST([CHANGELOG_CMD]) ]) # XORG_CHANGELOG # Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software # Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.11' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.11.6], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.11.6])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to # `$srcdir', `$srcdir/..', or `$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is `.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 9 # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ(2.52)dnl ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009, # 2010, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 12 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "GCJ", or "OBJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl ifelse([$1], CC, [depcc="$CC" am_compiler_list=], [$1], CXX, [depcc="$CXX" am_compiler_list=], [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], UPC, [depcc="$UPC" am_compiler_list=], [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE(dependency-tracking, [ --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl AC_SUBST([am__nodep])dnl _AM_SUBST_NOTMAKE([am__nodep])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. #serial 5 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Autoconf 2.62 quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each `.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2008, 2009 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 16 # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.62])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) AM_MISSING_PROG(AUTOCONF, autoconf) AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) AM_MISSING_PROG(AUTOHEADER, autoheader) AM_MISSING_PROG(MAKEINFO, makeinfo) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AM_PROG_MKDIR_P])dnl # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES(CC)], [define([AC_PROG_CC], defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES(CXX)], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES(OBJC)], [define([AC_PROG_OBJC], defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl ]) _AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl dnl The `parallel-tests' driver may need to know about EXEEXT, so add the dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl ]) dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001, 2003, 2005, 2008, 2011 Free Software Foundation, # Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST(install_sh)]) # Copyright (C) 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- # From Jim Meyering # Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008, # 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 5 # AM_MAINTAINER_MODE([DEFAULT-MODE]) # ---------------------------------- # Control maintainer-specific portions of Makefiles. # Default is to disable them, unless `enable' is passed literally. # For symmetry, `disable' may be passed as well. Anyway, the user # can override the default with the --enable/--disable switch. AC_DEFUN([AM_MAINTAINER_MODE], [m4_case(m4_default([$1], [disable]), [enable], [m4_define([am_maintainer_other], [disable])], [disable], [m4_define([am_maintainer_other], [enable])], [m4_define([am_maintainer_other], [enable]) m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) dnl maintainer-mode's default is 'disable' unless 'enable' is passed AC_ARG_ENABLE([maintainer-mode], [ --][am_maintainer_other][-maintainer-mode am_maintainer_other make rules and dependencies not useful (and sometimes confusing) to the casual installer], [USE_MAINTAINER_MODE=$enableval], [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) AC_MSG_RESULT([$USE_MAINTAINER_MODE]) AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) MAINT=$MAINTAINER_MODE_TRUE AC_SUBST([MAINT])dnl ] ) AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 4 # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from `make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 6 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it supports --run. # If it does, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= AC_MSG_WARN([`missing' script is too old or missing]) fi ]) # Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation, # Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # AM_PROG_MKDIR_P # --------------- # Check for `mkdir -p'. AC_DEFUN([AM_PROG_MKDIR_P], [AC_PREREQ([2.60])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, dnl while keeping a definition of mkdir_p for backward compatibility. dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of dnl Makefile.ins that do not define MKDIR_P, so we do our own dnl adjustment using top_builddir (which is defined more often than dnl MKDIR_P). AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl case $mkdir_p in [[\\/$]]* | ?:[[\\/]]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software # Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 5 # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) # _AM_SET_OPTIONS(OPTIONS) # ------------------------ # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008, 2009, # 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # AM_PATH_PYTHON([MINIMUM-VERSION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) # --------------------------------------------------------------------------- # Adds support for distributing Python modules and packages. To # install modules, copy them to $(pythondir), using the python_PYTHON # automake variable. To install a package with the same name as the # automake package, install to $(pkgpythondir), or use the # pkgpython_PYTHON automake variable. # # The variables $(pyexecdir) and $(pkgpyexecdir) are provided as # locations to install python extension modules (shared libraries). # Another macro is required to find the appropriate flags to compile # extension modules. # # If your package is configured with a different prefix to python, # users will have to add the install directory to the PYTHONPATH # environment variable, or create a .pth file (see the python # documentation for details). # # If the MINIMUM-VERSION argument is passed, AM_PATH_PYTHON will # cause an error if the version of python installed on the system # doesn't meet the requirement. MINIMUM-VERSION should consist of # numbers and dots only. AC_DEFUN([AM_PATH_PYTHON], [ dnl Find a Python interpreter. Python versions prior to 2.0 are not dnl supported. (2.0 was released on October 16, 2000). m4_define_default([_AM_PYTHON_INTERPRETER_LIST], [python python2 python3 python3.2 python3.1 python3.0 python2.7 dnl python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0]) AC_ARG_VAR([PYTHON], [the Python interpreter]) m4_if([$1],[],[ dnl No version check is needed. # Find any Python interpreter. if test -z "$PYTHON"; then AC_PATH_PROGS([PYTHON], _AM_PYTHON_INTERPRETER_LIST, :) fi am_display_PYTHON=python ], [ dnl A version check is needed. if test -n "$PYTHON"; then # If the user set $PYTHON, use it and don't search something else. AC_MSG_CHECKING([whether $PYTHON version >= $1]) AM_PYTHON_CHECK_VERSION([$PYTHON], [$1], [AC_MSG_RESULT(yes)], [AC_MSG_ERROR(too old)]) am_display_PYTHON=$PYTHON else # Otherwise, try each interpreter until we find one that satisfies # VERSION. AC_CACHE_CHECK([for a Python interpreter with version >= $1], [am_cv_pathless_PYTHON],[ for am_cv_pathless_PYTHON in _AM_PYTHON_INTERPRETER_LIST none; do test "$am_cv_pathless_PYTHON" = none && break AM_PYTHON_CHECK_VERSION([$am_cv_pathless_PYTHON], [$1], [break]) done]) # Set $PYTHON to the absolute path of $am_cv_pathless_PYTHON. if test "$am_cv_pathless_PYTHON" = none; then PYTHON=: else AC_PATH_PROG([PYTHON], [$am_cv_pathless_PYTHON]) fi am_display_PYTHON=$am_cv_pathless_PYTHON fi ]) if test "$PYTHON" = :; then dnl Run any user-specified action, or abort. m4_default([$3], [AC_MSG_ERROR([no suitable Python interpreter found])]) else dnl Query Python for its version number. Getting [:3] seems to be dnl the best way to do this; it's what "site.py" does in the standard dnl library. AC_CACHE_CHECK([for $am_display_PYTHON version], [am_cv_python_version], [am_cv_python_version=`$PYTHON -c "import sys; sys.stdout.write(sys.version[[:3]])"`]) AC_SUBST([PYTHON_VERSION], [$am_cv_python_version]) dnl Use the values of $prefix and $exec_prefix for the corresponding dnl values of PYTHON_PREFIX and PYTHON_EXEC_PREFIX. These are made dnl distinct variables so they can be overridden if need be. However, dnl general consensus is that you shouldn't need this ability. AC_SUBST([PYTHON_PREFIX], ['${prefix}']) AC_SUBST([PYTHON_EXEC_PREFIX], ['${exec_prefix}']) dnl At times (like when building shared libraries) you may want dnl to know which OS platform Python thinks this is. AC_CACHE_CHECK([for $am_display_PYTHON platform], [am_cv_python_platform], [am_cv_python_platform=`$PYTHON -c "import sys; sys.stdout.write(sys.platform)"`]) AC_SUBST([PYTHON_PLATFORM], [$am_cv_python_platform]) dnl Set up 4 directories: dnl pythondir -- where to install python scripts. This is the dnl site-packages directory, not the python standard library dnl directory like in previous automake betas. This behavior dnl is more consistent with lispdir.m4 for example. dnl Query distutils for this directory. AC_CACHE_CHECK([for $am_display_PYTHON script directory], [am_cv_python_pythondir], [if test "x$prefix" = xNONE then am_py_prefix=$ac_default_prefix else am_py_prefix=$prefix fi am_cv_python_pythondir=`$PYTHON -c "import sys; from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_lib(0,0,prefix='$am_py_prefix'))" 2>/dev/null` case $am_cv_python_pythondir in $am_py_prefix*) am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'` am_cv_python_pythondir=`echo "$am_cv_python_pythondir" | sed "s,^$am__strip_prefix,$PYTHON_PREFIX,"` ;; *) case $am_py_prefix in /usr|/System*) ;; *) am_cv_python_pythondir=$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages ;; esac ;; esac ]) AC_SUBST([pythondir], [$am_cv_python_pythondir]) dnl pkgpythondir -- $PACKAGE directory under pythondir. Was dnl PYTHON_SITE_PACKAGE in previous betas, but this naming is dnl more consistent with the rest of automake. AC_SUBST([pkgpythondir], [\${pythondir}/$PACKAGE]) dnl pyexecdir -- directory for installing python extension modules dnl (shared libraries) dnl Query distutils for this directory. AC_CACHE_CHECK([for $am_display_PYTHON extension module directory], [am_cv_python_pyexecdir], [if test "x$exec_prefix" = xNONE then am_py_exec_prefix=$am_py_prefix else am_py_exec_prefix=$exec_prefix fi am_cv_python_pyexecdir=`$PYTHON -c "import sys; from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_lib(1,0,prefix='$am_py_exec_prefix'))" 2>/dev/null` case $am_cv_python_pyexecdir in $am_py_exec_prefix*) am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'` am_cv_python_pyexecdir=`echo "$am_cv_python_pyexecdir" | sed "s,^$am__strip_prefix,$PYTHON_EXEC_PREFIX,"` ;; *) case $am_py_exec_prefix in /usr|/System*) ;; *) am_cv_python_pyexecdir=$PYTHON_EXEC_PREFIX/lib/python$PYTHON_VERSION/site-packages ;; esac ;; esac ]) AC_SUBST([pyexecdir], [$am_cv_python_pyexecdir]) dnl pkgpyexecdir -- $(pyexecdir)/$(PACKAGE) AC_SUBST([pkgpyexecdir], [\${pyexecdir}/$PACKAGE]) dnl Run any user-specified action. $2 fi ]) # AM_PYTHON_CHECK_VERSION(PROG, VERSION, [ACTION-IF-TRUE], [ACTION-IF-FALSE]) # --------------------------------------------------------------------------- # Run ACTION-IF-TRUE if the Python interpreter PROG has version >= VERSION. # Run ACTION-IF-FALSE otherwise. # This test uses sys.hexversion instead of the string equivalent (first # word of sys.version), in order to cope with versions such as 2.2c1. # This supports Python 2.0 or higher. (2.0 was released on October 16, 2000). AC_DEFUN([AM_PYTHON_CHECK_VERSION], [prog="import sys # split strings by '.' and convert to numeric. Append some zeros # because we need at least 4 digits for the hex conversion. # map returns an iterator in Python 3.0 and a list in 2.x minver = list(map(int, '$2'.split('.'))) + [[0, 0, 0]] minverhex = 0 # xrange is not present in Python 3.0 and range returns an iterator for i in list(range(0, 4)): minverhex = (minverhex << 8) + minver[[i]] sys.exit(sys.hexversion < minverhex)" AS_IF([AM_RUN_LOG([$1 -c "$prog"])], [$3], [$4])]) # Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # AM_RUN_LOG(COMMAND) # ------------------- # Run COMMAND, save the exit status in ac_status, and log it. # (This has been adapted from Autoconf's _AC_RUN_LOG macro.) AC_DEFUN([AM_RUN_LOG], [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD (exit $ac_status); }]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 5 # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; esac # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi rm -f conftest.file if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT(yes)]) # Copyright (C) 2009, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # AM_SILENT_RULES([DEFAULT]) # -------------------------- # Enable less verbose build rules; with the default set to DEFAULT # (`yes' being less verbose, `no' or empty being verbose). AC_DEFUN([AM_SILENT_RULES], [AC_ARG_ENABLE([silent-rules], [ --enable-silent-rules less verbose build output (undo: `make V=1') --disable-silent-rules verbose build output (undo: `make V=0')]) case $enable_silent_rules in yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; esac dnl dnl A few `make' implementations (e.g., NonStop OS and NextStep) dnl do not support nested variable expansions. dnl See automake bug#9928 and bug#10237. am_make=${MAKE-make} AC_CACHE_CHECK([whether $am_make supports nested variables], [am_cv_make_support_nested_variables], [if AS_ECHO([['TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi]) if test $am_cv_make_support_nested_variables = yes; then dnl Using `$V' instead of `$(V)' breaks IRIX make. AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AC_SUBST([AM_V])dnl AM_SUBST_NOTMAKE([AM_V])dnl AC_SUBST([AM_DEFAULT_V])dnl AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl AC_SUBST([AM_DEFAULT_VERBOSITY])dnl AM_BACKSLASH='\' AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) # Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor `install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in `make install-strip', and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be `maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 3 # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # -------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004, 2005, 2012 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of `v7', `ustar', or `pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) m4_if([$1], [v7], [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar],, [pax],, [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' _am_tools=${am_cv_prog_tar_$1-$_am_tools} # Do not fold the above two line into one, because Tru64 sh and # Solaris sh will not grok spaces in the rhs of `-'. for _am_tool in $_am_tools do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR intel-gpu-tools-1.3/tests/0000775000175100017510000000000012016622744012572 500000000000000intel-gpu-tools-1.3/tests/prime_nv_pcopy.c0000664000175100017510000010336312015765010015706 00000000000000/* basic set of prime tests between intel and nouveau */ /* test list - 1. share buffer from intel -> nouveau. 2. share buffer from nouveau -> intel 3. share intel->nouveau, map on both, write intel, read nouveau 4. share intel->nouveau, blit intel fill, readback on nouveau test 1 + map buffer, read/write, map other size. do some hw actions on the buffer some illegal operations - close prime fd try and map TODO add some nouveau rendering tests */ #include #include #include #include #include #include #include #include #include "i915_drm.h" #include "intel_bufmgr.h" #include "nouveau.h" #include "intel_gpu_tools.h" #include "intel_batchbuffer.h" static int intel_fd = -1, nouveau_fd = -1; static drm_intel_bufmgr *bufmgr; static struct nouveau_device *ndev; static struct nouveau_client *nclient; static uint32_t devid; static struct intel_batchbuffer *batch; static struct nouveau_object *nchannel, *pcopy; static struct nouveau_bufctx *nbufctx; static struct nouveau_pushbuf *npush; static struct nouveau_bo *query_bo; static uint32_t query_counter; static volatile uint32_t *query; static uint32_t memtype_intel, tile_intel_y, tile_intel_x; #define SUBC_COPY(x) 6, (x) #define NV01_SUBCHAN_OBJECT 0 #define NV01_SUBC(subc, mthd) SUBC_##subc((NV01_SUBCHAN_##mthd)) #if 0 #define dbg(fmt...) fprintf(stderr, fmt); #else #define dbg(...) do { } while (0) #endif typedef struct { uint32_t w, h; uint32_t pitch, lines; } rect; static int nv_bo_alloc(struct nouveau_bo **bo, rect *r, uint32_t w, uint32_t h, uint32_t tile_mode, int handle, uint32_t dom) { uint32_t size; uint32_t dx = 1, dy = 1, memtype = 0; int ret; *bo = NULL; if (tile_mode) { uint32_t tile_y; uint32_t tile_x; /* Y major tiling */ if ((tile_mode & 0xf) == 0xe) /* but the internal layout is different */ tile_x = 7; else tile_x = 6 + (tile_mode & 0xf); if (ndev->chipset < 0xc0) { memtype = 0x70; tile_y = 2; } else { memtype = 0xfe; tile_y = 3; } if ((tile_mode & 0xf) == 0xe) memtype = memtype_intel; tile_y += ((tile_mode & 0xf0)>>4); dx = 1 << tile_x; dy = 1 << tile_y; dbg("Tiling requirements: x y %u %u\n", dx, dy); } r->w = w; r->h = h; r->pitch = w = (w + dx-1) & ~(dx-1); r->lines = h = (h + dy-1) & ~(dy-1); size = w*h; if (handle < 0) { union nouveau_bo_config cfg; cfg.nv50.memtype = memtype; cfg.nv50.tile_mode = tile_mode; if (dom == NOUVEAU_BO_GART) dom |= NOUVEAU_BO_MAP; ret = nouveau_bo_new(ndev, dom, 4096, size, &cfg, bo); if (!ret) ret = nouveau_bo_map(*bo, NOUVEAU_BO_RDWR, nclient); if (ret) { fprintf(stderr, "creating bo failed with %i %s\n", ret, strerror(-ret)); nouveau_bo_ref(NULL, bo); return ret; } dbg("new flags %08x memtype %08x tile %08x\n", (*bo)->flags, (*bo)->config.nv50.memtype, (*bo)->config.nv50.tile_mode); if (tile_mode == tile_intel_y || tile_mode == tile_intel_x) { dbg("tile mode was: %02x, now: %02x\n", (*bo)->config.nv50.tile_mode, tile_mode); /* Doesn't like intel tiling much.. */ (*bo)->config.nv50.tile_mode = tile_mode; } } else { ret = nouveau_bo_prime_handle_ref(ndev, handle, bo); close(handle); if (ret < 0) { fprintf(stderr, "receiving bo failed with %i %s\n", ret, strerror(-ret)); return ret; } if ((*bo)->size < size) { fprintf(stderr, "expected bo size to be at least %u," "but received %"PRIu64"\n", size, (*bo)->size); nouveau_bo_ref(NULL, bo); return -1; } dbg("prime flags %08x memtype %08x tile %08x\n", (*bo)->flags, (*bo)->config.nv50.memtype, (*bo)->config.nv50.tile_mode); (*bo)->config.nv50.memtype = memtype; (*bo)->config.nv50.tile_mode = tile_mode; } dbg("size: %"PRIu64"\n", (*bo)->size); return ret; } static inline void PUSH_DATA(struct nouveau_pushbuf *push, uint32_t data) { *push->cur++ = data; } 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_NVXX(struct nouveau_pushbuf *push, int subc, int mthd, int size) { if (ndev->chipset < 0xc0) BEGIN_NV04(push, subc, mthd, size); else BEGIN_NVC0(push, subc, mthd, size); } static void noop_intel(drm_intel_bo *bo) { BEGIN_BATCH(3); OUT_BATCH(MI_NOOP); OUT_BATCH(MI_BATCH_BUFFER_END); OUT_RELOC(bo, I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER, 0); ADVANCE_BATCH(); intel_batchbuffer_flush(batch); } static int find_and_open_devices(void) { int i; char path[80], *unused; struct stat buf; FILE *fl; char vendor_id[8] = {}; int venid; for (i = 0; i < 9; i++) { sprintf(path, "/sys/class/drm/card%d/device/vendor", i); if (stat(path, &buf)) break; fl = fopen(path, "r"); if (!fl) break; unused = fgets(vendor_id, sizeof(vendor_id)-1, fl); (void)unused; fclose(fl); venid = strtoul(vendor_id, NULL, 16); sprintf(path, "/dev/dri/card%d", i); if (venid == 0x8086) { intel_fd = open(path, O_RDWR); if (!intel_fd) return -1; } else if (venid == 0x10de) { nouveau_fd = open(path, O_RDWR); if (!nouveau_fd) return -1; } } return 0; } static int init_nouveau(void) { struct nv04_fifo nv04_data = { .vram = 0xbeef0201, .gart = 0xbeef0202 }; struct nvc0_fifo nvc0_data = { }; struct nouveau_fifo *fifo; int size, ret; uint32_t class; void *data; ret = nouveau_device_wrap(nouveau_fd, 0, &ndev); if (ret < 0) { fprintf(stderr,"failed to wrap nouveau device\n"); return ret; } ret = nouveau_client_new(ndev, &nclient); if (ret < 0) { fprintf(stderr,"failed to setup nouveau client\n"); return ret; } if (ndev->chipset < 0xa3 || ndev->chipset == 0xaa || ndev->chipset == 0xac) { fprintf(stderr, "Your card doesn't support PCOPY\n"); return -1; } // TODO: Get a kepler and add support for it if (ndev->chipset >= 0xe0) { fprintf(stderr, "Unsure how kepler works!\n"); return -1; } ret = nouveau_bo_new(ndev, NOUVEAU_BO_GART | NOUVEAU_BO_MAP, 4096, 4096, NULL, &query_bo); if (!ret) ret = nouveau_bo_map(query_bo, NOUVEAU_BO_RDWR, nclient); if (ret < 0) { fprintf(stderr,"failed to setup query counter\n"); return ret; } query = query_bo->map; *query = query_counter; if (ndev->chipset < 0xc0) { class = 0x85b5; data = &nv04_data; size = sizeof(nv04_data); } else { class = ndev->chipset < 0xe0 ? 0x490b5 : 0xa0b5; data = &nvc0_data; size = sizeof(nvc0_data); } ret = nouveau_object_new(&ndev->object, 0, NOUVEAU_FIFO_CHANNEL_CLASS, data, size, &nchannel); if (ret) { fprintf(stderr, "Error creating GPU channel: %d\n", ret); if (ret == -ENODEV) { fprintf(stderr, "Make sure nouveau_accel is active\n"); fprintf(stderr, "nvd9 is likely broken regardless\n"); } return ret; } fifo = nchannel->data; ret = nouveau_pushbuf_new(nclient, nchannel, 4, 32 * 1024, true, &npush); if (ret) { fprintf(stderr, "Error allocating DMA push buffer: %d\n", ret); return ret; } ret = nouveau_bufctx_new(nclient, 1, &nbufctx); if (ret) { fprintf(stderr, "Error allocating buffer context: %d\n", ret); return ret; } npush->user_priv = nbufctx; /* Hope this is enough init for PCOPY */ ret = nouveau_object_new(nchannel, class, class & 0xffff, NULL, 0, &pcopy); if (ret) { fprintf(stderr, "Failed to allocate pcopy: %d\n", ret); return ret; } ret = nouveau_pushbuf_space(npush, 512, 0, 0); if (ret) { fprintf(stderr, "No space in pushbuf: %d\n", ret); return ret; } if (ndev->chipset < 0xc0) { struct nv04_fifo *nv04_fifo = (struct nv04_fifo*)fifo; tile_intel_y = 0x3e; tile_intel_x = 0x13; BEGIN_NV04(npush, NV01_SUBC(COPY, OBJECT), 1); PUSH_DATA(npush, pcopy->handle); BEGIN_NV04(npush, SUBC_COPY(0x0180), 3); PUSH_DATA(npush, nv04_fifo->vram); PUSH_DATA(npush, nv04_fifo->vram); PUSH_DATA(npush, nv04_fifo->vram); } else { tile_intel_y = 0x2e; tile_intel_x = 0x03; BEGIN_NVC0(npush, NV01_SUBC(COPY, OBJECT), 1); PUSH_DATA(npush, pcopy->handle); } nouveau_pushbuf_kick(npush, npush->channel); return ret; } static void fill16(void *ptr, uint32_t val) { uint32_t *p = ptr; val = (val) | (val << 8) | (val << 16) | (val << 24); p[0] = p[1] = p[2] = p[3] = val; } #define TILE_SIZE 4096 static int swtile_y(uint8_t *out, const uint8_t *in, int w, int h) { uint32_t x, y, dx, dy; uint8_t *endptr = out + w * h; assert(!(w % 128)); assert(!(h % 32)); for (y = 0; y < h; y += 32) { for (x = 0; x < w; x += 128, out += TILE_SIZE) { for (dx = 0; dx < 8; ++dx) { for (dy = 0; dy < 32; ++dy) { uint32_t out_ofs = (dx * 32 + dy) * 16; uint32_t in_ofs = (y + dy) * w + (x + 16 * dx); assert(out_ofs < TILE_SIZE); assert(in_ofs < w*h); // To do the Y tiling quirk: // out_ofs = out_ofs ^ (((out_ofs >> 9) & 1) << 6); memcpy(&out[out_ofs], &in[in_ofs], 16); } } } } assert(out == endptr); return 0; } static int swtile_x(uint8_t *out, const uint8_t *in, int w, int h) { uint32_t x, y, dy; uint8_t *endptr = out + w * h; assert(!(w % 512)); assert(!(h % 8)); for (y = 0; y < h; y += 8) { for (x = 0; x < w; x += 512, out += TILE_SIZE) { for (dy = 0; dy < 8; ++dy) { uint32_t out_ofs = 512 * dy; uint32_t in_ofs = (y + dy) * w + x; assert(out_ofs < TILE_SIZE); assert(in_ofs < w*h); memcpy(&out[out_ofs], &in[in_ofs], 512); } } } assert(out == endptr); return 0; } #if 0 /* X tiling is approximately linear, except tiled in 512x8 blocks, so lets abuse that * * How? Whole contiguous tiles can be copied safely as if linear */ static int perform_copy_hack(struct nouveau_bo *nvbo, const rect *dst, uint32_t dst_x, uint32_t dst_y, struct nouveau_bo *nvbi, const rect *src, uint32_t src_x, uint32_t src_y, uint32_t w, uint32_t h) { struct nouveau_pushbuf_refn refs[] = { { nvbi, (nvbi->flags & NOUVEAU_BO_APER) | NOUVEAU_BO_RD }, { nvbo, (nvbo->flags & NOUVEAU_BO_APER) | NOUVEAU_BO_WR }, { query_bo, NOUVEAU_BO_GART | NOUVEAU_BO_RDWR } }; uint32_t exec = 0x00000000; uint32_t src_off = 0, dst_off = 0; struct nouveau_pushbuf *push = npush; uint32_t dw, tiles, tile_src = nvbi->config.nv50.tile_mode, tile_dst = nvbo->config.nv50.tile_mode; if (tile_src == tile_intel_x) dw = 512 - (src_x & 512); else dw = 512 - (dst_x % 512); if (!nvbi->config.nv50.memtype) exec |= 0x00000010; if (!tile_src) src_off = src_y * src->pitch + src_x; if (!nvbo->config.nv50.memtype) exec |= 0x00000100; if (!tile_dst) dst_off = dst_y * dst->pitch + dst_x; if (dw > w) dw = w; tiles = 1 + ((w - dw + 511)/512); if (nouveau_pushbuf_space(push, 8 + tiles * 32, 0, 0) || nouveau_pushbuf_refn(push, refs, 3)) return -1; for (; w; w -= dw, src_x += dw, dst_x += dw, dw = w > 512 ? 512 : w) { if (tile_src == tile_intel_x) { /* Find the correct tiled offset */ src_off = 8 * dst->pitch * (src_y / 8); src_off += src_x / 512 * 4096; src_off += (src_x % 512) + 512 * (src_y % 8); if (!tile_dst) dst_off = dst_y * dst->pitch + dst_x; } else { if (!tile_src) src_off = src_y * src->pitch + src_x; dst_off = 8 * dst->pitch * (dst_y / 8); dst_off += dst_x / 512 * 4096; dst_off += (dst_x % 512) + 512 * (dst_y % 8); } fprintf(stderr, "Copying from %u to %u for %u bytes\n", src_x, dst_x, dw); fprintf(stderr, "src ofs: %u, dst ofs: %u\n", src_off, dst_off); BEGIN_NVXX(push, SUBC_COPY(0x0200), 7); PUSH_DATA (push, tile_src == tile_intel_x ? 0 : nvbi->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); PUSH_DATA (push, src_y); BEGIN_NVXX(push, SUBC_COPY(0x0220), 7); PUSH_DATA (push, tile_dst == tile_intel_x ? 0 : nvbo->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); PUSH_DATA (push, dst_y); BEGIN_NVXX(push, SUBC_COPY(0x030c), 8); PUSH_DATA (push, (nvbi->offset + src_off) >> 32); PUSH_DATA (push, (nvbi->offset + src_off)); PUSH_DATA (push, (nvbo->offset + dst_off) >> 32); PUSH_DATA (push, (nvbo->offset + dst_off)); PUSH_DATA (push, src->pitch); PUSH_DATA (push, dst->pitch); PUSH_DATA (push, dw); PUSH_DATA (push, h); if (w == dw) { exec |= 0x3000; /* QUERY|QUERY_SHORT */ BEGIN_NVXX(push, SUBC_COPY(0x0338), 3); PUSH_DATA (push, (query_bo->offset) >> 32); PUSH_DATA (push, (query_bo->offset)); PUSH_DATA (push, ++query_counter); } BEGIN_NVXX(push, SUBC_COPY(0x0300), 1); PUSH_DATA (push, exec); } nouveau_pushbuf_kick(push, push->channel); while (*query < query_counter) { } return 0; } #endif static int perform_copy(struct nouveau_bo *nvbo, const rect *dst, uint32_t dst_x, uint32_t dst_y, struct nouveau_bo *nvbi, const rect *src, uint32_t src_x, uint32_t src_y, uint32_t w, uint32_t h) { #if 0 /* Too much effort */ if (nvbi->config.nv50.tile_mode == tile_intel_x && nvbo->config.nv50.tile_mode == tile_intel_x) return -1; else if (nvbi->config.nv50.tile_mode == tile_intel_x || nvbo->config.nv50.tile_mode == tile_intel_x) return perform_copy_hack(nvbo, dst, dst_x, dst_y, nvbi, src, src_x, src_y, w, h); #endif struct nouveau_pushbuf_refn refs[] = { { nvbi, (nvbi->flags & NOUVEAU_BO_APER) | NOUVEAU_BO_RD }, { nvbo, (nvbo->flags & NOUVEAU_BO_APER) | NOUVEAU_BO_WR }, { query_bo, NOUVEAU_BO_GART | NOUVEAU_BO_RDWR } }; uint32_t cpp = 1, exec = 0x00003000; /* QUERY|QUERY_SHORT|FORMAT */ uint32_t src_off = 0, dst_off = 0; struct nouveau_pushbuf *push = npush; if (nvbi->config.nv50.tile_mode == tile_intel_y) dbg("src is y-tiled\n"); if (nvbo->config.nv50.tile_mode == tile_intel_y) dbg("dst is y-tiled\n"); if (nouveau_pushbuf_space(push, 64, 0, 0) || nouveau_pushbuf_refn(push, refs, 3)) return -1; if (!nvbi->config.nv50.tile_mode) { src_off = src_y * src->pitch + src_x; exec |= 0x00000010; } if (!nvbo->config.nv50.tile_mode) { dst_off = dst_y * dst->pitch + dst_x; exec |= 0x00000100; } BEGIN_NVXX(push, SUBC_COPY(0x0200), 7); PUSH_DATA (push, nvbi->config.nv50.tile_mode); PUSH_DATA (push, src->pitch / cpp); 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_NVXX(push, SUBC_COPY(0x0220), 7); PUSH_DATA (push, nvbo->config.nv50.tile_mode); PUSH_DATA (push, dst->pitch / cpp); 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_NVXX(push, SUBC_COPY(0x030c), 9); PUSH_DATA (push, (nvbi->offset + src_off) >> 32); PUSH_DATA (push, (nvbi->offset + src_off)); PUSH_DATA (push, (nvbo->offset + dst_off) >> 32); PUSH_DATA (push, (nvbo->offset + dst_off)); PUSH_DATA (push, src->pitch); PUSH_DATA (push, dst->pitch); PUSH_DATA (push, w / cpp); PUSH_DATA (push, h); PUSH_DATA (push, 0x03333120); BEGIN_NVXX(push, SUBC_COPY(0x0338), 3); PUSH_DATA (push, (query_bo->offset) >> 32); PUSH_DATA (push, (query_bo->offset)); PUSH_DATA (push, ++query_counter); BEGIN_NVXX(push, SUBC_COPY(0x0300), 1); PUSH_DATA (push, exec); nouveau_pushbuf_kick(push, push->channel); while (*query < query_counter) { usleep(1000); } return 0; } static int check1_macro(uint32_t *p, uint32_t w, uint32_t h) { uint32_t i, val, j; for (i = 0; i < 256; ++i, p += 4) { val = (i) | (i << 8) | (i << 16) | (i << 24); if (p[0] != val || p[1] != val || p[2] != val || p[3] != val) { fprintf(stderr, "Retile check failed in first tile!\n"); fprintf(stderr, "%08x %08x %08x %08x instead of %08x\n", p[0], p[1], p[2], p[3], val); return -1; } } val = 0x3e3e3e3e; for (i = 0; i < 256 * (w-1); ++i, p += 4) { if (p[0] != val || p[1] != val || p[2] != val || p[3] != val) { fprintf(stderr, "Retile check failed in second tile!\n"); fprintf(stderr, "%08x %08x %08x %08x instead of %08x\n", p[0], p[1], p[2], p[3], val); return -1; } } for (j = 1; j < h; ++j) { val = 0x7e7e7e7e; for (i = 0; i < 256; ++i, p += 4) { if (p[0] != val || p[1] != val || p[2] != val || p[3] != val) { fprintf(stderr, "Retile check failed in third tile!\n"); fprintf(stderr, "%08x %08x %08x %08x instead of %08x\n", p[0], p[1], p[2], p[3], val); return -1; } } val = 0xcececece; for (i = 0; i < 256 * (w-1); ++i, p += 4) { if (p[0] != val || p[1] != val || p[2] != val || p[3] != val) { fprintf(stderr, "Retile check failed in fourth tile!\n"); fprintf(stderr, "%08x %08x %08x %08x instead of %08x\n", p[0], p[1], p[2], p[3], val); return -1; } } } return 0; } /* test 1, see if we can copy from linear to intel Y format safely */ static int test1_macro(void) { int ret, prime_fd = -1; struct nouveau_bo *nvbo = NULL, *nvbi = NULL; rect dst, src; uint8_t *ptr; uint32_t w = 2 * 128, h = 2 * 32, x, y; ret = nv_bo_alloc(&nvbi, &src, w, h, 0, -1, NOUVEAU_BO_GART); if (ret >= 0) ret = nv_bo_alloc(&nvbo, &dst, w, h, tile_intel_y, -1, NOUVEAU_BO_GART); if (ret < 0) goto out; nouveau_bo_set_prime(nvbo, &prime_fd); /* Set up something for our tile that should map into the first * y-major tile, assuming my understanding of documentation is * correct */ /* First tile should be read out in groups of 16 bytes that * are all set to a linear increasing value.. */ ptr = nvbi->map; for (x = 0; x < 128; x += 16) for (y = 0; y < 32; ++y) fill16(&ptr[y * w + x], x * 2 + y); /* second tile */ for (x = 128; x < w; x += 16) for (y = 0; y < 32; ++y) fill16(&ptr[y * w + x], 0x3e); /* third tile */ for (x = 0; x < 128; x += 16) for (y = 32; y < h; ++y) fill16(&ptr[y * w + x], 0x7e); /* last tile */ for (x = 128; x < w; x += 16) for (y = 32; y < h; ++y) fill16(&ptr[y * w + x], 0xce); memset(nvbo->map, 0xfc, w * h); if (pcopy) ret = perform_copy(nvbo, &dst, 0, 0, nvbi, &src, 0, 0, w, h); else ret = swtile_y(nvbo->map, nvbi->map, w, h); if (!ret) ret = check1_macro(nvbo->map, w/128, h/32); out: nouveau_bo_ref(NULL, &nvbo); nouveau_bo_ref(NULL, &nvbi); close(prime_fd); return ret; } static int dump_line(uint8_t *map) { uint32_t dx, dy; fprintf(stderr, "Dumping sub-tile:\n"); for (dy = 0; dy < 32; ++dy) { for (dx = 0; dx < 15; ++dx, ++map) { fprintf(stderr, "%02x ", *map); } fprintf(stderr, "%02x\n", *(map++)); } return -1; } static int check1_micro(void *map, uint32_t pitch, uint32_t lines, uint32_t dst_x, uint32_t dst_y, uint32_t w, uint32_t h) { uint32_t x, y; /* check only the relevant subrectangle [0..w) [0...h) */ uint8_t *m = map; for (y = 0; y < h; ++y, m += pitch) { for (x = 0; x < w; ++x) { uint8_t expected = ((y & 3) << 6) | (x & 0x3f); if (expected != m[x]) { fprintf(stderr, "failed check at x=%u y=%u, expected %02x got %02x\n", x, y, expected, m[x]); return dump_line(m); } } } return 0; } /* test 1, but check micro format, should be unaffected by bit9 swizzling */ static int test1_micro(void) { struct nouveau_bo *bo_intel = NULL, *bo_nvidia = NULL, *bo_linear = NULL; rect intel, nvidia, linear; int ret = -1; uint32_t tiling = I915_TILING_Y; uint32_t src_x = 0, src_y = 0; uint32_t dst_x = 0, dst_y = 0; uint32_t x, y, w = 256, h = 64; drm_intel_bo *test_intel_bo; int prime_fd; test_intel_bo = drm_intel_bo_alloc(bufmgr, "test bo", w * h, 4096); if (!test_intel_bo) return -1; drm_intel_bo_set_tiling(test_intel_bo, &tiling, w); if (tiling != I915_TILING_Y) { fprintf(stderr, "Couldn't set y tiling\n"); goto out; } ret = drm_intel_gem_bo_map_gtt(test_intel_bo); if (ret) goto out; drm_intel_bo_gem_export_to_prime(test_intel_bo, &prime_fd); if (prime_fd < 0) { drm_intel_bo_unreference(test_intel_bo); goto out; } noop_intel(test_intel_bo); ret = nv_bo_alloc(&bo_intel, &intel, w, h, tile_intel_y, prime_fd, 0); if (!ret) ret = nv_bo_alloc(&bo_nvidia, &nvidia, w, h, 0x10, -1, NOUVEAU_BO_VRAM); if (!ret) ret = nv_bo_alloc(&bo_linear, &linear, w, h, 0, -1, NOUVEAU_BO_GART); if (ret) goto out; for (y = 0; y < linear.h; ++y) { uint8_t *map = bo_linear->map; map += y * linear.pitch; for (x = 0; x < linear.pitch; ++x) { uint8_t pos = x & 0x3f; /* low 4 bits: micro tile pos */ /* 2 bits: x pos in tile (wraps) */ /* 2 bits: y pos in tile (wraps) */ pos |= (y & 3) << 6; map[x] = pos; } } ret = perform_copy(bo_nvidia, &nvidia, 0, 0, bo_linear, &linear, 0, 0, nvidia.pitch, nvidia.h); if (ret) goto out; /* Perform the actual sub rectangle copy */ if (pcopy) ret = perform_copy(bo_intel, &intel, dst_x, dst_y, bo_nvidia, &nvidia, src_x, src_y, w, h); else ret = swtile_y(test_intel_bo->virtual, bo_linear->map, w, h); if (ret) goto out; noop_intel(test_intel_bo); ret = check1_micro(test_intel_bo->virtual, intel.pitch, intel.h, dst_x, dst_y, w, h); out: nouveau_bo_ref(NULL, &bo_linear); nouveau_bo_ref(NULL, &bo_nvidia); nouveau_bo_ref(NULL, &bo_intel); drm_intel_bo_unreference(test_intel_bo); return ret; } static int check1_swizzle(uint32_t *p, uint32_t pitch, uint32_t lines, uint32_t dst_x, uint32_t dst_y, uint32_t w, uint32_t h) { uint32_t i, val, j; for (j = 0; j < 32; ++j, p += (pitch - w)/4) { for (i = 0; i < 8; ++i, p += 4) { val = (i * 32) + j; val = (val) | (val << 8) | (val << 16) | (val << 24); if (p[0] != val || p[1] != val || p[2] != val || p[3] != val) { fprintf(stderr, "Retile check failed in first tile!\n"); fprintf(stderr, "%08x %08x %08x %08x instead of %08x\n", p[0], p[1], p[2], p[3], val); return -1; } } val = 0x3e3e3e3e; for (; i < w/16; ++i, p += 4) { if (p[0] != val || p[1] != val || p[2] != val || p[3] != val) { fprintf(stderr, "Retile check failed in second tile!\n"); fprintf(stderr, "%08x %08x %08x %08x instead of %08x\n", p[0], p[1], p[2], p[3], val); return -1; } } } for (j = 32; j < h; ++j, p += (pitch - w)/4) { val = 0x7e7e7e7e; for (i = 0; i < 8; ++i, p += 4) { if (p[0] != val || p[1] != val || p[2] != val || p[3] != val) { fprintf(stderr, "Retile check failed in third tile!\n"); fprintf(stderr, "%08x %08x %08x %08x instead of %08x\n", p[0], p[1], p[2], p[3], val); return -1; } } val = 0xcececece; for (; i < w/16; ++i, p += 4) { if (p[0] != val || p[1] != val || p[2] != val || p[3] != val) { fprintf(stderr, "Retile check failed in fourth tile!\n"); fprintf(stderr, "%08x %08x %08x %08x instead of %08x\n", p[0], p[1], p[2], p[3], val); return -1; } } } return 0; } /* Create a new bo, set tiling to y, and see if macro swizzling is done correctl */ static int test1_swizzle(void) { struct nouveau_bo *bo_intel = NULL, *bo_nvidia = NULL, *bo_linear = NULL; rect intel, nvidia, linear; int ret = -1; uint32_t tiling = I915_TILING_Y; uint32_t src_x = 0, src_y = 0; uint32_t dst_x = 0, dst_y = 0; uint32_t x, y, w = 256, h = 64; uint8_t *ptr; drm_intel_bo *test_intel_bo; int prime_fd; test_intel_bo = drm_intel_bo_alloc(bufmgr, "test bo", w * h, 4096); if (!test_intel_bo) return -1; drm_intel_bo_set_tiling(test_intel_bo, &tiling, w); if (tiling != I915_TILING_Y) { fprintf(stderr, "Couldn't set y tiling\n"); goto out; } ret = drm_intel_gem_bo_map_gtt(test_intel_bo); if (ret) goto out; drm_intel_bo_gem_export_to_prime(test_intel_bo, &prime_fd); if (prime_fd < 0) { drm_intel_bo_unreference(test_intel_bo); goto out; } ret = nv_bo_alloc(&bo_intel, &intel, w, h, tile_intel_y, prime_fd, 0); if (!ret) ret = nv_bo_alloc(&bo_nvidia, &nvidia, w, h, 0x10, -1, NOUVEAU_BO_VRAM); if (!ret) ret = nv_bo_alloc(&bo_linear, &linear, w, h, 0, -1, NOUVEAU_BO_GART); if (ret) goto out; noop_intel(test_intel_bo); ptr = bo_linear->map; for (x = 0; x < 128; x += 16) for (y = 0; y < 32; ++y) fill16(&ptr[y * w + x], x * 2 + y); /* second tile */ for (x = 128; x < w; x += 16) for (y = 0; y < 32; ++y) fill16(&ptr[y * w + x], 0x3e); /* third tile */ for (x = 0; x < 128; x += 16) for (y = 32; y < h; ++y) fill16(&ptr[y * w + x], 0x7e); /* last tile */ for (x = 128; x < w; x += 16) for (y = 32; y < h; ++y) fill16(&ptr[y * w + x], 0xce); ret = perform_copy(bo_nvidia, &nvidia, 0, 0, bo_linear, &linear, 0, 0, nvidia.pitch, nvidia.h); if (ret) goto out; /* Perform the actual sub rectangle copy */ ret = perform_copy(bo_intel, &intel, dst_x, dst_y, bo_nvidia, &nvidia, src_x, src_y, w, h); if (ret) goto out; noop_intel(test_intel_bo); ret = check1_swizzle(test_intel_bo->virtual, intel.pitch, intel.h, dst_x, dst_y, w, h); out: nouveau_bo_ref(NULL, &bo_linear); nouveau_bo_ref(NULL, &bo_nvidia); nouveau_bo_ref(NULL, &bo_intel); drm_intel_bo_unreference(test_intel_bo); return ret; } /* test 2, see if we can copy from linear to intel X format safely * Seems nvidia lacks a method to do it, so just keep this test * as a reference for potential future tests. Software tiling is * used for now */ static int test2(void) { int ret; struct nouveau_bo *nvbo = NULL, *nvbi = NULL; rect dst, src; uint8_t *ptr; uint32_t w = 1024, h = 16, x, y; ret = nv_bo_alloc(&nvbi, &src, w, h, 0, -1, NOUVEAU_BO_GART); if (ret >= 0) ret = nv_bo_alloc(&nvbo, &dst, w, h, tile_intel_x, -1, NOUVEAU_BO_GART); if (ret < 0) goto out; /* Set up something for our tile that should map into the first * y-major tile, assuming my understanding of documentation is * correct */ /* First tile should be read out in groups of 16 bytes that * are all set to a linear increasing value.. */ ptr = nvbi->map; for (y = 0; y < 8; ++y) for (x = 0; x < 512; x += 16) fill16(&ptr[y * w + x], (y * 512 + x)/16); for (y = 0; y < 8; ++y) for (x = 512; x < w; x += 16) fill16(&ptr[y * w + x], 0x3e); for (y = 8; y < h; ++y) for (x = 0; x < 512; x += 16) fill16(&ptr[y * w + x], 0x7e); for (y = 8; y < h; ++y) for (x = 512; x < w; x += 16) fill16(&ptr[y * w + x], 0xce); memset(nvbo->map, 0xfc, w * h); /* do this in software, there is no X major tiling in PCOPY (yet?) */ if (0 && pcopy) ret = perform_copy(nvbo, &dst, 0, 0, nvbi, &src, 0, 0, w, h); else ret = swtile_x(nvbo->map, nvbi->map, w, h); if (!ret) ret = check1_macro(nvbo->map, w/512, h/8); out: nouveau_bo_ref(NULL, &nvbo); nouveau_bo_ref(NULL, &nvbi); return ret; } static int check3(const uint32_t *p, uint32_t pitch, uint32_t lines, uint32_t sub_x, uint32_t sub_y, uint32_t sub_w, uint32_t sub_h) { uint32_t x, y; sub_w += sub_x; sub_h += sub_y; if (p[pitch * lines / 4 - 1] == 0x03030303) { fprintf(stderr, "copy failed: Not all lines have been copied back!\n"); return -1; } for (y = 0; y < lines; ++y) { for (x = 0; x < pitch; x += 4, ++p) { uint32_t expected; if ((x < sub_x || x >= sub_w) || (y < sub_y || y >= sub_h)) expected = 0x80808080; else expected = 0x04040404; if (*p != expected) { fprintf(stderr, "%u,%u should be %08x, but is %08x\n", x, y, expected, *p); return -1; } } } return 0; } /* copy from nvidia bo to intel bo and copy to a linear bo to check if tiling went succesful */ static int test3_base(int tile_src, int tile_dst) { struct nouveau_bo *bo_intel = NULL, *bo_nvidia = NULL, *bo_linear = NULL; rect intel, nvidia, linear; int ret; uint32_t cpp = 4; uint32_t src_x = 1 * cpp, src_y = 1; uint32_t dst_x = 2 * cpp, dst_y = 26; uint32_t w = 298 * cpp, h = 298; drm_intel_bo *test_intel_bo; int prime_fd; test_intel_bo = drm_intel_bo_alloc(bufmgr, "test bo", 2048 * cpp * 768, 4096); if (!test_intel_bo) return -1; drm_intel_bo_gem_export_to_prime(test_intel_bo, &prime_fd); if (prime_fd < 0) { drm_intel_bo_unreference(test_intel_bo); return -1; } ret = nv_bo_alloc(&bo_intel, &intel, 2048 * cpp, 768, tile_dst, prime_fd, 0); if (!ret) ret = nv_bo_alloc(&bo_nvidia, &nvidia, 300 * cpp, 300, tile_src, -1, NOUVEAU_BO_VRAM); if (!ret) ret = nv_bo_alloc(&bo_linear, &linear, 2048 * cpp, 768, 0, -1, NOUVEAU_BO_GART); if (ret) goto out; noop_intel(test_intel_bo); memset(bo_linear->map, 0x80, bo_linear->size); ret = perform_copy(bo_intel, &intel, 0, 0, bo_linear, &linear, 0, 0, linear.pitch, linear.h); if (ret) goto out; noop_intel(test_intel_bo); memset(bo_linear->map, 0x04, bo_linear->size); ret = perform_copy(bo_nvidia, &nvidia, 0, 0, bo_linear, &linear, 0, 0, nvidia.pitch, nvidia.h); if (ret) goto out; /* Perform the actual sub rectangle copy */ noop_intel(test_intel_bo); ret = perform_copy(bo_intel, &intel, dst_x, dst_y, bo_nvidia, &nvidia, src_x, src_y, w, h); if (ret) goto out; noop_intel(test_intel_bo); memset(bo_linear->map, 0x3, bo_linear->size); noop_intel(test_intel_bo); ret = perform_copy(bo_linear, &linear, 0, 0, bo_intel, &intel, 0, 0, intel.pitch, intel.h); if (ret) goto out; noop_intel(test_intel_bo); ret = check3(bo_linear->map, linear.pitch, linear.h, dst_x, dst_y, w, h); out: nouveau_bo_ref(NULL, &bo_linear); nouveau_bo_ref(NULL, &bo_nvidia); nouveau_bo_ref(NULL, &bo_intel); drm_intel_bo_unreference(test_intel_bo); return ret; } static int test3_1(void) { /* nvidia tiling to intel */ return test3_base(0x40, tile_intel_y); } static int test3_2(void) { /* intel tiling to nvidia */ return test3_base(tile_intel_y, 0x40); } static int test3_3(void) { /* intel tiling to linear */ return test3_base(tile_intel_y, 0); } static int test3_4(void) { /* linear tiling to intel */ return test3_base(0, tile_intel_y); } static int test3_5(void) { /* linear to linear */ return test3_base(0, 0); } /* Acquire when == SEQUENCE */ #define SEMA_ACQUIRE_EQUAL 1 /* Release, and write a 16 byte query structure to sema: * { (uint32)seq, (uint32)0, (uint64)timestamp } */ #define SEMA_WRITE_LONG 2 /* Acquire when >= SEQUENCE */ #define SEMA_ACQUIRE_GEQUAL 4 /* Test only new style semaphores, old ones are AWFUL */ static int test_semaphore(void) { drm_intel_bo *test_intel_bo = NULL; struct nouveau_bo *sema_bo = NULL; int ret = -1, prime_fd; uint32_t *sema; struct nouveau_pushbuf *push = npush; if (ndev->chipset < 0x84) return -1; /* Should probably be kept in sysmem */ test_intel_bo = drm_intel_bo_alloc(bufmgr, "semaphore bo", 4096, 4096); if (!test_intel_bo) goto out; drm_intel_bo_gem_export_to_prime(test_intel_bo, &prime_fd); if (prime_fd < 0) goto out; ret = nouveau_bo_prime_handle_ref(ndev, prime_fd, &sema_bo); close(prime_fd); if (ret < 0) goto out; ret = drm_intel_gem_bo_map_gtt(test_intel_bo); if (ret != 0) { fprintf(stderr,"failed to map bo\n"); goto out; } sema = test_intel_bo->virtual; sema++; *sema = 0; ret = -1; if (nouveau_pushbuf_space(push, 64, 0, 0) || nouveau_pushbuf_refn(push, &(struct nouveau_pushbuf_refn) { sema_bo, NOUVEAU_BO_GART|NOUVEAU_BO_RDWR }, 1)) goto out; if (ndev->chipset < 0xc0) { struct nv04_fifo *nv04_fifo = nchannel->data; /* kernel binds it's own dma object here and overwrites old one, * so just rebind vram every time we submit */ BEGIN_NV04(npush, SUBC_COPY(0x0060), 1); PUSH_DATA(npush, nv04_fifo->vram); } BEGIN_NVXX(push, SUBC_COPY(0x0010), 4); PUSH_DATA(push, sema_bo->offset >> 32); PUSH_DATA(push, sema_bo->offset + 4); PUSH_DATA(push, 2); // SEQUENCE PUSH_DATA(push, SEMA_WRITE_LONG); // TRIGGER BEGIN_NVXX(push, SUBC_COPY(0x0018), 2); PUSH_DATA(push, 3); PUSH_DATA(push, SEMA_ACQUIRE_EQUAL); BEGIN_NVXX(push, SUBC_COPY(0x0018), 2); PUSH_DATA(push, 4); PUSH_DATA(push, SEMA_WRITE_LONG); BEGIN_NVXX(push, SUBC_COPY(0x0018), 2); PUSH_DATA(push, 5); PUSH_DATA(push, SEMA_ACQUIRE_GEQUAL); BEGIN_NVXX(push, SUBC_COPY(0x0018), 2); PUSH_DATA(push, 6); PUSH_DATA(push, SEMA_WRITE_LONG); BEGIN_NVXX(push, SUBC_COPY(0x0018), 2); PUSH_DATA(push, 7); PUSH_DATA(push, SEMA_ACQUIRE_GEQUAL); BEGIN_NVXX(push, SUBC_COPY(0x0018), 2); PUSH_DATA(push, 9); PUSH_DATA(push, SEMA_WRITE_LONG); nouveau_pushbuf_kick(push, push->channel); usleep(1000); if (*sema != 2) { fprintf(stderr, "new sema should be 2 is %u\n", *sema); goto out; } *sema = 3; usleep(1000); if (*sema != 4) { fprintf(stderr, "new sema should be 4 is %u\n", *sema); goto out; } *sema = 5; usleep(1000); if (*sema != 6) { fprintf(stderr, "new sema should be 6 is %u\n", *sema); goto out; } *sema = 8; usleep(1000); if (*sema != 9) { fprintf(stderr, "new sema should be 9 is %u\n", *sema); goto out; } ret = 0; out: nouveau_bo_ref(NULL, &sema_bo); if (test_intel_bo) drm_intel_bo_unreference(test_intel_bo); return ret; } int main(int argc, char **argv) { int ret, failed = 0, run = 0; ret = find_and_open_devices(); if (ret < 0) return ret; if (nouveau_fd == -1 || intel_fd == -1) { fprintf(stderr,"failed to find intel and nouveau GPU\n"); return 77; } /* set up intel bufmgr */ bufmgr = drm_intel_bufmgr_gem_init(intel_fd, 4096); if (!bufmgr) return -1; /* Do not enable reuse, we share (almost) all buffers. */ //drm_intel_bufmgr_gem_enable_reuse(bufmgr); /* set up nouveau bufmgr */ ret = init_nouveau(); if (ret < 0) return 77; /* set up an intel batch buffer */ devid = intel_get_drm_devid(intel_fd); batch = intel_batchbuffer_alloc(bufmgr, devid); #define xtest(x, args...) do { \ ret = ((x)(args)); \ ++run; \ if (ret) { \ ++failed; \ fprintf(stderr, "prime_pcopy: failed " #x "\n"); } \ } while (0) xtest(test1_macro); xtest(test1_micro); xtest(test1_swizzle); xtest(test2); xtest(test3_1); xtest(test3_2); xtest(test3_3); xtest(test3_4); xtest(test3_5); xtest(test_semaphore); nouveau_bo_ref(NULL, &query_bo); nouveau_object_del(&pcopy); nouveau_bufctx_del(&nbufctx); nouveau_pushbuf_del(&npush); nouveau_object_del(&nchannel); intel_batchbuffer_free(batch); nouveau_client_del(&nclient); nouveau_device_del(&ndev); drm_intel_bufmgr_destroy(bufmgr); close(intel_fd); close(nouveau_fd); printf("Tests: %u run, %u failed\n", run, failed); return failed; } intel-gpu-tools-1.3/tests/gem_bad_batch.c0000664000175100017510000000416711566027747015420 00000000000000/* * Copyright © 2009 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Eric Anholt * Jesse Barnes (based on gem_bad_blit.c) * */ #include #include #include #include #include #include #include #include #include #include "drm.h" #include "i915_drm.h" #include "drmtest.h" #include "intel_bufmgr.h" #include "intel_batchbuffer.h" #include "intel_gpu_tools.h" static drm_intel_bufmgr *bufmgr; struct intel_batchbuffer *batch; static void bad_batch(void) { BEGIN_BATCH(2); OUT_BATCH(MI_BATCH_BUFFER_START); OUT_BATCH(0); ADVANCE_BATCH(); intel_batchbuffer_flush(batch); } int main(int argc, char **argv) { int fd; fd = drm_open_any(); bufmgr = drm_intel_bufmgr_gem_init(fd, 4096); drm_intel_bufmgr_gem_enable_reuse(bufmgr); batch = intel_batchbuffer_alloc(bufmgr, intel_get_drm_devid(fd)); bad_batch(); intel_batchbuffer_free(batch); drm_intel_bufmgr_destroy(bufmgr); close(fd); return 0; } intel-gpu-tools-1.3/tests/gem_storedw_loop_render.c0000664000175100017510000000724311733450453017574 00000000000000/* * Copyright © 2009 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Eric Anholt * Jesse Barnes (based on gem_bad_blit.c) * */ #include #include #include #include #include #include #include #include #include #include "drm.h" #include "i915_drm.h" #include "drmtest.h" #include "intel_bufmgr.h" #include "intel_batchbuffer.h" #include "intel_gpu_tools.h" static drm_intel_bufmgr *bufmgr; struct intel_batchbuffer *batch; static drm_intel_bo *target_buffer; static int has_ppgtt = 0; /* * Testcase: Basic render MI check using MI_STORE_DATA_IMM */ static void store_dword_loop(void) { int cmd, i, val = 0; uint32_t *buf; cmd = MI_STORE_DWORD_IMM; if (!has_ppgtt) cmd |= MI_MEM_VIRTUAL; for (i = 0; i < 0x100000; i++) { BEGIN_BATCH(4); OUT_BATCH(cmd); OUT_BATCH(0); /* reserved */ OUT_RELOC(target_buffer, I915_GEM_DOMAIN_INSTRUCTION, I915_GEM_DOMAIN_INSTRUCTION, 0); OUT_BATCH(val); ADVANCE_BATCH(); intel_batchbuffer_flush_on_ring(batch, 0); drm_intel_bo_map(target_buffer, 0); buf = target_buffer->virtual; if (buf[0] != val) { fprintf(stderr, "value mismatch: cur 0x%08x, stored 0x%08x\n", buf[0], val); exit(-1); } drm_intel_bo_unmap(target_buffer); val++; } drm_intel_bo_map(target_buffer, 0); buf = target_buffer->virtual; printf("completed %d writes successfully, current value: 0x%08x\n", i, buf[0]); drm_intel_bo_unmap(target_buffer); } int main(int argc, char **argv) { int fd; int devid; if (argc != 1) { fprintf(stderr, "usage: %s\n", argv[0]); exit(-1); } fd = drm_open_any(); devid = intel_get_drm_devid(fd); has_ppgtt = gem_uses_aliasing_ppgtt(fd); if (IS_GEN2(devid) || IS_GEN3(devid) || IS_GEN4(devid) || IS_GEN5(devid)) { fprintf(stderr, "MI_STORE_DATA can only use GTT address on gen4+/g33 and " "needs snoopable mem on pre-gen6\n"); return 77; } bufmgr = drm_intel_bufmgr_gem_init(fd, 4096); if (!bufmgr) { fprintf(stderr, "failed to init libdrm\n"); exit(-1); } drm_intel_bufmgr_gem_enable_reuse(bufmgr); batch = intel_batchbuffer_alloc(bufmgr, devid); if (!batch) { fprintf(stderr, "failed to create batch buffer\n"); exit(-1); } target_buffer = drm_intel_bo_alloc(bufmgr, "target bo", 4096, 4096); if (!target_buffer) { fprintf(stderr, "failed to alloc target buffer\n"); exit(-1); } store_dword_loop(); drm_intel_bo_unreference(target_buffer); intel_batchbuffer_free(batch); drm_intel_bufmgr_destroy(bufmgr); close(fd); return 0; } intel-gpu-tools-1.3/tests/gem_readwrite.c0000664000175100017510000000742211733450453015502 00000000000000/* * Copyright © 2008 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Eric Anholt * */ #include #include #include #include #include #include #include #include #include #include #include "drm.h" #include "i915_drm.h" #include "drmtest.h" #define OBJECT_SIZE 16384 static int do_read(int fd, int handle, void *buf, int offset, int size) { struct drm_i915_gem_pread read; /* Ensure that we don't have any convenient data in buf in case * we fail. */ memset(buf, 0xd0, size); memset(&read, 0, sizeof(read)); read.handle = handle; read.data_ptr = (uintptr_t)buf; read.size = size; read.offset = offset; return ioctl(fd, DRM_IOCTL_I915_GEM_PREAD, &read); } static int do_write(int fd, int handle, void *buf, int offset, int size) { struct drm_i915_gem_pwrite write; memset(&write, 0, sizeof(write)); write.handle = handle; write.data_ptr = (uintptr_t)buf; write.size = size; write.offset = offset; return ioctl(fd, DRM_IOCTL_I915_GEM_PWRITE, &write); } int main(int argc, char **argv) { int fd; uint8_t expected[OBJECT_SIZE]; uint8_t buf[OBJECT_SIZE]; int ret; int handle; fd = drm_open_any(); handle = gem_create(fd, OBJECT_SIZE); printf("Testing contents of newly created object.\n"); ret = do_read(fd, handle, buf, 0, OBJECT_SIZE); assert(ret == 0); memset(&expected, 0, sizeof(expected)); assert(memcmp(expected, buf, sizeof(expected)) == 0); printf("Testing read beyond end of buffer.\n"); ret = do_read(fd, handle, buf, OBJECT_SIZE / 2, OBJECT_SIZE); assert(ret == -1 && errno == EINVAL); printf("Testing full write of buffer\n"); memset(buf, 0, sizeof(buf)); memset(buf + 1024, 0x01, 1024); memset(expected + 1024, 0x01, 1024); ret = do_write(fd, handle, buf, 0, OBJECT_SIZE); assert(ret == 0); ret = do_read(fd, handle, buf, 0, OBJECT_SIZE); assert(ret == 0); assert(memcmp(buf, expected, sizeof(buf)) == 0); printf("Testing partial write of buffer\n"); memset(buf + 4096, 0x02, 1024); memset(expected + 4096, 0x02, 1024); ret = do_write(fd, handle, buf + 4096, 4096, 1024); assert(ret == 0); ret = do_read(fd, handle, buf, 0, OBJECT_SIZE); assert(ret == 0); assert(memcmp(buf, expected, sizeof(buf)) == 0); printf("Testing partial read of buffer\n"); ret = do_read(fd, handle, buf, 512, 1024); assert(ret == 0); assert(memcmp(buf, expected + 512, 1024) == 0); printf("Testing read of bad buffer handle\n"); ret = do_read(fd, 1234, buf, 0, 1024); assert(ret == -1 && errno == ENOENT); printf("Testing write of bad buffer handle\n"); ret = do_write(fd, 1234, buf, 0, 1024); assert(ret == -1 && errno == ENOENT); close(fd); return 0; } intel-gpu-tools-1.3/tests/gem_ctx_bad_destroy.c0000664000175100017510000000611111772702746016673 00000000000000/* * Copyright © 2012 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Ben Widawsky * */ /* * Negative test cases for destroy contexts */ #include #include #include "i915_drm.h" #include "drmtest.h" struct local_drm_i915_context_create { __u32 ctx_id; __u32 pad; }; struct local_drm_i915_context_destroy { __u32 ctx_id; __u32 pad; }; #define CONTEXT_CREATE_IOCTL DRM_IOWR(DRM_COMMAND_BASE + 0x2d, struct local_drm_i915_context_create) #define CONTEXT_DESTROY_IOCTL DRM_IOWR(DRM_COMMAND_BASE + 0x2e, struct local_drm_i915_context_destroy) static uint32_t context_create(int fd) { struct local_drm_i915_context_create create; int ret; ret = drmIoctl(fd, CONTEXT_CREATE_IOCTL, &create); if (ret == -1 && (errno == ENODEV || errno == EINVAL)) exit(77); else if (ret) abort(); return create.ctx_id; } static void handle_bad(int ret, int lerrno, int expected, const char *desc) { if (ret != 0 && lerrno != expected) { fprintf(stderr, "%s - errno was %d, but should have been %d\n", desc, lerrno, expected); exit(EXIT_FAILURE); } else if (ret == 0) { fprintf(stderr, "%s - Command succeeded, but should have failed\n", desc); exit(EXIT_FAILURE); } } int main(int argc, char *argv[]) { struct local_drm_i915_context_destroy destroy; uint32_t ctx_id; int ret, fd; fd = drm_open_any(); ctx_id = context_create(fd); destroy.ctx_id = ctx_id; /* Make sure a proper destroy works first */ ret = drmIoctl(fd, CONTEXT_DESTROY_IOCTL, &destroy); assert(ret == 0); /* try double destroy */ ret = drmIoctl(fd, CONTEXT_DESTROY_IOCTL, &destroy); handle_bad(ret, errno, ENOENT, "double destroy"); /* destroy something random */ destroy.ctx_id = 2; ret = drmIoctl(fd, CONTEXT_DESTROY_IOCTL, &destroy); handle_bad(ret, errno, ENOENT, "random destroy"); /* Try to destroy the default context */ destroy.ctx_id = 0; ret = drmIoctl(fd, CONTEXT_DESTROY_IOCTL, &destroy); handle_bad(ret, errno, ENOENT, "default destroy"); close(fd); exit(EXIT_SUCCESS); } intel-gpu-tools-1.3/tests/gem_reg_read.c0000664000175100017510000000516612007545764015274 00000000000000/* * Copyright © 2012 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Ben Widawsky * */ #include #include #include "i915_drm.h" #include "drmtest.h" struct local_drm_i915_reg_read { __u64 offset; __u64 val; /* Return value */ }; #define REG_READ_IOCTL DRM_IOWR(DRM_COMMAND_BASE + 0x31, struct local_drm_i915_reg_read) static void handle_bad(int ret, int lerrno, int expected, const char *desc) { if (ret != 0 && lerrno != expected) { fprintf(stderr, "%s - errno was %d, but should have been %d\n", desc, lerrno, expected); exit(EXIT_FAILURE); } else if (ret == 0) { fprintf(stderr, "%s - Command succeeded, but should have failed\n", desc); exit(EXIT_FAILURE); } } static uint64_t timer_query(int fd) { struct local_drm_i915_reg_read read; int ret; read.offset = 0x2358; ret = drmIoctl(fd, REG_READ_IOCTL, &read); if (ret) { perror("positive test case failed: "); exit(EXIT_FAILURE); } return read.val; } int main(int argc, char *argv[]) { struct local_drm_i915_reg_read read; int ret, fd; uint64_t val; fd = drm_open_any(); read.offset = 0x2358; ret = drmIoctl(fd, REG_READ_IOCTL, &read); if (errno == EINVAL) exit(77); else if (ret) exit(EXIT_FAILURE); val = timer_query(fd); sleep(1); if (timer_query(fd) == val) { fprintf(stderr, "Timer isn't moving, probably busted\n"); exit(EXIT_FAILURE); } /* bad reg */ read.offset = 0x12345678; ret = drmIoctl(fd, REG_READ_IOCTL, &read); handle_bad(ret, errno, EINVAL, "bad register"); close(fd); exit(EXIT_SUCCESS); } intel-gpu-tools-1.3/tests/gem_tiled_pread_pwrite.c0000664000175100017510000001013511752544417017362 00000000000000/* * Copyright © 2009 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Eric Anholt * */ /** @file gem_tiled_pread_pwrite.c * * This is a test of pread's behavior on tiled objects with respect to the * reported swizzling value. * * The goal is to exercise the slow_bit17_copy path for reading on bit17 * machines, but will also be useful for catching swizzling value bugs on * other systems. */ /* * Testcase: Test swizzling by testing pwrite does the invers of pread * * Together with the explicit pread testcase, this should cover our swizzle * handling. * * Note that this test will use swap in an effort to test all of ram. */ #include #include #include #include #include #include #include #include #include #include #include #include "drm.h" #include "i915_drm.h" #include "drmtest.h" #include "intel_gpu_tools.h" #define WIDTH 512 #define HEIGHT 512 static uint32_t linear[WIDTH * HEIGHT]; static uint32_t current_tiling_mode; #define PAGE_SIZE 4096 static void gem_get_tiling(int fd, uint32_t handle, uint32_t *tiling, uint32_t *swizzle) { struct drm_i915_gem_get_tiling get_tiling; int ret; memset(&get_tiling, 0, sizeof(get_tiling)); get_tiling.handle = handle; ret = drmIoctl(fd, DRM_IOCTL_I915_GEM_GET_TILING, &get_tiling); assert(ret == 0); *tiling = get_tiling.tiling_mode; *swizzle = get_tiling.swizzle_mode; } static uint32_t create_bo_and_fill(int fd) { uint32_t handle; uint32_t *data; int i; handle = gem_create(fd, sizeof(linear)); gem_set_tiling(fd, handle, current_tiling_mode, WIDTH * sizeof(uint32_t)); /* Fill the BO with dwords starting at start_val */ data = gem_mmap(fd, handle, sizeof(linear), PROT_READ | PROT_WRITE); for (i = 0; i < WIDTH*HEIGHT; i++) data[i] = i; munmap(data, sizeof(linear)); return handle; } static uint32_t create_bo(int fd) { uint32_t handle; handle = gem_create(fd, sizeof(linear)); gem_set_tiling(fd, handle, current_tiling_mode, WIDTH * sizeof(uint32_t)); return handle; } int main(int argc, char **argv) { int fd; uint32_t *data; int i, j; uint32_t tiling, swizzle; uint32_t handle, handle_target; int count; fd = drm_open_any(); count = intel_get_total_ram_mb() * 9 / 10; for (i = 0; i < count/2; i++) { current_tiling_mode = I915_TILING_X; handle = create_bo_and_fill(fd); gem_get_tiling(fd, handle, &tiling, &swizzle); gem_read(fd, handle, 0, linear, sizeof(linear)); handle_target = create_bo(fd); gem_write(fd, handle_target, 0, linear, sizeof(linear)); /* Check the target bo's contents. */ data = gem_mmap(fd, handle_target, sizeof(linear), PROT_READ | PROT_WRITE); for (j = 0; j < WIDTH*HEIGHT; j++) if (data[j] != j) { fprintf(stderr, "mismatch at %i: %i\n", j, data[j]); exit(1); } munmap(data, sizeof(linear)); /* Leak both bos so that we use all of system mem! */ drmtest_progress("gem_tiled_pread_pwrite: ", i, count/2); } close(fd); return 0; } intel-gpu-tools-1.3/tests/drm_vma_limiter.c0000664000175100017510000000617311706636070016041 00000000000000/* * Copyright © 2011 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Daniel Vetter */ #include #include #include #include #include #include #include #include #include #include "drm.h" #include "i915_drm.h" #include "drmtest.h" #include "intel_bufmgr.h" #include "intel_batchbuffer.h" #include "intel_gpu_tools.h" static drm_intel_bufmgr *bufmgr; struct intel_batchbuffer *batch; /* Testcase: check whether the libdrm vma limiter works * * We've had reports of the X server exhausting the default rlimit of 64k vma's * in the kernel. libdrm has grown facilities to limit the vma caching since, * this checks whether they actually work. */ /* we do both cpu and gtt maps, so only need half of 64k to exhaust */ #define BO_ARRAY_SIZE 35000 drm_intel_bo *bos[BO_ARRAY_SIZE]; int main(int argc, char **argv) { int fd; int i; char *ptr; fd = drm_open_any(); bufmgr = drm_intel_bufmgr_gem_init(fd, 4096); drm_intel_bufmgr_gem_enable_reuse(bufmgr); batch = intel_batchbuffer_alloc(bufmgr, intel_get_drm_devid(fd)); drm_intel_bufmgr_gem_set_vma_cache_size(bufmgr, 500); for (i = 0; i < BO_ARRAY_SIZE; i++) { bos[i] = drm_intel_bo_alloc(bufmgr, "mmap bo", 4096, 4096); assert(bos[i]); drm_intel_bo_map(bos[i], 1); ptr = bos[i]->virtual; assert(ptr); *ptr = 'c'; drm_intel_bo_unmap(bos[i]); drm_intel_gem_bo_map_gtt(bos[i]); ptr = bos[i]->virtual; assert(ptr); *ptr = 'c'; drm_intel_gem_bo_unmap_gtt(bos[i]); } /* and recheck whether a second map of the same still works */ for (i = 0; i < BO_ARRAY_SIZE; i++) { bos[i] = drm_intel_bo_alloc(bufmgr, "mmap bo", 4096, 4096); assert(bos[i]); drm_intel_bo_map(bos[i], 1); ptr = bos[i]->virtual; assert(*ptr = 'c'); drm_intel_bo_unmap(bos[i]); drm_intel_gem_bo_map_gtt(bos[i]); ptr = bos[i]->virtual; assert(*ptr = 'c'); drm_intel_gem_bo_unmap_gtt(bos[i]); } intel_batchbuffer_free(batch); drm_intel_bufmgr_destroy(bufmgr); close(fd); return 0; } intel-gpu-tools-1.3/tests/gem_tiled_pread.c0000664000175100017510000001363311706636070015772 00000000000000/* * Copyright © 2009 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Eric Anholt * */ /** @file gem_tiled_pread.c * * This is a test of pread's behavior on tiled objects with respect to the * reported swizzling value. * * The goal is to exercise the slow_bit17_copy path for reading on bit17 * machines, but will also be useful for catching swizzling value bugs on * other systems. */ #include #include #include #include #include #include #include #include #include #include #include #include "drm.h" #include "i915_drm.h" #include "drmtest.h" #include "intel_gpu_tools.h" #define WIDTH 512 #define HEIGHT 512 static uint32_t linear[WIDTH * HEIGHT]; #define PAGE_SIZE 4096 static int tile_width; static int tile_height; static int tile_size; static void gem_get_tiling(int fd, uint32_t handle, uint32_t *tiling, uint32_t *swizzle) { struct drm_i915_gem_get_tiling get_tiling; int ret; memset(&get_tiling, 0, sizeof(get_tiling)); get_tiling.handle = handle; ret = drmIoctl(fd, DRM_IOCTL_I915_GEM_GET_TILING, &get_tiling); assert(ret == 0); *tiling = get_tiling.tiling_mode; *swizzle = get_tiling.swizzle_mode; } static uint32_t create_bo(int fd) { uint32_t handle; uint32_t *data; int i; handle = gem_create(fd, sizeof(linear)); gem_set_tiling(fd, handle, I915_TILING_X, WIDTH * sizeof(uint32_t)); /* Fill the BO with dwords starting at start_val */ data = gem_mmap(fd, handle, sizeof(linear), PROT_READ | PROT_WRITE); for (i = 0; i < WIDTH*HEIGHT; i++) data[i] = i; munmap(data, sizeof(linear)); return handle; } static int swizzle_bit(int bit, int offset) { return (offset & (1 << bit)) >> (bit - 6); } /* Translate from a swizzled offset in the tiled buffer to the corresponding * value from the original linear buffer. */ static uint32_t calculate_expected(int offset) { int tile_off = offset & (tile_size - 1); int tile_base = offset & -tile_size; int tile_index = tile_base / tile_size; int tiles_per_row = 4*WIDTH / tile_width; /* base x,y values from the tile (page) index. */ int base_y = tile_index / tiles_per_row * tile_height; int base_x = tile_index % tiles_per_row * (tile_width/4); /* x, y offsets within the tile */ int tile_y = tile_off / tile_width; int tile_x = (tile_off % tile_width) / 4; /* printf("%3d, %3d, %3d,%3d\n", base_x, base_y, tile_x, tile_y); */ return (base_y + tile_y) * WIDTH + base_x + tile_x; } int main(int argc, char **argv) { int fd; int i, iter = 100; uint32_t tiling, swizzle; uint32_t handle; uint32_t devid; fd = drm_open_any(); handle = create_bo(fd); gem_get_tiling(fd, handle, &tiling, &swizzle); devid = intel_get_drm_devid(fd); if (IS_GEN2(devid)) { tile_height = 16; tile_width = 128; tile_size = 2048; } else { tile_height = 8; tile_width = 512; tile_size = PAGE_SIZE; } /* Read a bunch of random subsets of the data and check that they come * out right. */ for (i = 0; i < iter; i++) { int size = WIDTH * HEIGHT * 4; int offset = (random() % size) & ~3; int len = (random() % size) & ~3; int j; if (len == 0) len = 4; if (offset + len > size) len = size - offset; if (i == 0) { offset = 0; len = size; } gem_read(fd, handle, offset, linear, len); /* Translate from offsets in the read buffer to the swizzled * address that it corresponds to. This is the opposite of * what Mesa does (calculate offset to be read given the linear * offset it's looking for). */ for (j = offset; j < offset + len; j += 4) { uint32_t expected_val, found_val; int swizzled_offset; const char *swizzle_str; switch (swizzle) { case I915_BIT_6_SWIZZLE_NONE: swizzled_offset = j; swizzle_str = "none"; break; case I915_BIT_6_SWIZZLE_9: swizzled_offset = j ^ swizzle_bit(9, j); swizzle_str = "bit9"; break; case I915_BIT_6_SWIZZLE_9_10: swizzled_offset = j ^ swizzle_bit(9, j) ^ swizzle_bit(10, j); swizzle_str = "bit9^10"; break; case I915_BIT_6_SWIZZLE_9_11: swizzled_offset = j ^ swizzle_bit(9, j) ^ swizzle_bit(11, j); swizzle_str = "bit9^11"; break; case I915_BIT_6_SWIZZLE_9_10_11: swizzled_offset = j ^ swizzle_bit(9, j) ^ swizzle_bit(10, j) ^ swizzle_bit(11, j); swizzle_str = "bit9^10^11"; break; default: fprintf(stderr, "Bad swizzle bits; %d\n", swizzle); abort(); } expected_val = calculate_expected(swizzled_offset); found_val = linear[(j - offset) / 4]; if (expected_val != found_val) { fprintf(stderr, "Bad read [%d]: %d instead of %d at 0x%08x " "for read from 0x%08x to 0x%08x, swizzle=%s\n", i, found_val, expected_val, j, offset, offset + len, swizzle_str); abort(); } } } close(fd); return 0; } intel-gpu-tools-1.3/tests/gem_storedw_batches_loop.c0000664000175100017510000001037111733450453017722 00000000000000/* * Copyright © 2009 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Eric Anholt * Jesse Barnes (based on gem_bad_blit.c) * */ #include #include #include #include #include #include #include #include #include #include "drm.h" #include "i915_drm.h" #include "drmtest.h" #include "intel_bufmgr.h" #include "intel_batchbuffer.h" #include "intel_gpu_tools.h" static drm_intel_bufmgr *bufmgr; static drm_intel_bo *target_bo; static int has_ppgtt = 0; /* Like the store dword test, but we create new command buffers each time */ static void store_dword_loop(void) { int cmd, i, val = 0, ret; uint32_t *buf; drm_intel_bo *cmd_bo; cmd = MI_STORE_DWORD_IMM; if (!has_ppgtt) cmd |= MI_MEM_VIRTUAL; for (i = 0; i < 0x80000; i++) { cmd_bo = drm_intel_bo_alloc(bufmgr, "cmd bo", 4096, 4096); if (!cmd_bo) { fprintf(stderr, "failed to alloc cmd bo\n"); exit(-1); } drm_intel_bo_map(cmd_bo, 1); buf = cmd_bo->virtual; buf[0] = cmd; buf[1] = 0; buf[2] = target_bo->offset; buf[3] = 0x42000000 + val; ret = drm_intel_bo_references(cmd_bo, target_bo); if (ret) { fprintf(stderr, "failed to link cmd & target bos\n"); exit(-1); } ret = drm_intel_bo_emit_reloc(cmd_bo, 8, target_bo, 0, I915_GEM_DOMAIN_INSTRUCTION, I915_GEM_DOMAIN_INSTRUCTION); if (ret) { fprintf(stderr, "failed to emit reloc\n"); exit(-1); } buf[4] = MI_BATCH_BUFFER_END; buf[5] = MI_BATCH_BUFFER_END; drm_intel_bo_unmap(cmd_bo); ret = drm_intel_bo_references(cmd_bo, target_bo); if (ret != 1) { fprintf(stderr, "bad bo reference count: %d\n", ret); exit(-1); } ret = drm_intel_bo_exec(cmd_bo, 6 * 4, NULL, 0, 0); if (ret) { fprintf(stderr, "bo exec failed: %d\n", ret); exit(-1); } drm_intel_bo_wait_rendering(cmd_bo); drm_intel_bo_map(target_bo, 1); buf = target_bo->virtual; if (buf[0] != (0x42000000 | val)) { fprintf(stderr, "value mismatch: cur 0x%08x, stored 0x%08x\n", buf[0], 0x42000000 | val); exit(-1); } buf[0] = 0; /* let batch write it again */ drm_intel_bo_unmap(target_bo); drm_intel_bo_unreference(cmd_bo); val++; } printf("completed %d writes successfully\n", i); } int main(int argc, char **argv) { int fd; int devid; if (argc != 1) { fprintf(stderr, "usage: %s\n", argv[0]); exit(-1); } fd = drm_open_any(); devid = intel_get_drm_devid(fd); has_ppgtt = gem_uses_aliasing_ppgtt(fd); if (IS_GEN2(devid) || IS_GEN3(devid) || IS_GEN4(devid) || IS_GEN5(devid)) { fprintf(stderr, "MI_STORE_DATA can only use GTT address on gen4+/g33 and" "needs snoopable mem on pre-gen6\n"); return 77; } bufmgr = drm_intel_bufmgr_gem_init(fd, 4096); if (!bufmgr) { fprintf(stderr, "failed to init libdrm\n"); exit(-1); } // drm_intel_bufmgr_gem_enable_reuse(bufmgr); target_bo = drm_intel_bo_alloc(bufmgr, "target bo", 4096, 4096); if (!target_bo) { fprintf(stderr, "failed to alloc target buffer\n"); exit(-1); } store_dword_loop(); drm_intel_bo_unreference(target_bo); drm_intel_bufmgr_destroy(bufmgr); close(fd); return 0; } intel-gpu-tools-1.3/tests/gem_set_tiling_vs_blt.c0000664000175100017510000002031011743466312017217 00000000000000/* * Copyright © 2012 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Daniel Vetter * */ /** @file gem_set_tiling_vs_blt.c * * Testcase: Check for proper synchronization of tiling changes vs. tiled gpu * access * * The blitter on gen3 and earlier needs properly set up fences. Which also * means that for untiled blits we may not set up a fence before that blt has * finished. * * Current kernels have a bug there, but it's pretty hard to hit because you * need: * - a blt on an untiled object which is aligned correctly for tiling. * - a set_tiling to switch that object to tiling * - another blt without any intervening cpu access that uses this object. * * Testcase has been extended to also check tiled->untiled and tiled->tiled * transitions (i.e. changing stride). */ #include #include #include #include #include #include #include #include #include #include #include "drm.h" #include "i915_drm.h" #include "drmtest.h" #include "intel_bufmgr.h" #include "intel_batchbuffer.h" #include "intel_gpu_tools.h" static drm_intel_bufmgr *bufmgr; struct intel_batchbuffer *batch; uint32_t devid; #define TEST_SIZE (1024*1024) #define TEST_STRIDE (4*1024) #define TEST_HEIGHT(stride) (TEST_SIZE/(stride)) #define TEST_WIDTH(stride) ((stride)/4) uint32_t data[TEST_SIZE/4]; static void do_test(uint32_t tiling, unsigned stride, uint32_t tiling_after, unsigned stride_after) { drm_intel_bo *busy_bo, *test_bo, *target_bo; int i, ret; uint32_t *ptr; uint32_t test_bo_handle; uint32_t blt_stride, blt_bits; bool tiling_changed = false; printf("filling ring .. "); busy_bo = drm_intel_bo_alloc(bufmgr, "busy bo bo", 16*1024*1024, 4096); for (i = 0; i < 250; i++) { BEGIN_BATCH(8); OUT_BATCH(XY_SRC_COPY_BLT_CMD | XY_SRC_COPY_BLT_WRITE_ALPHA | XY_SRC_COPY_BLT_WRITE_RGB); OUT_BATCH((3 << 24) | /* 32 bits */ (0xcc << 16) | /* copy ROP */ 2*1024*4); OUT_BATCH(0 << 16 | 1024); OUT_BATCH((2048) << 16 | (2048)); OUT_RELOC_FENCED(busy_bo, I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER, 0); OUT_BATCH(0 << 16 | 0); OUT_BATCH(2*1024*4); OUT_RELOC_FENCED(busy_bo, I915_GEM_DOMAIN_RENDER, 0, 0); ADVANCE_BATCH(); if (IS_GEN6(devid) || IS_GEN7(devid)) { BEGIN_BATCH(3); OUT_BATCH(XY_SETUP_CLIP_BLT_CMD); OUT_BATCH(0); OUT_BATCH(0); ADVANCE_BATCH(); } } intel_batchbuffer_flush(batch); printf("playing tricks .. "); /* first allocate the target so it gets out of the way of playing funky * tricks */ target_bo = drm_intel_bo_alloc(bufmgr, "target bo", TEST_SIZE, 4096); /* allocate buffer with parameters _after_ transition we want to check * and touch it, so that it's properly aligned in the gtt. */ test_bo = drm_intel_bo_alloc(bufmgr, "tiled busy bo", TEST_SIZE, 4096); test_bo_handle = test_bo->handle; ret = drm_intel_bo_set_tiling(test_bo, &tiling_after, stride_after); assert(ret == 0); drm_intel_gem_bo_map_gtt(test_bo); ptr = test_bo->virtual; *ptr = 0; ptr = NULL; drm_intel_gem_bo_unmap_gtt(test_bo); drm_intel_bo_unreference(test_bo); test_bo = NULL; /* note we need a bo bigger than batches, otherwise the buffer reuse * trick will fail. */ test_bo = drm_intel_bo_alloc(bufmgr, "busy bo", TEST_SIZE, 4096); if (test_bo_handle != test_bo->handle) fprintf(stderr, "libdrm reuse trick failed\n"); test_bo_handle = test_bo->handle; /* ensure we have the right tiling before we start. */ ret = drm_intel_bo_set_tiling(test_bo, &tiling, stride); assert(ret == 0); if (tiling == I915_TILING_NONE) { drm_intel_bo_subdata(test_bo, 0, TEST_SIZE, data); } else { drm_intel_gem_bo_map_gtt(test_bo); ptr = test_bo->virtual; memcpy(ptr, data, TEST_SIZE); ptr = NULL; drm_intel_gem_bo_unmap_gtt(test_bo); } blt_stride = stride; blt_bits = 0; if (intel_gen(devid) >= 4 && tiling != I915_TILING_NONE) { blt_stride /= 4; blt_bits = XY_SRC_COPY_BLT_SRC_TILED; } BEGIN_BATCH(8); OUT_BATCH(XY_SRC_COPY_BLT_CMD | XY_SRC_COPY_BLT_WRITE_ALPHA | blt_bits | XY_SRC_COPY_BLT_WRITE_RGB); OUT_BATCH((3 << 24) | /* 32 bits */ (0xcc << 16) | /* copy ROP */ stride); OUT_BATCH(0 << 16 | 0); OUT_BATCH((TEST_HEIGHT(stride)) << 16 | (TEST_WIDTH(stride))); OUT_RELOC_FENCED(target_bo, I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER, 0); OUT_BATCH(0 << 16 | 0); OUT_BATCH(blt_stride); OUT_RELOC_FENCED(test_bo, I915_GEM_DOMAIN_RENDER, 0, 0); ADVANCE_BATCH(); intel_batchbuffer_flush(batch); drm_intel_bo_unreference(test_bo); test_bo = drm_intel_bo_alloc_for_render(bufmgr, "tiled busy bo", TEST_SIZE, 4096); if (test_bo_handle != test_bo->handle) fprintf(stderr, "libdrm reuse trick failed\n"); ret = drm_intel_bo_set_tiling(test_bo, &tiling_after, stride_after); assert(ret == 0); /* Note: We don't care about gen4+ here because the blitter doesn't use * fences there. So not setting tiling flags on the tiled buffer is ok. */ BEGIN_BATCH(8); OUT_BATCH(XY_SRC_COPY_BLT_CMD | XY_SRC_COPY_BLT_WRITE_ALPHA | XY_SRC_COPY_BLT_WRITE_RGB); OUT_BATCH((3 << 24) | /* 32 bits */ (0xcc << 16) | /* copy ROP */ stride_after); OUT_BATCH(0 << 16 | 0); OUT_BATCH((1) << 16 | (1)); OUT_RELOC_FENCED(test_bo, I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER, 0); OUT_BATCH(0 << 16 | 0); OUT_BATCH(stride_after); OUT_RELOC_FENCED(test_bo, I915_GEM_DOMAIN_RENDER, 0, 0); ADVANCE_BATCH(); intel_batchbuffer_flush(batch); /* Now try to trick the kernel the kernel into changing up the fencing * too early. */ printf("checking .. "); memset(data, 0, TEST_SIZE); drm_intel_bo_get_subdata(target_bo, 0, TEST_SIZE, data); for (i = 0; i < TEST_SIZE/4; i++) assert(data[i] == i); /* check whether tiling on the test_bo actually changed. */ drm_intel_gem_bo_map_gtt(test_bo); ptr = test_bo->virtual; for (i = 0; i < TEST_SIZE/4; i++) if (ptr[i] != data[i]) tiling_changed = true; ptr = NULL; drm_intel_gem_bo_unmap_gtt(test_bo); assert(tiling_changed); drm_intel_bo_unreference(test_bo); drm_intel_bo_unreference(target_bo); drm_intel_bo_unreference(busy_bo); printf("done\n"); } int main(int argc, char **argv) { int i, fd; uint32_t tiling, tiling_after; for (i = 0; i < 1024*256; i++) data[i] = i; fd = drm_open_any(); bufmgr = drm_intel_bufmgr_gem_init(fd, 4096); drm_intel_bufmgr_gem_enable_reuse(bufmgr); devid = intel_get_drm_devid(fd); batch = intel_batchbuffer_alloc(bufmgr, devid); printf("testing untiled->tiled transisition:\n"); tiling = I915_TILING_NONE; tiling_after = I915_TILING_X; do_test(tiling, TEST_STRIDE, tiling_after, TEST_STRIDE); assert(tiling == I915_TILING_NONE); assert(tiling_after == I915_TILING_X); printf("testing tiled->untiled transisition:\n"); tiling = I915_TILING_X; tiling_after = I915_TILING_NONE; do_test(tiling, TEST_STRIDE, tiling_after, TEST_STRIDE); assert(tiling == I915_TILING_X); assert(tiling_after == I915_TILING_NONE); printf("testing tiled->tiled transisition:\n"); tiling = I915_TILING_X; tiling_after = I915_TILING_X; do_test(tiling, TEST_STRIDE/2, tiling_after, TEST_STRIDE); assert(tiling == I915_TILING_X); assert(tiling_after == I915_TILING_X); return 0; } intel-gpu-tools-1.3/tests/Makefile.am0000644000175100017510000000630012015770040014533 00000000000000noinst_PROGRAMS = \ gem_stress \ $(TESTS_progs) \ $(HANG) \ $(NULL) if HAVE_NOUVEAU NOUVEAU_TESTS = \ prime_nv_api \ prime_nv_pcopy \ prime_nv_test endif TESTS_progs = \ getversion \ getclient \ getstats \ gem_basic \ gem_cpu_concurrent_blit \ gem_gtt_concurrent_blit \ gem_exec_nop \ gem_exec_blt \ gem_exec_bad_domains \ gem_exec_faulting_reloc \ gem_flink \ gem_readwrite \ gem_ringfill \ gem_mmap \ gem_mmap_gtt \ gem_mmap_offset_exhaustion \ gem_pwrite \ gem_pread_after_blit \ gem_set_tiling_vs_blt \ gem_set_tiling_vs_gtt \ gem_set_tiling_vs_pwrite \ gem_tiled_pread \ gem_tiled_pread_pwrite \ gem_tiled_partial_pwrite_pread \ gem_tiled_swapping \ gem_partial_pwrite_pread \ gem_linear_blits \ gem_vmap_blits \ gem_tiled_blits \ gem_tiled_fence_blits \ gem_largeobject \ gem_bad_length \ gem_fence_thrash \ gem_fenced_exec_thrash \ gem_gtt_speed \ gem_gtt_cpu_tlb \ gem_cs_prefetch \ gen3_render_linear_blits \ gen3_render_tiledx_blits \ gen3_render_tiledy_blits \ gen3_render_mixed_blits \ gen3_mixed_blits \ gem_storedw_loop_render \ gem_storedw_loop_blt \ gem_storedw_loop_bsd \ gem_storedw_batches_loop \ gem_dummy_reloc_loop \ gem_double_irq_loop \ gem_ring_sync_loop \ gem_pipe_control_store_loop \ gem_unfence_active_buffers \ gem_unref_active_buffers \ gem_reloc_vs_gpu \ drm_vma_limiter \ drm_vma_limiter_cpu \ drm_vma_limiter_gtt \ drm_vma_limiter_cached \ sysfs_rc6_residency \ flip_test \ gem_wait_render_timeout \ gem_ctx_create \ gem_ctx_bad_destroy \ gem_ctx_exec \ gem_ctx_bad_exec \ gem_ctx_basic \ gem_reg_read \ $(NOUVEAU_TESTS) \ prime_self_import \ $(NULL) # IMPORTANT: The ZZ_ tests need to be run last! # ... and make can't deal with inlined comments ... TESTS_scripts = \ debugfs_reader \ debugfs_emon_crash \ sysfs_l3_parity \ sysfs_edid_timing \ module_reload \ ZZ_check_dmesg \ ZZ_hangman \ $(NULL) kernel_tests = \ $(TESTS_progs) \ $(TESTS_scripts) \ $(NULL) TESTS = \ $(NULL) test: whoami | grep root || ( echo ERROR: not running as root; exit 1 ) ./check_drm_clients make TESTS="${kernel_tests}" check HANG = \ gem_bad_batch \ gem_hang \ gem_bad_blit \ gem_bad_address \ $(NULL) EXTRA_PROGRAMS = $(TESTS_progs) $(HANG) EXTRA_DIST = $(TESTS_scripts) drm_lib.sh check_drm_clients debugfs_wedged CLEANFILES = $(EXTRA_PROGRAMS) AM_CFLAGS = $(DRM_CFLAGS) $(CWARNFLAGS) \ -I$(srcdir)/.. \ -I$(srcdir)/../lib LDADD = ../lib/libintel_tools.la $(PCIACCESS_LIBS) $(DRM_LIBS) testdisplay_SOURCES = \ testdisplay.c \ testdisplay.h \ testdisplay_hotplug.c \ $(NULL) TESTS_progs += testdisplay LDADD += $(CAIRO_LIBS) $(LIBUDEV_LIBS) $(GLIB_LIBS) AM_CFLAGS += $(CAIRO_CFLAGS) $(LIBUDEV_CFLAGS) $(GLIB_CFLAGS) gem_fence_thrash_CFLAGS = $(AM_CFLAGS) $(THREAD_CFLAGS) gem_fence_thrash_LDADD = $(LDADD) -lpthread gem_wait_render_timeout_LDADD = $(LDADD) -lrt gem_ctx_basic_LDADD = $(LDADD) -lpthread prime_nv_test_CFLAGS = $(AM_CFLAGS) $(DRM_NOUVEAU_CFLAGS) prime_nv_test_LDADD = $(LDADD) $(DRM_NOUVEAU_LIBS) prime_nv_api_CFLAGS = $(AM_CFLAGS) $(DRM_NOUVEAU_CFLAGS) prime_nv_api_LDADD = $(LDADD) $(DRM_NOUVEAU_LIBS) prime_nv_pcopy_CFLAGS = $(AM_CFLAGS) $(DRM_NOUVEAU_CFLAGS) prime_nv_pcopy_LDADD = $(LDADD) $(DRM_NOUVEAU_LIBS) intel-gpu-tools-1.3/tests/testdisplay_hotplug.c0000664000175100017510000000660311707505022016765 00000000000000/* * Copyright 2010 Intel Corporation * Jesse Barnes * * 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 OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. */ #include #include #include #include "testdisplay.h" #ifdef HAVE_CONFIG_H #include "config.h" #endif #if HAVE_UDEV #include static struct udev_monitor *uevent_monitor; static struct udev *udev; static GIOChannel *udevchannel; static gboolean hotplug_event(GIOChannel *source, GIOCondition condition, gpointer data) { struct udev_device *dev; dev_t udev_devnum; struct stat s; const char *hotplug; dev = udev_monitor_receive_device(uevent_monitor); if (!dev) goto out; udev_devnum = udev_device_get_devnum(dev); fstat(drm_fd, &s); hotplug = udev_device_get_property_value(dev, "HOTPLUG"); if (memcmp(&s.st_rdev, &udev_devnum, sizeof(dev_t)) == 0 && hotplug && atoi(hotplug) == 1) update_display(); udev_device_unref(dev); out: return TRUE; } gboolean testdisplay_setup_hotplug(void) { int ret; udev = udev_new(); if (!udev) { fprintf(stderr, "failed to create udev object\n"); goto out; } uevent_monitor = udev_monitor_new_from_netlink(udev, "udev"); if (!uevent_monitor) { fprintf(stderr, "failed to create udev event monitor\n"); goto out; } ret = udev_monitor_filter_add_match_subsystem_devtype(uevent_monitor, "drm", "drm_minor"); if (ret < 0) { fprintf(stderr, "failed to filter for drm events\n"); goto out; } ret = udev_monitor_enable_receiving(uevent_monitor); if (ret < 0) { fprintf(stderr, "failed to enable udev event reception\n"); goto out; } udevchannel = g_io_channel_unix_new(udev_monitor_get_fd(uevent_monitor)); if (!udevchannel) { fprintf(stderr, "failed to create udev GIO channel\n"); goto out; } ret = g_io_add_watch(udevchannel, G_IO_IN | G_IO_ERR, hotplug_event, udev); if (ret < 0) { fprintf(stderr, "failed to add watch on udev GIO channel\n"); goto out; } return TRUE; out: testdisplay_cleanup_hotplug(); return FALSE; } void testdisplay_cleanup_hotplug(void) { if (udevchannel) g_io_channel_shutdown(udevchannel, TRUE, NULL); if (uevent_monitor) udev_monitor_unref(uevent_monitor); if (udev) udev_unref(udev); } #else gboolean testdisplay_setup_hotplug(void) { fprintf(stderr, "no hotplug support on this platform\n"); return TRUE; } void testdisplay_cleanup_hotplug(void) { } #endif intel-gpu-tools-1.3/tests/gem_basic.c0000664000175100017510000000425711733450453014600 00000000000000/* * Copyright © 2008 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Eric Anholt * */ #include #include #include #include #include #include #include #include #include #include #include "drm.h" #include "i915_drm.h" #include "drmtest.h" static void test_bad_close(int fd) { struct drm_gem_close close_bo; int ret; printf("Testing error return on bad close ioctl.\n"); close_bo.handle = 0x10101010; ret = ioctl(fd, DRM_IOCTL_GEM_CLOSE, &close_bo); assert(ret == -1 && errno == EINVAL); } static void test_create_close(int fd) { uint32_t handle; printf("Testing creating and closing an object.\n"); handle = gem_create(fd, 16*1024); gem_close(fd, handle); } static void test_create_fd_close(int fd) { printf("Testing closing with an object allocated.\n"); gem_create(fd, 16*1024); /* leak it */ close(fd); } int main(int argc, char **argv) { int fd; fd = drm_open_any(); test_bad_close(fd); test_create_close(fd); test_create_fd_close(fd); return 0; } intel-gpu-tools-1.3/tests/testdisplay.c0000644000175100017510000004571512010406202015214 00000000000000/* * Copyright 2010 Intel Corporation * Jesse Barnes * * 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 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. */ /* * This program is intended for testing of display functionality. It should * allow for testing of * - hotplug * - mode setting * - clone & twin modes * - panel fitting * - test patterns & pixel generators * Additional programs can test the detected outputs against VBT provided * device lists (both docked & undocked). * * TODO: * - pixel generator in transcoder * - test pattern reg in pipe * - test patterns on outputs (e.g. TV) * - handle hotplug (leaks crtcs, can't handle clones) * - allow mode force * - expose output specific controls * - e.g. DDC-CI brightness * - HDMI controls * - panel brightness * - DP commands (e.g. poweroff) * - verify outputs against VBT/physical connectors */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include "i915_drm.h" #include "drmtest.h" #include "testdisplay.h" #include #include drmModeRes *resources; int drm_fd, modes; int dump_info = 0, test_all_modes =0, test_preferred_mode = 0, force_mode = 0, test_plane, enable_tiling; int sleep_between_modes = 5; uint32_t depth = 24, stride, bpp; int qr_code = 0; drmModeModeInfo force_timing; int crtc_x, crtc_y, crtc_w, crtc_h, width, height; unsigned int plane_fb_id; unsigned int plane_crtc_id; unsigned int plane_id; int plane_width, plane_height; static const uint32_t SPRITE_COLOR_KEY = 0x00aaaaaa; uint32_t *fb_ptr; #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0])) struct type_name { int type; const char *name; }; #define type_name_fn(res) \ static const char * res##_str(int type) { \ unsigned int i; \ for (i = 0; i < ARRAY_SIZE(res##_names); i++) { \ if (res##_names[i].type == type) \ return res##_names[i].name; \ } \ return "(invalid)"; \ } struct type_name encoder_type_names[] = { { DRM_MODE_ENCODER_NONE, "none" }, { DRM_MODE_ENCODER_DAC, "DAC" }, { DRM_MODE_ENCODER_TMDS, "TMDS" }, { DRM_MODE_ENCODER_LVDS, "LVDS" }, { DRM_MODE_ENCODER_TVDAC, "TVDAC" }, }; type_name_fn(encoder_type) struct type_name connector_status_names[] = { { DRM_MODE_CONNECTED, "connected" }, { DRM_MODE_DISCONNECTED, "disconnected" }, { DRM_MODE_UNKNOWNCONNECTION, "unknown" }, }; type_name_fn(connector_status) struct type_name connector_type_names[] = { { DRM_MODE_CONNECTOR_Unknown, "unknown" }, { DRM_MODE_CONNECTOR_VGA, "VGA" }, { DRM_MODE_CONNECTOR_DVII, "DVI-I" }, { DRM_MODE_CONNECTOR_DVID, "DVI-D" }, { DRM_MODE_CONNECTOR_DVIA, "DVI-A" }, { DRM_MODE_CONNECTOR_Composite, "composite" }, { DRM_MODE_CONNECTOR_SVIDEO, "s-video" }, { DRM_MODE_CONNECTOR_LVDS, "LVDS" }, { DRM_MODE_CONNECTOR_Component, "component" }, { DRM_MODE_CONNECTOR_9PinDIN, "9-pin DIN" }, { DRM_MODE_CONNECTOR_DisplayPort, "DisplayPort" }, { DRM_MODE_CONNECTOR_HDMIA, "HDMI-A" }, { DRM_MODE_CONNECTOR_HDMIB, "HDMI-B" }, { DRM_MODE_CONNECTOR_TV, "TV" }, { DRM_MODE_CONNECTOR_eDP, "Embedded DisplayPort" }, }; type_name_fn(connector_type) /* * Mode setting with the kernel interfaces is a bit of a chore. * First you have to find the connector in question and make sure the * requested mode is available. * Then you need to find the encoder attached to that connector so you * can bind it with a free crtc. */ struct connector { uint32_t id; int mode_valid; drmModeModeInfo mode; drmModeEncoder *encoder; drmModeConnector *connector; int crtc; int pipe; }; static void dump_connectors_fd(int drmfd) { int i, j; drmModeRes *mode_resources = drmModeGetResources(drmfd); if (!mode_resources) { fprintf(stderr, "drmModeGetResources failed: %s\n", strerror(errno)); return; } printf("Connectors:\n"); printf("id\tencoder\tstatus\t\ttype\tsize (mm)\tmodes\n"); for (i = 0; i < mode_resources->count_connectors; i++) { drmModeConnector *connector; connector = drmModeGetConnector(drmfd, mode_resources->connectors[i]); if (!connector) { fprintf(stderr, "could not get connector %i: %s\n", mode_resources->connectors[i], strerror(errno)); continue; } printf("%d\t%d\t%s\t%s\t%dx%d\t\t%d\n", connector->connector_id, connector->encoder_id, connector_status_str(connector->connection), connector_type_str(connector->connector_type), connector->mmWidth, connector->mmHeight, connector->count_modes); if (!connector->count_modes) continue; printf(" modes:\n"); printf(" name refresh (Hz) hdisp hss hse htot vdisp " "vss vse vtot flags type clock\n"); for (j = 0; j < connector->count_modes; j++) kmstest_dump_mode(&connector->modes[j]); drmModeFreeConnector(connector); } printf("\n"); drmModeFreeResources(mode_resources); } static void dump_crtcs_fd(int drmfd) { int i; drmModeRes *mode_resources = drmModeGetResources(drmfd); printf("CRTCs:\n"); printf("id\tfb\tpos\tsize\n"); for (i = 0; i < mode_resources->count_crtcs; i++) { drmModeCrtc *crtc; crtc = drmModeGetCrtc(drmfd, mode_resources->crtcs[i]); if (!crtc) { fprintf(stderr, "could not get crtc %i: %s\n", mode_resources->crtcs[i], strerror(errno)); continue; } printf("%d\t%d\t(%d,%d)\t(%dx%d)\n", crtc->crtc_id, crtc->buffer_id, crtc->x, crtc->y, crtc->width, crtc->height); kmstest_dump_mode(&crtc->mode); drmModeFreeCrtc(crtc); } printf("\n"); drmModeFreeResources(mode_resources); } static void connector_find_preferred_mode(struct connector *c) { drmModeConnector *connector; drmModeEncoder *encoder = NULL; int i, j; /* First, find the connector & mode */ c->mode_valid = 0; connector = drmModeGetConnector(drm_fd, c->id); if (!connector) { fprintf(stderr, "could not get connector %d: %s\n", c->id, strerror(errno)); drmModeFreeConnector(connector); return; } if (connector->connection != DRM_MODE_CONNECTED) { drmModeFreeConnector(connector); return; } if (!connector->count_modes) { fprintf(stderr, "connector %d has no modes\n", c->id); drmModeFreeConnector(connector); return; } if (connector->connector_id != c->id) { fprintf(stderr, "connector id doesn't match (%d != %d)\n", connector->connector_id, c->id); drmModeFreeConnector(connector); return; } for (j = 0; j < connector->count_modes; j++) { c->mode = connector->modes[j]; if (c->mode.type & DRM_MODE_TYPE_PREFERRED) { c->mode_valid = 1; break; } } if (!c->mode_valid) { if (connector->count_modes > 0) { /* use the first mode as test mode */ c->mode = connector->modes[0]; c->mode_valid = 1; } else { fprintf(stderr, "failed to find any modes on connector %d\n", c->id); return; } } /* Now get the encoder */ for (i = 0; i < connector->count_encoders; i++) { encoder = drmModeGetEncoder(drm_fd, connector->encoders[i]); if (!encoder) { fprintf(stderr, "could not get encoder %i: %s\n", resources->encoders[i], strerror(errno)); drmModeFreeEncoder(encoder); continue; } break; } c->encoder = encoder; if (i == resources->count_encoders) { fprintf(stderr, "failed to find encoder\n"); c->mode_valid = 0; return; } /* Find first CRTC not in use */ for (i = 0; i < resources->count_crtcs; i++) { if (resources->crtcs[i] && (c->encoder->possible_crtcs & (1<crtc = resources->crtcs[i]; c->pipe = i; if(test_preferred_mode || force_mode) resources->crtcs[i] = 0; c->connector = connector; } static void paint_color_key(void) { int i, j; for (i = crtc_y; i < crtc_y + crtc_h; i++) for (j = crtc_x; j < crtc_x + crtc_w; j++) { uint32_t offset; offset = (i * width) + j; fb_ptr[offset] = SPRITE_COLOR_KEY; } } static void paint_image(cairo_t *cr, const char *file) { int img_x, img_y, img_w, img_h, img_w_o, img_h_o; double img_w_scale, img_h_scale; cairo_surface_t *image; img_y = height * (0.10 ); img_h = height * 0.08 * 4; img_w = img_h; img_x = (width / 2) - (img_w / 2); image = cairo_image_surface_create_from_png(file); img_w_o = cairo_image_surface_get_width(image); img_h_o = cairo_image_surface_get_height(image); cairo_translate(cr, img_x, img_y); img_w_scale = (double)img_w / (double)img_w_o; img_h_scale = (double)img_h / (double)img_h_o; cairo_scale(cr, img_w_scale, img_h_scale); cairo_set_source_surface(cr, image, 0, 0); cairo_scale(cr, 1, 1); cairo_paint(cr); cairo_surface_destroy(image); } static void paint_output_info(cairo_t *cr, int l_width, int l_height, void *priv) { struct connector *c = priv; cairo_text_extents_t name_extents, mode_extents; char name_buf[128], mode_buf[128]; int i, x, y, modes_x, modes_y; /* Get text extents for each string */ snprintf(name_buf, sizeof name_buf, "%s", connector_type_str(c->connector->connector_type)); cairo_set_font_size(cr, 48); cairo_select_font_face(cr, "Helvetica", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL); cairo_text_extents(cr, name_buf, &name_extents); snprintf(mode_buf, sizeof mode_buf, "%s @ %dHz on %s encoder", c->mode.name, c->mode.vrefresh, encoder_type_str(c->encoder->encoder_type)); cairo_set_font_size(cr, 36); cairo_text_extents(cr, mode_buf, &mode_extents); /* Paint output name */ x = l_width / 2; x -= name_extents.width / 2; y = l_height / 2; y -= (name_extents.height / 2) - (mode_extents.height / 2) - 10; cairo_set_font_size(cr, 48); cairo_move_to(cr, x, y); cairo_text_path(cr, name_buf); cairo_set_source_rgb(cr, 0, 0, 0); cairo_stroke_preserve(cr); cairo_set_source_rgb(cr, 1, 1, 1); cairo_fill(cr); /* Paint mode name */ x = l_width / 2; x -= mode_extents.width / 2; modes_x = x; y = l_height / 2; y += (mode_extents.height / 2) + (name_extents.height / 2) + 10; cairo_set_font_size(cr, 36); cairo_move_to(cr, x, y); cairo_text_path(cr, mode_buf); cairo_set_source_rgb(cr, 0, 0, 0); cairo_stroke_preserve(cr); cairo_set_source_rgb(cr, 1, 1, 1); cairo_fill(cr); /* List available modes */ snprintf(mode_buf, sizeof mode_buf, "Available modes:"); cairo_set_font_size(cr, 18); cairo_text_extents(cr, mode_buf, &mode_extents); x = modes_x; modes_x = x + mode_extents.width; y += mode_extents.height + 10; modes_y = y; cairo_move_to(cr, x, y); cairo_text_path(cr, mode_buf); cairo_set_source_rgb(cr, 0, 0, 0); cairo_stroke_preserve(cr); cairo_set_source_rgb(cr, 1, 1, 1); cairo_fill(cr); for (i = 0; i < c->connector->count_modes; i++) { snprintf(mode_buf, sizeof mode_buf, "%s @ %dHz", c->connector->modes[i].name, c->connector->modes[i].vrefresh); cairo_set_font_size(cr, 18); cairo_text_extents(cr, mode_buf, &mode_extents); x = modes_x - mode_extents.width; /* right justify modes */ y += mode_extents.height + 10; if (y + mode_extents.height >= height) { y = modes_y + mode_extents.height + 10; modes_x += mode_extents.width + 10; x = modes_x - mode_extents.width; } cairo_move_to(cr, x, y); cairo_text_path(cr, mode_buf); cairo_set_source_rgb(cr, 0, 0, 0); cairo_stroke_preserve(cr); cairo_set_source_rgb(cr, 1, 1, 1); cairo_fill(cr); } if (qr_code) paint_image(cr, "./pass.png"); } static void sighandler(int signo) { return; } static void set_single(void) { int sigs[] = { SIGUSR1 }; struct sigaction sa; sa.sa_handler = sighandler; sigemptyset(&sa.sa_mask); if (sigaction(sigs[0], &sa, NULL) == -1) perror("Could not set signal handler"); } static void set_mode(struct connector *c) { unsigned int fb_id = 0; int j, test_mode_num; if (depth <= 8) bpp = 8; else if (depth > 8 && depth <= 16) bpp = 16; else if (depth > 16 && depth <= 32) bpp = 32; connector_find_preferred_mode(c); if (!c->mode_valid) return; test_mode_num = 1; if (force_mode){ memcpy( &c->mode, &force_timing, sizeof(force_timing)); c->mode.vrefresh =(force_timing.clock*1e3)/(force_timing.htotal*force_timing.vtotal); c->mode_valid = 1; sprintf(c->mode.name, "%dx%d", force_timing.hdisplay, force_timing.vdisplay); } else if (test_all_modes) test_mode_num = c->connector->count_modes; for (j = 0; j < test_mode_num; j++) { struct kmstest_fb fb_info; if (test_all_modes) c->mode = c->connector->modes[j]; if (!c->mode_valid) continue; width = c->mode.hdisplay; height = c->mode.vdisplay; fb_id = kmstest_create_fb(drm_fd, width, height, bpp, depth, enable_tiling, &fb_info, paint_output_info, c); fb_ptr = gem_mmap(drm_fd, fb_info.gem_handle, fb_info.size, PROT_READ | PROT_WRITE); assert(fb_ptr); paint_color_key(); gem_close(drm_fd, fb_info.gem_handle); fprintf(stdout, "CRTS(%u):",c->crtc); kmstest_dump_mode(&c->mode); if (drmModeSetCrtc(drm_fd, c->crtc, fb_id, 0, 0, &c->id, 1, &c->mode)) { fprintf(stderr, "failed to set mode (%dx%d@%dHz): %s\n", width, height, c->mode.vrefresh, strerror(errno)); continue; } if (sleep_between_modes && test_all_modes && !qr_code) sleep(sleep_between_modes); if (qr_code){ set_single(); pause(); } } if(test_all_modes){ drmModeRmFB(drm_fd,fb_id); drmModeSetCrtc(drm_fd, c->crtc, fb_id, 0, 0, &c->id, 1, 0); } drmModeFreeEncoder(c->encoder); drmModeFreeConnector(c->connector); } /* * Re-probe outputs and light up as many as possible. * * On Intel, we have two CRTCs that we can drive independently with * different timings and scanout buffers. * * Each connector has a corresponding encoder, except in the SDVO case * where an encoder may have multiple connectors. */ int update_display(void) { struct connector *connectors; int c; resources = drmModeGetResources(drm_fd); if (!resources) { fprintf(stderr, "drmModeGetResources failed: %s\n", strerror(errno)); return 0; } connectors = calloc(resources->count_connectors, sizeof(struct connector)); if (!connectors) return 0; if (dump_info) { dump_connectors_fd(drm_fd); dump_crtcs_fd(drm_fd); } if (test_preferred_mode || test_all_modes || force_mode) { /* Find any connected displays */ for (c = 0; c < resources->count_connectors; c++) { connectors[c].id = resources->connectors[c]; set_mode(&connectors[c]); } } drmModeFreeResources(resources); return 1; } static char optstr[] = "hiaf:s:d:p:mrt"; static void usage(char *name) { fprintf(stderr, "usage: %s [-hiasdpmtf]\n", name); fprintf(stderr, "\t-i\tdump info\n"); fprintf(stderr, "\t-a\ttest all modes\n"); fprintf(stderr, "\t-s\t\tsleep between each mode test\n"); fprintf(stderr, "\t-d\t\tbit depth of scanout buffer\n"); fprintf(stderr, "\t-p\t,, test overlay plane\n"); fprintf(stderr, "\t-m\ttest the preferred mode\n"); fprintf(stderr, "\t-t\tuse a tiled framebuffer\n"); fprintf(stderr, "\t-r\tprint a QR code on the screen whose content is \"pass\" for the automatic test\n"); fprintf(stderr, "\t-f\t,,,,,\n"); fprintf(stderr, "\t\t,,,\n"); fprintf(stderr, "\t\ttest force mode\n"); fprintf(stderr, "\tDefault is to test all modes.\n"); exit(0); } #define dump_resource(res) if (res) dump_##res() static gboolean input_event(GIOChannel *source, GIOCondition condition, gpointer data) { gchar buf[2]; gsize count; count = read(g_io_channel_unix_get_fd(source), buf, sizeof(buf)); if (buf[0] == 'q' && (count == 1 || buf[1] == '\n')) { exit(0); } return TRUE; } static void enter_exec_path( char **argv ) { char *exec_path = NULL; char *pos = NULL; short len_path = 0; len_path = strlen( argv[0] ); exec_path = (char*) malloc(len_path); memcpy(exec_path, argv[0], len_path); pos = strrchr(exec_path, '/'); if (pos != NULL) *(pos+1) = '\0'; chdir(exec_path); free(exec_path); } int main(int argc, char **argv) { int c; int ret = 0; GIOChannel *stdinchannel; GMainLoop *mainloop; float force_clock; enter_exec_path( argv ); opterr = 0; while ((c = getopt(argc, argv, optstr)) != -1) { switch (c) { case 'i': dump_info = 1; break; case 'a': test_all_modes = 1; break; case 'f': force_mode = 1; if(sscanf(optarg,"%f,%hu,%hu,%hu,%hu,%hu,%hu,%hu,%hu", &force_clock,&force_timing.hdisplay, &force_timing.hsync_start,&force_timing.hsync_end,&force_timing.htotal, &force_timing.vdisplay, &force_timing.vsync_start, &force_timing.vsync_end, &force_timing.vtotal)!= 9) usage(argv[0]); force_timing.clock = force_clock*1000; break; case 's': sleep_between_modes = atoi(optarg); break; case 'd': depth = atoi(optarg); fprintf(stderr, "using depth %d\n", depth); break; case 'p': if (sscanf(optarg, "%d,%d,%d,%d,%d,%d", &plane_width, &plane_height, &crtc_x, &crtc_y, &crtc_w, &crtc_h) != 6) usage(argv[0]); test_plane = 1; break; case 'm': test_preferred_mode = 1; break; case 't': enable_tiling = 1; break; case 'r': qr_code = 1; break; default: fprintf(stderr, "unknown option %c\n", c); /* fall through */ case 'h': usage(argv[0]); break; } } if (!test_all_modes && !force_mode && !dump_info && !test_preferred_mode) test_all_modes = 1; drm_fd = drm_open_any(); mainloop = g_main_loop_new(NULL, FALSE); if (!mainloop) { fprintf(stderr, "failed to create glib mainloop\n"); ret = -1; goto out_close; } if (!testdisplay_setup_hotplug()) { fprintf(stderr, "failed to initialize hotplug support\n"); goto out_mainloop; } stdinchannel = g_io_channel_unix_new(0); if (!stdinchannel) { fprintf(stderr, "failed to create stdin GIO channel\n"); goto out_hotplug; } ret = g_io_add_watch(stdinchannel, G_IO_IN | G_IO_ERR, input_event, NULL); if (ret < 0) { fprintf(stderr, "failed to add watch on stdin GIO channel\n"); goto out_stdio; } ret = 0; if (!update_display()) { ret = 1; goto out_stdio; } if (dump_info || test_all_modes) goto out_stdio; g_main_loop_run(mainloop); out_stdio: g_io_channel_shutdown(stdinchannel, TRUE, NULL); out_hotplug: testdisplay_cleanup_hotplug(); out_mainloop: g_main_loop_unref(mainloop); out_close: close(drm_fd); return ret; } intel-gpu-tools-1.3/tests/gem_largeobject.c0000664000175100017510000000500311706636070015767 00000000000000/* * Copyright © 2008 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Jesse Barnes * */ #include #include #include #include #include #include #include #include #include #include "drm.h" #include "i915_drm.h" #include "drmtest.h" /* Should take 64 pages to store the page pointers on 64 bit */ #define OBJ_SIZE (128 * 1024 * 1024) unsigned char data[OBJ_SIZE]; static void test_large_object(int fd) { struct drm_i915_gem_create create; struct drm_i915_gem_pin pin; uint32_t obj_size; int ret; memset(&create, 0, sizeof(create)); memset(&pin, 0, sizeof(pin)); if (gem_aperture_size(fd)*3/4 < OBJ_SIZE/2) obj_size = OBJ_SIZE / 4; else if (gem_aperture_size(fd)*3/4 < OBJ_SIZE) obj_size = OBJ_SIZE / 2; else obj_size = OBJ_SIZE; create.size = obj_size; printf("obj size %i\n", obj_size); ret = ioctl(fd, DRM_IOCTL_I915_GEM_CREATE, &create); if (ret) { fprintf(stderr, "object creation failed: %s\n", strerror(errno)); exit(ret); } pin.handle = create.handle; ret = ioctl(fd, DRM_IOCTL_I915_GEM_PIN, &pin); if (ret) { fprintf(stderr, "pin failed: %s\n", strerror(errno)); exit(ret); } gem_write(fd, create.handle, 0, data, obj_size); /* kernel should clean this up for us */ } int main(int argc, char **argv) { int fd; fd = drm_open_any(); test_large_object(fd); return 0; } intel-gpu-tools-1.3/tests/drm_vma_limiter_gtt.c0000664000175100017510000000570011706636070016712 00000000000000/* * Copyright © 2011 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Daniel Vetter */ #include #include #include #include #include #include #include #include #include #include "drm.h" #include "i915_drm.h" #include "drmtest.h" #include "intel_bufmgr.h" #include "intel_batchbuffer.h" #include "intel_gpu_tools.h" static drm_intel_bufmgr *bufmgr; struct intel_batchbuffer *batch; /* Testcase: check whether the libdrm vma limiter works * * We've had reports of the X server exhausting the default rlimit of 64k vma's * in the kernel. libdrm has grown facilities to limit the vma caching since, * this checks whether they actually work. * * This one checks cpu mmaps only. */ /* we do both cpu and gtt maps, so only need half of 64k to exhaust */ #define BO_ARRAY_SIZE 68000 drm_intel_bo *bos[BO_ARRAY_SIZE]; int main(int argc, char **argv) { int fd; int i; char *ptr; fd = drm_open_any(); bufmgr = drm_intel_bufmgr_gem_init(fd, 4096); drm_intel_bufmgr_gem_enable_reuse(bufmgr); batch = intel_batchbuffer_alloc(bufmgr, intel_get_drm_devid(fd)); drm_intel_bufmgr_gem_set_vma_cache_size(bufmgr, 500); for (i = 0; i < BO_ARRAY_SIZE; i++) { bos[i] = drm_intel_bo_alloc(bufmgr, "mmap bo", 4096, 4096); assert(bos[i]); drm_intel_gem_bo_map_gtt(bos[i]); ptr = bos[i]->virtual; assert(ptr); *ptr = 'c'; drm_intel_gem_bo_unmap_gtt(bos[i]); } /* and recheck whether a second map of the same still works */ for (i = 0; i < BO_ARRAY_SIZE; i++) { bos[i] = drm_intel_bo_alloc(bufmgr, "mmap bo", 4096, 4096); assert(bos[i]); drm_intel_gem_bo_map_gtt(bos[i]); ptr = bos[i]->virtual; assert(*ptr = 'c'); drm_intel_gem_bo_unmap_gtt(bos[i]); } intel_batchbuffer_free(batch); drm_intel_bufmgr_destroy(bufmgr); close(fd); return 0; } intel-gpu-tools-1.3/tests/ZZ_hangman0000775000175100017510000000150011757635623014503 00000000000000#!/bin/bash # # Testcase: Simulate gpu hang # # This check uses the stop_rings facility to exercise the gpu hang code. # by reading /sys/kernel/debug/dri/0/i915_emon_status too quickly # SOURCE_DIR="$( dirname "${BASH_SOURCE[0]}" )" . $SOURCE_DIR/drm_lib.sh oldpath=`pwd` cd $i915_path if [ ! -f i915_ring_stop ] ; then echo "kernel doesn't support ring stopping" exit 77 fi if cat i915_error_state | grep -v "no error state collected" > /dev/null ; then echo "gpu hang dectected" exit 1 fi # stop rings echo 0xf > i915_ring_stop echo "rings stopped" (cd $oldpath; $SOURCE_DIR/gem_exec_nop) > /dev/null if cat i915_error_state | grep -v "no error state collected" > /dev/null ; then echo "gpu hang correctly dectected" else echo "gpu hang not dectected" exit 2 fi # clear error state echo > i915_error_state exit 0 intel-gpu-tools-1.3/tests/gen3_render_tiledx_blits.c0000664000175100017510000002551411772702746017637 00000000000000/* * Copyright © 2011 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Chris Wilson * */ /** @file gen3_linear_render_blits.c * * This is a test of doing many blits, with a working set * larger than the aperture size. * * The goal is to simply ensure the basics work. */ #include #include #include #include #include #include #include #include #include #include #include #include "drm.h" #include "i915_drm.h" #include "drmtest.h" #include "intel_gpu_tools.h" #include "i915_reg.h" #include "i915_3d.h" #define WIDTH 512 #define HEIGHT 512 static inline uint32_t pack_float(float f) { union { uint32_t dw; float f; } u; u.f = f; return u.dw; } static uint32_t fill_reloc(struct drm_i915_gem_relocation_entry *reloc, uint32_t offset, uint32_t handle, uint32_t read_domain, uint32_t write_domain) { reloc->target_handle = handle; reloc->delta = 0; reloc->offset = offset * sizeof(uint32_t); reloc->presumed_offset = 0; reloc->read_domains = read_domain; reloc->write_domain = write_domain; return reloc->presumed_offset + reloc->delta; } static void copy(int fd, uint32_t dst, uint32_t src) { uint32_t batch[1024], *b = batch; struct drm_i915_gem_relocation_entry reloc[2], *r = reloc; struct drm_i915_gem_exec_object2 obj[3]; struct drm_i915_gem_execbuffer2 exec; uint32_t handle; int ret; /* invariant state */ *b++ = (_3DSTATE_AA_CMD | AA_LINE_ECAAR_WIDTH_ENABLE | AA_LINE_ECAAR_WIDTH_1_0 | AA_LINE_REGION_WIDTH_ENABLE | AA_LINE_REGION_WIDTH_1_0); *b++ = (_3DSTATE_INDEPENDENT_ALPHA_BLEND_CMD | IAB_MODIFY_ENABLE | IAB_MODIFY_FUNC | (BLENDFUNC_ADD << IAB_FUNC_SHIFT) | IAB_MODIFY_SRC_FACTOR | (BLENDFACT_ONE << IAB_SRC_FACTOR_SHIFT) | IAB_MODIFY_DST_FACTOR | (BLENDFACT_ZERO << IAB_DST_FACTOR_SHIFT)); *b++ = (_3DSTATE_DFLT_DIFFUSE_CMD); *b++ = (0); *b++ = (_3DSTATE_DFLT_SPEC_CMD); *b++ = (0); *b++ = (_3DSTATE_DFLT_Z_CMD); *b++ = (0); *b++ = (_3DSTATE_COORD_SET_BINDINGS | CSB_TCB(0, 0) | CSB_TCB(1, 1) | CSB_TCB(2, 2) | CSB_TCB(3, 3) | CSB_TCB(4, 4) | CSB_TCB(5, 5) | CSB_TCB(6, 6) | CSB_TCB(7, 7)); *b++ = (_3DSTATE_RASTER_RULES_CMD | ENABLE_POINT_RASTER_RULE | OGL_POINT_RASTER_RULE | ENABLE_LINE_STRIP_PROVOKE_VRTX | ENABLE_TRI_FAN_PROVOKE_VRTX | LINE_STRIP_PROVOKE_VRTX(1) | TRI_FAN_PROVOKE_VRTX(2) | ENABLE_TEXKILL_3D_4D | TEXKILL_4D); *b++ = (_3DSTATE_MODES_4_CMD | ENABLE_LOGIC_OP_FUNC | LOGIC_OP_FUNC(LOGICOP_COPY) | ENABLE_STENCIL_WRITE_MASK | STENCIL_WRITE_MASK(0xff) | ENABLE_STENCIL_TEST_MASK | STENCIL_TEST_MASK(0xff)); *b++ = (_3DSTATE_LOAD_STATE_IMMEDIATE_1 | I1_LOAD_S(3) | I1_LOAD_S(4) | I1_LOAD_S(5) | 2); *b++ = (0x00000000); /* Disable texture coordinate wrap-shortest */ *b++ = ((1 << S4_POINT_WIDTH_SHIFT) | S4_LINE_WIDTH_ONE | S4_CULLMODE_NONE | S4_VFMT_XY); *b++ = (0x00000000); /* Stencil. */ *b++ = (_3DSTATE_SCISSOR_ENABLE_CMD | DISABLE_SCISSOR_RECT); *b++ = (_3DSTATE_SCISSOR_RECT_0_CMD); *b++ = (0); *b++ = (0); *b++ = (_3DSTATE_DEPTH_SUBRECT_DISABLE); *b++ = (_3DSTATE_LOAD_INDIRECT | 0); /* disable indirect state */ *b++ = (0); *b++ = (_3DSTATE_STIPPLE); *b++ = (0x00000000); *b++ = (_3DSTATE_BACKFACE_STENCIL_OPS | BFO_ENABLE_STENCIL_TWO_SIDE | 0); /* samler state */ #define TEX_COUNT 1 *b++ = (_3DSTATE_MAP_STATE | (3 * TEX_COUNT)); *b++ = ((1 << TEX_COUNT) - 1); *b = fill_reloc(r++, b-batch, src, I915_GEM_DOMAIN_SAMPLER, 0); b++; *b++ = (MAPSURF_32BIT | MT_32BIT_ARGB8888 | MS3_TILED_SURFACE | (HEIGHT - 1) << MS3_HEIGHT_SHIFT | (WIDTH - 1) << MS3_WIDTH_SHIFT); *b++ = ((WIDTH-1) << MS4_PITCH_SHIFT); *b++ = (_3DSTATE_SAMPLER_STATE | (3 * TEX_COUNT)); *b++ = ((1 << TEX_COUNT) - 1); *b++ = (MIPFILTER_NONE << SS2_MIP_FILTER_SHIFT | FILTER_NEAREST << SS2_MAG_FILTER_SHIFT | FILTER_NEAREST << SS2_MIN_FILTER_SHIFT); *b++ = (TEXCOORDMODE_WRAP << SS3_TCX_ADDR_MODE_SHIFT | TEXCOORDMODE_WRAP << SS3_TCY_ADDR_MODE_SHIFT | 0 << SS3_TEXTUREMAP_INDEX_SHIFT); *b++ = (0x00000000); /* render target state */ *b++ = (_3DSTATE_BUF_INFO_CMD); *b++ = (BUF_3D_ID_COLOR_BACK | BUF_3D_TILED_SURFACE | WIDTH*4); *b = fill_reloc(r++, b-batch, dst, I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER); b++; *b++ = (_3DSTATE_DST_BUF_VARS_CMD); *b++ = (COLR_BUF_ARGB8888 | DSTORG_HORT_BIAS(0x8) | DSTORG_VERT_BIAS(0x8)); /* draw rect is unconditional */ *b++ = (_3DSTATE_DRAW_RECT_CMD); *b++ = (0x00000000); *b++ = (0x00000000); /* ymin, xmin */ *b++ = (DRAW_YMAX(HEIGHT - 1) | DRAW_XMAX(WIDTH - 1)); /* yorig, xorig (relate to color buffer?) */ *b++ = (0x00000000); /* texfmt */ *b++ = (_3DSTATE_LOAD_STATE_IMMEDIATE_1 | I1_LOAD_S(1) | I1_LOAD_S(2) | I1_LOAD_S(6) | 2); *b++ = ((4 << S1_VERTEX_WIDTH_SHIFT) | (4 << S1_VERTEX_PITCH_SHIFT)); *b++ = (~S2_TEXCOORD_FMT(0, TEXCOORDFMT_NOT_PRESENT) | S2_TEXCOORD_FMT(0, TEXCOORDFMT_2D)); *b++ = (S6_CBUF_BLEND_ENABLE | S6_COLOR_WRITE_ENABLE | BLENDFUNC_ADD << S6_CBUF_BLEND_FUNC_SHIFT | BLENDFACT_ONE << S6_CBUF_SRC_BLEND_FACT_SHIFT | BLENDFACT_ZERO << S6_CBUF_DST_BLEND_FACT_SHIFT); /* pixel shader */ *b++ = (_3DSTATE_PIXEL_SHADER_PROGRAM | (1 + 3*3 - 2)); /* decl FS_T0 */ *b++ = (D0_DCL | REG_TYPE(FS_T0) << D0_TYPE_SHIFT | REG_NR(FS_T0) << D0_NR_SHIFT | ((REG_TYPE(FS_T0) != REG_TYPE_S) ? D0_CHANNEL_ALL : 0)); *b++ = (0); *b++ = (0); /* decl FS_S0 */ *b++ = (D0_DCL | (REG_TYPE(FS_S0) << D0_TYPE_SHIFT) | (REG_NR(FS_S0) << D0_NR_SHIFT) | ((REG_TYPE(FS_S0) != REG_TYPE_S) ? D0_CHANNEL_ALL : 0)); *b++ = (0); *b++ = (0); /* texld(FS_OC, FS_S0, FS_T0 */ *b++ = (T0_TEXLD | (REG_TYPE(FS_OC) << T0_DEST_TYPE_SHIFT) | (REG_NR(FS_OC) << T0_DEST_NR_SHIFT) | (REG_NR(FS_S0) << T0_SAMPLER_NR_SHIFT)); *b++ = ((REG_TYPE(FS_T0) << T1_ADDRESS_REG_TYPE_SHIFT) | (REG_NR(FS_T0) << T1_ADDRESS_REG_NR_SHIFT)); *b++ = (0); *b++ = (PRIM3D_RECTLIST | (3*4 - 1)); *b++ = pack_float(WIDTH); *b++ = pack_float(HEIGHT); *b++ = pack_float(WIDTH); *b++ = pack_float(HEIGHT); *b++ = pack_float(0); *b++ = pack_float(HEIGHT); *b++ = pack_float(0); *b++ = pack_float(HEIGHT); *b++ = pack_float(0); *b++ = pack_float(0); *b++ = pack_float(0); *b++ = pack_float(0); *b++ = MI_BATCH_BUFFER_END; if ((b - batch) & 1) *b++ = 0; assert(b - batch <= 1024); handle = gem_create(fd, 4096); gem_write(fd, handle, 0, batch, (b-batch)*sizeof(batch[0])); assert(r-reloc == 2); obj[0].handle = dst; obj[0].relocation_count = 0; obj[0].relocs_ptr = 0; obj[0].alignment = 0; obj[0].offset = 0; obj[0].flags = 0; obj[0].rsvd1 = 0; obj[0].rsvd2 = 0; obj[1].handle = src; obj[1].relocation_count = 0; obj[1].relocs_ptr = 0; obj[1].alignment = 0; obj[1].offset = 0; obj[1].flags = 0; obj[1].rsvd1 = 0; obj[1].rsvd2 = 0; obj[2].handle = handle; obj[2].relocation_count = 2; obj[2].relocs_ptr = (uintptr_t)reloc; obj[2].alignment = 0; obj[2].offset = 0; obj[2].flags = 0; obj[2].rsvd1 = obj[2].rsvd2 = 0; exec.buffers_ptr = (uintptr_t)obj; exec.buffer_count = 3; exec.batch_start_offset = 0; exec.batch_len = (b-batch)*sizeof(batch[0]); exec.DR1 = exec.DR4 = 0; exec.num_cliprects = 0; exec.cliprects_ptr = 0; exec.flags = 0; i915_execbuffer2_set_context_id(exec, 0); exec.rsvd2 = 0; ret = drmIoctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, &exec); while (ret && errno == EBUSY) { drmCommandNone(fd, DRM_I915_GEM_THROTTLE); ret = drmIoctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, &exec); } assert(ret == 0); gem_close(fd, handle); } static uint32_t create_bo(int fd, uint32_t val) { uint32_t handle; uint32_t *v; int i; handle = gem_create(fd, WIDTH*HEIGHT*4); gem_set_tiling(fd, handle, I915_TILING_X, WIDTH*4); /* Fill the BO with dwords starting at val */ v = gem_mmap(fd, handle, WIDTH*HEIGHT*4, PROT_READ | PROT_WRITE); assert(v); for (i = 0; i < WIDTH*HEIGHT; i++) v[i] = val++; munmap(v, WIDTH*HEIGHT*4); return handle; } static void check_bo(int fd, uint32_t handle, uint32_t val) { uint32_t *v; int i; v = gem_mmap(fd, handle, WIDTH*HEIGHT*4, PROT_READ); assert(v); for (i = 0; i < WIDTH*HEIGHT; i++) { if (v[i] != val) { fprintf(stderr, "Expected 0x%08x, found 0x%08x " "at offset 0x%08x\n", val, v[i], i * 4); abort(); } val++; } munmap(v, WIDTH*HEIGHT*4); } int main(int argc, char **argv) { uint32_t *handle, *start_val; uint32_t start = 0; int i, fd, count; fd = drm_open_any(); if (!IS_GEN3(intel_get_drm_devid(fd))) { printf("gen3-only test, doing nothing\n"); return 77; } count = 0; if (argc > 1) count = atoi(argv[1]); if (count == 0) count = 3 * gem_aperture_size(fd) / (1024*1024) / 2; printf("Using %d 1MiB buffers\n", count); handle = malloc(sizeof(uint32_t)*count*2); start_val = handle + count; for (i = 0; i < count; i++) { handle[i] = create_bo(fd, start); start_val[i] = start; start += 1024 * 1024 / 4; } printf("Verifying initialisation...\n"); for (i = 0; i < count; i++) check_bo(fd, handle[i], start_val[i]); printf("Cyclic blits, forward...\n"); for (i = 0; i < count * 4; i++) { int src = i % count; int dst = (i + 1) % count; copy(fd, handle[dst], handle[src]); start_val[dst] = start_val[src]; } for (i = 0; i < count; i++) check_bo(fd, handle[i], start_val[i]); printf("Cyclic blits, backward...\n"); for (i = 0; i < count * 4; i++) { int src = (i + 1) % count; int dst = i % count; copy(fd, handle[dst], handle[src]); start_val[dst] = start_val[src]; } for (i = 0; i < count; i++) check_bo(fd, handle[i], start_val[i]); printf("Random blits...\n"); for (i = 0; i < count * 4; i++) { int src = random() % count; int dst = random() % count; if (src == dst) continue; copy(fd, handle[dst], handle[src]); start_val[dst] = start_val[src]; } for (i = 0; i < count; i++) check_bo(fd, handle[i], start_val[i]); return 0; } intel-gpu-tools-1.3/tests/debugfs_reader0000775000175100017510000000023111741627117015400 00000000000000#!/bin/bash SOURCE_DIR="$( dirname "${BASH_SOURCE[0]}" )" . $SOURCE_DIR/drm_lib.sh # read everything we can cat $i915_path/* > /dev/null 2>&1 exit 0 intel-gpu-tools-1.3/tests/module_reload0000775000175100017510000000172011761452133015252 00000000000000#!/bin/bash # # Testcase: Reload the drm module # # ... we've broken this way too often :( # SOURCE_DIR="$( dirname "${BASH_SOURCE[0]}" )" . $SOURCE_DIR/drm_lib.sh # no other drm service should be running, so we can just unbind # vtcon0 is vga, vtcon1 fbcon and let's pray that won't change due to boot load # time changes if ! echo 0 > /sys/class/vtconsole/vtcon1/bind ; then echo -e "no kms unload support" echo "please enable CONFIG_VT_HW_CONSOLE_BINDING in the kernel" exit 77 fi #ignore errors in ips - gen5 only rmmod intel_ips &> /dev/null rmmod i915 #ignore errors in intel-gtt, often built-in rmmod intel-gtt &> /dev/null rmmod drm_kms_helper rmmod drm if lsmod | grep i915 &> /dev/null ; then echo WARNING: i915.ko still loaded! exitcode=1 else echo module successfully unloaded exitcode=0 fi modprobe i915 echo 1 > /sys/class/vtconsole/vtcon1/bind # try to run something $SOURCE_DIR/gem_exec_nop > /dev/null && echo "module successfully loaded again" intel-gpu-tools-1.3/tests/gem_dummy_reloc_loop.c0000664000175100017510000001215411636577643017077 00000000000000/* * Copyright © 2011 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Daniel Vetter (based on gem_storedw_*.c) * */ #include #include #include #include #include #include #include #include #include #include "drm.h" #include "i915_drm.h" #include "drmtest.h" #include "intel_bufmgr.h" #include "intel_batchbuffer.h" #include "intel_gpu_tools.h" #include "i830_reg.h" static drm_intel_bufmgr *bufmgr; struct intel_batchbuffer *batch; static drm_intel_bo *target_buffer; /* * Testcase: Basic check of ring<->cpu sync using a dummy reloc * * The last test (that randomly switches the ring) seems to be pretty effective * at hitting the missed irq bug that's worked around with the HWSTAM irq write. */ #define MI_COND_BATCH_BUFFER_END (0x36<<23 | 1) #define MI_DO_COMPARE (1<<21) static void dummy_reloc_loop(int ring) { int i; for (i = 0; i < 0x100000; i++) { if (ring == I915_EXEC_RENDER) { BEGIN_BATCH(4); OUT_BATCH(MI_COND_BATCH_BUFFER_END | MI_DO_COMPARE); OUT_BATCH(0xffffffff); /* compare dword */ OUT_RELOC(target_buffer, I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER, 0); OUT_BATCH(MI_NOOP); ADVANCE_BATCH(); } else { BEGIN_BATCH(4); OUT_BATCH(MI_FLUSH_DW | 1); OUT_BATCH(0); /* reserved */ OUT_RELOC(target_buffer, I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER, 0); OUT_BATCH(MI_NOOP | (1<<22) | (0xf)); ADVANCE_BATCH(); } intel_batchbuffer_flush_on_ring(batch, ring); drm_intel_bo_map(target_buffer, 0); // map to force completion drm_intel_bo_unmap(target_buffer); } } static void dummy_reloc_loop_random_ring(void) { int i; srandom(0xdeadbeef); for (i = 0; i < 0x100000; i++) { int ring = random() % 3 + 1; if (ring == I915_EXEC_RENDER) { BEGIN_BATCH(4); OUT_BATCH(MI_COND_BATCH_BUFFER_END | MI_DO_COMPARE); OUT_BATCH(0xffffffff); /* compare dword */ OUT_RELOC(target_buffer, I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER, 0); OUT_BATCH(MI_NOOP); ADVANCE_BATCH(); } else { BEGIN_BATCH(4); OUT_BATCH(MI_FLUSH_DW | 1); OUT_BATCH(0); /* reserved */ OUT_RELOC(target_buffer, I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER, 0); OUT_BATCH(MI_NOOP | (1<<22) | (0xf)); ADVANCE_BATCH(); } intel_batchbuffer_flush_on_ring(batch, ring); drm_intel_bo_map(target_buffer, 0); // map to force waiting on rendering drm_intel_bo_unmap(target_buffer); } } int main(int argc, char **argv) { int fd; int devid; if (argc != 1) { fprintf(stderr, "usage: %s\n", argv[0]); exit(-1); } fd = drm_open_any(); devid = intel_get_drm_devid(fd); if (!HAS_BLT_RING(devid)) { fprintf(stderr, "not (yet) implemented for pre-snb\n"); return 77; } bufmgr = drm_intel_bufmgr_gem_init(fd, 4096); if (!bufmgr) { fprintf(stderr, "failed to init libdrm\n"); exit(-1); } drm_intel_bufmgr_gem_enable_reuse(bufmgr); batch = intel_batchbuffer_alloc(bufmgr, devid); if (!batch) { fprintf(stderr, "failed to create batch buffer\n"); exit(-1); } target_buffer = drm_intel_bo_alloc(bufmgr, "target bo", 4096, 4096); if (!target_buffer) { fprintf(stderr, "failed to alloc target buffer\n"); exit(-1); } fprintf(stderr, "running dummy loop on render\n"); dummy_reloc_loop(I915_EXEC_RENDER); fprintf(stderr, "dummy loop run on render completed\n"); if (!HAS_BSD_RING(devid)) goto skip; sleep(2); fprintf(stderr, "running dummy loop on bsd\n"); dummy_reloc_loop(I915_EXEC_BSD); fprintf(stderr, "dummy loop run on bsd completed\n"); if (!HAS_BLT_RING(devid)) goto skip; sleep(2); fprintf(stderr, "running dummy loop on blt\n"); dummy_reloc_loop(I915_EXEC_BLT); fprintf(stderr, "dummy loop run on blt completed\n"); sleep(2); fprintf(stderr, "running dummy loop on random rings\n"); dummy_reloc_loop_random_ring(); fprintf(stderr, "dummy loop run on random rings completed\n"); skip: drm_intel_bo_unreference(target_buffer); intel_batchbuffer_free(batch); drm_intel_bufmgr_destroy(bufmgr); close(fd); return 0; } intel-gpu-tools-1.3/tests/gem_storedw_loop_blt.c0000664000175100017510000000746311733450453017102 00000000000000/* * Copyright © 2009 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Eric Anholt * Jesse Barnes (based on gem_bad_blit.c) * */ #include #include #include #include #include #include #include #include #include #include "drm.h" #include "i915_drm.h" #include "drmtest.h" #include "intel_bufmgr.h" #include "intel_batchbuffer.h" #include "intel_gpu_tools.h" static drm_intel_bufmgr *bufmgr; struct intel_batchbuffer *batch; static drm_intel_bo *target_buffer; static int has_ppgtt = 0; /* * Testcase: Basic blitter MI check using MI_STORE_DATA_IMM */ static void store_dword_loop(void) { int cmd, i, val = 0; uint32_t *buf; cmd = MI_STORE_DWORD_IMM; if (!has_ppgtt) cmd |= MI_MEM_VIRTUAL; for (i = 0; i < 0x100000; i++) { BEGIN_BATCH(4); OUT_BATCH(cmd); OUT_BATCH(0); /* reserved */ OUT_RELOC(target_buffer, I915_GEM_DOMAIN_INSTRUCTION, I915_GEM_DOMAIN_INSTRUCTION, 0); OUT_BATCH(val); ADVANCE_BATCH(); intel_batchbuffer_flush_on_ring(batch, I915_EXEC_BLT); drm_intel_bo_map(target_buffer, 0); buf = target_buffer->virtual; if (buf[0] != val) { fprintf(stderr, "value mismatch: cur 0x%08x, stored 0x%08x\n", buf[0], val); exit(-1); } drm_intel_bo_unmap(target_buffer); val++; } drm_intel_bo_map(target_buffer, 0); buf = target_buffer->virtual; printf("completed %d writes successfully, current value: 0x%08x\n", i, buf[0]); drm_intel_bo_unmap(target_buffer); } int main(int argc, char **argv) { int fd; int devid; if (argc != 1) { fprintf(stderr, "usage: %s\n", argv[0]); exit(-1); } fd = drm_open_any(); devid = intel_get_drm_devid(fd); has_ppgtt = gem_uses_aliasing_ppgtt(fd); if (IS_GEN2(devid) || IS_GEN3(devid) || IS_GEN4(devid) || IS_GEN5(devid)) { fprintf(stderr, "MI_STORE_DATA can only use GTT address on gen4+/g33 and " "needs snoopable mem on pre-gen6\n"); return 77; } /* This only works with ppgtt */ if (!has_ppgtt) { fprintf(stderr, "no ppgtt detected, which is required\n"); return 77; } bufmgr = drm_intel_bufmgr_gem_init(fd, 4096); if (!bufmgr) { fprintf(stderr, "failed to init libdrm\n"); exit(-1); } drm_intel_bufmgr_gem_enable_reuse(bufmgr); batch = intel_batchbuffer_alloc(bufmgr, devid); if (!batch) { fprintf(stderr, "failed to create batch buffer\n"); exit(-1); } target_buffer = drm_intel_bo_alloc(bufmgr, "target bo", 4096, 4096); if (!target_buffer) { fprintf(stderr, "failed to alloc target buffer\n"); exit(-1); } store_dword_loop(); drm_intel_bo_unreference(target_buffer); intel_batchbuffer_free(batch); drm_intel_bufmgr_destroy(bufmgr); close(fd); return 0; } intel-gpu-tools-1.3/tests/gem_hang.c0000664000175100017510000000522611663161675014440 00000000000000/* * Copyright © 2009 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Eric Anholt * Jesse Barnes (based on gem_bad_blit.c) * */ #include #include #include #include #include #include #include #include #include #include "drm.h" #include "i915_drm.h" #include "drmtest.h" #include "intel_bufmgr.h" #include "intel_batchbuffer.h" #include "intel_gpu_tools.h" static drm_intel_bufmgr *bufmgr; struct intel_batchbuffer *batch; static int bad_pipe; static void gpu_hang(void) { int cmd; cmd = bad_pipe ? MI_WAIT_FOR_PIPEB_SCAN_LINE_WINDOW : MI_WAIT_FOR_PIPEA_SCAN_LINE_WINDOW; BEGIN_BATCH(6); /* The documentation says that the LOAD_SCAN_LINES command * always comes in pairs. Don't ask me why. */ OUT_BATCH(MI_LOAD_SCAN_LINES_INCL | (bad_pipe << 20)); OUT_BATCH((0 << 16) | 2048); OUT_BATCH(MI_LOAD_SCAN_LINES_INCL | (bad_pipe << 20)); OUT_BATCH((0 << 16) | 2048); OUT_BATCH(MI_WAIT_FOR_EVENT | cmd); OUT_BATCH(MI_NOOP); ADVANCE_BATCH(); intel_batchbuffer_flush(batch); } int main(int argc, char **argv) { int fd; if (argc != 2) { fprintf(stderr, "usage: %s \n", argv[0]); exit(-1); } bad_pipe = atoi(argv[1]); fd = drm_open_any(); bufmgr = drm_intel_bufmgr_gem_init(fd, 4096); drm_intel_bufmgr_gem_enable_reuse(bufmgr); batch = intel_batchbuffer_alloc(bufmgr, intel_get_drm_devid(fd)); gpu_hang(); intel_batchbuffer_free(batch); drm_intel_bufmgr_destroy(bufmgr); close(fd); return 0; } intel-gpu-tools-1.3/tests/gem_vmap_blits.c0000664000175100017510000002037511706636070015657 00000000000000/* * Copyright © 2009,2011 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Eric Anholt * Chris Wilson * */ /** @file gem_vmap_blits.c * * This is a test of doing many blits using a mixture of normal system pages * and uncached linear buffers, with a working set larger than the * aperture size. * * The goal is to simply ensure the basics work. */ #include #include #include #include #include #include #include #include #include #include "drm.h" #include "i915_drm.h" #include "drmtest.h" #include "intel_bufmgr.h" #include "intel_batchbuffer.h" #include "intel_gpu_tools.h" #if !defined(I915_PARAM_HAS_VMAP) #warning No vmap support in drm, skipping int main(int argc, char **argv) { fprintf(stderr, "No vmap support in drm.\n"); return 77; } #else #define WIDTH 512 #define HEIGHT 512 static uint32_t linear[WIDTH*HEIGHT]; static uint32_t gem_vmap(int fd, void *ptr, int size, int read_only) { struct drm_i915_gem_vmap vmap; vmap.user_ptr = (uintptr_t)ptr; vmap.user_size = size; vmap.flags = 0; if (read_only) vmap.flags |= I915_VMAP_READ_ONLY; if (drmIoctl(fd, DRM_IOCTL_I915_GEM_VMAP, &vmap)) return 0; return vmap.handle; } static void gem_vmap_sync(int fd, uint32_t handle) { gem_set_domain(fd, handle, I915_GEM_DOMAIN_CPU, I915_GEM_DOMAIN_CPU); } static void gem_read(int fd, uint32_t handle, int offset, int size, void *buf) { struct drm_i915_gem_pread pread; int ret; pread.handle = handle; pread.offset = offset; pread.size = size; pread.data_ptr = (uintptr_t)buf; ret = drmIoctl(fd, DRM_IOCTL_I915_GEM_PREAD, &pread); assert(ret == 0); } static void copy(int fd, uint32_t dst, uint32_t src) { uint32_t batch[10]; struct drm_i915_gem_relocation_entry reloc[2]; struct drm_i915_gem_exec_object2 obj[3]; struct drm_i915_gem_execbuffer2 exec; uint32_t handle; int ret; batch[0] = XY_SRC_COPY_BLT_CMD | XY_SRC_COPY_BLT_WRITE_ALPHA | XY_SRC_COPY_BLT_WRITE_RGB; batch[1] = (3 << 24) | /* 32 bits */ (0xcc << 16) | /* copy ROP */ WIDTH*4; batch[2] = 0; /* dst x1,y1 */ batch[3] = (HEIGHT << 16) | WIDTH; /* dst x2,y2 */ batch[4] = 0; /* dst reloc */ batch[5] = 0; /* src x1,y1 */ batch[6] = WIDTH*4; batch[7] = 0; /* src reloc */ batch[8] = MI_BATCH_BUFFER_END; batch[9] = MI_NOOP; handle = gem_create(fd, 4096); gem_write(fd, handle, 0, batch, sizeof(batch)); reloc[0].target_handle = dst; reloc[0].delta = 0; reloc[0].offset = 4 * sizeof(batch[0]); reloc[0].presumed_offset = 0; reloc[0].read_domains = I915_GEM_DOMAIN_RENDER;; reloc[0].write_domain = I915_GEM_DOMAIN_RENDER; reloc[1].target_handle = src; reloc[1].delta = 0; reloc[1].offset = 7 * sizeof(batch[0]); reloc[1].presumed_offset = 0; reloc[1].read_domains = I915_GEM_DOMAIN_RENDER;; reloc[1].write_domain = 0; obj[0].handle = dst; obj[0].relocation_count = 0; obj[0].relocs_ptr = 0; obj[0].alignment = 0; obj[0].offset = 0; obj[0].flags = 0; obj[0].rsvd1 = 0; obj[0].rsvd2 = 0; obj[1].handle = src; obj[1].relocation_count = 0; obj[1].relocs_ptr = 0; obj[1].alignment = 0; obj[1].offset = 0; obj[1].flags = 0; obj[1].rsvd1 = 0; obj[1].rsvd2 = 0; obj[2].handle = handle; obj[2].relocation_count = 2; obj[2].relocs_ptr = (uintptr_t)reloc; obj[2].alignment = 0; obj[2].offset = 0; obj[2].flags = 0; obj[2].rsvd1 = obj[2].rsvd2 = 0; exec.buffers_ptr = (uintptr_t)obj; exec.buffer_count = 3; exec.batch_start_offset = 0; exec.batch_len = sizeof(batch); exec.DR1 = exec.DR4 = 0; exec.num_cliprects = 0; exec.cliprects_ptr = 0; exec.flags = HAS_BLT_RING(intel_get_drm_devid(fd)) ? I915_EXEC_BLT : 0; exec.rsvd1 = exec.rsvd2 = 0; ret = drmIoctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, &exec); while (ret && errno == EBUSY) { drmCommandNone(fd, DRM_I915_GEM_THROTTLE); ret = drmIoctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, &exec); } assert(ret == 0); gem_close(fd, handle); } static uint32_t create_vmap(int fd, uint32_t val, uint32_t *ptr) { uint32_t handle; int i; handle = gem_vmap(fd, ptr, sizeof(linear), 0); /* Fill the BO with dwords starting at val */ for (i = 0; i < WIDTH*HEIGHT; i++) ptr[i] = val++; return handle; } static uint32_t create_bo(int fd, uint32_t val) { uint32_t handle; int i; handle = gem_create(fd, sizeof(linear)); /* Fill the BO with dwords starting at val */ for (i = 0; i < WIDTH*HEIGHT; i++) linear[i] = val++; gem_write(fd, handle, 0, linear, sizeof(linear)); return handle; } static void check_cpu(uint32_t *ptr, uint32_t val) { int i; for (i = 0; i < WIDTH*HEIGHT; i++) { if (ptr[i] != val) { fprintf(stderr, "Expected 0x%08x, found 0x%08x " "at offset 0x%08x\n", val, ptr[i], i * 4); abort(); } val++; } } static void check_gpu(int fd, uint32_t handle, uint32_t val) { gem_read(fd, handle, 0, linear, sizeof(linear)); check_cpu(linear, val); } static int has_vmap(int fd) { drm_i915_getparam_t gp; int i; gp.param = I915_PARAM_HAS_VMAP; gp.value = &i; return drmIoctl(fd, DRM_IOCTL_I915_GETPARAM, &gp) == 0 && i > 0; } int main(int argc, char **argv) { uint32_t *memory; uint32_t *cpu, *cpu_val; uint32_t *gpu, *gpu_val; uint32_t start = 0; int i, fd, count; fd = drm_open_any(); if (!has_vmap(fd)) { fprintf(stderr, "No vmap support, ignoring.\n"); return 77; } count = 0; if (argc > 1) count = atoi(argv[1]); if (count == 0) count = 3 * gem_aperture_size(fd) / (1024*1024) / 4; printf("Using 2x%d 1MiB buffers\n", count); memory = malloc(count*sizeof(linear)); if (memory == NULL) { fprintf(stderr, "Unable to allocate %lld bytes\n", (long long)count*sizeof(linear)); return 1; } gpu = malloc(sizeof(uint32_t)*count*4); gpu_val = gpu + count; cpu = gpu_val + count; cpu_val = cpu + count; for (i = 0; i < count; i++) { gpu[i] = create_bo(fd, start); gpu_val[i] = start; start += WIDTH*HEIGHT; } for (i = 0; i < count; i++) { cpu[i] = create_vmap(fd, start, memory+i*WIDTH*HEIGHT); cpu_val[i] = start; start += WIDTH*HEIGHT;; } printf("Verifying initialisation...\n"); for (i = 0; i < count; i++) { check_gpu(fd, gpu[i], gpu_val[i]); check_cpu(memory+i*WIDTH*HEIGHT, cpu_val[i]); } printf("Cyclic blits cpu->gpu, forward...\n"); for (i = 0; i < count * 4; i++) { int src = i % count; int dst = (i + 1) % count; copy(fd, gpu[dst], cpu[src]); gpu_val[dst] = cpu_val[src]; } for (i = 0; i < count; i++) check_gpu(fd, gpu[i], gpu_val[i]); printf("Cyclic blits gpu->cpu, backward...\n"); for (i = 0; i < count * 4; i++) { int src = (i + 1) % count; int dst = i % count; copy(fd, cpu[dst], gpu[src]); cpu_val[dst] = gpu_val[src]; } for (i = 0; i < count; i++) { gem_vmap_sync(fd, cpu[i]); check_cpu(memory+i*WIDTH*HEIGHT, cpu_val[i]); } printf("Random blits...\n"); for (i = 0; i < count * 4; i++) { int src = random() % count; int dst = random() % count; if (random() & 1) { copy(fd, gpu[dst], cpu[src]); gpu_val[dst] = cpu_val[src]; } else { copy(fd, cpu[dst], gpu[src]); cpu_val[dst] = gpu_val[src]; } } for (i = 0; i < count; i++) { check_gpu(fd, gpu[i], gpu_val[i]); gem_vmap_sync(fd, cpu[i]); check_cpu(memory+i*WIDTH*HEIGHT, cpu_val[i]); } return 0; } #endif intel-gpu-tools-1.3/tests/debugfs_wedged0000775000175100017510000000045311741627117015403 00000000000000#!/bin/sh SOURCE_DIR="$( dirname "${BASH_SOURCE[0]}" )" . $SOURCE_DIR/drm_lib.sh # Testcase: wedge the hw to check the error_state reading # # Unfortunately wedged is permanent, so this test is not run by default echo 1 > ${i915_path}/i915_wedged cat $i915_path/i915_error_state > /dev/null 2>&1 intel-gpu-tools-1.3/tests/gem_pwrite.c0000664000175100017510000000616111706636070015026 00000000000000/* * Copyright © 2011 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Chris Wilson * */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include "drm.h" #include "i915_drm.h" #include "drmtest.h" #define OBJECT_SIZE 16384 #define COPY_BLT_CMD (2<<29|0x53<<22|0x6) #define BLT_WRITE_ALPHA (1<<21) #define BLT_WRITE_RGB (1<<20) #define BLT_SRC_TILED (1<<15) #define BLT_DST_TILED (1<<11) #define MI_BATCH_BUFFER_END (0xA<<23) static void do_gem_write(int fd, uint32_t handle, void *buf, int len, int loops) { while (loops--) gem_write(fd, handle, 0, buf, len); } static double elapsed(const struct timeval *start, const struct timeval *end, int loop) { return (1e6*(end->tv_sec - start->tv_sec) + (end->tv_usec - start->tv_usec))/loop; } static const char *bytes_per_sec(char *buf, double v) { const char *order[] = { "", "KiB", "MiB", "GiB", "TiB", NULL, }, **o = order; while (v > 1000 && o[1]) { v /= 1000; o++; } sprintf(buf, "%.1f%s/s", v, *o); return buf; } int main(int argc, char **argv) { int object_size = 0; uint32_t buf[20]; uint32_t *src, dst; int fd, count; if (argc > 1) object_size = atoi(argv[1]); if (object_size == 0) object_size = OBJECT_SIZE; object_size = (object_size + 3) & -4; fd = drm_open_any(); dst = gem_create(fd, object_size); src = malloc(object_size); for (count = 1; count <= 1<<17; count <<= 1) { struct timeval start, end; gettimeofday(&start, NULL); do_gem_write(fd, dst, src, object_size, count); gettimeofday(&end, NULL); printf("Time to pwrite %d bytes x %6d: %7.3fµs, %s\n", object_size, count, elapsed(&start, &end, count), bytes_per_sec((char *)buf, object_size/elapsed(&start, &end, count)*1e6)); fflush(stdout); } free(src); gem_close(fd, dst); close(fd); return 0; } intel-gpu-tools-1.3/tests/getstats.c0000664000175100017510000000307111636577643014533 00000000000000/* * Copyright © 2007 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Eric Anholt * */ #include #include #include "drmtest.h" /** * Checks DRM_IOCTL_GET_STATS. * * I don't care too much about the actual contents, just that the kernel * doesn't crash. */ int main(int argc, char **argv) { int fd, ret; drm_stats_t stats; fd = drm_open_any(); ret = ioctl(fd, DRM_IOCTL_GET_STATS, &stats); assert(ret == 0); close(fd); return 0; } intel-gpu-tools-1.3/tests/gem_mmap_gtt.c0000664000175100017510000000656511706636070015334 00000000000000/* * Copyright © 2011 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Chris Wilson * */ #include #include #include #include #include #include #include #include #include #include #include #include "drm.h" #include "i915_drm.h" #include "drmtest.h" #define OBJECT_SIZE (16*1024*1024) static void set_domain(int fd, uint32_t handle) { gem_set_domain(fd, handle, I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT); } static void * mmap_bo(int fd, uint32_t handle) { void *ptr; ptr = gem_mmap(fd, handle, OBJECT_SIZE, PROT_READ | PROT_WRITE); assert(ptr != MAP_FAILED); return ptr; } static void * create_pointer(int fd) { uint32_t handle; void *ptr; handle = gem_create(fd, OBJECT_SIZE); ptr = mmap_bo(fd, handle); gem_close(fd, handle); return ptr; } static void test_copy(int fd) { void *src, *dst; /* copy from a fresh src to fresh dst to force pagefault on both */ src = create_pointer(fd); dst = create_pointer(fd); memcpy(dst, src, OBJECT_SIZE); memcpy(src, dst, OBJECT_SIZE); munmap(dst, OBJECT_SIZE); munmap(src, OBJECT_SIZE); } static void test_write(int fd) { void *src; uint32_t dst; /* copy from a fresh src to fresh dst to force pagefault on both */ src = create_pointer(fd); dst = gem_create(fd, OBJECT_SIZE); gem_write(fd, dst, 0, src, OBJECT_SIZE); gem_close(fd, dst); munmap(src, OBJECT_SIZE); } static void test_write_gtt(int fd) { uint32_t dst; char *dst_gtt; void *src; dst = gem_create(fd, OBJECT_SIZE); /* prefault object into gtt */ dst_gtt = mmap_bo(fd, dst); set_domain(fd, dst); memset(dst_gtt, 0, OBJECT_SIZE); munmap(dst_gtt, OBJECT_SIZE); src = create_pointer(fd); gem_write(fd, dst, 0, src, OBJECT_SIZE); gem_close(fd, dst); munmap(src, OBJECT_SIZE); } static void test_read(int fd) { void *dst; uint32_t src; /* copy from a fresh src to fresh dst to force pagefault on both */ dst = create_pointer(fd); src = gem_create(fd, OBJECT_SIZE); gem_read(fd, src, 0, dst, OBJECT_SIZE); gem_close(fd, src); munmap(dst, OBJECT_SIZE); } int main(int argc, char **argv) { int fd; fd = drm_open_any(); test_copy(fd); test_read(fd); test_write(fd); test_write_gtt(fd); close(fd); return 0; } intel-gpu-tools-1.3/tests/gem_pipe_control_store_loop.c0000664000175100017510000001241411664511026020450 00000000000000/* * Copyright © 2011 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Daniel Vetter (based on gem_storedw_*.c) * */ /* * Testcase: (TLB-)Coherency of pipe_control QW writes * * Writes a counter-value into an always newly allocated target bo (by disabling * buffer reuse). Decently trashes on tlb inconsistencies, too. */ #include #include #include #include #include #include #include #include #include #include "drm.h" #include "i915_drm.h" #include "drmtest.h" #include "intel_bufmgr.h" #include "intel_batchbuffer.h" #include "intel_gpu_tools.h" static drm_intel_bufmgr *bufmgr; struct intel_batchbuffer *batch; uint32_t devid; #define GFX_OP_PIPE_CONTROL ((0x3<<29)|(0x3<<27)|(0x2<<24)|2) #define PIPE_CONTROL_WRITE_IMMEDIATE (1<<14) #define PIPE_CONTROL_WRITE_TIMESTAMP (3<<14) #define PIPE_CONTROL_DEPTH_STALL (1<<13) #define PIPE_CONTROL_WC_FLUSH (1<<12) #define PIPE_CONTROL_IS_FLUSH (1<<11) /* MBZ on Ironlake */ #define PIPE_CONTROL_TC_FLUSH (1<<10) /* GM45+ only */ #define PIPE_CONTROL_STALL_AT_SCOREBOARD (1<<1) #define PIPE_CONTROL_CS_STALL (1<<20) #define PIPE_CONTROL_GLOBAL_GTT (1<<2) /* in addr dword */ /* Like the store dword test, but we create new command buffers each time */ static void store_pipe_control_loop(void) { int i, val = 0; uint32_t *buf; drm_intel_bo *target_bo; for (i = 0; i < 0x10000; i++) { /* we want to check tlb consistency of the pipe_control target, * so get a new buffer every time around */ target_bo = drm_intel_bo_alloc(bufmgr, "target bo", 4096, 4096); if (!target_bo) { fprintf(stderr, "failed to alloc target buffer\n"); exit(-1); } /* gem_storedw_batches_loop.c is a bit overenthusiastic with * creating new batchbuffers - with buffer reuse disabled, the * support code will do that for us. */ if (intel_gen(devid) >= 6) { /* work-around hw issue, see intel_emit_post_sync_nonzero_flush * in mesa sources. */ BEGIN_BATCH(4); OUT_BATCH(GFX_OP_PIPE_CONTROL); OUT_BATCH(PIPE_CONTROL_CS_STALL | PIPE_CONTROL_STALL_AT_SCOREBOARD); OUT_BATCH(0); /* address */ OUT_BATCH(0); /* write data */ ADVANCE_BATCH(); BEGIN_BATCH(4); OUT_BATCH(GFX_OP_PIPE_CONTROL); OUT_BATCH(PIPE_CONTROL_WRITE_IMMEDIATE); OUT_RELOC(target_bo, I915_GEM_DOMAIN_INSTRUCTION, I915_GEM_DOMAIN_INSTRUCTION, PIPE_CONTROL_GLOBAL_GTT); OUT_BATCH(val); /* write data */ ADVANCE_BATCH(); } else if (intel_gen(devid) >= 4) { BEGIN_BATCH(4); OUT_BATCH(GFX_OP_PIPE_CONTROL | PIPE_CONTROL_WC_FLUSH | PIPE_CONTROL_TC_FLUSH | PIPE_CONTROL_WRITE_IMMEDIATE | 2); OUT_RELOC(target_bo, I915_GEM_DOMAIN_INSTRUCTION, I915_GEM_DOMAIN_INSTRUCTION, PIPE_CONTROL_GLOBAL_GTT); OUT_BATCH(val); OUT_BATCH(0xdeadbeef); ADVANCE_BATCH(); } intel_batchbuffer_flush_on_ring(batch, 0); drm_intel_bo_map(target_bo, 1); buf = target_bo->virtual; if (buf[0] != val) { fprintf(stderr, "value mismatch: cur 0x%08x, stored 0x%08x\n", buf[0], val); exit(-1); } buf[0] = 0; /* let batch write it again */ drm_intel_bo_unmap(target_bo); drm_intel_bo_unreference(target_bo); val++; } printf("completed %d writes successfully\n", i); } int main(int argc, char **argv) { int fd; if (argc != 1) { fprintf(stderr, "usage: %s\n", argv[0]); exit(-1); } fd = drm_open_any(); devid = intel_get_drm_devid(fd); bufmgr = drm_intel_bufmgr_gem_init(fd, 4096); if (!bufmgr) { fprintf(stderr, "failed to init libdrm\n"); exit(-1); } if (IS_GEN2(devid) || IS_GEN3(devid)) { fprintf(stderr, "no pipe_control on gen2/3\n"); return 77; } if (devid == PCI_CHIP_I965_G) { fprintf(stderr, "pipe_control totally broken on i965\n"); return 77; } /* IMPORTANT: No call to * drm_intel_bufmgr_gem_enable_reuse(bufmgr); * here because we wan't to have fresh buffers (to trash the tlb) * every time! */ batch = intel_batchbuffer_alloc(bufmgr, devid); if (!batch) { fprintf(stderr, "failed to create batch buffer\n"); exit(-1); } store_pipe_control_loop(); intel_batchbuffer_free(batch); drm_intel_bufmgr_destroy(bufmgr); close(fd); return 0; } intel-gpu-tools-1.3/tests/getversion.c0000664000175100017510000000314111566027747015055 00000000000000/* * Copyright © 2007 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Eric Anholt * */ #include #include #include "drmtest.h" /** * Checks DRM_IOCTL_GET_VERSION and libdrm's drmGetVersion() interface to it. */ int main(int argc, char **argv) { int fd; drmVersionPtr v; fd = drm_open_any(); v = drmGetVersion(fd); assert(strlen(v->name) != 0); assert(strlen(v->date) != 0); assert(strlen(v->desc) != 0); assert(v->version_major >= 1); drmFree(v); close(fd); return 0; } intel-gpu-tools-1.3/tests/gem_cs_prefetch.c0000664000175100017510000001131211731574443015776 00000000000000/* * Copyright © 2011 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Daniel Vetter * */ /* * Testcase: Test the CS prefetch behaviour on batches * * Historically the batch prefetcher doesn't check whether it's crossing page * boundaries and likes to throw up when it gets a pagefault in return for his * over-eager behaviour. Check for this. */ #include #include #include #include #include #include #include #include #include #include "drm.h" #include "i915_drm.h" #include "drmtest.h" #include "intel_bufmgr.h" #include "intel_batchbuffer.h" #include "intel_gpu_tools.h" static drm_intel_bufmgr *bufmgr; struct intel_batchbuffer *batch; static void exec(int fd, uint32_t handle) { struct drm_i915_gem_execbuffer2 execbuf; struct drm_i915_gem_exec_object2 gem_exec[1]; int ret = 0; gem_exec[0].handle = handle; gem_exec[0].relocation_count = 0; gem_exec[0].relocs_ptr = 0; gem_exec[0].alignment = 0; gem_exec[0].offset = 0; gem_exec[0].flags = 0; gem_exec[0].rsvd1 = 0; gem_exec[0].rsvd2 = 0; execbuf.buffers_ptr = (uintptr_t)gem_exec; execbuf.buffer_count = 1; execbuf.batch_start_offset = 0; execbuf.batch_len = 4096; execbuf.cliprects_ptr = 0; execbuf.num_cliprects = 0; execbuf.DR1 = 0; execbuf.DR4 = 0; execbuf.flags = 0; execbuf.rsvd1 = 0; execbuf.rsvd2 = 0; ret = drmIoctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, &execbuf); gem_sync(fd, handle); assert(ret == 0); } int main(int argc, char **argv) { uint32_t batch_end[4] = {MI_BATCH_BUFFER_END, 0, 0, 0}; int fd, i, ret; uint64_t aper_size; int count; drm_intel_bo *sample_batch_bo; fd = drm_open_any(); bufmgr = drm_intel_bufmgr_gem_init(fd, 4096); if (!bufmgr) { fprintf(stderr, "failed to init libdrm\n"); exit(-1); } drm_intel_bufmgr_gem_enable_reuse(bufmgr); aper_size = gem_aperture_size(fd); /* presume a big per-bo overhead */ if (intel_get_total_ram_mb() < (aper_size / (1024*1024)) * 3 / 2) { fprintf(stderr, "not enough mem to run test\n"); return 77; } count = aper_size / 4096; batch = intel_batchbuffer_alloc(bufmgr, intel_get_drm_devid(fd)); assert(batch); sample_batch_bo = drm_intel_bo_alloc(bufmgr, "", 4096, 4096); assert(sample_batch_bo); ret = drm_intel_bo_subdata(sample_batch_bo, 4096-sizeof(batch_end), sizeof(batch_end), batch_end); assert(ret == 0); /* fill the entire gart with batches and run them */ for (i = 0; i < count; i++) { drm_intel_bo *batch_bo; batch_bo = drm_intel_bo_alloc(bufmgr, "", 4096, 4096); assert(batch_bo); /* copy the sample batch with the gpu to the new one, so that we * also test the unmappable part of the gtt. */ BEGIN_BATCH(8); OUT_BATCH(XY_SRC_COPY_BLT_CMD | XY_SRC_COPY_BLT_WRITE_ALPHA | XY_SRC_COPY_BLT_WRITE_RGB); OUT_BATCH((3 << 24) | /* 32 bits */ (0xcc << 16) | /* copy ROP */ 4096); OUT_BATCH(0); /* dst y1,x1 */ OUT_BATCH((1 << 16) | 1024); OUT_RELOC(batch_bo, I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER, 0); OUT_BATCH((0 << 16) | 0); /* src x1, y1 */ OUT_BATCH(4096); OUT_RELOC(sample_batch_bo, I915_GEM_DOMAIN_RENDER, 0, 0); ADVANCE_BATCH(); intel_batchbuffer_flush(batch); if (i % 100 == 0) gem_sync(fd, batch_bo->handle); drm_intel_bo_disable_reuse(batch_bo); /* launch the newly created batch */ exec(fd, batch_bo->handle); // leak buffers //drm_intel_bo_unreference(batch_bo); drmtest_progress("gem_cs_prefetch: ", i, count); } fprintf(stderr, "Test suceeded, cleanup up - this might take a while.\n"); drm_intel_bufmgr_destroy(bufmgr); close(fd); return 0; } intel-gpu-tools-1.3/tests/drm_lib.sh0000775000175100017510000000101311741627117014457 00000000000000#!/bin/sh die() { echo "$@" exit 1 } if [ -d /debug/dri ] ; then debugfs_path=/debug/dri fi if [ -d /sys/kernel/debug/dri ] ; then debugfs_path=/sys/kernel/debug/dri fi i915_path=x for dir in `ls $debugfs_path` ; do if [ -f $debugfs_path/$dir/i915_error_state ] ; then i915_path=$debugfs_path/$dir break fi done if [ $i915_path = "x" ] ; then die " i915 debugfs path not found." fi # read everything we can if [ `cat $i915_path/clients | wc -l` -gt "2" ] ; then die "ERROR: other drm clients running" fi intel-gpu-tools-1.3/tests/gem_ctx_basic.c0000664000175100017510000000735411775241246015463 00000000000000/* * Copyright © 2011 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Ben Widawsky * */ /* * This test is useful for finding memory and refcount leaks. */ #include #include "rendercopy.h" /* options */ int num_contexts = 10; int uncontexted = 0; /* test only context create/destroy */ int multiple_fds = 1; int iter = 10000; /* globals */ pthread_t *threads; int *returns; int devid; int fd; static void init_buffer(drm_intel_bufmgr *bufmgr, struct scratch_buf *buf, uint32_t size) { buf->bo = drm_intel_bo_alloc(bufmgr, "", size, 4096); buf->size = size; assert(buf->bo); buf->tiling = I915_TILING_NONE; buf->stride = 4096; } static void *work(void *arg) { struct intel_batchbuffer *batch; drm_intel_context *context; drm_intel_bufmgr *bufmgr; int thread_id = *(int *)arg; int td_fd; int i; if (multiple_fds) td_fd = fd = drm_open_any(); else td_fd = fd; assert(td_fd >= 0); bufmgr = drm_intel_bufmgr_gem_init(td_fd, 4096); batch = intel_batchbuffer_alloc(bufmgr, devid); context = drm_intel_gem_context_create(bufmgr); if (!context) { returns[thread_id] = 77; goto out; } for (i = 0; i < iter; i++) { struct scratch_buf src, dst; init_buffer(bufmgr, &src, 4096); init_buffer(bufmgr, &dst, 4096); if (uncontexted) { gen6_render_copyfunc(batch, &src, 0, 0, 0, 0, &dst, 0, 0); } else { int ret; ret = drm_intel_bo_subdata(batch->bo, 0, 4096, batch->buffer); assert(ret == 0); intel_batchbuffer_flush_with_context(batch, context); } } out: drm_intel_gem_context_destroy(context); intel_batchbuffer_free(batch); drm_intel_bufmgr_destroy(bufmgr); if (multiple_fds) close(td_fd); pthread_exit(&returns[thread_id]); } static void parse(int argc, char *argv[]) { int opt; while ((opt = getopt(argc, argv, "i:c:n:muh?")) != -1) { switch (opt) { case 'i': iter = atoi(optarg); break; case 'c': num_contexts = atoi(optarg); break; case 'm': multiple_fds = 1; break; case 'u': uncontexted = 1; break; case 'h': case '?': default: exit(EXIT_SUCCESS); break; } } } int main(int argc, char *argv[]) { int i; fd = drm_open_any(); devid = intel_get_drm_devid(fd); parse(argc, argv); threads = calloc(num_contexts, sizeof(*threads)); returns = calloc(num_contexts, sizeof(*returns)); for (i = 0; i < num_contexts; i++) pthread_create(&threads[i], NULL, work, &i); for (i = 0; i < num_contexts; i++) { int thread_status, ret; void *retval; ret = pthread_join(threads[i], &retval); thread_status = *(int *)retval; if (!ret && thread_status) exit(thread_status); } free(returns); free(threads); close(fd); exit(EXIT_SUCCESS); } intel-gpu-tools-1.3/tests/gen3_render_mixed_blits.c0000664000175100017510000002713011772702746017450 00000000000000/* * Copyright © 2011 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Chris Wilson * */ /** @file gen3_linear_render_blits.c * * This is a test of doing many blits, with a working set * larger than the aperture size. * * The goal is to simply ensure the basics work. */ #include #include #include #include #include #include #include #include #include #include #include #include "drm.h" #include "i915_drm.h" #include "drmtest.h" #include "intel_gpu_tools.h" #include "i915_reg.h" #include "i915_3d.h" #define WIDTH 512 #define HEIGHT 512 static inline uint32_t pack_float(float f) { union { uint32_t dw; float f; } u; u.f = f; return u.dw; } static uint32_t fill_reloc(struct drm_i915_gem_relocation_entry *reloc, uint32_t offset, uint32_t handle, uint32_t read_domain, uint32_t write_domain) { reloc->target_handle = handle; reloc->delta = 0; reloc->offset = offset * sizeof(uint32_t); reloc->presumed_offset = 0; reloc->read_domains = read_domain; reloc->write_domain = write_domain; return reloc->presumed_offset + reloc->delta; } static void copy(int fd, uint32_t dst, int dst_tiling, uint32_t src, int src_tiling) { uint32_t batch[1024], *b = batch; struct drm_i915_gem_relocation_entry reloc[2], *r = reloc; struct drm_i915_gem_exec_object2 obj[3]; struct drm_i915_gem_execbuffer2 exec; uint32_t handle; uint32_t tiling_bits; int ret; /* invariant state */ *b++ = (_3DSTATE_AA_CMD | AA_LINE_ECAAR_WIDTH_ENABLE | AA_LINE_ECAAR_WIDTH_1_0 | AA_LINE_REGION_WIDTH_ENABLE | AA_LINE_REGION_WIDTH_1_0); *b++ = (_3DSTATE_INDEPENDENT_ALPHA_BLEND_CMD | IAB_MODIFY_ENABLE | IAB_MODIFY_FUNC | (BLENDFUNC_ADD << IAB_FUNC_SHIFT) | IAB_MODIFY_SRC_FACTOR | (BLENDFACT_ONE << IAB_SRC_FACTOR_SHIFT) | IAB_MODIFY_DST_FACTOR | (BLENDFACT_ZERO << IAB_DST_FACTOR_SHIFT)); *b++ = (_3DSTATE_DFLT_DIFFUSE_CMD); *b++ = (0); *b++ = (_3DSTATE_DFLT_SPEC_CMD); *b++ = (0); *b++ = (_3DSTATE_DFLT_Z_CMD); *b++ = (0); *b++ = (_3DSTATE_COORD_SET_BINDINGS | CSB_TCB(0, 0) | CSB_TCB(1, 1) | CSB_TCB(2, 2) | CSB_TCB(3, 3) | CSB_TCB(4, 4) | CSB_TCB(5, 5) | CSB_TCB(6, 6) | CSB_TCB(7, 7)); *b++ = (_3DSTATE_RASTER_RULES_CMD | ENABLE_POINT_RASTER_RULE | OGL_POINT_RASTER_RULE | ENABLE_LINE_STRIP_PROVOKE_VRTX | ENABLE_TRI_FAN_PROVOKE_VRTX | LINE_STRIP_PROVOKE_VRTX(1) | TRI_FAN_PROVOKE_VRTX(2) | ENABLE_TEXKILL_3D_4D | TEXKILL_4D); *b++ = (_3DSTATE_MODES_4_CMD | ENABLE_LOGIC_OP_FUNC | LOGIC_OP_FUNC(LOGICOP_COPY) | ENABLE_STENCIL_WRITE_MASK | STENCIL_WRITE_MASK(0xff) | ENABLE_STENCIL_TEST_MASK | STENCIL_TEST_MASK(0xff)); *b++ = (_3DSTATE_LOAD_STATE_IMMEDIATE_1 | I1_LOAD_S(3) | I1_LOAD_S(4) | I1_LOAD_S(5) | 2); *b++ = (0x00000000); /* Disable texture coordinate wrap-shortest */ *b++ = ((1 << S4_POINT_WIDTH_SHIFT) | S4_LINE_WIDTH_ONE | S4_CULLMODE_NONE | S4_VFMT_XY); *b++ = (0x00000000); /* Stencil. */ *b++ = (_3DSTATE_SCISSOR_ENABLE_CMD | DISABLE_SCISSOR_RECT); *b++ = (_3DSTATE_SCISSOR_RECT_0_CMD); *b++ = (0); *b++ = (0); *b++ = (_3DSTATE_DEPTH_SUBRECT_DISABLE); *b++ = (_3DSTATE_LOAD_INDIRECT | 0); /* disable indirect state */ *b++ = (0); *b++ = (_3DSTATE_STIPPLE); *b++ = (0x00000000); *b++ = (_3DSTATE_BACKFACE_STENCIL_OPS | BFO_ENABLE_STENCIL_TWO_SIDE | 0); /* samler state */ tiling_bits = 0; if (src_tiling != I915_TILING_NONE) tiling_bits = MS3_TILED_SURFACE; if (src_tiling == I915_TILING_Y) tiling_bits |= MS3_TILE_WALK; #define TEX_COUNT 1 *b++ = (_3DSTATE_MAP_STATE | (3 * TEX_COUNT)); *b++ = ((1 << TEX_COUNT) - 1); *b = fill_reloc(r++, b-batch, src, I915_GEM_DOMAIN_SAMPLER, 0); b++; *b++ = (MAPSURF_32BIT | MT_32BIT_ARGB8888 | tiling_bits | (HEIGHT - 1) << MS3_HEIGHT_SHIFT | (WIDTH - 1) << MS3_WIDTH_SHIFT); *b++ = ((WIDTH-1) << MS4_PITCH_SHIFT); *b++ = (_3DSTATE_SAMPLER_STATE | (3 * TEX_COUNT)); *b++ = ((1 << TEX_COUNT) - 1); *b++ = (MIPFILTER_NONE << SS2_MIP_FILTER_SHIFT | FILTER_NEAREST << SS2_MAG_FILTER_SHIFT | FILTER_NEAREST << SS2_MIN_FILTER_SHIFT); *b++ = (TEXCOORDMODE_WRAP << SS3_TCX_ADDR_MODE_SHIFT | TEXCOORDMODE_WRAP << SS3_TCY_ADDR_MODE_SHIFT | 0 << SS3_TEXTUREMAP_INDEX_SHIFT); *b++ = (0x00000000); /* render target state */ tiling_bits = 0; if (dst_tiling != I915_TILING_NONE) tiling_bits = BUF_3D_TILED_SURFACE; if (dst_tiling == I915_TILING_Y) tiling_bits |= BUF_3D_TILE_WALK_Y; *b++ = (_3DSTATE_BUF_INFO_CMD); *b++ = (BUF_3D_ID_COLOR_BACK | tiling_bits | WIDTH*4); *b = fill_reloc(r++, b-batch, dst, I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER); b++; *b++ = (_3DSTATE_DST_BUF_VARS_CMD); *b++ = (COLR_BUF_ARGB8888 | DSTORG_HORT_BIAS(0x8) | DSTORG_VERT_BIAS(0x8)); /* draw rect is unconditional */ *b++ = (_3DSTATE_DRAW_RECT_CMD); *b++ = (0x00000000); *b++ = (0x00000000); /* ymin, xmin */ *b++ = (DRAW_YMAX(HEIGHT - 1) | DRAW_XMAX(WIDTH - 1)); /* yorig, xorig (relate to color buffer?) */ *b++ = (0x00000000); /* texfmt */ *b++ = (_3DSTATE_LOAD_STATE_IMMEDIATE_1 | I1_LOAD_S(1) | I1_LOAD_S(2) | I1_LOAD_S(6) | 2); *b++ = ((4 << S1_VERTEX_WIDTH_SHIFT) | (4 << S1_VERTEX_PITCH_SHIFT)); *b++ = (~S2_TEXCOORD_FMT(0, TEXCOORDFMT_NOT_PRESENT) | S2_TEXCOORD_FMT(0, TEXCOORDFMT_2D)); *b++ = (S6_CBUF_BLEND_ENABLE | S6_COLOR_WRITE_ENABLE | BLENDFUNC_ADD << S6_CBUF_BLEND_FUNC_SHIFT | BLENDFACT_ONE << S6_CBUF_SRC_BLEND_FACT_SHIFT | BLENDFACT_ZERO << S6_CBUF_DST_BLEND_FACT_SHIFT); /* pixel shader */ *b++ = (_3DSTATE_PIXEL_SHADER_PROGRAM | (1 + 3*3 - 2)); /* decl FS_T0 */ *b++ = (D0_DCL | REG_TYPE(FS_T0) << D0_TYPE_SHIFT | REG_NR(FS_T0) << D0_NR_SHIFT | ((REG_TYPE(FS_T0) != REG_TYPE_S) ? D0_CHANNEL_ALL : 0)); *b++ = (0); *b++ = (0); /* decl FS_S0 */ *b++ = (D0_DCL | (REG_TYPE(FS_S0) << D0_TYPE_SHIFT) | (REG_NR(FS_S0) << D0_NR_SHIFT) | ((REG_TYPE(FS_S0) != REG_TYPE_S) ? D0_CHANNEL_ALL : 0)); *b++ = (0); *b++ = (0); /* texld(FS_OC, FS_S0, FS_T0 */ *b++ = (T0_TEXLD | (REG_TYPE(FS_OC) << T0_DEST_TYPE_SHIFT) | (REG_NR(FS_OC) << T0_DEST_NR_SHIFT) | (REG_NR(FS_S0) << T0_SAMPLER_NR_SHIFT)); *b++ = ((REG_TYPE(FS_T0) << T1_ADDRESS_REG_TYPE_SHIFT) | (REG_NR(FS_T0) << T1_ADDRESS_REG_NR_SHIFT)); *b++ = (0); *b++ = (PRIM3D_RECTLIST | (3*4 - 1)); *b++ = pack_float(WIDTH); *b++ = pack_float(HEIGHT); *b++ = pack_float(WIDTH); *b++ = pack_float(HEIGHT); *b++ = pack_float(0); *b++ = pack_float(HEIGHT); *b++ = pack_float(0); *b++ = pack_float(HEIGHT); *b++ = pack_float(0); *b++ = pack_float(0); *b++ = pack_float(0); *b++ = pack_float(0); *b++ = MI_BATCH_BUFFER_END; if ((b - batch) & 1) *b++ = 0; assert(b - batch <= 1024); handle = gem_create(fd, 4096); gem_write(fd, handle, 0, batch, (b-batch)*sizeof(batch[0])); assert(r-reloc == 2); obj[0].handle = dst; obj[0].relocation_count = 0; obj[0].relocs_ptr = 0; obj[0].alignment = 0; obj[0].offset = 0; obj[0].flags = 0; obj[0].rsvd1 = 0; obj[0].rsvd2 = 0; obj[1].handle = src; obj[1].relocation_count = 0; obj[1].relocs_ptr = 0; obj[1].alignment = 0; obj[1].offset = 0; obj[1].flags = 0; obj[1].rsvd1 = 0; obj[1].rsvd2 = 0; obj[2].handle = handle; obj[2].relocation_count = 2; obj[2].relocs_ptr = (uintptr_t)reloc; obj[2].alignment = 0; obj[2].offset = 0; obj[2].flags = 0; obj[2].rsvd1 = obj[2].rsvd2 = 0; exec.buffers_ptr = (uintptr_t)obj; exec.buffer_count = 3; exec.batch_start_offset = 0; exec.batch_len = (b-batch)*sizeof(batch[0]); exec.DR1 = exec.DR4 = 0; exec.num_cliprects = 0; exec.cliprects_ptr = 0; exec.flags = 0; i915_execbuffer2_set_context_id(exec, 0); exec.rsvd2 = 0; ret = drmIoctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, &exec); while (ret && errno == EBUSY) { drmCommandNone(fd, DRM_I915_GEM_THROTTLE); ret = drmIoctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, &exec); } assert(ret == 0); gem_close(fd, handle); } static uint32_t create_bo(int fd, uint32_t val, int tiling) { uint32_t handle; uint32_t *v; int i; handle = gem_create(fd, WIDTH*HEIGHT*4); gem_set_tiling(fd, handle, tiling, WIDTH*4); /* Fill the BO with dwords starting at val */ v = gem_mmap(fd, handle, WIDTH*HEIGHT*4, PROT_READ | PROT_WRITE); assert(v); for (i = 0; i < WIDTH*HEIGHT; i++) v[i] = val++; munmap(v, WIDTH*HEIGHT*4); return handle; } static void check_bo(int fd, uint32_t handle, uint32_t val) { uint32_t *v; int i; v = gem_mmap(fd, handle, WIDTH*HEIGHT*4, PROT_READ); assert(v); for (i = 0; i < WIDTH*HEIGHT; i++) { if (v[i] != val) { fprintf(stderr, "Expected 0x%08x, found 0x%08x " "at offset 0x%08x\n", val, v[i], i * 4); abort(); } val++; } munmap(v, WIDTH*HEIGHT*4); } int main(int argc, char **argv) { uint32_t *handle, *tiling, *start_val; uint32_t start = 0; int i, fd, count; fd = drm_open_any(); if (!IS_GEN3(intel_get_drm_devid(fd))) { printf("gen3-only test, doing nothing\n"); return 77; } count = 0; if (argc > 1) count = atoi(argv[1]); if (count == 0) count = 3 * gem_aperture_size(fd) / (1024*1024) / 2; printf("Using %d 1MiB buffers\n", count); handle = malloc(sizeof(uint32_t)*count*3); tiling = handle + count; start_val = tiling + count; for (i = 0; i < count; i++) { handle[i] = create_bo(fd, start, tiling[i] = i % 3); start_val[i] = start; start += 1024 * 1024 / 4; } printf("Verifying initialisation..."); fflush(stdout); for (i = 0; i < count; i++) check_bo(fd, handle[i], start_val[i]); printf("done\n"); printf("Cyclic blits, forward..."); fflush(stdout); for (i = 0; i < count * 32; i++) { int src = i % count; int dst = (i + 1) % count; copy(fd, handle[dst], tiling[dst], handle[src], tiling[src]); start_val[dst] = start_val[src]; } printf("verifying..."); fflush(stdout); for (i = 0; i < count; i++) check_bo(fd, handle[i], start_val[i]); printf("done\n"); printf("Cyclic blits, backward..."); fflush(stdout); for (i = 0; i < count * 32; i++) { int src = (i + 1) % count; int dst = i % count; copy(fd, handle[dst], tiling[dst], handle[src], tiling[src]); start_val[dst] = start_val[src]; } printf("verifying..."); fflush(stdout); for (i = 0; i < count; i++) check_bo(fd, handle[i], start_val[i]); printf("done\n"); printf("Random blits..."); fflush(stdout); for (i = 0; i < count * 32; i++) { int src = random() % count; int dst = random() % count; while (src == dst) dst = random() % count; copy(fd, handle[dst], tiling[dst], handle[src], tiling[src]); start_val[dst] = start_val[src]; } printf("verifying..."); fflush(stdout); for (i = 0; i < count; i++) check_bo(fd, handle[i], start_val[i]); printf("done\n"); return 0; } intel-gpu-tools-1.3/tests/gem_fenced_exec_thrash.c0000664000175100017510000001022111706636070017305 00000000000000/* * Copyright © 2011 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Chris Wilson * */ #define _GNU_SOURCE #include #include #include #include #include #include #include #include #include #include "drmtest.h" #define WIDTH 1024 #define HEIGHT 1024 #define OBJECT_SIZE (4*WIDTH*HEIGHT) #define BATCH_SIZE 4096 #define MAX_FENCES 16 #define MI_BATCH_BUFFER_END (0xA<<23) /* * Testcase: execbuf fence accounting * * We had a bug where we were falsely accounting upon reservation already * fenced buffers as occupying a fence register even if they did not require * one for the batch. * * We aim to exercise this by performing a sequence of fenced BLT * with 2*num_avail_fence buffers, but alternating which half are fenced in * each command. */ static uint32_t tiled_bo_create (int fd) { uint32_t handle; handle = gem_create(fd, OBJECT_SIZE); gem_set_tiling(fd, handle, I915_TILING_X, WIDTH*4); return handle; } static uint32_t batch_create (int fd) { uint32_t buf[] = { MI_BATCH_BUFFER_END, 0 }; uint32_t batch_handle; batch_handle = gem_create(fd, BATCH_SIZE); gem_write(fd, batch_handle, 0, buf, sizeof(buf)); return batch_handle; } static int get_num_fences(int fd) { drm_i915_getparam_t gp; int ret, val; gp.param = I915_PARAM_NUM_FENCES_AVAIL; gp.value = &val; ret = drmIoctl(fd, DRM_IOCTL_I915_GETPARAM, &gp); assert (ret == 0); printf ("total %d fences\n", val); assert(val > 4); return val - 2; } static void fill_reloc(struct drm_i915_gem_relocation_entry *reloc, uint32_t handle) { reloc->offset = 2 * sizeof(uint32_t); reloc->target_handle = handle; reloc->read_domains = I915_GEM_DOMAIN_RENDER; reloc->write_domain = 0; } int main(int argc, char **argv) { struct drm_i915_gem_execbuffer2 execbuf[2]; struct drm_i915_gem_exec_object2 exec[2][2*MAX_FENCES+1]; struct drm_i915_gem_relocation_entry reloc[2*MAX_FENCES]; int fd = drm_open_any(); int i, n, num_fences; int loop = 1000; memset(execbuf, 0, sizeof(execbuf)); memset(exec, 0, sizeof(exec)); memset(reloc, 0, sizeof(reloc)); num_fences = get_num_fences(fd) & ~1; assert(num_fences <= MAX_FENCES); for (n = 0; n < 2*num_fences; n++) { uint32_t handle = tiled_bo_create(fd); exec[1][2*num_fences - n-1].handle = exec[0][n].handle = handle; fill_reloc(&reloc[n], handle); } for (i = 0; i < 2; i++) { for (n = 0; n < num_fences; n++) exec[i][n].flags = EXEC_OBJECT_NEEDS_FENCE; exec[i][2*num_fences].handle = batch_create(fd); exec[i][2*num_fences].relocs_ptr = (uintptr_t)reloc; exec[i][2*num_fences].relocation_count = 2*num_fences; execbuf[i].buffers_ptr = (uintptr_t)exec[i]; execbuf[i].buffer_count = 2*num_fences+1; execbuf[i].batch_len = 2*sizeof(uint32_t); } do { int ret; ret = drmIoctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, &execbuf[0]); assert(ret == 0); ret = drmIoctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, &execbuf[1]); assert(ret == 0); } while (--loop); close(fd); return 0; } intel-gpu-tools-1.3/tests/drm_vma_limiter_cpu.c0000664000175100017510000000553711706636070016713 00000000000000/* * Copyright © 2011 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Daniel Vetter */ #include #include #include #include #include #include #include #include #include #include "drm.h" #include "i915_drm.h" #include "drmtest.h" #include "intel_bufmgr.h" #include "intel_batchbuffer.h" #include "intel_gpu_tools.h" static drm_intel_bufmgr *bufmgr; struct intel_batchbuffer *batch; /* Testcase: check whether the libdrm vma limiter works * * We've had reports of the X server exhausting the default rlimit of 64k vma's * in the kernel. libdrm has grown facilities to limit the vma caching since, * this checks whether they actually work. * * This one checks cpu mmaps only. */ #define BO_ARRAY_SIZE 68000 drm_intel_bo *bos[BO_ARRAY_SIZE]; int main(int argc, char **argv) { int fd; int i; char *ptr; fd = drm_open_any(); bufmgr = drm_intel_bufmgr_gem_init(fd, 4096); drm_intel_bufmgr_gem_enable_reuse(bufmgr); batch = intel_batchbuffer_alloc(bufmgr, intel_get_drm_devid(fd)); drm_intel_bufmgr_gem_set_vma_cache_size(bufmgr, 500); for (i = 0; i < BO_ARRAY_SIZE; i++) { bos[i] = drm_intel_bo_alloc(bufmgr, "mmap bo", 4096, 4096); assert(bos[i]); drm_intel_bo_map(bos[i], 1); ptr = bos[i]->virtual; assert(ptr); *ptr = 'c'; drm_intel_bo_unmap(bos[i]); } /* and recheck whether a second map of the same still works */ for (i = 0; i < BO_ARRAY_SIZE; i++) { bos[i] = drm_intel_bo_alloc(bufmgr, "mmap bo", 4096, 4096); assert(bos[i]); drm_intel_bo_map(bos[i], 1); ptr = bos[i]->virtual; assert(*ptr = 'c'); drm_intel_bo_unmap(bos[i]); } intel_batchbuffer_free(batch); drm_intel_bufmgr_destroy(bufmgr); close(fd); return 0; } intel-gpu-tools-1.3/tests/gem_linear_blits.c0000664000175100017510000001433111772702746016170 00000000000000/* * Copyright © 2009 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Eric Anholt * */ /** @file gem_linear_blits.c * * This is a test of doing many blits, with a working set * larger than the aperture size. * * The goal is to simply ensure the basics work. */ #include #include #include #include #include #include #include #include #include #include "drm.h" #include "i915_drm.h" #include "drmtest.h" #include "intel_bufmgr.h" #include "intel_batchbuffer.h" #include "intel_gpu_tools.h" #define WIDTH 512 #define HEIGHT 512 static uint32_t linear[WIDTH*HEIGHT]; static void copy(int fd, uint32_t dst, uint32_t src) { uint32_t batch[10]; struct drm_i915_gem_relocation_entry reloc[2]; struct drm_i915_gem_exec_object2 obj[3]; struct drm_i915_gem_execbuffer2 exec; uint32_t handle; int ret; batch[0] = XY_SRC_COPY_BLT_CMD | XY_SRC_COPY_BLT_WRITE_ALPHA | XY_SRC_COPY_BLT_WRITE_RGB; batch[1] = (3 << 24) | /* 32 bits */ (0xcc << 16) | /* copy ROP */ WIDTH*4; batch[2] = 0; /* dst x1,y1 */ batch[3] = (HEIGHT << 16) | WIDTH; /* dst x2,y2 */ batch[4] = 0; /* dst reloc */ batch[5] = 0; /* src x1,y1 */ batch[6] = WIDTH*4; batch[7] = 0; /* src reloc */ batch[8] = MI_BATCH_BUFFER_END; batch[9] = MI_NOOP; handle = gem_create(fd, 4096); gem_write(fd, handle, 0, batch, sizeof(batch)); reloc[0].target_handle = dst; reloc[0].delta = 0; reloc[0].offset = 4 * sizeof(batch[0]); reloc[0].presumed_offset = 0; reloc[0].read_domains = I915_GEM_DOMAIN_RENDER;; reloc[0].write_domain = I915_GEM_DOMAIN_RENDER; reloc[1].target_handle = src; reloc[1].delta = 0; reloc[1].offset = 7 * sizeof(batch[0]); reloc[1].presumed_offset = 0; reloc[1].read_domains = I915_GEM_DOMAIN_RENDER;; reloc[1].write_domain = 0; obj[0].handle = dst; obj[0].relocation_count = 0; obj[0].relocs_ptr = 0; obj[0].alignment = 0; obj[0].offset = 0; obj[0].flags = 0; obj[0].rsvd1 = 0; obj[0].rsvd2 = 0; obj[1].handle = src; obj[1].relocation_count = 0; obj[1].relocs_ptr = 0; obj[1].alignment = 0; obj[1].offset = 0; obj[1].flags = 0; obj[1].rsvd1 = 0; obj[1].rsvd2 = 0; obj[2].handle = handle; obj[2].relocation_count = 2; obj[2].relocs_ptr = (uintptr_t)reloc; obj[2].alignment = 0; obj[2].offset = 0; obj[2].flags = 0; obj[2].rsvd1 = obj[2].rsvd2 = 0; exec.buffers_ptr = (uintptr_t)obj; exec.buffer_count = 3; exec.batch_start_offset = 0; exec.batch_len = sizeof(batch); exec.DR1 = exec.DR4 = 0; exec.num_cliprects = 0; exec.cliprects_ptr = 0; exec.flags = HAS_BLT_RING(intel_get_drm_devid(fd)) ? I915_EXEC_BLT : 0; i915_execbuffer2_set_context_id(exec, 0); exec.rsvd2 = 0; ret = drmIoctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, &exec); while (ret && errno == EBUSY) { drmCommandNone(fd, DRM_I915_GEM_THROTTLE); ret = drmIoctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, &exec); } assert(ret == 0); gem_close(fd, handle); } static uint32_t create_bo(int fd, uint32_t val) { uint32_t handle; int i; handle = gem_create(fd, sizeof(linear)); /* Fill the BO with dwords starting at val */ for (i = 0; i < WIDTH*HEIGHT; i++) linear[i] = val++; gem_write(fd, handle, 0, linear, sizeof(linear)); return handle; } static void check_bo(int fd, uint32_t handle, uint32_t val) { int i; gem_read(fd, handle, 0, linear, sizeof(linear)); for (i = 0; i < WIDTH*HEIGHT; i++) { if (linear[i] != val) { fprintf(stderr, "Expected 0x%08x, found 0x%08x " "at offset 0x%08x\n", val, linear[i], i * 4); abort(); } val++; } } int main(int argc, char **argv) { uint32_t *handle, *start_val; uint32_t start = 0; int i, fd, count; fd = drm_open_any(); count = 0; if (argc > 1) count = atoi(argv[1]); if (count == 0) count = 3 * gem_aperture_size(fd) / (1024*1024) / 2; if (count > intel_get_total_ram_mb() * 9 / 10) { count = intel_get_total_ram_mb() * 9 / 10; printf("not enough RAM to run test, reducing buffer count\n"); } printf("Using %d 1MiB buffers\n", count); handle = malloc(sizeof(uint32_t)*count*2); start_val = handle + count; for (i = 0; i < count; i++) { handle[i] = create_bo(fd, start); start_val[i] = start; start += 1024 * 1024 / 4; } printf("Verifying initialisation...\n"); for (i = 0; i < count; i++) check_bo(fd, handle[i], start_val[i]); printf("Cyclic blits, forward...\n"); for (i = 0; i < count * 4; i++) { int src = i % count; int dst = (i + 1) % count; copy(fd, handle[dst], handle[src]); start_val[dst] = start_val[src]; } for (i = 0; i < count; i++) check_bo(fd, handle[i], start_val[i]); printf("Cyclic blits, backward...\n"); for (i = 0; i < count * 4; i++) { int src = (i + 1) % count; int dst = i % count; copy(fd, handle[dst], handle[src]); start_val[dst] = start_val[src]; } for (i = 0; i < count; i++) check_bo(fd, handle[i], start_val[i]); printf("Random blits...\n"); for (i = 0; i < count * 4; i++) { int src = random() % count; int dst = random() % count; if (src == dst) continue; copy(fd, handle[dst], handle[src]); start_val[dst] = start_val[src]; } for (i = 0; i < count; i++) check_bo(fd, handle[i], start_val[i]); return 0; } intel-gpu-tools-1.3/tests/gen3_mixed_blits.c0000664000175100017510000003424711772702746016120 00000000000000/* * Copyright © 2011 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Chris Wilson * */ /** @file gen3_linear_render_blits.c * * This is a test of doing many blits, with a working set * larger than the aperture size. * * The goal is to simply ensure the basics work. */ #include #include #include #include #include #include #include #include #include #include #include #include "drm.h" #include "i915_drm.h" #include "drmtest.h" #include "intel_gpu_tools.h" #include "i915_reg.h" #include "i915_3d.h" #define WIDTH (512) #define HEIGHT (512) static inline uint32_t pack_float(float f) { union { uint32_t dw; float f; } u; u.f = f; return u.dw; } static uint32_t fill_reloc(struct drm_i915_gem_relocation_entry *reloc, uint32_t offset, uint32_t handle, uint32_t read_domain, uint32_t write_domain) { reloc->target_handle = handle; reloc->delta = 0; reloc->offset = offset * sizeof(uint32_t); reloc->presumed_offset = 0; reloc->read_domains = read_domain; reloc->write_domain = write_domain; return reloc->presumed_offset + reloc->delta; } static void render_copy(int fd, uint32_t dst, int dst_tiling, uint32_t src, int src_tiling, int use_fence) { uint32_t batch[1024], *b = batch; struct drm_i915_gem_relocation_entry reloc[2], *r = reloc; struct drm_i915_gem_exec_object2 obj[3]; struct drm_i915_gem_execbuffer2 exec; uint32_t handle; uint32_t tiling_bits; int ret; /* invariant state */ *b++ = (_3DSTATE_AA_CMD | AA_LINE_ECAAR_WIDTH_ENABLE | AA_LINE_ECAAR_WIDTH_1_0 | AA_LINE_REGION_WIDTH_ENABLE | AA_LINE_REGION_WIDTH_1_0); *b++ = (_3DSTATE_INDEPENDENT_ALPHA_BLEND_CMD | IAB_MODIFY_ENABLE | IAB_MODIFY_FUNC | (BLENDFUNC_ADD << IAB_FUNC_SHIFT) | IAB_MODIFY_SRC_FACTOR | (BLENDFACT_ONE << IAB_SRC_FACTOR_SHIFT) | IAB_MODIFY_DST_FACTOR | (BLENDFACT_ZERO << IAB_DST_FACTOR_SHIFT)); *b++ = (_3DSTATE_DFLT_DIFFUSE_CMD); *b++ = (0); *b++ = (_3DSTATE_DFLT_SPEC_CMD); *b++ = (0); *b++ = (_3DSTATE_DFLT_Z_CMD); *b++ = (0); *b++ = (_3DSTATE_COORD_SET_BINDINGS | CSB_TCB(0, 0) | CSB_TCB(1, 1) | CSB_TCB(2, 2) | CSB_TCB(3, 3) | CSB_TCB(4, 4) | CSB_TCB(5, 5) | CSB_TCB(6, 6) | CSB_TCB(7, 7)); *b++ = (_3DSTATE_RASTER_RULES_CMD | ENABLE_POINT_RASTER_RULE | OGL_POINT_RASTER_RULE | ENABLE_LINE_STRIP_PROVOKE_VRTX | ENABLE_TRI_FAN_PROVOKE_VRTX | LINE_STRIP_PROVOKE_VRTX(1) | TRI_FAN_PROVOKE_VRTX(2) | ENABLE_TEXKILL_3D_4D | TEXKILL_4D); *b++ = (_3DSTATE_MODES_4_CMD | ENABLE_LOGIC_OP_FUNC | LOGIC_OP_FUNC(LOGICOP_COPY) | ENABLE_STENCIL_WRITE_MASK | STENCIL_WRITE_MASK(0xff) | ENABLE_STENCIL_TEST_MASK | STENCIL_TEST_MASK(0xff)); *b++ = (_3DSTATE_LOAD_STATE_IMMEDIATE_1 | I1_LOAD_S(3) | I1_LOAD_S(4) | I1_LOAD_S(5) | 2); *b++ = (0x00000000); /* Disable texture coordinate wrap-shortest */ *b++ = ((1 << S4_POINT_WIDTH_SHIFT) | S4_LINE_WIDTH_ONE | S4_CULLMODE_NONE | S4_VFMT_XY); *b++ = (0x00000000); /* Stencil. */ *b++ = (_3DSTATE_SCISSOR_ENABLE_CMD | DISABLE_SCISSOR_RECT); *b++ = (_3DSTATE_SCISSOR_RECT_0_CMD); *b++ = (0); *b++ = (0); *b++ = (_3DSTATE_DEPTH_SUBRECT_DISABLE); *b++ = (_3DSTATE_LOAD_INDIRECT | 0); /* disable indirect state */ *b++ = (0); *b++ = (_3DSTATE_STIPPLE); *b++ = (0x00000000); *b++ = (_3DSTATE_BACKFACE_STENCIL_OPS | BFO_ENABLE_STENCIL_TWO_SIDE | 0); /* samler state */ if (use_fence) { tiling_bits = MS3_USE_FENCE_REGS; } else { tiling_bits = 0; if (src_tiling != I915_TILING_NONE) tiling_bits = MS3_TILED_SURFACE; if (src_tiling == I915_TILING_Y) tiling_bits |= MS3_TILE_WALK; } #define TEX_COUNT 1 *b++ = (_3DSTATE_MAP_STATE | (3 * TEX_COUNT)); *b++ = ((1 << TEX_COUNT) - 1); *b = fill_reloc(r++, b-batch, src, I915_GEM_DOMAIN_SAMPLER, 0); b++; *b++ = (MAPSURF_32BIT | MT_32BIT_ARGB8888 | tiling_bits | (HEIGHT - 1) << MS3_HEIGHT_SHIFT | (WIDTH - 1) << MS3_WIDTH_SHIFT); *b++ = ((WIDTH-1) << MS4_PITCH_SHIFT); *b++ = (_3DSTATE_SAMPLER_STATE | (3 * TEX_COUNT)); *b++ = ((1 << TEX_COUNT) - 1); *b++ = (MIPFILTER_NONE << SS2_MIP_FILTER_SHIFT | FILTER_NEAREST << SS2_MAG_FILTER_SHIFT | FILTER_NEAREST << SS2_MIN_FILTER_SHIFT); *b++ = (TEXCOORDMODE_WRAP << SS3_TCX_ADDR_MODE_SHIFT | TEXCOORDMODE_WRAP << SS3_TCY_ADDR_MODE_SHIFT | 0 << SS3_TEXTUREMAP_INDEX_SHIFT); *b++ = (0x00000000); /* render target state */ if (use_fence) { tiling_bits = BUF_3D_USE_FENCE; } else { tiling_bits = 0; if (dst_tiling != I915_TILING_NONE) tiling_bits = BUF_3D_TILED_SURFACE; if (dst_tiling == I915_TILING_Y) tiling_bits |= BUF_3D_TILE_WALK_Y; } *b++ = (_3DSTATE_BUF_INFO_CMD); *b++ = (BUF_3D_ID_COLOR_BACK | tiling_bits | WIDTH*4); *b = fill_reloc(r++, b-batch, dst, I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER); b++; *b++ = (_3DSTATE_DST_BUF_VARS_CMD); *b++ = (COLR_BUF_ARGB8888 | DSTORG_HORT_BIAS(0x8) | DSTORG_VERT_BIAS(0x8)); /* draw rect is unconditional */ *b++ = (_3DSTATE_DRAW_RECT_CMD); *b++ = (0x00000000); *b++ = (0x00000000); /* ymin, xmin */ *b++ = (DRAW_YMAX(HEIGHT - 1) | DRAW_XMAX(WIDTH - 1)); /* yorig, xorig (relate to color buffer?) */ *b++ = (0x00000000); /* texfmt */ *b++ = (_3DSTATE_LOAD_STATE_IMMEDIATE_1 | I1_LOAD_S(1) | I1_LOAD_S(2) | I1_LOAD_S(6) | 2); *b++ = ((4 << S1_VERTEX_WIDTH_SHIFT) | (4 << S1_VERTEX_PITCH_SHIFT)); *b++ = (~S2_TEXCOORD_FMT(0, TEXCOORDFMT_NOT_PRESENT) | S2_TEXCOORD_FMT(0, TEXCOORDFMT_2D)); *b++ = (S6_CBUF_BLEND_ENABLE | S6_COLOR_WRITE_ENABLE | BLENDFUNC_ADD << S6_CBUF_BLEND_FUNC_SHIFT | BLENDFACT_ONE << S6_CBUF_SRC_BLEND_FACT_SHIFT | BLENDFACT_ZERO << S6_CBUF_DST_BLEND_FACT_SHIFT); /* pixel shader */ *b++ = (_3DSTATE_PIXEL_SHADER_PROGRAM | (1 + 3*3 - 2)); /* decl FS_T0 */ *b++ = (D0_DCL | REG_TYPE(FS_T0) << D0_TYPE_SHIFT | REG_NR(FS_T0) << D0_NR_SHIFT | ((REG_TYPE(FS_T0) != REG_TYPE_S) ? D0_CHANNEL_ALL : 0)); *b++ = (0); *b++ = (0); /* decl FS_S0 */ *b++ = (D0_DCL | (REG_TYPE(FS_S0) << D0_TYPE_SHIFT) | (REG_NR(FS_S0) << D0_NR_SHIFT) | ((REG_TYPE(FS_S0) != REG_TYPE_S) ? D0_CHANNEL_ALL : 0)); *b++ = (0); *b++ = (0); /* texld(FS_OC, FS_S0, FS_T0 */ *b++ = (T0_TEXLD | (REG_TYPE(FS_OC) << T0_DEST_TYPE_SHIFT) | (REG_NR(FS_OC) << T0_DEST_NR_SHIFT) | (REG_NR(FS_S0) << T0_SAMPLER_NR_SHIFT)); *b++ = ((REG_TYPE(FS_T0) << T1_ADDRESS_REG_TYPE_SHIFT) | (REG_NR(FS_T0) << T1_ADDRESS_REG_NR_SHIFT)); *b++ = (0); *b++ = (PRIM3D_RECTLIST | (3*4 - 1)); *b++ = pack_float(WIDTH); *b++ = pack_float(HEIGHT); *b++ = pack_float(WIDTH); *b++ = pack_float(HEIGHT); *b++ = pack_float(0); *b++ = pack_float(HEIGHT); *b++ = pack_float(0); *b++ = pack_float(HEIGHT); *b++ = pack_float(0); *b++ = pack_float(0); *b++ = pack_float(0); *b++ = pack_float(0); *b++ = MI_BATCH_BUFFER_END; if ((b - batch) & 1) *b++ = 0; assert(b - batch <= 1024); handle = gem_create(fd, 4096); gem_write(fd, handle, 0, batch, (b-batch)*sizeof(batch[0])); assert(r-reloc == 2); tiling_bits = 0; if (use_fence) tiling_bits = EXEC_OBJECT_NEEDS_FENCE; obj[0].handle = dst; obj[0].relocation_count = 0; obj[0].relocs_ptr = 0; obj[0].alignment = 0; obj[0].offset = 0; obj[0].flags = tiling_bits; obj[0].rsvd1 = 0; obj[0].rsvd2 = 0; obj[1].handle = src; obj[1].relocation_count = 0; obj[1].relocs_ptr = 0; obj[1].alignment = 0; obj[1].offset = 0; obj[1].flags = tiling_bits; obj[1].rsvd1 = 0; obj[1].rsvd2 = 0; obj[2].handle = handle; obj[2].relocation_count = 2; obj[2].relocs_ptr = (uintptr_t)reloc; obj[2].alignment = 0; obj[2].offset = 0; obj[2].flags = 0; obj[2].rsvd1 = obj[2].rsvd2 = 0; exec.buffers_ptr = (uintptr_t)obj; exec.buffer_count = 3; exec.batch_start_offset = 0; exec.batch_len = (b-batch)*sizeof(batch[0]); exec.DR1 = exec.DR4 = 0; exec.num_cliprects = 0; exec.cliprects_ptr = 0; exec.flags = 0; i915_execbuffer2_set_context_id(exec, 0); exec.rsvd2 = 0; ret = drmIoctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, &exec); while (ret && errno == EBUSY) { drmCommandNone(fd, DRM_I915_GEM_THROTTLE); ret = drmIoctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, &exec); } assert(ret == 0); gem_close(fd, handle); } static void blt_copy(int fd, uint32_t dst, uint32_t src) { uint32_t batch[1024], *b = batch; struct drm_i915_gem_relocation_entry reloc[2], *r = reloc; struct drm_i915_gem_exec_object2 obj[3]; struct drm_i915_gem_execbuffer2 exec; uint32_t handle; int ret; *b++ = (XY_SRC_COPY_BLT_CMD | XY_SRC_COPY_BLT_WRITE_ALPHA | XY_SRC_COPY_BLT_WRITE_RGB); *b++ = 3 << 24 | 0xcc << 16 | WIDTH * 4; *b++ = 0; *b++ = HEIGHT << 16 | WIDTH; *b = fill_reloc(r++, b-batch, dst, I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER); b++; *b++ = 0; *b++ = WIDTH*4; *b = fill_reloc(r++, b-batch, src, I915_GEM_DOMAIN_RENDER, 0); b++; *b++ = MI_BATCH_BUFFER_END; if ((b - batch) & 1) *b++ = 0; assert(b - batch <= 1024); handle = gem_create(fd, 4096); gem_write(fd, handle, 0, batch, (b-batch)*sizeof(batch[0])); assert(r-reloc == 2); obj[0].handle = dst; obj[0].relocation_count = 0; obj[0].relocs_ptr = 0; obj[0].alignment = 0; obj[0].offset = 0; obj[0].flags = EXEC_OBJECT_NEEDS_FENCE; obj[0].rsvd1 = 0; obj[0].rsvd2 = 0; obj[1].handle = src; obj[1].relocation_count = 0; obj[1].relocs_ptr = 0; obj[1].alignment = 0; obj[1].offset = 0; obj[1].flags = EXEC_OBJECT_NEEDS_FENCE; obj[1].rsvd1 = 0; obj[1].rsvd2 = 0; obj[2].handle = handle; obj[2].relocation_count = 2; obj[2].relocs_ptr = (uintptr_t)reloc; obj[2].alignment = 0; obj[2].offset = 0; obj[2].flags = 0; obj[2].rsvd1 = obj[2].rsvd2 = 0; exec.buffers_ptr = (uintptr_t)obj; exec.buffer_count = 3; exec.batch_start_offset = 0; exec.batch_len = (b-batch)*sizeof(batch[0]); exec.DR1 = exec.DR4 = 0; exec.num_cliprects = 0; exec.cliprects_ptr = 0; exec.flags = 0; i915_execbuffer2_set_context_id(exec, 0); exec.rsvd2 = 0; ret = drmIoctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, &exec); while (ret && errno == EBUSY) { drmCommandNone(fd, DRM_I915_GEM_THROTTLE); ret = drmIoctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, &exec); } assert(ret == 0); gem_close(fd, handle); } static void copy(int fd, uint32_t dst, int dst_tiling, uint32_t src, int src_tiling) { retry: switch (random() % 3) { case 0: render_copy(fd, dst, dst_tiling, src, src_tiling, 0); break; case 1: render_copy(fd, dst, dst_tiling, src, src_tiling, 1); break; case 2: if (dst_tiling == I915_TILING_Y || src_tiling == I915_TILING_Y) goto retry; blt_copy(fd, dst, src); break; } } static uint32_t create_bo(int fd, uint32_t val, int tiling) { uint32_t handle; uint32_t *v; int i; handle = gem_create(fd, WIDTH*HEIGHT*4); gem_set_tiling(fd, handle, tiling, WIDTH*4); /* Fill the BO with dwords starting at val */ v = gem_mmap(fd, handle, WIDTH*HEIGHT*4, PROT_READ | PROT_WRITE); assert(v); for (i = 0; i < WIDTH*HEIGHT; i++) v[i] = val++; munmap(v, WIDTH*HEIGHT*4); return handle; } static void check_bo(int fd, uint32_t handle, uint32_t val) { uint32_t *v; int i; v = gem_mmap(fd, handle, WIDTH*HEIGHT*4, PROT_READ); assert(v); for (i = 0; i < WIDTH*HEIGHT; i++) { if (v[i] != val) { fprintf(stderr, "Expected 0x%08x, found 0x%08x " "at offset 0x%08x\n", val, v[i], i * 4); abort(); } val++; } munmap(v, WIDTH*HEIGHT*4); } int main(int argc, char **argv) { uint32_t *handle, *tiling, *start_val; uint32_t start = 0; int i, fd, count; fd = drm_open_any(); if (!IS_GEN3(intel_get_drm_devid(fd))) { printf("gen3-only test, doing nothing\n"); return 77; } count = 0; if (argc > 1) count = atoi(argv[1]); if (count == 0) count = 3 * gem_aperture_size(fd) / (1024*1024) / 2; printf("Using %d 1MiB buffers\n", count); handle = malloc(sizeof(uint32_t)*count*3); tiling = handle + count; start_val = tiling + count; for (i = 0; i < count; i++) { handle[i] = create_bo(fd, start, tiling[i] = i % 3); start_val[i] = start; start += 1024 * 1024 / 4; } printf("Verifying initialisation..."); fflush(stdout); for (i = 0; i < count; i++) check_bo(fd, handle[i], start_val[i]); printf("done\n"); printf("Cyclic blits, forward..."); fflush(stdout); for (i = 0; i < count * 32; i++) { int src = i % count; int dst = (i + 1) % count; copy(fd, handle[dst], tiling[dst], handle[src], tiling[src]); start_val[dst] = start_val[src]; } printf("verifying..."); fflush(stdout); for (i = 0; i < count; i++) check_bo(fd, handle[i], start_val[i]); printf("done\n"); printf("Cyclic blits, backward..."); fflush(stdout); for (i = 0; i < count * 32; i++) { int src = (i + 1) % count; int dst = i % count; copy(fd, handle[dst], tiling[dst], handle[src], tiling[src]); start_val[dst] = start_val[src]; } printf("verifying..."); fflush(stdout); for (i = 0; i < count; i++) check_bo(fd, handle[i], start_val[i]); printf("done\n"); printf("Random blits..."); fflush(stdout); for (i = 0; i < count * 32; i++) { int src = random() % count; int dst = random() % count; while (src == dst) dst = random() % count; copy(fd, handle[dst], tiling[dst], handle[src], tiling[src]); start_val[dst] = start_val[src]; } printf("verifying..."); fflush(stdout); for (i = 0; i < count; i++) check_bo(fd, handle[i], start_val[i]); printf("done\n"); return 0; } intel-gpu-tools-1.3/tests/gem_ringfill.c0000664000175100017510000001373411746063357015334 00000000000000/* * Copyright © 2009 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Eric Anholt * */ /** @file gem_ringfill.c * * This is a test of doing many tiny batchbuffer operations, in the hope of * catching failure to manage the ring properly near full. */ #include #include #include #include #include #include #include #include #include #include #include "drm.h" #include "i915_drm.h" #include "intel_bufmgr.h" #include "intel_batchbuffer.h" #include "intel_gpu_tools.h" #include "rendercopy.h" struct bo { const char *ring; drm_intel_bo *src, *dst, *tmp; }; static const int width = 512, height = 512; static void create_bo(drm_intel_bufmgr *bufmgr, struct bo *b, const char *ring) { int size = 4 * width * height, i; uint32_t *map; b->ring = ring; b->src = drm_intel_bo_alloc(bufmgr, "src", size, 4096); b->dst = drm_intel_bo_alloc(bufmgr, "dst", size, 4096); b->tmp = drm_intel_bo_alloc(bufmgr, "tmp", size, 4096); /* Fill the src with indexes of the pixels */ drm_intel_bo_map(b->src, true); map = b->src->virtual; for (i = 0; i < width * height; i++) map[i] = i; drm_intel_bo_unmap(b->src); /* Fill the dst with garbage. */ drm_intel_bo_map(b->dst, true); map = b->dst->virtual; for (i = 0; i < width * height; i++) map[i] = 0xd0d0d0d0; drm_intel_bo_unmap(b->dst); } static int check_bo(struct bo *b) { const uint32_t *map; int i, fails = 0; drm_intel_bo_map(b->dst, false); map = b->dst->virtual; for (i = 0; i < width*height; i++) { if (map[i] != i && ++fails <= 9) { int x = i % width; int y = i / width; printf("%s: copy #%d at %d,%d failed: read 0x%08x\n", b->ring, i, x, y, map[i]); } } drm_intel_bo_unmap(b->dst); return fails; } static void destroy_bo(struct bo *b) { drm_intel_bo_unreference(b->src); drm_intel_bo_unreference(b->tmp); drm_intel_bo_unreference(b->dst); } static int check_ring(drm_intel_bufmgr *bufmgr, struct intel_batchbuffer *batch, const char *ring, render_copyfunc_t copy) { struct scratch_buf src, tmp, dst; struct bo bo; char output[100]; int i; snprintf(output, 100, "filling %s ring: ", ring); create_bo(bufmgr, &bo, ring); src.stride = 4 * width; src.tiling = 0; src.data = src.cpu_mapping = NULL; src.size = 4 * width * height; src.num_tiles = 4 * width * height; dst = tmp = src; src.bo = bo.src; tmp.bo = bo.tmp; dst.bo = bo.dst; /* The ring we've been using is 128k, and each rendering op * will use at least 8 dwords: * * BATCH_START * BATCH_START offset * MI_FLUSH * STORE_DATA_INDEX * STORE_DATA_INDEX offset * STORE_DATA_INDEX value * MI_USER_INTERRUPT * (padding) * * So iterate just a little more than that -- if we don't fill the ring * doing this, we aren't likely to with this test. */ for (i = 0; i < width * height; i++) { int x = i % width; int y = i / width; drmtest_progress(output, i, width*height); assert(y < height); /* Dummy load to fill the ring */ copy(batch, &src, 0, 0, width, height, &tmp, 0, 0); /* And copy the src into dst, pixel by pixel */ copy(batch, &src, x, y, 1, 1, &dst, x, y); } /* verify */ printf("verifying\n"); i = check_bo(&bo); destroy_bo(&bo); return i; } static void blt_copy(struct intel_batchbuffer *batch, struct scratch_buf *src, unsigned src_x, unsigned src_y, unsigned w, unsigned h, struct scratch_buf *dst, unsigned dst_x, unsigned dst_y) { BEGIN_BATCH(8); OUT_BATCH(XY_SRC_COPY_BLT_CMD | XY_SRC_COPY_BLT_WRITE_ALPHA | XY_SRC_COPY_BLT_WRITE_RGB); OUT_BATCH((3 << 24) | /* 32 bits */ (0xcc << 16) | /* copy ROP */ dst->stride); OUT_BATCH((dst_y << 16) | dst_x); /* dst x1,y1 */ OUT_BATCH(((dst_y + h) << 16) | (dst_x + w)); /* dst x2,y2 */ OUT_RELOC(dst->bo, I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER, 0); OUT_BATCH((src_y << 16) | src_x); /* src x1,y1 */ OUT_BATCH(src->stride); OUT_RELOC(src->bo, I915_GEM_DOMAIN_RENDER, 0, 0); ADVANCE_BATCH(); intel_batchbuffer_flush(batch); } int main(int argc, char **argv) { drm_intel_bufmgr *bufmgr; struct intel_batchbuffer *batch; render_copyfunc_t copy; int fd, fails = 0; fd = drm_open_any(); bufmgr = drm_intel_bufmgr_gem_init(fd, 4096); drm_intel_bufmgr_gem_enable_reuse(bufmgr); batch = intel_batchbuffer_alloc(bufmgr, intel_get_drm_devid(fd)); fails += check_ring(bufmgr, batch, "blt", blt_copy); /* Strictly only required on architectures with a separate BLT ring, * but lets stress everybody. */ copy = NULL; if (IS_GEN2(batch->devid)) copy = gen2_render_copyfunc; else if (IS_GEN3(batch->devid)) copy = gen3_render_copyfunc; else if (IS_GEN6(batch->devid)) copy = gen6_render_copyfunc; if (copy) fails += check_ring(bufmgr, batch, "render", copy); intel_batchbuffer_free(batch); drm_intel_bufmgr_destroy(bufmgr); close(fd); return fails != 0; } intel-gpu-tools-1.3/tests/testdisplay.h0000664000175100017510000000257211707505022015231 00000000000000/* * Copyright 2010 Intel Corporation * Jesse Barnes * * 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 OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. */ #include #include #include #include extern int drm_fd; gboolean testdisplay_setup_hotplug(void); void testdisplay_cleanup_hotplug(void); /* called by the hotplug code */ int update_display(void); intel-gpu-tools-1.3/tests/gem_gtt_cpu_tlb.c0000664000175100017510000000520312013127414016003 00000000000000/* * Copyright © 2009 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Daniel Vetter * */ /** @file gem_gtt_cpu_tlb.c * * This test checks whether gtt tlbs for cpu access are correctly invalidated. */ #include #include #include #include #include #include #include #include #include #include #include #include "drm.h" #include "i915_drm.h" #include "drmtest.h" #include "intel_gpu_tools.h" #define OBJ_SIZE (1024*1024) #define PAGE_SIZE 4096 static uint32_t create_bo(int fd) { uint32_t handle; uint32_t *data; int i; handle = gem_create(fd, OBJ_SIZE); /* Fill the BO with dwords starting at start_val */ data = gem_mmap(fd, handle, OBJ_SIZE, PROT_READ | PROT_WRITE); for (i = 0; i < OBJ_SIZE/4; i++) data[i] = i; munmap(data, OBJ_SIZE); return handle; } int main(int argc, char **argv) { int fd; int i; uint32_t handle; uint32_t *ptr; fd = drm_open_any(); handle = gem_create(fd, OBJ_SIZE); /* touch one page */ ptr = gem_mmap(fd, handle, OBJ_SIZE, PROT_READ | PROT_WRITE); *ptr = 0xdeadbeef; munmap(ptr, OBJ_SIZE); gem_close(fd, handle); /* stirr up the page allocator a bit. */ ptr = malloc(OBJ_SIZE); assert(ptr); memset(ptr, 0x1, OBJ_SIZE); handle = create_bo(fd); /* Read a bunch of random subsets of the data and check that they come * out right. */ gem_read(fd, handle, 0, ptr, OBJ_SIZE); for (i = 0; i < OBJ_SIZE/4; i++) assert(ptr[i] == i); close(fd); return 0; } intel-gpu-tools-1.3/tests/sysfs_l3_parity0000775000175100017510000000120711763072372015601 00000000000000#!/bin/bash if ! find /sys/class/drm/card*/ | grep l3_parity > /dev/null ; then echo "no l3_parity interface, skipping test" exit 77 fi SOURCE_DIR="$( dirname "${BASH_SOURCE[0]}" )" . $SOURCE_DIR/drm_lib.sh $SOURCE_DIR/../tools/intel_l3_parity -c #Check that we can remap a row $SOURCE_DIR/../tools/intel_l3_parity 0,0,0 disabled=`$SOURCE_DIR/../tools/intel_l3_parity | grep -c 'Row 0, Bank 0, Subbank 0 is disabled'` if [ "$disabled" != "1" ] ; then echo "Fail" exit 1 fi $SOURCE_DIR/../tools/intel_l3_parity -c #Check that we can clear remaps if [ `$SOURCE_DIR/../tools/intel_l3_parity | wc -c` != "0" ] ; then echo "Fail" exit 1 fi intel-gpu-tools-1.3/tests/prime_self_import.c0000664000175100017510000000705212004013767016375 00000000000000/* * Copyright © 2012 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Daniel Vetter * */ /* * Testcase: Check whether prime import/export works on the same device * * ... but with different fds, i.e. the wayland usecase. */ #include #include #include #include #include #include #include #include #include #include #include #include "drm.h" #include "i915_drm.h" #include "drmtest.h" #define BO_SIZE (16*1024) static void check_bo(int fd1, uint32_t handle1, int fd2, uint32_t handle2) { char *ptr1, *ptr2; static char counter = 0; int i; ptr1 = gem_mmap(fd1, handle1, BO_SIZE, PROT_READ | PROT_WRITE); ptr2 = gem_mmap(fd2, handle2, BO_SIZE, PROT_READ | PROT_WRITE); assert(ptr1); /* check whether it's still our old object first. */ for (i = 0; i < BO_SIZE; i++) { assert(ptr1[i] == counter); assert(ptr2[i] == counter); } counter++; memset(ptr1, counter, BO_SIZE); assert(memcmp(ptr1, ptr2, BO_SIZE) == 0); munmap(ptr1, BO_SIZE); munmap(ptr2, BO_SIZE); } int main(int argc, char **argv) { int fd1, fd2; uint32_t handle, handle_import1, handle_import2, handle_selfimport; int dma_buf_fd; fd1 = drm_open_any(); fd2 = drm_open_any(); handle = gem_create(fd1, BO_SIZE); dma_buf_fd = prime_handle_to_fd(fd1, handle); handle_import1 = prime_fd_to_handle(fd2, dma_buf_fd); check_bo(fd1, handle, fd2, handle_import1); /* reimport should give us the same handle so that userspace can check * whether it has that bo already somewhere. */ handle_import2 = prime_fd_to_handle(fd2, dma_buf_fd); assert(handle_import1 == handle_import2); /* Same for re-importing on the exporting fd. */ handle_selfimport = prime_fd_to_handle(fd1, dma_buf_fd); assert(handle == handle_selfimport); /* close dma_buf, check whether nothing disappears. */ close(dma_buf_fd); check_bo(fd1, handle, fd2, handle_import1); gem_close(fd1, handle); check_bo(fd2, handle_import1, fd2, handle_import1); /* re-import into old exporter */ dma_buf_fd = prime_handle_to_fd(fd2, handle_import1); /* but drop all references to the obj in between */ gem_close(fd2, handle_import1); handle = prime_fd_to_handle(fd1, dma_buf_fd); handle_import1 = prime_fd_to_handle(fd2, dma_buf_fd); check_bo(fd1, handle, fd2, handle_import1); /* Completely rip out exporting fd. */ close(fd1); check_bo(fd2, handle_import1, fd2, handle_import1); return 0; } intel-gpu-tools-1.3/tests/prime_nv_test.c0000664000175100017510000003120412015765010015525 00000000000000/* basic set of prime tests between intel and nouveau */ /* test list - 1. share buffer from intel -> nouveau. 2. share buffer from nouveau -> intel 3. share intel->nouveau, map on both, write intel, read nouveau 4. share intel->nouveau, blit intel fill, readback on nouveau test 1 + map buffer, read/write, map other size. do some hw actions on the buffer some illegal operations - close prime fd try and map TODO add some nouveau rendering tests */ #include #include #include #include #include #include #include #include "i915_drm.h" #include "intel_bufmgr.h" #include "nouveau.h" #include "intel_gpu_tools.h" #include "intel_batchbuffer.h" int intel_fd = -1, nouveau_fd = -1; drm_intel_bufmgr *bufmgr; struct nouveau_device *ndev; struct nouveau_client *nclient; uint32_t devid; struct intel_batchbuffer *intel_batch; #define BO_SIZE (256*1024) static int find_and_open_devices(void) { int i; char path[80]; struct stat buf; FILE *fl; char vendor_id[8]; int venid; for (i = 0; i < 9; i++) { sprintf(path, "/sys/class/drm/card%d/device/vendor", i); if (stat(path, &buf)) break; fl = fopen(path, "r"); if (!fl) break; fgets(vendor_id, 8, fl); fclose(fl); venid = strtoul(vendor_id, NULL, 16); sprintf(path, "/dev/dri/card%d", i); if (venid == 0x8086) { intel_fd = open(path, O_RDWR); if (!intel_fd) return -1; } else if (venid == 0x10de) { nouveau_fd = open(path, O_RDWR); if (!nouveau_fd) return -1; } } return 0; } /* * prime test 1 - * allocate buffer on intel, * set prime on buffer, * retrive buffer from nouveau, * close prime_fd, * unref buffers */ static int test1(void) { int ret; drm_intel_bo *test_intel_bo; int prime_fd; struct nouveau_bo *nvbo; test_intel_bo = drm_intel_bo_alloc(bufmgr, "test bo", BO_SIZE, 4096); drm_intel_bo_gem_export_to_prime(test_intel_bo, &prime_fd); ret = nouveau_bo_prime_handle_ref(ndev, prime_fd, &nvbo); close(prime_fd); if (ret < 0) return ret; nouveau_bo_ref(NULL, &nvbo); drm_intel_bo_unreference(test_intel_bo); return 0; } /* * prime test 2 - * allocate buffer on nouveau * set prime on buffer, * retrive buffer from intel * close prime_fd, * unref buffers */ static int test2(void) { int ret; drm_intel_bo *test_intel_bo; int prime_fd; struct nouveau_bo *nvbo; ret = nouveau_bo_new(ndev, NOUVEAU_BO_GART | NOUVEAU_BO_MAP, 0, BO_SIZE, NULL, &nvbo); if (ret < 0) return ret; ret = nouveau_bo_set_prime(nvbo, &prime_fd); if (ret < 0) return ret; test_intel_bo = drm_intel_bo_gem_create_from_prime(bufmgr, prime_fd, BO_SIZE); close(prime_fd); if (!test_intel_bo) return -1; nouveau_bo_ref(NULL, &nvbo); drm_intel_bo_unreference(test_intel_bo); return 0; } /* * allocate intel, give to nouveau, map on nouveau * write 0xdeadbeef, non-gtt map on intel, read */ static int test3(void) { int ret; drm_intel_bo *test_intel_bo; int prime_fd; struct nouveau_bo *nvbo = NULL; uint32_t *ptr; test_intel_bo = drm_intel_bo_alloc(bufmgr, "test bo", BO_SIZE, 4096); drm_intel_bo_gem_export_to_prime(test_intel_bo, &prime_fd); ret = nouveau_bo_prime_handle_ref(ndev, prime_fd, &nvbo); if (ret < 0) { fprintf(stderr,"failed to ref prime buffer %d\n", ret); close(prime_fd); goto free_intel; } close(prime_fd); goto free_intel; ret = nouveau_bo_map(nvbo, NOUVEAU_BO_RDWR, nclient); if (ret < 0) { fprintf(stderr,"failed to map nouveau bo\n"); goto out; } ptr = nvbo->map; *ptr = 0xdeadbeef; drm_intel_bo_map(test_intel_bo, 1); ptr = test_intel_bo->virtual; if (*ptr != 0xdeadbeef) { fprintf(stderr,"mapped value doesn't match\n"); ret = -1; } out: nouveau_bo_ref(NULL, &nvbo); free_intel: drm_intel_bo_unreference(test_intel_bo); return ret; } /* * allocate intel, give to nouveau, map on nouveau * write 0xdeadbeef, gtt map on intel, read */ static int test4(void) { int ret; drm_intel_bo *test_intel_bo; int prime_fd; struct nouveau_bo *nvbo = NULL; uint32_t *ptr; test_intel_bo = drm_intel_bo_alloc(bufmgr, "test bo", BO_SIZE, 4096); drm_intel_bo_gem_export_to_prime(test_intel_bo, &prime_fd); ret = nouveau_bo_prime_handle_ref(ndev, prime_fd, &nvbo); close(prime_fd); if (ret < 0) { fprintf(stderr,"failed to ref prime buffer\n"); return ret; } ret = nouveau_bo_map(nvbo, NOUVEAU_BO_RDWR, nclient); if (ret < 0) { fprintf(stderr,"failed to map nouveau bo\n"); goto out; } ptr = nvbo->map; *ptr = 0xdeadbeef; drm_intel_gem_bo_map_gtt(test_intel_bo); ptr = test_intel_bo->virtual; if (*ptr != 0xdeadbeef) { fprintf(stderr,"mapped value doesn't match\n"); ret = -1; } out: nouveau_bo_ref(NULL, &nvbo); drm_intel_bo_unreference(test_intel_bo); return ret; } /* test drm_intel_bo_map doesn't work properly, this tries to map the backing shmem fd, which doesn't exist for these objects */ static int test5(void) { int ret; drm_intel_bo *test_intel_bo; int prime_fd; struct nouveau_bo *nvbo; uint32_t *ptr; ret = nouveau_bo_new(ndev, NOUVEAU_BO_GART | NOUVEAU_BO_MAP, 0, BO_SIZE, NULL, &nvbo); if (ret < 0) return ret; ret = nouveau_bo_set_prime(nvbo, &prime_fd); if (ret < 0) return ret; test_intel_bo = drm_intel_bo_gem_create_from_prime(bufmgr, prime_fd, BO_SIZE); close(prime_fd); if (!test_intel_bo) return -1; ret = nouveau_bo_map(nvbo, NOUVEAU_BO_RDWR, nclient); if (ret < 0) { fprintf(stderr,"failed to map nouveau bo\n"); goto out; } ptr = nvbo->map; *ptr = 0xdeadbeef; ret = drm_intel_bo_map(test_intel_bo, 0); if (ret != 0) { /* failed to map the bo is expected */ ret = 0; goto out; } if (!test_intel_bo->virtual) { ret = 0; goto out; } ptr = test_intel_bo->virtual; if (*ptr != 0xdeadbeef) { fprintf(stderr,"mapped value doesn't match %08x\n", *ptr); ret = -1; } out: nouveau_bo_ref(NULL, &nvbo); drm_intel_bo_unreference(test_intel_bo); return ret; } /* test drm_intel_bo_map_gtt works properly, this tries to map the backing shmem fd, which doesn't exist for these objects */ static int test6(void) { int ret; drm_intel_bo *test_intel_bo; int prime_fd; struct nouveau_bo *nvbo; uint32_t *ptr; ret = nouveau_bo_new(ndev, NOUVEAU_BO_GART | NOUVEAU_BO_MAP, 0, BO_SIZE, NULL, &nvbo); if (ret < 0) return ret; ret = nouveau_bo_set_prime(nvbo, &prime_fd); if (ret < 0) return ret; test_intel_bo = drm_intel_bo_gem_create_from_prime(bufmgr, prime_fd, BO_SIZE); close(prime_fd); if (!test_intel_bo) return -1; ret = nouveau_bo_map(nvbo, NOUVEAU_BO_RDWR, nclient); if (ret < 0) { fprintf(stderr,"failed to map nouveau bo\n"); goto out; } ptr = nvbo->map; *ptr = 0xdeadbeef; *(ptr + 1) = 0xa55a55; ret = drm_intel_gem_bo_map_gtt(test_intel_bo); if (ret != 0) { fprintf(stderr,"failed to map bo\n"); goto out; } if (!test_intel_bo->virtual) { ret = -1; fprintf(stderr,"failed to map bo\n"); goto out; } ptr = test_intel_bo->virtual; if (*ptr != 0xdeadbeef) { fprintf(stderr,"mapped value doesn't match %08x %08x\n", *ptr, *(ptr + 1)); ret = -1; } out: nouveau_bo_ref(NULL, &nvbo); drm_intel_bo_unreference(test_intel_bo); return ret; } static int do_read(int fd, int handle, void *buf, int offset, int size) { struct drm_i915_gem_pread intel_pread; /* Ensure that we don't have any convenient data in buf in case * we fail. */ memset(buf, 0xd0, size); memset(&intel_pread, 0, sizeof(intel_pread)); intel_pread.handle = handle; intel_pread.data_ptr = (uintptr_t)buf; intel_pread.size = size; intel_pread.offset = offset; return ioctl(fd, DRM_IOCTL_I915_GEM_PREAD, &intel_pread); } static int do_write(int fd, int handle, void *buf, int offset, int size) { struct drm_i915_gem_pwrite intel_pwrite; memset(&intel_pwrite, 0, sizeof(intel_pwrite)); intel_pwrite.handle = handle; intel_pwrite.data_ptr = (uintptr_t)buf; intel_pwrite.size = size; intel_pwrite.offset = offset; return ioctl(fd, DRM_IOCTL_I915_GEM_PWRITE, &intel_pwrite); } /* test 7 - import from nouveau into intel, test pread/pwrite fail */ static int test7(void) { int ret; drm_intel_bo *test_intel_bo; int prime_fd; struct nouveau_bo *nvbo; uint32_t *ptr; uint32_t buf[64]; ret = nouveau_bo_new(ndev, NOUVEAU_BO_GART | NOUVEAU_BO_MAP, 0, BO_SIZE, NULL, &nvbo); if (ret < 0) return ret; ret = nouveau_bo_set_prime(nvbo, &prime_fd); if (ret < 0) return ret; test_intel_bo = drm_intel_bo_gem_create_from_prime(bufmgr, prime_fd, BO_SIZE); close(prime_fd); if (!test_intel_bo) return -1; ret = nouveau_bo_map(nvbo, NOUVEAU_BO_RDWR, nclient); if (ret < 0) { fprintf(stderr,"failed to map nouveau bo\n"); goto out; } ptr = nvbo->map; *ptr = 0xdeadbeef; ret = do_read(intel_fd, test_intel_bo->handle, buf, 0, 256); if (ret != -1) { fprintf(stderr,"pread succeedded %d\n", ret); goto out; } buf[0] = 0xabcdef55; ret = do_write(intel_fd, test_intel_bo->handle, buf, 0, 4); if (ret != -1) { fprintf(stderr,"pwrite succeedded\n"); goto out; } ret = 0; out: nouveau_bo_ref(NULL, &nvbo); drm_intel_bo_unreference(test_intel_bo); return ret; } static void set_bo(drm_intel_bo *bo, uint32_t val, int width, int height) { int size = width * height; uint32_t *vaddr; drm_intel_gem_bo_start_gtt_access(bo, true); vaddr = bo->virtual; while (size--) *vaddr++ = val; } static drm_intel_bo * create_bo(drm_intel_bufmgr *ibufmgr, uint32_t val, int width, int height) { drm_intel_bo *bo; bo = drm_intel_bo_alloc(ibufmgr, "bo", 4*width*height, 0); assert(bo); /* gtt map doesn't have a write parameter, so just keep the mapping * around (to avoid the set_domain with the gtt write domain set) and * manually tell the kernel when we start access the gtt. */ drm_intel_gem_bo_map_gtt(bo); set_bo(bo, val, width, height); return bo; } /* use intel hw to fill the BO with a blit from another BO, then readback from the nouveau bo, check value is correct */ static int test8(void) { int ret; drm_intel_bo *test_intel_bo, *src_bo; int prime_fd; struct nouveau_bo *nvbo = NULL; uint32_t *ptr; src_bo = create_bo(bufmgr, 0xaa55aa55, 256, 1); test_intel_bo = drm_intel_bo_alloc(bufmgr, "test bo", BO_SIZE, 4096); drm_intel_bo_gem_export_to_prime(test_intel_bo, &prime_fd); ret = nouveau_bo_prime_handle_ref(ndev, prime_fd, &nvbo); close(prime_fd); if (ret < 0) { fprintf(stderr,"failed to ref prime buffer\n"); return ret; } intel_copy_bo(intel_batch, test_intel_bo, src_bo, 256, 1); ret = nouveau_bo_map(nvbo, NOUVEAU_BO_RDWR, nclient); if (ret < 0) { fprintf(stderr,"failed to map nouveau bo\n"); goto out; } drm_intel_bo_map(test_intel_bo, 0); ptr = nvbo->map; if (*ptr != 0xaa55aa55) { fprintf(stderr,"mapped value doesn't match\n"); ret = -1; } out: nouveau_bo_ref(NULL, &nvbo); drm_intel_bo_unreference(test_intel_bo); return ret; } /* test 8 use nouveau to do blit */ /* test 9 nouveau copy engine?? */ int main(int argc, char **argv) { int ret; ret = find_and_open_devices(); if (ret < 0) return ret; if (nouveau_fd == -1 || intel_fd == -1) { fprintf(stderr,"failed to find intel and nouveau GPU\n"); return 77; } /* set up intel bufmgr */ bufmgr = drm_intel_bufmgr_gem_init(intel_fd, 4096); if (!bufmgr) return -1; /* Do not enable reuse, we share (almost) all buffers. */ //drm_intel_bufmgr_gem_enable_reuse(bufmgr); /* set up nouveau bufmgr */ ret = nouveau_device_wrap(nouveau_fd, 0, &ndev); if (ret < 0) { fprintf(stderr,"failed to wrap nouveau device\n"); return 77; } ret = nouveau_client_new(ndev, &nclient); if (ret < 0) { fprintf(stderr,"failed to setup nouveau client\n"); return -1; } /* set up an intel batch buffer */ devid = intel_get_drm_devid(intel_fd); intel_batch = intel_batchbuffer_alloc(bufmgr, devid); /* create an object on the i915 */ ret = test1(); if (ret) fprintf(stderr,"prime_test: failed test 1\n"); ret = test2(); if (ret) fprintf(stderr,"prime_test: failed test 2\n"); ret = test3(); if (ret) fprintf(stderr,"prime_test: failed test 3\n"); ret = test4(); if (ret) fprintf(stderr,"prime_test: failed test 4\n"); ret = test5(); if (ret) fprintf(stderr,"prime_test: failed test 5\n"); ret = test6(); if (ret) fprintf(stderr,"prime_test: failed test 6\n"); ret = test7(); if (ret) fprintf(stderr,"prime_test: failed test 7\n"); ret = test8(); if (ret) fprintf(stderr,"prime_test: failed test 8\n"); intel_batchbuffer_free(intel_batch); nouveau_device_del(&ndev); drm_intel_bufmgr_destroy(bufmgr); close(intel_fd); close(nouveau_fd); return ret; } intel-gpu-tools-1.3/tests/gem_partial_pwrite_pread.c0000664000175100017510000001506411714022505017706 00000000000000/* * Copyright © 2011 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Daniel Vetter * */ #include #include #include #include #include #include #include #include #include #include "drm.h" #include "i915_drm.h" #include "drmtest.h" #include "intel_bufmgr.h" #include "intel_batchbuffer.h" #include "intel_gpu_tools.h" /* * Testcase: pwrite/pread consistency when touching partial cachelines * * Some fancy new pwrite/pread optimizations clflush in-line while * reading/writing. Check whether all required clflushes happen. * */ static drm_intel_bufmgr *bufmgr; struct intel_batchbuffer *batch; drm_intel_bo *scratch_bo; drm_intel_bo *staging_bo; #define BO_SIZE (4*4096) uint32_t devid; uint64_t mappable_gtt_limit; int fd; static void copy_bo(drm_intel_bo *src, drm_intel_bo *dst) { BEGIN_BATCH(8); OUT_BATCH(XY_SRC_COPY_BLT_CMD | XY_SRC_COPY_BLT_WRITE_ALPHA | XY_SRC_COPY_BLT_WRITE_RGB); OUT_BATCH((3 << 24) | /* 32 bits */ (0xcc << 16) | /* copy ROP */ 4096); OUT_BATCH(0 << 16 | 0); OUT_BATCH((BO_SIZE/4096) << 16 | 1024); OUT_RELOC_FENCED(dst, I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER, 0); OUT_BATCH(0 << 16 | 0); OUT_BATCH(4096); OUT_RELOC_FENCED(src, I915_GEM_DOMAIN_RENDER, 0, 0); ADVANCE_BATCH(); intel_batchbuffer_flush(batch); } static void blt_bo_fill(drm_intel_bo *tmp_bo, drm_intel_bo *bo, int val) { uint8_t *gtt_ptr; int i; drm_intel_gem_bo_map_gtt(tmp_bo); gtt_ptr = tmp_bo->virtual; for (i = 0; i < BO_SIZE; i++) gtt_ptr[i] = val; drm_intel_gem_bo_unmap_gtt(tmp_bo); if (bo->offset < mappable_gtt_limit && (IS_G33(devid) || intel_gen(devid) >= 4)) drmtest_trash_aperture(); copy_bo(tmp_bo, bo); } #define MAX_BLT_SIZE 128 #define ROUNDS 1000 int main(int argc, char **argv) { int i, j; uint8_t tmp[BO_SIZE]; uint8_t *gtt_ptr; srandom(0xdeadbeef); fd = drm_open_any(); bufmgr = drm_intel_bufmgr_gem_init(fd, 4096); //drm_intel_bufmgr_gem_enable_reuse(bufmgr); devid = intel_get_drm_devid(fd); batch = intel_batchbuffer_alloc(bufmgr, devid); /* overallocate the buffers we're actually using because */ scratch_bo = drm_intel_bo_alloc(bufmgr, "scratch bo", BO_SIZE, 4096); staging_bo = drm_intel_bo_alloc(bufmgr, "staging bo", BO_SIZE, 4096); drmtest_init_aperture_trashers(bufmgr); mappable_gtt_limit = gem_mappable_aperture_size(); printf("checking partial reads\n"); for (i = 0; i < ROUNDS; i++) { int start, len; int val = i % 256; blt_bo_fill(staging_bo, scratch_bo, i); start = random() % BO_SIZE; len = random() % (BO_SIZE-start) + 1; drm_intel_bo_get_subdata(scratch_bo, start, len, tmp); for (j = 0; j < len; j++) { if (tmp[j] != val) { printf("mismatch at %i, got: %i, expected: %i\n", j, tmp[j], val); exit(1); } } drmtest_progress("partial reads test: ", i, ROUNDS); } printf("checking partial writes\n"); for (i = 0; i < ROUNDS; i++) { int start, len; int val = i % 256; blt_bo_fill(staging_bo, scratch_bo, i); start = random() % BO_SIZE; len = random() % (BO_SIZE-start) + 1; memset(tmp, i + 63, BO_SIZE); drm_intel_bo_subdata(scratch_bo, start, len, tmp); copy_bo(scratch_bo, staging_bo); drm_intel_gem_bo_map_gtt(staging_bo); gtt_ptr = staging_bo->virtual; for (j = 0; j < start; j++) { if (gtt_ptr[j] != val) { printf("mismatch at %i, got: %i, expected: %i\n", j, tmp[j], val); exit(1); } } for (; j < start + len; j++) { if (gtt_ptr[j] != tmp[0]) { printf("mismatch at %i, got: %i, expected: %i\n", j, tmp[j], i); exit(1); } } for (; j < BO_SIZE; j++) { if (gtt_ptr[j] != val) { printf("mismatch at %i, got: %i, expected: %i\n", j, tmp[j], val); exit(1); } } drm_intel_gem_bo_unmap_gtt(staging_bo); drmtest_progress("partial writes test: ", i, ROUNDS); } printf("checking partial writes after partial reads\n"); for (i = 0; i < ROUNDS; i++) { int start, len; int val = i % 256; blt_bo_fill(staging_bo, scratch_bo, i); /* partial read */ start = random() % BO_SIZE; len = random() % (BO_SIZE-start) + 1; drm_intel_bo_get_subdata(scratch_bo, start, len, tmp); for (j = 0; j < len; j++) { if (tmp[j] != val) { printf("mismatch in read at %i, got: %i, expected: %i\n", j, tmp[j], val); exit(1); } } /* Change contents through gtt to make the pread cachelines * stale. */ val = (i + 17) % 256; blt_bo_fill(staging_bo, scratch_bo, val); /* partial write */ start = random() % BO_SIZE; len = random() % (BO_SIZE-start) + 1; memset(tmp, i + 63, BO_SIZE); drm_intel_bo_subdata(scratch_bo, start, len, tmp); copy_bo(scratch_bo, staging_bo); drm_intel_gem_bo_map_gtt(staging_bo); gtt_ptr = staging_bo->virtual; for (j = 0; j < start; j++) { if (gtt_ptr[j] != val) { printf("mismatch at %i, got: %i, expected: %i\n", j, tmp[j], val); exit(1); } } for (; j < start + len; j++) { if (gtt_ptr[j] != tmp[0]) { printf("mismatch at %i, got: %i, expected: %i\n", j, tmp[j], tmp[0]); exit(1); } } for (; j < BO_SIZE; j++) { if (gtt_ptr[j] != val) { printf("mismatch at %i, got: %i, expected: %i\n", j, tmp[j], val); exit(1); } } drm_intel_gem_bo_unmap_gtt(staging_bo); drmtest_progress("partial read/writes test: ", i, ROUNDS); } drmtest_cleanup_aperture_trashers(); drm_intel_bufmgr_destroy(bufmgr); close(fd); return 0; } intel-gpu-tools-1.3/tests/gem_wait_render_timeout.c0000644000175100017510000001472312015770016017557 00000000000000/* * Copyright © 2012 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Ben Widawsky * */ #include #include #include "drm.h" #include "rendercopy.h" #define MSEC_PER_SEC 1000L #define USEC_PER_MSEC 1000L #define NSEC_PER_USEC 1000L #define NSEC_PER_MSEC 1000000L #define USEC_PER_SEC 1000000L #define NSEC_PER_SEC 1000000000L #define ENOUGH_WORK_IN_SECONDS 2 #define BUF_SIZE (8<<20) #define BUF_PAGES ((8<<20)>>12) drm_intel_bo *dst, *dst2; /* returns time diff in milliseconds */ static int64_t do_time_diff(struct timespec *end, struct timespec *start) { int64_t ret; ret = (MSEC_PER_SEC * difftime(end->tv_sec, start->tv_sec)) + ((end->tv_nsec/NSEC_PER_MSEC) - (start->tv_nsec/NSEC_PER_MSEC)); return ret; } /* to avoid stupid depencies on libdrm, copy&paste */ struct local_drm_i915_gem_wait { /** Handle of BO we shall wait on */ __u32 bo_handle; __u32 flags; /** Number of nanoseconds to wait, Returns time remaining. */ __u64 timeout_ns; }; # define WAIT_IOCTL DRM_IOWR(DRM_COMMAND_BASE + 0x2c, struct local_drm_i915_gem_wait) static int gem_bo_wait_timeout(int fd, uint32_t handle, uint64_t *timeout_ns) { struct local_drm_i915_gem_wait wait; int ret; assert(timeout_ns); wait.bo_handle = handle; wait.timeout_ns = *timeout_ns; wait.flags = 0; ret = drmIoctl(fd, WAIT_IOCTL, &wait); *timeout_ns = wait.timeout_ns; return ret ? -errno : 0; } static bool gem_bo_busy(int fd, uint32_t handle) { struct drm_i915_gem_busy busy; busy.handle = handle; do_or_die(drmIoctl(fd, DRM_IOCTL_I915_GEM_BUSY, &busy)); return !!busy.busy; } static void blt_color_fill(struct intel_batchbuffer *batch, drm_intel_bo *buf, const unsigned int pages) { const unsigned short height = pages/4; const unsigned short width = 4096; BEGIN_BATCH(5); OUT_BATCH(COLOR_BLT_CMD | COLOR_BLT_WRITE_ALPHA | COLOR_BLT_WRITE_RGB); OUT_BATCH((3 << 24) | /* 32 Bit Color */ 0xF0 | /* Raster OP copy background register */ 0); /* Dest pitch is 0 */ OUT_BATCH(width << 16 | height); OUT_RELOC(buf, I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER, 0); OUT_BATCH(rand()); /* random pattern */ ADVANCE_BATCH(); } int main(int argc, char **argv) { drm_intel_bufmgr *bufmgr; struct intel_batchbuffer *batch; uint64_t timeout = ENOUGH_WORK_IN_SECONDS * NSEC_PER_SEC; int fd, ret; const bool do_signals = true; /* signals will seem to make the operation * use less process CPU time */ bool done = false; int i, iter = 1; fd = drm_open_any(); bufmgr = drm_intel_bufmgr_gem_init(fd, 4096); drm_intel_bufmgr_gem_enable_reuse(bufmgr); batch = intel_batchbuffer_alloc(bufmgr, intel_get_drm_devid(fd)); dst = drm_intel_bo_alloc(bufmgr, "dst", BUF_SIZE, 4096); dst2 = drm_intel_bo_alloc(bufmgr, "dst2", BUF_SIZE, 4096); if (gem_bo_wait_timeout(fd, dst->handle, &timeout) == -EINVAL) { printf("kernel doesn't support wait_timeout, skipping test\n"); return -77; } timeout = ENOUGH_WORK_IN_SECONDS * NSEC_PER_SEC; /* Figure out a rough number of fills required to consume 1 second of * GPU work. */ do { struct timespec start, end; long diff; #ifndef CLOCK_MONOTONIC_RAW #define CLOCK_MONOTONIC_RAW CLOCK_MONOTONIC #endif assert(clock_gettime(CLOCK_MONOTONIC_RAW, &start) == 0); for (i = 0; i < iter; i++) blt_color_fill(batch, dst, BUF_PAGES); intel_batchbuffer_flush(batch); drm_intel_bo_wait_rendering(dst); assert(clock_gettime(CLOCK_MONOTONIC_RAW, &end) == 0); diff = do_time_diff(&end, &start); assert(diff >= 0); if ((diff / MSEC_PER_SEC) > ENOUGH_WORK_IN_SECONDS) done = true; else iter <<= 1; } while (!done && iter < 1000000); assert(iter < 1000000); printf("%d iters is enough work\n", iter); gem_quiescent_gpu(fd); if (do_signals) drmtest_fork_signal_helper(); /* We should be able to do half as much work in the same amount of time, * but because we might schedule almost twice as much as required, we * might accidentally time out. Hence add some fudge. */ for (i = 0; i < iter/3; i++) blt_color_fill(batch, dst2, BUF_PAGES); intel_batchbuffer_flush(batch); assert(gem_bo_busy(fd, dst2->handle) == true); ret = gem_bo_wait_timeout(fd, dst2->handle, &timeout); if (ret) { fprintf(stderr, "Timed wait failed %s\n", strerror(errno)); exit(EXIT_FAILURE); } assert(gem_bo_busy(fd, dst2->handle) == false); assert(timeout != 0); if (timeout == (ENOUGH_WORK_IN_SECONDS * NSEC_PER_SEC)) printf("Buffer was already done!\n"); else { printf("Finished with %lu time remaining\n", timeout); } /* check that polling with timeout=0 works. */ timeout = 0; assert(gem_bo_wait_timeout(fd, dst2->handle, &timeout) == 0); assert(timeout == 0); /* Now check that we correctly time out, twice the auto-tune load should * be good enough. */ timeout = ENOUGH_WORK_IN_SECONDS * NSEC_PER_SEC; for (i = 0; i < iter*2; i++) blt_color_fill(batch, dst2, BUF_PAGES); intel_batchbuffer_flush(batch); ret = gem_bo_wait_timeout(fd, dst2->handle, &timeout); assert(ret == -ETIME); assert(timeout == 0); assert(gem_bo_busy(fd, dst2->handle) == true); /* check that polling with timeout=0 works. */ timeout = 0; assert(gem_bo_wait_timeout(fd, dst2->handle, &timeout) == -ETIME); assert(timeout == 0); if (do_signals) drmtest_stop_signal_helper(); drm_intel_bo_unreference(dst2); drm_intel_bo_unreference(dst); intel_batchbuffer_free(batch); drm_intel_bufmgr_destroy(bufmgr); close(fd); return 0; } intel-gpu-tools-1.3/tests/gem_mmap_offset_exhaustion.c0000664000175100017510000000530511732123735020260 00000000000000/* * Copyright © 2012 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Daniel Vetter * */ #include #include #include #include #include #include #include #include #include #include #include #include "drm.h" #include "i915_drm.h" #include "drmtest.h" #define OBJECT_SIZE (1024*1024) /* Testcase: checks whether the kernel handles mmap offset exhaustion correctly * * Currently the kernel doesn't reap the mmap offset of purged objects, albeit * there's nothing that prevents it ABI-wise and it helps to get out of corners * (because drm_mm is only 32bit on 32bit archs unfortunately. * * Note that on 64bit machines we have plenty of address space (because drm_mm * uses unsigned long). */ static void create_and_map_bo(int fd) { uint32_t handle; char *ptr; handle = gem_create(fd, OBJECT_SIZE); ptr = gem_mmap(fd, handle, OBJECT_SIZE, PROT_READ | PROT_WRITE); if (!ptr) { fprintf(stderr, "mmap failed\n"); assert(ptr); } /* touch it to force it into the gtt */ *ptr = 0; /* but then unmap it again because we only have limited address space on * 32 bit */ munmap(ptr, OBJECT_SIZE); /* we happily leak objects to exhaust mmap offset space, the kernel will * reap backing storage. */ gem_madvise(fd, handle, I915_MADV_DONTNEED); } int main(int argc, char **argv) { int fd, i; fd = drm_open_any(); /* we have 32bit of address space, so try to fit one MB more * than that. */ for (i = 0; i < 4096 + 1; i++) create_and_map_bo(fd); close(fd); return 0; } intel-gpu-tools-1.3/tests/gem_reloc_vs_gpu.c0000664000175100017510000001315011706636070016177 00000000000000/* * Copyright © 2011 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Daniel Vetter * */ #include #include #include #include #include #include #include #include #include #include "drm.h" #include "i915_drm.h" #include "drmtest.h" #include "intel_bufmgr.h" #include "intel_batchbuffer.h" #include "intel_gpu_tools.h" /* * Testcase: Kernel relocations vs. gpu races * */ static drm_intel_bufmgr *bufmgr; struct intel_batchbuffer *batch; uint32_t blob[2048*2048]; #define NUM_TARGET_BOS 16 drm_intel_bo *pc_target_bo[NUM_TARGET_BOS]; drm_intel_bo *dummy_bo; drm_intel_bo *special_bo; uint32_t devid; int special_reloc_ofs; int special_batch_len; #define GFX_OP_PIPE_CONTROL ((0x3<<29)|(0x3<<27)|(0x2<<24)|2) #define PIPE_CONTROL_WRITE_IMMEDIATE (1<<14) #define PIPE_CONTROL_WRITE_TIMESTAMP (3<<14) #define PIPE_CONTROL_DEPTH_STALL (1<<13) #define PIPE_CONTROL_WC_FLUSH (1<<12) #define PIPE_CONTROL_IS_FLUSH (1<<11) /* MBZ on Ironlake */ #define PIPE_CONTROL_TC_FLUSH (1<<10) /* GM45+ only */ #define PIPE_CONTROL_STALL_AT_SCOREBOARD (1<<1) #define PIPE_CONTROL_CS_STALL (1<<20) #define PIPE_CONTROL_GLOBAL_GTT (1<<2) /* in addr dword */ static void create_special_bo(void) { uint32_t data[1024]; int len = 0; int small_pitch = 64; #define BATCH(dw) data[len++] = (dw); memset(data, 0, 4096); special_bo = drm_intel_bo_alloc(bufmgr, "special batch", 4096, 4096); BATCH(XY_COLOR_BLT_CMD | COLOR_BLT_WRITE_ALPHA | XY_COLOR_BLT_WRITE_RGB); BATCH((3 << 24) | (0xf0 << 16) | small_pitch); BATCH(0); BATCH(1 << 16 | 1); special_reloc_ofs = 4*len; BATCH(0); BATCH(0xdeadbeef); #define CMD_POLY_STIPPLE_OFFSET 0x7906 /* batchbuffer end */ if (IS_GEN5(batch->devid)) { BATCH(CMD_POLY_STIPPLE_OFFSET << 16); BATCH(0); } assert(len % 2 == 0); BATCH(MI_NOOP); BATCH(MI_BATCH_BUFFER_END); drm_intel_bo_subdata(special_bo, 0, 4096, data); special_batch_len = len*4; } static void emit_dummy_load(int pitch) { int i; uint32_t tile_flags = 0; if (IS_965(devid)) { pitch /= 4; tile_flags = XY_SRC_COPY_BLT_SRC_TILED | XY_SRC_COPY_BLT_DST_TILED; } for (i = 0; i < 10; i++) { BEGIN_BATCH(8); OUT_BATCH(XY_SRC_COPY_BLT_CMD | XY_SRC_COPY_BLT_WRITE_ALPHA | XY_SRC_COPY_BLT_WRITE_RGB | tile_flags); OUT_BATCH((3 << 24) | /* 32 bits */ (0xcc << 16) | /* copy ROP */ pitch); OUT_BATCH(0 << 16 | 1024); OUT_BATCH((2048) << 16 | (2048)); OUT_RELOC_FENCED(dummy_bo, I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER, 0); OUT_BATCH(0 << 16 | 0); OUT_BATCH(pitch); OUT_RELOC_FENCED(dummy_bo, I915_GEM_DOMAIN_RENDER, 0, 0); ADVANCE_BATCH(); if (IS_GEN6(devid) || IS_GEN7(devid)) { BEGIN_BATCH(3); OUT_BATCH(XY_SETUP_CLIP_BLT_CMD); OUT_BATCH(0); OUT_BATCH(0); ADVANCE_BATCH(); } } intel_batchbuffer_flush(batch); } #define MAX_BLT_SIZE 128 int main(int argc, char **argv) { uint32_t tiling_mode = I915_TILING_X; unsigned long pitch, act_size; int fd, i, ring; uint32_t test; memset(blob, 'A', sizeof(blob)); fd = drm_open_any(); bufmgr = drm_intel_bufmgr_gem_init(fd, 4096); /* disable reuse, otherwise the test fails */ //drm_intel_bufmgr_gem_enable_reuse(bufmgr); devid = intel_get_drm_devid(fd); batch = intel_batchbuffer_alloc(bufmgr, devid); act_size = 2048; dummy_bo = drm_intel_bo_alloc_tiled(bufmgr, "tiled dummy_bo", act_size, act_size, 4, &tiling_mode, &pitch, 0); drm_intel_bo_subdata(dummy_bo, 0, act_size*act_size*4, blob); create_special_bo(); if (intel_gen(devid) >= 6) ring = I915_EXEC_BLT; else ring = 0; for (i = 0; i < NUM_TARGET_BOS; i++) { pc_target_bo[i] = drm_intel_bo_alloc(bufmgr, "special batch", 4096, 4096); emit_dummy_load(pitch); assert(pc_target_bo[i]->offset == 0); drm_intel_bo_emit_reloc(special_bo, special_reloc_ofs, pc_target_bo[i], 0, I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER); drm_intel_bo_mrb_exec(special_bo, special_batch_len, NULL, 0, 0, ring); } /* Only check at the end to avoid unnecessary synchronous behaviour. */ for (i = 0; i < NUM_TARGET_BOS; i++) { drm_intel_bo_get_subdata(pc_target_bo[i], 0, 4, &test); if (test != 0xdeadbeef) { fprintf(stderr, "mismatch in buffer %i: 0x%08x instead of 0xdeadbeef\n", i, test); exit(1); } drm_intel_bo_unreference(pc_target_bo[i]); } drm_intel_gem_bo_map_gtt(dummy_bo); drm_intel_gem_bo_unmap_gtt(dummy_bo); intel_batchbuffer_free(batch); drm_intel_bufmgr_destroy(bufmgr); close(fd); return 0; } intel-gpu-tools-1.3/tests/gem_tiled_blits.c0000664000175100017510000001315511732606124016007 00000000000000/* * Copyright © 2009 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Eric Anholt * */ /** @file gem_tiled_blits.c * * This is a test of doing many tiled blits, with a working set * larger than the aperture size. * * The goal is to catch a couple types of failure; * - Fence management problems on pre-965. * - A17 or L-shaped memory tiling workaround problems in acceleration. * * The model is to fill a collection of 1MB objects in a way that can't trip * over A6 swizzling -- upload data to a non-tiled object, blit to the tiled * object. Then, copy the 1MB objects randomly between each other for a while. * Finally, download their data through linear objects again and see what * resulted. */ #include #include #include #include #include #include #include #include #include #include "drm.h" #include "i915_drm.h" #include "drmtest.h" #include "intel_bufmgr.h" #include "intel_batchbuffer.h" #include "intel_gpu_tools.h" static drm_intel_bufmgr *bufmgr; struct intel_batchbuffer *batch; static int width = 512, height = 512; static drm_intel_bo * create_bo(uint32_t start_val) { drm_intel_bo *bo, *linear_bo; uint32_t *linear; uint32_t tiling = I915_TILING_X; int ret, i; bo = drm_intel_bo_alloc(bufmgr, "tiled bo", 1024 * 1024, 4096); ret = drm_intel_bo_set_tiling(bo, &tiling, width * 4); assert(ret == 0); assert(tiling == I915_TILING_X); linear_bo = drm_intel_bo_alloc(bufmgr, "linear src", 1024 * 1024, 4096); /* Fill the BO with dwords starting at start_val */ drm_intel_bo_map(linear_bo, 1); linear = linear_bo->virtual; for (i = 0; i < 1024 * 1024 / 4; i++) linear[i] = start_val++; drm_intel_bo_unmap(linear_bo); intel_copy_bo (batch, bo, linear_bo, width, height); drm_intel_bo_unreference(linear_bo); return bo; } static void check_bo(drm_intel_bo *bo, uint32_t start_val) { drm_intel_bo *linear_bo; uint32_t *linear; int i; linear_bo = drm_intel_bo_alloc(bufmgr, "linear dst", 1024 * 1024, 4096); intel_copy_bo(batch, linear_bo, bo, width, height); drm_intel_bo_map(linear_bo, 0); linear = linear_bo->virtual; for (i = 0; i < 1024 * 1024 / 4; i++) { if (linear[i] != start_val) { fprintf(stderr, "Expected 0x%08x, found 0x%08x " "at offset 0x%08x\n", start_val, linear[i], i * 4); abort(); } start_val++; } drm_intel_bo_unmap(linear_bo); drm_intel_bo_unreference(linear_bo); } int main(int argc, char **argv) { drm_intel_bo **bo; uint32_t *bo_start_val; uint32_t start = 0; int i, fd, count; fd = drm_open_any(); count = 0; if (argc > 1) count = atoi(argv[1]); if (count == 0) { count = 3 * gem_aperture_size(fd) / (1024*1024) / 2; count += (count & 1) == 0; } if (count > intel_get_total_ram_mb() * 9 / 10) { count = intel_get_total_ram_mb() * 9 / 10; printf("not enough RAM to run test, reducing buffer count\n"); } printf("Using %d 1MiB buffers\n", count); bo = malloc(sizeof(drm_intel_bo *)*count); bo_start_val = malloc(sizeof(uint32_t)*count); bufmgr = drm_intel_bufmgr_gem_init(fd, 4096); drm_intel_bufmgr_gem_enable_reuse(bufmgr); batch = intel_batchbuffer_alloc(bufmgr, intel_get_drm_devid(fd)); for (i = 0; i < count; i++) { bo[i] = create_bo(start); bo_start_val[i] = start; start += 1024 * 1024 / 4; } printf("Verifying initialisation...\n"); for (i = 0; i < count; i++) check_bo(bo[i], bo_start_val[i]); printf("Cyclic blits, forward...\n"); for (i = 0; i < count * 4; i++) { int src = i % count; int dst = (i+1) % count; if (src == dst) continue; intel_copy_bo(batch, bo[dst], bo[src], width, height); bo_start_val[dst] = bo_start_val[src]; } for (i = 0; i < count; i++) check_bo(bo[i], bo_start_val[i]); printf("Cyclic blits, backward...\n"); for (i = 0; i < count * 4; i++) { int src = (i+1) % count; int dst = i % count; if (src == dst) continue; intel_copy_bo(batch, bo[dst], bo[src], width, height); bo_start_val[dst] = bo_start_val[src]; } for (i = 0; i < count; i++) check_bo(bo[i], bo_start_val[i]); printf("Random blits...\n"); for (i = 0; i < count * 4; i++) { int src = random() % count; int dst = random() % count; if (src == dst) continue; intel_copy_bo(batch, bo[dst], bo[src], width, height); bo_start_val[dst] = bo_start_val[src]; } for (i = 0; i < count; i++) check_bo(bo[i], bo_start_val[i]); for (i = 0; i < count; i++) { drm_intel_bo_unreference(bo[i]); bo[i] = NULL; } intel_batchbuffer_free(batch); drm_intel_bufmgr_destroy(bufmgr); close(fd); return 0; } intel-gpu-tools-1.3/tests/gem_cpu_concurrent_blit.c0000664000175100017510000000770012004013767017551 00000000000000/* * Copyright © 2009,2012 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Eric Anholt * Chris Wilson * */ /** @file gem_cpu_concurrent_blit.c * * This is a test of CPU read/write behavior when writing to active * buffers. */ #include #include #include #include #include #include #include #include #include #include "drm.h" #include "i915_drm.h" #include "drmtest.h" #include "intel_bufmgr.h" #include "intel_batchbuffer.h" #include "intel_gpu_tools.h" static void set_bo(drm_intel_bo *bo, uint32_t val, int width, int height) { int size = width * height; uint32_t *vaddr; drm_intel_bo_map(bo, true); vaddr = bo->virtual; while (size--) *vaddr++ = val; drm_intel_bo_unmap(bo); } static void cmp_bo(drm_intel_bo *bo, uint32_t val, int width, int height) { int size = width * height; uint32_t *vaddr; drm_intel_bo_map(bo, false); vaddr = bo->virtual; while (size--) assert(*vaddr++ == val); drm_intel_bo_unmap(bo); } static drm_intel_bo * create_bo(drm_intel_bufmgr *bufmgr, uint32_t val, int width, int height) { drm_intel_bo *bo; bo = drm_intel_bo_alloc(bufmgr, "bo", 4*width*height, 0); assert(bo); set_bo(bo, val, width, height); return bo; } int main(int argc, char **argv) { drm_intel_bufmgr *bufmgr; struct intel_batchbuffer *batch; int num_buffers = 128, max; drm_intel_bo *src[128], *dst[128], *dummy; int width = 512, height = 512; int fd; int i; fd = drm_open_any(); max = gem_aperture_size (fd) / (1024 * 1024) / 2; if (num_buffers > max) num_buffers = max; bufmgr = drm_intel_bufmgr_gem_init(fd, 4096); drm_intel_bufmgr_gem_enable_reuse(bufmgr); batch = intel_batchbuffer_alloc(bufmgr, intel_get_drm_devid(fd)); for (i = 0; i < num_buffers; i++) { src[i] = create_bo(bufmgr, i, width, height); dst[i] = create_bo(bufmgr, ~i, width, height); } dummy = create_bo(bufmgr, 0, width, height); /* try to overwrite the source values */ for (i = 0; i < num_buffers; i++) intel_copy_bo(batch, dst[i], src[i], width, height); for (i = num_buffers; i--; ) set_bo(src[i], 0xdeadbeef, width, height); for (i = 0; i < num_buffers; i++) cmp_bo(dst[i], i, width, height); /* try to read the results before the copy completes */ for (i = 0; i < num_buffers; i++) intel_copy_bo(batch, dst[i], src[i], width, height); for (i = num_buffers; i--; ) cmp_bo(dst[i], 0xdeadbeef, width, height); /* and finally try to trick the kernel into loosing the pending write */ for (i = num_buffers; i--; ) set_bo(src[i], 0xabcdabcd, width, height); for (i = 0; i < num_buffers; i++) intel_copy_bo(batch, dst[i], src[i], width, height); for (i = num_buffers; i--; ) intel_copy_bo(batch, dummy, dst[i], width, height); for (i = num_buffers; i--; ) cmp_bo(dst[i], 0xabcdabcd, width, height); return 0; } intel-gpu-tools-1.3/tests/gem_exec_faulting_reloc.c0000664000175100017510000001322311772702746017521 00000000000000/* * Copyright © 2011 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Daniel Vetter * */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include "drm.h" #include "i915_drm.h" #include "drmtest.h" #include "intel_chipset.h" #include "intel_gpu_tools.h" /* Testcase: Submit patches with relocations in memory that will fault * * To be really evil, use a gtt mmap for them. */ #define OBJECT_SIZE 16384 #define COPY_BLT_CMD (2<<29|0x53<<22|0x6) #define BLT_WRITE_ALPHA (1<<21) #define BLT_WRITE_RGB (1<<20) #define BLT_SRC_TILED (1<<15) #define BLT_DST_TILED (1<<11) static int gem_linear_blt(uint32_t *batch, uint32_t src, uint32_t dst, uint32_t length, struct drm_i915_gem_relocation_entry *reloc) { uint32_t *b = batch; int height = length / (16 * 1024); assert(height <= 1<<16); if (height) { b[0] = COPY_BLT_CMD | BLT_WRITE_ALPHA | BLT_WRITE_RGB; b[1] = 0xcc << 16 | 1 << 25 | 1 << 24 | (16*1024); b[2] = 0; b[3] = height << 16 | (4*1024); b[4] = 0; reloc->offset = (b-batch+4) * sizeof(uint32_t); reloc->delta = 0; reloc->target_handle = dst; reloc->read_domains = I915_GEM_DOMAIN_RENDER; reloc->write_domain = I915_GEM_DOMAIN_RENDER; reloc->presumed_offset = 0; reloc++; b[5] = 0; b[6] = 16*1024; b[7] = 0; reloc->offset = (b-batch+7) * sizeof(uint32_t); reloc->delta = 0; reloc->target_handle = src; reloc->read_domains = I915_GEM_DOMAIN_RENDER; reloc->write_domain = 0; reloc->presumed_offset = 0; reloc++; b += 8; length -= height * 16*1024; } if (length) { b[0] = COPY_BLT_CMD | BLT_WRITE_ALPHA | BLT_WRITE_RGB; b[1] = 0xcc << 16 | 1 << 25 | 1 << 24 | (16*1024); b[2] = height << 16; b[3] = (1+height) << 16 | (length / 4); b[4] = 0; reloc->offset = (b-batch+4) * sizeof(uint32_t); reloc->delta = 0; reloc->target_handle = dst; reloc->read_domains = I915_GEM_DOMAIN_RENDER; reloc->write_domain = I915_GEM_DOMAIN_RENDER; reloc->presumed_offset = 0; reloc++; b[5] = height << 16; b[6] = 16*1024; b[7] = 0; reloc->offset = (b-batch+7) * sizeof(uint32_t); reloc->delta = 0; reloc->target_handle = src; reloc->read_domains = I915_GEM_DOMAIN_RENDER; reloc->write_domain = 0; reloc->presumed_offset = 0; reloc++; b += 8; } b[0] = MI_BATCH_BUFFER_END; b[1] = 0; return (b+2 - batch) * sizeof(uint32_t); } static void gem_exec(int fd, struct drm_i915_gem_execbuffer2 *execbuf) { int ret; ret = drmIoctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, execbuf); assert(ret == 0); } static void run(int object_size) { struct drm_i915_gem_execbuffer2 execbuf; struct drm_i915_gem_exec_object2 exec[3]; struct drm_i915_gem_relocation_entry reloc[4]; uint32_t buf[20]; uint32_t handle, handle_relocs, src, dst; void *gtt_relocs; int fd, len; int ring; fd = drm_open_any(); handle = gem_create(fd, 4096); src = gem_create(fd, object_size); dst = gem_create(fd, object_size); len = gem_linear_blt(buf, src, dst, object_size, reloc); gem_write(fd, handle, 0, buf, len); exec[0].handle = src; exec[0].relocation_count = 0; exec[0].relocs_ptr = 0; exec[0].alignment = 0; exec[0].offset = 0; exec[0].flags = 0; exec[0].rsvd1 = 0; exec[0].rsvd2 = 0; exec[1].handle = dst; exec[1].relocation_count = 0; exec[1].relocs_ptr = 0; exec[1].alignment = 0; exec[1].offset = 0; exec[1].flags = 0; exec[1].rsvd1 = 0; exec[1].rsvd2 = 0; handle_relocs = gem_create(fd, 4096); gem_write(fd, handle_relocs, 0, reloc, sizeof(reloc)); gtt_relocs = gem_mmap(fd, handle_relocs, 4096, PROT_READ | PROT_WRITE); assert(gtt_relocs); exec[2].handle = handle; exec[2].relocation_count = len > 40 ? 4 : 2; /* A newly mmap gtt bo will fault on first access. */ exec[2].relocs_ptr = (uintptr_t)gtt_relocs; exec[2].alignment = 0; exec[2].offset = 0; exec[2].flags = 0; exec[2].rsvd1 = 0; exec[2].rsvd2 = 0; ring = 0; if (HAS_BLT_RING(intel_get_drm_devid(fd))) ring = I915_EXEC_BLT; execbuf.buffers_ptr = (uintptr_t)exec; execbuf.buffer_count = 3; execbuf.batch_start_offset = 0; execbuf.batch_len = len; execbuf.cliprects_ptr = 0; execbuf.num_cliprects = 0; execbuf.DR1 = 0; execbuf.DR4 = 0; execbuf.flags = ring; i915_execbuffer2_set_context_id(execbuf, 0); execbuf.rsvd2 = 0; gem_exec(fd, &execbuf); gem_sync(fd, handle); gem_close(fd, handle); close(fd); } int main(int argc, char **argv) { run(OBJECT_SIZE); return 0; } intel-gpu-tools-1.3/tests/gem_stress.c0000664000175100017510000006320611775241246015045 00000000000000/* * Copyright © 2011 Daniel Vetter * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Daniel Vetter * * Partially based upon gem_tiled_fence_blits.c */ /** @file gem_stress.c * * This is a general gem coherency test. It's designed to eventually replicate * any possible sequence of access patterns. It works by copying a set of tiles * between two sets of backing buffer objects, randomly permutating the assinged * position on each copy operations. * * The copy operation are done in tiny portions (to reduce any race windows * for corruptions, hence increasing the chances for observing one) and are * constantly switched between all means to copy stuff (fenced blitter, unfenced * render, mmap, pwrite/read). * * After every complete move of a set tiling parameters of a buffer are randomly * changed to simulate the effects of libdrm caching. * * Buffers are 1mb big to nicely fit into fences on gen2/3. A few are further * split up to test relaxed fencing. Using this to push the average working set * size over the available gtt space forces objects to be mapped as unfenceable * (and as a side-effect tests gtt map/unmap coherency). * * In short: designed for maximum evilness. */ #include "rendercopy.h" #define CMD_POLY_STIPPLE_OFFSET 0x7906 /** TODO: * - beat on relaxed fencing (i.e. mappable/fenceable tracking in the kernel) * - render copy (to check fence tracking and cache coherency management by the * kernel) * - multi-threading: probably just a wrapper script to launch multiple * instances + an option to accordingly reduce the working set * - gen6 inter-ring coherency (needs render copy, first) * - variable buffer size * - add an option to fork a second process that randomly sends signals to the * first one (to check consistency of the kernel recovery paths) */ drm_intel_bufmgr *bufmgr; struct intel_batchbuffer *batch; int drm_fd; int devid; int num_fences; drm_intel_bo *busy_bo; struct option_struct { unsigned scratch_buf_size; unsigned max_dimension; unsigned num_buffers; int trace_tile; int no_hw; int gpu_busy_load; int use_render; int use_blt; int forced_tiling; int use_cpu_maps; int total_rounds; int fail; int tiles_per_buf; int ducttape; int tile_size; int check_render_cpyfn; int use_signal_helper; }; struct option_struct options; #define MAX_BUFS 4096 #define SCRATCH_BUF_SIZE 1024*1024 #define BUSY_BUF_SIZE (256*4096) #define TILE_BYTES(size) ((size)*(size)*sizeof(uint32_t)) static struct scratch_buf buffers[2][MAX_BUFS]; /* tile i is at logical position tile_permutation[i] */ static unsigned *tile_permutation; static unsigned num_buffers = 0; static unsigned current_set = 0; static unsigned target_set = 0; static unsigned num_total_tiles = 0; int fence_storm = 0; static int gpu_busy_load = 10; struct { unsigned num_failed; unsigned max_failed_reads; } stats; static void tile2xy(struct scratch_buf *buf, unsigned tile, unsigned *x, unsigned *y) { assert(tile < buf->num_tiles); *x = (tile*options.tile_size) % (buf->stride/sizeof(uint32_t)); *y = ((tile*options.tile_size) / (buf->stride/sizeof(uint32_t))) * options.tile_size; } static void emit_blt(drm_intel_bo *src_bo, uint32_t src_tiling, unsigned src_pitch, unsigned src_x, unsigned src_y, unsigned w, unsigned h, drm_intel_bo *dst_bo, uint32_t dst_tiling, unsigned dst_pitch, unsigned dst_x, unsigned dst_y) { uint32_t cmd_bits = 0; if (IS_965(devid) && src_tiling) { src_pitch /= 4; cmd_bits |= XY_SRC_COPY_BLT_SRC_TILED; } if (IS_965(devid) && dst_tiling) { dst_pitch /= 4; cmd_bits |= XY_SRC_COPY_BLT_DST_TILED; } /* copy lower half to upper half */ BEGIN_BATCH(8); OUT_BATCH(XY_SRC_COPY_BLT_CMD | XY_SRC_COPY_BLT_WRITE_ALPHA | XY_SRC_COPY_BLT_WRITE_RGB | cmd_bits); OUT_BATCH((3 << 24) | /* 32 bits */ (0xcc << 16) | /* copy ROP */ dst_pitch); OUT_BATCH(dst_y << 16 | dst_x); OUT_BATCH((dst_y+h) << 16 | (dst_x+w)); OUT_RELOC_FENCED(dst_bo, I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER, 0); OUT_BATCH(src_y << 16 | src_x); OUT_BATCH(src_pitch); OUT_RELOC_FENCED(src_bo, I915_GEM_DOMAIN_RENDER, 0, 0); ADVANCE_BATCH(); if (IS_GEN6(devid) || IS_GEN7(devid)) { BEGIN_BATCH(3); OUT_BATCH(XY_SETUP_CLIP_BLT_CMD); OUT_BATCH(0); OUT_BATCH(0); ADVANCE_BATCH(); } } /* All this gem trashing wastes too much cpu time, so give the gpu something to * do to increase changes for races. */ static void keep_gpu_busy(void) { int tmp; tmp = 1 << gpu_busy_load; assert(tmp <= 1024); emit_blt(busy_bo, 0, 4096, 0, 0, tmp, 128, busy_bo, 0, 4096, 0, 128); } static void set_to_cpu_domain(struct scratch_buf *buf, int writing) { gem_set_domain(drm_fd, buf->bo->handle, I915_GEM_DOMAIN_CPU, writing ? I915_GEM_DOMAIN_CPU : 0); } static unsigned int copyfunc_seq = 0; static void (*copyfunc)(struct scratch_buf *src, unsigned src_x, unsigned src_y, struct scratch_buf *dst, unsigned dst_x, unsigned dst_y, unsigned logical_tile_no); /* stride, x, y in units of uint32_t! */ static void cpucpy2d(uint32_t *src, unsigned src_stride, unsigned src_x, unsigned src_y, uint32_t *dst, unsigned dst_stride, unsigned dst_x, unsigned dst_y, unsigned logical_tile_no) { int i, j; int failed = 0; for (i = 0; i < options.tile_size; i++) { for (j = 0; j < options.tile_size; j++) { unsigned dst_ofs = dst_x + j + dst_stride * (dst_y + i); unsigned src_ofs = src_x + j + src_stride * (src_y + i); unsigned expect = logical_tile_no*options.tile_size*options.tile_size + i*options.tile_size + j; uint32_t tmp = src[src_ofs]; if (tmp != expect) { printf("mismatch at tile %i pos %i, read %i, expected %i, diff %i\n", logical_tile_no, i*options.tile_size + j, tmp, expect, (int) tmp - expect); if (options.trace_tile >= 0 && options.fail) exit(1); failed++; } /* when not aborting, correct any errors */ dst[dst_ofs] = expect; } } if (failed && options.fail) exit(1); if (failed > stats.max_failed_reads) stats.max_failed_reads = failed; if (failed) stats.num_failed++; } static void cpu_copyfunc(struct scratch_buf *src, unsigned src_x, unsigned src_y, struct scratch_buf *dst, unsigned dst_x, unsigned dst_y, unsigned logical_tile_no) { assert(batch->ptr == batch->buffer); if (options.ducttape) drm_intel_bo_wait_rendering(dst->bo); if (options.use_cpu_maps) { set_to_cpu_domain(src, 0); set_to_cpu_domain(dst, 1); } cpucpy2d(src->data, src->stride/sizeof(uint32_t), src_x, src_y, dst->data, dst->stride/sizeof(uint32_t), dst_x, dst_y, logical_tile_no); } static void prw_copyfunc(struct scratch_buf *src, unsigned src_x, unsigned src_y, struct scratch_buf *dst, unsigned dst_x, unsigned dst_y, unsigned logical_tile_no) { uint32_t tmp_tile[options.tile_size*options.tile_size]; int i; assert(batch->ptr == batch->buffer); if (options.ducttape) drm_intel_bo_wait_rendering(dst->bo); if (src->tiling == I915_TILING_NONE) { for (i = 0; i < options.tile_size; i++) { unsigned ofs = src_x*sizeof(uint32_t) + src->stride*(src_y + i); drm_intel_bo_get_subdata(src->bo, ofs, options.tile_size*sizeof(uint32_t), tmp_tile + options.tile_size*i); } } else { if (options.use_cpu_maps) set_to_cpu_domain(src, 0); cpucpy2d(src->data, src->stride/sizeof(uint32_t), src_x, src_y, tmp_tile, options.tile_size, 0, 0, logical_tile_no); } if (dst->tiling == I915_TILING_NONE) { for (i = 0; i < options.tile_size; i++) { unsigned ofs = dst_x*sizeof(uint32_t) + dst->stride*(dst_y + i); drm_intel_bo_subdata(dst->bo, ofs, options.tile_size*sizeof(uint32_t), tmp_tile + options.tile_size*i); } } else { if (options.use_cpu_maps) set_to_cpu_domain(dst, 1); cpucpy2d(tmp_tile, options.tile_size, 0, 0, dst->data, dst->stride/sizeof(uint32_t), dst_x, dst_y, logical_tile_no); } } static void blitter_copyfunc(struct scratch_buf *src, unsigned src_x, unsigned src_y, struct scratch_buf *dst, unsigned dst_x, unsigned dst_y, unsigned logical_tile_no) { static unsigned keep_gpu_busy_counter = 0; /* check both edges of the fence usage */ if (keep_gpu_busy_counter & 1 && !fence_storm) keep_gpu_busy(); emit_blt(src->bo, src->tiling, src->stride, src_x, src_y, options.tile_size, options.tile_size, dst->bo, dst->tiling, dst->stride, dst_x, dst_y); if (!(keep_gpu_busy_counter & 1) && !fence_storm) keep_gpu_busy(); keep_gpu_busy_counter++; if (src->tiling) fence_storm--; if (dst->tiling) fence_storm--; if (fence_storm <= 1) { fence_storm = 0; intel_batchbuffer_flush(batch); } } static void render_copyfunc(struct scratch_buf *src, unsigned src_x, unsigned src_y, struct scratch_buf *dst, unsigned dst_x, unsigned dst_y, unsigned logical_tile_no) { static unsigned keep_gpu_busy_counter = 0; /* check both edges of the fence usage */ if (keep_gpu_busy_counter & 1) keep_gpu_busy(); if (IS_GEN2(devid)) gen2_render_copyfunc(batch, src, src_x, src_y, options.tile_size, options.tile_size, dst, dst_x, dst_y); else if (IS_GEN3(devid)) gen3_render_copyfunc(batch, src, src_x, src_y, options.tile_size, options.tile_size, dst, dst_x, dst_y); else if (IS_GEN6(devid)) gen6_render_copyfunc(batch, src, src_x, src_y, options.tile_size, options.tile_size, dst, dst_x, dst_y); else if (IS_GEN7(devid)) gen7_render_copyfunc(batch, src, src_x, src_y, options.tile_size, options.tile_size, dst, dst_x, dst_y); else blitter_copyfunc(src, src_x, src_y, dst, dst_x, dst_y, logical_tile_no); if (!(keep_gpu_busy_counter & 1)) keep_gpu_busy(); keep_gpu_busy_counter++; intel_batchbuffer_flush(batch); } static void next_copyfunc(int tile) { if (fence_storm) { if (tile == options.trace_tile) printf(" using fence storm\n"); return; } if (copyfunc_seq % 61 == 0 && options.forced_tiling != I915_TILING_NONE) { if (tile == options.trace_tile) printf(" using fence storm\n"); fence_storm = num_fences; copyfunc = blitter_copyfunc; } else if (copyfunc_seq % 17 == 0) { if (tile == options.trace_tile) printf(" using cpu\n"); copyfunc = cpu_copyfunc; } else if (copyfunc_seq % 19 == 0) { if (tile == options.trace_tile) printf(" using prw\n"); copyfunc = prw_copyfunc; } else if (copyfunc_seq % 3 == 0 && options.use_render) { if (tile == options.trace_tile) printf(" using render\n"); copyfunc = render_copyfunc; } else if (options.use_blt){ if (tile == options.trace_tile) printf(" using blitter\n"); copyfunc = blitter_copyfunc; } else if (options.use_render){ if (tile == options.trace_tile) printf(" using render\n"); copyfunc = render_copyfunc; } else { copyfunc = cpu_copyfunc; } copyfunc_seq++; } static void fan_out(void) { uint32_t tmp_tile[options.tile_size*options.tile_size]; uint32_t seq = 0; int i, k; unsigned tile, buf_idx, x, y; for (i = 0; i < num_total_tiles; i++) { tile = i; buf_idx = tile / options.tiles_per_buf; tile %= options.tiles_per_buf; tile2xy(&buffers[current_set][buf_idx], tile, &x, &y); for (k = 0; k < options.tile_size*options.tile_size; k++) tmp_tile[k] = seq++; if (options.use_cpu_maps) set_to_cpu_domain(&buffers[current_set][buf_idx], 1); cpucpy2d(tmp_tile, options.tile_size, 0, 0, buffers[current_set][buf_idx].data, buffers[current_set][buf_idx].stride / sizeof(uint32_t), x, y, i); } for (i = 0; i < num_total_tiles; i++) tile_permutation[i] = i; } static void fan_in_and_check(void) { uint32_t tmp_tile[options.tile_size*options.tile_size]; unsigned tile, buf_idx, x, y; int i; for (i = 0; i < num_total_tiles; i++) { tile = tile_permutation[i]; buf_idx = tile / options.tiles_per_buf; tile %= options.tiles_per_buf; tile2xy(&buffers[current_set][buf_idx], tile, &x, &y); if (options.use_cpu_maps) set_to_cpu_domain(&buffers[current_set][buf_idx], 0); cpucpy2d(buffers[current_set][buf_idx].data, buffers[current_set][buf_idx].stride / sizeof(uint32_t), x, y, tmp_tile, options.tile_size, 0, 0, i); } } static void sanitize_stride(struct scratch_buf *buf) { if (buf_height(buf) > options.max_dimension) buf->stride = buf->size / options.max_dimension; if (buf_height(buf) < options.tile_size) buf->stride = buf->size / options.tile_size; if (buf_width(buf) < options.tile_size) buf->stride = options.tile_size * sizeof(uint32_t); assert(buf->stride <= 8192); assert(buf_width(buf) <= options.max_dimension); assert(buf_height(buf) <= options.max_dimension); assert(buf_width(buf) >= options.tile_size); assert(buf_height(buf) >= options.tile_size); } static void init_buffer(struct scratch_buf *buf, unsigned size) { buf->bo = drm_intel_bo_alloc(bufmgr, "tiled bo", size, 4096); buf->size = size; assert(buf->bo); buf->tiling = I915_TILING_NONE; buf->stride = 4096; sanitize_stride(buf); if (options.no_hw) buf->data = malloc(size); else { if (options.use_cpu_maps) drm_intel_bo_map(buf->bo, 1); else drm_intel_gem_bo_map_gtt(buf->bo); buf->data = buf->bo->virtual; } buf->num_tiles = options.tiles_per_buf; } static void exchange_buf(void *array, unsigned i, unsigned j) { struct scratch_buf *buf_arr, tmp; buf_arr = array; memcpy(&tmp, &buf_arr[i], sizeof(struct scratch_buf)); memcpy(&buf_arr[i], &buf_arr[j], sizeof(struct scratch_buf)); memcpy(&buf_arr[j], &tmp, sizeof(struct scratch_buf)); } static void init_set(unsigned set) { long int r; int i; drmtest_permute_array(buffers[set], num_buffers, exchange_buf); if (current_set == 1 && options.gpu_busy_load == 0) { gpu_busy_load++; if (gpu_busy_load > 10) gpu_busy_load = 6; } for (i = 0; i < num_buffers; i++) { r = random(); if ((r & 3) != 0) continue; r >>= 2; if ((r & 3) != 0) buffers[set][i].tiling = I915_TILING_X; else buffers[set][i].tiling = I915_TILING_NONE; r >>= 2; if (options.forced_tiling >= 0) buffers[set][i].tiling = options.forced_tiling; if (buffers[set][i].tiling == I915_TILING_NONE) { /* min 64 byte stride */ r %= 8; buffers[set][i].stride = 64 * (1 << r); } else if (IS_GEN2(devid)) { /* min 128 byte stride */ r %= 7; buffers[set][i].stride = 128 * (1 << r); } else { /* min 512 byte stride */ r %= 5; buffers[set][i].stride = 512 * (1 << r); } sanitize_stride(&buffers[set][i]); gem_set_tiling(drm_fd, buffers[set][i].bo->handle, buffers[set][i].tiling, buffers[set][i].stride); if (options.trace_tile != -1 && i == options.trace_tile/options.tiles_per_buf) printf("changing buffer %i containing tile %i: tiling %i, stride %i\n", i, options.trace_tile, buffers[set][i].tiling, buffers[set][i].stride); } } static void exchange_uint(void *array, unsigned i, unsigned j) { unsigned *i_arr = array; unsigned i_tmp; i_tmp = i_arr[i]; i_arr[i] = i_arr[j]; i_arr[j] = i_tmp; } static void copy_tiles(unsigned *permutation) { unsigned src_tile, src_buf_idx, src_x, src_y; unsigned dst_tile, dst_buf_idx, dst_x, dst_y; struct scratch_buf *src_buf, *dst_buf; int i, idx; for (i = 0; i < num_total_tiles; i++) { /* tile_permutation is independent of current_permutation, so * abuse it to randomize the order of the src bos */ idx = tile_permutation[i]; src_buf_idx = idx / options.tiles_per_buf; src_tile = idx % options.tiles_per_buf; src_buf = &buffers[current_set][src_buf_idx]; tile2xy(src_buf, src_tile, &src_x, &src_y); dst_buf_idx = permutation[idx] / options.tiles_per_buf; dst_tile = permutation[idx] % options.tiles_per_buf; dst_buf = &buffers[target_set][dst_buf_idx]; tile2xy(dst_buf, dst_tile, &dst_x, &dst_y); if (options.trace_tile == i) printf("copying tile %i from %i (%i, %i) to %i (%i, %i)", i, tile_permutation[i], src_buf_idx, src_tile, permutation[idx], dst_buf_idx, dst_tile); if (options.no_hw) { cpucpy2d(src_buf->data, src_buf->stride / sizeof(uint32_t), src_x, src_y, dst_buf->data, dst_buf->stride / sizeof(uint32_t), dst_x, dst_y, i); } else { next_copyfunc(i); copyfunc(src_buf, src_x, src_y, dst_buf, dst_x, dst_y, i); } } intel_batchbuffer_flush(batch); } static int get_num_fences(void) { drm_i915_getparam_t gp; int ret, val; gp.param = I915_PARAM_NUM_FENCES_AVAIL; gp.value = &val; ret = drmIoctl(drm_fd, DRM_IOCTL_I915_GETPARAM, &gp); assert (ret == 0); printf ("total %d fences\n", val); assert(val > 4); return val - 2; } static void sanitize_tiles_per_buf(void) { if (options.tiles_per_buf > options.scratch_buf_size / TILE_BYTES(options.tile_size)) options.tiles_per_buf = options.scratch_buf_size / TILE_BYTES(options.tile_size); } static void parse_options(int argc, char **argv) { int c, tmp; int option_index = 0; static struct option long_options[] = { {"no-hw", 0, 0, 'd'}, {"buf-size", 1, 0, 's'}, {"gpu-busy-load", 1, 0, 'g'}, {"no-signals", 0, 0, 'S'}, {"buffer-count", 1, 0, 'c'}, {"trace-tile", 1, 0, 't'}, {"disable-blt", 0, 0, 'b'}, {"disable-render", 0, 0, 'r'}, {"untiled", 0, 0, 'u'}, {"x-tiled", 0, 0, 'x'}, {"use-cpu-maps", 0, 0, 'm'}, {"rounds", 1, 0, 'o'}, {"no-fail", 0, 0, 'f'}, {"tiles-per-buf", 0, 0, 'p'}, #define DUCTAPE 0xdead0001 {"remove-duct-tape", 0, 0, DUCTAPE}, #define TILESZ 0xdead0002 {"tile-size", 1, 0, TILESZ}, #define CHCK_RENDER 0xdead0003 {"check-render-cpyfn", 0, 0, CHCK_RENDER}, }; options.scratch_buf_size = 256*4096; options.no_hw = 0; options.use_signal_helper = 1; options.gpu_busy_load = 0; options.num_buffers = 0; options.trace_tile = -1; options.use_render = 1; options.use_blt = 1; options.forced_tiling = -1; options.use_cpu_maps = 0; options.total_rounds = 512; options.fail = 1; options.ducttape = 1; options.tile_size = 16; options.tiles_per_buf = options.scratch_buf_size / TILE_BYTES(options.tile_size); options.check_render_cpyfn = 0; while((c = getopt_long(argc, argv, "ds:g:c:t:rbuxmo:fp:", long_options, &option_index)) != -1) { switch(c) { case 'd': options.no_hw = 1; printf("no-hw debug mode\n"); break; case 'S': options.use_signal_helper = 0; printf("disabling that pesky nuisance who keeps interrupting us\n"); break; case 's': tmp = atoi(optarg); if (tmp < options.tile_size*8192) printf("scratch buffer size needs to be at least %i\n", options.tile_size*8192); else if (tmp & (tmp - 1)) { printf("scratch buffer size needs to be a power-of-two\n"); } else { printf("fixed scratch buffer size to %u\n", tmp); options.scratch_buf_size = tmp; sanitize_tiles_per_buf(); } break; case 'g': tmp = atoi(optarg); if (tmp < 0 || tmp > 10) printf("gpu busy load needs to be bigger than 0 and smaller than 10\n"); else { printf("gpu busy load factor set to %i\n", tmp); gpu_busy_load = options.gpu_busy_load = tmp; } break; case 'c': options.num_buffers = atoi(optarg); printf("buffer count set to %i\n", options.num_buffers); break; case 't': options.trace_tile = atoi(optarg); printf("tracing tile %i\n", options.trace_tile); break; case 'r': options.use_render = 0; printf("disabling render copy\n"); break; case 'b': options.use_blt = 0; printf("disabling blt copy\n"); break; case 'u': options.forced_tiling = I915_TILING_NONE; printf("disabling tiling\n"); break; case 'x': if (options.use_cpu_maps) { printf("tiling not possible with cpu maps\n"); } else { options.forced_tiling = I915_TILING_X; printf("using only X-tiling\n"); } break; case 'm': options.use_cpu_maps = 1; options.forced_tiling = I915_TILING_NONE; printf("disabling tiling\n"); break; case 'o': options.total_rounds = atoi(optarg); printf("total rounds %i\n", options.total_rounds); break; case 'f': options.fail = 0; printf("not failing when detecting errors\n"); break; case 'p': options.tiles_per_buf = atoi(optarg); printf("tiles per buffer %i\n", options.tiles_per_buf); break; case DUCTAPE: options.ducttape = 0; printf("applying duct-tape\n"); break; case TILESZ: options.tile_size = atoi(optarg); sanitize_tiles_per_buf(); printf("til size %i\n", options.tile_size); break; case CHCK_RENDER: options.check_render_cpyfn = 1; printf("checking render copy function\n"); break; default: printf("unkown command options\n"); break; } } if (optind < argc) printf("unkown command options\n"); /* actually 32767, according to docs, but that kills our nice pot calculations. */ options.max_dimension = 16*1024; if (options.use_render) { if (IS_GEN2(devid) || IS_GEN3(devid)) options.max_dimension = 2048; else options.max_dimension = 8192; } printf("Limiting buffer to %dx%d\n", options.max_dimension, options.max_dimension); } static void init(void) { int i; unsigned tmp; if (options.num_buffers == 0) { tmp = gem_aperture_size(drm_fd); tmp = tmp > 256*(1024*1024) ? 256*(1024*1024) : tmp; num_buffers = 2 * tmp / options.scratch_buf_size / 3; num_buffers /= 2; printf("using %u buffers\n", num_buffers); } else num_buffers = options.num_buffers; bufmgr = drm_intel_bufmgr_gem_init(drm_fd, 4096); drm_intel_bufmgr_gem_enable_reuse(bufmgr); drm_intel_bufmgr_gem_enable_fenced_relocs(bufmgr); num_fences = get_num_fences(); batch = intel_batchbuffer_alloc(bufmgr, devid); busy_bo = drm_intel_bo_alloc(bufmgr, "tiled bo", BUSY_BUF_SIZE, 4096); if (options.forced_tiling >= 0) gem_set_tiling(drm_fd, busy_bo->handle, options.forced_tiling, 4096); for (i = 0; i < num_buffers; i++) { init_buffer(&buffers[0][i], options.scratch_buf_size); init_buffer(&buffers[1][i], options.scratch_buf_size); num_total_tiles += buffers[0][i].num_tiles; } current_set = 0; /* just in case it helps reproducability */ srandom(0xdeadbeef); } static void check_render_copyfunc(void) { struct scratch_buf src, dst; uint32_t *ptr; int i, j, pass; if (!options.check_render_cpyfn) return; init_buffer(&src, options.scratch_buf_size); init_buffer(&dst, options.scratch_buf_size); for (pass = 0; pass < 16; pass++) { int sx = random() % (buf_width(&src)-options.tile_size); int sy = random() % (buf_height(&src)-options.tile_size); int dx = random() % (buf_width(&dst)-options.tile_size); int dy = random() % (buf_height(&dst)-options.tile_size); if (options.use_cpu_maps) set_to_cpu_domain(&src, 1); memset(src.data, 0xff, options.scratch_buf_size); for (j = 0; j < options.tile_size; j++) { ptr = (uint32_t*)((char *)src.data + sx*4 + (sy+j) * src.stride); for (i = 0; i < options.tile_size; i++) ptr[i] = j * options.tile_size + i; } render_copyfunc(&src, sx, sy, &dst, dx, dy, 0); if (options.use_cpu_maps) set_to_cpu_domain(&dst, 0); for (j = 0; j < options.tile_size; j++) { ptr = (uint32_t*)((char *)dst.data + dx*4 + (dy+j) * dst.stride); for (i = 0; i < options.tile_size; i++) if (ptr[i] != j * options.tile_size + i) { printf("render copyfunc mismatch at (%d, %d): found %d, expected %d\n", i, j, ptr[i], j*options.tile_size + i); } } } } int main(int argc, char **argv) { int i, j; unsigned *current_permutation, *tmp_permutation; drm_fd = drm_open_any(); devid = intel_get_drm_devid(drm_fd); parse_options(argc, argv); /* start our little helper early before too may allocations occur */ if (options.use_signal_helper) drmtest_fork_signal_helper(); init(); check_render_copyfunc(); tile_permutation = malloc(num_total_tiles*sizeof(uint32_t)); current_permutation = malloc(num_total_tiles*sizeof(uint32_t)); tmp_permutation = malloc(num_total_tiles*sizeof(uint32_t)); assert(tile_permutation); assert(current_permutation); assert(tmp_permutation); fan_out(); for (i = 0; i < options.total_rounds; i++) { printf("round %i\n", i); if (i % 64 == 63) { fan_in_and_check(); printf("everything correct after %i rounds\n", i + 1); } target_set = (current_set + 1) & 1; init_set(target_set); for (j = 0; j < num_total_tiles; j++) current_permutation[j] = j; drmtest_permute_array(current_permutation, num_total_tiles, exchange_uint); copy_tiles(current_permutation); memcpy(tmp_permutation, tile_permutation, sizeof(unsigned)*num_total_tiles); /* accumulate the permutations */ for (j = 0; j < num_total_tiles; j++) tile_permutation[j] = current_permutation[tmp_permutation[j]]; current_set = target_set; } fan_in_and_check(); fprintf(stderr, "num failed tiles %u, max incoherent bytes %zd\n", stats.num_failed, stats.max_failed_reads*sizeof(uint32_t)); intel_batchbuffer_free(batch); drm_intel_bufmgr_destroy(bufmgr); close(drm_fd); drmtest_stop_signal_helper(); return 0; } intel-gpu-tools-1.3/tests/gem_gtt_speed.c0000664000175100017510000001777711763656361015521 00000000000000/* * Copyright © 2010 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Eric Anholt * Chris Wilson * */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include "drm.h" #include "i915_drm.h" #include "drmtest.h" #define OBJECT_SIZE 16384 static double elapsed(const struct timeval *start, const struct timeval *end, int loop) { return (1e6*(end->tv_sec - start->tv_sec) + (end->tv_usec - start->tv_usec))/loop; } int main(int argc, char **argv) { struct timeval start, end; uint8_t *buf; uint32_t handle; int size = OBJECT_SIZE; int loop, i, tiling; int fd; if (argc > 1) size = atoi(argv[1]); if (size == 0) { fprintf(stderr, "Invalid object size specified\n"); return 1; } buf = malloc(size); memset(buf, 0, size); fd = drm_open_any(); handle = gem_create(fd, size); assert(handle); for (tiling = I915_TILING_NONE; tiling <= I915_TILING_Y; tiling++) { if (tiling != I915_TILING_NONE) { printf("\nSetting tiling mode to %s\n", tiling == I915_TILING_X ? "X" : "Y"); gem_set_tiling(fd, handle, tiling, 512); } if (tiling == I915_TILING_NONE) { gem_set_domain(fd, handle, I915_GEM_DOMAIN_CPU, I915_GEM_DOMAIN_CPU); { uint32_t *base = gem_mmap__cpu(fd, handle, size, PROT_READ | PROT_WRITE); volatile uint32_t *ptr = base; int x = 0; for (i = 0; i < size/sizeof(*ptr); i++) x += ptr[i]; /* force overtly clever gcc to actually compute x */ ptr[0] = x; munmap(base, size); /* mmap read */ gettimeofday(&start, NULL); for (loop = 0; loop < 1000; loop++) { base = gem_mmap__cpu(fd, handle, size, PROT_READ | PROT_WRITE); ptr = base; x = 0; for (i = 0; i < size/sizeof(*ptr); i++) x += ptr[i]; /* force overtly clever gcc to actually compute x */ ptr[0] = x; munmap(base, size); } gettimeofday(&end, NULL); printf("Time to read %dk through a CPU map: %7.3fµs\n", size/1024, elapsed(&start, &end, loop)); /* mmap write */ gettimeofday(&start, NULL); for (loop = 0; loop < 1000; loop++) { base = gem_mmap__cpu(fd, handle, size, PROT_READ | PROT_WRITE); ptr = base; for (i = 0; i < size/sizeof(*ptr); i++) ptr[i] = i; munmap(base, size); } gettimeofday(&end, NULL); printf("Time to write %dk through a CPU map: %7.3fµs\n", size/1024, elapsed(&start, &end, loop)); } /* CPU pwrite */ gettimeofday(&start, NULL); for (loop = 0; loop < 1000; loop++) gem_write(fd, handle, 0, buf, size); gettimeofday(&end, NULL); printf("Time to pwrite %dk through the CPU: %7.3fµs\n", size/1024, elapsed(&start, &end, loop)); /* CPU pread */ gettimeofday(&start, NULL); for (loop = 0; loop < 1000; loop++) gem_read(fd, handle, 0, buf, size); gettimeofday(&end, NULL); printf("Time to pread %dk through the CPU: %7.3fµs\n", size/1024, elapsed(&start, &end, loop)); } /* prefault into gtt */ { uint32_t *base = gem_mmap(fd, handle, size, PROT_READ | PROT_WRITE); volatile uint32_t *ptr = base; int x = 0; for (i = 0; i < size/sizeof(*ptr); i++) x += ptr[i]; /* force overtly clever gcc to actually compute x */ ptr[0] = x; munmap(base, size); } /* mmap read */ gettimeofday(&start, NULL); for (loop = 0; loop < 1000; loop++) { uint32_t *base = gem_mmap(fd, handle, size, PROT_READ | PROT_WRITE); volatile uint32_t *ptr = base; int x = 0; for (i = 0; i < size/sizeof(*ptr); i++) x += ptr[i]; /* force overtly clever gcc to actually compute x */ ptr[0] = x; munmap(base, size); } gettimeofday(&end, NULL); printf("Time to read %dk through a GTT map: %7.3fµs\n", size/1024, elapsed(&start, &end, loop)); /* mmap write */ gettimeofday(&start, NULL); for (loop = 0; loop < 1000; loop++) { uint32_t *base = gem_mmap(fd, handle, size, PROT_READ | PROT_WRITE); volatile uint32_t *ptr = base; for (i = 0; i < size/sizeof(*ptr); i++) ptr[i] = i; munmap(base, size); } gettimeofday(&end, NULL); printf("Time to write %dk through a GTT map: %7.3fµs\n", size/1024, elapsed(&start, &end, loop)); /* mmap read */ gettimeofday(&start, NULL); for (loop = 0; loop < 1000; loop++) { uint32_t *base = gem_mmap(fd, handle, size, PROT_READ | PROT_WRITE); volatile uint32_t *ptr = base; int x = 0; for (i = 0; i < size/sizeof(*ptr); i++) x += ptr[i]; /* force overtly clever gcc to actually compute x */ ptr[0] = x; munmap(base, size); } gettimeofday(&end, NULL); printf("Time to read %dk (again) through a GTT map: %7.3fµs\n", size/1024, elapsed(&start, &end, loop)); if (tiling == I915_TILING_NONE) { /* GTT pwrite */ gettimeofday(&start, NULL); for (loop = 0; loop < 1000; loop++) gem_write(fd, handle, 0, buf, size); gettimeofday(&end, NULL); printf("Time to pwrite %dk through the GTT: %7.3fµs\n", size/1024, elapsed(&start, &end, loop)); /* GTT pread */ gettimeofday(&start, NULL); for (loop = 0; loop < 1000; loop++) gem_read(fd, handle, 0, buf, size); gettimeofday(&end, NULL); printf("Time to pread %dk through the GTT: %7.3fµs\n", size/1024, elapsed(&start, &end, loop)); /* GTT pwrite, including clflush */ gettimeofday(&start, NULL); for (loop = 0; loop < 1000; loop++) { gem_write(fd, handle, 0, buf, size); gem_sync(fd, handle); } gettimeofday(&end, NULL); printf("Time to pwrite %dk through the GTT (clflush): %7.3fµs\n", size/1024, elapsed(&start, &end, loop)); /* GTT pread, including clflush */ gettimeofday(&start, NULL); for (loop = 0; loop < 1000; loop++) { gem_sync(fd, handle); gem_read(fd, handle, 0, buf, size); } gettimeofday(&end, NULL); printf("Time to pread %dk through the GTT (clflush): %7.3fµs\n", size/1024, elapsed(&start, &end, loop)); /* partial writes */ printf("Now partial writes.\n"); size /= 4; /* partial GTT pwrite, including clflush */ gettimeofday(&start, NULL); for (loop = 0; loop < 1000; loop++) { gem_write(fd, handle, 0, buf, size); gem_sync(fd, handle); } gettimeofday(&end, NULL); printf("Time to pwrite %dk through the GTT (clflush): %7.3fµs\n", size/1024, elapsed(&start, &end, loop)); /* partial GTT pread, including clflush */ gettimeofday(&start, NULL); for (loop = 0; loop < 1000; loop++) { gem_sync(fd, handle); gem_read(fd, handle, 0, buf, size); } gettimeofday(&end, NULL); printf("Time to pread %dk through the GTT (clflush): %7.3fµs\n", size/1024, elapsed(&start, &end, loop)); size *= 4; } } gem_close(fd, handle); close(fd); return 0; } intel-gpu-tools-1.3/tests/getclient.c0000664000175100017510000000377411566027747014662 00000000000000/* * Copyright © 2007 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Eric Anholt * */ #include #include #include "drmtest.h" /** * Checks DRM_IOCTL_GET_CLIENT. */ int main(int argc, char **argv) { int fd, ret; drm_client_t client; fd = drm_open_any(); /* Look for client index 0. This should exist whether we're operating * on an otherwise unused drm device, or the X Server is running on * the device. */ client.idx = 0; ret = ioctl(fd, DRM_IOCTL_GET_CLIENT, &client); assert(ret == 0); /* Look for some absurd client index and make sure it's invalid. * The DRM drivers currently always return data, so the user has * no real way to detect when the list has terminated. That's bad, * and this test is XFAIL as a result. */ client.idx = 0x7fffffff; ret = ioctl(fd, DRM_IOCTL_GET_CLIENT, &client); assert(ret == -1 && errno == EINVAL); close(fd); return 0; } intel-gpu-tools-1.3/tests/gem_flink.c0000664000175100017510000000623211706636070014616 00000000000000/* * Copyright © 2008 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Eric Anholt * */ #include #include #include #include #include #include #include #include #include #include "drm.h" #include "i915_drm.h" #include "drmtest.h" static void test_flink(int fd) { struct drm_i915_gem_create create; struct drm_gem_flink flink; struct drm_gem_open gem_open; int ret; printf("Testing flink and open.\n"); memset(&create, 0, sizeof(create)); create.size = 16 * 1024; ret = ioctl(fd, DRM_IOCTL_I915_GEM_CREATE, &create); assert(ret == 0); flink.handle = create.handle; ret = ioctl(fd, DRM_IOCTL_GEM_FLINK, &flink); assert(ret == 0); gem_open.name = flink.name; ret = ioctl(fd, DRM_IOCTL_GEM_OPEN, &gem_open); assert(ret == 0); assert(gem_open.handle != 0); } static void test_double_flink(int fd) { struct drm_i915_gem_create create; struct drm_gem_flink flink; struct drm_gem_flink flink2; int ret; printf("Testing repeated flink.\n"); memset(&create, 0, sizeof(create)); create.size = 16 * 1024; ret = ioctl(fd, DRM_IOCTL_I915_GEM_CREATE, &create); assert(ret == 0); flink.handle = create.handle; ret = ioctl(fd, DRM_IOCTL_GEM_FLINK, &flink); assert(ret == 0); flink2.handle = create.handle; ret = ioctl(fd, DRM_IOCTL_GEM_FLINK, &flink2); assert(ret == 0); assert(flink2.name == flink.name); } static void test_bad_flink(int fd) { struct drm_gem_flink flink; int ret; printf("Testing error return on bad flink ioctl.\n"); flink.handle = 0x10101010; ret = ioctl(fd, DRM_IOCTL_GEM_FLINK, &flink); assert(ret == -1 && errno == ENOENT); } static void test_bad_open(int fd) { struct drm_gem_open gem_open; int ret; printf("Testing error return on bad open ioctl.\n"); gem_open.name = 0x10101010; ret = ioctl(fd, DRM_IOCTL_GEM_OPEN, &gem_open); assert(ret == -1 && errno == ENOENT); } int main(int argc, char **argv) { int fd; fd = drm_open_any(); test_flink(fd); test_double_flink(fd); test_bad_flink(fd); test_bad_open(fd); return 0; } intel-gpu-tools-1.3/tests/gem_exec_bad_domains.c0000664000175100017510000000722411706636070016761 00000000000000/* * Copyright © 2011 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Daniel Vetter * */ #include #include #include #include #include #include #include #include #include #include "drm.h" #include "i915_drm.h" #include "drmtest.h" #include "intel_bufmgr.h" #include "intel_batchbuffer.h" #include "intel_gpu_tools.h" /* Testcase: Test whether the kernel rejects relocations with non-gpu domains * * If it does not, it'll oops somewhen later on because we don't expect that. */ static drm_intel_bufmgr *bufmgr; struct intel_batchbuffer *batch; #define BAD_GTT_DEST ((512*1024*1024)) /* past end of aperture */ static int run_batch(void) { unsigned int used = batch->ptr - batch->buffer; int ret; if (used == 0) return 0; /* Round batchbuffer usage to 2 DWORDs. */ if ((used & 4) == 0) { *(uint32_t *) (batch->ptr) = 0; /* noop */ batch->ptr += 4; } /* Mark the end of the buffer. */ *(uint32_t *)(batch->ptr) = MI_BATCH_BUFFER_END; /* noop */ batch->ptr += 4; used = batch->ptr - batch->buffer; ret = drm_intel_bo_subdata(batch->bo, 0, used, batch->buffer); assert(ret == 0); batch->ptr = NULL; ret = drm_intel_bo_mrb_exec(batch->bo, used, NULL, 0, 0, 0); intel_batchbuffer_reset(batch); return ret; } int main(int argc, char **argv) { int fd, ret; drm_intel_bo *tmp; fd = drm_open_any(); bufmgr = drm_intel_bufmgr_gem_init(fd, 4096); drm_intel_bufmgr_gem_enable_reuse(bufmgr); batch = intel_batchbuffer_alloc(bufmgr, intel_get_drm_devid(fd)); tmp = drm_intel_bo_alloc(bufmgr, "tmp", 128 * 128, 4096); BEGIN_BATCH(2); OUT_BATCH(0); OUT_RELOC(tmp, I915_GEM_DOMAIN_CPU, 0, 0); ADVANCE_BATCH(); ret = run_batch(); if (ret != -EINVAL) { fprintf(stderr, "(cpu, 0) reloc not rejected\n"); exit(1); } BEGIN_BATCH(2); OUT_BATCH(0); OUT_RELOC(tmp, I915_GEM_DOMAIN_CPU, I915_GEM_DOMAIN_CPU, 0); ADVANCE_BATCH(); ret = run_batch(); if (ret != -EINVAL) { fprintf(stderr, "(cpu, cpu) reloc not rejected\n"); exit(1); } BEGIN_BATCH(2); OUT_BATCH(0); OUT_RELOC(tmp, I915_GEM_DOMAIN_GTT, 0, 0); ADVANCE_BATCH(); ret = run_batch(); if (ret != -EINVAL) { fprintf(stderr, "(gtt, 0) reloc not rejected\n"); exit(1); } BEGIN_BATCH(2); OUT_BATCH(0); OUT_RELOC(tmp, I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT, 0); ADVANCE_BATCH(); ret = run_batch(); if (ret != -EINVAL) { fprintf(stderr, "(gtt, gtt) reloc not rejected\n"); exit(1); } intel_batchbuffer_free(batch); drm_intel_bufmgr_destroy(bufmgr); close(fd); return 0; } intel-gpu-tools-1.3/tests/gem_exec_blt.c0000664000175100017510000001441511772702746015311 00000000000000/* * Copyright © 2011 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Chris Wilson * */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include "drm.h" #include "i915_drm.h" #include "drmtest.h" #include "intel_chipset.h" #include "intel_gpu_tools.h" #define OBJECT_SIZE 16384 #define COPY_BLT_CMD (2<<29|0x53<<22|0x6) #define BLT_WRITE_ALPHA (1<<21) #define BLT_WRITE_RGB (1<<20) #define BLT_SRC_TILED (1<<15) #define BLT_DST_TILED (1<<11) static int gem_linear_blt(uint32_t *batch, uint32_t src, uint32_t dst, uint32_t length, struct drm_i915_gem_relocation_entry *reloc) { uint32_t *b = batch; int height = length / (16 * 1024); assert(height <= 1<<16); if (height) { b[0] = COPY_BLT_CMD | BLT_WRITE_ALPHA | BLT_WRITE_RGB; b[1] = 0xcc << 16 | 1 << 25 | 1 << 24 | (16*1024); b[2] = 0; b[3] = height << 16 | (4*1024); b[4] = 0; reloc->offset = (b-batch+4) * sizeof(uint32_t); reloc->delta = 0; reloc->target_handle = dst; reloc->read_domains = I915_GEM_DOMAIN_RENDER; reloc->write_domain = I915_GEM_DOMAIN_RENDER; reloc->presumed_offset = 0; reloc++; b[5] = 0; b[6] = 16*1024; b[7] = 0; reloc->offset = (b-batch+7) * sizeof(uint32_t); reloc->delta = 0; reloc->target_handle = src; reloc->read_domains = I915_GEM_DOMAIN_RENDER; reloc->write_domain = 0; reloc->presumed_offset = 0; reloc++; b += 8; length -= height * 16*1024; } if (length) { b[0] = COPY_BLT_CMD | BLT_WRITE_ALPHA | BLT_WRITE_RGB; b[1] = 0xcc << 16 | 1 << 25 | 1 << 24 | (16*1024); b[2] = height << 16; b[3] = (1+height) << 16 | (length / 4); b[4] = 0; reloc->offset = (b-batch+4) * sizeof(uint32_t); reloc->delta = 0; reloc->target_handle = dst; reloc->read_domains = I915_GEM_DOMAIN_RENDER; reloc->write_domain = I915_GEM_DOMAIN_RENDER; reloc->presumed_offset = 0; reloc++; b[5] = height << 16; b[6] = 16*1024; b[7] = 0; reloc->offset = (b-batch+7) * sizeof(uint32_t); reloc->delta = 0; reloc->target_handle = src; reloc->read_domains = I915_GEM_DOMAIN_RENDER; reloc->write_domain = 0; reloc->presumed_offset = 0; reloc++; b += 8; } b[0] = MI_BATCH_BUFFER_END; b[1] = 0; return (b+2 - batch) * sizeof(uint32_t); } static int gem_exec(int fd, struct drm_i915_gem_execbuffer2 *execbuf, int loops) { int ret = 0; while (loops-- && ret == 0) { ret = drmIoctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, execbuf); } return ret; } static double elapsed(const struct timeval *start, const struct timeval *end, int loop) { return (1e6*(end->tv_sec - start->tv_sec) + (end->tv_usec - start->tv_usec))/loop; } static const char *bytes_per_sec(char *buf, double v) { const char *order[] = { "", "KiB", "MiB", "GiB", "TiB", "PiB", NULL, }, **o = order; while (v > 1024 && o[1]) { v /= 1024; o++; } sprintf(buf, "%.1f%s/s", v, *o); return buf; } static void run(int object_size) { struct drm_i915_gem_execbuffer2 execbuf; struct drm_i915_gem_exec_object2 exec[3]; struct drm_i915_gem_relocation_entry reloc[4]; uint32_t buf[20]; uint32_t handle, src, dst; int fd, len, count; int ring; fd = drm_open_any(); handle = gem_create(fd, 4096); src = gem_create(fd, object_size); dst = gem_create(fd, object_size); len = gem_linear_blt(buf, src, dst, object_size, reloc); gem_write(fd, handle, 0, buf, len); exec[0].handle = src; exec[0].relocation_count = 0; exec[0].relocs_ptr = 0; exec[0].alignment = 0; exec[0].offset = 0; exec[0].flags = 0; exec[0].rsvd1 = 0; exec[0].rsvd2 = 0; exec[1].handle = dst; exec[1].relocation_count = 0; exec[1].relocs_ptr = 0; exec[1].alignment = 0; exec[1].offset = 0; exec[1].flags = 0; exec[1].rsvd1 = 0; exec[1].rsvd2 = 0; exec[2].handle = handle; exec[2].relocation_count = len > 40 ? 4 : 2; exec[2].relocs_ptr = (uintptr_t)reloc; exec[2].alignment = 0; exec[2].offset = 0; exec[2].flags = 0; exec[2].rsvd1 = 0; exec[2].rsvd2 = 0; ring = 0; if (HAS_BLT_RING(intel_get_drm_devid(fd))) ring = I915_EXEC_BLT; execbuf.buffers_ptr = (uintptr_t)exec; execbuf.buffer_count = 3; execbuf.batch_start_offset = 0; execbuf.batch_len = len; execbuf.cliprects_ptr = 0; execbuf.num_cliprects = 0; execbuf.DR1 = 0; execbuf.DR4 = 0; execbuf.flags = ring; i915_execbuffer2_set_context_id(execbuf, 0); execbuf.rsvd2 = 0; for (count = 1; count <= 1<<17; count <<= 1) { struct timeval start, end; gettimeofday(&start, NULL); if (gem_exec(fd, &execbuf, count)) exit(1); gem_sync(fd, handle); gettimeofday(&end, NULL); printf("Time to blt %d bytes x %6d: %7.3fµs, %s\n", object_size, count, elapsed(&start, &end, count), bytes_per_sec((char *)buf, object_size/elapsed(&start, &end, count)*1e6)); fflush(stdout); } gem_close(fd, handle); close(fd); } int main(int argc, char **argv) { int i; if (argc > 1) { for (i = 1; i < argc; i++) { int object_size = atoi(argv[i]); if (object_size) run((object_size + 3) & -4); } } else run(OBJECT_SIZE); return 0; } intel-gpu-tools-1.3/tests/debugfs_emon_crash0000775000175100017510000000053311766444522016265 00000000000000#!/bin/bash # # This check if we can crash the kernel with segmentation-fault # by reading /sys/kernel/debug/dri/0/i915_emon_status too quickly # SOURCE_DIR="$( dirname "${BASH_SOURCE[0]}" )" . $SOURCE_DIR/drm_lib.sh for z in $(seq 1 1000); do cat $i915_path/i915_emon_status > /dev/null 2&>1 done # If we got here, we haven't crashed exit 0 intel-gpu-tools-1.3/tests/gem_ring_sync_loop.c0000664000175100017510000000712411706636070016540 00000000000000/* * Copyright © 2011 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Daniel Vetter (based on gem_storedw_*.c) * */ #include #include #include #include #include #include #include #include #include #include "drm.h" #include "i915_drm.h" #include "drmtest.h" #include "intel_bufmgr.h" #include "intel_batchbuffer.h" #include "intel_gpu_tools.h" #include "i830_reg.h" static drm_intel_bufmgr *bufmgr; struct intel_batchbuffer *batch; static drm_intel_bo *target_buffer; /* * Testcase: Basic check of ring<->ring sync using a dummy reloc * * Extremely efficient at catching missed irqs with semaphores=0 ... */ #define MI_COND_BATCH_BUFFER_END (0x36<<23 | 1) #define MI_DO_COMPARE (1<<21) static void store_dword_loop(void) { int i; srandom(0xdeadbeef); for (i = 0; i < 0x100000; i++) { int ring = random() % 3 + 1; if (ring == I915_EXEC_RENDER) { BEGIN_BATCH(4); OUT_BATCH(MI_COND_BATCH_BUFFER_END | MI_DO_COMPARE); OUT_BATCH(0xffffffff); /* compare dword */ OUT_RELOC(target_buffer, I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER, 0); OUT_BATCH(MI_NOOP); ADVANCE_BATCH(); } else { BEGIN_BATCH(4); OUT_BATCH(MI_FLUSH_DW | 1); OUT_BATCH(0); /* reserved */ OUT_RELOC(target_buffer, I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER, 0); OUT_BATCH(MI_NOOP | (1<<22) | (0xf)); ADVANCE_BATCH(); } intel_batchbuffer_flush_on_ring(batch, ring); } drm_intel_bo_map(target_buffer, 0); // map to force waiting on rendering drm_intel_bo_unmap(target_buffer); } int main(int argc, char **argv) { int fd; int devid; if (argc != 1) { fprintf(stderr, "usage: %s\n", argv[0]); exit(-1); } fd = drm_open_any(); devid = intel_get_drm_devid(fd); if (!HAS_BLT_RING(devid)) { fprintf(stderr, "inter ring check needs gen6+\n"); return 77; } bufmgr = drm_intel_bufmgr_gem_init(fd, 4096); if (!bufmgr) { fprintf(stderr, "failed to init libdrm\n"); exit(-1); } drm_intel_bufmgr_gem_enable_reuse(bufmgr); batch = intel_batchbuffer_alloc(bufmgr, devid); if (!batch) { fprintf(stderr, "failed to create batch buffer\n"); exit(-1); } target_buffer = drm_intel_bo_alloc(bufmgr, "target bo", 4096, 4096); if (!target_buffer) { fprintf(stderr, "failed to alloc target buffer\n"); exit(-1); } store_dword_loop(); drm_intel_bo_unreference(target_buffer); intel_batchbuffer_free(batch); drm_intel_bufmgr_destroy(bufmgr); close(fd); return 0; } intel-gpu-tools-1.3/tests/gem_tiled_partial_pwrite_pread.c0000664000175100017510000001712111731574443021077 00000000000000/* * Copyright © 2011 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Daniel Vetter * */ #include #include #include #include #include #include #include #include #include #include "drm.h" #include "i915_drm.h" #include "drmtest.h" #include "intel_bufmgr.h" #include "intel_batchbuffer.h" #include "intel_gpu_tools.h" /* * Testcase: pwrite/pread consistency when touching partial cachelines * * Some fancy new pwrite/pread optimizations clflush in-line while * reading/writing. Check whether all required clflushes happen. * * Unfortunately really old mesa used unaligned pread/pwrite for s/w fallback * rendering, so we need to check whether this works on tiled buffers, too. * */ static drm_intel_bufmgr *bufmgr; struct intel_batchbuffer *batch; drm_intel_bo *scratch_bo; drm_intel_bo *staging_bo; drm_intel_bo *tiled_staging_bo; unsigned long scratch_pitch; #define BO_SIZE (32*4096) uint32_t devid; uint64_t mappable_gtt_limit; int fd; static void copy_bo(drm_intel_bo *src, int src_tiled, drm_intel_bo *dst, int dst_tiled) { unsigned long dst_pitch = scratch_pitch; unsigned long src_pitch = scratch_pitch; uint32_t cmd_bits = 0; /* dst is tiled ... */ if (intel_gen(devid) >= 4 && dst_tiled) { dst_pitch /= 4; cmd_bits |= XY_SRC_COPY_BLT_DST_TILED; } if (intel_gen(devid) >= 4 && dst_tiled) { src_pitch /= 4; cmd_bits |= XY_SRC_COPY_BLT_SRC_TILED; } BEGIN_BATCH(8); OUT_BATCH(XY_SRC_COPY_BLT_CMD | XY_SRC_COPY_BLT_WRITE_ALPHA | XY_SRC_COPY_BLT_WRITE_RGB | cmd_bits); OUT_BATCH((3 << 24) | /* 32 bits */ (0xcc << 16) | /* copy ROP */ dst_pitch); OUT_BATCH(0 << 16 | 0); OUT_BATCH(BO_SIZE/scratch_pitch << 16 | 1024); OUT_RELOC_FENCED(dst, I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER, 0); OUT_BATCH(0 << 16 | 0); OUT_BATCH(src_pitch); OUT_RELOC_FENCED(src, I915_GEM_DOMAIN_RENDER, 0, 0); ADVANCE_BATCH(); intel_batchbuffer_flush(batch); } static void blt_bo_fill(drm_intel_bo *tmp_bo, drm_intel_bo *bo, int val) { uint8_t *gtt_ptr; int i; drm_intel_gem_bo_map_gtt(tmp_bo); gtt_ptr = tmp_bo->virtual; for (i = 0; i < BO_SIZE; i++) gtt_ptr[i] = val; drm_intel_gem_bo_unmap_gtt(tmp_bo); if (bo->offset < mappable_gtt_limit && (IS_G33(devid) || intel_gen(devid) >= 4)) drmtest_trash_aperture(); copy_bo(tmp_bo, 0, bo, 1); } #define MAX_BLT_SIZE 128 #define ROUNDS 200 int main(int argc, char **argv) { int i, j; uint8_t tmp[BO_SIZE]; uint8_t compare_tmp[BO_SIZE]; uint32_t tiling_mode = I915_TILING_X; srandom(0xdeadbeef); fd = drm_open_any(); bufmgr = drm_intel_bufmgr_gem_init(fd, 4096); //drm_intel_bufmgr_gem_enable_reuse(bufmgr); devid = intel_get_drm_devid(fd); batch = intel_batchbuffer_alloc(bufmgr, devid); /* overallocate the buffers we're actually using because */ scratch_bo = drm_intel_bo_alloc_tiled(bufmgr, "scratch bo", 1024, BO_SIZE/4096, 4, &tiling_mode, &scratch_pitch, 0); assert(tiling_mode == I915_TILING_X); assert(scratch_pitch == 4096); staging_bo = drm_intel_bo_alloc(bufmgr, "staging bo", BO_SIZE, 4096); tiled_staging_bo = drm_intel_bo_alloc_tiled(bufmgr, "scratch bo", 1024, BO_SIZE/4096, 4, &tiling_mode, &scratch_pitch, 0); drmtest_init_aperture_trashers(bufmgr); mappable_gtt_limit = gem_mappable_aperture_size(); printf("checking partial reads\n"); for (i = 0; i < ROUNDS; i++) { int start, len; int val = i % 256; blt_bo_fill(staging_bo, scratch_bo, i); start = random() % BO_SIZE; len = random() % (BO_SIZE-start) + 1; drm_intel_bo_get_subdata(scratch_bo, start, len, tmp); for (j = 0; j < len; j++) { if (tmp[j] != val) { printf("mismatch at %i, got: %i, expected: %i\n", start + j, tmp[j], val); exit(1); } } drmtest_progress("partial reads test: ", i, ROUNDS); } printf("checking partial writes\n"); for (i = 0; i < ROUNDS; i++) { int start, len; int val = i % 256; blt_bo_fill(staging_bo, scratch_bo, i); start = random() % BO_SIZE; len = random() % (BO_SIZE-start) + 1; memset(tmp, i + 63, BO_SIZE); drm_intel_bo_subdata(scratch_bo, start, len, tmp); copy_bo(scratch_bo, 1, tiled_staging_bo, 1); drm_intel_bo_get_subdata(tiled_staging_bo, 0, BO_SIZE, compare_tmp); for (j = 0; j < start; j++) { if (compare_tmp[j] != val) { printf("amismatch at %i, got: %i, expected: %i\n", j, tmp[j], val); exit(1); } } for (; j < start + len; j++) { if (compare_tmp[j] != tmp[0]) { printf("bmismatch at %i, got: %i, expected: %i\n", j, tmp[j], i); exit(1); } } for (; j < BO_SIZE; j++) { if (compare_tmp[j] != val) { printf("cmismatch at %i, got: %i, expected: %i\n", j, tmp[j], val); exit(1); } } drm_intel_gem_bo_unmap_gtt(staging_bo); drmtest_progress("partial writes test: ", i, ROUNDS); } printf("checking partial writes after partial reads\n"); for (i = 0; i < ROUNDS; i++) { int start, len; int val = i % 256; blt_bo_fill(staging_bo, scratch_bo, i); /* partial read */ start = random() % BO_SIZE; len = random() % (BO_SIZE-start) + 1; drm_intel_bo_get_subdata(scratch_bo, start, len, tmp); for (j = 0; j < len; j++) { if (tmp[j] != val) { printf("mismatch in read at %i, got: %i, expected: %i\n", start + j, tmp[j], val); exit(1); } } /* Change contents through gtt to make the pread cachelines * stale. */ val = (i + 17) % 256; blt_bo_fill(staging_bo, scratch_bo, val); /* partial write */ start = random() % BO_SIZE; len = random() % (BO_SIZE-start) + 1; memset(tmp, i + 63, BO_SIZE); drm_intel_bo_subdata(scratch_bo, start, len, tmp); copy_bo(scratch_bo, 1, tiled_staging_bo, 1); drm_intel_bo_get_subdata(tiled_staging_bo, 0, BO_SIZE, compare_tmp); for (j = 0; j < start; j++) { if (compare_tmp[j] != val) { printf("mismatch at %i, got: %i, expected: %i\n", j, tmp[j], val); exit(1); } } for (; j < start + len; j++) { if (compare_tmp[j] != tmp[0]) { printf("mismatch at %i, got: %i, expected: %i\n", j, tmp[j], tmp[0]); exit(1); } } for (; j < BO_SIZE; j++) { if (compare_tmp[j] != val) { printf("mismatch at %i, got: %i, expected: %i\n", j, tmp[j], val); exit(1); } } drm_intel_gem_bo_unmap_gtt(staging_bo); drmtest_progress("partial read/writes test: ", i, ROUNDS); } drmtest_cleanup_aperture_trashers(); drm_intel_bufmgr_destroy(bufmgr); close(fd); return 0; } intel-gpu-tools-1.3/tests/gem_mmap.c0000664000175100017510000000542211763656361014455 00000000000000/* * Copyright © 2008 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Eric Anholt * */ #include #include #include #include #include #include #include #include #include #include #include #include "drm.h" #include "i915_drm.h" #include "drmtest.h" #define OBJECT_SIZE 16384 int main(int argc, char **argv) { int fd; struct drm_i915_gem_mmap arg; uint8_t expected[OBJECT_SIZE]; uint8_t buf[OBJECT_SIZE]; uint8_t *addr; int ret; int handle; fd = drm_open_any(); memset(&arg, 0, sizeof(arg)); arg.handle = 0x10101010; arg.offset = 0; arg.size = 4096; printf("Testing mmaping of bad object.\n"); ret = ioctl(fd, DRM_IOCTL_I915_GEM_MMAP, &arg); assert(ret == -1 && errno == ENOENT); handle = gem_create(fd, OBJECT_SIZE); printf("Testing mmaping of newly created object.\n"); arg.handle = handle; arg.offset = 0; arg.size = OBJECT_SIZE; ret = ioctl(fd, DRM_IOCTL_I915_GEM_MMAP, &arg); assert(ret == 0); addr = (uint8_t *)(uintptr_t)arg.addr_ptr; printf("Testing contents of newly created object.\n"); memset(expected, 0, sizeof(expected)); assert(memcmp(addr, expected, sizeof(expected)) == 0); printf("Testing coherency of writes and mmap reads.\n"); memset(buf, 0, sizeof(buf)); memset(buf + 1024, 0x01, 1024); memset(expected + 1024, 0x01, 1024); gem_write(fd, handle, 0, buf, OBJECT_SIZE); assert(memcmp(buf, addr, sizeof(buf)) == 0); printf("Testing that mapping stays after close\n"); gem_close(fd, handle); assert(memcmp(buf, addr, sizeof(buf)) == 0); printf("Testing unmapping\n"); munmap(addr, OBJECT_SIZE); close(fd); return 0; } intel-gpu-tools-1.3/tests/drm_vma_limiter_cached.c0000664000175100017510000001005411706636070017321 00000000000000/* * Copyright © 2011 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Daniel Vetter */ #include #include #include #include #include #include #include #include #include #include "drm.h" #include "i915_drm.h" #include "drmtest.h" #include "intel_bufmgr.h" #include "intel_batchbuffer.h" #include "intel_gpu_tools.h" static drm_intel_bufmgr *bufmgr; struct intel_batchbuffer *batch; /* Testcase: check whether the libdrm vma limiter works * * We've had reports of the X server exhausting the default rlimit of 64k vma's * in the kernel. libdrm has grown facilities to limit the vma caching since, * this checks whether they actually work. * * This one checks whether mmaps of unused cached bos are also properly reaped. */ /* we do both cpu and gtt maps, so only need half of 64k to exhaust */ int main(int argc, char **argv) { int fd; int i; char *ptr; drm_intel_bo *load_bo; fd = drm_open_any(); bufmgr = drm_intel_bufmgr_gem_init(fd, 4096); drm_intel_bufmgr_gem_enable_reuse(bufmgr); batch = intel_batchbuffer_alloc(bufmgr, intel_get_drm_devid(fd)); load_bo = drm_intel_bo_alloc(bufmgr, "target bo", 1024*4096, 4096); assert(load_bo); drm_intel_bufmgr_gem_set_vma_cache_size(bufmgr, 500); /* IMPORTANT: we need to enable buffer reuse, otherwise we won't test * the libdrm bo cache! */ drm_intel_bufmgr_gem_enable_reuse(bufmgr); /* put some load onto the gpu to keep the light buffers active for long * enough */ for (i = 0; i < 10000; i++) { BEGIN_BATCH(8); OUT_BATCH(XY_SRC_COPY_BLT_CMD | XY_SRC_COPY_BLT_WRITE_ALPHA | XY_SRC_COPY_BLT_WRITE_RGB); OUT_BATCH((3 << 24) | /* 32 bits */ (0xcc << 16) | /* copy ROP */ 4096); OUT_BATCH(0); /* dst x1,y1 */ OUT_BATCH((1024 << 16) | 512); OUT_RELOC(load_bo, I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER, 0); OUT_BATCH((0 << 16) | 512); /* src x1, y1 */ OUT_BATCH(4096); OUT_RELOC(load_bo, I915_GEM_DOMAIN_RENDER, 0, 0); ADVANCE_BATCH(); } #define GROUP_SZ 100 for (i = 0; i < 68000; ) { int j; drm_intel_bo *bo[GROUP_SZ]; for (j = 0; j < GROUP_SZ; j++, i++) { bo[j] = drm_intel_bo_alloc(bufmgr, "mmap bo", 4096, 4096); assert(bo[j]); drm_intel_gem_bo_map_gtt(bo[j]); ptr = bo[j]->virtual; assert(ptr); *ptr = 'c'; drm_intel_gem_bo_unmap_gtt(bo[j]); /* put it onto the active list ... */ BEGIN_BATCH(6); OUT_BATCH(XY_COLOR_BLT_CMD | XY_COLOR_BLT_WRITE_ALPHA | XY_COLOR_BLT_WRITE_RGB); OUT_BATCH((3 << 24) | /* 32 bits */ 128); OUT_BATCH(0); /* dst x1,y1 */ OUT_BATCH((1 << 16) | 1); OUT_RELOC(bo[j], I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER, 0); OUT_BATCH(0xffffffff); /* color */ ADVANCE_BATCH(); } intel_batchbuffer_flush(batch); for (j = 0; j < GROUP_SZ; j++) drm_intel_bo_unreference(bo[j]); } intel_batchbuffer_free(batch); drm_intel_bufmgr_destroy(bufmgr); close(fd); return 0; } intel-gpu-tools-1.3/tests/gem_gtt_concurrent_blit.c0000664000175100017510000001023712004013767017557 00000000000000/* * Copyright © 2009,2012 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Eric Anholt * Chris Wilson * */ /** @file gem_cpu_concurrent_blit.c * * This is a test of GTT mmap read/write behavior when writing to active * buffers. */ #include #include #include #include #include #include #include #include #include #include "drm.h" #include "i915_drm.h" #include "drmtest.h" #include "intel_bufmgr.h" #include "intel_batchbuffer.h" #include "intel_gpu_tools.h" static void set_bo(drm_intel_bo *bo, uint32_t val, int width, int height) { int size = width * height; uint32_t *vaddr; drm_intel_gem_bo_start_gtt_access(bo, true); vaddr = bo->virtual; while (size--) *vaddr++ = val; } static void cmp_bo(drm_intel_bo *bo, uint32_t val, int width, int height) { int size = width * height; uint32_t *vaddr; drm_intel_gem_bo_start_gtt_access(bo, false); vaddr = bo->virtual; while (size--) assert(*vaddr++ == val); } static drm_intel_bo * create_bo(drm_intel_bufmgr *bufmgr, uint32_t val, int width, int height) { drm_intel_bo *bo; bo = drm_intel_bo_alloc(bufmgr, "bo", 4*width*height, 0); assert(bo); /* gtt map doesn't have a write parameter, so just keep the mapping * around (to avoid the set_domain with the gtt write domain set) and * manually tell the kernel when we start access the gtt. */ drm_intel_gem_bo_map_gtt(bo); set_bo(bo, val, width, height); return bo; } int main(int argc, char **argv) { drm_intel_bufmgr *bufmgr; struct intel_batchbuffer *batch; int num_buffers = 128, max; drm_intel_bo *src[128], *dst[128], *dummy; int width = 512, height = 512; int fd; int i; fd = drm_open_any(); max = gem_aperture_size (fd) / (1024 * 1024) / 2; if (num_buffers > max) num_buffers = max; bufmgr = drm_intel_bufmgr_gem_init(fd, 4096); drm_intel_bufmgr_gem_enable_reuse(bufmgr); batch = intel_batchbuffer_alloc(bufmgr, intel_get_drm_devid(fd)); for (i = 0; i < num_buffers; i++) { src[i] = create_bo(bufmgr, i, width, height); dst[i] = create_bo(bufmgr, ~i, width, height); } dummy = create_bo(bufmgr, 0, width, height); /* try to overwrite the source values */ for (i = 0; i < num_buffers; i++) intel_copy_bo(batch, dst[i], src[i], width, height); for (i = num_buffers; i--; ) set_bo(src[i], 0xdeadbeef, width, height); for (i = 0; i < num_buffers; i++) cmp_bo(dst[i], i, width, height); /* try to read the results before the copy completes */ for (i = 0; i < num_buffers; i++) intel_copy_bo(batch, dst[i], src[i], width, height); for (i = num_buffers; i--; ) cmp_bo(dst[i], 0xdeadbeef, width, height); /* and finally try to trick the kernel into loosing the pending write */ for (i = num_buffers; i--; ) set_bo(src[i], 0xabcdabcd, width, height); for (i = 0; i < num_buffers; i++) intel_copy_bo(batch, dst[i], src[i], width, height); for (i = num_buffers; i--; ) intel_copy_bo(batch, dummy, dst[i], width, height); for (i = num_buffers; i--; ) cmp_bo(dst[i], 0xabcdabcd, width, height); return 0; } intel-gpu-tools-1.3/tests/gem_set_tiling_vs_gtt.c0000664000175100017510000000771011743466312017245 00000000000000/* * Copyright © 2012 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Daniel Vetter * */ #include #include #include #include #include #include #include #include #include #include #include #include "drm.h" #include "i915_drm.h" #include "drmtest.h" #include "intel_gpu_tools.h" #define OBJECT_SIZE (1024*1024) #define TEST_STRIDE (1024*4) /** * Testcase: Check set_tiling vs gtt mmap coherency */ int main(int argc, char **argv) { int fd; uint32_t *ptr; uint32_t data[OBJECT_SIZE/4]; int i; uint32_t handle; bool tiling_changed; int tile_height; fd = drm_open_any(); if (IS_GEN2(intel_get_drm_devid(fd))) tile_height = 16; else tile_height = 8; handle = gem_create(fd, OBJECT_SIZE); ptr = gem_mmap(fd, handle, OBJECT_SIZE, PROT_READ | PROT_WRITE); assert(ptr); /* gtt coherency is done with set_domain in libdrm, don't break that */ gem_set_domain(fd, handle, I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT); for (i = 0; i < OBJECT_SIZE/4; i++) ptr[i] = data[i] = i; gem_set_tiling(fd, handle, I915_TILING_X, TEST_STRIDE); printf("testing untiled->tiled\n"); tiling_changed = false; gem_set_domain(fd, handle, I915_GEM_DOMAIN_GTT, 0); /* Too lazy to check for the correct tiling, and impossible anyway on * bit17 swizzling machines. */ for (i = 0; i < OBJECT_SIZE/4; i++) if (ptr[i] != data[i]) tiling_changed = true; assert(tiling_changed); gem_set_domain(fd, handle, I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT); for (i = 0; i < OBJECT_SIZE/4; i++) ptr[i] = data[i] = i; gem_set_tiling(fd, handle, I915_TILING_X, TEST_STRIDE*2); printf("testing tiled->tiled\n"); gem_set_domain(fd, handle, I915_GEM_DOMAIN_GTT, 0); for (i = 0; i < OBJECT_SIZE/4; i++) { int tile_row = i / (TEST_STRIDE * tile_height / 4); int row = i / (TEST_STRIDE * 2 / 4); int half = i & (TEST_STRIDE / 4); int ofs = i % (TEST_STRIDE / 4); int data_i = (tile_row/2)*(TEST_STRIDE * tile_height / 4) + row*TEST_STRIDE/4 + half*tile_height + ofs; uint32_t val = data[data_i]; if (ptr[i] != val) { printf("mismatch at %i, row=%i, half=%i, ofs=%i\n", i, row, half, ofs); printf("read: 0x%08x, expected: 0x%08x\n", ptr[i], val); assert(0); } } gem_set_domain(fd, handle, I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT); for (i = 0; i < OBJECT_SIZE/4; i++) ptr[i] = data[i] = i; gem_set_tiling(fd, handle, I915_TILING_NONE, 0); printf("testing tiled->untiled\n"); tiling_changed = false; gem_set_domain(fd, handle, I915_GEM_DOMAIN_GTT, 0); /* Too lazy to check for the correct tiling, and impossible anyway on * bit17 swizzling machines. */ for (i = 0; i < OBJECT_SIZE/4; i++) if (ptr[i] != data[i]) tiling_changed = true; assert(tiling_changed); munmap(ptr, OBJECT_SIZE); close(fd); return 0; } intel-gpu-tools-1.3/tests/gem_bad_blit.c0000664000175100017510000000667111566027747015273 00000000000000/* * Copyright © 2009 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Eric Anholt * */ /** @file gem_tiled_blits.c * * This is a test of doing many tiled blits, with a working set * larger than the aperture size. * * The goal is to catch a couple types of failure; * - Fence management problems on pre-965. * - A17 or L-shaped memory tiling workaround problems in acceleration. * * The model is to fill a collection of 1MB objects in a way that can't trip * over A6 swizzling -- upload data to a non-tiled object, blit to the tiled * object. Then, copy the 1MB objects randomly between each other for a while. * Finally, download their data through linear objects again and see what * resulted. */ #include #include #include #include #include #include #include #include #include #include "drm.h" #include "i915_drm.h" #include "drmtest.h" #include "intel_bufmgr.h" #include "intel_batchbuffer.h" #include "intel_gpu_tools.h" static drm_intel_bufmgr *bufmgr; struct intel_batchbuffer *batch; #define BAD_GTT_DEST ((256*1024*1024)) /* past end of aperture */ static void bad_blit(drm_intel_bo *src_bo, uint32_t devid) { uint32_t src_pitch = 512, dst_pitch = 512; uint32_t cmd_bits = 0; if (IS_965(devid)) { src_pitch /= 4; cmd_bits |= XY_SRC_COPY_BLT_SRC_TILED; } if (IS_965(devid)) { dst_pitch /= 4; cmd_bits |= XY_SRC_COPY_BLT_DST_TILED; } BEGIN_BATCH(8); OUT_BATCH(XY_SRC_COPY_BLT_CMD | XY_SRC_COPY_BLT_WRITE_ALPHA | XY_SRC_COPY_BLT_WRITE_RGB | cmd_bits); OUT_BATCH((3 << 24) | /* 32 bits */ (0xcc << 16) | /* copy ROP */ dst_pitch); OUT_BATCH(0); /* dst x1,y1 */ OUT_BATCH((64 << 16) | 64); /* 64x64 blit */ OUT_BATCH(BAD_GTT_DEST); OUT_BATCH(0); /* src x1,y1 */ OUT_BATCH(src_pitch); OUT_RELOC(src_bo, I915_GEM_DOMAIN_RENDER, 0, 0); ADVANCE_BATCH(); intel_batchbuffer_flush(batch); } int main(int argc, char **argv) { drm_intel_bo *src; int fd; fd = drm_open_any(); bufmgr = drm_intel_bufmgr_gem_init(fd, 4096); drm_intel_bufmgr_gem_enable_reuse(bufmgr); batch = intel_batchbuffer_alloc(bufmgr, intel_get_drm_devid(fd)); src = drm_intel_bo_alloc(bufmgr, "src", 128 * 128, 4096); bad_blit(src, batch->devid); intel_batchbuffer_free(batch); drm_intel_bufmgr_destroy(bufmgr); close(fd); return 0; } intel-gpu-tools-1.3/tests/gem_bad_address.c0000664000175100017510000000440411566027747015756 00000000000000/* * Copyright © 2009 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Eric Anholt * Jesse Barnes (based on gem_bad_blit.c) * */ #include #include #include #include #include #include #include #include #include #include "drm.h" #include "i915_drm.h" #include "drmtest.h" #include "intel_bufmgr.h" #include "intel_batchbuffer.h" #include "intel_gpu_tools.h" static drm_intel_bufmgr *bufmgr; struct intel_batchbuffer *batch; #define BAD_GTT_DEST ((512*1024*1024)) /* past end of aperture */ static void bad_store(void) { BEGIN_BATCH(4); OUT_BATCH(MI_STORE_DWORD_IMM | MI_MEM_VIRTUAL | 1 << 21); OUT_BATCH(0); OUT_BATCH(BAD_GTT_DEST); OUT_BATCH(0xdeadbeef); ADVANCE_BATCH(); intel_batchbuffer_flush(batch); } int main(int argc, char **argv) { int fd; fd = drm_open_any(); bufmgr = drm_intel_bufmgr_gem_init(fd, 4096); drm_intel_bufmgr_gem_enable_reuse(bufmgr); batch = intel_batchbuffer_alloc(bufmgr, intel_get_drm_devid(fd)); bad_store(); intel_batchbuffer_free(batch); drm_intel_bufmgr_destroy(bufmgr); close(fd); return 0; } intel-gpu-tools-1.3/tests/gem_ctx_exec.c0000664000175100017510000000727611772702746015335 00000000000000/* * Copyright © 2012 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Ben Widawsky * */ /* * This test covers basic context switch functionality */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include "drm.h" #include "i915_drm.h" #include "drmtest.h" struct local_drm_i915_gem_context_create { __u32 ctx_id; __u32 pad; }; struct local_drm_i915_gem_context_destroy { __u32 ctx_id; __u32 pad; }; #define CONTEXT_CREATE_IOCTL DRM_IOWR(DRM_COMMAND_BASE + 0x2d, struct local_drm_i915_gem_context_create) #define CONTEXT_DESTROY_IOCTL DRM_IOWR(DRM_COMMAND_BASE + 0x23, struct local_drm_i915_gem_context_destroy) static uint32_t context_create(int fd) { struct local_drm_i915_gem_context_create create; int ret; ret = drmIoctl(fd, CONTEXT_CREATE_IOCTL, &create); if (ret == -1 && (errno == ENODEV || errno == EINVAL)) exit(77); else if (ret) abort(); return create.ctx_id; } static void context_destroy(int fd, uint32_t ctx_id) { struct local_drm_i915_gem_context_destroy destroy; destroy.ctx_id = ctx_id; do_ioctl(fd, CONTEXT_DESTROY_IOCTL, &destroy); } /* Copied from gem_exec_nop.c */ static int exec(int fd, uint32_t handle, int ring, int ctx_id) { struct drm_i915_gem_execbuffer2 execbuf; struct drm_i915_gem_exec_object2 gem_exec; int ret = 0; gem_exec.handle = handle; gem_exec.relocation_count = 0; gem_exec.relocs_ptr = 0; gem_exec.alignment = 0; gem_exec.offset = 0; gem_exec.flags = 0; gem_exec.rsvd1 = 0; gem_exec.rsvd2 = 0; execbuf.buffers_ptr = (uintptr_t)&gem_exec; execbuf.buffer_count = 1; execbuf.batch_start_offset = 0; execbuf.batch_len = 8; execbuf.cliprects_ptr = 0; execbuf.num_cliprects = 0; execbuf.DR1 = 0; execbuf.DR4 = 0; execbuf.flags = ring; i915_execbuffer2_set_context_id(execbuf, ctx_id); execbuf.rsvd2 = 0; ret = drmIoctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, &execbuf); gem_sync(fd, handle); return ret; } #define MI_BATCH_BUFFER_END (0xA<<23) int main(int argc, char *argv[]) { uint32_t handle; uint32_t batch[2] = {0, MI_BATCH_BUFFER_END}; uint32_t ctx_id; int fd; fd = drm_open_any(); ctx_id = context_create(fd); handle = gem_create(fd, 4096); gem_write(fd, handle, 0, batch, sizeof(batch)); assert(exec(fd, handle, I915_EXEC_RENDER, ctx_id) == 0); context_destroy(fd, ctx_id); ctx_id = context_create(fd); assert(exec(fd, handle, I915_EXEC_RENDER, ctx_id) == 0); context_destroy(fd, ctx_id); exit(EXIT_SUCCESS); } intel-gpu-tools-1.3/tests/gem_ctx_bad_exec.c0000664000175100017510000000650711772702746016137 00000000000000/* * Copyright © 2012 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Ben Widawsky * */ /* * Negative test cases: * test we can't submit contexts to unsupported rings */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include "drm.h" #include "i915_drm.h" #include "drmtest.h" struct local_drm_i915_gem_context_create { __u32 ctx_id; __u32 pad; }; #define CONTEXT_CREATE_IOCTL DRM_IOWR(DRM_COMMAND_BASE + 0x2d, struct local_drm_i915_gem_context_create) static uint32_t context_create(int fd) { struct local_drm_i915_gem_context_create create; int ret; ret = drmIoctl(fd, CONTEXT_CREATE_IOCTL, &create); if (ret == -1 && (errno == ENODEV || errno == EINVAL)) { exit(77); } else if (ret) { abort(); } return create.ctx_id; } /* Copied from gem_exec_nop.c */ static int exec(int fd, uint32_t handle, int ring, int ctx_id) { struct drm_i915_gem_execbuffer2 execbuf; struct drm_i915_gem_exec_object2 gem_exec; int ret = 0; gem_exec.handle = handle; gem_exec.relocation_count = 0; gem_exec.relocs_ptr = 0; gem_exec.alignment = 0; gem_exec.offset = 0; gem_exec.flags = 0; gem_exec.rsvd1 = 0; gem_exec.rsvd2 = 0; execbuf.buffers_ptr = (uintptr_t)&gem_exec; execbuf.buffer_count = 1; execbuf.batch_start_offset = 0; execbuf.batch_len = 8; execbuf.cliprects_ptr = 0; execbuf.num_cliprects = 0; execbuf.DR1 = 0; execbuf.DR4 = 0; execbuf.flags = ring; i915_execbuffer2_set_context_id(execbuf, ctx_id); execbuf.rsvd2 = 0; ret = drmIoctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, &execbuf); gem_sync(fd, handle); return ret; } #define MI_BATCH_BUFFER_END (0xA<<23) int main(int argc, char *argv[]) { uint32_t handle; uint32_t batch[2] = {MI_BATCH_BUFFER_END}; uint32_t ctx_id; int fd; fd = drm_open_any(); ctx_id = context_create(fd); handle = gem_create(fd, 4096); gem_write(fd, handle, 0, batch, sizeof(batch)); assert(exec(fd, handle, I915_EXEC_RENDER, ctx_id) == 0); assert(exec(fd, handle, I915_EXEC_BSD, ctx_id) != 0); assert(exec(fd, handle, I915_EXEC_BLT, ctx_id) != 0); exit(EXIT_SUCCESS); } intel-gpu-tools-1.3/tests/gem_set_tiling_vs_pwrite.c0000664000175100017510000000550711743466312017763 00000000000000/* * Copyright © 2012 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Daniel Vetter * */ #include #include #include #include #include #include #include #include #include #include #include #include "drm.h" #include "i915_drm.h" #include "drmtest.h" #include "intel_gpu_tools.h" #define OBJECT_SIZE (1024*1024) #define TEST_STRIDE (1024*4) /** * Testcase: Check set_tiling vs pwrite coherency */ int main(int argc, char **argv) { int fd; uint32_t *ptr; uint32_t data[OBJECT_SIZE/4]; int i; uint32_t handle; fd = drm_open_any(); for (i = 0; i < OBJECT_SIZE/4; i++) data[i] = i; handle = gem_create(fd, OBJECT_SIZE); ptr = gem_mmap(fd, handle, OBJECT_SIZE, PROT_READ | PROT_WRITE); assert(ptr); gem_set_tiling(fd, handle, I915_TILING_X, TEST_STRIDE); /* touch it */ gem_set_domain(fd, handle, I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT); *ptr = 0xdeadbeef; printf("testing pwrite on tiled buffer\n"); gem_write(fd, handle, 0, data, OBJECT_SIZE); memset(data, 0, OBJECT_SIZE); gem_read(fd, handle, 0, data, OBJECT_SIZE); for (i = 0; i < OBJECT_SIZE/4; i++) assert(i == data[i]); /* touch it before changing the tiling, so that the fence sticks around */ gem_set_domain(fd, handle, I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT); *ptr = 0xdeadbeef; gem_set_tiling(fd, handle, I915_TILING_NONE, 0); printf("testing pwrite on untiled, but still fenced buffer\n"); gem_write(fd, handle, 0, data, OBJECT_SIZE); memset(data, 0, OBJECT_SIZE); gem_read(fd, handle, 0, data, OBJECT_SIZE); for (i = 0; i < OBJECT_SIZE/4; i++) assert(i == data[i]); munmap(ptr, OBJECT_SIZE); close(fd); return 0; } intel-gpu-tools-1.3/tests/gem_storedw_loop_bsd.c0000664000175100017510000000762111733450453017065 00000000000000/* * Copyright © 2009 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Eric Anholt * Jesse Barnes (based on gem_bad_blit.c) * */ #include #include #include #include #include #include #include #include #include #include "drm.h" #include "i915_drm.h" #include "drmtest.h" #include "intel_bufmgr.h" #include "intel_batchbuffer.h" #include "intel_gpu_tools.h" static drm_intel_bufmgr *bufmgr; struct intel_batchbuffer *batch; static drm_intel_bo *target_buffer; static int has_ppgtt = 0; /* * Testcase: Basic bsd MI check using MI_STORE_DATA_IMM */ static void store_dword_loop(void) { int cmd, i, val = 0; uint32_t *buf; cmd = MI_STORE_DWORD_IMM; if (!has_ppgtt) cmd |= MI_MEM_VIRTUAL; for (i = 0; i < 0x100000; i++) { BEGIN_BATCH(4); OUT_BATCH(cmd); OUT_BATCH(0); /* reserved */ OUT_RELOC(target_buffer, I915_GEM_DOMAIN_INSTRUCTION, I915_GEM_DOMAIN_INSTRUCTION, 0); OUT_BATCH(val); ADVANCE_BATCH(); intel_batchbuffer_flush_on_ring(batch, I915_EXEC_BSD); drm_intel_bo_map(target_buffer, 0); buf = target_buffer->virtual; if (buf[0] != val) { fprintf(stderr, "value mismatch: cur 0x%08x, stored 0x%08x\n", buf[0], val); exit(-1); } drm_intel_bo_unmap(target_buffer); val++; } drm_intel_bo_map(target_buffer, 0); buf = target_buffer->virtual; printf("completed %d writes successfully, current value: 0x%08x\n", i, buf[0]); drm_intel_bo_unmap(target_buffer); } int main(int argc, char **argv) { int fd; int devid; if (argc != 1) { fprintf(stderr, "usage: %s\n", argv[0]); exit(-1); } fd = drm_open_any(); devid = intel_get_drm_devid(fd); has_ppgtt = gem_uses_aliasing_ppgtt(fd); if (IS_GEN2(devid) || IS_GEN3(devid) || IS_GEN4(devid) || IS_GEN5(devid)) { fprintf(stderr, "MI_STORE_DATA can only use GTT address on gen4+/g33 and " "needs snoopable mem on pre-gen6\n"); return 77; } if (IS_GEN6(devid)) { fprintf(stderr, "MI_STORE_DATA broken on gen6 bsd\n"); return 77; } /* This only works with ppgtt */ if (!has_ppgtt) { fprintf(stderr, "no ppgtt detected, which is required\n"); return 77; } bufmgr = drm_intel_bufmgr_gem_init(fd, 4096); if (!bufmgr) { fprintf(stderr, "failed to init libdrm\n"); exit(-1); } drm_intel_bufmgr_gem_enable_reuse(bufmgr); batch = intel_batchbuffer_alloc(bufmgr, devid); if (!batch) { fprintf(stderr, "failed to create batch buffer\n"); exit(-1); } target_buffer = drm_intel_bo_alloc(bufmgr, "target bo", 4096, 4096); if (!target_buffer) { fprintf(stderr, "failed to alloc target buffer\n"); exit(-1); } store_dword_loop(); drm_intel_bo_unreference(target_buffer); intel_batchbuffer_free(batch); drm_intel_bufmgr_destroy(bufmgr); close(fd); return 0; } intel-gpu-tools-1.3/tests/gem_ctx_create.c0000664000175100017510000000374412004013767015633 00000000000000/* * Copyright © 2012 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Ben Widawsky * */ #include #include #include "i915_drm.h" #include "drmtest.h" struct local_drm_i915_gem_context_create { __u32 ctx_id; __u32 pad; }; #define CONTEXT_CREATE_IOCTL DRM_IOWR(DRM_COMMAND_BASE + 0x2d, struct local_drm_i915_gem_context_create) int main(int argc, char *argv[]) { int ret, fd; struct local_drm_i915_gem_context_create create; create.ctx_id = rand(); create.pad = rand(); fd = drm_open_any(); ret = drmIoctl(fd, CONTEXT_CREATE_IOCTL, &create); if (ret != 0 && (errno == ENODEV || errno == EINVAL)) { fprintf(stderr, "Kernel is too old, or contexts not supported: %s\n", strerror(errno)); exit(77); } else if (ret != 0) { fprintf(stderr, "%s\n", strerror(errno)); exit(EXIT_FAILURE); } assert(create.ctx_id != 0); close(fd); exit(EXIT_SUCCESS); } intel-gpu-tools-1.3/tests/gem_exec_nop.c0000664000175100017510000000616511772702746015327 00000000000000/* * Copyright © 2011 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Chris Wilson * */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include "drm.h" #include "i915_drm.h" #include "drmtest.h" #define MI_BATCH_BUFFER_END (0xA<<23) static double elapsed(const struct timeval *start, const struct timeval *end, int loop) { return (1e6*(end->tv_sec - start->tv_sec) + (end->tv_usec - start->tv_usec))/loop; } static int exec(int fd, uint32_t handle, int loops) { struct drm_i915_gem_execbuffer2 execbuf; struct drm_i915_gem_exec_object2 gem_exec[1]; int ret = 0; gem_exec[0].handle = handle; gem_exec[0].relocation_count = 0; gem_exec[0].relocs_ptr = 0; gem_exec[0].alignment = 0; gem_exec[0].offset = 0; gem_exec[0].flags = 0; gem_exec[0].rsvd1 = 0; gem_exec[0].rsvd2 = 0; execbuf.buffers_ptr = (uintptr_t)gem_exec; execbuf.buffer_count = 1; execbuf.batch_start_offset = 0; execbuf.batch_len = 8; execbuf.cliprects_ptr = 0; execbuf.num_cliprects = 0; execbuf.DR1 = 0; execbuf.DR4 = 0; execbuf.flags = 0; i915_execbuffer2_set_context_id(execbuf, 0); execbuf.rsvd2 = 0; while (loops-- && ret == 0) { ret = drmIoctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, &execbuf); } gem_sync(fd, handle); return ret; } int main(int argc, char **argv) { uint32_t batch[2] = {MI_BATCH_BUFFER_END}; uint32_t handle; int count; int fd; fd = drm_open_any(); handle = gem_create(fd, 4096); gem_write(fd, handle, 0, batch, sizeof(batch)); for (count = 1; count <= 1<<17; count <<= 1) { struct timeval start, end; gettimeofday(&start, NULL); if (exec(fd, handle, count)) exit(1); gettimeofday(&end, NULL); printf("Time to exec x %d: %7.3fµs\n", count, elapsed(&start, &end, count)); fflush(stdout); } gem_close(fd, handle); close(fd); return 0; } intel-gpu-tools-1.3/tests/gem_double_irq_loop.c0000664000175100017510000000770411673204321016667 00000000000000/* * Copyright © 2011 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Daniel Vetter (based on gem_storedw_*.c) * */ #include #include #include #include #include #include #include #include #include #include "drm.h" #include "i915_drm.h" #include "drmtest.h" #include "intel_bufmgr.h" #include "intel_batchbuffer.h" #include "intel_gpu_tools.h" #include "i830_reg.h" static drm_intel_bufmgr *bufmgr; struct intel_batchbuffer *batch; static drm_intel_bo *target_buffer, *blt_bo; /* * Testcase: Basic check for missed irqs on blt * * Execs one large and then immediately a tiny batch on the blt ring. Then waits * on the second batch. This hopefully catches races in our irq acknowledgement. */ #define MI_COND_BATCH_BUFFER_END (0x36<<23 | 1) #define MI_DO_COMPARE (1<<21) static void dummy_reloc_loop(void) { int i; for (i = 0; i < 0x800; i++) { BEGIN_BATCH(8); OUT_BATCH(XY_SRC_COPY_BLT_CMD | XY_SRC_COPY_BLT_WRITE_ALPHA | XY_SRC_COPY_BLT_WRITE_RGB); OUT_BATCH((3 << 24) | /* 32 bits */ (0xcc << 16) | /* copy ROP */ 4*4096); OUT_BATCH(2048 << 16 | 0); OUT_BATCH((4096) << 16 | (2048)); OUT_RELOC_FENCED(blt_bo, I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER, 0); OUT_BATCH(0 << 16 | 0); OUT_BATCH(4*4096); OUT_RELOC_FENCED(blt_bo, I915_GEM_DOMAIN_RENDER, 0, 0); ADVANCE_BATCH(); intel_batchbuffer_flush(batch); BEGIN_BATCH(4); OUT_BATCH(MI_FLUSH_DW | 1); OUT_BATCH(0); /* reserved */ OUT_RELOC(target_buffer, I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER, 0); OUT_BATCH(MI_NOOP | (1<<22) | (0xf)); ADVANCE_BATCH(); intel_batchbuffer_flush(batch); drm_intel_bo_map(target_buffer, 0); // map to force completion drm_intel_bo_unmap(target_buffer); } } int main(int argc, char **argv) { int fd; int devid; if (argc != 1) { fprintf(stderr, "usage: %s\n", argv[0]); exit(-1); } fd = drm_open_any(); devid = intel_get_drm_devid(fd); if (!HAS_BLT_RING(devid)) { fprintf(stderr, "not (yet) implemented for pre-snb\n"); return 77; } bufmgr = drm_intel_bufmgr_gem_init(fd, 4096); if (!bufmgr) { fprintf(stderr, "failed to init libdrm\n"); exit(-1); } drm_intel_bufmgr_gem_enable_reuse(bufmgr); batch = intel_batchbuffer_alloc(bufmgr, devid); if (!batch) { fprintf(stderr, "failed to create batch buffer\n"); exit(-1); } target_buffer = drm_intel_bo_alloc(bufmgr, "target bo", 4096, 4096); if (!target_buffer) { fprintf(stderr, "failed to alloc target buffer\n"); exit(-1); } blt_bo = drm_intel_bo_alloc(bufmgr, "target bo", 4*4096*4096, 4096); if (!blt_bo) { fprintf(stderr, "failed to alloc blt buffer\n"); exit(-1); } dummy_reloc_loop(); drm_intel_bo_unreference(target_buffer); intel_batchbuffer_free(batch); drm_intel_bufmgr_destroy(bufmgr); close(fd); return 0; } intel-gpu-tools-1.3/tests/flip_test.c0000644000175100017510000001654312015770033014650 00000000000000/* * Copyright 2012 Intel Corporation * Jesse Barnes * * 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 OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include "i915_drm.h" #include "drmtest.h" #include "testdisplay.h" drmModeRes *resources; int drm_fd; int test_time = 3; uint32_t *fb_ptr; #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0])) struct type_name { int type; const char *name; }; struct test_output { uint32_t id; int mode_valid; drmModeModeInfo mode; drmModeEncoder *encoder; drmModeConnector *connector; int crtc; int pipe; unsigned int current_fb_id; unsigned int fb_ids[2]; }; static void page_flip_handler(int fd, unsigned int frame, unsigned int sec, unsigned int usec, void *data) { struct test_output *o = data; unsigned int new_fb_id; if (o->current_fb_id == o->fb_ids[0]) new_fb_id = o->fb_ids[1]; else new_fb_id = o->fb_ids[0]; drmModePageFlip(drm_fd, o->crtc, new_fb_id, DRM_MODE_PAGE_FLIP_EVENT, o); o->current_fb_id = new_fb_id; } static void connector_find_preferred_mode(struct test_output *o, int crtc_id) { drmModeConnector *connector; drmModeEncoder *encoder = NULL; int i, j; /* First, find the connector & mode */ o->mode_valid = 0; o->crtc = 0; connector = drmModeGetConnector(drm_fd, o->id); assert(connector); if (connector->connection != DRM_MODE_CONNECTED) { drmModeFreeConnector(connector); return; } if (!connector->count_modes) { fprintf(stderr, "connector %d has no modes\n", o->id); drmModeFreeConnector(connector); return; } if (connector->connector_id != o->id) { fprintf(stderr, "connector id doesn't match (%d != %d)\n", connector->connector_id, o->id); drmModeFreeConnector(connector); return; } for (j = 0; j < connector->count_modes; j++) { o->mode = connector->modes[j]; if (o->mode.type & DRM_MODE_TYPE_PREFERRED) { o->mode_valid = 1; break; } } if (!o->mode_valid) { if (connector->count_modes > 0) { /* use the first mode as test mode */ o->mode = connector->modes[0]; o->mode_valid = 1; } else { fprintf(stderr, "failed to find any modes on connector %d\n", o->id); return; } } /* Now get the encoder */ for (i = 0; i < connector->count_encoders; i++) { encoder = drmModeGetEncoder(drm_fd, connector->encoders[i]); if (!encoder) { fprintf(stderr, "could not get encoder %i: %s\n", resources->encoders[i], strerror(errno)); drmModeFreeEncoder(encoder); continue; } break; } o->encoder = encoder; if (i == resources->count_encoders) { fprintf(stderr, "failed to find encoder\n"); o->mode_valid = 0; return; } /* Find first CRTC not in use */ for (i = 0; i < resources->count_crtcs; i++) { if (resources->crtcs[i] != crtc_id) continue; if (resources->crtcs[i] && (o->encoder->possible_crtcs & (1<crtc = resources->crtcs[i]; break; } } if (!o->crtc) { fprintf(stderr, "could not find requested crtc %d\n", crtc_id); o->mode_valid = 0; return; } o->pipe = i; o->connector = connector; } static void paint_flip_mode(cairo_t *cr, int width, int height, void *priv) { bool odd_frame = (bool) priv; if (odd_frame) cairo_rectangle(cr, width/4, height/2, width/4, height/8); else cairo_rectangle(cr, width/2, height/2, width/4, height/8); cairo_set_source_rgb(cr, 1, 1, 1); cairo_fill(cr); } static void set_mode(struct test_output *o, int crtc) { int ret; int bpp = 32, depth = 24; drmEventContext evctx; int width, height; struct timeval end; struct kmstest_fb fb_info[2]; connector_find_preferred_mode(o, crtc); if (!o->mode_valid) return; width = o->mode.hdisplay; height = o->mode.vdisplay; o->fb_ids[0] = kmstest_create_fb(drm_fd, width, height, bpp, depth, false, &fb_info[0], paint_flip_mode, (void *)false); o->fb_ids[1] = kmstest_create_fb(drm_fd, width, height, bpp, depth, false, &fb_info[1], paint_flip_mode, (void *)true); if (!o->fb_ids[0] || !o->fb_ids[1]) { fprintf(stderr, "failed to create fbs\n"); exit(3); } gem_close(drm_fd, fb_info[0].gem_handle); gem_close(drm_fd, fb_info[1].gem_handle); kmstest_dump_mode(&o->mode); if (drmModeSetCrtc(drm_fd, o->crtc, o->fb_ids[0], 0, 0, &o->id, 1, &o->mode)) { fprintf(stderr, "failed to set mode (%dx%d@%dHz): %s\n", width, height, o->mode.vrefresh, strerror(errno)); exit(3); } ret = drmModePageFlip(drm_fd, o->crtc, o->fb_ids[1], DRM_MODE_PAGE_FLIP_EVENT, o); if (ret) { fprintf(stderr, "failed to page flip: %s\n", strerror(errno)); exit(4); } o->current_fb_id = o->fb_ids[1]; memset(&evctx, 0, sizeof evctx); evctx.version = DRM_EVENT_CONTEXT_VERSION; evctx.vblank_handler = NULL; evctx.page_flip_handler = page_flip_handler; gettimeofday(&end, NULL); end.tv_sec += 3; while (1) { struct timeval now, timeout = { .tv_sec = 3, .tv_usec = 0 }; fd_set fds; FD_ZERO(&fds); FD_SET(0, &fds); FD_SET(drm_fd, &fds); ret = select(drm_fd + 1, &fds, NULL, NULL, &timeout); if (ret <= 0) { fprintf(stderr, "select timed out or error (ret %d)\n", ret); exit(1); } else if (FD_ISSET(0, &fds)) { fprintf(stderr, "no fds active, breaking\n"); exit(2); } gettimeofday(&now, NULL); if (now.tv_sec > end.tv_sec || (now.tv_sec == end.tv_sec && now.tv_usec >= end.tv_usec)) { ret = 0; break; } drmHandleEvent(drm_fd, &evctx); } fprintf(stdout, "page flipping on crtc %d, connector %d: PASSED\n", crtc, o->id); drmModeFreeEncoder(o->encoder); drmModeFreeConnector(o->connector); } static int run_test(void) { struct test_output *connectors; int c, i; resources = drmModeGetResources(drm_fd); if (!resources) { fprintf(stderr, "drmModeGetResources failed: %s\n", strerror(errno)); exit(5); } connectors = calloc(resources->count_connectors, sizeof(struct test_output)); assert(connectors); /* Find any connected displays */ for (c = 0; c < resources->count_connectors; c++) { connectors[c].id = resources->connectors[c]; for (i = 0; i < resources->count_crtcs; i++) set_mode(&connectors[c], resources->crtcs[i]); } drmModeFreeResources(resources); return 1; } int main(int argc, char **argv) { drm_fd = drm_open_any(); run_test(); close(drm_fd); return 0; } intel-gpu-tools-1.3/tests/check_drm_clients0000775000175100017510000000013411741627117016101 00000000000000#!/bin/bash SOURCE_DIR="$( dirname "${BASH_SOURCE[0]}" )" . $SOURCE_DIR/drm_lib.sh exit 0 intel-gpu-tools-1.3/tests/sysfs_edid_timing0000775000175100017510000000104011664511026016134 00000000000000#!/bin/sh # # This check the time we take to read the content of all the possible connectors. # Without the edid -ENXIO patch (http://permalink.gmane.org/gmane.comp.video.dri.devel/62083), # we sometimes take a *really* long time. So let's just check for some reasonable timing here # TIME1=$(date +%s%N) cat $(find /sys/devices/|grep drm | grep /status) > /dev/null TIME2=$(date +%s%N) # time in ms RES=$(((TIME2 - TIME1) / 1000000)) if [ $RES -gt 600 ]; then echo "Talking to outputs took ${RES}ms, something is wrong" exit 1 fi exit 0 intel-gpu-tools-1.3/tests/gem_tiled_swapping.c0000664000175100017510000000742711707470121016525 00000000000000/* * Copyright © 2011 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Daniel Vetter * */ /** @file gem_tiled_pread_pwrite.c * * This is a test of pread's behavior on tiled objects with respect to the * reported swizzling value. * * The goal is to exercise the slow_bit17_copy path for reading on bit17 * machines, but will also be useful for catching swizzling value bugs on * other systems. */ /* * Testcase: Exercise swizzle code for swapping * * The swizzle checks in the swapin path are at a different place than the ones * for pread/pwrite, so we need to check them separately. * * This test obviously needs swap present (and exits if none is detected). */ #include #include #include #include #include #include #include #include #include #include #include #include "drm.h" #include "i915_drm.h" #include "drmtest.h" #include "intel_gpu_tools.h" #define WIDTH 512 #define HEIGHT 512 static uint32_t linear[WIDTH * HEIGHT]; static uint32_t current_tiling_mode; #define PAGE_SIZE 4096 static uint32_t create_bo_and_fill(int fd) { uint32_t handle; uint32_t *data; int i; handle = gem_create(fd, sizeof(linear)); gem_set_tiling(fd, handle, current_tiling_mode, WIDTH * sizeof(uint32_t)); /* Fill the BO with dwords starting at start_val */ data = gem_mmap(fd, handle, sizeof(linear), PROT_READ | PROT_WRITE); for (i = 0; i < WIDTH*HEIGHT; i++) data[i] = i; munmap(data, sizeof(linear)); return handle; } uint32_t *bo_handles; int *idx_arr; int main(int argc, char **argv) { int fd; uint32_t *data; int i, j; int count; current_tiling_mode = I915_TILING_X; fd = drm_open_any(); /* need slightly more than total ram */ count = intel_get_total_ram_mb() * 11 / 10; bo_handles = calloc(count, sizeof(uint32_t)); assert(bo_handles); idx_arr = calloc(count, sizeof(int)); assert(idx_arr); if (intel_get_total_swap_mb() == 0) { printf("no swap detected\n"); return 77; } if (intel_get_total_ram_mb() / 4 > intel_get_total_swap_mb()) { printf("not enough swap detected\n"); return 77; } for (i = 0; i < count; i++) bo_handles[i] = create_bo_and_fill(fd); for (i = 0; i < count; i++) idx_arr[i] = i; drmtest_permute_array(idx_arr, count, drmtest_exchange_int); for (i = 0; i < count/2; i++) { /* Check the target bo's contents. */ data = gem_mmap(fd, bo_handles[idx_arr[i]], sizeof(linear), PROT_READ | PROT_WRITE); for (j = 0; j < WIDTH*HEIGHT; j++) if (data[j] != j) { fprintf(stderr, "mismatch at %i: %i\n", j, data[j]); exit(1); } munmap(data, sizeof(linear)); } close(fd); return 0; } intel-gpu-tools-1.3/tests/gem_fence_thrash.c0000664000175100017510000000622711733450453016147 00000000000000/* * Copyright © 2008-9 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Eric Anholt * Chris Wilson * */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include #include #include "drm.h" #include "i915_drm.h" #include "drmtest.h" #define OBJECT_SIZE (128*1024) /* restricted to 1MiB alignment on i915 fences */ /* Before introduction of the LRU list for fences, allocation of a fence for a page * fault would use the first inactive fence (i.e. in preference one with no outstanding * GPU activity, or it would wait on the first to finish). Given the choice, it would simply * reuse the fence that had just been allocated for the previous page-fault - the worst choice * when copying between two buffers and thus constantly swapping fences. */ static void * bo_create (int fd) { void *ptr; int handle; handle = gem_create(fd, OBJECT_SIZE); gem_set_tiling(fd, handle, I915_TILING_X, 1024); ptr = gem_mmap(fd, handle, OBJECT_SIZE, PROT_READ | PROT_WRITE); /* XXX: mmap_gtt pulls the bo into the GTT read domain. */ gem_sync(fd, handle); return ptr; } static void * bo_copy (void *_arg) { int fd = *(int *)_arg; int n; char *a, *b; a = bo_create (fd); b = bo_create (fd); for (n = 0; n < 1000; n++) { memcpy (a, b, OBJECT_SIZE); sched_yield (); } return NULL; } int main(int argc, char **argv) { drm_i915_getparam_t gp; pthread_t threads[32]; int n, num_fences; int fd, ret; fd = drm_open_any(); gp.param = I915_PARAM_NUM_FENCES_AVAIL; gp.value = &num_fences; ret = ioctl(fd, DRM_IOCTL_I915_GETPARAM, &gp); assert (ret == 0); printf ("creating %d threads\n", num_fences); assert (num_fences < sizeof (threads) / sizeof (threads[0])); for (n = 0; n < num_fences; n++) pthread_create (&threads[n], NULL, bo_copy, &fd); for (n = 0; n < num_fences; n++) pthread_join (threads[n], NULL); close(fd); return 0; } intel-gpu-tools-1.3/tests/gen3_render_linear_blits.c0000664000175100017510000002516211772702746017617 00000000000000/* * Copyright © 2011 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Chris Wilson * */ /** @file gen3_linear_render_blits.c * * This is a test of doing many blits, with a working set * larger than the aperture size. * * The goal is to simply ensure the basics work. */ #include #include #include #include #include #include #include #include #include #include "drm.h" #include "i915_drm.h" #include "drmtest.h" #include "intel_gpu_tools.h" #include "i915_reg.h" #include "i915_3d.h" #define WIDTH 512 #define HEIGHT 512 static uint32_t linear[WIDTH*HEIGHT]; static inline uint32_t pack_float(float f) { union { uint32_t dw; float f; } u; u.f = f; return u.dw; } static uint32_t fill_reloc(struct drm_i915_gem_relocation_entry *reloc, uint32_t offset, uint32_t handle, uint32_t read_domain, uint32_t write_domain) { reloc->target_handle = handle; reloc->delta = 0; reloc->offset = offset * sizeof(uint32_t); reloc->presumed_offset = 0; reloc->read_domains = read_domain; reloc->write_domain = write_domain; return reloc->presumed_offset + reloc->delta; } static void copy(int fd, uint32_t dst, uint32_t src) { uint32_t batch[1024], *b = batch; struct drm_i915_gem_relocation_entry reloc[2], *r = reloc; struct drm_i915_gem_exec_object2 obj[3]; struct drm_i915_gem_execbuffer2 exec; uint32_t handle; int ret; /* invariant state */ *b++ = (_3DSTATE_AA_CMD | AA_LINE_ECAAR_WIDTH_ENABLE | AA_LINE_ECAAR_WIDTH_1_0 | AA_LINE_REGION_WIDTH_ENABLE | AA_LINE_REGION_WIDTH_1_0); *b++ = (_3DSTATE_INDEPENDENT_ALPHA_BLEND_CMD | IAB_MODIFY_ENABLE | IAB_MODIFY_FUNC | (BLENDFUNC_ADD << IAB_FUNC_SHIFT) | IAB_MODIFY_SRC_FACTOR | (BLENDFACT_ONE << IAB_SRC_FACTOR_SHIFT) | IAB_MODIFY_DST_FACTOR | (BLENDFACT_ZERO << IAB_DST_FACTOR_SHIFT)); *b++ = (_3DSTATE_DFLT_DIFFUSE_CMD); *b++ = (0); *b++ = (_3DSTATE_DFLT_SPEC_CMD); *b++ = (0); *b++ = (_3DSTATE_DFLT_Z_CMD); *b++ = (0); *b++ = (_3DSTATE_COORD_SET_BINDINGS | CSB_TCB(0, 0) | CSB_TCB(1, 1) | CSB_TCB(2, 2) | CSB_TCB(3, 3) | CSB_TCB(4, 4) | CSB_TCB(5, 5) | CSB_TCB(6, 6) | CSB_TCB(7, 7)); *b++ = (_3DSTATE_RASTER_RULES_CMD | ENABLE_POINT_RASTER_RULE | OGL_POINT_RASTER_RULE | ENABLE_LINE_STRIP_PROVOKE_VRTX | ENABLE_TRI_FAN_PROVOKE_VRTX | LINE_STRIP_PROVOKE_VRTX(1) | TRI_FAN_PROVOKE_VRTX(2) | ENABLE_TEXKILL_3D_4D | TEXKILL_4D); *b++ = (_3DSTATE_MODES_4_CMD | ENABLE_LOGIC_OP_FUNC | LOGIC_OP_FUNC(LOGICOP_COPY) | ENABLE_STENCIL_WRITE_MASK | STENCIL_WRITE_MASK(0xff) | ENABLE_STENCIL_TEST_MASK | STENCIL_TEST_MASK(0xff)); *b++ = (_3DSTATE_LOAD_STATE_IMMEDIATE_1 | I1_LOAD_S(3) | I1_LOAD_S(4) | I1_LOAD_S(5) | 2); *b++ = (0x00000000); /* Disable texture coordinate wrap-shortest */ *b++ = ((1 << S4_POINT_WIDTH_SHIFT) | S4_LINE_WIDTH_ONE | S4_CULLMODE_NONE | S4_VFMT_XY); *b++ = (0x00000000); /* Stencil. */ *b++ = (_3DSTATE_SCISSOR_ENABLE_CMD | DISABLE_SCISSOR_RECT); *b++ = (_3DSTATE_SCISSOR_RECT_0_CMD); *b++ = (0); *b++ = (0); *b++ = (_3DSTATE_DEPTH_SUBRECT_DISABLE); *b++ = (_3DSTATE_LOAD_INDIRECT | 0); /* disable indirect state */ *b++ = (0); *b++ = (_3DSTATE_STIPPLE); *b++ = (0x00000000); *b++ = (_3DSTATE_BACKFACE_STENCIL_OPS | BFO_ENABLE_STENCIL_TWO_SIDE | 0); /* samler state */ #define TEX_COUNT 1 *b++ = (_3DSTATE_MAP_STATE | (3 * TEX_COUNT)); *b++ = ((1 << TEX_COUNT) - 1); *b = fill_reloc(r++, b-batch, src, I915_GEM_DOMAIN_SAMPLER, 0); b++; *b++ = (MAPSURF_32BIT | MT_32BIT_ARGB8888 | (HEIGHT - 1) << MS3_HEIGHT_SHIFT | (WIDTH - 1) << MS3_WIDTH_SHIFT); *b++ = ((WIDTH-1) << MS4_PITCH_SHIFT); *b++ = (_3DSTATE_SAMPLER_STATE | (3 * TEX_COUNT)); *b++ = ((1 << TEX_COUNT) - 1); *b++ = (MIPFILTER_NONE << SS2_MIP_FILTER_SHIFT | FILTER_NEAREST << SS2_MAG_FILTER_SHIFT | FILTER_NEAREST << SS2_MIN_FILTER_SHIFT); *b++ = (TEXCOORDMODE_WRAP << SS3_TCX_ADDR_MODE_SHIFT | TEXCOORDMODE_WRAP << SS3_TCY_ADDR_MODE_SHIFT | 0 << SS3_TEXTUREMAP_INDEX_SHIFT); *b++ = (0x00000000); /* render target state */ *b++ = (_3DSTATE_BUF_INFO_CMD); *b++ = (BUF_3D_ID_COLOR_BACK | WIDTH*4); *b = fill_reloc(r++, b-batch, dst, I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER); b++; *b++ = (_3DSTATE_DST_BUF_VARS_CMD); *b++ = (COLR_BUF_ARGB8888 | DSTORG_HORT_BIAS(0x8) | DSTORG_VERT_BIAS(0x8)); /* draw rect is unconditional */ *b++ = (_3DSTATE_DRAW_RECT_CMD); *b++ = (0x00000000); *b++ = (0x00000000); /* ymin, xmin */ *b++ = (DRAW_YMAX(HEIGHT - 1) | DRAW_XMAX(WIDTH - 1)); /* yorig, xorig (relate to color buffer?) */ *b++ = (0x00000000); /* texfmt */ *b++ = (_3DSTATE_LOAD_STATE_IMMEDIATE_1 | I1_LOAD_S(1) | I1_LOAD_S(2) | I1_LOAD_S(6) | 2); *b++ = ((4 << S1_VERTEX_WIDTH_SHIFT) | (4 << S1_VERTEX_PITCH_SHIFT)); *b++ = (~S2_TEXCOORD_FMT(0, TEXCOORDFMT_NOT_PRESENT) | S2_TEXCOORD_FMT(0, TEXCOORDFMT_2D)); *b++ = (S6_CBUF_BLEND_ENABLE | S6_COLOR_WRITE_ENABLE | BLENDFUNC_ADD << S6_CBUF_BLEND_FUNC_SHIFT | BLENDFACT_ONE << S6_CBUF_SRC_BLEND_FACT_SHIFT | BLENDFACT_ZERO << S6_CBUF_DST_BLEND_FACT_SHIFT); /* pixel shader */ *b++ = (_3DSTATE_PIXEL_SHADER_PROGRAM | (1 + 3*3 - 2)); /* decl FS_T0 */ *b++ = (D0_DCL | REG_TYPE(FS_T0) << D0_TYPE_SHIFT | REG_NR(FS_T0) << D0_NR_SHIFT | ((REG_TYPE(FS_T0) != REG_TYPE_S) ? D0_CHANNEL_ALL : 0)); *b++ = (0); *b++ = (0); /* decl FS_S0 */ *b++ = (D0_DCL | (REG_TYPE(FS_S0) << D0_TYPE_SHIFT) | (REG_NR(FS_S0) << D0_NR_SHIFT) | ((REG_TYPE(FS_S0) != REG_TYPE_S) ? D0_CHANNEL_ALL : 0)); *b++ = (0); *b++ = (0); /* texld(FS_OC, FS_S0, FS_T0 */ *b++ = (T0_TEXLD | (REG_TYPE(FS_OC) << T0_DEST_TYPE_SHIFT) | (REG_NR(FS_OC) << T0_DEST_NR_SHIFT) | (REG_NR(FS_S0) << T0_SAMPLER_NR_SHIFT)); *b++ = ((REG_TYPE(FS_T0) << T1_ADDRESS_REG_TYPE_SHIFT) | (REG_NR(FS_T0) << T1_ADDRESS_REG_NR_SHIFT)); *b++ = (0); *b++ = (PRIM3D_RECTLIST | (3*4 - 1)); *b++ = pack_float(WIDTH); *b++ = pack_float(HEIGHT); *b++ = pack_float(WIDTH); *b++ = pack_float(HEIGHT); *b++ = pack_float(0); *b++ = pack_float(HEIGHT); *b++ = pack_float(0); *b++ = pack_float(HEIGHT); *b++ = pack_float(0); *b++ = pack_float(0); *b++ = pack_float(0); *b++ = pack_float(0); *b++ = MI_BATCH_BUFFER_END; if ((b - batch) & 1) *b++ = 0; assert(b - batch <= 1024); handle = gem_create(fd, 4096); gem_write(fd, handle, 0, batch, (b-batch)*sizeof(batch[0])); assert(r-reloc == 2); obj[0].handle = dst; obj[0].relocation_count = 0; obj[0].relocs_ptr = 0; obj[0].alignment = 0; obj[0].offset = 0; obj[0].flags = 0; obj[0].rsvd1 = 0; obj[0].rsvd2 = 0; obj[1].handle = src; obj[1].relocation_count = 0; obj[1].relocs_ptr = 0; obj[1].alignment = 0; obj[1].offset = 0; obj[1].flags = 0; obj[1].rsvd1 = 0; obj[1].rsvd2 = 0; obj[2].handle = handle; obj[2].relocation_count = 2; obj[2].relocs_ptr = (uintptr_t)reloc; obj[2].alignment = 0; obj[2].offset = 0; obj[2].flags = 0; obj[2].rsvd1 = obj[2].rsvd2 = 0; exec.buffers_ptr = (uintptr_t)obj; exec.buffer_count = 3; exec.batch_start_offset = 0; exec.batch_len = (b-batch)*sizeof(batch[0]); exec.DR1 = exec.DR4 = 0; exec.num_cliprects = 0; exec.cliprects_ptr = 0; exec.flags = 0; i915_execbuffer2_set_context_id(exec, 0); exec.rsvd2 = 0; ret = drmIoctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, &exec); while (ret && errno == EBUSY) { drmCommandNone(fd, DRM_I915_GEM_THROTTLE); ret = drmIoctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, &exec); } assert(ret == 0); gem_close(fd, handle); } static uint32_t create_bo(int fd, uint32_t val) { uint32_t handle; int i; handle = gem_create(fd, sizeof(linear)); /* Fill the BO with dwords starting at val */ for (i = 0; i < WIDTH*HEIGHT; i++) linear[i] = val++; gem_write(fd, handle, 0, linear, sizeof(linear)); return handle; } static void check_bo(int fd, uint32_t handle, uint32_t val) { int i; gem_read(fd, handle, 0, linear, sizeof(linear)); for (i = 0; i < WIDTH*HEIGHT; i++) { if (linear[i] != val) { fprintf(stderr, "Expected 0x%08x, found 0x%08x " "at offset 0x%08x\n", val, linear[i], i * 4); abort(); } val++; } } int main(int argc, char **argv) { uint32_t *handle, *start_val; uint32_t start = 0; int i, fd, count; fd = drm_open_any(); if (!IS_GEN3(intel_get_drm_devid(fd))) { printf("gen3-only test, doing nothing\n"); return 77; } count = 0; if (argc > 1) count = atoi(argv[1]); if (count == 0) count = 3 * gem_aperture_size(fd) / (1024*1024) / 2; printf("Using %d 1MiB buffers\n", count); handle = malloc(sizeof(uint32_t)*count*2); start_val = handle + count; for (i = 0; i < count; i++) { handle[i] = create_bo(fd, start); start_val[i] = start; start += 1024 * 1024 / 4; } printf("Verifying initialisation...\n"); for (i = 0; i < count; i++) check_bo(fd, handle[i], start_val[i]); printf("Cyclic blits, forward...\n"); for (i = 0; i < count * 4; i++) { int src = i % count; int dst = (i + 1) % count; copy(fd, handle[dst], handle[src]); start_val[dst] = start_val[src]; } for (i = 0; i < count; i++) check_bo(fd, handle[i], start_val[i]); printf("Cyclic blits, backward...\n"); for (i = 0; i < count * 4; i++) { int src = (i + 1) % count; int dst = i % count; copy(fd, handle[dst], handle[src]); start_val[dst] = start_val[src]; } for (i = 0; i < count; i++) check_bo(fd, handle[i], start_val[i]); printf("Random blits...\n"); for (i = 0; i < count * 4; i++) { int src = random() % count; int dst = random() % count; if (src == dst) continue; copy(fd, handle[dst], handle[src]); start_val[dst] = start_val[src]; } for (i = 0; i < count; i++) check_bo(fd, handle[i], start_val[i]); return 0; } intel-gpu-tools-1.3/tests/gen3_render_tiledy_blits.c0000664000175100017510000002620311772702746017634 00000000000000/* * Copyright © 2011 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Chris Wilson * */ /** @file gen3_linear_render_blits.c * * This is a test of doing many blits, with a working set * larger than the aperture size. * * The goal is to simply ensure the basics work. */ #include #include #include #include #include #include #include #include #include #include #include #include "drm.h" #include "i915_drm.h" #include "drmtest.h" #include "intel_gpu_tools.h" #include "i915_reg.h" #include "i915_3d.h" #define WIDTH 512 #define HEIGHT 512 static inline uint32_t pack_float(float f) { union { uint32_t dw; float f; } u; u.f = f; return u.dw; } static uint32_t fill_reloc(struct drm_i915_gem_relocation_entry *reloc, uint32_t offset, uint32_t handle, uint32_t read_domain, uint32_t write_domain) { reloc->target_handle = handle; reloc->delta = 0; reloc->offset = offset * sizeof(uint32_t); reloc->presumed_offset = 0; reloc->read_domains = read_domain; reloc->write_domain = write_domain; return reloc->presumed_offset + reloc->delta; } static void copy(int fd, uint32_t dst, uint32_t src) { uint32_t batch[1024], *b = batch; struct drm_i915_gem_relocation_entry reloc[2], *r = reloc; struct drm_i915_gem_exec_object2 obj[3]; struct drm_i915_gem_execbuffer2 exec; uint32_t handle; int ret; /* invariant state */ *b++ = (_3DSTATE_AA_CMD | AA_LINE_ECAAR_WIDTH_ENABLE | AA_LINE_ECAAR_WIDTH_1_0 | AA_LINE_REGION_WIDTH_ENABLE | AA_LINE_REGION_WIDTH_1_0); *b++ = (_3DSTATE_INDEPENDENT_ALPHA_BLEND_CMD | IAB_MODIFY_ENABLE | IAB_MODIFY_FUNC | (BLENDFUNC_ADD << IAB_FUNC_SHIFT) | IAB_MODIFY_SRC_FACTOR | (BLENDFACT_ONE << IAB_SRC_FACTOR_SHIFT) | IAB_MODIFY_DST_FACTOR | (BLENDFACT_ZERO << IAB_DST_FACTOR_SHIFT)); *b++ = (_3DSTATE_DFLT_DIFFUSE_CMD); *b++ = (0); *b++ = (_3DSTATE_DFLT_SPEC_CMD); *b++ = (0); *b++ = (_3DSTATE_DFLT_Z_CMD); *b++ = (0); *b++ = (_3DSTATE_COORD_SET_BINDINGS | CSB_TCB(0, 0) | CSB_TCB(1, 1) | CSB_TCB(2, 2) | CSB_TCB(3, 3) | CSB_TCB(4, 4) | CSB_TCB(5, 5) | CSB_TCB(6, 6) | CSB_TCB(7, 7)); *b++ = (_3DSTATE_RASTER_RULES_CMD | ENABLE_POINT_RASTER_RULE | OGL_POINT_RASTER_RULE | ENABLE_LINE_STRIP_PROVOKE_VRTX | ENABLE_TRI_FAN_PROVOKE_VRTX | LINE_STRIP_PROVOKE_VRTX(1) | TRI_FAN_PROVOKE_VRTX(2) | ENABLE_TEXKILL_3D_4D | TEXKILL_4D); *b++ = (_3DSTATE_MODES_4_CMD | ENABLE_LOGIC_OP_FUNC | LOGIC_OP_FUNC(LOGICOP_COPY) | ENABLE_STENCIL_WRITE_MASK | STENCIL_WRITE_MASK(0xff) | ENABLE_STENCIL_TEST_MASK | STENCIL_TEST_MASK(0xff)); *b++ = (_3DSTATE_LOAD_STATE_IMMEDIATE_1 | I1_LOAD_S(3) | I1_LOAD_S(4) | I1_LOAD_S(5) | 2); *b++ = (0x00000000); /* Disable texture coordinate wrap-shortest */ *b++ = ((1 << S4_POINT_WIDTH_SHIFT) | S4_LINE_WIDTH_ONE | S4_CULLMODE_NONE | S4_VFMT_XY); *b++ = (0x00000000); /* Stencil. */ *b++ = (_3DSTATE_SCISSOR_ENABLE_CMD | DISABLE_SCISSOR_RECT); *b++ = (_3DSTATE_SCISSOR_RECT_0_CMD); *b++ = (0); *b++ = (0); *b++ = (_3DSTATE_DEPTH_SUBRECT_DISABLE); *b++ = (_3DSTATE_LOAD_INDIRECT | 0); /* disable indirect state */ *b++ = (0); *b++ = (_3DSTATE_STIPPLE); *b++ = (0x00000000); *b++ = (_3DSTATE_BACKFACE_STENCIL_OPS | BFO_ENABLE_STENCIL_TWO_SIDE | 0); /* samler state */ #define TEX_COUNT 1 *b++ = (_3DSTATE_MAP_STATE | (3 * TEX_COUNT)); *b++ = ((1 << TEX_COUNT) - 1); *b = fill_reloc(r++, b-batch, src, I915_GEM_DOMAIN_SAMPLER, 0); b++; *b++ = (MAPSURF_32BIT | MT_32BIT_ARGB8888 | MS3_TILED_SURFACE | MS3_TILE_WALK | (HEIGHT - 1) << MS3_HEIGHT_SHIFT | (WIDTH - 1) << MS3_WIDTH_SHIFT); *b++ = ((WIDTH-1) << MS4_PITCH_SHIFT); *b++ = (_3DSTATE_SAMPLER_STATE | (3 * TEX_COUNT)); *b++ = ((1 << TEX_COUNT) - 1); *b++ = (MIPFILTER_NONE << SS2_MIP_FILTER_SHIFT | FILTER_NEAREST << SS2_MAG_FILTER_SHIFT | FILTER_NEAREST << SS2_MIN_FILTER_SHIFT); *b++ = (TEXCOORDMODE_WRAP << SS3_TCX_ADDR_MODE_SHIFT | TEXCOORDMODE_WRAP << SS3_TCY_ADDR_MODE_SHIFT | 0 << SS3_TEXTUREMAP_INDEX_SHIFT); *b++ = (0x00000000); /* render target state */ *b++ = (_3DSTATE_BUF_INFO_CMD); *b++ = (BUF_3D_ID_COLOR_BACK | BUF_3D_TILED_SURFACE | BUF_3D_TILE_WALK_Y | WIDTH*4); *b = fill_reloc(r++, b-batch, dst, I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER); b++; *b++ = (_3DSTATE_DST_BUF_VARS_CMD); *b++ = (COLR_BUF_ARGB8888 | DSTORG_HORT_BIAS(0x8) | DSTORG_VERT_BIAS(0x8)); /* draw rect is unconditional */ *b++ = (_3DSTATE_DRAW_RECT_CMD); *b++ = (0x00000000); *b++ = (0x00000000); /* ymin, xmin */ *b++ = (DRAW_YMAX(HEIGHT - 1) | DRAW_XMAX(WIDTH - 1)); /* yorig, xorig (relate to color buffer?) */ *b++ = (0x00000000); /* texfmt */ *b++ = (_3DSTATE_LOAD_STATE_IMMEDIATE_1 | I1_LOAD_S(1) | I1_LOAD_S(2) | I1_LOAD_S(6) | 2); *b++ = ((4 << S1_VERTEX_WIDTH_SHIFT) | (4 << S1_VERTEX_PITCH_SHIFT)); *b++ = (~S2_TEXCOORD_FMT(0, TEXCOORDFMT_NOT_PRESENT) | S2_TEXCOORD_FMT(0, TEXCOORDFMT_2D)); *b++ = (S6_CBUF_BLEND_ENABLE | S6_COLOR_WRITE_ENABLE | BLENDFUNC_ADD << S6_CBUF_BLEND_FUNC_SHIFT | BLENDFACT_ONE << S6_CBUF_SRC_BLEND_FACT_SHIFT | BLENDFACT_ZERO << S6_CBUF_DST_BLEND_FACT_SHIFT); /* pixel shader */ *b++ = (_3DSTATE_PIXEL_SHADER_PROGRAM | (1 + 3*3 - 2)); /* decl FS_T0 */ *b++ = (D0_DCL | REG_TYPE(FS_T0) << D0_TYPE_SHIFT | REG_NR(FS_T0) << D0_NR_SHIFT | ((REG_TYPE(FS_T0) != REG_TYPE_S) ? D0_CHANNEL_ALL : 0)); *b++ = (0); *b++ = (0); /* decl FS_S0 */ *b++ = (D0_DCL | (REG_TYPE(FS_S0) << D0_TYPE_SHIFT) | (REG_NR(FS_S0) << D0_NR_SHIFT) | ((REG_TYPE(FS_S0) != REG_TYPE_S) ? D0_CHANNEL_ALL : 0)); *b++ = (0); *b++ = (0); /* texld(FS_OC, FS_S0, FS_T0 */ *b++ = (T0_TEXLD | (REG_TYPE(FS_OC) << T0_DEST_TYPE_SHIFT) | (REG_NR(FS_OC) << T0_DEST_NR_SHIFT) | (REG_NR(FS_S0) << T0_SAMPLER_NR_SHIFT)); *b++ = ((REG_TYPE(FS_T0) << T1_ADDRESS_REG_TYPE_SHIFT) | (REG_NR(FS_T0) << T1_ADDRESS_REG_NR_SHIFT)); *b++ = (0); *b++ = (PRIM3D_RECTLIST | (3*4 - 1)); *b++ = pack_float(WIDTH); *b++ = pack_float(HEIGHT); *b++ = pack_float(WIDTH); *b++ = pack_float(HEIGHT); *b++ = pack_float(0); *b++ = pack_float(HEIGHT); *b++ = pack_float(0); *b++ = pack_float(HEIGHT); *b++ = pack_float(0); *b++ = pack_float(0); *b++ = pack_float(0); *b++ = pack_float(0); *b++ = MI_BATCH_BUFFER_END; if ((b - batch) & 1) *b++ = 0; assert(b - batch <= 1024); handle = gem_create(fd, 4096); gem_write(fd, handle, 0, batch, (b-batch)*sizeof(batch[0])); assert(r-reloc == 2); obj[0].handle = dst; obj[0].relocation_count = 0; obj[0].relocs_ptr = 0; obj[0].alignment = 0; obj[0].offset = 0; obj[0].flags = 0; obj[0].rsvd1 = 0; obj[0].rsvd2 = 0; obj[1].handle = src; obj[1].relocation_count = 0; obj[1].relocs_ptr = 0; obj[1].alignment = 0; obj[1].offset = 0; obj[1].flags = 0; obj[1].rsvd1 = 0; obj[1].rsvd2 = 0; obj[2].handle = handle; obj[2].relocation_count = 2; obj[2].relocs_ptr = (uintptr_t)reloc; obj[2].alignment = 0; obj[2].offset = 0; obj[2].flags = 0; obj[2].rsvd1 = obj[2].rsvd2 = 0; exec.buffers_ptr = (uintptr_t)obj; exec.buffer_count = 3; exec.batch_start_offset = 0; exec.batch_len = (b-batch)*sizeof(batch[0]); exec.DR1 = exec.DR4 = 0; exec.num_cliprects = 0; exec.cliprects_ptr = 0; exec.flags = 0; i915_execbuffer2_set_context_id(exec, 0); exec.rsvd2 = 0; ret = drmIoctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, &exec); while (ret && errno == EBUSY) { drmCommandNone(fd, DRM_I915_GEM_THROTTLE); ret = drmIoctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, &exec); } assert(ret == 0); gem_close(fd, handle); } static uint32_t create_bo(int fd, uint32_t val) { uint32_t handle; uint32_t *v; int i; handle = gem_create(fd, WIDTH*HEIGHT*4); gem_set_tiling(fd, handle, I915_TILING_Y, WIDTH*4); /* Fill the BO with dwords starting at val */ v = gem_mmap(fd, handle, WIDTH*HEIGHT*4, PROT_READ | PROT_WRITE); assert(v); for (i = 0; i < WIDTH*HEIGHT; i++) v[i] = val++; munmap(v, WIDTH*HEIGHT*4); return handle; } static void check_bo(int fd, uint32_t handle, uint32_t val) { uint32_t *v; int i; v = gem_mmap(fd, handle, WIDTH*HEIGHT*4, PROT_READ); assert(v); for (i = 0; i < WIDTH*HEIGHT; i++) { if (v[i] != val) { fprintf(stderr, "Expected 0x%08x, found 0x%08x " "at offset 0x%08x\n", val, v[i], i * 4); abort(); } val++; } munmap(v, WIDTH*HEIGHT*4); } int main(int argc, char **argv) { uint32_t *handle, *start_val; uint32_t start = 0; int i, fd, count; fd = drm_open_any(); if (!IS_GEN3(intel_get_drm_devid(fd))) { printf("gen3-only test, doing nothing\n"); return 77; } count = 0; if (argc > 1) count = atoi(argv[1]); if (count == 0) count = 3 * gem_aperture_size(fd) / (1024*1024) / 2; printf("Using %d 1MiB buffers\n", count); handle = malloc(sizeof(uint32_t)*count*2); start_val = handle + count; for (i = 0; i < count; i++) { handle[i] = create_bo(fd, start); start_val[i] = start; start += 1024 * 1024 / 4; } printf("Verifying initialisation..."); fflush(stdout); for (i = 0; i < count; i++) check_bo(fd, handle[i], start_val[i]); printf("done\n"); printf("Cyclic blits, forward..."); fflush(stdout); for (i = 0; i < count * 32; i++) { int src = i % count; int dst = (i + 1) % count; copy(fd, handle[dst], handle[src]); start_val[dst] = start_val[src]; } printf("verifying..."); fflush(stdout); for (i = 0; i < count; i++) check_bo(fd, handle[i], start_val[i]); printf("done\n"); printf("Cyclic blits, backward..."); fflush(stdout); for (i = 0; i < count * 32; i++) { int src = (i + 1) % count; int dst = i % count; copy(fd, handle[dst], handle[src]); start_val[dst] = start_val[src]; } printf("verifying..."); fflush(stdout); for (i = 0; i < count; i++) check_bo(fd, handle[i], start_val[i]); printf("done\n"); printf("Random blits..."); fflush(stdout); for (i = 0; i < count * 32; i++) { int src = random() % count; int dst = random() % count; while (src == dst) dst = random() % count; copy(fd, handle[dst], handle[src]); start_val[dst] = start_val[src]; } printf("verifying..."); fflush(stdout); for (i = 0; i < count; i++) check_bo(fd, handle[i], start_val[i]); printf("done\n"); return 0; } intel-gpu-tools-1.3/tests/ZZ_check_dmesg0000775000175100017510000000032711706636070015323 00000000000000#!/bin/sh if dmesg | grep '\*ERROR\*' > /dev/null ; then echo "DRM_ERROR dirt in dmesg" exit 1 fi if dmesg | grep -- '------\[ cut here \]----' > /dev/null ; then echo "found a backtrace in dmesg" exit 1 fi intel-gpu-tools-1.3/tests/gem_tiled_fence_blits.c0000664000175100017510000001113711732606130017142 00000000000000/* * Copyright © 2009,2011 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Eric Anholt * */ /** @file gem_tiled_fence_blits.c * * This is a test of doing many tiled blits, with a working set * larger than the aperture size. * * The goal is to catch a couple types of failure; * - Fence management problems on pre-965. * - A17 or L-shaped memory tiling workaround problems in acceleration. * * The model is to fill a collection of 1MB objects in a way that can't trip * over A6 swizzling -- upload data to a non-tiled object, blit to the tiled * object. Then, copy the 1MB objects randomly between each other for a while. * Finally, download their data through linear objects again and see what * resulted. */ #include #include #include #include #include #include #include #include #include #include "drm.h" #include "i915_drm.h" #include "drmtest.h" #include "intel_bufmgr.h" #include "intel_batchbuffer.h" #include "intel_gpu_tools.h" static drm_intel_bufmgr *bufmgr; struct intel_batchbuffer *batch; static int width = 512, height = 512; static uint32_t linear[1024*1024/4]; static drm_intel_bo * create_bo(int fd, uint32_t start_val) { drm_intel_bo *bo; uint32_t tiling = I915_TILING_X; int ret, i; bo = drm_intel_bo_alloc(bufmgr, "tiled bo", 1024 * 1024, 4096); ret = drm_intel_bo_set_tiling(bo, &tiling, width * 4); assert(ret == 0); assert(tiling == I915_TILING_X); /* Fill the BO with dwords starting at start_val */ for (i = 0; i < 1024 * 1024 / 4; i++) linear[i] = start_val++; gem_write(fd, bo->handle, 0, linear, sizeof(linear)); return bo; } static void check_bo(int fd, drm_intel_bo *bo, uint32_t start_val) { int i; gem_read(fd, bo->handle, 0, linear, sizeof(linear)); for (i = 0; i < 1024 * 1024 / 4; i++) { if (linear[i] != start_val) { fprintf(stderr, "Expected 0x%08x, found 0x%08x " "at offset 0x%08x\n", start_val, linear[i], i * 4); abort(); } start_val++; } } int main(int argc, char **argv) { drm_intel_bo *bo[4096]; uint32_t bo_start_val[4096]; uint32_t start = 0; int fd, i, count; fd = drm_open_any(); count = 3 * gem_aperture_size(fd) / (1024*1024) / 2; if (count > intel_get_total_ram_mb() * 9 / 10) { count = intel_get_total_ram_mb() * 9 / 10; printf("not enough RAM to run test, reducing buffer count\n"); } count |= 1; printf("Using %d 1MiB buffers\n", count); bufmgr = drm_intel_bufmgr_gem_init(fd, 4096); drm_intel_bufmgr_gem_enable_reuse(bufmgr); batch = intel_batchbuffer_alloc(bufmgr, intel_get_drm_devid(fd)); for (i = 0; i < count; i++) { bo[i] = create_bo(fd, start); bo_start_val[i] = start; /* printf("Creating bo %d\n", i); check_bo(bo[i], bo_start_val[i]); */ start += 1024 * 1024 / 4; } for (i = 0; i < count; i++) { int src = count - i - 1; intel_copy_bo(batch, bo[i], bo[src], width, height); bo_start_val[i] = bo_start_val[src]; } for (i = 0; i < count * 4; i++) { int src = random() % count; int dst = random() % count; if (src == dst) continue; intel_copy_bo(batch, bo[dst], bo[src], width, height); bo_start_val[dst] = bo_start_val[src]; /* check_bo(bo[dst], bo_start_val[dst]); printf("%d: copy bo %d to %d\n", i, src, dst); */ } for (i = 0; i < count; i++) { /* printf("check %d\n", i); */ check_bo(fd, bo[i], bo_start_val[i]); drm_intel_bo_unreference(bo[i]); bo[i] = NULL; } intel_batchbuffer_free(batch); drm_intel_bufmgr_destroy(bufmgr); close(fd); return 0; } intel-gpu-tools-1.3/tests/gem_unref_active_buffers.c0000664000175100017510000000620511653321362017675 00000000000000/* * Copyright © 2011 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Daniel Vetter * */ /* * Testcase: Unreferencing of active buffers * * Execs buffers and immediately unreferences them, hence the kernel active list * will be the last one to hold a reference on them. Usually libdrm bo caching * prevents that by keeping another reference. */ #include #include #include #include #include #include #include #include #include #include "drm.h" #include "i915_drm.h" #include "drmtest.h" #include "intel_bufmgr.h" #include "intel_batchbuffer.h" #include "intel_gpu_tools.h" static drm_intel_bufmgr *bufmgr; struct intel_batchbuffer *batch; static drm_intel_bo *load_bo; int main(int argc, char **argv) { int fd, i; fd = drm_open_any(); bufmgr = drm_intel_bufmgr_gem_init(fd, 4096); if (!bufmgr) { fprintf(stderr, "failed to init libdrm\n"); exit(-1); } /* don't enable buffer reuse!! */ //drm_intel_bufmgr_gem_enable_reuse(bufmgr); batch = intel_batchbuffer_alloc(bufmgr, intel_get_drm_devid(fd)); assert(batch); /* put some load onto the gpu to keep the light buffers active for long * enough */ for (i = 0; i < 1000; i++) { load_bo = drm_intel_bo_alloc(bufmgr, "target bo", 1024*4096, 4096); if (!load_bo) { fprintf(stderr, "failed to alloc target buffer\n"); exit(-1); } BEGIN_BATCH(8); OUT_BATCH(XY_SRC_COPY_BLT_CMD | XY_SRC_COPY_BLT_WRITE_ALPHA | XY_SRC_COPY_BLT_WRITE_RGB); OUT_BATCH((3 << 24) | /* 32 bits */ (0xcc << 16) | /* copy ROP */ 4096); OUT_BATCH(0); /* dst x1,y1 */ OUT_BATCH((1024 << 16) | 512); OUT_RELOC(load_bo, I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER, 0); OUT_BATCH((0 << 16) | 512); /* src x1, y1 */ OUT_BATCH(4096); OUT_RELOC(load_bo, I915_GEM_DOMAIN_RENDER, 0, 0); ADVANCE_BATCH(); intel_batchbuffer_flush(batch); drm_intel_bo_disable_reuse(load_bo); drm_intel_bo_unreference(load_bo); } drm_intel_bufmgr_destroy(bufmgr); close(fd); return 0; } intel-gpu-tools-1.3/tests/Makefile.in0000664000175100017510000025034412016622041014555 00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } 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@ noinst_PROGRAMS = gem_stress$(EXEEXT) $(am__EXEEXT_2) $(am__EXEEXT_3) TESTS = EXTRA_PROGRAMS = $(am__EXEEXT_2) $(am__EXEEXT_3) subdir = tests DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @HAVE_NOUVEAU_TRUE@am__EXEEXT_1 = prime_nv_api$(EXEEXT) \ @HAVE_NOUVEAU_TRUE@ prime_nv_pcopy$(EXEEXT) \ @HAVE_NOUVEAU_TRUE@ prime_nv_test$(EXEEXT) am__EXEEXT_2 = getversion$(EXEEXT) getclient$(EXEEXT) \ getstats$(EXEEXT) gem_basic$(EXEEXT) \ gem_cpu_concurrent_blit$(EXEEXT) \ gem_gtt_concurrent_blit$(EXEEXT) gem_exec_nop$(EXEEXT) \ gem_exec_blt$(EXEEXT) gem_exec_bad_domains$(EXEEXT) \ gem_exec_faulting_reloc$(EXEEXT) gem_flink$(EXEEXT) \ gem_readwrite$(EXEEXT) gem_ringfill$(EXEEXT) gem_mmap$(EXEEXT) \ gem_mmap_gtt$(EXEEXT) gem_mmap_offset_exhaustion$(EXEEXT) \ gem_pwrite$(EXEEXT) gem_pread_after_blit$(EXEEXT) \ gem_set_tiling_vs_blt$(EXEEXT) gem_set_tiling_vs_gtt$(EXEEXT) \ gem_set_tiling_vs_pwrite$(EXEEXT) gem_tiled_pread$(EXEEXT) \ gem_tiled_pread_pwrite$(EXEEXT) \ gem_tiled_partial_pwrite_pread$(EXEEXT) \ gem_tiled_swapping$(EXEEXT) gem_partial_pwrite_pread$(EXEEXT) \ gem_linear_blits$(EXEEXT) gem_vmap_blits$(EXEEXT) \ gem_tiled_blits$(EXEEXT) gem_tiled_fence_blits$(EXEEXT) \ gem_largeobject$(EXEEXT) gem_bad_length$(EXEEXT) \ gem_fence_thrash$(EXEEXT) gem_fenced_exec_thrash$(EXEEXT) \ gem_gtt_speed$(EXEEXT) gem_gtt_cpu_tlb$(EXEEXT) \ gem_cs_prefetch$(EXEEXT) gen3_render_linear_blits$(EXEEXT) \ gen3_render_tiledx_blits$(EXEEXT) \ gen3_render_tiledy_blits$(EXEEXT) \ gen3_render_mixed_blits$(EXEEXT) gen3_mixed_blits$(EXEEXT) \ gem_storedw_loop_render$(EXEEXT) gem_storedw_loop_blt$(EXEEXT) \ gem_storedw_loop_bsd$(EXEEXT) \ gem_storedw_batches_loop$(EXEEXT) \ gem_dummy_reloc_loop$(EXEEXT) gem_double_irq_loop$(EXEEXT) \ gem_ring_sync_loop$(EXEEXT) \ gem_pipe_control_store_loop$(EXEEXT) \ gem_unfence_active_buffers$(EXEEXT) \ gem_unref_active_buffers$(EXEEXT) gem_reloc_vs_gpu$(EXEEXT) \ drm_vma_limiter$(EXEEXT) drm_vma_limiter_cpu$(EXEEXT) \ drm_vma_limiter_gtt$(EXEEXT) drm_vma_limiter_cached$(EXEEXT) \ sysfs_rc6_residency$(EXEEXT) flip_test$(EXEEXT) \ gem_wait_render_timeout$(EXEEXT) gem_ctx_create$(EXEEXT) \ gem_ctx_bad_destroy$(EXEEXT) gem_ctx_exec$(EXEEXT) \ gem_ctx_bad_exec$(EXEEXT) gem_ctx_basic$(EXEEXT) \ gem_reg_read$(EXEEXT) $(am__EXEEXT_1) \ prime_self_import$(EXEEXT) testdisplay$(EXEEXT) am__EXEEXT_3 = gem_bad_batch$(EXEEXT) gem_hang$(EXEEXT) \ gem_bad_blit$(EXEEXT) gem_bad_address$(EXEEXT) PROGRAMS = $(noinst_PROGRAMS) drm_vma_limiter_SOURCES = drm_vma_limiter.c drm_vma_limiter_OBJECTS = drm_vma_limiter.$(OBJEXT) drm_vma_limiter_LDADD = $(LDADD) am__DEPENDENCIES_1 = drm_vma_limiter_DEPENDENCIES = ../lib/libintel_tools.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent drm_vma_limiter_cached_SOURCES = drm_vma_limiter_cached.c drm_vma_limiter_cached_OBJECTS = drm_vma_limiter_cached.$(OBJEXT) drm_vma_limiter_cached_LDADD = $(LDADD) drm_vma_limiter_cached_DEPENDENCIES = ../lib/libintel_tools.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) drm_vma_limiter_cpu_SOURCES = drm_vma_limiter_cpu.c drm_vma_limiter_cpu_OBJECTS = drm_vma_limiter_cpu.$(OBJEXT) drm_vma_limiter_cpu_LDADD = $(LDADD) drm_vma_limiter_cpu_DEPENDENCIES = ../lib/libintel_tools.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) drm_vma_limiter_gtt_SOURCES = drm_vma_limiter_gtt.c drm_vma_limiter_gtt_OBJECTS = drm_vma_limiter_gtt.$(OBJEXT) drm_vma_limiter_gtt_LDADD = $(LDADD) drm_vma_limiter_gtt_DEPENDENCIES = ../lib/libintel_tools.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) flip_test_SOURCES = flip_test.c flip_test_OBJECTS = flip_test.$(OBJEXT) flip_test_LDADD = $(LDADD) flip_test_DEPENDENCIES = ../lib/libintel_tools.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) gem_bad_address_SOURCES = gem_bad_address.c gem_bad_address_OBJECTS = gem_bad_address.$(OBJEXT) gem_bad_address_LDADD = $(LDADD) gem_bad_address_DEPENDENCIES = ../lib/libintel_tools.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) gem_bad_batch_SOURCES = gem_bad_batch.c gem_bad_batch_OBJECTS = gem_bad_batch.$(OBJEXT) gem_bad_batch_LDADD = $(LDADD) gem_bad_batch_DEPENDENCIES = ../lib/libintel_tools.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) gem_bad_blit_SOURCES = gem_bad_blit.c gem_bad_blit_OBJECTS = gem_bad_blit.$(OBJEXT) gem_bad_blit_LDADD = $(LDADD) gem_bad_blit_DEPENDENCIES = ../lib/libintel_tools.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) gem_bad_length_SOURCES = gem_bad_length.c gem_bad_length_OBJECTS = gem_bad_length.$(OBJEXT) gem_bad_length_LDADD = $(LDADD) gem_bad_length_DEPENDENCIES = ../lib/libintel_tools.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) gem_basic_SOURCES = gem_basic.c gem_basic_OBJECTS = gem_basic.$(OBJEXT) gem_basic_LDADD = $(LDADD) gem_basic_DEPENDENCIES = ../lib/libintel_tools.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) gem_cpu_concurrent_blit_SOURCES = gem_cpu_concurrent_blit.c gem_cpu_concurrent_blit_OBJECTS = gem_cpu_concurrent_blit.$(OBJEXT) gem_cpu_concurrent_blit_LDADD = $(LDADD) gem_cpu_concurrent_blit_DEPENDENCIES = ../lib/libintel_tools.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) gem_cs_prefetch_SOURCES = gem_cs_prefetch.c gem_cs_prefetch_OBJECTS = gem_cs_prefetch.$(OBJEXT) gem_cs_prefetch_LDADD = $(LDADD) gem_cs_prefetch_DEPENDENCIES = ../lib/libintel_tools.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) gem_ctx_bad_destroy_SOURCES = gem_ctx_bad_destroy.c gem_ctx_bad_destroy_OBJECTS = gem_ctx_bad_destroy.$(OBJEXT) gem_ctx_bad_destroy_LDADD = $(LDADD) gem_ctx_bad_destroy_DEPENDENCIES = ../lib/libintel_tools.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) gem_ctx_bad_exec_SOURCES = gem_ctx_bad_exec.c gem_ctx_bad_exec_OBJECTS = gem_ctx_bad_exec.$(OBJEXT) gem_ctx_bad_exec_LDADD = $(LDADD) gem_ctx_bad_exec_DEPENDENCIES = ../lib/libintel_tools.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) gem_ctx_basic_SOURCES = gem_ctx_basic.c gem_ctx_basic_OBJECTS = gem_ctx_basic.$(OBJEXT) am__DEPENDENCIES_2 = ../lib/libintel_tools.la $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) gem_ctx_basic_DEPENDENCIES = $(am__DEPENDENCIES_2) gem_ctx_create_SOURCES = gem_ctx_create.c gem_ctx_create_OBJECTS = gem_ctx_create.$(OBJEXT) gem_ctx_create_LDADD = $(LDADD) gem_ctx_create_DEPENDENCIES = ../lib/libintel_tools.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) gem_ctx_exec_SOURCES = gem_ctx_exec.c gem_ctx_exec_OBJECTS = gem_ctx_exec.$(OBJEXT) gem_ctx_exec_LDADD = $(LDADD) gem_ctx_exec_DEPENDENCIES = ../lib/libintel_tools.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) gem_double_irq_loop_SOURCES = gem_double_irq_loop.c gem_double_irq_loop_OBJECTS = gem_double_irq_loop.$(OBJEXT) gem_double_irq_loop_LDADD = $(LDADD) gem_double_irq_loop_DEPENDENCIES = ../lib/libintel_tools.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) gem_dummy_reloc_loop_SOURCES = gem_dummy_reloc_loop.c gem_dummy_reloc_loop_OBJECTS = gem_dummy_reloc_loop.$(OBJEXT) gem_dummy_reloc_loop_LDADD = $(LDADD) gem_dummy_reloc_loop_DEPENDENCIES = ../lib/libintel_tools.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) gem_exec_bad_domains_SOURCES = gem_exec_bad_domains.c gem_exec_bad_domains_OBJECTS = gem_exec_bad_domains.$(OBJEXT) gem_exec_bad_domains_LDADD = $(LDADD) gem_exec_bad_domains_DEPENDENCIES = ../lib/libintel_tools.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) gem_exec_blt_SOURCES = gem_exec_blt.c gem_exec_blt_OBJECTS = gem_exec_blt.$(OBJEXT) gem_exec_blt_LDADD = $(LDADD) gem_exec_blt_DEPENDENCIES = ../lib/libintel_tools.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) gem_exec_faulting_reloc_SOURCES = gem_exec_faulting_reloc.c gem_exec_faulting_reloc_OBJECTS = gem_exec_faulting_reloc.$(OBJEXT) gem_exec_faulting_reloc_LDADD = $(LDADD) gem_exec_faulting_reloc_DEPENDENCIES = ../lib/libintel_tools.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) gem_exec_nop_SOURCES = gem_exec_nop.c gem_exec_nop_OBJECTS = gem_exec_nop.$(OBJEXT) gem_exec_nop_LDADD = $(LDADD) gem_exec_nop_DEPENDENCIES = ../lib/libintel_tools.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) gem_fence_thrash_SOURCES = gem_fence_thrash.c gem_fence_thrash_OBJECTS = \ gem_fence_thrash-gem_fence_thrash.$(OBJEXT) gem_fence_thrash_DEPENDENCIES = $(am__DEPENDENCIES_2) gem_fence_thrash_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(gem_fence_thrash_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ gem_fenced_exec_thrash_SOURCES = gem_fenced_exec_thrash.c gem_fenced_exec_thrash_OBJECTS = gem_fenced_exec_thrash.$(OBJEXT) gem_fenced_exec_thrash_LDADD = $(LDADD) gem_fenced_exec_thrash_DEPENDENCIES = ../lib/libintel_tools.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) gem_flink_SOURCES = gem_flink.c gem_flink_OBJECTS = gem_flink.$(OBJEXT) gem_flink_LDADD = $(LDADD) gem_flink_DEPENDENCIES = ../lib/libintel_tools.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) gem_gtt_concurrent_blit_SOURCES = gem_gtt_concurrent_blit.c gem_gtt_concurrent_blit_OBJECTS = gem_gtt_concurrent_blit.$(OBJEXT) gem_gtt_concurrent_blit_LDADD = $(LDADD) gem_gtt_concurrent_blit_DEPENDENCIES = ../lib/libintel_tools.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) gem_gtt_cpu_tlb_SOURCES = gem_gtt_cpu_tlb.c gem_gtt_cpu_tlb_OBJECTS = gem_gtt_cpu_tlb.$(OBJEXT) gem_gtt_cpu_tlb_LDADD = $(LDADD) gem_gtt_cpu_tlb_DEPENDENCIES = ../lib/libintel_tools.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) gem_gtt_speed_SOURCES = gem_gtt_speed.c gem_gtt_speed_OBJECTS = gem_gtt_speed.$(OBJEXT) gem_gtt_speed_LDADD = $(LDADD) gem_gtt_speed_DEPENDENCIES = ../lib/libintel_tools.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) gem_hang_SOURCES = gem_hang.c gem_hang_OBJECTS = gem_hang.$(OBJEXT) gem_hang_LDADD = $(LDADD) gem_hang_DEPENDENCIES = ../lib/libintel_tools.la $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) gem_largeobject_SOURCES = gem_largeobject.c gem_largeobject_OBJECTS = gem_largeobject.$(OBJEXT) gem_largeobject_LDADD = $(LDADD) gem_largeobject_DEPENDENCIES = ../lib/libintel_tools.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) gem_linear_blits_SOURCES = gem_linear_blits.c gem_linear_blits_OBJECTS = gem_linear_blits.$(OBJEXT) gem_linear_blits_LDADD = $(LDADD) gem_linear_blits_DEPENDENCIES = ../lib/libintel_tools.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) gem_mmap_SOURCES = gem_mmap.c gem_mmap_OBJECTS = gem_mmap.$(OBJEXT) gem_mmap_LDADD = $(LDADD) gem_mmap_DEPENDENCIES = ../lib/libintel_tools.la $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) gem_mmap_gtt_SOURCES = gem_mmap_gtt.c gem_mmap_gtt_OBJECTS = gem_mmap_gtt.$(OBJEXT) gem_mmap_gtt_LDADD = $(LDADD) gem_mmap_gtt_DEPENDENCIES = ../lib/libintel_tools.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) gem_mmap_offset_exhaustion_SOURCES = gem_mmap_offset_exhaustion.c gem_mmap_offset_exhaustion_OBJECTS = \ gem_mmap_offset_exhaustion.$(OBJEXT) gem_mmap_offset_exhaustion_LDADD = $(LDADD) gem_mmap_offset_exhaustion_DEPENDENCIES = ../lib/libintel_tools.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) gem_partial_pwrite_pread_SOURCES = gem_partial_pwrite_pread.c gem_partial_pwrite_pread_OBJECTS = gem_partial_pwrite_pread.$(OBJEXT) gem_partial_pwrite_pread_LDADD = $(LDADD) gem_partial_pwrite_pread_DEPENDENCIES = ../lib/libintel_tools.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) gem_pipe_control_store_loop_SOURCES = gem_pipe_control_store_loop.c gem_pipe_control_store_loop_OBJECTS = \ gem_pipe_control_store_loop.$(OBJEXT) gem_pipe_control_store_loop_LDADD = $(LDADD) gem_pipe_control_store_loop_DEPENDENCIES = ../lib/libintel_tools.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) gem_pread_after_blit_SOURCES = gem_pread_after_blit.c gem_pread_after_blit_OBJECTS = gem_pread_after_blit.$(OBJEXT) gem_pread_after_blit_LDADD = $(LDADD) gem_pread_after_blit_DEPENDENCIES = ../lib/libintel_tools.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) gem_pwrite_SOURCES = gem_pwrite.c gem_pwrite_OBJECTS = gem_pwrite.$(OBJEXT) gem_pwrite_LDADD = $(LDADD) gem_pwrite_DEPENDENCIES = ../lib/libintel_tools.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) gem_readwrite_SOURCES = gem_readwrite.c gem_readwrite_OBJECTS = gem_readwrite.$(OBJEXT) gem_readwrite_LDADD = $(LDADD) gem_readwrite_DEPENDENCIES = ../lib/libintel_tools.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) gem_reg_read_SOURCES = gem_reg_read.c gem_reg_read_OBJECTS = gem_reg_read.$(OBJEXT) gem_reg_read_LDADD = $(LDADD) gem_reg_read_DEPENDENCIES = ../lib/libintel_tools.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) gem_reloc_vs_gpu_SOURCES = gem_reloc_vs_gpu.c gem_reloc_vs_gpu_OBJECTS = gem_reloc_vs_gpu.$(OBJEXT) gem_reloc_vs_gpu_LDADD = $(LDADD) gem_reloc_vs_gpu_DEPENDENCIES = ../lib/libintel_tools.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) gem_ring_sync_loop_SOURCES = gem_ring_sync_loop.c gem_ring_sync_loop_OBJECTS = gem_ring_sync_loop.$(OBJEXT) gem_ring_sync_loop_LDADD = $(LDADD) gem_ring_sync_loop_DEPENDENCIES = ../lib/libintel_tools.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) gem_ringfill_SOURCES = gem_ringfill.c gem_ringfill_OBJECTS = gem_ringfill.$(OBJEXT) gem_ringfill_LDADD = $(LDADD) gem_ringfill_DEPENDENCIES = ../lib/libintel_tools.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) gem_set_tiling_vs_blt_SOURCES = gem_set_tiling_vs_blt.c gem_set_tiling_vs_blt_OBJECTS = gem_set_tiling_vs_blt.$(OBJEXT) gem_set_tiling_vs_blt_LDADD = $(LDADD) gem_set_tiling_vs_blt_DEPENDENCIES = ../lib/libintel_tools.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) gem_set_tiling_vs_gtt_SOURCES = gem_set_tiling_vs_gtt.c gem_set_tiling_vs_gtt_OBJECTS = gem_set_tiling_vs_gtt.$(OBJEXT) gem_set_tiling_vs_gtt_LDADD = $(LDADD) gem_set_tiling_vs_gtt_DEPENDENCIES = ../lib/libintel_tools.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) gem_set_tiling_vs_pwrite_SOURCES = gem_set_tiling_vs_pwrite.c gem_set_tiling_vs_pwrite_OBJECTS = gem_set_tiling_vs_pwrite.$(OBJEXT) gem_set_tiling_vs_pwrite_LDADD = $(LDADD) gem_set_tiling_vs_pwrite_DEPENDENCIES = ../lib/libintel_tools.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) gem_storedw_batches_loop_SOURCES = gem_storedw_batches_loop.c gem_storedw_batches_loop_OBJECTS = gem_storedw_batches_loop.$(OBJEXT) gem_storedw_batches_loop_LDADD = $(LDADD) gem_storedw_batches_loop_DEPENDENCIES = ../lib/libintel_tools.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) gem_storedw_loop_blt_SOURCES = gem_storedw_loop_blt.c gem_storedw_loop_blt_OBJECTS = gem_storedw_loop_blt.$(OBJEXT) gem_storedw_loop_blt_LDADD = $(LDADD) gem_storedw_loop_blt_DEPENDENCIES = ../lib/libintel_tools.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) gem_storedw_loop_bsd_SOURCES = gem_storedw_loop_bsd.c gem_storedw_loop_bsd_OBJECTS = gem_storedw_loop_bsd.$(OBJEXT) gem_storedw_loop_bsd_LDADD = $(LDADD) gem_storedw_loop_bsd_DEPENDENCIES = ../lib/libintel_tools.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) gem_storedw_loop_render_SOURCES = gem_storedw_loop_render.c gem_storedw_loop_render_OBJECTS = gem_storedw_loop_render.$(OBJEXT) gem_storedw_loop_render_LDADD = $(LDADD) gem_storedw_loop_render_DEPENDENCIES = ../lib/libintel_tools.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) gem_stress_SOURCES = gem_stress.c gem_stress_OBJECTS = gem_stress.$(OBJEXT) gem_stress_LDADD = $(LDADD) gem_stress_DEPENDENCIES = ../lib/libintel_tools.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) gem_tiled_blits_SOURCES = gem_tiled_blits.c gem_tiled_blits_OBJECTS = gem_tiled_blits.$(OBJEXT) gem_tiled_blits_LDADD = $(LDADD) gem_tiled_blits_DEPENDENCIES = ../lib/libintel_tools.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) gem_tiled_fence_blits_SOURCES = gem_tiled_fence_blits.c gem_tiled_fence_blits_OBJECTS = gem_tiled_fence_blits.$(OBJEXT) gem_tiled_fence_blits_LDADD = $(LDADD) gem_tiled_fence_blits_DEPENDENCIES = ../lib/libintel_tools.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) gem_tiled_partial_pwrite_pread_SOURCES = \ gem_tiled_partial_pwrite_pread.c gem_tiled_partial_pwrite_pread_OBJECTS = \ gem_tiled_partial_pwrite_pread.$(OBJEXT) gem_tiled_partial_pwrite_pread_LDADD = $(LDADD) gem_tiled_partial_pwrite_pread_DEPENDENCIES = \ ../lib/libintel_tools.la $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) gem_tiled_pread_SOURCES = gem_tiled_pread.c gem_tiled_pread_OBJECTS = gem_tiled_pread.$(OBJEXT) gem_tiled_pread_LDADD = $(LDADD) gem_tiled_pread_DEPENDENCIES = ../lib/libintel_tools.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) gem_tiled_pread_pwrite_SOURCES = gem_tiled_pread_pwrite.c gem_tiled_pread_pwrite_OBJECTS = gem_tiled_pread_pwrite.$(OBJEXT) gem_tiled_pread_pwrite_LDADD = $(LDADD) gem_tiled_pread_pwrite_DEPENDENCIES = ../lib/libintel_tools.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) gem_tiled_swapping_SOURCES = gem_tiled_swapping.c gem_tiled_swapping_OBJECTS = gem_tiled_swapping.$(OBJEXT) gem_tiled_swapping_LDADD = $(LDADD) gem_tiled_swapping_DEPENDENCIES = ../lib/libintel_tools.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) gem_unfence_active_buffers_SOURCES = gem_unfence_active_buffers.c gem_unfence_active_buffers_OBJECTS = \ gem_unfence_active_buffers.$(OBJEXT) gem_unfence_active_buffers_LDADD = $(LDADD) gem_unfence_active_buffers_DEPENDENCIES = ../lib/libintel_tools.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) gem_unref_active_buffers_SOURCES = gem_unref_active_buffers.c gem_unref_active_buffers_OBJECTS = gem_unref_active_buffers.$(OBJEXT) gem_unref_active_buffers_LDADD = $(LDADD) gem_unref_active_buffers_DEPENDENCIES = ../lib/libintel_tools.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) gem_vmap_blits_SOURCES = gem_vmap_blits.c gem_vmap_blits_OBJECTS = gem_vmap_blits.$(OBJEXT) gem_vmap_blits_LDADD = $(LDADD) gem_vmap_blits_DEPENDENCIES = ../lib/libintel_tools.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) gem_wait_render_timeout_SOURCES = gem_wait_render_timeout.c gem_wait_render_timeout_OBJECTS = gem_wait_render_timeout.$(OBJEXT) gem_wait_render_timeout_DEPENDENCIES = $(am__DEPENDENCIES_2) gen3_mixed_blits_SOURCES = gen3_mixed_blits.c gen3_mixed_blits_OBJECTS = gen3_mixed_blits.$(OBJEXT) gen3_mixed_blits_LDADD = $(LDADD) gen3_mixed_blits_DEPENDENCIES = ../lib/libintel_tools.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) gen3_render_linear_blits_SOURCES = gen3_render_linear_blits.c gen3_render_linear_blits_OBJECTS = gen3_render_linear_blits.$(OBJEXT) gen3_render_linear_blits_LDADD = $(LDADD) gen3_render_linear_blits_DEPENDENCIES = ../lib/libintel_tools.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) gen3_render_mixed_blits_SOURCES = gen3_render_mixed_blits.c gen3_render_mixed_blits_OBJECTS = gen3_render_mixed_blits.$(OBJEXT) gen3_render_mixed_blits_LDADD = $(LDADD) gen3_render_mixed_blits_DEPENDENCIES = ../lib/libintel_tools.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) gen3_render_tiledx_blits_SOURCES = gen3_render_tiledx_blits.c gen3_render_tiledx_blits_OBJECTS = gen3_render_tiledx_blits.$(OBJEXT) gen3_render_tiledx_blits_LDADD = $(LDADD) gen3_render_tiledx_blits_DEPENDENCIES = ../lib/libintel_tools.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) gen3_render_tiledy_blits_SOURCES = gen3_render_tiledy_blits.c gen3_render_tiledy_blits_OBJECTS = gen3_render_tiledy_blits.$(OBJEXT) gen3_render_tiledy_blits_LDADD = $(LDADD) gen3_render_tiledy_blits_DEPENDENCIES = ../lib/libintel_tools.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) getclient_SOURCES = getclient.c getclient_OBJECTS = getclient.$(OBJEXT) getclient_LDADD = $(LDADD) getclient_DEPENDENCIES = ../lib/libintel_tools.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) getstats_SOURCES = getstats.c getstats_OBJECTS = getstats.$(OBJEXT) getstats_LDADD = $(LDADD) getstats_DEPENDENCIES = ../lib/libintel_tools.la $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) getversion_SOURCES = getversion.c getversion_OBJECTS = getversion.$(OBJEXT) getversion_LDADD = $(LDADD) getversion_DEPENDENCIES = ../lib/libintel_tools.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) prime_nv_api_SOURCES = prime_nv_api.c prime_nv_api_OBJECTS = prime_nv_api-prime_nv_api.$(OBJEXT) prime_nv_api_DEPENDENCIES = $(am__DEPENDENCIES_2) \ $(am__DEPENDENCIES_1) prime_nv_api_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(prime_nv_api_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ prime_nv_pcopy_SOURCES = prime_nv_pcopy.c prime_nv_pcopy_OBJECTS = prime_nv_pcopy-prime_nv_pcopy.$(OBJEXT) prime_nv_pcopy_DEPENDENCIES = $(am__DEPENDENCIES_2) \ $(am__DEPENDENCIES_1) prime_nv_pcopy_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(prime_nv_pcopy_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o \ $@ prime_nv_test_SOURCES = prime_nv_test.c prime_nv_test_OBJECTS = prime_nv_test-prime_nv_test.$(OBJEXT) prime_nv_test_DEPENDENCIES = $(am__DEPENDENCIES_2) \ $(am__DEPENDENCIES_1) prime_nv_test_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(prime_nv_test_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ prime_self_import_SOURCES = prime_self_import.c prime_self_import_OBJECTS = prime_self_import.$(OBJEXT) prime_self_import_LDADD = $(LDADD) prime_self_import_DEPENDENCIES = ../lib/libintel_tools.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) sysfs_rc6_residency_SOURCES = sysfs_rc6_residency.c sysfs_rc6_residency_OBJECTS = sysfs_rc6_residency.$(OBJEXT) sysfs_rc6_residency_LDADD = $(LDADD) sysfs_rc6_residency_DEPENDENCIES = ../lib/libintel_tools.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) am_testdisplay_OBJECTS = testdisplay.$(OBJEXT) \ testdisplay_hotplug.$(OBJEXT) testdisplay_OBJECTS = $(am_testdisplay_OBJECTS) testdisplay_LDADD = $(LDADD) testdisplay_DEPENDENCIES = ../lib/libintel_tools.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; SOURCES = drm_vma_limiter.c drm_vma_limiter_cached.c \ drm_vma_limiter_cpu.c drm_vma_limiter_gtt.c flip_test.c \ gem_bad_address.c gem_bad_batch.c gem_bad_blit.c \ gem_bad_length.c gem_basic.c gem_cpu_concurrent_blit.c \ gem_cs_prefetch.c gem_ctx_bad_destroy.c gem_ctx_bad_exec.c \ gem_ctx_basic.c gem_ctx_create.c gem_ctx_exec.c \ gem_double_irq_loop.c gem_dummy_reloc_loop.c \ gem_exec_bad_domains.c gem_exec_blt.c \ gem_exec_faulting_reloc.c gem_exec_nop.c gem_fence_thrash.c \ gem_fenced_exec_thrash.c gem_flink.c gem_gtt_concurrent_blit.c \ gem_gtt_cpu_tlb.c gem_gtt_speed.c gem_hang.c gem_largeobject.c \ gem_linear_blits.c gem_mmap.c gem_mmap_gtt.c \ gem_mmap_offset_exhaustion.c gem_partial_pwrite_pread.c \ gem_pipe_control_store_loop.c gem_pread_after_blit.c \ gem_pwrite.c gem_readwrite.c gem_reg_read.c gem_reloc_vs_gpu.c \ gem_ring_sync_loop.c gem_ringfill.c gem_set_tiling_vs_blt.c \ gem_set_tiling_vs_gtt.c gem_set_tiling_vs_pwrite.c \ gem_storedw_batches_loop.c gem_storedw_loop_blt.c \ gem_storedw_loop_bsd.c gem_storedw_loop_render.c gem_stress.c \ gem_tiled_blits.c gem_tiled_fence_blits.c \ gem_tiled_partial_pwrite_pread.c gem_tiled_pread.c \ gem_tiled_pread_pwrite.c gem_tiled_swapping.c \ gem_unfence_active_buffers.c gem_unref_active_buffers.c \ gem_vmap_blits.c gem_wait_render_timeout.c gen3_mixed_blits.c \ gen3_render_linear_blits.c gen3_render_mixed_blits.c \ gen3_render_tiledx_blits.c gen3_render_tiledy_blits.c \ getclient.c getstats.c getversion.c prime_nv_api.c \ prime_nv_pcopy.c prime_nv_test.c prime_self_import.c \ sysfs_rc6_residency.c $(testdisplay_SOURCES) DIST_SOURCES = drm_vma_limiter.c drm_vma_limiter_cached.c \ drm_vma_limiter_cpu.c drm_vma_limiter_gtt.c flip_test.c \ gem_bad_address.c gem_bad_batch.c gem_bad_blit.c \ gem_bad_length.c gem_basic.c gem_cpu_concurrent_blit.c \ gem_cs_prefetch.c gem_ctx_bad_destroy.c gem_ctx_bad_exec.c \ gem_ctx_basic.c gem_ctx_create.c gem_ctx_exec.c \ gem_double_irq_loop.c gem_dummy_reloc_loop.c \ gem_exec_bad_domains.c gem_exec_blt.c \ gem_exec_faulting_reloc.c gem_exec_nop.c gem_fence_thrash.c \ gem_fenced_exec_thrash.c gem_flink.c gem_gtt_concurrent_blit.c \ gem_gtt_cpu_tlb.c gem_gtt_speed.c gem_hang.c gem_largeobject.c \ gem_linear_blits.c gem_mmap.c gem_mmap_gtt.c \ gem_mmap_offset_exhaustion.c gem_partial_pwrite_pread.c \ gem_pipe_control_store_loop.c gem_pread_after_blit.c \ gem_pwrite.c gem_readwrite.c gem_reg_read.c gem_reloc_vs_gpu.c \ gem_ring_sync_loop.c gem_ringfill.c gem_set_tiling_vs_blt.c \ gem_set_tiling_vs_gtt.c gem_set_tiling_vs_pwrite.c \ gem_storedw_batches_loop.c gem_storedw_loop_blt.c \ gem_storedw_loop_bsd.c gem_storedw_loop_render.c gem_stress.c \ gem_tiled_blits.c gem_tiled_fence_blits.c \ gem_tiled_partial_pwrite_pread.c gem_tiled_pread.c \ gem_tiled_pread_pwrite.c gem_tiled_swapping.c \ gem_unfence_active_buffers.c gem_unref_active_buffers.c \ gem_vmap_blits.c gem_wait_render_timeout.c gen3_mixed_blits.c \ gen3_render_linear_blits.c gen3_render_mixed_blits.c \ gen3_render_tiledx_blits.c gen3_render_tiledy_blits.c \ getclient.c getstats.c getversion.c prime_nv_api.c \ prime_nv_pcopy.c prime_nv_test.c prime_self_import.c \ sysfs_rc6_residency.c $(testdisplay_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac ETAGS = etags CTAGS = ctags am__tty_colors = \ red=; grn=; lgn=; blu=; std= 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@ CAIRO_CFLAGS = @CAIRO_CFLAGS@ CAIRO_LIBS = @CAIRO_LIBS@ 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@ DRM_CFLAGS = @DRM_CFLAGS@ DRM_LIBS = @DRM_LIBS@ DRM_NOUVEAU_CFLAGS = @DRM_NOUVEAU_CFLAGS@ DRM_NOUVEAU_LIBS = @DRM_NOUVEAU_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILE_MAN_DIR = @FILE_MAN_DIR@ FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@ GEN4ASM = @GEN4ASM@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_LIBS = @GLIB_LIBS@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_CMD = @INSTALL_CMD@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBUDEV_CFLAGS = @LIBUDEV_CFLAGS@ LIBUDEV_LIBS = @LIBUDEV_LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MAN_SUBSTS = @MAN_SUBSTS@ MISC_MAN_DIR = @MISC_MAN_DIR@ MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJCOPY = @OBJCOPY@ 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@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ THREAD_CFLAGS = @THREAD_CFLAGS@ VERSION = @VERSION@ 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@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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@ @HAVE_NOUVEAU_TRUE@NOUVEAU_TESTS = \ @HAVE_NOUVEAU_TRUE@ prime_nv_api \ @HAVE_NOUVEAU_TRUE@ prime_nv_pcopy \ @HAVE_NOUVEAU_TRUE@ prime_nv_test TESTS_progs = getversion getclient getstats gem_basic \ gem_cpu_concurrent_blit gem_gtt_concurrent_blit gem_exec_nop \ gem_exec_blt gem_exec_bad_domains gem_exec_faulting_reloc \ gem_flink gem_readwrite gem_ringfill gem_mmap gem_mmap_gtt \ gem_mmap_offset_exhaustion gem_pwrite gem_pread_after_blit \ gem_set_tiling_vs_blt gem_set_tiling_vs_gtt \ gem_set_tiling_vs_pwrite gem_tiled_pread \ gem_tiled_pread_pwrite gem_tiled_partial_pwrite_pread \ gem_tiled_swapping gem_partial_pwrite_pread gem_linear_blits \ gem_vmap_blits gem_tiled_blits gem_tiled_fence_blits \ gem_largeobject gem_bad_length gem_fence_thrash \ gem_fenced_exec_thrash gem_gtt_speed gem_gtt_cpu_tlb \ gem_cs_prefetch gen3_render_linear_blits \ gen3_render_tiledx_blits gen3_render_tiledy_blits \ gen3_render_mixed_blits gen3_mixed_blits \ gem_storedw_loop_render gem_storedw_loop_blt \ gem_storedw_loop_bsd gem_storedw_batches_loop \ gem_dummy_reloc_loop gem_double_irq_loop gem_ring_sync_loop \ gem_pipe_control_store_loop gem_unfence_active_buffers \ gem_unref_active_buffers gem_reloc_vs_gpu drm_vma_limiter \ drm_vma_limiter_cpu drm_vma_limiter_gtt drm_vma_limiter_cached \ sysfs_rc6_residency flip_test gem_wait_render_timeout \ gem_ctx_create gem_ctx_bad_destroy gem_ctx_exec \ gem_ctx_bad_exec gem_ctx_basic gem_reg_read $(NOUVEAU_TESTS) \ prime_self_import $(NULL) testdisplay # IMPORTANT: The ZZ_ tests need to be run last! # ... and make can't deal with inlined comments ... TESTS_scripts = \ debugfs_reader \ debugfs_emon_crash \ sysfs_l3_parity \ sysfs_edid_timing \ module_reload \ ZZ_check_dmesg \ ZZ_hangman \ $(NULL) kernel_tests = \ $(TESTS_progs) \ $(TESTS_scripts) \ $(NULL) HANG = \ gem_bad_batch \ gem_hang \ gem_bad_blit \ gem_bad_address \ $(NULL) EXTRA_DIST = $(TESTS_scripts) drm_lib.sh check_drm_clients debugfs_wedged CLEANFILES = $(EXTRA_PROGRAMS) AM_CFLAGS = $(DRM_CFLAGS) $(CWARNFLAGS) -I$(srcdir)/.. \ -I$(srcdir)/../lib $(CAIRO_CFLAGS) $(LIBUDEV_CFLAGS) \ $(GLIB_CFLAGS) LDADD = ../lib/libintel_tools.la $(PCIACCESS_LIBS) $(DRM_LIBS) \ $(CAIRO_LIBS) $(LIBUDEV_LIBS) $(GLIB_LIBS) testdisplay_SOURCES = \ testdisplay.c \ testdisplay.h \ testdisplay_hotplug.c \ $(NULL) gem_fence_thrash_CFLAGS = $(AM_CFLAGS) $(THREAD_CFLAGS) gem_fence_thrash_LDADD = $(LDADD) -lpthread gem_wait_render_timeout_LDADD = $(LDADD) -lrt gem_ctx_basic_LDADD = $(LDADD) -lpthread prime_nv_test_CFLAGS = $(AM_CFLAGS) $(DRM_NOUVEAU_CFLAGS) prime_nv_test_LDADD = $(LDADD) $(DRM_NOUVEAU_LIBS) prime_nv_api_CFLAGS = $(AM_CFLAGS) $(DRM_NOUVEAU_CFLAGS) prime_nv_api_LDADD = $(LDADD) $(DRM_NOUVEAU_LIBS) prime_nv_pcopy_CFLAGS = $(AM_CFLAGS) $(DRM_NOUVEAU_CFLAGS) prime_nv_pcopy_LDADD = $(LDADD) $(DRM_NOUVEAU_LIBS) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tests/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign tests/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list drm_vma_limiter$(EXEEXT): $(drm_vma_limiter_OBJECTS) $(drm_vma_limiter_DEPENDENCIES) $(EXTRA_drm_vma_limiter_DEPENDENCIES) @rm -f drm_vma_limiter$(EXEEXT) $(AM_V_CCLD)$(LINK) $(drm_vma_limiter_OBJECTS) $(drm_vma_limiter_LDADD) $(LIBS) drm_vma_limiter_cached$(EXEEXT): $(drm_vma_limiter_cached_OBJECTS) $(drm_vma_limiter_cached_DEPENDENCIES) $(EXTRA_drm_vma_limiter_cached_DEPENDENCIES) @rm -f drm_vma_limiter_cached$(EXEEXT) $(AM_V_CCLD)$(LINK) $(drm_vma_limiter_cached_OBJECTS) $(drm_vma_limiter_cached_LDADD) $(LIBS) drm_vma_limiter_cpu$(EXEEXT): $(drm_vma_limiter_cpu_OBJECTS) $(drm_vma_limiter_cpu_DEPENDENCIES) $(EXTRA_drm_vma_limiter_cpu_DEPENDENCIES) @rm -f drm_vma_limiter_cpu$(EXEEXT) $(AM_V_CCLD)$(LINK) $(drm_vma_limiter_cpu_OBJECTS) $(drm_vma_limiter_cpu_LDADD) $(LIBS) drm_vma_limiter_gtt$(EXEEXT): $(drm_vma_limiter_gtt_OBJECTS) $(drm_vma_limiter_gtt_DEPENDENCIES) $(EXTRA_drm_vma_limiter_gtt_DEPENDENCIES) @rm -f drm_vma_limiter_gtt$(EXEEXT) $(AM_V_CCLD)$(LINK) $(drm_vma_limiter_gtt_OBJECTS) $(drm_vma_limiter_gtt_LDADD) $(LIBS) flip_test$(EXEEXT): $(flip_test_OBJECTS) $(flip_test_DEPENDENCIES) $(EXTRA_flip_test_DEPENDENCIES) @rm -f flip_test$(EXEEXT) $(AM_V_CCLD)$(LINK) $(flip_test_OBJECTS) $(flip_test_LDADD) $(LIBS) gem_bad_address$(EXEEXT): $(gem_bad_address_OBJECTS) $(gem_bad_address_DEPENDENCIES) $(EXTRA_gem_bad_address_DEPENDENCIES) @rm -f gem_bad_address$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gem_bad_address_OBJECTS) $(gem_bad_address_LDADD) $(LIBS) gem_bad_batch$(EXEEXT): $(gem_bad_batch_OBJECTS) $(gem_bad_batch_DEPENDENCIES) $(EXTRA_gem_bad_batch_DEPENDENCIES) @rm -f gem_bad_batch$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gem_bad_batch_OBJECTS) $(gem_bad_batch_LDADD) $(LIBS) gem_bad_blit$(EXEEXT): $(gem_bad_blit_OBJECTS) $(gem_bad_blit_DEPENDENCIES) $(EXTRA_gem_bad_blit_DEPENDENCIES) @rm -f gem_bad_blit$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gem_bad_blit_OBJECTS) $(gem_bad_blit_LDADD) $(LIBS) gem_bad_length$(EXEEXT): $(gem_bad_length_OBJECTS) $(gem_bad_length_DEPENDENCIES) $(EXTRA_gem_bad_length_DEPENDENCIES) @rm -f gem_bad_length$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gem_bad_length_OBJECTS) $(gem_bad_length_LDADD) $(LIBS) gem_basic$(EXEEXT): $(gem_basic_OBJECTS) $(gem_basic_DEPENDENCIES) $(EXTRA_gem_basic_DEPENDENCIES) @rm -f gem_basic$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gem_basic_OBJECTS) $(gem_basic_LDADD) $(LIBS) gem_cpu_concurrent_blit$(EXEEXT): $(gem_cpu_concurrent_blit_OBJECTS) $(gem_cpu_concurrent_blit_DEPENDENCIES) $(EXTRA_gem_cpu_concurrent_blit_DEPENDENCIES) @rm -f gem_cpu_concurrent_blit$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gem_cpu_concurrent_blit_OBJECTS) $(gem_cpu_concurrent_blit_LDADD) $(LIBS) gem_cs_prefetch$(EXEEXT): $(gem_cs_prefetch_OBJECTS) $(gem_cs_prefetch_DEPENDENCIES) $(EXTRA_gem_cs_prefetch_DEPENDENCIES) @rm -f gem_cs_prefetch$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gem_cs_prefetch_OBJECTS) $(gem_cs_prefetch_LDADD) $(LIBS) gem_ctx_bad_destroy$(EXEEXT): $(gem_ctx_bad_destroy_OBJECTS) $(gem_ctx_bad_destroy_DEPENDENCIES) $(EXTRA_gem_ctx_bad_destroy_DEPENDENCIES) @rm -f gem_ctx_bad_destroy$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gem_ctx_bad_destroy_OBJECTS) $(gem_ctx_bad_destroy_LDADD) $(LIBS) gem_ctx_bad_exec$(EXEEXT): $(gem_ctx_bad_exec_OBJECTS) $(gem_ctx_bad_exec_DEPENDENCIES) $(EXTRA_gem_ctx_bad_exec_DEPENDENCIES) @rm -f gem_ctx_bad_exec$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gem_ctx_bad_exec_OBJECTS) $(gem_ctx_bad_exec_LDADD) $(LIBS) gem_ctx_basic$(EXEEXT): $(gem_ctx_basic_OBJECTS) $(gem_ctx_basic_DEPENDENCIES) $(EXTRA_gem_ctx_basic_DEPENDENCIES) @rm -f gem_ctx_basic$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gem_ctx_basic_OBJECTS) $(gem_ctx_basic_LDADD) $(LIBS) gem_ctx_create$(EXEEXT): $(gem_ctx_create_OBJECTS) $(gem_ctx_create_DEPENDENCIES) $(EXTRA_gem_ctx_create_DEPENDENCIES) @rm -f gem_ctx_create$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gem_ctx_create_OBJECTS) $(gem_ctx_create_LDADD) $(LIBS) gem_ctx_exec$(EXEEXT): $(gem_ctx_exec_OBJECTS) $(gem_ctx_exec_DEPENDENCIES) $(EXTRA_gem_ctx_exec_DEPENDENCIES) @rm -f gem_ctx_exec$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gem_ctx_exec_OBJECTS) $(gem_ctx_exec_LDADD) $(LIBS) gem_double_irq_loop$(EXEEXT): $(gem_double_irq_loop_OBJECTS) $(gem_double_irq_loop_DEPENDENCIES) $(EXTRA_gem_double_irq_loop_DEPENDENCIES) @rm -f gem_double_irq_loop$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gem_double_irq_loop_OBJECTS) $(gem_double_irq_loop_LDADD) $(LIBS) gem_dummy_reloc_loop$(EXEEXT): $(gem_dummy_reloc_loop_OBJECTS) $(gem_dummy_reloc_loop_DEPENDENCIES) $(EXTRA_gem_dummy_reloc_loop_DEPENDENCIES) @rm -f gem_dummy_reloc_loop$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gem_dummy_reloc_loop_OBJECTS) $(gem_dummy_reloc_loop_LDADD) $(LIBS) gem_exec_bad_domains$(EXEEXT): $(gem_exec_bad_domains_OBJECTS) $(gem_exec_bad_domains_DEPENDENCIES) $(EXTRA_gem_exec_bad_domains_DEPENDENCIES) @rm -f gem_exec_bad_domains$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gem_exec_bad_domains_OBJECTS) $(gem_exec_bad_domains_LDADD) $(LIBS) gem_exec_blt$(EXEEXT): $(gem_exec_blt_OBJECTS) $(gem_exec_blt_DEPENDENCIES) $(EXTRA_gem_exec_blt_DEPENDENCIES) @rm -f gem_exec_blt$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gem_exec_blt_OBJECTS) $(gem_exec_blt_LDADD) $(LIBS) gem_exec_faulting_reloc$(EXEEXT): $(gem_exec_faulting_reloc_OBJECTS) $(gem_exec_faulting_reloc_DEPENDENCIES) $(EXTRA_gem_exec_faulting_reloc_DEPENDENCIES) @rm -f gem_exec_faulting_reloc$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gem_exec_faulting_reloc_OBJECTS) $(gem_exec_faulting_reloc_LDADD) $(LIBS) gem_exec_nop$(EXEEXT): $(gem_exec_nop_OBJECTS) $(gem_exec_nop_DEPENDENCIES) $(EXTRA_gem_exec_nop_DEPENDENCIES) @rm -f gem_exec_nop$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gem_exec_nop_OBJECTS) $(gem_exec_nop_LDADD) $(LIBS) gem_fence_thrash$(EXEEXT): $(gem_fence_thrash_OBJECTS) $(gem_fence_thrash_DEPENDENCIES) $(EXTRA_gem_fence_thrash_DEPENDENCIES) @rm -f gem_fence_thrash$(EXEEXT) $(AM_V_CCLD)$(gem_fence_thrash_LINK) $(gem_fence_thrash_OBJECTS) $(gem_fence_thrash_LDADD) $(LIBS) gem_fenced_exec_thrash$(EXEEXT): $(gem_fenced_exec_thrash_OBJECTS) $(gem_fenced_exec_thrash_DEPENDENCIES) $(EXTRA_gem_fenced_exec_thrash_DEPENDENCIES) @rm -f gem_fenced_exec_thrash$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gem_fenced_exec_thrash_OBJECTS) $(gem_fenced_exec_thrash_LDADD) $(LIBS) gem_flink$(EXEEXT): $(gem_flink_OBJECTS) $(gem_flink_DEPENDENCIES) $(EXTRA_gem_flink_DEPENDENCIES) @rm -f gem_flink$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gem_flink_OBJECTS) $(gem_flink_LDADD) $(LIBS) gem_gtt_concurrent_blit$(EXEEXT): $(gem_gtt_concurrent_blit_OBJECTS) $(gem_gtt_concurrent_blit_DEPENDENCIES) $(EXTRA_gem_gtt_concurrent_blit_DEPENDENCIES) @rm -f gem_gtt_concurrent_blit$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gem_gtt_concurrent_blit_OBJECTS) $(gem_gtt_concurrent_blit_LDADD) $(LIBS) gem_gtt_cpu_tlb$(EXEEXT): $(gem_gtt_cpu_tlb_OBJECTS) $(gem_gtt_cpu_tlb_DEPENDENCIES) $(EXTRA_gem_gtt_cpu_tlb_DEPENDENCIES) @rm -f gem_gtt_cpu_tlb$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gem_gtt_cpu_tlb_OBJECTS) $(gem_gtt_cpu_tlb_LDADD) $(LIBS) gem_gtt_speed$(EXEEXT): $(gem_gtt_speed_OBJECTS) $(gem_gtt_speed_DEPENDENCIES) $(EXTRA_gem_gtt_speed_DEPENDENCIES) @rm -f gem_gtt_speed$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gem_gtt_speed_OBJECTS) $(gem_gtt_speed_LDADD) $(LIBS) gem_hang$(EXEEXT): $(gem_hang_OBJECTS) $(gem_hang_DEPENDENCIES) $(EXTRA_gem_hang_DEPENDENCIES) @rm -f gem_hang$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gem_hang_OBJECTS) $(gem_hang_LDADD) $(LIBS) gem_largeobject$(EXEEXT): $(gem_largeobject_OBJECTS) $(gem_largeobject_DEPENDENCIES) $(EXTRA_gem_largeobject_DEPENDENCIES) @rm -f gem_largeobject$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gem_largeobject_OBJECTS) $(gem_largeobject_LDADD) $(LIBS) gem_linear_blits$(EXEEXT): $(gem_linear_blits_OBJECTS) $(gem_linear_blits_DEPENDENCIES) $(EXTRA_gem_linear_blits_DEPENDENCIES) @rm -f gem_linear_blits$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gem_linear_blits_OBJECTS) $(gem_linear_blits_LDADD) $(LIBS) gem_mmap$(EXEEXT): $(gem_mmap_OBJECTS) $(gem_mmap_DEPENDENCIES) $(EXTRA_gem_mmap_DEPENDENCIES) @rm -f gem_mmap$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gem_mmap_OBJECTS) $(gem_mmap_LDADD) $(LIBS) gem_mmap_gtt$(EXEEXT): $(gem_mmap_gtt_OBJECTS) $(gem_mmap_gtt_DEPENDENCIES) $(EXTRA_gem_mmap_gtt_DEPENDENCIES) @rm -f gem_mmap_gtt$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gem_mmap_gtt_OBJECTS) $(gem_mmap_gtt_LDADD) $(LIBS) gem_mmap_offset_exhaustion$(EXEEXT): $(gem_mmap_offset_exhaustion_OBJECTS) $(gem_mmap_offset_exhaustion_DEPENDENCIES) $(EXTRA_gem_mmap_offset_exhaustion_DEPENDENCIES) @rm -f gem_mmap_offset_exhaustion$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gem_mmap_offset_exhaustion_OBJECTS) $(gem_mmap_offset_exhaustion_LDADD) $(LIBS) gem_partial_pwrite_pread$(EXEEXT): $(gem_partial_pwrite_pread_OBJECTS) $(gem_partial_pwrite_pread_DEPENDENCIES) $(EXTRA_gem_partial_pwrite_pread_DEPENDENCIES) @rm -f gem_partial_pwrite_pread$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gem_partial_pwrite_pread_OBJECTS) $(gem_partial_pwrite_pread_LDADD) $(LIBS) gem_pipe_control_store_loop$(EXEEXT): $(gem_pipe_control_store_loop_OBJECTS) $(gem_pipe_control_store_loop_DEPENDENCIES) $(EXTRA_gem_pipe_control_store_loop_DEPENDENCIES) @rm -f gem_pipe_control_store_loop$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gem_pipe_control_store_loop_OBJECTS) $(gem_pipe_control_store_loop_LDADD) $(LIBS) gem_pread_after_blit$(EXEEXT): $(gem_pread_after_blit_OBJECTS) $(gem_pread_after_blit_DEPENDENCIES) $(EXTRA_gem_pread_after_blit_DEPENDENCIES) @rm -f gem_pread_after_blit$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gem_pread_after_blit_OBJECTS) $(gem_pread_after_blit_LDADD) $(LIBS) gem_pwrite$(EXEEXT): $(gem_pwrite_OBJECTS) $(gem_pwrite_DEPENDENCIES) $(EXTRA_gem_pwrite_DEPENDENCIES) @rm -f gem_pwrite$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gem_pwrite_OBJECTS) $(gem_pwrite_LDADD) $(LIBS) gem_readwrite$(EXEEXT): $(gem_readwrite_OBJECTS) $(gem_readwrite_DEPENDENCIES) $(EXTRA_gem_readwrite_DEPENDENCIES) @rm -f gem_readwrite$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gem_readwrite_OBJECTS) $(gem_readwrite_LDADD) $(LIBS) gem_reg_read$(EXEEXT): $(gem_reg_read_OBJECTS) $(gem_reg_read_DEPENDENCIES) $(EXTRA_gem_reg_read_DEPENDENCIES) @rm -f gem_reg_read$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gem_reg_read_OBJECTS) $(gem_reg_read_LDADD) $(LIBS) gem_reloc_vs_gpu$(EXEEXT): $(gem_reloc_vs_gpu_OBJECTS) $(gem_reloc_vs_gpu_DEPENDENCIES) $(EXTRA_gem_reloc_vs_gpu_DEPENDENCIES) @rm -f gem_reloc_vs_gpu$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gem_reloc_vs_gpu_OBJECTS) $(gem_reloc_vs_gpu_LDADD) $(LIBS) gem_ring_sync_loop$(EXEEXT): $(gem_ring_sync_loop_OBJECTS) $(gem_ring_sync_loop_DEPENDENCIES) $(EXTRA_gem_ring_sync_loop_DEPENDENCIES) @rm -f gem_ring_sync_loop$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gem_ring_sync_loop_OBJECTS) $(gem_ring_sync_loop_LDADD) $(LIBS) gem_ringfill$(EXEEXT): $(gem_ringfill_OBJECTS) $(gem_ringfill_DEPENDENCIES) $(EXTRA_gem_ringfill_DEPENDENCIES) @rm -f gem_ringfill$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gem_ringfill_OBJECTS) $(gem_ringfill_LDADD) $(LIBS) gem_set_tiling_vs_blt$(EXEEXT): $(gem_set_tiling_vs_blt_OBJECTS) $(gem_set_tiling_vs_blt_DEPENDENCIES) $(EXTRA_gem_set_tiling_vs_blt_DEPENDENCIES) @rm -f gem_set_tiling_vs_blt$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gem_set_tiling_vs_blt_OBJECTS) $(gem_set_tiling_vs_blt_LDADD) $(LIBS) gem_set_tiling_vs_gtt$(EXEEXT): $(gem_set_tiling_vs_gtt_OBJECTS) $(gem_set_tiling_vs_gtt_DEPENDENCIES) $(EXTRA_gem_set_tiling_vs_gtt_DEPENDENCIES) @rm -f gem_set_tiling_vs_gtt$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gem_set_tiling_vs_gtt_OBJECTS) $(gem_set_tiling_vs_gtt_LDADD) $(LIBS) gem_set_tiling_vs_pwrite$(EXEEXT): $(gem_set_tiling_vs_pwrite_OBJECTS) $(gem_set_tiling_vs_pwrite_DEPENDENCIES) $(EXTRA_gem_set_tiling_vs_pwrite_DEPENDENCIES) @rm -f gem_set_tiling_vs_pwrite$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gem_set_tiling_vs_pwrite_OBJECTS) $(gem_set_tiling_vs_pwrite_LDADD) $(LIBS) gem_storedw_batches_loop$(EXEEXT): $(gem_storedw_batches_loop_OBJECTS) $(gem_storedw_batches_loop_DEPENDENCIES) $(EXTRA_gem_storedw_batches_loop_DEPENDENCIES) @rm -f gem_storedw_batches_loop$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gem_storedw_batches_loop_OBJECTS) $(gem_storedw_batches_loop_LDADD) $(LIBS) gem_storedw_loop_blt$(EXEEXT): $(gem_storedw_loop_blt_OBJECTS) $(gem_storedw_loop_blt_DEPENDENCIES) $(EXTRA_gem_storedw_loop_blt_DEPENDENCIES) @rm -f gem_storedw_loop_blt$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gem_storedw_loop_blt_OBJECTS) $(gem_storedw_loop_blt_LDADD) $(LIBS) gem_storedw_loop_bsd$(EXEEXT): $(gem_storedw_loop_bsd_OBJECTS) $(gem_storedw_loop_bsd_DEPENDENCIES) $(EXTRA_gem_storedw_loop_bsd_DEPENDENCIES) @rm -f gem_storedw_loop_bsd$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gem_storedw_loop_bsd_OBJECTS) $(gem_storedw_loop_bsd_LDADD) $(LIBS) gem_storedw_loop_render$(EXEEXT): $(gem_storedw_loop_render_OBJECTS) $(gem_storedw_loop_render_DEPENDENCIES) $(EXTRA_gem_storedw_loop_render_DEPENDENCIES) @rm -f gem_storedw_loop_render$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gem_storedw_loop_render_OBJECTS) $(gem_storedw_loop_render_LDADD) $(LIBS) gem_stress$(EXEEXT): $(gem_stress_OBJECTS) $(gem_stress_DEPENDENCIES) $(EXTRA_gem_stress_DEPENDENCIES) @rm -f gem_stress$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gem_stress_OBJECTS) $(gem_stress_LDADD) $(LIBS) gem_tiled_blits$(EXEEXT): $(gem_tiled_blits_OBJECTS) $(gem_tiled_blits_DEPENDENCIES) $(EXTRA_gem_tiled_blits_DEPENDENCIES) @rm -f gem_tiled_blits$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gem_tiled_blits_OBJECTS) $(gem_tiled_blits_LDADD) $(LIBS) gem_tiled_fence_blits$(EXEEXT): $(gem_tiled_fence_blits_OBJECTS) $(gem_tiled_fence_blits_DEPENDENCIES) $(EXTRA_gem_tiled_fence_blits_DEPENDENCIES) @rm -f gem_tiled_fence_blits$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gem_tiled_fence_blits_OBJECTS) $(gem_tiled_fence_blits_LDADD) $(LIBS) gem_tiled_partial_pwrite_pread$(EXEEXT): $(gem_tiled_partial_pwrite_pread_OBJECTS) $(gem_tiled_partial_pwrite_pread_DEPENDENCIES) $(EXTRA_gem_tiled_partial_pwrite_pread_DEPENDENCIES) @rm -f gem_tiled_partial_pwrite_pread$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gem_tiled_partial_pwrite_pread_OBJECTS) $(gem_tiled_partial_pwrite_pread_LDADD) $(LIBS) gem_tiled_pread$(EXEEXT): $(gem_tiled_pread_OBJECTS) $(gem_tiled_pread_DEPENDENCIES) $(EXTRA_gem_tiled_pread_DEPENDENCIES) @rm -f gem_tiled_pread$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gem_tiled_pread_OBJECTS) $(gem_tiled_pread_LDADD) $(LIBS) gem_tiled_pread_pwrite$(EXEEXT): $(gem_tiled_pread_pwrite_OBJECTS) $(gem_tiled_pread_pwrite_DEPENDENCIES) $(EXTRA_gem_tiled_pread_pwrite_DEPENDENCIES) @rm -f gem_tiled_pread_pwrite$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gem_tiled_pread_pwrite_OBJECTS) $(gem_tiled_pread_pwrite_LDADD) $(LIBS) gem_tiled_swapping$(EXEEXT): $(gem_tiled_swapping_OBJECTS) $(gem_tiled_swapping_DEPENDENCIES) $(EXTRA_gem_tiled_swapping_DEPENDENCIES) @rm -f gem_tiled_swapping$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gem_tiled_swapping_OBJECTS) $(gem_tiled_swapping_LDADD) $(LIBS) gem_unfence_active_buffers$(EXEEXT): $(gem_unfence_active_buffers_OBJECTS) $(gem_unfence_active_buffers_DEPENDENCIES) $(EXTRA_gem_unfence_active_buffers_DEPENDENCIES) @rm -f gem_unfence_active_buffers$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gem_unfence_active_buffers_OBJECTS) $(gem_unfence_active_buffers_LDADD) $(LIBS) gem_unref_active_buffers$(EXEEXT): $(gem_unref_active_buffers_OBJECTS) $(gem_unref_active_buffers_DEPENDENCIES) $(EXTRA_gem_unref_active_buffers_DEPENDENCIES) @rm -f gem_unref_active_buffers$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gem_unref_active_buffers_OBJECTS) $(gem_unref_active_buffers_LDADD) $(LIBS) gem_vmap_blits$(EXEEXT): $(gem_vmap_blits_OBJECTS) $(gem_vmap_blits_DEPENDENCIES) $(EXTRA_gem_vmap_blits_DEPENDENCIES) @rm -f gem_vmap_blits$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gem_vmap_blits_OBJECTS) $(gem_vmap_blits_LDADD) $(LIBS) gem_wait_render_timeout$(EXEEXT): $(gem_wait_render_timeout_OBJECTS) $(gem_wait_render_timeout_DEPENDENCIES) $(EXTRA_gem_wait_render_timeout_DEPENDENCIES) @rm -f gem_wait_render_timeout$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gem_wait_render_timeout_OBJECTS) $(gem_wait_render_timeout_LDADD) $(LIBS) gen3_mixed_blits$(EXEEXT): $(gen3_mixed_blits_OBJECTS) $(gen3_mixed_blits_DEPENDENCIES) $(EXTRA_gen3_mixed_blits_DEPENDENCIES) @rm -f gen3_mixed_blits$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gen3_mixed_blits_OBJECTS) $(gen3_mixed_blits_LDADD) $(LIBS) gen3_render_linear_blits$(EXEEXT): $(gen3_render_linear_blits_OBJECTS) $(gen3_render_linear_blits_DEPENDENCIES) $(EXTRA_gen3_render_linear_blits_DEPENDENCIES) @rm -f gen3_render_linear_blits$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gen3_render_linear_blits_OBJECTS) $(gen3_render_linear_blits_LDADD) $(LIBS) gen3_render_mixed_blits$(EXEEXT): $(gen3_render_mixed_blits_OBJECTS) $(gen3_render_mixed_blits_DEPENDENCIES) $(EXTRA_gen3_render_mixed_blits_DEPENDENCIES) @rm -f gen3_render_mixed_blits$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gen3_render_mixed_blits_OBJECTS) $(gen3_render_mixed_blits_LDADD) $(LIBS) gen3_render_tiledx_blits$(EXEEXT): $(gen3_render_tiledx_blits_OBJECTS) $(gen3_render_tiledx_blits_DEPENDENCIES) $(EXTRA_gen3_render_tiledx_blits_DEPENDENCIES) @rm -f gen3_render_tiledx_blits$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gen3_render_tiledx_blits_OBJECTS) $(gen3_render_tiledx_blits_LDADD) $(LIBS) gen3_render_tiledy_blits$(EXEEXT): $(gen3_render_tiledy_blits_OBJECTS) $(gen3_render_tiledy_blits_DEPENDENCIES) $(EXTRA_gen3_render_tiledy_blits_DEPENDENCIES) @rm -f gen3_render_tiledy_blits$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gen3_render_tiledy_blits_OBJECTS) $(gen3_render_tiledy_blits_LDADD) $(LIBS) getclient$(EXEEXT): $(getclient_OBJECTS) $(getclient_DEPENDENCIES) $(EXTRA_getclient_DEPENDENCIES) @rm -f getclient$(EXEEXT) $(AM_V_CCLD)$(LINK) $(getclient_OBJECTS) $(getclient_LDADD) $(LIBS) getstats$(EXEEXT): $(getstats_OBJECTS) $(getstats_DEPENDENCIES) $(EXTRA_getstats_DEPENDENCIES) @rm -f getstats$(EXEEXT) $(AM_V_CCLD)$(LINK) $(getstats_OBJECTS) $(getstats_LDADD) $(LIBS) getversion$(EXEEXT): $(getversion_OBJECTS) $(getversion_DEPENDENCIES) $(EXTRA_getversion_DEPENDENCIES) @rm -f getversion$(EXEEXT) $(AM_V_CCLD)$(LINK) $(getversion_OBJECTS) $(getversion_LDADD) $(LIBS) prime_nv_api$(EXEEXT): $(prime_nv_api_OBJECTS) $(prime_nv_api_DEPENDENCIES) $(EXTRA_prime_nv_api_DEPENDENCIES) @rm -f prime_nv_api$(EXEEXT) $(AM_V_CCLD)$(prime_nv_api_LINK) $(prime_nv_api_OBJECTS) $(prime_nv_api_LDADD) $(LIBS) prime_nv_pcopy$(EXEEXT): $(prime_nv_pcopy_OBJECTS) $(prime_nv_pcopy_DEPENDENCIES) $(EXTRA_prime_nv_pcopy_DEPENDENCIES) @rm -f prime_nv_pcopy$(EXEEXT) $(AM_V_CCLD)$(prime_nv_pcopy_LINK) $(prime_nv_pcopy_OBJECTS) $(prime_nv_pcopy_LDADD) $(LIBS) prime_nv_test$(EXEEXT): $(prime_nv_test_OBJECTS) $(prime_nv_test_DEPENDENCIES) $(EXTRA_prime_nv_test_DEPENDENCIES) @rm -f prime_nv_test$(EXEEXT) $(AM_V_CCLD)$(prime_nv_test_LINK) $(prime_nv_test_OBJECTS) $(prime_nv_test_LDADD) $(LIBS) prime_self_import$(EXEEXT): $(prime_self_import_OBJECTS) $(prime_self_import_DEPENDENCIES) $(EXTRA_prime_self_import_DEPENDENCIES) @rm -f prime_self_import$(EXEEXT) $(AM_V_CCLD)$(LINK) $(prime_self_import_OBJECTS) $(prime_self_import_LDADD) $(LIBS) sysfs_rc6_residency$(EXEEXT): $(sysfs_rc6_residency_OBJECTS) $(sysfs_rc6_residency_DEPENDENCIES) $(EXTRA_sysfs_rc6_residency_DEPENDENCIES) @rm -f sysfs_rc6_residency$(EXEEXT) $(AM_V_CCLD)$(LINK) $(sysfs_rc6_residency_OBJECTS) $(sysfs_rc6_residency_LDADD) $(LIBS) testdisplay$(EXEEXT): $(testdisplay_OBJECTS) $(testdisplay_DEPENDENCIES) $(EXTRA_testdisplay_DEPENDENCIES) @rm -f testdisplay$(EXEEXT) $(AM_V_CCLD)$(LINK) $(testdisplay_OBJECTS) $(testdisplay_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/drm_vma_limiter.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/drm_vma_limiter_cached.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/drm_vma_limiter_cpu.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/drm_vma_limiter_gtt.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/flip_test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_bad_address.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_bad_batch.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_bad_blit.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_bad_length.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_basic.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_cpu_concurrent_blit.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_cs_prefetch.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_ctx_bad_destroy.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_ctx_bad_exec.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_ctx_basic.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_ctx_create.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_ctx_exec.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_double_irq_loop.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_dummy_reloc_loop.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_exec_bad_domains.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_exec_blt.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_exec_faulting_reloc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_exec_nop.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_fence_thrash-gem_fence_thrash.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_fenced_exec_thrash.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_flink.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_gtt_concurrent_blit.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_gtt_cpu_tlb.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_gtt_speed.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_hang.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_largeobject.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_linear_blits.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_mmap.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_mmap_gtt.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_mmap_offset_exhaustion.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_partial_pwrite_pread.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_pipe_control_store_loop.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_pread_after_blit.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_pwrite.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_readwrite.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_reg_read.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_reloc_vs_gpu.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_ring_sync_loop.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_ringfill.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_set_tiling_vs_blt.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_set_tiling_vs_gtt.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_set_tiling_vs_pwrite.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_storedw_batches_loop.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_storedw_loop_blt.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_storedw_loop_bsd.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_storedw_loop_render.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_stress.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_tiled_blits.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_tiled_fence_blits.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_tiled_partial_pwrite_pread.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_tiled_pread.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_tiled_pread_pwrite.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_tiled_swapping.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_unfence_active_buffers.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_unref_active_buffers.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_vmap_blits.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_wait_render_timeout.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gen3_mixed_blits.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gen3_render_linear_blits.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gen3_render_mixed_blits.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gen3_render_tiledx_blits.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gen3_render_tiledy_blits.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getclient.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getstats.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getversion.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prime_nv_api-prime_nv_api.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prime_nv_pcopy-prime_nv_pcopy.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prime_nv_test-prime_nv_test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prime_self_import.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sysfs_rc6_residency.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testdisplay.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testdisplay_hotplug.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< gem_fence_thrash-gem_fence_thrash.o: gem_fence_thrash.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gem_fence_thrash_CFLAGS) $(CFLAGS) -MT gem_fence_thrash-gem_fence_thrash.o -MD -MP -MF $(DEPDIR)/gem_fence_thrash-gem_fence_thrash.Tpo -c -o gem_fence_thrash-gem_fence_thrash.o `test -f 'gem_fence_thrash.c' || echo '$(srcdir)/'`gem_fence_thrash.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/gem_fence_thrash-gem_fence_thrash.Tpo $(DEPDIR)/gem_fence_thrash-gem_fence_thrash.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gem_fence_thrash.c' object='gem_fence_thrash-gem_fence_thrash.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gem_fence_thrash_CFLAGS) $(CFLAGS) -c -o gem_fence_thrash-gem_fence_thrash.o `test -f 'gem_fence_thrash.c' || echo '$(srcdir)/'`gem_fence_thrash.c gem_fence_thrash-gem_fence_thrash.obj: gem_fence_thrash.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gem_fence_thrash_CFLAGS) $(CFLAGS) -MT gem_fence_thrash-gem_fence_thrash.obj -MD -MP -MF $(DEPDIR)/gem_fence_thrash-gem_fence_thrash.Tpo -c -o gem_fence_thrash-gem_fence_thrash.obj `if test -f 'gem_fence_thrash.c'; then $(CYGPATH_W) 'gem_fence_thrash.c'; else $(CYGPATH_W) '$(srcdir)/gem_fence_thrash.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/gem_fence_thrash-gem_fence_thrash.Tpo $(DEPDIR)/gem_fence_thrash-gem_fence_thrash.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gem_fence_thrash.c' object='gem_fence_thrash-gem_fence_thrash.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gem_fence_thrash_CFLAGS) $(CFLAGS) -c -o gem_fence_thrash-gem_fence_thrash.obj `if test -f 'gem_fence_thrash.c'; then $(CYGPATH_W) 'gem_fence_thrash.c'; else $(CYGPATH_W) '$(srcdir)/gem_fence_thrash.c'; fi` prime_nv_api-prime_nv_api.o: prime_nv_api.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(prime_nv_api_CFLAGS) $(CFLAGS) -MT prime_nv_api-prime_nv_api.o -MD -MP -MF $(DEPDIR)/prime_nv_api-prime_nv_api.Tpo -c -o prime_nv_api-prime_nv_api.o `test -f 'prime_nv_api.c' || echo '$(srcdir)/'`prime_nv_api.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/prime_nv_api-prime_nv_api.Tpo $(DEPDIR)/prime_nv_api-prime_nv_api.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='prime_nv_api.c' object='prime_nv_api-prime_nv_api.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(prime_nv_api_CFLAGS) $(CFLAGS) -c -o prime_nv_api-prime_nv_api.o `test -f 'prime_nv_api.c' || echo '$(srcdir)/'`prime_nv_api.c prime_nv_api-prime_nv_api.obj: prime_nv_api.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(prime_nv_api_CFLAGS) $(CFLAGS) -MT prime_nv_api-prime_nv_api.obj -MD -MP -MF $(DEPDIR)/prime_nv_api-prime_nv_api.Tpo -c -o prime_nv_api-prime_nv_api.obj `if test -f 'prime_nv_api.c'; then $(CYGPATH_W) 'prime_nv_api.c'; else $(CYGPATH_W) '$(srcdir)/prime_nv_api.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/prime_nv_api-prime_nv_api.Tpo $(DEPDIR)/prime_nv_api-prime_nv_api.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='prime_nv_api.c' object='prime_nv_api-prime_nv_api.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(prime_nv_api_CFLAGS) $(CFLAGS) -c -o prime_nv_api-prime_nv_api.obj `if test -f 'prime_nv_api.c'; then $(CYGPATH_W) 'prime_nv_api.c'; else $(CYGPATH_W) '$(srcdir)/prime_nv_api.c'; fi` prime_nv_pcopy-prime_nv_pcopy.o: prime_nv_pcopy.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(prime_nv_pcopy_CFLAGS) $(CFLAGS) -MT prime_nv_pcopy-prime_nv_pcopy.o -MD -MP -MF $(DEPDIR)/prime_nv_pcopy-prime_nv_pcopy.Tpo -c -o prime_nv_pcopy-prime_nv_pcopy.o `test -f 'prime_nv_pcopy.c' || echo '$(srcdir)/'`prime_nv_pcopy.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/prime_nv_pcopy-prime_nv_pcopy.Tpo $(DEPDIR)/prime_nv_pcopy-prime_nv_pcopy.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='prime_nv_pcopy.c' object='prime_nv_pcopy-prime_nv_pcopy.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(prime_nv_pcopy_CFLAGS) $(CFLAGS) -c -o prime_nv_pcopy-prime_nv_pcopy.o `test -f 'prime_nv_pcopy.c' || echo '$(srcdir)/'`prime_nv_pcopy.c prime_nv_pcopy-prime_nv_pcopy.obj: prime_nv_pcopy.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(prime_nv_pcopy_CFLAGS) $(CFLAGS) -MT prime_nv_pcopy-prime_nv_pcopy.obj -MD -MP -MF $(DEPDIR)/prime_nv_pcopy-prime_nv_pcopy.Tpo -c -o prime_nv_pcopy-prime_nv_pcopy.obj `if test -f 'prime_nv_pcopy.c'; then $(CYGPATH_W) 'prime_nv_pcopy.c'; else $(CYGPATH_W) '$(srcdir)/prime_nv_pcopy.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/prime_nv_pcopy-prime_nv_pcopy.Tpo $(DEPDIR)/prime_nv_pcopy-prime_nv_pcopy.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='prime_nv_pcopy.c' object='prime_nv_pcopy-prime_nv_pcopy.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(prime_nv_pcopy_CFLAGS) $(CFLAGS) -c -o prime_nv_pcopy-prime_nv_pcopy.obj `if test -f 'prime_nv_pcopy.c'; then $(CYGPATH_W) 'prime_nv_pcopy.c'; else $(CYGPATH_W) '$(srcdir)/prime_nv_pcopy.c'; fi` prime_nv_test-prime_nv_test.o: prime_nv_test.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(prime_nv_test_CFLAGS) $(CFLAGS) -MT prime_nv_test-prime_nv_test.o -MD -MP -MF $(DEPDIR)/prime_nv_test-prime_nv_test.Tpo -c -o prime_nv_test-prime_nv_test.o `test -f 'prime_nv_test.c' || echo '$(srcdir)/'`prime_nv_test.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/prime_nv_test-prime_nv_test.Tpo $(DEPDIR)/prime_nv_test-prime_nv_test.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='prime_nv_test.c' object='prime_nv_test-prime_nv_test.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(prime_nv_test_CFLAGS) $(CFLAGS) -c -o prime_nv_test-prime_nv_test.o `test -f 'prime_nv_test.c' || echo '$(srcdir)/'`prime_nv_test.c prime_nv_test-prime_nv_test.obj: prime_nv_test.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(prime_nv_test_CFLAGS) $(CFLAGS) -MT prime_nv_test-prime_nv_test.obj -MD -MP -MF $(DEPDIR)/prime_nv_test-prime_nv_test.Tpo -c -o prime_nv_test-prime_nv_test.obj `if test -f 'prime_nv_test.c'; then $(CYGPATH_W) 'prime_nv_test.c'; else $(CYGPATH_W) '$(srcdir)/prime_nv_test.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/prime_nv_test-prime_nv_test.Tpo $(DEPDIR)/prime_nv_test-prime_nv_test.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='prime_nv_test.c' object='prime_nv_test-prime_nv_test.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(prime_nv_test_CFLAGS) $(CFLAGS) -c -o prime_nv_test-prime_nv_test.obj `if test -f 'prime_nv_test.c'; then $(CYGPATH_W) 'prime_nv_test.c'; else $(CYGPATH_W) '$(srcdir)/prime_nv_test.c'; fi` mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags check-TESTS: $(TESTS) @failed=0; all=0; xfail=0; xpass=0; skip=0; \ srcdir=$(srcdir); export srcdir; \ list=' $(TESTS) '; \ $(am__tty_colors); \ if test -n "$$list"; then \ for tst in $$list; do \ if test -f ./$$tst; then dir=./; \ elif test -f $$tst; then dir=; \ else dir="$(srcdir)/"; fi; \ if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$tst[\ \ ]*) \ xpass=`expr $$xpass + 1`; \ failed=`expr $$failed + 1`; \ col=$$red; res=XPASS; \ ;; \ *) \ col=$$grn; res=PASS; \ ;; \ esac; \ elif test $$? -ne 77; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$tst[\ \ ]*) \ xfail=`expr $$xfail + 1`; \ col=$$lgn; res=XFAIL; \ ;; \ *) \ failed=`expr $$failed + 1`; \ col=$$red; res=FAIL; \ ;; \ esac; \ else \ skip=`expr $$skip + 1`; \ col=$$blu; res=SKIP; \ fi; \ echo "$${col}$$res$${std}: $$tst"; \ done; \ if test "$$all" -eq 1; then \ tests="test"; \ All=""; \ else \ tests="tests"; \ All="All "; \ fi; \ if test "$$failed" -eq 0; then \ if test "$$xfail" -eq 0; then \ banner="$$All$$all $$tests passed"; \ else \ if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \ banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \ fi; \ else \ if test "$$xpass" -eq 0; then \ banner="$$failed of $$all $$tests failed"; \ else \ if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \ banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \ fi; \ fi; \ dashes="$$banner"; \ skipped=""; \ if test "$$skip" -ne 0; then \ if test "$$skip" -eq 1; then \ skipped="($$skip test was not run)"; \ else \ skipped="($$skip tests were not run)"; \ fi; \ test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$skipped"; \ fi; \ report=""; \ if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ report="Please report to $(PACKAGE_BUGREPORT)"; \ test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$report"; \ fi; \ dashes=`echo "$$dashes" | sed s/./=/g`; \ if test "$$failed" -eq 0; then \ col="$$grn"; \ else \ col="$$red"; \ fi; \ echo "$${col}$$dashes$${std}"; \ echo "$${col}$$banner$${std}"; \ test -z "$$skipped" || echo "$${col}$$skipped$${std}"; \ test -z "$$report" || echo "$${col}$$report$${std}"; \ echo "$${col}$$dashes$${std}"; \ test "$$failed" -eq 0; \ else :; fi distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am all-am: Makefile $(PROGRAMS) installdirs: 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 clean-noinstPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: check-am install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \ clean-generic clean-libtool clean-noinstPROGRAMS ctags \ distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am test: whoami | grep root || ( echo ERROR: not running as root; exit 1 ) ./check_drm_clients make TESTS="${kernel_tests}" check # 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: intel-gpu-tools-1.3/tests/sysfs_rc6_residency.c0000664000175100017510000000653211742027217016651 00000000000000/* * Copyright © 2012 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Ben Widawsky * */ #define _GNU_SOURCE #include #include #include #include #include "drmtest.h" #define SLEEP_DURATION 3000 // in milliseconds #define RC6_FUDGE 900 // in milliseconds static unsigned int readit(const char *path) { unsigned int ret; FILE *file; file = fopen(path, "r"); if (file == NULL) { fprintf(stderr, "Couldn't open %s (%d)\n", path, errno); abort(); } fscanf(file, "%u", &ret); fclose(file); return ret; } int main(int argc, char *argv[]) { const int device = drm_get_card(0); char *path, *pathp, *pathpp; int fd, ret; unsigned int value1, value1p, value1pp, value2, value2p, value2pp; FILE *file; int diff; /* Use drm_open_any to verify device existence */ fd = drm_open_any(); close(fd); ret = asprintf(&path, "/sys/class/drm/card%d/power/rc6_enable", device); assert(ret != -1); /* For some reason my ivb isn't idle even after syncing up with the gpu. * Let's add a sleept just to make it happy. */ sleep(5); file = fopen(path, "r"); if (!file) { printf("kernel too old or rc6 not supported on this platform.\n"); exit(77); } /* claim success if no rc6 enabled. */ if (readit(path) == 0) exit(EXIT_SUCCESS); ret = asprintf(&path, "/sys/class/drm/card%d/power/rc6_residency_ms", device); assert(ret != -1); ret = asprintf(&pathp, "/sys/class/drm/card%d/power/rc6p_residency_ms", device); assert(ret != -1); ret = asprintf(&pathpp, "/sys/class/drm/card%d/power/rc6pp_residency_ms", device); assert(ret != -1); value1 = readit(path); value1p = readit(pathp); value1pp = readit(pathpp); sleep(SLEEP_DURATION / 1000); value2 = readit(path); value2p = readit(pathp); value2pp = readit(pathpp); free(pathpp); free(pathp); free(path); diff = (value2pp - value1pp) + (value2p - value1p) + (value2 - value1); if (diff > (SLEEP_DURATION + RC6_FUDGE)) { fprintf(stderr, "Diff was too high. That is unpossible\n"); exit(EXIT_FAILURE); } if (diff < (SLEEP_DURATION - RC6_FUDGE)) { fprintf(stderr, "GPU was not in RC6 long enough. Check that " "the GPU is as idle as possible (ie. no X, " "running and running no other tests)\n"); exit(EXIT_FAILURE); } exit(EXIT_SUCCESS); } intel-gpu-tools-1.3/tests/gem_unfence_active_buffers.c0000664000175100017510000001204211746063357020207 00000000000000/* * Copyright © 2012 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Daniel Vetter * */ /** @file gem_unfence_active_buffers.c * * Testcase: Check for use-after free in the fence stealing code * * If we're stealing the fence of a active object where the active list is the * only thing holding a reference, we need to be careful not to access the old * object we're stealing the fence from after that reference has been dropped by * retire_requests. * * Note that this needs slab poisoning enabled in the kernel to reliably hit the * problem - the race window is too small. */ #include #include #include #include #include #include #include #include #include #include #include "drm.h" #include "i915_drm.h" #include "drmtest.h" #include "intel_bufmgr.h" #include "intel_batchbuffer.h" #include "intel_gpu_tools.h" static drm_intel_bufmgr *bufmgr; struct intel_batchbuffer *batch; uint32_t devid; #define TEST_SIZE (1024*1024) #define TEST_STRIDE (4*1024) uint32_t data[TEST_SIZE/4]; int main(int argc, char **argv) { int i, ret, fd, num_fences; drm_intel_bo *busy_bo, *test_bo; uint32_t tiling = I915_TILING_X; for (i = 0; i < 1024*256; i++) data[i] = i; fd = drm_open_any(); bufmgr = drm_intel_bufmgr_gem_init(fd, 4096); drm_intel_bufmgr_gem_enable_reuse(bufmgr); devid = intel_get_drm_devid(fd); batch = intel_batchbuffer_alloc(bufmgr, devid); printf("filling ring\n"); busy_bo = drm_intel_bo_alloc(bufmgr, "busy bo bo", 16*1024*1024, 4096); for (i = 0; i < 250; i++) { BEGIN_BATCH(8); OUT_BATCH(XY_SRC_COPY_BLT_CMD | XY_SRC_COPY_BLT_WRITE_ALPHA | XY_SRC_COPY_BLT_WRITE_RGB); OUT_BATCH((3 << 24) | /* 32 bits */ (0xcc << 16) | /* copy ROP */ 2*1024*4); OUT_BATCH(0 << 16 | 1024); OUT_BATCH((2048) << 16 | (2048)); OUT_RELOC_FENCED(busy_bo, I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER, 0); OUT_BATCH(0 << 16 | 0); OUT_BATCH(2*1024*4); OUT_RELOC_FENCED(busy_bo, I915_GEM_DOMAIN_RENDER, 0, 0); ADVANCE_BATCH(); if (IS_GEN6(devid) || IS_GEN7(devid)) { BEGIN_BATCH(3); OUT_BATCH(XY_SETUP_CLIP_BLT_CMD); OUT_BATCH(0); OUT_BATCH(0); ADVANCE_BATCH(); } } intel_batchbuffer_flush(batch); num_fences = gem_available_fences(fd); printf("creating havoc on %i fences\n", num_fences); for (i = 0; i < num_fences*2; i++) { test_bo = drm_intel_bo_alloc(bufmgr, "test_bo", TEST_SIZE, 4096); ret = drm_intel_bo_set_tiling(test_bo, &tiling, TEST_STRIDE); assert(ret == 0); drm_intel_bo_disable_reuse(test_bo); BEGIN_BATCH(8); OUT_BATCH(XY_SRC_COPY_BLT_CMD | XY_SRC_COPY_BLT_WRITE_ALPHA | XY_SRC_COPY_BLT_WRITE_RGB); OUT_BATCH((3 << 24) | /* 32 bits */ (0xcc << 16) | /* copy ROP */ TEST_STRIDE); OUT_BATCH(0 << 16 | 0); OUT_BATCH((1) << 16 | (1)); OUT_RELOC_FENCED(test_bo, I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER, 0); OUT_BATCH(0 << 16 | 0); OUT_BATCH(TEST_STRIDE); OUT_RELOC_FENCED(test_bo, I915_GEM_DOMAIN_RENDER, 0, 0); ADVANCE_BATCH(); intel_batchbuffer_flush(batch); printf("test bo offset: %#lx\n", test_bo->offset); drm_intel_bo_unreference(test_bo); } /* launch a few batchs to ensure the damaged slab objects get reused. */ for (i = 0; i < 10; i++) { BEGIN_BATCH(8); OUT_BATCH(XY_SRC_COPY_BLT_CMD | XY_SRC_COPY_BLT_WRITE_ALPHA | XY_SRC_COPY_BLT_WRITE_RGB); OUT_BATCH((3 << 24) | /* 32 bits */ (0xcc << 16) | /* copy ROP */ 2*1024*4); OUT_BATCH(0 << 16 | 1024); OUT_BATCH((1) << 16 | (1)); OUT_RELOC_FENCED(busy_bo, I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER, 0); OUT_BATCH(0 << 16 | 0); OUT_BATCH(2*1024*4); OUT_RELOC_FENCED(busy_bo, I915_GEM_DOMAIN_RENDER, 0, 0); ADVANCE_BATCH(); if (IS_GEN6(devid) || IS_GEN7(devid)) { BEGIN_BATCH(3); OUT_BATCH(XY_SETUP_CLIP_BLT_CMD); OUT_BATCH(0); OUT_BATCH(0); ADVANCE_BATCH(); } } intel_batchbuffer_flush(batch); return 0; } intel-gpu-tools-1.3/tests/gem_pread_after_blit.c0000664000175100017510000001064011566027747017010 00000000000000/* * Copyright © 2009 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Eric Anholt * */ /** @file gem_pread_after_blit.c * * This is a test of pread's behavior when getting values out of just-drawn-to * buffers. * * The goal is to catch failure in the whole-buffer-flush or * ranged-buffer-flush paths in the kernel. */ #include #include #include #include #include #include #include #include #include #include "drm.h" #include "i915_drm.h" #include "drmtest.h" #include "intel_bufmgr.h" #include "intel_batchbuffer.h" #include "intel_gpu_tools.h" static drm_intel_bufmgr *bufmgr; struct intel_batchbuffer *batch; static const int width = 512, height = 512; static const int size = 1024 * 1024; #define PAGE_SIZE 4096 static drm_intel_bo * create_bo(uint32_t val) { drm_intel_bo *bo; uint32_t *vaddr; int i; bo = drm_intel_bo_alloc(bufmgr, "src bo", size, 4096); /* Fill the BO with dwords starting at start_val */ drm_intel_bo_map(bo, 1); vaddr = bo->virtual; for (i = 0; i < 1024 * 1024 / 4; i++) vaddr[i] = val++; drm_intel_bo_unmap(bo); return bo; } static void verify_large_read(drm_intel_bo *bo, uint32_t val) { uint32_t buf[size / 4]; int i; drm_intel_bo_get_subdata(bo, 0, size, buf); for (i = 0; i < size / 4; i++) { if (buf[i] != val) { fprintf(stderr, "Unexpected value 0x%08x instead of " "0x%08x at offset 0x%08x (%p)\n", buf[i], val, i * 4, buf); abort(); } val++; } } /** This reads at the size that Mesa usees for software fallbacks. */ static void verify_small_read(drm_intel_bo *bo, uint32_t val) { uint32_t buf[4096 / 4]; int offset, i; for (i = 0; i < 4096 / 4; i++) buf[i] = 0x00c0ffee; for (offset = 0; offset < size; offset += PAGE_SIZE) { drm_intel_bo_get_subdata(bo, offset, PAGE_SIZE, buf); for (i = 0; i < PAGE_SIZE; i += 4) { if (buf[i / 4] != val) { fprintf(stderr, "Unexpected value 0x%08x instead of " "0x%08x at offset 0x%08x\n", buf[i / 4], val, i * 4); abort(); } val++; } } } int main(int argc, char **argv) { int fd; drm_intel_bo *src1, *src2, *bo; uint32_t start1 = 0; uint32_t start2 = 1024 * 1024 / 4; fd = drm_open_any(); bufmgr = drm_intel_bufmgr_gem_init(fd, 4096); drm_intel_bufmgr_gem_enable_reuse(bufmgr); batch = intel_batchbuffer_alloc(bufmgr, intel_get_drm_devid(fd)); src1 = create_bo(start1); src2 = create_bo(start2); bo = drm_intel_bo_alloc(bufmgr, "dst bo", size, 4096); /* First, do a full-buffer read after blitting */ printf("Large read after blit 1\n"); intel_copy_bo(batch, bo, src1, width, height); verify_large_read(bo, start1); printf("Large read after blit 2\n"); intel_copy_bo(batch, bo, src2, width, height); verify_large_read(bo, start2); printf("Small reads after blit 1\n"); intel_copy_bo(batch, bo, src1, width, height); verify_small_read(bo, start1); printf("Small reads after blit 2\n"); intel_copy_bo(batch, bo, src2, width, height); verify_small_read(bo, start2); printf("Large read after blit 3\n"); intel_copy_bo(batch, bo, src1, width, height); verify_large_read(bo, start1); drm_intel_bo_unreference(src1); drm_intel_bo_unreference(src2); drm_intel_bo_unreference(bo); intel_batchbuffer_free(batch); drm_intel_bufmgr_destroy(bufmgr); close(fd); return 0; } intel-gpu-tools-1.3/tests/prime_nv_api.c0000664000175100017510000002160412015765010015322 00000000000000/* wierd use of API tests */ /* test1- export buffer from intel, import same fd twice into nouveau, check handles match test2 - export buffer from intel, import fd once, close fd, try import again fail if it succeeds test3 - export buffer from intel, import twice on nouveau, check handle is the same test4 - export handle twice from intel, import into nouveau twice, check handle is the same */ #include #include #include #include #include #include "intel_bufmgr.h" #include "nouveau.h" #include "intel_gpu_tools.h" #include "intel_batchbuffer.h" #define BO_SIZE (256*1024) int intel_fd = -1, intel_fd2 = -1, nouveau_fd = -1, nouveau_fd2 = -1; drm_intel_bufmgr *bufmgr; drm_intel_bufmgr *bufmgr2; struct nouveau_device *ndev, *ndev2; struct nouveau_client *nclient, *nclient2; uint32_t devid; struct intel_batchbuffer *intel_batch; static int find_and_open_devices(void) { int i; char path[80]; struct stat buf; FILE *fl; char vendor_id[8]; int venid; for (i = 0; i < 9; i++) { sprintf(path, "/sys/class/drm/card%d/device/vendor", i); if (stat(path, &buf)) break; fl = fopen(path, "r"); if (!fl) break; fgets(vendor_id, 8, fl); fclose(fl); venid = strtoul(vendor_id, NULL, 16); sprintf(path, "/dev/dri/card%d", i); if (venid == 0x8086) { intel_fd = open(path, O_RDWR); if (!intel_fd) return -1; intel_fd2 = open(path, O_RDWR); if (!intel_fd2) return -1; } else if (venid == 0x10de) { nouveau_fd = open(path, O_RDWR); if (!nouveau_fd) return -1; nouveau_fd2 = open(path, O_RDWR); if (!nouveau_fd2) return -1; } } return 0; } static int test1(void) { int ret; drm_intel_bo *test_intel_bo; int prime_fd; struct nouveau_bo *nvbo = NULL, *nvbo2 = NULL; test_intel_bo = drm_intel_bo_alloc(bufmgr, "test bo", BO_SIZE, 4096); ret = drm_intel_bo_gem_export_to_prime(test_intel_bo, &prime_fd); if (ret) goto out; ret = nouveau_bo_prime_handle_ref(ndev, prime_fd, &nvbo); if (ret < 0) { close(prime_fd); goto out; } ret = nouveau_bo_prime_handle_ref(ndev2, prime_fd, &nvbo2); close(prime_fd); if (ret < 0) goto out; if (nvbo->handle != nvbo2->handle) ret = -1; out: nouveau_bo_ref(NULL, &nvbo2); nouveau_bo_ref(NULL, &nvbo); drm_intel_bo_unreference(test_intel_bo); return ret; } static int test2(void) { int ret; drm_intel_bo *test_intel_bo; int prime_fd; struct nouveau_bo *nvbo = NULL, *nvbo2 = NULL; test_intel_bo = drm_intel_bo_alloc(bufmgr, "test bo", BO_SIZE, 4096); ret = drm_intel_bo_gem_export_to_prime(test_intel_bo, &prime_fd); if (ret < 0) goto out; ret = nouveau_bo_prime_handle_ref(ndev, prime_fd, &nvbo); close(prime_fd); if (ret < 0) goto out; ret = nouveau_bo_prime_handle_ref(ndev2, prime_fd, &nvbo2); if (ret == 0) ret = -1; else ret = 0; out: nouveau_bo_ref(NULL, &nvbo2); nouveau_bo_ref(NULL, &nvbo); drm_intel_bo_unreference(test_intel_bo); return ret; } /* import handle twice on one driver */ static int test3(void) { int ret; drm_intel_bo *test_intel_bo; int prime_fd; struct nouveau_bo *nvbo = NULL, *nvbo2 = NULL; test_intel_bo = drm_intel_bo_alloc(bufmgr, "test bo", BO_SIZE, 4096); ret = drm_intel_bo_gem_export_to_prime(test_intel_bo, &prime_fd); if (ret < 0) goto out; ret = nouveau_bo_prime_handle_ref(ndev, prime_fd, &nvbo); if (ret < 0) { close(prime_fd); goto out; } ret = nouveau_bo_prime_handle_ref(ndev, prime_fd, &nvbo2); close(prime_fd); if (ret < 0) goto out; if (nvbo->handle != nvbo2->handle) ret = -1; out: nouveau_bo_ref(NULL, &nvbo2); nouveau_bo_ref(NULL, &nvbo); drm_intel_bo_unreference(test_intel_bo); return ret; } /* export handle twice from one driver - import twice see if we get same object */ static int test4(void) { int ret; drm_intel_bo *test_intel_bo; int prime_fd, prime_fd2; struct nouveau_bo *nvbo = NULL, *nvbo2 = NULL; test_intel_bo = drm_intel_bo_alloc(bufmgr, "test bo", BO_SIZE, 4096); drm_intel_bo_gem_export_to_prime(test_intel_bo, &prime_fd); drm_intel_bo_gem_export_to_prime(test_intel_bo, &prime_fd2); ret = nouveau_bo_prime_handle_ref(ndev, prime_fd, &nvbo); close(prime_fd); if (ret >= 0) ret = nouveau_bo_prime_handle_ref(ndev, prime_fd2, &nvbo2); close(prime_fd2); if (ret < 0) goto out; if (nvbo->handle != nvbo2->handle) ret = -1; out: nouveau_bo_ref(NULL, &nvbo2); nouveau_bo_ref(NULL, &nvbo); drm_intel_bo_unreference(test_intel_bo); return ret; } /* export handle from intel driver - reimport to intel driver see if you get same object */ static int test5(void) { int ret; drm_intel_bo *test_intel_bo, *test_intel_bo2; int prime_fd; test_intel_bo = drm_intel_bo_alloc(bufmgr, "test bo", BO_SIZE, 4096); drm_intel_bo_gem_export_to_prime(test_intel_bo, &prime_fd); test_intel_bo2 = drm_intel_bo_gem_create_from_prime(bufmgr, prime_fd, BO_SIZE); close(prime_fd); if (!test_intel_bo2) { ret = -1; goto out; } ret = 0; if (test_intel_bo->handle != test_intel_bo2->handle) ret = -1; out: drm_intel_bo_unreference(test_intel_bo); return ret; } /* nouveau export reimport test */ static int test6(void) { int ret; int prime_fd; struct nouveau_bo *nvbo, *nvbo2; ret = nouveau_bo_new(ndev, NOUVEAU_BO_GART | NOUVEAU_BO_MAP, 0, BO_SIZE, NULL, &nvbo); if (ret < 0) return ret; ret = nouveau_bo_set_prime(nvbo, &prime_fd); if (ret < 0) return ret; ret = nouveau_bo_prime_handle_ref(ndev, prime_fd, &nvbo2); close(prime_fd); if (ret < 0) return ret; if (nvbo->handle != nvbo2->handle) fprintf(stderr,"mismatch handles %d %d\n", nvbo->handle, nvbo2->handle); nouveau_bo_ref(NULL, &nvbo); nouveau_bo_ref(NULL, &nvbo2); return 0; } /* export handle from intel driver - reimport to another intel driver bufmgr see if you get same object */ static int test7(void) { int ret; drm_intel_bo *test_intel_bo, *test_intel_bo2; int prime_fd; test_intel_bo = drm_intel_bo_alloc(bufmgr, "test bo", BO_SIZE, 4096); drm_intel_bo_gem_export_to_prime(test_intel_bo, &prime_fd); test_intel_bo2 = drm_intel_bo_gem_create_from_prime(bufmgr2, prime_fd, BO_SIZE); close(prime_fd); if (!test_intel_bo2) { ret = -1; goto out; } ret = 0; /* not sure what to test for, just that we don't explode */ out: drm_intel_bo_unreference(test_intel_bo2); drm_intel_bo_unreference(test_intel_bo); return ret; } /* nouveau export reimport to other driver test */ static int test8(void) { int ret; int prime_fd; struct nouveau_bo *nvbo, *nvbo2; ret = nouveau_bo_new(ndev, NOUVEAU_BO_GART | NOUVEAU_BO_MAP, 0, BO_SIZE, NULL, &nvbo); if (ret < 0) return ret; ret = nouveau_bo_set_prime(nvbo, &prime_fd); if (ret < 0) return ret; ret = nouveau_bo_prime_handle_ref(ndev2, prime_fd, &nvbo2); close(prime_fd); if (ret < 0) return ret; /* not sure what to test for, just make sure we don't explode */ nouveau_bo_ref(NULL, &nvbo); nouveau_bo_ref(NULL, &nvbo2); return 0; } int main(int argc, char **argv) { int ret; ret = find_and_open_devices(); if (ret < 0) return ret; if (nouveau_fd == -1 || intel_fd == -1 || nouveau_fd2 == -1 || intel_fd2 == -1) { fprintf(stderr,"failed to find intel and nouveau GPU\n"); return 77; } /* set up intel bufmgr */ bufmgr = drm_intel_bufmgr_gem_init(intel_fd, 4096); if (!bufmgr) return -1; /* Do not enable reuse, we share (almost) all buffers. */ //drm_intel_bufmgr_gem_enable_reuse(bufmgr); bufmgr2 = drm_intel_bufmgr_gem_init(intel_fd2, 4096); if (!bufmgr2) return -1; drm_intel_bufmgr_gem_enable_reuse(bufmgr2); /* set up nouveau bufmgr */ ret = nouveau_device_wrap(nouveau_fd, 0, &ndev); if (ret < 0) { fprintf(stderr,"failed to wrap nouveau device\n"); return 77; } ret = nouveau_client_new(ndev, &nclient); if (ret < 0) { fprintf(stderr,"failed to setup nouveau client\n"); return -1; } /* set up nouveau bufmgr */ ret = nouveau_device_wrap(nouveau_fd2, 0, &ndev2); if (ret < 0) { fprintf(stderr,"failed to wrap nouveau device\n"); return 77; } ret = nouveau_client_new(ndev2, &nclient2); if (ret < 0) { fprintf(stderr,"failed to setup nouveau client\n"); return -1; } /* set up an intel batch buffer */ devid = intel_get_drm_devid(intel_fd); intel_batch = intel_batchbuffer_alloc(bufmgr, devid); ret = test1(); if (ret) fprintf(stderr,"prime_test: failed test 1\n"); ret = test2(); if (ret) fprintf(stderr,"prime_test: failed test 2\n"); ret = test3(); if (ret) fprintf(stderr,"prime_test: failed test 3\n"); ret = test4(); if (ret) fprintf(stderr,"prime_test: failed test 4\n"); ret = test5(); if (ret) fprintf(stderr,"prime_test: failed test 5\n"); ret = test6(); if (ret) fprintf(stderr,"prime_test: failed test 6\n"); ret = test7(); if (ret) fprintf(stderr,"prime_test: failed test 7\n"); ret = test8(); if (ret) fprintf(stderr,"prime_test: failed test 8\n"); intel_batchbuffer_free(intel_batch); nouveau_device_del(&ndev); drm_intel_bufmgr_destroy(bufmgr); close(intel_fd); close(nouveau_fd); return ret; } intel-gpu-tools-1.3/tests/gem_bad_length.c0000664000175100017510000000660611772702746015616 00000000000000/* * Copyright © 2011 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Chris Wilson * */ #include #include #include #include #include #include #include #include #include #include #include #include "drm.h" #include "i915_drm.h" #include "drmtest.h" #define MI_BATCH_BUFFER_END (0xA<<23) /* * Testcase: Minmal bo_create and batchbuffer exec * * Originally this caught an kernel oops due to the unchecked assumption that * objects have size > 0. */ static uint32_t do_gem_create(int fd, int size, int *retval) { struct drm_i915_gem_create create; int ret; create.handle = 0; create.size = (size + 4095) & -4096; ret = drmIoctl(fd, DRM_IOCTL_I915_GEM_CREATE, &create); assert(retval || ret == 0); if (retval) *retval = errno; return create.handle; } static int gem_exec(int fd, struct drm_i915_gem_execbuffer2 *execbuf) { return drmIoctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, execbuf); } static void create0(int fd) { int retval = 0; printf("trying to create a zero-length gem object\n"); do_gem_create(fd, 0, &retval); assert(retval == EINVAL); } static void exec0(int fd) { struct drm_i915_gem_execbuffer2 execbuf; struct drm_i915_gem_exec_object2 exec[1]; uint32_t buf[2] = { MI_BATCH_BUFFER_END, 0 }; /* Just try executing with a zero-length bo. * We expect the kernel to either accept the nop batch, or reject it * for the zero-length buffer, but never crash. */ exec[0].handle = gem_create(fd, 4096); gem_write(fd, exec[0].handle, 0, buf, sizeof(buf)); exec[0].relocation_count = 0; exec[0].relocs_ptr = 0; exec[0].alignment = 0; exec[0].offset = 0; exec[0].flags = 0; exec[0].rsvd1 = 0; exec[0].rsvd2 = 0; execbuf.buffers_ptr = (uintptr_t)exec; execbuf.buffer_count = 1; execbuf.batch_start_offset = 0; execbuf.batch_len = sizeof(buf); execbuf.cliprects_ptr = 0; execbuf.num_cliprects = 0; execbuf.DR1 = 0; execbuf.DR4 = 0; execbuf.flags = 0; i915_execbuffer2_set_context_id(execbuf, 0); execbuf.rsvd2 = 0; printf("trying to run an empty batchbuffer\n"); gem_exec(fd, &execbuf); gem_close(fd, exec[0].handle); } int main(int argc, char **argv) { int fd; fd = drm_open_any(); create0(fd); //exec0(fd); close(fd); return 0; } intel-gpu-tools-1.3/man/0000775000175100017510000000000012016622744012203 500000000000000intel-gpu-tools-1.3/man/intel_upload_blit_small.man0000664000175100017510000000120011702400214017455 00000000000000.\" shorthand for double quote that works everywhere. .ds q \N'34' .TH intel_upload_blit_small __appmansuffix__ __xorgversion__ .SH NAME intel_upload_blit_small \- microbenchmark of Intel GPU performance .SH SYNOPSIS .nf .B intel_upload_blit_small .fi .SH DESCRIPTION .B intel_upload_blit_small is a microbenchmark tool for DRM performance. It should be run with kernel modesetting enabled, and may require root privilege for correct operation. It does not require X to be running. .PP Given that it is a microbenchmark, its utility is largely for regression testing of the kernel, and not for general conclusions on graphics performance. intel-gpu-tools-1.3/man/intel_upload_blit_large_gtt.man0000664000175100017510000000122011702400214020317 00000000000000.\" shorthand for double quote that works everywhere. .ds q \N'34' .TH intel_upload_blit_large_gtt __appmansuffix__ __xorgversion__ .SH NAME intel_upload_blit_large_gtt \- microbenchmark of Intel GPU performance .SH SYNOPSIS .nf .B intel_upload_blit_large_gtt .fi .SH DESCRIPTION .B intel_upload_blit_large_gtt is a microbenchmark tool for DRM performance. It should be run with kernel modesetting enabled, and may require root privilege for correct operation. It does not require X to be running. .PP Given that it is a microbenchmark, its utility is largely for regression testing of the kernel, and not for general conclusions on graphics performance. intel-gpu-tools-1.3/man/intel_reg_dumper.man0000664000175100017510000000162011721136153016137 00000000000000.\" shorthand for double quote that works everywhere. .ds q \N'34' .TH intel_reg_dumper __appmansuffix__ __xorgversion__ .SH NAME intel_reg_dumper \- Decode a bunch of Intel GPU registers for debugging .SH SYNOPSIS .B intel_reg_dumper [ options ] [ file ] .SH DESCRIPTION .B intel_reg_dumper is a tool to read and decode the values of many Intel GPU registers. It is commonly used in debugging video mode setting issues. If the .B file argument is present, the registers will be decoded from the given file instead of the current registers. Use the .B intel_reg_snapshot tool to generate such files. When the .B file argument is present and the .B -d argument is not present, .B intel_reg_dumper will assume the file was generated on an Ironlake machine. .SH OPTIONS .TP .B -d id when a dump file is used, use 'id' as device id (in hex) .TP .B -h prints a help message .SH SEE ALSO .BR intel_reg_snapshot(1) intel-gpu-tools-1.3/man/Makefile.am0000644000175100017510000000141111742027230014144 00000000000000appmandir = $(APP_MAN_DIR) appman_PRE = \ intel_audio_dump.man \ intel_bios_dumper.man \ intel_bios_reader.man \ intel_error_decode.man \ intel_gpu_top.man \ intel_gtt.man \ intel_infoframes.man \ intel_lid.man \ intel_panel_fitter.man \ intel_reg_dumper.man \ intel_reg_read.man \ intel_reg_write.man \ intel_stepping.man \ intel_upload_blit_large.man \ intel_upload_blit_large_gtt.man \ intel_upload_blit_large_map.man \ intel_upload_blit_small.man appman_DATA = $(appman_PRE:man=$(APP_MAN_SUFFIX)) EXTRA_DIST = $(appman_PRE) CLEANFILES = $(appman_DATA) # String replacements in MAN_SUBSTS now come from xorg-macros.m4 via configure SUFFIXES = .$(APP_MAN_SUFFIX) .man .man.$(APP_MAN_SUFFIX): $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@ intel-gpu-tools-1.3/man/intel_reg_write.man0000664000175100017510000000101011702400214015755 00000000000000.\" shorthand for double quote that works everywhere. .ds q \N'34' .TH intel_reg_write __appmansuffix__ __xorgversion__ .SH NAME intel_reg_write \- Set an Intel GPU register to a value .SH SYNOPSIS .B intel_reg_write \fIregister\fR \fIvalue\fR .SH DESCRIPTION .B intel_reg_write is a tool to set Intel GPU registers to values, for use in speeding up debugging. The \fIregister\fR and \fIvalue\fR arguments are given as hexadecimal. .SH EXAMPLES .TP intel_reg_write 0x61230 0x0 Disables the first internal panel fitter. intel-gpu-tools-1.3/man/intel_error_decode.man0000664000175100017510000000125711702400214016437 00000000000000.\" shorthand for double quote that works everywhere. .ds q \N'34' .TH intel_error_decode __appmansuffix__ __xorgversion__ .SH NAME intel_error_decode \- Decodes an Intel GPU dump automatically captured by the kernel at the time of an error. .SH SYNOPSIS .nf .B intel_error_decode .B intel_error_decode [ filename ] .fi .SH DESCRIPTION .B intel_error_decode is a tool that decodes the instructions and state of the GPU at the time of an error. It requires kernel 2.6.34 or newer, and either debugfs mounted on /sys/kernel/debug or /debug containing a current i915_error_state or you can pass a file containing a saved error. .SS Options .TP .B filename Decodes a previously saved error. intel-gpu-tools-1.3/man/intel_gpu_top.man0000664000175100017510000000244111702400214015454 00000000000000.\" shorthand for double quote that works everywhere. .ds q \N'34' .TH intel_gpu_top __appmansuffix__ __xorgversion__ .SH NAME intel_gpu_top \- Display a top-like summary of Intel GPU usage .SH SYNOPSIS .nf .B intel_gpu_top .B intel_gpu_top [ parameters ] .SH DESCRIPTION .B intel_gpu_top is a tool to display usage information of an Intel GPU. It requires root privilege to map the graphics device. .SS Options .TP .B -s [samples per second] number of samples to acquire per second .TP .B -o [output file] collect usage statistics to [file]. If file is "-", run non-interactively and output statistics to stdout. .TP .B -e ["command to profile"] execute a command, and leave when it is finished. Note that the entire command with all parameters should be included as one parameter. .TP .B -h show usage notes .SH EXAMPLES .TP intel_gpu_top -o "cairo-trace-gvim.log" -s 100 -e "cairo-perf-trace /tmp/gvim" will run cairo-perf-trace with /tmp/gvim trace, non-interactively, saving the statistics into cairo-trace-gvim.log file, and collecting 100 samples per second. .PP Note that idle units are not displayed, so an entirely idle GPU will only display the ring status and header. .SH BUGS Some GPUs report some units as busy when they aren't, such that even when idle and not hung, it will show up as 100% busy. intel-gpu-tools-1.3/man/intel_bios_dumper.man0000664000175100017510000000073511715034646016333 00000000000000.\" shorthand for double quote that works everywhere. .ds q \N'34' .TH intel_bios_dumper __appmansuffix__ __xorgversion__ .SH NAME intel_bios_dumper \- Saves the Intel video BIOS contents to a file. .SH SYNOPSIS .B intel_bios_dumper \fIfilename\fR .SH DESCRIPTION .B intel_bios_dumper is a tool to save the contents of the Intel video BIOS to a file. It can then be parsed offline for debugging issues with the video bios table handling. .SH SEE ALSO .BR intel_bios_reader(1) intel-gpu-tools-1.3/man/intel_gtt.man0000664000175100017510000000100511702400214014570 00000000000000.\" shorthand for double quote that works everywhere. .ds q \N'34' .TH intel_gtt __appmansuffix__ __xorgversion__ .SH NAME intel_gtt \- Dump the contents of an Intel GPU's GTT .SH SYNOPSIS .B intel_gtt .SH DESCRIPTION .B intel_gtt is a tool to view the contents of the GTT on an Intel GPU. The GTT is the page table that maps between GPU addresses and system memory. This tool can be useful in debugging the Linux AGP driver initialization of the chip or in debugging later overwriting of the GTT with garbage data. intel-gpu-tools-1.3/man/intel_reg_read.man0000664000175100017510000000073511702400214015553 00000000000000.\" shorthand for double quote that works everywhere. .ds q \N'34' .TH intel_reg_read __appmansuffix__ __xorgversion__ .SH NAME intel_reg_read \- Reads an Intel GPU register value .SH SYNOPSIS .B intel_reg_read \fIregister\fR .SH DESCRIPTION .B intel_reg_read is a tool to read Intel GPU registers, for use in debugging. The \fIregister\fR argument is given as hexadecimal. .SH EXAMPLES .TP intel_reg_read 0x61230 Shows the register value for the first internal panel fitter. intel-gpu-tools-1.3/man/intel_bios_reader.man0000664000175100017510000000106611702400214016257 00000000000000.\" shorthand for double quote that works everywhere. .ds q \N'34' .TH intel_bios_reader __appmansuffix__ __xorgversion__ .SH NAME intel_bios_reader \- Parses an Intel BIOS and displays many of its tables .SH SYNOPSIS .B intel_bios_reader \fIfilename\fR .SH DESCRIPTION .B intel_bios_reader is a tool to parse the contents of an Intel video BIOS file. The file can come from intel_bios_dumper. This can be used for quick debugging of video bios table handling, which is harder when done inside of the kernel graphics driver. .SH SEE ALSO .BR intel_bios_dumper (1) intel-gpu-tools-1.3/man/intel_lid.man0000664000175100017510000000065411702400214014553 00000000000000.\" shorthand for double quote that works everywhere. .ds q \N'34' .TH intel_lid __appmansuffix__ __xorgversion__ .SH NAME intel_ \- Polls the values of different reports about laptop lid state. .SH SYNOPSIS .B intel_lid .SH DESCRIPTION .B intel_lid is a tool to poll ACPI and the BIOS scratch register's reporting of laptop lid state. This can be used for debugging issues with laptop modesetting for lid opening and closing. intel-gpu-tools-1.3/man/intel_panel_fitter.man0000664000175100017510000000265611721136153016474 00000000000000.\" shorthand for double quote that works everywhere. .ds q \N'34' .TH intel_panel_fitter __appmansuffix__ __xorgversion__ .SH NAME intel_panel_fitter \- Change the panel fitter settings .SH SYNOPSIS .B intel_panel_fitter [options] .SH DESCRIPTION .B intel_panel_fitter is a tool that allows you to change the panel fitter settings, so you can change the size of the screen being displayed on your monitor without changing the real pixel size of your desktop. The biggest use case for this tool is to work around overscan done by TVs and some monitors in interlaced mode. .SS Options .TP .B -p [pipe] pipe to be used (A, B or C, but C is only present on Ivy Bridge and newer). .TP .B -x [value] final screen width size in pixels (needs -p option). .TP .B -y [value] final screen height size in pixels (needs -p option). .TP .B -d disable panel fitter (needs -p option, ignores -x and -y options). .TP .B -l list current state of each pipe. .TP .B -h prints the help message. .SS .SH EXAMPLES .TP .B intel_panel_fitter -l will list the current status of each pipe, so you can decide what to do. .TP .B intel_panel_fitter -p A -x 1850 -y 1040 will change the pipe A size to 1850x1040 pixels. .TP .B intel_panel_fitter -p A -d will disable the panel fitter for pipe A. .SH NOTES In the future, there will be support for this feature inside the Linux Kernel. Machines older than Ironlake are still not supported, but support may be possible to implement. intel-gpu-tools-1.3/man/intel_stepping.man0000664000175100017510000000106711702400214015633 00000000000000.\" shorthand for double quote that works everywhere. .ds q \N'34' .TH intel_stepping __appmansuffix__ __xorgversion__ .SH NAME intel_stepping \- Display the stepping information for an Intel GPU .SH SYNOPSIS .B intel_stepping .SH DESCRIPTION .B intel_stepping is a tool to print the stepping information for an Intel GPU, along with the PCI ID and revision used to determine it. It requires root privilege to map the graphics device. .SH BUGS Not all the known stepping IDs or chipsets are included, so the output on some devices may not be as specific as possible. intel-gpu-tools-1.3/man/intel_upload_blit_large_map.man0000664000175100017510000000122011702400214020276 00000000000000.\" shorthand for double quote that works everywhere. .ds q \N'34' .TH intel_upload_blit_large_map __appmansuffix__ __xorgversion__ .SH NAME intel_upload_blit_large_map \- microbenchmark of Intel GPU performance .SH SYNOPSIS .nf .B intel_upload_blit_large_map .fi .SH DESCRIPTION .B intel_upload_blit_large_map is a microbenchmark tool for DRM performance. It should be run with kernel modesetting enabled, and may require root privilege for correct operation. It does not require X to be running. .PP Given that it is a microbenchmark, its utility is largely for regression testing of the kernel, and not for general conclusions on graphics performance. intel-gpu-tools-1.3/man/intel_audio_dump.man0000664000175100017510000000055611702400214016132 00000000000000.\" shorthand for double quote that works everywhere. .ds q \N'34' .TH intel_audio_dump __appmansuffix__ __xorgversion__ .SH NAME intel_audio_dump \- Dumps the Intel GPU registers for HDMI audio setup. .SH SYNOPSIS .B intel_audio_dump .SH DESCRIPTION .B intel_audio_dump dumps and decodes registers containing the configuration of HDMI audio handling on Intel GPUs. intel-gpu-tools-1.3/man/intel_upload_blit_large.man0000664000175100017510000000120011702400214017437 00000000000000.\" shorthand for double quote that works everywhere. .ds q \N'34' .TH intel_upload_blit_large __appmansuffix__ __xorgversion__ .SH NAME intel_upload_blit_large \- microbenchmark of Intel GPU performance .SH SYNOPSIS .nf .B intel_upload_blit_large .fi .SH DESCRIPTION .B intel_upload_blit_large is a microbenchmark tool for DRM performance. It should be run with kernel modesetting enabled, and may require root privilege for correct operation. It does not require X to be running. .PP Given that it is a microbenchmark, its utility is largely for regression testing of the kernel, and not for general conclusions on graphics performance. intel-gpu-tools-1.3/man/Makefile.in0000664000175100017510000003510112016622041014156 00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = man DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ SOURCES = DIST_SOURCES = am__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)$(appmandir)" DATA = $(appman_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ADMIN_MAN_DIR = @ADMIN_MAN_DIR@ ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ APP_MAN_DIR = @APP_MAN_DIR@ APP_MAN_SUFFIX = @APP_MAN_SUFFIX@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BASE_CFLAGS = @BASE_CFLAGS@ CAIRO_CFLAGS = @CAIRO_CFLAGS@ CAIRO_LIBS = @CAIRO_LIBS@ 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@ DRM_CFLAGS = @DRM_CFLAGS@ DRM_LIBS = @DRM_LIBS@ DRM_NOUVEAU_CFLAGS = @DRM_NOUVEAU_CFLAGS@ DRM_NOUVEAU_LIBS = @DRM_NOUVEAU_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILE_MAN_DIR = @FILE_MAN_DIR@ FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@ GEN4ASM = @GEN4ASM@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_LIBS = @GLIB_LIBS@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_CMD = @INSTALL_CMD@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBUDEV_CFLAGS = @LIBUDEV_CFLAGS@ LIBUDEV_LIBS = @LIBUDEV_LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MAN_SUBSTS = @MAN_SUBSTS@ MISC_MAN_DIR = @MISC_MAN_DIR@ MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJCOPY = @OBJCOPY@ 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@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ THREAD_CFLAGS = @THREAD_CFLAGS@ VERSION = @VERSION@ 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@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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@ appmandir = $(APP_MAN_DIR) appman_PRE = \ intel_audio_dump.man \ intel_bios_dumper.man \ intel_bios_reader.man \ intel_error_decode.man \ intel_gpu_top.man \ intel_gtt.man \ intel_infoframes.man \ intel_lid.man \ intel_panel_fitter.man \ intel_reg_dumper.man \ intel_reg_read.man \ intel_reg_write.man \ intel_stepping.man \ intel_upload_blit_large.man \ intel_upload_blit_large_gtt.man \ intel_upload_blit_large_map.man \ intel_upload_blit_small.man appman_DATA = $(appman_PRE:man=$(APP_MAN_SUFFIX)) EXTRA_DIST = $(appman_PRE) CLEANFILES = $(appman_DATA) # String replacements in MAN_SUBSTS now come from xorg-macros.m4 via configure SUFFIXES = .$(APP_MAN_SUFFIX) .man all: all-am .SUFFIXES: .SUFFIXES: .$(APP_MAN_SUFFIX) .man $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign man/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign man/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-appmanDATA: $(appman_DATA) @$(NORMAL_INSTALL) @list='$(appman_DATA)'; test -n "$(appmandir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(appmandir)'"; \ $(MKDIR_P) "$(DESTDIR)$(appmandir)" || 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)$(appmandir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(appmandir)" || exit $$?; \ done uninstall-appmanDATA: @$(NORMAL_UNINSTALL) @list='$(appman_DATA)'; test -n "$(appmandir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(appmandir)'; $(am__uninstall_files_from_dir) tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(appmandir)"; 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-appmanDATA 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-appmanDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-appmanDATA install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ uninstall uninstall-am uninstall-appmanDATA .man.$(APP_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: intel-gpu-tools-1.3/man/intel_infoframes.man0000644000175100017510000000144011746063575016153 00000000000000.\" shorthand for double quote that works everywhere. .ds q \N'34' .TH intel_infoframes __appmansuffix__ __xorgversion__ .SH NAME intel_infoframes \- View and change HDMI InfoFrames .SH SYNOPSIS .B intel_infoframes .SH DESCRIPTION .B intel_infoframes is a tool to view and change the HDMI InfoFrames sent by the GPU. Its main purpose is to be used as a debugging tool. In some cases (e.g., when changing modes) the Kernel will undo the changes made by this tool. Descriptions of the InfoFrame fields can be found on the HDMI and CEA-861 specifications. Use the .B -h or .B --help options to learn how to use the command .SH LIMITATIONS Not all HDMI monitors respect the InfoFrames sent to them. Only GEN 4 or newer hardware is supported yet. .SH SEE ALSO HDMI specification, CEA-861 specification. intel-gpu-tools-1.3/README0000664000175100017510000000455611673204321012235 00000000000000This is a collection of tools for development and testing of the Intel DRM driver. There are many macro-level test suites that get used against our driver, including xtest, rendercheck, piglit, and oglconform, but failures from those can be difficult to track down to kernel changes, and many require complicated build procedures or specific testing environments to get useful results. Thus, intel-graphics-tools was a project I started to collect some low-level tools I intended to build. benchmarks/ This should be a collection of useful microbenchmarks. The hope is that people can use these to tune some pieces of DRM code in relevant ways. The benchmarks require KMS to be enabled. When run with an X Server running, they must be run as root to avoid the authentication requirement. Note that a few other microbenchmarks are in tests (like gem_gtt_speed). tests/ This is a set of automated tests to run against the DRM to validate changes. Hopefully this can cover the relevant cases we need to worry about, including backwards compatibility. Run this tests with "make test" as root from this directory. Note that no other drm clients (X server) may run. "make test" only runs a default of test usefull for regression testing. Other tests not run are: - tests that might hang the gpu, see HANG in Makefile.am - gem_stress, a stress test suite. Look at the source for all the various options. - testdisplay is only run in the default mode. testdisplay has tons of options to test different kms functionality, again read the source of the details. lib/ Common helper functions and headers used by the other tools. man/ Manpages, unfortunately rather incomplete. tools/ This is a collection of debugging tools that had previously been built with the 2D driver but not shipped. Some distros were hacking up the 2D build to ship them. Instead, here's a separate package for people debugging the driver. These tools generally must be run as root, safe for the ones that just decode dumps. debugger/ This tool is to be used to do shader debugging. It acts like a debug server accepting connections from debug clients such as mesa. The connections is made with unix domain sockets, and at some point it would be nice if this directory contained a library for initiating connections with debug clients.. The debugger must be run as root: "sudo debugger/eudb" intel-gpu-tools-1.3/Makefile.am0000644000175100017510000000272212004013776013401 00000000000000# Copyright © 2005 Adam Jackson. # Copyright © 2009 Intel Corporation # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"), # to deal in the Software without restriction, including without limitation # 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. ACLOCAL_AMFLAGS = ${ACLOCAL_FLAGS} SUBDIRS = lib man tools scripts tests benchmarks demos if BUILD_SHADER_DEBUGGER SUBDIRS += debugger endif test: ${MAKE} -C tests test MAINTAINERCLEANFILES = ChangeLog INSTALL .PHONY: ChangeLog INSTALL INSTALL: $(INSTALL_CMD) ChangeLog: $(CHANGELOG_CMD) dist-hook: ChangeLog INSTALL intel-gpu-tools-1.3/configure.ac0000644000175100017510000001134212016621627013634 00000000000000# Copyright 2005 Adam Jackson. # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"), # to deal in the Software without restriction, including without limitation # on the rights to use, copy, modify, merge, publish, distribute, sub # license, and/or sell copies of the Software, and to permit persons to whom # the Software is furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice (including the next # paragraph) shall be included in all copies or substantial portions of the # Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL # ADAM JACKSON BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER # IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Process this file with autoconf to produce a configure script AC_PREREQ([2.60]) AC_INIT([intel-gpu-tools], [1.3], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [intel-gpu-tools]) AC_CONFIG_SRCDIR([Makefile.am]) AC_CONFIG_HEADERS([config.h]) AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_AUX_DIR([build-aux]) AC_USE_SYSTEM_EXTENSIONS AC_SYS_LARGEFILE AC_GNU_SOURCE AM_INIT_AUTOMAKE([foreign dist-bzip2]) AM_PATH_PYTHON([3],, [:]) AM_MAINTAINER_MODE # Checks for functions, headers, structures, etc. AC_CHECK_HEADERS([termios.h]) AC_CHECK_MEMBERS([struct sysinfo.totalram],[],[],[AC_INCLUDES_DEFAULT #include ]) AC_CHECK_FUNCS([swapctl]) AC_CHECK_FUNCS([asprintf]) # Initialize libtool AC_DISABLE_STATIC AC_PROG_LIBTOOL # Require X.Org macros 1.16 or later for XORG_TESTSET_CFLAG m4_ifndef([XORG_MACROS_VERSION], [m4_fatal([must install xorg-macros 1.16 or later before running autoconf/autogen])]) XORG_MACROS_VERSION(1.16) XORG_DEFAULT_OPTIONS PKG_CHECK_MODULES(DRM, [libdrm_intel >= 2.4.38 libdrm]) PKG_CHECK_MODULES(PCIACCESS, [pciaccess >= 0.10]) # for dma-buf tests AC_ARG_ENABLE(nouveau, AS_HELP_STRING([--disable-nouveau], [Enable use of nouveau API for prime tests (default: enabled)]), [NOUVEAU=$enableval], [NOUVEAU=yes]) if test "x$NOUVEAU" = xyes; then PKG_CHECK_MODULES(DRM_NOUVEAU, [libdrm_nouveau >= 2.4.33]) AC_DEFINE(HAVE_NOUVEAU, 1, [Have nouveau support]) fi AM_CONDITIONAL(HAVE_NOUVEAU, [test "x$NOUVEAU" = xyes]) # for testdisplay PKG_CHECK_MODULES(CAIRO, cairo) PKG_CHECK_MODULES(LIBUDEV, [libudev], [udev=yes], [udev=no]) if test x"$udev" = xyes; then AC_DEFINE(HAVE_UDEV,1,[Enable udev-based monitor hotplug detection]) fi PKG_CHECK_MODULES(GLIB, glib-2.0) # ----------------------------------------------------------------------------- # Configuration options # ----------------------------------------------------------------------------- # Define a configure option for the shadder debugger AC_ARG_ENABLE(shader-debugger, AS_HELP_STRING([--enable-shader-debugger], [Enable shader debugging support [autodetected]]), [BUILD_SHADER_DEBUGGER="$enableval"], [BUILD_SHADER_DEBUGGER=auto]) # Shadder debugger depends on python3, intel-genasm and objcopy if test "x$BUILD_SHADER_DEBUGGER" != xno; then # Check Python 3 is installed if test "$PYTHON" = ":" ; then if test "x$BUILD_SHADER_DEBUGGER" = xyes; then AC_MSG_ERROR([Shader debugger requested, python version 3 not found.]) else BUILD_SHADER_DEBUGGER=no fi fi # Check for the Intel Chipset assembler compiler AC_PATH_PROGS([GEN4ASM], intel-gen4asm) if test -z "$GEN4ASM" ; then if test "x$BUILD_SHADER_DEBUGGER" = xyes; then AC_MSG_ERROR([Shader debugger requested, but intel-gen4asm not found.]) else BUILD_SHADER_DEBUGGER=no fi fi # Check for the objcopy GNU binary utiliy command AC_PATH_PROGS([OBJCOPY], objcopy) if test -z "$OBJCOPY" ; then if test "x$BUILD_SHADER_DEBUGGER" = xyes; then AC_MSG_ERROR([Shader debugger requested, but objcopy command not found.]) else BUILD_SHADER_DEBUGGER=no fi fi fi AM_CONDITIONAL(BUILD_SHADER_DEBUGGER, [test "x$BUILD_SHADER_DEBUGGER" != xno]) # ----------------------------------------------------------------------------- # To build multithread code, gcc uses -pthread, Solaris Studio cc uses -mt XORG_TESTSET_CFLAG([THREAD_CFLAGS], [-pthread], [-mt]) AC_SUBST([THREAD_CFLAGS]) AC_CONFIG_FILES([ Makefile benchmarks/Makefile demos/Makefile lib/Makefile man/Makefile scripts/Makefile tests/Makefile tools/Makefile debugger/Makefile debugger/system_routine/Makefile ]) AC_OUTPUT intel-gpu-tools-1.3/demos/0000775000175100017510000000000012016622744012537 500000000000000intel-gpu-tools-1.3/demos/intel_sprite_on.c0000664000175100017510000010315211757635623016035 00000000000000/* * Copyright 2012 Corporation * * Author: * Armin Reese * * 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 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. */ /* * This program is intended for testing sprite functionality. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "i915_drm.h" #include "drmtest.h" #if defined(DRM_IOCTL_MODE_ADDFB2) && defined(DRM_I915_SET_SPRITE_COLORKEY) #define TEST_PLANES 1 #include "drm_fourcc.h" #endif #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0])) struct type_name { int type; const char *name; }; #define type_name_fn(res) \ static const char * res##_str(int type) { \ unsigned int i; \ for (i = 0; i < ARRAY_SIZE(res##_names); i++) { \ if (res##_names[i].type == type) \ return res##_names[i].name; \ } \ return "(invalid)"; \ } struct type_name encoder_type_names[] = { { DRM_MODE_ENCODER_NONE, "none" }, { DRM_MODE_ENCODER_DAC, "DAC" }, { DRM_MODE_ENCODER_TMDS, "TMDS" }, { DRM_MODE_ENCODER_LVDS, "LVDS" }, { DRM_MODE_ENCODER_TVDAC, "TVDAC" }, }; type_name_fn(encoder_type) struct type_name connector_status_names[] = { { DRM_MODE_CONNECTED, "connected" }, { DRM_MODE_DISCONNECTED, "disconnected" }, { DRM_MODE_UNKNOWNCONNECTION, "unknown" }, }; type_name_fn(connector_status) struct type_name connector_type_names[] = { { DRM_MODE_CONNECTOR_Unknown, "unknown" }, { DRM_MODE_CONNECTOR_VGA, "VGA" }, { DRM_MODE_CONNECTOR_DVII, "DVI-I" }, { DRM_MODE_CONNECTOR_DVID, "DVI-D" }, { DRM_MODE_CONNECTOR_DVIA, "DVI-A" }, { DRM_MODE_CONNECTOR_Composite, "composite" }, { DRM_MODE_CONNECTOR_SVIDEO, "s-video" }, { DRM_MODE_CONNECTOR_LVDS, "LVDS" }, { DRM_MODE_CONNECTOR_Component, "component" }, { DRM_MODE_CONNECTOR_9PinDIN, "9-pin DIN" }, { DRM_MODE_CONNECTOR_DisplayPort, "DisplayPort" }, { DRM_MODE_CONNECTOR_HDMIA, "HDMI-A" }, { DRM_MODE_CONNECTOR_HDMIB, "HDMI-B" }, { DRM_MODE_CONNECTOR_TV, "TV" }, { DRM_MODE_CONNECTOR_eDP, "Embedded DisplayPort" }, }; type_name_fn(connector_type) /* * Mode setting with the kernel interfaces is a bit of a chore. * First you have to find the connector in question and make sure the * requested mode is available. * Then you need to find the encoder attached to that connector so you * can bind it with a free crtc. */ struct connector { uint32_t id; int mode_valid; drmModeModeInfo mode; drmModeEncoder *encoder; drmModeConnector *connector; int crtc; int pipe; }; static void dump_mode( drmModeModeInfo *mode) { printf(" %s %d %d %d %d %d %d %d %d %d 0x%x 0x%x %d\n", mode->name, mode->vrefresh, mode->hdisplay, mode->hsync_start, mode->hsync_end, mode->htotal, mode->vdisplay, mode->vsync_start, mode->vsync_end, mode->vtotal, mode->flags, mode->type, mode->clock); } static void dump_connectors( int gfx_fd, drmModeRes *resources) { int i, j; printf("Connectors:\n"); printf("id\tencoder\tstatus\t\ttype\tsize (mm)\tmodes\n"); for (i = 0; i < resources->count_connectors; i++) { drmModeConnector *connector; connector = drmModeGetConnector(gfx_fd, resources->connectors[i]); if (!connector) { printf("could not get connector %i: %s\n", resources->connectors[i], strerror(errno)); continue; } printf("%d\t%d\t%s\t%s\t%dx%d\t\t%d\n", connector->connector_id, connector->encoder_id, connector_status_str(connector->connection), connector_type_str(connector->connector_type), connector->mmWidth, connector->mmHeight, connector->count_modes); if (!connector->count_modes) continue; printf(" modes:\n"); printf(" name refresh (Hz) hdisp hss hse htot vdisp " "vss vse vtot flags type clock\n"); for (j = 0; j < connector->count_modes; j++) dump_mode(&connector->modes[j]); drmModeFreeConnector(connector); } printf("\n"); } static void dump_crtcs( int gfx_fd, drmModeRes *resources) { int i; printf("CRTCs:\n"); printf("id\tfb\tpos\tsize\n"); for (i = 0; i < resources->count_crtcs; i++) { drmModeCrtc *crtc; crtc = drmModeGetCrtc(gfx_fd, resources->crtcs[i]); if (!crtc) { printf("could not get crtc %i: %s\n", resources->crtcs[i], strerror(errno)); continue; } printf("%d\t%d\t(%d,%d)\t(%dx%d)\n", crtc->crtc_id, crtc->buffer_id, crtc->x, crtc->y, crtc->width, crtc->height); dump_mode(&crtc->mode); drmModeFreeCrtc(crtc); } printf("\n"); } static void dump_planes( int gfx_fd, drmModeRes *resources) { drmModePlaneRes *plane_resources; drmModePlane *ovr; int i; plane_resources = drmModeGetPlaneResources(gfx_fd); if (!plane_resources) { printf("drmModeGetPlaneResources failed: %s\n", strerror(errno)); return; } printf("Planes:\n"); printf("id\tcrtc\tfb\tCRTC x,y\tx,y\tgamma size\n"); for (i = 0; i < plane_resources->count_planes; i++) { ovr = drmModeGetPlane(gfx_fd, plane_resources->planes[i]); if (!ovr) { printf("drmModeGetPlane failed: %s\n", strerror(errno)); continue; } printf("%d\t%d\t%d\t%d,%d\t\t%d,%d\t%d\n", ovr->plane_id, ovr->crtc_id, ovr->fb_id, ovr->crtc_x, ovr->crtc_y, ovr->x, ovr->y, ovr->gamma_size); drmModeFreePlane(ovr); } printf("\n"); return; } static void connector_find_preferred_mode( int gfx_fd, drmModeRes *gfx_resources, struct connector *c) { drmModeConnector *connector; drmModeEncoder *encoder = NULL; int i, j; /* First, find the connector & mode */ c->mode_valid = 0; connector = drmModeGetConnector(gfx_fd, c->id); if (!connector) { printf("could not get connector %d: %s\n", c->id, strerror(errno)); drmModeFreeConnector(connector); return; } if (connector->connection != DRM_MODE_CONNECTED) { drmModeFreeConnector(connector); return; } if (!connector->count_modes) { printf("connector %d has no modes\n", c->id); drmModeFreeConnector(connector); return; } if (connector->connector_id != c->id) { printf("connector id doesn't match (%d != %d)\n", connector->connector_id, c->id); drmModeFreeConnector(connector); return; } for (j = 0; j < connector->count_modes; j++) { c->mode = connector->modes[j]; if (c->mode.type & DRM_MODE_TYPE_PREFERRED) { c->mode_valid = 1; break; } } if (!c->mode_valid) { if (connector->count_modes > 0) { /* use the first mode as test mode */ c->mode = connector->modes[0]; c->mode_valid = 1; } else { printf("failed to find any modes on connector %d\n", c->id); return; } } /* Now get the encoder */ for (i = 0; i < connector->count_encoders; i++) { encoder = drmModeGetEncoder(gfx_fd, connector->encoders[i]); if (!encoder) { printf("could not get encoder %i: %s\n", gfx_resources->encoders[i], strerror(errno)); drmModeFreeEncoder(encoder); continue; } break; } c->encoder = encoder; if (i == gfx_resources->count_encoders) { printf("failed to find encoder\n"); c->mode_valid = 0; return; } /* Find first CRTC not in use */ for (i = 0; i < gfx_resources->count_crtcs; i++) { if (gfx_resources->crtcs[i] && (c->encoder->possible_crtcs & (1<crtc = gfx_resources->crtcs[i]; c->pipe = i; gfx_resources->crtcs[i] = 0; c->connector = connector; } static int connector_find_plane(int gfx_fd, struct connector *c) { drmModePlaneRes *plane_resources; drmModePlane *ovr; uint32_t id = 0; int i; plane_resources = drmModeGetPlaneResources(gfx_fd); if (!plane_resources) { printf("drmModeGetPlaneResources failed: %s\n", strerror(errno)); return 0; } for (i = 0; i < plane_resources->count_planes; i++) { ovr = drmModeGetPlane(gfx_fd, plane_resources->planes[i]); if (!ovr) { printf("drmModeGetPlane failed: %s\n", strerror(errno)); continue; } if (ovr->possible_crtcs & (1 << c->pipe)) { id = ovr->plane_id; drmModeFreePlane(ovr); break; } drmModeFreePlane(ovr); } return id; } static int prepare_primary_surface( int fd, int prim_width, int prim_height, uint32_t *prim_handle, uint32_t *prim_stride, uint32_t *prim_size, int tiled) { uint32_t bytes_per_pixel = sizeof(uint32_t); uint32_t *prim_fb_ptr; struct drm_i915_gem_set_tiling set_tiling; if (bytes_per_pixel != sizeof(uint32_t)) { printf("Bad bytes_per_pixel for primary surface: %d\n", bytes_per_pixel); return -EINVAL; } if (tiled) { int v; /* Round the tiling up to the next power-of-two and the * region up to the next pot fence size so that this works * on all generations. * * This can still fail if the framebuffer is too large to * be tiled. But then that failure is expected. */ v = prim_width * bytes_per_pixel; for (*prim_stride = 512; *prim_stride < v; *prim_stride *= 2) ; v = *prim_stride * prim_height; for (*prim_size = 1024*1024; *prim_size < v; *prim_size *= 2) ; } else { /* Scan-out has a 64 byte alignment restriction */ *prim_stride = (prim_width * bytes_per_pixel + 63) & ~63; *prim_size = *prim_stride * prim_height; } *prim_handle = gem_create(fd, *prim_size); if (tiled) { set_tiling.handle = *prim_handle; set_tiling.tiling_mode = I915_TILING_X; set_tiling.stride = *prim_stride; if (ioctl(fd, DRM_IOCTL_I915_GEM_SET_TILING, &set_tiling)) { printf("Set tiling failed: %s (stride=%d, size=%d)\n", strerror(errno), *prim_stride, *prim_size); return -1; } } prim_fb_ptr = gem_mmap(fd, *prim_handle, *prim_size, PROT_READ | PROT_WRITE); if (prim_fb_ptr != NULL) { // Write primary surface with gray background memset(prim_fb_ptr, 0x3f, *prim_size); munmap(prim_fb_ptr, *prim_size); } return 0; } static void fill_sprite( int sprite_width, int sprite_height, int sprite_stride, int sprite_index, void *sprite_fb_ptr) { __u32 *pLinePat0, *pLinePat1, *pLinePtr; int i, line; int stripe_width; stripe_width = ((sprite_width > 64) && (sprite_height > 64)) ? (sprite_index + 1) * 8 : (sprite_index + 1) * 2; // Note: sprite_stride is in bytes. pLinePat0 and pLinePat1 // are both __u32 pointers pLinePat0 = sprite_fb_ptr; pLinePat1 = pLinePat0 + (stripe_width * (sprite_stride / sizeof(*pLinePat0))); for (i = 0; i < sprite_width; i++) { *(pLinePat0 + i) = ((i / stripe_width) & 0x1) ? 0 : ~0; *(pLinePat1 + i) = ~(*(pLinePat0 + i)); } for (line = 1; line < sprite_height; line++) { if (line == stripe_width) { continue; } pLinePtr = ((line / stripe_width) & 0x1) ? pLinePat1 : pLinePat0; memcpy( pLinePat0 + ((sprite_stride / sizeof(*pLinePat0)) * line), pLinePtr, sprite_width * sizeof(*pLinePat0)); } return; } static int prepare_sprite_surfaces( int fd, int sprite_width, int sprite_height, uint32_t num_surfaces, uint32_t *sprite_handles, uint32_t *sprite_stride, uint32_t *sprite_size, int tiled) { uint32_t bytes_per_pixel = sizeof(uint32_t); uint32_t *sprite_fb_ptr; struct drm_i915_gem_set_tiling set_tiling; int i; if (bytes_per_pixel != sizeof(uint32_t)) { printf("Bad bytes_per_pixel for sprite: %d\n", bytes_per_pixel); return -EINVAL; } if (tiled) { int v; /* Round the tiling up to the next power-of-two and the * region up to the next pot fence size so that this works * on all generations. * * This can still fail if the framebuffer is too large to * be tiled. But then that failure is expected. */ v = sprite_width * bytes_per_pixel; for (*sprite_stride = 512; *sprite_stride < v; *sprite_stride *= 2) ; v = *sprite_stride * sprite_height; for (*sprite_size = 1024*1024; *sprite_size < v; *sprite_size *= 2) ; } else { /* Scan-out has a 64 byte alignment restriction */ *sprite_stride = (sprite_width * bytes_per_pixel + 63) & ~63; *sprite_size = *sprite_stride * sprite_height; } for (i = 0; i < num_surfaces; i++) { // Create the sprite surface sprite_handles[i] = gem_create(fd, *sprite_size); if (tiled) { set_tiling.handle = sprite_handles[i]; set_tiling.tiling_mode = I915_TILING_X; set_tiling.stride = *sprite_stride; if (ioctl(fd, DRM_IOCTL_I915_GEM_SET_TILING, &set_tiling)) { printf("Set tiling failed: %s (stride=%d, size=%d)\n", strerror(errno), *sprite_stride, *sprite_size); return -1; } } // Get pointer to the surface sprite_fb_ptr = gem_mmap(fd, sprite_handles[i], *sprite_size, PROT_READ | PROT_WRITE); if (sprite_fb_ptr != NULL) { // Fill with checkerboard pattern fill_sprite( sprite_width, sprite_height, *sprite_stride, i, sprite_fb_ptr); munmap(sprite_fb_ptr, *sprite_size); } else { i--; while (i >= 0) { gem_close(fd, sprite_handles[i]); i--; } } } return 0; } static void ricochet( int tiled, int sprite_w, int sprite_h, int out_w, int out_h, int dump_info) { int ret; int gfx_fd; int keep_moving; const int num_surfaces = 3; uint32_t sprite_handles[num_surfaces]; uint32_t sprite_fb_id[num_surfaces]; int sprite_x; int sprite_y; uint32_t sprite_stride; uint32_t sprite_size; uint32_t handles[4], pitches[4], offsets[4]; /* we only use [0] */ uint32_t prim_width, prim_height, prim_handle, prim_stride, prim_size, prim_fb_id; struct drm_intel_sprite_colorkey set; struct connector curr_connector; drmModeRes *gfx_resources; struct termios orig_term, curr_term; int c_index; int sprite_index; unsigned int sprite_plane_id; uint32_t plane_flags = 0; int delta_x, delta_y; struct timeval stTimeVal; long long currTime, prevFlipTime, prevMoveTime, deltaFlipTime, deltaMoveTime, SleepTime; char key; // Open up I915 graphics device gfx_fd = drmOpen("i915", NULL); if (gfx_fd < 0) { printf("Failed to load i915 driver: %s\n", strerror(errno)); return; } // Obtain pointer to struct containing graphics resources gfx_resources = drmModeGetResources(gfx_fd); if (!gfx_resources) { printf("drmModeGetResources failed: %s\n", strerror(errno)); return; } if (dump_info != 0) { dump_connectors(gfx_fd, gfx_resources); dump_crtcs(gfx_fd, gfx_resources); dump_planes(gfx_fd, gfx_resources); } // Save previous terminal settings if (tcgetattr( 0, &orig_term) != 0) { printf("tcgetattr failure: %s\n", strerror(errno)); return; } // Set up input to return characters immediately curr_term = orig_term; curr_term.c_lflag &= ~(ICANON | ECHO | ECHONL); curr_term.c_cc[VMIN] = 0; // No minimum number of characters curr_term.c_cc[VTIME] = 0 ; // Return immediately, even if // nothing has been entered. if (tcsetattr( 0, TCSANOW, &curr_term) != 0) { printf("tcgetattr failure: %s\n", strerror(errno)); return; } // Cycle through all connectors and display the flying sprite // where there are displays attached and the hardware will support it. for (c_index = 0; c_index < gfx_resources->count_connectors; c_index++) { curr_connector.id = gfx_resources->connectors[c_index]; // Find the native (preferred) display mode connector_find_preferred_mode(gfx_fd, gfx_resources, &curr_connector); if (curr_connector.mode_valid == 0) { printf("No valid preferred mode detected\n"); goto out; } // Determine if sprite hardware is available on pipe // associated with this connector. sprite_plane_id = connector_find_plane(gfx_fd, &curr_connector); if (!sprite_plane_id) { printf("Failed to find sprite plane on crtc\n"); goto out; } // Width and height of preferred mode prim_width = curr_connector.mode.hdisplay; prim_height = curr_connector.mode.vdisplay; // Allocate and fill memory for primary surface ret = prepare_primary_surface( gfx_fd, prim_width, prim_height, &prim_handle, &prim_stride, &prim_size, tiled); if (ret != 0) { printf("Failed to add primary fb (%dx%d): %s\n", prim_width, prim_height, strerror(errno)); goto out; } // Add the primary surface framebuffer ret = drmModeAddFB( gfx_fd, prim_width, prim_height, 24, 32, prim_stride, prim_handle, &prim_fb_id); gem_close(gfx_fd, prim_handle); if (ret != 0) { printf("Failed to add primary fb (%dx%d): %s\n", prim_width, prim_height, strerror(errno)); goto out; } // Allocate and fill sprite surfaces ret = prepare_sprite_surfaces( gfx_fd, sprite_w, sprite_h, num_surfaces, &sprite_handles[0], &sprite_stride, &sprite_size, tiled); if (ret != 0) { printf("Preparation of sprite surfaces failed %dx%d\n", sprite_w, sprite_h); goto out; } // Add the sprite framebuffers for (sprite_index = 0; sprite_index < num_surfaces; sprite_index++) { handles[0] = sprite_handles[sprite_index]; handles[1] = handles[0]; handles[2] = handles[0]; handles[3] = handles[0]; pitches[0] = sprite_stride; pitches[1] = sprite_stride; pitches[2] = sprite_stride; pitches[3] = sprite_stride; memset(offsets, 0, sizeof(offsets)); ret = drmModeAddFB2( gfx_fd, sprite_w, sprite_h, DRM_FORMAT_XRGB8888, handles, pitches, offsets, &sprite_fb_id[sprite_index], plane_flags); gem_close(gfx_fd, sprite_handles[sprite_index]); if (ret) { printf("Failed to add sprite fb (%dx%d): %s\n", sprite_w, sprite_h, strerror(errno)); sprite_index--; while (sprite_index >= 0) { drmModeRmFB(gfx_fd, sprite_fb_id[sprite_index]); sprite_index--; } goto out; } } if (dump_info != 0) { printf("Displayed Mode Connector struct:\n" " .id = %d\n" " .mode_valid = %d\n" " .crtc = %d\n" " .pipe = %d\n" " drmModeModeInfo ...\n" " .name = %s\n" " .type = %d\n" " .flags = %08x\n" " drmModeEncoder ...\n" " .encoder_id = %d\n" " .encoder_type = %d (%s)\n" " .crtc_id = %d\n" " .possible_crtcs = %d\n" " .possible_clones = %d\n" " drmModeConnector ...\n" " .connector_id = %d\n" " .encoder_id = %d\n" " .connector_type = %d (%s)\n" " .connector_type_id = %d\n\n", curr_connector.id, curr_connector.mode_valid, curr_connector.crtc, curr_connector.pipe, curr_connector.mode.name, curr_connector.mode.type, curr_connector.mode.flags, curr_connector.encoder->encoder_id, curr_connector.encoder->encoder_type, encoder_type_str(curr_connector.encoder->encoder_type), curr_connector.encoder->crtc_id, curr_connector.encoder->possible_crtcs, curr_connector.encoder->possible_clones, curr_connector.connector->connector_id, curr_connector.connector->encoder_id, curr_connector.connector->connector_type, connector_type_str(curr_connector.connector->connector_type), curr_connector.connector->connector_type_id); printf("Sprite surface dimensions = %dx%d\n" "Sprite output dimensions = %dx%d\n" "Press any key to continue >\n", sprite_w, sprite_h, out_w, out_h); // Wait for a key-press while( read(0, &key, 1) == 0); // Purge unread characters tcflush(0, TCIFLUSH); } // Set up the primary display mode ret = drmModeSetCrtc( gfx_fd, curr_connector.crtc, prim_fb_id, 0, 0, &curr_connector.id, 1, &curr_connector.mode); if (ret != 0) { printf("Failed to set mode (%dx%d@%dHz): %s\n", prim_width, prim_height, curr_connector.mode.vrefresh, strerror(errno)); continue; } // Set the sprite colorkey state set.plane_id = sprite_plane_id; set.min_value = 0; set.max_value = 0; set.flags = I915_SET_COLORKEY_NONE; ret = drmCommandWrite(gfx_fd, DRM_I915_SET_SPRITE_COLORKEY, &set, sizeof(set)); // Set up sprite output dimensions, initial position, etc. if (out_w > prim_width / 2) out_w = prim_width / 2; if (out_h > prim_height / 2) out_h = prim_height / 2; delta_x = 3; delta_y = 4; sprite_x = (prim_width / 2) - (out_w / 2); sprite_y = (prim_height / 2) - (out_h / 2); currTime = 0; prevFlipTime = 0; // Will force immediate sprite flip prevMoveTime = 0; // Will force immediate sprite move deltaFlipTime = 500000; // Flip sprite surface every 1/2 second deltaMoveTime = 100000; // Move sprite every 100 ms sprite_index = num_surfaces - 1; keep_moving = 1; // Bounce sprite off the walls while (keep_moving) { // Obtain system time in usec. if (gettimeofday( &stTimeVal, NULL ) != 0) { printf("gettimeofday error: %s\n", strerror(errno)); } else { currTime = ((long long)stTimeVal.tv_sec * 1000000) + stTimeVal.tv_usec; } // Check if it's time to flip the sprite surface if (currTime - prevFlipTime > deltaFlipTime) { sprite_index = (sprite_index + 1) % num_surfaces; prevFlipTime = currTime; } // Move the sprite on the screen and flip // the surface if the index has changed if (drmModeSetPlane( gfx_fd, sprite_plane_id, curr_connector.crtc, sprite_fb_id[sprite_index], plane_flags, sprite_x, sprite_y, out_w, out_h, 0, 0, sprite_w, sprite_h)) { printf("Failed to enable sprite plane: %s\n", strerror(errno)); } // Check if it's time to move the sprite surface if (currTime - prevMoveTime > deltaMoveTime) { // Compute the next position for sprite sprite_x += delta_x; sprite_y += delta_y; if (sprite_x < 0) { sprite_x = 0; delta_x = -delta_x; } else if (sprite_x > prim_width - out_w) { sprite_x = prim_width - out_w; delta_x = -delta_x; } if (sprite_y < 0) { sprite_y = 0; delta_y = -delta_y; } else if (sprite_y > prim_height - out_h) { sprite_y = prim_height - out_h; delta_y = -delta_y; } prevMoveTime = currTime; } // Fetch a key from input (non-blocking) if (read(0, &key, 1) == 1) { switch (key) { case 'q': // Kill the program case 'Q': goto out; break; case 's': // Slow down sprite movement; deltaMoveTime = (deltaMoveTime * 100) / 90; if (deltaMoveTime > 800000) { deltaMoveTime = 800000; } break; case 'S': // Speed up sprite movement; deltaMoveTime = (deltaMoveTime * 100) / 110; if (deltaMoveTime < 2000) { deltaMoveTime = 2000; } break; case 'f': // Slow down sprite flipping; deltaFlipTime = (deltaFlipTime * 100) / 90; if (deltaFlipTime > 1000000) { deltaFlipTime = 1000000; } break; case 'F': // Speed up sprite flipping; deltaFlipTime = (deltaFlipTime * 100) / 110; if (deltaFlipTime < 20000) { deltaFlipTime = 20000; } break; case 'n': // Next connector case 'N': keep_moving = 0; break; default: break; } // Purge unread characters tcflush(0, TCIFLUSH); } // Wait for min of flip or move deltas SleepTime = (deltaFlipTime < deltaMoveTime) ? deltaFlipTime : deltaMoveTime; usleep(SleepTime); } } out: // Purge unread characters tcflush(0, TCIFLUSH); // Restore previous terminal settings if (tcsetattr( 0, TCSANOW, &orig_term) != 0) { printf("tcgetattr failure: %s\n", strerror(errno)); return; } drmModeFreeResources(gfx_resources); } static void usage(char *name) { printf("usage: %s -s x [-dhto]\n" "\t-d\t[optional] dump mode information\n" "\t-h\t[optional] output help message\n" "\t-t\t[optional] enable tiling\n" "\t-o\t[optional] x\n\n" "Keyboard control for sprite movement and flip rate ...\n" "\t'q' or 'Q' - Quit the program\n" "\t'n' or 'N' - Switch to next display\n" "\t's' - Slow sprite movement\n" "\t'S' - Speed up sprite movement\n" "\t'f' - Slow sprite surface flipping\n" "\t'F' - Speed up sprite surface flipping\n", name); } int main(int argc, char **argv) { int c; int test_overlay = 0, enable_tiling = 0, dump_info = 0; int plane_width = 0, plane_height = 0, out_width = 0, out_height = 0; static char optstr[] = "ds:o:th"; opterr = 0; while ((c = getopt(argc, argv, optstr)) != -1) { switch (c) { case 'd': // Dump information dump_info = 1; break; case 't': // Tiling enable enable_tiling = 1; break; case 's': // Surface dimensions if (sscanf(optarg, "%dx%d", &plane_width, &plane_height) != 2) usage(argv[0]); test_overlay = 1; break; case 'o': // Output dimensions if (sscanf(optarg, "%dx%d", &out_width, &out_height) != 2) usage(argv[0]); break; default: printf("unknown option %c\n", c); /* fall through */ case 'h': // Help! usage(argv[0]); goto out; } } if (test_overlay) { if (out_width < (plane_width / 2)) { out_width = plane_width; } if (out_height < (plane_height / 2)) { out_height = plane_height; } ricochet(enable_tiling, plane_width, plane_height, out_width, out_height, dump_info); } else { printf("Sprite dimensions are required:\n"); usage(argv[0]); } out: exit(0); } intel-gpu-tools-1.3/demos/Makefile.am0000664000175100017510000000041411757635623014525 00000000000000bin_PROGRAMS = \ intel_sprite_on \ $(NULL) AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/lib AM_CFLAGS = $(DRM_CFLAGS) $(PCIACCESS_CFLAGS) $(CWARNFLAGS) $(CAIRO_CFLAGS) LDADD = $(top_builddir)/lib/libintel_tools.la $(DRM_LIBS) $(PCIACCESS_LIBS) $(CAIRO_LIBS) intel-gpu-tools-1.3/demos/Makefile.in0000664000175100017510000004542012016622041014517 00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } 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@ bin_PROGRAMS = intel_sprite_on$(EXEEXT) subdir = demos DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) intel_sprite_on_SOURCES = intel_sprite_on.c intel_sprite_on_OBJECTS = intel_sprite_on.$(OBJEXT) intel_sprite_on_LDADD = $(LDADD) am__DEPENDENCIES_1 = intel_sprite_on_DEPENDENCIES = $(top_builddir)/lib/libintel_tools.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; SOURCES = intel_sprite_on.c DIST_SOURCES = intel_sprite_on.c am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ADMIN_MAN_DIR = @ADMIN_MAN_DIR@ ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@ AMTAR = @AMTAR@ 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@ CAIRO_CFLAGS = @CAIRO_CFLAGS@ CAIRO_LIBS = @CAIRO_LIBS@ 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@ DRM_CFLAGS = @DRM_CFLAGS@ DRM_LIBS = @DRM_LIBS@ DRM_NOUVEAU_CFLAGS = @DRM_NOUVEAU_CFLAGS@ DRM_NOUVEAU_LIBS = @DRM_NOUVEAU_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILE_MAN_DIR = @FILE_MAN_DIR@ FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@ GEN4ASM = @GEN4ASM@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_LIBS = @GLIB_LIBS@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_CMD = @INSTALL_CMD@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBUDEV_CFLAGS = @LIBUDEV_CFLAGS@ LIBUDEV_LIBS = @LIBUDEV_LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MAN_SUBSTS = @MAN_SUBSTS@ MISC_MAN_DIR = @MISC_MAN_DIR@ MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJCOPY = @OBJCOPY@ 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@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ THREAD_CFLAGS = @THREAD_CFLAGS@ VERSION = @VERSION@ 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@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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@ AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/lib AM_CFLAGS = $(DRM_CFLAGS) $(PCIACCESS_CFLAGS) $(CWARNFLAGS) $(CAIRO_CFLAGS) LDADD = $(top_builddir)/lib/libintel_tools.la $(DRM_LIBS) $(PCIACCESS_LIBS) $(CAIRO_LIBS) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign demos/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign demos/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p || test -f $$p1; \ then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list intel_sprite_on$(EXEEXT): $(intel_sprite_on_OBJECTS) $(intel_sprite_on_DEPENDENCIES) $(EXTRA_intel_sprite_on_DEPENDENCIES) @rm -f intel_sprite_on$(EXEEXT) $(AM_V_CCLD)$(LINK) $(intel_sprite_on_OBJECTS) $(intel_sprite_on_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/intel_sprite_on.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic clean-libtool ctags distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-binPROGRAMS install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-binPROGRAMS # 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: intel-gpu-tools-1.3/configure0000775000175100017510000231713612016622041013262 00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for intel-gpu-tools 1.3. # # Report bugs to . # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1 test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org and $0: https://bugs.freedesktop.org/enter_bug.cgi?product=xorg $0: about your system, including any error possibly output $0: before this message. Then install a modern shell, or $0: manually run the script under such a shell if you do $0: have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" SHELL=${CONFIG_SHELL-/bin/sh} test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='intel-gpu-tools' PACKAGE_TARNAME='intel-gpu-tools' PACKAGE_VERSION='1.3' PACKAGE_STRING='intel-gpu-tools 1.3' PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=xorg' PACKAGE_URL='' ac_unique_file="Makefile.am" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS THREAD_CFLAGS BUILD_SHADER_DEBUGGER_FALSE BUILD_SHADER_DEBUGGER_TRUE OBJCOPY GEN4ASM GLIB_LIBS GLIB_CFLAGS LIBUDEV_LIBS LIBUDEV_CFLAGS CAIRO_LIBS CAIRO_CFLAGS HAVE_NOUVEAU_FALSE HAVE_NOUVEAU_TRUE DRM_NOUVEAU_LIBS DRM_NOUVEAU_CFLAGS PCIACCESS_LIBS PCIACCESS_CFLAGS DRM_LIBS DRM_CFLAGS AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V MAN_SUBSTS XORG_MAN_PAGE ADMIN_MAN_DIR DRIVER_MAN_DIR MISC_MAN_DIR FILE_MAN_DIR LIB_MAN_DIR APP_MAN_DIR ADMIN_MAN_SUFFIX DRIVER_MAN_SUFFIX MISC_MAN_SUFFIX FILE_MAN_SUFFIX LIB_MAN_SUFFIX APP_MAN_SUFFIX INSTALL_CMD PKG_CONFIG_LIBDIR PKG_CONFIG_PATH PKG_CONFIG CHANGELOG_CMD STRICT_CFLAGS CWARNFLAGS BASE_CFLAGS OTOOL64 OTOOL LIPO NMEDIT DSYMUTIL MANIFEST_TOOL RANLIB ac_ct_AR AR DLLTOOL OBJDUMP LN_S NM ac_ct_DUMPBIN DUMPBIN LD FGREP SED host_os host_vendor host_cpu host build_os build_vendor build_cpu build LIBTOOL MAINT MAINTAINER_MODE_FALSE MAINTAINER_MODE_TRUE pkgpyexecdir pyexecdir pkgpythondir pythondir PYTHON_PLATFORM PYTHON_EXEC_PREFIX PYTHON_PREFIX PYTHON_VERSION PYTHON am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM EGREP GREP CPP OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_largefile enable_dependency_tracking enable_maintainer_mode enable_static enable_shared with_pic enable_fast_install with_gnu_ld with_sysroot enable_libtool_lock enable_selective_werror enable_strict_compilation enable_silent_rules enable_nouveau enable_shader_debugger ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP PYTHON PKG_CONFIG PKG_CONFIG_PATH PKG_CONFIG_LIBDIR DRM_CFLAGS DRM_LIBS PCIACCESS_CFLAGS PCIACCESS_LIBS DRM_NOUVEAU_CFLAGS DRM_NOUVEAU_LIBS CAIRO_CFLAGS CAIRO_LIBS LIBUDEV_CFLAGS LIBUDEV_LIBS GLIB_CFLAGS GLIB_LIBS' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures intel-gpu-tools 1.3 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/intel-gpu-tools] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of intel-gpu-tools 1.3:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --disable-largefile omit support for large files --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer --enable-static[=PKGS] build static libraries [default=no] --enable-shared[=PKGS] build shared libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) --disable-selective-werror Turn off selective compiler errors. (default: enabled) --enable-strict-compilation Enable all warnings from compiler and make them errors (default: disabled) --enable-silent-rules less verbose build output (undo: `make V=1') --disable-silent-rules verbose build output (undo: `make V=0') --disable-nouveau Enable use of nouveau API for prime tests (default: enabled) --enable-shader-debugger Enable shader debugging support [autodetected] Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use both] --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-sysroot=DIR Search for dependent libraries within DIR (or the compiler's sysroot if not specified). Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor PYTHON the Python interpreter PKG_CONFIG path to pkg-config utility PKG_CONFIG_PATH directories to add to pkg-config's search path PKG_CONFIG_LIBDIR path overriding pkg-config's built-in search path DRM_CFLAGS C compiler flags for DRM, overriding pkg-config DRM_LIBS linker flags for DRM, overriding pkg-config PCIACCESS_CFLAGS C compiler flags for PCIACCESS, overriding pkg-config PCIACCESS_LIBS linker flags for PCIACCESS, overriding pkg-config DRM_NOUVEAU_CFLAGS C compiler flags for DRM_NOUVEAU, overriding pkg-config DRM_NOUVEAU_LIBS linker flags for DRM_NOUVEAU, overriding pkg-config CAIRO_CFLAGS C compiler flags for CAIRO, overriding pkg-config CAIRO_LIBS linker flags for CAIRO, overriding pkg-config LIBUDEV_CFLAGS C compiler flags for LIBUDEV, overriding pkg-config LIBUDEV_LIBS linker flags for LIBUDEV, overriding pkg-config GLIB_CFLAGS C compiler flags for GLIB, overriding pkg-config GLIB_LIBS linker flags for GLIB, overriding pkg-config Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF intel-gpu-tools configure 1.3 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ( $as_echo "## ---------------------------------------------------------------------- ## ## Report this to https://bugs.freedesktop.org/enter_bug.cgi?product=xorg ## ## ---------------------------------------------------------------------- ##" ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_mongrel # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES # ---------------------------------------------------- # Tries to find if the field MEMBER exists in type AGGR, after including # INCLUDES, setting cache variable VAR accordingly. ac_fn_c_check_member () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5 $as_echo_n "checking for $2.$3... " >&6; } if eval \${$4+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $5 int main () { static $2 ac_aggr; if (ac_aggr.$3) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$4=yes" else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $5 int main () { static $2 ac_aggr; if (sizeof ac_aggr.$3) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$4=yes" else eval "$4=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$4 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_member # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func # ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES # --------------------------------------------- # Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR # accordingly. ac_fn_c_check_decl () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack as_decl_name=`echo $2|sed 's/ *(.*//'` as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 $as_echo_n "checking whether $as_decl_name is declared... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { #ifndef $as_decl_name #ifdef __cplusplus (void) $as_decl_use; #else (void) $as_decl_name; #endif #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_decl cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by intel-gpu-tools $as_me 1.3, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_config_headers="$ac_config_headers config.h" ac_aux_dir= for ac_dir in build-aux "$srcdir"/build-aux; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in build-aux \"$srcdir\"/build-aux" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default" if test "x$ac_cv_header_minix_config_h" = xyes; then : MINIX=yes else MINIX= fi if test "$MINIX" = yes; then $as_echo "#define _POSIX_SOURCE 1" >>confdefs.h $as_echo "#define _POSIX_1_SOURCE 2" >>confdefs.h $as_echo "#define _MINIX 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5 $as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; } if ${ac_cv_safe_to_define___extensions__+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ # define __EXTENSIONS__ 1 $ac_includes_default int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_safe_to_define___extensions__=yes else ac_cv_safe_to_define___extensions__=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5 $as_echo "$ac_cv_safe_to_define___extensions__" >&6; } test $ac_cv_safe_to_define___extensions__ = yes && $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h $as_echo "#define _ALL_SOURCE 1" >>confdefs.h $as_echo "#define _GNU_SOURCE 1" >>confdefs.h $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h $as_echo "#define _TANDEM_SOURCE 1" >>confdefs.h # Check whether --enable-largefile was given. if test "${enable_largefile+set}" = set; then : enableval=$enable_largefile; fi if test "$enable_largefile" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5 $as_echo_n "checking for special C compiler options needed for large files... " >&6; } if ${ac_cv_sys_largefile_CC+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_sys_largefile_CC=no if test "$GCC" != yes; then ac_save_CC=$CC while :; do # IRIX 6.2 and later do not support large files by default, # so use the C compiler's -n32 option if that helps. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : break fi rm -f core conftest.err conftest.$ac_objext CC="$CC -n32" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_sys_largefile_CC=' -n32'; break fi rm -f core conftest.err conftest.$ac_objext break done CC=$ac_save_CC rm -f conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5 $as_echo "$ac_cv_sys_largefile_CC" >&6; } if test "$ac_cv_sys_largefile_CC" != no; then CC=$CC$ac_cv_sys_largefile_CC fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5 $as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } if ${ac_cv_sys_file_offset_bits+:} false; then : $as_echo_n "(cached) " >&6 else while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_sys_file_offset_bits=no; break fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _FILE_OFFSET_BITS 64 #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_sys_file_offset_bits=64; break fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_sys_file_offset_bits=unknown break done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5 $as_echo "$ac_cv_sys_file_offset_bits" >&6; } case $ac_cv_sys_file_offset_bits in #( no | unknown) ;; *) cat >>confdefs.h <<_ACEOF #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits _ACEOF ;; esac rm -rf conftest* if test $ac_cv_sys_file_offset_bits = unknown; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5 $as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; } if ${ac_cv_sys_large_files+:} false; then : $as_echo_n "(cached) " >&6 else while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_sys_large_files=no; break fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _LARGE_FILES 1 #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_sys_large_files=1; break fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_sys_large_files=unknown break done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5 $as_echo "$ac_cv_sys_large_files" >&6; } case $ac_cv_sys_large_files in #( no | unknown) ;; *) cat >>confdefs.h <<_ACEOF #define _LARGE_FILES $ac_cv_sys_large_files _ACEOF ;; esac rm -rf conftest* fi fi am__api_version='1.11' # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Just in case sleep 1 echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;; esac # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi rm -f conftest.file if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } mkdir_p="$MKDIR_P" case $mkdir_p in [\\/$]* | ?:[\\/]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from `make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 $as_echo "$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='intel-gpu-tools' VERSION='1.3' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi if test -n "$PYTHON"; then # If the user set $PYTHON, use it and don't search something else. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $PYTHON version >= 3" >&5 $as_echo_n "checking whether $PYTHON version >= 3... " >&6; } prog="import sys # split strings by '.' and convert to numeric. Append some zeros # because we need at least 4 digits for the hex conversion. # map returns an iterator in Python 3.0 and a list in 2.x minver = list(map(int, '3'.split('.'))) + [0, 0, 0] minverhex = 0 # xrange is not present in Python 3.0 and range returns an iterator for i in list(range(0, 4)): minverhex = (minverhex << 8) + minver[i] sys.exit(sys.hexversion < minverhex)" if { echo "$as_me:$LINENO: $PYTHON -c "$prog"" >&5 ($PYTHON -c "$prog") >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else as_fn_error $? "too old" "$LINENO" 5 fi am_display_PYTHON=$PYTHON else # Otherwise, try each interpreter until we find one that satisfies # VERSION. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a Python interpreter with version >= 3" >&5 $as_echo_n "checking for a Python interpreter with version >= 3... " >&6; } if ${am_cv_pathless_PYTHON+:} false; then : $as_echo_n "(cached) " >&6 else for am_cv_pathless_PYTHON in python python2 python3 python3.2 python3.1 python3.0 python2.7 python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 none; do test "$am_cv_pathless_PYTHON" = none && break prog="import sys # split strings by '.' and convert to numeric. Append some zeros # because we need at least 4 digits for the hex conversion. # map returns an iterator in Python 3.0 and a list in 2.x minver = list(map(int, '3'.split('.'))) + [0, 0, 0] minverhex = 0 # xrange is not present in Python 3.0 and range returns an iterator for i in list(range(0, 4)): minverhex = (minverhex << 8) + minver[i] sys.exit(sys.hexversion < minverhex)" if { echo "$as_me:$LINENO: $am_cv_pathless_PYTHON -c "$prog"" >&5 ($am_cv_pathless_PYTHON -c "$prog") >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then : break fi done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_pathless_PYTHON" >&5 $as_echo "$am_cv_pathless_PYTHON" >&6; } # Set $PYTHON to the absolute path of $am_cv_pathless_PYTHON. if test "$am_cv_pathless_PYTHON" = none; then PYTHON=: else # Extract the first word of "$am_cv_pathless_PYTHON", so it can be a program name with args. set dummy $am_cv_pathless_PYTHON; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_PYTHON+:} false; then : $as_echo_n "(cached) " >&6 else case $PYTHON in [\\/]* | ?:[\\/]*) ac_cv_path_PYTHON="$PYTHON" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PYTHON="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi PYTHON=$ac_cv_path_PYTHON if test -n "$PYTHON"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON" >&5 $as_echo "$PYTHON" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi am_display_PYTHON=$am_cv_pathless_PYTHON fi if test "$PYTHON" = :; then : else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON version" >&5 $as_echo_n "checking for $am_display_PYTHON version... " >&6; } if ${am_cv_python_version+:} false; then : $as_echo_n "(cached) " >&6 else am_cv_python_version=`$PYTHON -c "import sys; sys.stdout.write(sys.version[:3])"` fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_version" >&5 $as_echo "$am_cv_python_version" >&6; } PYTHON_VERSION=$am_cv_python_version PYTHON_PREFIX='${prefix}' PYTHON_EXEC_PREFIX='${exec_prefix}' { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON platform" >&5 $as_echo_n "checking for $am_display_PYTHON platform... " >&6; } if ${am_cv_python_platform+:} false; then : $as_echo_n "(cached) " >&6 else am_cv_python_platform=`$PYTHON -c "import sys; sys.stdout.write(sys.platform)"` fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_platform" >&5 $as_echo "$am_cv_python_platform" >&6; } PYTHON_PLATFORM=$am_cv_python_platform { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON script directory" >&5 $as_echo_n "checking for $am_display_PYTHON script directory... " >&6; } if ${am_cv_python_pythondir+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$prefix" = xNONE then am_py_prefix=$ac_default_prefix else am_py_prefix=$prefix fi am_cv_python_pythondir=`$PYTHON -c "import sys; from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_lib(0,0,prefix='$am_py_prefix'))" 2>/dev/null` case $am_cv_python_pythondir in $am_py_prefix*) am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'` am_cv_python_pythondir=`echo "$am_cv_python_pythondir" | sed "s,^$am__strip_prefix,$PYTHON_PREFIX,"` ;; *) case $am_py_prefix in /usr|/System*) ;; *) am_cv_python_pythondir=$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages ;; esac ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_pythondir" >&5 $as_echo "$am_cv_python_pythondir" >&6; } pythondir=$am_cv_python_pythondir pkgpythondir=\${pythondir}/$PACKAGE { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON extension module directory" >&5 $as_echo_n "checking for $am_display_PYTHON extension module directory... " >&6; } if ${am_cv_python_pyexecdir+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$exec_prefix" = xNONE then am_py_exec_prefix=$am_py_prefix else am_py_exec_prefix=$exec_prefix fi am_cv_python_pyexecdir=`$PYTHON -c "import sys; from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_lib(1,0,prefix='$am_py_exec_prefix'))" 2>/dev/null` case $am_cv_python_pyexecdir in $am_py_exec_prefix*) am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'` am_cv_python_pyexecdir=`echo "$am_cv_python_pyexecdir" | sed "s,^$am__strip_prefix,$PYTHON_EXEC_PREFIX,"` ;; *) case $am_py_exec_prefix in /usr|/System*) ;; *) am_cv_python_pyexecdir=$PYTHON_EXEC_PREFIX/lib/python$PYTHON_VERSION/site-packages ;; esac ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_pyexecdir" >&5 $as_echo "$am_cv_python_pyexecdir" >&6; } pyexecdir=$am_cv_python_pyexecdir pkgpyexecdir=\${pyexecdir}/$PACKAGE fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 $as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } # Check whether --enable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then : enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval else USE_MAINTAINER_MODE=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 $as_echo "$USE_MAINTAINER_MODE" >&6; } if test $USE_MAINTAINER_MODE = yes; then MAINTAINER_MODE_TRUE= MAINTAINER_MODE_FALSE='#' else MAINTAINER_MODE_TRUE='#' MAINTAINER_MODE_FALSE= fi MAINT=$MAINTAINER_MODE_TRUE # Checks for functions, headers, structures, etc. for ac_header in termios.h do : ac_fn_c_check_header_mongrel "$LINENO" "termios.h" "ac_cv_header_termios_h" "$ac_includes_default" if test "x$ac_cv_header_termios_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_TERMIOS_H 1 _ACEOF fi done ac_fn_c_check_member "$LINENO" "struct sysinfo" "totalram" "ac_cv_member_struct_sysinfo_totalram" "$ac_includes_default #include " if test "x$ac_cv_member_struct_sysinfo_totalram" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_SYSINFO_TOTALRAM 1 _ACEOF fi for ac_func in swapctl do : ac_fn_c_check_func "$LINENO" "swapctl" "ac_cv_func_swapctl" if test "x$ac_cv_func_swapctl" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SWAPCTL 1 _ACEOF fi done for ac_func in asprintf do : ac_fn_c_check_func "$LINENO" "asprintf" "ac_cv_func_asprintf" if test "x$ac_cv_func_asprintf" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_ASPRINTF 1 _ACEOF fi done # Initialize libtool # Check whether --enable-static was given. if test "${enable_static+set}" = set; then : enableval=$enable_static; p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac else enable_static=no fi case `pwd` in *\ * | *\ *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 $as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; esac macro_version='2.4.2' macro_revision='1.3337' ltmain="$ac_aux_dir/ltmain.sh" # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if ${ac_cv_build+:} false; then : $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if ${ac_cv_host+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac # Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\(["`$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 $as_echo_n "checking how to print strings... " >&6; } # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "" } case "$ECHO" in printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 $as_echo "printf" >&6; } ;; print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 $as_echo "print -r" >&6; } ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 $as_echo "cat" >&6; } ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } if ${ac_cv_path_SED+:} false; then : $as_echo_n "(cached) " >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed { ac_script=; unset ac_script;} if test -z "$SED"; then ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 $as_echo "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 $as_echo_n "checking for fgrep... " >&6; } if ${ac_cv_path_FGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 then ac_cv_path_FGREP="$GREP -F" else if test -z "$FGREP"; then ac_path_FGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in fgrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_FGREP" || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP case `"$ac_path_FGREP" --version 2>&1` in *GNU*) ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'FGREP' >> "conftest.nl" "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_FGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_FGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_FGREP"; then as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_FGREP=$FGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 $as_echo "$ac_cv_path_FGREP" >&6; } FGREP="$ac_cv_path_FGREP" test -z "$GREP" && GREP=grep # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${lt_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 $as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } if ${lt_cv_path_NM+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done : ${lt_cv_path_NM=no} fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 $as_echo "$lt_cv_path_NM" >&6; } if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else if test -n "$ac_tool_prefix"; then for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DUMPBIN"; then ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 $as_echo "$DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$DUMPBIN" && break done fi if test -z "$DUMPBIN"; then ac_ct_DUMPBIN=$DUMPBIN for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DUMPBIN"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 $as_echo "$ac_ct_DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_DUMPBIN" && break done if test "x$ac_ct_DUMPBIN" = x; then DUMPBIN=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DUMPBIN=$ac_ct_DUMPBIN fi fi case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols" ;; *) DUMPBIN=: ;; esac fi if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm { $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 $as_echo_n "checking the name lister ($NM) interface... " >&6; } if ${lt_cv_nm_interface+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 $as_echo "$lt_cv_nm_interface" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 $as_echo "no, using $LN_S" >&6; } fi # find the maximum length of command line arguments { $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 $as_echo_n "checking the maximum length of command line arguments... " >&6; } if ${lt_cv_sys_max_cmd_len+:} false; then : $as_echo_n "(cached) " >&6 else i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac fi if test -n $lt_cv_sys_max_cmd_len ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 $as_echo "$lt_cv_sys_max_cmd_len" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 $as_echo "none" >&6; } fi max_cmd_len=$lt_cv_sys_max_cmd_len : ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5 $as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,b/c, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5 $as_echo "$xsi_shell" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5 $as_echo_n "checking whether the shell understands \"+=\"... " >&6; } lt_shell_append=no ( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5 $as_echo "$lt_shell_append" >&6; } if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 $as_echo_n "checking how to convert $build file names to $host format... " >&6; } if ${lt_cv_to_host_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac fi to_host_file_cmd=$lt_cv_to_host_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 $as_echo "$lt_cv_to_host_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 $as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } if ${lt_cv_to_tool_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else #assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac fi to_tool_file_cmd=$lt_cv_to_tool_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 $as_echo "$lt_cv_to_tool_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 $as_echo_n "checking for $LD option to reload object files... " >&6; } if ${lt_cv_ld_reload_flag+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_reload_flag='-r' fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 $as_echo "$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in cygwin* | mingw* | pw32* | cegcc*) if test "$GCC" != yes; then reload_cmds=false fi ;; darwin*) if test "$GCC" = yes; then reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 $as_echo "$OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJDUMP="objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 $as_echo "$ac_ct_OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi test -z "$OBJDUMP" && OBJDUMP=objdump { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 $as_echo_n "checking how to recognize dependent libraries... " >&6; } if ${lt_cv_deplibs_check_method+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # `unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # which responds to the $file_magic_cmd with a given extended regex. # If you have `file' or equivalent on your system and you're not sure # whether `pass_all' will *always* work, you probably want this one. case $host_os in aix[4-9]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[45]*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; 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* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 $as_echo "$lt_cv_deplibs_check_method" >&6; } file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 $as_echo "$DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 $as_echo "$ac_ct_DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DLLTOOL=$ac_ct_DLLTOOL fi else DLLTOOL="$ac_cv_prog_DLLTOOL" fi test -z "$DLLTOOL" && DLLTOOL=dlltool { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 $as_echo_n "checking how to associate runtime and link libraries... " >&6; } if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh # decide which to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd="$ECHO" ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 $as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO if test -n "$ac_tool_prefix"; then for ac_prog in ar do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 $as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AR" && break done fi if test -z "$AR"; then ac_ct_AR=$AR for ac_prog in ar do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 $as_echo "$ac_ct_AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_AR" && break done if test "x$ac_ct_AR" = x; then AR="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi fi : ${AR=ar} : ${AR_FLAGS=cru} { $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 $as_echo_n "checking for archiver @FILE support... " >&6; } if ${lt_cv_ar_at_file+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ar_at_file=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -eq 0; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -ne 0; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 $as_echo "$lt_cv_ar_at_file" >&6; } if test "x$lt_cv_ar_at_file" = xno; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi test -z "$STRIP" && STRIP=: if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi test -z "$RANLIB" && RANLIB=: # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Check for command to grab the raw symbol name followed by C symbol from nm. { $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 $as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } if ${lt_cv_sys_global_symbol_pipe+:} false; then : $as_echo_n "(cached) " >&6 else # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[ABCDEGRST]' fi ;; irix* | nonstopux*) symcode='[BCDEGRST]' ;; osf*) symcode='[BCDEGQRST]' ;; solaris*) symcode='[BDRT]' ;; sco3.2v5*) symcode='[DT]' ;; sysv4.2uw2*) symcode='[DT]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[ABDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGIRSTW]' ;; esac # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done fi if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 $as_echo "failed" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then nm_file_list_spec='@' fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 $as_echo_n "checking for sysroot... " >&6; } # Check whether --with-sysroot was given. if test "${with_sysroot+set}" = set; then : withval=$with_sysroot; else with_sysroot=no fi lt_sysroot= case ${with_sysroot} in #( yes) if test "$GCC" = yes; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5 $as_echo "${with_sysroot}" >&6; } as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 $as_echo "${lt_sysroot:-no}" >&6; } # Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then : enableval=$enable_libtool_lock; fi test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 $as_echo_n "checking whether the C compiler needs -belf... " >&6; } if ${lt_cv_cc_needs_belf+:} false; then : $as_echo_n "(cached) " >&6 else ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_cc_needs_belf=yes else lt_cv_cc_needs_belf=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 $as_echo "$lt_cv_cc_needs_belf" >&6; } if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; *-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD="${LD-ld}_sol2" fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. set dummy ${ac_tool_prefix}mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$MANIFEST_TOOL"; then ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL if test -n "$MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 $as_echo "$MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_MANIFEST_TOOL"; then ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL # Extract the first word of "mt", so it can be a program name with args. set dummy mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_MANIFEST_TOOL"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL if test -n "$ac_ct_MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 $as_echo "$ac_ct_MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_MANIFEST_TOOL" = x; then MANIFEST_TOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL fi else MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" fi test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 $as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } if ${lt_cv_path_mainfest_tool+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&5 if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 $as_echo "$lt_cv_path_mainfest_tool" >&6; } if test "x$lt_cv_path_mainfest_tool" != xyes; then MANIFEST_TOOL=: fi case $host_os in rhapsody* | darwin*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DSYMUTIL"; then ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 $as_echo "$DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DSYMUTIL"; then ac_ct_DSYMUTIL=$DSYMUTIL # Extract the first word of "dsymutil", so it can be a program name with args. set dummy dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DSYMUTIL"; then ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 $as_echo "$ac_ct_DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DSYMUTIL" = x; then DSYMUTIL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DSYMUTIL=$ac_ct_DSYMUTIL fi else DSYMUTIL="$ac_cv_prog_DSYMUTIL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. set dummy ${ac_tool_prefix}nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NMEDIT"; then ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 $as_echo "$NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_NMEDIT"; then ac_ct_NMEDIT=$NMEDIT # Extract the first word of "nmedit", so it can be a program name with args. set dummy nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_NMEDIT"; then ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_NMEDIT="nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 $as_echo "$ac_ct_NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_NMEDIT" = x; then NMEDIT=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac NMEDIT=$ac_ct_NMEDIT fi else NMEDIT="$ac_cv_prog_NMEDIT" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. set dummy ${ac_tool_prefix}lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_LIPO="${ac_tool_prefix}lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 $as_echo "$LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_LIPO"; then ac_ct_LIPO=$LIPO # Extract the first word of "lipo", so it can be a program name with args. set dummy lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_LIPO"; then ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_LIPO="lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 $as_echo "$ac_ct_LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_LIPO" = x; then LIPO=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac LIPO=$ac_ct_LIPO fi else LIPO="$ac_cv_prog_LIPO" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. set dummy ${ac_tool_prefix}otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL"; then ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL="${ac_tool_prefix}otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 $as_echo "$OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL"; then ac_ct_OTOOL=$OTOOL # Extract the first word of "otool", so it can be a program name with args. set dummy otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL"; then ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL="otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 $as_echo "$ac_ct_OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL" = x; then OTOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL=$ac_ct_OTOOL fi else OTOOL="$ac_cv_prog_OTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. set dummy ${ac_tool_prefix}otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL64"; then ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 $as_echo "$OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL64"; then ac_ct_OTOOL64=$OTOOL64 # Extract the first word of "otool64", so it can be a program name with args. set dummy otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL64"; then ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL64="otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 $as_echo "$ac_ct_OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL64" = x; then OTOOL64=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL64=$ac_ct_OTOOL64 fi else OTOOL64="$ac_cv_prog_OTOOL64" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 $as_echo_n "checking for -single_module linker flag... " >&6; } if ${lt_cv_apple_cc_single_mod+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_apple_cc_single_mod=no if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&5 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&5 # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test $_lt_result -eq 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 fi rm -rf libconftest.dylib* rm -f conftest.* fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 $as_echo "$lt_cv_apple_cc_single_mod" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } if ${lt_cv_ld_exported_symbols_list+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_ld_exported_symbols_list=yes else lt_cv_ld_exported_symbols_list=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 $as_echo "$lt_cv_ld_exported_symbols_list" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 $as_echo_n "checking for -force_load linker flag... " >&6; } if ${lt_cv_ld_force_load+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 echo "$AR cru libconftest.a conftest.o" >&5 $AR cru libconftest.a conftest.o 2>&5 echo "$RANLIB libconftest.a" >&5 $RANLIB libconftest.a 2>&5 cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&5 elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then lt_cv_ld_force_load=yes else cat conftest.err >&5 fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 $as_echo "$lt_cv_ld_force_load" >&6; } case $host_os in rhapsody* | darwin1.[012]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[91]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[012]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac for ac_header in dlfcn.h do : ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default " if test "x$ac_cv_header_dlfcn_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_DLFCN_H 1 _ACEOF fi done # Set options enable_dlopen=no enable_win32_dll=no # Check whether --enable-shared was given. if test "${enable_shared+set}" = set; then : enableval=$enable_shared; p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac else enable_shared=yes fi # Check whether --with-pic was given. if test "${with_pic+set}" = set; then : withval=$with_pic; lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for lt_pkg in $withval; do IFS="$lt_save_ifs" if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS="$lt_save_ifs" ;; esac else pic_mode=default fi test -z "$pic_mode" && pic_mode=default # Check whether --enable-fast-install was given. if test "${enable_fast_install+set}" = set; then : enableval=$enable_fast_install; p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac else enable_fast_install=yes fi # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' test -z "$LN_S" && LN_S="ln -s" if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 $as_echo_n "checking for objdir... " >&6; } if ${lt_cv_objdir+:} false; then : $as_echo_n "(cached) " >&6 else rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 $as_echo "$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir cat >>confdefs.h <<_ACEOF #define LT_OBJDIR "$lt_cv_objdir/" _ACEOF case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld="$lt_cv_prog_gnu_ld" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 $as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/${ac_tool_prefix}file; then lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 $as_echo_n "checking for file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/file; then lt_cv_path_MAGIC_CMD="$ac_dir/file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi else MAGIC_CMD=: fi fi fi ;; esac # Use C for the default configuration in the libtool script lt_save_CC="$CC" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o objext=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* if test -n "$compiler"; then lt_prog_compiler_no_builtin_flag= if test "$GCC" = yes; then case $cc_basename in nvcc*) lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; *) lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 $as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= if test "$GCC" = yes; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; *) lt_prog_compiler_pic='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 lt_prog_compiler_wl='-Xlinker ' if test -n "$lt_prog_compiler_pic"; then lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # Lahey Fortran 8.1. lf95*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;; nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='' ;; *Sun\ F* | *Sun*Fortran*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; *Intel*\ [CF]*Compiler*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; *Portland\ Group*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; esac ;; esac ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; rdos*) lt_prog_compiler_static='-non_shared' ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; unicos*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_can_build_shared=no ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if ${lt_cv_prog_compiler_pic+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic=$lt_prog_compiler_pic fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 $as_echo "$lt_cv_prog_compiler_pic" >&6; } lt_prog_compiler_pic=$lt_cv_prog_compiler_pic # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } if ${lt_cv_prog_compiler_pic_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 $as_echo "$lt_cv_prog_compiler_pic_works" >&6; } if test x"$lt_cv_prog_compiler_pic_works" = xyes; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if ${lt_cv_prog_compiler_static_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works=yes fi else lt_cv_prog_compiler_static_works=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 $as_echo "$lt_cv_prog_compiler_static_works" >&6; } if test x"$lt_cv_prog_compiler_static_works" = xyes; then : else lt_prog_compiler_static= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test "$hard_links" = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag= always_export_symbols=no archive_cmds= archive_expsym_cmds= compiler_needs_object=no enable_shared_with_static_runtimes=no export_dynamic_flag_spec= export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' hardcode_automatic=no hardcode_direct=no hardcode_direct_absolute=no hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_minus_L=no hardcode_shlibpath_var=unsupported inherit_rpath=no link_all_deplibs=unknown module_cmds= module_expsym_cmds= old_archive_from_new_cmds= old_archive_from_expsyms_cmds= thread_safe_flag_spec= whole_archive_flag_spec= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; linux* | k*bsd*-gnu | gnu*) link_all_deplibs=no ;; esac ld_shlibs=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test "$with_gnu_ld" = yes; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; *\ \(GNU\ Binutils\)\ [3-9]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' export_dynamic_flag_spec='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec= fi supports_anon_versioning=no case `$LD -v 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' export_dynamic_flag_spec='${wl}--export-all-symbols' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs=no fi ;; haiku*) archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' link_all_deplibs=yes ;; interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else ld_shlibs=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = no; then runpath_var= hardcode_libdir_flag_spec= export_dynamic_flag_spec= whole_archive_flag_spec= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix[4-9]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global # defined symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds='' hardcode_direct=yes hardcode_direct_absolute=yes hardcode_libdir_separator=':' link_all_deplibs=yes file_list_spec='${wl}-f,' if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi link_all_deplibs=no else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi export_dynamic_flag_spec='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an # empty executable. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' ${wl}-bernotok' allow_undefined_flag=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' fi archive_cmds_need_lc=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported always_export_symbols=yes file_list_spec='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, )='true' enable_shared_with_static_runtimes=yes exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib old_postinstall_cmds='chmod 644 $oldlib' postlink_cmds='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' enable_shared_with_static_runtimes=yes ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported if test "$lt_cv_ld_force_load" = "yes"; then whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec='' fi link_all_deplibs=yes allow_undefined_flag="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=func_echo_all archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" else ld_shlibs=no fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes export_dynamic_flag_spec='${wl}-E' ;; hpux10*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 $as_echo_n "checking if $CC understands -b... " >&6; } if ${lt_cv_prog_compiler__b+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler__b=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -b" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler__b=yes fi else lt_cv_prog_compiler__b=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 $as_echo "$lt_cv_prog_compiler__b" >&6; } if test x"$lt_cv_prog_compiler__b" = xyes; then archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi ;; esac fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_direct=no hardcode_shlibpath_var=no ;; *) hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 $as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } if ${lt_cv_irix_exported_symbol+:} false; then : $as_echo_n "(cached) " >&6 else save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo (void) { return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_irix_exported_symbol=yes else lt_cv_irix_exported_symbol=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 $as_echo "$lt_cv_irix_exported_symbol" >&6; } if test "$lt_cv_irix_exported_symbol" = yes; then archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' fi else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: inherit_rpath=yes link_all_deplibs=yes ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes hardcode_shlibpath_var=no hardcode_direct_absolute=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-R$libdir' ;; *) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi archive_cmds_need_lc='no' hardcode_libdir_separator=: ;; solaris*) no_undefined_flag=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='${wl}' archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else whole_archive_flag_spec='-z allextract$convenience -z defaultextract' fi ;; esac link_all_deplibs=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) case $host_vendor in sni) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds='$CC -r -o $output$reload_objs' hardcode_direct=no ;; motorola) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag='${wl}-z,text' archive_cmds_need_lc=no hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag='${wl}-z,text' allow_undefined_flag='${wl}-z,nodefs' archive_cmds_need_lc=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-R,$libdir' hardcode_libdir_separator=':' link_all_deplibs=yes export_dynamic_flag_spec='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) export_dynamic_flag_spec='${wl}-Blargedynsym' ;; esac fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 $as_echo "$ld_shlibs" >&6; } test "$ld_shlibs" = no && can_build_shared=no with_gnu_ld=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } if ${lt_cv_archive_cmds_need_lc+:} false; then : $as_echo_n "(cached) " >&6 else $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl pic_flag=$lt_prog_compiler_pic compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc=no else lt_cv_archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 $as_echo "$lt_cv_archive_cmds_need_lc" >&6; } archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;; *) lt_sed_strip_eq="s,=/,/,g" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[lt_foo]++; } if (lt_freq[lt_foo] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's,/\([A-Za-z]:\),\1,g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[4-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' library_names_spec='${libname}.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec="$LIB" if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=yes sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH if ${lt_cv_shlibpath_overrides_runpath+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || test -n "$runpath_var" || test "X$hardcode_automatic" = "Xyes" ; then # We can hardcode non-existent directories. if test "$hardcode_direct" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no && test "$hardcode_minus_L" != no; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 $as_echo "$hardcode_action" >&6; } if test "$hardcode_action" = relink || test "$inherit_rpath" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; *) ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" if test "x$ac_cv_func_shl_load" = xyes; then : lt_cv_dlopen="shl_load" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } if ${ac_cv_lib_dld_shl_load+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_shl_load=yes else ac_cv_lib_dld_shl_load=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = xyes; then : lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" else ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" if test "x$ac_cv_func_dlopen" = xyes; then : lt_cv_dlopen="dlopen" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 $as_echo_n "checking for dlopen in -lsvld... " >&6; } if ${ac_cv_lib_svld_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_svld_dlopen=yes else ac_cv_lib_svld_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 $as_echo "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 $as_echo_n "checking for dld_link in -ldld... " >&6; } if ${ac_cv_lib_dld_dld_link+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dld_link (); int main () { return dld_link (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_dld_link=yes else ac_cv_lib_dld_dld_link=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 $as_echo "$ac_cv_lib_dld_dld_link" >&6; } if test "x$ac_cv_lib_dld_dld_link" = xyes; then : lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" fi fi fi fi fi fi ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 $as_echo_n "checking whether a program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 $as_echo "$lt_cv_dlopen_self" >&6; } if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self_static+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 $as_echo "$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi striplib= old_striplib= { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 $as_echo_n "checking whether stripping libraries is possible... " >&6; } if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ;; esac fi # Report which library types will actually be built { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 $as_echo_n "checking if libtool supports shared libraries... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 $as_echo "$can_build_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 $as_echo_n "checking whether to build shared libraries... " >&6; } test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[4-9]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 $as_echo "$enable_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 $as_echo_n "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 $as_echo "$enable_static" >&6; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" ac_config_commands="$ac_config_commands libtool" # Only expand once: # Require X.Org macros 1.16 or later for XORG_TESTSET_CFLAG { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C99" >&5 $as_echo_n "checking for $CC option to accept ISO C99... " >&6; } if ${ac_cv_prog_cc_c99+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c99=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include #include // Check varargs macros. These examples are taken from C99 6.10.3.5. #define debug(...) fprintf (stderr, __VA_ARGS__) #define showlist(...) puts (#__VA_ARGS__) #define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) static void test_varargs_macros (void) { int x = 1234; int y = 5678; debug ("Flag"); debug ("X = %d\n", x); showlist (The first, second, and third items.); report (x>y, "x is %d but y is %d", x, y); } // Check long long types. #define BIG64 18446744073709551615ull #define BIG32 4294967295ul #define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) #if !BIG_OK your preprocessor is broken; #endif #if BIG_OK #else your preprocessor is broken; #endif static long long int bignum = -9223372036854775807LL; static unsigned long long int ubignum = BIG64; struct incomplete_array { int datasize; double data[]; }; struct named_init { int number; const wchar_t *name; double average; }; typedef const char *ccp; static inline int test_restrict (ccp restrict text) { // See if C++-style comments work. // Iterate through items via the restricted pointer. // Also check for declarations in for loops. for (unsigned int i = 0; *(text+i) != '\0'; ++i) continue; return 0; } // Check varargs and va_copy. static void test_varargs (const char *format, ...) { va_list args; va_start (args, format); va_list args_copy; va_copy (args_copy, args); const char *str; int number; float fnumber; while (*format) { switch (*format++) { case 's': // string str = va_arg (args_copy, const char *); break; case 'd': // int number = va_arg (args_copy, int); break; case 'f': // float fnumber = va_arg (args_copy, double); break; default: break; } } va_end (args_copy); va_end (args); } int main () { // Check bool. _Bool success = false; // Check restrict. if (test_restrict ("String literal") == 0) success = true; char *restrict newvar = "Another string"; // Check varargs. test_varargs ("s, d' f .", "string", 65, 34.234); test_varargs_macros (); // Check flexible array members. struct incomplete_array *ia = malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); ia->datasize = 10; for (int i = 0; i < ia->datasize; ++i) ia->data[i] = i * 1.234; // Check named initializers. struct named_init ni = { .number = 34, .name = L"Test wide string", .average = 543.34343, }; ni.number = 58; int dynamic_array[ni.number]; dynamic_array[ni.number - 1] = 543; // work around unused variable warnings return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x' || dynamic_array[ni.number - 1] != 543); ; return 0; } _ACEOF for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -D_STDC_C99= -qlanglvl=extc99 do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c99=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c99" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c99" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c99" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 $as_echo "$ac_cv_prog_cc_c99" >&6; } ;; esac if test "x$ac_cv_prog_cc_c99" != xno; then : fi ac_fn_c_check_decl "$LINENO" "__clang__" "ac_cv_have_decl___clang__" "$ac_includes_default" if test "x$ac_cv_have_decl___clang__" = xyes; then : CLANGCC="yes" else CLANGCC="no" fi ac_fn_c_check_decl "$LINENO" "__INTEL_COMPILER" "ac_cv_have_decl___INTEL_COMPILER" "$ac_includes_default" if test "x$ac_cv_have_decl___INTEL_COMPILER" = xyes; then : INTELCC="yes" else INTELCC="no" fi ac_fn_c_check_decl "$LINENO" "__SUNPRO_C" "ac_cv_have_decl___SUNPRO_C" "$ac_includes_default" if test "x$ac_cv_have_decl___SUNPRO_C" = xyes; then : SUNCC="yes" else SUNCC="no" fi if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 $as_echo "$PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_PKG_CONFIG"; then ac_pt_PKG_CONFIG=$PKG_CONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG if test -n "$ac_pt_PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 $as_echo "$ac_pt_PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_PKG_CONFIG" = x; then PKG_CONFIG="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac PKG_CONFIG=$ac_pt_PKG_CONFIG fi else PKG_CONFIG="$ac_cv_path_PKG_CONFIG" fi fi if test -n "$PKG_CONFIG"; then _pkg_min_version=0.9.0 { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 $as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } PKG_CONFIG="" fi fi # Check whether --enable-selective-werror was given. if test "${enable_selective_werror+set}" = set; then : enableval=$enable_selective_werror; SELECTIVE_WERROR=$enableval else SELECTIVE_WERROR=yes fi # -v is too short to test reliably with XORG_TESTSET_CFLAG if test "x$SUNCC" = "xyes"; then BASE_CFLAGS="-v" else BASE_CFLAGS="" fi # This chunk of warnings were those that existed in the legacy CWARNFLAGS xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wall" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Wall" >&5 $as_echo_n "checking if $CC supports-Wall... " >&6; } cacheid=xorg_cv_cc_flag__Wall if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wall" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wpointer-arith" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Wpointer-arith" >&5 $as_echo_n "checking if $CC supports-Wpointer-arith... " >&6; } cacheid=xorg_cv_cc_flag__Wpointer_arith if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wpointer-arith" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wmissing-declarations" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Wmissing-declarations" >&5 $as_echo_n "checking if $CC supports-Wmissing-declarations... " >&6; } cacheid=xorg_cv_cc_flag__Wmissing_declarations if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wmissing-declarations" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wformat=2" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Wformat=2" >&5 $as_echo_n "checking if $CC supports-Wformat=2... " >&6; } cacheid=xorg_cv_cc_flag__Wformat_2 if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wformat=2" found="yes" fi fi if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wformat" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Wformat" >&5 $as_echo_n "checking if $CC supports-Wformat... " >&6; } cacheid=xorg_cv_cc_flag__Wformat if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wformat" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wstrict-prototypes" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Wstrict-prototypes" >&5 $as_echo_n "checking if $CC supports-Wstrict-prototypes... " >&6; } cacheid=xorg_cv_cc_flag__Wstrict_prototypes if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wstrict-prototypes" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wmissing-prototypes" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Wmissing-prototypes" >&5 $as_echo_n "checking if $CC supports-Wmissing-prototypes... " >&6; } cacheid=xorg_cv_cc_flag__Wmissing_prototypes if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wmissing-prototypes" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wnested-externs" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Wnested-externs" >&5 $as_echo_n "checking if $CC supports-Wnested-externs... " >&6; } cacheid=xorg_cv_cc_flag__Wnested_externs if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wnested-externs" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wbad-function-cast" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Wbad-function-cast" >&5 $as_echo_n "checking if $CC supports-Wbad-function-cast... " >&6; } cacheid=xorg_cv_cc_flag__Wbad_function_cast if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wbad-function-cast" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wold-style-definition" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Wold-style-definition" >&5 $as_echo_n "checking if $CC supports-Wold-style-definition... " >&6; } cacheid=xorg_cv_cc_flag__Wold_style_definition if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wold-style-definition" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wdeclaration-after-statement" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Wdeclaration-after-statement" >&5 $as_echo_n "checking if $CC supports-Wdeclaration-after-statement... " >&6; } cacheid=xorg_cv_cc_flag__Wdeclaration_after_statement if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wdeclaration-after-statement" found="yes" fi fi # This chunk adds additional warnings that could catch undesired effects. xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wunused" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Wunused" >&5 $as_echo_n "checking if $CC supports-Wunused... " >&6; } cacheid=xorg_cv_cc_flag__Wunused if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wunused" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wuninitialized" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Wuninitialized" >&5 $as_echo_n "checking if $CC supports-Wuninitialized... " >&6; } cacheid=xorg_cv_cc_flag__Wuninitialized if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wuninitialized" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wshadow" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Wshadow" >&5 $as_echo_n "checking if $CC supports-Wshadow... " >&6; } cacheid=xorg_cv_cc_flag__Wshadow if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wshadow" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wcast-qual" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Wcast-qual" >&5 $as_echo_n "checking if $CC supports-Wcast-qual... " >&6; } cacheid=xorg_cv_cc_flag__Wcast_qual if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wcast-qual" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wmissing-noreturn" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Wmissing-noreturn" >&5 $as_echo_n "checking if $CC supports-Wmissing-noreturn... " >&6; } cacheid=xorg_cv_cc_flag__Wmissing_noreturn if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wmissing-noreturn" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wmissing-format-attribute" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Wmissing-format-attribute" >&5 $as_echo_n "checking if $CC supports-Wmissing-format-attribute... " >&6; } cacheid=xorg_cv_cc_flag__Wmissing_format_attribute if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wmissing-format-attribute" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wredundant-decls" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Wredundant-decls" >&5 $as_echo_n "checking if $CC supports-Wredundant-decls... " >&6; } cacheid=xorg_cv_cc_flag__Wredundant_decls if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wredundant-decls" found="yes" fi fi # These are currently disabled because they are noisy. They will be enabled # in the future once the codebase is sufficiently modernized to silence # them. For now, I don't want them to drown out the other warnings. # XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op]) # XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wparentheses]) # XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align]) # Turn some warnings into errors, so we don't accidently get successful builds # when there are problems that should be fixed. if test "x$SELECTIVE_WERROR" = "xyes" ; then xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Werror=implicit" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Werror=implicit" >&5 $as_echo_n "checking if $CC supports-Werror=implicit... " >&6; } cacheid=xorg_cv_cc_flag__Werror_implicit if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Werror=implicit" found="yes" fi fi if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED" >&5 $as_echo_n "checking if $CC supports-errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED... " >&6; } cacheid=xorg_cv_cc_flag__errwarn_E_NO_EXPLICIT_TYPE_GIVEN__errwarn_E_NO_IMPLICIT_DECL_ALLOWED if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Werror=nonnull" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Werror=nonnull" >&5 $as_echo_n "checking if $CC supports-Werror=nonnull... " >&6; } cacheid=xorg_cv_cc_flag__Werror_nonnull if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Werror=nonnull" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Werror=init-self" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Werror=init-self" >&5 $as_echo_n "checking if $CC supports-Werror=init-self... " >&6; } cacheid=xorg_cv_cc_flag__Werror_init_self if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Werror=init-self" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Werror=main" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Werror=main" >&5 $as_echo_n "checking if $CC supports-Werror=main... " >&6; } cacheid=xorg_cv_cc_flag__Werror_main if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Werror=main" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Werror=missing-braces" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Werror=missing-braces" >&5 $as_echo_n "checking if $CC supports-Werror=missing-braces... " >&6; } cacheid=xorg_cv_cc_flag__Werror_missing_braces if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Werror=missing-braces" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Werror=sequence-point" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Werror=sequence-point" >&5 $as_echo_n "checking if $CC supports-Werror=sequence-point... " >&6; } cacheid=xorg_cv_cc_flag__Werror_sequence_point if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Werror=sequence-point" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Werror=return-type" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Werror=return-type" >&5 $as_echo_n "checking if $CC supports-Werror=return-type... " >&6; } cacheid=xorg_cv_cc_flag__Werror_return_type if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Werror=return-type" found="yes" fi fi if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -errwarn=E_FUNC_HAS_NO_RETURN_STMT" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-errwarn=E_FUNC_HAS_NO_RETURN_STMT" >&5 $as_echo_n "checking if $CC supports-errwarn=E_FUNC_HAS_NO_RETURN_STMT... " >&6; } cacheid=xorg_cv_cc_flag__errwarn_E_FUNC_HAS_NO_RETURN_STMT if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -errwarn=E_FUNC_HAS_NO_RETURN_STMT" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Werror=trigraphs" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Werror=trigraphs" >&5 $as_echo_n "checking if $CC supports-Werror=trigraphs... " >&6; } cacheid=xorg_cv_cc_flag__Werror_trigraphs if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Werror=trigraphs" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Werror=array-bounds" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Werror=array-bounds" >&5 $as_echo_n "checking if $CC supports-Werror=array-bounds... " >&6; } cacheid=xorg_cv_cc_flag__Werror_array_bounds if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Werror=array-bounds" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Werror=write-strings" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Werror=write-strings" >&5 $as_echo_n "checking if $CC supports-Werror=write-strings... " >&6; } cacheid=xorg_cv_cc_flag__Werror_write_strings if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Werror=write-strings" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Werror=address" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Werror=address" >&5 $as_echo_n "checking if $CC supports-Werror=address... " >&6; } cacheid=xorg_cv_cc_flag__Werror_address if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Werror=address" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Werror=int-to-pointer-cast" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Werror=int-to-pointer-cast" >&5 $as_echo_n "checking if $CC supports-Werror=int-to-pointer-cast... " >&6; } cacheid=xorg_cv_cc_flag__Werror_int_to_pointer_cast if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Werror=int-to-pointer-cast" found="yes" fi fi if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -errwarn=E_BAD_PTR_INT_COMBINATION" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-errwarn=E_BAD_PTR_INT_COMBINATION" >&5 $as_echo_n "checking if $CC supports-errwarn=E_BAD_PTR_INT_COMBINATION... " >&6; } cacheid=xorg_cv_cc_flag__errwarn_E_BAD_PTR_INT_COMBINATION if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -errwarn=E_BAD_PTR_INT_COMBINATION" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Werror=pointer-to-int-cast" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Werror=pointer-to-int-cast" >&5 $as_echo_n "checking if $CC supports-Werror=pointer-to-int-cast... " >&6; } cacheid=xorg_cv_cc_flag__Werror_pointer_to_int_cast if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Werror=pointer-to-int-cast" found="yes" fi fi # Also -errwarn=E_BAD_PTR_INT_COMBINATION else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: You have chosen not to turn some select compiler warnings into errors. This should not be necessary. Please report why you needed to do so in a bug report at $PACKAGE_BUGREPORT" >&5 $as_echo "$as_me: WARNING: You have chosen not to turn some select compiler warnings into errors. This should not be necessary. Please report why you needed to do so in a bug report at $PACKAGE_BUGREPORT" >&2;} xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wimplicit" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Wimplicit" >&5 $as_echo_n "checking if $CC supports-Wimplicit... " >&6; } cacheid=xorg_cv_cc_flag__Wimplicit if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wimplicit" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wnonnull" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Wnonnull" >&5 $as_echo_n "checking if $CC supports-Wnonnull... " >&6; } cacheid=xorg_cv_cc_flag__Wnonnull if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wnonnull" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Winit-self" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Winit-self" >&5 $as_echo_n "checking if $CC supports-Winit-self... " >&6; } cacheid=xorg_cv_cc_flag__Winit_self if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Winit-self" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wmain" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Wmain" >&5 $as_echo_n "checking if $CC supports-Wmain... " >&6; } cacheid=xorg_cv_cc_flag__Wmain if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wmain" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wmissing-braces" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Wmissing-braces" >&5 $as_echo_n "checking if $CC supports-Wmissing-braces... " >&6; } cacheid=xorg_cv_cc_flag__Wmissing_braces if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wmissing-braces" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wsequence-point" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Wsequence-point" >&5 $as_echo_n "checking if $CC supports-Wsequence-point... " >&6; } cacheid=xorg_cv_cc_flag__Wsequence_point if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wsequence-point" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wreturn-type" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Wreturn-type" >&5 $as_echo_n "checking if $CC supports-Wreturn-type... " >&6; } cacheid=xorg_cv_cc_flag__Wreturn_type if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wreturn-type" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wtrigraphs" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Wtrigraphs" >&5 $as_echo_n "checking if $CC supports-Wtrigraphs... " >&6; } cacheid=xorg_cv_cc_flag__Wtrigraphs if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wtrigraphs" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Warray-bounds" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Warray-bounds" >&5 $as_echo_n "checking if $CC supports-Warray-bounds... " >&6; } cacheid=xorg_cv_cc_flag__Warray_bounds if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Warray-bounds" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wwrite-strings" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Wwrite-strings" >&5 $as_echo_n "checking if $CC supports-Wwrite-strings... " >&6; } cacheid=xorg_cv_cc_flag__Wwrite_strings if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wwrite-strings" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Waddress" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Waddress" >&5 $as_echo_n "checking if $CC supports-Waddress... " >&6; } cacheid=xorg_cv_cc_flag__Waddress if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Waddress" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wint-to-pointer-cast" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Wint-to-pointer-cast" >&5 $as_echo_n "checking if $CC supports-Wint-to-pointer-cast... " >&6; } cacheid=xorg_cv_cc_flag__Wint_to_pointer_cast if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wint-to-pointer-cast" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wpointer-to-int-cast" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Wpointer-to-int-cast" >&5 $as_echo_n "checking if $CC supports-Wpointer-to-int-cast... " >&6; } cacheid=xorg_cv_cc_flag__Wpointer_to_int_cast if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wpointer-to-int-cast" found="yes" fi fi fi CWARNFLAGS="$BASE_CFLAGS" if test "x$GCC" = xyes ; then CWARNFLAGS="$CWARNFLAGS -fno-strict-aliasing" fi # Check whether --enable-strict-compilation was given. if test "${enable_strict_compilation+set}" = set; then : enableval=$enable_strict_compilation; STRICT_COMPILE=$enableval else STRICT_COMPILE=no fi STRICT_CFLAGS="" xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -pedantic" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-pedantic" >&5 $as_echo_n "checking if $CC supports-pedantic... " >&6; } cacheid=xorg_cv_cc_flag__pedantic if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then STRICT_CFLAGS="$STRICT_CFLAGS -pedantic" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Werror" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Werror" >&5 $as_echo_n "checking if $CC supports-Werror... " >&6; } cacheid=xorg_cv_cc_flag__Werror if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then STRICT_CFLAGS="$STRICT_CFLAGS -Werror" found="yes" fi fi if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -errwarn" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-errwarn" >&5 $as_echo_n "checking if $CC supports-errwarn... " >&6; } cacheid=xorg_cv_cc_flag__errwarn if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then STRICT_CFLAGS="$STRICT_CFLAGS -errwarn" found="yes" fi fi # Earlier versions of gcc (eg: 4.2) support -Werror=attributes, but do not # activate it with -Werror, so we add it here explicitly. xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Werror=attributes" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Werror=attributes" >&5 $as_echo_n "checking if $CC supports-Werror=attributes... " >&6; } cacheid=xorg_cv_cc_flag__Werror_attributes if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then STRICT_CFLAGS="$STRICT_CFLAGS -Werror=attributes" found="yes" fi fi if test "x$STRICT_COMPILE" = "xyes"; then BASE_CFLAGS="$BASE_CFLAGS $STRICT_CFLAGS" CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS" fi cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION_MAJOR `echo $PACKAGE_VERSION | cut -d . -f 1` _ACEOF PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1` if test "x$PVM" = "x"; then PVM="0" fi cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION_MINOR $PVM _ACEOF PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1` if test "x$PVP" = "x"; then PVP="0" fi cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION_PATCHLEVEL $PVP _ACEOF CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \ mv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \ || (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \ echo 'git directory not found: installing possibly empty changelog.' >&2)" macros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros` INSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \ mv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \ || (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \ echo 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)" if test x$APP_MAN_SUFFIX = x ; then APP_MAN_SUFFIX=1 fi if test x$APP_MAN_DIR = x ; then APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)' fi if test x$LIB_MAN_SUFFIX = x ; then LIB_MAN_SUFFIX=3 fi if test x$LIB_MAN_DIR = x ; then LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)' fi if test x$FILE_MAN_SUFFIX = x ; then case $host_os in solaris*) FILE_MAN_SUFFIX=4 ;; *) FILE_MAN_SUFFIX=5 ;; esac fi if test x$FILE_MAN_DIR = x ; then FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)' fi if test x$MISC_MAN_SUFFIX = x ; then case $host_os in solaris*) MISC_MAN_SUFFIX=5 ;; *) MISC_MAN_SUFFIX=7 ;; esac fi if test x$MISC_MAN_DIR = x ; then MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)' fi if test x$DRIVER_MAN_SUFFIX = x ; then case $host_os in solaris*) DRIVER_MAN_SUFFIX=7 ;; *) DRIVER_MAN_SUFFIX=4 ;; esac fi if test x$DRIVER_MAN_DIR = x ; then DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)' fi if test x$ADMIN_MAN_SUFFIX = x ; then case $host_os in solaris*) ADMIN_MAN_SUFFIX=1m ;; *) ADMIN_MAN_SUFFIX=8 ;; esac fi if test x$ADMIN_MAN_DIR = x ; then ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)' fi XORG_MAN_PAGE="X Version 11" MAN_SUBSTS="\ -e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \ -e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \ -e 's|__xservername__|Xorg|g' \ -e 's|__xconfigfile__|xorg.conf|g' \ -e 's|__projectroot__|\$(prefix)|g' \ -e 's|__apploaddir__|\$(appdefaultdir)|g' \ -e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \ -e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \ -e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \ -e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \ -e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \ -e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'" # Check whether --enable-silent-rules was given. if test "${enable_silent_rules+set}" = set; then : enableval=$enable_silent_rules; fi case $enable_silent_rules in yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=0;; esac am_make=${MAKE-make} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 $as_echo_n "checking whether $am_make supports nested variables... " >&6; } if ${am_cv_make_support_nested_variables+:} false; then : $as_echo_n "(cached) " >&6 else if $as_echo 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 $as_echo "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DRM" >&5 $as_echo_n "checking for DRM... " >&6; } if test -n "$DRM_CFLAGS"; then pkg_cv_DRM_CFLAGS="$DRM_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libdrm_intel >= 2.4.38 libdrm\""; } >&5 ($PKG_CONFIG --exists --print-errors "libdrm_intel >= 2.4.38 libdrm") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_DRM_CFLAGS=`$PKG_CONFIG --cflags "libdrm_intel >= 2.4.38 libdrm" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$DRM_LIBS"; then pkg_cv_DRM_LIBS="$DRM_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libdrm_intel >= 2.4.38 libdrm\""; } >&5 ($PKG_CONFIG --exists --print-errors "libdrm_intel >= 2.4.38 libdrm") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_DRM_LIBS=`$PKG_CONFIG --libs "libdrm_intel >= 2.4.38 libdrm" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then DRM_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libdrm_intel >= 2.4.38 libdrm" 2>&1` else DRM_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libdrm_intel >= 2.4.38 libdrm" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$DRM_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (libdrm_intel >= 2.4.38 libdrm) were not met: $DRM_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables DRM_CFLAGS and DRM_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables DRM_CFLAGS and DRM_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else DRM_CFLAGS=$pkg_cv_DRM_CFLAGS DRM_LIBS=$pkg_cv_DRM_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PCIACCESS" >&5 $as_echo_n "checking for PCIACCESS... " >&6; } if test -n "$PCIACCESS_CFLAGS"; then pkg_cv_PCIACCESS_CFLAGS="$PCIACCESS_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"pciaccess >= 0.10\""; } >&5 ($PKG_CONFIG --exists --print-errors "pciaccess >= 0.10") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_PCIACCESS_CFLAGS=`$PKG_CONFIG --cflags "pciaccess >= 0.10" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$PCIACCESS_LIBS"; then pkg_cv_PCIACCESS_LIBS="$PCIACCESS_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"pciaccess >= 0.10\""; } >&5 ($PKG_CONFIG --exists --print-errors "pciaccess >= 0.10") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_PCIACCESS_LIBS=`$PKG_CONFIG --libs "pciaccess >= 0.10" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then PCIACCESS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "pciaccess >= 0.10" 2>&1` else PCIACCESS_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "pciaccess >= 0.10" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$PCIACCESS_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (pciaccess >= 0.10) were not met: $PCIACCESS_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables PCIACCESS_CFLAGS and PCIACCESS_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables PCIACCESS_CFLAGS and PCIACCESS_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else PCIACCESS_CFLAGS=$pkg_cv_PCIACCESS_CFLAGS PCIACCESS_LIBS=$pkg_cv_PCIACCESS_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi # for dma-buf tests # Check whether --enable-nouveau was given. if test "${enable_nouveau+set}" = set; then : enableval=$enable_nouveau; NOUVEAU=$enableval else NOUVEAU=yes fi if test "x$NOUVEAU" = xyes; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DRM_NOUVEAU" >&5 $as_echo_n "checking for DRM_NOUVEAU... " >&6; } if test -n "$DRM_NOUVEAU_CFLAGS"; then pkg_cv_DRM_NOUVEAU_CFLAGS="$DRM_NOUVEAU_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libdrm_nouveau >= 2.4.33\""; } >&5 ($PKG_CONFIG --exists --print-errors "libdrm_nouveau >= 2.4.33") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_DRM_NOUVEAU_CFLAGS=`$PKG_CONFIG --cflags "libdrm_nouveau >= 2.4.33" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$DRM_NOUVEAU_LIBS"; then pkg_cv_DRM_NOUVEAU_LIBS="$DRM_NOUVEAU_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libdrm_nouveau >= 2.4.33\""; } >&5 ($PKG_CONFIG --exists --print-errors "libdrm_nouveau >= 2.4.33") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_DRM_NOUVEAU_LIBS=`$PKG_CONFIG --libs "libdrm_nouveau >= 2.4.33" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then DRM_NOUVEAU_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libdrm_nouveau >= 2.4.33" 2>&1` else DRM_NOUVEAU_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libdrm_nouveau >= 2.4.33" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$DRM_NOUVEAU_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (libdrm_nouveau >= 2.4.33) were not met: $DRM_NOUVEAU_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables DRM_NOUVEAU_CFLAGS and DRM_NOUVEAU_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables DRM_NOUVEAU_CFLAGS and DRM_NOUVEAU_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else DRM_NOUVEAU_CFLAGS=$pkg_cv_DRM_NOUVEAU_CFLAGS DRM_NOUVEAU_LIBS=$pkg_cv_DRM_NOUVEAU_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi $as_echo "#define HAVE_NOUVEAU 1" >>confdefs.h fi if test "x$NOUVEAU" = xyes; then HAVE_NOUVEAU_TRUE= HAVE_NOUVEAU_FALSE='#' else HAVE_NOUVEAU_TRUE='#' HAVE_NOUVEAU_FALSE= fi # for testdisplay pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CAIRO" >&5 $as_echo_n "checking for CAIRO... " >&6; } if test -n "$CAIRO_CFLAGS"; then pkg_cv_CAIRO_CFLAGS="$CAIRO_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"cairo\""; } >&5 ($PKG_CONFIG --exists --print-errors "cairo") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_CAIRO_CFLAGS=`$PKG_CONFIG --cflags "cairo" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$CAIRO_LIBS"; then pkg_cv_CAIRO_LIBS="$CAIRO_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"cairo\""; } >&5 ($PKG_CONFIG --exists --print-errors "cairo") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_CAIRO_LIBS=`$PKG_CONFIG --libs "cairo" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then CAIRO_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "cairo" 2>&1` else CAIRO_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "cairo" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$CAIRO_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (cairo) were not met: $CAIRO_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables CAIRO_CFLAGS and CAIRO_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables CAIRO_CFLAGS and CAIRO_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else CAIRO_CFLAGS=$pkg_cv_CAIRO_CFLAGS CAIRO_LIBS=$pkg_cv_CAIRO_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBUDEV" >&5 $as_echo_n "checking for LIBUDEV... " >&6; } if test -n "$LIBUDEV_CFLAGS"; then pkg_cv_LIBUDEV_CFLAGS="$LIBUDEV_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libudev\""; } >&5 ($PKG_CONFIG --exists --print-errors "libudev") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBUDEV_CFLAGS=`$PKG_CONFIG --cflags "libudev" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$LIBUDEV_LIBS"; then pkg_cv_LIBUDEV_LIBS="$LIBUDEV_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libudev\""; } >&5 ($PKG_CONFIG --exists --print-errors "libudev") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBUDEV_LIBS=`$PKG_CONFIG --libs "libudev" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then LIBUDEV_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libudev" 2>&1` else LIBUDEV_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libudev" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$LIBUDEV_PKG_ERRORS" >&5 udev=no elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } udev=no else LIBUDEV_CFLAGS=$pkg_cv_LIBUDEV_CFLAGS LIBUDEV_LIBS=$pkg_cv_LIBUDEV_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } udev=yes fi if test x"$udev" = xyes; then $as_echo "#define HAVE_UDEV 1" >>confdefs.h fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GLIB" >&5 $as_echo_n "checking for GLIB... " >&6; } if test -n "$GLIB_CFLAGS"; then pkg_cv_GLIB_CFLAGS="$GLIB_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "glib-2.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GLIB_CFLAGS=`$PKG_CONFIG --cflags "glib-2.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$GLIB_LIBS"; then pkg_cv_GLIB_LIBS="$GLIB_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "glib-2.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GLIB_LIBS=`$PKG_CONFIG --libs "glib-2.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then GLIB_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "glib-2.0" 2>&1` else GLIB_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "glib-2.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$GLIB_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (glib-2.0) were not met: $GLIB_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables GLIB_CFLAGS and GLIB_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables GLIB_CFLAGS and GLIB_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else GLIB_CFLAGS=$pkg_cv_GLIB_CFLAGS GLIB_LIBS=$pkg_cv_GLIB_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi # ----------------------------------------------------------------------------- # Configuration options # ----------------------------------------------------------------------------- # Define a configure option for the shadder debugger # Check whether --enable-shader-debugger was given. if test "${enable_shader_debugger+set}" = set; then : enableval=$enable_shader_debugger; BUILD_SHADER_DEBUGGER="$enableval" else BUILD_SHADER_DEBUGGER=auto fi # Shadder debugger depends on python3, intel-genasm and objcopy if test "x$BUILD_SHADER_DEBUGGER" != xno; then # Check Python 3 is installed if test "$PYTHON" = ":" ; then if test "x$BUILD_SHADER_DEBUGGER" = xyes; then as_fn_error $? "Shader debugger requested, python version 3 not found." "$LINENO" 5 else BUILD_SHADER_DEBUGGER=no fi fi # Check for the Intel Chipset assembler compiler for ac_prog in intel-gen4asm do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_GEN4ASM+:} false; then : $as_echo_n "(cached) " >&6 else case $GEN4ASM in [\\/]* | ?:[\\/]*) ac_cv_path_GEN4ASM="$GEN4ASM" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_GEN4ASM="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi GEN4ASM=$ac_cv_path_GEN4ASM if test -n "$GEN4ASM"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GEN4ASM" >&5 $as_echo "$GEN4ASM" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$GEN4ASM" && break done if test -z "$GEN4ASM" ; then if test "x$BUILD_SHADER_DEBUGGER" = xyes; then as_fn_error $? "Shader debugger requested, but intel-gen4asm not found." "$LINENO" 5 else BUILD_SHADER_DEBUGGER=no fi fi # Check for the objcopy GNU binary utiliy command for ac_prog in objcopy do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_OBJCOPY+:} false; then : $as_echo_n "(cached) " >&6 else case $OBJCOPY in [\\/]* | ?:[\\/]*) ac_cv_path_OBJCOPY="$OBJCOPY" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_OBJCOPY="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi OBJCOPY=$ac_cv_path_OBJCOPY if test -n "$OBJCOPY"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJCOPY" >&5 $as_echo "$OBJCOPY" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$OBJCOPY" && break done if test -z "$OBJCOPY" ; then if test "x$BUILD_SHADER_DEBUGGER" = xyes; then as_fn_error $? "Shader debugger requested, but objcopy command not found." "$LINENO" 5 else BUILD_SHADER_DEBUGGER=no fi fi fi if test "x$BUILD_SHADER_DEBUGGER" != xno; then BUILD_SHADER_DEBUGGER_TRUE= BUILD_SHADER_DEBUGGER_FALSE='#' else BUILD_SHADER_DEBUGGER_TRUE='#' BUILD_SHADER_DEBUGGER_FALSE= fi # ----------------------------------------------------------------------------- # To build multithread code, gcc uses -pthread, Solaris Studio cc uses -mt xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -pthread" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-pthread" >&5 $as_echo_n "checking if $CC supports-pthread... " >&6; } cacheid=xorg_cv_cc_flag__pthread if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then THREAD_CFLAGS="$THREAD_CFLAGS -pthread" found="yes" fi fi if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -mt" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-mt" >&5 $as_echo_n "checking if $CC supports-mt... " >&6; } cacheid=xorg_cv_cc_flag__mt if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then THREAD_CFLAGS="$THREAD_CFLAGS -mt" found="yes" fi fi ac_config_files="$ac_config_files Makefile benchmarks/Makefile demos/Makefile lib/Makefile man/Makefile scripts/Makefile tests/Makefile tools/Makefile debugger/Makefile debugger/system_routine/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_NOUVEAU_TRUE}" && test -z "${HAVE_NOUVEAU_FALSE}"; then as_fn_error $? "conditional \"HAVE_NOUVEAU\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${BUILD_SHADER_DEBUGGER_TRUE}" && test -z "${BUILD_SHADER_DEBUGGER_FALSE}"; then as_fn_error $? "conditional \"BUILD_SHADER_DEBUGGER\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by intel-gpu-tools $as_me 1.3, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ intel-gpu-tools config.status 1.3 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`' hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } # Quote evaled strings. for var in SHELL \ ECHO \ PATH_SEPARATOR \ SED \ GREP \ EGREP \ FGREP \ LD \ NM \ LN_S \ lt_SP2NL \ lt_NL2SP \ reload_flag \ OBJDUMP \ deplibs_check_method \ file_magic_cmd \ file_magic_glob \ want_nocaseglob \ DLLTOOL \ sharedlib_from_linklib_cmd \ AR \ AR_FLAGS \ archiver_list_spec \ STRIP \ RANLIB \ CC \ CFLAGS \ compiler \ lt_cv_sys_global_symbol_pipe \ lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ nm_file_list_spec \ lt_prog_compiler_no_builtin_flag \ lt_prog_compiler_pic \ lt_prog_compiler_wl \ lt_prog_compiler_static \ lt_cv_prog_compiler_c_o \ need_locks \ MANIFEST_TOOL \ DSYMUTIL \ NMEDIT \ LIPO \ OTOOL \ OTOOL64 \ shrext_cmds \ export_dynamic_flag_spec \ whole_archive_flag_spec \ compiler_needs_object \ with_gnu_ld \ allow_undefined_flag \ no_undefined_flag \ hardcode_libdir_flag_spec \ hardcode_libdir_separator \ exclude_expsyms \ include_expsyms \ file_list_spec \ variables_saved_for_relink \ libname_spec \ library_names_spec \ soname_spec \ install_override_mode \ finish_eval \ old_striplib \ striplib; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in reload_cmds \ old_postinstall_cmds \ old_postuninstall_cmds \ old_archive_cmds \ extract_expsyms_cmds \ old_archive_from_new_cmds \ old_archive_from_expsyms_cmds \ archive_cmds \ archive_expsym_cmds \ module_cmds \ module_expsym_cmds \ export_symbols_cmds \ prelink_cmds \ postlink_cmds \ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ sys_lib_dlsearch_path_spec; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done ac_aux_dir='$ac_aux_dir' xsi_shell='$xsi_shell' lt_shell_append='$lt_shell_append' # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "benchmarks/Makefile") CONFIG_FILES="$CONFIG_FILES benchmarks/Makefile" ;; "demos/Makefile") CONFIG_FILES="$CONFIG_FILES demos/Makefile" ;; "lib/Makefile") CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;; "man/Makefile") CONFIG_FILES="$CONFIG_FILES man/Makefile" ;; "scripts/Makefile") CONFIG_FILES="$CONFIG_FILES scripts/Makefile" ;; "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;; "tools/Makefile") CONFIG_FILES="$CONFIG_FILES tools/Makefile" ;; "debugger/Makefile") CONFIG_FILES="$CONFIG_FILES debugger/Makefile" ;; "debugger/system_routine/Makefile") CONFIG_FILES="$CONFIG_FILES debugger/system_routine/Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Autoconf 2.62 quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir=$dirpart/$fdir; as_fn_mkdir_p # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ;; "libtool":C) # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi cfgfile="${ofile}T" trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. # # GNU Libtool is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of # the License, or (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, or # obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # The names of the tagged configurations supported by this script. available_tags="" # ### BEGIN LIBTOOL CONFIG # Whether or not to build static libraries. build_old_libs=$enable_static # Which release of libtool.m4 was used? macro_version=$macro_version macro_revision=$macro_revision # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # What type of objects to build. pic_mode=$pic_mode # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # An echo program that protects backslashes. ECHO=$lt_ECHO # The PATH separator for the build system. PATH_SEPARATOR=$lt_PATH_SEPARATOR # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="\$SED -e 1s/^X//" # A grep program that handles long lines. GREP=$lt_GREP # An ERE matcher. EGREP=$lt_EGREP # A literal string matcher. FGREP=$lt_FGREP # A BSD- or MS-compatible name lister. NM=$lt_NM # Whether we need soft or hard links. LN_S=$lt_LN_S # What is the maximum length of a command? max_cmd_len=$max_cmd_len # Object file suffix (normally "o"). objext=$ac_objext # Executable file suffix (normally ""). exeext=$exeext # whether the shell understands "unset". lt_unset=$lt_unset # turn spaces into newlines. SP2NL=$lt_lt_SP2NL # turn newlines into spaces. NL2SP=$lt_lt_NL2SP # convert \$build file names to \$host format. to_host_file_cmd=$lt_cv_to_host_file_cmd # convert \$build files to toolchain format. to_tool_file_cmd=$lt_cv_to_tool_file_cmd # An object symbol dumper. OBJDUMP=$lt_OBJDUMP # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method = "file_magic". file_magic_cmd=$lt_file_magic_cmd # How to find potential files when deplibs_check_method = "file_magic". file_magic_glob=$lt_file_magic_glob # Find potential files using nocaseglob when deplibs_check_method = "file_magic". want_nocaseglob=$lt_want_nocaseglob # DLL creation program. DLLTOOL=$lt_DLLTOOL # Command to associate shared and link libraries. sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd # The archiver. AR=$lt_AR # Flags to create an archive. AR_FLAGS=$lt_AR_FLAGS # How to feed a file listing to the archiver. archiver_list_spec=$lt_archiver_list_spec # A symbol stripping program. STRIP=$lt_STRIP # Commands used to install an old-style archive. RANLIB=$lt_RANLIB old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Whether to use a lock for old archive extraction. lock_old_archive_extraction=$lock_old_archive_extraction # A C compiler. LTCC=$lt_CC # LTCC compiler flags. LTCFLAGS=$lt_CFLAGS # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration. global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair. global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # Transform the output of nm in a C name address pair when lib prefix is needed. global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix # Specify filename containing input files for \$NM. nm_file_list_spec=$lt_nm_file_list_spec # The root where to search for dependent libraries,and in which our libraries should be installed. lt_sysroot=$lt_sysroot # The name of the directory that contains temporary libtool files. objdir=$objdir # Used to examine libraries when file_magic_cmd begins with "file". MAGIC_CMD=$MAGIC_CMD # Must we lock files when doing compilation? need_locks=$lt_need_locks # Manifest tool. MANIFEST_TOOL=$lt_MANIFEST_TOOL # Tool to manipulate archived DWARF debug symbol files on Mac OS X. DSYMUTIL=$lt_DSYMUTIL # Tool to change global to local symbols on Mac OS X. NMEDIT=$lt_NMEDIT # Tool to manipulate fat objects and archives on Mac OS X. LIPO=$lt_LIPO # ldd/readelf like tool for Mach-O binaries on Mac OS X. OTOOL=$lt_OTOOL # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. OTOOL64=$lt_OTOOL64 # Old archive suffix (normally "a"). libext=$libext # Shared library suffix (normally ".so"). shrext_cmds=$lt_shrext_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Variables whose values should be saved in libtool wrapper scripts and # restored at link time. variables_saved_for_relink=$lt_variables_saved_for_relink # Do we need the "lib" prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Library versioning type. version_type=$version_type # Shared library runtime path variable. runpath_var=$runpath_var # Shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Permission mode override for installation of shared libraries. install_override_mode=$lt_install_override_mode # Command to use after installation of a shared archive. postinstall_cmds=$lt_postinstall_cmds # Command to use after uninstallation of a shared archive. postuninstall_cmds=$lt_postuninstall_cmds # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # As "finish_cmds", except a single script fragment to be evaled but # not shown. finish_eval=$lt_finish_eval # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Compile-time system search path for libraries. sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries. sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # The linker used to build libraries. LD=$lt_LD # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds # A language specific compiler. CC=$lt_compiler # Is the compiler the GNU compiler? with_gcc=$GCC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \${shlibpath_var} if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds # Specify filename containing input files. file_list_spec=$lt_file_list_spec # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # ### END LIBTOOL CONFIG _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac ltmain="$ac_aux_dir/ltmain.sh" # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) if test x"$xsi_shell" = xyes; then sed -e '/^func_dirname ()$/,/^} # func_dirname /c\ func_dirname ()\ {\ \ case ${1} in\ \ */*) func_dirname_result="${1%/*}${2}" ;;\ \ * ) func_dirname_result="${3}" ;;\ \ esac\ } # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_basename ()$/,/^} # func_basename /c\ func_basename ()\ {\ \ func_basename_result="${1##*/}"\ } # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\ func_dirname_and_basename ()\ {\ \ case ${1} in\ \ */*) func_dirname_result="${1%/*}${2}" ;;\ \ * ) func_dirname_result="${3}" ;;\ \ esac\ \ func_basename_result="${1##*/}"\ } # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_stripname ()$/,/^} # func_stripname /c\ func_stripname ()\ {\ \ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\ \ # positional parameters, so assign one to ordinary parameter first.\ \ func_stripname_result=${3}\ \ func_stripname_result=${func_stripname_result#"${1}"}\ \ func_stripname_result=${func_stripname_result%"${2}"}\ } # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\ func_split_long_opt ()\ {\ \ func_split_long_opt_name=${1%%=*}\ \ func_split_long_opt_arg=${1#*=}\ } # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\ func_split_short_opt ()\ {\ \ func_split_short_opt_arg=${1#??}\ \ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\ } # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\ func_lo2o ()\ {\ \ case ${1} in\ \ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\ \ *) func_lo2o_result=${1} ;;\ \ esac\ } # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_xform ()$/,/^} # func_xform /c\ func_xform ()\ {\ func_xform_result=${1%.*}.lo\ } # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_arith ()$/,/^} # func_arith /c\ func_arith ()\ {\ func_arith_result=$(( $* ))\ } # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_len ()$/,/^} # func_len /c\ func_len ()\ {\ func_len_result=${#1}\ } # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$lt_shell_append" = xyes; then sed -e '/^func_append ()$/,/^} # func_append /c\ func_append ()\ {\ eval "${1}+=\\${2}"\ } # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\ func_append_quoted ()\ {\ \ func_quote_for_eval "${2}"\ \ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\ } # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: # Save a `func_append' function call where possible by direct use of '+=' sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: else # Save a `func_append' function call even when '+=' is not available sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$_lt_function_replace_fail" = x":"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5 $as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;} fi mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi intel-gpu-tools-1.3/INSTALL0000644000175100017510000002622212016622744012403 00000000000000Installation Instructions ************************* Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. This file is free documentation; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. Basic Installation ================== Briefly, the shell commands `./configure; make; make install' should configure, build, and install this package. The following more-detailed instructions are generic; see the `README' file for instructions specific to this package. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). It can also use an optional file (typically called `config.cache' and enabled with `--cache-file=config.cache' or simply `-C') that saves the results of its tests to speed up reconfiguring. Caching is disabled by default to prevent problems with accidental use of stale cache files. If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If you are using the cache, and at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.ac' (or `configure.in') is used to create `configure' by a program called `autoconf'. You need `configure.ac' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. Running `configure' might take a while. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package. 4. Type `make install' to install the programs and any data files and documentation. 5. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. 6. Often, you can also type `make uninstall' to remove the installed files again. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. Run `./configure --help' for details on some of the pertinent environment variables. You can give `configure' initial values for configuration parameters by setting variables in the command line or in the environment. Here is an example: ./configure CC=c99 CFLAGS=-g LIBS=-lposix *Note Defining Variables::, for more details. Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you can use GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. With a non-GNU `make', it is safer to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. On MacOS X 10.5 and later systems, you can create libraries and executables that work on multiple system types--known as "fat" or "universal" binaries--by specifying multiple `-arch' options to the compiler but only a single `-arch' option to the preprocessor. Like this: ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CPP="gcc -E" CXXCPP="g++ -E" This is not guaranteed to produce working output in all cases, you may have to build one architecture at a time and combine the results using the `lipo' tool if you have problems. Installation Names ================== By default, `make install' installs the package's commands under `/usr/local/bin', include files under `/usr/local/include', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PREFIX'. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you pass the option `--exec-prefix=PREFIX' to `configure', the package uses PREFIX as the prefix for installing programs and libraries. Documentation and other data files still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=DIR' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Optional Features ================= Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Particular systems ================== On HP-UX, the default C compiler is not ANSI C compatible. If GNU CC is not installed, it is recommended to use the following options in order to use an ANSI C compiler: ./configure CC="cc -Ae" and if that doesn't work, install pre-built binaries of GCC for HP-UX. On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot parse its `' header file. The option `-nodtk' can be used as a workaround. If GNU CC is not installed, it is therefore recommended to try ./configure CC="cc" and if that doesn't work, try ./configure CC="cc -nodtk" Specifying the System Type ========================== There may be some features `configure' cannot figure out automatically, but needs to determine by the type of machine the package will run on. Usually, assuming the package is built to be run on the _same_ architectures, `configure' can figure that out, but if it prints a message saying it cannot guess the machine type, give it the `--build=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name which has the form: CPU-COMPANY-SYSTEM where SYSTEM can have one of these forms: OS KERNEL-OS See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the machine type. If you are _building_ compiler tools for cross-compiling, you should use the option `--target=TYPE' to select the type of system they will produce code for. If you want to _use_ a cross compiler, that generates code for a platform different from the build platform, you should specify the "host" platform (i.e., that on which the generated programs will eventually be run) with `--host=TYPE'. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Defining Variables ================== Variables not defined in a site shell script can be set in the environment passed to `configure'. However, some packages may run configure again during the build, and the customized values of these variables may be lost. In order to avoid this problem, you should set them in the `configure' command line, using `VAR=value'. For example: ./configure CC=/usr/local2/bin/gcc causes the specified `gcc' to be used as the C compiler (unless it is overridden in the site shell script). Unfortunately, this technique does not work for `CONFIG_SHELL' due to an Autoconf bug. Until the bug is fixed you can use this workaround: CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash `configure' Invocation ====================== `configure' recognizes the following options to control how it operates. `--help' `-h' Print a summary of all of the options to `configure', and exit. `--help=short' `--help=recursive' Print a summary of the options unique to this package's `configure', and exit. The `short' variant lists options used only in the top level, while the `recursive' variant lists options also present in any nested packages. `--version' `-V' Print the version of Autoconf used to generate the `configure' script, and exit. `--cache-file=FILE' Enable the cache: use and save the results of the tests in FILE, traditionally `config.cache'. FILE defaults to `/dev/null' to disable caching. `--config-cache' `-C' Alias for `--cache-file=config.cache'. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to `/dev/null' (any error messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `--prefix=DIR' Use DIR as the installation prefix. *Note Installation Names:: for more details, including other options available for fine-tuning the installation locations. `--no-create' `-n' Run the configure checks, but stop before creating any output files. `configure' also accepts some other, not widely useful, options. Run `configure --help' for more details. intel-gpu-tools-1.3/debugger/0000775000175100017510000000000012016622744013214 500000000000000intel-gpu-tools-1.3/debugger/eudb.c0000664000175100017510000003334511631112215014214 00000000000000/* * Copyright © 2011 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Ben Widawsky * * Notes: * */ #include #include #include #include #include #include #include #include #include #include #include #include #include "drm.h" #include "i915_drm.h" #include "drmtest.h" #include "intel_chipset.h" #include "intel_bufmgr.h" #include "intel_gpu_tools.h" #include "intel_batchbuffer.h" #include "intel_debug.h" #include "debug.h" #define EU_ATT 0x7810 #define EU_ATT_CLR 0x7830 #define RSVD_EU -1 #define RSVD_THREAD -1 #define RSVD_ID EUID(-1, -1, -1) enum { EBAD_SHMEM, EBAD_PROTOCOL, EBAD_MAGIC, EBAD_WRITE }; struct debuggee { int euid; int tid; int fd; int clr; uint32_t reg; }; struct debugger { struct debuggee *debuggees; int num_threads; int real_num_threads; int threads_per_eu; } *eu_info; drm_intel_bufmgr *bufmgr; struct intel_batchbuffer *batch; drm_intel_bo *scratch_bo; int handle; int drm_fd; int debug_fd = 0; const char *debug_file = "dump_debug.bin"; int debug; int clear_waits; int shutting_down = 0; struct intel_debug_handshake dh; int force_clear = 0; uint32_t old_td_ctl; /* * The docs are wrong about the attention clear bits. The clear bits are * provided as part of the structure in case they change in future generations. */ #define EUID(eu, td, clear) \ { .euid = eu, .tid = td, .reg = EU_ATT, .fd = -1, .clr = clear } #define EUID2(eu, td, clear) \ { .euid = eu, .tid = td, .reg = EU_ATT + 4, .fd = -1, .clr = clear } struct debuggee gt1_debug_ids[] = { RSVD_ID, RSVD_ID, RSVD_ID, EUID(6, 3, 28), EUID(6, 2, 27), EUID(6, 1, 26), EUID(6, 0, 25), RSVD_ID, EUID(5, 3, 23), EUID(5, 2, 22), EUID(5, 1, 21), EUID(5, 0, 20), RSVD_ID, EUID(4, 3, 18), EUID(4, 2, 17), EUID(4, 1, 16), EUID(4, 0, 15), RSVD_ID, EUID(2, 3, 13), EUID(2, 2, 12), EUID(2, 1, 11), EUID(2, 0, 10), RSVD_ID, EUID(1, 3, 8), EUID(1, 2, 7), EUID(1, 1, 6), EUID(1, 0, 5), RSVD_ID, EUID(0, 3, 3), EUID(0, 2, 2), EUID(0, 1, 1), EUID(0, 0, 0) }; struct debuggee gt2_debug_ids[] = { EUID(8, 1, 31), EUID(8, 0, 30), EUID(6, 4, 29), EUID(6, 3, 28), EUID(6, 2, 27), EUID(6, 1, 26), EUID(6, 0, 25), EUID(5, 4, 24), EUID(5, 3, 23), EUID(5, 2, 22), EUID(5, 1, 21), EUID(5, 0, 20), EUID(4, 4, 19), EUID(4, 3, 18), EUID(4, 2, 17), EUID(4, 1, 16), EUID(4, 0, 15), EUID(2, 4, 14), EUID(2, 3, 13), EUID(2, 2, 12), EUID(2, 1, 11), EUID(2, 0, 10), EUID(1, 4, 9), EUID(1, 3, 8), EUID(1, 2, 7), EUID(1, 1, 6), EUID(1, 0, 5), EUID(0, 4, 4), EUID(0, 3, 3), EUID(0, 2, 2), EUID(0, 1, 1), EUID(0, 0, 0), RSVD_ID, RSVD_ID, RSVD_ID, RSVD_ID, EUID2(14, 4, 27), EUID2(14, 3, 26), EUID2(14, 2, 25), EUID2(14, 1, 24), EUID2(14, 0, 23), EUID2(13, 4, 22), EUID2(13, 3, 21), EUID2(13, 2, 20), EUID2(13, 1, 19), EUID2(13, 0, 18), EUID2(12, 4, 17), EUID2(12, 3, 16), EUID2(12, 2, 15), EUID2(12, 1, 14), EUID2(12, 0, 13), EUID2(10, 4, 12), EUID2(10, 3, 11), EUID2(10, 2, 10), EUID2(10, 1, 9), EUID2(10, 0, 8), EUID2(9, 4, 7), EUID2(9, 3, 6), EUID2(9, 2, 5), EUID2(9, 1, 4), EUID2(9, 0, 3), EUID2(8, 4, 2), EUID2(8, 3, 1), EUID2(8, 2, 0) }; struct debugger gt1 = { .debuggees = gt1_debug_ids, .num_threads = 32, .real_num_threads = 24, .threads_per_eu = 4 }; struct debugger gt2 = { .debuggees = gt2_debug_ids, .num_threads = 64, .real_num_threads = 60, .threads_per_eu = 5 }; static void dump_debug(void *buf, size_t count) { if (!debug_fd) debug_fd = open(debug_file, O_CREAT | O_WRONLY | O_TRUNC, S_IRWXO); write(debug_fd, buf, count); } static volatile void * map_debug_buffer(void) { int ret; ret = drm_intel_bo_map(scratch_bo, 0); assert(ret == 0); return scratch_bo->virtual; } static void unmap_debug_buffer(void) { drm_intel_bo_unmap(scratch_bo); } static int wait_for_attn(int timeout, int *out_bits) { int step = 1; int eus_waiting = 0; int i,j; if (timeout <= 0) { timeout = 1; step = 0; } for (i = 0; i < timeout; i += step) { for (j = 0; j < 8; j += 4) { uint32_t attn = intel_register_read(EU_ATT + j); if (attn) { int bit = 0; while( (bit = ffs(attn)) != 0) { bit--; // ffs is 1 based assert(bit >= 0); out_bits[eus_waiting] = bit + (j * 8); attn &= ~(1 << bit); eus_waiting++; } } } if (intel_register_read(EU_ATT + 8) || intel_register_read(EU_ATT + 0xc)) { fprintf(stderr, "Unknown attention bits\n"); } if (eus_waiting || shutting_down) break; } return eus_waiting; } #define eu_fd(bit) eu_info->debuggees[bit].fd #define eu_id(bit) eu_info->debuggees[bit].euid #define eu_tid(bit) eu_info->debuggees[bit].tid static struct eu_state * find_eu_shmem(int bit, volatile uint8_t *buf) { struct per_thread_data { uint8_t ____[dh.per_thread_scratch]; }__attribute__((packed)) *data; struct eu_state *eu; int mem_tid, mem_euid, i; data = (struct per_thread_data *)buf; for(i = 0; i < eu_info->num_threads; i++) { eu = (struct eu_state *)&data[i]; mem_tid = eu->sr0 & 0x7; mem_euid = (eu->sr0 >> 8) & 0xf; if (mem_tid == eu_tid(bit) && mem_euid == eu_id(bit)) break; eu = NULL; } return eu; } #define GRF_CMP(a, b) memcmp(a, b, sizeof(grf)) #define GRF_CPY(a, b) memcpy(a, b, sizeof(grf)) static int verify(struct eu_state *eu) { if (GRF_CMP(eu->version, protocol_version)) { if (debug) { printf("Bad EU protocol version %x %x\n", ((uint32_t *)&eu->version)[0], DEBUG_PROTOCOL_VERSION); dump_debug((void *)eu, sizeof(*eu)); } return -EBAD_PROTOCOL; } if (GRF_CMP(eu->state_magic, eu_msg)) { if (debug) { printf("Bad EU state magic %x %x\n", ((uint32_t *)&eu->state_magic)[0], ((uint32_t *)&eu->state_magic)[1]); dump_debug((void *)eu, sizeof(*eu)); } return -EBAD_MAGIC; } else { GRF_CPY(eu->state_magic, cpu_ack); } eu->sr0 = RSVD_EU << 8 | RSVD_THREAD; return 0; } static int collect_data(int bit, volatile uint8_t *buf) { struct eu_state *eu; ssize_t num; int ret; assert(eu_id(bit) != RSVD_EU); if (eu_fd(bit) == -1) { char name[128]; sprintf(name, "dump_eu_%02d_%d.bin", eu_id(bit), eu_tid(bit)); eu_fd(bit) = open(name, O_CREAT | O_WRONLY | O_TRUNC, S_IRWXO); if (eu_fd(bit) == -1) return -1; } eu = find_eu_shmem(bit, buf); if (eu == NULL) { if (debug) printf("Bad offset %d %d\n", eu_id(bit), eu_tid(bit)); return -EBAD_SHMEM; } ret = verify(eu); if (ret) return ret; num = write(eu_fd(bit), (void *)eu, sizeof(*eu)); if (num != sizeof(*eu)) { perror("unhandled write failure"); return EBAD_WRITE; } return 0; } static void clear_attn(int bit) { #if 0 /* * This works but doesn't allow for easily changed clearing bits */ static void clear_attn_old(int bit) { int bit_to_clear = bit % 32; bit_to_clear = 31 - bit_to_clear; intel_register_write(0x7830 + (bit/32) * 4, 0); intel_register_write(0x7830 + (bit/32) * 4, 1 << bit_to_clear); } #else if (!force_clear) { int bit_to_clear; bit_to_clear = eu_info->debuggees[bit].clr; intel_register_write(EU_ATT_CLR + (bit/32) * 4, 0); intel_register_write(EU_ATT_CLR + (bit/32) * 4, 1 << bit_to_clear); } else { intel_register_write(EU_ATT_CLR + 0, 0); intel_register_write(EU_ATT_CLR + 4, 0); intel_register_write(EU_ATT_CLR + 0, 0xffffffff); intel_register_write(EU_ATT_CLR + 4, 0xffffffff); } #endif } static void db_shutdown(int sig) { shutting_down = 1; printf("Shutting down...\n"); } static void die(int reason) { int i = 0; intel_register_write(EU_ATT_CLR, 0); intel_register_write(EU_ATT_CLR + 4, 0); if (debug_fd) close(debug_fd); for (i = 0; i < eu_info->num_threads; i++) { if (eu_info->debuggees[i].fd != -1) close(eu_info->debuggees[i].fd); } unmap_debug_buffer(); if (old_td_ctl) intel_register_write(TD_CTL, old_td_ctl); intel_register_access_fini(); exit(reason); } static int identify_device(int devid) { switch(devid) { case PCI_CHIP_SANDYBRIDGE_GT1: case PCI_CHIP_SANDYBRIDGE_M_GT1: case PCI_CHIP_SANDYBRIDGE_S: eu_info = >1; break; case PCI_CHIP_SANDYBRIDGE_GT2: case PCI_CHIP_SANDYBRIDGE_GT2_PLUS: case PCI_CHIP_SANDYBRIDGE_M_GT2: case PCI_CHIP_SANDYBRIDGE_M_GT2_PLUS: eu_info = >2; break; default: return 1; } return 0; } static void parse_data(const char *file_name) { struct eu_state *eu_state = NULL; struct stat st; int fd = -1; int ret, i, elements; fd = open(file_name, O_RDONLY); if (fd == -1) { perror("open"); goto out; } ret = fstat(fd, &st); if (ret == -1) { perror("fstat"); goto out; } elements = st.st_size / sizeof(struct eu_state); if (elements == 0) { fprintf(stderr, "File not big enough for 1 entry\n"); goto out; } eu_state = mmap(0, st.st_size, PROT_READ, MAP_SHARED, fd, 0); if (eu_state == MAP_FAILED) { perror("mmap"); goto out; } for(i = 0; i < elements; i++) { printf("AIP: "); printf("%x\n", ((uint32_t *)eu_state[i].cr0)[2]); } out: if (eu_state) munmap(eu_state, st.st_size); if (fd != -1) close(fd); } static int wait_for_scratch_bo(void) { struct sockaddr_un addr; uint32_t version; int fd, ret, handle = -1; assert(sizeof(version) == sizeof(dh.version)); fd = socket(AF_UNIX, SOCK_STREAM, 0); if (fd == -1) return -1; /* Clean up previous runs */ remove(SHADER_DEBUG_SOCKET); memset(&addr, 0, sizeof(addr)); addr.sun_family = AF_UNIX; strncpy(addr.sun_path, SHADER_DEBUG_SOCKET, sizeof(addr.sun_path) - 1); ret = bind(fd, (const struct sockaddr *)&addr, sizeof(addr)); if (ret == -1) { perror("listen"); return -1; } ret = listen(fd, 1); if (ret == -1) { perror("listen"); goto done; } while(1) { int client_fd; size_t count; char ack[] = DEBUG_HANDSHAKE_ACK; client_fd = accept(fd, NULL, NULL); if (client_fd == -1) { perror("accept"); goto done; } count = read(client_fd, &version, sizeof(version)); if (count != sizeof(version)) { perror("read version"); goto loop_out; } if (version != DEBUG_HANDSHAKE_VERSION) { fprintf(stderr, "Bad debug handshake\n"); goto loop_out; } count = read(client_fd, ((char *)&dh) + 1, sizeof(dh) - 1); if (count != sizeof(dh) - 1) { perror("read handshake"); goto loop_out; } count = write(client_fd, ack, sizeof(ack)); if (count != sizeof(ack)) { perror("write ack"); goto loop_out; } handle = dh.flink_handle; if (debug > 0) { printf("Handshake completed successfully\n" "\tprotocol version = %d\n" "\tflink handle = %d\n" "\tper thread scratch = %x\n", version, dh.flink_handle, dh.per_thread_scratch); } loop_out: close(client_fd); break; } done: close(fd); return handle; } static void setup_hw_bits(void) { intel_register_write(INST_PM, GEN6_GLOBAL_DEBUG_ENABLE | GEN6_GLOBAL_DEBUG_ENABLE << 16); old_td_ctl = intel_register_read(GEN6_TD_CTL); intel_register_write(GEN6_TD_CTL, GEN6_TD_CTL_FORCE_TD_BKPT); } int main(int argc, char* argv[]) { struct pci_device *pci_dev; volatile uint8_t *scratch = NULL; int bits[64]; int devid = -1, opt; while ((opt = getopt(argc, argv, "cdr:pf?h")) != -1) { switch (opt) { case 'c': clear_waits = 1; break; case 'd': debug = 1; break; case 'r': parse_data(optarg); exit(0); break; case 'p': devid = atoi(optarg); break; case 'f': force_clear = 1; break; case '?': case 'h': default: exit(0); } } pci_dev = intel_get_pci_device(); if (devid != -1); devid = pci_dev->device_id; if (identify_device(devid)) { abort(); } assert(intel_register_access_init(pci_dev, 1) == 0); memset(bits, -1, sizeof(bits)); /* * These events have to occur before the SR runs, or we need * non-blocking versions of the functions. */ if (!clear_waits) { int handle; drm_fd = drm_open_any(); bufmgr = drm_intel_bufmgr_gem_init(drm_fd, 4096); setup_hw_bits(); /* We are probably root, make files world friendly */ umask(0); handle = wait_for_scratch_bo(); if (handle == -1) { printf("No handle from mesa, please enter manually: "); if (fscanf(stdin, "%1d", &handle) == 0) exit(1); } scratch_bo = intel_bo_gem_create_from_name(bufmgr, "scratch", handle); if (scratch_bo == NULL) { fprintf(stderr, "Couldn't flink buffer\n"); abort(); } signal(SIGINT, db_shutdown); printf("Press Ctrl-C to stop\n"); } else { int time = force_clear ? 0 : 20000; while (wait_for_attn(time, bits)) { clear_attn(bits[0]); memset(bits, -1, sizeof(bits)); } die(0); } scratch = map_debug_buffer(); while (shutting_down == 0) { int num_events, i; memset(bits, -1, sizeof(bits)); num_events = wait_for_attn(-1, bits); if (num_events == 0) break; for (i = 0; i < num_events; i++) { assert(bits[i] < 64 && bits[i] >= 0); if (collect_data(bits[i], scratch)) { bits[i] = -1; continue; } clear_attn(bits[i]); } } die(0); return 0; } intel-gpu-tools-1.3/debugger/Makefile.am0000664000175100017510000000046111757635623015204 00000000000000 SUBDIRS = system_routine bin_PROGRAMS = eudb noinst_PROGRAMS = debug_rdata AM_CPPFLAGS = \ -I$(top_srcdir) \ -I$(top_srcdir)/lib AM_CFLAGS = \ $(DRM_CFLAGS) \ $(PCIACCESS_CFLAGS) \ $(CWARNFLAGS) LDADD = $(top_builddir)/lib/libintel_tools.la $(DRM_LIBS) $(PCIACCESS_LIBS) $(CAIRO_LIBS) intel-gpu-tools-1.3/debugger/debug_rdata.c0000664000175100017510000000750611631112215015536 00000000000000/* * Copyright © 2011 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Ben Widawsky * */ #include #include #include #include "intel_gpu_tools.h" struct eu_rdata { union { struct { uint8_t sendc_dep : 1; uint8_t swh_dep : 1; uint8_t pwc_dep : 1; uint8_t n2_dep : 1; uint8_t n1_dep : 1; uint8_t n0_dep : 1; uint8_t flag1_dep : 1; uint8_t flag0_dep : 1; uint8_t indx_dep : 1; uint8_t mrf_dep : 1; uint8_t dst_dep : 1; uint8_t src2_dep : 1; uint8_t src1_dep : 1; uint8_t src0_dep : 1; uint8_t mp_dep_pin : 1; uint8_t sp_dep_pin : 1; uint8_t fftid : 8; uint8_t ffid : 4; uint8_t instruction_valid : 1; uint8_t thread_status : 3; }; uint32_t dword; } ud0; union { struct { uint8_t mrf_addr : 4; uint8_t dst_addr : 7; uint8_t src2_addr : 7; uint8_t src1_addr : 7; uint8_t src0_addr : 7; }; uint32_t dword; } ud1; union { struct { uint16_t exip : 12; uint8_t opcode : 7; uint8_t pwc : 8; uint8_t instruction_valid : 1; uint8_t mbz : 4; }; uint32_t dword; } ud2; }; const char *thread_status[] = {"INVALID", "invalid/no thread", "standby (dependency)", "INVALID", "Executing", "INVALID" , "INVALID" , "INVALID"}; static struct eu_rdata collect_rdata(int eu, int tid) { struct eu_rdata rdata; intel_register_write(0x7800, eu << 16 | (3 * tid) << 8); rdata.ud0.dword = intel_register_read(0x7840); intel_register_write(0x7800, eu << 16 | (3 * tid + 1) << 8); rdata.ud1.dword = intel_register_read(0x7840); intel_register_write(0x7800, eu << 16 | (3 * tid + 2) << 8); rdata.ud2.dword = intel_register_read(0x7840); return rdata; } static void print_rdata(struct eu_rdata rdata) { printf("\t%s\n", thread_status[rdata.ud0.thread_status]); printf("\tn1_dep: %d\n", rdata.ud0.n1_dep); printf("\tpwc_dep: %d\n", rdata.ud0.pwc_dep); printf("\tswh_dep: %d\n", rdata.ud0.swh_dep); printf("\tsource 0 %x\n", rdata.ud1.src0_addr); printf("\tsource 1 %x\n", rdata.ud1.src1_addr); printf("\tsource 2 %x\n", rdata.ud1.src2_addr); printf("\tdest %x\n", rdata.ud1.dst_addr); printf("\tmrf %x\n", rdata.ud1.mrf_addr); printf("\tIP: %x\n", rdata.ud2.exip); printf("\topcode: %x\n", rdata.ud2.opcode); } static void find_stuck_threads(void) { int i, j; for (i = 0; i < 15; i++) for (j = 0; j < 5; j++) { struct eu_rdata rdata; rdata = collect_rdata(i, j); if (rdata.ud0.thread_status == 2 || rdata.ud0.thread_status == 4) { printf("%d %d:\n", i, j); print_rdata(rdata); } } } int main(int argc, char *argv[]) { struct pci_device *pci_dev; pci_dev = intel_get_pci_device(); intel_register_access_init(pci_dev, 1); find_stuck_threads(); // collect_rdata(atoi(argv[1]), atoi(argv[2])); return 0; } intel-gpu-tools-1.3/debugger/Makefile.in0000664000175100017510000006146612016622040015203 00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } 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@ bin_PROGRAMS = eudb$(EXEEXT) noinst_PROGRAMS = debug_rdata$(EXEEXT) subdir = debugger DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS) debug_rdata_SOURCES = debug_rdata.c debug_rdata_OBJECTS = debug_rdata.$(OBJEXT) debug_rdata_LDADD = $(LDADD) am__DEPENDENCIES_1 = debug_rdata_DEPENDENCIES = $(top_builddir)/lib/libintel_tools.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent eudb_SOURCES = eudb.c eudb_OBJECTS = eudb.$(OBJEXT) eudb_LDADD = $(LDADD) eudb_DEPENDENCIES = $(top_builddir)/lib/libintel_tools.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; SOURCES = debug_rdata.c eudb.c DIST_SOURCES = debug_rdata.c eudb.c RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ ADMIN_MAN_DIR = @ADMIN_MAN_DIR@ ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@ AMTAR = @AMTAR@ 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@ CAIRO_CFLAGS = @CAIRO_CFLAGS@ CAIRO_LIBS = @CAIRO_LIBS@ 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@ DRM_CFLAGS = @DRM_CFLAGS@ DRM_LIBS = @DRM_LIBS@ DRM_NOUVEAU_CFLAGS = @DRM_NOUVEAU_CFLAGS@ DRM_NOUVEAU_LIBS = @DRM_NOUVEAU_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILE_MAN_DIR = @FILE_MAN_DIR@ FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@ GEN4ASM = @GEN4ASM@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_LIBS = @GLIB_LIBS@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_CMD = @INSTALL_CMD@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBUDEV_CFLAGS = @LIBUDEV_CFLAGS@ LIBUDEV_LIBS = @LIBUDEV_LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MAN_SUBSTS = @MAN_SUBSTS@ MISC_MAN_DIR = @MISC_MAN_DIR@ MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJCOPY = @OBJCOPY@ 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@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ THREAD_CFLAGS = @THREAD_CFLAGS@ VERSION = @VERSION@ 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@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = system_routine AM_CPPFLAGS = \ -I$(top_srcdir) \ -I$(top_srcdir)/lib AM_CFLAGS = \ $(DRM_CFLAGS) \ $(PCIACCESS_CFLAGS) \ $(CWARNFLAGS) LDADD = $(top_builddir)/lib/libintel_tools.la $(DRM_LIBS) $(PCIACCESS_LIBS) $(CAIRO_LIBS) all: all-recursive .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign debugger/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign debugger/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p || test -f $$p1; \ then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list debug_rdata$(EXEEXT): $(debug_rdata_OBJECTS) $(debug_rdata_DEPENDENCIES) $(EXTRA_debug_rdata_DEPENDENCIES) @rm -f debug_rdata$(EXEEXT) $(AM_V_CCLD)$(LINK) $(debug_rdata_OBJECTS) $(debug_rdata_LDADD) $(LIBS) eudb$(EXEEXT): $(eudb_OBJECTS) $(eudb_DEPENDENCIES) $(EXTRA_eudb_DEPENDENCIES) @rm -f eudb$(EXEEXT) $(AM_V_CCLD)$(LINK) $(eudb_OBJECTS) $(eudb_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/debug_rdata.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eudb.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(PROGRAMS) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-binPROGRAMS clean-generic clean-libtool \ clean-noinstPROGRAMS mostlyclean-am distclean: distclean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-binPROGRAMS .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-binPROGRAMS \ clean-generic clean-libtool clean-noinstPROGRAMS ctags \ ctags-recursive distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs installdirs-am \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \ uninstall-binPROGRAMS # 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: intel-gpu-tools-1.3/debugger/system_routine/0000775000175100017510000000000012016622744016305 500000000000000intel-gpu-tools-1.3/debugger/system_routine/test.g4a0000664000175100017510000000433711631112215017575 00000000000000/* * Copyright © 2011 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Ben Widawsky * */ #include "debug.h" #define CR0_0_ME_STATE_CTRL (1 << 31) #define CR0_0_BP_SUPPRESS (1 << 15) #define CR0_0_SPF_EN (1 << 2) #define CR0_0_ACC_DIS (1 << 1) #define CR0_1_BES_CTRL (1 << 31) #define CR0_1_HALT_CTRL (1 << 30) #define CR0_1_SOFT_EXCEPTION_CTRL (1 << 29) #define CR0_1_ILLGL_OP_STS (1 << 28) #define CR0_1_STACK_OVRFLW_STS (1 << 27) #define CR0_0_ENTRY_UNMASK (CR0_0_SPF_EN | CR0_0_ACC_DIS) // TODO: Need to fix this for non breakpoint case #define CR0_1_ENTRY_UNMASK ~(CR0_1_BES_CTRL) #define CR0_0_RETURN_MASK ~(CR0_0_ME_STATE_CTRL | CR0_0_SPF_EN | CR0_0_ACC_DIS) #ifndef SANDYBRIDGE #error Only SandyBridge is supported #endif /* Default flags for an instruction */ #define FLAGS { ALIGN1, SWITCH, MASK_DISABLE, ACCWRCTRL} Enter: nop; or (1) cr0.0 cr0.0 CR0_0_ENTRY_UNMASK:ud FLAGS; /* Clear breakpoint status */ and (1) cr0.1 cr0.1 CR0_1_ENTRY_UNMASK:ud FLAGS; /* set breakpoint suppress this should be conditional on bes */ or (1) cr0.0 cr0.0 CR0_0_BP_SUPPRESS:ud FLAGS; and (1) cr0.0 cr0.0 CR0_0_RETURN_MASK:ud FLAGS; nop; intel-gpu-tools-1.3/debugger/system_routine/eviction_macro.c0000664000175100017510000000333211631112215021360 00000000000000/* * Copyright © 2011 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Ben Widawsky * */ #include #define START 0x100 #define END ((128 << 10) / 4) int main(int argc, char *argv[]) { int i; printf("#ifdef SANDYBRIDGE\n"); printf("#define EVICT_CACHE \\\n"); printf("\tmov (1) m0.5:ud g0.5:ud FLAGS; \\\n"); for (i = START; i < END - 8; i+=0x8) { printf("\tmov (1) m0.2:ud 0x%04x:ud FLAGS; \\\n", i); printf("\tWRITE_SCRATCH4(m0); \\\n"); } printf("\tmov (1) m0.2:ud 0x%04x:ud FLAGS; \\\n", i); printf("\tWRITE_SCRATCH4(m0)\n"); printf("#else\n"); printf("#define EVICT_CACHE\n"); printf("#endif\n"); } intel-gpu-tools-1.3/debugger/system_routine/Makefile.am0000664000175100017510000000230211706636070020260 00000000000000 noinst_PROGRAMS = eviction_macro sr tiny nodist_sr_SOURCES = sr.c nodist_tiny_SOURCES = tiny.c GEN4ASM_FLAGS = -g6 -a -b ASM_CPPFLAGS = \ -x assembler-with-cpp \ -P -DGEN_ASM -DSANDYBRIDGE \ -I$(top_srcdir)/lib \ -I$(builddir) evict.h : eviction_macro $(builddir)/eviction_macro > evict.h sr.cpp : sr.g4a $(srcdir)/pre_cpp.py $(srcdir)/sr.g4a > $@.tmp && mv $@.tmp $@ sr.asm : sr.cpp evict.h $(CPP) $(ASM_CPPFLAGS) -o $@ sr.cpp sr.c: sr.asm $(GEN4ASM) $(GEN4ASM_FLAGS) sr.asm -o $@ sr.o : sr.c $(CC) -c -o $@ sr.c sr : sr.o $(OBJCOPY) -O binary -K gen_eu_bytes sr.o $@ # Test.g4a is the simplest possible system routine we can run on the GPU # without actually hanging the system. The system routine kernel is very # simple and doesn't depend on any external communication to run. tiny.cpp : test.g4a $(srcdir)/pre_cpp.py $(srcdir)/test.g4a > $@.tmp && mv $@.tmp $@ tiny.asm : tiny.cpp $(CPP) $(ASM_CPPFLAGS) -o $@ tiny.cpp tiny.c: tiny.asm $(GEN4ASM) $(GEN4ASM_FLAGS) tiny.asm -o $@ tiny.o : tiny.c $(CC) -c -o $@ tiny.c tiny : tiny.o $(OBJCOPY) -O binary -K gen_eu_bytes tiny.o $@ CLEANFILES = evict.h sr.cpp sr.asm sr.c tiny.cpp tiny.asm tiny.c EXTRA_DIST = pre_cpp.py sr.g4a test.g4a intel-gpu-tools-1.3/debugger/system_routine/pre_cpp.py0000775000175100017510000000715011631112215020222 00000000000000#!/usr/bin/env python3 # Copyright © 2011 Intel Corporation # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice (including the next # paragraph) shall be included in all copies or substantial portions of the # Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. # # Authors: # Ben Widawsky #very limited C-like preprocessor #limitations: # no macro substitutions # no multiline definitions # divide operator is // import sys,re file = open(sys.argv[1], "r") lines = file.readlines() len(lines) out = dict() defines = dict() count = 0 #create a dict for our output for line in lines: out[count] = line count = count + 1 #done is considered #define def is_done(string): m = re.match("#define\s+(\w+?)\s+([a-fA-F0-9\-]+?)\s*$", string) return m #skip macros, the real cpp will handle it def skip(string): #macro m = re.match("#define\s+\w+\(.+", string) return m != None #put contants which are done being evaluated into the dictionary def easy_constants(): ret = 0 for lineno, string in out.items(): if skip(string): continue m = is_done(string) if m != None: key = m.group(1) value = m.group(2) if not key in defines: defines[key] = int(eval(value)) ret = 1 return ret #replace names with dictionary values def simple_replace(): ret = 0 for lineno, string in out.items(): if skip(string): continue for key, value in defines.items(): if is_done(string): continue s = re.subn(key, repr(value), string) if s[1] > 0: out[lineno] = s[0] ret = s[1] return ret #evaluate expressions to try to simplify them def collapse_constants(): ret = 0 for lineno, string in out.items(): if skip(string): continue if is_done(string): continue m = re.match("#define\s+(.+?)\s+(.+)$", string) if m != None: try: out[lineno] = "#define " + m.group(1) + " " + repr(eval(m.group(2))) ret = 1 except NameError as ne: #this happens before a variable is resolved in simple_replace continue except SyntaxError: #this happens with something like #define foo bar, which the #regular cpp can handle continue except: raise KeyboardInterrupt return ret; while True: ret = 0 ret += easy_constants() ret += simple_replace() ret += collapse_constants() if ret == 0: break; for lineno, string in out.items(): print(string.rstrip()) intel-gpu-tools-1.3/debugger/system_routine/sr.g4a0000664000175100017510000002040711631112215017236 00000000000000/* * Copyright © 2011 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Ben Widawsky * */ #include "debug.h" #include "evict.h" #define CR0_0_ME_STATE_CTRL (1 << 31) #define CR0_0_BP_SUPPRESS (1 << 15) #define CR0_0_SPF_EN (1 << 2) #define CR0_0_ACC_DIS (1 << 1) #define CR0_1_BES_CTRL (1 << 31) #define CR0_1_HALT_CTRL (1 << 30) #define CR0_1_SOFT_EXCEPTION_CTRL (1 << 29) #define CR0_1_ILLGL_OP_STS (1 << 28) #define CR0_1_STACK_OVRFLW_STS (1 << 27) #define CR0_0_ENTRY_UNMASK (CR0_0_SPF_EN | CR0_0_ACC_DIS) // TODO: Need to fix this for non breakpoint case #define CR0_1_ENTRY_UNMASK ~(CR0_1_BES_CTRL) #define CR0_0_RETURN_MASK ~(CR0_0_ME_STATE_CTRL | CR0_0_SPF_EN | CR0_0_ACC_DIS) // TODO: not sure how to make this not hardcoded #define PER_THREAD_SCRATCH_SIZE (1 << 20) #define PER_THREAD_QWORDS (PER_THREAD_SCRATCH_SIZE >> 4) /* Should get this from brw_defines.h */ #define BRW_DATAPORT_OWORD_BLOCK_2_OWORDS 2 #define BRW_DATAPORT_OWORD_BLOCK_4_OWORDS 3 #define BRW_DATAPORT_OWORD_BLOCK_8_OWORDS 4 #define GEN6_DATAPORT_WRITE_MESSAGE_OWORD_BLOCK_WRITE 8 #define BRW_DATAPORT_READ_MESSAGE_OWORD_BLOCK_READ 0 /* desc field, ie. dword3 6.3.66.2 and 2.11.2.1.4 */ #define SEND_MLEN_5 (5<<25) #define SEND_MLEN_3 (3<<25) #define SEND_MLEN_2 (2<<25) #define SEND_MLEN_1 (1<<25) #define SEND_RLEN_1 (1<<20) #define SEND_RLEN_0 (0<<20) #define SEND_HEADER_PRESENT (1<<19) #define SEND_WRITE_COMMIT (1<<17) #define SEND_TYPE_WRITE (GEN6_DATAPORT_WRITE_MESSAGE_OWORD_BLOCK_WRITE<<13) #define SEND_TYPE_READ (BRW_DATAPORT_READ_MESSAGE_OWORD_BLOCK_READ<<13) #define SEND_BLOCK_SIZE1 (BRW_DATAPORT_OWORD_BLOCK_2_OWORDS<<8) #define SEND_BLOCK_SIZE2 (BRW_DATAPORT_OWORD_BLOCK_4_OWORDS<<8) #define SEND_BLOCK_SIZE4 (BRW_DATAPORT_OWORD_BLOCK_8_OWORDS<<8) #define SEND_BINDING_TABLE (255<<0) // No write commit #define WRITE_DESC1_XXX SEND_BINDING_TABLE | SEND_BLOCK_SIZE1 | SEND_TYPE_WRITE | SEND_HEADER_PRESENT | SEND_MLEN_2 #define WRITE_DESC1_WC SEND_BINDING_TABLE | SEND_BLOCK_SIZE1 | SEND_TYPE_WRITE | SEND_HEADER_PRESENT | SEND_MLEN_2 | SEND_WRITE_COMMIT #define WRITE_DESC2 SEND_BINDING_TABLE | SEND_BLOCK_SIZE2 | SEND_TYPE_WRITE | SEND_HEADER_PRESENT | SEND_MLEN_3 #define WRITE_DESC4 SEND_BINDING_TABLE | SEND_BLOCK_SIZE4 | SEND_TYPE_WRITE | SEND_HEADER_PRESENT | SEND_MLEN_5 #define RECV_DESC1 SEND_BINDING_TABLE | SEND_BLOCK_SIZE1 | SEND_TYPE_READ | SEND_HEADER_PRESENT | SEND_MLEN_1 | SEND_RLEN_1 //#define SEND_DESC1 0x40902FF #define SEND_DESC1_WC 0x40b02FF /* ex_desc field 6.3.66.2 */ #define SEND_DP_RENDER_CACHE (5<<0) #define SEND_EOT (1<<5) #define SEND_EX_DESC SEND_DP_RENDER_CACHE /** * WRITE_SCRATCH1 - Write 2 owords. * cdst.2 - offset * cdst.5 - per thread scratch base, relative to gsba?? * cdst+1 - data to be written. */ #define WRITE_SCRATCH1(cdst) \ send (16) null cdst SEND_EX_DESC WRITE_DESC1_XXX FLAGS #define WRITE_SCRATCH1_WC(cdst) \ send (16) g1 cdst SEND_EX_DESC WRITE_DESC1_WC FLAGS #define WRITE_SCRATCH2(cdst) \ send (16) null cdst SEND_EX_DESC WRITE_DESC2 FLAGS #define WRITE_SCRATCH4(cdst) \ send (16) null cdst SEND_EX_DESC WRITE_DESC4 FLAGS /** * READ_SCRATCH1 - Read 2 owords. * cdst.2 - offset * cdst.5 - per thread scratch base, relative to gsba?? * grf - register where read data is populated. */ #define READ_SCRATCH1(grf, cdst) \ send (16) grf:ud cdst SEND_EX_DESC RECV_DESC1 FLAGS /** * SET_OFFSET - setup mrf for the given offset prior to a send instruction. * mrf - message register to be used as the header. * offset - offset. * * If a WRITE_SCRATCH follows, mrf+1 -> mrf+1+n should contain the data to be * written. */ #define SET_OFFSET(mrf, offset) \ mov (1) mrf.5:ud g0.5:ud FLAGS; \ mov (1) mrf.2:ud offset:ud FLAGS /** * SAVE_CRF - save the control register * clobbers: m0.2, m0.5 */ #define CR_OFFSET 0x40 #define SAVE_CRF \ SET_OFFSET(m0, CR_OFFSET); \ mov (8) m1:ud 0xdeadbeef:ud FLAGS; \ mov (1) m1.0:ud cr0.0 FLAGS; \ mov (1) m1.1:ud cr0.1 FLAGS; \ mov (1) m1.2:ud cr0.2 FLAGS; \ mov (1) m1.3:ud sr0:ud FLAGS; \ WRITE_SCRATCH1(m0) /* * clobbers: m0.2, m0.5 */ #define STORE_GRF(grf, offset) \ SET_OFFSET(m0, offset); \ mov (8) m1:ud grf:ud FLAGS; \ WRITE_SCRATCH1(m0) /* * clobbers: m0.2, m0.5 */ #define LOAD_GRF(grf, offset) \ SET_OFFSET(m0, offset); \ READ_SCRATCH1(grf, m0) /* * clobbers: mrf.2 mrf.5 */ #define STORE_MRF(mrf, offset) \ SET_OFFSET(mrf, offset); \ WRITE_SCRATCH1(mrf) /* * non-quirky semantics, unlike STORE_MRF * clobbers: g1 */ #define LOAD_MRF(mrf, offset) \ LOAD_GRF(g1, offset); \ mov (8) mrf:ud g1:ud FLAGS #define SAVE_ALL_MRF \ /* m1 is saved already */ \ STORE_MRF(m1, 0x2); \ STORE_MRF(m2, 0x4); \ STORE_MRF(m3, 0x6); \ STORE_MRF(m4, 0x8); \ STORE_MRF(m5, 0xa); \ STORE_MRF(m6, 0xc); \ STORE_MRF(m7, 0xe); \ STORE_MRF(m8, 0x10); \ STORE_MRF(m9, 0x12); \ STORE_MRF(m10, 0x14); \ STORE_MRF(m11, 0x16); \ STORE_MRF(m12, 0x18); \ STORE_MRF(m13, 0x1a); \ STORE_MRF(m14, 0x1c) #define RESTORE_ALL_MRF \ LOAD_MRF(m15, 0x1c); \ LOAD_MRF(m14, 0x1a); \ LOAD_MRF(m13, 0x18); \ LOAD_MRF(m12, 0x16); \ LOAD_MRF(m11, 0x14); \ LOAD_MRF(m10, 0x12); \ LOAD_MRF(m9, 0x10); \ LOAD_MRF(m8, 0xe); \ LOAD_MRF(m7, 0xc); \ LOAD_MRF(m6, 0xa); \ LOAD_MRF(m5, 0x8); \ LOAD_MRF(m4, 0x6); \ LOAD_MRF(m3, 0x4); \ LOAD_MRF(m2, 0x2); \ LOAD_MRF(m1, 0x0) #ifndef SANDYBRIDGE #error Only SandyBridge is supported #endif /* Default flags for an instruction */ #define FLAGS { ALIGN1, SWITCH, MASK_DISABLE, ACCWRCTRL} /* * We can clobber m0, and g0.4, everything else must be saved. */ Enter: nop; or (1) cr0.0 cr0.0 CR0_0_ENTRY_UNMASK:ud FLAGS; /* * g0.5 has the per thread scratch space when running in FS or VS. * If we don't have a valid g0.5, we can calculate a per thread scratch offset * using the system registers. The problem is we do not have a good way to know * the offset from GSBA. The system routine will have to be hardcoded or * dynamically patched with the correct offset. * TID is in sr0.0[2:0] * EUID is in sr0.0[11:8] */ #ifdef GPGPU mov (1) g0.4:ud 0:ud FLAGS; #if 0 /* This should work according to the docs, the add blows up */ shr (1) g0.8:uw sr0.0:uw 5 FLAGS; add (1) g0.16:ub gr0.16:ub sr0.0:ub FLAGS; #else shr (1) g0.8:uw sr0.0:uw 5 FLAGS; mov (1) g0.9:uw sr0.0:uw FLAGS; and (1) g0.9:uw g0.9:uw 0x7:uw FLAGS; add (1) g0.8:uw g0.8:uw g0.9:uw FLAGS; mov (1) g0.9:uw 0:uw FLAGS; mul (1) g0.4:ud g0.4:ud PER_THREAD_QWORDS FLAGS; #endif #endif mov (8) m0:ud 0:ud FLAGS; /* Saves must occur in order so as not to clobber the next register */ STORE_MRF(m0, 0); STORE_GRF(g0, 0x20); STORE_GRF(g1, 0x22); SAVE_ALL_MRF; mov (8) g1:ud STATE_EU_MSG:ud FLAGS; STORE_GRF(g1, STATE_QWORD); mov (8) g1:ud DEBUG_PROTOCOL_VERSION:ud FLAGS; STORE_GRF(g1, COMMUNICATION_QWORD); SAVE_CRF; EVICT_CACHE; wait n1:ud; EVICT_CACHE; /* Using this to try to keep coherency */ LOAD_GRF(g1, CR_OFFSET); LOAD_GRF(g1, COMMUNICATION_QWORD); LOAD_GRF(g1, STATE_QWORD); RESTORE_ALL_MRF; LOAD_GRF(g1, 0x22); LOAD_GRF(g0, 0x20); /* Clear breakpoint status */ and (1) cr0.1 cr0.1 CR0_1_ENTRY_UNMASK:ud FLAGS; /* set breakpoint suppress this should be conditional on bes */ or (1) cr0.0 cr0.0 CR0_0_BP_SUPPRESS:ud FLAGS; and (1) cr0.0 cr0.0 CR0_0_RETURN_MASK:ud FLAGS; nop; intel-gpu-tools-1.3/debugger/system_routine/Makefile.in0000664000175100017510000004430212016622041020263 00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } 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@ noinst_PROGRAMS = eviction_macro$(EXEEXT) sr$(EXEEXT) tiny$(EXEEXT) subdir = debugger/system_routine DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = PROGRAMS = $(noinst_PROGRAMS) eviction_macro_SOURCES = eviction_macro.c eviction_macro_OBJECTS = eviction_macro.$(OBJEXT) eviction_macro_LDADD = $(LDADD) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent nodist_sr_OBJECTS = sr.$(OBJEXT) sr_OBJECTS = $(nodist_sr_OBJECTS) sr_LDADD = $(LDADD) nodist_tiny_OBJECTS = tiny.$(OBJEXT) tiny_OBJECTS = $(nodist_tiny_OBJECTS) tiny_LDADD = $(LDADD) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; SOURCES = eviction_macro.c $(nodist_sr_SOURCES) $(nodist_tiny_SOURCES) DIST_SOURCES = eviction_macro.c am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ADMIN_MAN_DIR = @ADMIN_MAN_DIR@ ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@ AMTAR = @AMTAR@ 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@ CAIRO_CFLAGS = @CAIRO_CFLAGS@ CAIRO_LIBS = @CAIRO_LIBS@ 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@ DRM_CFLAGS = @DRM_CFLAGS@ DRM_LIBS = @DRM_LIBS@ DRM_NOUVEAU_CFLAGS = @DRM_NOUVEAU_CFLAGS@ DRM_NOUVEAU_LIBS = @DRM_NOUVEAU_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILE_MAN_DIR = @FILE_MAN_DIR@ FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@ GEN4ASM = @GEN4ASM@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_LIBS = @GLIB_LIBS@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_CMD = @INSTALL_CMD@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBUDEV_CFLAGS = @LIBUDEV_CFLAGS@ LIBUDEV_LIBS = @LIBUDEV_LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MAN_SUBSTS = @MAN_SUBSTS@ MISC_MAN_DIR = @MISC_MAN_DIR@ MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJCOPY = @OBJCOPY@ 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@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ THREAD_CFLAGS = @THREAD_CFLAGS@ VERSION = @VERSION@ 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@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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@ nodist_sr_SOURCES = sr.c nodist_tiny_SOURCES = tiny.c GEN4ASM_FLAGS = -g6 -a -b ASM_CPPFLAGS = \ -x assembler-with-cpp \ -P -DGEN_ASM -DSANDYBRIDGE \ -I$(top_srcdir)/lib \ -I$(builddir) CLEANFILES = evict.h sr.cpp sr.asm sr.c tiny.cpp tiny.asm tiny.c EXTRA_DIST = pre_cpp.py sr.g4a test.g4a all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign debugger/system_routine/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign debugger/system_routine/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list eviction_macro$(EXEEXT): $(eviction_macro_OBJECTS) $(eviction_macro_DEPENDENCIES) $(EXTRA_eviction_macro_DEPENDENCIES) @rm -f eviction_macro$(EXEEXT) $(AM_V_CCLD)$(LINK) $(eviction_macro_OBJECTS) $(eviction_macro_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eviction_macro.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tiny.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: 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 clean-noinstPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstPROGRAMS ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am evict.h : eviction_macro $(builddir)/eviction_macro > evict.h sr.cpp : sr.g4a $(srcdir)/pre_cpp.py $(srcdir)/sr.g4a > $@.tmp && mv $@.tmp $@ sr.asm : sr.cpp evict.h $(CPP) $(ASM_CPPFLAGS) -o $@ sr.cpp sr.c: sr.asm $(GEN4ASM) $(GEN4ASM_FLAGS) sr.asm -o $@ sr.o : sr.c $(CC) -c -o $@ sr.c sr : sr.o $(OBJCOPY) -O binary -K gen_eu_bytes sr.o $@ # Test.g4a is the simplest possible system routine we can run on the GPU # without actually hanging the system. The system routine kernel is very # simple and doesn't depend on any external communication to run. tiny.cpp : test.g4a $(srcdir)/pre_cpp.py $(srcdir)/test.g4a > $@.tmp && mv $@.tmp $@ tiny.asm : tiny.cpp $(CPP) $(ASM_CPPFLAGS) -o $@ tiny.cpp tiny.c: tiny.asm $(GEN4ASM) $(GEN4ASM_FLAGS) tiny.asm -o $@ tiny.o : tiny.c $(CC) -c -o $@ tiny.c tiny : tiny.o $(OBJCOPY) -O binary -K gen_eu_bytes tiny.o $@ # 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: intel-gpu-tools-1.3/tools/0000775000175100017510000000000012016622744012570 500000000000000intel-gpu-tools-1.3/tools/intel_reg_dumper.c0000644000175100017510000016101212015774631016201 00000000000000/* * Copyright © 2006,2009 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * * Authors: * Eric Anholt * */ #define _GNU_SOURCE #include #include #include #include #include #include "intel_gpu_tools.h" static uint32_t devid = 0; #define DEBUGSTRING(func) static void func(char *result, int len, int reg, uint32_t val) DEBUGSTRING(i830_16bit_func) { snprintf(result, len, "0x%04x", (uint16_t) val); } DEBUGSTRING(i830_debug_dcc) { const char *addressing = NULL; if (!IS_MOBILE(devid)) return; if (IS_965(devid)) { if (val & (1 << 1)) addressing = "dual channel interleaved"; else addressing = "single or dual channel asymmetric"; } else { switch (val & 3) { case 0: addressing = "single channel"; break; case 1: addressing = "dual channel asymmetric"; break; case 2: addressing = "dual channel interleaved"; break; case 3: addressing = "unknown channel layout"; break; } } snprintf(result, len, "%s, XOR randomization: %sabled, XOR bit: %d", addressing, (val & (1 << 10)) ? "dis" : "en", (val & (1 << 9)) ? 17 : 11); } DEBUGSTRING(i830_debug_chdecmisc) { const char *enhmodesel = NULL; switch ((val >> 5) & 3) { case 1: enhmodesel = "XOR bank/rank"; break; case 2: enhmodesel = "swap bank"; break; case 3: enhmodesel = "XOR bank"; break; case 0: enhmodesel = "none"; break; } snprintf(result, len, "%s, ch2 enh %sabled, ch1 enh %sabled, " "ch0 enh %sabled, " "flex %sabled, ep %spresent", enhmodesel, (val & (1 << 4)) ? "en" : "dis", (val & (1 << 3)) ? "en" : "dis", (val & (1 << 2)) ? "en" : "dis", (val & (1 << 1)) ? "en" : "dis", (val & (1 << 0)) ? "" : "not "); } DEBUGSTRING(i830_debug_xyminus1) { snprintf(result, len, "%d, %d", (val & 0xffff) + 1, ((val & 0xffff0000) >> 16) + 1); } DEBUGSTRING(i830_debug_yxminus1) { snprintf(result, len, "%d, %d", ((val & 0xffff0000) >> 16) + 1, (val & 0xffff) + 1); } DEBUGSTRING(i830_debug_xy) { snprintf(result, len, "%d, %d", (val & 0xffff), ((val & 0xffff0000) >> 16)); } DEBUGSTRING(i830_debug_dspstride) { snprintf(result, len, "%d bytes", val); } DEBUGSTRING(i830_debug_dspcntr) { const char *enabled = val & DISPLAY_PLANE_ENABLE ? "enabled" : "disabled"; char plane = val & DISPPLANE_SEL_PIPE_B ? 'B' : 'A'; if (HAS_PCH_SPLIT(devid)) snprintf(result, len, "%s", enabled); else snprintf(result, len, "%s, pipe %c", enabled, plane); } DEBUGSTRING(i830_debug_pipeconf) { const char *enabled = val & PIPEACONF_ENABLE ? "enabled" : "disabled"; const char *bit30, *interlace; if (IS_965(devid)) bit30 = val & I965_PIPECONF_ACTIVE ? "active" : "inactive"; else bit30 = val & PIPEACONF_DOUBLE_WIDE ? "double-wide" : "single-wide"; if (HAS_PCH_SPLIT(devid)) { const char *bpc, *rotation; switch ((val >> 21) & 7) { case 0: interlace = "pf-pd"; break; case 1: interlace = "pf-id"; break; case 3: interlace = "if-id"; break; case 4: interlace = "if-id-dbl"; break; case 5: interlace = "pf-id-dbl"; break; default: interlace = "rsvd"; break; } switch ((val >> 14) & 3) { case 0: rotation = "rotate 0"; break; case 1: rotation = "rotate 90"; break; case 2: rotation = "rotate 180"; break; case 3: rotation = "rotate 270"; break; } switch (val & (7 << 5)) { case PIPECONF_8BPP: bpc = "8bpc"; break; case PIPECONF_10BPP: bpc = "10bpc"; break; case PIPECONF_6BPP: bpc = "6bpc"; break; case PIPECONF_12BPP: bpc = "12bpc"; break; default: bpc = "invalid bpc"; break; } snprintf(result, len, "%s, %s, %s, %s, %s", enabled, bit30, interlace, rotation, bpc); } else if (IS_GEN4(devid)) { switch ((val >> 21) & 7) { case 0: case 1: case 2: case 3: interlace = "progressive"; break; case 4: interlace = "interlaced embedded"; break; case 5: interlace = "interlaced"; break; case 6: interlace = "interlaced sdvo"; break; case 7: interlace = "interlaced legacy"; break; } snprintf(result, len, "%s, %s, %s", enabled, bit30, interlace); } else snprintf(result, len, "%s, %s", enabled, bit30); } DEBUGSTRING(i830_debug_pipestat) { const char *_FIFO_UNDERRUN = val & FIFO_UNDERRUN ? " FIFO_UNDERRUN" : ""; const char *_CRC_ERROR_ENABLE = val & CRC_ERROR_ENABLE ? " CRC_ERROR_ENABLE" : ""; const char *_CRC_DONE_ENABLE = val & CRC_DONE_ENABLE ? " CRC_DONE_ENABLE" : ""; const char *_GMBUS_EVENT_ENABLE = val & GMBUS_EVENT_ENABLE ? " GMBUS_EVENT_ENABLE" : ""; const char *_VSYNC_INT_ENABLE = val & VSYNC_INT_ENABLE ? " VSYNC_INT_ENABLE" : ""; const char *_DLINE_COMPARE_ENABLE = val & DLINE_COMPARE_ENABLE ? " DLINE_COMPARE_ENABLE" : ""; const char *_DPST_EVENT_ENABLE = val & DPST_EVENT_ENABLE ? " DPST_EVENT_ENABLE" : ""; const char *_LBLC_EVENT_ENABLE = val & LBLC_EVENT_ENABLE ? " LBLC_EVENT_ENABLE" : ""; const char *_OFIELD_INT_ENABLE = val & OFIELD_INT_ENABLE ? " OFIELD_INT_ENABLE" : ""; const char *_EFIELD_INT_ENABLE = val & EFIELD_INT_ENABLE ? " EFIELD_INT_ENABLE" : ""; const char *_SVBLANK_INT_ENABLE = val & SVBLANK_INT_ENABLE ? " SVBLANK_INT_ENABLE" : ""; const char *_VBLANK_INT_ENABLE = val & VBLANK_INT_ENABLE ? " VBLANK_INT_ENABLE" : ""; const char *_OREG_UPDATE_ENABLE = val & OREG_UPDATE_ENABLE ? " OREG_UPDATE_ENABLE" : ""; const char *_CRC_ERROR_INT_STATUS = val & CRC_ERROR_INT_STATUS ? " CRC_ERROR_INT_STATUS" : ""; const char *_CRC_DONE_INT_STATUS = val & CRC_DONE_INT_STATUS ? " CRC_DONE_INT_STATUS" : ""; const char *_GMBUS_INT_STATUS = val & GMBUS_INT_STATUS ? " GMBUS_INT_STATUS" : ""; const char *_VSYNC_INT_STATUS = val & VSYNC_INT_STATUS ? " VSYNC_INT_STATUS" : ""; const char *_DLINE_COMPARE_STATUS = val & DLINE_COMPARE_STATUS ? " DLINE_COMPARE_STATUS" : ""; const char *_DPST_EVENT_STATUS = val & DPST_EVENT_STATUS ? " DPST_EVENT_STATUS" : ""; const char *_LBLC_EVENT_STATUS = val & LBLC_EVENT_STATUS ? " LBLC_EVENT_STATUS" : ""; const char *_OFIELD_INT_STATUS = val & OFIELD_INT_STATUS ? " OFIELD_INT_STATUS" : ""; const char *_EFIELD_INT_STATUS = val & EFIELD_INT_STATUS ? " EFIELD_INT_STATUS" : ""; const char *_SVBLANK_INT_STATUS = val & SVBLANK_INT_STATUS ? " SVBLANK_INT_STATUS" : ""; const char *_VBLANK_INT_STATUS = val & VBLANK_INT_STATUS ? " VBLANK_INT_STATUS" : ""; const char *_OREG_UPDATE_STATUS = val & OREG_UPDATE_STATUS ? " OREG_UPDATE_STATUS" : ""; snprintf(result, len, "status:%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s", _FIFO_UNDERRUN, _CRC_ERROR_ENABLE, _CRC_DONE_ENABLE, _GMBUS_EVENT_ENABLE, _VSYNC_INT_ENABLE, _DLINE_COMPARE_ENABLE, _DPST_EVENT_ENABLE, _LBLC_EVENT_ENABLE, _OFIELD_INT_ENABLE, _EFIELD_INT_ENABLE, _SVBLANK_INT_ENABLE, _VBLANK_INT_ENABLE, _OREG_UPDATE_ENABLE, _CRC_ERROR_INT_STATUS, _CRC_DONE_INT_STATUS, _GMBUS_INT_STATUS, _VSYNC_INT_STATUS, _DLINE_COMPARE_STATUS, _DPST_EVENT_STATUS, _LBLC_EVENT_STATUS, _OFIELD_INT_STATUS, _EFIELD_INT_STATUS, _SVBLANK_INT_STATUS, _VBLANK_INT_STATUS, _OREG_UPDATE_STATUS); } DEBUGSTRING(ivb_debug_port) { const char *drrs = NULL; switch (val & (2 << 30)) { case PORT_DBG_DRRS_HW_STATE_OFF: drrs = "off"; break; case PORT_DBG_DRRS_HW_STATE_LOW: drrs = "low"; break; case PORT_DBG_DRRS_HW_STATE_HIGH: drrs = "high"; break; } snprintf(result, len, "HW DRRS %s", drrs); } DEBUGSTRING(i830_debug_hvtotal) { snprintf(result, len, "%d active, %d total", (val & 0xffff) + 1, ((val & 0xffff0000) >> 16) + 1); } DEBUGSTRING(i830_debug_hvsyncblank) { snprintf(result, len, "%d start, %d end", (val & 0xffff) + 1, ((val & 0xffff0000) >> 16) + 1); } DEBUGSTRING(i830_debug_vgacntrl) { snprintf(result, len, "%s", val & VGA_DISP_DISABLE ? "disabled" : "enabled"); } DEBUGSTRING(i830_debug_fp) { if (IS_IGD(devid)) { snprintf(result, len, "n = %d, m1 = %d, m2 = %d", ffs((val & FP_N_IGD_DIV_MASK) >> FP_N_DIV_SHIFT) - 1, ((val & FP_M1_DIV_MASK) >> FP_M1_DIV_SHIFT), ((val & FP_M2_IGD_DIV_MASK) >> FP_M2_DIV_SHIFT)); } snprintf(result, len, "n = %d, m1 = %d, m2 = %d", ((val & FP_N_DIV_MASK) >> FP_N_DIV_SHIFT), ((val & FP_M1_DIV_MASK) >> FP_M1_DIV_SHIFT), ((val & FP_M2_DIV_MASK) >> FP_M2_DIV_SHIFT)); } DEBUGSTRING(i830_debug_vga_pd) { int vga0_p1, vga0_p2, vga1_p1, vga1_p2; /* XXX: i9xx version */ if (val & VGA0_PD_P1_DIV_2) vga0_p1 = 2; else vga0_p1 = ((val & VGA0_PD_P1_MASK) >> VGA0_PD_P1_SHIFT) + 2; vga0_p2 = (val & VGA0_PD_P2_DIV_4) ? 4 : 2; if (val & VGA1_PD_P1_DIV_2) vga1_p1 = 2; else vga1_p1 = ((val & VGA1_PD_P1_MASK) >> VGA1_PD_P1_SHIFT) + 2; vga1_p2 = (val & VGA1_PD_P2_DIV_4) ? 4 : 2; snprintf(result, len, "vga0 p1 = %d, p2 = %d, vga1 p1 = %d, p2 = %d", vga0_p1, vga0_p2, vga1_p1, vga1_p2); } DEBUGSTRING(i830_debug_pp_status) { const char *status = val & PP_ON ? "on" : "off"; const char *ready = val & PP_READY ? "ready" : "not ready"; const char *seq = "unknown"; switch (val & PP_SEQUENCE_MASK) { case PP_SEQUENCE_NONE: seq = "idle"; break; case PP_SEQUENCE_ON: seq = "on"; break; case PP_SEQUENCE_OFF: seq = "off"; break; } snprintf(result, len, "%s, %s, sequencing %s", status, ready, seq); } DEBUGSTRING(i830_debug_pp_control) { snprintf(result, len, "power target: %s", val & POWER_TARGET_ON ? "on" : "off"); } DEBUGSTRING(i830_debug_dpll) { const char *enabled = val & DPLL_VCO_ENABLE ? "enabled" : "disabled"; const char *dvomode = val & DPLL_DVO_HIGH_SPEED ? "dvo" : "non-dvo"; const char *vgamode = val & DPLL_VGA_MODE_DIS ? "" : ", VGA"; const char *mode = "unknown"; const char *clock = "unknown"; const char *fpextra = val & DISPLAY_RATE_SELECT_FPA1 ? ", using FPx1!" : ""; char sdvoextra[20]; int p1, p2 = 0; if (IS_GEN2(devid)) { char is_lvds = (INREG(LVDS) & LVDS_PORT_EN) && (reg == DPLL_B); if (is_lvds) { mode = "LVDS"; p1 = ffs((val & DPLL_FPA01_P1_POST_DIV_MASK_I830_LVDS) >> DPLL_FPA01_P1_POST_DIV_SHIFT); if ((INREG(LVDS) & LVDS_CLKB_POWER_MASK) == LVDS_CLKB_POWER_UP) p2 = 7; else p2 = 14; } else { mode = "DAC/serial"; if (val & PLL_P1_DIVIDE_BY_TWO) { p1 = 2; } else { /* Map the number in the field to (3, 33) */ p1 = ((val & DPLL_FPA01_P1_POST_DIV_MASK_I830) >> DPLL_FPA01_P1_POST_DIV_SHIFT) + 2; } if (val & PLL_P2_DIVIDE_BY_4) p2 = 4; else p2 = 2; } } else { if (IS_IGD(devid)) { p1 = ffs((val & DPLL_FPA01_P1_POST_DIV_MASK_IGD) >> DPLL_FPA01_P1_POST_DIV_SHIFT_IGD); } else { p1 = ffs((val & DPLL_FPA01_P1_POST_DIV_MASK) >> DPLL_FPA01_P1_POST_DIV_SHIFT); } switch (val & DPLL_MODE_MASK) { case DPLLB_MODE_DAC_SERIAL: mode = "DAC/serial"; p2 = val & DPLL_DAC_SERIAL_P2_CLOCK_DIV_5 ? 5 : 10; break; case DPLLB_MODE_LVDS: mode = "LVDS"; p2 = val & DPLLB_LVDS_P2_CLOCK_DIV_7 ? 7 : 14; break; } } switch (val & PLL_REF_INPUT_MASK) { case PLL_REF_INPUT_DREFCLK: clock = "default"; break; case PLL_REF_INPUT_TVCLKINA: clock = "TV A"; break; case PLL_REF_INPUT_TVCLKINBC: clock = "TV B/C"; break; case PLLB_REF_INPUT_SPREADSPECTRUMIN: if (reg == DPLL_B) clock = "spread spectrum"; break; } if (IS_945(devid)) { sprintf(sdvoextra, ", SDVO mult %d", (int)((val & SDVO_MULTIPLIER_MASK) >> SDVO_MULTIPLIER_SHIFT_HIRES) + 1); } else { sdvoextra[0] = '\0'; } snprintf(result, len, "%s, %s%s, %s clock, %s mode, p1 = %d, " "p2 = %d%s%s", enabled, dvomode, vgamode, clock, mode, p1, p2, fpextra, sdvoextra); } DEBUGSTRING(i830_debug_dpll_test) { const char *dpllandiv = val & DPLLA_TEST_N_BYPASS ? ", DPLLA N bypassed" : ""; const char *dpllamdiv = val & DPLLA_TEST_M_BYPASS ? ", DPLLA M bypassed" : ""; const char *dpllainput = val & DPLLA_INPUT_BUFFER_ENABLE ? "" : ", DPLLA input buffer disabled"; const char *dpllbndiv = val & DPLLB_TEST_N_BYPASS ? ", DPLLB N bypassed" : ""; const char *dpllbmdiv = val & DPLLB_TEST_M_BYPASS ? ", DPLLB M bypassed" : ""; const char *dpllbinput = val & DPLLB_INPUT_BUFFER_ENABLE ? "" : ", DPLLB input buffer disabled"; snprintf(result, len, "%s%s%s%s%s%s", dpllandiv, dpllamdiv, dpllainput, dpllbndiv, dpllbmdiv, dpllbinput); } DEBUGSTRING(i830_debug_adpa) { char disp_pipe = (val & ADPA_PIPE_B_SELECT) ? 'B' : 'A'; const char *enable = (val & ADPA_DAC_ENABLE) ? "enabled" : "disabled"; char hsync = (val & ADPA_HSYNC_ACTIVE_HIGH) ? '+' : '-'; char vsync = (val & ADPA_VSYNC_ACTIVE_HIGH) ? '+' : '-'; if (HAS_CPT) disp_pipe = val & (1<<29) ? 'B' : 'A'; if (HAS_PCH_SPLIT(devid)) snprintf(result, len, "%s, transcoder %c, %chsync, %cvsync", enable, disp_pipe, hsync, vsync); else snprintf(result, len, "%s, pipe %c, %chsync, %cvsync", enable, disp_pipe, hsync, vsync); } DEBUGSTRING(i830_debug_lvds) { char disp_pipe = val & LVDS_PIPEB_SELECT ? 'B' : 'A'; const char *enable = val & LVDS_PORT_EN ? "enabled" : "disabled"; int depth; const char *channels; if ((val & LVDS_A3_POWER_MASK) == LVDS_A3_POWER_UP) depth = 24; else depth = 18; if ((val & LVDS_B0B3_POWER_MASK) == LVDS_B0B3_POWER_UP) channels = "2 channels"; else channels = "1 channel"; if (HAS_CPT) disp_pipe = val & (1<<29) ? 'B' : 'A'; snprintf(result, len, "%s, pipe %c, %d bit, %s", enable, disp_pipe, depth, channels); } DEBUGSTRING(i830_debug_dvo) { const char *enable = val & DVO_ENABLE ? "enabled" : "disabled"; char disp_pipe = val & DVO_PIPE_B_SELECT ? 'B' : 'A'; const char *stall; char hsync = val & DVO_HSYNC_ACTIVE_HIGH ? '+' : '-'; char vsync = val & DVO_VSYNC_ACTIVE_HIGH ? '+' : '-'; switch (val & DVO_PIPE_STALL_MASK) { case DVO_PIPE_STALL_UNUSED: stall = "no stall"; break; case DVO_PIPE_STALL: stall = "stall"; break; case DVO_PIPE_STALL_TV: stall = "TV stall"; break; default: stall = "unknown stall"; break; } snprintf(result, len, "%s, pipe %c, %s, %chsync, %cvsync", enable, disp_pipe, stall, hsync, vsync); } DEBUGSTRING(i830_debug_sdvo) { const char *enable = val & SDVO_ENABLE ? "enabled" : "disabled"; char disp_pipe = val & SDVO_PIPE_B_SELECT ? 'B' : 'A'; const char *stall = val & SDVO_STALL_SELECT ? "enabled" : "disabled"; const char *detected = val & SDVO_DETECTED ? "" : "not "; const char *gang = val & SDVOC_GANG_MODE ? ", gang mode" : ""; char sdvoextra[20]; if (IS_915(devid)) { sprintf(sdvoextra, ", SDVO mult %d", (int)((val & SDVO_PORT_MULTIPLY_MASK) >> SDVO_PORT_MULTIPLY_SHIFT) + 1); } else { sdvoextra[0] = '\0'; } snprintf(result, len, "%s, pipe %c, stall %s, %sdetected%s%s", enable, disp_pipe, stall, detected, sdvoextra, gang); } DEBUGSTRING(i830_debug_dspclk_gate_d) { const char *DPUNIT_B = val & DPUNIT_B_CLOCK_GATE_DISABLE ? " DPUNIT_B" : ""; const char *VSUNIT = val & VSUNIT_CLOCK_GATE_DISABLE ? " VSUNIT" : ""; const char *VRHUNIT = val & VRHUNIT_CLOCK_GATE_DISABLE ? " VRHUNIT" : ""; const char *VRDUNIT = val & VRDUNIT_CLOCK_GATE_DISABLE ? " VRDUNIT" : ""; const char *AUDUNIT = val & AUDUNIT_CLOCK_GATE_DISABLE ? " AUDUNIT" : ""; const char *DPUNIT_A = val & DPUNIT_A_CLOCK_GATE_DISABLE ? " DPUNIT_A" : ""; const char *DPCUNIT = val & DPCUNIT_CLOCK_GATE_DISABLE ? " DPCUNIT" : ""; const char *TVRUNIT = val & TVRUNIT_CLOCK_GATE_DISABLE ? " TVRUNIT" : ""; const char *TVCUNIT = val & TVCUNIT_CLOCK_GATE_DISABLE ? " TVCUNIT" : ""; const char *TVFUNIT = val & TVFUNIT_CLOCK_GATE_DISABLE ? " TVFUNIT" : ""; const char *TVEUNIT = val & TVEUNIT_CLOCK_GATE_DISABLE ? " TVEUNIT" : ""; const char *DVSUNIT = val & DVSUNIT_CLOCK_GATE_DISABLE ? " DVSUNIT" : ""; const char *DSSUNIT = val & DSSUNIT_CLOCK_GATE_DISABLE ? " DSSUNIT" : ""; const char *DDBUNIT = val & DDBUNIT_CLOCK_GATE_DISABLE ? " DDBUNIT" : ""; const char *DPRUNIT = val & DPRUNIT_CLOCK_GATE_DISABLE ? " DPRUNIT" : ""; const char *DPFUNIT = val & DPFUNIT_CLOCK_GATE_DISABLE ? " DPFUNIT" : ""; const char *DPBMUNIT = val & DPBMUNIT_CLOCK_GATE_DISABLE ? " DPBMUNIT" : ""; const char *DPLSUNIT = val & DPLSUNIT_CLOCK_GATE_DISABLE ? " DPLSUNIT" : ""; const char *DPLUNIT = val & DPLUNIT_CLOCK_GATE_DISABLE ? " DPLUNIT" : ""; const char *DPOUNIT = val & DPOUNIT_CLOCK_GATE_DISABLE ? " DPOUNIT" : ""; const char *DPBUNIT = val & DPBUNIT_CLOCK_GATE_DISABLE ? " DPBUNIT" : ""; const char *DCUNIT = val & DCUNIT_CLOCK_GATE_DISABLE ? " DCUNIT" : ""; const char *DPUNIT = val & DPUNIT_CLOCK_GATE_DISABLE ? " DPUNIT" : ""; const char *VRUNIT = val & VRUNIT_CLOCK_GATE_DISABLE ? " VRUNIT" : ""; const char *OVHUNIT = val & OVHUNIT_CLOCK_GATE_DISABLE ? " OVHUNIT" : ""; const char *DPIOUNIT = val & DPIOUNIT_CLOCK_GATE_DISABLE ? " DPIOUNIT" : ""; const char *OVFUNIT = val & OVFUNIT_CLOCK_GATE_DISABLE ? " OVFUNIT" : ""; const char *OVBUNIT = val & OVBUNIT_CLOCK_GATE_DISABLE ? " OVBUNIT" : ""; const char *OVRUNIT = val & OVRUNIT_CLOCK_GATE_DISABLE ? " OVRUNIT" : ""; const char *OVCUNIT = val & OVCUNIT_CLOCK_GATE_DISABLE ? " OVCUNIT" : ""; const char *OVUUNIT = val & OVUUNIT_CLOCK_GATE_DISABLE ? " OVUUNIT" : ""; const char *OVLUNIT = val & OVLUNIT_CLOCK_GATE_DISABLE ? " OVLUNIT" : ""; snprintf(result, len, "clock gates disabled:%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s", DPUNIT_B, VSUNIT, VRHUNIT, VRDUNIT, AUDUNIT, DPUNIT_A, DPCUNIT, TVRUNIT, TVCUNIT, TVFUNIT, TVEUNIT, DVSUNIT, DSSUNIT, DDBUNIT, DPRUNIT, DPFUNIT, DPBMUNIT, DPLSUNIT, DPLUNIT, DPOUNIT, DPBUNIT, DCUNIT, DPUNIT, VRUNIT, OVHUNIT, DPIOUNIT, OVFUNIT, OVBUNIT, OVRUNIT, OVCUNIT, OVUUNIT, OVLUNIT); } DEBUGSTRING(i810_debug_915_fence) { char format = (val & 1 << 12) ? 'Y' : 'X'; int pitch = 128 << ((val & 0x70) >> 4); unsigned int offset = val & 0x0ff00000; int size = (1024 * 1024) << ((val & 0x700) >> 8); if (IS_965(devid) || (IS_915(devid) && reg >= FENCE_NEW)) return; if (format == 'X') pitch *= 4; if (val & 1) { snprintf(result, len, "enabled, %c tiled, %4d pitch, 0x%08x - 0x%08x (%dkb)", format, pitch, offset, offset + size, size / 1024); } else { snprintf(result, len, "disabled"); } } DEBUGSTRING(i810_debug_965_fence_start) { const char *enable = (val & FENCE_VALID) ? " enabled" : "disabled"; char format = (val & I965_FENCE_Y_MAJOR) ? 'Y' : 'X'; int pitch = ((val & 0xffc) >> 2) * 128 + 128; unsigned int offset = val & 0xfffff000; if (!IS_965(devid)) return; snprintf(result, len, "%s, %c tile walk, %4d pitch, 0x%08x start", enable, format, pitch, offset); } DEBUGSTRING(i810_debug_965_fence_end) { unsigned int end = val & 0xfffff000; if (!IS_965(devid)) return; snprintf(result, len, " 0x%08x end", end); } #define DEFINEREG(reg) \ { reg, #reg, NULL, 0 } #define DEFINEREG_16BIT(reg) \ { reg, #reg, i830_16bit_func, 0 } #define DEFINEREG2(reg, func) \ { reg, #reg, func, 0 } struct reg_debug { int reg; const char *name; void (*debug_output) (char *result, int len, int reg, uint32_t val); uint32_t val; }; static struct reg_debug intel_debug_regs[] = { DEFINEREG2(DCC, i830_debug_dcc), DEFINEREG2(CHDECMISC, i830_debug_chdecmisc), DEFINEREG_16BIT(C0DRB0), DEFINEREG_16BIT(C0DRB1), DEFINEREG_16BIT(C0DRB2), DEFINEREG_16BIT(C0DRB3), DEFINEREG_16BIT(C1DRB0), DEFINEREG_16BIT(C1DRB1), DEFINEREG_16BIT(C1DRB2), DEFINEREG_16BIT(C1DRB3), DEFINEREG_16BIT(C0DRA01), DEFINEREG_16BIT(C0DRA23), DEFINEREG_16BIT(C1DRA01), DEFINEREG_16BIT(C1DRA23), DEFINEREG(PGETBL_CTL), DEFINEREG2(VCLK_DIVISOR_VGA0, i830_debug_fp), DEFINEREG2(VCLK_DIVISOR_VGA1, i830_debug_fp), DEFINEREG2(VCLK_POST_DIV, i830_debug_vga_pd), DEFINEREG2(DPLL_TEST, i830_debug_dpll_test), DEFINEREG(CACHE_MODE_0), DEFINEREG(D_STATE), DEFINEREG2(DSPCLK_GATE_D, i830_debug_dspclk_gate_d), DEFINEREG(RENCLK_GATE_D1), DEFINEREG(RENCLK_GATE_D2), /* DEFINEREG(RAMCLK_GATE_D), CRL only */ DEFINEREG2(SDVOB, i830_debug_sdvo), DEFINEREG2(SDVOC, i830_debug_sdvo), /* DEFINEREG(UDIB_SVB_SHB_CODES), CRL only */ /* DEFINEREG(UDIB_SHA_BLANK_CODES), CRL only */ DEFINEREG(SDVOUDI), DEFINEREG(DSPARB), DEFINEREG(DSPFW1), DEFINEREG(DSPFW2), DEFINEREG(DSPFW3), DEFINEREG2(ADPA, i830_debug_adpa), DEFINEREG2(LVDS, i830_debug_lvds), DEFINEREG2(DVOA, i830_debug_dvo), DEFINEREG2(DVOB, i830_debug_dvo), DEFINEREG2(DVOC, i830_debug_dvo), DEFINEREG(DVOA_SRCDIM), DEFINEREG(DVOB_SRCDIM), DEFINEREG(DVOC_SRCDIM), DEFINEREG(BLC_PWM_CTL), DEFINEREG(BLC_PWM_CTL2), DEFINEREG2(PP_CONTROL, i830_debug_pp_control), DEFINEREG2(PP_STATUS, i830_debug_pp_status), DEFINEREG(PP_ON_DELAYS), DEFINEREG(PP_OFF_DELAYS), DEFINEREG(PP_DIVISOR), DEFINEREG(PFIT_CONTROL), DEFINEREG(PFIT_PGM_RATIOS), DEFINEREG(PORT_HOTPLUG_EN), DEFINEREG(PORT_HOTPLUG_STAT), DEFINEREG2(DSPACNTR, i830_debug_dspcntr), DEFINEREG2(DSPASTRIDE, i830_debug_dspstride), DEFINEREG2(DSPAPOS, i830_debug_xy), DEFINEREG2(DSPASIZE, i830_debug_xyminus1), DEFINEREG(DSPABASE), DEFINEREG(DSPASURF), DEFINEREG(DSPATILEOFF), DEFINEREG2(PIPEACONF, i830_debug_pipeconf), DEFINEREG2(PIPEASRC, i830_debug_yxminus1), DEFINEREG2(PIPEASTAT, i830_debug_pipestat), DEFINEREG(PIPEA_GMCH_DATA_M), DEFINEREG(PIPEA_GMCH_DATA_N), DEFINEREG(PIPEA_DP_LINK_M), DEFINEREG(PIPEA_DP_LINK_N), DEFINEREG(CURSOR_A_BASE), DEFINEREG(CURSOR_A_CONTROL), DEFINEREG(CURSOR_A_POSITION), DEFINEREG2(FPA0, i830_debug_fp), DEFINEREG2(FPA1, i830_debug_fp), DEFINEREG2(DPLL_A, i830_debug_dpll), DEFINEREG(DPLL_A_MD), DEFINEREG2(HTOTAL_A, i830_debug_hvtotal), DEFINEREG2(HBLANK_A, i830_debug_hvsyncblank), DEFINEREG2(HSYNC_A, i830_debug_hvsyncblank), DEFINEREG2(VTOTAL_A, i830_debug_hvtotal), DEFINEREG2(VBLANK_A, i830_debug_hvsyncblank), DEFINEREG2(VSYNC_A, i830_debug_hvsyncblank), DEFINEREG(BCLRPAT_A), DEFINEREG(VSYNCSHIFT_A), DEFINEREG2(DSPBCNTR, i830_debug_dspcntr), DEFINEREG2(DSPBSTRIDE, i830_debug_dspstride), DEFINEREG2(DSPBPOS, i830_debug_xy), DEFINEREG2(DSPBSIZE, i830_debug_xyminus1), DEFINEREG(DSPBBASE), DEFINEREG(DSPBSURF), DEFINEREG(DSPBTILEOFF), DEFINEREG2(PIPEBCONF, i830_debug_pipeconf), DEFINEREG2(PIPEBSRC, i830_debug_yxminus1), DEFINEREG2(PIPEBSTAT, i830_debug_pipestat), DEFINEREG(PIPEB_GMCH_DATA_M), DEFINEREG(PIPEB_GMCH_DATA_N), DEFINEREG(PIPEB_DP_LINK_M), DEFINEREG(PIPEB_DP_LINK_N), DEFINEREG(CURSOR_B_BASE), DEFINEREG(CURSOR_B_CONTROL), DEFINEREG(CURSOR_B_POSITION), DEFINEREG2(FPB0, i830_debug_fp), DEFINEREG2(FPB1, i830_debug_fp), DEFINEREG2(DPLL_B, i830_debug_dpll), DEFINEREG(DPLL_B_MD), DEFINEREG2(HTOTAL_B, i830_debug_hvtotal), DEFINEREG2(HBLANK_B, i830_debug_hvsyncblank), DEFINEREG2(HSYNC_B, i830_debug_hvsyncblank), DEFINEREG2(VTOTAL_B, i830_debug_hvtotal), DEFINEREG2(VBLANK_B, i830_debug_hvsyncblank), DEFINEREG2(VSYNC_B, i830_debug_hvsyncblank), DEFINEREG(BCLRPAT_B), DEFINEREG(VSYNCSHIFT_B), DEFINEREG(VCLK_DIVISOR_VGA0), DEFINEREG(VCLK_DIVISOR_VGA1), DEFINEREG(VCLK_POST_DIV), DEFINEREG2(VGACNTRL, i830_debug_vgacntrl), DEFINEREG(TV_CTL), DEFINEREG(TV_DAC), DEFINEREG(TV_CSC_Y), DEFINEREG(TV_CSC_Y2), DEFINEREG(TV_CSC_U), DEFINEREG(TV_CSC_U2), DEFINEREG(TV_CSC_V), DEFINEREG(TV_CSC_V2), DEFINEREG(TV_CLR_KNOBS), DEFINEREG(TV_CLR_LEVEL), DEFINEREG(TV_H_CTL_1), DEFINEREG(TV_H_CTL_2), DEFINEREG(TV_H_CTL_3), DEFINEREG(TV_V_CTL_1), DEFINEREG(TV_V_CTL_2), DEFINEREG(TV_V_CTL_3), DEFINEREG(TV_V_CTL_4), DEFINEREG(TV_V_CTL_5), DEFINEREG(TV_V_CTL_6), DEFINEREG(TV_V_CTL_7), DEFINEREG(TV_SC_CTL_1), DEFINEREG(TV_SC_CTL_2), DEFINEREG(TV_SC_CTL_3), DEFINEREG(TV_WIN_POS), DEFINEREG(TV_WIN_SIZE), DEFINEREG(TV_FILTER_CTL_1), DEFINEREG(TV_FILTER_CTL_2), DEFINEREG(TV_FILTER_CTL_3), DEFINEREG(TV_CC_CONTROL), DEFINEREG(TV_CC_DATA), DEFINEREG(TV_H_LUMA_0), DEFINEREG(TV_H_LUMA_59), DEFINEREG(TV_H_CHROMA_0), DEFINEREG(TV_H_CHROMA_59), DEFINEREG(FBC_CFB_BASE), DEFINEREG(FBC_LL_BASE), DEFINEREG(FBC_CONTROL), DEFINEREG(FBC_COMMAND), DEFINEREG(FBC_STATUS), DEFINEREG(FBC_CONTROL2), DEFINEREG(FBC_FENCE_OFF), DEFINEREG(FBC_MOD_NUM), DEFINEREG(MI_MODE), /* DEFINEREG(MI_DISPLAY_POWER_DOWN), CRL only */ DEFINEREG(MI_ARB_STATE), DEFINEREG(MI_RDRET_STATE), DEFINEREG(ECOSKPD), DEFINEREG(DP_B), DEFINEREG(DPB_AUX_CH_CTL), DEFINEREG(DPB_AUX_CH_DATA1), DEFINEREG(DPB_AUX_CH_DATA2), DEFINEREG(DPB_AUX_CH_DATA3), DEFINEREG(DPB_AUX_CH_DATA4), DEFINEREG(DPB_AUX_CH_DATA5), DEFINEREG(DP_C), DEFINEREG(DPC_AUX_CH_CTL), DEFINEREG(DPC_AUX_CH_DATA1), DEFINEREG(DPC_AUX_CH_DATA2), DEFINEREG(DPC_AUX_CH_DATA3), DEFINEREG(DPC_AUX_CH_DATA4), DEFINEREG(DPC_AUX_CH_DATA5), DEFINEREG(DP_D), DEFINEREG(DPD_AUX_CH_CTL), DEFINEREG(DPD_AUX_CH_DATA1), DEFINEREG(DPD_AUX_CH_DATA2), DEFINEREG(DPD_AUX_CH_DATA3), DEFINEREG(DPD_AUX_CH_DATA4), DEFINEREG(DPD_AUX_CH_DATA5), DEFINEREG(AUD_CONFIG), DEFINEREG(AUD_HDMIW_STATUS), DEFINEREG(AUD_CONV_CHCNT), DEFINEREG(VIDEO_DIP_CTL), DEFINEREG(AUD_PINW_CNTR), DEFINEREG(AUD_CNTL_ST), DEFINEREG(AUD_PIN_CAP), DEFINEREG(AUD_PINW_CAP), DEFINEREG(AUD_PINW_UNSOLRESP), DEFINEREG(AUD_OUT_DIG_CNVT), DEFINEREG(AUD_OUT_CWCAP), DEFINEREG(AUD_GRP_CAP), #define DEFINEFENCE_915(i) \ { FENCE+i*4, "FENCE " #i, i810_debug_915_fence, 0 } #define DEFINEFENCE_945(i) \ { FENCE_NEW+(i - 8) * 4, "FENCE " #i, i810_debug_915_fence, 0 } DEFINEFENCE_915(0), DEFINEFENCE_915(1), DEFINEFENCE_915(2), DEFINEFENCE_915(3), DEFINEFENCE_915(4), DEFINEFENCE_915(5), DEFINEFENCE_915(6), DEFINEFENCE_915(7), DEFINEFENCE_945(8), DEFINEFENCE_945(9), DEFINEFENCE_945(10), DEFINEFENCE_945(11), DEFINEFENCE_945(12), DEFINEFENCE_945(13), DEFINEFENCE_945(14), DEFINEFENCE_945(15), #define DEFINEFENCE_965(i) \ { FENCE_NEW+i*8, "FENCE START " #i, i810_debug_965_fence_start, 0 }, \ { FENCE_NEW+i*8+4, "FENCE END " #i, i810_debug_965_fence_end, 0 } DEFINEFENCE_965(0), DEFINEFENCE_965(1), DEFINEFENCE_965(2), DEFINEFENCE_965(3), DEFINEFENCE_965(4), DEFINEFENCE_965(5), DEFINEFENCE_965(6), DEFINEFENCE_965(7), DEFINEFENCE_965(8), DEFINEFENCE_965(9), DEFINEFENCE_965(10), DEFINEFENCE_965(11), DEFINEFENCE_965(12), DEFINEFENCE_965(13), DEFINEFENCE_965(14), DEFINEFENCE_965(15), DEFINEREG(INST_PM), }; DEBUGSTRING(ironlake_debug_rr_hw_ctl) { snprintf(result, len, "low %d, high %d", val & RR_HW_LOW_POWER_FRAMES_MASK, (val & RR_HW_HIGH_POWER_FRAMES_MASK) >> 8); } DEBUGSTRING(ironlake_debug_m_tu) { snprintf(result, len, "TU %d, val 0x%x %d", (val >> 25) + 1, val & 0xffffff, val & 0xffffff); } DEBUGSTRING(ironlake_debug_n) { snprintf(result, len, "val 0x%x %d", val & 0xffffff, val & 0xffffff); } DEBUGSTRING(ironlake_debug_fdi_tx_ctl) { const char *train = NULL, *voltage = NULL, *pre_emphasis = NULL, *portw = NULL; switch (val & FDI_LINK_TRAIN_NONE) { case FDI_LINK_TRAIN_PATTERN_1: train = "pattern_1"; break; case FDI_LINK_TRAIN_PATTERN_2: train = "pattern_2"; break; case FDI_LINK_TRAIN_PATTERN_IDLE: train = "pattern_idle"; break; case FDI_LINK_TRAIN_NONE: train = "not train"; break; } if (HAS_CPT) { /* SNB B0 */ switch (val & (0x3f << 22)) { case FDI_LINK_TRAIN_400MV_0DB_SNB_B: voltage = "0.4V"; pre_emphasis = "0dB"; break; case FDI_LINK_TRAIN_400MV_6DB_SNB_B: voltage = "0.4V"; pre_emphasis = "6dB"; break; case FDI_LINK_TRAIN_600MV_3_5DB_SNB_B: voltage = "0.6V"; pre_emphasis = "3.5dB"; break; case FDI_LINK_TRAIN_800MV_0DB_SNB_B: voltage = "0.8V"; pre_emphasis = "0dB"; break; } } else { switch (val & (7 << 25)) { case FDI_LINK_TRAIN_VOLTAGE_0_4V: voltage = "0.4V"; break; case FDI_LINK_TRAIN_VOLTAGE_0_6V: voltage = "0.6V"; break; case FDI_LINK_TRAIN_VOLTAGE_0_8V: voltage = "0.8V"; break; case FDI_LINK_TRAIN_VOLTAGE_1_2V: voltage = "1.2V"; break; default: voltage = "reserved"; } switch (val & (7 << 22)) { case FDI_LINK_TRAIN_PRE_EMPHASIS_NONE: pre_emphasis = "none"; break; case FDI_LINK_TRAIN_PRE_EMPHASIS_1_5X: pre_emphasis = "1.5x"; break; case FDI_LINK_TRAIN_PRE_EMPHASIS_2X: pre_emphasis = "2x"; break; case FDI_LINK_TRAIN_PRE_EMPHASIS_3X: pre_emphasis = "3x"; break; default: pre_emphasis = "reserved"; } } switch (val & (7 << 19)) { case FDI_DP_PORT_WIDTH_X1: portw = "X1"; break; case FDI_DP_PORT_WIDTH_X2: portw = "X2"; break; case FDI_DP_PORT_WIDTH_X3: portw = "X3"; break; case FDI_DP_PORT_WIDTH_X4: portw = "X4"; break; } snprintf(result, len, "%s, train pattern %s, voltage swing %s," "pre-emphasis %s, port width %s, enhanced framing %s, FDI PLL %s, scrambing %s, master mode %s", val & FDI_TX_ENABLE ? "enable" : "disable", train, voltage, pre_emphasis, portw, val & FDI_TX_ENHANCE_FRAME_ENABLE ? "enable" : "disable", val & FDI_TX_PLL_ENABLE ? "enable" : "disable", val & (1 << 7) ? "disable" : "enable", val & (1 << 0) ? "enable" : "disable"); } DEBUGSTRING(ironlake_debug_fdi_rx_ctl) { const char *train = NULL, *portw = NULL, *bpc = NULL; if (HAS_CPT) { switch (val & FDI_LINK_TRAIN_PATTERN_MASK_CPT) { case FDI_LINK_TRAIN_PATTERN_1_CPT: train = "pattern_1"; break; case FDI_LINK_TRAIN_PATTERN_2_CPT: train = "pattern_2"; break; case FDI_LINK_TRAIN_PATTERN_IDLE_CPT: train = "pattern_idle"; break; case FDI_LINK_TRAIN_NORMAL_CPT: train = "not train"; break; } } else { switch (val & FDI_LINK_TRAIN_NONE) { case FDI_LINK_TRAIN_PATTERN_1: train = "pattern_1"; break; case FDI_LINK_TRAIN_PATTERN_2: train = "pattern_2"; break; case FDI_LINK_TRAIN_PATTERN_IDLE: train = "pattern_idle"; break; case FDI_LINK_TRAIN_NONE: train = "not train"; break; } } switch (val & (7 << 19)) { case FDI_DP_PORT_WIDTH_X1: portw = "X1"; break; case FDI_DP_PORT_WIDTH_X2: portw = "X2"; break; case FDI_DP_PORT_WIDTH_X3: portw = "X3"; break; case FDI_DP_PORT_WIDTH_X4: portw = "X4"; break; } switch (val & (7 << 16)) { case FDI_8BPC: bpc = "8bpc"; break; case FDI_10BPC: bpc = "10bpc"; break; case FDI_6BPC: bpc = "6bpc"; break; case FDI_12BPC: bpc = "12bpc"; break; } snprintf(result, len, "%s, train pattern %s, port width %s, %s," "link_reverse_strap_overwrite %s, dmi_link_reverse %s, FDI PLL %s," "FS ecc %s, FE ecc %s, FS err report %s, FE err report %s," "scrambing %s, enhanced framing %s, %s", val & FDI_RX_ENABLE ? "enable" : "disable", train, portw, bpc, val & FDI_LINK_REVERSE_OVERWRITE ? "yes" : "no", val & FDI_DMI_LINK_REVERSE_MASK ? "yes" : "no", val & FDI_RX_PLL_ENABLE ? "enable" : "disable", val & FDI_FS_ERR_CORRECT_ENABLE ? "enable" : "disable", val & FDI_FE_ERR_CORRECT_ENABLE ? "enable" : "disable", val & FDI_FS_ERR_REPORT_ENABLE ? "enable" : "disable", val & FDI_FE_ERR_REPORT_ENABLE ? "enable" : "disable", val & (1 << 7) ? "disable" : "enable", val & FDI_RX_ENHANCE_FRAME_ENABLE ? "enable" : "disable", val & FDI_SEL_PCDCLK ? "PCDClk" : "RawClk"); } DEBUGSTRING(ironlake_debug_dspstride) { snprintf(result, len, "%d", val >> 6); } DEBUGSTRING(ironlake_debug_pch_dpll) { const char *enable = val & DPLL_VCO_ENABLE ? "enable" : "disable"; const char *highspeed = val & DPLL_DVO_HIGH_SPEED ? "yes" : "no"; const char *mode = NULL; const char *p2 = NULL; int fpa0_p1, fpa1_p1; const char *refclk = NULL; int sdvo_mul; if ((val & DPLLB_MODE_LVDS) == DPLLB_MODE_LVDS) { mode = "LVDS"; if (val & DPLLB_LVDS_P2_CLOCK_DIV_7) p2 = "Div 7"; else p2 = "Div 14"; } else if ((val & DPLLB_MODE_LVDS) == DPLLB_MODE_DAC_SERIAL) { mode = "Non-LVDS"; if (val & DPLL_DAC_SERIAL_P2_CLOCK_DIV_5) p2 = "Div 5"; else p2 = "Div 10"; } fpa0_p1 = ffs((val & DPLL_FPA01_P1_POST_DIV_MASK) >> 16); fpa1_p1 = ffs((val & DPLL_FPA1_P1_POST_DIV_MASK)); switch (val & PLL_REF_INPUT_MASK) { case PLL_REF_INPUT_DREFCLK: refclk = "default 120Mhz"; break; case PLL_REF_INPUT_SUPER_SSC: refclk = "SuperSSC 120Mhz"; break; case PLL_REF_INPUT_TVCLKINBC: refclk = "SDVO TVClkIn"; break; case PLLB_REF_INPUT_SPREADSPECTRUMIN: refclk = "SSC"; break; case PLL_REF_INPUT_DMICLK: refclk = "DMI RefCLK"; break; } sdvo_mul = ((val & PLL_REF_SDVO_HDMI_MULTIPLIER_MASK) >> 9) + 1; snprintf(result, len, "%s, sdvo high speed %s, mode %s, p2 %s, " "FPA0 P1 %d, FPA1 P1 %d, refclk %s, sdvo/hdmi mul %d", enable, highspeed, mode, p2, fpa0_p1, fpa1_p1, refclk, sdvo_mul); } DEBUGSTRING(ironlake_debug_dref_ctl) { const char *cpu_source; const char *ssc_source = val & DREF_SSC_SOURCE_ENABLE ? "enable" : "disable"; const char *nonspread_source = val & DREF_NONSPREAD_SOURCE_ENABLE ? "enable" : "disable"; const char *superspread_source = val & DREF_SUPERSPREAD_SOURCE_ENABLE ? "enable" : "disable"; const char *ssc4_mode = val & DREF_SSC4_CENTERSPREAD ? "centerspread" : "downspread"; const char *ssc1 = val & DREF_SSC1_ENABLE ? "enable" : "disable"; const char *ssc4 = val & DREF_SSC4_ENABLE ? "enable" : "disable"; switch (val & DREF_CPU_SOURCE_OUTPUT_NONSPREAD) { case DREF_CPU_SOURCE_OUTPUT_DISABLE: cpu_source = "disable"; break; case DREF_CPU_SOURCE_OUTPUT_DOWNSPREAD: cpu_source = "downspread"; break; case DREF_CPU_SOURCE_OUTPUT_NONSPREAD: cpu_source = "nonspread"; break; default: cpu_source = "reserved"; } snprintf(result, len, "cpu source %s, ssc_source %s, nonspread_source %s, " "superspread_source %s, ssc4_mode %s, ssc1 %s, ssc4 %s", cpu_source, ssc_source, nonspread_source, superspread_source, ssc4_mode, ssc1, ssc4); } DEBUGSTRING(ironlake_debug_rawclk_freq) { const char *tp1 = NULL, *tp2 = NULL; switch (val & FDL_TP1_TIMER_MASK) { case 0: tp1 = "0.5us"; break; case (1 << 12): tp1 = "1.0us"; break; case (2 << 12): tp1 = "2.0us"; break; case (3 << 12): tp1 = "4.0us"; break; } switch (val & FDL_TP2_TIMER_MASK) { case 0: tp2 = "1.5us"; break; case (1 << 10): tp2 = "3.0us"; break; case (2 << 10): tp2 = "6.0us"; break; case (3 << 10): tp2 = "12.0us"; break; } snprintf(result, len, "FDL_TP1 timer %s, FDL_TP2 timer %s, freq %d", tp1, tp2, val & RAWCLK_FREQ_MASK); } DEBUGSTRING(ironlake_debug_fdi_rx_misc) { snprintf(result, len, "FDI Delay %d", val & ((1 << 13) - 1)); } DEBUGSTRING(ironlake_debug_transconf) { const char *enable = val & TRANS_ENABLE ? "enable" : "disable"; const char *state = val & TRANS_STATE_ENABLE ? "active" : "inactive"; const char *interlace; switch ((val >> 21) & 7) { case 0: interlace = "progressive"; break; case 2: if (IS_GEN5(devid)) interlace = "interlaced sdvo"; else interlace = "rsvd"; break; case 3: interlace = "interlaced"; break; default: interlace = "rsvd"; } snprintf(result, len, "%s, %s, %s", enable, state, interlace); } DEBUGSTRING(ironlake_debug_panel_fitting) { const char *vadapt = NULL, *filter_sel = NULL; switch (val & (3 << 25)) { case 0: vadapt = "least"; break; case (1 << 25): vadapt = "moderate"; break; case (2 << 25): vadapt = "reserved"; break; case (3 << 25): vadapt = "most"; break; } switch (val & (3 << 23)) { case 0: filter_sel = "programmed"; break; case (1 << 23): filter_sel = "hardcoded"; break; case (2 << 23): filter_sel = "edge_enhance"; break; case (3 << 23): filter_sel = "edge_soften"; break; } snprintf(result, len, "%s, auto_scale %s, auto_scale_cal %s, v_filter %s, vadapt %s, mode %s, filter_sel %s," "chroma pre-filter %s, vert3tap %s, v_inter_invert %s", val & PF_ENABLE ? "enable" : "disable", val & (1 << 30) ? "no" : "yes", val & (1 << 29) ? "yes" : "no", val & (1 << 28) ? "bypass" : "enable", val & (1 << 27) ? "enable" : "disable", vadapt, filter_sel, val & (1 << 22) ? "enable" : "disable", val & (1 << 21) ? "force" : "auto", val & (1 << 20) ? "field 0" : "field 1"); } DEBUGSTRING(ironlake_debug_panel_fitting_2) { snprintf(result, len, "vscale %f", val / (float) (1<<15)); } DEBUGSTRING(ironlake_debug_panel_fitting_3) { snprintf(result, len, "vscale initial phase %f", val / (float) (1<<15)); } DEBUGSTRING(ironlake_debug_panel_fitting_4) { snprintf(result, len, "hscale %f", val / (float) (1<<15)); } DEBUGSTRING(ironlake_debug_pf_win) { int a, b; a = (val >> 16) & 0x1fff; b = val & 0xfff; snprintf(result, len, "%d, %d", a, b); } DEBUGSTRING(ironlake_debug_hdmi) { int disp_pipe; const char *enable, *bpc = NULL, *encoding; const char *mode, *audio, *vsync, *hsync, *detect; if (val & PORT_ENABLE) enable = "enabled"; else enable = "disabled"; if (HAS_CPT) disp_pipe = (val & (3<<29)) >> 29; else disp_pipe = (val & TRANSCODER_B) >> 29; switch (val & (7 << 26)) { case COLOR_FORMAT_8bpc: bpc = "8bpc"; break; case COLOR_FORMAT_12bpc: bpc = "12bpc"; break; } if ((val & (3 << 10)) == TMDS_ENCODING) encoding = "TMDS"; else encoding = "SDVO"; if (val & (1 << 9)) mode = "HDMI"; else mode = "DVI"; if (val & AUDIO_ENABLE) audio = "enabled"; else audio = "disabled"; if (val & VSYNC_ACTIVE_HIGH) vsync = "+vsync"; else vsync = "-vsync"; if (val & HSYNC_ACTIVE_HIGH) hsync = "+hsync"; else hsync = "-hsync"; if (val & PORT_DETECTED) detect = "detected"; else detect = "non-detected"; snprintf(result, len, "%s pipe %c %s %s %s audio %s %s %s %s", enable, disp_pipe + 'A', bpc, encoding, mode, audio, vsync, hsync, detect); } DEBUGSTRING(snb_debug_dpll_sel) { const char *transa, *transb; const char *dplla = NULL, *dpllb = NULL; if (!HAS_CPT) return; if (val & TRANSA_DPLL_ENABLE) { transa = "enable"; if (val & TRANSA_DPLLB_SEL) dplla = "B"; else dplla = "A"; } else transa = "disable"; if (val & TRANSB_DPLL_ENABLE) { transb = "enable"; if (val & TRANSB_DPLLB_SEL) dpllb = "B"; else dpllb = "A"; } else transb = "disable"; snprintf(result, len, "TransA DPLL %s (DPLL %s), TransB DPLL %s (DPLL %s)", transa, dplla, transb, dpllb); } DEBUGSTRING(snb_debug_trans_dp_ctl) { const char *enable, *port = NULL, *bpc = NULL, *vsync, *hsync; if (!HAS_CPT) return; if (val & TRANS_DP_OUTPUT_ENABLE) enable = "enable"; else enable = "disable"; switch (val & TRANS_DP_PORT_SEL_MASK) { case TRANS_DP_PORT_SEL_B: port = "B"; break; case TRANS_DP_PORT_SEL_C: port = "C"; break; case TRANS_DP_PORT_SEL_D: port = "D"; break; default: port = "none"; break; } switch (val & (7<<9)) { case TRANS_DP_8BPC: bpc = "8bpc"; break; case TRANS_DP_10BPC: bpc = "10bpc"; break; case TRANS_DP_6BPC: bpc = "6bpc"; break; case TRANS_DP_12BPC: bpc = "12bpc"; break; } if (val & TRANS_DP_VSYNC_ACTIVE_HIGH) vsync = "+vsync"; else vsync = "-vsync"; if (val & TRANS_DP_HSYNC_ACTIVE_HIGH) hsync = "+hsync"; else hsync = "-hsync"; snprintf(result, len, "%s port %s %s %s %s", enable, port, bpc, vsync, hsync); } DEBUGSTRING(ilk_debug_pp_control) { snprintf(result, len, "blacklight %s, %spower down on reset, panel %s", (val & (1 << 2)) ? "enabled" : "disabled", (val & (1 << 1)) ? "" : "do not ", (val & (1 << 0)) ? "on" : "off"); } static struct reg_debug ironlake_debug_regs[] = { DEFINEREG(PGETBL_CTL), DEFINEREG(GEN6_INSTDONE_1), DEFINEREG(GEN6_INSTDONE_2), DEFINEREG2(CPU_VGACNTRL, i830_debug_vgacntrl), DEFINEREG(DIGITAL_PORT_HOTPLUG_CNTRL), DEFINEREG2(RR_HW_CTL, ironlake_debug_rr_hw_ctl), DEFINEREG(FDI_PLL_BIOS_0), DEFINEREG(FDI_PLL_BIOS_1), DEFINEREG(FDI_PLL_BIOS_2), DEFINEREG(DISPLAY_PORT_PLL_BIOS_0), DEFINEREG(DISPLAY_PORT_PLL_BIOS_1), DEFINEREG(DISPLAY_PORT_PLL_BIOS_2), DEFINEREG(FDI_PLL_FREQ_CTL), /* pipe B */ DEFINEREG2(PIPEACONF, i830_debug_pipeconf), DEFINEREG2(HTOTAL_A, i830_debug_hvtotal), DEFINEREG2(HBLANK_A, i830_debug_hvsyncblank), DEFINEREG2(HSYNC_A, i830_debug_hvsyncblank), DEFINEREG2(VTOTAL_A, i830_debug_hvtotal), DEFINEREG2(VBLANK_A, i830_debug_hvsyncblank), DEFINEREG2(VSYNC_A, i830_debug_hvsyncblank), DEFINEREG(VSYNCSHIFT_A), DEFINEREG2(PIPEASRC, i830_debug_yxminus1), DEFINEREG2(PIPEA_DATA_M1, ironlake_debug_m_tu), DEFINEREG2(PIPEA_DATA_N1, ironlake_debug_n), DEFINEREG2(PIPEA_DATA_M2, ironlake_debug_m_tu), DEFINEREG2(PIPEA_DATA_N2, ironlake_debug_n), DEFINEREG2(PIPEA_LINK_M1, ironlake_debug_n), DEFINEREG2(PIPEA_LINK_N1, ironlake_debug_n), DEFINEREG2(PIPEA_LINK_M2, ironlake_debug_n), DEFINEREG2(PIPEA_LINK_N2, ironlake_debug_n), DEFINEREG2(DSPACNTR, i830_debug_dspcntr), DEFINEREG(DSPABASE), DEFINEREG2(DSPASTRIDE, ironlake_debug_dspstride), DEFINEREG(DSPASURF), DEFINEREG2(DSPATILEOFF, i830_debug_xy), /* pipe B */ DEFINEREG2(PIPEBCONF, i830_debug_pipeconf), DEFINEREG2(HTOTAL_B, i830_debug_hvtotal), DEFINEREG2(HBLANK_B, i830_debug_hvsyncblank), DEFINEREG2(HSYNC_B, i830_debug_hvsyncblank), DEFINEREG2(VTOTAL_B, i830_debug_hvtotal), DEFINEREG2(VBLANK_B, i830_debug_hvsyncblank), DEFINEREG2(VSYNC_B, i830_debug_hvsyncblank), DEFINEREG(VSYNCSHIFT_B), DEFINEREG2(PIPEBSRC, i830_debug_yxminus1), DEFINEREG2(PIPEB_DATA_M1, ironlake_debug_m_tu), DEFINEREG2(PIPEB_DATA_N1, ironlake_debug_n), DEFINEREG2(PIPEB_DATA_M2, ironlake_debug_m_tu), DEFINEREG2(PIPEB_DATA_N2, ironlake_debug_n), DEFINEREG2(PIPEB_LINK_M1, ironlake_debug_n), DEFINEREG2(PIPEB_LINK_N1, ironlake_debug_n), DEFINEREG2(PIPEB_LINK_M2, ironlake_debug_n), DEFINEREG2(PIPEB_LINK_N2, ironlake_debug_n), DEFINEREG2(DSPBCNTR, i830_debug_dspcntr), DEFINEREG(DSPBBASE), DEFINEREG2(DSPBSTRIDE, ironlake_debug_dspstride), DEFINEREG(DSPBSURF), DEFINEREG2(DSPBTILEOFF, i830_debug_xy), /* pipe C */ DEFINEREG2(PIPECCONF, i830_debug_pipeconf), DEFINEREG2(HTOTAL_C, i830_debug_hvtotal), DEFINEREG2(HBLANK_C, i830_debug_hvsyncblank), DEFINEREG2(HSYNC_C, i830_debug_hvsyncblank), DEFINEREG2(VTOTAL_C, i830_debug_hvtotal), DEFINEREG2(VBLANK_C, i830_debug_hvsyncblank), DEFINEREG2(VSYNC_C, i830_debug_hvsyncblank), DEFINEREG(VSYNCSHIFT_C), DEFINEREG2(PIPECSRC, i830_debug_yxminus1), DEFINEREG2(PIPEC_DATA_M1, ironlake_debug_m_tu), DEFINEREG2(PIPEC_DATA_N1, ironlake_debug_n), DEFINEREG2(PIPEC_DATA_M2, ironlake_debug_m_tu), DEFINEREG2(PIPEC_DATA_N2, ironlake_debug_n), DEFINEREG2(PIPEC_LINK_M1, ironlake_debug_n), DEFINEREG2(PIPEC_LINK_N1, ironlake_debug_n), DEFINEREG2(PIPEC_LINK_M2, ironlake_debug_n), DEFINEREG2(PIPEC_LINK_N2, ironlake_debug_n), DEFINEREG2(DSPCCNTR, i830_debug_dspcntr), DEFINEREG(DSPCBASE), DEFINEREG2(DSPCSTRIDE, ironlake_debug_dspstride), DEFINEREG(DSPCSURF), DEFINEREG2(DSPCTILEOFF, i830_debug_xy), /* Panel fitter */ DEFINEREG2(PFA_CTL_1, ironlake_debug_panel_fitting), DEFINEREG2(PFA_CTL_2, ironlake_debug_panel_fitting_2), DEFINEREG2(PFA_CTL_3, ironlake_debug_panel_fitting_3), DEFINEREG2(PFA_CTL_4, ironlake_debug_panel_fitting_4), DEFINEREG2(PFA_WIN_POS, ironlake_debug_pf_win), DEFINEREG2(PFA_WIN_SIZE, ironlake_debug_pf_win), DEFINEREG2(PFB_CTL_1, ironlake_debug_panel_fitting), DEFINEREG2(PFB_CTL_2, ironlake_debug_panel_fitting_2), DEFINEREG2(PFB_CTL_3, ironlake_debug_panel_fitting_3), DEFINEREG2(PFB_CTL_4, ironlake_debug_panel_fitting_4), DEFINEREG2(PFB_WIN_POS, ironlake_debug_pf_win), DEFINEREG2(PFB_WIN_SIZE, ironlake_debug_pf_win), DEFINEREG2(PFC_CTL_1, ironlake_debug_panel_fitting), DEFINEREG2(PFC_CTL_2, ironlake_debug_panel_fitting_2), DEFINEREG2(PFC_CTL_3, ironlake_debug_panel_fitting_3), DEFINEREG2(PFC_CTL_4, ironlake_debug_panel_fitting_4), DEFINEREG2(PFC_WIN_POS, ironlake_debug_pf_win), DEFINEREG2(PFC_WIN_SIZE, ironlake_debug_pf_win), /* PCH */ DEFINEREG2(PCH_DREF_CONTROL, ironlake_debug_dref_ctl), DEFINEREG2(PCH_RAWCLK_FREQ, ironlake_debug_rawclk_freq), DEFINEREG(PCH_DPLL_TMR_CFG), DEFINEREG(PCH_SSC4_PARMS), DEFINEREG(PCH_SSC4_AUX_PARMS), DEFINEREG2(PCH_DPLL_SEL, snb_debug_dpll_sel), DEFINEREG(PCH_DPLL_ANALOG_CTL), DEFINEREG2(PCH_DPLL_A, ironlake_debug_pch_dpll), DEFINEREG2(PCH_DPLL_B, ironlake_debug_pch_dpll), DEFINEREG2(PCH_FPA0, i830_debug_fp), DEFINEREG2(PCH_FPA1, i830_debug_fp), DEFINEREG2(PCH_FPB0, i830_debug_fp), DEFINEREG2(PCH_FPB1, i830_debug_fp), DEFINEREG2(TRANS_HTOTAL_A, i830_debug_hvtotal), DEFINEREG2(TRANS_HBLANK_A, i830_debug_hvsyncblank), DEFINEREG2(TRANS_HSYNC_A, i830_debug_hvsyncblank), DEFINEREG2(TRANS_VTOTAL_A, i830_debug_hvtotal), DEFINEREG2(TRANS_VBLANK_A, i830_debug_hvsyncblank), DEFINEREG2(TRANS_VSYNC_A, i830_debug_hvsyncblank), DEFINEREG(TRANS_VSYNCSHIFT_A), DEFINEREG2(TRANSA_DATA_M1, ironlake_debug_m_tu), DEFINEREG2(TRANSA_DATA_N1, ironlake_debug_n), DEFINEREG2(TRANSA_DATA_M2, ironlake_debug_m_tu), DEFINEREG2(TRANSA_DATA_N2, ironlake_debug_n), DEFINEREG2(TRANSA_DP_LINK_M1, ironlake_debug_n), DEFINEREG2(TRANSA_DP_LINK_N1, ironlake_debug_n), DEFINEREG2(TRANSA_DP_LINK_M2, ironlake_debug_n), DEFINEREG2(TRANSA_DP_LINK_N2, ironlake_debug_n), DEFINEREG2(TRANS_HTOTAL_B, i830_debug_hvtotal), DEFINEREG2(TRANS_HBLANK_B, i830_debug_hvsyncblank), DEFINEREG2(TRANS_HSYNC_B, i830_debug_hvsyncblank), DEFINEREG2(TRANS_VTOTAL_B, i830_debug_hvtotal), DEFINEREG2(TRANS_VBLANK_B, i830_debug_hvsyncblank), DEFINEREG2(TRANS_VSYNC_B, i830_debug_hvsyncblank), DEFINEREG(TRANS_VSYNCSHIFT_B), DEFINEREG2(TRANSB_DATA_M1, ironlake_debug_m_tu), DEFINEREG2(TRANSB_DATA_N1, ironlake_debug_n), DEFINEREG2(TRANSB_DATA_M2, ironlake_debug_m_tu), DEFINEREG2(TRANSB_DATA_N2, ironlake_debug_n), DEFINEREG2(TRANSB_DP_LINK_M1, ironlake_debug_n), DEFINEREG2(TRANSB_DP_LINK_N1, ironlake_debug_n), DEFINEREG2(TRANSB_DP_LINK_M2, ironlake_debug_n), DEFINEREG2(TRANSB_DP_LINK_N2, ironlake_debug_n), DEFINEREG2(TRANS_HTOTAL_C, i830_debug_hvtotal), DEFINEREG2(TRANS_HBLANK_C, i830_debug_hvsyncblank), DEFINEREG2(TRANS_HSYNC_C, i830_debug_hvsyncblank), DEFINEREG2(TRANS_VTOTAL_C, i830_debug_hvtotal), DEFINEREG2(TRANS_VBLANK_C, i830_debug_hvsyncblank), DEFINEREG2(TRANS_VSYNC_C, i830_debug_hvsyncblank), DEFINEREG(TRANS_VSYNCSHIFT_C), DEFINEREG2(TRANSC_DATA_M1, ironlake_debug_m_tu), DEFINEREG2(TRANSC_DATA_N1, ironlake_debug_n), DEFINEREG2(TRANSC_DATA_M2, ironlake_debug_m_tu), DEFINEREG2(TRANSC_DATA_N2, ironlake_debug_n), DEFINEREG2(TRANSC_DP_LINK_M1, ironlake_debug_n), DEFINEREG2(TRANSC_DP_LINK_N1, ironlake_debug_n), DEFINEREG2(TRANSC_DP_LINK_M2, ironlake_debug_n), DEFINEREG2(TRANSC_DP_LINK_N2, ironlake_debug_n), DEFINEREG2(TRANSACONF, ironlake_debug_transconf), DEFINEREG2(TRANSBCONF, ironlake_debug_transconf), DEFINEREG2(TRANSCCONF, ironlake_debug_transconf), DEFINEREG2(FDI_TXA_CTL, ironlake_debug_fdi_tx_ctl), DEFINEREG2(FDI_TXB_CTL, ironlake_debug_fdi_tx_ctl), DEFINEREG2(FDI_TXC_CTL, ironlake_debug_fdi_tx_ctl), DEFINEREG2(FDI_RXA_CTL, ironlake_debug_fdi_rx_ctl), DEFINEREG2(FDI_RXB_CTL, ironlake_debug_fdi_rx_ctl), DEFINEREG2(FDI_RXC_CTL, ironlake_debug_fdi_rx_ctl), DEFINEREG2(FDI_RXA_MISC, ironlake_debug_fdi_rx_misc), DEFINEREG2(FDI_RXB_MISC, ironlake_debug_fdi_rx_misc), DEFINEREG2(FDI_RXC_MISC, ironlake_debug_fdi_rx_misc), DEFINEREG(FDI_RXA_TUSIZE1), DEFINEREG(FDI_RXA_TUSIZE2), DEFINEREG(FDI_RXB_TUSIZE1), DEFINEREG(FDI_RXB_TUSIZE2), DEFINEREG(FDI_RXC_TUSIZE1), DEFINEREG(FDI_RXC_TUSIZE2), DEFINEREG(FDI_PLL_CTL_1), DEFINEREG(FDI_PLL_CTL_2), DEFINEREG(FDI_RXA_IIR), DEFINEREG(FDI_RXA_IMR), DEFINEREG(FDI_RXB_IIR), DEFINEREG(FDI_RXB_IMR), DEFINEREG2(PCH_ADPA, i830_debug_adpa), DEFINEREG2(HDMIB, ironlake_debug_hdmi), DEFINEREG2(HDMIC, ironlake_debug_hdmi), DEFINEREG2(HDMID, ironlake_debug_hdmi), DEFINEREG2(PCH_LVDS, i830_debug_lvds), DEFINEREG(CPU_eDP_A), DEFINEREG(PCH_DP_B), DEFINEREG(PCH_DP_C), DEFINEREG(PCH_DP_D), DEFINEREG2(TRANS_DP_CTL_A, snb_debug_trans_dp_ctl), DEFINEREG2(TRANS_DP_CTL_B, snb_debug_trans_dp_ctl), DEFINEREG2(TRANS_DP_CTL_C, snb_debug_trans_dp_ctl), DEFINEREG(BLC_PWM_CPU_CTL2), DEFINEREG(BLC_PWM_CPU_CTL), DEFINEREG(BLC_PWM_PCH_CTL1), DEFINEREG(BLC_PWM_PCH_CTL2), DEFINEREG2(PCH_PP_STATUS, i830_debug_pp_status), DEFINEREG2(PCH_PP_CONTROL, ilk_debug_pp_control), DEFINEREG(PCH_PP_ON_DELAYS), DEFINEREG(PCH_PP_OFF_DELAYS), DEFINEREG(PCH_PP_DIVISOR), DEFINEREG2(PORT_DBG, ivb_debug_port), DEFINEREG(RC6_RESIDENCY_TIME), DEFINEREG(RC6p_RESIDENCY_TIME), DEFINEREG(RC6pp_RESIDENCY_TIME), }; static struct reg_debug haswell_debug_regs[] = { /* Power wells */ DEFINEREG(HSW_PWR_WELL_CTL1), DEFINEREG(HSW_PWR_WELL_CTL2), DEFINEREG(HSW_PWR_WELL_CTL3), DEFINEREG(HSW_PWR_WELL_CTL4), DEFINEREG(HSW_PWR_WELL_CTL5), DEFINEREG(HSW_PWR_WELL_CTL6), /* DDI pipe function */ DEFINEREG(PIPE_DDI_FUNC_CTL_A), DEFINEREG(PIPE_DDI_FUNC_CTL_B), DEFINEREG(PIPE_DDI_FUNC_CTL_C), DEFINEREG(PIPE_DDI_FUNC_CTL_EDP), /* DP transport control */ DEFINEREG(DP_TP_CTL_A), DEFINEREG(DP_TP_CTL_B), DEFINEREG(DP_TP_CTL_C), DEFINEREG(DP_TP_CTL_D), DEFINEREG(DP_TP_CTL_E), /* DP status */ DEFINEREG(DP_TP_STATUS_A), DEFINEREG(DP_TP_STATUS_B), DEFINEREG(DP_TP_STATUS_C), DEFINEREG(DP_TP_STATUS_D), DEFINEREG(DP_TP_STATUS_E), /* DDI buffer control */ DEFINEREG(DDI_BUF_CTL_A), DEFINEREG(DDI_BUF_CTL_B), DEFINEREG(DDI_BUF_CTL_C), DEFINEREG(DDI_BUF_CTL_D), DEFINEREG(DDI_BUF_CTL_E), /* Clocks */ DEFINEREG(PIXCLK_GATE), DEFINEREG(SPLL_CTL), DEFINEREG(LCPLL_CTL), DEFINEREG(WRPLL_CTL1), DEFINEREG(WRPLL_CTL2), /* DDI port clock control */ DEFINEREG(PORT_CLK_SEL_A), DEFINEREG(PORT_CLK_SEL_B), DEFINEREG(PORT_CLK_SEL_C), DEFINEREG(PORT_CLK_SEL_D), DEFINEREG(PORT_CLK_SEL_E), /* Pipe clock control */ DEFINEREG(PIPE_CLK_SEL_A), DEFINEREG(PIPE_CLK_SEL_B), DEFINEREG(PIPE_CLK_SEL_C), /* Pipe line time */ DEFINEREG(PIPE_WM_LINETIME_A), DEFINEREG(PIPE_WM_LINETIME_B), DEFINEREG(PIPE_WM_LINETIME_C), /* Fuses */ DEFINEREG(SFUSE_STRAP), }; static struct reg_debug i945gm_mi_regs[] = { DEFINEREG(PGETBL_CTL), DEFINEREG(PGTBL_ER), DEFINEREG(EXCC), DEFINEREG(HWS_PGA), DEFINEREG(IPEIR), DEFINEREG(IPEHR), DEFINEREG(INST_DONE), DEFINEREG(NOP_ID), DEFINEREG(HWSTAM), DEFINEREG(SCPD0), DEFINEREG(IER), DEFINEREG(IIR), DEFINEREG(IMR), DEFINEREG(ISR), DEFINEREG(EIR), DEFINEREG(EMR), DEFINEREG(ESR), DEFINEREG(INST_PM), DEFINEREG(ECOSKPD), }; #define intel_dump_regs(regs) _intel_dump_regs(regs, ARRAY_SIZE(regs)) static void _intel_dump_regs(struct reg_debug *regs, int count) { char debug[1024]; int i; for (i = 0; i < count; i++) { uint32_t val = INREG(regs[i].reg); if (regs[i].debug_output != NULL) { regs[i].debug_output(debug, sizeof(debug), regs[i].reg, val); printf("%30.30s: 0x%08x (%s)\n", regs[i].name, (unsigned int)val, debug); } else { printf("%30.30s: 0x%08x\n", regs[i].name, (unsigned int)val); } } } DEBUGSTRING(gen6_rp_control) { snprintf(result, len, "%s", (val & (1 << 7)) ? "enabled" : "disabled"); } static struct reg_debug gen6_rp_debug_regs[] = { DEFINEREG2(GEN6_RP_CONTROL, gen6_rp_control), DEFINEREG(GEN6_RPNSWREQ), DEFINEREG(GEN6_RP_DOWN_TIMEOUT), DEFINEREG(GEN6_RP_INTERRUPT_LIMITS), DEFINEREG(GEN6_RP_UP_THRESHOLD), DEFINEREG(GEN6_RP_UP_EI), DEFINEREG(GEN6_RP_DOWN_EI), DEFINEREG(GEN6_RP_IDLE_HYSTERSIS), DEFINEREG(GEN6_RC_STATE), DEFINEREG(GEN6_RC_CONTROL), DEFINEREG(GEN6_RC1_WAKE_RATE_LIMIT), DEFINEREG(GEN6_RC6_WAKE_RATE_LIMIT), DEFINEREG(GEN6_RC_EVALUATION_INTERVAL), DEFINEREG(GEN6_RC_IDLE_HYSTERSIS), DEFINEREG(GEN6_RC_SLEEP), DEFINEREG(GEN6_RC1e_THRESHOLD), DEFINEREG(GEN6_RC6_THRESHOLD), DEFINEREG(GEN6_RC_VIDEO_FREQ), DEFINEREG(GEN6_PMIER), DEFINEREG(GEN6_PMIMR), DEFINEREG(GEN6_PMINTRMSK), }; static void intel_dump_other_regs(void) { int i; int fp, dpll; int disp_pipe; int n, m1, m2, m, p1, p2; int ref; int dot; int phase; #if 0 int msr; int crt; #endif #if 0 i830DumpIndexed(pScrn, "SR", 0x3c4, 0x3c5, 0, 7); msr = INREG8(0x3cc); printf("%20.20s: 0x%02x\n", "MSR", (unsigned int)msr); i830DumpAR(pScrn); if (msr & 1) crt = 0x3d0; else crt = 0x3b0; i830DumpIndexed(pScrn, "CR", crt + 4, crt + 5, 0, 0x24); #endif for (disp_pipe = 0; disp_pipe <= 1; disp_pipe++) { fp = INREG(disp_pipe == 0 ? FPA0 : FPB0); dpll = INREG(disp_pipe == 0 ? DPLL_A : DPLL_B); if (IS_GEN2(devid)) { uint32_t lvds = INREG(LVDS); if (devid == PCI_CHIP_I855_GM && (lvds & LVDS_PORT_EN) && (lvds & LVDS_PIPEB_SELECT) == (disp_pipe << 30)) { if ((lvds & LVDS_CLKB_POWER_MASK) == LVDS_CLKB_POWER_UP) p2 = 7; else p2 = 14; switch ((dpll >> 16) & 0x3f) { case 0x01: p1 = 1; break; case 0x02: p1 = 2; break; case 0x04: p1 = 3; break; case 0x08: p1 = 4; break; case 0x10: p1 = 5; break; case 0x20: p1 = 6; break; default: p1 = 1; printf("LVDS P1 0x%x invalid encoding\n", (dpll >> 16) & 0x3f); break; } } else { if (dpll & (1 << 23)) p2 = 4; else p2 = 2; if (dpll & PLL_P1_DIVIDE_BY_TWO) p1 = 2; else p1 = ((dpll >> 16) & 0x3f) + 2; } switch ((dpll >> 13) & 0x3) { case 0: ref = 48000; break; case 3: ref = 66000; break; default: ref = 0; printf("ref out of range\n"); break; } } else { uint32_t lvds = INREG(LVDS); if ((lvds & LVDS_PORT_EN) && (lvds & LVDS_PIPEB_SELECT) == (disp_pipe << 30)) { if ((lvds & LVDS_CLKB_POWER_MASK) == LVDS_CLKB_POWER_UP) p2 = 7; else p2 = 14; } else { switch ((dpll >> 24) & 0x3) { case 0: p2 = 10; break; case 1: p2 = 5; break; default: p2 = 1; printf("p2 out of range\n"); break; } } if (IS_IGD(devid)) i = (dpll >> DPLL_FPA01_P1_POST_DIV_SHIFT_IGD) & 0x1ff; else i = (dpll >> DPLL_FPA01_P1_POST_DIV_SHIFT) & 0xff; switch (i) { case 1: p1 = 1; break; case 2: p1 = 2; break; case 4: p1 = 3; break; case 8: p1 = 4; break; case 16: p1 = 5; break; case 32: p1 = 6; break; case 64: p1 = 7; break; case 128: p1 = 8; break; case 256: if (IS_IGD(devid)) { p1 = 9; break; } /* fallback */ default: p1 = 1; printf("p1 out of range\n"); break; } switch ((dpll >> 13) & 0x3) { case 0: ref = 96000; break; case 3: ref = 100000; break; default: ref = 0; printf("ref out of range\n"); break; } } if (IS_965(devid)) { phase = (dpll >> 9) & 0xf; switch (phase) { case 6: break; default: printf("SDVO phase shift %d out of range -- probobly not " "an issue.\n", phase); break; } } switch ((dpll >> 8) & 1) { case 0: break; default: printf("fp select out of range\n"); break; } m1 = ((fp >> 8) & 0x3f); if (IS_IGD(devid)) { n = ffs((fp & FP_N_IGD_DIV_MASK) >> FP_N_DIV_SHIFT) - 1; m2 = (fp & FP_M2_IGD_DIV_MASK) >> FP_M2_DIV_SHIFT; m = m2 + 2; dot = (ref * m) / n / (p1 * p2); } else { n = ((fp >> 16) & 0x3f); m2 = ((fp >> 0) & 0x3f); m = 5 * (m1 + 2) + (m2 + 2); dot = (ref * (5 * (m1 + 2) + (m2 + 2)) / (n + 2)) / (p1 * p2); } printf("pipe %s dot %d n %d m1 %d m2 %d p1 %d p2 %d\n", disp_pipe == 0 ? "A" : "B", dot, n, m1, m2, p1, p2); } } static void print_usage(void) { printf("Usage: intel_reg_dumper [options] [file]\n" "Options:\n" " -d id when a dump file is used, use 'id' as device id (in " "hex)\n" " -h prints this help\n"); } int main(int argc, char** argv) { struct pci_device *pci_dev; int opt; char *file = NULL; while ((opt = getopt(argc, argv, "d:h")) != -1) { switch (opt) { case 'd': devid = strtol(optarg, NULL, 16); break; case 'h': print_usage(); return 0; default: print_usage(); return 1; } } if (optind < argc) file = argv[optind]; if (file) { intel_map_file(file); if (devid) { if (IS_GEN5(devid)) pch = PCH_IBX; else pch = PCH_CPT; } else { printf("Dumping from file without -d argument. " "Assuming Ironlake machine.\n"); devid = 0x0042; pch = PCH_IBX; } } else { pci_dev = intel_get_pci_device(); devid = pci_dev->device_id; intel_register_access_init(pci_dev, 1); if (HAS_PCH_SPLIT(devid)) intel_check_pch(); } if (HAS_PCH_SPLIT(devid)) { intel_dump_regs(ironlake_debug_regs); } else if (IS_945GM(devid)) { intel_dump_regs(i945gm_mi_regs); intel_dump_regs(intel_debug_regs); intel_dump_other_regs(); } else { intel_dump_regs(intel_debug_regs); intel_dump_other_regs(); } if (IS_GEN6(devid) || IS_GEN7(devid)) intel_dump_regs(gen6_rp_debug_regs); if (IS_HASWELL(devid)) intel_dump_regs(haswell_debug_regs); intel_register_access_fini(); return 0; } intel-gpu-tools-1.3/tools/intel_bios_reader.c0000664000175100017510000006457711710277452016352 00000000000000/* * Copyright 2006 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * * Authors: * Eric Anholt * */ #include #include #include #include #include #include #include #include #include #include "intel_bios.h" #include "intel_gpu_tools.h" static uint32_t devid = -1; /* no bother to include "edid.h" */ #define _H_ACTIVE(x) (x[2] + ((x[4] & 0xF0) << 4)) #define _H_SYNC_OFF(x) (x[8] + ((x[11] & 0xC0) << 2)) #define _H_SYNC_WIDTH(x) (x[9] + ((x[11] & 0x30) << 4)) #define _H_BLANK(x) (x[3] + ((x[4] & 0x0F) << 8)) #define _V_ACTIVE(x) (x[5] + ((x[7] & 0xF0) << 4)) #define _V_SYNC_OFF(x) ((x[10] >> 4) + ((x[11] & 0x0C) << 2)) #define _V_SYNC_WIDTH(x) ((x[10] & 0x0F) + ((x[11] & 0x03) << 4)) #define _V_BLANK(x) (x[6] + ((x[7] & 0x0F) << 8)) #define _PIXEL_CLOCK(x) (x[0] + (x[1] << 8)) * 10000 uint8_t *VBIOS; #define INTEL_BIOS_8(_addr) (VBIOS[_addr]) #define INTEL_BIOS_16(_addr) (VBIOS[_addr] | \ (VBIOS[_addr + 1] << 8)) #define INTEL_BIOS_32(_addr) (VBIOS[_addr] | \ (VBIOS[_addr + 1] << 8) | \ (VBIOS[_addr + 2] << 16) | \ (VBIOS[_addr + 3] << 24)) #define YESNO(val) ((val) ? "yes" : "no") struct bdb_block { uint8_t id; uint16_t size; void *data; }; struct bdb_header *bdb; static int tv_present; static int lvds_present; static int panel_type; static struct bdb_block *find_section(int section_id, int length) { struct bdb_block *block; unsigned char *base = (unsigned char *)bdb; int idx = 0; uint16_t total, current_size; unsigned char current_id; /* skip to first section */ idx += bdb->header_size; total = bdb->bdb_size; if (total > length) total = length; block = malloc(sizeof(*block)); if (!block) { fprintf(stderr, "out of memory\n"); exit(-1); } /* walk the sections looking for section_id */ while (idx + 3 < total) { current_id = *(base + idx); current_size = *(uint16_t *)(base + idx + 1); if (idx + current_size > total) return NULL; if (current_id == section_id) { block->id = current_id; block->size = current_size; block->data = base + idx + 3; return block; } idx += current_size + 3; } free(block); return NULL; } static void dump_general_features(int length) { struct bdb_general_features *features; struct bdb_block *block; block = find_section(BDB_GENERAL_FEATURES, length); if (!block) return; features = block->data; printf("General features block:\n"); printf("\tPanel fitting: "); switch (features->panel_fitting) { case 0: printf("disabled\n"); break; case 1: printf("text only\n"); break; case 2: printf("graphics only\n"); break; case 3: printf("text & graphics\n"); break; } printf("\tFlexaim: %s\n", YESNO(features->flexaim)); printf("\tMessage: %s\n", YESNO(features->msg_enable)); printf("\tClear screen: %d\n", features->clear_screen); printf("\tDVO color flip required: %s\n", YESNO(features->color_flip)); printf("\tExternal VBT: %s\n", YESNO(features->download_ext_vbt)); printf("\tEnable SSC: %s\n", YESNO(features->enable_ssc)); if (features->enable_ssc) { if (HAS_PCH_SPLIT(devid)) printf("\tSSC frequency: %s\n", features->ssc_freq ? "100 MHz" : "120 MHz"); else printf("\tSSC frequency: %s\n", features->ssc_freq ? "100 MHz (66 MHz on 855)" : "96 MHz (48 MHz on 855)"); } printf("\tLFP on override: %s\n", YESNO(features->enable_lfp_on_override)); printf("\tDisable SSC on clone: %s\n", YESNO(features->disable_ssc_ddt)); printf("\tDisable smooth vision: %s\n", YESNO(features->disable_smooth_vision)); printf("\tSingle DVI for CRT/DVI: %s\n", YESNO(features->single_dvi)); printf("\tLegacy monitor detect: %s\n", YESNO(features->legacy_monitor_detect)); printf("\tIntegrated CRT: %s\n", YESNO(features->int_crt_support)); printf("\tIntegrated TV: %s\n", YESNO(features->int_tv_support)); tv_present = 1; /* should be based on whether TV DAC exists */ lvds_present = 1; /* should be based on IS_MOBILE() */ free(block); } static void dump_backlight_info(int length) { struct bdb_block *block; struct bdb_lvds_backlight *backlight; struct blc_struct *blc; block = find_section(BDB_LVDS_BACKLIGHT, length); if (!block) return; backlight = block->data; printf("Backlight info block (len %d):\n", block->size); if (sizeof(struct blc_struct) != backlight->blcstruct_size) { printf("\tBacklight struct sizes don't match (expected %zu, got %u), skipping\n", sizeof(struct blc_struct), backlight->blcstruct_size); return; } blc = &backlight->panels[panel_type]; printf("\tInverter type: %d\n", blc->inverter_type); printf("\t polarity: %d\n", blc->inverter_polarity); printf("\t GPIO pins: %d\n", blc->gpio_pins); printf("\t GMBUS speed: %d\n", blc->gmbus_speed); printf("\t PWM freq: %d\n", blc->pwm_freq); printf("\tMinimum brightness: %d\n", blc->min_brightness); printf("\tI2C slave addr: 0x%02x\n", blc->i2c_slave_addr); printf("\tI2C command: 0x%02x\n", blc->i2c_cmd); } static const struct { unsigned short type; const char *name; } child_device_types[] = { { DEVICE_TYPE_NONE, "none" }, { DEVICE_TYPE_CRT, "CRT" }, { DEVICE_TYPE_TV, "TV" }, { DEVICE_TYPE_EFP, "EFP" }, { DEVICE_TYPE_LFP, "LFP" }, { DEVICE_TYPE_CRT_DPMS, "CRT" }, { DEVICE_TYPE_CRT_DPMS_HOTPLUG, "CRT" }, { DEVICE_TYPE_TV_COMPOSITE, "TV composite" }, { DEVICE_TYPE_TV_MACROVISION, "TV" }, { DEVICE_TYPE_TV_RF_COMPOSITE, "TV" }, { DEVICE_TYPE_TV_SVIDEO_COMPOSITE, "TV S-Video" }, { DEVICE_TYPE_TV_SCART, "TV SCART" }, { DEVICE_TYPE_TV_CODEC_HOTPLUG_PWR, "TV" }, { DEVICE_TYPE_EFP_HOTPLUG_PWR, "EFP" }, { DEVICE_TYPE_EFP_DVI_HOTPLUG_PWR, "DVI" }, { DEVICE_TYPE_EFP_DVI_I, "DVI-I" }, { DEVICE_TYPE_EFP_DVI_D_DUAL, "DL-DVI-D" }, { DEVICE_TYPE_EFP_DVI_D_HDCP, "DVI-D" }, { DEVICE_TYPE_OPENLDI_HOTPLUG_PWR, "OpenLDI" }, { DEVICE_TYPE_OPENLDI_DUALPIX, "OpenLDI" }, { DEVICE_TYPE_LFP_PANELLINK, "PanelLink" }, { DEVICE_TYPE_LFP_CMOS_PWR, "CMOS LFP" }, { DEVICE_TYPE_LFP_LVDS_PWR, "LVDS" }, { DEVICE_TYPE_LFP_LVDS_DUAL, "LVDS" }, { DEVICE_TYPE_LFP_LVDS_DUAL_HDCP, "LVDS" }, { DEVICE_TYPE_INT_LFP, "LFP" }, { DEVICE_TYPE_INT_TV, "TV" }, { DEVICE_TYPE_DP, "DisplayPort" }, { DEVICE_TYPE_DP_HDMI_DVI, "DisplayPort/HDMI/DVI" }, { DEVICE_TYPE_DP_DVI, "DisplayPort/DVI" }, { DEVICE_TYPE_HDMI_DVI, "HDMI/DVI" }, { DEVICE_TYPE_DVI, "DVI" }, { DEVICE_TYPE_eDP, "eDP" }, }; static const int num_child_device_types = sizeof(child_device_types) / sizeof(child_device_types[0]); static const char *child_device_type(unsigned short type) { int i; for (i = 0; i < num_child_device_types; i++) if (child_device_types[i].type == type) return child_device_types[i].name; return "unknown"; } static const struct { unsigned short type; const char *name; } efp_ports[] = { { DEVICE_PORT_NONE, "N/A" }, { DEVICE_PORT_HDMIB, "HDMI-B" }, { DEVICE_PORT_HDMIC, "HDMI-C" }, { DEVICE_PORT_HDMID, "HDMI-D" }, { DEVICE_PORT_DPB, "DP-B" }, { DEVICE_PORT_DPC, "DP-C" }, { DEVICE_PORT_DPD, "DP-D" }, }; static const int num_efp_ports = sizeof(efp_ports) / sizeof(efp_ports[0]); static const char *efp_port(uint8_t type) { int i; for (i = 0; i < num_efp_ports; i++) if (efp_ports[i].type == type) return efp_ports[i].name; return "unknown"; } static const struct { unsigned short type; const char *name; } efp_conn_info[] = { { DEVICE_INFO_NONE, "N/A" }, { DEVICE_INFO_HDMI_CERT, "HDMI certified" }, { DEVICE_INFO_DP, "DisplayPort" }, { DEVICE_INFO_DVI, "DVI" }, }; static const int num_efp_conn_info = sizeof(efp_conn_info) / sizeof(efp_conn_info[0]); static const char *efp_conn(uint8_t type) { int i; for (i = 0; i < num_efp_conn_info; i++) if (efp_conn_info[i].type == type) return efp_conn_info[i].name; return "unknown"; } static void dump_child_device(struct child_device_config *child) { char child_id[11]; if (!child->device_type) return; if (bdb->version < 152) { strncpy(child_id, (char *)child->device_id, 10); child_id[10] = 0; printf("\tChild device info:\n"); printf("\t\tDevice type: %04x (%s)\n", child->device_type, child_device_type(child->device_type)); printf("\t\tSignature: %s\n", child_id); printf("\t\tAIM offset: %d\n", child->addin_offset); printf("\t\tDVO port: 0x%02x\n", child->dvo_port); } else { /* 152+ have EFP blocks here */ struct efp_child_device_config *efp = (struct efp_child_device_config *)child; printf("\tEFP device info:\n"); printf("\t\tDevice type: 0x%04x (%s)\n", efp->device_type, child_device_type(efp->device_type)); printf("\t\tPort: 0x%02x (%s)\n", efp->port, efp_port(efp->port)); printf("\t\tDDC pin: 0x%02x\n", efp->ddc_pin); printf("\t\tDock port: 0x%02x (%s)\n", efp->docked_port, efp_port(efp->docked_port)); printf("\t\tHDMI compatible? %s\n", efp->hdmi_compat ? "Yes" : "No"); printf("\t\tInfo: %s\n", efp_conn(efp->conn_info)); printf("\t\tAux channel: 0x%02x\n", efp->aux_chan); printf("\t\tDongle detect: 0x%02x\n", efp->dongle_detect); } } static void dump_general_definitions(int length) { struct bdb_block *block; struct bdb_general_definitions *defs; struct child_device_config *child; int i; int child_device_num; block = find_section(BDB_GENERAL_DEFINITIONS, length); if (!block) return; defs = block->data; printf("General definitions block:\n"); printf("\tCRT DDC GMBUS addr: 0x%02x\n", defs->crt_ddc_gmbus_pin); printf("\tUse ACPI DPMS CRT power states: %s\n", YESNO(defs->dpms_acpi)); printf("\tSkip CRT detect at boot: %s\n", YESNO(defs->skip_boot_crt_detect)); printf("\tUse DPMS on AIM devices: %s\n", YESNO(defs->dpms_aim)); printf("\tBoot display type: 0x%02x%02x\n", defs->boot_display[1], defs->boot_display[0]); printf("\tTV data block present: %s\n", YESNO(tv_present)); child_device_num = (block->size - sizeof(*defs)) / sizeof(*child); for (i = 0; i < child_device_num; i++) dump_child_device(&defs->devices[i]); free(block); } static void dump_child_devices(int length) { struct bdb_block *block; struct bdb_child_devices *child_devs; struct child_device_config *child; int i; block = find_section(BDB_CHILD_DEVICE_TABLE, length); if (!block) { printf("No child device table found\n"); return; } child_devs = block->data; printf("Child devices block:\n"); for (i = 0; i < DEVICE_CHILD_SIZE; i++) { child = &child_devs->children[i]; /* Skip nonexistent children */ if (!child->device_type) continue; printf("\tChild device %d\n", i); printf("\t\tType: 0x%04x (%s)\n", child->device_type, child_device_type(child->device_type)); printf("\t\tDVO port: 0x%02x\n", child->dvo_port); printf("\t\tI2C pin: 0x%02x\n", child->i2c_pin); printf("\t\tSlave addr: 0x%02x\n", child->slave_addr); printf("\t\tDDC pin: 0x%02x\n", child->ddc_pin); printf("\t\tDVO config: 0x%02x\n", child->dvo_cfg); printf("\t\tDVO wiring: 0x%02x\n", child->dvo_wiring); } free(block); } static void dump_lvds_options(int length) { struct bdb_block *block; struct bdb_lvds_options *options; block = find_section(BDB_LVDS_OPTIONS, length); if (!block) { printf("No LVDS options block\n"); return; } options = block->data; printf("LVDS options block:\n"); panel_type = options->panel_type; printf("\tPanel type: %d\n", panel_type); printf("\tLVDS EDID available: %s\n", YESNO(options->lvds_edid)); printf("\tPixel dither: %s\n", YESNO(options->pixel_dither)); printf("\tPFIT auto ratio: %s\n", YESNO(options->pfit_ratio_auto)); printf("\tPFIT enhanced graphics mode: %s\n", YESNO(options->pfit_gfx_mode_enhanced)); printf("\tPFIT enhanced text mode: %s\n", YESNO(options->pfit_text_mode_enhanced)); printf("\tPFIT mode: %d\n", options->pfit_mode); free(block); } static void dump_lvds_ptr_data(int length) { struct bdb_block *block; struct bdb_lvds_lfp_data *lvds_data; struct bdb_lvds_lfp_data_ptrs *ptrs; struct lvds_fp_timing *fp_timing; struct bdb_lvds_lfp_data_entry *entry; int lfp_data_size; block = find_section(BDB_LVDS_LFP_DATA_PTRS, length); if (!block) { printf("No LFP data pointers block\n"); return; } ptrs = block->data; block = find_section(BDB_LVDS_LFP_DATA, length); if (!block) { printf("No LVDS data block\n"); return; } lvds_data = block->data; lfp_data_size = ptrs->ptr[1].fp_timing_offset - ptrs->ptr[0].fp_timing_offset; entry = (struct bdb_lvds_lfp_data_entry *)((uint8_t *) lvds_data->data + (lfp_data_size * panel_type)); fp_timing = &entry->fp_timing; printf("LVDS timing pointer data:\n"); printf(" Number of entries: %d\n", ptrs->lvds_entries); printf("\tpanel type %02i: %dx%d\n", panel_type, fp_timing->x_res, fp_timing->y_res); free(block); } static void dump_lvds_data(int length) { struct bdb_block *block; struct bdb_lvds_lfp_data *lvds_data; struct bdb_lvds_lfp_data_ptrs *ptrs; int num_entries; int i; int hdisplay, hsyncstart, hsyncend, htotal; int vdisplay, vsyncstart, vsyncend, vtotal; float clock; int lfp_data_size, dvo_offset; block = find_section(BDB_LVDS_LFP_DATA_PTRS, length); if (!block) { printf("No LVDS ptr block\n"); return; } ptrs = block->data; lfp_data_size = ptrs->ptr[1].fp_timing_offset - ptrs->ptr[0].fp_timing_offset; dvo_offset = ptrs->ptr[0].dvo_timing_offset - ptrs->ptr[0].fp_timing_offset; free(block); block = find_section(BDB_LVDS_LFP_DATA, length); if (!block) { printf("No LVDS data block\n"); return; } lvds_data = block->data; num_entries = block->size / lfp_data_size; printf("LVDS panel data block (preferred block marked with '*'):\n"); printf(" Number of entries: %d\n", num_entries); for (i = 0; i < num_entries; i++) { uint8_t *lfp_data_ptr = (uint8_t *) lvds_data->data + lfp_data_size * i; uint8_t *timing_data = lfp_data_ptr + dvo_offset; struct bdb_lvds_lfp_data_entry *lfp_data = (struct bdb_lvds_lfp_data_entry *)lfp_data_ptr; char marker; if (i == panel_type) marker = '*'; else marker = ' '; hdisplay = _H_ACTIVE(timing_data); hsyncstart = hdisplay + _H_SYNC_OFF(timing_data); hsyncend = hsyncstart + _H_SYNC_WIDTH(timing_data); htotal = hdisplay + _H_BLANK(timing_data); vdisplay = _V_ACTIVE(timing_data); vsyncstart = vdisplay + _V_SYNC_OFF(timing_data); vsyncend = vsyncstart + _V_SYNC_WIDTH(timing_data); vtotal = vdisplay + _V_BLANK(timing_data); clock = _PIXEL_CLOCK(timing_data) / 1000; printf("%c\tpanel type %02i: %dx%d clock %d\n", marker, i, lfp_data->fp_timing.x_res, lfp_data->fp_timing.y_res, _PIXEL_CLOCK(timing_data)); printf("\t\tinfo:\n"); printf("\t\t LVDS: 0x%08lx\n", (unsigned long)lfp_data->fp_timing.lvds_reg_val); printf("\t\t PP_ON_DELAYS: 0x%08lx\n", (unsigned long)lfp_data->fp_timing.pp_on_reg_val); printf("\t\t PP_OFF_DELAYS: 0x%08lx\n", (unsigned long)lfp_data->fp_timing.pp_off_reg_val); printf("\t\t PP_DIVISOR: 0x%08lx\n", (unsigned long)lfp_data->fp_timing.pp_cycle_reg_val); printf("\t\t PFIT: 0x%08lx\n", (unsigned long)lfp_data->fp_timing.pfit_reg_val); printf("\t\ttimings: %d %d %d %d %d %d %d %d %.2f (%s)\n", hdisplay, hsyncstart, hsyncend, htotal, vdisplay, vsyncstart, vsyncend, vtotal, clock, (hsyncend > htotal || vsyncend > vtotal) ? "BAD!" : "good"); } free(block); } static void dump_driver_feature(int length) { struct bdb_block *block; struct bdb_driver_feature *feature; block = find_section(BDB_DRIVER_FEATURES, length); if (!block) { printf("No Driver feature data block\n"); return; } feature = block->data; printf("Driver feature Data Block:\n"); printf("\tBoot Device Algorithm: %s\n", feature->boot_dev_algorithm ? "driver default" : "os default"); printf("\tBlock display switching when DVD active: %s\n", YESNO(feature->block_display_switch)); printf("\tAllow display switching when in Full Screen DOS: %s\n", YESNO(feature->allow_display_switch)); printf("\tHot Plug DVO: %s\n", YESNO(feature->hotplug_dvo)); printf("\tDual View Zoom: %s\n", YESNO(feature->dual_view_zoom)); printf("\tDriver INT 15h hook: %s\n", YESNO(feature->int15h_hook)); printf("\tEnable Sprite in Clone Mode: %s\n", YESNO(feature->sprite_in_clone)); printf("\tUse 00000110h ID for Primary LFP: %s\n", YESNO(feature->primary_lfp_id)); printf("\tBoot Mode X: %u\n", feature->boot_mode_x); printf("\tBoot Mode Y: %u\n", feature->boot_mode_y); printf("\tBoot Mode Bpp: %u\n", feature->boot_mode_bpp); printf("\tBoot Mode Refresh: %u\n", feature->boot_mode_refresh); printf("\tEnable LFP as primary: %s\n", YESNO(feature->enable_lfp_primary)); printf("\tSelective Mode Pruning: %s\n", YESNO(feature->selective_mode_pruning)); printf("\tDual-Frequency Graphics Technology: %s\n", YESNO(feature->dual_frequency)); printf("\tDefault Render Clock Frequency: %s\n", feature->render_clock_freq ? "low" : "high"); printf("\tNT 4.0 Dual Display Clone Support: %s\n", YESNO(feature->nt_clone_support)); printf("\tDefault Power Scheme user interface: %s\n", feature->power_scheme_ui ? "3rd party" : "CUI"); printf ("\tSprite Display Assignment when Overlay is Active in Clone Mode: %s\n", feature->sprite_display_assign ? "primary" : "secondary"); printf("\tDisplay Maintain Aspect Scaling via CUI: %s\n", YESNO(feature->cui_aspect_scaling)); printf("\tPreserve Aspect Ratio: %s\n", YESNO(feature->preserve_aspect_ratio)); printf("\tEnable SDVO device power down: %s\n", YESNO(feature->sdvo_device_power_down)); printf("\tCRT hotplug: %s\n", YESNO(feature->crt_hotplug)); printf("\tLVDS config: "); switch (feature->lvds_config) { case BDB_DRIVER_NO_LVDS: printf("No LVDS\n"); break; case BDB_DRIVER_INT_LVDS: printf("Integrated LVDS\n"); break; case BDB_DRIVER_SDVO_LVDS: printf("SDVO LVDS\n"); break; case BDB_DRIVER_EDP: printf("Embedded DisplayPort\n"); break; } printf("\tDefine Display statically: %s\n", YESNO(feature->static_display)); printf("\tLegacy CRT max X: %d\n", feature->legacy_crt_max_x); printf("\tLegacy CRT max Y: %d\n", feature->legacy_crt_max_y); printf("\tLegacy CRT max refresh: %d\n", feature->legacy_crt_max_refresh); free(block); } static void dump_edp(int length) { struct bdb_block *block; struct bdb_edp *edp; int bpp; block = find_section(BDB_EDP, length); if (!block) { printf("No EDP data block\n"); return; } edp = block->data; printf("eDP block: type %d\n", panel_type); printf("\tPower Sequence: T3 %d T7 %d T9 %d T10 %d T12 %d\n", edp->power_seqs[panel_type].t3, edp->power_seqs[panel_type].t7, edp->power_seqs[panel_type].t9, edp->power_seqs[panel_type].t10, edp->power_seqs[panel_type].t12); bpp = (edp->color_depth >> (panel_type * 2)) & 3; printf("\tPanel color depth: "); switch (bpp) { case EDP_18BPP: printf("18bpp\n"); break; case EDP_24BPP: printf("24bpp\n"); break; case EDP_30BPP: printf("30bpp\n"); break; } printf("\teDP sDRRs MSA timing delay: %d\n", edp->sdrrs_msa_timing_delay); printf("\tLink params:\n"); printf("\t\trate: "); if (edp->link_params[panel_type].rate == EDP_RATE_1_62) printf("1.62G\n"); else if (edp->link_params[panel_type].rate == EDP_RATE_2_7) printf("2.7G\n"); printf("\t\tlanes: "); switch (edp->link_params[panel_type].lanes) { case EDP_LANE_1: printf("x1 mode\n"); break; case EDP_LANE_2: printf("x2 mode\n"); break; case EDP_LANE_4: printf("x4 mode\n"); break; } printf("\t\tpre-emphasis: "); switch (edp->link_params[panel_type].preemphasis) { case EDP_PREEMPHASIS_NONE: printf("none\n"); break; case EDP_PREEMPHASIS_3_5dB: printf("3.5dB\n"); break; case EDP_PREEMPHASIS_6dB: printf("6dB\n"); break; case EDP_PREEMPHASIS_9_5dB: printf("9.5dB\n"); break; } printf("\t\tvswing: "); switch (edp->link_params[panel_type].vswing) { case EDP_VSWING_0_4V: printf("0.4V\n"); break; case EDP_VSWING_0_6V: printf("0.6V\n"); break; case EDP_VSWING_0_8V: printf("0.8V\n"); break; case EDP_VSWING_1_2V: printf("1.2V\n"); break; } free(block); } static void print_detail_timing_data(struct lvds_dvo_timing2 *dvo_timing) { int display, sync_start, sync_end, total; display = (dvo_timing->hactive_hi << 8) | dvo_timing->hactive_lo; sync_start = display + ((dvo_timing->hsync_off_hi << 8) | dvo_timing->hsync_off_lo); sync_end = sync_start + dvo_timing->hsync_pulse_width; total = display + ((dvo_timing->hblank_hi << 8) | dvo_timing->hblank_lo); printf("\thdisplay: %d\n", display); printf("\thsync [%d, %d] %s\n", sync_start, sync_end, dvo_timing->hsync_positive ? "+sync" : "-sync"); printf("\thtotal: %d\n", total); display = (dvo_timing->vactive_hi << 8) | dvo_timing->vactive_lo; sync_start = display + dvo_timing->vsync_off; sync_end = sync_start + dvo_timing->vsync_pulse_width; total = display + ((dvo_timing->vblank_hi << 8) | dvo_timing->vblank_lo); printf("\tvdisplay: %d\n", display); printf("\tvsync [%d, %d] %s\n", sync_start, sync_end, dvo_timing->vsync_positive ? "+sync" : "-sync"); printf("\tvtotal: %d\n", total); printf("\tclock: %d\n", dvo_timing->clock * 10); } static void dump_sdvo_panel_dtds(int length) { struct bdb_block *block; struct lvds_dvo_timing2 *dvo_timing; int n, count; block = find_section(BDB_SDVO_PANEL_DTDS, length); if (!block) { printf("No SDVO panel dtds block\n"); return; } printf("SDVO panel dtds:\n"); count = block->size / sizeof(struct lvds_dvo_timing2); dvo_timing = block->data; for (n = 0; n < count; n++) { printf("%d:\n", n); print_detail_timing_data(dvo_timing++); } free(block); } static void dump_sdvo_lvds_options(int length) { struct bdb_block *block; struct bdb_sdvo_lvds_options *options; block = find_section(BDB_SDVO_LVDS_OPTIONS, length); if (!block) { printf("No SDVO LVDS options block\n"); return; } options = block->data; printf("SDVO LVDS options block:\n"); printf("\tbacklight: %d\n", options->panel_backlight); printf("\th40 type: %d\n", options->h40_set_panel_type); printf("\ttype: %d\n", options->panel_type); printf("\tssc_clk_freq: %d\n", options->ssc_clk_freq); printf("\tals_low_trip: %d\n", options->als_low_trip); printf("\tals_high_trip: %d\n", options->als_high_trip); /* u8 sclalarcoeff_tab_row_num; u8 sclalarcoeff_tab_row_size; u8 coefficient[8]; */ printf("\tmisc[0]: %x\n", options->panel_misc_bits_1); printf("\tmisc[1]: %x\n", options->panel_misc_bits_2); printf("\tmisc[2]: %x\n", options->panel_misc_bits_3); printf("\tmisc[3]: %x\n", options->panel_misc_bits_4); free(block); } static int get_device_id(unsigned char *bios) { int device; int offset = (bios[0x19] << 8) + bios[0x18]; if (bios[offset] != 'P' || bios[offset+1] != 'C' || bios[offset+2] != 'I' || bios[offset+3] != 'R') return -1; device = (bios[offset+7] << 8) + bios[offset+6]; return device; } int main(int argc, char **argv) { int fd; struct vbt_header *vbt = NULL; int vbt_off, bdb_off, i; const char *filename = "bios"; struct stat finfo; struct bdb_block *block; char signature[17]; char *devid_string; if (argc != 2) { printf("usage: %s \n", argv[0]); return 1; } if ((devid_string = getenv("DEVICE"))) devid = strtoul(devid_string, NULL, 0); filename = argv[1]; fd = open(filename, O_RDONLY); if (fd == -1) { printf("Couldn't open \"%s\": %s\n", filename, strerror(errno)); return 1; } if (stat(filename, &finfo)) { printf("failed to stat \"%s\": %s\n", filename, strerror(errno)); return 1; } if (finfo.st_size == 0) { int len = 0, ret; finfo.st_size = 8192; VBIOS = malloc (finfo.st_size); while ((ret = read(fd, VBIOS + len, finfo.st_size - len))) { if (ret < 0) { printf("failed to read \"%s\": %s\n", filename, strerror(errno)); return 1; } len += ret; if (len == finfo.st_size) { finfo.st_size *= 2; VBIOS = realloc(VBIOS, finfo.st_size); } } } else { VBIOS = mmap(NULL, finfo.st_size, PROT_READ, MAP_SHARED, fd, 0); if (VBIOS == MAP_FAILED) { printf("failed to map \"%s\": %s\n", filename, strerror(errno)); return 1; } } /* Scour memory looking for the VBT signature */ for (i = 0; i + 4 < finfo.st_size; i++) { if (!memcmp(VBIOS + i, "$VBT", 4)) { vbt_off = i; vbt = (struct vbt_header *)(VBIOS + i); break; } } if (!vbt) { printf("VBT signature missing\n"); return 1; } printf("VBT vers: %d.%d\n", vbt->version / 100, vbt->version % 100); bdb_off = vbt_off + vbt->bdb_offset; if (bdb_off >= finfo.st_size - sizeof(struct bdb_header)) { printf("Invalid VBT found, BDB points beyond end of data block\n"); return 1; } bdb = (struct bdb_header *)(VBIOS + bdb_off); strncpy(signature, (char *)bdb->signature, 16); signature[16] = 0; printf("BDB sig: %s\n", signature); printf("BDB vers: %d\n", bdb->version); printf("Available sections: "); for (i = 0; i < 256; i++) { block = find_section(i, finfo.st_size); if (!block) continue; printf("%d ", i); free(block); } printf("\n"); if (devid == -1) devid = get_device_id(VBIOS); if (devid == -1) printf("Warning: could not find PCI device ID!\n"); dump_general_features(finfo.st_size); dump_general_definitions(finfo.st_size); dump_child_devices(finfo.st_size); dump_lvds_options(finfo.st_size); dump_lvds_data(finfo.st_size); dump_lvds_ptr_data(finfo.st_size); dump_backlight_info(finfo.st_size); dump_sdvo_lvds_options(finfo.st_size); dump_sdvo_panel_dtds(finfo.st_size); dump_driver_feature(finfo.st_size); dump_edp(finfo.st_size); return 0; } intel-gpu-tools-1.3/tools/intel_bios.h0000664000175100017510000005202711566027747015031 00000000000000/* * Copyright 2006 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * * Authors: * Eric Anholt * */ #ifndef _INTEL_BIOS_H_ #define _INTEL_BIOS_H_ #include struct vbt_header { char signature[20]; /**< Always starts with 'VBT$' */ uint16_t version; /**< decimal */ uint16_t header_size; /**< in bytes */ uint16_t vbt_size; /**< in bytes */ uint8_t vbt_checksum; uint8_t reserved0; uint32_t bdb_offset; /**< from beginning of VBT */ uint32_t aim_offset[4]; /**< from beginning of VBT */ } __attribute__ ((packed)); struct bdb_header { char signature[16]; /**< Always 'BIOS_DATA_BLOCK' */ uint16_t version; /**< decimal */ uint16_t header_size; /**< in bytes */ uint16_t bdb_size; /**< in bytes */ } __attribute__ ((packed)); /* * There are several types of BIOS data blocks (BDBs), each block has * an ID and size in the first 3 bytes (ID in first, size in next 2). * Known types are listed below. */ #define BDB_GENERAL_FEATURES 1 #define BDB_GENERAL_DEFINITIONS 2 #define BDB_OLD_TOGGLE_LIST 3 #define BDB_MODE_SUPPORT_LIST 4 #define BDB_GENERIC_MODE_TABLE 5 #define BDB_EXT_MMIO_REGS 6 #define BDB_SWF_IO 7 #define BDB_SWF_MMIO 8 #define BDB_DOT_CLOCK_TABLE 9 #define BDB_MODE_REMOVAL_TABLE 10 #define BDB_CHILD_DEVICE_TABLE 11 #define BDB_DRIVER_FEATURES 12 #define BDB_DRIVER_PERSISTENCE 13 #define BDB_EXT_TABLE_PTRS 14 #define BDB_DOT_CLOCK_OVERRIDE 15 #define BDB_DISPLAY_SELECT 16 /* 17 rsvd */ #define BDB_DRIVER_ROTATION 18 #define BDB_DISPLAY_REMOVE 19 #define BDB_OEM_CUSTOM 20 #define BDB_EFP_LIST 21 /* workarounds for VGA hsync/vsync */ #define BDB_SDVO_LVDS_OPTIONS 22 #define BDB_SDVO_PANEL_DTDS 23 #define BDB_SDVO_LVDS_PNP_IDS 24 #define BDB_SDVO_LVDS_POWER_SEQ 25 #define BDB_TV_OPTIONS 26 #define BDB_EDP 27 #define BDB_LVDS_OPTIONS 40 #define BDB_LVDS_LFP_DATA_PTRS 41 #define BDB_LVDS_LFP_DATA 42 #define BDB_LVDS_BACKLIGHT 43 #define BDB_LVDS_POWER 44 #define BDB_SKIP 254 /* VBIOS private block, ignore */ struct bdb_general_features { /* bits 1 */ unsigned char panel_fitting:2; unsigned char flexaim:1; unsigned char msg_enable:1; unsigned char clear_screen:3; unsigned char color_flip:1; /* bits 2 */ unsigned char download_ext_vbt:1; unsigned char enable_ssc:1; unsigned char ssc_freq:1; unsigned char enable_lfp_on_override:1; unsigned char disable_ssc_ddt:1; unsigned char rsvd8:3; /* finish byte */ /* bits 3 */ unsigned char disable_smooth_vision:1; unsigned char single_dvi:1; unsigned char rsvd9:6; /* finish byte */ /* bits 4 */ unsigned char legacy_monitor_detect; /* bits 5 */ unsigned char int_crt_support:1; unsigned char int_tv_support:1; unsigned char rsvd11:6; /* finish byte */ } __attribute__ ((packed)); #define GPIO_PIN_NONE 0x00 /* "N/A" */ #define GPIO_PIN_I2C 0x01 /* "I2C GPIO pins" */ #define GPIO_PIN_CRT_DDC 0x02 /* "Analog CRT DDC GPIO pins" */ /* 915+ */ #define GPIO_PIN_LVDS 0x03 /* "Integrated LVDS DDC GPIO pins" */ #define GPIO_PIN_SDVO_I2C 0x05 /* "sDVO I2C GPIO pins" */ #define GPIO_PIN_SDVO_DDC1 0x1D /* "SDVO DDC1 GPIO pins" */ #define GPIO_PIN_SDVO_DDC2 0x2D /* "SDVO DDC2 GPIO pins" */ /* pre-915 */ #define GPIO_PIN_DVI_LVDS 0x03 /* "DVI/LVDS DDC GPIO pins" */ #define GPIO_PIN_ADD_I2C 0x05 /* "ADDCARD I2C GPIO pins" */ #define GPIO_PIN_ADD_DDC 0x04 /* "ADDCARD DDC GPIO pins" */ #define GPIO_PIN_ADD_DDC_I2C 0x06 /* "ADDCARD DDC/I2C GPIO pins" */ /* Pre 915 */ #define DEVICE_TYPE_NONE 0x00 #define DEVICE_TYPE_CRT 0x01 #define DEVICE_TYPE_TV 0x09 #define DEVICE_TYPE_EFP 0x12 #define DEVICE_TYPE_LFP 0x22 /* On 915+ */ #define DEVICE_TYPE_CRT_DPMS 0x6001 #define DEVICE_TYPE_CRT_DPMS_HOTPLUG 0x4001 #define DEVICE_TYPE_TV_COMPOSITE 0x0209 #define DEVICE_TYPE_TV_MACROVISION 0x0289 #define DEVICE_TYPE_TV_RF_COMPOSITE 0x020c #define DEVICE_TYPE_TV_SVIDEO_COMPOSITE 0x0609 #define DEVICE_TYPE_TV_SCART 0x0209 #define DEVICE_TYPE_TV_CODEC_HOTPLUG_PWR 0x6009 #define DEVICE_TYPE_EFP_HOTPLUG_PWR 0x6012 #define DEVICE_TYPE_EFP_DVI_HOTPLUG_PWR 0x6052 #define DEVICE_TYPE_EFP_DVI_I 0x6053 #define DEVICE_TYPE_EFP_DVI_D_DUAL 0x6152 #define DEVICE_TYPE_EFP_DVI_D_HDCP 0x60d2 #define DEVICE_TYPE_OPENLDI_HOTPLUG_PWR 0x6062 #define DEVICE_TYPE_OPENLDI_DUALPIX 0x6162 #define DEVICE_TYPE_LFP_PANELLINK 0x5012 #define DEVICE_TYPE_LFP_CMOS_PWR 0x5042 #define DEVICE_TYPE_LFP_LVDS_PWR 0x5062 #define DEVICE_TYPE_LFP_LVDS_DUAL 0x5162 #define DEVICE_TYPE_LFP_LVDS_DUAL_HDCP 0x51e2 #define DEVICE_TYPE_INT_HDMI 0xf0D2 #define DEVICE_TYPE_INT_LFP 0x1022 #define DEVICE_TYPE_INT_TV 0x1009 #define DEVICE_TYPE_DP 0x68C6 #define DEVICE_TYPE_DP_HDMI_DVI 0x60d6 #define DEVICE_TYPE_DP_DVI 0x68d6 #define DEVICE_TYPE_HDMI_DVI 0x60d2 #define DEVICE_TYPE_DVI 0x68d2 #define DEVICE_TYPE_eDP 0x78C6 #define DEVICE_CFG_NONE 0x00 #define DEVICE_CFG_12BIT_DVOB 0x01 #define DEVICE_CFG_12BIT_DVOC 0x02 #define DEVICE_CFG_24BIT_DVOBC 0x09 #define DEVICE_CFG_24BIT_DVOCB 0x0a #define DEVICE_CFG_DUAL_DVOB 0x11 #define DEVICE_CFG_DUAL_DVOC 0x12 #define DEVICE_CFG_DUAL_DVOBC 0x13 #define DEVICE_CFG_DUAL_LINK_DVOBC 0x19 #define DEVICE_CFG_DUAL_LINK_DVOCB 0x1a #define DEVICE_WIRE_NONE 0x00 #define DEVICE_WIRE_DVOB 0x01 #define DEVICE_WIRE_DVOC 0x02 #define DEVICE_WIRE_DVOBC 0x03 #define DEVICE_WIRE_DVOBB 0x05 #define DEVICE_WIRE_DVOCC 0x06 #define DEVICE_WIRE_DVOB_MASTER 0x0d #define DEVICE_WIRE_DVOC_MASTER 0x0e #define DEVICE_PORT_DVOA 0x00 /* none on 845+ */ #define DEVICE_PORT_DVOB 0x01 #define DEVICE_PORT_DVOC 0x02 #define DEVICE_PORT_NONE 0 #define DEVICE_PORT_HDMIB 1 #define DEVICE_PORT_HDMIC 2 #define DEVICE_PORT_HDMID 3 #define DEVICE_PORT_DPB 7 #define DEVICE_PORT_DPC 8 #define DEVICE_PORT_DPD 9 #define DEVICE_INFO_NONE 0 #define DEVICE_INFO_HDMI_CERT 1 #define DEVICE_INFO_DP 2 #define DEVICE_INFO_DVI 3 struct child_device_config { uint16_t handle; uint16_t device_type; /* See DEVICE_TYPE_* above */ uint8_t device_id[10]; uint16_t addin_offset; uint8_t dvo_port; /* See DEVICE_PORT_* above */ uint8_t i2c_pin; uint8_t slave_addr; uint8_t ddc_pin; uint16_t edid_ptr; uint8_t dvo_cfg; /* See DEVICE_CFG_* above */ uint8_t dvo2_port; uint8_t i2c2_pin; uint8_t slave2_addr; uint8_t ddc2_pin; uint8_t capabilities; uint8_t dvo_wiring; /* See DEVICE_WIRE_* above */ uint8_t dvo2_wiring; uint16_t extended_type; uint8_t dvo_function; } __attribute__ ((packed)); struct efp_child_device_config { uint16_t handle; uint16_t device_type; uint8_t skip1[12]; uint8_t port; uint8_t skip2[2]; uint8_t ddc_pin; uint8_t skip3[3]; uint8_t docked_port; uint8_t hdmi_compat:1; uint8_t conn_info:3; uint8_t skip4:4; uint8_t aux_chan; uint8_t dongle_detect; uint8_t skip5[6]; } __attribute__ ((packed)); struct bdb_general_definitions { unsigned char crt_ddc_gmbus_pin; /* see GPIO_PIN_* above */ /* DPMS bits */ unsigned char dpms_acpi:1; unsigned char skip_boot_crt_detect:1; unsigned char dpms_aim:1; unsigned char rsvd1:5; /* finish byte */ /* boot device bits */ unsigned char boot_display[2]; unsigned char child_dev_size; /* * Device info: * If TV is present, it'll be at devices[0] * LVDS will be next, either devices[0] or [1], if present * Max total will be 6, but could be as few as 4 if both * TV and LVDS are missing, so be careful when interpreting * [4] and [5]. */ struct child_device_config devices[0]; /* may be another device block here on some platforms */ } __attribute__ ((packed)); #define DEVICE_CHILD_SIZE 7 struct bdb_child_devices { uint8_t child_structure_size; struct child_device_config children[DEVICE_CHILD_SIZE]; } __attribute__ ((packed)); struct bdb_lvds_options { uint8_t panel_type; uint8_t rsvd1; /* LVDS capabilities, stored in a dword */ uint8_t pfit_mode:2; uint8_t pfit_text_mode_enhanced:1; uint8_t pfit_gfx_mode_enhanced:1; uint8_t pfit_ratio_auto:1; uint8_t pixel_dither:1; uint8_t lvds_edid:1; uint8_t rsvd2:1; uint8_t rsvd4; } __attribute__ ((packed)); /* 915+ only */ struct bdb_tv_features { /* need to verify bit ordering */ uint16_t under_over_scan_via_yprpb:2; uint16_t rsvd1:10; uint16_t under_over_scan_via_dvi:2; uint16_t add_overscan_mode:1; uint16_t rsvd2:1; } __attribute__ ((packed)); struct lvds_fp_timing { uint16_t x_res; uint16_t y_res; uint32_t lvds_reg; uint32_t lvds_reg_val; uint32_t pp_on_reg; uint32_t pp_on_reg_val; uint32_t pp_off_reg; uint32_t pp_off_reg_val; uint32_t pp_cycle_reg; uint32_t pp_cycle_reg_val; uint32_t pfit_reg; uint32_t pfit_reg_val; uint16_t terminator; } __attribute__ ((packed)); struct lvds_dvo_timing { uint16_t dclk; /**< In 10khz */ uint8_t hactive; uint8_t hblank; uint8_t high_h; /**< 7:4 = hactive 11:8, 3:0 = hblank 11:8 */ uint8_t vactive; uint8_t vblank; uint8_t high_v; /**< 7:4 = vactive 11:8, 3:0 = vblank 11:8 */ uint8_t hsync_off; uint8_t hsync_pulse_width; uint8_t vsync_off; uint8_t high_hsync_off; /**< 7:6 = hsync off 9:8 */ uint8_t h_image; uint8_t v_image; uint8_t max_hv; uint8_t h_border; uint8_t v_border; uint8_t flags; } __attribute__ ((packed)); struct lvds_dvo_timing2 { uint16_t clock; /**< In 10khz */ uint8_t hactive_lo; uint8_t hblank_lo; uint8_t hblank_hi:4; uint8_t hactive_hi:4; uint8_t vactive_lo; uint8_t vblank_lo; uint8_t vblank_hi:4; uint8_t vactive_hi:4; uint8_t hsync_off_lo; uint8_t hsync_pulse_width; uint8_t vsync_pulse_width:4; uint8_t vsync_off:4; uint8_t rsvd0:6; uint8_t hsync_off_hi:2; uint8_t h_image; uint8_t v_image; uint8_t max_hv; uint8_t h_border; uint8_t v_border; uint8_t rsvd1:3; uint8_t digital:2; uint8_t vsync_positive:1; uint8_t hsync_positive:1; uint8_t rsvd2:1; } __attribute__((packed)); struct lvds_pnp_id { uint16_t mfg_name; uint16_t product_code; uint32_t serial; uint8_t mfg_week; uint8_t mfg_year; } __attribute__ ((packed));; /* LFP pointer table contains entries to the struct below */ struct bdb_lvds_lfp_data_ptr { uint16_t fp_timing_offset; /* offsets are from start of bdb */ uint8_t fp_table_size; uint16_t dvo_timing_offset; uint8_t dvo_table_size; uint16_t panel_pnp_id_offset; uint8_t pnp_table_size; } __attribute__ ((packed)); struct bdb_lvds_lfp_data_ptrs { uint8_t lvds_entries; struct bdb_lvds_lfp_data_ptr ptr[16]; } __attribute__ ((packed)); struct bdb_lvds_lfp_data_entry { struct lvds_fp_timing fp_timing; struct lvds_dvo_timing dvo_timing; struct lvds_pnp_id pnp_id; } __attribute__ ((packed)); struct bdb_lvds_lfp_data { struct bdb_lvds_lfp_data_entry data[16]; } __attribute__ ((packed)); #define BACKLIGHT_TYPE_NONE 0 #define BACKLIGHT_TYPE_I2C 1 #define BACKLIGHT_TYPE_PWM 2 #define BACKLIGHT_GMBUS_100KHZ 0 #define BACKLIGHT_GMBUS_50KHZ 1 #define BACKLIGHT_GMBUS_400KHZ 2 #define BACKLIGHT_GMBUS_1MHZ 3 struct backlight_info { uint8_t inverter_type:2; /* see BACKLIGHT_TYPE_* above */ uint8_t inverter_polarity:1; /* 1 means 0 is max, 255 is min */ uint8_t gpio_pins:3; /* see GPIO_PIN_* above */ uint8_t gmbus_speed:2; uint16_t pwm_frequency; /* in Hz */ uint8_t min_brightness; /* Next two are only for 915+ systems */ uint8_t i2c_addr; uint8_t i2c_cmd; } __attribute((packed)); struct bdb_backlight_control { uint8_t row_size; struct backlight_info lfps[16]; } __attribute__ ((packed)); struct bdb_bia { uint8_t bia_enable:1; uint8_t bia_level:3; uint8_t rsvd1:3; uint8_t als_enable:1; uint8_t als_response_data[20]; } __attribute((packed)); struct aimdb_header { char signature[16]; char oem_device[20]; uint16_t aimdb_version; uint16_t aimdb_header_size; uint16_t aimdb_size; } __attribute__ ((packed)); struct aimdb_block { uint8_t aimdb_id; uint16_t aimdb_size; } __attribute__ ((packed)); struct vch_panel_data { uint16_t fp_timing_offset; uint8_t fp_timing_size; uint16_t dvo_timing_offset; uint8_t dvo_timing_size; uint16_t text_fitting_offset; uint8_t text_fitting_size; uint16_t graphics_fitting_offset; uint8_t graphics_fitting_size; } __attribute__ ((packed)); struct vch_bdb_22 { struct aimdb_block aimdb_block; struct vch_panel_data panels[16]; } __attribute__ ((packed)); #define BLC_INVERTER_TYPE_NONE 0 #define BLC_INVERTER_TYPE_I2C 1 #define BLC_INVERTER_TYPE_PWM 2 #define BLC_GPIO_NONE 0 #define BLC_GPIO_I2C 1 #define BLC_GPIO_CRT_DDC 2 #define BLC_GPIO_DVI_DDC 3 #define BLC_GPIO_SDVO_I2C 5 struct blc_struct { uint8_t inverter_type:2; uint8_t inverter_polarity:1; /* 1 means inverted (0 = max brightness) */ uint8_t gpio_pins:3; uint8_t gmbus_speed:2; uint16_t pwm_freq; /* in Hz */ uint8_t min_brightness; /* (0-255) */ uint8_t i2c_slave_addr; uint8_t i2c_cmd; } __attribute__ ((packed)); struct bdb_lvds_backlight { uint8_t blcstruct_size; struct blc_struct panels[16]; } __attribute__ ((packed)); struct bdb_lvds_power { uint8_t dpst_enabled:1; uint8_t pwr_prefs:3; uint8_t rsvd1:3; uint8_t als_enabled:1; uint16_t als_backlight1; uint16_t als_backlight2; uint16_t als_backlight3; uint16_t als_backlight4; uint16_t als_backlight5; } __attribute__ ((packed)); #define BDB_DRIVER_NO_LVDS 0 #define BDB_DRIVER_INT_LVDS 1 #define BDB_DRIVER_SDVO_LVDS 2 #define BDB_DRIVER_EDP 3 struct bdb_driver_feature { uint8_t boot_dev_algorithm:1; uint8_t block_display_switch:1; uint8_t allow_display_switch:1; uint8_t hotplug_dvo:1; uint8_t dual_view_zoom:1; uint8_t int15h_hook:1; uint8_t sprite_in_clone:1; uint8_t primary_lfp_id:1; uint16_t boot_mode_x; uint16_t boot_mode_y; uint8_t boot_mode_bpp; uint8_t boot_mode_refresh; uint16_t enable_lfp_primary:1; uint16_t selective_mode_pruning:1; uint16_t dual_frequency:1; uint16_t render_clock_freq:1; /* 0: high freq; 1: low freq */ uint16_t nt_clone_support:1; uint16_t power_scheme_ui:1; /* 0: CUI; 1: 3rd party */ uint16_t sprite_display_assign:1; /* 0: secondary; 1: primary */ uint16_t cui_aspect_scaling:1; uint16_t preserve_aspect_ratio:1; uint16_t sdvo_device_power_down:1; uint16_t crt_hotplug:1; uint16_t lvds_config:2; uint16_t reserved:3; uint8_t static_display:1; uint8_t reserved2:7; uint16_t legacy_crt_max_x; uint16_t legacy_crt_max_y; uint8_t legacy_crt_max_refresh; } __attribute__ ((packed)); struct bdb_sdvo_lvds_options { uint8_t panel_backlight; uint8_t h40_set_panel_type; uint8_t panel_type; uint8_t ssc_clk_freq; uint16_t als_low_trip; uint16_t als_high_trip; uint8_t sclalarcoeff_tab_row_num; uint8_t sclalarcoeff_tab_row_size; uint8_t coefficient[8]; uint8_t panel_misc_bits_1; uint8_t panel_misc_bits_2; uint8_t panel_misc_bits_3; uint8_t panel_misc_bits_4; } __attribute__ ((packed)); #define EDP_18BPP 0 #define EDP_24BPP 1 #define EDP_30BPP 2 #define EDP_RATE_1_62 0 #define EDP_RATE_2_7 1 #define EDP_LANE_1 0 #define EDP_LANE_2 1 #define EDP_LANE_4 3 #define EDP_PREEMPHASIS_NONE 0 #define EDP_PREEMPHASIS_3_5dB 1 #define EDP_PREEMPHASIS_6dB 2 #define EDP_PREEMPHASIS_9_5dB 3 #define EDP_VSWING_0_4V 0 #define EDP_VSWING_0_6V 1 #define EDP_VSWING_0_8V 2 #define EDP_VSWING_1_2V 3 struct edp_power_seq { uint16_t t3; uint16_t t7; uint16_t t9; uint16_t t10; uint16_t t12; } __attribute__ ((packed)); struct edp_link_params { uint8_t rate:4; uint8_t lanes:4; uint8_t preemphasis:4; uint8_t vswing:4; } __attribute__ ((packed)); struct bdb_edp { struct edp_power_seq power_seqs[16]; uint32_t color_depth; uint32_t sdrrs_msa_timing_delay; struct edp_link_params link_params[16]; } __attribute__ ((packed)); /* * Driver<->VBIOS interaction occurs through scratch bits in * GR18 & SWF*. * * The VBIOS/firmware will signal to the gfx driver through the ASLE interrupt * (visible in the interupt regs at bit 0) when it wants something done. * * Pre-965: * The gfx driver can make calls to the VBIOS/firmware through an SMI request, * generated by writing to offset 0xe0 of the device's config space (see the * publically available 915 PRM for details). * * 965 and above: * IGD OpRegion requests to the VBIOS/firmware are made using SWSCI, which can * be triggered by writing to offset 0xe4 (see the publically available * 965 graphics PRM for details). */ /* GR18 bits are set on display switch and hotkey events */ #define GR18_DRIVER_SWITCH_EN (1<<7) /* 0: VBIOS control, 1: driver control */ #define GR18_HOTKEY_MASK 0x78 /* See also SWF4 15:0 */ #define GR18_HK_NONE (0x0<<3) #define GR18_HK_LFP_STRETCH (0x1<<3) #define GR18_HK_TOGGLE_DISP (0x2<<3) #define GR18_HK_DISP_SWITCH (0x4<<3) /* see SWF14 15:0 for what to enable */ #define GR18_HK_POPUP_DISABLED (0x6<<3) #define GR18_HK_POPUP_ENABLED (0x7<<3) #define GR18_HK_PFIT (0x8<<3) #define GR18_HK_APM_CHANGE (0xa<<3) #define GR18_HK_MULTIPLE (0xc<<3) #define GR18_USER_INT_EN (1<<2) #define GR18_A0000_FLUSH_EN (1<<1) #define GR18_SMM_EN (1<<0) /* Set by driver, cleared by VBIOS */ #define SWF00_YRES_SHIFT 16 #define SWF00_XRES_SHIFT 0 #define SWF00_RES_MASK 0xffff /* Set by VBIOS at boot time and driver at runtime */ #define SWF01_TV2_FORMAT_SHIFT 8 #define SWF01_TV1_FORMAT_SHIFT 0 #define SWF01_TV_FORMAT_MASK 0xffff #define SWF10_VBIOS_BLC_I2C_EN (1<<29) #define SWF10_GTT_OVERRIDE_EN (1<<28) #define SWF10_LFP_DPMS_OVR (1<<27) /* override DPMS on display switch */ #define SWF10_ACTIVE_TOGGLE_LIST_MASK (7<<24) #define SWF10_OLD_TOGGLE 0x0 #define SWF10_TOGGLE_LIST_1 0x1 #define SWF10_TOGGLE_LIST_2 0x2 #define SWF10_TOGGLE_LIST_3 0x3 #define SWF10_TOGGLE_LIST_4 0x4 #define SWF10_PANNING_EN (1<<23) #define SWF10_DRIVER_LOADED (1<<22) #define SWF10_EXTENDED_DESKTOP (1<<21) #define SWF10_EXCLUSIVE_MODE (1<<20) #define SWF10_OVERLAY_EN (1<<19) #define SWF10_PLANEB_HOLDOFF (1<<18) #define SWF10_PLANEA_HOLDOFF (1<<17) #define SWF10_VGA_HOLDOFF (1<<16) #define SWF10_ACTIVE_DISP_MASK 0xffff #define SWF10_PIPEB_LFP2 (1<<15) #define SWF10_PIPEB_EFP2 (1<<14) #define SWF10_PIPEB_TV2 (1<<13) #define SWF10_PIPEB_CRT2 (1<<12) #define SWF10_PIPEB_LFP (1<<11) #define SWF10_PIPEB_EFP (1<<10) #define SWF10_PIPEB_TV (1<<9) #define SWF10_PIPEB_CRT (1<<8) #define SWF10_PIPEA_LFP2 (1<<7) #define SWF10_PIPEA_EFP2 (1<<6) #define SWF10_PIPEA_TV2 (1<<5) #define SWF10_PIPEA_CRT2 (1<<4) #define SWF10_PIPEA_LFP (1<<3) #define SWF10_PIPEA_EFP (1<<2) #define SWF10_PIPEA_TV (1<<1) #define SWF10_PIPEA_CRT (1<<0) #define SWF11_MEMORY_SIZE_SHIFT 16 #define SWF11_SV_TEST_EN (1<<15) #define SWF11_IS_AGP (1<<14) #define SWF11_DISPLAY_HOLDOFF (1<<13) #define SWF11_DPMS_REDUCED (1<<12) #define SWF11_IS_VBE_MODE (1<<11) #define SWF11_PIPEB_ACCESS (1<<10) /* 0 here means pipe a */ #define SWF11_DPMS_MASK 0x07 #define SWF11_DPMS_OFF (1<<2) #define SWF11_DPMS_SUSPEND (1<<1) #define SWF11_DPMS_STANDBY (1<<0) #define SWF11_DPMS_ON 0 #define SWF14_GFX_PFIT_EN (1<<31) #define SWF14_TEXT_PFIT_EN (1<<30) #define SWF14_LID_SWITCH_EN (1<<29) #define SWF14_POPUP_EN (1<<28) #define SWF14_DISPLAY_HOLDOFF (1<<27) #define SWF14_DISP_DETECT_EN (1<<26) #define SWF14_DOCKING_STATUS_DOCKED (1<<25) /* 0 here means undocked */ #define SWF14_DRIVER_STATUS (1<<24) #define SWF14_OS_TYPE_WIN9X (1<<23) #define SWF14_OS_TYPE_WINNT (1<<22) /* 21:19 rsvd */ #define SWF14_PM_TYPE_MASK 0x00070000 #define SWF14_PM_ACPI_VIDEO (0x4 << 16) #define SWF14_PM_ACPI (0x3 << 16) #define SWF14_PM_APM_12 (0x2 << 16) #define SWF14_PM_APM_11 (0x1 << 16) #define SWF14_HK_REQUEST_MASK 0x0000ffff /* see GR18 6:3 for event type */ /* if GR18 indicates a display switch */ #define SWF14_DS_PIPEB_LFP2_EN (1<<15) #define SWF14_DS_PIPEB_EFP2_EN (1<<14) #define SWF14_DS_PIPEB_TV2_EN (1<<13) #define SWF14_DS_PIPEB_CRT2_EN (1<<12) #define SWF14_DS_PIPEB_LFP_EN (1<<11) #define SWF14_DS_PIPEB_EFP_EN (1<<10) #define SWF14_DS_PIPEB_TV_EN (1<<9) #define SWF14_DS_PIPEB_CRT_EN (1<<8) #define SWF14_DS_PIPEA_LFP2_EN (1<<7) #define SWF14_DS_PIPEA_EFP2_EN (1<<6) #define SWF14_DS_PIPEA_TV2_EN (1<<5) #define SWF14_DS_PIPEA_CRT2_EN (1<<4) #define SWF14_DS_PIPEA_LFP_EN (1<<3) #define SWF14_DS_PIPEA_EFP_EN (1<<2) #define SWF14_DS_PIPEA_TV_EN (1<<1) #define SWF14_DS_PIPEA_CRT_EN (1<<0) /* if GR18 indicates a panel fitting request */ #define SWF14_PFIT_EN (1<<0) /* 0 means disable */ /* if GR18 indicates an APM change request */ #define SWF14_APM_HIBERNATE 0x4 #define SWF14_APM_SUSPEND 0x3 #define SWF14_APM_STANDBY 0x1 #define SWF14_APM_RESTORE 0x0 #endif /* _INTEL_BIOS_H_ */ intel-gpu-tools-1.3/tools/intel_reg_checker.c0000664000175100017510000002440511647345636016330 00000000000000/* Copyright © 2011 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ #include #include #include #include #include #include #include "intel_gpu_tools.h" static uint32_t devid; static int gen; static inline uint32_t read_reg(uint32_t reg) { return *(volatile uint32_t *)((volatile char *)mmio + reg); } static uint32_t read_and_print_reg(const char *name, uint32_t reg) { uint32_t val = read_reg(reg); printf("%s (0x%x): 0x%08x\n", name, reg, val); return val; } static void check_chicken_unset(const char *name, uint32_t reg) { uint32_t val = read_and_print_reg(name, reg); if (val != 0) { fprintf(stderr, " WARN: chicken bits set\n"); } else { printf(" OK: chicken bits unset\n"); } } static void check_bit(uint32_t val, int bit, const char *bitname, bool set) { if (!!(val & (1 << bit)) != set) { fprintf(stderr, " (bit %2d) FAIL: %s must be %s\n", bit, bitname, set ? "set" : "unset"); } else { printf(" (bit %2d) OK: %s\n", bit, bitname); } } static void check_perf_bit(uint32_t val, int bit, const char *bitname, bool set) { if (!!(val & (1 << bit)) != set) { printf(" (bit %2d) PERF: %s should be %s\n", bit, bitname, set ? "set" : "unset"); } else { printf(" (bit %2d) OK: %s\n", bit, bitname); } } static void check_mi_mode(void) { /* Described in page 14-16 of the IHD_OS_Vol1_Part3.pdf * specification. */ uint32_t mi_mode = read_and_print_reg("MI_MODE", 0x209c); /* From page 14: * * Async Flip Performance mode * Project: All * Default Value: 0h * Format: U1 * [DevSNB] This bit must be set to ‘1’ */ if (gen == 6) check_bit(mi_mode, 14, "Async Flip Performance mode", true); else check_perf_bit(mi_mode, 14, "Async Flip Performance mode", false); check_perf_bit(mi_mode, 13, "Flush Performance Mode", false); /* Our driver relies on MI_FLUSH, unfortunately. */ if (gen >= 6) check_bit(mi_mode, 12, "MI_FLUSH enable", true); /* From page 15: * * "1h: LRA mode of allocation. Used for validation purposes" */ if (gen < 7) check_bit(mi_mode, 7, "Vertex Shader Cache Mode", false); /* From page 16: * * "To avoid deadlock conditions in hardware this bit * needs to be set for normal operation. */ check_bit(mi_mode, 6, "Vertex Shader Timer Dispatch Enable", true); } static void check_gfx_mode(void) { /* Described in page 17-19 of the IHD_OS_Vol1_Part3.pdf * specification. */ uint32_t gfx_mode; if (gen < 6) return; if (gen == 6) gfx_mode = read_and_print_reg("GFX_MODE", 0x2520); else gfx_mode = read_and_print_reg("GFX_MODE", 0x229c); /* Our driver only updates page tables at batchbuffer * boundaries, so we don't need TLB flushes at other times. */ check_perf_bit(gfx_mode, 13, "Flush TLB Invalidation Mode", true); } static void check_gt_mode(void) { /* Described in page 20-22 of the IHD_OS_Vol1_Part3.pdf * specification. */ uint32_t gt_mode; if (gen < 6) return; if (gen == 6) gt_mode = read_and_print_reg("GT_MODE", 0x20d0); else gt_mode = read_and_print_reg("GT_MODE", 0x7008); if (gen == 6) check_perf_bit(gt_mode, 8, "Full Rate Sampler Disable", false); /* For DevSmallGT, this bit must be set, which means disable * hashing. */ if (devid == PCI_CHIP_SANDYBRIDGE_GT1 || devid == PCI_CHIP_SANDYBRIDGE_M_GT1) check_bit(gt_mode, 6, "WIZ Hashing disable", true); else if (gen == 6) check_perf_bit(gt_mode, 6, "WIZ Hashing disable", false); if (gen == 6) { check_perf_bit(gt_mode, 5, "TD Four Row Dispatch Disable", false); check_perf_bit(gt_mode, 4, "Full Size URB Disable", false); check_perf_bit(gt_mode, 3, "Full Size SF FIFO Disable", false); check_perf_bit(gt_mode, 1, "VS Quad Thread Dispatch Disable", false); } } static void check_cache_mode_0(void) { /* Described in page 23-25 of the IHD_OS_Vol1_Part3.pdf * specification. */ uint32_t cache_mode_0; if (gen >= 7) cache_mode_0 = read_and_print_reg("CACHE_MODE_0", 0x7000); else cache_mode_0 = read_and_print_reg("CACHE_MODE_0", 0x2120); check_perf_bit(cache_mode_0, 15, "Sampler L2 Disable", false); check_perf_bit(cache_mode_0, 9, "Sampler L2 TLB Prefetch Enable", true); check_perf_bit(cache_mode_0, 8, "Depth Related Cache Pipelined Flush Disable", false); /* From page 24: * * "If this bit is set, RCCunit will have LRA as * replacement policy. The default value i.e. ( when this * bit is reset ) indicates that non-LRA eviction * policy. This bit must be reset. LRA replacement policy * is not supported." * * And the same for STC Eviction Policy. */ check_bit(cache_mode_0, 5, "STC LRA Eviction Policy", false); if (gen >= 6) check_bit(cache_mode_0, 4, "RCC LRA Eviction Policy", false); check_perf_bit(cache_mode_0, 3, "Hierarchical Z Disable", false); if (gen == 6) { check_perf_bit(cache_mode_0, 2, "Hierarchical Z RAW Stall Optimization " "Disable", false); } /* From page 25: * * "This bit must be 0. Operational Flushes [DevSNB] are * not supported in [DevSNB]. SW must flush the render * target after front buffer rendering." */ check_bit(cache_mode_0, 0, "Render Cache Operational Flush", false); } static void check_cache_mode_1(void) { /* Described in page 23-25 of the IHD_OS_Vol1_Part3.pdf * specification. */ uint32_t cache_mode_1; if (gen >= 7) cache_mode_1 = read_and_print_reg("CACHE_MODE_1", 0x7004); else cache_mode_1 = read_and_print_reg("CACHE_MODE_1", 0x2124); if (gen >= 7) { check_perf_bit(cache_mode_1, 13, "STC Address Lookup Optimization Disable", false); } /* From page 24: * * "If this bit is set, Hizunit will have LRA as * replacement policy. The default value i.e. (when this * bit is reset) indicates the non-LRA eviction * policy. For performance reasons, this bit must be * reset." */ check_bit(cache_mode_1, 12, "HIZ LRA Eviction Policy", false); /* Page 26 describes these bits as reserved (debug only). */ check_bit(cache_mode_1, 11, "DAP Instruction and State Cache Invalidate", false); check_bit(cache_mode_1, 10, "Instruction L1 Cache and In-Flight Queue Disable", false); check_bit(cache_mode_1, 9, "Instruction L2 Cache Fill Buffers Disable", false); if (gen >= 7) { check_perf_bit(cache_mode_1, 6, "Pixel Backend sub-span collection " "Optimization Disable", false); check_perf_bit(cache_mode_1, 5, "MCS Cache Disable", false); } check_perf_bit(cache_mode_1, 4, "Data Disable", false); if (gen == 6) { /* In a later update of the documentation, it says: * * "[DevSNB:A0{WKA1}] [DevSNB]: This bit must be * set for depth buffer format * D24_UNORM_S8_UINT." * * XXX: Does that mean A0 only, or all DevSNB? */ check_perf_bit(cache_mode_1, 3, "Depth Read Hit Write-Only Optimization " "Disable", false); check_perf_bit(cache_mode_1, 2, "Depth Cache LRA Hunt Feature Disable", false); } check_bit(cache_mode_1, 1, "Instruction and State L2 Cache Disable", false); check_bit(cache_mode_1, 0, "Instruction and State L1 Cache Disable", false); } static void check_3d_chicken4(void) { /* Described in page 23-25 of the IHD_OS_Vol1_Part3.pdf * specification. */ uint32_t _3d_chicken4 = read_and_print_reg("3D_CHICKEN4", 0x20d4); check_perf_bit(_3d_chicken4, 6, "3D Scoreboard Hashing Enable", true); if (_3d_chicken4 & 0x0fbf) { fprintf(stderr, " WARN: other non-thread deps bits set\n"); } else { printf(" OK: other non-thread deps bits unset\n"); } } static void check_dpfc_control_sa(void) { uint32_t dpfc_control_sa; if (gen != 6) return; dpfc_control_sa = read_and_print_reg("DPFC_CONTROL_SA", 0x100100); /* This is needed for framebuffer compression for us to be * able to access the framebuffer by the CPU through the GTT. */ check_bit(dpfc_control_sa, 29, "CPU Fence Enable", true); } int main(int argc, char** argv) { struct pci_device *dev; dev = intel_get_pci_device(); devid = dev->device_id; intel_get_mmio(dev); if (IS_GEN7(devid)) gen = 7; else if (IS_GEN6(devid)) gen = 6; else if (IS_GEN5(devid)) gen = 5; else gen = 4; check_mi_mode(); check_gfx_mode(); check_gt_mode(); check_cache_mode_0(); check_cache_mode_1(); if (gen < 7) { check_chicken_unset("3D_CHICKEN", 0x2084); check_chicken_unset("3D_CHICKEN2", 0x208c); } else { check_chicken_unset("FF_SLICE_CHICKEN", 0x2088); } if (gen >= 6) check_chicken_unset("3D_CHICKEN3", 0x2090); if (gen == 6) check_3d_chicken4(); if (gen >= 7) { check_chicken_unset("FF_SLICE_CS_CHICKEN1", 0x20e0); check_chicken_unset("FF_SLICE_CS_CHICKEN2", 0x20e4); check_chicken_unset("FF_SLICE_CS_CHICKEN3", 0x20e8); check_chicken_unset("COMMON_SLICE_CHICKEN1", 0x7010); check_chicken_unset("COMMON_SLICE_CHICKEN2", 0x7014); check_chicken_unset("WM_CHICKEN", 0x5580); check_chicken_unset("HALF_SLICE_CHICKEN", 0xe100); check_chicken_unset("HALF_SLICE_CHICKEN2", 0xe180); check_chicken_unset("ROW_CHICKEN", 0xe4f0); check_chicken_unset("ROW_CHICKEN2", 0xe4f4); } check_chicken_unset("ECOSKPD", 0x21d0); check_dpfc_control_sa(); return 0; } intel-gpu-tools-1.3/tools/Makefile.am0000644000175100017510000000170412014634425014541 00000000000000bin_PROGRAMS = \ intel_disable_clock_gating \ intel_audio_dump \ intel_backlight \ intel_bios_dumper \ intel_bios_reader \ intel_error_decode \ intel_gpu_top \ intel_gpu_time \ intel_gtt \ intel_stepping \ intel_reg_checker \ intel_reg_dumper \ intel_reg_snapshot \ intel_reg_write \ intel_reg_read \ intel_forcewaked \ intel_dpio_read \ intel_dpio_write \ intel_l3_parity noinst_PROGRAMS = \ intel_dump_decode \ intel_infoframes \ intel_lid \ intel_panel_fitter dist_bin_SCRIPTS = intel_gpu_abrt AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/lib AM_CFLAGS = $(DRM_CFLAGS) $(PCIACCESS_CFLAGS) $(CWARNFLAGS) $(CAIRO_CFLAGS) LDADD = $(top_builddir)/lib/libintel_tools.la $(DRM_LIBS) $(PCIACCESS_LIBS) $(CAIRO_LIBS) intel_dump_decode_SOURCES = \ intel_dump_decode.c intel_error_decode_SOURCES = \ intel_error_decode.c intel_bios_reader_SOURCES = \ intel_bios_reader.c \ intel_bios.h intel-gpu-tools-1.3/tools/intel_gpu_abrt0000775000175100017510000000143111663161675015443 00000000000000#!/bin/sh if [ -d /debug/dri ] ; then debugfs_path=/debug_dri fi if [ -d /sys/kernel/debug/dri ] ; then debugfs_path=/sys/kernel/debug/dri fi i915_debugfs=x for dir in `ls $debugfs_path` ; do if [ -f $debugfs_path/$dir/i915_error_state ] ; then i915_debugfs=$debugfs_path/$dir break fi done if [ $i915_debugfs = "x" ] ; then echo i915 debugfs path not found. exit 1 fi tmpdir=`mktemp -d` tardir=$tmpdir/intel_gpu_abrt mkdir $tardir mkdir $tardir/debugfs cp $i915_debugfs/* $tardir/debugfs mkdir $tardir/mod_opts cp /sys/module/i915/parameters/* $tardir/mod_opts mkdir $tardir/X cp /var/log/Xorg.*.log $tardir/X cp /etc/X11/xorg.conf $tardir/X dmesg > $tardir/dmesg lspci -nn > $tardir/lspci (cd $tmpdir; tar -c intel_gpu_abrt ) > intel_gpu_abrt.tar rm $tmpdir -Rf exit 0 intel-gpu-tools-1.3/tools/intel_error_decode.c0000664000175100017510000003301711752544417016515 00000000000000/* -*- c-basic-offset: 4 -*- */ /* * Copyright © 2007 Intel Corporation * Copyright © 2009 Intel Corporation * Copyright © 2010 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Eric Anholt * Carl Worth * Chris Wilson * */ /** @file intel_decode.c * This file contains code to print out batchbuffer contents in a * human-readable format. * * The current version only supports i915 packets, and only pretty-prints a * subset of them. The intention is for it to make just a best attempt to * decode, but never crash in the process. */ #define _GNU_SOURCE #include #include #include #include #include #include #include #include #include #include #include "intel_chipset.h" #include "intel_gpu_tools.h" #include "instdone.h" static void print_instdone (uint32_t devid, unsigned int instdone, unsigned int instdone1) { int i; static int once; if (!once) { init_instdone_definitions(devid); once = 1; } for (i = 0; i < num_instdone_bits; i++) { int busy = 0; if (instdone_bits[i].reg == INST_DONE_1) { if (!(instdone1 & instdone_bits[i].bit)) busy = 1; } else { if (!(instdone & instdone_bits[i].bit)) busy = 1; } if (busy) printf(" busy: %s\n", instdone_bits[i].name); } } static void print_i830_pgtbl_err(unsigned int reg) { const char *str; switch((reg >> 3) & 0xf) { case 0x1: str = "Overlay TLB"; break; case 0x2: str = "Display A TLB"; break; case 0x3: str = "Host TLB"; break; case 0x4: str = "Render TLB"; break; case 0x5: str = "Display C TLB"; break; case 0x6: str = "Mapping TLB"; break; case 0x7: str = "Command Stream TLB"; break; case 0x8: str = "Vertex Buffer TLB"; break; case 0x9: str = "Display B TLB"; break; case 0xa: str = "Reserved System Memory"; break; case 0xb: str = "Compressor TLB"; break; case 0xc: str = "Binner TLB"; break; default: str = "unknown"; break; } if (str) printf (" source = %s\n", str); switch(reg & 0x7) { case 0x0: str = "Invalid GTT"; break; case 0x1: str = "Invalid GTT PTE"; break; case 0x2: str = "Invalid Memory"; break; case 0x3: str = "Invalid TLB miss"; break; case 0x4: str = "Invalid PTE data"; break; case 0x5: str = "Invalid LocalMemory not present"; break; case 0x6: str = "Invalid Tiling"; break; case 0x7: str = "Host to CAM"; break; } printf (" error = %s\n", str); } static void print_i915_pgtbl_err(unsigned int reg) { if (reg & (1 << 29)) printf (" Cursor A: Invalid GTT PTE\n"); if (reg & (1 << 28)) printf (" Cursor B: Invalid GTT PTE\n"); if (reg & (1 << 27)) printf (" MT: Invalid tiling\n"); if (reg & (1 << 26)) printf (" MT: Invalid GTT PTE\n"); if (reg & (1 << 25)) printf (" LC: Invalid tiling\n"); if (reg & (1 << 24)) printf (" LC: Invalid GTT PTE\n"); if (reg & (1 << 23)) printf (" BIN VertexData: Invalid GTT PTE\n"); if (reg & (1 << 22)) printf (" BIN Instruction: Invalid GTT PTE\n"); if (reg & (1 << 21)) printf (" CS VertexData: Invalid GTT PTE\n"); if (reg & (1 << 20)) printf (" CS Instruction: Invalid GTT PTE\n"); if (reg & (1 << 19)) printf (" CS: Invalid GTT\n"); if (reg & (1 << 18)) printf (" Overlay: Invalid tiling\n"); if (reg & (1 << 16)) printf (" Overlay: Invalid GTT PTE\n"); if (reg & (1 << 14)) printf (" Display C: Invalid tiling\n"); if (reg & (1 << 12)) printf (" Display C: Invalid GTT PTE\n"); if (reg & (1 << 10)) printf (" Display B: Invalid tiling\n"); if (reg & (1 << 8)) printf (" Display B: Invalid GTT PTE\n"); if (reg & (1 << 6)) printf (" Display A: Invalid tiling\n"); if (reg & (1 << 4)) printf (" Display A: Invalid GTT PTE\n"); if (reg & (1 << 1)) printf (" Host Invalid PTE data\n"); if (reg & (1 << 0)) printf (" Host Invalid GTT PTE\n"); } static void print_i965_pgtbl_err(unsigned int reg) { if (reg & (1 << 26)) printf (" Invalid Sampler Cache GTT entry\n"); if (reg & (1 << 24)) printf (" Invalid Render Cache GTT entry\n"); if (reg & (1 << 23)) printf (" Invalid Instruction/State Cache GTT entry\n"); if (reg & (1 << 22)) printf (" There is no ROC, this cannot occur!\n"); if (reg & (1 << 21)) printf (" Invalid GTT entry during Vertex Fetch\n"); if (reg & (1 << 20)) printf (" Invalid GTT entry during Command Fetch\n"); if (reg & (1 << 19)) printf (" Invalid GTT entry during CS\n"); if (reg & (1 << 18)) printf (" Invalid GTT entry during Cursor Fetch\n"); if (reg & (1 << 17)) printf (" Invalid GTT entry during Overlay Fetch\n"); if (reg & (1 << 8)) printf (" Invalid GTT entry during Display B Fetch\n"); if (reg & (1 << 4)) printf (" Invalid GTT entry during Display A Fetch\n"); if (reg & (1 << 1)) printf (" Valid PTE references illegal memory\n"); if (reg & (1 << 0)) printf (" Invalid GTT entry during fetch for host\n"); } static void print_pgtbl_err(unsigned int reg, unsigned int devid) { if (IS_965(devid)) { return print_i965_pgtbl_err(reg); } else if (IS_GEN3(devid)) { return print_i915_pgtbl_err(reg); } else { return print_i830_pgtbl_err(reg); } } static void print_snb_fence(unsigned int devid, uint64_t fence) { printf(" %svalid, %c-tiled, pitch: %i, start: 0x%08x, size: %u\n", fence & 1 ? "" : "in", fence & (1<<1) ? 'y' : 'x', (int)(((fence>>32)&0xfff)+1)*128, (uint32_t)fence & 0xfffff000, (uint32_t)(((fence>>32)&0xfffff000) - (fence&0xfffff000) + 4096)); } static void print_i965_fence(unsigned int devid, uint64_t fence) { printf(" %svalid, %c-tiled, pitch: %i, start: 0x%08x, size: %u\n", fence & 1 ? "" : "in", fence & (1<<1) ? 'y' : 'x', (int)(((fence>>2)&0x1ff)+1)*128, (uint32_t)fence & 0xfffff000, (uint32_t)(((fence>>32)&0xfffff000) - (fence&0xfffff000) + 4096)); } static void print_i915_fence(unsigned int devid, uint64_t fence) { unsigned tile_width; if ((fence & 12) && !IS_915(devid)) tile_width = 128; else tile_width = 512; printf(" %svalid, %c-tiled, pitch: %i, start: 0x%08x, size: %i\n", fence & 1 ? "" : "in", fence & 12 ? 'y' : 'x', (1<<((fence>>4)&0xf))*tile_width, (uint32_t)fence & 0xff00000, 1<<(20 + ((fence>>8)&0xf))); } static void print_i830_fence(unsigned int devid, uint64_t fence) { printf(" %svalid, %c-tiled, pitch: %i, start: 0x%08x, size: %i\n", fence & 1 ? "" : "in", fence & 12 ? 'y' : 'x', (1<<((fence>>4)&0xf))*128, (uint32_t)fence & 0x7f80000, 1<<(19 + ((fence>>8)&0xf))); } static void print_fence(unsigned int devid, uint64_t fence) { if (IS_GEN6(devid) || IS_GEN7(devid)) { return print_snb_fence(devid, fence); } else if (IS_GEN4(devid) || IS_GEN5(devid)) { return print_i965_fence(devid, fence); } else if (IS_GEN3(devid)) { return print_i915_fence(devid, fence); } else { return print_i830_fence(devid, fence); } } static void read_data_file (FILE *file) { struct drm_intel_decode *decode_ctx = NULL; uint32_t devid = PCI_CHIP_I855_GM; uint32_t *data = NULL; long long unsigned fence; int data_size = 0, count = 0, line_number = 0, matched; char *line = NULL; size_t line_size; uint32_t offset, value; uint32_t gtt_offset = 0, new_gtt_offset; const char *buffer_type[2] = { "ringbuffer", "batchbuffer" }; char *ring_name = NULL; int is_batch = 1; while (getline (&line, &line_size, file) > 0) { char *dashes; line_number++; dashes = strstr(line, "---"); if (dashes) { char *new_ring_name = malloc(dashes - line); strncpy(new_ring_name, line, dashes - line); new_ring_name[dashes - line - 1] = '\0'; matched = sscanf (dashes, "--- gtt_offset = 0x%08x\n", &new_gtt_offset); if (matched == 1) { if (count) { printf("%s (%s) at 0x%08x:\n", buffer_type[is_batch], ring_name, gtt_offset); drm_intel_decode_set_batch_pointer(decode_ctx, data, gtt_offset, count); drm_intel_decode(decode_ctx); count = 0; } gtt_offset = new_gtt_offset; is_batch = 1; free(ring_name); ring_name = new_ring_name; continue; } matched = sscanf (dashes, "--- ringbuffer = 0x%08x\n", &new_gtt_offset); if (matched == 1) { if (count) { printf("%s (%s) at 0x%08x:\n", buffer_type[is_batch], ring_name, gtt_offset); drm_intel_decode_set_batch_pointer(decode_ctx, data, gtt_offset, count); drm_intel_decode(decode_ctx); count = 0; } gtt_offset = new_gtt_offset; is_batch = 0; free(ring_name); ring_name = new_ring_name; continue; } } matched = sscanf (line, "%08x : %08x", &offset, &value); if (matched != 2) { unsigned int reg; /* display reg section is after the ringbuffers, don't mix them */ if (count) { printf("%s (%s) at 0x%08x:\n", buffer_type[is_batch], ring_name, gtt_offset); drm_intel_decode_set_batch_pointer(decode_ctx, data, gtt_offset, count); drm_intel_decode(decode_ctx); count = 0; } printf("%s", line); matched = sscanf (line, "PCI ID: 0x%04x\n", ®); if (matched == 0) matched = sscanf (line, " PCI ID: 0x%04x\n", ®); if (matched == 1) { devid = reg; printf("Detected GEN%i chipset\n", intel_gen(devid)); decode_ctx = drm_intel_decode_context_alloc(devid); } matched = sscanf (line, " ACTHD: 0x%08x\n", ®); if (matched == 1) drm_intel_decode_set_head_tail(decode_ctx, reg, 0xffffffff); matched = sscanf (line, " PGTBL_ER: 0x%08x\n", ®); if (matched == 1 && reg) print_pgtbl_err(reg, devid); matched = sscanf (line, " INSTDONE: 0x%08x\n", ®); if (matched == 1) print_instdone (devid, reg, -1); matched = sscanf (line, " INSTDONE1: 0x%08x\n", ®); if (matched == 1) print_instdone (devid, -1, reg); matched = sscanf (line, " fence[%i] = %Lx\n", ®, &fence); if (matched == 2) print_fence (devid, fence); continue; } count++; if (count > data_size) { data_size = data_size ? data_size * 2 : 1024; data = realloc (data, data_size * sizeof (uint32_t)); if (data == NULL) { fprintf (stderr, "Out of memory.\n"); exit (1); } } data[count-1] = value; } if (count) { printf("%s (%s) at 0x%08x:\n", buffer_type[is_batch], ring_name, gtt_offset); drm_intel_decode_set_batch_pointer(decode_ctx, data, gtt_offset, count); drm_intel_decode(decode_ctx); } free (data); free (line); free (ring_name); } int main (int argc, char *argv[]) { FILE *file; const char *path; char *filename = NULL; struct stat st; int error; if (argc > 2) { fprintf (stderr, "intel_gpu_decode: Parse an Intel GPU i915_error_state\n" "Usage:\n" "\t%s []\n" "\n" "With no arguments, debugfs-dri-directory is probed for in " "/debug and \n" "/sys/kernel/debug. Otherwise, it may be " "specified. If a file is given,\n" "it is parsed as an GPU dump in the format of " "/debug/dri/0/i915_error_state.\n", argv[0]); return 1; } if (argc == 1) { if (isatty(0)) { path = "/debug/dri"; error = stat (path, &st); if (error != 0) { path = "/sys/kernel/debug/dri"; error = stat (path, &st); if (error != 0) { errx(1, "Couldn't find i915 debugfs directory.\n\n" "Is debugfs mounted? You might try mounting it with a command such as:\n\n" "\tsudo mount -t debugfs debugfs /sys/kernel/debug\n"); } } } else { read_data_file(stdin); exit(0); } } else { path = argv[1]; error = stat (path, &st); if (error != 0) { fprintf (stderr, "Error opening %s: %s\n", path, strerror (errno)); exit (1); } } if (S_ISDIR (st.st_mode)) { asprintf (&filename, "%s/i915_error_state", path); file = fopen(filename, "r"); if (!file) { int minor; for (minor = 0; minor < 64; minor++) { free(filename); asprintf(&filename, "%s/%d/i915_error_state", path, minor); file = fopen(filename, "r"); if (file) break; } } if (!file) { fprintf (stderr, "Failed to find i915_error_state beneath %s\n", path); exit (1); } } else { file = fopen(path, "r"); if (!file) { fprintf (stderr, "Failed to open %s: %s\n", path, strerror (errno)); exit (1); } } read_data_file (file); fclose (file); if (filename != path) free (filename); return 0; } intel-gpu-tools-1.3/tools/intel_reg_write.c0000664000175100017510000000361411710277452016044 00000000000000/* * Copyright © 2007 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * * Authors: * Ben Gamari * */ #include #include #include #include #include "intel_gpu_tools.h" int main(int argc, char** argv) { uint32_t reg, value; volatile uint32_t *ptr; if (argc < 3) { printf("Usage: %s addr value\n", argv[0]); printf(" WARNING: This is dangerous to you and your system's health.\n"); printf(" Only for use in debugging.\n"); exit(1); } intel_register_access_init(intel_get_pci_device(), 0); sscanf(argv[1], "0x%x", ®); sscanf(argv[2], "0x%x", &value); ptr = (volatile uint32_t *)((volatile char *)mmio + reg); printf("Value before: 0x%X\n", *ptr); *ptr = value; printf("Value after: 0x%X\n", *ptr); intel_register_access_fini(); return 0; } intel-gpu-tools-1.3/tools/intel_reg_read.c0000664000175100017510000000772012015542673015626 00000000000000/* * Copyright © 2010 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * * Authors: * Zhenyu Wang * */ #include #include #include #include #include #include "intel_gpu_tools.h" static void bit_decode(uint32_t reg) { int i; for (i=31; i >= 0; i--) printf(" %2d", i); printf("\n"); for (i=31; i >= 0; i--) printf(" %2d", (reg & (1 << i)) && 1); printf("\n"); } static void dump_range(uint32_t start, uint32_t end) { int i; for (i = start; i < end; i += 4) printf("0x%X : 0x%X\n", i, *(volatile uint32_t *)((volatile char*)mmio + i)); } static void usage(char *cmdname) { printf("Usage: %s [-f|-d] [addr1] [addr2] .. [addrN]\n", cmdname); printf("\t -f : read back full range of registers.\n"); printf("\t WARNING! This option may result in a machine hang!\n"); printf("\t -d : decode register bits.\n"); printf("\t -c : number of dwords to dump (can't be used with -f/-d).\n"); printf("\t addr : in 0xXXXX format\n"); } int main(int argc, char** argv) { int ret = 0; uint32_t reg; int i, ch; char *cmdname = strdup(argv[0]); int full_dump = 0; int decode_bits = 0; int dwords = 1; while ((ch = getopt(argc, argv, "dfhc:")) != -1) { switch(ch) { case 'd': decode_bits = 1; break; case 'f': full_dump = 1; break; case 'h': usage(cmdname); ret = 1; goto out; case 'c': dwords = strtol(optarg, NULL, 0); break; } } argc -= optind; argv += optind; if (argc < 1) { usage(cmdname); ret = 1; goto out; } if ((dwords > 1) && (argc != 1 || full_dump || decode_bits)) { usage(cmdname); ret = 1; goto out; } intel_register_access_init(intel_get_pci_device(), 0); if (full_dump) { dump_range(0x00000, 0x00fff); /* VGA registers */ dump_range(0x02000, 0x02fff); /* instruction, memory, interrupt control registers */ dump_range(0x03000, 0x031ff); /* FENCE and PPGTT control registers */ dump_range(0x03200, 0x03fff); /* frame buffer compression registers */ dump_range(0x05000, 0x05fff); /* I/O control registers */ dump_range(0x06000, 0x06fff); /* clock control registers */ dump_range(0x07000, 0x07fff); /* 3D internal debug registers */ dump_range(0x07400, 0x088ff); /* GPE debug registers */ dump_range(0x0a000, 0x0afff); /* display palette registers */ dump_range(0x10000, 0x13fff); /* MMIO MCHBAR */ dump_range(0x30000, 0x3ffff); /* overlay registers */ dump_range(0x60000, 0x6ffff); /* display engine pipeline registers */ dump_range(0x70000, 0x72fff); /* display and cursor registers */ dump_range(0x73000, 0x73fff); /* performance counters */ } else { for (i=0; i < argc; i++) { sscanf(argv[i], "0x%x", ®); dump_range(reg, reg + (dwords * 4)); if (decode_bits) bit_decode(*(volatile uint32_t *)((volatile char*)mmio + reg)); } } intel_register_access_fini(); out: free(cmdname); return ret; } intel-gpu-tools-1.3/tools/intel_forcewaked.c0000664000175100017510000000540311721136153016157 00000000000000/* * Copyright © 2011 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * * Authors: * Ben Widawsky * */ #include #include #include #include #include #include #include #include #include #include "intel_gpu_tools.h" bool daemonized; #define INFO_PRINT(...) \ do { \ if (daemonized) \ syslog(LOG_INFO, ##__VA_ARGS__); \ else \ fprintf(stdout, ##__VA_ARGS__); \ } while(0) static void help(char *prog) { printf("%s Prevents the GT from sleeping.\n\n", prog); printf("usage: %s [options] \n\n", prog); printf("Options: \n"); printf(" -b Run in background/daemon mode\n"); } static int is_alive(void) { /* Read the timestamp, which should *almost* always be !0 */ return (intel_register_read(0x2358) != 0); } int main(int argc, char *argv[]) { int ret; if (argc > 2 || (argc == 2 && !strncmp(argv[1], "-h", 2))) { help(argv[1]); exit(0); } if (argc == 2 && (!strncmp(argv[1], "-b", 2))) daemonized = true; if (daemonized) { assert(daemon(0, 0) == 0); openlog(argv[0], LOG_CONS | LOG_PID, LOG_USER); INFO_PRINT("started daemon"); } ret = intel_register_access_init(intel_get_pci_device(), 1); if (ret) { INFO_PRINT("Couldn't init register access\n"); exit(1); } else { INFO_PRINT("Forcewake locked\n"); } while(1) { if (!is_alive()) { INFO_PRINT("gpu reset? restarting daemon\n"); intel_register_access_fini(); ret = intel_register_access_init(intel_get_pci_device(), 1); } sleep(1); } intel_register_access_fini(); INFO_PRINT("Forcewake unlock\n"); if (daemonized) { INFO_PRINT("finished\n"); closelog(); } return 0; } intel-gpu-tools-1.3/tools/intel_gpu_top.c0000664000175100017510000003704411755775340015546 00000000000000/* * Copyright © 2007 Intel Corporation * Copyright © 2011 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * * Authors: * Eric Anholt * Eugeni Dodonov * */ #include "config.h" #include #include #include #include #include #include #include #include #ifdef HAVE_TERMIOS_H #include #endif #include "intel_gpu_tools.h" #include "instdone.h" #define FORCEWAKE 0xA18C #define FORCEWAKE_ACK 0x130090 #define SAMPLES_PER_SEC 10000 #define SAMPLES_TO_PERCENT_RATIO (SAMPLES_PER_SEC / 100) #define MAX_NUM_TOP_BITS 100 #define HAS_STATS_REGS(devid) IS_965(devid) struct top_bit { struct instdone_bit *bit; int count; } top_bits[MAX_NUM_TOP_BITS]; struct top_bit *top_bits_sorted[MAX_NUM_TOP_BITS]; static uint32_t instdone, instdone1; static const char *bars[] = { " ", "▏", "▎", "▍", "▌", "▋", "▊", "▉", "█" }; enum stats_counts { IA_VERTICES, IA_PRIMITIVES, VS_INVOCATION, GS_INVOCATION, GS_PRIMITIVES, CL_INVOCATION, CL_PRIMITIVES, PS_INVOCATION, PS_DEPTH, STATS_COUNT }; const uint32_t stats_regs[STATS_COUNT] = { IA_VERTICES_COUNT_QW, IA_PRIMITIVES_COUNT_QW, VS_INVOCATION_COUNT_QW, GS_INVOCATION_COUNT_QW, GS_PRIMITIVES_COUNT_QW, CL_INVOCATION_COUNT_QW, CL_PRIMITIVES_COUNT_QW, PS_INVOCATION_COUNT_QW, PS_DEPTH_COUNT_QW, }; const char *stats_reg_names[STATS_COUNT] = { "vert fetch", "prim fetch", "VS invocations", "GS invocations", "GS prims", "CL invocations", "CL prims", "PS invocations", "PS depth pass", }; uint64_t stats[STATS_COUNT]; uint64_t last_stats[STATS_COUNT]; static unsigned long gettime(void) { struct timeval t; gettimeofday(&t, NULL); return (t.tv_usec + (t.tv_sec * 1000000)); } static int top_bits_sort(const void *a, const void *b) { struct top_bit * const *bit_a = a; struct top_bit * const *bit_b = b; int a_count = (*bit_a)->count; int b_count = (*bit_b)->count; if (a_count < b_count) return 1; else if (a_count == b_count) return 0; else return -1; } static void update_idle_bit(struct top_bit *top_bit) { uint32_t reg_val; if (top_bit->bit->reg == INST_DONE_1) reg_val = instdone1; else reg_val = instdone; if ((reg_val & top_bit->bit->bit) == 0) top_bit->count++; } static void print_clock(const char *name, int clock) { if (clock == -1) printf("%s clock: unknown", name); else printf("%s clock: %d Mhz", name, clock); } static int print_clock_info(struct pci_device *pci_dev) { uint32_t devid = pci_dev->device_id; uint16_t gcfgc; if (IS_GM45(devid)) { int core_clock = -1; pci_device_cfg_read_u16(pci_dev, &gcfgc, I915_GCFGC); switch (gcfgc & 0xf) { case 8: core_clock = 266; break; case 9: core_clock = 320; break; case 11: core_clock = 400; break; case 13: core_clock = 533; break; } print_clock("core", core_clock); } else if (IS_965(devid) && IS_MOBILE(devid)) { int render_clock = -1, sampler_clock = -1; pci_device_cfg_read_u16(pci_dev, &gcfgc, I915_GCFGC); switch (gcfgc & 0xf) { case 2: render_clock = 250; sampler_clock = 267; break; case 3: render_clock = 320; sampler_clock = 333; break; case 4: render_clock = 400; sampler_clock = 444; break; case 5: render_clock = 500; sampler_clock = 533; break; } print_clock("render", render_clock); printf(" "); print_clock("sampler", sampler_clock); } else if (IS_945(devid) && IS_MOBILE(devid)) { int render_clock = -1, display_clock = -1; pci_device_cfg_read_u16(pci_dev, &gcfgc, I915_GCFGC); switch (gcfgc & 0x7) { case 0: render_clock = 166; break; case 1: render_clock = 200; break; case 3: render_clock = 250; break; case 5: render_clock = 400; break; } switch (gcfgc & 0x70) { case 0: display_clock = 200; break; case 4: display_clock = 320; break; } if (gcfgc & (1 << 7)) display_clock = 133; print_clock("render", render_clock); printf(" "); print_clock("display", display_clock); } else if (IS_915(devid) && IS_MOBILE(devid)) { int render_clock = -1, display_clock = -1; pci_device_cfg_read_u16(pci_dev, &gcfgc, I915_GCFGC); switch (gcfgc & 0x7) { case 0: render_clock = 160; break; case 1: render_clock = 190; break; case 4: render_clock = 333; break; } if (gcfgc & (1 << 13)) render_clock = 133; switch (gcfgc & 0x70) { case 0: display_clock = 190; break; case 4: display_clock = 333; break; } if (gcfgc & (1 << 7)) display_clock = 133; print_clock("render", render_clock); printf(" "); print_clock("display", display_clock); } printf("\n"); return -1; } #define STATS_LEN (20) #define PERCENTAGE_BAR_END (79 - STATS_LEN) static void print_percentage_bar(float percent, int cur_line_len) { int bar_avail_len = (PERCENTAGE_BAR_END - cur_line_len - 1) * 8; int bar_len = bar_avail_len * (percent + .5) / 100.0; int i; for (i = bar_len; i >= 8; i -= 8) { printf("%s", bars[8]); cur_line_len++; } if (i) { printf("%s", bars[i]); cur_line_len++; } /* NB: We can't use a field width with utf8 so we manually * guarantee a field with of 45 chars for any bar. */ printf("%*s", PERCENTAGE_BAR_END - cur_line_len, ""); } struct ring { const char *name; uint32_t mmio; int head, tail, size; uint64_t full; int idle; }; static uint32_t ring_read(struct ring *ring, uint32_t reg) { return INREG(ring->mmio + reg); } static void ring_init(struct ring *ring) { ring->size = (((ring_read(ring, RING_LEN) & RING_NR_PAGES) >> 12) + 1) * 4096; } static void ring_reset(struct ring *ring) { ring->idle = ring->full = 0; } static void ring_sample(struct ring *ring) { int full; if (!ring->size) return; ring->head = ring_read(ring, RING_HEAD) & HEAD_ADDR; ring->tail = ring_read(ring, RING_TAIL) & TAIL_ADDR; if (ring->tail == ring->head) ring->idle++; full = ring->tail - ring->head; if (full < 0) full += ring->size; ring->full += full; } static void ring_print_header(FILE *out, struct ring *ring) { fprintf(out, "%.6s%%\tops\t", ring->name ); } static void ring_print(struct ring *ring, unsigned long samples_per_sec) { int percent_busy, len; if (!ring->size) return; percent_busy = 100 - 100 * ring->idle / samples_per_sec; len = printf("%25s busy: %3d%%: ", ring->name, percent_busy); print_percentage_bar (percent_busy, len); printf("%24s space: %d/%d\n", ring->name, (int)(ring->full / samples_per_sec), ring->size); } static void ring_log(struct ring *ring, unsigned long samples_per_sec, FILE *output) { if (ring->size) fprintf(output, "%3d\t%d\t", (int)(100 - 100 * ring->idle / samples_per_sec), (int)(ring->full / samples_per_sec)); else fprintf(output, "-1\t-1\t"); } static void usage(const char *appname) { printf("intel_gpu_top - Display a top-like summary of Intel GPU usage\n" "\n" "usage: %s [parameters]\n" "\n" "The following parameters apply:\n" "[-s ] samples per seconds (default %d)\n" "[-e ] command to profile\n" "[-o ] output statistics to file. If file is '-'," " run in batch mode and output statistics to stdio only \n" "[-h] show this help screen\n" "\n", appname, SAMPLES_PER_SEC ); return; } int main(int argc, char **argv) { uint32_t devid; struct pci_device *pci_dev; struct ring render_ring = { .name = "render", .mmio = 0x2030, }, bsd_ring = { .name = "bitstream", .mmio = 0x4030, }, bsd6_ring = { .name = "bitstream", .mmio = 0x12030, }, blt_ring = { .name = "blitter", .mmio = 0x22030, }; int i, ch; int samples_per_sec = SAMPLES_PER_SEC; FILE *output = NULL; double elapsed_time=0; int print_headers=1; pid_t child_pid=-1; int child_stat; char *cmd=NULL; int interactive=1; /* Parse options? */ while ((ch = getopt(argc, argv, "s:o:e:h")) != -1) { switch (ch) { case 'e': cmd = strdup(optarg); break; case 's': samples_per_sec = atoi(optarg); if (samples_per_sec < 100) { fprintf(stderr, "Error: samples per second must be >= 100\n"); exit(1); } break; case 'o': if (!strcmp(optarg, "-")) { /* Running in non-interactive mode */ interactive = 0; output = stdout; } else output = fopen(optarg, "w"); if (!output) { perror("fopen"); exit(1); } break; case 'h': usage(argv[0]); exit(0); break; default: fprintf(stderr, "Invalid flag %c!\n", (char)optopt); usage(argv[0]); exit(1); break; } } argc -= optind; argv += optind; pci_dev = intel_get_pci_device(); devid = pci_dev->device_id; intel_get_mmio(pci_dev); init_instdone_definitions(devid); /* Do we have a command to run? */ if (cmd != NULL) { if (output) { fprintf(output, "# Profiling: %s\n", cmd); fflush(output); } child_pid = fork(); if (child_pid < 0) { perror("fork"); exit(1); } else if (child_pid == 0) { int res; res = system(cmd); if (res < 0) perror("running command"); if (output) { fflush(output); fprintf(output, "# %s exited with status %d\n", cmd, res); fflush(output); } free(cmd); exit(0); } else { free(cmd); } } for (i = 0; i < num_instdone_bits; i++) { top_bits[i].bit = &instdone_bits[i]; top_bits[i].count = 0; top_bits_sorted[i] = &top_bits[i]; } /* Grab access to the registers */ intel_register_access_init(pci_dev, 0); ring_init(&render_ring); if (IS_GEN4(devid) || IS_GEN5(devid)) ring_init(&bsd_ring); if (IS_GEN6(devid) || IS_GEN7(devid)) { ring_init(&bsd6_ring); ring_init(&blt_ring); } /* Initialize GPU stats */ if (HAS_STATS_REGS(devid)) { for (i = 0; i < STATS_COUNT; i++) { uint32_t stats_high, stats_low, stats_high_2; do { stats_high = INREG(stats_regs[i] + 4); stats_low = INREG(stats_regs[i]); stats_high_2 = INREG(stats_regs[i] + 4); } while (stats_high != stats_high_2); last_stats[i] = (uint64_t)stats_high << 32 | stats_low; } } for (;;) { int j; unsigned long long t1, ti, tf, t2; unsigned long long def_sleep = 1000000 / samples_per_sec; unsigned long long last_samples_per_sec = samples_per_sec; unsigned short int max_lines; struct winsize ws; char clear_screen[] = {0x1b, '[', 'H', 0x1b, '[', 'J', 0x0}; int percent; int len; t1 = gettime(); ring_reset(&render_ring); ring_reset(&bsd_ring); ring_reset(&bsd6_ring); ring_reset(&blt_ring); for (i = 0; i < samples_per_sec; i++) { long long interval; ti = gettime(); if (IS_965(devid)) { instdone = INREG(INST_DONE_I965); instdone1 = INREG(INST_DONE_1); } else instdone = INREG(INST_DONE); for (j = 0; j < num_instdone_bits; j++) update_idle_bit(&top_bits[j]); ring_sample(&render_ring); ring_sample(&bsd_ring); ring_sample(&bsd6_ring); ring_sample(&blt_ring); tf = gettime(); if (tf - t1 >= 1000000) { /* We are out of sync, bail out */ last_samples_per_sec = i+1; break; } interval = def_sleep - (tf - ti); if (interval > 0) usleep(interval); } if (HAS_STATS_REGS(devid)) { for (i = 0; i < STATS_COUNT; i++) { uint32_t stats_high, stats_low, stats_high_2; do { stats_high = INREG(stats_regs[i] + 4); stats_low = INREG(stats_regs[i]); stats_high_2 = INREG(stats_regs[i] + 4); } while (stats_high != stats_high_2); stats[i] = (uint64_t)stats_high << 32 | stats_low; } } qsort(top_bits_sorted, num_instdone_bits, sizeof(struct top_bit *), top_bits_sort); /* Limit the number of lines printed to the terminal height so the * most important info (at the top) will stay on screen. */ max_lines = -1; if (ioctl(0, TIOCGWINSZ, &ws) != -1) max_lines = ws.ws_row - 6; /* exclude header lines */ if (max_lines >= num_instdone_bits) max_lines = num_instdone_bits; t2 = gettime(); elapsed_time += (t2 - t1) / 1000000.0; if (interactive) { printf("%s", clear_screen); print_clock_info(pci_dev); ring_print(&render_ring, last_samples_per_sec); ring_print(&bsd_ring, last_samples_per_sec); ring_print(&bsd6_ring, last_samples_per_sec); ring_print(&blt_ring, last_samples_per_sec); printf("\n%30s %s\n", "task", "percent busy"); for (i = 0; i < max_lines; i++) { if (top_bits_sorted[i]->count > 0) { percent = (top_bits_sorted[i]->count * 100) / last_samples_per_sec; len = printf("%30s: %3d%%: ", top_bits_sorted[i]->bit->name, percent); print_percentage_bar (percent, len); } else { printf("%*s", PERCENTAGE_BAR_END, ""); } if (i < STATS_COUNT && HAS_STATS_REGS(devid)) { printf("%13s: %llu (%lld/sec)", stats_reg_names[i], (long long)stats[i], (long long)(stats[i] - last_stats[i])); last_stats[i] = stats[i]; } else { if (!top_bits_sorted[i]->count) break; } printf("\n"); } } if (output) { /* Print headers for columns at first run */ if (print_headers) { fprintf(output, "# time\t"); ring_print_header(output, &render_ring); ring_print_header(output, &bsd_ring); ring_print_header(output, &bsd6_ring); ring_print_header(output, &blt_ring); for (i = 0; i < MAX_NUM_TOP_BITS; i++) { if (i < STATS_COUNT && HAS_STATS_REGS(devid)) { fprintf(output, "%.6s\t", stats_reg_names[i] ); } if (!top_bits[i].count) continue; } fprintf(output, "\n"); print_headers = 0; } /* Print statistics */ fprintf(output, "%.2f\t", elapsed_time); ring_log(&render_ring, last_samples_per_sec, output); ring_log(&bsd_ring, last_samples_per_sec, output); ring_log(&bsd6_ring, last_samples_per_sec, output); ring_log(&blt_ring, last_samples_per_sec, output); for (i = 0; i < MAX_NUM_TOP_BITS; i++) { if (i < STATS_COUNT && HAS_STATS_REGS(devid)) { fprintf(output, "%lu\t", stats[i] - last_stats[i]); last_stats[i] = stats[i]; } if (!top_bits[i].count) continue; } fprintf(output, "\n"); fflush(output); } for (i = 0; i < num_instdone_bits; i++) { top_bits_sorted[i]->count = 0; if (i < STATS_COUNT) last_stats[i] = stats[i]; } /* Check if child has gone */ if (child_pid > 0) { int res; if ((res = waitpid(child_pid, &child_stat, WNOHANG)) == -1) { perror("waitpid"); exit(1); } if (res == 0) continue; if (WIFEXITED(child_stat)) break; } } fclose(output); intel_register_access_fini(); return 0; } intel-gpu-tools-1.3/tools/intel_l3_parity.c0000664000175100017510000000755211763072372015772 00000000000000/* * Copyright © 2012 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Ben Widawsky * */ #define _GNU_SOURCE #include #include #include #include #include #include #include #include "intel_chipset.h" #include "intel_gpu_tools.h" #include "drmtest.h" #define NUM_BANKS 4 #define NUM_SUBBANKS 8 #define NUM_REGS (NUM_BANKS * NUM_SUBBANKS) struct __attribute__ ((__packed__)) l3_log_register { uint32_t row0_enable : 1; uint32_t rsvd2 : 4; uint32_t row0 : 11; uint32_t row1_enable : 1; uint32_t rsvd1 : 4; uint32_t row1 : 11; } l3log[NUM_BANKS][NUM_SUBBANKS]; static void dumpit(void) { int i, j; for (i = 0; i < NUM_BANKS; i++) { for (j = 0; j < NUM_SUBBANKS; j++) { struct l3_log_register *reg = &l3log[i][j]; if (reg->row0_enable) printf("Row %d, Bank %d, Subbank %d is disabled\n", reg->row0, i, j); if (reg->row1_enable) printf("Row %d, Bank %d, Subbank %d is disabled\n", reg->row1, i, j); } } } static int disable_rbs(int row, int bank, int sbank) { struct l3_log_register *reg = &l3log[bank][sbank]; // can't map more than 2 rows if (reg->row0_enable && reg->row1_enable) return -1; // can't remap the same row twice if ((reg->row0_enable && reg->row0 == row) || (reg->row1_enable && reg->row1 == row)) { return -1; } if (reg->row0_enable) { reg->row1 = row; reg->row1_enable = 1; } else { reg->row0 = row; reg->row0_enable = 1; } return 0; } static int do_parse(int argc, char *argv[]) { int row, bank, sbank, i, ret; for (i = 1; i < argc; i++) { ret = sscanf(argv[i], "%d,%d,%d", &row, &bank, &sbank); if (ret != 3) return i; assert(disable_rbs(row, bank, sbank) == 0); } return 0; } int main(int argc, char *argv[]) { const int device = drm_get_card(0); char *path; unsigned int devid; int drm_fd, fd, ret; drm_fd = drm_open_any(); devid = intel_get_drm_devid(drm_fd); ret = asprintf(&path, "/sys/class/drm/card%d/l3_parity", device); assert(ret != -1); fd = open(path, O_RDWR); if (fd == -1 && IS_IVYBRIDGE(devid)) { perror("Opening sysfs"); exit(EXIT_FAILURE); } else if (fd == -1) exit(EXIT_SUCCESS); ret = read(fd, l3log, NUM_REGS * sizeof(uint32_t)); if (ret == -1) { perror("Reading sysfs"); exit(EXIT_FAILURE); } assert(lseek(fd, 0, SEEK_SET) == 0); if (argc == 1) { dumpit(); exit(EXIT_SUCCESS); } else if (!strncmp("-c", argv[1], 2)) { memset(l3log, 0, sizeof(l3log)); } else { ret = do_parse(argc, argv); if (ret != 0) { fprintf(stderr, "Malformed command line at %s\n", argv[ret]); exit(EXIT_FAILURE); } } ret = write(fd, l3log, NUM_REGS * sizeof(uint32_t)); if (ret == -1) { perror("Writing sysfs"); exit(EXIT_FAILURE); } close(fd); exit(EXIT_SUCCESS); } intel-gpu-tools-1.3/tools/intel_dpio_read.c0000644000175100017510000000376012014634425015776 00000000000000/* * Copyright © 2012 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * * Authors: * Vijay Purushothaman * */ #include #include #include #include #include #include "intel_gpu_tools.h" static void usage(char *cmdname) { printf("Warning : This program will work only on Valleyview\n"); printf("Usage: %s [addr]\n", cmdname); printf("\t addr : in 0xXXXX format\n"); } int main(int argc, char** argv) { int ret = 0; uint32_t reg, val; char *cmdname = strdup(argv[0]); struct pci_device *dev = intel_get_pci_device(); if (argc != 2 || !IS_VALLEYVIEW(dev->device_id)) { usage(cmdname); ret = 1; goto out; } sscanf(argv[1], "0x%x", ®); intel_register_access_init(dev, 0); val = intel_dpio_reg_read(reg); printf("Read DPIO register: 0x%x - Value : 0x%x\n", reg, val); intel_register_access_fini(); out: free(cmdname); return ret; } intel-gpu-tools-1.3/tools/intel_gtt.c0000644000175100017510000000677112016621406014650 00000000000000/* * Copyright © 2008 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * * Authors: * Eric Anholt * */ #include #include #include #include #include #include #include "intel_gpu_tools.h" #define INGTT(offset) (*(volatile uint32_t *)(gtt + (offset) / (KB(4) / 4))) #define KB(x) ((x) * 1024) #define MB(x) ((x) * 1024 * 1024) int main(int argc, char **argv) { struct pci_device *pci_dev; int start, aper_size; unsigned char *gtt; uint32_t devid; int flag[] = { PCI_DEV_MAP_FLAG_WRITE_COMBINE, PCI_DEV_MAP_FLAG_WRITABLE, 0 }, f; pci_dev = intel_get_pci_device(); devid = pci_dev->device_id; if (IS_GEN2(devid)) { printf("Unsupported chipset for gtt dumper\n"); exit(1); } for (f = 0; flag[f] != 0; f++) { if (IS_GEN3(devid)) { /* 915/945 chips has GTT range in bar 3 */ if (pci_device_map_range(pci_dev, pci_dev->regions[3].base_addr, pci_dev->regions[3].size, flag[f], (void **)>t) == 0) break; } else { int offset; if (IS_G4X(devid) || IS_GEN5(devid)) offset = MB(2); else offset = KB(512); if (pci_device_map_range(pci_dev, pci_dev->regions[0].base_addr + offset, offset, flag[f], (void **)>t) == 0) break; } } if (flag[f] == 0) { printf("Failed to map gtt\n"); exit(1); } aper_size = pci_dev->regions[2].size; for (start = 0; start < aper_size; start += KB(4)) { uint32_t start_pte = INGTT(start); uint32_t end; int constant_length = 0; int linear_length = 0; /* Check if it's a linear sequence */ for (end = start + KB(4); end < aper_size; end += KB(4)) { uint32_t end_pte = INGTT(end); if (end_pte == start_pte + (end - start)) linear_length++; else break; } if (linear_length > 0) { printf("0x%08x - 0x%08x: linear from " "0x%08x to 0x%08x\n", start, end - KB(4), start_pte, start_pte + (end - start) - KB(4)); start = end - KB(4); continue; } /* Check if it's a constant sequence */ for (end = start + KB(4); end < aper_size; end += KB(4)) { uint32_t end_pte = INGTT(end); if (end_pte == start_pte) constant_length++; else break; } if (constant_length > 0) { printf("0x%08x - 0x%08x: constant 0x%08x\n", start, end - KB(4), start_pte); start = end - KB(4); continue; } printf("0x%08x: 0x%08x\n", start, start_pte); } return 0; } intel-gpu-tools-1.3/tools/intel_backlight.c0000664000175100017510000000413211631112215015764 00000000000000/* * Copyright © 2011 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * * Authors: * Chris Wilson * */ #include #include #include #include #include "intel_gpu_tools.h" /* XXX PCH only today */ static uint32_t reg_read(uint32_t reg) { return *(volatile uint32_t *)((volatile char*)mmio + reg); } static void reg_write(uint32_t reg, uint32_t val) { *(volatile uint32_t *)((volatile char*)mmio + reg) = val; } int main(int argc, char** argv) { uint32_t current, max; intel_get_mmio(intel_get_pci_device()); current = reg_read(BLC_PWM_CPU_CTL) & BACKLIGHT_DUTY_CYCLE_MASK; max = reg_read(BLC_PWM_PCH_CTL2) >> 16; printf ("current backlight value: %d%%\n", current * 100 / max); if (argc > 1) { uint32_t v = atoi (argv[1]) * max / 100; if (v > max) v = max; reg_write(BLC_PWM_CPU_CTL, (reg_read(BLC_PWM_CPU_CTL) &~ BACKLIGHT_DUTY_CYCLE_MASK) | v); (void) reg_read(BLC_PWM_CPU_CTL); printf ("set backlight to %d%%\n", v * 100 / max); } return 0; } intel-gpu-tools-1.3/tools/intel_dpio_write.c0000644000175100017510000000372512014634425016216 00000000000000/* * Copyright © 2012 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * * Authors: * Vijay Purushothaman * */ #include #include #include #include #include #include "intel_gpu_tools.h" static void usage(char *cmdname) { printf("Warning : This program will work only on Valleyview\n"); printf("Usage: %s [addr] [val]\n", cmdname); printf("\t addr : in 0xXXXX format\n"); } int main(int argc, char** argv) { int ret = 0; uint32_t reg, val; char *cmdname = strdup(argv[0]); struct pci_device *dev = intel_get_pci_device(); if (argc != 3 || !IS_VALLEYVIEW(dev->device_id)) { usage(cmdname); ret = 1; goto out; } sscanf(argv[1], "0x%x", ®); sscanf(argv[2], "0x%x", &val); intel_register_access_init(dev, 0); intel_dpio_reg_write(reg, val); intel_register_access_fini(); out: free(cmdname); return ret; } intel-gpu-tools-1.3/tools/intel_infoframes.c0000664000175100017510000007364211755775340016226 00000000000000/* * Copyright © 2012 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * * Authors: * Paulo Zanoni * */ #include #include #include #include #include #include "intel_gpu_tools.h" typedef enum { TRANSC_A = 0, TRANSC_B = 1, TRANSC_C = 2, TRANSC_INVALID } Transcoder; typedef enum { REG_HDMIB_GEN4 = 0x61140, REG_HDMIC_GEN4 = 0x61160, REG_HDMIB_PCH = 0xe1140, REG_HDMIC_PCH = 0xe1150, REG_HDMID_PCH = 0xe1160, REG_DIP_CTL_GEN4 = 0x61170, REG_DIP_CTL_A = 0xe0200, REG_DIP_CTL_B = 0xe1200, REG_DIP_CTL_C = 0xe2200, REG_DIP_DATA_GEN4 = 0x61178, REG_DIP_DATA_A = 0xe0208, REG_DIP_DATA_B = 0xe1208, REG_DIP_DATA_C = 0xe2208, } Register; typedef enum { DIP_AVI = 0, DIP_VENDOR = 1, DIP_GAMUT = 2, DIP_SPD = 3, DIP_INVALID, } DipType; typedef enum { DIP_FREQ_ONCE = 0, DIP_FREQ_EVERY_VSYNC = 1, DIP_FREQ_EVERY_OTHER_VSYNC = 2, DIP_FREQ_RESERVED = 3, } DipFrequency; typedef enum { SOURCE_DEVICE_UNKNOWN = 0x00, SOURCE_DEVICE_DIGITAL_STB = 0x01, SOURCE_DEVICE_DVD_PLAYER = 0x02, SOURCE_DEVICE_D_VHS = 0x03, SOURCE_DEVICE_HDD_VIDEORECORDER = 0x04, SOURCE_DEVICE_DVC = 0x05, SOURCE_DEVICE_DSC = 0x06, SOURCE_DEVICE_VIDEO_CD = 0x07, SOURCE_DEVICE_GAME = 0x08, SOURCE_DEVICE_PC_GENERAL = 0x09, SOURCE_DEVICE_BLU_RAY_DISK = 0x0a, SOURCE_DEVICE_SUPER_AUDIO_CD = 0x0b, SOURCE_DEVICE_RESERVED = 0x0c } SourceDevice; #define HDMI_PORT_ENABLE (1 << 31) #define HDMI_PORT_TRANSCODER_GEN4 (1 << 30) #define HDMI_PORT_TRANSCODER_IBX (1 << 30) #define HDMI_PORT_TRANSCODER_CPT (3 << 29) #define HDMI_PORT_ENCODING (3 << 10) #define HDMI_PORT_MODE (1 << 9) #define HDMI_PORT_AUDIO (1 << 6) #define HDMI_PORT_DETECTED (1 << 2) #define DIP_CTL_ENABLE (1 << 31) #define DIP_CTL_GCP_ENABLE (1 << 25) #define DIP_CTL_SPD_ENABLE (1 << 24) #define DIP_CTL_GAMUT_ENABLE (1 << 23) #define DIP_CTL_VENDOR_ENABLE (1 << 22) #define DIP_CTL_AVI_ENABLE (1 << 21) #define DIP_CTL_BUFFER_INDEX (3 << 19) #define DIP_CTL_BUFFER_AVI (0 << 19) #define DIP_CTL_BUFFER_VENDOR (1 << 19) #define DIP_CTL_BUFFER_GAMUT (2 << 19) #define DIP_CTL_BUFFER_SPD (3 << 19) #define DIP_CTL_FREQUENCY (3 << 16) #define DIP_CTL_FREQ_ONCE (0 << 16) #define DIP_CTL_FREQ_EVERY (1 << 16) #define DIP_CTL_FREQ_EVERY_OTHER (2 << 16) #define DIP_CTL_BUFFER_SIZE (15 << 8) #define DIP_CTL_ACCESS_ADDR (15 << 0) #define DIP_CTL_PORT_SEL_MASK_GEN4 (3 << 29) #define DIP_CTL_PORT_SEL_B_GEN4 (1 << 29) #define DIP_CTL_PORT_SEL_C_GEN4 (2 << 29) #define DIP_CTL_BUFFER_TRANS_ACTIVE_GEN4 (1 << 28) #define AVI_INFOFRAME_TYPE 0x82 #define AVI_INFOFRAME_VERSION 0x02 #define AVI_INFOFRAME_LENGTH 0x0d #define SPD_INFOFRAME_TYPE 0x83 #define SPD_INFOFRAME_VERSION 0x01 #define SPD_INFOFRAME_LENGTH 0x19 typedef struct { uint8_t type; uint8_t version; uint8_t length; uint8_t ecc; } DipInfoFrameHeader; typedef union { struct { DipInfoFrameHeader header; uint8_t checksum; uint8_t S :2; uint8_t B :2; uint8_t A :1; uint8_t Y :2; uint8_t Rsvd0 :1; uint8_t R :4; uint8_t M :2; uint8_t C :2; uint8_t SC :2; uint8_t Q :2; uint8_t EC :3; uint8_t ITC :1; uint8_t VIC :7; uint8_t Rsvd1 :1; uint8_t PR :4; uint8_t Rsvd2 :4; uint16_t top; uint16_t bottom; uint16_t left; uint16_t right; uint16_t Rsvd3; uint32_t Rsvd4[3]; } avi; struct { DipInfoFrameHeader header; uint8_t checksum; uint8_t vendor[8]; uint8_t description[16]; uint8_t source; } __attribute__((packed)) spd; struct { DipInfoFrameHeader header; uint8_t body[27]; } generic; uint8_t data8[128]; uint32_t data32[16]; } DipInfoFrame; Register gen4_hdmi_ports[] = { REG_HDMIB_GEN4, REG_HDMIC_GEN4, }; Register pch_hdmi_ports[] = { REG_HDMIB_PCH, REG_HDMIC_PCH, REG_HDMID_PCH }; Register pch_dip_ctl_regs[] = { REG_DIP_CTL_A, REG_DIP_CTL_B, REG_DIP_CTL_C }; Register pch_dip_data_regs[] = { REG_DIP_DATA_A, REG_DIP_DATA_B, REG_DIP_DATA_C }; const char *hdmi_port_names[] = { "HDMIB", "HDMIC", "HDMID" }; const char *transcoder_names[] = { "A", "B", "C" }; const char *dip_frequency_names[] = { "once", "every vsync", "every other vsync", "reserved (invalid)" }; int gen = 0; static const char *spd_source_to_string(SourceDevice source) { switch (source) { case SOURCE_DEVICE_UNKNOWN: return "unknown"; case SOURCE_DEVICE_DIGITAL_STB: return "digital stb"; case SOURCE_DEVICE_DVD_PLAYER: return "dvd player"; case SOURCE_DEVICE_D_VHS: return "d vhs"; case SOURCE_DEVICE_HDD_VIDEORECORDER: return "hdd videorecorder"; case SOURCE_DEVICE_DVC: return "dvc"; case SOURCE_DEVICE_DSC: return "dsc"; case SOURCE_DEVICE_VIDEO_CD: return "video cd"; case SOURCE_DEVICE_GAME: return "game"; case SOURCE_DEVICE_PC_GENERAL: return "pc general"; case SOURCE_DEVICE_BLU_RAY_DISK: return "blu-ray disk"; case SOURCE_DEVICE_SUPER_AUDIO_CD: return "super audio cd"; default: return "reserved"; } } static Register get_dip_ctl_reg(Transcoder transcoder) { if (gen == 4) return REG_DIP_CTL_GEN4; else return pch_dip_ctl_regs[transcoder]; } static Register get_dip_data_reg(Transcoder transcoder) { if (gen == 4) return REG_DIP_DATA_GEN4; else return pch_dip_data_regs[transcoder]; } static Register get_hdmi_port(int hdmi_port_index) { if (gen == 4) { assert(hdmi_port_index < 2); return gen4_hdmi_ports[hdmi_port_index]; } else { return pch_hdmi_ports[hdmi_port_index]; } } static void load_infoframe(Transcoder transcoder, DipInfoFrame *frame, DipType type) { Register ctl_reg = get_dip_ctl_reg(transcoder); Register data_reg = get_dip_data_reg(transcoder); uint32_t ctl_val; uint32_t i; ctl_val = INREG(ctl_reg); ctl_val &= ~DIP_CTL_BUFFER_INDEX; ctl_val |= type << 19; OUTREG(ctl_reg, ctl_val); ctl_val = INREG(ctl_reg); ctl_val &= ~DIP_CTL_ACCESS_ADDR; OUTREG(ctl_reg, ctl_val); for (i = 0; i < 16; i++) { ctl_val = INREG(ctl_reg); assert((ctl_val & DIP_CTL_ACCESS_ADDR) == i); frame->data32[i] = INREG(data_reg); } } static int infoframe_valid_checksum(DipInfoFrame *frame) { int i; int length = frame->generic.header.length; uint8_t csum; csum = frame->generic.header.type + frame->generic.header.version + frame->generic.header.length; /* no ecc */ for (i = 0; i < length + 1; i++) csum += frame->generic.body[i]; return (csum == 0); } static void infoframe_fix_checksum(DipInfoFrame *frame) { int i; int length = frame->generic.header.length; uint8_t csum; csum = frame->generic.header.type + frame->generic.header.version + frame->generic.header.length; /* no ecc */ /* Length does not include the header field nor the checksum */ for (i = 1; i < length + 1; i++) csum += frame->generic.body[i]; frame->generic.body[0] = 0x100 - csum; } static void dump_port_info(int hdmi_port_index) { Register port = get_hdmi_port(hdmi_port_index); uint32_t val = INREG(port); Transcoder transcoder; printf("\nPort %s:\n", hdmi_port_names[hdmi_port_index]); printf("- %sdetected\n", val & HDMI_PORT_DETECTED ? "" : "not "); printf("- %s\n", val & HDMI_PORT_ENABLE ? "enabled" : "disabled"); if (!(val & HDMI_PORT_ENABLE)) return; if (gen == 4) transcoder = (val & HDMI_PORT_TRANSCODER_GEN4) >> 30; else if (pch >= PCH_CPT) transcoder = (val & HDMI_PORT_TRANSCODER_CPT) >> 29; else transcoder = (val & HDMI_PORT_TRANSCODER_IBX) >> 30; printf("- transcoder: %s\n", transcoder_names[transcoder]); switch ((val & HDMI_PORT_ENCODING) >> 10) { case 0: printf("- mode: SDVO\n"); break; case 2: printf("- mode: TMDS\n"); break; default: printf("- mode: INVALID!\n"); } printf("- mode: %s\n", val & HDMI_PORT_MODE ? "HDMI" : "DVI"); printf("- audio: %s\n", val & HDMI_PORT_AUDIO ? "enabled" : "disabled"); } static void dump_raw_infoframe(DipInfoFrame *frame) { unsigned int i; printf("- raw:"); for (i = 0; i < 16; i++) { if (i % 4 == 0) printf("\n "); printf(" %08x", frame->data32[i]); } printf("\n"); } static void dump_avi_info(Transcoder transcoder) { Register reg = get_dip_ctl_reg(transcoder); uint32_t val = INREG(reg); DipFrequency freq; DipInfoFrame frame; load_infoframe(transcoder, &frame, DIP_AVI); val = INREG(reg); printf("AVI InfoFrame:\n"); if (gen == 4) { printf("- %sbeing transmitted\n", val & DIP_CTL_BUFFER_TRANS_ACTIVE_GEN4 ? "" : "not "); } freq = (val & DIP_CTL_FREQUENCY) >> 16; printf("- frequency: %s\n", dip_frequency_names[freq]); dump_raw_infoframe(&frame); printf("- type: %x, version: %x, length: %x, ecc: %x, checksum: %x\n", frame.avi.header.type, frame.avi.header.version, frame.avi.header.length, frame.avi.header.ecc, frame.avi.checksum); printf("- S: %x, B: %x, A: %x, Y: %x, Rsvd0: %x\n", frame.avi.S, frame.avi.B, frame.avi.A, frame.avi.Y, frame.avi.Rsvd0); printf("- R: %x, M: %x, C: %x\n", frame.avi.R, frame.avi.M, frame.avi.C); printf("- SC: %x, Q: %x, EC: %x, ITC: %x\n", frame.avi.SC, frame.avi.Q, frame.avi.EC, frame.avi.ITC); printf("- VIC: %x, Rsvd1: %x\n", frame.avi.VIC, frame.avi.Rsvd1); printf("- PR: %x, Rsvd2: %x\n", frame.avi.PR, frame.avi.Rsvd2); printf("- top: %x, bottom: %x, left: %x, right: %x\n", frame.avi.top, frame.avi.bottom, frame.avi.left, frame.avi.right); printf("- Rsvd3: %x, Rsvd4[0]: %x, Rsvd4[1]: %x, Rsvd4[2]: %x\n", frame.avi.Rsvd3, frame.avi.Rsvd4[0], frame.avi.Rsvd4[1], frame.avi.Rsvd4[2]); if (!infoframe_valid_checksum(&frame)) printf("Invalid InfoFrame checksum!\n"); } static void dump_vendor_info(Transcoder transcoder) { Register reg = get_dip_ctl_reg(transcoder); uint32_t val = INREG(reg); DipFrequency freq; DipInfoFrame frame; load_infoframe(transcoder, &frame, DIP_VENDOR); val = INREG(reg); printf("Vendor InfoFrame:\n"); if (gen == 4) { printf("- %sbeing transmitted\n", val & DIP_CTL_BUFFER_TRANS_ACTIVE_GEN4 ? "" : "not "); } freq = (val & DIP_CTL_FREQUENCY) >> 16; printf("- frequency: %s\n", dip_frequency_names[freq]); dump_raw_infoframe(&frame); if (!infoframe_valid_checksum(&frame)) printf("Invalid InfoFrame checksum!\n"); } static void dump_gamut_info(Transcoder transcoder) { Register reg = get_dip_ctl_reg(transcoder); uint32_t val = INREG(reg); DipFrequency freq; DipInfoFrame frame; load_infoframe(transcoder, &frame, DIP_GAMUT); val = INREG(reg); printf("Gamut InfoFrame:\n"); if (gen == 4) { printf("- %sbeing transmitted\n", val & DIP_CTL_BUFFER_TRANS_ACTIVE_GEN4 ? "" : "not "); } freq = (val & DIP_CTL_FREQUENCY) >> 16; printf("- frequency: %s\n", dip_frequency_names[freq]); dump_raw_infoframe(&frame); if (!infoframe_valid_checksum(&frame)) printf("Invalid InfoFrame checksum!\n"); } static void dump_spd_info(Transcoder transcoder) { Register reg = get_dip_ctl_reg(transcoder); uint32_t val = INREG(reg); DipFrequency freq; DipInfoFrame frame; char vendor[9]; char description[17]; load_infoframe(transcoder, &frame, DIP_SPD); val = INREG(reg); printf("SPD InfoFrame:\n"); if (gen == 4) { printf("- %sbeing transmitted\n", val & DIP_CTL_BUFFER_TRANS_ACTIVE_GEN4 ? "" : "not "); } freq = (val & DIP_CTL_FREQUENCY) >> 16; printf("- frequency: %s\n", dip_frequency_names[freq]); dump_raw_infoframe(&frame); printf("- type: %x, version: %x, length: %x, ecc: %x, checksum: %x\n", frame.spd.header.type, frame.spd.header.version, frame.spd.header.length, frame.spd.header.ecc, frame.spd.checksum); memcpy(vendor, frame.spd.vendor, 8); vendor[8] = '\0'; memcpy(description, frame.spd.description, 16); description[16] = '\0'; printf("- vendor: %s\n", vendor); printf("- description: %s\n", description); printf("- source: %s\n", spd_source_to_string(frame.spd.source)); if (!infoframe_valid_checksum(&frame)) printf("Invalid InfoFrame checksum!\n"); } static void dump_transcoder_info(Transcoder transcoder) { Register reg = get_dip_ctl_reg(transcoder); uint32_t val = INREG(reg); if (gen == 4) { printf("\nDIP information:\n"); switch (val & DIP_CTL_PORT_SEL_MASK_GEN4) { case DIP_CTL_PORT_SEL_B_GEN4: printf("- port B\n"); break; case DIP_CTL_PORT_SEL_C_GEN4: printf("- port C\n"); break; default: printf("- INVALID port!\n"); } } else { printf("\nTranscoder %s:\n", transcoder_names[transcoder]); } printf("- %s\n", val & DIP_CTL_ENABLE ? "enabled" : "disabled"); if (!(val & DIP_CTL_ENABLE)) return; printf("- GCP: %s\n", val & DIP_CTL_GCP_ENABLE ? "enabled" : "disabled"); if (val & DIP_CTL_AVI_ENABLE) dump_avi_info(transcoder); if (val & DIP_CTL_VENDOR_ENABLE) dump_vendor_info(transcoder); if (val & DIP_CTL_GAMUT_ENABLE) dump_gamut_info(transcoder); if (val & DIP_CTL_SPD_ENABLE) dump_spd_info(transcoder); } static void dump_all_info(void) { unsigned int i; if (gen == 4) { for (i = 0; i < ARRAY_SIZE(gen4_hdmi_ports); i++) dump_port_info(i); dump_transcoder_info(0); } else { for (i = 0; i < ARRAY_SIZE(pch_hdmi_ports); i++) dump_port_info(i); for (i = 0; i < ARRAY_SIZE(pch_dip_ctl_regs); i++) dump_transcoder_info(i); } } static void write_infoframe(Transcoder transcoder, DipType type, DipInfoFrame *frame) { Register ctl_reg = get_dip_ctl_reg(transcoder); Register data_reg = get_dip_data_reg(transcoder); uint32_t ctl_val; unsigned int i; ctl_val = INREG(ctl_reg); ctl_val &= ~DIP_CTL_BUFFER_INDEX; ctl_val |= (type << 19); ctl_val &= ~DIP_CTL_ACCESS_ADDR; OUTREG(ctl_reg, ctl_val); for (i = 0; i < 8; i++) { ctl_val = INREG(ctl_reg); assert((ctl_val & DIP_CTL_ACCESS_ADDR) == i); OUTREG(data_reg, frame->data32[i]); } } static void disable_infoframe(Transcoder transcoder, DipType type) { Register reg = get_dip_ctl_reg(transcoder); uint32_t val = INREG(reg); if (gen != 4 && type == DIP_AVI) val &= ~DIP_CTL_ENABLE; val &= ~(1 << (21 + type)); OUTREG(reg, val); } static void enable_infoframe(Transcoder transcoder, DipType type) { Register reg = get_dip_ctl_reg(transcoder); uint32_t val = INREG(reg); if (gen != 4 && type == DIP_AVI) val |= DIP_CTL_ENABLE; val |= (1 << (21 + type)); OUTREG(reg, val); } static int parse_infoframe_option_u(const char *name, const char *s, uint32_t min, uint32_t max, uint32_t *value, char **commands) { int read, rc; if (!strcmp(name, s)) { rc = sscanf(*commands, "%x%n", value, &read); *commands = &(*commands)[read]; if (rc != 1) { printf("Invalid value.\n"); return 0; } if (*value < min || *value > max) { printf("Value outside allowed range.\n"); return 0; } return 1; } return 0; } static int parse_infoframe_option_s(const char *name, const char *s, int min_size, int max_size, char *value, char **commands) { int size, read, rc; if (!strcmp(name, s)) { rc = sscanf(*commands, "%31s%n", value, &read); *commands = &(*commands)[read]; if (rc != 1) { printf("Invalid value.\n"); return 0; } size = strlen(value); if (size < min_size || size > max_size) { printf("String either too big or too small.\n"); return 0; } return 1; } return 0; } static void change_avi_infoframe(Transcoder transcoder, char *commands) { Register reg = get_dip_ctl_reg(transcoder); uint32_t val = INREG(reg); DipInfoFrame frame; char option[32]; uint32_t option_val; int rc, read; char *current = commands; load_infoframe(transcoder, &frame, DIP_AVI); val = INREG(reg); while (1) { rc = sscanf(current, "%31s%n", option, &read); current = ¤t[read]; if (rc == EOF) { break; } else if (rc != 1) { printf("Invalid option: %s\n", option); continue; } if (parse_infoframe_option_u("S", option, 0, 2, &option_val, ¤t)) frame.avi.S = option_val; else if (parse_infoframe_option_u("B", option, 0, 3, &option_val, ¤t)) frame.avi.B = option_val; else if (parse_infoframe_option_u("A", option, 0, 1, &option_val, ¤t)) frame.avi.A = option_val; else if (parse_infoframe_option_u("Y", option, 0, 2, &option_val, ¤t)) frame.avi.Y = option_val; else if (parse_infoframe_option_u("R", option, 0, 15, &option_val, ¤t)) frame.avi.R = option_val; else if (parse_infoframe_option_u("M", option, 0, 2, &option_val, ¤t)) frame.avi.M = option_val; else if (parse_infoframe_option_u("C", option, 0, 3, &option_val, ¤t)) frame.avi.C = option_val; else if (parse_infoframe_option_u("SC", option, 0, 3, &option_val, ¤t)) frame.avi.SC = option_val; else if (parse_infoframe_option_u("Q", option, 0, 2, &option_val, ¤t)) frame.avi.Q = option_val; else if (parse_infoframe_option_u("EC", option, 0, 1, &option_val,¤t)) frame.avi.EC = option_val; else if (parse_infoframe_option_u("ITC", option, 0, 1, &option_val, ¤t)) frame.avi.ITC = option_val; else if (parse_infoframe_option_u("VIC", option, 0, 127, &option_val, ¤t)) frame.avi.VIC = option_val; else if (parse_infoframe_option_u("PR", option, 0, 15, &option_val, ¤t)) frame.avi.PR = option_val; else if (parse_infoframe_option_u("top", option, 0, 65535, &option_val, ¤t)) frame.avi.top = option_val; else if (parse_infoframe_option_u("bottom", option, 0, 65535, &option_val, ¤t)) frame.avi.bottom = option_val; else if (parse_infoframe_option_u("left", option, 0, 65535, &option_val, ¤t)) frame.avi.left = option_val; else if (parse_infoframe_option_u("right", option, 0, 65535, &option_val, ¤t)) frame.avi.right = option_val; else printf("Unrecognized option: %s\n", option); } val &= ~DIP_CTL_FREQUENCY; val |= DIP_CTL_FREQ_EVERY; OUTREG(reg, val); frame.avi.header.type = AVI_INFOFRAME_TYPE; frame.avi.header.version = AVI_INFOFRAME_VERSION; frame.avi.header.length = AVI_INFOFRAME_LENGTH; frame.avi.Rsvd0 = 0; frame.avi.Rsvd1 = 0; frame.avi.Rsvd2 = 0; frame.avi.Rsvd3 = 0; frame.avi.Rsvd4[0] = 0; frame.avi.Rsvd4[1] = 0; frame.avi.Rsvd4[2] = 0; infoframe_fix_checksum(&frame); disable_infoframe(transcoder, DIP_AVI); write_infoframe(transcoder, DIP_AVI, &frame); enable_infoframe(transcoder, DIP_AVI); } static void change_spd_infoframe(Transcoder transcoder, char *commands) { Register reg = get_dip_ctl_reg(transcoder); uint32_t val = INREG(reg); DipInfoFrame frame; char option[16]; char option_val_s[32]; uint32_t option_val_i; int rc, read; char *current = commands; load_infoframe(transcoder, &frame, DIP_SPD); val = INREG(reg); while (1) { rc = sscanf(current, "%31s%n", option, &read); current = ¤t[read]; if (rc == EOF) { break; } else if (rc != 1) { printf("Invalid option: %s\n", option); continue; } memset(option_val_s, 0, 32); if (parse_infoframe_option_s("vendor", option, 0, 8, option_val_s, ¤t)) memcpy(frame.spd.vendor, option_val_s, 8); else if (parse_infoframe_option_s("description", option, 0, 16, option_val_s, ¤t)) memcpy(frame.spd.description, option_val_s, 16); else if (parse_infoframe_option_u("source", option, 0, 0x0c, &option_val_i, ¤t)) frame.spd.source = option_val_i; else printf("Unrecognized option: %s\n", option); } val &= ~DIP_CTL_FREQUENCY; val |= DIP_CTL_FREQ_EVERY_OTHER; OUTREG(reg, val); frame.spd.header.type = SPD_INFOFRAME_TYPE; frame.spd.header.version = SPD_INFOFRAME_VERSION; frame.spd.header.length = SPD_INFOFRAME_LENGTH; infoframe_fix_checksum(&frame); disable_infoframe(transcoder, DIP_SPD); write_infoframe(transcoder, DIP_SPD, &frame); enable_infoframe(transcoder, DIP_SPD); } static void change_infoframe_checksum(Transcoder transcoder, DipType type, uint32_t selected_csum) { DipInfoFrame frame; load_infoframe(transcoder, &frame, type); frame.generic.body[0] = selected_csum; disable_infoframe(transcoder, type); write_infoframe(transcoder, type, &frame); enable_infoframe(transcoder, type); } static void change_infoframe_frequency(Transcoder transcoder, DipType type, DipFrequency frequency) { Register reg = get_dip_ctl_reg(transcoder); uint32_t val = INREG(reg); if (type == DIP_AVI && frequency != DIP_FREQ_EVERY_VSYNC) { printf("Error: AVI infoframe must be sent every VSync!\n"); frequency = DIP_FREQ_EVERY_VSYNC; } val &= ~DIP_CTL_FREQUENCY; val |= (frequency << 16); OUTREG(reg, val); } static void disable_dip(Transcoder transcoder) { Register reg = get_dip_ctl_reg(transcoder); uint32_t val = INREG(reg); val &= ~DIP_CTL_ENABLE; OUTREG(reg, val); } static void enable_dip(Transcoder transcoder) { Register reg = get_dip_ctl_reg(transcoder); uint32_t val = INREG(reg); val |= DIP_CTL_ENABLE; OUTREG(reg, val); } static void disable_hdmi_port(Register reg) { uint32_t val = INREG(reg); val &= ~HDMI_PORT_ENABLE; OUTREG(reg, val); } static void enable_hdmi_port(Register reg) { uint32_t val = INREG(reg); val |= HDMI_PORT_ENABLE; OUTREG(reg, val); } static void print_usage(void) { printf("Options:\n" " -d, --dump\n" " dump information about all transcoders\n" " -c, --change-fields [fields]\n" " change infoframe fields from selected transcoder\n" " -k, --change-checksum [checksum]\n" " change infoframe checksum (value in hex)\n" " -q, --change-frequency [frequency]\n" " change infoframe frequency (once, everyvsync or everyothervsync)\n" " -n, --disable\n" " disable the selected infoframe from the selected transcoder\n" " -N, --enable\n" " enable the selected infoframe from the selected transcoder\n" " -x, --disable-infoframes\n" " disable all infoframes from selected transcoder\n" " -X, --enable-infoframes\n" " enable sending infoframes on the selected transcoder\n" " -p, --disable-hdmi-port [port]\n" " disable hdmi port on the selected transcoder (B, C or D)\n" " -P, --enable-hdmi-port [port]\n" " enable hdmi port on the selected transcoder (B, C or D)\n" " -t, --transcoder\n" " select transcoder (A, B or C)\n" " -f, --infoframe\n" " select infoframe (AVI, Vendor, Gamut or SPD)\n" " -h, --help\n" " prints this message\n" "\n" "Examples:\n" "\n" " Dump information:\n" " intel_infoframes\n" "\n" " Disable overscan and set ITC on transcoder B:\n" " intel_infoframes -t B -f AVI -c 'S 2 ITC 1'\n" "\n" " Many actions on the same command:\n" " - enable overscan on transcoder A\n" " - enable overscan and change description on transcoder B\n" " - disable all infoframes on transcoder C\n" " - dump the resulting state:\n" " intel_infoframes -t A -f AVI -c 'S 1' \\\n" " -t B -f AVI -c 'S 2' \\\n" " -f SPD -c 'description Linux' \\\n" " -t C --disable-infoframes \\\n" " -d\n" "\n" " Even more:\n" " - print the help message\n" " - completely disable all infoframes on all transcoders\n" " - dump the state" " - enable sending infoframes on transcoder B, but disable all infoframes\n" " - enable AVI infoframes transcoder B, use underscan and declare ITC\n" " - also enable SPD infoframes on the same transcoder, change frequency to\n" " every vsync and change vendor, description and source\n" " - dump the state again\n" " intel_infoframes -h \\\n" " -t A -x -t B -x -t C -x \\\n" " -d \\\n" " -t A -X -f AVI -n -f Vendor -n \\\n" " -f Gamut -n -f SPD -n \\\n" " -f AVI -N -c 'S 2 ITC 1'\\\n" " -f SPD -q everyvsync \\\n" " -c 'vendor me description mine source 0x09' \\\n" " -d\n" "\n" "Infoframe fields used by the --change-fields option:\n" " - AVI infoframe fields:\n" " S B A Y R M C SC Q EC ITC VIC PR top bottom left right\n" " - SPD infoframe fields:\n" " vendor description source\n" " - Other infoframe fields are not implemented yet.\n"); } #define CHECK_TRANSCODER(transcoder) \ if (transcoder == TRANSC_INVALID) { \ printf("Transcoder not selected.\n"); \ ret = 1; \ goto out; \ } #define CHECK_DIP(dip) \ if (dip == DIP_INVALID) { \ printf("Infoframe not selected.\n"); \ ret = 1; \ goto out; \ } int main(int argc, char *argv[]) { int opt; int ret = 0; struct pci_device *pci_dev; Transcoder transcoder = TRANSC_INVALID; DipType dip = DIP_INVALID; Register hdmi_port; char short_opts[] = "dc:k:q:nNxXp:P:t:f:h"; struct option long_opts[] = { { "dump", no_argument, NULL, 'd' }, { "change-fields", required_argument, NULL, 'c' }, { "change-checksum", required_argument, NULL, 'k' }, { "change-frequency", required_argument, NULL, 'q' }, { "disable", no_argument, NULL, 'n' }, { "enable", no_argument, NULL, 'N' }, { "disable-infoframes", no_argument, NULL, 'x' }, { "enable-infoframes", no_argument, NULL, 'X' }, { "disable-hdmi-port", required_argument, NULL, 'p' }, { "enable-hdmi-port", required_argument, NULL, 'P' }, { "transcoder" , required_argument, NULL, 't' }, { "infoframe", required_argument, NULL, 'f' }, { "help", no_argument, NULL, 'h' }, }; printf("WARNING: This is just a debugging tool! Don't expect it to work" " perfectly: the Kernel might undo our changes.\n"); pci_dev = intel_get_pci_device(); intel_register_access_init(pci_dev, 0); intel_check_pch(); if (IS_GEN4(pci_dev->device_id)) gen = 4; else if (IS_GEN5(pci_dev->device_id)) gen = 5; else if (IS_GEN6(pci_dev->device_id)) gen = 6; else if (IS_GEN7(pci_dev->device_id)) gen = 7; else { printf("This program does not support your hardware yet.\n"); ret = 1; goto out; } while (1) { opt = getopt_long(argc, argv, short_opts, long_opts, NULL); if (opt == -1) break; switch (opt) { case 'd': dump_all_info(); break; case 'c': if (transcoder == TRANSC_INVALID) { printf("Transcoder not selected.\n"); ret = 1; goto out; } switch (dip) { case DIP_AVI: change_avi_infoframe(transcoder, optarg); break; case DIP_VENDOR: case DIP_GAMUT: printf("Option not implemented yet.\n"); ret = 1; goto out; case DIP_SPD: change_spd_infoframe(transcoder, optarg); break; case DIP_INVALID: printf("Infoframe not selected.\n"); ret = 1; goto out; } break; case 'k': CHECK_TRANSCODER(transcoder); CHECK_DIP(dip); change_infoframe_checksum(transcoder, dip, atoi(optarg)); break; case 'q': CHECK_TRANSCODER(transcoder); CHECK_DIP(dip); if (!strcmp(optarg, "once")) change_infoframe_frequency(transcoder, dip, DIP_FREQ_ONCE); else if (!strcmp(optarg, "everyvsync")) change_infoframe_frequency(transcoder, dip, DIP_FREQ_EVERY_VSYNC); else if (!strcmp(optarg, "everyothervsync")) change_infoframe_frequency(transcoder, dip, DIP_FREQ_EVERY_OTHER_VSYNC); else { printf("Invalid frequency.\n"); ret = 1; goto out; } break; case 'n': CHECK_TRANSCODER(transcoder); CHECK_DIP(dip); disable_infoframe(transcoder, dip); break; case 'N': CHECK_TRANSCODER(transcoder); CHECK_DIP(dip); enable_infoframe(transcoder, dip); break; case 'x': CHECK_TRANSCODER(transcoder); disable_dip(transcoder); break; case 'X': CHECK_TRANSCODER(transcoder); enable_dip(transcoder); break; case 'p': case 'P': if (!strcmp(optarg, "B")) hdmi_port = get_hdmi_port(0); else if (!strcmp(optarg, "C")) hdmi_port = get_hdmi_port(1); else if (!strcmp(optarg, "D")) hdmi_port = get_hdmi_port(2); else { printf("Invalid HDMI port.\n"); ret = 1; goto out; } if (opt == 'p') disable_hdmi_port(hdmi_port); else enable_hdmi_port(hdmi_port); break; case 't': if (!strcmp(optarg, "A")) transcoder = TRANSC_A; else if (!strcmp(optarg, "B")) transcoder = TRANSC_B; else if (pch >= PCH_CPT && !strcmp(optarg, "C")) { transcoder = TRANSC_C; } else { printf("Invalid transcoder.\n"); ret = 1; goto out; } break; case 'f': if (!strcmp(optarg, "AVI")) dip = DIP_AVI; else if (!strcmp(optarg, "Vendor")) dip = DIP_VENDOR; else if (!strcmp(optarg, "Gamut")) dip = DIP_GAMUT; else if (!strcmp(optarg, "SPD")) dip = DIP_SPD; else { printf("Invalid infoframe.\n"); ret = 1; goto out; } break; case 'h': print_usage(); break; default: print_usage(); ret = 1; goto out; } } out: intel_register_access_fini(); return ret; } intel-gpu-tools-1.3/tools/intel_bios_dumper.c0000664000175100017510000000563411702777132016372 00000000000000/* * Copyright © 2007 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * * Authors: * Eric Anholt * */ #include #include #include #include #include #include #include #include #include #include #ifndef DEFFILEMODE #define DEFFILEMODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH) /* 0666 */ #endif static void usage(void) { fprintf(stderr, "usage: bios_dumper \n"); exit(1); } int main(int argc, char **argv) { struct pci_device *dev; void *bios; int error, fd; if (argc != 2) usage(); error = pci_system_init(); if (error != 0) { fprintf(stderr, "Couldn't initialize PCI system: %s\n", strerror(error)); exit(1); } /* Grab the graphics card */ dev = pci_device_find_by_slot(0, 0, 2, 0); if (dev == NULL) errx(1, "Couldn't find graphics card"); error = pci_device_probe(dev); if (error != 0) { fprintf(stderr, "Couldn't probe graphics card: %s\n", strerror(error)); exit(1); } if (dev->vendor_id != 0x8086) errx(1, "Graphics card is non-intel"); /* Some versions of libpciaccess correct this automatically, but some * don't. */ if (dev->rom_size == 0) dev->rom_size = 64 * 1024; bios = malloc(dev->rom_size); if (bios == NULL) errx(1, "Couldn't allocate memory for BIOS data\n"); error = pci_device_read_rom(dev, bios); if (error != 0) { fprintf(stderr, "Couldn't read graphics card ROM: %s\n", strerror(error)); exit(1); } fd = open(argv[1], O_RDWR | O_CREAT | O_TRUNC, DEFFILEMODE); if (fd < 0) { fprintf(stderr, "Couldn't open output: %s\n", strerror(errno)); exit(1); } if (write(fd, bios, dev->rom_size) < dev->rom_size) { fprintf(stderr, "Couldn't write BIOS data: %s\n", strerror(errno)); exit(1); } close(fd); pci_system_cleanup(); return 0; } intel-gpu-tools-1.3/tools/intel_panel_fitter.c0000664000175100017510000002073011721136153016521 00000000000000/* * Copyright © 2012 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * * Authors: * Paulo Zanoni */ #include #include #include #include #include #include #include "intel_gpu_tools.h" int gen; uint32_t HTOTAL[] = { 0x60000, 0x61000, 0x62000 }; uint32_t VTOTAL[] = { 0x6000C, 0x6100C, 0x6200C }; uint32_t PIPECONF[] = { 0x70008, 0x71008, 0x72008 }; uint32_t PIPESRC[] = { 0x6001C, 0x6101C, 0x6201C }; uint32_t PF_CTRL1[] = { 0x68080, 0x68880, 0x69080 }; uint32_t PF_WIN_POS[] = { 0x68070, 0x68870, 0x69070 }; uint32_t PF_WIN_SZ[] = { 0x68074, 0x68874, 0x69074 }; #define PIPECONF_ENABLE (1 << 31) #define PIPECONF_INTERLACE_MASK (7 << 21) #define PIPECONF_PF_PD (0 << 21) #define PIPECONF_PF_ID (1 << 21) #define PIPECONF_IF_ID (3 << 21) #define HTOTAL_ACTIVE_MASK (0xFFF << 0) #define VTOTAL_ACTIVE_MASK (0xFFF << 0) #define PIPESRC_HORIZ_MASK (0xFFF << 16) #define PIPESRC_VERT_MASK (0xFFF << 0) /*#define PF_ENABLE (1 << 31)*/ #define PF_PIPE_MASK (3 << 29) #define PF_FILTER_MASK (3 << 23) #define PF_FILTER_MED (1 << 23) #define PF_PIPE_A (0 << 29) #define PF_PIPE_B (1 << 29) #define PF_PIPE_C (2 << 29) #define PF_WIN_SZ_X_MASK (0x1FFF << 16) #define PF_WIN_SZ_Y_MASK (0xFFF << 0) struct pipe_info { bool enabled; bool pf_enabled; uint32_t interlace_mode; uint32_t tot_width; /* htotal */ uint32_t tot_height; /* vtotal */ uint32_t src_width; /* pipesrc.x */ uint32_t src_height; /* pipesrc.y */ uint32_t dst_width; /* pf_win_sz.x */ uint32_t dst_height; /* pf_win_sz.y */ }; static void read_pipe_info(int intel_pipe, struct pipe_info *info) { uint32_t conf, vtotal, htotal, src, ctrl1, win_sz; conf = INREG(PIPECONF[intel_pipe]); htotal = INREG(HTOTAL[intel_pipe]); vtotal = INREG(VTOTAL[intel_pipe]); src = INREG(PIPESRC[intel_pipe]); ctrl1 = INREG(PF_CTRL1[intel_pipe]); win_sz = INREG(PF_WIN_SZ[intel_pipe]); info->enabled = (conf & PIPECONF_ENABLE) ? true : false; info->tot_width = (htotal & HTOTAL_ACTIVE_MASK) + 1; info->tot_height = (vtotal & VTOTAL_ACTIVE_MASK) + 1; info->src_width = ((src & PIPESRC_HORIZ_MASK) >> 16) + 1; info->src_height = (src & PIPESRC_VERT_MASK) + 1; info->interlace_mode = conf & PIPECONF_INTERLACE_MASK; info->pf_enabled = ctrl1 & PF_ENABLE; info->dst_width = (win_sz & PF_WIN_SZ_X_MASK) >> 16; info->dst_height = win_sz & PF_WIN_SZ_Y_MASK; } static void dump_pipe(int intel_pipe) { struct pipe_info info; read_pipe_info(intel_pipe, &info); printf("\nPipe %c:\n", intel_pipe + 'A'); printf("- %s\n", info.enabled ? "enabled" : "disabled"); if (!info.enabled) return; switch (info.interlace_mode) { case PIPECONF_PF_PD: printf("- progressive\n"); break; case PIPECONF_PF_ID: printf("- interlaced (progressive fetch)\n"); break; case PIPECONF_IF_ID: printf("- interlaced (interlaced fetch)\n"); break; default: assert(0); } printf("- pf %s\n", info.pf_enabled ? "enabled" : "disabled"); if (!info.pf_enabled) return; printf("- tot %dx%d\n", info.tot_width, info.tot_height); printf("- src %dx%d\n", info.src_width, info.src_height); printf("- dst %dx%d\n", info.dst_width, info.dst_height); } static void dump_info(void) { int i; int pipes; if (gen < 7) pipes = 2; else pipes = 3; for (i = 0; i < pipes; i++) { dump_pipe(i); } } static int change_screen_size(int intel_pipe, int x, int y) { struct pipe_info info; uint32_t dst_width, dst_height, pos_x, pos_y; uint32_t ctrl1_val; uint32_t win_pos_val; uint32_t win_sz_val; read_pipe_info(intel_pipe, &info); if (x == 0) { if (info.dst_width != 0) dst_width = info.dst_width; else dst_width = info.src_width; } else { dst_width = x; } if (y == 0) { if (info.dst_height != 0) dst_height = info.dst_height; else dst_height = info.src_height; } else { dst_height = y; } pos_x = abs((info.tot_width - dst_width)) / 2; pos_y = abs((info.tot_height - dst_height)) / 2; if (pos_x == 1) pos_x = 0; if (info.src_width / (double) dst_width > 1.125) { printf("X is too small\n"); return 1; } else if (info.tot_width < dst_width) { printf("X is too big\n"); return 1; } else if (dst_width & 1) { printf("X must be even\n"); return 1; } else if (info.src_height / (double) dst_height > 1.125) { printf("Y is too small\n"); return 1; } else if (info.tot_height < dst_height) { printf("Y is too big\n"); return 1; } else if (dst_height & 1) { printf("Y must be even\n"); return 1; } printf("Changing size for pipe %c:\n" "- width: %d -> %d\n" "- height: %d -> %d\n" "- pos: %dx%d\n", intel_pipe + 'A', info.src_width, dst_width, info.src_height, dst_height, pos_x, pos_y); ctrl1_val = PF_ENABLE | PF_FILTER_MED; /* This can break stuff if the panel fitter is already enabled for * another pipe */ if (gen >= 7) { switch (intel_pipe) { case 0: ctrl1_val |= PF_PIPE_A; break; case 1: ctrl1_val |= PF_PIPE_B; break; case 2: ctrl1_val |= PF_PIPE_C; break; default: assert(0); } } OUTREG(PF_CTRL1[intel_pipe], ctrl1_val); win_pos_val = pos_x << 16; win_pos_val |= pos_y; OUTREG(PF_WIN_POS[intel_pipe], win_pos_val); win_sz_val = dst_width << 16; win_sz_val |= dst_height; OUTREG(PF_WIN_SZ[intel_pipe], win_sz_val); return 0; } static int disable_panel_fitter(int intel_pipe) { OUTREG(PF_CTRL1[intel_pipe], 0); OUTREG(PF_WIN_POS[intel_pipe], 0); OUTREG(PF_WIN_SZ[intel_pipe], 0); return 0; } static void print_usage(void) { printf("Options:\n" " -p pipe: pipe to be used (A, B or C)\n" " -x value: final screen width size in pixels\n" " -y value: final screen height size in pixels\n" " -d: disable panel fitter\n" " -l: list the current state of each pipe\n" " -h: prints this message\n"); } int main (int argc, char *argv[]) { int opt; int ret = 0; char intel_pipe = '\0'; int x = 0, y = 0; bool do_disable = false, do_dump = false, do_usage = false; struct pci_device *pci_dev; uint32_t devid; printf("WARNING:\n" "This tool is a workaround for people that don't have a Kernel " "with overscan compensation properties: it is just a temporary " "solution that may or may not work. Use it at your own risk.\n"); pci_dev = intel_get_pci_device(); intel_register_access_init(pci_dev, 0); devid = pci_dev->device_id; if (!HAS_PCH_SPLIT(devid)) { printf("This tool was only tested on Ironlake and newer\n"); ret = 1; goto out; } if (IS_GEN5(devid)) gen = 5; else if (IS_GEN6(devid)) gen = 6; else gen = 7; while ((opt = getopt(argc, argv, "p:x:y:dlh")) != -1) { switch (opt) { case 'p': intel_pipe = optarg[0]; if (intel_pipe != 'A' && intel_pipe != 'B' && (gen <= 6 || intel_pipe != 'C')) { printf("Invalid pipe\n"); ret = 1; goto out; } break; case 'x': x = atoi(optarg); break; case 'y': y = atoi(optarg); break; case 'd': do_disable = true; break; case 'l': do_dump = true; break; case 'h': do_usage = true; break; default: do_usage = true; ret = 1; } } if (do_usage) { print_usage(); } else if (do_dump) { dump_info(); } else if (intel_pipe) { if (do_disable) ret = disable_panel_fitter(intel_pipe - 'A'); else ret = change_screen_size(intel_pipe - 'A', x, y); } else { print_usage(); ret = 1; } out: intel_register_access_fini(); return ret; } intel-gpu-tools-1.3/tools/intel_gpu_time.c0000664000175100017510000000571511566027747015703 00000000000000/* * Copyright © 2007,2009 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * * Authors: * Eric Anholt * Chris Wilson * */ #include #include #include #include #include #include #include #include "intel_gpu_tools.h" #define SAMPLES_PER_SEC 10000 static volatile int goddo; static pid_t spawn(char **argv) { pid_t pid; pid = fork(); if (pid != 0) return pid; execvp(argv[0], argv); exit(1); } static void sighandler(int sig) { goddo = sig; } int main(int argc, char **argv) { pid_t child; uint64_t ring_idle = 0, ring_time = 0; struct timeval start, end; static struct rusage rusage; int status; intel_get_mmio(intel_get_pci_device()); if (argc == 1) { fprintf(stderr, "usage: %s cmd [args...]\n", argv[0]); return 1; } signal(SIGCHLD, sighandler); signal(SIGINT, SIG_IGN); signal(SIGQUIT, SIG_IGN); gettimeofday(&start, NULL); child = spawn(argv+1); if (child < 0) return 127; while (!goddo) { uint32_t ring_head, ring_tail; ring_head = INREG(LP_RING + RING_HEAD) & HEAD_ADDR; ring_tail = INREG(LP_RING + RING_TAIL) & TAIL_ADDR; if (ring_tail == ring_head) ring_idle++; ring_time++; usleep(1000000 / SAMPLES_PER_SEC); } gettimeofday(&end, NULL); timersub(&end, &start, &end); waitpid(child, &status, 0); getrusage(RUSAGE_CHILDREN, &rusage); printf("user: %ld.%06lds, sys: %ld.%06lds, elapsed: %ld.%06lds, CPU: %.1f%%, GPU: %.1f%%\n", rusage.ru_utime.tv_sec, rusage.ru_utime.tv_usec, rusage.ru_stime.tv_sec, rusage.ru_stime.tv_usec, end.tv_sec, end.tv_usec, 100*(rusage.ru_utime.tv_sec + 1e-6*rusage.ru_utime.tv_usec + rusage.ru_stime.tv_sec + 1e-6*rusage.ru_stime.tv_usec) / (end.tv_sec + 1e-6*end.tv_usec), 100 - ring_idle * 100. / ring_time); return WEXITSTATUS(status); } intel-gpu-tools-1.3/tools/intel_lid.c0000664000175100017510000000666411566027747014646 00000000000000/* * Copyright © 2009 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * * Authors: * Zhenyu Wang * */ #include #include #include #include #include #include #include #include #include #include #include #include "intel_gpu_tools.h" #include "intel_reg.h" #include "intel_bios.h" enum lid_status { LID_UNKNOWN = -1, LID_OPEN, LID_CLOSE, }; #define ACPI_BUTTON "/proc/acpi/button/" #define ACPI_LID "/proc/acpi/button/lid/" static int i830_lvds_acpi_lid_state(void) { int fd; DIR *button_dir; DIR *lid_dir; struct dirent *lid_dent; char *state_name; char state[64]; enum lid_status ret = LID_UNKNOWN; button_dir = opendir(ACPI_BUTTON); /* If acpi button driver is not loaded, bypass ACPI check method */ if (button_dir == NULL) goto out; closedir(button_dir); lid_dir = opendir(ACPI_LID); /* no acpi lid object found */ if (lid_dir == NULL) goto out; while (1) { lid_dent = readdir(lid_dir); if (lid_dent == NULL) { /* no LID object */ closedir(lid_dir); goto out; } if (strcmp(lid_dent->d_name, ".") && strcmp(lid_dent->d_name, "..")) { break; } } state_name = malloc(strlen(ACPI_LID) + strlen(lid_dent->d_name) + 7); memset(state_name, 0, sizeof(state_name)); strcat(state_name, ACPI_LID); strcat(state_name, lid_dent->d_name); strcat(state_name, "/state"); closedir(lid_dir); if ((fd = open(state_name, O_RDONLY)) == -1) { free(state_name); goto out; } free(state_name); if (read(fd, state, 64) == -1) { close(fd); goto out; } close(fd); if (strstr(state, "open")) ret = LID_OPEN; else if (strstr(state, "closed")) ret = LID_CLOSE; else /* "unsupported" */ ret = LID_UNKNOWN; out: return ret; } int main(int argc, char **argv) { int swf14, acpi_lid; intel_get_mmio(intel_get_pci_device()); while (1) { swf14 = INREG(SWF14); printf("Intel LVDS Lid status:\n"); printf("\tSWF14(0x%x) : %s\n", swf14, swf14 & SWF14_LID_SWITCH_EN ? "close" : "open"); acpi_lid = i830_lvds_acpi_lid_state(); switch (acpi_lid) { case LID_UNKNOWN: printf("\tACPI Lid state : unknown\n"); break; case LID_OPEN: printf("\tACPI Lid state : open\n"); break; case LID_CLOSE: printf("\tACPI Lid state : close\n"); break; } sleep(2); } return 0; } intel-gpu-tools-1.3/tools/intel_disable_clock_gating.c0000664000175100017510000000434411566027747020176 00000000000000/* * Copyright © 2010 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * * Authors: * Zhenyu Wang * */ #include #include #include #include #include #include "intel_gpu_tools.h" int main(int argc, char** argv) { struct pci_device *pci_dev; pci_dev = intel_get_pci_device(); intel_get_mmio(pci_dev); if (IS_GEN5(pci_dev->device_id)) { printf("Restore method:\n"); printf("intel_reg_write 0x%x 0x%08x\n", PCH_3DCGDIS0, INREG(PCH_3DCGDIS0)); OUTREG(PCH_3DCGDIS0, 0xffffffff); printf("intel_reg_write 0x%x 0x%08x\n", PCH_3DCGDIS1, INREG(PCH_3DCGDIS1)); OUTREG(PCH_3DCGDIS1, 0xffffffff); printf("intel_reg_write 0x%x 0x%08x\n", PCH_3DRAMCGDIS0, INREG(PCH_3DRAMCGDIS0)); OUTREG(PCH_3DRAMCGDIS0, 0xffffffff); printf("intel_reg_write 0x%x 0x%08x\n", PCH_DSPCLK_GATE_D, INREG(PCH_DSPCLK_GATE_D)); OUTREG(PCH_DSPCLK_GATE_D, 0xffffffff); printf("intel_reg_write 0x%x 0x%08x\n", PCH_DSPRAMCLK_GATE_D, INREG(PCH_DSPRAMCLK_GATE_D)); OUTREG(PCH_DSPRAMCLK_GATE_D, 0xffffffff); } else { fprintf(stderr, "unsupported chipset\n"); } return 0; } intel-gpu-tools-1.3/tools/intel_reg_snapshot.c0000664000175100017510000000303311566027747016555 00000000000000/* * Copyright © 2010 Red Hat, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * * Authors: * Adam Jackson */ #include #include "intel_gpu_tools.h" int main(int argc, char** argv) { struct pci_device *pci_dev; uint32_t devid; int mmio_bar; pci_dev = intel_get_pci_device(); devid = pci_dev->device_id; intel_get_mmio(pci_dev); if (IS_GEN2(devid)) mmio_bar = 1; else mmio_bar = 0; write(1, mmio, pci_dev->regions[mmio_bar].size); return 0; } intel-gpu-tools-1.3/tools/intel_dump_decode.c0000664000175100017510000001067411702777132016332 00000000000000/* * Copyright © 2010 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Chris Wilson * */ #define _GNU_SOURCE #include #include #include #include #include #include #include #include #include struct drm_intel_decode *ctx; static void read_bin_file(const char * filename) { uint32_t buf[16384]; int fd, offset, ret; if (!strcmp(filename, "-")) fd = fileno(stdin); else fd = open (filename, O_RDONLY); if (fd < 0) { fprintf (stderr, "Failed to open %s: %s\n", filename, strerror (errno)); exit (1); } drm_intel_decode_set_dump_past_end(ctx, 1); offset = 0; while ((ret = read (fd, buf, sizeof(buf))) > 0) { drm_intel_decode_set_batch_pointer(ctx, buf, offset, ret/4); drm_intel_decode(ctx); offset += ret; } close (fd); } static void read_data_file(const char * filename) { FILE *file; uint32_t *data = NULL; int data_size = 0, count = 0, line_number = 0, matched; char *line = NULL; size_t line_size; uint32_t offset, value; uint32_t gtt_offset = 0; if (!strcmp(filename, "-")) file = stdin; else file = fopen (filename, "r"); if (file == NULL) { fprintf (stderr, "Failed to open %s: %s\n", filename, strerror (errno)); exit (1); } while (getline (&line, &line_size, file) > 0) { line_number++; matched = sscanf (line, "%08x : %08x", &offset, &value); if (matched != 2) { printf("ignoring line %s", line); continue; } count++; if (count > data_size) { data_size = data_size ? data_size * 2 : 1024; data = realloc (data, data_size * sizeof (uint32_t)); if (data == NULL) { fprintf (stderr, "Out of memory.\n"); exit (1); } } data[count-1] = value; } if (count) { drm_intel_decode_set_batch_pointer(ctx, data, gtt_offset, count); drm_intel_decode(ctx); } free (data); free (line); fclose (file); } static void read_autodetect_file(const char * filename) { int binary = 0, c; FILE *file; file = fopen (filename, "r"); if (file == NULL) { fprintf (stderr, "Failed to open %s: %s\n", filename, strerror (errno)); exit (1); } while ((c = fgetc(file)) != EOF) { /* totally lazy binary detector */ if (c < 10) { binary = 1; break; } } fclose(file); if (binary == 1) read_bin_file(filename); else read_data_file(filename); } int main (int argc, char *argv[]) { uint32_t devid = 0xa011; int i, c; int option_index = 0; int binary = -1; static struct option long_options[] = { {"devid", 1, 0, 'd'}, {"ascii", 0, 0, 'a'}, {"binary", 0, 0, 'b'} }; while((c = getopt_long(argc, argv, "ab", long_options, &option_index)) != -1) { switch(c) { case 'd': devid = strtoul(optarg, NULL, 0); break; case 'b': binary = 1; break; case 'a': binary = 0; break; default: printf("unkown command options\n"); break; } } ctx = drm_intel_decode_context_alloc(devid); if (optind == argc) { fprintf(stderr, "no input file given\n"); exit(-1); } for (i = optind; i < argc; i++) { /* For stdin input, let's read as data file */ if (!strcmp(argv[i], "-")) { read_data_file(argv[i]); continue; } if (binary == 1) read_bin_file(argv[i]); else if (binary == 0) read_data_file(argv[i]); else read_autodetect_file(argv[i]); } return 0; } intel-gpu-tools-1.3/tools/intel_stepping.c0000664000175100017510000001446311702777132015713 00000000000000/* * Copyright © 2007 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * * Authors: * Eric Anholt * */ #include #include #include #include #include #include #include "intel_chipset.h" #include "intel_gpu_tools.h" static void print_clock(const char *name, int clock) { if (clock == -1) printf("%s clock: unknown", name); else printf("%s clock: %d Mhz", name, clock); } static int print_clock_info(struct pci_device *pci_dev) { uint32_t devid = pci_dev->device_id; uint16_t gcfgc; if (IS_GM45(devid)) { int core_clock = -1; pci_device_cfg_read_u16(pci_dev, &gcfgc, I915_GCFGC); switch (gcfgc & 0xf) { case 8: core_clock = 266; break; case 9: core_clock = 320; break; case 11: core_clock = 400; break; case 13: core_clock = 533; break; } print_clock("core", core_clock); } else if (IS_965(devid) && IS_MOBILE(devid)) { int render_clock = -1, sampler_clock = -1; pci_device_cfg_read_u16(pci_dev, &gcfgc, I915_GCFGC); switch (gcfgc & 0xf) { case 2: render_clock = 250; sampler_clock = 267; break; case 3: render_clock = 320; sampler_clock = 333; break; case 4: render_clock = 400; sampler_clock = 444; break; case 5: render_clock = 500; sampler_clock = 533; break; } print_clock("render", render_clock); printf(" "); print_clock("sampler", sampler_clock); } else if (IS_945(devid) && IS_MOBILE(devid)) { int render_clock = -1, display_clock = -1; pci_device_cfg_read_u16(pci_dev, &gcfgc, I915_GCFGC); switch (gcfgc & 0x7) { case 0: render_clock = 166; break; case 1: render_clock = 200; break; case 3: render_clock = 250; break; case 5: render_clock = 400; break; } switch (gcfgc & 0x70) { case 0: display_clock = 200; break; case 4: display_clock = 320; break; } if (gcfgc & (1 << 7)) display_clock = 133; print_clock("render", render_clock); printf(" "); print_clock("display", display_clock); } else if (IS_915(devid) && IS_MOBILE(devid)) { int render_clock = -1, display_clock = -1; pci_device_cfg_read_u16(pci_dev, &gcfgc, I915_GCFGC); switch (gcfgc & 0x7) { case 0: render_clock = 160; break; case 1: render_clock = 190; break; case 4: render_clock = 333; break; } if (gcfgc & (1 << 13)) render_clock = 133; switch (gcfgc & 0x70) { case 0: display_clock = 190; break; case 4: display_clock = 333; break; } if (gcfgc & (1 << 7)) display_clock = 133; print_clock("render", render_clock); printf(" "); print_clock("display", display_clock); } printf("\n"); return -1; } int main(int argc, char **argv) { struct pci_device *dev, *bridge; int error; uint8_t stepping; const char *step_desc = "??"; error = pci_system_init(); if (error != 0) { fprintf(stderr, "Couldn't initialize PCI system: %s\n", strerror(error)); exit(1); } /* Grab the graphics card */ dev = pci_device_find_by_slot(0, 0, 2, 0); if (dev == NULL) errx(1, "Couldn't find graphics card"); error = pci_device_probe(dev); if (error != 0) { fprintf(stderr, "Couldn't probe graphics card: %s\n", strerror(error)); exit(1); } if (dev->vendor_id != 0x8086) errx(1, "Graphics card is non-intel"); bridge = pci_device_find_by_slot(0, 0, 0, 0); if (dev == NULL) errx(1, "Couldn't bridge"); error = pci_device_cfg_read_u8(bridge, &stepping, 8); if (error != 0) { fprintf(stderr, "Couldn't read revision ID: %s\n", strerror(error)); exit(1); } switch (dev->device_id) { case PCI_CHIP_I915_G: if (stepping < 0x04) step_desc = " 0x0e) step_desc = ">C2"; else step_desc = ">B1 vendor_id, dev->device_id, stepping, step_desc); print_clock_info(dev); return 0; } intel-gpu-tools-1.3/tools/intel_audio_dump.c0000644000175100017510000027220312012663433016175 00000000000000/* * Copyright © 2009 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * * Authors: * Zhenyu Wang * Wu Fengguang * */ #define _GNU_SOURCE #include #include #include #include #include #include #include "intel_gpu_tools.h" static uint32_t devid; #define BITSTO(n) (n >= sizeof(long) * 8 ? ~0 : (1UL << (n)) - 1) #define BITMASK(high, low) (BITSTO(high+1) & ~BITSTO(low)) #define BITS(reg, high, low) (((reg) & (BITMASK(high, low))) >> (low)) #define BIT(reg, n) BITS(reg, n, n) #define min_t(type, x, y) ({ \ type __min1 = (x); \ type __min2 = (y); \ __min1 < __min2 ? __min1: __min2; }) #define OPNAME(names, index) \ names[min_t(unsigned int, index, ARRAY_SIZE(names) - 1)] #define dump_reg(reg, desc) \ do { \ dword = INREG(reg); \ printf("%-21s 0x%08x %s\n", # reg, dword, desc); \ } while (0) static const char *pixel_clock[] = { [0] = "25.2 / 1.001 MHz", [1] = "25.2 MHz", [2] = "27 MHz", [3] = "27 * 1.001 MHz", [4] = "54 MHz", [5] = "54 * 1.001 MHz", [6] = "74.25 / 1.001 MHz", [7] = "74.25 MHz", [8] = "148.5 / 1.001 MHz", [9] = "148.5 MHz", [10] = "Reserved", }; static const char *power_state[] = { [0] = "D0", [1] = "D1", [2] = "D2", [3] = "D3", }; static const char *stream_type[] = { [0] = "default samples", [1] = "one bit stream", [2] = "DST stream", [3] = "MLP stream", [4] = "Reserved", }; static const char *dip_port[] = { [0] = "Reserved", [1] = "Digital Port B", [2] = "Digital Port C", [3] = "Digital Port D", }; static const char *dip_type[] = { [0] = "Audio DIP Disabled", [1] = "Audio DIP Enabled", }; static const char *dip_index[] = { [0] = "Audio DIP", [1] = "ACP DIP", [2] = "ISRC1 DIP", [3] = "ISRC2 DIP", [4] = "Reserved", }; static const char *dip_trans[] = { [0] = "disabled", [1] = "reserved", [2] = "send once", [3] = "best effort", }; static const char *video_dip_index[] = { [0] = "AVI DIP", [1] = "Vendor-specific DIP", [2] = "Gamut Metadata DIP", [3] = "Source Product Description DIP", }; static const char *video_dip_trans[] = { [0] = "send once", [1] = "send every vsync", [2] = "send at least every other vsync", [3] = "reserved", }; static const char *trans_to_port_sel[] = { [0] = "no port", [1] = "Digital Port B", [2] = "Digital Port C", [3] = "Digital Port D", [4] = "reserved", [5] = "reserved", [6] = "reserved", [7] = "reserved", }; static const char *ddi_mode[] = { [0] = "HDMI mode", [1] = "DVI mode", [2] = "DP SST mode", [3] = "DP MST mode", [4] = "DP FDI mode", [5] = "reserved", [6] = "reserved", [7] = "reserved", }; static const char *transcoder_select[] = { [0] = "Transcoder A", [1] = "Transcoder B", [2] = "Transcoder C", [3] = "reserved", }; static const char *dp_port_width[] = { [0] = "x1 mode", [1] = "x2 mode", [2] = "reserved", [3] = "x4 mode", [4] = "reserved", [5] = "reserved", [6] = "reserved", [7] = "reserved", }; static const char *bits_per_sample[] = { [0] = "reserved", [1] = "16 bits", [2] = "24 bits", [3] = "32 bits", [4] = "20 bits", [5] = "reserved", }; static const char *sdvo_hdmi_encoding[] = { [0] = "SDVO", [1] = "reserved", [2] = "TMDS", [3] = "reserved", }; static const char *n_index_value[] = { [0] = "HDMI", [1] = "DisplayPort", }; static void do_self_tests(void) { if (BIT(1, 0) != 1) exit(1); if (BIT(0x80000000, 31) != 1) exit(2); if (BITS(0xc0000000, 31, 30) != 3) exit(3); } /* * EagleLake registers */ #define AUD_CONFIG 0x62000 #define AUD_DEBUG 0x62010 #define AUD_VID_DID 0x62020 #define AUD_RID 0x62024 #define AUD_SUBN_CNT 0x62028 #define AUD_FUNC_GRP 0x62040 #define AUD_SUBN_CNT2 0x62044 #define AUD_GRP_CAP 0x62048 #define AUD_PWRST 0x6204c #define AUD_SUPPWR 0x62050 #define AUD_SID 0x62054 #define AUD_OUT_CWCAP 0x62070 #define AUD_OUT_PCMSIZE 0x62074 #define AUD_OUT_STR 0x62078 #define AUD_OUT_DIG_CNVT 0x6207c #define AUD_OUT_CH_STR 0x62080 #define AUD_OUT_STR_DESC 0x62084 #define AUD_PINW_CAP 0x620a0 #define AUD_PIN_CAP 0x620a4 #define AUD_PINW_CONNLNG 0x620a8 #define AUD_PINW_CONNLST 0x620ac #define AUD_PINW_CNTR 0x620b0 #define AUD_PINW_UNSOLRESP 0x620b8 #define AUD_CNTL_ST 0x620b4 #define AUD_PINW_CONFIG 0x620bc #define AUD_HDMIW_STATUS 0x620d4 #define AUD_HDMIW_HDMIEDID 0x6210c #define AUD_HDMIW_INFOFR 0x62118 #define AUD_CONV_CHCNT 0x62120 #define AUD_CTS_ENABLE 0x62128 #define VIDEO_DIP_CTL 0x61170 #define VIDEO_DIP_ENABLE (1<<31) #define VIDEO_DIP_ENABLE_AVI (1<<21) #define VIDEO_DIP_ENABLE_VENDOR (1<<22) #define VIDEO_DIP_ENABLE_SPD (1<<24) #define VIDEO_DIP_BUF_AVI (0<<19) #define VIDEO_DIP_BUF_VENDOR (1<<19) #define VIDEO_DIP_BUF_SPD (3<<19) #define VIDEO_DIP_TRANS_ONCE (0<<16) #define VIDEO_DIP_TRANS_1 (1<<16) #define VIDEO_DIP_TRANS_2 (2<<16) #define AUDIO_HOTPLUG_EN (1<<24) static void dump_eaglelake(void) { uint32_t dword; int i; /* printf("%-18s %8s %s\n\n", "register name", "raw value", "description"); */ dump_reg(VIDEO_DIP_CTL, "Video DIP Control"); dump_reg(SDVOB, "Digital Display Port B Control Register"); dump_reg(SDVOC, "Digital Display Port C Control Register"); dump_reg(PORT_HOTPLUG_EN, "Hot Plug Detect Enable"); dump_reg(AUD_CONFIG, "Audio Configuration"); dump_reg(AUD_DEBUG, "Audio Debug"); dump_reg(AUD_VID_DID, "Audio Vendor ID / Device ID"); dump_reg(AUD_RID, "Audio Revision ID"); dump_reg(AUD_SUBN_CNT, "Audio Subordinate Node Count"); dump_reg(AUD_FUNC_GRP, "Audio Function Group Type"); dump_reg(AUD_SUBN_CNT2, "Audio Subordinate Node Count"); dump_reg(AUD_GRP_CAP, "Audio Function Group Capabilities"); dump_reg(AUD_PWRST, "Audio Power State"); dump_reg(AUD_SUPPWR, "Audio Supported Power States"); dump_reg(AUD_SID, "Audio Root Node Subsystem ID"); dump_reg(AUD_OUT_CWCAP, "Audio Output Converter Widget Capabilities"); dump_reg(AUD_OUT_PCMSIZE, "Audio PCM Size and Rates"); dump_reg(AUD_OUT_STR, "Audio Stream Formats"); dump_reg(AUD_OUT_DIG_CNVT, "Audio Digital Converter"); dump_reg(AUD_OUT_CH_STR, "Audio Channel ID and Stream ID"); dump_reg(AUD_OUT_STR_DESC, "Audio Stream Descriptor Format"); dump_reg(AUD_PINW_CAP, "Audio Pin Complex Widget Capabilities"); dump_reg(AUD_PIN_CAP, "Audio Pin Capabilities"); dump_reg(AUD_PINW_CONNLNG, "Audio Connection List Length"); dump_reg(AUD_PINW_CONNLST, "Audio Connection List Entry"); dump_reg(AUD_PINW_CNTR, "Audio Pin Widget Control"); dump_reg(AUD_PINW_UNSOLRESP,"Audio Unsolicited Response Enable"); dump_reg(AUD_CNTL_ST, "Audio Control State Register"); dump_reg(AUD_PINW_CONFIG, "Audio Configuration Default"); dump_reg(AUD_HDMIW_STATUS, "Audio HDMI Status"); dump_reg(AUD_HDMIW_HDMIEDID,"Audio HDMI Data EDID Block"); dump_reg(AUD_HDMIW_INFOFR, "Audio HDMI Widget Data Island Packet"); dump_reg(AUD_CONV_CHCNT, "Audio Converter Channel Count"); dump_reg(AUD_CTS_ENABLE, "Audio CTS Programming Enable"); printf("\nDetails:\n\n"); dword = INREG(AUD_VID_DID); printf("AUD_VID_DID vendor id\t\t\t0x%x\n", dword >> 16); printf("AUD_VID_DID device id\t\t\t0x%x\n", dword & 0xffff); dword = INREG(AUD_RID); printf("AUD_RID major revision\t\t\t0x%lx\n", BITS(dword, 23, 20)); printf("AUD_RID minor revision\t\t\t0x%lx\n", BITS(dword, 19, 16)); printf("AUD_RID revision id\t\t\t0x%lx\n", BITS(dword, 15, 8)); printf("AUD_RID stepping id\t\t\t0x%lx\n", BITS(dword, 7, 0)); dword = INREG(SDVOB); printf("SDVOB enable\t\t\t\t%u\n", !!(dword & SDVO_ENABLE)); printf("SDVOB HDMI encoding\t\t\t%u\n", !!(dword & SDVO_ENCODING_HDMI)); printf("SDVOB SDVO encoding\t\t\t%u\n", !!(dword & SDVO_ENCODING_SDVO)); printf("SDVOB null packets\t\t\t%u\n", !!(dword & SDVO_NULL_PACKETS_DURING_VSYNC)); printf("SDVOB audio enabled\t\t\t%u\n", !!(dword & SDVO_AUDIO_ENABLE)); dword = INREG(SDVOC); printf("SDVOC enable\t\t\t\t%u\n", !!(dword & SDVO_ENABLE)); printf("SDVOC HDMI encoding\t\t\t%u\n", !!(dword & SDVO_ENCODING_HDMI)); printf("SDVOC SDVO encoding\t\t\t%u\n", !!(dword & SDVO_ENCODING_SDVO)); printf("SDVOC null packets\t\t\t%u\n", !!(dword & SDVO_NULL_PACKETS_DURING_VSYNC)); printf("SDVOC audio enabled\t\t\t%u\n", !!(dword & SDVO_AUDIO_ENABLE)); dword = INREG(PORT_HOTPLUG_EN); printf("PORT_HOTPLUG_EN DisplayPort/HDMI port B\t%ld\n", BIT(dword, 29)), printf("PORT_HOTPLUG_EN DisplayPort/HDMI port C\t%ld\n", BIT(dword, 28)), printf("PORT_HOTPLUG_EN DisplayPort port D\t%ld\n", BIT(dword, 27)), printf("PORT_HOTPLUG_EN SDVOB\t\t\t%ld\n", BIT(dword, 26)), printf("PORT_HOTPLUG_EN SDVOC\t\t\t%ld\n", BIT(dword, 25)), printf("PORT_HOTPLUG_EN audio\t\t\t%ld\n", BIT(dword, 24)), printf("PORT_HOTPLUG_EN TV\t\t\t%ld\n", BIT(dword, 23)), printf("PORT_HOTPLUG_EN CRT\t\t\t%ld\n", BIT(dword, 9)), dword = INREG(VIDEO_DIP_CTL); printf("VIDEO_DIP_CTL enable graphics DIP\t%ld\n", BIT(dword, 31)), printf("VIDEO_DIP_CTL port select\t\t[0x%lx] %s\n", BITS(dword, 30, 29), dip_port[BITS(dword, 30, 29)]); printf("VIDEO_DIP_CTL DIP buffer trans active\t%lu\n", BIT(dword, 28)); printf("VIDEO_DIP_CTL AVI DIP enabled\t\t%lu\n", BIT(dword, 21)); printf("VIDEO_DIP_CTL vendor DIP enabled\t%lu\n", BIT(dword, 22)); printf("VIDEO_DIP_CTL SPD DIP enabled\t\t%lu\n", BIT(dword, 24)); printf("VIDEO_DIP_CTL DIP buffer index\t\t[0x%lx] %s\n", BITS(dword, 20, 19), video_dip_index[BITS(dword, 20, 19)]); printf("VIDEO_DIP_CTL DIP trans freq\t\t[0x%lx] %s\n", BITS(dword, 17, 16), video_dip_trans[BITS(dword, 17, 16)]); printf("VIDEO_DIP_CTL DIP buffer size\t\t%lu\n", BITS(dword, 11, 8)); printf("VIDEO_DIP_CTL DIP address\t\t%lu\n", BITS(dword, 3, 0)); dword = INREG(AUD_CONFIG); printf("AUD_CONFIG pixel clock\t\t\t[0x%lx] %s\n", BITS(dword, 19, 16), OPNAME(pixel_clock, BITS(dword, 19, 16))); printf("AUD_CONFIG fabrication enabled\t\t%lu\n", BITS(dword, 2, 2)); printf("AUD_CONFIG professional use allowed\t%lu\n", BIT(dword, 1)); printf("AUD_CONFIG fuse enabled\t\t\t%lu\n", BIT(dword, 0)); dword = INREG(AUD_DEBUG); printf("AUD_DEBUG function reset\t\t%lu\n", BIT(dword, 0)); dword = INREG(AUD_SUBN_CNT); printf("AUD_SUBN_CNT starting node number\t0x%lx\n", BITS(dword, 23, 16)); printf("AUD_SUBN_CNT total number of nodes\t0x%lx\n", BITS(dword, 7, 0)); dword = INREG(AUD_SUBN_CNT2); printf("AUD_SUBN_CNT2 starting node number\t0x%lx\n", BITS(dword, 24, 16)); printf("AUD_SUBN_CNT2 total number of nodes\t0x%lx\n", BITS(dword, 7, 0)); dword = INREG(AUD_FUNC_GRP); printf("AUD_FUNC_GRP unsol capable\t\t%lu\n", BIT(dword, 8)); printf("AUD_FUNC_GRP node type\t\t\t0x%lx\n", BITS(dword, 7, 0)); dword = INREG(AUD_GRP_CAP); printf("AUD_GRP_CAP beep 0\t\t\t%lu\n", BIT(dword, 16)); printf("AUD_GRP_CAP input delay\t\t\t%lu\n", BITS(dword, 11, 8)); printf("AUD_GRP_CAP output delay\t\t%lu\n", BITS(dword, 3, 0)); dword = INREG(AUD_PWRST); printf("AUD_PWRST device power state\t\t%s\n", power_state[BITS(dword, 5, 4)]); printf("AUD_PWRST device power state setting\t%s\n", power_state[BITS(dword, 1, 0)]); dword = INREG(AUD_SUPPWR); printf("AUD_SUPPWR support D0\t\t\t%lu\n", BIT(dword, 0)); printf("AUD_SUPPWR support D1\t\t\t%lu\n", BIT(dword, 1)); printf("AUD_SUPPWR support D2\t\t\t%lu\n", BIT(dword, 2)); printf("AUD_SUPPWR support D3\t\t\t%lu\n", BIT(dword, 3)); dword = INREG(AUD_OUT_CWCAP); printf("AUD_OUT_CWCAP widget type\t\t0x%lx\n", BITS(dword, 23, 20)); printf("AUD_OUT_CWCAP sample delay\t\t0x%lx\n", BITS(dword, 19, 16)); printf("AUD_OUT_CWCAP channel count\t\t%lu\n", BITS(dword, 15, 13) * 2 + BIT(dword, 0) + 1); printf("AUD_OUT_CWCAP L-R swap\t\t\t%lu\n", BIT(dword, 11)); printf("AUD_OUT_CWCAP power control\t\t%lu\n", BIT(dword, 10)); printf("AUD_OUT_CWCAP digital\t\t\t%lu\n", BIT(dword, 9)); printf("AUD_OUT_CWCAP conn list\t\t\t%lu\n", BIT(dword, 8)); printf("AUD_OUT_CWCAP unsol\t\t\t%lu\n", BIT(dword, 7)); printf("AUD_OUT_CWCAP mute\t\t\t%lu\n", BIT(dword, 5)); printf("AUD_OUT_CWCAP format override\t\t%lu\n", BIT(dword, 4)); printf("AUD_OUT_CWCAP amp param override\t%lu\n", BIT(dword, 3)); printf("AUD_OUT_CWCAP out amp present\t\t%lu\n", BIT(dword, 2)); printf("AUD_OUT_CWCAP in amp present\t\t%lu\n", BIT(dword, 1)); dword = INREG(AUD_OUT_DIG_CNVT); printf("AUD_OUT_DIG_CNVT SPDIF category\t\t0x%lx\n", BITS(dword, 14, 8)); printf("AUD_OUT_DIG_CNVT SPDIF level\t\t%lu\n", BIT(dword, 7)); printf("AUD_OUT_DIG_CNVT professional\t\t%lu\n", BIT(dword, 6)); printf("AUD_OUT_DIG_CNVT non PCM\t\t%lu\n", BIT(dword, 5)); printf("AUD_OUT_DIG_CNVT copyright asserted\t%lu\n", BIT(dword, 4)); printf("AUD_OUT_DIG_CNVT filter preemphasis\t%lu\n", BIT(dword, 3)); printf("AUD_OUT_DIG_CNVT validity config\t%lu\n", BIT(dword, 2)); printf("AUD_OUT_DIG_CNVT validity flag\t\t%lu\n", BIT(dword, 1)); printf("AUD_OUT_DIG_CNVT digital enable\t\t%lu\n", BIT(dword, 0)); dword = INREG(AUD_OUT_CH_STR); printf("AUD_OUT_CH_STR stream id\t\t0x%lx\n", BITS(dword, 7, 4)); printf("AUD_OUT_CH_STR lowest channel\t\t%lu\n", BITS(dword, 3, 0)); dword = INREG(AUD_OUT_STR_DESC); printf("AUD_OUT_STR_DESC stream channels\t%lu\n", BITS(dword, 3, 0) + 1); printf("AUD_OUT_STR_DESC Bits per Sample\t[%#lx] %s\n", BITS(dword, 6, 4), OPNAME(bits_per_sample, BITS(dword, 6, 4))); dword = INREG(AUD_PINW_CAP); printf("AUD_PINW_CAP widget type\t\t0x%lx\n", BITS(dword, 23, 20)); printf("AUD_PINW_CAP sample delay\t\t0x%lx\n", BITS(dword, 19, 16)); printf("AUD_PINW_CAP channel count\t\t%lu\n", BITS(dword, 15, 13) * 2 + BIT(dword, 0) + 1); printf("AUD_PINW_CAP HDCP\t\t\t%lu\n", BIT(dword, 12)); printf("AUD_PINW_CAP L-R swap\t\t\t%lu\n", BIT(dword, 11)); printf("AUD_PINW_CAP power control\t\t%lu\n", BIT(dword, 10)); printf("AUD_PINW_CAP digital\t\t\t%lu\n", BIT(dword, 9)); printf("AUD_PINW_CAP conn list\t\t\t%lu\n", BIT(dword, 8)); printf("AUD_PINW_CAP unsol\t\t\t%lu\n", BIT(dword, 7)); printf("AUD_PINW_CAP mute\t\t\t%lu\n", BIT(dword, 5)); printf("AUD_PINW_CAP format override\t\t%lu\n", BIT(dword, 4)); printf("AUD_PINW_CAP amp param override\t\t%lu\n", BIT(dword, 3)); printf("AUD_PINW_CAP out amp present\t\t%lu\n", BIT(dword, 2)); printf("AUD_PINW_CAP in amp present\t\t%lu\n", BIT(dword, 1)); dword = INREG(AUD_PIN_CAP); printf("AUD_PIN_CAP EAPD\t\t\t%lu\n", BIT(dword, 16)); printf("AUD_PIN_CAP HDMI\t\t\t%lu\n", BIT(dword, 7)); printf("AUD_PIN_CAP output\t\t\t%lu\n", BIT(dword, 4)); printf("AUD_PIN_CAP presence detect\t\t%lu\n", BIT(dword, 2)); dword = INREG(AUD_PINW_CNTR); printf("AUD_PINW_CNTR mute status\t\t%lu\n", BIT(dword, 8)); printf("AUD_PINW_CNTR out enable\t\t%lu\n", BIT(dword, 6)); printf("AUD_PINW_CNTR amp mute status\t\t%lu\n", BIT(dword, 8)); printf("AUD_PINW_CNTR amp mute status\t\t%lu\n", BIT(dword, 8)); printf("AUD_PINW_CNTR stream type\t\t[0x%lx] %s\n", BITS(dword, 2, 0), OPNAME(stream_type, BITS(dword, 2, 0))); dword = INREG(AUD_PINW_UNSOLRESP); printf("AUD_PINW_UNSOLRESP enable unsol resp\t%lu\n", BIT(dword, 31)); dword = INREG(AUD_CNTL_ST); printf("AUD_CNTL_ST DIP audio enabled\t\t%lu\n", BIT(dword, 21)); printf("AUD_CNTL_ST DIP ACP enabled\t\t%lu\n", BIT(dword, 22)); printf("AUD_CNTL_ST DIP ISRCx enabled\t\t%lu\n", BIT(dword, 23)); printf("AUD_CNTL_ST DIP port select\t\t[0x%lx] %s\n", BITS(dword, 30, 29), dip_port[BITS(dword, 30, 29)]); printf("AUD_CNTL_ST DIP buffer index\t\t[0x%lx] %s\n", BITS(dword, 20, 18), OPNAME(dip_index, BITS(dword, 20, 18))); printf("AUD_CNTL_ST DIP trans freq\t\t[0x%lx] %s\n", BITS(dword, 17, 16), dip_trans[BITS(dword, 17, 16)]); printf("AUD_CNTL_ST DIP address\t\t\t%lu\n", BITS(dword, 3, 0)); printf("AUD_CNTL_ST CP ready\t\t\t%lu\n", BIT(dword, 15)); printf("AUD_CNTL_ST ELD valid\t\t\t%lu\n", BIT(dword, 14)); printf("AUD_CNTL_ST ELD ack\t\t\t%lu\n", BIT(dword, 4)); printf("AUD_CNTL_ST ELD bufsize\t\t\t%lu\n", BITS(dword, 13, 9)); printf("AUD_CNTL_ST ELD address\t\t\t%lu\n", BITS(dword, 8, 5)); dword = INREG(AUD_HDMIW_STATUS); printf("AUD_HDMIW_STATUS CDCLK/DOTCLK underrun\t%lu\n", BIT(dword, 31)); printf("AUD_HDMIW_STATUS CDCLK/DOTCLK overrun\t%lu\n", BIT(dword, 30)); printf("AUD_HDMIW_STATUS BCLK/CDCLK underrun\t%lu\n", BIT(dword, 29)); printf("AUD_HDMIW_STATUS BCLK/CDCLK overrun\t%lu\n", BIT(dword, 28)); dword = INREG(AUD_CONV_CHCNT); printf("AUD_CONV_CHCNT HDMI HBR enabled\t\t%lu\n", BITS(dword, 15, 14)); printf("AUD_CONV_CHCNT HDMI channel count\t%lu\n", BITS(dword, 11, 8) + 1); printf("AUD_CONV_CHCNT HDMI channel mapping:\n"); for (i = 0; i < 8; i++) { OUTREG(AUD_CONV_CHCNT, i); dword = INREG(AUD_CONV_CHCNT); printf("\t\t\t\t\t[0x%x] %u => %lu \n", dword, i, BITS(dword, 7, 4)); } printf("AUD_HDMIW_HDMIEDID HDMI ELD:\n\t"); dword = INREG(AUD_CNTL_ST); dword &= ~BITMASK(8, 5); OUTREG(AUD_CNTL_ST, dword); for (i = 0; i < BITS(dword, 14, 10) / 4; i++) printf("%08x ", htonl(INREG(AUD_HDMIW_HDMIEDID))); printf("\n"); printf("AUD_HDMIW_INFOFR HDMI audio Infoframe:\n\t"); dword = INREG(AUD_CNTL_ST); dword &= ~BITMASK(20, 18); dword &= ~BITMASK(3, 0); OUTREG(AUD_CNTL_ST, dword); for (i = 0; i < 8; i++) printf("%08x ", htonl(INREG(AUD_HDMIW_INFOFR))); printf("\n"); } #undef AUD_RID #undef AUD_VID_DID #undef AUD_PWRST #undef AUD_OUT_CH_STR #undef AUD_HDMIW_STATUS /* * IronLake registers */ #define AUD_CONFIG_A 0xE2000 #define AUD_CONFIG_B 0xE2100 #define AUD_CTS_ENABLE_A 0xE2028 #define AUD_CTS_ENABLE_B 0xE2128 #define AUD_MISC_CTRL_A 0xE2010 #define AUD_MISC_CTRL_B 0xE2110 #define AUD_VID_DID 0xE2020 #define AUD_RID 0xE2024 #define AUD_PWRST 0xE204C #define AUD_PORT_EN_HD_CFG 0xE207C #define AUD_OUT_DIG_CNVT_A 0xE2080 #define AUD_OUT_DIG_CNVT_B 0xE2180 #define AUD_OUT_CH_STR 0xE2088 #define AUD_OUT_STR_DESC_A 0xE2084 #define AUD_OUT_STR_DESC_B 0xE2184 #define AUD_PINW_CONNLNG_LIST 0xE20A8 #define AUD_PINW_CONNLNG_SEL 0xE20AC #define AUD_CNTL_ST_A 0xE20B4 #define AUD_CNTL_ST_B 0xE21B4 #define AUD_CNTL_ST2 0xE20C0 #define AUD_HDMIW_STATUS 0xE20D4 #define AUD_HDMIW_HDMIEDID_A 0xE2050 #define AUD_HDMIW_HDMIEDID_B 0xE2150 #define AUD_HDMIW_INFOFR_A 0xE2054 #define AUD_HDMIW_INFOFR_B 0xE2154 static void dump_ironlake(void) { uint32_t dword; int i; dump_reg(HDMIB, "sDVO/HDMI Port B Control"); dump_reg(HDMIC, "HDMI Port C Control"); dump_reg(HDMID, "HDMI Port D Control"); dump_reg(PCH_DP_B, "DisplayPort B Control Register"); dump_reg(PCH_DP_C, "DisplayPort C Control Register"); dump_reg(PCH_DP_D, "DisplayPort D Control Register"); dump_reg(AUD_CONFIG_A, "Audio Configuration - Transcoder A"); dump_reg(AUD_CONFIG_B, "Audio Configuration - Transcoder B"); dump_reg(AUD_CTS_ENABLE_A, "Audio CTS Programming Enable - Transcoder A"); dump_reg(AUD_CTS_ENABLE_B, "Audio CTS Programming Enable - Transcoder B"); dump_reg(AUD_MISC_CTRL_A, "Audio MISC Control for Transcoder A"); dump_reg(AUD_MISC_CTRL_B, "Audio MISC Control for Transcoder B"); dump_reg(AUD_VID_DID, "Audio Vendor ID / Device ID"); dump_reg(AUD_RID, "Audio Revision ID"); dump_reg(AUD_PWRST, "Audio Power State (Function Group, Convertor, Pin Widget)"); dump_reg(AUD_PORT_EN_HD_CFG, "Audio Port Enable HDAudio Config"); dump_reg(AUD_OUT_DIG_CNVT_A, "Audio Digital Converter - Conv A"); dump_reg(AUD_OUT_DIG_CNVT_B, "Audio Digital Converter - Conv B"); dump_reg(AUD_OUT_CH_STR, "Audio Channel ID and Stream ID"); dump_reg(AUD_OUT_STR_DESC_A, "Audio Stream Descriptor Format - Conv A"); dump_reg(AUD_OUT_STR_DESC_B, "Audio Stream Descriptor Format - Conv B"); dump_reg(AUD_PINW_CONNLNG_LIST, "Audio Connection List"); dump_reg(AUD_PINW_CONNLNG_SEL, "Audio Connection Select"); dump_reg(AUD_CNTL_ST_A, "Audio Control State Register - Transcoder A"); dump_reg(AUD_CNTL_ST_B, "Audio Control State Register - Transcoder B"); dump_reg(AUD_CNTL_ST2, "Audio Control State 2"); dump_reg(AUD_HDMIW_STATUS, "Audio HDMI Status"); dump_reg(AUD_HDMIW_HDMIEDID_A, "HDMI Data EDID Block - Transcoder A"); dump_reg(AUD_HDMIW_HDMIEDID_B, "HDMI Data EDID Block - Transcoder B"); dump_reg(AUD_HDMIW_INFOFR_A, "Audio Widget Data Island Packet - Transcoder A"); dump_reg(AUD_HDMIW_INFOFR_B, "Audio Widget Data Island Packet - Transcoder B"); printf("\nDetails:\n\n"); dword = INREG(AUD_VID_DID); printf("AUD_VID_DID vendor id\t\t\t\t\t0x%x\n", dword >> 16); printf("AUD_VID_DID device id\t\t\t\t\t0x%x\n", dword & 0xffff); dword = INREG(AUD_RID); printf("AUD_RID Major_Revision\t\t\t\t\t0x%lx\n", BITS(dword, 23, 20)); printf("AUD_RID Minor_Revision\t\t\t\t\t0x%lx\n", BITS(dword, 19, 16)); printf("AUD_RID Revision_Id\t\t\t\t\t0x%lx\n", BITS(dword, 15, 8)); printf("AUD_RID Stepping_Id\t\t\t\t\t0x%lx\n", BITS(dword, 7, 0)); dword = INREG(HDMIB); printf("HDMIB HDMIB_Enable\t\t\t\t\t%u\n", !!(dword & SDVO_ENABLE)); printf("HDMIB Transcoder_Select\t\t\t\t\t%s\n", BIT(dword, 30) ? "Transcoder B" : "Transcoder A"); printf("HDMIB HDCP_Port_Select\t\t\t\t\t%lu\n", BIT(dword, 5)); printf("HDMIB SDVOB Hot Plug Interrupt Detect Enable\t\t%lu\n", BIT(dword, 23)); printf("HDMIB Digital_Port_B_Detected\t\t\t\t%lu\n", BIT(dword, 2)); printf("HDMIB Encoding\t\t\t\t\t\t[0x%lx] %s\n", BITS(dword, 11, 10), sdvo_hdmi_encoding[BITS(dword, 11, 10)]); printf("HDMIB Null_packets_enabled_during_Vsync\t\t\t%u\n", !!(dword & SDVO_NULL_PACKETS_DURING_VSYNC)); printf("HDMIB Audio_Output_Enable\t\t\t\t%u\n", !!(dword & SDVO_AUDIO_ENABLE)); dword = INREG(HDMIC); printf("HDMIC HDMIC_Enable\t\t\t\t\t%u\n", !!(dword & SDVO_ENABLE)); printf("HDMIC Transcoder_Select\t\t\t\t\t%s\n", BIT(dword, 30) ? "Transcoder B" : "Transcoder A"); printf("HDMIC HDCP_Port_Select\t\t\t\t\t%lu\n", BIT(dword, 5)); printf("HDMIC Digital_Port_C_Detected\t\t\t\t%lu\n", BIT(dword, 2)); printf("HDMIC Encoding\t\t\t\t\t\t[0x%lx] %s\n", BITS(dword, 11, 10), sdvo_hdmi_encoding[BITS(dword, 11, 10)]); printf("HDMIC Null_packets_enabled_during_Vsync\t\t\t%u\n", !!(dword & SDVO_NULL_PACKETS_DURING_VSYNC)); printf("HDMIC Audio_Output_Enable\t\t\t\t%u\n", !!(dword & SDVO_AUDIO_ENABLE)); dword = INREG(HDMID); printf("HDMID HDMID_Enable\t\t\t\t\t%u\n", !!(dword & SDVO_ENABLE)); printf("HDMID Transcoder_Select\t\t\t\t\t%s\n", BIT(dword, 30) ? "Transcoder B" : "Transcoder A"); printf("HDMID HDCP_Port_Select\t\t\t\t\t%lu\n", BIT(dword, 5)); printf("HDMID Digital_Port_D_Detected\t\t\t\t%lu\n", BIT(dword, 2)); printf("HDMID Encoding\t\t\t\t\t\t[0x%lx] %s\n", BITS(dword, 11, 10), sdvo_hdmi_encoding[BITS(dword, 11, 10)]); printf("HDMID Null_packets_enabled_during_Vsync\t\t\t%u\n", !!(dword & SDVO_NULL_PACKETS_DURING_VSYNC)); printf("HDMID Audio_Output_Enable\t\t\t\t%u\n", !!(dword & SDVO_AUDIO_ENABLE)); dword = INREG(PCH_DP_B); printf("PCH_DP_B DisplayPort_Enable\t\t\t\t%lu\n", BIT(dword, 31)); printf("PCH_DP_B Transcoder_Select\t\t\t\t%s\n", BIT(dword, 30) ? "Transcoder B" : "Transcoder A"); printf("PCH_DP_B Port_Width_Selection\t\t\t\t[0x%lx] %s\n", BITS(dword, 21, 19), dp_port_width[BITS(dword, 21, 19)]); printf("PCH_DP_B Port_Detected\t\t\t\t\t%lu\n", BIT(dword, 2)); printf("PCH_DP_B HDCP_Port_Select\t\t\t\t%lu\n", BIT(dword, 5)); printf("PCH_DP_B Audio_Output_Enable\t\t\t\t%lu\n", BIT(dword, 6)); dword = INREG(PCH_DP_C); printf("PCH_DP_C DisplayPort_Enable\t\t\t\t%lu\n", BIT(dword, 31)); printf("PCH_DP_C Transcoder_Select\t\t\t\t%s\n", BIT(dword, 30) ? "Transcoder B" : "Transcoder A"); printf("PCH_DP_C Port_Width_Selection\t\t\t\t[0x%lx] %s\n", BITS(dword, 21, 19), dp_port_width[BITS(dword, 21, 19)]); printf("PCH_DP_C Port_Detected\t\t\t\t\t%lu\n", BIT(dword, 2)); printf("PCH_DP_C HDCP_Port_Select\t\t\t\t%lu\n", BIT(dword, 5)); printf("PCH_DP_C Audio_Output_Enable\t\t\t\t%lu\n", BIT(dword, 6)); dword = INREG(PCH_DP_D); printf("PCH_DP_D DisplayPort_Enable\t\t\t\t%lu\n", BIT(dword, 31)); printf("PCH_DP_D Transcoder_Select\t\t\t\t%s\n", BIT(dword, 30) ? "Transcoder B" : "Transcoder A"); printf("PCH_DP_D Port_Width_Selection\t\t\t\t[0x%lx] %s\n", BITS(dword, 21, 19), dp_port_width[BITS(dword, 21, 19)]); printf("PCH_DP_D Port_Detected\t\t\t\t\t%lu\n", BIT(dword, 2)); printf("PCH_DP_D HDCP_Port_Select\t\t\t\t%lu\n", BIT(dword, 5)); printf("PCH_DP_D Audio_Output_Enable\t\t\t\t%lu\n", BIT(dword, 6)); dword = INREG(AUD_CONFIG_A); printf("AUD_CONFIG_A N_index_value\t\t\t\t[0x%lx] %s\n", BIT(dword, 29), n_index_value[BIT(dword, 29)]); printf("AUD_CONFIG_A N_programming_enable\t\t\t%lu\n", BIT(dword, 28)); printf("AUD_CONFIG_A Upper_N_value\t\t\t\t0x%02lx\n", BITS(dword, 27, 20)); printf("AUD_CONFIG_A Lower_N_value\t\t\t\t0x%03lx\n", BITS(dword, 15, 4)); printf("AUD_CONFIG_A Pixel_Clock\t\t\t\t[0x%lx] %s\n", BITS(dword, 19, 16), OPNAME(pixel_clock, BITS(dword, 19, 16))); printf("AUD_CONFIG_A Disable_NCTS\t\t\t\t%lu\n", BIT(dword, 3)); dword = INREG(AUD_CONFIG_B); printf("AUD_CONFIG_B N_index_value\t\t\t\t[0x%lx] %s\n", BIT(dword, 29), n_index_value[BIT(dword, 29)]); printf("AUD_CONFIG_B N_programming_enable\t\t\t%lu\n", BIT(dword, 28)); printf("AUD_CONFIG_B Upper_N_value\t\t\t\t0x%02lx\n", BITS(dword, 27, 20)); printf("AUD_CONFIG_B Lower_N_value\t\t\t\t0x%03lx\n", BITS(dword, 15, 4)); printf("AUD_CONFIG_B Pixel_Clock\t\t\t\t[0x%lx] %s\n", BITS(dword, 19, 16), OPNAME(pixel_clock, BITS(dword, 19, 16))); printf("AUD_CONFIG_B Disable_NCTS\t\t\t\t%lu\n", BIT(dword, 3)); dword = INREG(AUD_CTS_ENABLE_A); printf("AUD_CTS_ENABLE_A Enable_CTS_or_M_programming\t\t%lu\n", BIT(dword, 20)); printf("AUD_CTS_ENABLE_A CTS/M value Index\t\t\t%s\n", BIT(dword, 21) ? "CTS" : "M"); printf("AUD_CTS_ENABLE_A CTS_programming\t\t\t%#lx\n", BITS(dword, 19, 0)); dword = INREG(AUD_CTS_ENABLE_B); printf("AUD_CTS_ENABLE_B Enable_CTS_or_M_programming\t\t%lu\n", BIT(dword, 20)); printf("AUD_CTS_ENABLE_B CTS/M value Index\t\t\t%s\n", BIT(dword, 21) ? "CTS" : "M"); printf("AUD_CTS_ENABLE_B CTS_programming\t\t\t%#lx\n", BITS(dword, 19, 0)); dword = INREG(AUD_MISC_CTRL_A); printf("AUD_MISC_CTRL_A Sample_Fabrication_EN_bit\t\t%lu\n", BIT(dword, 2)); printf("AUD_MISC_CTRL_A Sample_present_Disable\t\t\t%lu\n", BIT(dword, 8)); printf("AUD_MISC_CTRL_A Output_Delay\t\t\t\t%lu\n", BITS(dword, 7, 4)); printf("AUD_MISC_CTRL_A Pro_Allowed\t\t\t\t%lu\n", BIT(dword, 1)); dword = INREG(AUD_MISC_CTRL_B); printf("AUD_MISC_CTRL_B Sample_Fabrication_EN_bit\t\t%lu\n", BIT(dword, 2)); printf("AUD_MISC_CTRL_B Sample_present_Disable\t\t\t%lu\n", BIT(dword, 8)); printf("AUD_MISC_CTRL_B Output_Delay\t\t\t\t%lu\n", BITS(dword, 7, 4)); printf("AUD_MISC_CTRL_B Pro_Allowed\t\t\t\t%lu\n", BIT(dword, 1)); dword = INREG(AUD_PWRST); printf("AUD_PWRST Function_Group_Device_Power_State_Current\t%s\n", power_state[BITS(dword, 23, 22)]); printf("AUD_PWRST Function_Group_Device_Power_State_Set \t%s\n", power_state[BITS(dword, 21, 20)]); printf("AUD_PWRST ConvertorB_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 19, 18)]); printf("AUD_PWRST ConvertorB_Widget_Power_State_Requested \t%s\n", power_state[BITS(dword, 17, 16)]); printf("AUD_PWRST ConvertorA_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 15, 14)]); printf("AUD_PWRST ConvertorA_Widget_Power_State_Requsted \t%s\n", power_state[BITS(dword, 13, 12)]); printf("AUD_PWRST PinD_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 11, 10)]); printf("AUD_PWRST PinD_Widget_Power_State_Set \t%s\n", power_state[BITS(dword, 9, 8)]); printf("AUD_PWRST PinC_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 7, 6)]); printf("AUD_PWRST PinC_Widget_Power_State_Set \t%s\n", power_state[BITS(dword, 5, 4)]); printf("AUD_PWRST PinB_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 3, 2)]); printf("AUD_PWRST PinB_Widget_Power_State_Set \t%s\n", power_state[BITS(dword, 1, 0)]); dword = INREG(AUD_PORT_EN_HD_CFG); printf("AUD_PORT_EN_HD_CFG Convertor_A_Digen\t\t\t%lu\n", BIT(dword, 0)); printf("AUD_PORT_EN_HD_CFG Convertor_B_Digen\t\t\t%lu\n", BIT(dword, 1)); printf("AUD_PORT_EN_HD_CFG ConvertorA_Stream_ID\t\t%lu\n", BITS(dword, 7, 4)); printf("AUD_PORT_EN_HD_CFG ConvertorB_Stream_ID\t\t%lu\n", BITS(dword, 11, 8)); printf("AUD_PORT_EN_HD_CFG Port_B_Out_Enable\t\t\t%lu\n", BIT(dword, 12)); printf("AUD_PORT_EN_HD_CFG Port_C_Out_Enable\t\t\t%lu\n", BIT(dword, 13)); printf("AUD_PORT_EN_HD_CFG Port_D_Out_Enable\t\t\t%lu\n", BIT(dword, 14)); printf("AUD_PORT_EN_HD_CFG Port_B_Amp_Mute_Status\t\t%lu\n", BIT(dword, 16)); printf("AUD_PORT_EN_HD_CFG Port_C_Amp_Mute_Status\t\t%lu\n", BIT(dword, 17)); printf("AUD_PORT_EN_HD_CFG Port_D_Amp_Mute_Status\t\t%lu\n", BIT(dword, 18)); dword = INREG(AUD_OUT_DIG_CNVT_A); printf("AUD_OUT_DIG_CNVT_A V\t\t\t\t\t%lu\n", BIT(dword, 1)); printf("AUD_OUT_DIG_CNVT_A VCFG\t\t\t\t%lu\n", BIT(dword, 2)); printf("AUD_OUT_DIG_CNVT_A PRE\t\t\t\t\t%lu\n", BIT(dword, 3)); printf("AUD_OUT_DIG_CNVT_A Copy\t\t\t\t%lu\n", BIT(dword, 4)); printf("AUD_OUT_DIG_CNVT_A NonAudio\t\t\t\t%lu\n", BIT(dword, 5)); printf("AUD_OUT_DIG_CNVT_A PRO\t\t\t\t\t%lu\n", BIT(dword, 6)); printf("AUD_OUT_DIG_CNVT_A Level\t\t\t\t%lu\n", BIT(dword, 7)); printf("AUD_OUT_DIG_CNVT_A Category_Code\t\t\t%lu\n", BITS(dword, 14, 8)); printf("AUD_OUT_DIG_CNVT_A Lowest_Channel_Number\t\t%lu\n",BITS(dword, 19, 16)); printf("AUD_OUT_DIG_CNVT_A Stream_ID\t\t\t\t%lu\n", BITS(dword, 23, 20)); dword = INREG(AUD_OUT_DIG_CNVT_B); printf("AUD_OUT_DIG_CNVT_B V\t\t\t\t\t%lu\n", BIT(dword, 1)); printf("AUD_OUT_DIG_CNVT_B VCFG\t\t\t\t%lu\n", BIT(dword, 2)); printf("AUD_OUT_DIG_CNVT_B PRE\t\t\t\t\t%lu\n", BIT(dword, 3)); printf("AUD_OUT_DIG_CNVT_B Copy\t\t\t\t%lu\n", BIT(dword, 4)); printf("AUD_OUT_DIG_CNVT_B NonAudio\t\t\t\t%lu\n", BIT(dword, 5)); printf("AUD_OUT_DIG_CNVT_B PRO\t\t\t\t\t%lu\n", BIT(dword, 6)); printf("AUD_OUT_DIG_CNVT_B Level\t\t\t\t%lu\n", BIT(dword, 7)); printf("AUD_OUT_DIG_CNVT_B Category_Code\t\t\t%lu\n", BITS(dword, 14, 8)); printf("AUD_OUT_DIG_CNVT_B Lowest_Channel_Number\t\t%lu\n",BITS(dword, 19, 16)); printf("AUD_OUT_DIG_CNVT_B Stream_ID\t\t\t\t%lu\n", BITS(dword, 23, 20)); printf("AUD_OUT_CH_STR Converter_Channel_MAP PORTB PORTC PORTD\n"); for (i = 0; i < 8; i++) { OUTREG(AUD_OUT_CH_STR, i | (i << 8) | (i << 16)); dword = INREG(AUD_OUT_CH_STR); printf("\t\t\t\t%lu\t%lu\t%lu\t%lu\n", 1 + BITS(dword, 3, 0), 1 + BITS(dword, 7, 4), 1 + BITS(dword, 15, 12), 1 + BITS(dword, 23, 20)); } dword = INREG(AUD_OUT_STR_DESC_A); printf("AUD_OUT_STR_DESC_A HBR_enable\t\t\t\t%lu\n", BITS(dword, 28, 27)); printf("AUD_OUT_STR_DESC_A Convertor_Channel_Count\t\t%lu\n", BITS(dword, 20, 16) + 1); printf("AUD_OUT_STR_DESC_A Bits_per_Sample\t\t\t[%#lx] %s\n", BITS(dword, 6, 4), OPNAME(bits_per_sample, BITS(dword, 6, 4))); printf("AUD_OUT_STR_DESC_A Number_of_Channels_in_a_Stream\t%lu\n", 1 + BITS(dword, 3, 0)); dword = INREG(AUD_OUT_STR_DESC_B); printf("AUD_OUT_STR_DESC_B HBR_enable\t\t\t\t%lu\n", BITS(dword, 28, 27)); printf("AUD_OUT_STR_DESC_B Convertor_Channel_Count\t\t%lu\n", BITS(dword, 20, 16) + 1); printf("AUD_OUT_STR_DESC_B Bits_per_Sample\t\t\t[%#lx] %s\n", BITS(dword, 6, 4), OPNAME(bits_per_sample, BITS(dword, 6, 4))); printf("AUD_OUT_STR_DESC_B Number_of_Channels_in_a_Stream\t%lu\n", 1 + BITS(dword, 3, 0)); dword = INREG(AUD_PINW_CONNLNG_SEL); printf("AUD_PINW_CONNLNG_SEL Connection_select_Control_B\t%lu\n", BITS(dword, 7, 0)); printf("AUD_PINW_CONNLNG_SEL Connection_select_Control_C\t%lu\n", BITS(dword, 15, 8)); printf("AUD_PINW_CONNLNG_SEL Connection_select_Control_D\t%lu\n", BITS(dword, 23, 16)); dword = INREG(AUD_CNTL_ST_A); printf("AUD_CNTL_ST_A DIP_Port_Select\t\t\t\t[%#lx] %s\n", BITS(dword, 30, 29), dip_port[BITS(dword, 30, 29)]); printf("AUD_CNTL_ST_A DIP_type_enable_status Audio DIP\t\t%lu\n", BIT(dword, 21)); printf("AUD_CNTL_ST_A DIP_type_enable_status ACP DIP\t\t%lu\n", BIT(dword, 22)); printf("AUD_CNTL_ST_A DIP_type_enable_status Generic 2 DIP\t%lu\n", BIT(dword, 23)); printf("AUD_CNTL_ST_A DIP_transmission_frequency\t\t[0x%lx] %s\n", BITS(dword, 17, 16), dip_trans[BITS(dword, 17, 16)]); printf("AUD_CNTL_ST_A ELD_ACK\t\t\t\t\t%lu\n", BIT(dword, 4)); printf("AUD_CNTL_ST_A ELD_buffer_size\t\t\t\t%lu\n", BITS(dword, 14, 10)); printf("AUD_CNTL_ST_A ELD_access_address\t\t\t%lu\n", BITS(dword, 9, 5)); dword = INREG(AUD_CNTL_ST_B); printf("AUD_CNTL_ST_B DIP_Port_Select\t\t\t\t[%#lx] %s\n", BITS(dword, 30, 29), dip_port[BITS(dword, 30, 29)]); printf("AUD_CNTL_ST_B DIP_type_enable_status Audio DIP\t\t%lu\n", BIT(dword, 21)); printf("AUD_CNTL_ST_B DIP_type_enable_status ACP DIP\t\t%lu\n", BIT(dword, 22)); printf("AUD_CNTL_ST_B DIP_type_enable_status Generic 2 DIP\t%lu\n", BIT(dword, 23)); printf("AUD_CNTL_ST_B DIP_transmission_frequency\t\t[0x%lx] %s\n", BITS(dword, 17, 16), dip_trans[BITS(dword, 17, 16)]); printf("AUD_CNTL_ST_B ELD_ACK\t\t\t\t\t%lu\n", BIT(dword, 4)); printf("AUD_CNTL_ST_B ELD_buffer_size\t\t\t\t%lu\n", BITS(dword, 14, 10)); printf("AUD_CNTL_ST_B ELD_access_address\t\t\t%lu\n", BITS(dword, 9, 5)); dword = INREG(AUD_CNTL_ST2); printf("AUD_CNTL_ST2 CP_ReadyB\t\t\t\t\t%lu\n", BIT(dword, 1)); printf("AUD_CNTL_ST2 ELD_validB\t\t\t\t%lu\n", BIT(dword, 0)); printf("AUD_CNTL_ST2 CP_ReadyC\t\t\t\t\t%lu\n", BIT(dword, 5)); printf("AUD_CNTL_ST2 ELD_validC\t\t\t\t%lu\n", BIT(dword, 4)); printf("AUD_CNTL_ST2 CP_ReadyD\t\t\t\t\t%lu\n", BIT(dword, 9)); printf("AUD_CNTL_ST2 ELD_validD\t\t\t\t%lu\n", BIT(dword, 8)); dword = INREG(AUD_HDMIW_STATUS); printf("AUD_HDMIW_STATUS Conv_B_CDCLK/DOTCLK_FIFO_Underrun\t%lu\n", BIT(dword, 31)); printf("AUD_HDMIW_STATUS Conv_B_CDCLK/DOTCLK_FIFO_Overrun\t%lu\n", BIT(dword, 30)); printf("AUD_HDMIW_STATUS Conv_A_CDCLK/DOTCLK_FIFO_Underrun\t%lu\n", BIT(dword, 29)); printf("AUD_HDMIW_STATUS Conv_A_CDCLK/DOTCLK_FIFO_Overrun\t%lu\n", BIT(dword, 28)); printf("AUD_HDMIW_STATUS BCLK/CDCLK_FIFO_Overrun\t\t%lu\n", BIT(dword, 25)); printf("AUD_HDMIW_STATUS Function_Reset\t\t\t%lu\n", BIT(dword, 29)); printf("AUD_HDMIW_HDMIEDID_A HDMI ELD:\n\t"); dword = INREG(AUD_CNTL_ST_A); dword &= ~BITMASK(9, 5); OUTREG(AUD_CNTL_ST_A, dword); for (i = 0; i < BITS(dword, 14, 10) / 4; i++) printf("%08x ", htonl(INREG(AUD_HDMIW_HDMIEDID_A))); printf("\n"); printf("AUD_HDMIW_HDMIEDID_B HDMI ELD:\n\t"); dword = INREG(AUD_CNTL_ST_B); dword &= ~BITMASK(9, 5); OUTREG(AUD_CNTL_ST_B, dword); for (i = 0; i < BITS(dword, 14, 10) / 4; i++) printf("%08x ", htonl(INREG(AUD_HDMIW_HDMIEDID_B))); printf("\n"); printf("AUD_HDMIW_INFOFR_A HDMI audio Infoframe:\n\t"); dword = INREG(AUD_CNTL_ST_A); dword &= ~BITMASK(20, 18); dword &= ~BITMASK(3, 0); OUTREG(AUD_CNTL_ST_A, dword); for (i = 0; i < 8; i++) printf("%08x ", htonl(INREG(AUD_HDMIW_INFOFR_A))); printf("\n"); printf("AUD_HDMIW_INFOFR_B HDMI audio Infoframe:\n\t"); dword = INREG(AUD_CNTL_ST_B); dword &= ~BITMASK(20, 18); dword &= ~BITMASK(3, 0); OUTREG(AUD_CNTL_ST_B, dword); for (i = 0; i < 8; i++) printf("%08x ", htonl(INREG(AUD_HDMIW_INFOFR_B))); printf("\n"); } #undef AUD_CONFIG_A #undef AUD_MISC_CTRL_A #undef AUD_VID_DID #undef AUD_RID #undef AUD_CTS_ENABLE_A #undef AUD_PWRST #undef AUD_HDMIW_HDMIEDID_A #undef AUD_HDMIW_INFOFR_A #undef AUD_PORT_EN_HD_CFG #undef AUD_OUT_DIG_CNVT_A #undef AUD_OUT_STR_DESC_A #undef AUD_OUT_CH_STR #undef AUD_PINW_CONNLNG_LIST #undef AUD_CNTL_ST_A #undef AUD_HDMIW_STATUS #undef AUD_CONFIG_B #undef AUD_MISC_CTRL_B #undef AUD_CTS_ENABLE_B #undef AUD_HDMIW_HDMIEDID_B #undef AUD_HDMIW_INFOFR_B #undef AUD_OUT_DIG_CNVT_B #undef AUD_OUT_STR_DESC_B #undef AUD_CNTL_ST_B /* * CougarPoint registers */ #define DP_CTL_B 0xE4100 #define DP_CTL_C 0xE4200 #define DP_AUX_CTL_C 0xE4210 #define DP_AUX_TST_C 0xE4228 #define SPORT_DDI_CRC_C 0xE4250 #define SPORT_DDI_CRC_R 0xE4264 #define DP_CTL_D 0xE4300 #define DP_AUX_CTL_D 0xE4310 #define DP_AUX_TST_D 0xE4328 #define SPORT_DDI_CRC_CTL_D 0xE4350 #define AUD_CONFIG_A 0xE5000 #define AUD_MISC_CTRL_A 0xE5010 #define AUD_VID_DID 0xE5020 #define AUD_RID 0xE5024 #define AUD_CTS_ENABLE_A 0xE5028 #define AUD_PWRST 0xE504C #define AUD_HDMIW_HDMIEDID_A 0xE5050 #define AUD_HDMIW_INFOFR_A 0xE5054 #define AUD_PORT_EN_HD_CFG 0xE507C #define AUD_OUT_DIG_CNVT_A 0xE5080 #define AUD_OUT_STR_DESC_A 0xE5084 #define AUD_OUT_CH_STR 0xE5088 #define AUD_PINW_CONNLNG_LIST 0xE50A8 #define AUD_PINW_CONNLNG_SELA 0xE50AC #define AUD_CNTL_ST_A 0xE50B4 #define AUD_CNTRL_ST2 0xE50C0 #define AUD_CNTRL_ST3 0xE50C4 #define AUD_HDMIW_STATUS 0xE50D4 #define AUD_CONFIG_B 0xE5100 #define AUD_MISC_CTRL_B 0xE5110 #define AUD_CTS_ENABLE_B 0xE5128 #define AUD_HDMIW_HDMIEDID_B 0xE5150 #define AUD_HDMIW_INFOFR_B 0xE5154 #define AUD_OUT_DIG_CNVT_B 0xE5180 #define AUD_OUT_STR_DESC_B 0xE5184 #define AUD_CNTL_ST_B 0xE51B4 #define AUD_CONFIG_C 0xE5200 #define AUD_MISC_CTRL_C 0xE5210 #define AUD_CTS_ENABLE_C 0xE5228 #define AUD_HDMIW_HDMIEDID_C 0xE5250 #define AUD_HDMIW_INFOFR_C 0xE5254 #define AUD_OUT_DIG_CNVT_C 0xE5280 #define AUD_OUT_STR_DESC_C 0xE5284 #define AUD_CNTL_ST_C 0xE52B4 #define AUD_CONFIG_D 0xE5300 #define AUD_MISC_CTRL_D 0xE5310 #define AUD_CTS_ENABLE_D 0xE5328 #define AUD_HDMIW_HDMIEDID_D 0xE5350 #define AUD_HDMIW_INFOFR_D 0xE5354 #define AUD_OUT_DIG_CNVT_D 0xE5380 #define AUD_OUT_STR_DESC_D 0xE5384 #define AUD_CNTL_ST_D 0xE53B4 #define VIDEO_DIP_CTL_A 0xE0200 #define VIDEO_DIP_CTL_B 0xE1200 #define VIDEO_DIP_CTL_C 0xE2200 #define VIDEO_DIP_CTL_D 0xE3200 static void dump_cpt(void) { uint32_t dword; int i; dump_reg(HDMIB, "sDVO/HDMI Port B Control"); dump_reg(HDMIC, "HDMI Port C Control"); dump_reg(HDMID, "HDMI Port D Control"); dump_reg(DP_CTL_B, "DisplayPort B Control"); dump_reg(DP_CTL_C, "DisplayPort C Control"); dump_reg(DP_CTL_D, "DisplayPort D Control"); dump_reg(TRANS_DP_CTL_A, "Transcoder A DisplayPort Control"); dump_reg(TRANS_DP_CTL_B, "Transcoder B DisplayPort Control"); dump_reg(TRANS_DP_CTL_C, "Transcoder C DisplayPort Control"); dump_reg(AUD_CONFIG_A, "Audio Configuration - Transcoder A"); dump_reg(AUD_CONFIG_B, "Audio Configuration - Transcoder B"); dump_reg(AUD_CONFIG_C, "Audio Configuration - Transcoder C"); dump_reg(AUD_CTS_ENABLE_A, "Audio CTS Programming Enable - Transcoder A"); dump_reg(AUD_CTS_ENABLE_B, "Audio CTS Programming Enable - Transcoder B"); dump_reg(AUD_CTS_ENABLE_C, "Audio CTS Programming Enable - Transcoder C"); dump_reg(AUD_MISC_CTRL_A, "Audio MISC Control for Transcoder A"); dump_reg(AUD_MISC_CTRL_B, "Audio MISC Control for Transcoder B"); dump_reg(AUD_MISC_CTRL_C, "Audio MISC Control for Transcoder C"); dump_reg(AUD_VID_DID, "Audio Vendor ID / Device ID"); dump_reg(AUD_RID, "Audio Revision ID"); dump_reg(AUD_PWRST, "Audio Power State (Function Group, Convertor, Pin Widget)"); dump_reg(AUD_PORT_EN_HD_CFG, "Audio Port Enable HDAudio Config"); dump_reg(AUD_OUT_DIG_CNVT_A, "Audio Digital Converter - Conv A"); dump_reg(AUD_OUT_DIG_CNVT_B, "Audio Digital Converter - Conv B"); dump_reg(AUD_OUT_DIG_CNVT_C, "Audio Digital Converter - Conv C"); dump_reg(AUD_OUT_CH_STR, "Audio Channel ID and Stream ID"); dump_reg(AUD_OUT_STR_DESC_A, "Audio Stream Descriptor Format - Conv A"); dump_reg(AUD_OUT_STR_DESC_B, "Audio Stream Descriptor Format - Conv B"); dump_reg(AUD_OUT_STR_DESC_C, "Audio Stream Descriptor Format - Conv C"); dump_reg(AUD_PINW_CONNLNG_LIST, "Audio Connection List"); dump_reg(AUD_PINW_CONNLNG_SEL, "Audio Connection Select"); dump_reg(AUD_CNTL_ST_A, "Audio Control State Register - Transcoder A"); dump_reg(AUD_CNTL_ST_B, "Audio Control State Register - Transcoder B"); dump_reg(AUD_CNTL_ST_C, "Audio Control State Register - Transcoder C"); dump_reg(AUD_CNTRL_ST2, "Audio Control State 2"); dump_reg(AUD_CNTRL_ST3, "Audio Control State 3"); dump_reg(AUD_HDMIW_STATUS, "Audio HDMI Status"); dump_reg(AUD_HDMIW_HDMIEDID_A, "HDMI Data EDID Block - Transcoder A"); dump_reg(AUD_HDMIW_HDMIEDID_B, "HDMI Data EDID Block - Transcoder B"); dump_reg(AUD_HDMIW_HDMIEDID_C, "HDMI Data EDID Block - Transcoder C"); dump_reg(AUD_HDMIW_INFOFR_A, "Audio Widget Data Island Packet - Transcoder A"); dump_reg(AUD_HDMIW_INFOFR_B, "Audio Widget Data Island Packet - Transcoder B"); dump_reg(AUD_HDMIW_INFOFR_C, "Audio Widget Data Island Packet - Transcoder C"); printf("\nDetails:\n\n"); dword = INREG(VIDEO_DIP_CTL_A); printf("VIDEO_DIP_CTL_A Enable_Graphics_DIP\t\t\t%ld\n", BIT(dword, 31)), printf("VIDEO_DIP_CTL_A GCP_DIP_enable\t\t\t\t%ld\n", BIT(dword, 25)), printf("VIDEO_DIP_CTL_A Video_DIP_type_enable AVI\t\t%lu\n", BIT(dword, 21)); printf("VIDEO_DIP_CTL_A Video_DIP_type_enable Vendor\t\t%lu\n", BIT(dword, 22)); printf("VIDEO_DIP_CTL_A Video_DIP_type_enable Gamut\t\t%lu\n", BIT(dword, 23)); printf("VIDEO_DIP_CTL_A Video_DIP_type_enable Source \t\t%lu\n", BIT(dword, 24)); printf("VIDEO_DIP_CTL_A Video_DIP_buffer_index\t\t\t[0x%lx] %s\n", BITS(dword, 20, 19), video_dip_index[BITS(dword, 20, 19)]); printf("VIDEO_DIP_CTL_A Video_DIP_frequency\t\t\t[0x%lx] %s\n", BITS(dword, 17, 16), video_dip_trans[BITS(dword, 17, 16)]); printf("VIDEO_DIP_CTL_A Video_DIP_buffer_size\t\t\t%lu\n", BITS(dword, 11, 8)); printf("VIDEO_DIP_CTL_A Video_DIP_access_address\t\t%lu\n", BITS(dword, 3, 0)); dword = INREG(VIDEO_DIP_CTL_B); printf("VIDEO_DIP_CTL_B Enable_Graphics_DIP\t\t\t%ld\n", BIT(dword, 31)), printf("VIDEO_DIP_CTL_B GCP_DIP_enable\t\t\t\t%ld\n", BIT(dword, 25)), printf("VIDEO_DIP_CTL_B Video_DIP_type_enable AVI\t\t%lu\n", BIT(dword, 21)); printf("VIDEO_DIP_CTL_B Video_DIP_type_enable Vendor\t\t%lu\n", BIT(dword, 22)); printf("VIDEO_DIP_CTL_B Video_DIP_type_enable Gamut\t\t%lu\n", BIT(dword, 23)); printf("VIDEO_DIP_CTL_B Video_DIP_type_enable Source \t\t%lu\n", BIT(dword, 24)); printf("VIDEO_DIP_CTL_B Video_DIP_buffer_index\t\t\t[0x%lx] %s\n", BITS(dword, 20, 19), video_dip_index[BITS(dword, 20, 19)]); printf("VIDEO_DIP_CTL_B Video_DIP_frequency\t\t\t[0x%lx] %s\n", BITS(dword, 17, 16), video_dip_trans[BITS(dword, 17, 16)]); printf("VIDEO_DIP_CTL_B Video_DIP_buffer_size\t\t\t%lu\n", BITS(dword, 11, 8)); printf("VIDEO_DIP_CTL_B Video_DIP_access_address\t\t%lu\n", BITS(dword, 3, 0)); dword = INREG(VIDEO_DIP_CTL_C); printf("VIDEO_DIP_CTL_C Enable_Graphics_DIP\t\t\t%ld\n", BIT(dword, 31)), printf("VIDEO_DIP_CTL_C GCP_DIP_enable\t\t\t\t%ld\n", BIT(dword, 25)), printf("VIDEO_DIP_CTL_C Video_DIP_type_enable AVI\t\t%lu\n", BIT(dword, 21)); printf("VIDEO_DIP_CTL_C Video_DIP_type_enable Vendor\t\t%lu\n", BIT(dword, 22)); printf("VIDEO_DIP_CTL_C Video_DIP_type_enable Gamut\t\t%lu\n", BIT(dword, 23)); printf("VIDEO_DIP_CTL_C Video_DIP_type_enable Source \t\t%lu\n", BIT(dword, 24)); printf("VIDEO_DIP_CTL_C Video_DIP_buffer_index\t\t\t[0x%lx] %s\n", BITS(dword, 20, 19), video_dip_index[BITS(dword, 20, 19)]); printf("VIDEO_DIP_CTL_C Video_DIP_frequency\t\t\t[0x%lx] %s\n", BITS(dword, 17, 16), video_dip_trans[BITS(dword, 17, 16)]); printf("VIDEO_DIP_CTL_C Video_DIP_buffer_size\t\t\t%lu\n", BITS(dword, 11, 8)); printf("VIDEO_DIP_CTL_C Video_DIP_access_address\t\t%lu\n", BITS(dword, 3, 0)); dword = INREG(AUD_VID_DID); printf("AUD_VID_DID vendor id\t\t\t\t\t0x%x\n", dword >> 16); printf("AUD_VID_DID device id\t\t\t\t\t0x%x\n", dword & 0xffff); dword = INREG(AUD_RID); printf("AUD_RID Major_Revision\t\t\t\t\t0x%lx\n", BITS(dword, 23, 20)); printf("AUD_RID Minor_Revision\t\t\t\t\t0x%lx\n", BITS(dword, 19, 16)); printf("AUD_RID Revision_Id\t\t\t\t\t0x%lx\n", BITS(dword, 15, 8)); printf("AUD_RID Stepping_Id\t\t\t\t\t0x%lx\n", BITS(dword, 7, 0)); dword = INREG(HDMIB); printf("HDMIB Port_Enable\t\t\t\t\t%u\n", !!(dword & SDVO_ENABLE)); printf("HDMIB Transcoder_Select\t\t\t\t\t[0x%lx] %s\n", BITS(dword, 30, 29), transcoder_select[BITS(dword, 30, 29)]); printf("HDMIB sDVO_Border_Enable\t\t\t\t%lu\n", BIT(dword, 7)); printf("HDMIB HDCP_Port_Select\t\t\t\t\t%lu\n", BIT(dword, 5)); printf("HDMIB SDVO_HPD_Interrupt_Enable\t\t\t\t%lu\n", BIT(dword, 23)); printf("HDMIB Port_Detected\t\t\t\t\t%lu\n", BIT(dword, 2)); printf("HDMIB Encoding\t\t\t\t\t\t[0x%lx] %s\n", BITS(dword, 11, 10), sdvo_hdmi_encoding[BITS(dword, 11, 10)]); printf("HDMIB HDMI_or_DVI_Select\t\t\t\t%s\n", BIT(dword, 9) ? "HDMI" : "DVI"); printf("HDMIB Audio_Output_Enable\t\t\t\t%u\n", !!(dword & SDVO_AUDIO_ENABLE)); dword = INREG(HDMIC); printf("HDMIC Port_Enable\t\t\t\t\t%u\n", !!(dword & SDVO_ENABLE)); printf("HDMIC Transcoder_Select\t\t\t\t\t[0x%lx] %s\n", BITS(dword, 30, 29), transcoder_select[BITS(dword, 30, 29)]); printf("HDMIC sDVO_Border_Enable\t\t\t\t%lu\n", BIT(dword, 7)); printf("HDMIC HDCP_Port_Select\t\t\t\t\t%lu\n", BIT(dword, 5)); printf("HDMIC SDVO_HPD_Interrupt_Enable\t\t\t\t%lu\n", BIT(dword, 23)); printf("HDMIC Port_Detected\t\t\t\t\t%lu\n", BIT(dword, 2)); printf("HDMIC Encoding\t\t\t\t\t\t[0x%lx] %s\n", BITS(dword, 11, 10), sdvo_hdmi_encoding[BITS(dword, 11, 10)]); printf("HDMIC HDMI_or_DVI_Select\t\t\t\t%s\n", BIT(dword, 9) ? "HDMI" : "DVI"); printf("HDMIC Audio_Output_Enable\t\t\t\t%u\n", !!(dword & SDVO_AUDIO_ENABLE)); dword = INREG(HDMID); printf("HDMID Port_Enable\t\t\t\t\t%u\n", !!(dword & SDVO_ENABLE)); printf("HDMID Transcoder_Select\t\t\t\t\t[0x%lx] %s\n", BITS(dword, 30, 29), transcoder_select[BITS(dword, 30, 29)]); printf("HDMID sDVO_Border_Enable\t\t\t\t%lu\n", BIT(dword, 7)); printf("HDMID HDCP_Port_Select\t\t\t\t\t%lu\n", BIT(dword, 5)); printf("HDMID SDVO_HPD_Interrupt_Enable\t\t\t\t%lu\n", BIT(dword, 23)); printf("HDMID Port_Detected\t\t\t\t\t%lu\n", BIT(dword, 2)); printf("HDMID Encoding\t\t\t\t\t\t[0x%lx] %s\n", BITS(dword, 11, 10), sdvo_hdmi_encoding[BITS(dword, 11, 10)]); printf("HDMID HDMI_or_DVI_Select\t\t\t\t%s\n", BIT(dword, 9) ? "HDMI" : "DVI"); printf("HDMID Audio_Output_Enable\t\t\t\t%u\n", !!(dword & SDVO_AUDIO_ENABLE)); dword = INREG(DP_CTL_B); printf("DP_CTL_B DisplayPort_Enable\t\t\t\t%lu\n", BIT(dword, 31)); printf("DP_CTL_B Port_Width_Selection\t\t\t\t[0x%lx] %s\n", BITS(dword, 21, 19), dp_port_width[BITS(dword, 21, 19)]); printf("DP_CTL_B Port_Detected\t\t\t\t\t%lu\n", BIT(dword, 2)); printf("DP_CTL_B HDCP_Port_Select\t\t\t\t%lu\n", BIT(dword, 5)); printf("DP_CTL_B Audio_Output_Enable\t\t\t\t%lu\n", BIT(dword, 6)); dword = INREG(DP_CTL_C); printf("DP_CTL_C DisplayPort_Enable\t\t\t\t%lu\n", BIT(dword, 31)); printf("DP_CTL_C Port_Width_Selection\t\t\t\t[0x%lx] %s\n", BITS(dword, 21, 19), dp_port_width[BITS(dword, 21, 19)]); printf("DP_CTL_C Port_Detected\t\t\t\t\t%lu\n", BIT(dword, 2)); printf("DP_CTL_C HDCP_Port_Select\t\t\t\t%lu\n", BIT(dword, 5)); printf("DP_CTL_C Audio_Output_Enable\t\t\t\t%lu\n", BIT(dword, 6)); dword = INREG(DP_CTL_D); printf("DP_CTL_D DisplayPort_Enable\t\t\t\t%lu\n", BIT(dword, 31)); printf("DP_CTL_D Port_Width_Selection\t\t\t\t[0x%lx] %s\n", BITS(dword, 21, 19), dp_port_width[BITS(dword, 21, 19)]); printf("DP_CTL_D Port_Detected\t\t\t\t\t%lu\n", BIT(dword, 2)); printf("DP_CTL_D HDCP_Port_Select\t\t\t\t%lu\n", BIT(dword, 5)); printf("DP_CTL_D Audio_Output_Enable\t\t\t\t%lu\n", BIT(dword, 6)); dword = INREG(AUD_CONFIG_A); printf("AUD_CONFIG_A N_index_value\t\t\t\t[0x%lx] %s\n", BIT(dword, 29), n_index_value[BIT(dword, 29)]); printf("AUD_CONFIG_A N_programming_enable\t\t\t%lu\n", BIT(dword, 28)); printf("AUD_CONFIG_A Upper_N_value\t\t\t\t0x%02lx\n", BITS(dword, 27, 20)); printf("AUD_CONFIG_A Lower_N_value\t\t\t\t0x%03lx\n", BITS(dword, 15, 4)); printf("AUD_CONFIG_A Pixel_Clock_HDMI\t\t\t\t[0x%lx] %s\n", BITS(dword, 19, 16), OPNAME(pixel_clock, BITS(dword, 19, 16))); printf("AUD_CONFIG_A Disable_NCTS\t\t\t\t%lu\n", BIT(dword, 3)); dword = INREG(AUD_CONFIG_B); printf("AUD_CONFIG_B N_index_value\t\t\t\t[0x%lx] %s\n", BIT(dword, 29), n_index_value[BIT(dword, 29)]); printf("AUD_CONFIG_B N_programming_enable\t\t\t%lu\n", BIT(dword, 28)); printf("AUD_CONFIG_B Upper_N_value\t\t\t\t0x%02lx\n", BITS(dword, 27, 20)); printf("AUD_CONFIG_B Lower_N_value\t\t\t\t0x%03lx\n", BITS(dword, 15, 4)); printf("AUD_CONFIG_B Pixel_Clock_HDMI\t\t\t\t[0x%lx] %s\n", BITS(dword, 19, 16), OPNAME(pixel_clock, BITS(dword, 19, 16))); printf("AUD_CONFIG_B Disable_NCTS\t\t\t\t%lu\n", BIT(dword, 3)); dword = INREG(AUD_CONFIG_C); printf("AUD_CONFIG_C N_index_value\t\t\t\t[0x%lx] %s\n", BIT(dword, 29), n_index_value[BIT(dword, 29)]); printf("AUD_CONFIG_C N_programming_enable\t\t\t%lu\n", BIT(dword, 28)); printf("AUD_CONFIG_C Upper_N_value\t\t\t\t0x%02lx\n", BITS(dword, 27, 20)); printf("AUD_CONFIG_C Lower_N_value\t\t\t\t0x%03lx\n", BITS(dword, 15, 4)); printf("AUD_CONFIG_C Pixel_Clock_HDMI\t\t\t\t[0x%lx] %s\n", BITS(dword, 19, 16), OPNAME(pixel_clock, BITS(dword, 19, 16))); printf("AUD_CONFIG_C Disable_NCTS\t\t\t\t%lu\n", BIT(dword, 3)); dword = INREG(AUD_CTS_ENABLE_A); printf("AUD_CTS_ENABLE_A Enable_CTS_or_M_programming\t\t%lu\n", BIT(dword, 20)); printf("AUD_CTS_ENABLE_A CTS_M value Index\t\t\t%s\n", BIT(dword, 21) ? "CTS" : "M"); printf("AUD_CTS_ENABLE_A CTS_programming\t\t\t%#lx\n", BITS(dword, 19, 0)); dword = INREG(AUD_CTS_ENABLE_B); printf("AUD_CTS_ENABLE_B Enable_CTS_or_M_programming\t\t%lu\n", BIT(dword, 20)); printf("AUD_CTS_ENABLE_B CTS_M value Index\t\t\t%s\n", BIT(dword, 21) ? "CTS" : "M"); printf("AUD_CTS_ENABLE_B CTS_programming\t\t\t%#lx\n", BITS(dword, 19, 0)); dword = INREG(AUD_CTS_ENABLE_C); printf("AUD_CTS_ENABLE_C Enable_CTS_or_M_programming\t\t%lu\n", BIT(dword, 20)); printf("AUD_CTS_ENABLE_C CTS_M value Index\t\t\t%s\n", BIT(dword, 21) ? "CTS" : "M"); printf("AUD_CTS_ENABLE_C CTS_programming\t\t\t%#lx\n", BITS(dword, 19, 0)); dword = INREG(AUD_MISC_CTRL_A); printf("AUD_MISC_CTRL_A Sample_Fabrication_EN_bit\t\t%lu\n", BIT(dword, 2)); printf("AUD_MISC_CTRL_A Sample_present_Disable\t\t\t%lu\n", BIT(dword, 8)); printf("AUD_MISC_CTRL_A Output_Delay\t\t\t\t%lu\n", BITS(dword, 7, 4)); printf("AUD_MISC_CTRL_A Pro_Allowed\t\t\t\t%lu\n", BIT(dword, 1)); dword = INREG(AUD_MISC_CTRL_B); printf("AUD_MISC_CTRL_B Sample_Fabrication_EN_bit\t\t%lu\n", BIT(dword, 2)); printf("AUD_MISC_CTRL_B Sample_present_Disable\t\t\t%lu\n", BIT(dword, 8)); printf("AUD_MISC_CTRL_B Output_Delay\t\t\t\t%lu\n", BITS(dword, 7, 4)); printf("AUD_MISC_CTRL_B Pro_Allowed\t\t\t\t%lu\n", BIT(dword, 1)); dword = INREG(AUD_MISC_CTRL_C); printf("AUD_MISC_CTRL_C Sample_Fabrication_EN_bit\t\t%lu\n", BIT(dword, 2)); printf("AUD_MISC_CTRL_C Sample_present_Disable\t\t\t%lu\n", BIT(dword, 8)); printf("AUD_MISC_CTRL_C Output_Delay\t\t\t\t%lu\n", BITS(dword, 7, 4)); printf("AUD_MISC_CTRL_C Pro_Allowed\t\t\t\t%lu\n", BIT(dword, 1)); dword = INREG(AUD_PWRST); printf("AUD_PWRST Func_Grp_Dev_PwrSt_Curr \t%s\n", power_state[BITS(dword, 27, 26)]); printf("AUD_PWRST Func_Grp_Dev_PwrSt_Set \t%s\n", power_state[BITS(dword, 25, 24)]); printf("AUD_PWRST ConvertorA_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 15, 14)]); printf("AUD_PWRST ConvertorA_Widget_Power_State_Requsted \t%s\n", power_state[BITS(dword, 13, 12)]); printf("AUD_PWRST ConvertorB_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 19, 18)]); printf("AUD_PWRST ConvertorB_Widget_Power_State_Requested \t%s\n", power_state[BITS(dword, 17, 16)]); printf("AUD_PWRST ConvC_Widget_PwrSt_Curr \t%s\n", power_state[BITS(dword, 23, 22)]); printf("AUD_PWRST ConvC_Widget_PwrSt_Req \t%s\n", power_state[BITS(dword, 21, 20)]); printf("AUD_PWRST PinB_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 3, 2)]); printf("AUD_PWRST PinB_Widget_Power_State_Set \t%s\n", power_state[BITS(dword, 1, 0)]); printf("AUD_PWRST PinC_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 7, 6)]); printf("AUD_PWRST PinC_Widget_Power_State_Set \t%s\n", power_state[BITS(dword, 5, 4)]); printf("AUD_PWRST PinD_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 11, 10)]); printf("AUD_PWRST PinD_Widget_Power_State_Set \t%s\n", power_state[BITS(dword, 9, 8)]); dword = INREG(AUD_PORT_EN_HD_CFG); printf("AUD_PORT_EN_HD_CFG Convertor_A_Digen\t\t\t%lu\n", BIT(dword, 0)); printf("AUD_PORT_EN_HD_CFG Convertor_B_Digen\t\t\t%lu\n", BIT(dword, 1)); printf("AUD_PORT_EN_HD_CFG Convertor_C_Digen\t\t\t%lu\n", BIT(dword, 2)); printf("AUD_PORT_EN_HD_CFG ConvertorA_Stream_ID\t\t%lu\n", BITS(dword, 7, 4)); printf("AUD_PORT_EN_HD_CFG ConvertorB_Stream_ID\t\t%lu\n", BITS(dword, 11, 8)); printf("AUD_PORT_EN_HD_CFG ConvertorC_Stream_ID\t\t%lu\n", BITS(dword, 15, 12)); printf("AUD_PORT_EN_HD_CFG Port_B_Out_Enable\t\t\t%lu\n", BIT(dword, 16)); printf("AUD_PORT_EN_HD_CFG Port_C_Out_Enable\t\t\t%lu\n", BIT(dword, 17)); printf("AUD_PORT_EN_HD_CFG Port_D_Out_Enable\t\t\t%lu\n", BIT(dword, 18)); printf("AUD_PORT_EN_HD_CFG Port_B_Amp_Mute_Status\t\t%lu\n", BIT(dword, 20)); printf("AUD_PORT_EN_HD_CFG Port_C_Amp_Mute_Status\t\t%lu\n", BIT(dword, 21)); printf("AUD_PORT_EN_HD_CFG Port_D_Amp_Mute_Status\t\t%lu\n", BIT(dword, 22)); dword = INREG(AUD_OUT_DIG_CNVT_A); printf("AUD_OUT_DIG_CNVT_A V\t\t\t\t\t%lu\n", BIT(dword, 1)); printf("AUD_OUT_DIG_CNVT_A VCFG\t\t\t\t%lu\n", BIT(dword, 2)); printf("AUD_OUT_DIG_CNVT_A PRE\t\t\t\t\t%lu\n", BIT(dword, 3)); printf("AUD_OUT_DIG_CNVT_A Copy\t\t\t\t%lu\n", BIT(dword, 4)); printf("AUD_OUT_DIG_CNVT_A NonAudio\t\t\t\t%lu\n", BIT(dword, 5)); printf("AUD_OUT_DIG_CNVT_A PRO\t\t\t\t\t%lu\n", BIT(dword, 6)); printf("AUD_OUT_DIG_CNVT_A Level\t\t\t\t%lu\n", BIT(dword, 7)); printf("AUD_OUT_DIG_CNVT_A Category_Code\t\t\t%lu\n", BITS(dword, 14, 8)); printf("AUD_OUT_DIG_CNVT_A Lowest_Channel_Number\t\t%lu\n",BITS(dword, 19, 16)); printf("AUD_OUT_DIG_CNVT_A Stream_ID\t\t\t\t%lu\n", BITS(dword, 23, 20)); dword = INREG(AUD_OUT_DIG_CNVT_B); printf("AUD_OUT_DIG_CNVT_B V\t\t\t\t\t%lu\n", BIT(dword, 1)); printf("AUD_OUT_DIG_CNVT_B VCFG\t\t\t\t%lu\n", BIT(dword, 2)); printf("AUD_OUT_DIG_CNVT_B PRE\t\t\t\t\t%lu\n", BIT(dword, 3)); printf("AUD_OUT_DIG_CNVT_B Copy\t\t\t\t%lu\n", BIT(dword, 4)); printf("AUD_OUT_DIG_CNVT_B NonAudio\t\t\t\t%lu\n", BIT(dword, 5)); printf("AUD_OUT_DIG_CNVT_B PRO\t\t\t\t\t%lu\n", BIT(dword, 6)); printf("AUD_OUT_DIG_CNVT_B Level\t\t\t\t%lu\n", BIT(dword, 7)); printf("AUD_OUT_DIG_CNVT_B Category_Code\t\t\t%lu\n", BITS(dword, 14, 8)); printf("AUD_OUT_DIG_CNVT_B Lowest_Channel_Number\t\t%lu\n",BITS(dword, 19, 16)); printf("AUD_OUT_DIG_CNVT_B Stream_ID\t\t\t\t%lu\n", BITS(dword, 23, 20)); dword = INREG(AUD_OUT_DIG_CNVT_C); printf("AUD_OUT_DIG_CNVT_C V\t\t\t\t\t%lu\n", BIT(dword, 1)); printf("AUD_OUT_DIG_CNVT_C VCFG\t\t\t\t%lu\n", BIT(dword, 2)); printf("AUD_OUT_DIG_CNVT_C PRE\t\t\t\t\t%lu\n", BIT(dword, 3)); printf("AUD_OUT_DIG_CNVT_C Copy\t\t\t\t%lu\n", BIT(dword, 4)); printf("AUD_OUT_DIG_CNVT_C NonAudio\t\t\t\t%lu\n", BIT(dword, 5)); printf("AUD_OUT_DIG_CNVT_C PRO\t\t\t\t\t%lu\n", BIT(dword, 6)); printf("AUD_OUT_DIG_CNVT_C Level\t\t\t\t%lu\n", BIT(dword, 7)); printf("AUD_OUT_DIG_CNVT_C Category_Code\t\t\t%lu\n", BITS(dword, 14, 8)); printf("AUD_OUT_DIG_CNVT_C Lowest_Channel_Number\t\t%lu\n",BITS(dword, 19, 16)); printf("AUD_OUT_DIG_CNVT_C Stream_ID\t\t\t\t%lu\n", BITS(dword, 23, 20)); printf("AUD_OUT_CH_STR Converter_Channel_MAP PORTB PORTC PORTD\n"); for (i = 0; i < 8; i++) { OUTREG(AUD_OUT_CH_STR, i | (i << 8) | (i << 16)); dword = INREG(AUD_OUT_CH_STR); printf("\t\t\t\t%lu\t%lu\t%lu\t%lu\n", 1 + BITS(dword, 3, 0), 1 + BITS(dword, 7, 4), 1 + BITS(dword, 15, 12), 1 + BITS(dword, 23, 20)); } dword = INREG(AUD_OUT_STR_DESC_A); printf("AUD_OUT_STR_DESC_A HBR_enable\t\t\t\t%lu\n", BITS(dword, 28, 27)); printf("AUD_OUT_STR_DESC_A Convertor_Channel_Count\t\t%lu\n", BITS(dword, 20, 16) + 1); printf("AUD_OUT_STR_DESC_A Bits_per_Sample\t\t\t[%#lx] %s\n", BITS(dword, 6, 4), OPNAME(bits_per_sample, BITS(dword, 6, 4))); printf("AUD_OUT_STR_DESC_A Number_of_Channels_in_a_Stream\t%lu\n", 1 + BITS(dword, 3, 0)); dword = INREG(AUD_OUT_STR_DESC_B); printf("AUD_OUT_STR_DESC_B HBR_enable\t\t\t\t%lu\n", BITS(dword, 28, 27)); printf("AUD_OUT_STR_DESC_B Convertor_Channel_Count\t\t%lu\n", BITS(dword, 20, 16) + 1); printf("AUD_OUT_STR_DESC_B Bits_per_Sample\t\t\t[%#lx] %s\n", BITS(dword, 6, 4), OPNAME(bits_per_sample, BITS(dword, 6, 4))); printf("AUD_OUT_STR_DESC_B Number_of_Channels_in_a_Stream\t%lu\n", 1 + BITS(dword, 3, 0)); dword = INREG(AUD_OUT_STR_DESC_C); printf("AUD_OUT_STR_DESC_C HBR_enable\t\t\t\t%lu\n", BITS(dword, 28, 27)); printf("AUD_OUT_STR_DESC_C Convertor_Channel_Count\t\t%lu\n", BITS(dword, 20, 16) + 1); printf("AUD_OUT_STR_DESC_C Bits_per_Sample\t\t\t[%#lx] %s\n", BITS(dword, 6, 4), OPNAME(bits_per_sample, BITS(dword, 6, 4))); printf("AUD_OUT_STR_DESC_C Number_of_Channels_in_a_Stream\t%lu\n", 1 + BITS(dword, 3, 0)); dword = INREG(AUD_PINW_CONNLNG_SEL); printf("AUD_PINW_CONNLNG_SEL Connection_select_Control_B\t%#lx\n", BITS(dword, 7, 0)); printf("AUD_PINW_CONNLNG_SEL Connection_select_Control_C\t%#lx\n", BITS(dword, 15, 8)); printf("AUD_PINW_CONNLNG_SEL Connection_select_Control_D\t%#lx\n", BITS(dword, 23, 16)); dword = INREG(AUD_CNTL_ST_A); printf("AUD_CNTL_ST_A DIP_Port_Select\t\t\t\t[%#lx] %s\n", BITS(dword, 30, 29), dip_port[BITS(dword, 30, 29)]); printf("AUD_CNTL_ST_A DIP_type_enable_status Audio DIP\t\t%lu\n", BIT(dword, 21)); printf("AUD_CNTL_ST_A DIP_type_enable_status ACP DIP\t\t%lu\n", BIT(dword, 22)); printf("AUD_CNTL_ST_A DIP_type_enable_status Generic 2 DIP\t%lu\n", BIT(dword, 23)); printf("AUD_CNTL_ST_A DIP_transmission_frequency\t\t[0x%lx] %s\n", BITS(dword, 17, 16), dip_trans[BITS(dword, 17, 16)]); printf("AUD_CNTL_ST_A ELD_ACK\t\t\t\t\t%lu\n", BIT(dword, 4)); printf("AUD_CNTL_ST_A ELD_buffer_size\t\t\t\t%lu\n", BITS(dword, 14, 10)); dword = INREG(AUD_CNTL_ST_B); printf("AUD_CNTL_ST_B DIP_Port_Select\t\t\t\t[%#lx] %s\n", BITS(dword, 30, 29), dip_port[BITS(dword, 30, 29)]); printf("AUD_CNTL_ST_B DIP_type_enable_status Audio DIP\t\t%lu\n", BIT(dword, 21)); printf("AUD_CNTL_ST_B DIP_type_enable_status ACP DIP\t\t%lu\n", BIT(dword, 22)); printf("AUD_CNTL_ST_B DIP_type_enable_status Generic 2 DIP\t%lu\n", BIT(dword, 23)); printf("AUD_CNTL_ST_B DIP_transmission_frequency\t\t[0x%lx] %s\n", BITS(dword, 17, 16), dip_trans[BITS(dword, 17, 16)]); printf("AUD_CNTL_ST_B ELD_ACK\t\t\t\t\t%lu\n", BIT(dword, 4)); printf("AUD_CNTL_ST_B ELD_buffer_size\t\t\t\t%lu\n", BITS(dword, 14, 10)); dword = INREG(AUD_CNTL_ST_C); printf("AUD_CNTL_ST_C DIP_Port_Select\t\t\t\t[%#lx] %s\n", BITS(dword, 30, 29), dip_port[BITS(dword, 30, 29)]); printf("AUD_CNTL_ST_C DIP_type_enable_status Audio DIP\t\t%lu\n", BIT(dword, 21)); printf("AUD_CNTL_ST_C DIP_type_enable_status ACP DIP\t\t%lu\n", BIT(dword, 22)); printf("AUD_CNTL_ST_C DIP_type_enable_status Generic 2 DIP\t%lu\n", BIT(dword, 23)); printf("AUD_CNTL_ST_C DIP_transmission_frequency\t\t[0x%lx] %s\n", BITS(dword, 17, 16), dip_trans[BITS(dword, 17, 16)]); printf("AUD_CNTL_ST_C ELD_ACK\t\t\t\t\t%lu\n", BIT(dword, 4)); printf("AUD_CNTL_ST_C ELD_buffer_size\t\t\t\t%lu\n", BITS(dword, 14, 10)); dword = INREG(AUD_CNTRL_ST2); printf("AUD_CNTRL_ST2 CP_ReadyB\t\t\t\t%lu\n", BIT(dword, 1)); printf("AUD_CNTRL_ST2 ELD_validB\t\t\t\t%lu\n", BIT(dword, 0)); printf("AUD_CNTRL_ST2 CP_ReadyC\t\t\t\t%lu\n", BIT(dword, 5)); printf("AUD_CNTRL_ST2 ELD_validC\t\t\t\t%lu\n", BIT(dword, 4)); printf("AUD_CNTRL_ST2 CP_ReadyD\t\t\t\t%lu\n", BIT(dword, 9)); printf("AUD_CNTRL_ST2 ELD_validD\t\t\t\t%lu\n", BIT(dword, 8)); dword = INREG(AUD_CNTRL_ST3); printf("AUD_CNTRL_ST3 TransA_DPT_Audio_Output_En\t\t%lu\n", BIT(dword, 3)); printf("AUD_CNTRL_ST3 TransA_to_Port_Sel\t\t\t[%#lx] %s\n", BITS(dword, 2, 0), trans_to_port_sel[BITS(dword, 2, 0)]); printf("AUD_CNTRL_ST3 TransB_DPT_Audio_Output_En\t\t%lu\n", BIT(dword, 7)); printf("AUD_CNTRL_ST3 TransB_to_Port_Sel\t\t\t[%#lx] %s\n", BITS(dword, 6, 4), trans_to_port_sel[BITS(dword, 6, 4)]); printf("AUD_CNTRL_ST3 TransC_DPT_Audio_Output_En\t\t%lu\n", BIT(dword, 11)); printf("AUD_CNTRL_ST3 TransC_to_Port_Sel\t\t\t[%#lx] %s\n", BITS(dword, 10, 8), trans_to_port_sel[BITS(dword, 10, 8)]); dword = INREG(AUD_HDMIW_STATUS); printf("AUD_HDMIW_STATUS Conv_A_CDCLK/DOTCLK_FIFO_Underrun\t%lu\n", BIT(dword, 27)); printf("AUD_HDMIW_STATUS Conv_A_CDCLK/DOTCLK_FIFO_Overrun\t%lu\n", BIT(dword, 26)); printf("AUD_HDMIW_STATUS Conv_B_CDCLK/DOTCLK_FIFO_Underrun\t%lu\n", BIT(dword, 29)); printf("AUD_HDMIW_STATUS Conv_B_CDCLK/DOTCLK_FIFO_Overrun\t%lu\n", BIT(dword, 28)); printf("AUD_HDMIW_STATUS Conv_C_CDCLK/DOTCLK_FIFO_Underrun\t%lu\n", BIT(dword, 31)); printf("AUD_HDMIW_STATUS Conv_C_CDCLK/DOTCLK_FIFO_Overrun\t%lu\n", BIT(dword, 30)); printf("AUD_HDMIW_STATUS BCLK/CDCLK_FIFO_Overrun\t\t%lu\n", BIT(dword, 25)); printf("AUD_HDMIW_STATUS Function_Reset\t\t\t%lu\n", BIT(dword, 24)); printf("AUD_HDMIW_HDMIEDID_A HDMI ELD:\n\t"); dword = INREG(AUD_CNTL_ST_A); dword &= ~BITMASK(9, 5); OUTREG(AUD_CNTL_ST_A, dword); for (i = 0; i < BITS(dword, 14, 10) / 4; i++) printf("%08x ", htonl(INREG(AUD_HDMIW_HDMIEDID_A))); printf("\n"); printf("AUD_HDMIW_HDMIEDID_B HDMI ELD:\n\t"); dword = INREG(AUD_CNTL_ST_B); dword &= ~BITMASK(9, 5); OUTREG(AUD_CNTL_ST_B, dword); for (i = 0; i < BITS(dword, 14, 10) / 4; i++) printf("%08x ", htonl(INREG(AUD_HDMIW_HDMIEDID_B))); printf("\n"); printf("AUD_HDMIW_HDMIEDID_C HDMI ELD:\n\t"); dword = INREG(AUD_CNTL_ST_C); dword &= ~BITMASK(9, 5); OUTREG(AUD_CNTL_ST_C, dword); for (i = 0; i < BITS(dword, 14, 10) / 4; i++) printf("%08x ", htonl(INREG(AUD_HDMIW_HDMIEDID_C))); printf("\n"); printf("AUD_HDMIW_INFOFR_A HDMI audio Infoframe:\n\t"); dword = INREG(AUD_CNTL_ST_A); dword &= ~BITMASK(20, 18); dword &= ~BITMASK(3, 0); OUTREG(AUD_CNTL_ST_A, dword); for (i = 0; i < 8; i++) printf("%08x ", htonl(INREG(AUD_HDMIW_INFOFR_A))); printf("\n"); printf("AUD_HDMIW_INFOFR_B HDMI audio Infoframe:\n\t"); dword = INREG(AUD_CNTL_ST_B); dword &= ~BITMASK(20, 18); dword &= ~BITMASK(3, 0); OUTREG(AUD_CNTL_ST_B, dword); for (i = 0; i < 8; i++) printf("%08x ", htonl(INREG(AUD_HDMIW_INFOFR_B))); printf("\n"); printf("AUD_HDMIW_INFOFR_C HDMI audio Infoframe:\n\t"); dword = INREG(AUD_CNTL_ST_C); dword &= ~BITMASK(20, 18); dword &= ~BITMASK(3, 0); OUTREG(AUD_CNTL_ST_C, dword); for (i = 0; i < 8; i++) printf("%08x ", htonl(INREG(AUD_HDMIW_INFOFR_C))); printf("\n"); } #undef AUD_CONFIG_A #undef AUD_MISC_CTRL_A #undef AUD_VID_DID #undef AUD_RID #undef AUD_CTS_ENABLE_A #undef AUD_PWRST #undef AUD_HDMIW_HDMIEDID_A #undef AUD_HDMIW_INFOFR_A #undef AUD_PORT_EN_HD_CFG #undef AUD_OUT_DIG_CNVT_A #undef AUD_OUT_STR_DESC_A #undef AUD_OUT_CH_STR #undef AUD_PINW_CONNLNG_LIST #undef AUD_CNTL_ST_A #undef AUD_HDMIW_STATUS #undef AUD_CONFIG_B #undef AUD_MISC_CTRL_B #undef AUD_CTS_ENABLE_B #undef AUD_HDMIW_HDMIEDID_B #undef AUD_HDMIW_INFOFR_B #undef AUD_OUT_DIG_CNVT_B #undef AUD_OUT_STR_DESC_B #undef AUD_CNTL_ST_B #undef AUD_CONFIG_C #undef AUD_MISC_CTRL_C #undef AUD_CTS_ENABLE_C #undef AUD_HDMIW_HDMIEDID_C #undef AUD_HDMIW_INFOFR_C #undef AUD_OUT_DIG_CNVT_C #undef AUD_OUT_STR_DESC_C #undef VIDEO_DIP_CTL_A #undef VIDEO_DIP_CTL_B #undef VIDEO_DIP_CTL_C #undef VIDEO_DIP_CTL_D #undef VIDEO_DIP_DATA /* * Haswell registers */ /* DisplayPort Transport Control */ #define DP_TP_CTL_A 0x64040 #define DP_TP_CTL_B 0x64140 #define DP_TP_CTL_C 0x64240 #define DP_TP_CTL_D 0x64340 #define DP_TP_CTL_E 0x64440 /* DisplayPort Transport Status */ #define DP_TP_ST_A 0x64044 #define DP_TP_ST_B 0x64144 #define DP_TP_ST_C 0x64244 #define DP_TP_ST_D 0x64344 #define DP_TP_ST_E 0x64444 /* Transcoder configuration */ #define TRANS_CONF_A 0xF0008 #define TRANS_CONF_B 0xF1008 #define TRANS_CONF_C 0xF2008 /* DDI Buffer Control */ #define DDI_BUF_CTL_A 0x64000 #define DDI_BUF_CTL_B 0x64100 #define DDI_BUF_CTL_C 0x64200 #define DDI_BUF_CTL_D 0x64300 #define DDI_BUF_CTL_E 0x64400 /* DDI Buffer Translation */ #define DDI_BUF_TRANS_A 0x64e00 #define DDI_BUF_TRANS_B 0x64e60 #define DDI_BUF_TRANS_C 0x64ec0 #define DDI_BUF_TRANS_D 0x64f20 #define DDI_BUF_TRANS_E 0x64f80 /* DDI Aux Channel */ #define DDI_AUX_CHANNEL_CTRL 0x64010 #define DDI_AUX_DATA 0x64014 #define DDI_AUX_TST 0x64028 /* DDI CRC Control */ #define DDI_CRC_CTL_A 0x64050 #define DDI_CRC_CTL_B 0x64150 #define DDI_CRC_CTL_C 0x64250 #define DDI_CRC_CTL_D 0x64350 #define DDI_CRC_CTL_E 0x64450 /* Pipe DDI Function Control */ #define PIPE_DDI_FUNC_CTL_A 0x60400 #define PIPE_DDI_FUNC_CTL_B 0x61400 #define PIPE_DDI_FUNC_CTL_C 0x62400 #define PIPE_DDI_FUNC_CTL_EDP 0x6F400 /* Pipe Configuration */ #define PIPE_CONF_A 0x70008 #define PIPE_CONF_B 0x71008 #define PIPE_CONF_C 0x72008 #define PIPE_CONF_EDP 0x7F008 /* Audio registers */ #define AUD_CONFIG_A 0x65000 #define AUD_MISC_CTRL_A 0x65010 #define AUD_VID_DID 0x65020 #define AUD_RID 0x65024 #define AUD_CTS_ENABLE_A 0x65028 #define AUD_PWRST 0x6504C #define AUD_HDMIW_HDMIEDID_A 0x65050 #define AUD_HDMIW_INFOFR_A 0x65054 #define AUD_PORT_EN_HD_CFG 0x6507C #define AUD_OUT_DIG_CNVT_A 0x65080 #define AUD_OUT_STR_DESC_A 0x65084 #define AUD_OUT_CHAN_MAP 0x65088 #define AUD_PINW_CONNLNG_LIST_A 0x650A8 #define AUD_PINW_CONNLNG_LIST_B 0x651A8 #define AUD_PINW_CONNLNG_LIST_C 0x652A8 #define AUD_PIPE_CONN_SEL_CTRL 0x650AC #define AUD_PIN_ELD_CP_VLD 0x650C0 #define AUD_HDMIW_STATUS 0x650D4 #define AUD_CONFIG_B 0x65100 #define AUD_MISC_CTRL_B 0x65110 #define AUD_CTS_ENABLE_B 0x65128 #define AUD_HDMIW_HDMIEDID_B 0x65150 #define AUD_HDMIW_INFOFR_B 0x65154 #define AUD_OUT_DIG_CNVT_B 0x65180 #define AUD_OUT_STR_DESC_B 0x65184 #define AUD_CONFIG_C 0x65200 #define AUD_MISC_CTRL_C 0x65210 #define AUD_CTS_ENABLE_C 0x65228 #define AUD_HDMIW_HDMIEDID_C 0x65250 #define AUD_HDMIW_INFOFR_C 0x65254 #define AUD_OUT_DIG_CNVT_C 0x65280 #define AUD_OUT_STR_DESC_C 0x65284 #define AUD_DIP_ELD_CTRL_ST_A 0x650b4 #define AUD_DIP_ELD_CTRL_ST_B 0x651b4 #define AUD_DIP_ELD_CTRL_ST_C 0x652b4 /* Video DIP Control */ #define VIDEO_DIP_CTL_A 0x60200 #define VIDEO_DIP_CTL_B 0x61200 #define VIDEO_DIP_CTL_C 0x62200 #define VIDEO_DIP_CTL_D 0x63200 #define VIDEO_DIP_DATA 0x60220 #define VIDEO_DIP_ECC 0x60240 #define AUD_DP_DIP_STATUS 0x65f20 static void dump_hsw(void) { uint32_t dword; int i; /* HSW DDI Buffer */ dump_reg(DDI_BUF_CTL_A, "DDI Buffer Controler A"); dump_reg(DDI_BUF_CTL_B, "DDI Buffer Controler B"); dump_reg(DDI_BUF_CTL_C, "DDI Buffer Controler C"); dump_reg(DDI_BUF_CTL_D, "DDI Buffer Controler D"); dump_reg(DDI_BUF_CTL_E, "DDI Buffer Controler E"); /* HSW Pipe Function */ dump_reg(PIPE_CONF_A, "PIPE Configuration A"); dump_reg(PIPE_CONF_B, "PIPE Configuration B"); dump_reg(PIPE_CONF_C, "PIPE Configuration C"); dump_reg(PIPE_CONF_EDP, "PIPE Configuration EDP"); dump_reg(PIPE_DDI_FUNC_CTL_A, "PIPE DDI Function Control A"); dump_reg(PIPE_DDI_FUNC_CTL_B, "PIPE DDI Function Control B"); dump_reg(PIPE_DDI_FUNC_CTL_C, "PIPE DDI Function Control C"); dump_reg(PIPE_DDI_FUNC_CTL_EDP, "PIPE DDI Function Control EDP"); /* HSW Display port */ dump_reg(DP_TP_CTL_A, "DisplayPort Transport A Control"); dump_reg(DP_TP_CTL_B, "DisplayPort Transport B Control"); dump_reg(DP_TP_CTL_C, "DisplayPort Transport C Control"); dump_reg(DP_TP_CTL_D, "DisplayPort Transport D Control"); dump_reg(DP_TP_CTL_E, "DisplayPort Transport E Control"); dump_reg(DP_TP_ST_A, "DisplayPort Transport A Status"); dump_reg(DP_TP_ST_B, "DisplayPort Transport B Status"); dump_reg(DP_TP_ST_C, "DisplayPort Transport C Status"); dump_reg(DP_TP_ST_D, "DisplayPort Transport D Status"); dump_reg(DP_TP_ST_E, "DisplayPort Transport E Status"); /* HSW Transcoder A configuration */ dump_reg(TRANS_CONF_A, "Transcoder A Configuration"); dump_reg(TRANS_CONF_B, "Transcoder B Configuration"); dump_reg(TRANS_CONF_C, "Transcoder C Configuration"); /* HSW North Display Audio */ dump_reg(AUD_CONFIG_A, "Audio Configuration - Transcoder A"); dump_reg(AUD_CONFIG_B, "Audio Configuration - Transcoder B"); dump_reg(AUD_CONFIG_C, "Audio Configuration - Transcoder C"); dump_reg(AUD_MISC_CTRL_A, "Audio MISC Control for Transcoder A"); dump_reg(AUD_MISC_CTRL_B, "Audio MISC Control for Transcoder B"); dump_reg(AUD_MISC_CTRL_C, "Audio MISC Control for Transcoder C"); dump_reg(AUD_VID_DID, "Audio Vendor ID / Device ID"); dump_reg(AUD_RID, "Audio Revision ID"); dump_reg(AUD_CTS_ENABLE_A, "Audio CTS Programming Enable - Transcoder A"); dump_reg(AUD_CTS_ENABLE_B, "Audio CTS Programming Enable - Transcoder B"); dump_reg(AUD_CTS_ENABLE_C, "Audio CTS Programming Enable - Transcoder C"); dump_reg(AUD_PWRST, "Audio Power State (Function Group, Convertor, Pin Widget)"); dump_reg(AUD_HDMIW_HDMIEDID_A, "HDMI Data EDID Block - Transcoder A"); dump_reg(AUD_HDMIW_HDMIEDID_B, "HDMI Data EDID Block - Transcoder B"); dump_reg(AUD_HDMIW_HDMIEDID_C, "HDMI Data EDID Block - Transcoder C"); dump_reg(AUD_HDMIW_INFOFR_A, "Audio Widget Data Island Packet - Transcoder A"); dump_reg(AUD_HDMIW_INFOFR_B, "Audio Widget Data Island Packet - Transcoder B"); dump_reg(AUD_HDMIW_INFOFR_C, "Audio Widget Data Island Packet - Transcoder C"); dump_reg(AUD_PORT_EN_HD_CFG, "Audio Pipe and Convert Configs"); dump_reg(AUD_OUT_DIG_CNVT_A, "Audio Digital Converter - Conv A"); dump_reg(AUD_OUT_DIG_CNVT_B, "Audio Digital Converter - Conv B"); dump_reg(AUD_OUT_DIG_CNVT_C, "Audio Digital Converter - Conv C"); dump_reg(AUD_OUT_CHAN_MAP, "Audio Output Channel Mapping"); dump_reg(AUD_OUT_STR_DESC_A, "Audio Stream Descriptor Format - Conv A"); dump_reg(AUD_OUT_STR_DESC_B, "Audio Stream Descriptor Format - Conv B"); dump_reg(AUD_OUT_STR_DESC_C, "Audio Stream Descriptor Format - Conv C"); dump_reg(AUD_PINW_CONNLNG_LIST_A, "Audio Connection List entry and Length - Transcoder A"); dump_reg(AUD_PINW_CONNLNG_LIST_B, "Audio Connection List entry and Length - Transcoder B"); dump_reg(AUD_PINW_CONNLNG_LIST_C, "Audio Connection List entry and Length - Transcoder C"); dump_reg(AUD_PIPE_CONN_SEL_CTRL, "Audio Pipe Connection Select Control"); dump_reg(AUD_DIP_ELD_CTRL_ST_A, "Audio DIP and ELD control state - Transcoder A"); dump_reg(AUD_DIP_ELD_CTRL_ST_B, "Audio DIP and ELD control state - Transcoder B"); dump_reg(AUD_DIP_ELD_CTRL_ST_C, "Audio DIP and ELD control state - Transcoder C"); dump_reg(AUD_PIN_ELD_CP_VLD, "audio pin eld valid status"); dump_reg(AUD_HDMIW_STATUS, "Audio HDMI FIFO Status"); printf("\nDetails:\n\n"); dword = INREG(AUD_VID_DID); printf("AUD_VID_DID vendor id\t\t\t\t\t0x%x\n", dword >> 16); printf("AUD_VID_DID device id\t\t\t\t\t0x%x\n", dword & 0xffff); dword = INREG(AUD_RID); printf("AUD_RID Major_Revision\t\t\t\t\t0x%lx\n", BITS(dword, 23, 20)); printf("AUD_RID Minor_Revision\t\t\t\t\t0x%lx\n", BITS(dword, 19, 16)); printf("AUD_RID Revision_Id\t\t\t\t\t0x%lx\n", BITS(dword, 15, 8)); printf("AUD_RID Stepping_Id\t\t\t\t\t0x%lx\n", BITS(dword, 7, 0)); dword = INREG(AUD_DIP_ELD_CTRL_ST_A); printf("Audio DIP and ELD control state for TranscoderA\n"); printf("Audio DIP port select\t\t\t\t\t[0x%lx] %s\n", BITS(dword, 30, 29), dip_port[BITS(dword, 30, 29)]); printf("Audio DIP type enable status\t\t\t\t[0x%lx] %s\n", BITS(dword, 24, 21), dip_type[BIT(dword, 21)]); printf("DIP Buffer Index \t\t\t\t\t[0x%lx] %s\n", BITS(dword, 20, 18), dip_index[BITS(dword, 20, 18)]); printf("DIP_transmission_frequency\t\t\t\t[0x%lx] %s\n", BITS(dword, 17, 16), dip_trans[BITS(dword, 17, 16)]); printf("ELD_ACK\t\t\t\t\t\t\t%lu\n", BIT(dword, 4)); printf("ELD_buffer_size\t\t\t\t\t\t%lu\n", BITS(dword, 14, 10)); dword = INREG(AUD_DIP_ELD_CTRL_ST_B); printf("Audio DIP and ELD control state for TranscoderB\n"); printf("Audio DIP port select\t\t\t\t\t[0x%lx] %s\n", BITS(dword, 30, 29), dip_port[BITS(dword, 30, 29)]); printf("Audio DIP type enable status\t\t\t\t[0x%lx] %s\n", BITS(dword, 24, 21), dip_type[BIT(dword, 21)]); printf("DIP Buffer Index \t\t\t\t\t[0x%lx] %s\n", BITS(dword, 20, 18), dip_index[BITS(dword, 20, 18)]); printf("DIP_transmission_frequency\t\t\t\t[0x%lx] %s\n", BITS(dword, 17, 16), dip_trans[BITS(dword, 17, 16)]); printf("ELD_ACK\t\t\t\t\t\t\t%lu\n", BIT(dword, 4)); printf("ELD_buffer_size\t\t\t\t\t\t%lu\n", BITS(dword, 14, 10)); dword = INREG(AUD_DIP_ELD_CTRL_ST_C); printf("Audio DIP and ELD control state for TranscoderC\n"); printf("Audio DIP port select\t\t\t\t\t[0x%lx] %s\n", BITS(dword, 30, 29), dip_port[BITS(dword, 30, 29)]); printf("Audio DIP type enable status\t\t\t\t[0x%lx] %s\n", BITS(dword, 24, 21), dip_type[BIT(dword, 21)]); printf("DIP Buffer Index \t\t\t\t\t[0x%lx] %s\n", BITS(dword, 20, 18), dip_index[BITS(dword, 20, 18)]); printf("DIP_transmission_frequency\t\t\t\t[0x%lx] %s\n", BITS(dword, 17, 16), dip_trans[BITS(dword, 17, 16)]); printf("ELD_ACK\t\t\t\t\t\t\t%lu\n", BIT(dword, 4)); printf("ELD_buffer_size\t\t\t\t\t\t%lu\n", BITS(dword, 14, 10)); dword = INREG(DDI_BUF_CTL_A); printf("DDI A Buffer control\n"); printf("DDI Buffer Enable\t\t\t\t\t%ld\n", BIT(dword, 31)); printf("DP port width\t\t\t\t\t\t[0x%lx] %s\n", BITS(dword, 3, 1), dp_port_width[BITS(dword, 3, 1)]); dword = INREG(DDI_BUF_CTL_B); printf("DDI B Buffer control\n"); printf("DDI Buffer Enable\t\t\t\t\t%ld\n", BIT(dword, 31)); printf("DP port width\t\t\t\t\t\t[0x%lx] %s\n", BITS(dword, 3, 1), dp_port_width[BITS(dword, 3, 1)]); dword = INREG(DDI_BUF_CTL_C); printf("DDI C Buffer control\n"); printf("DDI Buffer Enable\t\t\t\t\t%ld\n", BIT(dword, 31)); printf("DP port width\t\t\t\t\t\t[0x%lx] %s\n", BITS(dword, 3, 1), dp_port_width[BITS(dword, 3, 1)]); dword = INREG(DDI_BUF_CTL_D); printf("DDI D Buffer control\n"); printf("DDI Buffer Enable\t\t\t\t\t%ld\n", BIT(dword, 31)); printf("DP port width\t\t\t\t\t\t[0x%lx] %s\n", BITS(dword, 3, 1), dp_port_width[BITS(dword, 3, 1)]); dword = INREG(DDI_BUF_CTL_E); printf("DDI E Buffer control\n"); printf("DDI Buffer Enable\t\t\t\t\t%ld\n", BIT(dword, 31)); printf("DP port width\t\t\t\t\t\t[0x%lx] %s\n", BITS(dword, 3, 1), dp_port_width[BITS(dword, 3, 1)]); dword = INREG(PIPE_DDI_FUNC_CTL_A); printf("Pipe A DDI Function Control\n"); printf("PIPE DDI Function Enable\t\t\t\t[0x%lx]\n", BIT(dword, 31)); printf("PIPE DDI selection\t\t\t\t\t[0x%lx] %s\n", BITS(dword, 30, 28), trans_to_port_sel[BITS(dword, 30, 28)]); printf("PIPE DDI Mode\t\t\t\t\t\t[0x%lx] %s\n", BITS(dword, 26, 24), ddi_mode[BITS(dword, 26, 24)]); printf("BITS per color\t\t\t\t\t\t[0x%lx]\n", BITS(dword, 22, 20)); dword = INREG(PIPE_DDI_FUNC_CTL_B); printf("Pipe B DDI Function Control\n"); printf("PIPE DDI Function Enable\t\t\t\t[0x%lx]\n", BIT(dword, 31)); printf("PIPE DDI selection\t\t\t\t\t[0x%lx] %s\n", BITS(dword, 30, 28), trans_to_port_sel[BITS(dword, 30, 28)]); printf("PIPE DDI Mode \t\t\t\t\t\t[0x%lx] %s\n", BITS(dword, 26, 24), ddi_mode[BITS(dword, 26, 24)]); printf("BITS per color\t\t\t\t\t\t[0x%lx]\n", BITS(dword, 22, 20)); dword = INREG(PIPE_DDI_FUNC_CTL_C); printf("Pipe C DDI Function Control\n"); printf("PIPE DDI Function Enable\t\t\t\t[0x%lx]\n", BIT(dword, 31)); printf("PIPE DDI selection\t\t\t\t\t[0x%lx] %s\n", BITS(dword, 30, 28), trans_to_port_sel[BITS(dword, 30, 28)]); printf("PIPE DDI Mode \t\t\t\t\t\t[0x%lx] %s\n", BITS(dword, 26, 24), ddi_mode[BITS(dword, 26, 24)]); printf("BITS per color\t\t\t\t\t\t[0x%lx]\n", BITS(dword, 22, 20)); dword = INREG(AUD_CONFIG_A); printf("AUD_CONFIG_A N_index_value\t\t\t\t[0x%lx] %s\n", BIT(dword, 29), n_index_value[BIT(dword, 29)]); printf("AUD_CONFIG_A N_programming_enable\t\t\t%lu\n", BIT(dword, 28)); printf("AUD_CONFIG_A Upper_N_value\t\t\t\t0x%02lx\n", BITS(dword, 27, 20)); printf("AUD_CONFIG_A Lower_N_value\t\t\t\t0x%03lx\n", BITS(dword, 15, 4)); printf("AUD_CONFIG_A Pixel_Clock_HDMI\t\t\t\t[0x%lx] %s\n", BITS(dword, 19, 16), OPNAME(pixel_clock, BITS(dword, 19, 16))); printf("AUD_CONFIG_A Disable_NCTS\t\t\t\t%lu\n", BIT(dword, 3)); dword = INREG(AUD_CONFIG_B); printf("AUD_CONFIG_B N_index_value\t\t\t\t[0x%lx] %s\n", BIT(dword, 29), n_index_value[BIT(dword, 29)]); printf("AUD_CONFIG_B N_programming_enable\t\t\t%lu\n", BIT(dword, 28)); printf("AUD_CONFIG_B Upper_N_value\t\t\t\t0x%02lx\n", BITS(dword, 27, 20)); printf("AUD_CONFIG_B Lower_N_value\t\t\t\t0x%03lx\n", BITS(dword, 15, 4)); printf("AUD_CONFIG_B Pixel_Clock_HDMI\t\t\t\t[0x%lx] %s\n", BITS(dword, 19, 16), OPNAME(pixel_clock, BITS(dword, 19, 16))); printf("AUD_CONFIG_B Disable_NCTS\t\t\t\t%lu\n", BIT(dword, 3)); dword = INREG(AUD_CONFIG_C); printf("AUD_CONFIG_C N_index_value\t\t\t\t[0x%lx] %s\n", BIT(dword, 29), n_index_value[BIT(dword, 29)]); printf("AUD_CONFIG_C N_programming_enable\t\t\t%lu\n", BIT(dword, 28)); printf("AUD_CONFIG_C Upper_N_value\t\t\t\t0x%02lx\n", BITS(dword, 27, 20)); printf("AUD_CONFIG_C Lower_N_value\t\t\t\t0x%03lx\n", BITS(dword, 15, 4)); printf("AUD_CONFIG_C Pixel_Clock_HDMI\t\t\t\t[0x%lx] %s\n", BITS(dword, 19, 16), OPNAME(pixel_clock, BITS(dword, 19, 16))); printf("AUD_CONFIG_C Disable_NCTS\t\t\t\t%lu\n", BIT(dword, 3)); dword = INREG(AUD_CTS_ENABLE_A); printf("AUD_CTS_ENABLE_A Enable_CTS_or_M_programming\t\t%lu\n", BIT(dword, 20)); printf("AUD_CTS_ENABLE_A CTS_M value Index\t\t\t%s\n", BIT(dword, 21) ? "CTS" : "M"); printf("AUD_CTS_ENABLE_A CTS_programming\t\t\t%#lx\n", BITS(dword, 19, 0)); dword = INREG(AUD_CTS_ENABLE_B); printf("AUD_CTS_ENABLE_B Enable_CTS_or_M_programming\t\t%lu\n", BIT(dword, 20)); printf("AUD_CTS_ENABLE_B CTS_M value Index\t\t\t%s\n", BIT(dword, 21) ? "CTS" : "M"); printf("AUD_CTS_ENABLE_B CTS_programming\t\t\t%#lx\n", BITS(dword, 19, 0)); dword = INREG(AUD_CTS_ENABLE_C); printf("AUD_CTS_ENABLE_C Enable_CTS_or_M_programming\t\t%lu\n", BIT(dword, 20)); printf("AUD_CTS_ENABLE_C CTS_M value Index\t\t\t%s\n", BIT(dword, 21) ? "CTS" : "M"); printf("AUD_CTS_ENABLE_C CTS_programming\t\t\t%#lx\n", BITS(dword, 19, 0)); dword = INREG(AUD_MISC_CTRL_A); printf("AUD_MISC_CTRL_A Sample_Fabrication_EN_bit\t\t%lu\n", BIT(dword, 2)); printf("AUD_MISC_CTRL_A Sample_present_Disable\t\t\t%lu\n", BIT(dword, 8)); printf("AUD_MISC_CTRL_A Output_Delay\t\t\t\t%lu\n", BITS(dword, 7, 4)); printf("AUD_MISC_CTRL_A Pro_Allowed\t\t\t\t%lu\n", BIT(dword, 1)); dword = INREG(AUD_MISC_CTRL_B); printf("AUD_MISC_CTRL_B Sample_Fabrication_EN_bit\t\t%lu\n", BIT(dword, 2)); printf("AUD_MISC_CTRL_B Sample_present_Disable\t\t\t%lu\n", BIT(dword, 8)); printf("AUD_MISC_CTRL_B Output_Delay\t\t\t\t%lu\n", BITS(dword, 7, 4)); printf("AUD_MISC_CTRL_B Pro_Allowed\t\t\t\t%lu\n", BIT(dword, 1)); dword = INREG(AUD_MISC_CTRL_C); printf("AUD_MISC_CTRL_C Sample_Fabrication_EN_bit\t\t%lu\n", BIT(dword, 2)); printf("AUD_MISC_CTRL_C Sample_present_Disable\t\t\t%lu\n", BIT(dword, 8)); printf("AUD_MISC_CTRL_C Output_Delay\t\t\t\t%lu\n", BITS(dword, 7, 4)); printf("AUD_MISC_CTRL_C Pro_Allowed\t\t\t\t%lu\n", BIT(dword, 1)); dword = INREG(AUD_PWRST); printf("AUD_PWRST Func_Grp_Dev_PwrSt_Curr \t%s\n", power_state[BITS(dword, 27, 26)]); printf("AUD_PWRST Func_Grp_Dev_PwrSt_Set \t%s\n", power_state[BITS(dword, 25, 24)]); printf("AUD_PWRST ConvertorA_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 15, 14)]); printf("AUD_PWRST ConvertorA_Widget_Power_State_Requsted \t%s\n", power_state[BITS(dword, 13, 12)]); printf("AUD_PWRST ConvertorB_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 19, 18)]); printf("AUD_PWRST ConvertorB_Widget_Power_State_Requested \t%s\n", power_state[BITS(dword, 17, 16)]); printf("AUD_PWRST ConvC_Widget_PwrSt_Curr \t%s\n", power_state[BITS(dword, 23, 22)]); printf("AUD_PWRST ConvC_Widget_PwrSt_Req \t%s\n", power_state[BITS(dword, 21, 20)]); printf("AUD_PWRST PinB_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 3, 2)]); printf("AUD_PWRST PinB_Widget_Power_State_Set \t%s\n", power_state[BITS(dword, 1, 0)]); printf("AUD_PWRST PinC_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 7, 6)]); printf("AUD_PWRST PinC_Widget_Power_State_Set \t%s\n", power_state[BITS(dword, 5, 4)]); printf("AUD_PWRST PinD_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 11, 10)]); printf("AUD_PWRST PinD_Widget_Power_State_Set \t%s\n", power_state[BITS(dword, 9, 8)]); dword = INREG(AUD_PORT_EN_HD_CFG); printf("AUD_PORT_EN_HD_CFG Convertor_A_Digen\t\t\t%lu\n", BIT(dword, 0)); printf("AUD_PORT_EN_HD_CFG Convertor_B_Digen\t\t\t%lu\n", BIT(dword, 1)); printf("AUD_PORT_EN_HD_CFG Convertor_C_Digen\t\t\t%lu\n", BIT(dword, 2)); printf("AUD_PORT_EN_HD_CFG ConvertorA_Stream_ID\t\t%lu\n", BITS(dword, 7, 4)); printf("AUD_PORT_EN_HD_CFG ConvertorB_Stream_ID\t\t%lu\n", BITS(dword, 11, 8)); printf("AUD_PORT_EN_HD_CFG ConvertorC_Stream_ID\t\t%lu\n", BITS(dword, 15, 12)); printf("AUD_PORT_EN_HD_CFG Port_B_Out_Enable\t\t\t%lu\n", BIT(dword, 16)); printf("AUD_PORT_EN_HD_CFG Port_C_Out_Enable\t\t\t%lu\n", BIT(dword, 17)); printf("AUD_PORT_EN_HD_CFG Port_D_Out_Enable\t\t\t%lu\n", BIT(dword, 18)); printf("AUD_PORT_EN_HD_CFG Port_B_Amp_Mute_Status\t\t%lu\n", BIT(dword, 20)); printf("AUD_PORT_EN_HD_CFG Port_C_Amp_Mute_Status\t\t%lu\n", BIT(dword, 21)); printf("AUD_PORT_EN_HD_CFG Port_D_Amp_Mute_Status\t\t%lu\n", BIT(dword, 22)); dword = INREG(AUD_OUT_DIG_CNVT_A); printf("AUD_OUT_DIG_CNVT_A V\t\t\t\t\t%lu\n", BIT(dword, 1)); printf("AUD_OUT_DIG_CNVT_A VCFG\t\t\t\t%lu\n", BIT(dword, 2)); printf("AUD_OUT_DIG_CNVT_A PRE\t\t\t\t\t%lu\n", BIT(dword, 3)); printf("AUD_OUT_DIG_CNVT_A Copy\t\t\t\t%lu\n", BIT(dword, 4)); printf("AUD_OUT_DIG_CNVT_A NonAudio\t\t\t\t%lu\n", BIT(dword, 5)); printf("AUD_OUT_DIG_CNVT_A PRO\t\t\t\t\t%lu\n", BIT(dword, 6)); printf("AUD_OUT_DIG_CNVT_A Level\t\t\t\t%lu\n", BIT(dword, 7)); printf("AUD_OUT_DIG_CNVT_A Category_Code\t\t\t%lu\n", BITS(dword, 14, 8)); printf("AUD_OUT_DIG_CNVT_A Lowest_Channel_Number\t\t%lu\n",BITS(dword, 19, 16)); printf("AUD_OUT_DIG_CNVT_A Stream_ID\t\t\t\t%lu\n", BITS(dword, 23, 20)); dword = INREG(AUD_OUT_DIG_CNVT_B); printf("AUD_OUT_DIG_CNVT_B V\t\t\t\t\t%lu\n", BIT(dword, 1)); printf("AUD_OUT_DIG_CNVT_B VCFG\t\t\t\t%lu\n", BIT(dword, 2)); printf("AUD_OUT_DIG_CNVT_B PRE\t\t\t\t\t%lu\n", BIT(dword, 3)); printf("AUD_OUT_DIG_CNVT_B Copy\t\t\t\t%lu\n", BIT(dword, 4)); printf("AUD_OUT_DIG_CNVT_B NonAudio\t\t\t\t%lu\n", BIT(dword, 5)); printf("AUD_OUT_DIG_CNVT_B PRO\t\t\t\t\t%lu\n", BIT(dword, 6)); printf("AUD_OUT_DIG_CNVT_B Level\t\t\t\t%lu\n", BIT(dword, 7)); printf("AUD_OUT_DIG_CNVT_B Category_Code\t\t\t%lu\n", BITS(dword, 14, 8)); printf("AUD_OUT_DIG_CNVT_B Lowest_Channel_Number\t\t%lu\n",BITS(dword, 19, 16)); printf("AUD_OUT_DIG_CNVT_B Stream_ID\t\t\t\t%lu\n", BITS(dword, 23, 20)); dword = INREG(AUD_OUT_DIG_CNVT_C); printf("AUD_OUT_DIG_CNVT_C V\t\t\t\t\t%lu\n", BIT(dword, 1)); printf("AUD_OUT_DIG_CNVT_C VCFG\t\t\t\t%lu\n", BIT(dword, 2)); printf("AUD_OUT_DIG_CNVT_C PRE\t\t\t\t\t%lu\n", BIT(dword, 3)); printf("AUD_OUT_DIG_CNVT_C Copy\t\t\t\t%lu\n", BIT(dword, 4)); printf("AUD_OUT_DIG_CNVT_C NonAudio\t\t\t\t%lu\n", BIT(dword, 5)); printf("AUD_OUT_DIG_CNVT_C PRO\t\t\t\t\t%lu\n", BIT(dword, 6)); printf("AUD_OUT_DIG_CNVT_C Level\t\t\t\t%lu\n", BIT(dword, 7)); printf("AUD_OUT_DIG_CNVT_C Category_Code\t\t\t%lu\n", BITS(dword, 14, 8)); printf("AUD_OUT_DIG_CNVT_C Lowest_Channel_Number\t\t%lu\n",BITS(dword, 19, 16)); printf("AUD_OUT_DIG_CNVT_C Stream_ID\t\t\t\t%lu\n", BITS(dword, 23, 20)); printf("AUD_OUT_CHAN_MAP Converter_Channel_MAP PORTB PORTC PORTD\n"); for (i = 0; i < 8; i++) { OUTREG(AUD_OUT_CHAN_MAP, i | (i << 8) | (i << 16)); dword = INREG(AUD_OUT_CHAN_MAP); printf("\t\t\t\t%lu\t%lu\t%lu\t%lu\n", 1 + BITS(dword, 3, 0), 1 + BITS(dword, 7, 4), 1 + BITS(dword, 15, 12), 1 + BITS(dword, 23, 20)); } dword = INREG(AUD_OUT_STR_DESC_A); printf("AUD_OUT_STR_DESC_A Convertor_Channel_Count\t\t%lu\n", BITS(dword, 20, 16) + 1); printf("AUD_OUT_STR_DESC_A Bits_per_Sample\t\t\t[%#lx] %s\n", BITS(dword, 6, 4), OPNAME(bits_per_sample, BITS(dword, 6, 4))); printf("AUD_OUT_STR_DESC_A Number_of_Channels_in_a_Stream\t%lu\n", 1 + BITS(dword, 3, 0)); dword = INREG(AUD_OUT_STR_DESC_B); printf("AUD_OUT_STR_DESC_B Convertor_Channel_Count\t\t%lu\n", BITS(dword, 20, 16) + 1); printf("AUD_OUT_STR_DESC_B Bits_per_Sample\t\t\t[%#lx] %s\n", BITS(dword, 6, 4), OPNAME(bits_per_sample, BITS(dword, 6, 4))); printf("AUD_OUT_STR_DESC_B Number_of_Channels_in_a_Stream\t%lu\n", 1 + BITS(dword, 3, 0)); dword = INREG(AUD_OUT_STR_DESC_C); printf("AUD_OUT_STR_DESC_C Convertor_Channel_Count\t\t%lu\n", BITS(dword, 20, 16) + 1); printf("AUD_OUT_STR_DESC_C Bits_per_Sample\t\t\t[%#lx] %s\n", BITS(dword, 6, 4), OPNAME(bits_per_sample, BITS(dword, 6, 4))); printf("AUD_OUT_STR_DESC_C Number_of_Channels_in_a_Stream\t%lu\n", 1 + BITS(dword, 3, 0)); dword = INREG(AUD_PINW_CONNLNG_SEL); printf("AUD_PINW_CONNLNG_SEL Connection_select_Control_B\t%#lx\n", BITS(dword, 7, 0)); printf("AUD_PINW_CONNLNG_SEL Connection_select_Control_C\t%#lx\n", BITS(dword, 15, 8)); printf("AUD_PINW_CONNLNG_SEL Connection_select_Control_D\t%#lx\n", BITS(dword, 23, 16)); dword = INREG(AUD_PIN_ELD_CP_VLD); printf("AUD_CNTRL_ST2 CP_ReadyB\t\t\t\t%lu\n", BIT(dword, 1)); printf("AUD_CNTRL_ST2 ELD_validB\t\t\t\t%lu\n", BIT(dword, 0)); printf("AUD_CNTRL_ST2 OUT_enableB\t\t\t\t%lu\n", BIT(dword, 2)); printf("AUD_CNTRL_ST2 CP_ReadyC\t\t\t\t%lu\n", BIT(dword, 5)); printf("AUD_CNTRL_ST2 ELD_validC\t\t\t\t%lu\n", BIT(dword, 4)); printf("AUD_CNTRL_ST2 OUT_enableC\t\t\t\t%lu\n", BIT(dword, 6)); printf("AUD_CNTRL_ST2 CP_ReadyD\t\t\t\t%lu\n", BIT(dword, 9)); printf("AUD_CNTRL_ST2 ELD_validD\t\t\t\t%lu\n", BIT(dword, 8)); printf("AUD_CNTRL_ST2 OUT_enableD\t\t\t\t%lu\n", BIT(dword, 10)); dword = INREG(AUD_HDMIW_STATUS); printf("AUD_HDMIW_STATUS Conv_A_CDCLK/DOTCLK_FIFO_Underrun\t%lu\n", BIT(dword, 27)); printf("AUD_HDMIW_STATUS Conv_A_CDCLK/DOTCLK_FIFO_Overrun\t%lu\n", BIT(dword, 26)); printf("AUD_HDMIW_STATUS Conv_B_CDCLK/DOTCLK_FIFO_Underrun\t%lu\n", BIT(dword, 29)); printf("AUD_HDMIW_STATUS Conv_B_CDCLK/DOTCLK_FIFO_Overrun\t%lu\n", BIT(dword, 28)); printf("AUD_HDMIW_STATUS Conv_C_CDCLK/DOTCLK_FIFO_Underrun\t%lu\n", BIT(dword, 31)); printf("AUD_HDMIW_STATUS Conv_C_CDCLK/DOTCLK_FIFO_Overrun\t%lu\n", BIT(dword, 30)); printf("AUD_HDMIW_STATUS BCLK/CDCLK_FIFO_Overrun\t\t%lu\n", BIT(dword, 25)); printf("AUD_HDMIW_STATUS Function_Reset\t\t\t%lu\n", BIT(dword, 24)); printf("AUD_HDMIW_HDMIEDID_A HDMI ELD:\n\t"); dword = INREG(AUD_DIP_ELD_CTRL_ST_A); dword &= ~BITMASK(9, 5); OUTREG(AUD_DIP_ELD_CTRL_ST_A, dword); for (i = 0; i < BITS(dword, 14, 10) / 4; i++) printf("%08x ", htonl(INREG(AUD_HDMIW_HDMIEDID_A))); printf("\n"); printf("AUD_HDMIW_HDMIEDID_B HDMI ELD:\n\t"); dword = INREG(AUD_DIP_ELD_CTRL_ST_B); dword &= ~BITMASK(9, 5); OUTREG(AUD_DIP_ELD_CTRL_ST_B, dword); for (i = 0; i < BITS(dword, 14, 10) / 4; i++) printf("%08x ", htonl(INREG(AUD_HDMIW_HDMIEDID_B))); printf("\n"); printf("AUD_HDMIW_HDMIEDID_C HDMI ELD:\n\t"); dword = INREG(AUD_DIP_ELD_CTRL_ST_C); dword &= ~BITMASK(9, 5); OUTREG(AUD_DIP_ELD_CTRL_ST_C, dword); for (i = 0; i < BITS(dword, 14, 10) / 4; i++) printf("%08x ", htonl(INREG(AUD_HDMIW_HDMIEDID_C))); printf("\n"); printf("AUD_HDMIW_INFOFR_A HDMI audio Infoframe:\n\t"); dword = INREG(AUD_DIP_ELD_CTRL_ST_A); dword &= ~BITMASK(20, 18); dword &= ~BITMASK(3, 0); OUTREG(AUD_DIP_ELD_CTRL_ST_A, dword); for (i = 0; i < 8; i++) printf("%08x ", htonl(INREG(AUD_HDMIW_INFOFR_A))); printf("\n"); printf("AUD_HDMIW_INFOFR_B HDMI audio Infoframe:\n\t"); dword = INREG(AUD_DIP_ELD_CTRL_ST_B); dword &= ~BITMASK(20, 18); dword &= ~BITMASK(3, 0); OUTREG(AUD_DIP_ELD_CTRL_ST_B, dword); for (i = 0; i < 8; i++) printf("%08x ", htonl(INREG(AUD_HDMIW_INFOFR_B))); printf("\n"); printf("AUD_HDMIW_INFOFR_C HDMI audio Infoframe:\n\t"); dword = INREG(AUD_DIP_ELD_CTRL_ST_C); dword &= ~BITMASK(20, 18); dword &= ~BITMASK(3, 0); OUTREG(AUD_DIP_ELD_CTRL_ST_C, dword); for (i = 0; i < 8; i++) printf("%08x ", htonl(INREG(AUD_HDMIW_INFOFR_C))); printf("\n"); } int main(int argc, char **argv) { struct pci_device *pci_dev; pci_dev = intel_get_pci_device(); devid = pci_dev->device_id; /* XXX not true when mapping! */ do_self_tests(); if (argc == 2) intel_map_file(argv[1]); else intel_get_mmio(pci_dev); if (IS_GEN6(devid) || IS_GEN7(devid) || getenv("HAS_PCH_SPLIT")) { if (IS_HASWELL(devid)) { printf("Haswell audio registers:\n\n"); dump_hsw(); return 0; } printf("%s audio registers:\n\n", IS_GEN6(devid) ? "SandyBridge" : "IvyBridge"); intel_check_pch(); dump_cpt(); } else if (IS_GEN5(devid)) { printf("Ironlake audio registers:\n\n"); dump_ironlake(); } else if (IS_G4X(devid)) { printf("G45 audio registers:\n\n"); dump_eaglelake(); } return 0; } intel-gpu-tools-1.3/tools/Makefile.in0000664000175100017510000011076712016622041014557 00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } 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@ bin_PROGRAMS = intel_disable_clock_gating$(EXEEXT) \ intel_audio_dump$(EXEEXT) intel_backlight$(EXEEXT) \ intel_bios_dumper$(EXEEXT) intel_bios_reader$(EXEEXT) \ intel_error_decode$(EXEEXT) intel_gpu_top$(EXEEXT) \ intel_gpu_time$(EXEEXT) intel_gtt$(EXEEXT) \ intel_stepping$(EXEEXT) intel_reg_checker$(EXEEXT) \ intel_reg_dumper$(EXEEXT) intel_reg_snapshot$(EXEEXT) \ intel_reg_write$(EXEEXT) intel_reg_read$(EXEEXT) \ intel_forcewaked$(EXEEXT) intel_dpio_read$(EXEEXT) \ intel_dpio_write$(EXEEXT) intel_l3_parity$(EXEEXT) noinst_PROGRAMS = intel_dump_decode$(EXEEXT) intel_infoframes$(EXEEXT) \ intel_lid$(EXEEXT) intel_panel_fitter$(EXEEXT) subdir = tools DIST_COMMON = $(dist_bin_SCRIPTS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS) intel_audio_dump_SOURCES = intel_audio_dump.c intel_audio_dump_OBJECTS = intel_audio_dump.$(OBJEXT) intel_audio_dump_LDADD = $(LDADD) am__DEPENDENCIES_1 = intel_audio_dump_DEPENDENCIES = $(top_builddir)/lib/libintel_tools.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent intel_backlight_SOURCES = intel_backlight.c intel_backlight_OBJECTS = intel_backlight.$(OBJEXT) intel_backlight_LDADD = $(LDADD) intel_backlight_DEPENDENCIES = $(top_builddir)/lib/libintel_tools.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) intel_bios_dumper_SOURCES = intel_bios_dumper.c intel_bios_dumper_OBJECTS = intel_bios_dumper.$(OBJEXT) intel_bios_dumper_LDADD = $(LDADD) intel_bios_dumper_DEPENDENCIES = \ $(top_builddir)/lib/libintel_tools.la $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_intel_bios_reader_OBJECTS = intel_bios_reader.$(OBJEXT) intel_bios_reader_OBJECTS = $(am_intel_bios_reader_OBJECTS) intel_bios_reader_LDADD = $(LDADD) intel_bios_reader_DEPENDENCIES = \ $(top_builddir)/lib/libintel_tools.la $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) intel_disable_clock_gating_SOURCES = intel_disable_clock_gating.c intel_disable_clock_gating_OBJECTS = \ intel_disable_clock_gating.$(OBJEXT) intel_disable_clock_gating_LDADD = $(LDADD) intel_disable_clock_gating_DEPENDENCIES = \ $(top_builddir)/lib/libintel_tools.la $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) intel_dpio_read_SOURCES = intel_dpio_read.c intel_dpio_read_OBJECTS = intel_dpio_read.$(OBJEXT) intel_dpio_read_LDADD = $(LDADD) intel_dpio_read_DEPENDENCIES = $(top_builddir)/lib/libintel_tools.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) intel_dpio_write_SOURCES = intel_dpio_write.c intel_dpio_write_OBJECTS = intel_dpio_write.$(OBJEXT) intel_dpio_write_LDADD = $(LDADD) intel_dpio_write_DEPENDENCIES = $(top_builddir)/lib/libintel_tools.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) am_intel_dump_decode_OBJECTS = intel_dump_decode.$(OBJEXT) intel_dump_decode_OBJECTS = $(am_intel_dump_decode_OBJECTS) intel_dump_decode_LDADD = $(LDADD) intel_dump_decode_DEPENDENCIES = \ $(top_builddir)/lib/libintel_tools.la $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_intel_error_decode_OBJECTS = intel_error_decode.$(OBJEXT) intel_error_decode_OBJECTS = $(am_intel_error_decode_OBJECTS) intel_error_decode_LDADD = $(LDADD) intel_error_decode_DEPENDENCIES = \ $(top_builddir)/lib/libintel_tools.la $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) intel_forcewaked_SOURCES = intel_forcewaked.c intel_forcewaked_OBJECTS = intel_forcewaked.$(OBJEXT) intel_forcewaked_LDADD = $(LDADD) intel_forcewaked_DEPENDENCIES = $(top_builddir)/lib/libintel_tools.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) intel_gpu_time_SOURCES = intel_gpu_time.c intel_gpu_time_OBJECTS = intel_gpu_time.$(OBJEXT) intel_gpu_time_LDADD = $(LDADD) intel_gpu_time_DEPENDENCIES = $(top_builddir)/lib/libintel_tools.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) intel_gpu_top_SOURCES = intel_gpu_top.c intel_gpu_top_OBJECTS = intel_gpu_top.$(OBJEXT) intel_gpu_top_LDADD = $(LDADD) intel_gpu_top_DEPENDENCIES = $(top_builddir)/lib/libintel_tools.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) intel_gtt_SOURCES = intel_gtt.c intel_gtt_OBJECTS = intel_gtt.$(OBJEXT) intel_gtt_LDADD = $(LDADD) intel_gtt_DEPENDENCIES = $(top_builddir)/lib/libintel_tools.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) intel_infoframes_SOURCES = intel_infoframes.c intel_infoframes_OBJECTS = intel_infoframes.$(OBJEXT) intel_infoframes_LDADD = $(LDADD) intel_infoframes_DEPENDENCIES = $(top_builddir)/lib/libintel_tools.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) intel_l3_parity_SOURCES = intel_l3_parity.c intel_l3_parity_OBJECTS = intel_l3_parity.$(OBJEXT) intel_l3_parity_LDADD = $(LDADD) intel_l3_parity_DEPENDENCIES = $(top_builddir)/lib/libintel_tools.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) intel_lid_SOURCES = intel_lid.c intel_lid_OBJECTS = intel_lid.$(OBJEXT) intel_lid_LDADD = $(LDADD) intel_lid_DEPENDENCIES = $(top_builddir)/lib/libintel_tools.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) intel_panel_fitter_SOURCES = intel_panel_fitter.c intel_panel_fitter_OBJECTS = intel_panel_fitter.$(OBJEXT) intel_panel_fitter_LDADD = $(LDADD) intel_panel_fitter_DEPENDENCIES = \ $(top_builddir)/lib/libintel_tools.la $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) intel_reg_checker_SOURCES = intel_reg_checker.c intel_reg_checker_OBJECTS = intel_reg_checker.$(OBJEXT) intel_reg_checker_LDADD = $(LDADD) intel_reg_checker_DEPENDENCIES = \ $(top_builddir)/lib/libintel_tools.la $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) intel_reg_dumper_SOURCES = intel_reg_dumper.c intel_reg_dumper_OBJECTS = intel_reg_dumper.$(OBJEXT) intel_reg_dumper_LDADD = $(LDADD) intel_reg_dumper_DEPENDENCIES = $(top_builddir)/lib/libintel_tools.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) intel_reg_read_SOURCES = intel_reg_read.c intel_reg_read_OBJECTS = intel_reg_read.$(OBJEXT) intel_reg_read_LDADD = $(LDADD) intel_reg_read_DEPENDENCIES = $(top_builddir)/lib/libintel_tools.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) intel_reg_snapshot_SOURCES = intel_reg_snapshot.c intel_reg_snapshot_OBJECTS = intel_reg_snapshot.$(OBJEXT) intel_reg_snapshot_LDADD = $(LDADD) intel_reg_snapshot_DEPENDENCIES = \ $(top_builddir)/lib/libintel_tools.la $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) intel_reg_write_SOURCES = intel_reg_write.c intel_reg_write_OBJECTS = intel_reg_write.$(OBJEXT) intel_reg_write_LDADD = $(LDADD) intel_reg_write_DEPENDENCIES = $(top_builddir)/lib/libintel_tools.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) intel_stepping_SOURCES = intel_stepping.c intel_stepping_OBJECTS = intel_stepping.$(OBJEXT) intel_stepping_LDADD = $(LDADD) intel_stepping_DEPENDENCIES = $(top_builddir)/lib/libintel_tools.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) 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; }; \ } SCRIPTS = $(dist_bin_SCRIPTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; SOURCES = intel_audio_dump.c intel_backlight.c intel_bios_dumper.c \ $(intel_bios_reader_SOURCES) intel_disable_clock_gating.c \ intel_dpio_read.c intel_dpio_write.c \ $(intel_dump_decode_SOURCES) $(intel_error_decode_SOURCES) \ intel_forcewaked.c intel_gpu_time.c intel_gpu_top.c \ intel_gtt.c intel_infoframes.c intel_l3_parity.c intel_lid.c \ intel_panel_fitter.c intel_reg_checker.c intel_reg_dumper.c \ intel_reg_read.c intel_reg_snapshot.c intel_reg_write.c \ intel_stepping.c DIST_SOURCES = intel_audio_dump.c intel_backlight.c \ intel_bios_dumper.c $(intel_bios_reader_SOURCES) \ intel_disable_clock_gating.c intel_dpio_read.c \ intel_dpio_write.c $(intel_dump_decode_SOURCES) \ $(intel_error_decode_SOURCES) intel_forcewaked.c \ intel_gpu_time.c intel_gpu_top.c intel_gtt.c \ intel_infoframes.c intel_l3_parity.c intel_lid.c \ intel_panel_fitter.c intel_reg_checker.c intel_reg_dumper.c \ intel_reg_read.c intel_reg_snapshot.c intel_reg_write.c \ intel_stepping.c am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ADMIN_MAN_DIR = @ADMIN_MAN_DIR@ ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@ AMTAR = @AMTAR@ 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@ CAIRO_CFLAGS = @CAIRO_CFLAGS@ CAIRO_LIBS = @CAIRO_LIBS@ 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@ DRM_CFLAGS = @DRM_CFLAGS@ DRM_LIBS = @DRM_LIBS@ DRM_NOUVEAU_CFLAGS = @DRM_NOUVEAU_CFLAGS@ DRM_NOUVEAU_LIBS = @DRM_NOUVEAU_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILE_MAN_DIR = @FILE_MAN_DIR@ FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@ GEN4ASM = @GEN4ASM@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_LIBS = @GLIB_LIBS@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_CMD = @INSTALL_CMD@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBUDEV_CFLAGS = @LIBUDEV_CFLAGS@ LIBUDEV_LIBS = @LIBUDEV_LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MAN_SUBSTS = @MAN_SUBSTS@ MISC_MAN_DIR = @MISC_MAN_DIR@ MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJCOPY = @OBJCOPY@ 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@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ THREAD_CFLAGS = @THREAD_CFLAGS@ VERSION = @VERSION@ 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@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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@ dist_bin_SCRIPTS = intel_gpu_abrt AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/lib AM_CFLAGS = $(DRM_CFLAGS) $(PCIACCESS_CFLAGS) $(CWARNFLAGS) $(CAIRO_CFLAGS) LDADD = $(top_builddir)/lib/libintel_tools.la $(DRM_LIBS) $(PCIACCESS_LIBS) $(CAIRO_LIBS) intel_dump_decode_SOURCES = \ intel_dump_decode.c intel_error_decode_SOURCES = \ intel_error_decode.c intel_bios_reader_SOURCES = \ intel_bios_reader.c \ intel_bios.h all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tools/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign tools/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p || test -f $$p1; \ then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list intel_audio_dump$(EXEEXT): $(intel_audio_dump_OBJECTS) $(intel_audio_dump_DEPENDENCIES) $(EXTRA_intel_audio_dump_DEPENDENCIES) @rm -f intel_audio_dump$(EXEEXT) $(AM_V_CCLD)$(LINK) $(intel_audio_dump_OBJECTS) $(intel_audio_dump_LDADD) $(LIBS) intel_backlight$(EXEEXT): $(intel_backlight_OBJECTS) $(intel_backlight_DEPENDENCIES) $(EXTRA_intel_backlight_DEPENDENCIES) @rm -f intel_backlight$(EXEEXT) $(AM_V_CCLD)$(LINK) $(intel_backlight_OBJECTS) $(intel_backlight_LDADD) $(LIBS) intel_bios_dumper$(EXEEXT): $(intel_bios_dumper_OBJECTS) $(intel_bios_dumper_DEPENDENCIES) $(EXTRA_intel_bios_dumper_DEPENDENCIES) @rm -f intel_bios_dumper$(EXEEXT) $(AM_V_CCLD)$(LINK) $(intel_bios_dumper_OBJECTS) $(intel_bios_dumper_LDADD) $(LIBS) intel_bios_reader$(EXEEXT): $(intel_bios_reader_OBJECTS) $(intel_bios_reader_DEPENDENCIES) $(EXTRA_intel_bios_reader_DEPENDENCIES) @rm -f intel_bios_reader$(EXEEXT) $(AM_V_CCLD)$(LINK) $(intel_bios_reader_OBJECTS) $(intel_bios_reader_LDADD) $(LIBS) intel_disable_clock_gating$(EXEEXT): $(intel_disable_clock_gating_OBJECTS) $(intel_disable_clock_gating_DEPENDENCIES) $(EXTRA_intel_disable_clock_gating_DEPENDENCIES) @rm -f intel_disable_clock_gating$(EXEEXT) $(AM_V_CCLD)$(LINK) $(intel_disable_clock_gating_OBJECTS) $(intel_disable_clock_gating_LDADD) $(LIBS) intel_dpio_read$(EXEEXT): $(intel_dpio_read_OBJECTS) $(intel_dpio_read_DEPENDENCIES) $(EXTRA_intel_dpio_read_DEPENDENCIES) @rm -f intel_dpio_read$(EXEEXT) $(AM_V_CCLD)$(LINK) $(intel_dpio_read_OBJECTS) $(intel_dpio_read_LDADD) $(LIBS) intel_dpio_write$(EXEEXT): $(intel_dpio_write_OBJECTS) $(intel_dpio_write_DEPENDENCIES) $(EXTRA_intel_dpio_write_DEPENDENCIES) @rm -f intel_dpio_write$(EXEEXT) $(AM_V_CCLD)$(LINK) $(intel_dpio_write_OBJECTS) $(intel_dpio_write_LDADD) $(LIBS) intel_dump_decode$(EXEEXT): $(intel_dump_decode_OBJECTS) $(intel_dump_decode_DEPENDENCIES) $(EXTRA_intel_dump_decode_DEPENDENCIES) @rm -f intel_dump_decode$(EXEEXT) $(AM_V_CCLD)$(LINK) $(intel_dump_decode_OBJECTS) $(intel_dump_decode_LDADD) $(LIBS) intel_error_decode$(EXEEXT): $(intel_error_decode_OBJECTS) $(intel_error_decode_DEPENDENCIES) $(EXTRA_intel_error_decode_DEPENDENCIES) @rm -f intel_error_decode$(EXEEXT) $(AM_V_CCLD)$(LINK) $(intel_error_decode_OBJECTS) $(intel_error_decode_LDADD) $(LIBS) intel_forcewaked$(EXEEXT): $(intel_forcewaked_OBJECTS) $(intel_forcewaked_DEPENDENCIES) $(EXTRA_intel_forcewaked_DEPENDENCIES) @rm -f intel_forcewaked$(EXEEXT) $(AM_V_CCLD)$(LINK) $(intel_forcewaked_OBJECTS) $(intel_forcewaked_LDADD) $(LIBS) intel_gpu_time$(EXEEXT): $(intel_gpu_time_OBJECTS) $(intel_gpu_time_DEPENDENCIES) $(EXTRA_intel_gpu_time_DEPENDENCIES) @rm -f intel_gpu_time$(EXEEXT) $(AM_V_CCLD)$(LINK) $(intel_gpu_time_OBJECTS) $(intel_gpu_time_LDADD) $(LIBS) intel_gpu_top$(EXEEXT): $(intel_gpu_top_OBJECTS) $(intel_gpu_top_DEPENDENCIES) $(EXTRA_intel_gpu_top_DEPENDENCIES) @rm -f intel_gpu_top$(EXEEXT) $(AM_V_CCLD)$(LINK) $(intel_gpu_top_OBJECTS) $(intel_gpu_top_LDADD) $(LIBS) intel_gtt$(EXEEXT): $(intel_gtt_OBJECTS) $(intel_gtt_DEPENDENCIES) $(EXTRA_intel_gtt_DEPENDENCIES) @rm -f intel_gtt$(EXEEXT) $(AM_V_CCLD)$(LINK) $(intel_gtt_OBJECTS) $(intel_gtt_LDADD) $(LIBS) intel_infoframes$(EXEEXT): $(intel_infoframes_OBJECTS) $(intel_infoframes_DEPENDENCIES) $(EXTRA_intel_infoframes_DEPENDENCIES) @rm -f intel_infoframes$(EXEEXT) $(AM_V_CCLD)$(LINK) $(intel_infoframes_OBJECTS) $(intel_infoframes_LDADD) $(LIBS) intel_l3_parity$(EXEEXT): $(intel_l3_parity_OBJECTS) $(intel_l3_parity_DEPENDENCIES) $(EXTRA_intel_l3_parity_DEPENDENCIES) @rm -f intel_l3_parity$(EXEEXT) $(AM_V_CCLD)$(LINK) $(intel_l3_parity_OBJECTS) $(intel_l3_parity_LDADD) $(LIBS) intel_lid$(EXEEXT): $(intel_lid_OBJECTS) $(intel_lid_DEPENDENCIES) $(EXTRA_intel_lid_DEPENDENCIES) @rm -f intel_lid$(EXEEXT) $(AM_V_CCLD)$(LINK) $(intel_lid_OBJECTS) $(intel_lid_LDADD) $(LIBS) intel_panel_fitter$(EXEEXT): $(intel_panel_fitter_OBJECTS) $(intel_panel_fitter_DEPENDENCIES) $(EXTRA_intel_panel_fitter_DEPENDENCIES) @rm -f intel_panel_fitter$(EXEEXT) $(AM_V_CCLD)$(LINK) $(intel_panel_fitter_OBJECTS) $(intel_panel_fitter_LDADD) $(LIBS) intel_reg_checker$(EXEEXT): $(intel_reg_checker_OBJECTS) $(intel_reg_checker_DEPENDENCIES) $(EXTRA_intel_reg_checker_DEPENDENCIES) @rm -f intel_reg_checker$(EXEEXT) $(AM_V_CCLD)$(LINK) $(intel_reg_checker_OBJECTS) $(intel_reg_checker_LDADD) $(LIBS) intel_reg_dumper$(EXEEXT): $(intel_reg_dumper_OBJECTS) $(intel_reg_dumper_DEPENDENCIES) $(EXTRA_intel_reg_dumper_DEPENDENCIES) @rm -f intel_reg_dumper$(EXEEXT) $(AM_V_CCLD)$(LINK) $(intel_reg_dumper_OBJECTS) $(intel_reg_dumper_LDADD) $(LIBS) intel_reg_read$(EXEEXT): $(intel_reg_read_OBJECTS) $(intel_reg_read_DEPENDENCIES) $(EXTRA_intel_reg_read_DEPENDENCIES) @rm -f intel_reg_read$(EXEEXT) $(AM_V_CCLD)$(LINK) $(intel_reg_read_OBJECTS) $(intel_reg_read_LDADD) $(LIBS) intel_reg_snapshot$(EXEEXT): $(intel_reg_snapshot_OBJECTS) $(intel_reg_snapshot_DEPENDENCIES) $(EXTRA_intel_reg_snapshot_DEPENDENCIES) @rm -f intel_reg_snapshot$(EXEEXT) $(AM_V_CCLD)$(LINK) $(intel_reg_snapshot_OBJECTS) $(intel_reg_snapshot_LDADD) $(LIBS) intel_reg_write$(EXEEXT): $(intel_reg_write_OBJECTS) $(intel_reg_write_DEPENDENCIES) $(EXTRA_intel_reg_write_DEPENDENCIES) @rm -f intel_reg_write$(EXEEXT) $(AM_V_CCLD)$(LINK) $(intel_reg_write_OBJECTS) $(intel_reg_write_LDADD) $(LIBS) intel_stepping$(EXEEXT): $(intel_stepping_OBJECTS) $(intel_stepping_DEPENDENCIES) $(EXTRA_intel_stepping_DEPENDENCIES) @rm -f intel_stepping$(EXEEXT) $(AM_V_CCLD)$(LINK) $(intel_stepping_OBJECTS) $(intel_stepping_LDADD) $(LIBS) install-dist_binSCRIPTS: $(dist_bin_SCRIPTS) @$(NORMAL_INSTALL) @list='$(dist_bin_SCRIPTS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) { files[d] = files[d] " " $$1; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$4, $$1 } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-dist_binSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(dist_bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/intel_audio_dump.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/intel_backlight.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/intel_bios_dumper.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/intel_bios_reader.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/intel_disable_clock_gating.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/intel_dpio_read.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/intel_dpio_write.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/intel_dump_decode.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/intel_error_decode.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/intel_forcewaked.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/intel_gpu_time.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/intel_gpu_top.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/intel_gtt.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/intel_infoframes.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/intel_l3_parity.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/intel_lid.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/intel_panel_fitter.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/intel_reg_checker.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/intel_reg_dumper.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/intel_reg_read.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/intel_reg_snapshot.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/intel_reg_write.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/intel_stepping.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(SCRIPTS) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool \ clean-noinstPROGRAMS mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-dist_binSCRIPTS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-dist_binSCRIPTS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic clean-libtool clean-noinstPROGRAMS ctags \ distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-dist_binSCRIPTS \ 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-compile mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ uninstall-am uninstall-binPROGRAMS uninstall-dist_binSCRIPTS # 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: intel-gpu-tools-1.3/ChangeLog0000664000175100017510000070150012016622744013125 00000000000000commit dd5f40f50c02e8ef68ac9bbee3e94302e7baeed3 Author: Daniel Vetter Date: Mon Aug 27 09:37:01 2012 +0200 bump to 1.3 release commit 7a02aa4cbfe4c63bb9435cf9cab487bd1df10185 Author: Chris Wilson Date: Sun Aug 26 21:22:15 2012 +0100 mmio: Limit the uc- mapping to only map the registers In the future, we may like to enable wc mapping of at least the GATT, and so causing a conflict if we attempt to map the entire bar as uc- here. Obviously we need a better fallback plan, but for the moment only attempt to map the portion of the pci space that we use for register access. Signed-off-by: Chris Wilson Signed-off-by: Daniel Vetter commit a4783f9485f78c80e7cc1eb041634b4b8a3aa4b9 Author: Chris Wilson Date: Sun Aug 26 21:22:14 2012 +0100 intel_gtt: Harden against changes to kernel mappings of the GTT Rather than use the common mmio segment which will be in future restricted to just the registers and so exclude the GTT portion on all architectures, explicitly mmap the GTT ourselves. Repeat this mmapping with a couple of flags until we matching the existing kernel mapping. Signed-off-by: Chris Wilson Signed-off-by: Daniel Vetter commit 3d148e164d498d81cc3990c85b65afee8bcca3b8 Author: Daniel Vetter Date: Sat Aug 25 00:01:27 2012 +0200 s/NO_PID/NOP_ID Alan typo'ed it, I've failed to notice :( commit 1b5fd314fd474827373f6f48fa11fcb60687f5a2 Author: Alan Coopersmith Date: Fri Aug 24 14:02:04 2012 -0700 Add --disable-nouveau option for platforms without nouveau support Signed-off-by: Alan Coopersmith Signed-off-by: Daniel Vetter commit 4cdfa8e9b7177a12d7d693207be52a6c999236ef Author: Alan Coopersmith Date: Fri Aug 24 14:02:03 2012 -0700 flip_test: add cast to pacify Solaris Studio compiler Fixes build error: "flip_test.c", line 180: improper pointer/integer combination: op "=" Signed-off-by: Alan Coopersmith Signed-off-by: Daniel Vetter commit 6b3e6f28d2ba738fd2677b6c3e4f7ec03d9a463a Author: Alan Coopersmith Date: Fri Aug 24 14:02:02 2012 -0700 Rename NOPID to NO_PID to avoid conflict with Solaris NOPID Solaris already has #define NOPID (pid_t)(-1) Signed-off-by: Alan Coopersmith Signed-off-by: Daniel Vetter commit 99fdba921ed88381ab721b15299e637366042465 Author: Alan Coopersmith Date: Fri Aug 24 14:02:01 2012 -0700 Fall back to CLOCK_MONOTONIC on systems without CLOCK_MONOTONIC_RAW Solaris has not yet adopted this Linux extension Signed-off-by: Alan Coopersmith Signed-off-by: Daniel Vetter commit e40146878e4cf74a96fd0c42342065f7cd85fa97 Author: Daniel Vetter Date: Fri Aug 24 23:18:48 2012 +0200 Revert "tests: disable nouveau if unavailable" This reverts commit dd8325323bfcca1f742e864ca7d87101a0d59936. I like the patch from Alan Coopersmith with an explicit disable option better. commit dd8325323bfcca1f742e864ca7d87101a0d59936 Author: Maarten Lankhorst Date: Fri Aug 24 22:55:20 2012 +0200 tests: disable nouveau if unavailable commit 425940be1d894459cead9aaf211a74338480aaa3 Author: Maarten Lankhorst Date: Fri Aug 24 22:50:21 2012 +0200 tests/prime_nv_test: add missing call for test8 commit c5b7ebc1cc4ecb4db8e691ba0d935826c6da2ebf Author: Maarten Lankhorst Date: Fri Aug 24 22:49:40 2012 +0200 tests/prime_nv_pcopy: kill debug code that's not upstream commit 94ec3f926c2a8e0706a93b20892aa1a25a504e99 Author: Daniel Vetter Date: Fri Aug 24 15:45:09 2012 +0200 tests/prime_nv: don't enable buffer reuse We share these suckers, hence the fd-local libdrn instance does not have full control over the lifecycle of the object. Prevents the tests from blowing up with [drm:i915_gem_mmap_gtt] *ERROR* Attempting to mmap a purgeable buffer and similar things. Signed-off-by: Daniel Vetter commit d4005511443e385b54b11754681f7bf44b6d9796 Author: Ben Widawsky Date: Thu Aug 23 11:37:09 2012 -0700 Converted a display debug script for use by designers Signed-off-by: Ben Widawsky commit ea944a9faf137e95b146ce8a1fb15d7e4cb8ae41 Author: Ben Widawsky Date: Thu Aug 23 11:32:57 2012 -0700 intel_reg_read: use strtol instead of atoi Signed-off-by: Ben Widawsky commit baf026d692c25969c3a30fcd50394c83f3f20815 Author: Ben Widawsky Date: Thu Aug 23 11:29:43 2012 -0700 intel_reg_read: support -c option to read multiple dwords Signed-off-by: Ben Widawsky commit 4fc76adf313f2792b7438f9372321ce3ea66c6c2 Author: Vijay Purushothaman Date: Fri Aug 17 18:06:52 2012 +0530 tools: Added intel_dpio_read and intel_dpio_write In Valleyview the DPLL and lane control registers are accessible only through side band fabric called DPIO. Added two tools to read and write registers residing in this space. v2: Moved the core read/write functions to lib/intel_dpio.c based on Ben's feedback Signed-off-by: Vijay Purushothaman Signed-off-by: Daniel Vetter commit 082826de6c66ff76c444434cd56aaf6df80027b3 Author: Daniel Vetter Date: Wed Aug 15 10:26:08 2012 +0200 tests: add gem_gtt_cpu_tlb This catches tlb invalidation issues on my snb mobile gt2+ commit c407722048cee255be0e02ccf27d010ad3c7a6f6 Author: Wang Xingchao Date: Wed Aug 15 16:13:38 2012 +0800 intel_audio_dump: add Haswell audio dump support Add Haswell audio registers definition and dump support. Signed-off-by: Wang Xingchao Signed-off-by: Daniel Vetter commit f9a2481e717fcd8c8bd363f9084743ce885aa1d4 Author: Wang Xingchao Date: Wed Aug 15 16:13:37 2012 +0800 intel_audio_dump: fix wrong port definition there're three Ports B/C/D used for selection by each transcoder A/B/C. Signed-off-by: Wang Xingchao Signed-off-by: Daniel Vetter commit 1f523bd8d10c0b67fc8a026633bcaa416ea03d9c Author: Maarten Lankhorst Date: Tue Aug 14 18:51:19 2012 +0200 Fixup previous commit ENODEV not being defined and return code wrong commit 3dda35744561e61cd6a63a75eb77bc4d67643f27 Author: Maarten Lankhorst Date: Tue Aug 14 18:50:29 2012 +0200 And add another corner case skip commit 0f65ee9576dcfe3f9b82dcda47fd8744874c4ccb Author: Maarten Lankhorst Date: Tue Aug 14 18:48:48 2012 +0200 fix crash with insufficient permissions commit fc54f2eaa8f55ceb4955d31ef6d8b36645c6910f Author: Maarten Lankhorst Date: Tue Aug 14 18:25:50 2012 +0200 satisfy danvet's OC and add skip codes, but mostly satisfy danvet's OCD commit 4520025b7320cad238333793f36aadd466adb7ba Author: Maarten Lankhorst Date: Mon Aug 13 15:57:57 2012 +0200 Add intel <-> nouveau prime tests commit 0efa6c7b2725f67d742f194a0c88291b7b3edffa Author: Daniel Vetter Date: Tue Aug 7 18:16:34 2012 +0200 tools/reg_dumper: really dump pipe C regs Not just a copy of pipe B. Meh. Also kill a few redudant #define for pipe B - they match pipe A. commit 9fcaffda887a8ea20135e48368b44037a4750c63 Author: Yi Sun Date: Wed Aug 8 14:35:20 2012 +0800 Update the image file pass.png with higher correction level Signed-off-by: Yi Sun commit f669e8c12ebaae6f3638593d564358e5ab43d24c Author: Yi Sun Date: Wed Aug 8 14:32:04 2012 +0800 tests/testdisplay.c Remove an uncomfortable error output Signed-off-by: Yi Sun commit 5ba39da67e4bc2a17e2e3d8e8a06386ebc5a5ae8 Author: Paulo Zanoni Date: Mon Aug 6 15:05:28 2012 -0300 lib: add more Haswell PCI IDs Signed-off-by: Paulo Zanoni Reviewed-by: Rodrigo Vivi commit f56a289aa86e591243c07b17d9bdf22e5e82de8a Author: Daniel Vetter Date: Tue Aug 7 14:50:54 2012 +0200 tools/reg_dumper: dump pipe C regs Also reorder the pipe B regs a bit to be consisten with pipe A. commit 81f16261f4d5d2cb1217569cc6580c0326b9eae2 Author: Daniel Vetter Date: Sun Aug 5 21:40:56 2012 +0200 tests/gem_reg_read: actually wait a bit between reading TIMESTAMP reg QA could only hit this on ilk because the timer increase quite a bit slower on that platform than on gen6+ (80ns vs 320ns, iirc). Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=52937 commit 41fe811feb5c79c760f5d2e9fe5d1671f6d71ff8 Author: Yi Sun Date: Thu Jul 26 14:23:36 2012 +0800 tests/testdisplay.c: Add a option '-r'. With the option '-r', the testdisplay could paint a 2-D bar code(QR bar code) on the screen. The word "pass" is hiden in the bar code image. Further more, with this option, testdisplay will wait until a system signal 'SIGUSR1' coming after each mode setting. This function is for another program to control testdisplay. danvet: Fix up the missing static. Signed-off-by: Yi Sun Signed-off-by: Daniel Vetter commit 3b0f80308a033633be6b903fa2a55128dfd99339 Author: Damien Lespiau Date: Wed Jul 25 16:04:32 2012 +0100 build: Make autoreconf honour ACLOCAL_FLAGS When running autoreconf, it's possible to give flags to the underlying aclocal by declaring a ACLOCAL_AMFLAGS variable in the top level Makefile.am. Putting ${ACLOCAL_FLAGS} there allows the user to set an environment variable up before running autogen.sh and pull in the right directories to look for m4 macros, say an up-to-date version of the xorg-util macros. Signed-off-by: Damien Lespiau commit efa5e355ac371d749cf505b952b900d05f25474c Author: Daniel Vetter Date: Tue May 22 19:55:21 2012 +0200 test/flip_test: don't fail if we can't find a crtc some connectors are forced to certain crcs ... commit c832aa1714a47516e6b9402709d66720c464393f Author: Daniel Vetter Date: Mon Jul 23 11:25:47 2012 +0200 tests: fixup prime test paranoia commit 5d9e22366b37b725358d22dbee47e094f7157974 Author: Daniel Vetter Date: Mon Jul 23 10:06:25 2012 +0200 tests/prime: more paranoia - check the old contents first in check_bo - drop all GEM handles for the re-import test commit 796f6193c9697e0ae57970a8c48cc9bb3a69877d Author: Daniel Vetter Date: Mon Jul 23 09:51:12 2012 +0200 tests: add missing stuff to .gitignore Signed-off-by: Daniel Vetter commit 6bc22e3dfd2cf143c2a9abcb72738a1674ce2fc5 Author: Daniel Vetter Date: Mon Jul 23 09:49:06 2012 +0200 tests: add basic re-importing prime test Signed-off-by: Daniel Vetter commit fb748aad4cc8b178801f286e947b251d29764da5 Author: Daniel Vetter Date: Mon Jul 23 06:41:10 2012 +0200 tests: s/drm_reg_read/gem_reg_read gem_ is the prefix for low-level kernel tests, drm_ tests libdrm_intel specific stuff. commit 434be47f12c390659bf0dabd8ebea8ea37f8f26a Author: Daniel Vetter Date: Sat Jul 21 17:36:36 2012 +0200 shut up the compiler a bit Signed-Off-by: Daniel Vetter commit 4c9abd5aa460572899c4890fcc833d57ee025073 Author: Ben Widawsky Date: Sun Jul 22 16:30:04 2012 -0700 reg_read: use good offset, and errno The test was bonghits. Signed-off-by: Ben Widawsky commit 58cfeabb90a9bef742df53e2602966a2166e37b9 Author: Ben Widawsky Date: Wed Jul 18 11:47:42 2012 -0700 reg_read: skip older kernels Signed-off-by: Ben Widawsky commit 4fe786953962d9603d15ea82c97ea5f6e57ba8be Author: Ben Widawsky Date: Wed Jul 11 17:06:01 2012 -0700 reg_read: basic register read ioctl test This will need to get modified when the ioctl expands, and so is only here for reference/to make Daniel happy. Signed-off-by: Ben Widawsky commit d9fb72e26698562367df53909ade0d34520f88f0 Author: Daniel Vetter Date: Fri Jul 13 10:35:11 2012 +0200 tests: improve concurrent blit tests By adding another testcase that follows up with a gpu read. This checks whether the kernel properly tracks the pending write and doesn't lose it (or sync up to the wrong seqno). For some odd reason only the cpu mmap variant blows up, the gtt one works here. I need to look into that some more. Signed-Off-by: Daniel Vetter commit fbd6d0495969ffab5902e3e8e39dc4687806ae0c Author: Ben Widawsky Date: Tue Jul 3 11:04:05 2012 -0700 gem_ctx_basic: fixes I must have checked in the wrong version the first time. Signed-off-by: Ben Widawsky commit e843c55370e85c147b9e4ca9b26cf0902a1b322c Author: Ben Widawsky Date: Tue Jul 3 10:40:32 2012 -0700 ctx_basic: we stopped using rendercopy so get rid of the remants. perhaps we'll use it again someday. Signed-off-by: Ben Widawsky commit cbb3c685b59aeb41a6ce94bc47f0bf255c87df60 Author: Ben Widawsky Date: Sat Jun 30 19:26:59 2012 -0700 rendercopy_gen7: add support for haswell Only compile tested. Signed-off-by: Ben Widawsky commit afcffe783a12472e60d4cd0f2ebdc89e2f5b2def Author: Ben Widawsky Date: Thu Jun 14 11:04:01 2012 -0700 context_basic: the most stressful context test to date. this context test requiring libdrm updates Signed-off-by: Ben Widawsky commit a635a5ac3bb72b8ac13f020b610b71d97499a1fb Author: Ben Widawsky Date: Sun Jan 15 14:52:33 2012 -0800 context: libdrm wrappers This wraps libdrm functionality to exec with contexts. This patch shouldn't be applied until libdrm for contexts is updated. Signed-off-by: Ben Widawsky commit c157e9485e6a96fa359f8236f43475bc2095e1e2 Author: Ben Widawsky Date: Fri Jun 29 11:23:34 2012 -0700 intel: update libdrm requirement We want context APIs in order to use our super context test. Signed-off-by: Ben Widawsky commit beb1bb8fd26b1b1c55242c3b2a3004a346d64b80 Author: Ben Widawsky Date: Thu Jun 28 22:43:47 2012 -0700 gem_stress: use the gen7 rendercopy Signed-off-by: Ben Widawsky commit 2234f87a0852f321a6f85e8fcd6fbb6866f9c944 Author: Ben Widawsky Date: Thu Jun 28 22:42:58 2012 -0700 lib: add a gen7 rendercopy Signed-off-by: Ben Widawsky commit ab0460eaac85fdd66328ccba511519397cea0ddb Author: Ben Widawsky Date: Wed Jun 27 11:13:23 2012 -0700 ctx_bad_destroy: danvet changed to ENOENT In all fairness if the test worked, he would have found this earlier Signed-off-by: Ben Widawsky commit 278e53b5c42f4bf1dcabf82aab2f211e6994ed06 Author: Ben Widawsky Date: Wed Jun 27 11:13:06 2012 -0700 ctx_bad_destroy - ioctl is 2e, not 23 Signed-off-by: Ben Widawsky commit 1136f61298979912e7edfa94a56437f7c9c5499b Author: Ben Widawsky Date: Wed Jun 27 11:07:09 2012 -0700 ctx_bad_destroy: a little more description is nice Signed-off-by: Ben Widawsky commit 76b53ef68d39063c4b0203aa8db2b32dcce1e3b4 Author: Daniel Vetter Date: Tue Jun 26 19:47:30 2012 +0200 tests/gem_wait_rendering_timeout: needs more fudge Due to the way we calculate the workload by doubling it each time we might end up with almost twice as much as we want. Hence increase our fudge by 1.5 to account for that. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50666 commit c6fe31bc473a7ae44bc42bad7da5faca3c924821 Author: Eugeni Dodonov Date: Thu Jun 21 14:31:34 2012 -0300 intel_reg_dumper: use intel_register_access_init/fini We need to hold forcewake lock in order to be able to read GT registers. Otherwise, when the GPU is in RC6 mode, we'll read all zeros. Signed-off-by: Eugeni Dodonov commit f7e356d9cd7795de055a9f3c13bb33f5c9bea01f Author: Ben Widawsky Date: Thu Jun 14 10:00:57 2012 -0700 context tests not requiring libdrm Signed-off-by: Ben Widawsky commit 5a28ef8580a83375fc663b84873c4e18207ed3fb Author: Ben Widawsky Date: Sun Mar 18 18:42:44 2012 -0700 context: update for new execbuf2 element Signed-off-by: Ben Widawsky commit b28a399dcd8d28b6b9bde4baa105f9e78e520122 Author: Eugeni Dodonov Date: Wed Jun 13 15:34:40 2012 -0300 intel_reg_dumper: dump more PM registers Signed-off-by: Eugeni Dodonov commit 34240176c15968e9f25e154d7a1111bb7b0af8af Author: Jesse Barnes Date: Mon Jun 11 12:08:32 2012 -0700 add VLV PCI ID This allows the tests to run on the prototype boards. commit b015a25e897d8b2d79d5938d10e35803ce4dfa2c Author: Daniel Vetter Date: Fri Jun 8 19:35:19 2012 +0200 tests/debgufs_emon_crash: make it quiet commit 9739401fb5806d576f0bc895239e67d86352d417 Author: Daniel Vetter Date: Thu Jun 7 16:37:02 2012 +0200 intel_reg_dumper: dump pre-pch-split blc regs commit 77586dcdf7240aebf29d3d70313dce9d79108147 Author: Chris Wilson Date: Mon Jun 4 17:29:20 2012 +0100 test/gem_gtt_speed: Add a baseline test for the performance of a CPU mmap When looking at the pwrite/pread/wc performance, it is useful to judge that against the performance of an ordinary CPU mmap. Signed-off-by: Chris Wilson Acked-by: Daniel Vetter commit b558877f6e25663ece1242f1e658cf1630d7d7fe Author: Daniel Vetter Date: Thu May 31 15:45:17 2012 +0200 test/sysfs_l3_parity: skip test if the sysfs interface doesn't exist commit 4cf1b02e96b276fcd707d26c9533ab4bfad54739 Author: Daniel Vetter Date: Thu May 31 15:45:17 2012 +0200 test/sysfs_l3_parity: fixup logic It didn't fail properly. commit 55fdd7f1bb4cd5044dbbb4822180a91a9a4c0dd2 Author: Daniel Vetter Date: Thu May 31 13:49:32 2012 +0200 cleanups after l3_parity merge - call it sysfs_l3_parity for more consistency - add .gitignore for intel_l3_parity commit dac1a2cedae1118cfa4ae5a4667cd715487cfcf2 Author: Ben Widawsky Date: Fri May 25 16:56:27 2012 -0700 tests/dpf: simple dpf test Signed-off-by: Ben Widawsky commit 8f7ea34751886ca754e6246a9d400de18c6a972f Author: Ben Widawsky Date: Fri May 25 16:56:26 2012 -0700 tools/dpf: Tool to read and write l3 remap registers. Signed-off-by: Ben Widawsky commit a35dcac0ff7310bc431c14419874e9653d0d2725 Author: Daniel Vetter Date: Wed May 30 20:16:24 2012 +0200 tests/gem_wait_rendering_timeout: check polling behaviour ... with timeout=0. We have special code in the kernel to optimize that one. commit b8e00110a0556fb7edde5dcb3ed0ff3d728c5552 Author: Daniel Vetter Date: Tue May 29 22:23:14 2012 +0200 lib/gem_wait_rendering_timeout: sprinkle busy_ioctl checks While we have that testcase, let's cross-check the busy ioctl. commit bfbe813f8fb587017c4e1d73c51395c2837eb395 Author: Daniel Vetter Date: Tue May 29 22:14:06 2012 +0200 lib: fix gen5 workaround emission Using BEGIN_BATCH can lead to a nice inf recursion through require_space -> flush_batch -> BEGIN_BATCH. Also fix things up to always require BATCH_RESERVED. We need 2 dwords for the gen5 workaround and 2 dwords for MI_BB_END. commit 04dfa492d195e063a07053815ff541b4351b0097 Author: Daniel Vetter Date: Tue May 29 16:52:23 2012 +0200 tests/gem_wait_rendering_timeout: test the timeout case When I've first tried this it somehow failed, but I can't reproduce this any more. I guess I've hunted a ghost. commit b711bfe54f74c6a4337f978e6bef4c47a2f2ea9e Author: Daniel Vetter Date: Tue May 29 16:49:41 2012 +0200 tests/gem_wait_rendering_timeout: fix up the autotuner duuh commit 95877ab9ce137e52128b34acab343273b46404dd Author: Daniel Vetter Date: Tue May 29 16:35:35 2012 +0200 tests/gem_wait_rendering_timout: adjust .gitignore commit 2952feb23f303e0c7afe5ce9c92002abecd7a75f Author: Daniel Vetter Date: Tue May 29 16:35:11 2012 +0200 tests/get_wait_rendering_timeout: fixup the auto-tuner - start at 1 iterations - actually adjust the number of iterations like the comment claims commit cf979c20636814389adcf969c5858a915a97571f Author: Daniel Vetter Date: Tue May 29 16:34:32 2012 +0200 tests/gem_wait_rendering_timeout: some fixes for the blt function - widht/height are in pixel, and the cmd uses 32bit, so we need to adjust this. - we write to the buffer, set the right reloc domain. commit 25bf5574a2252311bf5c0c691e728e8ffd47161e Author: Daniel Vetter Date: Tue May 29 16:23:41 2012 +0200 tests/gem_wait_rendering_timeout: properly skip test also assign the timeout value unconditionally, we want to know it even when we've timeout out. commit f14a045137ea804625439fc7ac3144e46a12d3ae Author: Daniel Vetter Date: Tue May 29 16:14:31 2012 +0200 tests/gem_wait_rendering_timeout: make it compile ... we need to do this libdrm depency dance. Or just copy&paste it. commit 9cfcb75b79829230dc9dde1247a82ffe8b0b9702 Author: Ben Widawsky Date: Fri May 11 13:54:12 2012 -0700 tests/wait render timeout test Assures that signals interrupting the wait works properly. Because of the scheduling around signals, interrupted waits will *seem* faster as the GPU continues to work while all the CPU scheduling stuff happens. Signed-off-by: Ben Widawsky commit c26b5ee72f3a2ac3ddef309e181daab9e5128ae9 Author: Daniel Vetter Date: Fri May 25 11:29:28 2012 +0200 tests: fixup type in module_reload Oops, I've frobbed this to test the check but committed the wrong version. commit 3985d9b976f4daabb9adea38735d9c9b77da7fac Author: root Date: Fri May 25 11:26:53 2012 +0200 tests: add some help to module_reload ... so that it's easier to get the kernel configuration right. commit a628d564709aec0dda98ae71c24bff7cfe9268c0 Author: root Date: Fri May 25 11:02:09 2012 +0200 tests: add module reload testcase We've broken this way too often in the past. commit 2448a75ff6127a03404e659a5e1046236eef41d4 Author: Daniel Vetter Date: Wed May 23 11:37:04 2012 +0200 tests/hangman: fix when run with absolute path QA's test rig does that. commit 96c2fc82ba0be6c0e1ae8f675ccc97714aa08e11 Author: Daniel Vetter Date: Tue May 22 19:54:22 2012 +0200 test/flip_test: fail harder We want testcase to return non-zero if they fail ... commit 17787f30c6f05edb40da1a1fc0074bee2e09e779 Author: Daniel Vetter Date: Tue May 22 16:15:15 2012 +0200 lib: extract kmstest_dump_mode commit b7aa6756ce770f44280e1369dd7fbf9761f3cdb7 Author: Daniel Vetter Date: Tue May 22 16:01:32 2012 +0200 test/flip_test: use kmstest_create_fb And bring back some frame indication that actually works. commit 662d73219976ca820f878f63b5222e22e17c6328 Author: Daniel Vetter Date: Tue May 22 14:37:19 2012 +0200 lib: extract kmstest_create_fb We should get more kms tests soon, and not needing to copy-paste a nice test pattern should be useful. That establishes a firm depency of i-g-t on cairo over everything, but I don't care so much about that. Signed-Off-by: Daniel Vetter commit 0732cc59abc06151b8756a6890f13885cde7403b Author: Daniel Vetter Date: Tue May 22 12:01:36 2012 +0200 tests: use drm_open_any more And fix it up to not leak open fds, which kills all the master only stuff. commit a5e6897d10962e4bdfa657ce704bc111a4a4c663 Author: Daniel Vetter Date: Tue May 22 10:57:17 2012 +0200 tests/flip_test: rip out usage Totally useless if the only option is "-h" commit 1fedd1db41bfe1815654a726480e430591db344d Author: Daniel Vetter Date: Tue May 22 10:53:38 2012 +0200 tests: add flip_test to .gitignore commit 9e620146f704549c7203632f63571d22a9551de3 Author: Daniel Vetter Date: Tue May 22 10:51:29 2012 +0200 tests/flip_test: rip out funny pictures The path isn't properly autodetected and it yells stupid stuff into stderr. Which causes spurious failures. And really, these are automated tests. If you need to look at the output, something is wrong. Signed-off-by: Daniel Vetter commit 984e44f88bad9b39bd5bb9c449f6bfb0580660ae Author: Paulo Zanoni Date: Fri Apr 27 16:14:34 2012 -0300 intel_infoframes: options -p and -P require an argument Signed-off-by: Paulo Zanoni commit e6b264cce7799d822bc8a1b0e493cf5dee112f85 Author: Eugeni Dodonov Date: Wed May 16 10:14:55 2012 -0300 intel_gpu_top: allow to work on Gen7 Somehow nobody noticed this before, but we were missing blt and bsd6 initialization on Gen7. Reported-by: Philippe Lecluse Signed-off-by: Eugeni Dodonov commit 544e35785198045d76d8f11ee414c7f1661ffc77 Author: Daniel Vetter Date: Thu May 10 20:25:33 2012 +0200 tests/gtt_speed: try to outwit gcc It optimized away the read loops ;-) Also fix up the size to not be 1/4th of the one we want for tiled buffer tests. Signed-Off-by: Daniel Vetter commit 78c38dcddb79052a964081c470bb2641fb3daf95 Author: Chris Wilson Date: Wed May 9 14:06:28 2012 +0100 tests/gem_tiled_pread_pwrite fix progname for pretty print progress Signed-off-by: Chris Wilson commit 412e7b341f40a2d21067c7059a64e500945d6433 Author: Chris Wilson Date: Wed May 9 13:50:53 2012 +0100 intel_error_decode: Be more lax for whitespace around parsing PCI-ID Signed-off-by: Chris Wilson commit 3986d9faf343639dc9ceec23e880a99f4fcea365 Author: Eugeni Dodonov Date: Tue May 8 15:55:05 2012 -0300 tools: add Haswell registers into intel_reg_dumper For now, only print their content for diffing, but also add the necessary bits that can be used for more verbose output in the fugure. Signed-off-by: Eugeni Dodonov Signed-off-by: Daniel Vetter commit e70b7de8cea142a7aa2b4c08cdbd7484d7b39e14 Author: Jesse Barnes Date: Mon May 7 12:57:05 2012 -0700 tests/flip_test: test on each CRTC for each detected output This allows us to test on 3 pipe configs for example. commit 362599ac1042eeca52ebbfca646a975a989ff38f Author: Jesse Barnes Date: Mon May 7 12:36:28 2012 -0700 tests: add simple flip test Add a simple flip test to test flipping on a single output with the preferred mode. TODO: test each crtc for 3s and print pass/fail results commit c6f42f4cca10cb644c7f91d1fd3e625dba505eb0 Author: Ben Widawsky Date: Sat Apr 28 20:10:09 2012 -0700 intel_infoframe: fix assertion off by 1 this makes my compiler very unhappy Signed-off-by: Ben Widawsky commit 43fda53199afba7788549d4d290bb0874459fa2d Author: Ben Widawsky Date: Sat Apr 28 20:07:40 2012 -0700 chipset: accidentally left the old IS_GEN7 macro Signed-off-by: Ben Widawsky commit 97198ccbe1546e0249c3a7885d778e46cb538877 Author: Daniel Vetter Date: Fri Apr 27 14:08:34 2012 +0200 test/ZZ_hangman: adjust to new error_state reset semantics Signed-Off-by: Daniel Vetter commit 9898083fa2841a73227515cbe2659c99f353db95 Author: Paulo Zanoni Date: Tue Apr 24 18:10:25 2012 -0300 intel_infoframes: add support for Gen 4 Signed-off-by: Paulo Zanoni Signed-off-by: Daniel Vetter commit 0611af4a33e443767ce2bdadac08f6f0680dbb9e Author: Paulo Zanoni Date: Tue Apr 24 18:10:24 2012 -0300 intel_infoframes: AVI InfoFrame version should be 2 Signed-off-by: Paulo Zanoni Signed-off-by: Daniel Vetter commit 4d053f97db7759c51c2299b401e166b09efad87e Author: Ben Widawsky Date: Wed Apr 25 13:33:17 2012 -0700 chipset updates Signed-off-by: Ben Widawsky commit bb40c7e8df2183449e6e252556b9c176d516caeb Author: Daniel Vetter Date: Wed Apr 25 13:21:38 2012 +0200 test: fix up hangman script and enable by default Signed-Off-by: Daniel Vetter commit cf72da57dcc1baeaaff71250a82b40ab324b7590 Author: Daniel Vetter Date: Sun Apr 22 12:35:23 2012 +0200 tests: add gem_unfence_active_buffers Unfortunately this requires slab poisoning to catch anything :( Also add a new helper to drmtest to get the available fence count. Signed-off-by: Daniel Vetter commit 19a28d06ad6555ae36797f64e3705d373822faf7 Author: Chris Wilson Date: Thu Apr 19 14:11:51 2012 +0100 lib: Fix render copy on gen2 commit 7e9676143cd5c7e44b310fa3bce8da5d1cdf21e8 Author: Daniel Vetter Date: Thu Apr 19 12:34:16 2012 +0200 tests/gem_ringfill: add progress indicator This thing takes ages on older chips. Signed-Off-by: Daniel Vetter commit 127d76d51c00fa1693053d126f8045b1efa7f07a Author: Daniel Vetter Date: Tue Apr 17 22:38:44 2012 +0200 tests: re-enable commented-out testcase Meh, I suck. Signed-Off-by: Daniel Vetter commit 16bc61993915ab39136407d82e3468d8840b6a28 Author: Daniel Vetter Date: Tue Apr 17 22:02:33 2012 +0200 tests: add gem_set_tiling_vs_pwrite Signed-off-by: Daniel Vetter commit 2f4bc72da76afac4dc708a0c70ca9e32522b1f83 Author: Daniel Vetter Date: Tue Apr 17 18:01:48 2012 +0200 tests/gem_set_tiling_vs_gtt: update copyright header Meh, I've forgotten these. Signed-Off-by: Daniel Vetter commit ff6abb313d975850c0f333f308d6c09e636cd907 Author: Daniel Vetter Date: Tue Apr 17 17:25:24 2012 +0200 tests: add gem_set_tiling_vs_gtt Signed-off-by: Daniel Vetter commit 48ec7f9edd7a1bfe01a158a2a3ba85667f29030f Author: Daniel Vetter Date: Tue Apr 17 13:25:04 2012 +0200 tests/gem_set_tiling_vs_blt: fix on gen4+ Oops, the new checks need correctly tiled blts to work. Signed-Off-by: Daniel Vetter commit b38188ad97571f9145407e9bf3bd6a32a51ce87d Author: Daniel Vetter Date: Sun Apr 15 23:59:12 2012 +0200 tests: rename gem_tiled_after_untiled_blt into gem_set_tiling_vs_blt ... it checks much more now. Also update the comments a bit in the testcase. Signed-off-by: Daniel Vetter commit 887e4a58b9b697e7c8545123008a350864311c2c Author: Daniel Vetter Date: Sun Apr 15 23:40:20 2012 +0200 tests: pimp tiled_after_untiled_blt Now with more tiling transition tests. Changes: - refactoring to reuse the tiling transition functions. - add a tiled->untiled transition - add a tiled->tiled transition with different stride - add a check at the end to ensure that the tiling has indeed changed on the test_bo Signed-Off-by: Daniel Vetter commit fd585207961f9916e1603852a703d6c656604656 Author: Paulo Zanoni Date: Fri Apr 13 10:27:01 2012 -0300 Add tools/intel_infoframes This is a command-line tool that allows us to display and modify the InfoFrames we send. v2: use argv instead of stdin Signed-off-by: Paulo Zanoni Signed-off-by: Daniel Vetter commit de9d98bb6e8736907458a28921aee5fcc507ca6d Author: Daniel Vetter Date: Thu Apr 12 23:12:24 2012 +0200 tests: skip rc6_residency test if not supported Fixes spurious failures. Signed-Off-by: Daniel Vetter commit 5ce86f88a0a9b24564a6349a70de5797b814b108 Author: Chris Wilson Date: Thu Apr 12 15:47:00 2012 +0100 Use mmap64() for performing the GTT mapping Although the address space for GTT mappings may only be 32-bits, we need to use the explicit 64-bit mmap interface so that on a 32-bit platform the offset we pass is not truncated to 31-bits. Fixes gem_mmap_offset_exhaustion on 32-bit platforms. Signed-off-by: Chris Wilson commit 8f6ebd4ac03f7c3c751d4d6bb4096d0285e34517 Author: Daniel Vetter Date: Wed Apr 11 15:28:26 2012 +0200 tests: add gem_gtt_concurrent_blit Same test as Chris Wilson's gem_cpu_concurrent_blit, but for gtt mmaps. Signed-off-by: Daniel Vetter commit 0448eefeb2f6971f9f74fb83972fa327d3255415 Author: Daniel Vetter Date: Wed Apr 11 15:02:32 2012 +0200 tests: add sysfs_rc6_residency to .gitignore commit ee014dbb8d98ada16a4829ff9878af6d4a06dcad Author: Daniel Vetter Date: Wed Apr 11 14:55:30 2012 +0200 tests/sysfs_rc6_residency: add some sleep before testing That way I can run i-g-t on my ivb without spurious failures. Signed-Off-by: Daniel Vetter commit f841f4028ca37c3e4b49240b7f999dd07709724c Author: Ben Widawsky Date: Sat Mar 24 19:04:10 2012 -0700 tests: rc6 residency test This is meant to test the sysfs entry for showing rc6 residency in milliseconds. Remember, sysfs is a permanent interface. v2: use new get_card interface to try "all" devices check rc6p and rc6pp in addition to rc6 v3: rename rc6_residency.c to sysfs_rc6_residency.c print better error messages skip test if rc6 isn't enabled v4: update to new sysfs names Acked-by: Daniel Vetter Signed-off-by: Ben Widawsky commit 2585bea428801c5542bc62d75d0d5c1ee71ff739 Author: Ben Widawsky Date: Sun Mar 25 16:04:07 2012 -0700 drm/i915: extract card getting Signed-off-by: Ben Widawsky commit 8af53e0b7e2f99ead129822f3761c618f775f7e2 Author: Ben Widawsky Date: Sat Mar 24 19:03:38 2012 -0700 build: make sure we have asprintf Signed-off-by: Ben Widawsky commit b78243fc61bd46624931f149d00e4a78242e9c92 Author: Chris Wilson Date: Tue Apr 10 19:41:43 2012 +0100 test/gem_cpu_concurrent_blit: Limit memory usage to half aperture So that we don't cause needless thrashing on older devices and spoil the test. commit da026d8bfef1a76a60ae4a46a738ce153e9fe0b7 Author: Chris Wilson Date: Tue Apr 10 18:21:33 2012 +0100 test: Exercise concurrent GPU read/write with CPU domain access Designed to exercise this patch to i915.ko: diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index fbf1118..57ae1f2 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@ -3181,9 +3181,11 @@ i915_gem_object_set_to_cpu_domain(struct drm_i915_gem_obj if (ret) return ret; - ret = i915_gem_object_wait_rendering(obj); - if (ret) - return ret; + if (write || obj->pending_gpu_write) { + ret = i915_gem_object_wait_rendering(obj); + if (ret) + return ret; + } i915_gem_object_flush_gtt_write_domain(obj); By exercising the conditions whereby should either of the checks be missed an error is detected. commit 7601fafbcffe1c6da5351682bd6febe5fa248f16 Author: Daniel Vetter Date: Tue Apr 10 16:23:18 2012 +0200 tests: explicit use bash We use bashisms, which debian's default sh dash doesn't like. Signed-Off-by: Daniel Vetter commit af275bd52197cb41e6beb83dc496a50666b48814 Author: Ben Widawsky Date: Tue Apr 3 23:02:59 2012 -0700 tests: add wedging tests Used to check that i915_error_state works. Unfortunately this kills the gpu because wedging is permanent. Base on a patch by Ben Widawsky. Signed-off-by: Daniel Vetter commit bb86947638b7471c4e3da5dd32b756b0c7d504ae Author: Daniel Vetter Date: Wed Apr 4 11:07:44 2012 +0200 tests: fixup drm_lib.sh sourcing Signed-off-by: Daniel Vetter commit e63f1870b47073852c82f02e29b57dbb66b72d0d Author: Daniel Vetter Date: Wed Apr 4 10:56:50 2012 +0200 tests: use / as path separator instead of _ Oops. Originally by me, noticed while reviewing Ben Widawsky's patch. Signed-Off-by: Daniel Vetter commit 888df75a0cc3e6eea485ae3189afde2d86486750 Author: Ben Widawsky Date: Tue Apr 3 23:02:58 2012 -0700 tests: use common code for scripts This removes cut and pasted code and uses a more central source. Signed-off-by: Ben Widawsky Signed-off-by: Daniel Vetter commit b7bd1837ccc980666f5502fbd428d3a4be3cd26f Author: Chris Wilson Date: Thu Mar 29 12:45:59 2012 +0100 Make the assertions guarding syscalls (drmIoctl in particular) verbose Currently all we see is gem_read: ret == 0 failed, where it would help to see the errno and/or the ret. Signed-off-by: Chris Wilson commit 9dbce0991f4eb353ab892c88299bbebf2cb1a285 Author: Daniel Vetter Date: Sat Mar 24 19:30:29 2012 +0100 tests: use gem_create and gem_close more Signed-Off-by: Daniel Vetter commit ff93f351512a194dd3d32e643c7987b5fe2347a5 Author: Daniel Vetter Date: Sat Mar 24 19:22:21 2012 +0100 tests/gem_fence_thrash: make some good use of drmtest helpers Signed-Off-by: Daniel Vetter commit 11fa35850306172b0e2285a919172c02671dd815 Author: Daniel Vetter Date: Sat Mar 24 19:17:43 2012 +0100 tests/gem_exec_faulting_reloc: kill superflous mmap_bo Signed-Off-by: Daniel Vetter commit c34e48119939fa30809a58a9991ae18539824892 Author: Daniel Vetter Date: Fri Mar 23 19:28:08 2012 +0100 tests: add gem_tiled_after_untiled_blt Signed-Off-by: Daniel Vetter commit afbdc7af8d9324ae065c47d6122bb020c579fd0a Author: Daniel Vetter Date: Thu Mar 22 13:47:57 2012 +0100 tests: adapt storedw tests to ppgtt MI_MEM_VIRTUAL actually means use global gtt now, not setting the bit means use ppgtt. On previous gens, not setting the bits ment 'use physical memory'. So what, the usual confusion. Note that for some odd reasong this is broken on gen6, but only on the bsd ring. Unexpected. Signed-Off-by: Daniel Vetter commit 9e531888ed0c3e34303a67e324ea4ab29057c62b Author: Daniel Vetter Date: Thu Mar 22 12:27:43 2012 +0100 tests: don't just bail out when there's not enough RAM ... but actually run the test with reduced memory requirements, as the messages claims. Additional print it to stdout, stderr seems to imply FAIL in our QA's testing rig. Signed-off-by: Daniel Vetter commit 16c4f52782e0df88f818dadd4586ea99ccf992d5 Author: Daniel Vetter Date: Tue Mar 20 14:24:14 2012 +0100 tests: add gem_mmap_offset_exhaustion This also adds a gem_madvise helper to lib/drmtest.c Signed-off-by: Daniel Vetter commit c4ae3bc41204c83a89369af91217daa33fff9675 Author: Daniel Vetter Date: Tue Mar 20 14:25:56 2012 +0100 update .gitingore commit f4908880f3b91caab1fffbbd17c3e0bc432f71d1 Author: Daniel Vetter Date: Tue Mar 20 14:03:18 2012 +0100 intel_sprite_on: kill overtly verbose and totally content-free comments /me just hates fluff Signed-off-by: Daniel Vetter commit 42b20d4ab97363f18c7c05cf69fe9b06ddead27f Author: Daniel Vetter Date: Tue Mar 20 14:00:55 2012 +0100 intel_sprite_on: remove copy&pasted gem functions Can we just please stop this? Signed-off-by: Daniel Vetter commit 3928569eede8ca5f2e9ee1fa4e7fb9989956b2a9 Author: Chris Wilson Date: Mon Mar 19 14:25:13 2012 +0000 intel_gpu_top: Trust the register access is safe Fixes intel_gpu_top on gen3 which otherwise refuses to do mmio. Signed-off-by: Chris Wilson commit bf6c480d6ddc157713f839af314ea4892bf8f867 Author: Chris Wilson Date: Mon Mar 19 14:24:22 2012 +0000 decode: Use the correct start mask for gen3 fence registers A cut'n'paste error from gen2 apparently. Signed-off-by: Chris Wilson commit d364c280892af29956ad7032b0d242b7d24d7846 Author: Chris Wilson Date: Wed Mar 14 10:59:51 2012 +0000 configure: Add AC_SYS_LARGEFILE for mmap64 support on 64-bit Without enabling largefile support the prototype for mmap64() is broken on Linux/x86_64 with the result being a 32-bit integer sign-extended to fill a 64-bit pointer. Hilarity ensues. commit be7ca950d7d4d18744a76abab091eb032835fb82 Author: Eugeni Dodonov Date: Tue Feb 28 17:40:32 2012 -0300 intel_reg_read: add a flag to simplify bit decoding This allows to specify '-d' parameter which will decode individual bits in each register being read. The register bits are printed horizontally for space reasons. This requires more than 80x25 terminal to see them all. An alternative solution would be to print them vertically, but this will become much more difficult to read when printing multiple registers at the same time. v2: fix spacing to get us a bit closer to the code nirvana. Signed-off-by: Eugeni Dodonov commit 8d4545642835cb66f84739b9384f31920feacdba Author: Eugeni Dodonov Date: Tue Feb 28 17:33:54 2012 -0300 intel_reg_read: support reading multiple registers The registers must be passed on the command line and will be read sequentially, one at a time. Signed-off-by: Eugeni Dodonov commit b7464e4032a181fc743fe531c6ea271c099b9a74 Author: Eugeni Dodonov Date: Tue Feb 28 17:20:35 2012 -0300 intel_reg_read: add support for getopt This will allow us to pass more options to it in the future. v2: fix whitespacing issues and improve scary warning text as suggested by Paul Menzel. Reviewed-by: Paul Menzel Signed-off-by: Eugeni Dodonov commit 628ad0c91bad85f48a34ae7cefd53e686f99a3a8 Author: Daniel Vetter Date: Wed Feb 29 20:22:45 2012 +0100 tests: some more tuning on the tiled partial pwrite/pread test ... 8 pages is just not enough to somewhat reliably get one page that needs bit17 swizzling. Signed-Off-by: Daniel Vetter commit dac239e2b694f5f187ae0af9aeb339e3b57a51a1 Author: Daniel Vetter Date: Wed Feb 29 17:36:04 2012 +0100 tests/gem_tiled_partial_pread/write: fixes Astonishing how dense I sometimes am ... - increase the bo size so that we don't have any round-up to next tile size areas (which the 2d blit go over, but the 1d pread/pwrite calls will notice). - correctly set tiling bits when copying back to a linear buffer. - read back through a tiled bo to avoid messing with swizzling. Signed-Off-by: Daniel Vetter commit f1d32d541dc8328a0f55224915906f23b58062a0 Author: Daniel Vetter Date: Wed Feb 29 15:57:30 2012 +0100 tests: add tiled partial pwrite/pread test And indeed, this blows up. Signed-off-by: Daniel Vetter commit a50550f22341aa4ee17110ecc68953829ba0153e Author: Chris Wilson Date: Tue Feb 28 09:31:17 2012 +0000 lib: Downgrade error for unknown 'swap' not 'ram' Oops, my mistake for copying a compile fix from another machine... If we can't detect how much RAM we have, 0 is not a suitable default, so keep the error for the time being and only downgrade the error for unknown swap. Signed-off-by: Chris Wilson commit 2035119201b4c63fe84d3883ae1b1c058bcc862c Author: Chris Wilson Date: Tue Feb 28 09:29:11 2012 +0000 lib: Downgrade error for failing to determine swap interface to a warning If we can't detect how much swap is available, presume none. Signed-off-by: Chris Wilson commit 1e74007b4c7c05f0b157b16acc2b9605002fe2ba Author: Jesse Barnes Date: Mon Feb 27 12:50:50 2012 -0800 testdisplay: remove unnecessary passing of width, height, stride, depth These are globals, no need to shadow them everywhere. commit ea4163395e95951bd73b14316a0b28eac0475aaa Author: Jesse Barnes Date: Mon Feb 27 12:46:11 2012 -0800 testdisplay: remove plane test support This is better done in intel_sprite_on and was broken anyway. commit 488daaa40bdf45f4cdcc9f516148dc1fd3b6a0bd Author: Daniel Vetter Date: Wed Feb 22 10:58:39 2012 +0100 demos/intel_sprite_on: build warning fixes ... from Armin Reese. Signed-Off-by: Daniel Vetter commit ace4a6e0e99841aec7199fe00795ddb35dfb24d1 Author: Daniel Vetter Date: Wed Feb 22 10:50:52 2012 +0100 tests/gem_ringfill: shut up the compiler Double-include ftl and local variable shadowing. While fixing the later I've noticed that we mix up width and height in the blt copy function. Signed-Off-by: Daniel Vetter commit fa6c2757feb18b17120310fe315ed32594ff326c Author: Chris Wilson Date: Mon Feb 20 22:53:26 2012 +0000 tests/gem_ringfill: Exercise all rings On SandyBridge, the BLT commands were split from the RENDER commands as well as the BSD split inherited from Ironlake. So we need to make sure we do exercise each ring, and in order to do so we also need to make sure each batch takes longer to execute than it takes for us to submit it. v2: Exercise each ring sequentially. Signed-off-by: Chris Wilson commit 5cf555868214ac6d55d8102d3198813aadc37853 Author: Eric Anholt Date: Mon Feb 20 10:04:02 2012 -0800 gem_ringfill: Make this actually test that all the batches executed. I was looking into some strange behavior in Mesa that looks like batches maybe being skipped, but this test didn't catch it. commit 732547793f22c873e3bc68c9c164937cb2ec2da9 Author: Eric Anholt Date: Mon Feb 20 10:04:01 2012 -0800 intel_reg_dumper: Add dumping of GPU turbo regs. I was interested in finding why my IVB system is not getting GPU turbo after suspend/resume. The piece that looks weird to me is that INTERRUPT_THRESHOLD is sitting at 0, whereas pre-suspend it's 0x12000000. commit 6624325f13e48e13f3c6d95f374437b151afbe12 Author: Eric Anholt Date: Mon Feb 20 10:04:00 2012 -0800 reg_dumper: Refactor duplicated reg-dumping code. commit 3e0bd266d29c74fb4e5d19d24e8c9853c0da90eb Author: Eric Anholt Date: Mon Feb 20 10:03:58 2012 -0800 instdone: Fix fallthroughs to invalid instdone bits on newer hardware. commit 4fc909fd4881eec38d46be5db9e023e07d53c33c Author: Eric Anholt Date: Mon Feb 20 10:03:59 2012 -0800 instdone: Add support for one of the IVB instdone regs. [danvet: added GAM and GAFM bits.] commit 8bedcae848332e9dd3425765682a7f71eb1339f0 Author: Daniel Vetter Date: Thu Feb 16 12:26:23 2012 +0100 tests/intel_reg_dumper: s/pipe/disp_pipe/ to shut off the compiler Signed-Off-by: Daniel Vetter commit 3b65f179f2acbf8f2c4372f1cea14069b0d3375c Author: Paulo Zanoni Date: Wed Feb 15 16:04:28 2012 -0200 Add intel_panel_fitter tool The tool allows you to change the panel fitter settings, so you can change the size of the screen being displayed on your monitor without changing the real pixel size of your desktop. The biggest use case for this tool is to work around overscan done by TVs and some monitors in interlaced mode. v2: reviews by Ben, Chris and Rodrigo - don't install - use intel_register_access_init - check for maximum X and Y values - add a disclaimer saying this is not the real solution - print less when pf is disabled and option '-l' is used Signed-off-by: Paulo Zanoni Signed-off-by: Daniel Vetter commit ecad594e0254648a3bf2d995569afd18dbb75ec2 Author: Paulo Zanoni Date: Wed Feb 15 16:04:00 2012 -0200 reg_dumper: change and fix behavior when using dump files Before this patch, handling dump files was wrong: - when HAS_PCH_SPLIT was specified, intel_reg_dumper segfaulted inside intel_check_pch() - the "devid" variable was used but not set - there was no way to specify the device id of the machine used to generate the dump file This patch fixes this behavior with the following changes: - the HAS_PCH_SPLIT variable is gone - there is now a '-d' argument that can be used to specify the device id used to interpret the results - when a dump file is used but the '-d' argument is not provided, an Ironlake machine is assumed Signed-off-by: Paulo Zanoni Signed-off-by: Daniel Vetter commit ad87b06fd6a5af4836562c1d318ca06a918d5466 Author: Paulo Zanoni Date: Wed Feb 15 16:03:09 2012 -0200 reg_dumper: add interlaced information to TRANSCONF Signed-off-by: Paulo Zanoni Signed-off-by: Daniel Vetter commit 3310db08d874d696241b84aceb9380e8e17d6e9e Author: Paulo Zanoni Date: Wed Feb 15 16:02:27 2012 -0200 reg_dumper: add interlaced and rotation information to PIPECONF Signed-off-by: Paulo Zanoni Signed-off-by: Daniel Vetter commit 27d1cef2d32cf1ef6904e672152364240d634ef8 Author: Daniel Vetter Date: Wed Feb 15 17:50:57 2012 +0100 tests: fixup storedw tests We need to use _INSTRUCTION as the reloc domain because otherwise the ppgtt pipe_control w/a for snb won't kick in and the test fails. The storedw tests for blt and bsd are still disabled because the corresponding patch to flag ppgtt support isn't merged upstream yet. Without ppgtt these hang my snb here. Signed-Off-by: Daniel Vetter commit 1d16f7934df06d4b4feee083096575ef0c4f2340 Author: Daniel Vetter Date: Wed Feb 15 17:43:38 2012 +0100 test/gem_tiled_pread_pwrite: add progress indicator Signed-Off-by: Daniel Vetter commit 24c8d2f112853a41cd9d5077c86e41ed62663a09 Author: Daniel Vetter Date: Sun Feb 12 12:14:27 2012 +0100 remove old .c files Oopps, I've forgotten about this in commit 9b32894937af27f9ba95ea572ac857d376fe9034 Author: Daniel Vetter Date: Sat Feb 11 16:52:26 2012 +0100 prepend 'intel_' to installed programms Signed-Off-by: Daniel Vetter commit e1ddd1c8e0ec947906b528315cdc7b9f64ae3d9b Author: Daniel Vetter Date: Sat Feb 11 16:54:58 2012 +0100 lib/drmtest: fixup copy&paste printf format issue Signed-Off-by: Daniel Vetter commit 9b32894937af27f9ba95ea572ac857d376fe9034 Author: Daniel Vetter Date: Sat Feb 11 16:52:26 2012 +0100 prepend 'intel_' to installed programms Signed-off-by: Daniel Vetter commit 6cfd16648d8d229c4ab474e4beff1cc131287238 Author: Kenneth Graunke Date: Fri Feb 10 22:19:16 2012 -0800 Remove pointless Android ifdefs for sys/fcntl.h. On my system, sys/fcntl.h contains exactly one line: #include So there's really no need to #ifdef it. Also, intel_mmio.c already included ; there's no need to include it twice. Signed-off-by: Kenneth Graunke Signed-off-by: Daniel Vetter commit b39a74ba4ef36889465b03c93d3d4940b21af465 Author: Sateesh Kavuri Date: Mon Feb 6 15:37:04 2012 +0530 Added support for Android Added the Android.mk file as per Android make system. Also had to modify the headers with the proper location for fcntl.h as per the Android bionic headers location Signed-off-by: Sateesh Kavuri Signed-off-by: Daniel Vetter commit 2065ca15fb5a5a5c4079f6c0cb6361a4052e4fdb Author: Daniel Vetter Date: Thu Feb 9 22:39:50 2012 +0100 Release 1.2 commit 06bfa3d3870521a595beb280f5f91c07422f189e Author: Daniel Vetter Date: Thu Feb 9 22:32:54 2012 +0100 lib/rendercopy: fixup make distcheck And complete the gem_stress->rendercopy rename that I've forgotten about. Signed-off-by: Daniel Vetter commit 042f40eda776aec56c4d39d4e47033117a85415e Author: Alan Coopersmith Date: Wed Feb 8 17:04:45 2012 -0800 Fix program name in intel_bios_dumper.man SYNOPSIS Signed-off-by: Alan Coopersmith commit 90a6f75dd284e4527e6583a519da5b634f8b469d Author: Kenneth Graunke Date: Wed Feb 8 12:05:05 2012 -0800 Update generation checks to provide basic support for Ivybridge. There may be some updates required, but assuming Ivybridge is similar to Sandybridge is a decent start; previously it fell through to the Gen2/3 case and nothing worked. Signed-off-by: Kenneth Graunke Reviewed-by: Ben Widawsky Signed-off-by: Daniel Vetter commit 6fe3884bc97b7c9ad5cdcbc9144cb7319341eb75 Author: Daniel Vetter Date: Wed Feb 8 16:46:57 2012 +0100 add sprite demo from Armin Reese Also fixed up the copyright header a bit. No comments on the coding styled used ;-) Signed-off-by: Daniel Vetter commit e61b917134527500c08900f5f71d996a9cbc5735 Author: Alan Coopersmith Date: Sat Feb 4 09:05:08 2012 -0800 Move free(cmd) to after last use of cmd in intel_gpu_top Error: Use after free (CWE 416) Use after free of pointer 'cmd' in call to fprintf at line 496 of tools/intel_gpu_top.c in function 'main'. Previously freed at line 491 with free. [ This bug was found by the Parfait 0.4.2 bug checking tool. For more information see http://labs.oracle.com/projects/parfait/ ] Signed-off-by: Alan Coopersmith Signed-off-by: Daniel Vetter commit 3d46ca8c4d43adfd9827b4b21648a4fddd03c254 Author: Yi Sun Date: Fri Feb 3 22:45:39 2012 +0800 tests/testdisplay.c: rewite function dump_connectors and dump_crtcs. Replace the globe variable drm_fd with local variable passed from parameter. Signed-off-by: Yi Sun [danvet: fixup whitespace] Signed-off-by: Daniel Vetter commit 4cceae74e3f18b78db5049edb0fc3d6d89b66275 Author: Yi Sun Date: Fri Feb 3 19:23:55 2012 +0800 tests/testdisplay.c: Fix the black screen issue while force mode. Replace the 8 globe force mode variables with a struct drmModeInfo variable. Next step, we could reduce the number of globe veriables, to be convenient to call the functions. Signed-off-by: Yi Sun Signed-off-by: Daniel Vetter commit 36a40a5423247651bb51d8ad9bfdd0528cd79634 Author: Daniel Vetter Date: Tue Jan 31 13:52:59 2012 +0100 gem_partial_pwrite_pread: add progress indicator Without optimized pread/pwrite this test takes forever. Signed-Off-by: Daniel Vetter commit 611e0cb333b9c0c55985b5d40d7c0c76e15b343b Author: Daniel Vetter Date: Fri Jan 27 18:50:21 2012 +0100 intel_reg_dumper: add TRANS_VSYNCSHIFT Signed-Off-by: Daniel Vetter commit 6b6b13906a22d7d1f0205a6a44b6c760b4c3fe97 Author: Ben Widawsky Date: Wed Jan 25 21:05:15 2012 -0800 intel_reg_write: use register access init/fini This will do the proper forcewake stuff. Signed-off-by: Ben Widawsky commit 6e3066c9c3c4443cf63e0efbb3d9d0906d58b5b4 Author: Ben Widawsky Date: Wed Jan 25 21:05:15 2012 -0800 intel_reg_read: use register access init/fini This will do the proper forcewake stuff. Signed-off-by: Ben Widawsky commit 4c20525b7f50fa0c0bb5579d49f7bc4907698da0 Author: Ben Widawsky Date: Wed Jan 25 21:04:16 2012 -0800 mmio: refactor reg init/fini Rearrange register access init and fini so that we properly accomodate platforms without forcewake. Signed-off-by: Ben Widawsky commit 802bd74c5f9526faccfdf168b06c0c2c44237840 Author: Ben Widawsky Date: Sun Jan 15 13:41:42 2012 -0800 i-g-t: silence -Winline In this case, the code already has a comment about the problem. We don't need to flood the build with this less than useful message. Signed-off-by: Ben Widawsky commit 1ffe6b0ee8decc02edb48ab197a869e1d7783a2b Author: Chris Wilson Date: Wed Jan 25 10:11:49 2012 +0000 intel_bios_reader: Sanitize input to ensure all data blocks are within bounds Running intel_bios_reader upon itself causes the reader to crash and burn. It obviously finds a VBT signature inside the binary, but then does not rigorously check that all data blocks are valid before dereferencing them. Reported-by: Emanuel Bronshtein Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45205 Signed-off-by: Chris Wilson commit 93a65895bb775932b02a3de692a1262ef7fafdbc Author: Daniel Vetter Date: Tue Jan 24 23:18:21 2012 +0100 drmtest: add progress indicator Some test that trash the aperture necessarily need to take forever, so add a little progress indicator to keep worried minds at peace. Signed-Off-by: Daniel Vetter commit 7492f97cde0a0b86b307637858c1d5efbadd2d06 Author: Daniel Vetter Date: Tue Jan 24 18:05:11 2012 +0100 tests: add gem_cs_prefetch Tested-by: Chris Wilson Signed-off-by: Daniel Vetter commit ca10c7231da5fe00be52c6d5be2d053637c07467 Author: Daniel Vetter Date: Tue Jan 24 21:41:17 2012 +0100 intel_error_decode: fixup glibc free warning Usually some random stack garbage doesn't equal some other random stack garbage, leading to the filename != path check succeeding. Signed-off-by: Daniel Vetter commit fbae13899013491fa78499ba27641c2fadef1fb0 Author: Alan Coopersmith Date: Mon Jan 23 20:13:49 2012 -0800 Add Solaris implementation of intel_get_total_swap_mb() Signed-off-by: Alan Coopersmith Signed-off-by: Daniel Vetter commit 5c4e041dc8bea5cc32e37ab8fce09ac7f4ede135 Author: Alan Coopersmith Date: Mon Jan 23 20:13:48 2012 -0800 Make benchmarks also link against libpciaccess Fixes Solaris build error on build of intel_upload_blit_large: Undefined first referenced symbol in file pci_device_probe ../lib/.libs/libintel_tools.a(intel_pci.o) (symbol belongs to implicit dependency libpciaccess.so.0) pci_system_init ../lib/.libs/libintel_tools.a(intel_pci.o) (symbol belongs to implicit dependency libpciaccess.so.0) pci_device_find_by_slot ../lib/.libs/libintel_tools.a(intel_pci.o) (symbol belongs to implicit dependency libpciaccess.so.0) ld: fatal: symbol referencing errors. No output written to intel_upload_blit_large Signed-off-by: Alan Coopersmith Signed-off-by: Daniel Vetter commit fa461203e6df7318d49d183366769e392e6decf0 Author: Daniel Vetter Date: Tue Jan 24 11:28:25 2012 +0100 testdisplay: make udev optional Hopefully this makes Solaris happy. Signed-Off-by: Daniel Vetter commit 7f7cafe7293570d56607b101cac7db617741713d Author: Daniel Vetter Date: Tue Jan 24 10:50:05 2012 +0100 testdisplay: extract hotplug code Signed-Off-by: Daniel Vetter commit 137f4d467e93eb1a91487f7be8b7a6e62e2bce2d Author: Daniel Vetter Date: Tue Jan 24 09:37:51 2012 +0100 lib: forcewake is gen6+ Signed-Off-by: Daniel Vetter commit 8d4d8b00ed92287cee81448ad886d8e9a4602f7b Author: Daniel Vetter Date: Mon Jan 23 17:18:53 2012 +0100 tests/gem_tiled_swapping: be more conservative with the swap requirements Blew up and angered the OOM killer on one of my machines. Signed-Off-by: Daniel Vetter commit 98129fa2ff2c095d13cb0f60499c2de129d36d6c Author: Daniel Vetter Date: Sun Jan 22 21:58:27 2012 +0100 tests: add gem_tiled_swapping Also add a drmtest_exchange_int helper, might come handy at other places. Signed-off-by: Daniel Vetter commit fbfe374b280be9542f7ddb59c41c6096f4d773fa Author: Daniel Vetter Date: Sun Jan 22 20:09:54 2012 +0100 lib: extract drmtest_permute_array Lots of tests need to create havoc to LRUs in the kernel or otherwise need to shuffle things around a bit. So make a small array permutation function available. Signed-Off-by: Daniel Vetter commit 1a9fa8fd12c78236b1eb4a83062cd8f732c7abb3 Author: Daniel Vetter Date: Sun Jan 22 19:24:48 2012 +0100 lib: add intel_get_total_swap_mb Test that try to exercise the swap paths need to check whether swap is available, otherwise they'll just oom. Signed-Off-by: Daniel Vetter commit 7132d0f977d226969b47edafbed74a6de04465f9 Author: Daniel Vetter Date: Sun Jan 22 19:14:25 2012 +0100 Revert "tests/gem_tiled_pread_pwrite: actually try to use more than total ram" This test is actually not really designed to test swap. This reverts commit 6d755c39d38e9f0e5a991933cc82e015d1ccd272. Signed-Off-by: Daniel Vetter commit 6d755c39d38e9f0e5a991933cc82e015d1ccd272 Author: Daniel Vetter Date: Sun Jan 22 18:04:24 2012 +0100 tests/gem_tiled_pread_pwrite: actually try to use more than total ram Luckily there's usually enough other stuff around to waste the last few mb ... Signed-Off-by: Daniel Vetter commit e64abe581a34bf12d3a91c13970100a16f709783 Author: Wu Fengguang Date: Tue Jan 17 07:19:24 2012 +0800 intel_audio_dump: show more AUD_CONFIG bits Signed-off-by: Wu Fengguang Reviewed-by: Eugeni Dodonov Signed-off-by: Daniel Vetter commit 3beea0bd0c3ead3cb87ca6fc0b17b887d187d002 Author: Wu Fengguang Date: Tue Jan 17 07:18:08 2012 +0800 intel_audio_dump: fix missing Audio DIP tabs This makes the SNB/IVY Audio DIP values aligned with others. Signed-off-by: Wu Fengguang Reviewed-by: Eugeni Dodonov Signed-off-by: Daniel Vetter commit 08ccec1ec77a92ec1aa766c8571a0a7a2e6541f8 Author: Daniel Vetter Date: Thu Jan 19 13:01:03 2012 +0100 tests: make testdisplay non-optional Not testing modesetting should not be an option. Also this hopefully prevents testdisplay build-breakage from lingering on for days like it has in the past. And we want to eventually test the gem/kms cross-section, i.e. pageflips. Acked-by: Chris Wilson Signed-Off-by: Daniel Vetter commit f07e4d1885fbf54a4faa1f91a92fa9499e11b011 Author: Daniel Vetter Date: Wed Jan 18 21:23:56 2012 +0100 lib: extract rendercopy functions from gem_stress Signed-off-by: Daniel Vetter commit 1357427fd0287b1027608c96d400daa6c4c97ddc Author: Daniel Vetter Date: Wed Jan 18 17:53:12 2012 +0100 gem_stress: s/gem_stress.h/rendercopy.h commit f7c2dab5bd1284982343a31d315864906392f016 Author: Daniel Vetter Date: Wed Jan 18 17:51:48 2012 +0100 gem_stress: move keep_gpu_busy stuff out of render copy functions Signed-off-by: Daniel Vetter commit b9fe673f498003b2d235f63485ed832070f84a8c Author: Daniel Vetter Date: Wed Jan 18 17:47:33 2012 +0100 gem_stress: move option struct out of header Signed-off-by: Daniel Vetter commit 9f20ecc3b3e80b2893646817926f2e090abf757a Author: Daniel Vetter Date: Wed Jan 18 17:46:00 2012 +0100 gem_stress: add width/height arg to rendercpy functions Signed-off-by: Daniel Vetter commit 699d30950f1d91cd017364765c14fdc4cb63cd14 Author: Daniel Vetter Date: Wed Jan 18 01:03:20 2012 +0100 gem_stress: move a few things out of gem_stress.h Signed-off-by: Daniel Vetter commit f1de285e7e5e1825f09510b2e6264139ea92f921 Author: Daniel Vetter Date: Wed Jan 18 00:55:49 2012 +0100 gem_stress: pass batch as arg to render_copy functions Signed-off-by: Daniel Vetter commit 72f74ce35512aebebf7f9a35e54cd7746ab30017 Author: Daniel Vetter Date: Wed Jan 18 00:36:37 2012 +0100 gem_stress: remove logical_tile_no arg from render_copy functions Signed-off-by: Daniel Vetter commit 205510badf00f82c0dc069ca15c5016a6fe18a60 Author: Daniel Vetter Date: Wed Jan 18 00:34:15 2012 +0100 gem_stress: add buf->size Removes a dependency on gem_stress internals from the rendercpy functions. Signed-off-by: Daniel Vetter commit d75d69d0a9e5e77dcea469b47401cd7d25f155a3 Author: Daniel Vetter Date: Sun Jan 15 18:32:11 2012 +0100 lib/drmtest: extract mappable aperture trasher infrastructure Signed-off-by: Daniel Vetter commit 7b14b093d45232cd2fd3a96322353eb35083c9eb Author: Daniel Vetter Date: Sun Jan 15 17:40:41 2012 +0100 lib/drmtest: add gem_mappable_aperture_size Signed-off-by: Daniel Vetter commit 7f944349efb98ae2ab777dc745c3d12acd03d82f Author: Daniel Vetter Date: Sun Jan 15 17:14:56 2012 +0100 lib/drmtest: extract gem_aperture_size Signed-off-by: Daniel Vetter commit d749921e48366c3b562fa315e7ed6cf4ce063a1c Author: Daniel Vetter Date: Sun Jan 15 16:40:32 2012 +0100 tests: update .gitignore commit a50eb34398b7a8ac5580d21a5f867c4697fee7ea Author: Daniel Vetter Date: Sun Jan 15 16:39:49 2012 +0100 tests: add ZZ_hangman Not yet enabled by default because the kernel can't recover from this on chips where we don't have a gpu reset implemented. Signed-off-by: Daniel Vetter commit eb6459161394d763b116e55eaef22b6b0b6a09a8 Author: Daniel Vetter Date: Sat Jan 14 17:05:39 2012 +0100 tests: add ZZ_check_dmesg This way the testsuit automatically fails if we hit a DRM_ERROR or a WARN/BUG somewhere. ... i.e. this is the Jesse Barnes catcher ... Signed-off-by: Daniel Vetter commit 91a01e034858dacd41f0a847ba90996db87c44be Author: Gaetan Nadon Date: Tue Jan 10 20:30:23 2012 -0500 tools: use correct src and build location Headers are found under top_srcdir/ Headers are CPP flags, not C Flags libintel_tools.la is located in top_builddir. Use dist_bin_SCRIPTS so it is included in tarball Line-up the line continuation characters Acked-by: Ben Widawsky Signed-off-by: Gaetan Nadon commit 812ca58f8a0d71433781b3ae38ead65e10e51cce Author: Gaetan Nadon Date: Thu Jan 5 18:56:28 2012 -0500 scripts: use PYTHON primary directive for python scripts Should it become installlable in the future, it will get compiled at installation time by Automake. Because it is "source", they get included in the tarball. Acked-by: Ben Widawsky Signed-off-by: Gaetan Nadon commit 65b7c72335572fec7f1fd78de840148c91b1fde2 Author: Gaetan Nadon Date: Thu Jan 5 18:44:49 2012 -0500 lib: fix include directives, alphabetize sources Headers are found under top_srcdir/... Headers are CPP flags, not C Flags Acked-by: Ben Widawsky Signed-off-by: Gaetan Nadon commit 3ceb75828ccf813005a7eb4c3924c9ca56c01aa1 Author: Gaetan Nadon Date: Thu Jan 5 17:02:30 2012 -0500 Benchmark: use correct src and build location Headers are found under top_srcdir/... Haeders are CPP flags, not C Flags AM_CPPFLAGS, AM_CFLAGS and LDAAD apply to all targets. libintel_tools.la is located in top_builddir. Acked-by: Ben Widawsky Signed-off-by: Gaetan Nadon commit 4768adf7d77706fb6c2967695e0afa7d7c7dbb75 Author: Gaetan Nadon Date: Tue Jan 10 17:25:24 2012 -0500 Debugger: convert existing makefiles to Automake. A common xorg idiom is used. The dependencies are auto-detected. If they are present, the debugger is build. If any are missing, the debugger is silently skipped. If --enable-shader-debugger is specified, the configuration will abort if any of the dependencies is missing. No user actions is needed, no env variable to set (as it should be) This will fix a number of problems: build cannot start due Makefile missing in tarball. build fails as GEN4ASM variable not available in Makefile. distcheck is also disturbed. In the process other minor problems were fixed: helper target is missing dependencies on evict.h. too may arguments given to pre_cpp.py but they were ignored. fills /tmp with temporary files. Acked-by: Ben Widawsky Signed-off-by: Gaetan Nadon commit 9f8766030463bc0c75506d990831b853f19d7725 Author: Daniel Vetter Date: Wed Jan 11 17:19:53 2012 +0100 lib/drmtest: add gpu quiescent helper Some tests are higly timing dependent and others carelessly leave active buffers behind. So add a helper to quiescent the gpu and call it unconditionally when opening an fd in a vain attempt to make all this race-condition hitting more scientifically sound. Signed-Off-by: Daniel Vetter commit 7a54bfa772d6823a20152c15fe18726e9222a4e9 Author: Daniel Vetter Date: Wed Jan 11 16:56:50 2012 +0100 tests: add drm_vma_limiter_cached to check libdrm cache mmap pruning Suggested by Chris Wilson. Signed-Off-by: Daniel Vetter commit cbaa8a389e47695e6612eb0f76faaf7d0979fee3 Author: Daniel Vetter Date: Wed Jan 11 15:33:00 2012 +0100 lib/drmtest: extract helpers for signal interruptions Also add some hackish stat to check it works. Signed-off-by: Daniel Vetter commit 36d25cc7440ef9d37d16ea95ee0d51e5e6e2c5e2 Author: Daniel Vetter Date: Wed Jan 11 14:59:47 2012 +0100 tests: add drm_vma_limiter variants that only check gtt/cpu mmaps Suggested by Chris Wilson. Signed-off-by: Daniel Vetter commit 553021d9740019d602ef327632a120cf0c9fc15a Author: root Date: Wed Jan 11 14:37:42 2012 +0100 tests: add drm_vma_limiter v2: Also check whether a 2nd mmap on the same bo still works. Suggested by Chris Wilson. Signed-Off-by: Daniel Vetter commit e287fe1958f73d35dd833d927662a5a1c64bcdbd Author: root Date: Tue Jan 10 22:34:52 2012 +0100 tests/gem_fenced_exec_trash: use drmtest helpers more Signed-Off-by: Daniel Vetter commit 527cad1618b458a2ff04b1d63ea1ffe926774815 Author: Daniel Vetter Date: Tue Jan 10 18:41:46 2012 +0100 lib/drmtest: extract gem_mmap Signed-Off-by: Daniel Vetter commit 7a6042e87ef3dee2df06b1666fb8af6889ac35b8 Author: Daniel Vetter Date: Tue Jan 10 18:29:30 2012 +0100 lib/drmtest: extract gem_create Signed-Off-by: Daniel Vetter commit 73d1b88129cdcf6fa250b6fb8e198fdfc2d70e04 Author: Daniel Vetter Date: Tue Jan 10 18:20:39 2012 +0100 testdisplay: rename global fd variable to drm_fd Shuts up compiler warnings about shadowing in functions. Signed-Off-by: Daniel Vetter commit db7462e1f5e3fd6bfeeeeb18e76231638d7f8c07 Author: Daniel Vetter Date: Tue Jan 10 18:15:05 2012 +0100 testdisplay: fixup smaller compiler warnings const char * issues and redudant getopt stuff Signed-Off-by: Daniel Vetter commit 08cd2f220ee84e51917cc76c19998b12b6d50407 Author: Daniel Vetter Date: Tue Jan 10 16:10:48 2012 +0100 tests: use the gem_write wrapper some more Signed-Off-by: Daniel Vetter commit 673e6b220a34fb7600cbf272bc46a4ac1ca08905 Author: Daniel Vetter Date: Tue Jan 10 16:05:34 2012 +0100 lib/drmtest: extract gem_set_domain and gem_sync gem_sync just does a gtt sync by using set_domain(GTT, GTT). Signed-Off-by: Daniel Vetter commit a7a80c2c2f7ac15ae50d75dc2fcaf59834b47e0c Author: Daniel Vetter Date: Tue Jan 10 15:50:20 2012 +0100 tests: fixup new warnings Signed-Off-by: Daniel Vetter commit bd5cf9a07d17ce91dfaa3aa12d3f2c93815f0489 Author: Daniel Vetter Date: Tue Jan 10 15:37:53 2012 +0100 lib/drmtest: extract gem_read Signed-Off-by: Daniel Vetter commit 319638ba6d38c25be0f6dadbab3f5855083234a1 Author: Daniel Vetter Date: Tue Jan 10 15:31:11 2012 +0100 lib/drmtest: extract gem_write Astonishing how many different function signatures are possible for something that simple. Signed-Off-by: Daniel Vetter commit 5dd17d3f4bddb075f3fb6fbcd1b6c271f7b746a7 Author: Daniel Vetter Date: Tue Jan 10 15:07:19 2012 +0100 lib/drmtest: extract gem_close Signed-Off-by: Daniel Vetter commit aa67b22e426f26f8a8d7fe35221fe2a6ceb5d3db Author: Daniel Vetter Date: Tue Jan 10 14:59:58 2012 +0100 lib/drmtest: extract gem_set_tiling Way too much copy-pasting going on here. Also fix a compiler warnings in gem_stress while fixup things up. Signed-off-by: Daniel Vetter commit 1be3fd7eeed3adf1fba56edc37110d346b03b88b Author: Daniel Vetter Date: Mon Jan 9 23:42:19 2012 +0100 lib: fixup new compiler warnings Signed-Off-by: Daniel Vetter commit bd811d2d39f49087310be508e2ea6278e817d6f1 Author: Daniel Vetter Date: Mon Jan 9 23:37:36 2012 +0100 tools/intel_stepping: fixup new warnings Signed-Off-by: Daniel Vetter commit faf3dd11357dc3aebbf025785f572b51117ea068 Author: Daniel Vetter Date: Mon Jan 9 23:35:21 2012 +0100 tools/intel_gtt: fixup new warnings Signed-Off-by: Daniel Vetter commit 5774fadf7d99ade1a18177eb04bf10377fcfef8b Author: Daniel Vetter Date: Mon Jan 9 23:34:38 2012 +0100 tools/intel_reg_dumper: fixup new warnings Signed-Off-by: Daniel Vetter commit d50e6368abfb657a838d212955b7445b44aba168 Author: Daniel Vetter Date: Mon Jan 9 23:24:12 2012 +0100 remove tools/intel_decode Everyone's using the libdrm decoder now. Signed-Off-by: Daniel Vetter commit 904bcab7ba884605e2e99264482c6c5383025b19 Author: Daniel Vetter Date: Mon Jan 9 23:22:21 2012 +0100 tools/intel_gpu_top: fixup new warnings Signed-Off-by: Daniel Vetter commit 2ca6c6b4fdd09b99b2456923926cc8d85316f301 Author: Daniel Vetter Date: Mon Jan 9 23:19:32 2012 +0100 tools/intel_dump_decode: use libdrm decoder Signed-Off-by: Daniel Vetter commit 24a33db7f0177e3c0d7cc4686a69ae6e30e09c3b Author: Daniel Vetter Date: Mon Jan 9 23:11:58 2012 +0100 tools/intel_bios_reader: fixup new warnings Signed-Off-by: Daniel Vetter commit 74b70baf14e42ee435a4e317c20a41d3fb0f0d93 Author: Daniel Vetter Date: Mon Jan 9 23:10:44 2012 +0100 tools/intel_bios_dumper: fixup new warnings Signed-Off-by: Daniel Vetter commit 03ab1328a765d725677809179779ff673ca41296 Author: Daniel Vetter Date: Mon Jan 9 23:09:37 2012 +0100 tools/intel_audio_dump: fixup new warnings Signed-Off-by: Daniel Vetter commit 391e6aa89ad21fa161632b41ff8e1f48352d0287 Author: Daniel Vetter Date: Mon Jan 9 23:06:41 2012 +0100 tools/intel_error_decode: fixup new warnings Signed-Off-by: Daniel Vetter commit 7ee9f16e5166a4b0dddb76ad5166410c388f603e Author: Daniel Vetter Date: Mon Jan 9 23:38:17 2012 +0100 tools/intel_error_decode: convert over to libdrm decoder Note that a per-ring error decode state would make more sense - this way we could better decode the ring head and tail. But our current head tracking is already lame (we need the kernel to also dump the ringbuffer head/tail first, not just acthd), so I didn't bother. Signed-Off-by: Daniel Vetter commit 555cfd4597bc04cb3fa67304408f7fa1be910647 Author: Jesse Barnes Date: Mon Jan 9 14:33:39 2012 -0800 testdisplay: update to new colorkey ioctl commit 504c4fa94f109338ef90a7e07b21bfafa67b8d4e Author: Alan Coopersmith Date: Fri Jan 6 15:45:29 2012 -0800 Fix pthread compiler flags to work on Solaris and with Studio compiler AC_USE_SYSTEM_EXTENSIONS is used to let autoconf take care of setting the right system defintions for POSIX threads & similar extensions to the base POSIX API. Since it will also #define _GNU_SOURCE 1, remove the extra setting to avoid compiler warnings about redefined macros. Signed-off-by: Alan Coopersmith Signed-off-by: Daniel Vetter commit 4e3c85f153276fc297570364b71ddbdd37aeaf5a Author: Alan Coopersmith Date: Fri Jan 6 14:37:20 2012 -0800 include in lib/intel_mmio.c for open() prototype on Solaris is the POSIX standard specified header for open(), so should be available on all platforms. Signed-off-by: Alan Coopersmith Signed-off-by: Daniel Vetter commit c461006bac8a3ff1196a83449bd1676778e8844f Author: Alan Coopersmith Date: Fri Jan 6 14:37:19 2012 -0800 List out array values instead of using gcc range extension Required to compile with Solaris Studio cc compiler. Signed-off-by: Alan Coopersmith Signed-off-by: Daniel Vetter commit 00751594dbdce9f1855ebe4105677a494fd7e36b Author: Alan Coopersmith Date: Fri Jan 6 15:45:28 2012 -0800 Use sched_yield instead of pthread_yield Despite the name implying it's a standard part of the POSIX threads API, pthread_yield is actually non-standard and less portable than sched_yield. For instance, Solaris only has sched_yield, and not pthread_yield. Since even the Linux man page suggests using sched_yield, just call that. Signed-off-by: Alan Coopersmith Signed-off-by: Daniel Vetter commit f73dddc767b38988f6905ef56e95acad9fa4e8ca Author: Alan Coopersmith Date: Fri Jan 6 14:37:17 2012 -0800 Solaris defines struct winsize in termios.h Signed-off-by: Alan Coopersmith Signed-off-by: Daniel Vetter commit 9ebb860e3981db78ee31859dc77f1fce3ccc3183 Author: Alan Coopersmith Date: Fri Jan 6 14:37:16 2012 -0800 Provide Solaris implementation of intel_get_total_ram_mb Signed-off-by: Alan Coopersmith Signed-off-by: Daniel Vetter commit 65db78f687e757ca40ac42e9c26ddc769bd4cfcc Author: Gaetan Nadon Date: Tue Jan 3 21:13:39 2012 -0500 config: restore the libtool minimum version to 1.5 Very few systems still use this old version, but it would be inconvenient to build a video driver with libtool 1.5 and have to build the gpu tools on another system having libtool 2.2. The toolchain version requirements are documented here: http://www.x.org/wiki/ModularDevelopersGuide#GNU_Build_System Signed-off-by: Gaetan Nadon Signed-off-by: Daniel Vetter commit d63a1f6c73f2fbfd4af1d3bab3eb0e4f68483115 Author: Gaetan Nadon Date: Tue Jan 3 21:12:25 2012 -0500 config: the minimum version for autoconf is 2.60 A version later than 2.60 can be used, but no new features from such a later version can be used in configure.ac. The toolchain version requirements are documented here: http://www.x.org/wiki/ModularDevelopersGuide#GNU_Build_System Minimum version for Automake is 1.10 but we have not written it in any xorg module so far and there has been no issues. Signed-off-by: Gaetan Nadon Signed-off-by: Daniel Vetter commit a03ef7abb508223bce65366d2ef9193521513d00 Author: Gaetan Nadon Date: Tue Jan 3 21:12:24 2012 -0500 config: set-up xorg automatic rebuilding rules The current code is a noop. Use the same configuration as all the other xorg modules. This will change in the future but it is less confusing when all modules behave the same way. Note that these rules apply to building from a tarball only. Restore autogen.sh to be identical in all xorg modules. Signed-off-by: Gaetan Nadon Signed-off-by: Daniel Vetter commit 665b86664ab5b4a8a076682d9c879f7a9fbeb756 Author: Gaetan Nadon Date: Tue Jan 3 21:12:23 2012 -0500 config: use project wide xorg warnings variable Use CWARNFLAGS as in all of xorg. There seems to be no reason why this module should be different. The warnings were updated recently for those who install the latest util-macros. Signed-off-by: Gaetan Nadon Signed-off-by: Daniel Vetter commit 1722b781286bbb7d98a90fa789d56219fd907ce7 Author: Gaetan Nadon Date: Tue Jan 3 21:12:22 2012 -0500 config: remove duplicate AC_PROG_CC and AC_PROG__CC_99 The compiler was configured three times. It is done once by XORG_DEFAULT_OPTIONS in util-macros. Signed-off-by: Gaetan Nadon Signed-off-by: Daniel Vetter commit 4435791013a7172a06a17e5656a5e6007f5a2d89 Author: Gaetan Nadon Date: Tue Jan 3 21:12:21 2012 -0500 config: remove unrequired AM_PROG_CC_C_O Required when using per-target flags or subdir-objects with C sources. http://www.gnu.org/software/automake/manual/automake.html Signed-off-by: Gaetan Nadon Signed-off-by: Daniel Vetter commit 27e1294cf8ef11455cb54527b8a269717ea12395 Author: Gaetan Nadon Date: Tue Jan 3 21:12:20 2012 -0500 Add mandatory ChangeLog and INSTALL files These are generated from a macro in the util-macros package Refer to the wiki for more details. http://www.x.org/wiki/NewModuleGuidelines. Acked-by: Cyril Brulebois Reviewed-by: Ben Widawsky Signed-off-by: Gaetan Nadon Signed-off-by: Daniel Vetter commit 4384c68f2ed7dac944b1cf57ac4acda606fafffe Author: Gaetan Nadon Date: Tue Jan 3 21:12:19 2012 -0500 Man pages still showing version 1.0 in the 1.1 release The patch coverts the man subdir to the standard xorg man page makefile. The version number is automatically updated when a new release is made. The man page section number is no longer hard coded either. The package util-macros at version 1.8 or greater is required. Acked-by: Cyril Brulebois Reviewed-by: Ben Widawsky Signed-off-by: Gaetan Nadon Signed-off-by: Daniel Vetter commit 6540ed2112dc589e13eb4bf4460df1c95a1b38a5 Author: Gaetan Nadon Date: Tue Jan 3 21:12:18 2012 -0500 Use standard .gitignore file and layout Reusing xorg code saves maintenance in the long term. Now that m4/.gitignore is removed, the -I m4 ${ACLOCAL_FLAGS} must be removed to avoid build breakage as m4 is generated and not part of the git source. Acked-by: Cyril Brulebois Reviewed-by: Ben Widawsky Signed-off-by: Gaetan Nadon Signed-off-by: Daniel Vetter commit 41ae07aba28dcec0b98245be90d9d5925c13c5c7 Author: Gaetan Nadon Date: Tue Jan 3 21:12:17 2012 -0500 Add mandatory COPYING file. This module is hosted as an X.Org app and is published as such. This file is a summary of the copyright statements in the source code. http://www.x.org/wiki/NewModuleGuidelines Acked-by: Cyril Brulebois Reviewed-by: Ben Widawsky Signed-off-by: Gaetan Nadon Signed-off-by: Daniel Vetter commit 47a5bc505cb972cc94f1fbd9882d4e5c2e72ac43 Author: Eugeni Dodonov Date: Mon Dec 19 16:25:53 2011 -0200 tools/intel_reg_dumper: retrieve rc6 residency values This allows to check if rc6 works, and how long have we been in each state. Signed-off-by: Eugeni Dodonov commit 1649ab350f60b664a51fc4a7fd9c225bb72eb0a8 Author: Eugeni Dodonov Date: Tue Oct 25 14:40:12 2011 -0200 tools/intel_reg_dumper: Add support for debug register Right now, we only check for hardware DRRS support. But much more can be done with it. Some day. Signed-off-by: Eugeni Dodonov commit f3f84bb3502cd1188dbc60cd975564eb3c3d4670 Author: Wu Fengguang Date: Sat Nov 12 11:12:55 2011 +0800 intel_audio_dump: show Gamut Metadata DIP Signed-off-by: Wu Fengguang Signed-off-by: Daniel Vetter commit 821e07d00d8d43472a808e240b0a7f1b9adc0ba9 Author: Wu Fengguang Date: Sat Nov 12 11:12:54 2011 +0800 intel_audio_dump: show interrupt enable bit Signed-off-by: Wu Fengguang Signed-off-by: Daniel Vetter commit ee94958d131cb71488f60fad48d7793a9dfd78e7 Author: Wu Fengguang Date: Sat Nov 12 11:12:53 2011 +0800 intel_audio_dump: show HDMI encoding Signed-off-by: Wu Fengguang Signed-off-by: Daniel Vetter commit e321f1315bddf94748e412cc1741cf1908420b6f Author: Wu Fengguang Date: Sat Nov 12 11:12:52 2011 +0800 intel_audio_dump: show VIDEO_DIP_CTL_* for CPT Signed-off-by: Wu Fengguang Signed-off-by: Daniel Vetter commit c0635c3f5c10459478665eb54814726def22fb5d Author: Wu Fengguang Date: Sat Nov 12 11:12:51 2011 +0800 intel_audio_dump: show ironlake ELD_access_address Signed-off-by: Wu Fengguang Signed-off-by: Daniel Vetter commit f32aecb2963f94f8ea033ad2e7a5e8d30a92484b Author: Wu Fengguang Date: Sat Nov 12 11:12:50 2011 +0800 intel_audio_dump: show ELD contents for G45 Signed-off-by: Wu Fengguang Signed-off-by: Daniel Vetter commit 6fcb5cdcbc385d94290271e0122ee4163ce38ec6 Author: Wu Fengguang Date: Sat Nov 12 11:12:49 2011 +0800 intel_audio_dump: show detected chipset name Signed-off-by: Wu Fengguang Signed-off-by: Daniel Vetter commit b5ca6b4410ac9ac00cad85dc53ef9761c6031f15 Author: Wu Fengguang Date: Sat Nov 12 11:12:48 2011 +0800 intel_audio_dump: show DP control registers for Ironlake Signed-off-by: Wu Fengguang Signed-off-by: Daniel Vetter commit 12861a95680ad35646713a38b617036a2bc3bbc8 Author: Wu Fengguang Date: Sat Nov 12 11:12:47 2011 +0800 intel_audio_dump: explain Bits_per_Sample Signed-off-by: Wu Fengguang Signed-off-by: Daniel Vetter commit cf4c12f103bbcc4b3f3b39fc8fe944f3c411b4fb Author: Wu Fengguang Date: Sat Nov 12 11:12:46 2011 +0800 intel_audio_dump: fix DP port width for CPT Signed-off-by: Wu Fengguang Signed-off-by: Daniel Vetter commit 97d203140c748490a5371a4695247f21ae328ac5 Author: Wu Fengguang Date: Sat Nov 12 11:12:45 2011 +0800 intel_audio_dump: fix DP control registers for CPT Signed-off-by: Wu Fengguang Signed-off-by: Daniel Vetter commit 63e3c37838aefb7e8a715eda29e1ca635fa21c63 Author: Wu Fengguang Date: Sat Nov 12 11:12:44 2011 +0800 intel_audio_dump: fix Ironlake detection The original test mistakenly calls dump_cpt() for Ironlake, due to HAS_PCH_SPLIT := IS_GEN5 || IS_GEN6 || IS_GEN7. Signed-off-by: Wu Fengguang Signed-off-by: Daniel Vetter commit 305443cf0ae5cc7566aceb6dc37aa3f51f51c9fb Author: Wu Fengguang Date: Sat Nov 12 11:12:43 2011 +0800 intel_audio_dump: fix Digital_Port_D_Detected copy&paste error Signed-off-by: Wu Fengguang Signed-off-by: Daniel Vetter commit d6bdaf01f9e9db47e0f5bb37d65e017b0c01502d Author: Wu Fengguang Date: Sat Nov 12 11:12:42 2011 +0800 intel_audio_dump: fix ironlake Stream_ID indents Signed-off-by: Wu Fengguang Signed-off-by: Daniel Vetter commit 5032f68a77b67d020cd462c22e390dc35d70447b Author: Wu Fengguang Date: Sat Nov 12 11:12:41 2011 +0800 intel_audio_dump: report effective channel count The raw channel count is not user friendly and may be misleading. Signed-off-by: Wu Fengguang Signed-off-by: Daniel Vetter commit 1c6a7cade7881d6ee1ff4e240331b10112389ce8 Author: Wu Fengguang Date: Sat Nov 12 11:12:40 2011 +0800 intel_audio_dump: cleanup hex output - no need to show the 1-bit AUD_OUT_DIG_CNVT_* as hex value - show the Connection_select_Control_* bits as hex values Signed-off-by: Wu Fengguang Signed-off-by: Daniel Vetter commit d6e38ffb6fbca1d13f21dae0b0b1eef2325583cd Author: Wu Fengguang Date: Sat Nov 12 11:12:39 2011 +0800 intel_audio_dump: cleanup ACP DIP name for ironlake and CPT Signed-off-by: Wu Fengguang Signed-off-by: Daniel Vetter commit ea3815cd03a4613d915f410aaa5c2079e989467c Author: Wu Fengguang Date: Sat Nov 12 11:12:38 2011 +0800 intel_audio_dump: cleanup hyphen character Convert "­" (Hex 00ad) to "-" (Hex 2d), the former leads to ugly outputs in some situations. Signed-off-by: Wu Fengguang Signed-off-by: Daniel Vetter commit 5a3fccbb577dd8d6a0699cd58e9f39532792b866 Author: Daniel Vetter Date: Sat Dec 24 01:23:59 2011 +0100 Release 1.1 commit 74d6545ffadf0a7f321138ae4ccd0def8f28e0d2 Author: Daniel Vetter Date: Sun Dec 18 00:24:45 2011 +0100 testdisplay: shut up compiler Signed-Off-by: Daniel Vetter commit 2de19c477af4f10370f1272e6578cec0d1b486bc Author: Daniel Vetter Date: Sun Dec 18 00:21:39 2011 +0100 testdisplay: move drm_fourcc.h include under the #ifdef protection Signed-Off-by: Daniel Vetter commit 1f41a30070d62e007bfda9f8ddadc24877a3324c Author: Yi Sun Date: Thu Dec 1 18:57:16 2011 +0800 tests/testdisplay.c: make the 3th pipe finish all the mode setting. If test all modes rather than preferred mode, remove framebuffer and set CRTC to zero after each connector mode setting. Signed-off-by: Sun Yi Reviewed-by: Eugeni Dodonov commit 06460049f69b2769c31c51520ae07af394a0a33b Author: Ben Widawsky Date: Thu Dec 15 13:54:30 2011 -0800 intel-decode: fix flush dword post sync parse Signed-off-by: Ben Widawsky commit 7ecdb152ca30db67f23a8f31bc7e4b84ec72a4d1 Author: Chris Wilson Date: Wed Dec 14 17:43:37 2011 +0000 tests/gem_double_irq_loop: silence the compiler gem_double_irq_loop.c: In function ‘dummy_reloc_loop’: gem_double_irq_loop.c:62:9: warning: unused variable ‘j’ [-Wunused-variable] commit f381a8b9f08a6d0c843e7b9f7997020d6b0d1e1a Author: Chris Wilson Date: Wed Dec 14 17:41:34 2011 +0000 tests/gem_exec_blt: silence the compiler by failing on error gem_exec_blt.c: In function ‘gem_exec’: gem_exec_blt.c:174:6: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable] Propagate the failure and exit(1). commit 2a292188e764c18b76698e1698ecaf62699b2f04 Author: Chris Wilson Date: Wed Dec 14 17:41:34 2011 +0000 tests/gem_exec_nop: silence the compiler by failing on error gem_exec_nop.c: In function ‘exec’: gem_exec_nop.c:101:6: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable] Propagate the failure and exit(1). commit ceb9f7d934e7efaaf0b061c3a0c5cb4b21efa156 Author: Chris Wilson Date: Wed Dec 14 17:39:42 2011 +0000 tests/gem_stress: silence the compiler by using '%zu' for size_t gem_stress.c: In function ‘main’: gem_stress.c:980:3: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘unsigned int’ [-Wformat] commit d4bb328b78b767b98c8a60ee2c1bd0d2cc894d67 Author: Chris Wilson Date: Wed Dec 14 17:37:53 2011 +0000 tests/gem_largeobject: silence the compiler gem_largeobject.c: In function ‘test_large_object’: gem_largeobject.c:95:20: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] commit b4fb480c802c41dbb8061344a540752156113489 Author: Jesse Barnes Date: Wed Dec 14 08:14:45 2011 -0800 testdisplay: don't test planes if i915 color key ioctl is not available commit 7ac492aec2c749895c863675ad5f48177daf9648 Author: Chris Wilson Date: Mon Dec 12 20:19:03 2011 +0000 scripts/who: Add the process id to the output Signed-off-by: Chris Wilson commit 61ff1309cabaa1fc879ed0c3179696ad64a79da3 Author: Chris Wilson Date: Mon Dec 12 17:44:58 2011 +0000 scripts: Add a trivial script to show which programs are using the GPU Signed-off-by: Chris Wilson commit 10e36edabe42e52f7862f66147d4433e8947ebc2 Author: Chris Wilson Date: Sat Dec 10 12:49:10 2011 +0000 decode: Fix interpretation of i915 8bit formats 2/3 are reserved with the correct values for A8/I8 being 4/5 respectively. Signed-off-by: Chris Wilson commit 5a9d82c6d5ad6d4e9b48a74dd4a5226babee81aa Author: Jesse Barnes Date: Wed Dec 7 08:22:41 2011 -0800 testdisplay: update for final plane & fb ABI Signed-off-by: Jesse Barnes commit ff409c537f541cbaa20f0b0f8faa03ece0d8014f Author: Daniel Vetter Date: Tue Dec 6 16:57:53 2011 +0100 tests/gem_partial_pwrite_pread: don't trash gtt unnecessarily On chips that don't have a unmappable gtt part it's utterly pointless. Signed-Off-by: Daniel Vetter commit 5a851b139266063fc4e172e6ce781ebc1c75c9d9 Author: Daniel Vetter Date: Sun Dec 4 21:42:31 2011 +0100 tests: add gem_partial_pwrite_pread Signed-off-by: Daniel Vetter commit 09cba27fdc5fbcc82471b4d7ba41944e5a4865d4 Author: Daniel Vetter Date: Sun Dec 4 13:57:56 2011 +0100 tests/gem_reloc_vs_gpu: fixup this mess - fixup pitch mess noticed by Chris Wilson. - we need to diable bo reuse otherwise the kernel won't do the relocs (we might get an already gtt-bound batch from the dummy load). Signed-Off-by: Daniel Vetter commit b9629f2d8d21a47c383c718e41910cc61c7947a6 Author: Daniel Vetter Date: Sun Dec 4 13:49:24 2011 +0100 tests/gem_reloc_vs_gpu: emit special batch on blt ring on gen6+ Signed-Off-by: Daniel Vetter commit 28e3f9c6064f2c9859e547b17abe1138a62e97ae Author: Daniel Vetter Date: Sun Dec 4 13:02:35 2011 +0100 tests/gem_reloc_vs_gpu: switch to COLOR_BLT instead of PIPE_CONTROL Less fancy command that works everywhere. Suggested by Chris Wilons. Signed-Off-by: Daniel Vetter commit 1c9cce9c45b9d8980eb6944dc8c36925e91f5228 Author: Daniel Vetter Date: Sat Dec 3 19:57:36 2011 +0100 tests/gem_tiled_pread_pwrite: kill set-but-unsed warning Signed-Off-by: Daniel Vetter commit ad6be1f0c913c5b9b5bb93d1c56390ac2b0c62ea Author: Daniel Vetter Date: Sun Dec 4 12:08:59 2011 +0100 tests: add gem_reloc_vs_gpu Tests whether the kernel properly waits for the gpu before applying a reloc. Signed-off-by: Daniel Vetter commit 224d4d22f069782c3a83a06ec97bbc58932db3d8 Author: Daniel Vetter Date: Fri Dec 2 20:40:03 2011 +0100 Revert some accidental things ... somehow slipped in. Signed-off-by: Daniel Vetter commit f5854c89022991f76d813249104566d14e73801b Author: Daniel Vetter Date: Fri Dec 2 20:36:06 2011 +0100 tests: add gem_exec_faulting_reloc Signed-off-by: Daniel Vetter commit ab3f4bdafe60dede32a48674ef9920df090bf3a7 Author: Daniel Vetter Date: Fri Dec 2 18:41:34 2011 +0100 tests: add gem_exec_bad_domains To check whether the kernel properly rejects non-gpu domains in relocs. Signed-Off-by: Daniel Vetter commit 783f16e328f331f92ef37b986b0f845c4ae23d98 Author: Daniel Vetter Date: Fri Dec 2 10:55:56 2011 +0100 tests: add gem_tiled_pread_pwrite Signed-off-by: Daniel Vetter commit eafdf50044f53e4b5eef222f6374c9ddba21e9da Author: Daniel Vetter Date: Tue Nov 1 14:33:53 2011 +0100 improve README Signed-Off-by: Daniel Vetter commit 2e88c4ce34c0403df2301863efae4bf0a8699acb Author: Daniel Vetter Date: Wed Nov 30 12:36:29 2011 +0100 tests/gem_gtt_speed: Add modes that force that to the gtt domain No sane userspace doesn't upload data to the gpu without actually using it there ... Signed-Off-by: Daniel Vetter commit 4591d4ba7fe224289faa2b3b37052106d476a04f Author: Paul Berry Date: Wed Nov 30 09:47:56 2011 -0800 Add missing executables to .gitignore. commit 7af82bb0e5af670add67996ff8d6e890b9622a0c Author: Daniel Vetter Date: Sun Nov 27 02:39:14 2011 +0100 tests: implement snb+ XY_SETUP_CLIP_BLT workaround Better safe than sorry. Signed-off-by: Daniel Vetter commit 66b88b615cb5b1f483eb86d4623a5df0bbb2c1bf Author: Daniel Vetter Date: Sun Nov 27 01:55:42 2011 +0100 tests/sysfs_edit_reader: posixify Debian's default sh complains ... Signed-Off-by: Daniel Vetter commit 8c7f8bcccbbb8cdd75aaa2f5084f7667f4279ea8 Author: Daniel Vetter Date: Sun Nov 27 01:37:59 2011 +0100 tests: properly terminate tests when values mismatch Not much use running them in the test rig otherwise. Signed-Off-by: Daniel Vetter commit 2f56e9617703466aaac79c8763974cea6b233933 Author: Eugeni Dodonov Date: Fri Nov 11 11:17:59 2011 -0200 tests/gem_hang: fix copy-paste problem I suspect that we should do different things for different pipes.. Spotted by Thomas Jarosh on #intel-gfx freenode. Signed-off-by: Eugeni Dodonov commit faf413d87556b9b76686ef9bf1e797e86e4b5129 Author: Eugeni Dodonov Date: Thu Nov 10 11:27:27 2011 -0200 tests: add a test for checking edid reading delays With base on EDID timing testing, when we take more than 1s to run xrandr command, something is wrong.. So add this test for testing the time we take to read the status of all the connectors from sysfs. It should do us an average picture of how long we'd take to run xrandr (roughtly 2x that value). Signed-off-by: Eugeni Dodonov commit 48186febf17490820dc089172c58526664255417 Author: Eugeni Dodonov Date: Thu Nov 10 11:12:10 2011 -0200 tests: add test for kernel segmentation fault As asked by Daniel Vetter, this is a tech which checks if we can cause division by zero in kernel by reading the i915_emon_status debugfs entry repeatably. Signed-off-by: Eugeni Dodonov commit 31a4b13132d8d3c1c8e2d16205b9785f4e6bb48d Author: Eugeni Dodonov Date: Tue Nov 8 15:47:03 2011 -0200 intel_gpu_top: use debugfs interface for forcewake Using debugfs facilities for forcewake-related stuff. Acked-by: Ben Widawsky Signed-off-by: Eugeni Dodonov commit f4ba3f529eace14bc3f4c3bf9fb2a0112d3632d5 Author: Daniel Vetter Date: Tue Nov 8 12:36:24 2011 +0100 tests: disable pipe_control on i965g That hw is broken. Reported-by: Dave Airlie Signed-off-by: Daniel Vetter commit 402948624cb9a18da2a5bdf9c1905b9eb9fd22ee Author: Chris Wilson Date: Fri Nov 4 17:10:06 2011 +0000 Call Arrandale gen5 not gen4. commit 4c7c94ad98ac94a1f8fffbf2ffd79fc3bfcef647 Author: Chris Wilson Date: Fri Nov 4 13:26:13 2011 +0000 testdisplay: Round tiled allocations up to pot stride and fence size Be simple and use the strictest requirements from gen2/3 with old kernels so that this simply works everywhere. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42585 commit 9c29be40bcb139ba57927fde954f66dcc4f0e6c8 Author: Jesse Barnes Date: Wed Nov 2 12:57:40 2011 -0700 testdisplay: find planes for each pipe Fixes a bug where we were masking against the wrong value. commit 3afb7b22d6388d13e7af293baa98cad6c3226aec Author: Jesse Barnes Date: Wed Nov 2 12:57:20 2011 -0700 testdisplay: update to new addfb2 definition commit 6f7e6c91009000ad4614609a4b2ebd0bf69ec751 Author: Daniel Vetter Date: Tue Nov 1 17:20:01 2011 +0100 cargo-cult the build system into shape Signed-Off-by: Daniel Vetter commit 593cb1874a7929909773ec5d95e4b1911ff27918 Author: Daniel Vetter Date: Tue Nov 1 17:04:44 2011 +0100 always require libdrm ... and also add the missing files to lib/Makefile.am Signed-Off-by: Daniel Vetter commit 37c64007345d4cf949746dd64b150162053de7cf Author: Daniel Vetter Date: Tue Nov 1 12:10:35 2011 +0100 tests/gem_tiled_pread: fixup detiler for gen2 Signed-Off-by: Daniel Vetter commit 6b4f5c7ad84cac32151e9acd0c1692b74cf33fb2 Author: Daniel Vetter Date: Tue Nov 1 11:52:53 2011 +0100 tests/gem_largeobject: accomodate for puny apertures ... like on my i855gm. Signed-Off-by: Daniel Vetter commit 7c8d41f4d959ee5f09c76272589f4e9b7872af52 Author: Ben Widawsky Date: Mon Oct 31 17:19:54 2011 -0700 i-g-t/debugger - make the debugger work with distcheck Signed-off-by: Ben Widawsky commit 15830ea54be914b1f4005154b2dcba52fa6b6120 Author: Ben Widawsky Date: Mon Oct 31 13:36:50 2011 -0700 i-g-t/debugger: Only allow the shader debugger if the user has specified a gen4asm Signed-off-by: Ben Widawsky commit 32910231514d938be269c3b087f0d444709b0466 Author: Daniel Vetter Date: Mon Oct 31 23:19:08 2011 +0100 tests: mark gem_bad_address as HANG Kills my little i855gm. Signed-Off-by: Daniel Vetter commit efd3a5d0b595b0e7f3a8a66fc61ecd67f4af8699 Author: Daniel Vetter Date: Mon Oct 31 17:40:37 2011 +0100 tests/debugfs_reader: fight bashism debian's dash doesn't like this. Signed-Off-by: Daniel Vetter commit cc85c4efb719f31812947616dad3c6e00af5a001 Author: Daniel Vetter Date: Mon Oct 31 16:08:02 2011 +0100 tests: actually add the drm client check script Ooops. Signed-Off-by: Daniel Vetter commit d4cc95b4578d2010cf6fecb6bb833c8dd83651b5 Author: Daniel Vetter Date: Mon Oct 31 16:04:34 2011 +0100 tests: check for other drm clients Signed-Off-by: Daniel Vetter commit 899496ba414067c72bbfb2dcdbf835977338db26 Author: Daniel Vetter Date: Sun Oct 30 23:20:12 2011 +0100 tests/gem_bad_length: disable broken batchbuffer Submitting random crap hangs the gpu. Suprise! Signed-off-by: Daniel Vetter commit 20ff3839e448ba383b73a227889445a35d197cdc Author: Daniel Vetter Date: Sun Oct 30 22:27:19 2011 +0100 tests: don't run kernel check from make check Add a new target test for that. Signed-off-by: Daniel Vetter commit 931aa17754bad046f9a1d870894468527cb10c17 Author: Daniel Vetter Date: Sun Oct 30 22:04:39 2011 +0100 tools: script to gather bug report data Signed-off-by: Daniel Vetter commit 91b3c7f3338370538feeb080c79a1f506823dee5 Author: Daniel Vetter Date: Sun Oct 30 21:24:12 2011 +0100 make distcheck fixes Signed-off-by: Daniel Vetter commit f361664df024e7d30ef94221304207991c2ebb6c Author: Daniel Vetter Date: Sun Oct 30 20:51:03 2011 +0100 tests: add test to read all debugfs files Catches a bunch of forcewake warnings on snb+ Signed-off-by: Daniel Vetter commit 5b8bbc950d411ea30ebe14e6d001f1eb3204f8b1 Author: Daniel Vetter Date: Sun Oct 30 20:45:42 2011 +0100 testdisplay: compile fix for !DRM_PLANES Signed-off-by: Daniel Vetter commit 5ef806bb5d4767eeeb6ec926b8af7044c98d47a0 Author: Daniel Vetter Date: Fri Oct 28 17:39:14 2011 +0200 tests: add gem_unref_active_buffers The crucial trick to reproduce the bug is that we need to have a decent pile of active bos to retire. Because we unref the bo after having it moved off the active list, our recursion depth in fdo bug #42180 is limited by the number of active objects that can retire at the same time. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42180 Signed-off-by: Daniel Vetter commit 1f4c37a6e91c74553afe3e67ac5e4703c85e6dbc Author: Jesse Barnes Date: Fri Oct 28 05:25:53 2011 +0200 testdisplay: allow overlay plane to be moved & scaled at runtime For additional testing. Signed-off-by: Jesse Barnes commit 2b484c16dd477bfe35e41a52f6a47ae8f9ae28d0 Author: Jesse Barnes Date: Fri Oct 28 08:53:48 2011 -0700 intel_reg_dumper: handle 3 pipe configs when dumping HDMI config Could be on pipe A, B, or C. Signed-off-by: Jesse Barnes commit 234b5c40b13f3fd211bff07a046aee00611e1a4f Author: Jesse Barnes Date: Thu Oct 27 17:47:58 2011 -0700 testdisplay: add stub disable_planes() function To fix the compile with non-plane libdrms. Signed-off-by: Jesse Barnes commit 28d1be3f9bca0ef5fb87d5c8c45d71f7e94a4e2c Author: Daniel Vetter Date: Tue Oct 25 12:24:17 2011 +0200 tools/decode: decode XY_SCANLINES_BLT commit c2657e865f5c87a8ac64f75a560b6c0f01fe1a0d Author: Daniel Vetter Date: Tue Oct 25 12:15:27 2011 +0200 tools/decode: decode XY_SETUP_* cmds And extract decode code for br00 and br01. Signed-off-by: Daniel Vetter commit 24e60385febe8ce603a233c617cdcc5b3d3ea9ba Author: Jesse Barnes Date: Mon Oct 24 17:15:34 2011 +0200 testdisplay: add sprite scaling and location support Allow testdisplay to locate the sprite on the screen and potentially scale it using different crtc width/height vs the source width/height (determined by the resolution on the target pipe). Also fix exit, making sure we properly disable all the planes. Signed-off-by: Jesse Barnes commit d510953ef38de7017c87688b3f4f5a7924097488 Author: Daniel Vetter Date: Fri Oct 21 19:06:08 2011 +0200 tools/intel_error_decode: decode gen4+ fences Signed-off-by: Daniel Vetter commit 982d14e34b978b318ba0d92dd25d5b791375d0f3 Author: Daniel Vetter Date: Fri Oct 21 10:09:14 2011 +0200 tools/decode: properly decode gen6+ PIPE_CONTROL flags Signed-off-by: Daniel Vetter commit e0b264573074debc0b97b3d13f60de4c2c21186b Author: Chris Wilson Date: Tue Oct 18 14:05:54 2011 +0100 top: Avoid FPE by removing meaningless metric commit d2c95d118310374e5d0958b2cd85bc77479b307a Author: Eric Anholt Date: Fri Sep 23 14:47:44 2011 -0700 intel_reg_checker: New tool to accumulate checks for HW workarounds. The goal of this tool is to be usable as a test for whether something (suspend/resume, GPU reset, bugs, whatever) may have lost various required hardware setup specified in the docs. Reviewed-By: Eugeni Dodonov commit 5801e6b9118c5209f2e44e581776e1b078164f46 Author: Daniel Vetter Date: Tue Oct 18 16:30:56 2011 +0200 intel/decode: print out chipset gen ... instead of i965+ for almost everything that Intel is still selling. Signed-off-by: Daniel Vetter commit 92b1f2c96eaf51a793a267fa66fa0cc0b960de11 Author: Daniel Vetter Date: Tue Oct 18 15:54:31 2011 +0200 tools/decode: don't move around the display register section Signed-off-by: Daniel Vetter commit 6ed89f47ecefb334be6fd8a80d8e6f26ddc059f6 Author: Daniel Vetter Date: Tue Oct 18 15:49:41 2011 +0200 tools/decode: don't forget to print the name of the last ring Signed-off-by: Daniel Vetter commit e98f308994711b3bc22d70c782bdf800eb253a0f Author: Eugeni Dodonov Date: Mon Oct 17 17:48:18 2011 -0200 Allow intel_dump_decode to read data from stdin. Signed-off-by: Eugeni Dodonov commit f312f89f4ae65ee969ec30657724b1fd5a1ebd44 Author: Daniel Vetter Date: Mon Oct 17 19:41:42 2011 +0200 tools/intel_dump_decode: make devid parsing more useful We use hex for these! Signed-off-by: Daniel Vetter commit 73c2104070fc0e2cd8230075a75eed3a214bba06 Author: Daniel Vetter Date: Tue Oct 11 13:14:02 2011 +0200 tools/decode: retain the ring name Signed-off-by: Daniel Vetter commit 1c6511f7fb9b0117d2a1f4ebe489e5a0221c6d7b Author: Daniel Vetter Date: Sun Oct 16 21:13:34 2011 +0200 tests: add gem_hangcheck_forcewake Provokes the forcewake warning when the hangcheck runs and no one waits for the gpu (and hence holds the dev->struct_mutex). Signed-off-by: Daniel Vetter commit 2e9e27ce6b7b7cb2db39590265d08bd19386855d Author: Daniel Vetter Date: Sat Oct 15 13:46:19 2011 +0200 tests/gem_fence_trash: some retuning We actually want to test lru behaviour, so do a bit of work with the fence before yielding to the next thread (we use twice as many fences as there are, so yielding always is pretty bad, no matter how clever our fence stealing). Signed-off-by: Daniel Vetter commit b75451838a0b4315fa9494691c1615bce178d424 Author: Daniel Vetter Date: Sat Oct 15 13:09:36 2011 +0200 tests/gem_*_blits: reduce buffer count to not trash swap Signed-off-by: Daniel Vetter commit 62c542fd4e7f47d5216785e9a13054ce56973f28 Author: Eugeni Dodonov Date: Fri Oct 14 15:26:13 2011 -0300 Allow to output statistics to stdout. This allows intel_gpu_top to run both in statistics-collecting mode (collecting the per-ring statistics in gnuplot-friendly format) and ncurses top-like mode at the same time. It also allows to output the statistics directly to stdout, by using "-o -", so the results can be parsed directly via a popen() parsing. If you are using intel_gpu_top as previously (without any command-line arguments), it should change nothing for you. If you were using its logging facilities (e.g., the '-o file'), note that the logging will keep running, but the detailed top-like interface will be on the screen at the same time. Signed-off-by: Eugeni Dodonov commit eaaddc794bade33e0d7b0c94406102c9814c2c05 Author: Adam Jackson Date: Tue Oct 11 18:25:26 2011 -0400 bios_reader: Allow forcing the device ID with DEVICE=0xNNNN As a pleasant side effect you can now feed it an opregion dump and it'll decode without crashing. Signed-off-by: Adam Jackson commit 1708580217ed403f0abd086f15baddf98cb0fb5a Author: Jesse Barnes Date: Tue Oct 11 11:37:25 2011 -0700 intel_reg_dumper: use none instead of NULL if no port is assigned to TRANS_DP Makes the output a little more readable. commit 503cfa2707bca2c06895f51d50fa38218ff16aa7 Author: Jesse Barnes Date: Mon Oct 10 11:24:42 2011 -0700 Treat PPT like CPT as we do in the kernel Set the pch type to CPT if we detect a PPT as well. commit af6a25c187a0f1a340fad71bb1a019e087e2b1ae Author: Daniel Vetter Date: Wed Sep 28 10:05:56 2011 +0200 tests: disable storedw tests on !render According to docs, this should work with ppgtt and just convert to noops otherwise. In reality, it hangs the machine. So just disable these for the moment. Signed-Off-by: Daniel Vetter commit a2dfbbf3e70767bc4c67c18c9c14ab4f9646155e Author: Daniel Vetter Date: Wed Sep 28 10:02:57 2011 +0200 tools/decode: add missing shift to MI_SEM_MBOX decoder Signed-off-by: Daniel Vetter commit 17ceccedbf8c09368b72ecc4afe12f0d1e63837e Author: Paulo Zanoni Date: Fri Sep 16 18:06:27 2011 -0300 testdisplay: return 0 when successful We use the "ret" variable to check function return values, and these values are not necessarily 0 on the successful cases, so we need to reset "ret" after we finish using it. Signed-off-by: Paulo Zanoni Signed-Off-by: Daniel Vetter commit a167425b39c01a729ed3b2ef5a1d17e83edb720f Author: Paulo Zanoni Date: Thu Sep 15 15:18:40 2011 -0300 getstats: remove useless assertion getstats.c:48:2: warning: comparison of unsigned expression >= 0 is always true Signed-off-by: Paulo Zanoni Signed-off-by: Daniel Vetter commit ca2800f1d4d352304dccd33e9ab5c0e27e89a05a Author: Paulo Zanoni Date: Thu Sep 15 15:17:46 2011 -0300 drm_open_any: explain why we are abort()ing Signed-off-by: Paulo Zanoni [danvet: pimped error msg] Signed-off-by: Daniel Vetter commit 3ba12bbb2faf6cfd87eea96edf761f16ef8c4ab1 Author: Paulo Zanoni Date: Thu Sep 15 15:16:33 2011 -0300 testdisplay: remove wrong return statement It seems that the kernel patches required by the TEST_PLANES feature are still not upstream, so I didn't test this patch. Signed-off-by: Paulo Zanoni Signed-off-by: Daniel Vetter commit 7ead7ba3e6bcfa59203d63ac3cc66432853e02de Author: Paulo Zanoni Date: Thu Sep 15 15:14:18 2011 -0300 testdisplay: don't enter the main loop if dump_info or test_all_modes If calls inside update_display fail, the function returns and we don't quit the program if dump_info or test_all_modes. So we enter the main loop and keep waiting for user input, even on cases where we are not supposed to require user input. To fix this, we move the check to outside the update_display function. As a side effect, we also do cleanup instead of just exit(0) and we return 1 in case update_display failed. Signed-off-by: Paulo Zanoni Signed-off-by: Daniel Vetter commit 9fe1148c4b20cb80c86c64a81c4594d152d20be7 Author: Paulo Zanoni Date: Thu Sep 15 15:13:41 2011 -0300 testdisplay: test all modes if no option is provided Previously, when called without any arguments, the application required user input to finish. However, testdisplay is ran by "make check", and it is not a good idea to run a program that requires user input in "make check". So we change the default behavior to something that doesn't require user input. You can still access the previous behavior using the "-m" argument. Signed-off-by: Paulo Zanoni Signed-off-by: Daniel Vetter commit e450cf6d8aefc99bf9300092d50bae0d927490a1 Author: Paulo Zanoni Date: Thu Sep 15 15:12:48 2011 -0300 Add missing files to .gitignore Signed-off-by: Paulo Zanoni Signed-off-by: Daniel Vetter commit 19fef544ebcd7358633db56027f893cacca7ef88 Author: Paulo Zanoni Date: Thu Sep 15 15:10:52 2011 -0300 testdisplay: fix compiler warnings testdisplay.c:117:1: warning: comparison between signed and unsigned integer expressions testdisplay.c:125:1: warning: comparison between signed and unsigned integer expressions testdisplay.c:145:1: warning: comparison between signed and unsigned integer expressions testdisplay.c:1060:16: warning: comparison between signed and unsigned integer expressions Signed-off-by: Paulo Zanoni Signed-off-by: Daniel Vetter commit 733a1d9f3441eec77c272648d0df7eea010b8f44 Author: Daniel Vetter Date: Thu Sep 15 18:47:21 2011 +0200 tests/gem_mmap_gtt: also test gtt pwrite paths This needs a properly pre-faulted dst bo. Signed-off-by: Daniel Vetter commit ba2255a7e41cade707af36d3de0a59fbb41245e9 Author: Daniel Vetter Date: Wed Sep 14 14:58:55 2011 +0200 tests: build all tests by default Signed-off-by: Daniel Vetter commit d6ac159ba18756a63d22bf84be72e433d9ec04d2 Author: Daniel Vetter Date: Wed Sep 14 14:48:45 2011 +0200 tests: separate testcases in gem_bad_length Creating a zero-length bo should fail, so check that. Still run the minimal batchbuffer, but without the zero-length reloc. Signed-off-by: Daniel Vetter commit 2c380c2eac0562a5e8ebc1ed8aeca2192f60e885 Author: Daniel Vetter Date: Wed Sep 14 11:06:03 2011 +0200 tests: disable gem_bad_blit Hangs gen3 and simply writes garbage into the unmappable part of gtt on gen4+, which might cause issues later on. Signed-off-by: Daniel Vetter commit bbe635f0dc67e40fde1efb221b7e550952ad8a84 Author: Daniel Vetter Date: Tue Sep 13 20:57:04 2011 +0200 tests/gem_bad_length: dont throw garbage at the gpu It doesn't like it. Really. Signed-off-by: Daniel Vetter commit a5abe177468f3c1c93f869a7c33712c63b023f65 Author: Ben Widawsky Date: Tue Sep 13 08:54:33 2011 -0700 intel: we don't do distcheck for the debugger commit f91e2c2b7e5e7fd79ba4be3051914e4453d292d8 Author: Daniel Vetter Date: Tue Sep 13 17:20:12 2011 +0200 intel_gpu_dump: really kill it This is getting a bit hilarious ... Signed-off-by: Daniel Vetter commit c7a98ae2515e39a54c35bf3da978fec7f4b1235c Author: Daniel Vetter Date: Tue Sep 13 12:05:58 2011 +0200 intel_gpu_dump: also kill manpage Signed-off-by: Daniel Vetter commit 8d9792ce23087ac4cbee17fb93f9a75030abc7c6 Author: Daniel Vetter Date: Tue Sep 13 11:43:06 2011 +0200 tools: remove intel_gpu_dump Superseded by the kernel's i915_error_state dumping facility. Signed-off-by: Daniel Vetter commit e855dc222368f76b80b6685dcaa731b00ee1a0d6 Author: Daniel Vetter Date: Tue Sep 13 11:41:42 2011 +0200 tools: beef up intel_dump_decode - now also handles ascii dumps like i915_ringbuffer_data - getoptified - totally lazy binary detector Signed-off-by: Daniel Vetter commit 19d69955d2827ccf56c65d97a921e5c70f125ca0 Author: Daniel Vetter Date: Tue Sep 13 11:05:13 2011 +0200 tests: exit(77) to properly mark tests as SKIP Signed-off-by: Daniel Vetter commit 21ec8c78b3b8860b59e772416b5858ed6b41554f Author: Daniel Vetter Date: Mon Sep 12 20:56:13 2011 +0200 tests: mark gen3-only tests as such ... instead of hanging the gpu. Signed-off-by: Daniel Vetter commit b8245e18fe6a80e55aa0ece17d6b3a0cf3b1182c Author: Daniel Vetter Date: Mon Sep 12 20:45:06 2011 +0200 tests: add basic test for missed irqs Didn't catch any known bug, but can't hurt. Signed-off-by: Daniel Vetter commit fbf8950f6e04e5e000f1f099d75536d8e4fe0cad Author: Daniel Vetter Date: Wed Sep 7 09:31:00 2011 +0200 tests: check pipe_control coherency v2: proper support for gen6+ Signed-off-by: Daniel Vetter commit bf9f149a6d24355dd5959d3ad750678c4e1cd4b6 Author: Daniel Vetter Date: Mon Sep 12 20:33:58 2011 +0200 tools: add intel_gen Signed-off-by: Daniel Vetter commit 61b9806f4e7b92031491f2c4b3454c1f3afe418c Author: Daniel Vetter Date: Fri Sep 9 20:44:27 2011 +0200 tests: basic ring<->cpu and ring<->ring tests Using a dummy reloc that doesn't matter to trick the kernel into synchroizing the rings. v2: properly apply MI_NOOP workaround to MI_FLUSH_DW and switch to MI_COND_BATCH_BUFFER_END as a dummy command on the render ring to avoid PIPE_CONTROL errata. v3: somebody clever decided that in C, you cound from 1, i.e. I915_EXEC_RENDER == 1. It works now ... Signed-off-by: Daniel Vetter commit 32f49c7c0d91318c1993e381855ecf4bb02abc80 Author: Daniel Vetter Date: Thu Sep 8 10:50:37 2011 +0200 tests: split up gem_storedw_loop into ring specific variations Also start to shortly explain testcases with an easily-greppable header like this: /* * Testcase: * * [Possible further explanation.] * */ Signed-off-by: Daniel Vetter commit d1aae145a7d76775f9903f8dbba9a0d2bd8118bd Author: Daniel Vetter Date: Wed Sep 7 10:18:06 2011 +0200 tests/gem_storedw: disable on pre-gen6 Doesn't work. Signed-off-by: Daniel Vetter commit d42b7f9189680de4f137cae248ddb67f2310a26f Author: Daniel Vetter Date: Wed Sep 7 09:20:36 2011 +0200 lib/batch: hackish interface to run batches on specific rings Signed-off-by: Daniel Vetter commit 49cd753a77ab8ed9194f0e3ac2b5eadc803ef165 Author: Daniel Vetter Date: Tue Sep 6 21:16:21 2011 +0200 test/gem_storedw_*: tune some more MI_*/PIPE_CONTROL writes need to be in DOMAIN_INSTRUCTION, because that is what mesa uses and I plan to use this to work around a gen6 ppgtt issue. Also testing with intentionally b0rked GFX_MODE on my snb shows that we need to increase the loop counter a bit to reliably hit the tlb invalidation problem. Test still completes within a few seconds. Signed-off-by: Daniel Vetter commit 2a0b3488a0f3a715d2d654858ba0a638d71366c7 Author: Daniel Vetter Date: Fri Sep 9 17:22:28 2011 +0200 tools: decode some more MI_ ops Signed-off-by: Daniel Vetter commit 206e129af067b7a898515d8c26acc319e5c5f445 Author: Daniel Vetter Date: Fri Sep 9 10:10:07 2011 +0200 tools: decode MI_SEMAPHORE_MBOX Juggle the length check up to avoid duplication. Signed-off-by: Daniel Vetter commit 079f8390309d9dc59197f04cafbcbda6c711c346 Author: Daniel Vetter Date: Tue Sep 6 20:54:16 2011 +0200 tools/intel_gpu_dump: add hackish --devid parsing For bugreports and whatnotelse. Signed-off-by: Daniel Vetter commit 2a7778d4e3f4730572e4f22c39c85787daa73469 Author: Paulo Zanoni Date: Wed Aug 24 14:57:31 2011 -0300 gem_vmap_blits: fix compilation if I915_PARAM_HAS_VMAP is not defined Previously, "make check" failed because the main() function was not defined. Signed-off-by: Paulo Zanoni Tested-By: Eugeni Dodonov Signed-Off-by: Daniel Vetter commit 15cb28218786ae80101ad0f6cc5a21c1ad9e8d3e Author: Eugeni Dodonov Date: Mon Sep 5 20:04:17 2011 -0300 intel_gpu_top: access hardware before running profiling command Without this patch, intel_gpu_top will try to get access to the hardware after running the profiling command in the background. In case such access fails, the main process quits, but the background one will continue running. So let's move this test up, so it is done before we fork. Signed-off-by: Eugeni Dodonov commit 8ad08546e5d6189d2c778b6175e97b486332d37e Author: Eugeni Dodonov Date: Mon Sep 5 19:59:40 2011 -0300 intel_gpu_tools: describe -e option in usage screen This patch adds a short description of '-e' option to the usage screen. Signed-off-by: Eugeni Dodonov commit b9d7c3a087f0973bd98af02955082b9140d90c11 Author: Eugeni Dodonov Date: Mon Sep 5 19:50:52 2011 -0300 intel_gpu_top: adopt to kernel coding style This patch fixes adopts the code to the kernel coding_style. commit a483c97d910d18b0626591f770d212ca97e2f7a1 Author: Eugeni Dodonov Date: Mon Sep 5 19:41:24 2011 -0300 intel_gpu_top: support profiling user-specified commands This patch adds support for running intel_gpu_top to profile specific commands. The required command will be carried out in separate process, and main intel_gpu_top will leave when the child process will exit. Signed-off-by: Eugeni Dodonov commit c2983f24e34936fd9e0d513922af70485d579e61 Author: Eugeni Dodonov Date: Mon Sep 5 19:39:58 2011 -0300 intel_gpu_top: support non-interactive mode This patch adds support for non-interactive mode, invoked by running with '-o output' switch. In this case, no interactive output is being performed, but the execution statistics are being saved into the output file. The output file is generated in both human and gnuplot-readable format. Unlike interactive mode, where non-supported pipes and non-active registers are skipped, the content of such pipes and registers is recorded into the log file to simplify parsing and standardize the list of columns. Also, unlike interactive mode, the registers are not sorted according to the usage - this way, their variation over time can be analysed offline. Signed-off-by: Eugeni Dodonov commit 83047e9a5e7563bb7dd7085de5f27b55d3c2f16e Author: Eugeni Dodonov Date: Mon Sep 5 19:35:44 2011 -0300 This patch initializes the last_stats[] for registers prior to starting the monitoring itself. This way, the first measure will already contain the difference from the previous value instead of non-initialized value. Signed-off-by: Eugeni Dodonov commit f11f8d9aac77051a071b215910832b020d959858 Author: Eugeni Dodonov Date: Mon Sep 5 19:33:40 2011 -0300 Revert "intel_gpu_top: initialize monitoring statistics at startup" This reverts commit 431fe7803d37f344275fdaceb57c1fbaeee8541c. Will be replaced with more fine-grained commits. commit 431fe7803d37f344275fdaceb57c1fbaeee8541c Author: Eugeni Dodonov Date: Mon Sep 5 16:33:04 2011 -0300 intel_gpu_top: initialize monitoring statistics at startup This patch initializes the last_stats[] for registers prior to starting the monitoring itself. This way, the first measure will already contain the difference from the previous value instead of non-initialized value. Signed-off-by: Eugeni Dodonov commit 4b0a15e45d1823888cfed9a76e54036658ab8e61 Author: Eugeni Dodonov Date: Mon Sep 5 16:29:39 2011 -0300 intel_gpu_tool: initial support for non-screen output This patch adds initial support for non-stdio output, to be used for non-interactive monitoring. Signed-off-by: Eugeni Dodonov commit 09e4b0cd26e800c203c1de071b83d879a09bb0dc Author: Eugeni Dodonov Date: Mon Sep 5 16:23:11 2011 -0300 intel_gpu_top: suport command line parameters and variable samples per second This patch adds support for getopt, and adds two default parameters to it: -h to show usage notes; and -s to allow user to define number of samples to acquire per second. Manpage documentation is also adjusted accordingly. Signed-off-by: Eugeni Dodonov commit 6194c75c8f438d13f6535d70009658851929f39e Author: Eugeni Dodonov Date: Mon Sep 5 15:31:17 2011 -0300 intel_gpu_top: account for time spent in syscalls This allows intel_gpu_top to properly account for time spent inside system calls. Effectively, with previous implementation, intel_gpu_top could spent longer than 1s between consecutive measures. This attempts to minimize the extra time spent while polling for data. Signed-off-by: Eugeni Dodonov commit 922214f9869220373c3768cfcbd0e243e6ac07b6 Author: Jesse Barnes Date: Fri Aug 12 12:51:34 2011 -0700 tests: add store dword tests Add a couple of simple store dword tests to test memory coherence. gem_storedw_loop simply executes a batch that continually stores an incremented value to a target buffer object, checking the results after each batch completes. gem_storedw_batches_loop does the same thing, but creates a new command batch buffer for each iteration, which can exercise the buffer creation code. This test is based on one from Andrzej Kacprowski from Intel. Signed-off-by: Jesse Barnes commit 6857a1af816e18981515b942faaba65e85c40cc5 Author: Hai Lan Date: Fri Aug 5 00:47:25 2011 -0400 testdisplay: for tiled mode test, the height should be aligned Signed-off-by: Hai Lan commit e40c9c7faf7303201b8fbe8ff1ed1b17533d3c50 Author: Eric Anholt Date: Mon Aug 1 10:39:51 2011 -0700 Add missing copyright info to intel_decode.c commit 3b10b7bd5a8ce60aef06df5e61f0a0c30fb0fa10 Author: Ben Widawsky Date: Thu Jul 28 14:58:24 2011 -0700 tools: readme addition for shader debugging commit d0a7e0ab5a19b2f04f2692ec0e8874056c9b2d32 Author: Ben Widawsky Date: Thu Jul 28 15:07:28 2011 -0700 tools/range handing: forgot the register map file :( commit 62873796c4a96554cc139e9aa49e25ce19cd65cd Author: Ben Widawsky Date: Fri Jun 24 11:42:03 2011 -0700 intel-gpu-tools/debugging: shader debugger high level summary of the files: * debug_rdata - get current state from debug registers. Helpful when developing the debugger, and could serve some purpose in the future. * eudb - the debugger itself * eviction_macro - generate the proper macro to flush the EU render cache until I get control flow working * pre_cpp - an evaluating c preprocesser like thing, to be used before cpp * sr - the system routine, exception handler which runs on the EU * test - a very basic test system routine * debug.h commit e39b13d7e4174ec50fd41d74fe8d3375c8ef2850 Author: Ben Widawsky Date: Sun Jul 17 12:43:12 2011 -0700 intel-gpu-tools/debugging: add important debug regs Cc: Chris Wilson commit c82c1d68469ae99b40fa260a1b4c4debb9130515 Author: Ben Widawsky Date: Tue Jun 14 11:00:30 2011 -0700 intel-gpu-tools/forcewaked: sample forcewake app This app is required for debug features which seem to (undocumented) reset themselves if/when the GT goes to sleep. It is also useful for those doing general debugging or profiling from userspace when they do not wish to have the GT sleep. v2: made forcewaked more daemon-like Cc: Chris Wilson commit abd7038e5a814bb29398d6ea259815b293c62a2b Author: Ben Widawsky Date: Thu Jul 28 13:42:45 2011 -0700 intel-gpu-tools/range handling: register range handling Hooks to allow safe accesses from userspace. Can revert to old behavior by using unsafe access. commit cac8f8b52621f246a7cff412f340a7db28cb1b99 Author: Ben Widawsky Date: Thu Jul 28 13:40:19 2011 -0700 forcewake: Add mmio code to do proper forcewake stuff for gen6 commit 294927c601bf1af05d718e0b1ca092f9c8c8e19e Author: Chris Wilson Date: Wed Jul 20 20:40:13 2011 +0100 Add intel_backlight A trivial tool to adjust the backlight registers (gen5+ only atm). Signed-off-by: Chris Wilson commit 30ffcc34ea6bae238671c042d718ae7f05853022 Author: Chris Wilson Date: Wed Jul 20 20:39:56 2011 +0100 intel_decode: Handle a few gen7 blocks commit 74670c7bb9968a99d75a97c3677b15110281c94d Author: Daniel Vetter Date: Sun Jul 17 23:33:27 2011 +0200 gem_stress: ducttaping mandatory In other news: We've been missing a unmapping_mapping_range somewhere in the kernel. But lazy me never came around to digging up the real cause. Signed-off-by: Daniel Vetter commit 6cc92bcbc5301e79a9afa8f3dcbc73ec770be034 Author: Hai Lan Date: Tue May 31 17:13:30 2011 -0400 testdisplay: Test the first mode if there is no preferred mode. For a TV device, there might be no preferred mode. In this case, we can test the first mode. Signed-off-by: Hai Lan commit 25b25b907d8d6dc309c23fde136c35d4daee2643 Author: Chris Wilson Date: Fri Jul 8 15:01:39 2011 +0100 tests/gem_vmap_blits: Fix typo Why, oh why, do these only become obvious after pushing upstream? Signed-off-by: Chris Wilson commit 4c0176e49700401a568d592865d6f53649075ca7 Author: Chris Wilson Date: Fri Jul 8 14:55:36 2011 +0100 intel_reg_dumper: Slightly tidy the reporting of pipe configs Signed-off-by: Chris Wilson commit a0a0b6ab34f4413cc911d6e9b60e831f72a1e11a Author: Chris Wilson Date: Fri Jul 8 14:54:32 2011 +0100 Add a test case for coherency of vmaps Signed-off-by: Chris Wilson commit 75f7e81fbc65cd67500f0795228f6e03619e3a49 Author: Chris Wilson Date: Wed May 25 14:49:40 2011 +0100 gem_stress: Assert we have no pending ops when using the CPU Signed-off-by: Chris Wilson commit f40d54e132f84efa28b29723f90537e4731c6c92 Author: Chris Wilson Date: Wed May 25 14:40:38 2011 +0100 gem_gtt_speed: Add option for variable buffer size commit 4227da8c3cc6417c9d9600bddac938759f01ae03 Author: Chris Wilson Date: Sat Jul 2 08:59:32 2011 +0100 gem_stress: Add an option to test handling of signals As signals cause the syscalls to be interrupted, we often need to clean up partial state before returning to userspace. Often a source of unamusing bugs, so encourage gem_stress to provoke them. Signed-off-by: Chris Wilson commit 8908055da6a484058caa92c3c2ba3221cb9ce9d9 Author: Chris Wilson Date: Thu Jun 23 14:04:35 2011 +0100 tests: Add an exercise for zero-length buffers Triggers an OOPS with dmar enabled currently. Signed-off-by: Chris Wilson commit 9de433a471a0bf829a8143658e6b8d07fa896454 Author: Chris Wilson Date: Mon Jun 20 13:53:12 2011 +0100 tests: Add a simple exercise of GTT mmaps Test copying between 2 mappings and reading/writing from and to. References: https://bugs.freedesktop.org/show_bug.cgi?id=38115 Signed-off-by: Chris Wilson commit 336f85dafb6b11f24353544e12d4ddd7f1c10a73 Author: Daniel Vetter Date: Mon Jun 13 22:02:52 2011 +0200 gem_stress: some stats about incoherencies Signed-off-by: Daniel Vetter commit 10079566805f5d48edb09f7a9ed3fdea0ecee004 Author: Daniel Vetter Date: Mon Jun 13 20:14:53 2011 +0200 gem_stress: option to disable render copyfunc check Too noisy - which is an another way of saying too broken :( Signed-off-by: Daniel Vetter commit 5b253cee37b610a14d4d48a8bdde0df5a932be88 Author: Daniel Vetter Date: Mon Jun 13 20:09:38 2011 +0200 gem_stress: option for tile_size I want to know how large these corruptions can get! Signed-off-by: Daniel Vetter commit c0f34338e7bb3be473ff3afe70e17afbaa3a7958 Author: Daniel Vetter Date: Mon Jun 13 13:18:35 2011 +0200 gem_stress: option to set tiles per buffer gem_stress -p1 is much more evil than gem_stress -c1, it also manages to tear appart untiled workloads! Now duct-taping over it still works (--apply-duct-tape) ... hm. Signed-off-by: Daniel Vetter commit 6daa883fa3cf08363912fd46bce49177a3fa7c82 Author: Daniel Vetter Date: Mon Jun 13 00:22:01 2011 +0200 gem_stress: option to continue despite failures Signed-off-by: Daniel Vetter commit 9649dd7ef0bc55a027219347734b2bb13fe0fc71 Author: Daniel Vetter Date: Tue Jun 7 22:30:03 2011 +0200 gem_stress: option to override the number of rounds to complete gem_stress -c 1 ... sometimes takes a while to hit a problem. Signed-off-by: Daniel Vetter commit e0532d4eb0192f62d2fed29a67b830f122f356c2 Author: Chris Wilson Date: Wed Jun 8 12:13:46 2011 +0100 scripts: Add throttle.py Parses a trace.dat and works out how long each throttle was and how many batches retired within that period (and their average duration). Signed-off-by: Chris Wilson commit e235f932883316953a9b7a5bcc76ea3b775c3695 Author: Jesse Barnes Date: Tue Jun 7 13:32:37 2011 -0700 testdisplay: automatically enable TEST_PLANES if possible Just look for the ADDFB2 ioctl and enable the new code if it exists. commit 8969b839b544e73a9242adb025562b1dc9ec5916 Author: Jesse Barnes Date: Tue Jun 7 13:28:19 2011 -0700 testdisplay: fix error output if test pattern draw fails commit b707feb9d51bb3a2e7eb5f172afeae2ef13381e1 Author: Jesse Barnes Date: Tue Jun 7 13:27:35 2011 -0700 testdisplay: add tiled buffer test support Useful for testing tiled vs linear framebuffers. commit 7230c0142115b2ed6460e1b95cef97c0954b56c5 Author: Jesse Barnes Date: Tue Jun 7 13:17:46 2011 -0700 testdisplay: add overlay plane test option Enumerate available extra planes and try to use one on each CRTC we enable. commit 3ddc799fbf04e1c7c482c0879aa506c3c7a12c04 Author: Lan, Hai Date: Mon Jun 6 19:16:26 2011 -0700 testdisplay: fix possible_crtcs check so LVDS works When using testdisplay on GM965 and Pineview with LVDS, it will fail to set a mode because the first unused crtc can't be used for LVDS. So check the possible_crtcs to make sure the crtc can be used. Signed-off-by: Hai Lan commit 1095a825c0acaecf51f97741eacf14acd9bf901e Author: Daniel Vetter Date: Mon Jun 6 20:16:35 2011 +0200 gem_stress: avoid division by 0 Without this height would be 16 with the minimal buffer size. Signed-off-by: Daniel Vetter commit fde66f9bf4de6240422e64b24dd1a74577cd6128 Author: Daniel Vetter Date: Mon Jun 6 20:15:44 2011 +0200 gem_stress: disable fence storm when only using untiled buffers This explains why gem_stress -u worked beforehand - the rendercpy was not actually used! Signed-off-by: Daniel Vetter commit 7250328bb8b3d524cd39dee3fd48b6e17e3af24e Author: Daniel Vetter Date: Mon Jun 6 18:59:54 2011 +0200 gem_stress: round max_dimension down to the next pot Creates funny rounding problems otherwise. Signed-off-by: Daniel Vetter commit 3d66d913d9165f59e39952a41b41461b2329c9c1 Author: Chris Wilson Date: Sun Jun 5 21:53:49 2011 +0100 gem_stress: trim buffer sizes to fit into 3D pipeline Remember the 3D pipeline is much more restricted than the BLT engine, and we were feeding it buffers much larger than either the render engine or the sampler could manager. Signed-off-by: Chris Wilson commit 2933547eb0d22cb70c783a78ab3d7b4dcc5972ce Author: Chris Wilson Date: Sun Jun 5 21:35:34 2011 +0100 gem_stress: cpu maps force tiling to be disabled, so fix the printf Signed-off-by: Chris Wilson commit bfa23b47a57a89eb8adcde32ffe2849f0d2aac2e Author: Chris Wilson Date: Sun Jun 5 21:34:07 2011 +0100 gem_stress: Add extra passes to intial render copyfunc verification ...and allow for cpu maps! commit e7119c2e3bf73bd1029a668d167c16a0949fef70 Author: Chris Wilson Date: Sun Jun 5 19:10:14 2011 +0100 test/gen3_mixed_blits: Remember that the BLT engine cannot handle Y-tiling ...even through a fence that can. Signed-off-by: Chris Wilson commit 6f6cd8191392a9b6c5805524cbe3fd62937f76bb Author: Chris Wilson Date: Sun Jun 5 18:05:28 2011 +0100 test/gen3_mixed_blits: Alternately use fence regs for the render copies Signed-off-by: Chris Wilson commit 853d729598fddce3f1814cd7fc5e1020147b3f34 Author: Chris Wilson Date: Sun Jun 5 17:45:28 2011 +0100 test/gen3_mixed_blits: Acutally use fences for BLT Gah, in my excitement of reproducing the failure reported by gem_stress, I missed using fenced relocs for the BLT. Fortunately, it doesn't affect the presence of the error. Signed-off-by: Chris Wilson commit aadfcdfd4edbaa7f9912a6ec42215ddb6726c74a Author: Chris Wilson Date: Sun Jun 5 18:13:18 2011 +0100 decode: Fix segmentation fault The decode for A8 is incomplete and died with a segfault. First hide the segfault, latter fix the pretty printing. Signed-off-by: Chris Wilson commit f5e63b12a5881d112f8c757838167e05e1c13b88 Author: Chris Wilson Date: Sun Jun 5 17:23:09 2011 +0100 test: Add more gen3 render blitters ... and we have a winner: gen3_mixed_blits reproduces the issue Daniel Vetter originally found. It seems clear that we have some incoherence between the RENDER and BLT units on gen3 that no amount of MI_FLUSH can hide. Hmmm.... Signed-off-by: Chris Wilson commit 20b69039e816ed44ef30048c81a76def7028f0ba Author: Chris Wilson Date: Sun Jun 5 11:20:34 2011 +0100 test: Exercise gen3 render copies gem_stress is unhappy with tiled render copies on gen3. This is a simple little test to ensure that a set of pure copies with a working set larger than the aperture are handled correctly. Signed-off-by: Chris Wilson commit 3ca054c2259483f27ffaabd786215ea82a66f78f Author: Chris Wilson Date: Sat Jun 4 21:41:11 2011 +0100 tests: Add a fenced execbuffer thrash test Exercise a nasty corner-case in the reservation logic for the fence accounting. Signed-off-by: Chris Wilson commit 91f609741d7497c4bcc113e74028f9c4948d8b48 Author: Sun Yi Date: Mon May 30 18:20:30 2011 -0700 testdisplay: print pixel clock in mode debug output Print the pixel clock of each mode. commit 9b325c8a864efce172bdfaf82e251284f115e263 Author: Chris Wilson Date: Wed May 25 13:42:29 2011 +0100 Update gitignore Signed-off-by: Chris Wilson commit 4e1f2f5957d47458c39b7b32fcdacf2b5411d6b1 Author: Chris Wilson Date: Wed May 25 13:41:28 2011 +0100 gem_stress: '-b' option to disable BLT copyfunc Signed-off-by: Chris Wilson commit 719ffef7c39386c453614bc71e1af97904d3671b Author: Chris Wilson Date: Sun May 22 10:34:12 2011 +0100 gem_stress: Add render copyfunc for SandyBridge Signed-off-by: Chris Wilson commit d73cdde45afc41fb7b36829eda1af763af682ada Author: Eric Anholt Date: Fri May 6 12:15:50 2011 -0700 Add Ivybridge support to intel_gpu_dump and the BLT tests. commit a825173a5f2154b0491f7b5554c10ab7146b4592 Author: Jesse Barnes Date: Thu May 12 17:49:07 2011 -0700 testdisplay: add 30bpp support (#ifdef'd out until the next cairo release) commit a09dd09e00561739a10c83eb25ee9443f8bf79f6 Author: Jesse Barnes Date: Tue May 10 17:21:12 2011 -0700 Add Ivybridge device IDs Makes the reg dumper work better. commit 12de60a5e8db990c173b21857fe68ff74daa5679 Author: Jesse Barnes Date: Wed May 4 14:55:32 2011 -0700 testdisplay: don't read hotplug events from buffer before libudev Otherwise we'll just block rather than trying to update the display. Signed-off-by: Jesse Barnes commit b11d67a33baca467bebd53bf605bdeeee1f31e26 Author: Daniel Vetter Date: Wed Apr 27 22:13:29 2011 +0200 gem_stress: option to use cpu mappings This things just won't die (libva!!!), so add an option to test them. _Not_ meant to test snoopable mappings. Signed-off-by: Daniel Vetter commit 9bfda1a809b6606e06bb96158cc103e12428e9c2 Author: Hai Lan Date: Tue Apr 26 11:03:39 2011 +0800 Fix a bug of testing preferred mode Signed-off-by: Chris Wilson commit c56cd106f969d223b17e7d9a6113e63d6befd9bc Author: Jesse Barnes Date: Tue Apr 19 11:50:16 2011 -0700 testdisplay: add non-24 bit depth support Testing 16bpp is useful, and 30bpp will be added once cairo supports it. commit 0d3043f5f3cb7265e297a4e8386c7c0b2ec97d2d Author: Jesse Barnes Date: Mon Apr 18 16:48:27 2011 -0700 testdisplay: paint color gradients Helps identify dithering problems. commit a67091b220bd50ea4c1a6aaecbac816bbf331fcf Author: Daniel Vetter Date: Tue Apr 12 22:26:42 2011 +0200 gem_stress: option to only use x-tiling This seems to be another trick to massively improve correctness of the render blit. At least on my i945. Signed-off-by: Daniel Vetter commit f70a717482823e69637b4d91e216ae5756f07e0d Author: Ben Widawsky Date: Mon Apr 11 08:47:11 2011 -0700 Add C99 requirement to autoconf. snprintf is part of the C99 standard and is used in many places in the tools. Signed-off-by: Ben Widawsky commit afa940c39844f565d396b51deb6fd6e564751e49 Author: Daniel Vetter Date: Sat Apr 9 20:15:10 2011 +0200 Disable gem tests when libdrm is not available Quickly checked on ppc by Cyril Brulebois. Signed-off-by: Daniel Vetter commit 1c9ede3acbf62eab60e6f949a759e9e2e2e1014b Author: Daniel Vetter Date: Tue Apr 5 21:14:54 2011 +0200 intel_decode: drop unused code Signed-off-by: Daniel Vetter commit 841c551f12a522b8fdfbe2233ed1b8baa2f1c146 Author: Chris Wilson Date: Tue Apr 5 08:52:52 2011 +0100 decode: Correct a couple of mistakes in gen3 IMMEDIATE_STATE_1 Signed-off-by: Chris Wilson commit e68652cad6ec46b8dacbf5360f20dd03afab3ec9 Author: Daniel Vetter Date: Mon Apr 4 22:10:21 2011 +0200 gem_stress: option to disable tiling Of all the things I've tried, this seems to be the only thing to fix tile corruptions reliably on gen2&gen3 (safe for outright disabling the render copy). Signed-off-by: Daniel Vetter commit 272c8988079ce867f92bdf5df85f27ca46d15f27 Author: Daniel Vetter Date: Mon Apr 4 21:24:58 2011 +0200 gem_stress: clean up fence_storm That little snippet creapt in and magically made render copy work - by essentially disabling it. Restore order, everything incoherent again. Signed-off-by: Daniel Vetter commit aeb0b6f33c56766cf269e798742cb793ee4dcd5e Author: Daniel Vetter Date: Sun Apr 3 13:10:07 2011 +0200 gem_stress: extract emit_blt Signed-off-by: Daniel Vetter commit 4fcfc9f1020aad07060569be3fcedf446ff2d58f Author: Daniel Vetter Date: Thu Mar 31 23:30:17 2011 +0200 gem_stress: gen2 render copy Sometimes acts up like gen3 on my i855gm. Sometimes works flawless. Signed-off-by: Daniel Vetter commit a6751bac8dd05e2f04960d40b670d35d3b63704e Author: Daniel Vetter Date: Thu Mar 31 23:29:25 2011 +0200 gem_stress: split out gen3 render copy Header conflicts with other headers for different generations. Signed-off-by: Daniel Vetter commit 1baab2e43a40fe33606668c0be19ab772e25cc7a Author: Daniel Vetter Date: Wed Mar 30 21:46:04 2011 +0200 gem_stress: option to disable render copy It seems to be randomly broken, every boot in a slightly different way on my i945gme. Works quite well on my Q35. So add an option to disable it till this is resolved. Well, more testing seems to suggest that I've been hunting ghosts. Or maybe not and it works now simply because it's a different day. Anyway, leave this in for future testing. Signed-off-by: Daniel Vetter commit cd640cca6c0eb5936eaf48e43ebc5b3bf7278f6d Author: Daniel Vetter Date: Sun Mar 27 21:33:29 2011 +0200 gem_stress: render copy on gen3 Headers copied over from xf86-video-intel, code built after the Xrender support. Signed-off-by: Daniel Vetter commit 8ab88c9af062512dee6dc2c43d400a71b165c284 Author: Daniel Vetter Date: Sun Mar 27 16:17:54 2011 +0200 lib: execbuffer2 support Signed-off-by: Daniel Vetter commit 2374af20feaaeac849b9a506aeb1e8e9028e5ff7 Author: Daniel Vetter Date: Mon Mar 28 21:42:26 2011 +0200 gem_stress: fix set_tiling Signed-off-by: Daniel Vetter commit 6a860b75075e68eac786e1b4b8ec76b2dfbedb1a Author: Daniel Vetter Date: Tue Mar 29 19:23:35 2011 +0200 gem_stress: ad-hoc tile tracing Signed-off-by: root commit 130daf9cd072dd3cdb380a2578ff830cc022bd1b Author: Daniel Vetter Date: Sun Mar 27 15:37:26 2011 +0200 gem_stress: optin to set num_buffers Signed-off-by: Daniel Vetter commit 294c78f4ab3fea90cf8a09ec08095b200103b6e3 Author: Daniel Vetter Date: Sun Mar 27 15:25:12 2011 +0200 gem_stress: variable gpu busy load Signed-off-by: Daniel Vetter commit 22fe098bf5468931278e68c42280a583c3f714f2 Author: Daniel Vetter Date: Sun Mar 27 14:26:43 2011 +0200 gem_stress: getoptification Signed-off-by: Daniel Vetter commit 874163d5c8433012bcfd00e990c289fa6d2a64ce Author: Daniel Vetter Date: Sun Mar 27 14:02:49 2011 +0200 gem_stress: dump complete failed tile Signed-off-by: Daniel Vetter commit ad515f817a7e669ec1b7596c88a97349094728e8 Author: Daniel Vetter Date: Fri Mar 25 22:09:28 2011 +0100 Move gen5 blitter work-around to lib Suggested by Chris Wilson to prevent utterly strange gpu hangs. Signed-off-by: Daniel Vetter commit bfa6f5d94ffccfe00a6232e5adaf61d60c7cdde2 Author: Daniel Vetter Date: Fri Mar 25 21:54:02 2011 +0100 gem_stress: limit gtt_size to 256 gem_stress maps all buffers, so more only results in trashing (which should be handled with an option). Signed-off-by: Daniel Vetter commit 2aac22358feb217435bb4b77ae824db823435db0 Author: Daniel Vetter Date: Fri Mar 25 21:53:07 2011 +0100 gem_stress: implement gen5 blitter work-around ddx and mesa assume that this is issued after every blit command. Breaking that invariant results in a dying gpu. Signed-off-by: Daniel Vetter commit cfba9dd371bdf8031bf2bd77817a7a7976319e61 Author: Daniel Vetter Date: Fri Mar 25 20:42:57 2011 +0100 gem_stress: fix blitter_copy on gen4+ Utter fail at copy&pasting. Signed-off-by: Daniel Vetter commit d641f0fd42c2f59459641f039a8da7d3b2adbae8 Author: Forest Bond Date: Tue Mar 22 10:31:43 2011 -0400 intel_bios_dumper: handle rom_size == 0 Some versions of libpciaccess on Linux set rom_size to 0 for VGA devices. While this behavior may change, intel_bios_dumper should handle this situation to be compatible with current versions of the library. This fixes segmentation faults on affected systems. Signed-off-by: Forest Bond Signed-off-by: Chris Wilson commit 3f10ff85bd2bb65e49e52ec4f025dc977985b4b6 Author: Daniel Vetter Date: Mon Mar 21 22:13:18 2011 +0100 gem_stress: submit batch if there's only one fence left ... for a copy might use up to two fences! Signed-off-by: Daniel Vetter commit 652d9eb983c25caf4bac09aabafbf90aa9daddbf Author: Chris Wilson Date: Mon Mar 21 07:58:51 2011 +0000 stress: Distinguish between busy_bo and scratch_bo creation sizes The busy bo has a fixed size (1024x256, 32bpp) whereas the scratch bo may need to vary their size to exercise different features of fence allocation. Signed-off-by: Chris Wilson commit 80aae9b4244d02873e9f6221de70a4d9cbbc2504 Author: Daniel Vetter Date: Sun Mar 20 21:12:20 2011 +0100 gem_stress: pwrite/pread support And a few other things: - inline checking when copying tiles with the cpu, fails _much_ faster. - bo size seems to have a tremendous effect, put on the TODO. Signed-off-by: Daniel Vetter commit 08cf53703e79ec48e826af06fd6a5d5be847cb7c Author: Daniel Vetter Date: Sat Mar 19 21:34:55 2011 +0100 Add gem stress test Not where I want it to be, yet. And not as good as I've hoped in detecting broken kernels. Signed-off-by: Daniel Vetter commit 02014cee2aff72592107046328448a32374b18d3 Author: Daniel Vetter Date: Mon Mar 14 13:03:48 2011 +0100 Decode map state on gen2 At least the important stuff. Signed-off-by: Daniel Vetter commit cf5db1161a559798d789ae2aba2c9b8c101c7bdc Author: Daniel Vetter Date: Mon Mar 14 11:20:17 2011 +0100 Decode gen2/gen3 fences in the error_state Signed-off-by: Daniel Vetter commit afe492549d782fc58201268d119092e069d31a83 Author: Daniel Vetter Date: Sun Mar 6 00:12:03 2011 +0100 Decode 3DSTATE_CLEAR_PARAMETERS Signed-off-by: Daniel Vetter commit ad27fac946ca67d88bf12b40d6455c30daf1584b Author: Daniel Vetter Date: Sun Mar 6 00:11:50 2011 +0100 Small cleanups for immediate state S5 And a tiny fix. Signed-off-by: Daniel Vetter commit 84c32bd85cc9c6b066e3af53a0998104391f56cf Author: Chris Wilson Date: Sat Mar 5 09:01:01 2011 +0000 test: Mark gem_bad_batch as a known hang Signed-off-by: Chris Wilson commit 03c1e334b8cb06a9f548ec2e43baa79731c1c798 Author: Daniel Vetter Date: Fri Mar 4 16:41:07 2011 +0100 Fully decode sampler state Signed-off-by: Daniel Vetter commit f14877f2ded521f90d47aa9682f60d648eebeea9 Author: Daniel Vetter Date: Fri Mar 4 15:58:00 2011 +0100 Fully decode map state A few odd things were missing. Signed-off-by: Daniel Vetter commit 673d5bcea01bfcbf62a014bd13cc026bac3c6a8c Author: Daniel Vetter Date: Fri Mar 4 14:31:04 2011 +0100 Decode 3DSTATE_LOAD_INDIRECT The remaining stuff + cleanups. Signed-off-by: Daniel Vetter commit 75c403e9236cc03bc9c14ee7bf4f3d2ca8e4a93a Author: Daniel Vetter Date: Fri Mar 4 12:50:48 2011 +0100 Decode 3DSTATE_LOAD_INDIRECT S0-S4 Signed-off-by: Daniel Vetter commit 1e8713fdaa38ee384d916831e8bd5354ff664f46 Author: Daniel Vetter Date: Thu Mar 3 21:29:27 2011 +0100 Decode scissor state Not absolutely paranoid, who cares. Signed-off-by: Daniel Vetter commit 01ac8b90993eb28668d791e0b88df8bd5e93ee78 Author: Daniel Vetter Date: Thu Mar 3 21:23:13 2011 +0100 Decode 3DSTATE_DRAWING_RECTANGLE Signed-off-by: Daniel Vetter commit 05309ebfe43d54ae231676cabbee9a285ef6375a Author: Daniel Vetter Date: Thu Mar 3 21:20:26 2011 +0100 Decode MS3 tex format Signed-off-by: Daniel Vetter commit 1f35267948ef98c5685a02633784a5ca13e49718 Author: Chris Wilson Date: Wed Mar 2 16:06:00 2011 +0000 decode: Fix pretty printing of 3DSTATE_URB allocation size Signed-off-by: Chris Wilson commit 1c05f89cebb0d1fa5e0676bf88cc1cf0bdb4421c Author: Chris Wilson Date: Wed Mar 2 14:48:20 2011 +0000 decode: fix gen6 PS binding table update bit Signed-off-by: Chris Wilson commit eb777071d75e4bb50964d32e4c354021116ed9e9 Author: Daniel Vetter Date: Tue Mar 1 00:01:34 2011 +0100 Decode MS3 tex format Signed-off-by: Daniel Vetter commit 8348e69561f7300ef9eb4a154f0185f9da4fa651 Author: Daniel Vetter Date: Mon Feb 28 22:51:47 2011 +0100 Decode depth buffer format Signed-off-by: Daniel Vetter commit 14bed666f4f88ac2597ab5322a21e1846db21339 Author: Ben Widawsky Date: Tue Feb 22 09:25:29 2011 -0800 Add MI_SUSPEND_FLUSH instruction decode Signed-off-by: Ben Widawsky Signed-off-by: Chris Wilson commit 41570d9bf583d35687bab88ac88620af41404836 Author: Chris Wilson Date: Mon Feb 14 15:56:14 2011 +0000 Remove confusing use of IS_9XX ... and test for what we mean instead. Reported-by: Diego Celix Signed-off-by: Chris Wilson commit dac602b7b3678c82dd7bc41f258e6518efb8d6cd Author: Hai Lan Date: Fri Feb 11 23:25:36 2011 -0500 correct a mistyping for testdisplay For testing all mode, the sleep time should be sleep_between_modes Signed-off-by: Chris Wilson commit 28032382bce40392a98dd5ec71443a6f2bee7f27 Author: Chris Wilson Date: Fri Feb 11 10:56:41 2011 +0000 testdisplay: Remove deprecated GIO functions Signed-off-by: Chris Wilson commit 5534cb1c7566916a6bc39badf1eb4624399d542e Author: Chris Wilson Date: Fri Feb 11 10:48:04 2011 +0000 testdisplay: Clarify Move the loop operations around for test_all_modes so that it is clearly split up into the desired phases. Signed-off-by: Chris Wilson commit 62d516813afd36146df63746e7b83e86d2588c70 Author: Hai Lan Date: Fri Feb 11 11:14:15 2011 -0500 Add a test case into intel-gpu-tools for intel display driver validation. We have not a unified tool to check Intel display driver and we plan to use intel-gpu-tools/testdisplay to check Intel display driver even though some function tests can be found in libdrm/test. 3 new features are added:test all supported modes, force mode and dump mode info(dump mode info is based on libdrm/tests/modetest). [ickle: attack the whitespacing!] Signed-off-by: Chris Wilson commit d75f2632c11b4f694447c464690e52c37c7c0573 Author: Chris Wilson Date: Thu Feb 10 11:20:20 2011 +0000 intel_stepping: Include clocks in summary Signed-off-by: Chris Wilson commit 592b1a51ffa8944da1673e844bfccd0c40cf0a20 Author: Chris Wilson Date: Thu Feb 10 11:00:49 2011 +0000 tools/intel_bios_reader: use correct printf format for size_t intel_bios_reader.c: In function ‘dump_backlight_info’: intel_bios_reader.c:192:22: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘unsigned int’ [-Wformat] Signed-off-by: Chris Wilson commit 73dd92f85b6321a863dac2a1d22600ad03b3b5d9 Author: Chris Wilson Date: Thu Feb 10 10:59:54 2011 +0000 tools/intel_disable_clock_gating: Remove unused variable intel_disable_clock_gating.c: In function ‘main’: intel_disable_clock_gating.c:38:11: warning: unused variable ‘temp’ [-Wunused-variable] Signed-off-by: Chris Wilson commit 56167d8bfd7dcd6959e3f0465b09833f2906baec Author: Chris Wilson Date: Thu Feb 10 10:56:27 2011 +0000 tools: Do not install intel_gpu_dump It has been supersede by intel_error_decode for the user-facing role of obtaining debug info after a crash. Signed-off-by: Chris Wilson commit c407041ebbe0ad1944dc713ec342fd9b57efb8b2 Author: Chris Wilson Date: Thu Feb 10 10:54:39 2011 +0000 tools/intel_gpu_dump: Replace asprintf with snprintf The maximum filename is limited so we can simply use a large buffer rather than fail to check the error return from asprintf. Signed-off-by: Chris Wilson commit 2c9b293927b5f6bd48c71e2657ca5d7a524a59f8 Author: Chris Wilson Date: Thu Feb 10 10:50:48 2011 +0000 tests/intel_reg_dumper: Replace asprintf with snprintf Stops the compiler warning about not checking the potential error return from asprintf, which was a false positive anyway. Signed-off-by: Chris Wilson commit d4127e0e68315b668a4d9aea62ec43e03ccb86e7 Author: Chris Wilson Date: Wed Feb 9 10:24:39 2011 +0000 tests: Move potential machine killers away from distcheck Signed-off-by: Chris Wilson commit a5bbd5ea7122fef2c66980805c110e4f095406cb Author: Chris Wilson Date: Wed Feb 9 10:21:27 2011 +0000 tests/gem_exec_blt: Compile fix commit 68b64f1b399e712a3b96b91568dc2b6d7e9b35d9 Author: Javier Jardón Date: Tue Feb 8 22:33:12 2011 +0000 build: Update autotools configuration Replace deprecated macros and use the new libtool syntax Also use silent-rules to make the build option less verbose. commit 293dd478d713eee5cedfa04749c97d1aa850df3c Author: Chris Wilson Date: Tue Feb 8 12:04:17 2011 +0000 configure: Bump the libdrm dependency Whoops, should have done this ages ago for I915_EXEC_BLT Signed-off-by: Chris Wilson commit c91951de0e7b412fa02facf349c8912348cb1aa4 Author: Chris Wilson Date: Sun Feb 6 10:18:53 2011 +0000 gem_linear_blits,gem_tiled_blits: Add optional count Signed-off-by: Chris Wilson commit 0995b563341c9e34f4b6314c67d4671a516fb1b0 Author: Chris Wilson Date: Tue Feb 1 13:35:16 2011 +0000 Fix basic blt test for SNB Signed-off-by: Chris Wilson commit 0e50b972de4ea7e883b6cea608311fbd84b2961b Author: Chris Wilson Date: Sun Feb 6 10:12:42 2011 +0000 Fix typo excluding Ironlake from IS_INTEL Signed-off-by: Chris Wilson commit 74895a2344a3839c5c8f9b41438e226b9d72efc1 Author: Chris Wilson Date: Sat Feb 5 10:09:38 2011 +0000 gem_tiled_blits: Minor enhancements Include a simple series of blits that exhaust the aperture but have the maximum grace time between reuse. Signed-off-by: Chris Wilson commit 91b1c62a9c1e625d6c84cab354ed66d08239faa9 Author: Chris Wilson Date: Sat Feb 5 10:09:38 2011 +0000 gem_linear_blits: Minor enhancements Include a simple series of blits that exhaust the aperture but have the maximum grace time between reuse. Signed-off-by: Chris Wilson commit f343805d169a99f7daa12df88bdf3da7e7085482 Author: Chris Wilson Date: Wed Feb 2 10:32:52 2011 +0000 Simplify gem_linear_blits By doing everything manually we can indeed exercise the full GTT. Signed-off-by: Chris Wilson commit 9fd7e35c39a2fd82b95376c8a8a8424bc79f2d23 Author: Chris Wilson Date: Tue Feb 1 19:22:32 2011 +0000 Simple test to ensure that working sets larger than memory, just work. Based on gem_tiled_blit, but without the complication of the tiling. Signed-off-by: Chris Wilson commit 68a95f0e389096e7e4d87cd87dbb09edaca9909b Author: Chris Wilson Date: Tue Jan 25 16:34:08 2011 +0000 error decode: Search for first i915_error_state Handy for multi-GPU systems where the IGFX may not be first. Signed-off-by: Chris Wilson commit 3c5c8ba71c4c32dcac1cf0493210d21fc9b33c8a Author: Chris Wilson Date: Tue Feb 1 13:35:36 2011 +0000 Search for the first Intel dri device. This is vital in a multi-GPU system so that we only test the Intel card and not the discrete GPUs. Signed-off-by: Chris Wilson commit c1e9795050b1e4b76c7f9acd3cc5071f0ecb06ed Author: Chris Wilson Date: Tue Feb 1 11:12:40 2011 +0000 tests/gem_tiled_fence_blits: Ensure the bo count is odd In order to avoid a self-copy, the number of bo must not be even. Signed-off-by: Chris Wilson commit 371f87f2d825900484e34a8ec78272b9e62cbc02 Author: Chris Wilson Date: Tue Feb 1 10:53:57 2011 +0000 Exercise the whole aperture with tiled blits After full-gtt, gem_tiled_blits doesn't allocate enough to force eviction. So query the total aperture and accommodate. Also introduce a similar test that utilizes fences rather than use the BLT to perform the tiling and detiling. Signed-off-by: Chris Wilson commit 5fc09c82d40113a7ebf67b7dbc374c181d9fafe3 Author: Chris Wilson Date: Fri Jan 21 00:43:11 2011 +0000 Time blt vs pwrite Signed-off-by: Chris Wilson commit 07d59b308d1d71c350e99ac2a889e5d0110a69d8 Author: Chris Wilson Date: Thu Jan 20 22:10:10 2011 +0000 Add a simple test to execute n nop batches Signed-off-by: Chris Wilson commit ed385ea331b1d7d284c6e2e0165f01d1af1f4513 Author: Chris Wilson Date: Thu Dec 23 12:44:51 2010 +0000 Add a GTT timing test Using for basic benchmarking and diagnosing some mysterious slowdowns. Signed-off-by: Chris Wilson commit 281285ec702bceecaffbdcbc5c1a3cc4591e500c Author: Chris Wilson Date: Sat Jan 29 16:12:38 2011 +0000 bios: Parse SDVO panel DTDs Signed-off-by: Chris Wilson commit afaf5ef27cafad5a0fc0ad2fb870e1a7ea8743a1 Author: Chris Wilson Date: Sun Jan 9 14:01:47 2011 +0000 gpu-top: Correct computation of ring size Signed-off-by: Chris Wilson commit 98eb5a5e240fbdf8067c2bee48afe749feeca12f Author: Chris Wilson Date: Sun Jan 9 13:26:50 2011 +0000 error: Parse ring name before gtt_offset Signed-off-by: Chris Wilson commit d9ec63b1a0c41c96af676cd9d642bf622be1788f Author: Chris Wilson Date: Fri Jan 7 19:59:00 2011 +0000 intel_gpu_top: Include BLT ring Signed-off-by: Chris Wilson commit 5503ac9e1907ed905a29986d0db8beb468273827 Author: Chris Wilson Date: Fri Jan 7 19:42:29 2011 +0000 intel_gpu_top: Wake the GT power well to read gen6 ring registers Signed-off-by: Chris Wilson commit 4f20844247e72811c2f3655e24cb45dc920340d6 Author: Chris Wilson Date: Thu Dec 23 19:44:14 2010 +0000 error decode: print out class of chipset in the error report Signed-off-by: Chris Wilson commit f19a1942c2a3da4b65dff029ecfd9d20a132765d Author: Chris Wilson Date: Thu Dec 23 12:44:51 2010 +0000 Add a GTT timing test Using for diagnosing some mysterious slowdowns. Should include a variant for basic benchmarking... Signed-off-by: Chris Wilson commit 322563027cabbdbd21c1ecee4cec4b89b3028ce6 Author: Jesse Barnes Date: Tue Dec 21 12:06:00 2010 -0800 tools/bios_reader: try to dump more child device data Some of our device class defines were incorrect, and we were missing several recent ones, so fix those up and dump more child device data if we have it. commit 5406c633a006eb76a81b73d27cc3be1754b0718f Author: Jesse Barnes Date: Tue Dec 21 09:38:23 2010 -0800 tests: add display testing program Just a simple program to light up all detected outputs at their native mode and respond to hotplug events. commit 253acc34af6fb9976a8d54991560dec5920af20b Author: Eric Anholt Date: Thu Dec 16 16:42:52 2010 -0800 intel_disable_clock_gating: New tool for turning off clock gating on ILK. This is something I sometimes want to do in testing, to see if a mystery bug (say, 29172) is due to broken clock gating. Sadly, in this case it isn't. Note that it isn't supported on non-ILK chipsets yet. commit 19b412b37cd3474200a2c6fe0cdb11af0c0f98cb Author: Eric Anholt Date: Tue Nov 16 09:25:56 2010 +0800 intel_gpu_top: Print stats regs on Ironlake as well. commit 292ae4538a922f93eec1958b6073e83baab4e1c7 Author: Chris Wilson Date: Fri Dec 10 15:31:59 2010 +0000 error-decode: stdin is 0 not 1 Signed-off-by: Chris Wilson commit 94de0b46b5b2c80dc34a145ec47a34b13a1f7937 Author: Chris Wilson Date: Sat Dec 4 14:12:19 2010 +0000 decode: Add a couple of BLT MI. Signed-off-by: Chris Wilson commit 1e4cf7dbbe4fcc86c551567975f121589c721f97 Author: Chris Wilson Date: Sat Dec 4 11:41:30 2010 +0000 gpu-dump: Include BLT and BSD ringbuffers Signed-off-by: Chris Wilson commit 157207ada5d92ce47c03f64f953ee3955de164e1 Author: Chris Wilson Date: Fri Dec 3 00:41:43 2010 +0000 decode: Add some missing protection against short buffers for gen6 instr Signed-off-by: Chris Wilson commit 3dafead3f25cf2118637d131a9da1d06da4cae02 Author: Chris Wilson Date: Thu Dec 2 23:05:16 2010 +0000 dump-decode: allow specification of devid, i.e. gen Signed-off-by: Chris Wilson commit a3a78632bd1ae873b3946d22271d4002daccc34b Author: Chris Wilson Date: Wed Dec 1 21:51:59 2010 +0000 error-decode: Operate as a pipe and accept input from stdin Useful for feeding in compressed files from bugzilla: $ bzcat /tmp/i915_error_state.bz | intel_error_decode | less Next step would be to use gzfopen or bzfopen to automagically handle compressed files... Signed-off-by: Chris Wilson commit aa0a346deb208386e3f39253efd0693621841535 Author: Chris Wilson Date: Mon Nov 29 16:06:46 2010 +0000 decode: Improve parsing of i915 fixed-length indexed primitives Signed-off-by: Chris Wilson commit d4d769a4329f3f22842f8270fca46047bd4892ce Author: Chris Wilson Date: Tue Oct 26 10:59:18 2010 +0100 Prepare for split BLT ring on Sandybridge. Depends on libdrm 057fab3382c02af54126ce395c43d4e6dce9439a Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=31123 Signed-off-by: Chris Wilson commit 8934395d9d3b5910a52785d69a8da4516c4d82a6 Author: Chris Wilson Date: Fri Oct 22 11:33:08 2010 +0100 Decode PGTBL_ER for i965 Signed-off-by: Chris Wilson commit 8a4fc850a820cb555dfe7c1a6ddd068cb0039308 Author: Chris Wilson Date: Fri Oct 1 22:22:28 2010 +0100 intel_gpu_top: Sample BSD rings as well as render Show how busy the GPU is when decoding video as well as rendering. Signed-off-by: Chris Wilson commit 4eef00a8fbb0602914e7bf903c78fecb4b888ef1 Author: Zhenyu Wang Date: Wed Sep 29 09:47:46 2010 +0800 decode: fix PS sample state change bit on sandybridge Signed-off-by: Zhenyu Wang commit dbc547dbb525827a53543267bd38451c475e7c54 Author: Zhenyu Wang Date: Mon Sep 27 13:34:52 2010 +0800 intel_decode: decode 3d commands for sandybridge Signed-off-by: Zhenyu Wang commit b95893820fd0b8e0af3d5c80110884acdb934666 Author: Zhenyu Wang Date: Mon Sep 27 13:24:52 2010 +0800 Add all sandybridge device ids Signed-off-by: Zhenyu Wang commit 7ab19ae6feb06fa8140a16333fc7670936af80ac Author: Jesse Barnes Date: Mon Sep 20 14:37:07 2010 -0700 intel_reg_dumper: eDP port is on the CPU, not PCH Made me think there was another register until I checked the offset. commit 4f12d8acbaa3a253d8b21d04bbfe17ed9ede6158 Author: Adam Jackson Date: Wed Sep 8 14:39:12 2010 -0400 bios_reader: Fix to work on non-Intel machines Actually, fix to work on _any_ machine where the ROM file doesn't match the GPU. Just extract the device ID from the ROM itself rather than look at the running system. Signed-off-by: Adam Jackson commit c09fa38c01e44581db37703bb6b8cf1b60b2d09f Author: Chris Wilson Date: Sun Sep 5 12:05:52 2010 +0100 reg dumper: Dump ILK panel fitting control debug registers Signed-off-by: Chris Wilson commit a462fa6e29bf64fd64d94274775f33b9918f5cbb Author: Chris Wilson Date: Sun Sep 5 10:53:12 2010 +0100 reg dumper: Fix ilk panel fitter filter shift Signed-off-by: Chris Wilson commit c935c6021449fa442c51858e3d9cd79e1cec62ab Author: Chris Wilson Date: Wed Aug 25 11:56:59 2010 +0100 tests: Fix fallout from s/EBADF/ENOENT/ in 2.6.36 After bf79cb914dbfe848add8bb76cbb8ff89110d29ff, drm uses ENOENT to report unknown handles buffer objects, update the tests accordingly. Fixes: Bug 29794 - some intel_gpu_tools cases fail https://bugs.freedesktop.org/show_bug.cgi?id=29794 Signed-off-by: Chris Wilson commit 14618620cc057293bce77f9a137a5f7df083beed Author: Chris Wilson Date: Wed Aug 25 11:55:25 2010 +0100 decode: Handle errors during parsing. Signed-off-by: Chris Wilson commit db91f220da8806a505e848ab35db7659b155fe1f Author: Chris Wilson Date: Wed Aug 25 11:54:54 2010 +0100 reg dumper: Add panel backlight detailed information Signed-off-by: Chris Wilson commit 74c8c8d6121cda1d91df29d471e58f6b68275a1c Author: Eric Anholt Date: Mon Jul 19 08:27:32 2010 -0700 intel_gpu_top: Fix the "limit printing to terminal height" again. commit 9e4ba53014f214750d8bba01f92bf3febf2ffb0d Author: Eric Anholt Date: Fri Jul 9 13:26:57 2010 -0700 intel_decode: Fix decode for gen6's moved VERTEX_ELEMENTS valid bit. commit aa4772c3c1c09f775e34e15533789094922f2e40 Author: Chris Wilson Date: Thu Jul 15 19:31:21 2010 +0100 dump decode: Add a non-installed program for decoding binary batchbuffer dumps. Rather than add yet another decoder into the drivers, I rather just emit a binary blob and use the decoder being developed here. As it is a pure debugging feature, lets not package it. Signed-off-by: Chris Wilson commit 2d1ad95423953c60fdc5b336d5dd1298ce2114c7 Author: Chris Wilson Date: Thu Jul 15 19:18:39 2010 +0100 error: Decode i915 PGTBL errors Signed-off-by: Chris Wilson commit cf255e382d147fe3ca450f0dcec3525190e7dcbc Author: Eric Anholt Date: Thu Jul 8 12:13:08 2010 -0700 intel_decode: Fix whitespace for importing to Mesa. commit b1e839d02652fcc5b19ee20d7feeb7e908df1c29 Author: Jesse Barnes Date: Wed Jun 30 02:02:49 2010 -0700 intel_reg_dumper: add some 945 MI reg dumping commit be6e1a53fc0fadedf24839e11d0bd2e0faca5126 Author: Adam Jackson Date: Wed Jun 30 11:18:00 2010 -0400 Use longer string padding in intel_reg_dumper on ironlake DIGITAL_PORT_HOTPLUG_CNTRL is 26 chars. Bump out to 30. Signed-off-by: Adam Jackson commit 439adf7a0af2613e13bf1b29b02ab084b39f072c Author: Adam Jackson Date: Wed May 5 11:46:27 2010 -0400 fix reg_dumper on systems without intel gpus commit 040fbc6ea3fd59024a41e85af273b0194901f27a Author: Chris Wilson Date: Tue Jun 15 13:05:48 2010 +0100 intel_reg_dump: Off-by-one in calculation of i965 fence pitch Signed-off-by: Chris Wilson commit 581205db44b834e8f056749819502fd833c1af10 Author: Zhenyu Wang Date: Thu Jun 3 10:31:04 2010 +0800 bios_reader: Fix SSC frequency parse for Ironlake/Sandybridge Signed-off-by: Zhenyu Wang commit 020abdb7cc52163a0f2dacd1b296b36ce1a31911 Author: Wu Fengguang Date: Mon Apr 19 13:13:06 2010 +0800 intel_audio_dump: add support for IbexPeak and CougarPoint Signed-off-by: Wu Fengguang Signed-off-by: Eric Anholt commit a52cbcbf5657a13e456af419c45a87b89bf56ca3 Author: Adam Jackson Date: Thu Apr 22 15:37:49 2010 -0400 bios reader: Decode device type from child device table Signed-off-by: Adam Jackson commit a5b1e98edb2f8f7f7f6449afaad8a1385cad3d4d Author: Chris Wilson Date: Fri Apr 16 22:23:44 2010 +0100 decode; Parse 3DSTATE_BUFFER_INFO Signed-off-by: Chris Wilson commit 5b9678e822b770825a4b17919a953009ac7abb02 Author: Chris Wilson Date: Thu Apr 15 09:53:00 2010 +0100 decode: Also override S2 for 3DPRIM_CLEAR_RECT 3DPRIM_CLEAR_RECT implicitly uses only VERTEX_XY and no texture coords. Signed-off-by: Chris Wilson commit c8f5ac542c91f2533db72abe30546df8fb8aee0f Author: Chris Wilson Date: Thu Apr 15 09:48:00 2010 +0100 decode: Use a valid S4 mask [VERTEX_XY] for 3DPRIM_CLEAR_RECT Signed-off-by: Chris Wilson commit 50b8272d0b28c1fde9e3ab07fcf011d14f41fb66 Author: Zhenyu Wang Date: Thu Apr 15 23:22:06 2010 +0800 update PCH HDMI debug info Signed-off-by: Zhenyu Wang commit eae80edbb3e6959d3acda963ee32db4f4a200533 Author: Zhenyu Wang Date: Thu Apr 15 01:25:50 2010 +0800 reg dump update for SNB/CPT Signed-off-by: Zhenyu Wang commit 2b40fc83d130d2850761aa1409e0716ace6dfe0b Author: Zhenyu Wang Date: Thu Apr 15 22:57:02 2010 +0800 Add PCH chipset type check for Cougarpoint Signed-off-by: Zhenyu Wang commit c3832aefbf9a4120f12283e3cb3e18d7daa04070 Author: Chris Wilson Date: Mon Apr 5 00:26:35 2010 +0100 decode: There are 4 unpreserved registers on i915, not 3. Signed-off-by: Chris Wilson commit 4278dc6e645c4b70b4029294e552aae5f57340ba Author: Chris Wilson Date: Wed Apr 14 22:30:58 2010 +0100 decode: CLEAR_RECT uses a fixed VERTEX_XY format. Signed-off-by: Chris Wilson commit 3d883c3d2576a460dd56dcb04b22d98022f3057b Author: Chris Wilson Date: Wed Apr 14 22:25:57 2010 +0100 decode: CLEAR_PARAMETERS has a fixed length bias of 5. Signed-off-by: Chris Wilson commit 58eb041970a6bd3732aaeb61cf427d0db088a663 Author: Chris Wilson Date: Thu Apr 8 12:00:00 2010 +0100 gitignore: Add missing intel_reg_snapshot commit 95374225e865da3a30153f73e8bb536700d15459 Author: Chris Wilson Date: Thu Apr 8 11:56:57 2010 +0100 Enable compilation on non-Intel, non-DRM systems. A few of the tools can be performed post-mortem from a different system, so it is useful to be able to compile those tools on those foreign systems. Obviously, any program to interact with the PCI device or talk to GEM will fail on a non-Intel system. Signed-off-by: Chris Wilson commit cd64e193299be4b9733a5e804cedd99e2072830f Author: Adam Jackson Date: Wed Mar 31 17:25:23 2010 -0400 intel_reg_dumper: Add support for reading register dumps from files Also add intel_reg_snapshot for creating such snapshots, and relevant documentation. Signed-off-by: Adam Jackson commit 2187ec2112750bb898416358ac5463eebbf30049 Author: Chris Wilson Date: Mon Apr 5 00:26:35 2010 +0100 decode: There are 4 unpreserved registers on i915, not 3. Signed-off-by: Chris Wilson commit 7682c42809078ad32552a2dae663510580158b28 Author: Eric Anholt Date: Wed Mar 24 12:01:00 2010 -0700 Fix INSTDONE1 bits on g4x, and use those on Ironlake too. commit b0ddd0688cccd41a4661a00bfd897a63f9a11279 Author: Eric Anholt Date: Wed Mar 24 11:40:07 2010 -0700 Add Ironlake INSTDONE bits. commit 7c9d69de5722fe492c3e06ec94d1c26013df2861 Author: Eric Anholt Date: Mon Mar 8 22:51:40 2010 -0800 intel_reg_dumper: Fix the i915 fence reg decode to not be pure lies. commit 4279006ff24376c47ed3efff95ed2239b0928954 Author: Chris Wilson Date: Sun Mar 21 19:33:45 2010 +0000 decode: Parse i915 MAP_STATE texture sizes and tiling Signed-off-by: Chris Wilson commit bfc2b5306fac21bda5fc09dbf031716fd53a0f78 Author: Chris Wilson Date: Thu Mar 4 21:56:04 2010 +0000 intel_error_decode: Pretty print i830 PGTBL_ER Signed-off-by: Chris Wilson commit f93dae8176d83791521eae23ab3c028cc7c93eee Author: Chris Wilson Date: Thu Mar 4 09:14:56 2010 +0000 decode: Fix length mask for LOAD_REGISTER_IMM. Signed-off-by: Chris Wilson commit bcaea4da8997ce09d580df351ae7919832882fc5 Author: Eric Anholt Date: Thu Feb 25 12:48:00 2010 -0800 intel_gpu_top: Print stats lines even when there's no done bit on the line. commit 9271e2256d7e86989587b001715fccc30400180e Author: Eric Anholt Date: Thu Feb 25 12:18:11 2010 -0800 intel_gpu_top: Print the vertex/primitive statistics on gen4+. This requires that the window be much wider. I'm not sure how we really want to lay out this interface usably, but so far giant windows are working well enough for me. commit c33f64ff955134aef2fc10cee4d48c6da4858549 Author: Chris Wilson Date: Thu Feb 25 18:52:15 2010 +0000 man: Add manpage for intel_error_decode A rudimentary manpage based on intel_gpu_dump for the simple tool for the post-processing of i915_error_state, intel_error_decode. commit 0e4e700c51fbed8f333f2642edadf1b46bf51cc5 Author: Eric Anholt Date: Tue Feb 23 17:04:29 2010 -0800 Fix a typo in intel_gtt(1). commit 17b8abdb6b9401768c9b1821ac33220d3b7eea5e Author: Eric Anholt Date: Tue Feb 23 17:00:54 2010 -0800 Add manpages for a bunch of recently-added tools. commit cb6bd9f73a6ff926cb4863c1fd3ad37a00f9c0b3 Author: Eric Anholt Date: Mon Feb 1 10:47:19 2010 -0800 Add decode for more Sandybridge packets. commit 291a576d72d234c42f5d9655ee0698f20eec8bd8 Author: Eric Anholt Date: Fri Jan 15 14:28:16 2010 -0800 Add support for Sandybridge INSTDONE regs. commit 67736dbc9435ab95ab4092d73a5b057039d14d30 Author: Eric Anholt Date: Fri Jan 15 14:28:02 2010 -0800 Add support for Sandybridge mobile chipset. commit 0fe5e9c1342a3baf9c15616febc74d203b43b2d4 Author: Eric Anholt Date: Fri Jan 15 14:27:41 2010 -0800 intel_gpu_dump: More SNB packets. commit 334f76d22de1098fb209c08c8ae45b8d71c4ed6a Author: Eric Anholt Date: Fri Jan 15 14:26:43 2010 -0800 intel_gpu_dump: Use the spec's names for the INSTDONE regs printed out. commit 35233864413ff74e26a29b7807ec7413cde6e7cc Author: Eric Anholt Date: Thu Dec 17 14:21:28 2009 -0800 Add Sandybridge decode for CMD_VIEWPORT_STATE_POINTERS commit 0a497420cd170e0eb1109dd03dab04232d7e9ce2 Author: Eric Anholt Date: Tue Dec 15 12:38:23 2009 -0800 Add Sandybridge STATE_BASE_ADDRESS decode. commit 24ea25de39cc2f4e9e2052f90f4e93ad98d98c19 Author: Eric Anholt Date: Tue Nov 3 16:15:25 2009 -0800 intel_gpu_dump: Add support for sandybridge DEPTH_BUFFER and BINDING_TABLEs. commit 613d1c48968bf5b6130d01a3408a70fc2d1307ee Author: Eric Anholt Date: Thu Oct 22 15:52:02 2009 -0700 Add some initial definitions for Sandybridge. commit c94174d106b0b7c97643309ec85d763b0429ef11 Author: Chris Wilson Date: Thu Feb 25 11:05:16 2010 +0000 decode: Parse MI_BATCH_BUFFER for i8xx Signed-off-by: Chris Wilson commit 0583c22cdfb71cb43153cf7c17aa775ae660f96c Author: Eric Anholt Date: Fri Feb 19 12:23:16 2010 -0500 Add intel_bios_dumper from the 2D driver. Last of the tools, finally! commit 22fd4c370c2a04702fd5fabd6bbd16988b4a8225 Author: Eric Anholt Date: Fri Feb 19 12:12:04 2010 -0500 Move the intel_lid tool from the 2D driver to here. commit 9eb4de10a1ff3df3a455efb63a51ea9d5480d72d Author: Chris Wilson Date: Fri Feb 12 13:28:40 2010 +0000 Add intel_error_decode. A simple variant of intel_gpu_dump that explicitly handles parsing of i915_error_state. Signed-off-by: Chris Wilson commit a5846bff27ccd4f148c883177c9516c3f06da4b0 Author: Eric Anholt Date: Mon Feb 1 15:02:24 2010 -0800 intel_gtt: Add intel_gtt from the 2D driver. We've used it several times in bringing up the AGP driver, so it seems useful to have aronud. commit 65f1f881b7a4a547c6ebdb75f8bddc99636210b9 Author: Chris Wilson Date: Thu Jan 28 22:52:50 2010 +0000 intel_gpu_dump: Parse ringbuffer info from i915_error_state Distinguish an inline ringbuffer [-- ringbuffer] dump, from batch buffers [-- gtt_offset] and separate it in the decoded output. Signed-off-by: Chris Wilson commit 6c1125d95804dafc72f16deafd345d7523d9dd24 Author: Zhenyu Wang Date: Thu Jan 21 09:39:29 2010 +0800 Remove extra aclocal flag after replace dolt and shave Signed-off-by: Zhenyu Wang commit 7daa481bb7cdb06630a42fe45c2a59d677cf8af1 Author: Zhao Yakui Date: Tue Jan 5 14:13:43 2010 +0000 reg_dump: Dump display port register on Ironlake Dump the display port register on Ironlake. Signed-off-by: Zhao Yakui Signed-off-by: Eric Anholt commit 97ffee66ae240fdebe8142f4f43687b1772a9350 Author: Zhenyu Wang Date: Tue Jan 12 14:04:43 2010 +0800 Pull bios_reader program from Xorg driver Signed-off-by: Zhenyu Wang commit 087d74b33544b07ec4413cd6622b2eb9b0dbfa73 Author: Zhenyu Wang Date: Wed Jan 6 13:43:54 2010 +0800 gitignore intel_audio_dump and intel_reg_read Signed-off-by: Zhenyu Wang commit 4cc8b0543a9afc3209ff02f5739f7a38ff484dd8 Author: Zhenyu Wang Date: Wed Jan 6 13:39:05 2010 +0800 Add 'intel_reg_read' tool This is a handy tool to just check state of one register, which might not bother to be included in intel_reg_dumper tool. And also take in Ben's original full range register dump with '-f' option. Signed-off-by: Zhenyu Wang commit 5afb8ff68b87c4ae00b2ac2c3124515c1c71272b Author: Chris Wilson Date: Tue Jan 5 12:33:17 2010 +0000 gpu_dump: Parse INSTDONE if seen inside a file. Signed-off-by: Chris Wilson commit e30f06fbb927a7348630d5c2ad64982068475b58 Author: Chris Wilson Date: Tue Jan 5 12:32:32 2010 +0000 reg: Include INSTPM in dump. Signed-off-by: Chris Wilson commit 55950195da6ab0cb6d931dae2733628a97286bde Author: Chris Wilson Date: Tue Jan 5 12:31:12 2010 +0000 decode/i965: Show byte lengths for buffers. Signed-off-by: Chris Wilson commit 7f63b95c06ee49afcc6547128f8d582b91694d40 Author: Shuang He Date: Mon Dec 14 14:10:02 2009 +0800 intel_gpu_top: Fix broken clock reporting. Signed-off-by: Eric Anholt commit 4e6400c4bbba2a35c7dc5396c69ca4444682b07f Author: Eric Anholt Date: Mon Nov 2 11:20:23 2009 -0800 Replace dolt and shave with using current autotools. commit b4b8aafc61f48be9c1bfef7cf2c055201aeb4711 Author: Kenneth Graunke Date: Tue Dec 8 22:38:18 2009 -0800 Limit printing to terminal height in intel_gpu_top. When using intel_gpu_top in a small terminal, the most important information (ring idle/busy units) scrolls off the top of the screen. This patch limits the number of lines printed to the terminal height so that the most idle units (at the bottom) are truncated instead. Signed-off-by: Kenneth Graunke commit 94a180c0c95d70983ca15ada1de5d8624a68211e Author: Chris Wilson Date: Mon Nov 30 15:20:29 2009 +0000 decode: Split decoder and reuse outside of intel_gpu_dump Introduce a second decoder that simpler operates on a file so that it can be run on dumped batchbuffers independent of the gpu. Signed-off-by: Chris Wilson commit 9e9c9f24f5d5520ab6a2451aab7dc81d2abc8cdf Author: Wu Fengguang Date: Fri Nov 6 11:06:22 2009 +0800 Add: tools/intel_audio_dump Signed-off-by: Zhenyu Wang Signed-off-by: Wu Fengguang commit b4ddf71a4ae45e24fc0947194048b56e45c18456 Author: Chris Wilson Date: Thu Oct 8 06:48:02 2009 +0100 Add: tools/intel_gpu_time A simple variant on time crossed with intel_gpu_top to estimate the amount of GPU activity during a program's execution time. The resource usage (sys+user, i.e. CPU %) is for the child, but the GPU measure is global. Hmm. Signed-off-by: Chris Wilson commit 40bff5071c8e5bce785f9c56b7d98f12fc3ae2c2 Author: Eric Anholt Date: Tue Oct 6 17:25:10 2009 -0700 Add intel_gpu_dump from the 2D driver. commit d48fc144cab31b0a776992b2a8eba30b101a21f4 Author: Eric Anholt Date: Mon Sep 21 15:00:56 2009 -0700 Bump to 1.0.2 for release. commit 15ba3a5fc6556ce408723e4a9f05b1830316115b Author: Carl Worth Date: Thu Sep 17 15:05:24 2009 -0700 Print unmatched opcode value for all 3D UNKNOWN messages This just simplifies one step for fixing up an incompletely-parsed dump. commit bbebf6b1c90b5c777e1a155818e3194e1c3889bc Author: Xiang, Haihao Date: Thu Sep 3 09:50:00 2009 +0800 Add support for new chips Signed-off-by: Xiang, Haihao commit b20efcf585af65b1cff8b76b8bac5af9252d9391 Author: Xiang, Haihao Date: Thu Sep 3 09:35:50 2009 +0800 CS FENCE in URB_FENCE is 11-bits wide Signed-off-by: Xiang, Haihao commit 84a877511f2a85274ef0f22ea01249b1440e95c5 Author: Xiang, Haihao Date: Thu Sep 3 09:33:36 2009 +0800 Fix the length of CONSTANT_BUFFER Signed-off-by: Xiang, Haihao commit 61237b98bb02479bfa9eefe5e6bf62a3ce9468f7 Author: Eric Anholt Date: Mon Jul 20 11:46:11 2009 -0700 intel_gpu_dump: Don't pretend we understand vertex formats on 8xx. commit b66d2feb6981c41fae9eea003e7e55ff531d1317 Author: Eric Anholt Date: Mon Jul 20 11:44:56 2009 -0700 intel_gpu_dump: Parse LOAD_STATE_IMMEDIATE_2 for 830. commit 7bc13bc00c028162dbf402a8ebda6203c50c3179 Author: Eric Anholt Date: Mon Jul 20 09:14:43 2009 -0700 intel_gpu_dump: Add IPEIR and PGTBL_ER to output. commit 56bdcd1d6b434cd37bfc47d295abaf37f0093c84 Author: Eric Anholt Date: Mon Jul 20 09:07:16 2009 -0700 Add INSTDONE bits for 830-865. commit 1cbfe0ea6aea4a1bef6528cb72308c9571636c62 Author: Eric Anholt Date: Thu Jul 16 14:15:47 2009 -0700 intel_gpu_dump: Fix decode for LOAD_STATE_IMMEDIATE_1 with S8 set. commit d9e28e63e5a11f0707516b2eff648b1c2c99598a Author: Eric Anholt Date: Mon Jul 13 10:03:17 2009 -0700 Add a manpage for intel_reg_write commit d83a417c0158b5385835d520c1ed46fd6e5fd683 Author: Chris Wilson Date: Thu Sep 3 10:58:59 2009 +0100 dump: Minor typo commit 8f3f862b961c5b28ccdb42faff7b279aafcec652 Author: Chris Wilson Date: Tue Sep 1 10:09:55 2009 +0100 Add gem_fence_thrash test This is a test case that overcommits fence registers between threads, which are copying from one fenced bo to another. In earlier versions of the driver this would cause excessive spinning as the first inactive (i.e. not in use by the GPU) would be used to service the next page. After all the fence registers had been allocated, in effect only the very first fence would then be used for all subsequent faults. commit 4839ee97875d07a27c28f39021178d2cf4b5d4b8 Author: Ben Gamari Date: Wed Jul 1 16:52:20 2009 -0400 Add CS_USB_STATE decoding commit 147f07b5c2248f57c75961b80e717bd83fcaa44b Author: Ben Gamari Date: Wed Jul 1 16:52:19 2009 -0400 Add CONSTANT_BUFFER decoding commit 357e43a4f1e1e4561fa1ced59c47e1b489b21b2b Author: Ben Gamari Date: Wed Jul 1 16:52:18 2009 -0400 Fix gs_fence output in URB_FENCE output commit e302d0fe89596ff5a12ae6b098ec5094154f9a4e Author: Ben Gamari Date: Wed Jul 1 16:52:17 2009 -0400 add realloc bits to URB_FENCE decoding commit 3fda98b4db5d0308cd6cbb984871ea52aca6cc5c Author: Carl Worth Date: Fri May 8 16:04:24 2009 -0700 Fix error message for case of kernel prior to 2.6.30 The error message was falsely claiming that a debugfs directory didn't exist, when it was supposed to report that the ringbuffer file did not exist within that directory. commit 324428ca82ce96e2e64b724682833baf16ee6616 Author: Eric Anholt Date: Tue Jun 30 18:05:57 2009 -0700 .gitignore: catch up to intel_reg_write addition commit eb239afeb7c04ffec6570959b050edda7131dcf2 Author: Eric Anholt Date: Tue Jun 30 17:52:43 2009 -0700 intel_gpu_dump: Add instdone register values and decoding. commit 3904b7c6a266538eaf749c90445970601239e0a2 Author: Eric Anholt Date: Tue Jun 30 17:13:27 2009 -0700 intel_gpu_top: Move instdone bit definitions to lib to share with _dump. commit 21b6f2600d2eda8e9c10ab9b123ebe79431779f7 Author: Eric Anholt Date: Tue Jun 23 19:35:19 2009 -0700 intel_gpu_dump: Use the correct IPEHR on pre-965. commit eafbad3707fcbe36cc37c4acd62b8612e82757ae Author: Eric Anholt Date: Tue Jun 23 18:43:59 2009 -0700 intel_gpu_dump: Add details on URB_FENCE. commit bf3b1a3da95a1190ad09a0007be6c4c45d76627b Author: Eric Anholt Date: Tue Jun 23 18:16:42 2009 -0700 Oops, fix up printed hw offset since the HEAD pointer fixup commit a18af8ed43b092408196948b1ec3d7f9a8d7065c Author: Eric Anholt Date: Tue Jun 23 17:10:44 2009 -0700 Add more 965 INSTDONE bits. This shows off the units that are stuck busy in the ut2004 hang. commit da2c7f35c7b3059e09b4ffe680975fac0d6eb7c0 Author: Eric Anholt Date: Tue Jun 23 16:22:41 2009 -0700 Correctly flag the acthd when it points within a packet. commit 12ceecf971e416fbd8be921ea187f68238878c0c Author: Eric Anholt Date: Tue Jun 23 16:21:34 2009 -0700 Add the acthd to the GPU dump. commit c25532cc613c9daf87e97d04aec2ad708bec9b3b Author: Ben Gamari Date: Wed Jun 10 23:13:40 2009 -0400 Add register writing tool Signed-off-by: Eric Anholt commit bbafc3d0bf851f0f1a2de6cdc7f2923a2387e775 Author: Jesse Barnes Date: Thu Jun 18 18:07:47 2009 -0700 Four new tests for error handling Add four new tests for error the error handling cases: - gem_bad_address - store to a bad address, should generate a protection or page table error - gem_bad_batch - try to execute a bad batch, should generate a protection, invalid instruction or page table error - gem_bad_blit - blit to an invalid location, should generated a protection or page table error - gem_hang - hang the GPU on an event that will never happen, test hang detection & recovery code commit 49c564ec2fa47f62d097c7dee42730ae43445f8b Author: Eric Anholt Date: Tue Jun 9 11:30:25 2009 -0700 Make the precentage bars fit in 80 columns. Signed-off-by: Eric Anholt commit 8c7be935443934297763af03f0b4b7fcd4999dde Author: Robert Bragg Date: Fri Apr 17 19:01:04 2009 +0100 A pedantic addition of a format string to a printf call The printf used to clear the screen didn't have a format string, this adds one to avoid a compiler warning. Signed-off-by: Eric Anholt commit 700e45a5225dbf06ada48c269d725458ceb347a6 Author: Robert Bragg Date: Fri Apr 17 18:52:23 2009 +0100 Adds unicode bars for quickly visualizing the busy percentages It can be a bit easier to digest the percentages with bar graphs than by scanning continually changing numbers. Signed-off-by: Eric Anholt commit 2f0c0aa8ae0649e8b05d74fed9115a4a62aa7e7f Author: Robert Bragg Date: Fri Apr 17 16:25:52 2009 +0100 Increases the sample frequency from 100/sec to 10,000/sec For a typical vsync locked application running at 60fps, sampling at just under twice a frame doesn't seem to give very stable lists of relevent hardware units because there are a number of units involved that may not be sampled one second to the next. This bumps the sample rate to 10,000 instead which is ~ 170 samples per frame so we tend to hit all the units involved. It also changes the report threshold to a sample count >= 1, so you don't see as many units with a percentage of 0. Signed-off-by: Eric Anholt commit 2a50faae7e9d674dac60b51101aa8bf653a0b7a3 Author: Robert Bragg Date: Sun Jun 7 23:26:18 2009 +0100 Revert "intel_gpu_top:print a visual clue on how big a certain use is" This reverts commit 5e13b98da1e7e31cffba84fd257002357d5f2682. We can print prettier graphs using unicode Signed-off-by: Eric Anholt commit 114763f4190260e326cf4e82806fc07c7022d934 Author: Eric Anholt Date: Thu Jun 4 14:38:17 2009 +0000 intel_gpu_top: Print GPU clock information, which seems interesting. commit 5e13b98da1e7e31cffba84fd257002357d5f2682 Author: Arjan van de Ven Date: Tue Apr 28 12:05:43 2009 +0100 intel_gpu_top:print a visual clue on how big a certain use is humans are pretty bad at reading percentages quicky; this patch adds a histogram capability to make it more visually clear as to which lines are big ticket items commit 0521bca629a1d350fd5807516cfa0f3d0fc215de Author: Eric Anholt Date: Tue May 19 16:48:40 2009 -0700 Bump version to 1.0.1 for release. commit 3365c8563a3e0ac0d86d01f956301a23a7d8dc92 Author: Eric Anholt Date: Tue May 19 16:32:39 2009 -0700 intel_gpu_dump: Stop decoding batchbuffers after MI_BATCH_BUFFER_END. commit 652d5518d6901f4ebe0f696b8d7e18b8edfc76ec Author: Eric Anholt Date: Tue May 19 16:26:35 2009 -0700 Add decode of gen4 PIPE_CONTROL commit b7d70fc1fdb8b1b29ce62a6d75c2aca2b5314b7e Author: Eric Anholt Date: Tue May 19 16:12:43 2009 -0700 Add decode of dest buffer variables (destination format) (cherry-pick from Mesa commit 0af7e9170fd7c0d906652378b9f78fe2ba9725ad) commit e71c6283022d91e3884374fa145b936cba330a66 Author: Eric Anholt Date: Tue May 19 16:09:08 2009 -0700 Add manpages for all installed binaries. commit 49cba961a2914df0d308ef22d257c9c60ecd02f7 Author: Eric Anholt Date: Tue May 19 15:53:55 2009 -0700 Add gem_largeobject to ignore. commit 433e1c85a0a512d2d58775bf10ddadeb43fe7ed8 Author: Jesse Barnes Date: Thu May 14 14:39:48 2009 -0700 tests: add large object test The large object test simply tries to allocate a 128M object, pin it, then pwrite the whole thing. This should make obvious any leaks on close or page pointer allocation failures. commit c9de42933223e53f326a46cffc98d24d540dc694 Author: Eric Anholt Date: Mon Apr 27 09:45:22 2009 -0700 Fix distcheck commit 49ccc2bfc21f89fdd1dd823969ad5ddd82b2e67e Author: Eric Anholt Date: Mon Apr 27 09:41:41 2009 -0700 .gitignore libtool junk commit 7583e811a57d72b47ec721fcc91b2f7ad0b6a770 Author: Eric Anholt Date: Mon Apr 27 09:39:05 2009 -0700 intel_gpu_top: Add ring information. commit 302d15f2e7cd77bf2bfef5a142688cdf07fc59fc Author: Eric Anholt Date: Mon Apr 27 09:35:40 2009 -0700 Add a test to try to fill the ring. Did this while trying to debug the Ubuntu DRI1+compiz issue. Didn't succeed in filling the ring. commit 28a1d6436e5067221b03c820c1b6fee2ef21d496 Author: Carl Worth Date: Mon Apr 13 14:35:11 2009 -0700 intel_gpu_dump: Use asprintf instead of a static-sized array Not that we're really concerned about buffer-overrun attacks against this utility, but still, good habits and clean code are always preferred. commit 5b8c19445cdd736d679e12be196cd4db0aac0cb1 Author: Carl Worth Date: Mon Apr 13 14:33:09 2009 -0700 intel_gpu_dump: Give a nicer message for missing batchbuffer-dumping code This is the case where debugfs is mounted, the dri/0 directory exists but there's no i915_ringbuffer_info file. Point the user toward upgrading the driver. commit 0a820610ee733f348f9331c677f74cc88bc46486 Author: Carl Worth Date: Mon Apr 13 14:06:00 2009 -0700 intel_gpu_dump: Mention filename in error message This helps for when the user makes a typo trying to pass a file or directory name to intel_gpu_dump. commit 660a20f611adb0a176cecce1b2abfe9ec5accd05 Author: Carl Worth Date: Mon Apr 13 14:02:04 2009 -0700 Add example command for mounting debugfs This is a nice opportunity to teach the user something, (and help our users to actually succeed in creating useful bug reports for us). commit 48888093b2da0b7809d465d111e9c0cc92bb6c5e Author: Eric Anholt Date: Sun Apr 12 18:03:25 2009 -0700 intel_gpu_dump: Add no-arguments automatic mode, and clean up comments. commit 5b40c86c9a714936938d19cc095f038ee904c94c Author: Eric Anholt Date: Sun Apr 12 17:49:31 2009 -0700 intel_gpu_dump: Dump ring, batch, and head/tail info when given the directory. commit d69042dde69ca4a04f5e949130026447b8890cfc Author: Eric Anholt Date: Sun Apr 12 17:04:31 2009 -0700 intel_gpu_dump: Decode the GTT offset of batchbuffers. commit 593a47f00e3c9cb3f748daae7d3fe04427c7e0c2 Author: Eric Anholt Date: Sun Apr 12 15:57:07 2009 -0700 intel_gpu_dump: Get the devid so we can decode correctly on gen4. commit b51588b9bd8a1a18a77d354b1c9fe4c841dff0f3 Author: Eric Anholt Date: Tue Apr 7 19:07:18 2009 -0700 Fix warning about assert in intel_batchbuffer.h commit 548a6a7fa2037415cade339252ed29a7f89ff9f7 Author: Eric Anholt Date: Tue Apr 7 16:21:16 2009 -0700 Add a test for reading tiled objects with pread. commit cd9ba0a3b6c5e11fcd2cb82914cb9d491309de89 Author: Eric Anholt Date: Tue Apr 7 16:18:11 2009 -0700 Add a test for pread after blitting to an object. This caught a bug with get_user_pages usage in the kernel, which would result in zeroes being read out of the object when faulting in a new page. commit 00c7571fce14135fa6bbe387ab4e7ce205d53c08 Author: Carl Worth Date: Tue Apr 7 16:22:46 2009 -0700 Add very preliminary intel_gpu_dump program Right now it requires a filename on the command line, (such as /debug/dri/0/i915_batchbuffers). We plan to make it smarter in the future by going out and collecting all the data it needs. commit 90ca63163d250e2d50d01aa06f9fc158c0fb6ced Author: Carl Worth Date: Thu Apr 2 11:53:38 2009 -0700 Add Eric's batchbuffer-decode code This comes from the 3D driver within mesa, with identically named files. In its new life here it will become a standalone program. commit 3b301df9ecf652d1d26fbcc5083cdfd70c800a8b Author: Eric Anholt Date: Fri Apr 3 14:23:06 2009 -0700 Add a regression test for tiled object blitting. commit cb5a35fe8ebe959291082a15395a619b40c562a7 Author: Eric Anholt Date: Mon Mar 30 19:17:12 2009 -0700 Add a couple of other intel_upload_blit_large variants for comparison. commit 7889abd2631b418d4bb9fb90a758f23f37d2f098 Author: Eric Anholt Date: Mon Mar 30 19:09:00 2009 -0700 intel_upload_blit_*: Fix reporting and generate junk instead of using random. Turns out that random completely overwhelmed the cost of the driver stuff in _large.c. I definitely want to generate data, but still be able to see the driver's responsibility. commit 614b165c60d695da424c1f42ecca53d95a32ca94 Author: Eric Anholt Date: Mon Mar 30 19:08:43 2009 -0700 Add intel_chipset.h to fix dist. commit ce4782dc9d387929babf2c96d795286c91b753fe Author: Eric Anholt Date: Fri Mar 27 16:11:50 2009 -0700 Move i810_reg.h to lib/intel_reg.h and get it disted. commit 0581738c7a02d45518d60924bd8cafa5446d4019 Author: Eric Anholt Date: Fri Mar 27 16:04:25 2009 -0700 tests/: warning fixes commit 1eabfa9a142a314adeaba7a691e9cf85e026f79c Author: Eric Anholt Date: Fri Mar 27 16:03:12 2009 -0700 rename project commit 676a1097234bdb4661c65565c3d568fb8cfc0e94 Author: Eric Anholt Date: Fri Mar 27 16:03:02 2009 -0700 readme fixups commit 3ba49a9295370cbcbb3139674556ea723c1a6b6c Author: Eric Anholt Date: Fri Mar 27 13:13:47 2009 -0700 intel_gpu_top: Add more 965 bits. commit fbbf124f8d01365078328910cf9375e08767a57e Author: Eric Anholt Date: Fri Mar 27 12:25:09 2009 -0700 Port intel_idle from 2D driver as intel_gpu_top with a better interface. commit 872713057a7bf02afaab89832d85c0401b4bb510 Author: Eric Anholt Date: Fri Mar 27 11:07:33 2009 -0700 intel_stepping: Add G45 and GM45. commit 29777a542b8db659cf539af72b17fe17a44c2aae Author: Eric Anholt Date: Fri Mar 27 10:59:09 2009 -0700 Add intel_stepping from the 2D driver. commit 895a415909188e7bddb8571fe5db69cf91ee1383 Author: Eric Anholt Date: Thu Mar 26 18:47:42 2009 -0700 Add the tests we want from libdrm. commit ec172167d6992b2f9b59f79b57b7a346b75317ba Author: Eric Anholt Date: Thu Mar 26 18:45:01 2009 -0700 Fix project name/version for distfiles. commit 6abc9b13f0b87f9af82d9b46ad84d74648b46a97 Author: Eric Anholt Date: Thu Mar 26 18:44:13 2009 -0700 Add notes about running things as root. commit 8c64183a461a422b0443f84622af48858d5fe6ed Author: Eric Anholt Date: Thu Mar 26 17:15:11 2009 -0700 Initial import of intel-graphics-tools with some microbenchmarks. intel-gpu-tools-1.3/benchmarks/0000775000175100017510000000000012016622744013545 500000000000000intel-gpu-tools-1.3/benchmarks/intel_upload_blit_large_gtt.c0000664000175100017510000001142311566027747021366 00000000000000/* * Copyright © 2009 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Eric Anholt * */ /** * Roughly simulates repeatedly uploading frames of images, by uploading * the data all at once with pwrite, and then blitting it to another buffer. * * You might think of this like a movie player, but that wouldn't be entirely * accurate, since the access patterns of the memory would be different * (generally, smaller source image, upscaled, an thus different memory access * pattern in both texel fetch for the stretching and the destination writes). * However, some things like swfdec would be doing something like this since * they compute their data in host memory and upload the full sw rendered * frame. * * Additionally, those applications should be rendering at the screen refresh * rate, while this test has no limits, and so can get itself into the * working set larger than aperture size performance disaster. * * The current workload doing this path is pixmap upload in 2D with KMS. */ #include #include #include #include #include #include #include #include #include #include "drm.h" #include "i915_drm.h" #include "drmtest.h" #include "intel_bufmgr.h" #include "intel_batchbuffer.h" #include "intel_gpu_tools.h" #define OBJECT_WIDTH 1280 #define OBJECT_HEIGHT 720 static double get_time_in_secs(void) { struct timeval tv; gettimeofday(&tv, NULL); return (double)tv.tv_sec + tv.tv_usec / 1000000.0; } static void do_render(drm_intel_bufmgr *bufmgr, struct intel_batchbuffer *batch, drm_intel_bo *dst_bo, int width, int height) { uint32_t *data; drm_intel_bo *src_bo; int i; static uint32_t seed = 1; src_bo = drm_intel_bo_alloc(bufmgr, "src", width * height * 4, 4096); drm_intel_gem_bo_map_gtt(src_bo); data = src_bo->virtual; for (i = 0; i < width * height; i++) { data[i] = seed++; } drm_intel_gem_bo_unmap_gtt(src_bo); /* Render the junk to the dst. */ BEGIN_BATCH(8); OUT_BATCH(XY_SRC_COPY_BLT_CMD | XY_SRC_COPY_BLT_WRITE_ALPHA | XY_SRC_COPY_BLT_WRITE_RGB); OUT_BATCH((3 << 24) | /* 32 bits */ (0xcc << 16) | /* copy ROP */ (width * 4) /* dst pitch */); OUT_BATCH(0); /* dst x1,y1 */ OUT_BATCH((height << 16) | width); /* dst x2,y2 */ OUT_RELOC(dst_bo, I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER, 0); OUT_BATCH(0); /* src x1,y1 */ OUT_BATCH(width * 4); /* src pitch */ OUT_RELOC(src_bo, I915_GEM_DOMAIN_RENDER, 0, 0); ADVANCE_BATCH(); intel_batchbuffer_flush(batch); drm_intel_bo_unreference(src_bo); } int main(int argc, char **argv) { int fd; int object_size = OBJECT_WIDTH * OBJECT_HEIGHT * 4; double start_time, end_time; drm_intel_bo *dst_bo; drm_intel_bufmgr *bufmgr; struct intel_batchbuffer *batch; int i; fd = drm_open_any(); bufmgr = drm_intel_bufmgr_gem_init(fd, 4096); drm_intel_bufmgr_gem_enable_reuse(bufmgr); batch = intel_batchbuffer_alloc(bufmgr, intel_get_drm_devid(fd)); dst_bo = drm_intel_bo_alloc(bufmgr, "dst", object_size, 4096); /* Prep loop to get us warmed up. */ for (i = 0; i < 60; i++) { do_render(bufmgr, batch, dst_bo, OBJECT_WIDTH, OBJECT_HEIGHT); } drm_intel_bo_wait_rendering(dst_bo); /* Do the actual timing. */ start_time = get_time_in_secs(); for (i = 0; i < 200; i++) { do_render(bufmgr, batch, dst_bo, OBJECT_WIDTH, OBJECT_HEIGHT); } drm_intel_bo_wait_rendering(dst_bo); end_time = get_time_in_secs(); printf("%d iterations in %.03f secs: %.01f MB/sec\n", i, end_time - start_time, (double)i * OBJECT_WIDTH * OBJECT_HEIGHT * 4 / 1024.0 / 1024.0 / (end_time - start_time)); intel_batchbuffer_free(batch); drm_intel_bufmgr_destroy(bufmgr); close(fd); return 0; } intel-gpu-tools-1.3/benchmarks/intel_upload_blit_large.c0000664000175100017510000001155211566027747020513 00000000000000/* * Copyright © 2009 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Eric Anholt * */ /** * Roughly simulates repeatedly uploading frames of images, by uploading * the data all at once with pwrite, and then blitting it to another buffer. * * You might think of this like a movie player, but that wouldn't be entirely * accurate, since the access patterns of the memory would be different * (generally, smaller source image, upscaled, an thus different memory access * pattern in both texel fetch for the stretching and the destination writes). * However, some things like swfdec would be doing something like this since * they compute their data in host memory and upload the full sw rendered * frame. * * Additionally, those applications should be rendering at the screen refresh * rate, while this test has no limits, and so can get itself into the * working set larger than aperture size performance disaster. * * The current workload doing this path is pixmap upload for non-KMS. */ #include #include #include #include #include #include #include #include #include #include "drm.h" #include "i915_drm.h" #include "drmtest.h" #include "intel_bufmgr.h" #include "intel_batchbuffer.h" #include "intel_gpu_tools.h" #define OBJECT_WIDTH 1280 #define OBJECT_HEIGHT 720 static double get_time_in_secs(void) { struct timeval tv; gettimeofday(&tv, NULL); return (double)tv.tv_sec + tv.tv_usec / 1000000.0; } static void do_render(drm_intel_bufmgr *bufmgr, struct intel_batchbuffer *batch, drm_intel_bo *dst_bo, int width, int height) { uint32_t data[width * height]; drm_intel_bo *src_bo; int i; static uint32_t seed = 1; /* Generate some junk. Real workloads would be doing a lot more * work to generate the junk. */ for (i = 0; i < width * height; i++) { data[i] = seed++; } /* Upload the junk. */ src_bo = drm_intel_bo_alloc(bufmgr, "src", sizeof(data), 4096); drm_intel_bo_subdata(src_bo, 0, sizeof(data), data); /* Render the junk to the dst. */ BEGIN_BATCH(8); OUT_BATCH(XY_SRC_COPY_BLT_CMD | XY_SRC_COPY_BLT_WRITE_ALPHA | XY_SRC_COPY_BLT_WRITE_RGB); OUT_BATCH((3 << 24) | /* 32 bits */ (0xcc << 16) | /* copy ROP */ (width * 4) /* dst pitch */); OUT_BATCH(0); /* dst x1,y1 */ OUT_BATCH((height << 16) | width); /* dst x2,y2 */ OUT_RELOC(dst_bo, I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER, 0); OUT_BATCH(0); /* src x1,y1 */ OUT_BATCH(width * 4); /* src pitch */ OUT_RELOC(src_bo, I915_GEM_DOMAIN_RENDER, 0, 0); ADVANCE_BATCH(); intel_batchbuffer_flush(batch); drm_intel_bo_unreference(src_bo); } int main(int argc, char **argv) { int fd; int object_size = OBJECT_WIDTH * OBJECT_HEIGHT * 4; double start_time, end_time; drm_intel_bo *dst_bo; drm_intel_bufmgr *bufmgr; struct intel_batchbuffer *batch; int i; fd = drm_open_any(); bufmgr = drm_intel_bufmgr_gem_init(fd, 4096); drm_intel_bufmgr_gem_enable_reuse(bufmgr); batch = intel_batchbuffer_alloc(bufmgr, intel_get_drm_devid(fd)); dst_bo = drm_intel_bo_alloc(bufmgr, "dst", object_size, 4096); /* Prep loop to get us warmed up. */ for (i = 0; i < 60; i++) { do_render(bufmgr, batch, dst_bo, OBJECT_WIDTH, OBJECT_HEIGHT); } drm_intel_bo_wait_rendering(dst_bo); /* Do the actual timing. */ start_time = get_time_in_secs(); for (i = 0; i < 200; i++) { do_render(bufmgr, batch, dst_bo, OBJECT_WIDTH, OBJECT_HEIGHT); } drm_intel_bo_wait_rendering(dst_bo); end_time = get_time_in_secs(); printf("%d iterations in %.03f secs: %.01f MB/sec\n", i, end_time - start_time, (double)i * OBJECT_WIDTH * OBJECT_HEIGHT * 4 / 1024.0 / 1024.0 / (end_time - start_time)); intel_batchbuffer_free(batch); drm_intel_bufmgr_destroy(bufmgr); close(fd); return 0; } intel-gpu-tools-1.3/benchmarks/Makefile.am0000664000175100017510000000051611757635623015536 00000000000000 bin_PROGRAMS = \ intel_upload_blit_large \ intel_upload_blit_large_gtt \ intel_upload_blit_large_map \ intel_upload_blit_small AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/lib AM_CFLAGS = $(DRM_CFLAGS) $(CWARNFLAGS) $(CAIRO_CFLAGS) LDADD = $(top_builddir)/lib/libintel_tools.la $(DRM_LIBS) $(PCIACCESS_LIBS) $(CAIRO_LIBS) intel-gpu-tools-1.3/benchmarks/intel_upload_blit_large_map.c0000664000175100017510000001162611566027747021352 00000000000000/* * Copyright © 2009 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Eric Anholt * */ /** * Roughly simulates repeatedly uploading frames of images, by uploading * the data all at once with pwrite, and then blitting it to another buffer. * * You might think of this like a movie player, but that wouldn't be entirely * accurate, since the access patterns of the memory would be different * (generally, smaller source image, upscaled, an thus different memory access * pattern in both texel fetch for the stretching and the destination writes). * However, some things like swfdec would be doing something like this since * they compute their data in host memory and upload the full sw rendered * frame. * * Additionally, those applications should be rendering at the screen refresh * rate, while this test has no limits, and so can get itself into the * working set larger than aperture size performance disaster. * * The current workload we have that does large drm_intel_bo_map() * uploads is texture upload for OpenGL (as it frequently is doing * reformatting as it uploads the user's data, making bo_subdata less * suitable) */ #include #include #include #include #include #include #include #include #include #include "drm.h" #include "i915_drm.h" #include "drmtest.h" #include "intel_bufmgr.h" #include "intel_batchbuffer.h" #include "intel_gpu_tools.h" #define OBJECT_WIDTH 1280 #define OBJECT_HEIGHT 720 static double get_time_in_secs(void) { struct timeval tv; gettimeofday(&tv, NULL); return (double)tv.tv_sec + tv.tv_usec / 1000000.0; } static void do_render(drm_intel_bufmgr *bufmgr, struct intel_batchbuffer *batch, drm_intel_bo *dst_bo, int width, int height) { uint32_t *data; drm_intel_bo *src_bo; int i; static uint32_t seed = 1; src_bo = drm_intel_bo_alloc(bufmgr, "src", width * height * 4, 4096); drm_intel_bo_map(src_bo, 1); data = src_bo->virtual; for (i = 0; i < width * height; i++) { data[i] = seed++; } drm_intel_bo_unmap(src_bo); /* Render the junk to the dst. */ BEGIN_BATCH(8); OUT_BATCH(XY_SRC_COPY_BLT_CMD | XY_SRC_COPY_BLT_WRITE_ALPHA | XY_SRC_COPY_BLT_WRITE_RGB); OUT_BATCH((3 << 24) | /* 32 bits */ (0xcc << 16) | /* copy ROP */ (width * 4) /* dst pitch */); OUT_BATCH(0); /* dst x1,y1 */ OUT_BATCH((height << 16) | width); /* dst x2,y2 */ OUT_RELOC(dst_bo, I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER, 0); OUT_BATCH(0); /* src x1,y1 */ OUT_BATCH(width * 4); /* src pitch */ OUT_RELOC(src_bo, I915_GEM_DOMAIN_RENDER, 0, 0); ADVANCE_BATCH(); intel_batchbuffer_flush(batch); drm_intel_bo_unreference(src_bo); } int main(int argc, char **argv) { int fd; int object_size = OBJECT_WIDTH * OBJECT_HEIGHT * 4; double start_time, end_time; drm_intel_bo *dst_bo; drm_intel_bufmgr *bufmgr; struct intel_batchbuffer *batch; int i; fd = drm_open_any(); bufmgr = drm_intel_bufmgr_gem_init(fd, 4096); drm_intel_bufmgr_gem_enable_reuse(bufmgr); batch = intel_batchbuffer_alloc(bufmgr, intel_get_drm_devid(fd)); dst_bo = drm_intel_bo_alloc(bufmgr, "dst", object_size, 4096); /* Prep loop to get us warmed up. */ for (i = 0; i < 60; i++) { do_render(bufmgr, batch, dst_bo, OBJECT_WIDTH, OBJECT_HEIGHT); } drm_intel_bo_wait_rendering(dst_bo); /* Do the actual timing. */ start_time = get_time_in_secs(); for (i = 0; i < 200; i++) { do_render(bufmgr, batch, dst_bo, OBJECT_WIDTH, OBJECT_HEIGHT); } drm_intel_bo_wait_rendering(dst_bo); end_time = get_time_in_secs(); printf("%d iterations in %.03f secs: %.01f MB/sec\n", i, end_time - start_time, (double)i * OBJECT_WIDTH * OBJECT_HEIGHT * 4 / 1024.0 / 1024.0 / (end_time - start_time)); intel_batchbuffer_free(batch); drm_intel_bufmgr_destroy(bufmgr); close(fd); return 0; } intel-gpu-tools-1.3/benchmarks/intel_upload_blit_small.c0000664000175100017510000001212611566027747020527 00000000000000/* * Copyright © 2009 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Eric Anholt * */ /** * Roughly simulates Mesa's current vertex buffer behavior: do a series of * small pwrites on a moderately-sized buffer, then render using it. * * The vertex buffer uploads * * You might think of this like a movie player, but that wouldn't be entirely * accurate, since the access patterns of the memory would be different * (generally, smaller source image, upscaled, an thus different memory access * pattern in both texel fetch for the stretching and the destination writes). * However, some things like swfdec would be doing something like this since * they compute their data in host memory and upload the full sw rendered * frame. */ #include #include #include #include #include #include #include #include #include #include "drm.h" #include "i915_drm.h" #include "drmtest.h" #include "intel_bufmgr.h" #include "intel_batchbuffer.h" #include "intel_gpu_tools.h" /* Happens to be 128k, the size of the VBOs used by i965's Mesa driver. */ #define OBJECT_WIDTH 256 #define OBJECT_HEIGHT 128 static double get_time_in_secs(void) { struct timeval tv; gettimeofday(&tv, NULL); return (double)tv.tv_sec + tv.tv_usec / 1000000.0; } static void do_render(drm_intel_bufmgr *bufmgr, struct intel_batchbuffer *batch, drm_intel_bo *dst_bo, int width, int height) { uint32_t data[64]; drm_intel_bo *src_bo; int i; static uint32_t seed = 1; src_bo = drm_intel_bo_alloc(bufmgr, "src", width * height * 4, 4096); /* Upload some junk. Real workloads would be doing a lot more * work to generate the junk. */ for (i = 0; i < width * height;) { int size, j; /* Choose a size from 1 to 64 dwords to upload. * Normal workloads have a distribution of sizes with a * large tail (something in your scene's going to have a big * pile of vertices, most likely), but I'm trying to get at * the cost of the small uploads here. */ size = random() % 64 + 1; if (i + size > width * height) size = width * height - i; for (j = 0; j < size; j++) data[j] = seed++; /* Upload the junk. */ drm_intel_bo_subdata(src_bo, i * 4, size * 4, data); i += size; } /* Render the junk to the dst. */ BEGIN_BATCH(8); OUT_BATCH(XY_SRC_COPY_BLT_CMD | XY_SRC_COPY_BLT_WRITE_ALPHA | XY_SRC_COPY_BLT_WRITE_RGB); OUT_BATCH((3 << 24) | /* 32 bits */ (0xcc << 16) | /* copy ROP */ (width * 4) /* dst pitch */); OUT_BATCH(0); /* dst x1,y1 */ OUT_BATCH((height << 16) | width); /* dst x2,y2 */ OUT_RELOC(dst_bo, I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER, 0); OUT_BATCH(0); /* src x1,y1 */ OUT_BATCH(width * 4); /* src pitch */ OUT_RELOC(src_bo, I915_GEM_DOMAIN_RENDER, 0, 0); ADVANCE_BATCH(); intel_batchbuffer_flush(batch); drm_intel_bo_unreference(src_bo); } int main(int argc, char **argv) { int fd; int object_size = OBJECT_WIDTH * OBJECT_HEIGHT * 4; double start_time, end_time; drm_intel_bo *dst_bo; drm_intel_bufmgr *bufmgr; struct intel_batchbuffer *batch; int i; fd = drm_open_any(); bufmgr = drm_intel_bufmgr_gem_init(fd, 4096); drm_intel_bufmgr_gem_enable_reuse(bufmgr); batch = intel_batchbuffer_alloc(bufmgr, intel_get_drm_devid(fd)); dst_bo = drm_intel_bo_alloc(bufmgr, "dst", object_size, 4096); /* Prep loop to get us warmed up. */ for (i = 0; i < 20; i++) { do_render(bufmgr, batch, dst_bo, OBJECT_WIDTH, OBJECT_HEIGHT); } drm_intel_bo_wait_rendering(dst_bo); /* Do the actual timing. */ start_time = get_time_in_secs(); for (i = 0; i < 1000; i++) { do_render(bufmgr, batch, dst_bo, OBJECT_WIDTH, OBJECT_HEIGHT); } drm_intel_bo_wait_rendering(dst_bo); end_time = get_time_in_secs(); printf("%d iterations in %.03f secs: %.01f MB/sec\n", i, end_time - start_time, (double)i * OBJECT_WIDTH * OBJECT_HEIGHT * 4 / 1024.0 / 1024.0 / (end_time - start_time)); intel_batchbuffer_free(batch); drm_intel_bufmgr_destroy(bufmgr); close(fd); return 0; } intel-gpu-tools-1.3/benchmarks/Makefile.in0000664000175100017510000005254612016622040015533 00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } 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@ bin_PROGRAMS = intel_upload_blit_large$(EXEEXT) \ intel_upload_blit_large_gtt$(EXEEXT) \ intel_upload_blit_large_map$(EXEEXT) \ intel_upload_blit_small$(EXEEXT) subdir = benchmarks DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) intel_upload_blit_large_SOURCES = intel_upload_blit_large.c intel_upload_blit_large_OBJECTS = intel_upload_blit_large.$(OBJEXT) intel_upload_blit_large_LDADD = $(LDADD) am__DEPENDENCIES_1 = intel_upload_blit_large_DEPENDENCIES = \ $(top_builddir)/lib/libintel_tools.la $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent intel_upload_blit_large_gtt_SOURCES = intel_upload_blit_large_gtt.c intel_upload_blit_large_gtt_OBJECTS = \ intel_upload_blit_large_gtt.$(OBJEXT) intel_upload_blit_large_gtt_LDADD = $(LDADD) intel_upload_blit_large_gtt_DEPENDENCIES = \ $(top_builddir)/lib/libintel_tools.la $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) intel_upload_blit_large_map_SOURCES = intel_upload_blit_large_map.c intel_upload_blit_large_map_OBJECTS = \ intel_upload_blit_large_map.$(OBJEXT) intel_upload_blit_large_map_LDADD = $(LDADD) intel_upload_blit_large_map_DEPENDENCIES = \ $(top_builddir)/lib/libintel_tools.la $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) intel_upload_blit_small_SOURCES = intel_upload_blit_small.c intel_upload_blit_small_OBJECTS = intel_upload_blit_small.$(OBJEXT) intel_upload_blit_small_LDADD = $(LDADD) intel_upload_blit_small_DEPENDENCIES = \ $(top_builddir)/lib/libintel_tools.la $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; SOURCES = intel_upload_blit_large.c intel_upload_blit_large_gtt.c \ intel_upload_blit_large_map.c intel_upload_blit_small.c DIST_SOURCES = intel_upload_blit_large.c intel_upload_blit_large_gtt.c \ intel_upload_blit_large_map.c intel_upload_blit_small.c am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ADMIN_MAN_DIR = @ADMIN_MAN_DIR@ ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@ AMTAR = @AMTAR@ 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@ CAIRO_CFLAGS = @CAIRO_CFLAGS@ CAIRO_LIBS = @CAIRO_LIBS@ 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@ DRM_CFLAGS = @DRM_CFLAGS@ DRM_LIBS = @DRM_LIBS@ DRM_NOUVEAU_CFLAGS = @DRM_NOUVEAU_CFLAGS@ DRM_NOUVEAU_LIBS = @DRM_NOUVEAU_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILE_MAN_DIR = @FILE_MAN_DIR@ FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@ GEN4ASM = @GEN4ASM@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_LIBS = @GLIB_LIBS@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_CMD = @INSTALL_CMD@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBUDEV_CFLAGS = @LIBUDEV_CFLAGS@ LIBUDEV_LIBS = @LIBUDEV_LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MAN_SUBSTS = @MAN_SUBSTS@ MISC_MAN_DIR = @MISC_MAN_DIR@ MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJCOPY = @OBJCOPY@ 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@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ THREAD_CFLAGS = @THREAD_CFLAGS@ VERSION = @VERSION@ 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@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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@ AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/lib AM_CFLAGS = $(DRM_CFLAGS) $(CWARNFLAGS) $(CAIRO_CFLAGS) LDADD = $(top_builddir)/lib/libintel_tools.la $(DRM_LIBS) $(PCIACCESS_LIBS) $(CAIRO_LIBS) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign benchmarks/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign benchmarks/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p || test -f $$p1; \ then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list intel_upload_blit_large$(EXEEXT): $(intel_upload_blit_large_OBJECTS) $(intel_upload_blit_large_DEPENDENCIES) $(EXTRA_intel_upload_blit_large_DEPENDENCIES) @rm -f intel_upload_blit_large$(EXEEXT) $(AM_V_CCLD)$(LINK) $(intel_upload_blit_large_OBJECTS) $(intel_upload_blit_large_LDADD) $(LIBS) intel_upload_blit_large_gtt$(EXEEXT): $(intel_upload_blit_large_gtt_OBJECTS) $(intel_upload_blit_large_gtt_DEPENDENCIES) $(EXTRA_intel_upload_blit_large_gtt_DEPENDENCIES) @rm -f intel_upload_blit_large_gtt$(EXEEXT) $(AM_V_CCLD)$(LINK) $(intel_upload_blit_large_gtt_OBJECTS) $(intel_upload_blit_large_gtt_LDADD) $(LIBS) intel_upload_blit_large_map$(EXEEXT): $(intel_upload_blit_large_map_OBJECTS) $(intel_upload_blit_large_map_DEPENDENCIES) $(EXTRA_intel_upload_blit_large_map_DEPENDENCIES) @rm -f intel_upload_blit_large_map$(EXEEXT) $(AM_V_CCLD)$(LINK) $(intel_upload_blit_large_map_OBJECTS) $(intel_upload_blit_large_map_LDADD) $(LIBS) intel_upload_blit_small$(EXEEXT): $(intel_upload_blit_small_OBJECTS) $(intel_upload_blit_small_DEPENDENCIES) $(EXTRA_intel_upload_blit_small_DEPENDENCIES) @rm -f intel_upload_blit_small$(EXEEXT) $(AM_V_CCLD)$(LINK) $(intel_upload_blit_small_OBJECTS) $(intel_upload_blit_small_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/intel_upload_blit_large.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/intel_upload_blit_large_gtt.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/intel_upload_blit_large_map.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/intel_upload_blit_small.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic clean-libtool ctags distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-binPROGRAMS install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-binPROGRAMS # 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: intel-gpu-tools-1.3/scripts/0000775000175100017510000000000012016622744013117 500000000000000intel-gpu-tools-1.3/scripts/Makefile.am0000664000175100017510000000007211706636070015074 00000000000000 dist_noinst_SCRIPTS = who.sh noinst_PYTHON = throttle.py intel-gpu-tools-1.3/scripts/throttle.py0000775000175100017510000000313611631112215015251 00000000000000#!/usr/bin/env python # # Usage: # scripts/throttle.py trace-dat # # Shows how often the trace throttles and for how long. import getopt from tracecmd import * import sys requests = {} throttle = {} prev_throttle = 0; def read_events(t): for cpu in range(0, t.cpus): e = t.read_event(cpu) while e: if e.name == 'i915_gem_request_complete': seqno = e.num_field('seqno') requests[seqno] = e.ts; if e.name == 'i915_gem_request_throttle_begin': seqno = e.num_field('seqno') throttle[seqno] = e.ts if e.name == 'i915_gem_request_throttle_end': global prev_throttle ts = 0 sum_dispatch = 0 num_dispatch = 0 max_dispatch = 0 seqno = e.num_field('seqno') s = prev_throttle if s == 0: s = seqno while s <= seqno: if requests.has_key(s): if ts: delta = requests[s] - ts num_dispatch += 1 sum_dispatch += delta if delta > max_dispatch: max_dispatch = delta ts = requests[s] s += 1 if throttle.has_key(seqno) and throttle.has_key(prev_throttle) and num_dispatch: print "throttle +%d: %dms -- %d dispatch, avg %.3fms, max %dus" % ((throttle[seqno]-throttle[prev_throttle])/1000000, (e.ts - throttle[seqno]) / 1000000, num_dispatch, sum_dispatch / (1000000. * num_dispatch), max_dispatch / 1000) throttle[seqno] = e.ts prev_throttle = seqno e = t.read_event(cpu) if __name__ == "__main__": if len(sys.argv) >=2: filename = sys.argv[1] else: filename = "trace.dat" print "Initializing trace '%s'..." % (filename) trace = Trace(filename) read_events(trace) intel-gpu-tools-1.3/scripts/who.sh0000775000175100017510000000051111673204321014163 00000000000000#!/bin/bash # # usage: sudo who.sh # # Requires root permissions to both query who has the device open, # and to read the mappings of likely root-owned processes # for i in `lsof -t /dev/dri/card0`; do who=`readlink /proc/$i/exe` count=`grep /dev/dri/card0 /proc/$i/maps | wc -l | cut -f1 -d\ ` echo "$who [$i]: $count" done intel-gpu-tools-1.3/scripts/Makefile.in0000664000175100017510000002750012016622041015076 00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } 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 = scripts DIST_COMMON = $(dist_noinst_SCRIPTS) $(noinst_PYTHON) \ $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SCRIPTS = $(dist_noinst_SCRIPTS) AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__py_compile = PYTHON=$(PYTHON) $(SHELL) $(py_compile) py_compile = $(top_srcdir)/build-aux/py-compile 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@ CAIRO_CFLAGS = @CAIRO_CFLAGS@ CAIRO_LIBS = @CAIRO_LIBS@ 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@ DRM_CFLAGS = @DRM_CFLAGS@ DRM_LIBS = @DRM_LIBS@ DRM_NOUVEAU_CFLAGS = @DRM_NOUVEAU_CFLAGS@ DRM_NOUVEAU_LIBS = @DRM_NOUVEAU_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILE_MAN_DIR = @FILE_MAN_DIR@ FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@ GEN4ASM = @GEN4ASM@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_LIBS = @GLIB_LIBS@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_CMD = @INSTALL_CMD@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBUDEV_CFLAGS = @LIBUDEV_CFLAGS@ LIBUDEV_LIBS = @LIBUDEV_LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MAN_SUBSTS = @MAN_SUBSTS@ MISC_MAN_DIR = @MISC_MAN_DIR@ MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJCOPY = @OBJCOPY@ 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@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ THREAD_CFLAGS = @THREAD_CFLAGS@ VERSION = @VERSION@ 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@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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@ dist_noinst_SCRIPTS = who.sh noinst_PYTHON = throttle.py all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign scripts/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign scripts/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(SCRIPTS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool 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-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: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am # 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: intel-gpu-tools-1.3/config.h.in0000664000175100017510000000641712016622047013377 00000000000000/* config.h.in. Generated from configure.ac by autoheader. */ /* Define to 1 if you have the `asprintf' function. */ #undef HAVE_ASPRINTF /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Have nouveau support */ #undef HAVE_NOUVEAU /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if `totalram' is a member of `struct sysinfo'. */ #undef HAVE_STRUCT_SYSINFO_TOTALRAM /* Define to 1 if you have the `swapctl' function. */ #undef HAVE_SWAPCTL /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_TERMIOS_H /* Enable udev-based monitor hotplug detection */ #undef HAVE_UDEV /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #undef LT_OBJDIR /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Major version of this package */ #undef PACKAGE_VERSION_MAJOR /* Minor version of this package */ #undef PACKAGE_VERSION_MINOR /* Patch version of this package */ #undef PACKAGE_VERSION_PATCHLEVEL /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Enable extensions on AIX 3, Interix. */ #ifndef _ALL_SOURCE # undef _ALL_SOURCE #endif /* Enable GNU extensions on systems that have them. */ #ifndef _GNU_SOURCE # undef _GNU_SOURCE #endif /* Enable threading extensions on Solaris. */ #ifndef _POSIX_PTHREAD_SEMANTICS # undef _POSIX_PTHREAD_SEMANTICS #endif /* Enable extensions on HP NonStop. */ #ifndef _TANDEM_SOURCE # undef _TANDEM_SOURCE #endif /* Enable general extensions on Solaris. */ #ifndef __EXTENSIONS__ # undef __EXTENSIONS__ #endif /* Version number of package */ #undef VERSION /* Enable large inode numbers on Mac OS X 10.5. */ #ifndef _DARWIN_USE_64_BIT_INODE # define _DARWIN_USE_64_BIT_INODE 1 #endif /* Number of bits in a file offset, on hosts where this is settable. */ #undef _FILE_OFFSET_BITS /* Define for large files, on AIX-style hosts. */ #undef _LARGE_FILES /* Define to 1 if on MINIX. */ #undef _MINIX /* Define to 2 if the system does not provide POSIX.1 features except with this defined. */ #undef _POSIX_1_SOURCE /* Define to 1 if you need to in order for `stat' and other things to work. */ #undef _POSIX_SOURCE intel-gpu-tools-1.3/COPYING0000664000175100017510000001270511702400214012373 00000000000000Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. All Rights Reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sub license, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Copyright 2003,2006 Tungsten Graphics, Inc., Cedar Park, Texas. All Rights Reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sub license, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Copyright © 2006-2011 Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Copyright © 2010 Red Hat, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Copyright © 2011 Daniel Vetter 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. intel-gpu-tools-1.3/build-aux/0000775000175100017510000000000012016622744013322 500000000000000intel-gpu-tools-1.3/build-aux/depcomp0000755000175100017510000005064311757635640014637 00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2012-03-27.16; # UTC # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009, 2010, # 2011, 2012 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 # A tabulation character. tab=' ' # A newline character. nl=' ' if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvisualcpp fi if test "$depmode" = msvc7msys; then # This is just like msvc7 but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvc7 fi if test "$depmode" = xlc; then # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency informations. 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 -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ## The second -e expression handles DOS-style file names with drive letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the "deleted header file" problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. tr ' ' "$nl" < "$tmpdepfile" | ## Some versions of gcc put a space before the ':'. On the theory ## that the space means something, we add a space to the output as ## well. hp depmode also adds that space, but also prefixes the VPATH ## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like '#:fec' to the end of the # dependency line. tr ' ' "$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 # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; 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. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then # Each line is of the form 'foo.o: dependent.h'. # Do two passes, one to just change these to # '$object: dependent.h' and one to simply 'dependent.h:'. sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; icc) # Intel's C compiler anf tcc (Tiny C Compiler) understand '-MD -MF file'. # However on # $CC -MD -MF foo.d -c -o sub/foo.o sub/foo.c # ICC 7.0 will fill foo.d with something like # foo.o: sub/foo.c # foo.o: sub/foo.h # which is wrong. We want # sub/foo.o: sub/foo.c # sub/foo.o: sub/foo.h # sub/foo.c: # sub/foo.h: # ICC 7.1 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using '\': # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... # tcc 0.9.26 (FIXME still under development at the moment of writing) # will emit a similar output, but also prepend the continuation lines # with horizontal tabulation characters. "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form 'foo.o: dependent.h', # or 'foo.o: dep1.h dep2.h \', or ' dep3.h dep4.h \'. # Do two passes, one to just change these to # '$object: dependent.h' and one to simply 'dependent.h:'. sed -e "s/^[ $tab][ $tab]*/ /" -e "s,^[^:]*:,$object :," \ < "$tmpdepfile" > "$depfile" sed ' s/[ '"$tab"'][ '"$tab"']*/ /g s/^ *// s/ *\\*$// s/^[^:]*: *// /^$/d /:$/d s/$/ :/ ' < "$tmpdepfile" >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" # Add 'dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in 'foo.d' instead, so we check for that too. # Subdirectories are respected. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then # With Tru64 cc, shared objects can also be used to make a # static library. This mechanism is used in libtool 1.4 series to # handle both shared and static libraries in a single compilation. # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. # # With libtool 1.5 this exception was removed, and libtool now # generates 2 separate objects for the 2 libraries. These two # compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 tmpdepfile2=$dir$base.o.d # libtool 1.5 tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.o.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d tmpdepfile4=$dir$base.d "$@" -MD fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; msvc7) if test "$libtool" = yes; then showIncludes=-Wc,-showIncludes else showIncludes=-showIncludes fi "$@" $showIncludes > "$tmpdepfile" stat=$? grep -v '^Note: including file: ' "$tmpdepfile" if test "$stat" = 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The first sed program below extracts the file names and escapes # backslashes for cygpath. The second sed program outputs the file # name when reading, but also accumulates all include files in the # hold buffer in order to output them again at the end. This only # works with sed implementations that can handle large buffers. sed < "$tmpdepfile" -n ' /^Note: including file: *\(.*\)/ { s//\1/ s/\\/\\\\/g p }' | $cygpath_u | sort -u | sed -n ' s/ /\\ /g s/\(.*\)/'"$tab"'\1 \\/p s/.\(.*\) \\/\1:/ H $ { s/.*/'"$tab"'/ G p }' >> "$depfile" rm -f "$tmpdepfile" ;; msvc7msys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for ':' # in the target name. This is to cope with DOS-style filenames: # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. "$@" $dashmflag | sed 's:^['"$tab"' ]*[^:'"$tab"' ][^:][^:]*\:['"$tab"' ]*:'"$object"'\: :' > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" tr ' ' "$nl" < "$tmpdepfile" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no continue fi case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -arch) eat=yes ;; -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix=`echo "$object" | sed 's/^.*\././'` touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" # makedepend may prepend the VPATH from the source file name to the object. # No need to regex-escape $object, excess matching of '.' is harmless. sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" sed '1,2d' "$tmpdepfile" | tr ' ' "$nl" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " for arg do case "$arg" in -o) shift ;; $object) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$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 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: intel-gpu-tools-1.3/build-aux/py-compile0000755000175100017510000001040011757635640015251 00000000000000#!/bin/sh # py-compile - Compile a Python program scriptversion=2011-06-08.12; # UTC # Copyright (C) 2000, 2001, 2003, 2004, 2005, 2008, 2009, 2011 Free # Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . if [ -z "$PYTHON" ]; then PYTHON=python fi me=py-compile usage_error () { echo "$me: $*" >&2 echo "Try \`$me --help' for more information." >&2 exit 1 } basedir= destdir= while test $# -ne 0; do case "$1" in --basedir) if test $# -lt 2; then usage_error "option '--basedir' requires an argument" else basedir=$2 fi shift ;; --destdir) if test $# -lt 2; then usage_error "option '--destdir' requires an argument" else destdir=$2 fi shift ;; -h|--help) cat <<\EOF Usage: py-compile [--help] [--version] [--basedir DIR] [--destdir DIR] FILES..." Byte compile some python scripts FILES. Use --destdir to specify any leading directory path to the FILES that you don't want to include in the byte compiled file. Specify --basedir for any additional path information you do want to be shown in the byte compiled file. Example: py-compile --destdir /tmp/pkg-root --basedir /usr/share/test test.py test2.py Report bugs to . EOF exit $? ;; -v|--version) echo "$me $scriptversion" exit $? ;; --) shift break ;; -*) usage_error "unrecognized option '$1'" ;; *) break ;; esac shift done files=$* if test -z "$files"; then usage_error "no files given" fi # if basedir was given, then it should be prepended to filenames before # byte compilation. if [ -z "$basedir" ]; then pathtrans="path = file" else pathtrans="path = os.path.join('$basedir', file)" fi # if destdir was given, then it needs to be prepended to the filename to # byte compile but not go into the compiled file. if [ -z "$destdir" ]; then filetrans="filepath = path" else filetrans="filepath = os.path.normpath('$destdir' + os.sep + path)" fi $PYTHON -c " import sys, os, py_compile files = '''$files''' sys.stdout.write('Byte-compiling python modules...\n') for file in files.split(): $pathtrans $filetrans if not os.path.exists(filepath) or not (len(filepath) >= 3 and filepath[-3:] == '.py'): continue sys.stdout.write(file) sys.stdout.flush() py_compile.compile(filepath, filepath + 'c', path) sys.stdout.write('\n')" || exit $? # this will fail for python < 1.5, but that doesn't matter ... $PYTHON -O -c " import sys, os, py_compile files = '''$files''' sys.stdout.write('Byte-compiling python modules (optimized versions) ...\n') for file in files.split(): $pathtrans $filetrans if not os.path.exists(filepath) or not (len(filepath) >= 3 and filepath[-3:] == '.py'): continue sys.stdout.write(file) sys.stdout.flush() py_compile.compile(filepath, filepath + 'o', path) sys.stdout.write('\n')" 2>/dev/null || : # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: intel-gpu-tools-1.3/build-aux/ltmain.sh0000644000175100017510000105202211757635635015100 00000000000000 # libtool (GNU libtool) 2.4.2 # Written by Gordon Matzigkeit , 1996 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, # 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, # or obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Usage: $progname [OPTION]... [MODE-ARG]... # # Provide generalized library-building support services. # # --config show all configuration variables # --debug enable verbose shell tracing # -n, --dry-run display commands without modifying any files # --features display basic configuration information and exit # --mode=MODE use operation mode MODE # --preserve-dup-deps don't remove duplicate dependency libraries # --quiet, --silent don't print informational messages # --no-quiet, --no-silent # print informational messages (default) # --no-warn don't display warning messages # --tag=TAG use configuration variables from tag TAG # -v, --verbose print more informational messages than default # --no-verbose don't print the extra informational messages # --version print version information # -h, --help, --help-all print short, long, or detailed help message # # MODE must be one of the following: # # clean remove files from the build directory # compile compile a source file into a libtool object # execute automatically set library path, then run a program # finish complete the installation of libtool libraries # install install libraries or executables # link create a library or an executable # uninstall remove libraries from an installed directory # # MODE-ARGS vary depending on the MODE. When passed as first option, # `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that. # Try `$progname --help --mode=MODE' for a more detailed description of MODE. # # When reporting a bug, please describe a test case to reproduce it and # include the following information: # # host-triplet: $host # shell: $SHELL # compiler: $LTCC # compiler flags: $LTCFLAGS # linker: $LD (gnu? $with_gnu_ld) # $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1 # automake: $automake_version # autoconf: $autoconf_version # # Report bugs to . # GNU libtool home page: . # General help using GNU software: . PROGRAM=libtool PACKAGE=libtool VERSION="2.4.2 Debian-2.4.2-1" TIMESTAMP="" package_revision=1.3337 # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } # NLS nuisances: We save the old values to restore during execute mode. lt_user_locale= lt_safe_locale= for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${$lt_var+set}\" = set; then save_$lt_var=\$$lt_var $lt_var=C export $lt_var lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" fi" done LC_ALL=C LANGUAGE=C export LANGUAGE LC_ALL $lt_unset CDPATH # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh # is ksh but when the shell is invoked as "sh" and the current value of # the _XPG environment variable is not equal to 1 (one), the special # positional parameter $0, within a function call, is the name of the # function. progpath="$0" : ${CP="cp -f"} test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} : ${Xsed="$SED -e 1s/^X//"} # Global variables: EXIT_SUCCESS=0 EXIT_FAILURE=1 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. exit_status=$EXIT_SUCCESS # Make sure IFS has a sensible default lt_nl=' ' IFS=" $lt_nl" dirname="s,/[^/]*$,," basename="s,^.*/,," # func_dirname file append nondir_replacement # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. func_dirname () { func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi } # func_dirname may be replaced by extended shell implementation # func_basename file func_basename () { func_basename_result=`$ECHO "${1}" | $SED "$basename"` } # func_basename may be replaced by extended shell implementation # func_dirname_and_basename file append nondir_replacement # perform func_basename and func_dirname in a single function # call: # dirname: Compute the dirname of FILE. If nonempty, # add APPEND to the result, otherwise set result # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. # value retuned in "$func_basename_result" # Implementation must be kept synchronized with func_dirname # and func_basename. For efficiency, we do not delegate to # those functions but instead duplicate the functionality here. func_dirname_and_basename () { # Extract subdirectory from the argument. func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi func_basename_result=`$ECHO "${1}" | $SED -e "$basename"` } # func_dirname_and_basename may be replaced by extended shell implementation # func_stripname prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # func_strip_suffix prefix name func_stripname () { case ${2} in .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } # func_stripname may be replaced by extended shell implementation # These SED scripts presuppose an absolute path with a trailing slash. pathcar='s,^/\([^/]*\).*$,\1,' pathcdr='s,^/[^/]*,,' removedotparts=':dotsl s@/\./@/@g t dotsl s,/\.$,/,' collapseslashes='s@/\{1,\}@/@g' finalslash='s,/*$,/,' # func_normal_abspath PATH # Remove doubled-up and trailing slashes, "." path components, # and cancel out any ".." path components in PATH after making # it an absolute path. # value returned in "$func_normal_abspath_result" func_normal_abspath () { # Start from root dir and reassemble the path. func_normal_abspath_result= func_normal_abspath_tpath=$1 func_normal_abspath_altnamespace= case $func_normal_abspath_tpath in "") # Empty path, that just means $cwd. func_stripname '' '/' "`pwd`" func_normal_abspath_result=$func_stripname_result return ;; # The next three entries are used to spot a run of precisely # two leading slashes without using negated character classes; # we take advantage of case's first-match behaviour. ///*) # Unusual form of absolute path, do nothing. ;; //*) # Not necessarily an ordinary path; POSIX reserves leading '//' # and for example Cygwin uses it to access remote file shares # over CIFS/SMB, so we conserve a leading double slash if found. func_normal_abspath_altnamespace=/ ;; /*) # Absolute path, do nothing. ;; *) # Relative path, prepend $cwd. func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath ;; esac # Cancel out all the simple stuff to save iterations. We also want # the path to end with a slash for ease of parsing, so make sure # there is one (and only one) here. func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"` while :; do # Processed it all yet? if test "$func_normal_abspath_tpath" = / ; then # If we ascended to the root using ".." the result may be empty now. if test -z "$func_normal_abspath_result" ; then func_normal_abspath_result=/ fi break fi func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$pathcar"` func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$pathcdr"` # Figure out what to do with it case $func_normal_abspath_tcomponent in "") # Trailing empty path component, ignore it. ;; ..) # Parent dir; strip last assembled component from result. func_dirname "$func_normal_abspath_result" func_normal_abspath_result=$func_dirname_result ;; *) # Actual path component, append it. func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent ;; esac done # Restore leading double-slash if one was found on entry. func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result } # func_relative_path SRCDIR DSTDIR # generates a relative path from SRCDIR to DSTDIR, with a trailing # slash if non-empty, suitable for immediately appending a filename # without needing to append a separator. # value returned in "$func_relative_path_result" func_relative_path () { func_relative_path_result= func_normal_abspath "$1" func_relative_path_tlibdir=$func_normal_abspath_result func_normal_abspath "$2" func_relative_path_tbindir=$func_normal_abspath_result # Ascend the tree starting from libdir while :; do # check if we have found a prefix of bindir case $func_relative_path_tbindir in $func_relative_path_tlibdir) # found an exact match func_relative_path_tcancelled= break ;; $func_relative_path_tlibdir*) # found a matching prefix func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" func_relative_path_tcancelled=$func_stripname_result if test -z "$func_relative_path_result"; then func_relative_path_result=. fi break ;; *) func_dirname $func_relative_path_tlibdir func_relative_path_tlibdir=${func_dirname_result} if test "x$func_relative_path_tlibdir" = x ; then # Have to descend all the way to the root! func_relative_path_result=../$func_relative_path_result func_relative_path_tcancelled=$func_relative_path_tbindir break fi func_relative_path_result=../$func_relative_path_result ;; esac done # Now calculate path; take care to avoid doubling-up slashes. func_stripname '' '/' "$func_relative_path_result" func_relative_path_result=$func_stripname_result func_stripname '/' '/' "$func_relative_path_tcancelled" if test "x$func_stripname_result" != x ; then func_relative_path_result=${func_relative_path_result}/${func_stripname_result} fi # Normalisation. If bindir is libdir, return empty string, # else relative path ending with a slash; either way, target # file name can be directly appended. if test ! -z "$func_relative_path_result"; then func_stripname './' '' "$func_relative_path_result/" func_relative_path_result=$func_stripname_result fi } # The name of this program: func_dirname_and_basename "$progpath" progname=$func_basename_result # Make sure we have an absolute path for reexecution: case $progpath in [\\/]*|[A-Za-z]:\\*) ;; *[\\/]*) progdir=$func_dirname_result progdir=`cd "$progdir" && pwd` progpath="$progdir/$progname" ;; *) save_IFS="$IFS" IFS=${PATH_SEPARATOR-:} for progdir in $PATH; do IFS="$save_IFS" test -x "$progdir/$progname" && break done IFS="$save_IFS" test -n "$progdir" || progdir=`pwd` progpath="$progdir/$progname" ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed="${SED}"' -e 1s/^X//' sed_quote_subst='s/\([`"$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution that turns a string into a regex matching for the # string literally. sed_make_literal_regex='s,[].[^$\\*\/],\\&,g' # Sed substitution that converts a w32 file name or path # which contains forward slashes, into one that contains # (escaped) backslashes. A very naive implementation. lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' # Re-`\' parameter expansions in output of double_quote_subst that were # `\'-ed in input to the same. If an odd number of `\' preceded a '$' # in input to double_quote_subst, that '$' was protected from expansion. # Since each input `\' is now two `\'s, look for any number of runs of # four `\'s followed by two `\'s and then a '$'. `\' that '$'. bs='\\' bs2='\\\\' bs4='\\\\\\\\' dollar='\$' sed_double_backslash="\ s/$bs4/&\\ /g s/^$bs2$dollar/$bs&/ s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g s/\n//g" # Standard options: opt_dry_run=false opt_help=false opt_quiet=false opt_verbose=false opt_warning=: # func_echo arg... # Echo program name prefixed message, along with the current mode # name if it has been set yet. func_echo () { $ECHO "$progname: ${opt_mode+$opt_mode: }$*" } # func_verbose arg... # Echo program name prefixed message in verbose mode only. func_verbose () { $opt_verbose && func_echo ${1+"$@"} # A bug in bash halts the script if the last line of a function # fails when set -e is in force, so we need another command to # work around that: : } # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } # func_error arg... # Echo program name prefixed message to standard error. func_error () { $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2 } # func_warning arg... # Echo program name prefixed warning message to standard error. func_warning () { $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 # bash bug again: : } # func_fatal_error arg... # Echo program name prefixed message to standard error, and exit. func_fatal_error () { func_error ${1+"$@"} exit $EXIT_FAILURE } # func_fatal_help arg... # Echo program name prefixed message to standard error, followed by # a help hint, and exit. func_fatal_help () { func_error ${1+"$@"} func_fatal_error "$help" } help="Try \`$progname --help' for more information." ## default # func_grep expression filename # Check whether EXPRESSION matches any line of FILENAME, without output. func_grep () { $GREP "$1" "$2" >/dev/null 2>&1 } # func_mkdir_p directory-path # Make sure the entire path to DIRECTORY-PATH is available. func_mkdir_p () { my_directory_path="$1" my_dir_list= if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then # Protect directory names starting with `-' case $my_directory_path in -*) my_directory_path="./$my_directory_path" ;; esac # While some portion of DIR does not yet exist... while test ! -d "$my_directory_path"; do # ...make a list in topmost first order. Use a colon delimited # list incase some portion of path contains whitespace. my_dir_list="$my_directory_path:$my_dir_list" # If the last portion added has no slash in it, the list is done case $my_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"` done my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'` save_mkdir_p_IFS="$IFS"; IFS=':' for my_dir in $my_dir_list; do IFS="$save_mkdir_p_IFS" # mkdir can fail with a `File exist' error if two processes # try to create one of the directories concurrently. Don't # stop in that case! $MKDIR "$my_dir" 2>/dev/null || : done IFS="$save_mkdir_p_IFS" # Bail out if we (or some other process) failed to create a directory. test -d "$my_directory_path" || \ func_fatal_error "Failed to create \`$1'" fi } # func_mktempdir [string] # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If # given, STRING is the basename for that directory. func_mktempdir () { my_template="${TMPDIR-/tmp}/${1-$progname}" if test "$opt_dry_run" = ":"; then # Return a directory name, but don't create it in dry-run mode my_tmpdir="${my_template}-$$" else # If mktemp works, use that first and foremost my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` if test ! -d "$my_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race my_tmpdir="${my_template}-${RANDOM-0}$$" save_mktempdir_umask=`umask` umask 0077 $MKDIR "$my_tmpdir" umask $save_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure test -d "$my_tmpdir" || \ func_fatal_error "cannot create temporary directory \`$my_tmpdir'" fi $ECHO "$my_tmpdir" } # func_quote_for_eval arg # Aesthetically quote ARG to be evaled later. # This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT # is double-quoted, suitable for a subsequent eval, whereas # FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters # which are still active within double quotes backslashified. func_quote_for_eval () { case $1 in *[\\\`\"\$]*) func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;; *) func_quote_for_eval_unquoted_result="$1" ;; esac case $func_quote_for_eval_unquoted_result in # Double-quote args containing shell metacharacters to delay # word splitting, command substitution and and variable # expansion for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" ;; *) func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" esac } # func_quote_for_expand arg # Aesthetically quote ARG to be evaled later; same as above, # but do not quote variable references. func_quote_for_expand () { case $1 in *[\\\`\"]*) my_arg=`$ECHO "$1" | $SED \ -e "$double_quote_subst" -e "$sed_double_backslash"` ;; *) my_arg="$1" ;; esac case $my_arg in # Double-quote args containing shell metacharacters to delay # word splitting and command substitution for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") my_arg="\"$my_arg\"" ;; esac func_quote_for_expand_result="$my_arg" } # func_show_eval cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. func_show_eval () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$my_cmd" my_status=$? if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_show_eval_locale cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. Use the saved locale for evaluation. func_show_eval_locale () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$lt_user_locale $my_cmd" my_status=$? eval "$lt_safe_locale" if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_tr_sh # Turn $1 into a string suitable for a shell variable name. # Result is stored in $func_tr_sh_result. All characters # not in the set a-zA-Z0-9_ are replaced with '_'. Further, # if $1 begins with a digit, a '_' is prepended as well. func_tr_sh () { case $1 in [0-9]* | *[!a-zA-Z0-9_]*) func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'` ;; * ) func_tr_sh_result=$1 ;; esac } # func_version # Echo version message to standard output and exit. func_version () { $opt_debug $SED -n '/(C)/!b go :more /\./!{ N s/\n# / / b more } :go /^# '$PROGRAM' (GNU /,/# warranty; / { s/^# // s/^# *$// s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ p }' < "$progpath" exit $? } # func_usage # Echo short help message to standard output and exit. func_usage () { $opt_debug $SED -n '/^# Usage:/,/^# *.*--help/ { s/^# // s/^# *$// s/\$progname/'$progname'/ p }' < "$progpath" echo $ECHO "run \`$progname --help | more' for full usage" exit $? } # func_help [NOEXIT] # Echo long help message to standard output and exit, # unless 'noexit' is passed as argument. func_help () { $opt_debug $SED -n '/^# Usage:/,/# Report bugs to/ { :print s/^# // s/^# *$// s*\$progname*'$progname'* s*\$host*'"$host"'* s*\$SHELL*'"$SHELL"'* s*\$LTCC*'"$LTCC"'* s*\$LTCFLAGS*'"$LTCFLAGS"'* s*\$LD*'"$LD"'* s/\$with_gnu_ld/'"$with_gnu_ld"'/ s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/ s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/ p d } /^# .* home page:/b print /^# General help using/b print ' < "$progpath" ret=$? if test -z "$1"; then exit $ret fi } # func_missing_arg argname # Echo program name prefixed message to standard error and set global # exit_cmd. func_missing_arg () { $opt_debug func_error "missing argument for $1." exit_cmd=exit } # func_split_short_opt shortopt # Set func_split_short_opt_name and func_split_short_opt_arg shell # variables after splitting SHORTOPT after the 2nd character. func_split_short_opt () { my_sed_short_opt='1s/^\(..\).*$/\1/;q' my_sed_short_rest='1s/^..\(.*\)$/\1/;q' func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"` func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"` } # func_split_short_opt may be replaced by extended shell implementation # func_split_long_opt longopt # Set func_split_long_opt_name and func_split_long_opt_arg shell # variables after splitting LONGOPT at the `=' sign. func_split_long_opt () { my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q' my_sed_long_arg='1s/^--[^=]*=//' func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"` func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"` } # func_split_long_opt may be replaced by extended shell implementation exit_cmd=: magic="%%%MAGIC variable%%%" magic_exe="%%%MAGIC EXE variable%%%" # Global variables. nonopt= preserve_args= lo2o="s/\\.lo\$/.${objext}/" o2lo="s/\\.${objext}\$/.lo/" extracted_archives= extracted_serial=0 # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. exec_cmd= # func_append var value # Append VALUE to the end of shell variable VAR. func_append () { eval "${1}=\$${1}\${2}" } # func_append may be replaced by extended shell implementation # func_append_quoted var value # Quote VALUE and append to the end of shell variable VAR, separated # by a space. func_append_quoted () { func_quote_for_eval "${2}" eval "${1}=\$${1}\\ \$func_quote_for_eval_result" } # func_append_quoted may be replaced by extended shell implementation # func_arith arithmetic-term... func_arith () { func_arith_result=`expr "${@}"` } # func_arith may be replaced by extended shell implementation # func_len string # STRING may not start with a hyphen. func_len () { func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len` } # func_len may be replaced by extended shell implementation # func_lo2o object func_lo2o () { func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` } # func_lo2o may be replaced by extended shell implementation # func_xform libobj-or-source func_xform () { func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` } # func_xform may be replaced by extended shell implementation # func_fatal_configuration arg... # Echo program name prefixed message to standard error, followed by # a configuration failure hint, and exit. func_fatal_configuration () { func_error ${1+"$@"} func_error "See the $PACKAGE documentation for more information." func_fatal_error "Fatal configuration error." } # func_config # Display the configuration for all the tags in this script. func_config () { re_begincf='^# ### BEGIN LIBTOOL' re_endcf='^# ### END LIBTOOL' # Default configuration. $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" # Now print the configurations for the tags. for tagname in $taglist; do $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" done exit $? } # func_features # Display the features supported by this script. func_features () { echo "host: $host" if test "$build_libtool_libs" = yes; then echo "enable shared libraries" else echo "disable shared libraries" fi if test "$build_old_libs" = yes; then echo "enable static libraries" else echo "disable static libraries" fi exit $? } # func_enable_tag tagname # Verify that TAGNAME is valid, and either flag an error and exit, or # enable the TAGNAME tag. We also add TAGNAME to the global $taglist # variable here. func_enable_tag () { # Global variable: tagname="$1" re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" sed_extractcf="/$re_begincf/,/$re_endcf/p" # Validate tagname. case $tagname in *[!-_A-Za-z0-9,/]*) func_fatal_error "invalid tag name: $tagname" ;; esac # Don't test for the "default" C tag, as we know it's # there but not specially marked. case $tagname in CC) ;; *) if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then taglist="$taglist $tagname" # Evaluate the configuration. Be careful to quote the path # and the sed script, to avoid splitting on whitespace, but # also don't use non-portable quotes within backquotes within # quotes we have to do it in 2 steps: extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` eval "$extractedcf" else func_error "ignoring unknown tag $tagname" fi ;; esac } # func_check_version_match # Ensure that we are using m4 macros, and libtool script from the same # release of libtool. func_check_version_match () { if test "$package_revision" != "$macro_revision"; then if test "$VERSION" != "$macro_version"; then if test -z "$macro_version"; then cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from an older release. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from $PACKAGE $macro_version. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF fi else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, $progname: but the definition of this LT_INIT comes from revision $macro_revision. $progname: You should recreate aclocal.m4 with macros from revision $package_revision $progname: of $PACKAGE $VERSION and run autoconf again. _LT_EOF fi exit $EXIT_MISMATCH fi } # Shorthand for --mode=foo, only valid as the first argument case $1 in clean|clea|cle|cl) shift; set dummy --mode clean ${1+"$@"}; shift ;; compile|compil|compi|comp|com|co|c) shift; set dummy --mode compile ${1+"$@"}; shift ;; execute|execut|execu|exec|exe|ex|e) shift; set dummy --mode execute ${1+"$@"}; shift ;; finish|finis|fini|fin|fi|f) shift; set dummy --mode finish ${1+"$@"}; shift ;; install|instal|insta|inst|ins|in|i) shift; set dummy --mode install ${1+"$@"}; shift ;; link|lin|li|l) shift; set dummy --mode link ${1+"$@"}; shift ;; uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) shift; set dummy --mode uninstall ${1+"$@"}; shift ;; esac # Option defaults: opt_debug=: opt_dry_run=false opt_config=false opt_preserve_dup_deps=false opt_features=false opt_finish=false opt_help=false opt_help_all=false opt_silent=: opt_warning=: opt_verbose=: opt_silent=false opt_verbose=false # Parse options once, thoroughly. This comes as soon as possible in the # script to make things like `--version' happen as quickly as we can. { # this just eases exit handling while test $# -gt 0; do opt="$1" shift case $opt in --debug|-x) opt_debug='set -x' func_echo "enabling shell trace mode" $opt_debug ;; --dry-run|--dryrun|-n) opt_dry_run=: ;; --config) opt_config=: func_config ;; --dlopen|-dlopen) optarg="$1" opt_dlopen="${opt_dlopen+$opt_dlopen }$optarg" shift ;; --preserve-dup-deps) opt_preserve_dup_deps=: ;; --features) opt_features=: func_features ;; --finish) opt_finish=: set dummy --mode finish ${1+"$@"}; shift ;; --help) opt_help=: ;; --help-all) opt_help_all=: opt_help=': help-all' ;; --mode) test $# = 0 && func_missing_arg $opt && break optarg="$1" opt_mode="$optarg" case $optarg in # Valid mode arguments: clean|compile|execute|finish|install|link|relink|uninstall) ;; # Catch anything else as an error *) func_error "invalid argument for $opt" exit_cmd=exit break ;; esac shift ;; --no-silent|--no-quiet) opt_silent=false func_append preserve_args " $opt" ;; --no-warning|--no-warn) opt_warning=false func_append preserve_args " $opt" ;; --no-verbose) opt_verbose=false func_append preserve_args " $opt" ;; --silent|--quiet) opt_silent=: func_append preserve_args " $opt" opt_verbose=false ;; --verbose|-v) opt_verbose=: func_append preserve_args " $opt" opt_silent=false ;; --tag) test $# = 0 && func_missing_arg $opt && break optarg="$1" opt_tag="$optarg" func_append preserve_args " $opt $optarg" func_enable_tag "$optarg" shift ;; -\?|-h) func_usage ;; --help) func_help ;; --version) func_version ;; # Separate optargs to long options: --*=*) func_split_long_opt "$opt" set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"} shift ;; # Separate non-argument short options: -\?*|-h*|-n*|-v*) func_split_short_opt "$opt" set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"} shift ;; --) break ;; -*) func_fatal_help "unrecognized option \`$opt'" ;; *) set dummy "$opt" ${1+"$@"}; shift; break ;; esac done # Validate options: # save first non-option argument if test "$#" -gt 0; then nonopt="$opt" shift fi # preserve --debug test "$opt_debug" = : || func_append preserve_args " --debug" case $host in *cygwin* | *mingw* | *pw32* | *cegcc*) # don't eliminate duplications in $postdeps and $predeps opt_duplicate_compiler_generated_deps=: ;; *) opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps ;; esac $opt_help || { # Sanity checks first: func_check_version_match if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then func_fatal_configuration "not configured to build any kind of library" fi # Darwin sucks eval std_shrext=\"$shrext_cmds\" # Only execute mode is allowed to have -dlopen flags. if test -n "$opt_dlopen" && test "$opt_mode" != execute; then func_error "unrecognized option \`-dlopen'" $ECHO "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help="$help" help="Try \`$progname --help --mode=$opt_mode' for more information." } # Bail if the options were screwed $exit_cmd $EXIT_FAILURE } ## ----------- ## ## Main. ## ## ----------- ## # func_lalib_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_lalib_p () { test -f "$1" && $SED -e 4q "$1" 2>/dev/null \ | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } # func_lalib_unsafe_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function implements the same check as func_lalib_p without # resorting to external programs. To this end, it redirects stdin and # closes it afterwards, without saving the original file descriptor. # As a safety measure, use it only where a negative result would be # fatal anyway. Works if `file' does not exist. func_lalib_unsafe_p () { lalib_p=no if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then for lalib_p_l in 1 2 3 4 do read lalib_p_line case "$lalib_p_line" in \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; esac done exec 0<&5 5<&- fi test "$lalib_p" = yes } # func_ltwrapper_script_p file # True iff FILE is a libtool wrapper script # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_script_p () { func_lalib_p "$1" } # func_ltwrapper_executable_p file # True iff FILE is a libtool wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_executable_p () { func_ltwrapper_exec_suffix= case $1 in *.exe) ;; *) func_ltwrapper_exec_suffix=.exe ;; esac $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 } # func_ltwrapper_scriptname file # Assumes file is an ltwrapper_executable # uses $file to determine the appropriate filename for a # temporary ltwrapper_script. func_ltwrapper_scriptname () { func_dirname_and_basename "$1" "" "." func_stripname '' '.exe' "$func_basename_result" func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" } # func_ltwrapper_p file # True iff FILE is a libtool wrapper script or wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_p () { func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" } # func_execute_cmds commands fail_cmd # Execute tilde-delimited COMMANDS. # If FAIL_CMD is given, eval that upon failure. # FAIL_CMD may read-access the current command in variable CMD! func_execute_cmds () { $opt_debug save_ifs=$IFS; IFS='~' for cmd in $1; do IFS=$save_ifs eval cmd=\"$cmd\" func_show_eval "$cmd" "${2-:}" done IFS=$save_ifs } # func_source file # Source FILE, adding directory component if necessary. # Note that it is not necessary on cygwin/mingw to append a dot to # FILE even if both FILE and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # `FILE.' does not work on cygwin managed mounts. func_source () { $opt_debug case $1 in */* | *\\*) . "$1" ;; *) . "./$1" ;; esac } # func_resolve_sysroot PATH # Replace a leading = in PATH with a sysroot. Store the result into # func_resolve_sysroot_result func_resolve_sysroot () { func_resolve_sysroot_result=$1 case $func_resolve_sysroot_result in =*) func_stripname '=' '' "$func_resolve_sysroot_result" func_resolve_sysroot_result=$lt_sysroot$func_stripname_result ;; esac } # func_replace_sysroot PATH # If PATH begins with the sysroot, replace it with = and # store the result into func_replace_sysroot_result. func_replace_sysroot () { case "$lt_sysroot:$1" in ?*:"$lt_sysroot"*) func_stripname "$lt_sysroot" '' "$1" func_replace_sysroot_result="=$func_stripname_result" ;; *) # Including no sysroot. func_replace_sysroot_result=$1 ;; esac } # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. # arg is usually of the form 'gcc ...' func_infer_tag () { $opt_debug if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) for z in $available_tags; do if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case "$@ " in " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then func_echo "unable to infer tagged configuration" func_fatal_error "specify a tag with \`--tag'" # else # func_verbose "using $tagname tagged configuration" fi ;; esac fi } # func_write_libtool_object output_name pic_name nonpic_name # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. func_write_libtool_object () { write_libobj=${1} if test "$build_libtool_libs" = yes; then write_lobj=\'${2}\' else write_lobj=none fi if test "$build_old_libs" = yes; then write_oldobj=\'${3}\' else write_oldobj=none fi $opt_dry_run || { cat >${write_libobj}T </dev/null` if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | $SED -e "$lt_sed_naive_backslashify"` else func_convert_core_file_wine_to_w32_result= fi fi } # end: func_convert_core_file_wine_to_w32 # func_convert_core_path_wine_to_w32 ARG # Helper function used by path conversion functions when $build is *nix, and # $host is mingw, cygwin, or some other w32 environment. Relies on a correctly # configured wine environment available, with the winepath program in $build's # $PATH. Assumes ARG has no leading or trailing path separator characters. # # ARG is path to be converted from $build format to win32. # Result is available in $func_convert_core_path_wine_to_w32_result. # Unconvertible file (directory) names in ARG are skipped; if no directory names # are convertible, then the result may be empty. func_convert_core_path_wine_to_w32 () { $opt_debug # unfortunately, winepath doesn't convert paths, only file names func_convert_core_path_wine_to_w32_result="" if test -n "$1"; then oldIFS=$IFS IFS=: for func_convert_core_path_wine_to_w32_f in $1; do IFS=$oldIFS func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" if test -n "$func_convert_core_file_wine_to_w32_result" ; then if test -z "$func_convert_core_path_wine_to_w32_result"; then func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result" else func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" fi fi done IFS=$oldIFS fi } # end: func_convert_core_path_wine_to_w32 # func_cygpath ARGS... # Wrapper around calling the cygpath program via LT_CYGPATH. This is used when # when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) # $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or # (2), returns the Cygwin file name or path in func_cygpath_result (input # file name or path is assumed to be in w32 format, as previously converted # from $build's *nix or MSYS format). In case (3), returns the w32 file name # or path in func_cygpath_result (input file name or path is assumed to be in # Cygwin format). Returns an empty string on error. # # ARGS are passed to cygpath, with the last one being the file name or path to # be converted. # # Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH # environment variable; do not put it in $PATH. func_cygpath () { $opt_debug if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` if test "$?" -ne 0; then # on failure, ensure result is empty func_cygpath_result= fi else func_cygpath_result= func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'" fi } #end: func_cygpath # func_convert_core_msys_to_w32 ARG # Convert file name or path ARG from MSYS format to w32 format. Return # result in func_convert_core_msys_to_w32_result. func_convert_core_msys_to_w32 () { $opt_debug # awkward: cmd appends spaces to result func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` } #end: func_convert_core_msys_to_w32 # func_convert_file_check ARG1 ARG2 # Verify that ARG1 (a file name in $build format) was converted to $host # format in ARG2. Otherwise, emit an error message, but continue (resetting # func_to_host_file_result to ARG1). func_convert_file_check () { $opt_debug if test -z "$2" && test -n "$1" ; then func_error "Could not determine host file name corresponding to" func_error " \`$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback: func_to_host_file_result="$1" fi } # end func_convert_file_check # func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH # Verify that FROM_PATH (a path in $build format) was converted to $host # format in TO_PATH. Otherwise, emit an error message, but continue, resetting # func_to_host_file_result to a simplistic fallback value (see below). func_convert_path_check () { $opt_debug if test -z "$4" && test -n "$3"; then func_error "Could not determine the host path corresponding to" func_error " \`$3'" func_error "Continuing, but uninstalled executables may not work." # Fallback. This is a deliberately simplistic "conversion" and # should not be "improved". See libtool.info. if test "x$1" != "x$2"; then lt_replace_pathsep_chars="s|$1|$2|g" func_to_host_path_result=`echo "$3" | $SED -e "$lt_replace_pathsep_chars"` else func_to_host_path_result="$3" fi fi } # end func_convert_path_check # func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG # Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT # and appending REPL if ORIG matches BACKPAT. func_convert_path_front_back_pathsep () { $opt_debug case $4 in $1 ) func_to_host_path_result="$3$func_to_host_path_result" ;; esac case $4 in $2 ) func_append func_to_host_path_result "$3" ;; esac } # end func_convert_path_front_back_pathsep ################################################## # $build to $host FILE NAME CONVERSION FUNCTIONS # ################################################## # invoked via `$to_host_file_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # Result will be available in $func_to_host_file_result. # func_to_host_file ARG # Converts the file name ARG from $build format to $host format. Return result # in func_to_host_file_result. func_to_host_file () { $opt_debug $to_host_file_cmd "$1" } # end func_to_host_file # func_to_tool_file ARG LAZY # converts the file name ARG from $build format to toolchain format. Return # result in func_to_tool_file_result. If the conversion in use is listed # in (the comma separated) LAZY, no conversion takes place. func_to_tool_file () { $opt_debug case ,$2, in *,"$to_tool_file_cmd",*) func_to_tool_file_result=$1 ;; *) $to_tool_file_cmd "$1" func_to_tool_file_result=$func_to_host_file_result ;; esac } # end func_to_tool_file # func_convert_file_noop ARG # Copy ARG to func_to_host_file_result. func_convert_file_noop () { func_to_host_file_result="$1" } # end func_convert_file_noop # func_convert_file_msys_to_w32 ARG # Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_file_result. func_convert_file_msys_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_to_host_file_result="$func_convert_core_msys_to_w32_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_w32 # func_convert_file_cygwin_to_w32 ARG # Convert file name ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_file_cygwin_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then # because $build is cygwin, we call "the" cygpath in $PATH; no need to use # LT_CYGPATH in this case. func_to_host_file_result=`cygpath -m "$1"` fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_cygwin_to_w32 # func_convert_file_nix_to_w32 ARG # Convert file name ARG from *nix to w32 format. Requires a wine environment # and a working winepath. Returns result in func_to_host_file_result. func_convert_file_nix_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_file_wine_to_w32 "$1" func_to_host_file_result="$func_convert_core_file_wine_to_w32_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_w32 # func_convert_file_msys_to_cygwin ARG # Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_file_msys_to_cygwin () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_cygpath -u "$func_convert_core_msys_to_w32_result" func_to_host_file_result="$func_cygpath_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_cygwin # func_convert_file_nix_to_cygwin ARG # Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed # in a wine environment, working winepath, and LT_CYGPATH set. Returns result # in func_to_host_file_result. func_convert_file_nix_to_cygwin () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. func_convert_core_file_wine_to_w32 "$1" func_cygpath -u "$func_convert_core_file_wine_to_w32_result" func_to_host_file_result="$func_cygpath_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_cygwin ############################################# # $build to $host PATH CONVERSION FUNCTIONS # ############################################# # invoked via `$to_host_path_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # The result will be available in $func_to_host_path_result. # # Path separators are also converted from $build format to $host format. If # ARG begins or ends with a path separator character, it is preserved (but # converted to $host format) on output. # # All path conversion functions are named using the following convention: # file name conversion function : func_convert_file_X_to_Y () # path conversion function : func_convert_path_X_to_Y () # where, for any given $build/$host combination the 'X_to_Y' value is the # same. If conversion functions are added for new $build/$host combinations, # the two new functions must follow this pattern, or func_init_to_host_path_cmd # will break. # func_init_to_host_path_cmd # Ensures that function "pointer" variable $to_host_path_cmd is set to the # appropriate value, based on the value of $to_host_file_cmd. to_host_path_cmd= func_init_to_host_path_cmd () { $opt_debug if test -z "$to_host_path_cmd"; then func_stripname 'func_convert_file_' '' "$to_host_file_cmd" to_host_path_cmd="func_convert_path_${func_stripname_result}" fi } # func_to_host_path ARG # Converts the path ARG from $build format to $host format. Return result # in func_to_host_path_result. func_to_host_path () { $opt_debug func_init_to_host_path_cmd $to_host_path_cmd "$1" } # end func_to_host_path # func_convert_path_noop ARG # Copy ARG to func_to_host_path_result. func_convert_path_noop () { func_to_host_path_result="$1" } # end func_convert_path_noop # func_convert_path_msys_to_w32 ARG # Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_path_result. func_convert_path_msys_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # Remove leading and trailing path separator characters from ARG. MSYS # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; # and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result="$func_convert_core_msys_to_w32_result" func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_msys_to_w32 # func_convert_path_cygwin_to_w32 ARG # Convert path ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_path_cygwin_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_cygwin_to_w32 # func_convert_path_nix_to_w32 ARG # Convert path ARG from *nix to w32 format. Requires a wine environment and # a working winepath. Returns result in func_to_host_file_result. func_convert_path_nix_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result="$func_convert_core_path_wine_to_w32_result" func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_nix_to_w32 # func_convert_path_msys_to_cygwin ARG # Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_path_msys_to_cygwin () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_msys_to_w32_result" func_to_host_path_result="$func_cygpath_result" func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_msys_to_cygwin # func_convert_path_nix_to_cygwin ARG # Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a # a wine environment, working winepath, and LT_CYGPATH set. Returns result in # func_to_host_file_result. func_convert_path_nix_to_cygwin () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # Remove leading and trailing path separator characters from # ARG. msys behavior is inconsistent here, cygpath turns them # into '.;' and ';.', and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" func_to_host_path_result="$func_cygpath_result" func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_nix_to_cygwin # func_mode_compile arg... func_mode_compile () { $opt_debug # Get the compilation command and the source file. base_compile= srcfile="$nonopt" # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal libobj= later= pie_flag= for arg do case $arg_mode in arg ) # do not "continue". Instead, add this to base_compile lastarg="$arg" arg_mode=normal ;; target ) libobj="$arg" arg_mode=normal continue ;; normal ) # Accept any command-line options. case $arg in -o) test -n "$libobj" && \ func_fatal_error "you cannot specify \`-o' more than once" arg_mode=target continue ;; -pie | -fpie | -fPIE) func_append pie_flag " $arg" continue ;; -shared | -static | -prefer-pic | -prefer-non-pic) func_append later " $arg" continue ;; -no-suppress) suppress_opt=no continue ;; -Xcompiler) arg_mode=arg # the next one goes into the "base_compile" arg list continue # The current "srcfile" will either be retained or ;; # replaced later. I would guess that would be a bug. -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result lastarg= save_ifs="$IFS"; IFS=',' for arg in $args; do IFS="$save_ifs" func_append_quoted lastarg "$arg" done IFS="$save_ifs" func_stripname ' ' '' "$lastarg" lastarg=$func_stripname_result # Add the arguments to base_compile. func_append base_compile " $lastarg" continue ;; *) # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # lastarg="$srcfile" srcfile="$arg" ;; esac # case $arg ;; esac # case $arg_mode # Aesthetically quote the previous argument. func_append_quoted base_compile "$lastarg" done # for arg case $arg_mode in arg) func_fatal_error "you must specify an argument for -Xcompile" ;; target) func_fatal_error "you must specify a target with \`-o'" ;; *) # Get the name of the library object. test -z "$libobj" && { func_basename "$srcfile" libobj="$func_basename_result" } ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo case $libobj in *.[cCFSifmso] | \ *.ada | *.adb | *.ads | *.asm | \ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) func_xform "$libobj" libobj=$func_xform_result ;; esac case $libobj in *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; *) func_fatal_error "cannot determine name of library object from \`$libobj'" ;; esac func_infer_tag $base_compile for arg in $later; do case $arg in -shared) test "$build_libtool_libs" != yes && \ func_fatal_configuration "can not build a shared library" build_old_libs=no continue ;; -static) build_libtool_libs=no build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; esac done func_quote_for_eval "$libobj" test "X$libobj" != "X$func_quote_for_eval_result" \ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ && func_warning "libobj name \`$libobj' may not contain shell special characters." func_dirname_and_basename "$obj" "/" "" objname="$func_basename_result" xdir="$func_dirname_result" lobj=${xdir}$objdir/$objname test -z "$base_compile" && \ func_fatal_help "you must specify a compilation command" # Delete any leftover library objects. if test "$build_old_libs" = yes; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2* | cegcc*) pic_mode=default ;; esac if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test "$compiler_c_o" = no; then output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext} lockfile="$output_obj.lock" else output_obj= need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test "$need_locks" = yes; then until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done elif test "$need_locks" = warn; then if test -f "$lockfile"; then $ECHO "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi func_append removelist " $output_obj" $ECHO "$srcfile" > "$lockfile" fi $opt_dry_run || $RM $removelist func_append removelist " $lockfile" trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 srcfile=$func_to_tool_file_result func_quote_for_eval "$srcfile" qsrcfile=$func_quote_for_eval_result # Only build a PIC object if we are building libtool libraries. if test "$build_libtool_libs" = yes; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile if test "$pic_mode" != no; then command="$base_compile $qsrcfile $pic_flag" else # Don't build PIC code command="$base_compile $qsrcfile" fi func_mkdir_p "$xdir$objdir" if test -z "$output_obj"; then # Place PIC objects in $objdir func_append command " -o $lobj" fi func_show_eval_locale "$command" \ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed, then go on to compile the next one if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then func_show_eval '$MV "$output_obj" "$lobj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi # Allow error messages only from the first compilation. if test "$suppress_opt" = yes; then suppress_output=' >/dev/null 2>&1' fi fi # Only build a position-dependent object if we build old libraries. if test "$build_old_libs" = yes; then if test "$pic_mode" != yes; then # Don't build PIC code command="$base_compile $qsrcfile$pie_flag" else command="$base_compile $qsrcfile $pic_flag" fi if test "$compiler_c_o" = yes; then func_append command " -o $obj" fi # Suppress compiler output if we already did a PIC compilation. func_append command "$suppress_output" func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then func_show_eval '$MV "$output_obj" "$obj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi fi $opt_dry_run || { func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" # Unlock the critical section if it was locked if test "$need_locks" != no; then removelist=$lockfile $RM "$lockfile" fi } exit $EXIT_SUCCESS } $opt_help || { test "$opt_mode" = compile && func_mode_compile ${1+"$@"} } func_mode_help () { # We need to display help for each of the modes. case $opt_mode in "") # Generic help is extracted from the usage comments # at the start of this file. func_help ;; clean) $ECHO \ "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $ECHO \ "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -no-suppress do not suppress compiler output for multiple passes -prefer-pic try to build PIC objects only -prefer-non-pic try to build non-PIC objects only -shared do not build a \`.o' file suitable for static linking -static only build a \`.o' file suitable for static linking -Wc,FLAG pass FLAG directly to the compiler COMPILE-COMMAND is a command to be used in creating a \`standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix \`.c' with the library object suffix, \`.lo'." ;; execute) $ECHO \ "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to \`-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $ECHO \ "Usage: $progname [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the \`--dry-run' option if you just want to see what would be executed." ;; install) $ECHO \ "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the \`install' or \`cp' program. The following components of INSTALL-COMMAND are treated specially: -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $ECHO \ "Usage: $progname [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -bindir BINDIR specify path to binaries directory (for systems where libraries must be found in the PATH setting at runtime) -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE Use a list of object files found in FILE to specify objects -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -shared only do dynamic linking of libtool libraries -shrext SUFFIX override the standard shared library file extension -static do not do any dynamic linking of uninstalled libtool libraries -static-libtool-libs do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] -weak LIBNAME declare that the target provides the LIBNAME interface -Wc,FLAG -Xcompiler FLAG pass linker-specific FLAG directly to the compiler -Wl,FLAG -Xlinker FLAG pass linker-specific FLAG directly to the linker -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) All other options (arguments beginning with \`-') are ignored. Every other argument is treated as a filename. Files ending in \`.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only library objects (\`.lo' files) may be specified, and \`-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created using \`ar' and \`ranlib', or on Windows using \`lib'. If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $ECHO \ "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) func_fatal_help "invalid operation mode \`$opt_mode'" ;; esac echo $ECHO "Try \`$progname --help' for more information about other modes." } # Now that we've collected a possible --mode arg, show help if necessary if $opt_help; then if test "$opt_help" = :; then func_mode_help else { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do func_mode_help done } | sed -n '1p; 2,$s/^Usage:/ or: /p' { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do echo func_mode_help done } | sed '1d /^When reporting/,/^Report/{ H d } $x /information about other modes/d /more detailed .*MODE/d s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' fi exit $? fi # func_mode_execute arg... func_mode_execute () { $opt_debug # The first argument is the command name. cmd="$nonopt" test -z "$cmd" && \ func_fatal_help "you must specify a COMMAND" # Handle -dlopen flags immediately. for file in $opt_dlopen; do test -f "$file" \ || func_fatal_help "\`$file' is not a file" dir= case $file in *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$lib' is not a valid libtool archive" # Read the libtool library. dlname= library_names= func_source "$file" # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && \ func_warning "\`$file' was not linked with \`-export-dynamic'" continue fi func_dirname "$file" "" "." dir="$func_dirname_result" if test -f "$dir/$objdir/$dlname"; then func_append dir "/$objdir" else if test ! -f "$dir/$dlname"; then func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" fi fi ;; *.lo) # Just add the directory containing the .lo file. func_dirname "$file" "" "." dir="$func_dirname_result" ;; *) func_warning "\`-dlopen' is ignored for non-libtool libraries and objects" continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir="$absdir" # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic="$magic" # Check if any of the arguments is a wrapper script. args= for file do case $file in -* | *.la | *.lo ) ;; *) # Do a test to see if this is really a libtool program. if func_ltwrapper_script_p "$file"; then func_source "$file" # Transform arg to wrapped name. file="$progdir/$program" elif func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" func_source "$func_ltwrapper_scriptname_result" # Transform arg to wrapped name. file="$progdir/$program" fi ;; esac # Quote arguments (to preserve shell metacharacters). func_append_quoted args "$file" done if test "X$opt_dry_run" = Xfalse; then if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${save_$lt_var+set}\" = set; then $lt_var=\$save_$lt_var; export $lt_var else $lt_unset $lt_var fi" done # Now prepare to actually exec the command. exec_cmd="\$cmd$args" else # Display what would be done. if test -n "$shlibpath_var"; then eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" echo "export $shlibpath_var" fi $ECHO "$cmd$args" exit $EXIT_SUCCESS fi } test "$opt_mode" = execute && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { $opt_debug libs= libdirs= admincmds= for opt in "$nonopt" ${1+"$@"} do if test -d "$opt"; then func_append libdirs " $opt" elif test -f "$opt"; then if func_lalib_unsafe_p "$opt"; then func_append libs " $opt" else func_warning "\`$opt' is not a valid libtool archive" fi else func_fatal_error "invalid argument \`$opt'" fi done if test -n "$libs"; then if test -n "$lt_sysroot"; then sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" else sysroot_cmd= fi # Remove sysroot references if $opt_dry_run; then for lib in $libs; do echo "removing references to $lt_sysroot and \`=' prefixes from $lib" done else tmpdir=`func_mktempdir` for lib in $libs; do sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ > $tmpdir/tmp-la mv -f $tmpdir/tmp-la $lib done ${RM}r "$tmpdir" fi fi if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. func_execute_cmds "$finish_cmds" 'admincmds="$admincmds '"$cmd"'"' fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $opt_dry_run || eval "$cmds" || func_append admincmds " $cmds" fi done fi # Exit here if they wanted silent mode. $opt_silent && exit $EXIT_SUCCESS if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then echo "----------------------------------------------------------------------" echo "Libraries have been installed in:" for libdir in $libdirs; do $ECHO " $libdir" done echo echo "If you ever happen to want to link against installed libraries" echo "in a given directory, LIBDIR, you must either use libtool, and" echo "specify the full pathname of the library, or use the \`-LLIBDIR'" echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then echo " - add LIBDIR to the \`$shlibpath_var' environment variable" echo " during execution" fi if test -n "$runpath_var"; then echo " - add LIBDIR to the \`$runpath_var' environment variable" echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" $ECHO " - use the \`$flag' linker flag" fi if test -n "$admincmds"; then $ECHO " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" fi echo echo "See any operating system documentation about shared libraries for" case $host in solaris2.[6789]|solaris2.1[0-9]) echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" echo "pages." ;; *) echo "more information, such as the ld(1) and ld.so(8) manual pages." ;; esac echo "----------------------------------------------------------------------" fi exit $EXIT_SUCCESS } test "$opt_mode" = finish && func_mode_finish ${1+"$@"} # func_mode_install arg... func_mode_install () { $opt_debug # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || # Allow the use of GNU shtool's install command. case $nonopt in *shtool*) :;; *) false;; esac; then # Aesthetically quote it. func_quote_for_eval "$nonopt" install_prog="$func_quote_for_eval_result " arg=$1 shift else install_prog= arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. func_quote_for_eval "$arg" func_append install_prog "$func_quote_for_eval_result" install_shared_prog=$install_prog case " $install_prog " in *[\\\ /]cp\ *) install_cp=: ;; *) install_cp=false ;; esac # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=no stripme= no_mode=: for arg do arg2= if test -n "$dest"; then func_append files " $dest" dest=$arg continue fi case $arg in -d) isdir=yes ;; -f) if $install_cp; then :; else prev=$arg fi ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then if test "x$prev" = x-m && test -n "$install_override_mode"; then arg2=$install_override_mode no_mode=false fi prev= else dest=$arg continue fi ;; esac # Aesthetically quote the argument. func_quote_for_eval "$arg" func_append install_prog " $func_quote_for_eval_result" if test -n "$arg2"; then func_quote_for_eval "$arg2" fi func_append install_shared_prog " $func_quote_for_eval_result" done test -z "$install_prog" && \ func_fatal_help "you must specify an install program" test -n "$prev" && \ func_fatal_help "the \`$prev' option requires an argument" if test -n "$install_override_mode" && $no_mode; then if $install_cp; then :; else func_quote_for_eval "$install_override_mode" func_append install_shared_prog " -m $func_quote_for_eval_result" fi fi if test -z "$files"; then if test -z "$dest"; then func_fatal_help "no file or destination specified" else func_fatal_help "you must specify a destination" fi fi # Strip any trailing slash from the destination. func_stripname '' '/' "$dest" dest=$func_stripname_result # Check to see that the destination is a directory. test -d "$dest" && isdir=yes if test "$isdir" = yes; then destdir="$dest" destname= else func_dirname_and_basename "$dest" "" "." destdir="$func_dirname_result" destname="$func_basename_result" # Not a directory, so check to see that there is only one file specified. set dummy $files; shift test "$#" -gt 1 && \ func_fatal_help "\`$dest' is not a directory" fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) func_fatal_help "\`$destdir' must be an absolute directory name" ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. func_append staticlibs " $file" ;; *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$file' is not a valid libtool archive" library_names= old_library= relink_command= func_source "$file" # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) func_append current_libdirs " $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) func_append future_libdirs " $libdir" ;; esac fi func_dirname "$file" "/" "" dir="$func_dirname_result" func_append dir "$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. # At present, this check doesn't affect windows .dll's that # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. test "$inst_prefix_dir" = "$destdir" && \ func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir" if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi func_warning "relinking \`$file'" func_show_eval "$relink_command" \ 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' fi # See the names of the shared library. set dummy $library_names; shift if test -n "$1"; then realname="$1" shift srcname="$realname" test -n "$relink_command" && srcname="$realname"T # Install the shared library and build the symlinks. func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ 'exit $?' tstripme="$stripme" case $host_os in cygwin* | mingw* | pw32* | cegcc*) case $realname in *.dll.a) tstripme="" ;; esac ;; esac if test -n "$tstripme" && test -n "$striplib"; then func_show_eval "$striplib $destdir/$realname" 'exit $?' fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. # Try `ln -sf' first, because the `ln' binary might depend on # the symlink we replace! Solaris /bin/ln does not understand -f, # so we also need to try rm && ln -s. for linkname do test "$linkname" != "$realname" \ && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" done fi # Do each command in the postinstall commands. lib="$destdir/$realname" func_execute_cmds "$postinstall_cmds" 'exit $?' fi # Install the pseudo-library for information purposes. func_basename "$file" name="$func_basename_result" instname="$dir/$name"i func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' # Maybe install the static library, too. test -n "$old_library" && func_append staticlibs " $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) func_lo2o "$destfile" staticdest=$func_lo2o_result ;; *.$objext) staticdest="$destfile" destfile= ;; *) func_fatal_help "cannot copy a libtool object to \`$destfile'" ;; esac # Install the libtool object if requested. test -n "$destfile" && \ func_show_eval "$install_prog $file $destfile" 'exit $?' # Install the old object if enabled. if test "$build_old_libs" = yes; then # Deduce the name of the old-style object file. func_lo2o "$file" staticobj=$func_lo2o_result func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' fi exit $EXIT_SUCCESS ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install stripped_ext="" case $file in *.exe) if test ! -f "$file"; then func_stripname '' '.exe' "$file" file=$func_stripname_result stripped_ext=".exe" fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin* | *mingw*) if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" wrapper=$func_ltwrapper_scriptname_result else func_stripname '' '.exe' "$file" wrapper=$func_stripname_result fi ;; *) wrapper=$file ;; esac if func_ltwrapper_script_p "$wrapper"; then notinst_deplibs= relink_command= func_source "$wrapper" # Check the variables that should have been set. test -z "$generated_by_libtool_version" && \ func_fatal_error "invalid libtool wrapper script \`$wrapper'" finalize=yes for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then func_source "$lib" fi libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test if test -n "$libdir" && test ! -f "$libfile"; then func_warning "\`$lib' has not been installed in \`$libdir'" finalize=no fi done relink_command= func_source "$wrapper" outputname= if test "$fast_install" = no && test -n "$relink_command"; then $opt_dry_run || { if test "$finalize" = yes; then tmpdir=`func_mktempdir` func_basename "$file$stripped_ext" file="$func_basename_result" outputname="$tmpdir/$file" # Replace the output file specification. relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` $opt_silent || { func_quote_for_expand "$relink_command" eval "func_echo $func_quote_for_expand_result" } if eval "$relink_command"; then : else func_error "error: relink \`$file' with the above command before installing it" $opt_dry_run || ${RM}r "$tmpdir" continue fi file="$outputname" else func_warning "cannot relink \`$file'" fi } else # Install the binary that we compiled earlier. file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyway case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) func_stripname '' '.exe' "$destfile" destfile=$func_stripname_result ;; esac ;; esac func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' $opt_dry_run || if test -n "$outputname"; then ${RM}r "$tmpdir" fi ;; esac done for file in $staticlibs; do func_basename "$file" name="$func_basename_result" # Set up the ranlib parameters. oldlib="$destdir/$name" func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result func_show_eval "$install_prog \$file \$oldlib" 'exit $?' if test -n "$stripme" && test -n "$old_striplib"; then func_show_eval "$old_striplib $tool_oldlib" 'exit $?' fi # Do each command in the postinstall commands. func_execute_cmds "$old_postinstall_cmds" 'exit $?' done test -n "$future_libdirs" && \ func_warning "remember to run \`$progname --finish$future_libdirs'" if test -n "$current_libdirs"; then # Maybe just do a dry run. $opt_dry_run && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi } test "$opt_mode" = install && func_mode_install ${1+"$@"} # func_generate_dlsyms outputname originator pic_p # Extract symbols from dlprefiles and create ${outputname}S.o with # a dlpreopen symbol table. func_generate_dlsyms () { $opt_debug my_outputname="$1" my_originator="$2" my_pic_p="${3-no}" my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'` my_dlsyms= if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then if test -n "$NM" && test -n "$global_symbol_pipe"; then my_dlsyms="${my_outputname}S.c" else func_error "not configured to extract global symbols from dlpreopened files" fi fi if test -n "$my_dlsyms"; then case $my_dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist="$output_objdir/${my_outputname}.nm" func_show_eval "$RM $nlist ${nlist}S ${nlist}T" # Parse the name list into a source file. func_verbose "creating $output_objdir/$my_dlsyms" $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ /* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */ /* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */ #ifdef __cplusplus extern \"C\" { #endif #if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) #pragma GCC diagnostic ignored \"-Wstrict-prototypes\" #endif /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif /* External symbol declarations for the compiler. */\ " if test "$dlself" = yes; then func_verbose "generating symbol list for \`$output'" $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` for progfile in $progfiles; do func_to_tool_file "$progfile" func_convert_file_msys_to_w32 func_verbose "extracting global C symbols from \`$func_to_tool_file_result'" $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $opt_dry_run || { eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi if test -n "$export_symbols_regex"; then $opt_dry_run || { eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols="$output_objdir/$outputname.exp" $opt_dry_run || { $RM $export_symbols eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; esac } else $opt_dry_run || { eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; esac } fi fi for dlprefile in $dlprefiles; do func_verbose "extracting global C symbols from \`$dlprefile'" func_basename "$dlprefile" name="$func_basename_result" case $host in *cygwin* | *mingw* | *cegcc* ) # if an import library, we need to obtain dlname if func_win32_import_lib_p "$dlprefile"; then func_tr_sh "$dlprefile" eval "curr_lafile=\$libfile_$func_tr_sh_result" dlprefile_dlbasename="" if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then # Use subshell, to avoid clobbering current variable values dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` if test -n "$dlprefile_dlname" ; then func_basename "$dlprefile_dlname" dlprefile_dlbasename="$func_basename_result" else # no lafile. user explicitly requested -dlpreopen . $sharedlib_from_linklib_cmd "$dlprefile" dlprefile_dlbasename=$sharedlib_from_linklib_result fi fi $opt_dry_run || { if test -n "$dlprefile_dlbasename" ; then eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' else func_warning "Could not compute DLL name from $name" eval '$ECHO ": $name " >> "$nlist"' fi func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" } else # not an import lib $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } fi ;; *) $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } ;; esac done $opt_dry_run || { # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $MV "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if $GREP -v "^: " < "$nlist" | if sort -k 3 /dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else $GREP -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' else echo '/* NONE */' >> "$output_objdir/$my_dlsyms" fi echo >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ typedef struct { const char *name; void *address; } lt_dlsymlist; extern LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[]; LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = {\ { \"$my_originator\", (void *) 0 }," case $need_lib_prefix in no) eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; *) eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; esac echo >> "$output_objdir/$my_dlsyms" "\ {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_${my_prefix}_LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " } # !$opt_dry_run pic_flag_for_symtable= case "$compile_command " in *" -static "*) ;; *) case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; *) if test "X$my_pic_p" != Xno; then pic_flag_for_symtable=" $pic_flag" fi ;; esac ;; esac symtab_cflags= for arg in $LTCFLAGS; do case $arg in -pie | -fpie | -fPIE) ;; *) func_append symtab_cflags " $arg" ;; esac done # Now compile the dynamic symbol file. func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' # Clean up the generated files. func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"' # Transform the symbol file into the correct name. symfileobj="$output_objdir/${my_outputname}S.$objext" case $host in *cygwin* | *mingw* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` else compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` fi ;; *) compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` ;; esac ;; *) func_fatal_error "unknown suffix for \`$my_dlsyms'" ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` fi } # func_win32_libid arg # return the library type of file 'arg' # # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. # Despite the name, also deal with 64 bit binaries. func_win32_libid () { $opt_debug win32_libid_type="unknown" win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then func_to_tool_file "$1" func_convert_file_msys_to_w32 win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | $SED -n -e ' 1,100{ / I /{ s,.*,import, p q } }'` case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; esac fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $ECHO "$win32_libid_type" } # func_cygming_dll_for_implib ARG # # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib () { $opt_debug sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` } # func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs # # The is the core of a fallback implementation of a # platform-specific function to extract the name of the # DLL associated with the specified import library LIBNAME. # # SECTION_NAME is either .idata$6 or .idata$7, depending # on the platform and compiler that created the implib. # # Echos the name of the DLL associated with the # specified import library. func_cygming_dll_for_implib_fallback_core () { $opt_debug match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` $OBJDUMP -s --section "$1" "$2" 2>/dev/null | $SED '/^Contents of section '"$match_literal"':/{ # Place marker at beginning of archive member dllname section s/.*/====MARK====/ p d } # These lines can sometimes be longer than 43 characters, but # are always uninteresting /:[ ]*file format pe[i]\{,1\}-/d /^In archive [^:]*:/d # Ensure marker is printed /^====MARK====/p # Remove all lines with less than 43 characters /^.\{43\}/!d # From remaining lines, remove first 43 characters s/^.\{43\}//' | $SED -n ' # Join marker and all lines until next marker into a single line /^====MARK====/ b para H $ b para b :para x s/\n//g # Remove the marker s/^====MARK====// # Remove trailing dots and whitespace s/[\. \t]*$// # Print /./p' | # we now have a list, one entry per line, of the stringified # contents of the appropriate section of all members of the # archive which possess that section. Heuristic: eliminate # all those which have a first or second character that is # a '.' (that is, objdump's representation of an unprintable # character.) This should work for all archives with less than # 0x302f exports -- but will fail for DLLs whose name actually # begins with a literal '.' or a single character followed by # a '.'. # # Of those that remain, print the first one. $SED -e '/^\./d;/^.\./d;q' } # func_cygming_gnu_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is a GNU/binutils-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_gnu_implib_p () { $opt_debug func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` test -n "$func_cygming_gnu_implib_tmp" } # func_cygming_ms_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is an MS-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_ms_implib_p () { $opt_debug func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` test -n "$func_cygming_ms_implib_tmp" } # func_cygming_dll_for_implib_fallback ARG # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # # This fallback implementation is for use when $DLLTOOL # does not support the --identify-strict option. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib_fallback () { $opt_debug if func_cygming_gnu_implib_p "$1" ; then # binutils import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` elif func_cygming_ms_implib_p "$1" ; then # ms-generated import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` else # unknown sharedlib_from_linklib_result="" fi } # func_extract_an_archive dir oldlib func_extract_an_archive () { $opt_debug f_ex_an_ar_dir="$1"; shift f_ex_an_ar_oldlib="$1" if test "$lock_old_archive_extraction" = yes; then lockfile=$f_ex_an_ar_oldlib.lock until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done fi func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ 'stat=$?; rm -f "$lockfile"; exit $stat' if test "$lock_old_archive_extraction" = yes; then $opt_dry_run || rm -f "$lockfile" fi if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" fi } # func_extract_archives gentop oldlib ... func_extract_archives () { $opt_debug my_gentop="$1"; shift my_oldlibs=${1+"$@"} my_oldobjs="" my_xlib="" my_xabs="" my_xdir="" for my_xlib in $my_oldlibs; do # Extract the objects. case $my_xlib in [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac func_basename "$my_xlib" my_xlib="$func_basename_result" my_xlib_u=$my_xlib while :; do case " $extracted_archives " in *" $my_xlib_u "*) func_arith $extracted_serial + 1 extracted_serial=$func_arith_result my_xlib_u=lt$extracted_serial-$my_xlib ;; *) break ;; esac done extracted_archives="$extracted_archives $my_xlib_u" my_xdir="$my_gentop/$my_xlib_u" func_mkdir_p "$my_xdir" case $host in *-darwin*) func_verbose "Extracting $my_xabs" # Do not bother doing anything if just a dry run $opt_dry_run || { darwin_orig_dir=`pwd` cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` darwin_base_archive=`basename "$darwin_archive"` darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` if test -n "$darwin_arches"; then darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" for darwin_arch in $darwin_arches ; do func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}" $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" func_extract_an_archive "`pwd`" "${darwin_base_archive}" cd "$darwin_curdir" $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" done # $darwin_arches ## Okay now we've a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` $LIPO -create -output "$darwin_file" $darwin_files done # $darwin_filelist $RM -rf unfat-$$ cd "$darwin_orig_dir" else cd $darwin_orig_dir func_extract_an_archive "$my_xdir" "$my_xabs" fi # $darwin_arches } # !$opt_dry_run ;; *) func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` done func_extract_archives_result="$my_oldobjs" } # func_emit_wrapper [arg=no] # # Emit a libtool wrapper script on stdout. # Don't directly open a file because we may want to # incorporate the script contents within a cygwin/mingw # wrapper executable. Must ONLY be called from within # func_mode_link because it depends on a number of variables # set therein. # # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR # variable will take. If 'yes', then the emitted script # will assume that the directory in which it is stored is # the $objdir directory. This is a cygwin/mingw-specific # behavior. func_emit_wrapper () { func_emit_wrapper_arg1=${1-no} $ECHO "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='$sed_quote_subst' # Be Bourne compatible if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variables: generated_by_libtool_version='$macro_version' notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$ECHO are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then file=\"\$0\"" qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` $ECHO "\ # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } ECHO=\"$qECHO\" fi # Very basic option parsing. These options are (a) specific to # the libtool wrapper, (b) are identical between the wrapper # /script/ and the wrapper /executable/ which is used only on # windows platforms, and (c) all begin with the string "--lt-" # (application programs are unlikely to have options which match # this pattern). # # There are only two supported options: --lt-debug and # --lt-dump-script. There is, deliberately, no --lt-help. # # The first argument to this parsing function should be the # script's $0 value, followed by "$@". lt_option_debug= func_parse_lt_options () { lt_script_arg0=\$0 shift for lt_opt do case \"\$lt_opt\" in --lt-debug) lt_option_debug=1 ;; --lt-dump-script) lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` cat \"\$lt_dump_D/\$lt_dump_F\" exit 0 ;; --lt-*) \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 exit 1 ;; esac done # Print the debug banner immediately: if test -n \"\$lt_option_debug\"; then echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2 fi } # Used when --lt-debug. Prints its arguments to stdout # (redirection is the responsibility of the caller) func_lt_dump_args () { lt_dump_args_N=1; for lt_arg do \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\" lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` done } # Core function for launching the target application func_exec_program_core () { " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2* | *-cegcc*) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $ECHO "\ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 exit 1 } # A function to encapsulate launching the target application # Strips options in the --lt-* namespace from \$@ and # launches target application with the remaining arguments. func_exec_program () { case \" \$* \" in *\\ --lt-*) for lt_wr_arg do case \$lt_wr_arg in --lt-*) ;; *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; esac shift done ;; esac func_exec_program_core \${1+\"\$@\"} } # Parse options func_parse_lt_options \"\$0\" \${1+\"\$@\"} # Find the directory that this script lives in. thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` done # Usually 'no', except on cygwin/mingw when embedded into # the cwrapper. WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then # special case for '.' if test \"\$thisdir\" = \".\"; then thisdir=\`pwd\` fi # remove .libs from thisdir case \"\$thisdir\" in *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; $objdir ) thisdir=. ;; esac fi # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test "$fast_install" = yes; then $ECHO "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $MKDIR \"\$progdir\" else $RM \"\$progdir/\$file\" fi" $ECHO "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else $ECHO \"\$relink_command_output\" >&2 $RM \"\$progdir/\$file\" exit 1 fi fi $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $RM \"\$progdir/\$program\"; $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } $RM \"\$progdir/\$file\" fi" else $ECHO "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $ECHO "\ if test -f \"\$progdir/\$program\"; then" # fixup the dll searchpath if we need to. # # Fix the DLL searchpath if we need to. Do this before prepending # to shlibpath, because on Windows, both are PATH and uninstalled # libraries must come first. if test -n "$dllsearchpath"; then $ECHO "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi # Export our shlibpath_var if we have one. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $ECHO "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` export $shlibpath_var " fi $ECHO "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. func_exec_program \${1+\"\$@\"} fi else # The program doesn't exist. \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi\ " } # func_emit_cwrapperexe_src # emit the source code for a wrapper executable on stdout # Must ONLY be called from within func_mode_link because # it depends on a number of variable set therein. func_emit_cwrapperexe_src () { cat < #include #ifdef _MSC_VER # include # include # include #else # include # include # ifdef __CYGWIN__ # include # endif #endif #include #include #include #include #include #include #include #include /* declarations of non-ANSI functions */ #if defined(__MINGW32__) # ifdef __STRICT_ANSI__ int _putenv (const char *); # endif #elif defined(__CYGWIN__) # ifdef __STRICT_ANSI__ char *realpath (const char *, char *); int putenv (char *); int setenv (const char *, const char *, int); # endif /* #elif defined (other platforms) ... */ #endif /* portability defines, excluding path handling macros */ #if defined(_MSC_VER) # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv # define S_IXUSR _S_IEXEC # ifndef _INTPTR_T_DEFINED # define _INTPTR_T_DEFINED # define intptr_t int # endif #elif defined(__MINGW32__) # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv #elif defined(__CYGWIN__) # define HAVE_SETENV # define FOPEN_WB "wb" /* #elif defined (other platforms) ... */ #endif #if defined(PATH_MAX) # define LT_PATHMAX PATH_MAX #elif defined(MAXPATHLEN) # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef S_IXOTH # define S_IXOTH 0 #endif #ifndef S_IXGRP # define S_IXGRP 0 #endif /* path handling portability macros */ #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' #endif #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ defined (__OS2__) # define HAVE_DOS_BASED_FILE_SYSTEM # define FOPEN_WB "wb" # ifndef DIR_SEPARATOR_2 # define DIR_SEPARATOR_2 '\\' # endif # ifndef PATH_SEPARATOR_2 # define PATH_SEPARATOR_2 ';' # endif #endif #ifndef DIR_SEPARATOR_2 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #ifndef PATH_SEPARATOR_2 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) #else /* PATH_SEPARATOR_2 */ # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ #ifndef FOPEN_WB # define FOPEN_WB "w" #endif #ifndef _O_BINARY # define _O_BINARY 0 #endif #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free ((void *) stale); stale = 0; } \ } while (0) #if defined(LT_DEBUGWRAPPER) static int lt_debug = 1; #else static int lt_debug = 0; #endif const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ void *xmalloc (size_t num); char *xstrdup (const char *string); const char *base_name (const char *name); char *find_executable (const char *wrapper); char *chase_symlinks (const char *pathspec); int make_executable (const char *path); int check_executable (const char *path); char *strendzap (char *str, const char *pat); void lt_debugprintf (const char *file, int line, const char *fmt, ...); void lt_fatal (const char *file, int line, const char *message, ...); static const char *nonnull (const char *s); static const char *nonempty (const char *s); void lt_setenv (const char *name, const char *value); char *lt_extend_str (const char *orig_value, const char *add, int to_end); void lt_update_exe_path (const char *name, const char *value); void lt_update_lib_path (const char *name, const char *value); char **prepare_spawn (char **argv); void lt_dump_script (FILE *f); EOF cat <= 0) && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) return 1; else return 0; } int make_executable (const char *path) { int rval = 0; struct stat st; lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", nonempty (path)); if ((!path) || (!*path)) return 0; if (stat (path, &st) >= 0) { rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); } return rval; } /* Searches for the full path of the wrapper. Returns newly allocated full path name if found, NULL otherwise Does not chase symlinks, even on platforms that support them. */ char * find_executable (const char *wrapper) { int has_slash = 0; const char *p; const char *p_next; /* static buffer for getcwd */ char tmp[LT_PATHMAX + 1]; int tmp_len; char *concat_name; lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", nonempty (wrapper)); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; /* Absolute path? */ #if defined (HAVE_DOS_BASED_FILE_SYSTEM) if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } else { #endif if (IS_DIR_SEPARATOR (wrapper[0])) { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } #if defined (HAVE_DOS_BASED_FILE_SYSTEM) } #endif for (p = wrapper; *p; p++) if (*p == '/') { has_slash = 1; break; } if (!has_slash) { /* no slashes; search PATH */ const char *path = getenv ("PATH"); if (path != NULL) { for (p = path; *p; p = p_next) { const char *q; size_t p_len; for (q = p; *q; q++) if (IS_PATH_SEPARATOR (*q)) break; p_len = q - p; p_next = (*q == '\0' ? q : q + 1); if (p_len == 0) { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); } else { concat_name = XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, p, p_len); concat_name[p_len] = '/'; strcpy (concat_name + p_len + 1, wrapper); } if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } } /* not found in PATH; assume curdir */ } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); return NULL; } char * chase_symlinks (const char *pathspec) { #ifndef S_ISLNK return xstrdup (pathspec); #else char buf[LT_PATHMAX]; struct stat s; char *tmp_pathspec = xstrdup (pathspec); char *p; int has_symlinks = 0; while (strlen (tmp_pathspec) && !has_symlinks) { lt_debugprintf (__FILE__, __LINE__, "checking path component for symlinks: %s\n", tmp_pathspec); if (lstat (tmp_pathspec, &s) == 0) { if (S_ISLNK (s.st_mode) != 0) { has_symlinks = 1; break; } /* search backwards for last DIR_SEPARATOR */ p = tmp_pathspec + strlen (tmp_pathspec) - 1; while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) p--; if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) { /* no more DIR_SEPARATORS left */ break; } *p = '\0'; } else { lt_fatal (__FILE__, __LINE__, "error accessing file \"%s\": %s", tmp_pathspec, nonnull (strerror (errno))); } } XFREE (tmp_pathspec); if (!has_symlinks) { return xstrdup (pathspec); } tmp_pathspec = realpath (pathspec, buf); if (tmp_pathspec == 0) { lt_fatal (__FILE__, __LINE__, "could not follow symlinks for %s", pathspec); } return xstrdup (tmp_pathspec); #endif } char * strendzap (char *str, const char *pat) { size_t len, patlen; assert (str != NULL); assert (pat != NULL); len = strlen (str); patlen = strlen (pat); if (patlen <= len) { str += len - patlen; if (strcmp (str, pat) == 0) *str = '\0'; } return str; } void lt_debugprintf (const char *file, int line, const char *fmt, ...) { va_list args; if (lt_debug) { (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); va_start (args, fmt); (void) vfprintf (stderr, fmt, args); va_end (args); } } static void lt_error_core (int exit_status, const char *file, int line, const char *mode, const char *message, va_list ap) { fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *file, int line, const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); va_end (ap); } static const char * nonnull (const char *s) { return s ? s : "(null)"; } static const char * nonempty (const char *s) { return (s && !*s) ? "(empty)" : nonnull (s); } void lt_setenv (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_setenv) setting '%s' to '%s'\n", nonnull (name), nonnull (value)); { #ifdef HAVE_SETENV /* always make a copy, for consistency with !HAVE_SETENV */ char *str = xstrdup (value); setenv (name, str, 1); #else int len = strlen (name) + 1 + strlen (value) + 1; char *str = XMALLOC (char, len); sprintf (str, "%s=%s", name, value); if (putenv (str) != EXIT_SUCCESS) { XFREE (str); } #endif } } char * lt_extend_str (const char *orig_value, const char *add, int to_end) { char *new_value; if (orig_value && *orig_value) { int orig_value_len = strlen (orig_value); int add_len = strlen (add); new_value = XMALLOC (char, add_len + orig_value_len + 1); if (to_end) { strcpy (new_value, orig_value); strcpy (new_value + orig_value_len, add); } else { strcpy (new_value, add); strcpy (new_value + add_len, orig_value); } } else { new_value = xstrdup (add); } return new_value; } void lt_update_exe_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); /* some systems can't cope with a ':'-terminated path #' */ int len = strlen (new_value); while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1])) { new_value[len-1] = '\0'; } lt_setenv (name, new_value); XFREE (new_value); } } void lt_update_lib_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); lt_setenv (name, new_value); XFREE (new_value); } } EOF case $host_os in mingw*) cat <<"EOF" /* Prepares an argument vector before calling spawn(). Note that spawn() does not by itself call the command interpreter (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); GetVersionEx(&v); v.dwPlatformId == VER_PLATFORM_WIN32_NT; }) ? "cmd.exe" : "command.com"). Instead it simply concatenates the arguments, separated by ' ', and calls CreateProcess(). We must quote the arguments since Win32 CreateProcess() interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a special way: - Space and tab are interpreted as delimiters. They are not treated as delimiters if they are surrounded by double quotes: "...". - Unescaped double quotes are removed from the input. Their only effect is that within double quotes, space and tab are treated like normal characters. - Backslashes not followed by double quotes are not special. - But 2*n+1 backslashes followed by a double quote become n backslashes followed by a double quote (n >= 0): \" -> " \\\" -> \" \\\\\" -> \\" */ #define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" #define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" char ** prepare_spawn (char **argv) { size_t argc; char **new_argv; size_t i; /* Count number of arguments. */ for (argc = 0; argv[argc] != NULL; argc++) ; /* Allocate new argument vector. */ new_argv = XMALLOC (char *, argc + 1); /* Put quoted arguments into the new argument vector. */ for (i = 0; i < argc; i++) { const char *string = argv[i]; if (string[0] == '\0') new_argv[i] = xstrdup ("\"\""); else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) { int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); size_t length; unsigned int backslashes; const char *s; char *quoted_string; char *p; length = 0; backslashes = 0; if (quote_around) length++; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') length += backslashes + 1; length++; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) length += backslashes + 1; quoted_string = XMALLOC (char, length + 1); p = quoted_string; backslashes = 0; if (quote_around) *p++ = '"'; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') { unsigned int j; for (j = backslashes + 1; j > 0; j--) *p++ = '\\'; } *p++ = c; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) { unsigned int j; for (j = backslashes; j > 0; j--) *p++ = '\\'; *p++ = '"'; } *p = '\0'; new_argv[i] = quoted_string; } else new_argv[i] = (char *) string; } new_argv[argc] = NULL; return new_argv; } EOF ;; esac cat <<"EOF" void lt_dump_script (FILE* f) { EOF func_emit_wrapper yes | $SED -n -e ' s/^\(.\{79\}\)\(..*\)/\1\ \2/ h s/\([\\"]\)/\\\1/g s/$/\\n/ s/\([^\n]*\).*/ fputs ("\1", f);/p g D' cat <<"EOF" } EOF } # end: func_emit_cwrapperexe_src # func_win32_import_lib_p ARG # True if ARG is an import lib, as indicated by $file_magic_cmd func_win32_import_lib_p () { $opt_debug case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in *import*) : ;; *) false ;; esac } # func_mode_link arg... func_mode_link () { $opt_debug case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # which system we are compiling for in order to pass an extra # flag for every libtool invocation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying # to make a dll which has undefined symbols, in which case not # even a static library is built. For now, we need to specify # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. allow_undefined=yes ;; *) allow_undefined=yes ;; esac libtool_args=$nonopt base_compile="$nonopt $@" compile_command=$nonopt finalize_command=$nonopt compile_rpath= finalize_rpath= compile_shlibpath= finalize_shlibpath= convenience= old_convenience= deplibs= old_deplibs= compiler_flags= linker_flags= dllsearchpath= lib_search_path=`pwd` inst_prefix_dir= new_inherited_linker_flags= avoid_version=no bindir= dlfiles= dlprefiles= dlself=no export_dynamic=no export_symbols= export_symbols_regex= generated= libobjs= ltlibs= module=no no_install=no objs= non_pic_objects= precious_files_regex= prefer_static_libs=no preload=no prev= prevarg= release= rpath= xrpath= perm_rpath= temp_rpath= thread_safe=no vinfo= vinfo_number=no weak_libs= single_module="${wl}-single_module" func_infer_tag $base_compile # We need to know -static, to get the right output filenames. for arg do case $arg in -shared) test "$build_libtool_libs" != yes && \ func_fatal_configuration "can not build a shared library" build_old_libs=no break ;; -all-static | -static | -static-libtool-libs) case $arg in -all-static) if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then func_warning "complete static linking is impossible in this configuration" fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; -static) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=built ;; -static-libtool-libs) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; esac build_libtool_libs=no build_old_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg="$1" shift func_quote_for_eval "$arg" qarg=$func_quote_for_eval_unquoted_result func_append libtool_args " $func_quote_for_eval_result" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) func_append compile_command " @OUTPUT@" func_append finalize_command " @OUTPUT@" ;; esac case $prev in bindir) bindir="$arg" prev= continue ;; dlfiles|dlprefiles) if test "$preload" = no; then # Add the symbol object into the linking commands. func_append compile_command " @SYMFILE@" func_append finalize_command " @SYMFILE@" preload=yes fi case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test "$dlself" = no; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test "$prev" = dlprefiles; then dlself=yes elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test "$prev" = dlfiles; then func_append dlfiles " $arg" else func_append dlprefiles " $arg" fi prev= continue ;; esac ;; expsyms) export_symbols="$arg" test -f "$arg" \ || func_fatal_error "symbol file \`$arg' does not exist" prev= continue ;; expsyms_regex) export_symbols_regex="$arg" prev= continue ;; framework) case $host in *-*-darwin*) case "$deplibs " in *" $qarg.ltframework "*) ;; *) func_append deplibs " $qarg.ltframework" # this is fixed later ;; esac ;; esac prev= continue ;; inst_prefix) inst_prefix_dir="$arg" prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat "$save_arg"` do # func_append moreargs " $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi done else func_fatal_error "link input file \`$arg' does not exist" fi arg=$save_arg prev= continue ;; precious_regex) precious_files_regex="$arg" prev= continue ;; release) release="-$arg" prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac if test "$prev" = rpath; then case "$rpath " in *" $arg "*) ;; *) func_append rpath " $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) func_append xrpath " $arg" ;; esac fi prev= continue ;; shrext) shrext_cmds="$arg" prev= continue ;; weak) func_append weak_libs " $arg" prev= continue ;; xcclinker) func_append linker_flags " $qarg" func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xcompiler) func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xlinker) func_append linker_flags " $qarg" func_append compiler_flags " $wl$qarg" prev= func_append compile_command " $wl$qarg" func_append finalize_command " $wl$qarg" continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n "$prev" prevarg="$arg" case $arg in -all-static) if test -n "$link_static_flag"; then # See comment for -static flag below, for more details. func_append compile_command " $link_static_flag" func_append finalize_command " $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. func_fatal_error "\`-allow-undefined' must not be used because it is the default" ;; -avoid-version) avoid_version=yes continue ;; -bindir) prev=bindir continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then func_fatal_error "more than one -exported-symbols argument is not allowed" fi if test "X$arg" = "X-export-symbols"; then prev=expsyms else prev=expsyms_regex fi continue ;; -framework) prev=framework continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | /*-*-irix*) func_append compile_command " $arg" func_append finalize_command " $arg" ;; esac continue ;; -L*) func_stripname "-L" '' "$arg" if test -z "$func_stripname_result"; then if test "$#" -gt 0; then func_fatal_error "require no space between \`-L' and \`$1'" else func_fatal_error "need path for \`-L' option" fi fi func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` test -z "$absdir" && \ func_fatal_error "cannot determine absolute directory name of \`$dir'" dir="$absdir" ;; esac case "$deplibs " in *" -L$dir "* | *" $arg "*) # Will only happen for absolute or sysroot arguments ;; *) # Preserve sysroot, but never include relative directories case $dir in [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; *) func_append deplibs " -L$dir" ;; esac func_append lib_search_path " $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; ::) dllsearchpath=$dir;; *) func_append dllsearchpath ":$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac continue ;; -l*) if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) # These systems don't actually have a C or math library (as such) continue ;; *-*-os2*) # These systems don't actually have a C library (as such) test "X$arg" = "X-lc" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework func_append deplibs " System.ltframework" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype test "X$arg" = "X-lc" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test "X$arg" = "X-lc" && continue ;; esac elif test "X$arg" = "X-lc_r"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi func_append deplibs " $arg" continue ;; -module) module=yes continue ;; # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. # Darwin uses the -arch flag to determine output architecture. -model|-arch|-isysroot|--sysroot) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" prev=xcompiler continue ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case "$new_inherited_linker_flags " in *" $arg "*) ;; * ) func_append new_inherited_linker_flags " $arg" ;; esac continue ;; -multi_module) single_module="${wl}-multi_module" continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) # The PATH hackery in wrapper scripts is required on Windows # and Darwin in order for the loader to find any dlls it needs. func_warning "\`-no-install' is ignored for $host" func_warning "assuming \`-no-fast-install' instead" fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -objectlist) prev=objectlist continue ;; -o) prev=output ;; -precious-files-regex) prev=precious_regex continue ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) func_stripname '-R' '' "$arg" dir=$func_stripname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; =*) func_stripname '=' '' "$dir" dir=$lt_sysroot$func_stripname_result ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac continue ;; -shared) # The effects of -shared are defined in a previous loop. continue ;; -shrext) prev=shrext continue ;; -static | -static-libtool-libs) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -version-number) prev=vinfo vinfo_number=yes continue ;; -weak) prev=weak continue ;; -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" func_append arg " $func_quote_for_eval_result" func_append compiler_flags " $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Wl,*) func_stripname '-Wl,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" func_append arg " $wl$func_quote_for_eval_result" func_append compiler_flags " $wl$func_quote_for_eval_result" func_append linker_flags " $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # -msg_* for osf cc -msg_*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; # Flags to be passed through unchanged, with rationale: # -64, -mips[0-9] enable 64-bit mode for the SGI compiler # -r[0-9][0-9]* specify processor for the SGI compiler # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler # +DA*, +DD* enable 64-bit mode for the HP compiler # -q* compiler args for the IBM compiler # -m*, -t[45]*, -txscale* architecture-specific flags for GCC # -F/path path to uninstalled frameworks, gcc on darwin # -p, -pg, --coverage, -fprofile-* profiling flags for GCC # @file GCC response files # -tp=* Portland pgcc target processor selection # --sysroot=* for sysroot support # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ -O*|-flto*|-fwhopr*|-fuse-linker-plugin) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" func_append compile_command " $arg" func_append finalize_command " $arg" func_append compiler_flags " $arg" continue ;; # Some other compiler flag. -* | +*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; *.$objext) # A standard object. func_append objs " $arg" ;; *.lo) # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi ;; *.$libext) # An archive. func_append deplibs " $arg" func_append old_deplibs " $arg" continue ;; *.la) # A libtool-controlled library. func_resolve_sysroot "$arg" if test "$prev" = dlfiles; then # This library was specified with -dlopen. func_append dlfiles " $func_resolve_sysroot_result" prev= elif test "$prev" = dlprefiles; then # The library was specified with -dlpreopen. func_append dlprefiles " $func_resolve_sysroot_result" prev= else func_append deplibs " $func_resolve_sysroot_result" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then func_append compile_command " $arg" func_append finalize_command " $arg" fi done # argument parsing loop test -n "$prev" && \ func_fatal_help "the \`$prevarg' option requires an argument" if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" func_append compile_command " $arg" func_append finalize_command " $arg" fi oldlibs= # calculate the name of the file, without its directory func_basename "$output" outputname="$func_basename_result" libobjs_save="$libobjs" if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" func_dirname "$output" "/" "" output_objdir="$func_dirname_result$objdir" func_to_tool_file "$output_objdir/" tool_output_objdir=$func_to_tool_file_result # Create the object directory. func_mkdir_p "$output_objdir" # Determine the type of output case $output in "") func_fatal_help "you must specify an output file" ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac specialdeplibs= libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do if $opt_preserve_dup_deps ; then case "$libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append libs " $deplib" done if test "$linkmode" = lib; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps # $postdeps and mark them as special (i.e., whose duplicates are # not to be eliminated). pre_post_deps= if $opt_duplicate_compiler_generated_deps; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; esac func_append pre_post_deps " $pre_post_dep" done fi pre_post_deps= fi deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries notinst_path= # paths that contain not-installed libtool libraries case $linkmode in lib) passes="conv dlpreopen link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file" ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=no newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do # The preopen pass in lib mode reverses $deplibs; put it back here # so that -L comes before libs that need it for instance... if test "$linkmode,$pass" = "lib,link"; then ## FIXME: Find the place where the list is rebuilt in the wrong ## order, and fix it there properly tmp_deplibs= for deplib in $deplibs; do tmp_deplibs="$deplib $tmp_deplibs" done deplibs="$tmp_deplibs" fi if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan"; then libs="$deplibs" deplibs= fi if test "$linkmode" = prog; then case $pass in dlopen) libs="$dlfiles" ;; dlpreopen) libs="$dlprefiles" ;; link) libs="$deplibs %DEPLIBS%" test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs" ;; esac fi if test "$linkmode,$pass" = "lib,dlpreopen"; then # Collect and forward deplibs of preopened libtool libs for lib in $dlprefiles; do # Ignore non-libtool-libs dependency_libs= func_resolve_sysroot "$lib" case $lib in *.la) func_source "$func_resolve_sysroot_result" ;; esac # Collect preopened libtool deplibs, except any this library # has declared as weak libs for deplib in $dependency_libs; do func_basename "$deplib" deplib_base=$func_basename_result case " $weak_libs " in *" $deplib_base "*) ;; *) func_append deplibs " $deplib" ;; esac done done libs="$dlprefiles" fi if test "$pass" = dlopen; then # Collect dlpreopened libraries save_deplibs="$deplibs" deplibs= fi for deplib in $libs; do lib= found=no case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append compiler_flags " $deplib" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -l*) if test "$linkmode" != lib && test "$linkmode" != prog; then func_warning "\`-l' is ignored for archives/objects" continue fi func_stripname '-l' '' "$deplib" name=$func_stripname_result if test "$linkmode" = lib; then searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" else searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" fi for searchdir in $searchdirs; do for search_ext in .la $std_shrext .so .a; do # Search the libtool library lib="$searchdir/lib${name}${search_ext}" if test -f "$lib"; then if test "$search_ext" = ".la"; then found=yes else found=no fi break 2 fi done done if test "$found" != yes; then # deplib doesn't seem to be a libtool library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue else # deplib is a libtool library # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, # We need to do some special things here, and not later. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $deplib "*) if func_lalib_p "$lib"; then library_names= old_library= func_source "$lib" for l in $old_library $library_names; do ll="$l" done if test "X$ll" = "X$old_library" ; then # only static version available found=no func_dirname "$lib" "" "." ladir="$func_dirname_result" lib=$ladir/$old_library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi fi ;; # -l *.ltframework) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test "$pass" = conv && continue newdependency_libs="$deplib $newdependency_libs" func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; prog) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi if test "$pass" = scan; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; *) func_warning "\`-L' is ignored for archives/objects" ;; esac # linkmode continue ;; # -L -R*) if test "$pass" = link; then func_stripname '-R' '' "$deplib" func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) func_resolve_sysroot "$deplib" lib=$func_resolve_sysroot_result ;; *.$libext) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) # Linking convenience modules into shared libraries is allowed, # but linking other static libraries is non-portable. case " $dlpreconveniencelibs " in *" $deplib "*) ;; *) valid_a_lib=no case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=yes fi ;; pass_all) valid_a_lib=yes ;; esac if test "$valid_a_lib" != yes; then echo $ECHO "*** Warning: Trying to link with static lib archive $deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because the file extensions .$libext of this argument makes me believe" echo "*** that it is just a static archive that I should not use here." else echo $ECHO "*** Warning: Linking the shared library $output against the" $ECHO "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" fi ;; esac continue ;; prog) if test "$pass" != link; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test "$pass" = conv; then deplibs="$deplib $deplibs" elif test "$linkmode" = prog; then if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlopen support or we're linking statically, # we need to preload. func_append newdlprefiles " $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append newdlfiles " $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=yes continue ;; esac # case $deplib if test "$found" = yes || test -f "$lib"; then : else func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'" fi # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$lib" \ || func_fatal_error "\`$lib' is not a valid libtool archive" func_dirname "$lib" "" "." ladir="$func_dirname_result" dlname= dlopen= dlpreopen= libdir= library_names= old_library= inherited_linker_flags= # If the library was installed with an old release of libtool, # it will not redefine variables installed, or shouldnotlink installed=yes shouldnotlink=no avoidtemprpath= # Read the .la file func_source "$lib" # Convert "-framework foo" to "foo.ltframework" if test -n "$inherited_linker_flags"; then tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do case " $new_inherited_linker_flags " in *" $tmp_inherited_linker_flag "*) ;; *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; esac done fi dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan" || { test "$linkmode" != prog && test "$linkmode" != lib; }; then test -n "$dlopen" && func_append dlfiles " $dlopen" test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" fi if test "$pass" = conv; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # It is a libtool convenience library, so add in its objects. func_append convenience " $ladir/$objdir/$old_library" func_append old_convenience " $ladir/$objdir/$old_library" tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done elif test "$linkmode" != prog && test "$linkmode" != lib; then func_fatal_error "\`$lib' is not a convenience library" fi continue fi # $pass = conv # Get the name of the library we link against. linklib= if test -n "$old_library" && { test "$prefer_static_libs" = yes || test "$prefer_static_libs,$installed" = "built,no"; }; then linklib=$old_library else for l in $old_library $library_names; do linklib="$l" done fi if test -z "$linklib"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # This library was specified with -dlopen. if test "$pass" = dlopen; then if test -z "$libdir"; then func_fatal_error "cannot -dlopen a convenience library: \`$lib'" fi if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. func_append dlprefiles " $lib $dependency_libs" else func_append newdlfiles " $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then func_warning "cannot determine absolute directory name of \`$ladir'" func_warning "passing it literally to the linker, although it might fail" abs_ladir="$ladir" fi ;; esac func_basename "$lib" laname="$func_basename_result" # Find the relevant object directory and library name. if test "X$installed" = Xyes; then if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then func_warning "library \`$lib' was moved." dir="$ladir" absdir="$abs_ladir" libdir="$abs_ladir" else dir="$lt_sysroot$libdir" absdir="$lt_sysroot$libdir" fi test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes else if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then dir="$ladir" absdir="$abs_ladir" # Remove this search path later func_append notinst_path " $abs_ladir" else dir="$ladir/$objdir" absdir="$abs_ladir/$objdir" # Remove this search path later func_append notinst_path " $abs_ladir" fi fi # $installed = yes func_stripname 'lib' '.la' "$laname" name=$func_stripname_result # This library was specified with -dlpreopen. if test "$pass" = dlpreopen; then if test -z "$libdir" && test "$linkmode" = prog; then func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" fi case "$host" in # special handling for platforms with PE-DLLs. *cygwin* | *mingw* | *cegcc* ) # Linker will automatically link against shared library if both # static and shared are present. Therefore, ensure we extract # symbols from the import library if a shared library is present # (otherwise, the dlopen module name will be incorrect). We do # this by putting the import library name into $newdlprefiles. # We recover the dlopen module name by 'saving' the la file # name in a special purpose variable, and (later) extracting the # dlname from the la file. if test -n "$dlname"; then func_tr_sh "$dir/$linklib" eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" func_append newdlprefiles " $dir/$linklib" else func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" fi ;; * ) # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then func_append newdlprefiles " $dir/$dlname" else func_append newdlprefiles " $dir/$linklib" fi ;; esac fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test "$linkmode" = lib; then deplibs="$dir/$old_library $deplibs" elif test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" # used for prog,scan pass fi continue fi if test "$linkmode" = prog && test "$pass" != link; then func_append newlib_search_path " $ladir" deplibs="$lib $deplibs" linkalldeplibs=no if test "$link_all_deplibs" != no || test -z "$library_names" || test "$build_libtool_libs" = no; then linkalldeplibs=yes fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; esac # Need to link against all dependency_libs? if test "$linkalldeplibs" = yes; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done # for deplib continue fi # $linkmode = prog... if test "$linkmode,$pass" = "prog,link"; then if test -n "$library_names" && { { test "$prefer_static_libs" = no || test "$prefer_static_libs,$installed" = "built,yes"; } || test -z "$old_library"; }; then # We need to hardcode the library path if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then # Make sure the rpath contains only unique directories. case "$temp_rpath:" in *"$absdir:"*) ;; *) func_append temp_rpath "$absdir:" ;; esac fi # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi # $linkmode,$pass = prog,link... if test "$alldeplibs" = yes && { test "$deplibs_check_method" = pass_all || { test "$build_libtool_libs" = yes && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi fi link_static=no # Whether the deplib will be linked statically use_static_libs=$prefer_static_libs if test "$use_static_libs" = built && test "$installed" = yes; then use_static_libs=no fi if test -n "$library_names" && { test "$use_static_libs" = no || test -z "$old_library"; }; then case $host in *cygwin* | *mingw* | *cegcc*) # No point in relinking DLLs because paths are not encoded func_append notinst_deplibs " $lib" need_relink=no ;; *) if test "$installed" = no; then func_append notinst_deplibs " $lib" need_relink=yes fi ;; esac # This is a shared library # Warn about portability, can't link against -module's on some # systems (darwin). Don't bleat about dlopened modules though! dlopenmodule="" for dlpremoduletest in $dlprefiles; do if test "X$dlpremoduletest" = "X$lib"; then dlopenmodule="$dlpremoduletest" break fi done if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then echo if test "$linkmode" = prog; then $ECHO "*** Warning: Linking the executable $output against the loadable module" else $ECHO "*** Warning: Linking the shared library $output against the loadable module" fi $ECHO "*** $linklib is not portable!" fi if test "$linkmode" = lib && test "$hardcode_into_libs" = yes; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names shift realname="$1" shift libname=`eval "\\$ECHO \"$libname_spec\""` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then soname="$dlname" elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin* | mingw* | *cegcc*) func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; esac eval soname=\"$soname_spec\" else soname="$realname" fi # Make a new name for the extract_expsyms_cmds to use soroot="$soname" func_basename "$soroot" soname="$func_basename_result" func_stripname 'lib' '.dll' "$soname" newlib=libimp-$func_stripname_result.a # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else func_verbose "extracting exported symbol list from \`$soname'" func_execute_cmds "$extract_expsyms_cmds" 'exit $?' fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else func_verbose "generating import library for \`$soname'" func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" if test "$linkmode" = prog || test "$opt_mode" != relink; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test "$hardcode_direct" = no; then add="$dir/$linklib" case $host in *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; *-*-sysv4*uw2*) add_dir="-L$dir" ;; *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ *-*-unixware7*) add_dir="-L$dir" ;; *-*-darwin* ) # if the lib is a (non-dlopened) module then we can not # link against it, someone is ignoring the earlier warnings if /usr/bin/file -L $add 2> /dev/null | $GREP ": [^:]* bundle" >/dev/null ; then if test "X$dlopenmodule" != "X$lib"; then $ECHO "*** Warning: lib $linklib is a module, not a shared library" if test -z "$old_library" ; then echo echo "*** And there doesn't seem to be a static archive available" echo "*** The link will probably fail, sorry" else add="$dir/$old_library" fi elif test -n "$old_library"; then add="$dir/$old_library" fi fi esac elif test "$hardcode_minus_L" = no; then case $host in *-*-sunos*) add_shlibpath="$dir" ;; esac add_dir="-L$dir" add="-l$name" elif test "$hardcode_shlibpath_var" = no; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; relink) if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$dir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$absdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; *) lib_linked=no ;; esac if test "$lib_linked" != yes; then func_fatal_configuration "unsupported hardcode properties" fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) func_append compile_shlibpath "$add_shlibpath:" ;; esac fi if test "$linkmode" = prog; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test "$hardcode_direct" != yes && test "$hardcode_minus_L" != yes && test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac fi fi fi if test "$linkmode" = prog || test "$opt_mode" = relink; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$libdir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$libdir" add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac add="-l$name" elif test "$hardcode_automatic" = yes; then if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then add="$inst_prefix_dir$libdir/$linklib" else add="$libdir/$linklib" fi else # We cannot seem to hardcode it, guess we'll fake it. add_dir="-L$libdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" fi if test "$linkmode" = prog; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test "$linkmode" = prog; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test "$hardcode_direct" != unsupported; then test -n "$old_library" && linklib="$old_library" compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test "$build_libtool_libs" = yes; then # Not a shared library if test "$deplibs_check_method" != pass_all; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. echo $ECHO "*** Warning: This system can not link to static lib archive $lib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have." if test "$module" = yes; then echo "*** But as you try to build a module library, libtool will still create " echo "*** a static module, that should work as long as the dlopening application" echo "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test "$linkmode" = lib; then if test -n "$dependency_libs" && { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes || test "$link_static" = yes; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) func_stripname '-R' '' "$libdir" temp_xrpath=$func_stripname_result case " $xrpath " in *" $temp_xrpath "*) ;; *) func_append xrpath " $temp_xrpath";; esac;; *) func_append temp_deplibs " $libdir";; esac done dependency_libs="$temp_deplibs" fi func_append newlib_search_path " $absdir" # Link against this library test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result";; *) func_resolve_sysroot "$deplib" ;; esac if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $func_resolve_sysroot_result "*) func_append specialdeplibs " $func_resolve_sysroot_result" ;; esac fi func_append tmp_libs " $func_resolve_sysroot_result" done if test "$link_all_deplibs" != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do path= case $deplib in -L*) path="$deplib" ;; *.la) func_resolve_sysroot "$deplib" deplib=$func_resolve_sysroot_result func_dirname "$deplib" "" "." dir=$func_dirname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then func_warning "cannot determine absolute directory name of \`$dir'" absdir="$dir" fi ;; esac if $GREP "^installed=no" $deplib > /dev/null; then case $host in *-*-darwin*) depdepl= eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` if test -n "$deplibrary_names" ; then for tmp in $deplibrary_names ; do depdepl=$tmp done if test -f "$absdir/$objdir/$depdepl" ; then depdepl="$absdir/$objdir/$depdepl" darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` if test -z "$darwin_install_name"; then darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` fi func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}" path= fi fi ;; *) path="-L$absdir/$objdir" ;; esac else eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" test "$absdir" != "$libdir" && \ func_warning "\`$deplib' seems to be moved" path="-L$absdir" fi ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$path $deplibs" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs if test "$pass" = link; then if test "$linkmode" = "prog"; then compile_deplibs="$new_inherited_linker_flags $compile_deplibs" finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" else compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` fi fi dependency_libs="$newdependency_libs" if test "$pass" = dlpreopen; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test "$pass" != dlopen; then if test "$pass" != conv; then # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) func_append lib_search_path " $dir" ;; esac done newlib_search_path= fi if test "$linkmode,$pass" != "prog,link"; then vars="deplibs" else vars="compile_deplibs finalize_deplibs" fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do # FIXME: Pedantically, this is the right thing to do, so # that some nasty dependency loop isn't accidentally # broken: #new_libs="$deplib $new_libs" # Pragmatically, this seems to cause very few problems in # practice: case $deplib in -L*) new_libs="$deplib $new_libs" ;; -R*) ;; *) # And here is the reason: when a library appears more # than once as an explicit dependence of a library, or # is implicitly linked in more than once by the # compiler, it is considered special, and multiple # occurrences thereof are not removed. Compare this # with having the same library being listed as a # dependency of multiple other libraries: in this case, # we know (pedantically, we assume) the library does not # need to be listed more than once, so we keep only the # last copy. This is not always right, but it is rare # enough that we require users that really mean to play # such unportable linking tricks to link the library # using -Wl,-lname, so that libtool does not consider it # for duplicate removal. case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) func_append tmp_libs " $deplib" ;; esac ;; *) func_append tmp_libs " $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= for i in $dependency_libs ; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) i="" ;; esac if test -n "$i" ; then func_append tmp_libs " $i" fi done dependency_libs=$tmp_libs done # for pass if test "$linkmode" = prog; then dlfiles="$newdlfiles" fi if test "$linkmode" = prog || test "$linkmode" = lib; then dlprefiles="$newdlprefiles" fi case $linkmode in oldlib) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for archives" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for archives" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for archives" test -n "$xrpath" && \ func_warning "\`-R' is ignored for archives" test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for archives" test -n "$release" && \ func_warning "\`-release' is ignored for archives" test -n "$export_symbols$export_symbols_regex" && \ func_warning "\`-export-symbols' is ignored for archives" # Now set the variables for building old libraries. build_libtool_libs=no oldlibs="$output" func_append objs "$old_deplibs" ;; lib) # Make sure we only generate libraries of the form `libNAME.la'. case $outputname in lib*) func_stripname 'lib' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" ;; *) test "$module" = no && \ func_fatal_help "libtool library \`$output' must begin with \`lib'" if test "$need_lib_prefix" != no; then # Add the "lib" prefix for modules if required func_stripname '' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" else func_stripname '' '.la' "$outputname" libname=$func_stripname_result fi ;; esac if test -n "$objs"; then if test "$deplibs_check_method" != pass_all; then func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs" else echo $ECHO "*** Warning: Linking the shared library $output against the non-libtool" $ECHO "*** objects $objs is not portable!" func_append libobjs " $objs" fi fi test "$dlself" != no && \ func_warning "\`-dlopen self' is ignored for libtool libraries" set dummy $rpath shift test "$#" -gt 1 && \ func_warning "ignoring multiple \`-rpath's for a libtool library" install_libdir="$1" oldlibs= if test -z "$rpath"; then if test "$build_libtool_libs" = yes; then # Building a libtool convenience library. # Some compilers have problems with a `.al' extension so # convenience libraries should have the same extension an # archive normally would. oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for convenience libraries" test -n "$release" && \ func_warning "\`-release' is ignored for convenience libraries" else # Parse the version information argument. save_ifs="$IFS"; IFS=':' set dummy $vinfo 0 0 0 shift IFS="$save_ifs" test -n "$7" && \ func_fatal_help "too many parameters to \`-version-info'" # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts # to make the code below a bit more comprehensible case $vinfo_number in yes) number_major="$1" number_minor="$2" number_revision="$3" # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix # which has an extra 1 added just for fun # case $version_type in # correct linux to gnu/linux during the next big refactor darwin|linux|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_revision" ;; freebsd-aout|freebsd-elf|qnx|sunos) current="$number_major" revision="$number_minor" age="0" ;; irix|nonstopux) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_minor" lt_irix_increment=no ;; *) func_fatal_configuration "$modename: unknown library version type \`$version_type'" ;; esac ;; no) current="$1" revision="$2" age="$3" ;; esac # Check that each of the things are valid numbers. case $current in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "CURRENT \`$current' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $revision in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "REVISION \`$revision' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $age in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "AGE \`$age' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac if test "$age" -gt "$current"; then func_error "AGE \`$age' is greater than the current interface number \`$current'" func_fatal_error "\`$vinfo' is not valid version information" fi # Calculate the version variables. major= versuffix= verstring= case $version_type in none) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" # Darwin ld doesn't like 0 for these options... func_arith $current + 1 minor_current=$func_arith_result xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; freebsd-aout) major=".$current" versuffix=".$current.$revision"; ;; freebsd-elf) major=".$current" versuffix=".$current" ;; irix | nonstopux) if test "X$lt_irix_increment" = "Xno"; then func_arith $current - $age else func_arith $current - $age + 1 fi major=$func_arith_result case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac verstring="$verstring_prefix$major.$revision" # Add in all the interfaces that we are compatible with. loop=$revision while test "$loop" -ne 0; do func_arith $revision - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring_prefix$major.$iface:$verstring" done # Before this point, $major must not contain `.'. major=.$major versuffix="$major.$revision" ;; linux) # correct to gnu/linux during the next big refactor func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" ;; osf) func_arith $current - $age major=.$func_arith_result versuffix=".$current.$age.$revision" verstring="$current.$age.$revision" # Add in all the interfaces that we are compatible with. loop=$age while test "$loop" -ne 0; do func_arith $current - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring:${iface}.0" done # Make executables depend on our current version. func_append verstring ":${current}.0" ;; qnx) major=".$current" versuffix=".$current" ;; sunos) major=".$current" versuffix=".$current.$revision" ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 filesystems. func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; *) func_fatal_configuration "unknown library version type \`$version_type'" ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring= ;; *) verstring="0.0" ;; esac if test "$need_version" = no; then versuffix= else versuffix=".0.0" fi fi # Remove version info from name if versioning should be avoided if test "$avoid_version" = yes && test "$need_version" = no; then major= versuffix= verstring="" fi # Check to see if the archive will have undefined symbols. if test "$allow_undefined" = yes; then if test "$allow_undefined_flag" = unsupported; then func_warning "undefined symbols not allowed in $host shared libraries" build_libtool_libs=no build_old_libs=yes fi else # Don't allow undefined symbols. allow_undefined_flag="$no_undefined_flag" fi fi func_generate_dlsyms "$libname" "$libname" "yes" func_append libobjs " $symfileobj" test "X$libobjs" = "X " && libobjs= if test "$opt_mode" != relink; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= tempremovelist=`$ECHO "$output_objdir/*"` for p in $tempremovelist; do case $p in *.$objext | *.gcno) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) if test "X$precious_files_regex" != "X"; then if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi func_append removelist " $p" ;; *) ;; esac done test -n "$removelist" && \ func_show_eval "${RM}r \$removelist" fi # Now set the variables for building old libraries. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then func_append oldlibs " $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP` fi # Eliminate all temporary directories. #for path in $notinst_path; do # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` #done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do func_replace_sysroot "$libdir" func_append temp_xrpath " -R$func_replace_sysroot_result" case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles="$dlfiles" dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) func_append dlfiles " $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles="$dlprefiles" dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) func_append dlprefiles " $lib" ;; esac done if test "$build_libtool_libs" = yes; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework func_append deplibs " System.ltframework" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work ;; *) # Add libc to deplibs on all other systems if necessary. if test "$build_libtool_need_lc" = "yes"; then func_append deplibs " -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release="" versuffix="" major="" newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behavior. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $opt_dry_run || $RM conftest.c cat > conftest.c </dev/null` $nocaseglob else potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` fi for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null | $GREP " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib="$potent_lib" while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | $SED -e 10q | $EGREP "$file_magic_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for file magic test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a file magic. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` for a_deplib in $deplibs; do case $a_deplib in -l*) func_stripname -l '' "$a_deplib" name=$func_stripname_result if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) func_append newdeplibs " $a_deplib" a_deplib="" ;; esac fi if test -n "$a_deplib" ; then libname=`eval "\\$ECHO \"$libname_spec\""` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib="$potent_lib" # see symlink-check above in file_magic test if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ $EGREP "$match_pattern_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a regex pattern. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; none | unknown | *) newdeplibs="" tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then for i in $predeps $postdeps ; do # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"` done fi case $tmp_deplibs in *[!\ \ ]*) echo if test "X$deplibs_check_method" = "Xnone"; then echo "*** Warning: inter-library dependencies are not supported in this platform." else echo "*** Warning: inter-library dependencies are not known to be supported." fi echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes ;; esac ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library with the System framework newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac if test "$droppeddeps" = yes; then if test "$module" = yes; then echo echo "*** Warning: libtool could not satisfy all declared inter-library" $ECHO "*** dependencies of module $libname. Therefore, libtool will create" echo "*** a static module, that should work as long as the dlopening" echo "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else echo "*** The inter-library dependencies that have been dropped here will be" echo "*** automatically added whenever a program is linked with this library" echo "*** or is declared to -dlopen it." if test "$allow_undefined" = no; then echo echo "*** Since this library must not contain undefined symbols," echo "*** because either the platform does not support them or" echo "*** it was explicitly requested with -no-undefined," echo "*** libtool will only create a static version of it." if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" case $host in *-*-darwin*) newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done deplibs="$new_libs" # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then # Remove ${wl} instances when linking with ld. # FIXME: should test the right _cmds variable. case $archive_cmds in *\$LD\ *) wl= ;; esac if test "$hardcode_into_libs" = yes; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath="$finalize_rpath" test "$opt_mode" != relink && rpath="$compile_rpath$rpath" for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then func_replace_sysroot "$libdir" libdir=$func_replace_sysroot_result if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append dep_rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath="$finalize_shlibpath" test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath" if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval shared_ext=\"$shrext_cmds\" eval library_names=\"$library_names_spec\" set dummy $library_names shift realname="$1" shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname="$realname" fi if test -z "$dlname"; then dlname=$soname fi lib="$output_objdir/$realname" linknames= for link do func_append linknames " $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` test "X$libobjs" = "X " && libobjs= delfiles= if test -n "$export_symbols" && test -n "$include_expsyms"; then $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" export_symbols="$output_objdir/$libname.uexp" func_append delfiles " $export_symbols" fi orig_export_symbols= case $host_os in cygwin* | mingw* | cegcc*) if test -n "$export_symbols" && test -z "$export_symbols_regex"; then # exporting using user supplied symfile if test "x`$SED 1q $export_symbols`" != xEXPORTS; then # and it's NOT already a .def file. Must figure out # which of the given symbols are data symbols and tag # them as such. So, trigger use of export_symbols_cmds. # export_symbols gets reassigned inside the "prepare # the list of exported symbols" if statement, so the # include_expsyms logic still works. orig_export_symbols="$export_symbols" export_symbols= always_export_symbols=yes fi fi ;; esac # Prepare the list of exported symbols if test -z "$export_symbols"; then if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols cmds=$export_symbols_cmds save_ifs="$IFS"; IFS='~' for cmd1 in $cmds; do IFS="$save_ifs" # Take the normal branch if the nm_file_list_spec branch # doesn't work or if tool conversion is not needed. case $nm_file_list_spec~$to_tool_file_cmd in *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) try_normal_branch=yes eval cmd=\"$cmd1\" func_len " $cmd" len=$func_len_result ;; *) try_normal_branch=no ;; esac if test "$try_normal_branch" = yes \ && { test "$len" -lt "$max_cmd_len" \ || test "$max_cmd_len" -le -1; } then func_show_eval "$cmd" 'exit $?' skipped_export=false elif test -n "$nm_file_list_spec"; then func_basename "$output" output_la=$func_basename_result save_libobjs=$libobjs save_output=$output output=${output_objdir}/${output_la}.nm func_to_tool_file "$output" libobjs=$nm_file_list_spec$func_to_tool_file_result func_append delfiles " $output" func_verbose "creating $NM input file list: $output" for obj in $save_libobjs; do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > "$output" eval cmd=\"$cmd1\" func_show_eval "$cmd" 'exit $?' output=$save_output libobjs=$save_libobjs skipped_export=false else # The command line is too long to execute in one step. func_verbose "using reloadable object file for export list..." skipped_export=: # Break out early, otherwise skipped_export may be # set to false by a later but shorter cmd. break fi done IFS="$save_ifs" if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) func_append tmp_deplibs " $test_deplib" ;; esac done deplibs="$tmp_deplibs" if test -n "$convenience"; then if test -n "$whole_archive_flag_spec" && test "$compiler_needs_object" = yes && test -z "$libobjs"; then # extract the archives, so we have objects to list. # TODO: could optimize this to just extract one archive. whole_archive_flag_spec= fi if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= else gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $convenience func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi fi if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" func_append linker_flags " $flag" fi # Make a backup of the uninstalled library when relinking if test "$opt_mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds else eval test_cmds=\"$module_cmds\" cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval test_cmds=\"$archive_expsym_cmds\" cmds=$archive_expsym_cmds else eval test_cmds=\"$archive_cmds\" cmds=$archive_cmds fi fi if test "X$skipped_export" != "X:" && func_len " $test_cmds" && len=$func_len_result && test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # The command line is too long to link in one step, link piecewise # or, if using GNU ld and skipped_export is not :, use a linker # script. # Save the value of $output and $libobjs because we want to # use them later. If we have whole_archive_flag_spec, we # want to use save_libobjs as it was before # whole_archive_flag_spec was expanded, because we can't # assume the linker understands whole_archive_flag_spec. # This may have to be revisited, in case too many # convenience libraries get linked in and end up exceeding # the spec. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then save_libobjs=$libobjs fi save_output=$output func_basename "$output" output_la=$func_basename_result # Clear the reloadable object creation command queue and # initialize k to one. test_cmds= concat_cmds= objlist= last_robj= k=1 if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then output=${output_objdir}/${output_la}.lnkscript func_verbose "creating GNU ld script: $output" echo 'INPUT (' > $output for obj in $save_libobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done echo ')' >> $output func_append delfiles " $output" func_to_tool_file "$output" output=$func_to_tool_file_result elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then output=${output_objdir}/${output_la}.lnk func_verbose "creating linker input file list: $output" : > $output set x $save_libobjs shift firstobj= if test "$compiler_needs_object" = yes; then firstobj="$1 " shift fi for obj do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done func_append delfiles " $output" func_to_tool_file "$output" output=$firstobj\"$file_list_spec$func_to_tool_file_result\" else if test -n "$save_libobjs"; then func_verbose "creating reloadable object files..." output=$output_objdir/$output_la-${k}.$objext eval test_cmds=\"$reload_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 # Loop over the list of objects to be linked. for obj in $save_libobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result if test "X$objlist" = X || test "$len" -lt "$max_cmd_len"; then func_append objlist " $obj" else # The command $test_cmds is almost too long, add a # command to the queue. if test "$k" -eq 1 ; then # The first file doesn't have a previous command to add. reload_objs=$objlist eval concat_cmds=\"$reload_cmds\" else # All subsequent reloadable object files will link in # the last one created. reload_objs="$objlist $last_robj" eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" fi last_robj=$output_objdir/$output_la-${k}.$objext func_arith $k + 1 k=$func_arith_result output=$output_objdir/$output_la-${k}.$objext objlist=" $obj" func_len " $last_robj" func_arith $len0 + $func_len_result len=$func_arith_result fi done # Handle the remaining objects by creating one last # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ reload_objs="$objlist $last_robj" eval concat_cmds=\"\${concat_cmds}$reload_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" fi func_append delfiles " $output" else output= fi if ${skipped_export-false}; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols libobjs=$output # Append the command to create the export file. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi fi test -n "$save_libobjs" && func_verbose "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. save_ifs="$IFS"; IFS='~' for cmd in $concat_cmds; do IFS="$save_ifs" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" if test -n "$export_symbols_regex" && ${skipped_export-false}; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi if ${skipped_export-false}; then if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi fi libobjs=$output # Restore the value of output. output=$save_output if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= fi # Expand the library linking commands again to reset the # value of $libobjs for piecewise linking. # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then cmds=$archive_expsym_cmds else cmds=$archive_cmds fi fi fi if test -n "$delfiles"; then # Append the command to remove temporary files to $cmds. eval cmds=\"\$cmds~\$RM $delfiles\" fi # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" # Restore the uninstalled library and exit if test "$opt_mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? if test -n "$convenience"; then if test -z "$whole_archive_flag_spec"; then func_show_eval '${RM}r "$gentop"' fi fi exit $EXIT_SUCCESS fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' fi done # If -module or -export-dynamic was specified, set the dlname. if test "$module" = yes || test "$export_dynamic" = yes; then # On all known operating systems, these are identical. dlname="$soname" fi fi ;; obj) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for objects" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for objects" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for objects" test -n "$xrpath" && \ func_warning "\`-R' is ignored for objects" test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for objects" test -n "$release" && \ func_warning "\`-release' is ignored for objects" case $output in *.lo) test -n "$objs$old_deplibs" && \ func_fatal_error "cannot build library object \`$output' from non-libtool objects" libobj=$output func_lo2o "$libobj" obj=$func_lo2o_result ;; *) libobj= obj="$output" ;; esac # Delete the old objects. $opt_dry_run || $RM $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # reload_cmds runs $LD directly, so let us get rid of # -Wl from whole_archive_flag_spec and hope we can get by with # turning comma into space.. wl= if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` else gentop="$output_objdir/${obj}x" func_append generated " $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi # If we're not building shared, we need to use non_pic_objs test "$build_libtool_libs" != yes && libobjs="$non_pic_objects" # Create the old-style object. reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test output="$obj" func_execute_cmds "$reload_cmds" 'exit $?' # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS fi if test "$build_libtool_libs" != yes; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. # $show "echo timestamp > $libobj" # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? exit $EXIT_SUCCESS fi if test -n "$pic_flag" || test "$pic_mode" != default; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output="$libobj" func_execute_cmds "$reload_cmds" 'exit $?' fi if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS ;; prog) case $host in *cygwin*) func_stripname '' '.exe' "$output" output=$func_stripname_result.exe;; esac test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for programs" test -n "$release" && \ func_warning "\`-release' is ignored for programs" test "$preload" = yes \ && test "$dlopen_support" = unknown \ && test "$dlopen_self" = unknown \ && test "$dlopen_self_static" = unknown && \ func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support." case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac case $host in *-*-darwin*) # Don't allow lazy linking, it breaks C++ global constructors # But is supposedly fixed on 10.4 or later (yay!). if test "$tagname" = CXX ; then case ${MACOSX_DEPLOYMENT_TARGET-10.0} in 10.[0123]) func_append compile_command " ${wl}-bind_at_load" func_append finalize_command " ${wl}-bind_at_load" ;; esac fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $compile_deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $compile_deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done compile_deplibs="$new_libs" func_append compile_command " $compile_deplibs" func_append finalize_command " $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; ::) dllsearchpath=$libdir;; *) func_append dllsearchpath ":$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath="$rpath" rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) func_append finalize_perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath="$rpath" if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` fi func_generate_dlsyms "$outputname" "@PROGRAM@" "no" # template prelinking step if test -n "$prelink_cmds"; then func_execute_cmds "$prelink_cmds" 'exit $?' fi wrappers_required=yes case $host in *cegcc* | *mingw32ce*) # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. wrappers_required=no ;; *cygwin* | *mingw* ) if test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; *) if test "$need_relink" = no || test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; esac if test "$wrappers_required" = no; then # Replace the output file specification. compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. exit_status=0 func_show_eval "$link_command" 'exit_status=$?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Delete the generated files. if test -f "$output_objdir/${outputname}S.${objext}"; then func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' fi exit $exit_status fi if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do func_append rpath "$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test "$no_install" = yes; then # We don't need to create a wrapper script. link_command="$compile_var$compile_command$compile_rpath" # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $opt_dry_run || $RM $output # Link the executable and exit func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi exit $EXIT_SUCCESS fi if test "$hardcode_action" = relink; then # Fast installation is not supported link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" func_warning "this platform does not like uninstalled shared libraries" func_warning "\`$output' will be relinked during installation" else if test "$fast_install" != no; then link_command="$finalize_var$compile_command$finalize_rpath" if test "$fast_install" = yes; then relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` else # fast_install is set to needless relink_command= fi else link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" fi fi # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output_objdir/$outputname" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Now create the wrapper script. func_verbose "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done relink_command="(cd `pwd`; $relink_command)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` fi # Only actually do things if not in dry run mode. $opt_dry_run || { # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) func_stripname '' '.exe' "$output" output=$func_stripname_result ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe func_stripname '' '.exe' "$outputname" outputname=$func_stripname_result ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) func_dirname_and_basename "$output" "" "." output_name=$func_basename_result output_path=$func_dirname_result cwrappersource="$output_path/$objdir/lt-$output_name.c" cwrapper="$output_path/$output_name.exe" $RM $cwrappersource $cwrapper trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 func_emit_cwrapperexe_src > $cwrappersource # The wrapper executable is built using the $host compiler, # because it contains $host paths and files. If cross- # compiling, it, like the target executable, must be # executed on the $host or under an emulation environment. $opt_dry_run || { $LTCC $LTCFLAGS -o $cwrapper $cwrappersource $STRIP $cwrapper } # Now, create the wrapper script for func_source use: func_ltwrapper_scriptname $cwrapper $RM $func_ltwrapper_scriptname_result trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 $opt_dry_run || { # note: this script will not be executed, so do not chmod. if test "x$build" = "x$host" ; then $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result else func_emit_wrapper no > $func_ltwrapper_scriptname_result fi } ;; * ) $RM $output trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 func_emit_wrapper no > $output chmod +x $output ;; esac } exit $EXIT_SUCCESS ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do if test "$build_libtool_libs" = convenience; then oldobjs="$libobjs_save $symfileobj" addlibs="$convenience" build_libtool_libs=no else if test "$build_libtool_libs" = module; then oldobjs="$libobjs_save" build_libtool_libs=no else oldobjs="$old_deplibs $non_pic_objects" if test "$preload" = yes && test -f "$symfileobj"; then func_append oldobjs " $symfileobj" fi fi addlibs="$old_convenience" fi if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $addlibs func_append oldobjs " $func_extract_archives_result" fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then cmds=$old_archive_from_new_cmds else # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append oldobjs " $func_extract_archives_result" fi # POSIX demands no paths to be encoded in archives. We have # to avoid creating archives with duplicate basenames if we # might have to extract them afterwards, e.g., when creating a # static archive out of a convenience library, or when linking # the entirety of a libtool archive into another (currently # not supported by libtool). if (for obj in $oldobjs do func_basename "$obj" $ECHO "$func_basename_result" done | sort | sort -uc >/dev/null 2>&1); then : else echo "copying selected object files to avoid basename conflicts..." gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_mkdir_p "$gentop" save_oldobjs=$oldobjs oldobjs= counter=1 for obj in $save_oldobjs do func_basename "$obj" objbase="$func_basename_result" case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) while :; do # Make sure we don't pick an alternate name that also # overlaps. newobj=lt$counter-$objbase func_arith $counter + 1 counter=$func_arith_result case " $oldobjs " in *[\ /]"$newobj "*) ;; *) if test ! -f "$gentop/$newobj"; then break; fi ;; esac done func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" func_append oldobjs " $gentop/$newobj" ;; *) func_append oldobjs " $obj" ;; esac done fi func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result eval cmds=\"$old_archive_cmds\" func_len " $cmds" len=$func_len_result if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds elif test -n "$archiver_list_spec"; then func_verbose "using command file archive linking..." for obj in $oldobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > $output_objdir/$libname.libcmd func_to_tool_file "$output_objdir/$libname.libcmd" oldobjs=" $archiver_list_spec$func_to_tool_file_result" cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts func_verbose "using piecewise archive linking..." save_RANLIB=$RANLIB RANLIB=: objlist= concat_cmds= save_oldobjs=$oldobjs oldobjs= # Is there a better way of finding the last object in the list? for obj in $save_oldobjs do last_oldobj=$obj done eval test_cmds=\"$old_archive_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 for obj in $save_oldobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result func_append objlist " $obj" if test "$len" -lt "$max_cmd_len"; then : else # the above command should be used before it gets too long oldobjs=$objlist if test "$obj" = "$last_oldobj" ; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" objlist= len=$len0 fi done RANLIB=$save_RANLIB oldobjs=$objlist if test "X$oldobjs" = "X" ; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" fi fi fi func_execute_cmds "$cmds" 'exit $?' done test -n "$generated" && \ func_show_eval "${RM}r$generated" # Now create the libtool archive. case $output in *.la) old_library= test "$build_old_libs" = yes && old_library="$libname.$libext" func_verbose "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` if test "$hardcode_automatic" = yes ; then relink_command= fi # Only create the output if not a dry run. $opt_dry_run || { for installed in no yes; do if test "$installed" = yes; then if test -z "$install_libdir"; then break fi output="$output_objdir/$outputname"i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) func_basename "$deplib" name="$func_basename_result" func_resolve_sysroot "$deplib" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" ;; -L*) func_stripname -L '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -L$func_replace_sysroot_result" ;; -R*) func_stripname -R '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -R$func_replace_sysroot_result" ;; *) func_append newdependency_libs " $deplib" ;; esac done dependency_libs="$newdependency_libs" newdlfiles= for lib in $dlfiles; do case $lib in *.la) func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" ;; *) func_append newdlfiles " $lib" ;; esac done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in *.la) # Only pass preopened files to the pseudo-archive (for # eventual linking with the app. that links it) if we # didn't already link the preopened objects directly into # the library: func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" ;; esac done dlprefiles="$newdlprefiles" else newdlfiles= for lib in $dlfiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlfiles " $abs" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlprefiles " $abs" done dlprefiles="$newdlprefiles" fi $RM $output # place dlname in correct position for cygwin # In fact, it would be nice if we could use this code for all target # systems that can't hard-code library paths into their executables # and that have no shared library path variable independent of PATH, # but it turns out we can't easily determine that from inspecting # libtool variables, so we have to hard-code the OSs to which it # applies here; at the moment, that means platforms that use the PE # object format with DLL files. See the long comment at the top of # tests/bindir.at for full details. tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) # If a -bindir argument was supplied, place the dll there. if test "x$bindir" != x ; then func_relative_path "$install_libdir" "$bindir" tdlname=$func_relative_path_result$dlname else # Otherwise fall back on heuristic. tdlname=../bin/$dlname fi ;; esac $ECHO > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Linker flags that can not go in dependency_libs. inherited_linker_flags='$new_inherited_linker_flags' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Names of additional weak libraries provided by this library weak_library_names='$weak_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Should we warn about portability when linking against -modules? shouldnotlink=$module # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test "$installed" = no && test "$need_relink" = yes; then $ECHO >> $output "\ relink_command=\"$relink_command\"" fi done } # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' ;; esac exit $EXIT_SUCCESS } { test "$opt_mode" = link || test "$opt_mode" = relink; } && func_mode_link ${1+"$@"} # func_mode_uninstall arg... func_mode_uninstall () { $opt_debug RM="$nonopt" files= rmforce= exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" for arg do case $arg in -f) func_append RM " $arg"; rmforce=yes ;; -*) func_append RM " $arg" ;; *) func_append files " $arg" ;; esac done test -z "$RM" && \ func_fatal_help "you must specify an RM program" rmdirs= for file in $files; do func_dirname "$file" "" "." dir="$func_dirname_result" if test "X$dir" = X.; then odir="$objdir" else odir="$dir/$objdir" fi func_basename "$file" name="$func_basename_result" test "$opt_mode" = uninstall && odir="$dir" # Remember odir for removal later, being careful to avoid duplicates if test "$opt_mode" = clean; then case " $rmdirs " in *" $odir "*) ;; *) func_append rmdirs " $odir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if { test -L "$file"; } >/dev/null 2>&1 || { test -h "$file"; } >/dev/null 2>&1 || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif test "$rmforce" = yes; then continue fi rmfiles="$file" case $name in *.la) # Possibly a libtool archive, so verify it. if func_lalib_p "$file"; then func_source $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do func_append rmfiles " $odir/$n" done test -n "$old_library" && func_append rmfiles " $odir/$old_library" case "$opt_mode" in clean) case " $library_names " in *" $dlname "*) ;; *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; esac test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" ;; uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi # FIXME: should reinstall the best remaining shared library. ;; esac fi ;; *.lo) # Possibly a libtool object, so verify it. if func_lalib_p "$file"; then # Read the .lo file func_source $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" && test "$pic_object" != none; then func_append rmfiles " $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" && test "$non_pic_object" != none; then func_append rmfiles " $dir/$non_pic_object" fi fi ;; *) if test "$opt_mode" = clean ; then noexename=$name case $file in *.exe) func_stripname '' '.exe' "$file" file=$func_stripname_result func_stripname '' '.exe' "$name" noexename=$func_stripname_result # $file with .exe has already been added to rmfiles, # add $file without .exe func_append rmfiles " $file" ;; esac # Do a test to see if this is a libtool program. if func_ltwrapper_p "$file"; then if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" relink_command= func_source $func_ltwrapper_scriptname_result func_append rmfiles " $func_ltwrapper_scriptname_result" else relink_command= func_source $dir/$noexename fi # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles func_append rmfiles " $odir/$name $odir/${name}S.${objext}" if test "$fast_install" = yes && test -n "$relink_command"; then func_append rmfiles " $odir/lt-$name" fi if test "X$noexename" != "X$name" ; then func_append rmfiles " $odir/lt-${noexename}.c" fi fi fi ;; esac func_show_eval "$RM $rmfiles" 'exit_status=1' done # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then func_show_eval "rmdir $dir >/dev/null 2>&1" fi done exit $exit_status } { test "$opt_mode" = uninstall || test "$opt_mode" = clean; } && func_mode_uninstall ${1+"$@"} test -z "$opt_mode" && { help="$generic_help" func_fatal_help "you must specify a MODE" } test -z "$exec_cmd" && \ func_fatal_help "invalid operation mode \`$opt_mode'" if test -n "$exec_cmd"; then eval exec "$exec_cmd" exit $EXIT_FAILURE fi exit $exit_status # The TAGs below are defined such that we never get into a situation # in which we disable both kinds of libraries. Given conflicting # choices, we go for a static library, that is the most portable, # since we can't tell whether shared libraries were disabled because # the user asked for that or because the platform doesn't support # them. This is particularly important on AIX, because we don't # support having both static and shared libraries enabled at the same # time on that platform, so we default to a shared-only configuration. # If a disable-shared tag is given, we'll fallback to a static-only # configuration. But we'll never go from static-only to shared-only. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared build_libtool_libs=no build_old_libs=yes # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: # mode:shell-script # sh-indentation:2 # End: # vi:sw=2 intel-gpu-tools-1.3/build-aux/config.guess0000755000175100017510000012743211757635640015603 00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, # 2011, 2012 Free Software Foundation, Inc. timestamp='2012-02-10' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Per Bothner. Please send patches (context # diff format) to and include a ChangeLog # entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 exit $exitcode ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm:riscos:*:*|arm:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) echo i386-pc-auroraux${UNAME_RELEASE} exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval $set_cc_for_build SUN_ARCH="i386" # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH="x86_64" fi fi echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` case ${UNAME_PROCESSOR} in amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:MSYS*:*) echo ${UNAME_MACHINE}-pc-msys exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; authenticamd | genuineintel | EM64T) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) echo ia64-unknown-interix${UNAME_RELEASE} exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; 8664:Windows_NT:*) echo x86_64-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; aarch64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo ${UNAME_MACHINE}-unknown-linux-gnu else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then echo ${UNAME_MACHINE}-unknown-linux-gnueabi else echo ${UNAME_MACHINE}-unknown-linux-gnueabihf fi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; cris:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-gnu exit ;; crisv32:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-gnu exit ;; frv:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; hexagon:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; i*86:Linux:*:*) LIBC=gnu eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __dietlibc__ LIBC=dietlibc #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` echo "${UNAME_MACHINE}-pc-linux-${LIBC}" exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=${UNAME_MACHINE} #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; padre:Linux:*:*) echo sparc-unknown-linux-gnu exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; tile*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; x86_64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configury will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux${UNAME_RELEASE} exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux${UNAME_RELEASE} exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in i386) eval $set_cc_for_build if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then UNAME_PROCESSOR="x86_64" fi fi ;; unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NEO-?:NONSTOP_KERNEL:*:*) echo neo-tandem-nsk${UNAME_RELEASE} exit ;; NSE-?:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros exit ;; x86_64:VMkernel:*:*) echo ${UNAME_MACHINE}-unknown-esx exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix\n"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; c34*) echo c34-convex-bsd exit ;; c38*) echo c38-convex-bsd exit ;; c4*) echo c4-convex-bsd exit ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: intel-gpu-tools-1.3/build-aux/install-sh0000755000175100017510000003325611757635640015267 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2011-01-19.21; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. nl=' ' IFS=" "" $nl" # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit=${DOITPROG-} if test -z "$doit"; then doit_exec=exec else doit_exec=$doit fi # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_glob='?' initialize_posix_glob=' test "$posix_glob" != "?" || { if (set -f) 2>/dev/null; then posix_glob= else posix_glob=: fi } ' posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false no_target_directory= usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *' '* | *' '* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) dst_arg=$2 # Protect names problematic for `test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) no_target_directory=true;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg # Protect names problematic for `test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call `install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names problematic for `test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else # Prefer dirname, but fall back on a substitute if dirname fails. dstdir=` (dirname "$dst") 2>/dev/null || expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$dst" : 'X\(//\)[^/]' \| \ X"$dst" : 'X\(//\)$' \| \ X"$dst" : 'X\(/\)' \| . 2>/dev/null || echo X"$dst" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q' ` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writeable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac eval "$initialize_posix_glob" oIFS=$IFS IFS=/ $posix_glob set -f set fnord $dstdir shift $posix_glob set +f IFS=$oIFS prefixes= for d do test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && eval "$initialize_posix_glob" && $posix_glob set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && $posix_glob set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: intel-gpu-tools-1.3/build-aux/missing0000755000175100017510000002415211757635640014655 00000000000000#! /bin/sh # Common stub for a few missing GNU programs while installing. scriptversion=2012-01-06.13; # UTC # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, # 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi run=: sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' sed_minuso='s/.* -o \([^ ]*\).*/\1/p' # In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac else configure_ac=configure.in fi msg="missing on your system" case $1 in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 # Exit code 63 means version mismatch. This often happens # when the user try to use an ancient version of a tool on # a file that requires a minimum version. In this case we # we should proceed has if the program had been absent, or # if --run hadn't been passed. if test $? = 63; then run=: msg="probably too old" fi ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit --run try to run the given command, and emulate it if it fails Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' autom4te touch the output file, or create a stub one automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file yacc create \`y.tab.[ch]', if possible, from existing .[ch] Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and \`g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; esac # normalize program name to check for. program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` # Now exit if we have it, but it failed. Also exit now if we # don't have it and --version was passed (most likely to detect # the program). This is about non-GNU programs, so use $1 not # $program. case $1 in lex*|yacc*) # Not GNU programs, they don't have --version. ;; *) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then # Could not run --version or --help. This is probably someone # running `$TOOL --version' or `$TOOL --help' to check whether # $TOOL exists and not knowing $TOOL uses missing. exit 1 fi ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case $program in aclocal*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acconfig.h' or \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" touch_files= for f in $files; do case $f in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; autom4te*) echo 1>&2 "\ WARNING: \`$1' is needed, but is $msg. You might have modified some files without having the proper tools for further handling them. You can get \`$1' as part of \`Autoconf' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo "#! /bin/sh" echo "# Created by GNU Automake missing as a replacement of" echo "# $ $@" echo "exit 0" chmod +x $file exit 1 fi ;; bison*|yacc*) echo 1>&2 "\ WARNING: \`$1' $msg. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if test $# -ne 1; then eval LASTARG=\${$#} case $LASTARG in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.h fi ;; esac fi if test ! -f y.tab.h; then echo >y.tab.h fi if test ! -f y.tab.c; then echo 'main() { return 0; }' >y.tab.c fi ;; lex*|flex*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if test $# -ne 1; then eval LASTARG=\${$#} case $LASTARG in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if test ! -f lex.yy.c; then echo 'main() { return 0; }' >lex.yy.c fi ;; help2man*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a dependency of a manual page. You may need the \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit $? fi ;; makeinfo*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." # The file to touch is that specified with -o ... file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -z "$file"; then # ... or it is the one specified with @setfilename ... infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n ' /^@setfilename/{ s/.* \([^ ]*\) *$/\1/ p q }' $infile` # ... or it is derived from the source name (dir/f.texi becomes f.info) test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info fi # If the file does not exist, the user really needs makeinfo; # let's fail without touching anything. test -f $file || exit 1 touch $file ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and is $msg. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequisites for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: intel-gpu-tools-1.3/build-aux/config.sub0000755000175100017510000010517611757635640015247 00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, # 2011, 2012 Free Software Foundation, Inc. timestamp='2012-02-10' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Please send patches to . Submit a context # diff and a properly formatted GNU ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; android-linux) os=-linux-android basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray | -microblaze) os= basic_machine=$1 ;; -bluegene*) os=-cnk ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | aarch64 | aarch64_be \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ | be32 | be64 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | epiphany \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ | nios | nios2 \ | ns16k | ns32k \ | open8 \ | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ | rl78 | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu \ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; c54x) basic_machine=tic54x-unknown ;; c55x) basic_machine=tic55x-unknown ;; c6x) basic_machine=tic6x-unknown ;; m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip) basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; strongarm | thumb | xscale) basic_machine=arm-unknown ;; xgate) basic_machine=$basic_machine-unknown os=-none ;; xscaleeb) basic_machine=armeb-unknown ;; xscaleel) basic_machine=armel-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hexagon-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pyramid-* \ | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aros) basic_machine=i386-pc os=-aros ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; bluegene*) basic_machine=powerpc-ibm os=-cnk ;; c54x-*) basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c55x-*) basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c6x-*) basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c90) basic_machine=c90-cray os=-unicos ;; cegcc) basic_machine=arm-unknown os=-cegcc ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16 | cr16-*) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dicos) basic_machine=i686-pc os=-dicos ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; microblaze) basic_machine=microblaze-xilinx ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; msys) basic_machine=i386-pc os=-msys ;; mvs) basic_machine=i370-ibm os=-mvs ;; nacl) basic_machine=le32-unknown os=-nacl ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; neo-tandem) basic_machine=neo-tandem ;; nse-tandem) basic_machine=nse-tandem ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc | ppcbe) basic_machine=powerpc-unknown ;; ppc-* | ppcbe-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; strongarm-* | thumb-*) basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tile*) basic_machine=$basic_machine-unknown os=-linux-gnu ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; xscale-* | xscalee[bl]-*) basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; z80-*-coff) basic_machine=z80-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -auroraux) os=-auroraux ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -kaos*) os=-kaos ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; -nacl*) ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; tic54x-*) os=-coff ;; tic55x-*) os=-coff ;; tic6x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -cnk*|-aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: intel-gpu-tools-1.3/lib/0000775000175100017510000000000012016622744012176 500000000000000intel-gpu-tools-1.3/lib/i830_reg.h0000664000175100017510000007030311566027747013625 00000000000000/************************************************************************** * * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sub license, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial portions * of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * **************************************************************************/ #ifndef _I830_REG_H_ #define _I830_REG_H_ #define I830_SET_FIELD( var, mask, value ) (var &= ~(mask), var |= value) /* Flush */ #define MI_FLUSH (0x04<<23) #define MI_FLUSH_DW (0x26<<23) #define MI_WRITE_DIRTY_STATE (1<<4) #define MI_END_SCENE (1<<3) #define MI_GLOBAL_SNAPSHOT_COUNT_RESET (1<<3) #define MI_INHIBIT_RENDER_CACHE_FLUSH (1<<2) #define MI_STATE_INSTRUCTION_CACHE_FLUSH (1<<1) #define MI_INVALIDATE_MAP_CACHE (1<<0) /* broadwater flush bits */ #define BRW_MI_GLOBAL_SNAPSHOT_RESET (1 << 3) #define MI_BATCH_BUFFER_END (0xA << 23) /* Noop */ #define MI_NOOP 0x00 #define MI_NOOP_WRITE_ID (1<<22) #define MI_NOOP_ID_MASK (1<<22 - 1) /* Wait for Events */ #define MI_WAIT_FOR_EVENT (0x03<<23) #define MI_WAIT_FOR_PIPEB_SVBLANK (1<<18) #define MI_WAIT_FOR_PIPEA_SVBLANK (1<<17) #define MI_WAIT_FOR_OVERLAY_FLIP (1<<16) #define MI_WAIT_FOR_PIPEB_VBLANK (1<<7) #define MI_WAIT_FOR_PIPEB_SCAN_LINE_WINDOW (1<<5) #define MI_WAIT_FOR_PIPEA_VBLANK (1<<3) #define MI_WAIT_FOR_PIPEA_SCAN_LINE_WINDOW (1<<1) /* Set the scan line for MI_WAIT_FOR_PIPE?_SCAN_LINE_WINDOW */ #define MI_LOAD_SCAN_LINES_INCL (0x12<<23) #define MI_LOAD_SCAN_LINES_DISPLAY_PIPEA (0) #define MI_LOAD_SCAN_LINES_DISPLAY_PIPEB (0x1<<20) /* BLT commands */ #define COLOR_BLT_CMD ((2<<29)|(0x40<<22)|(0x3)) #define COLOR_BLT_WRITE_ALPHA (1<<21) #define COLOR_BLT_WRITE_RGB (1<<20) #define XY_COLOR_BLT_CMD ((2<<29)|(0x50<<22)|(0x4)) #define XY_COLOR_BLT_WRITE_ALPHA (1<<21) #define XY_COLOR_BLT_WRITE_RGB (1<<20) #define XY_COLOR_BLT_TILED (1<<11) #define XY_SETUP_CLIP_BLT_CMD ((2<<29)|(3<<22)|1) #define XY_SRC_COPY_BLT_CMD ((2<<29)|(0x53<<22)|6) #define XY_SRC_COPY_BLT_WRITE_ALPHA (1<<21) #define XY_SRC_COPY_BLT_WRITE_RGB (1<<20) #define XY_SRC_COPY_BLT_SRC_TILED (1<<15) #define XY_SRC_COPY_BLT_DST_TILED (1<<11) #define SRC_COPY_BLT_CMD ((2<<29)|(0x43<<22)|0x4) #define SRC_COPY_BLT_WRITE_ALPHA (1<<21) #define SRC_COPY_BLT_WRITE_RGB (1<<20) #define XY_PAT_BLT_IMMEDIATE ((2<<29)|(0x72<<22)) #define XY_MONO_PAT_BLT_CMD ((0x2<<29)|(0x52<<22)|0x7) #define XY_MONO_PAT_VERT_SEED ((1<<10)|(1<<9)|(1<<8)) #define XY_MONO_PAT_HORT_SEED ((1<<14)|(1<<13)|(1<<12)) #define XY_MONO_PAT_BLT_WRITE_ALPHA (1<<21) #define XY_MONO_PAT_BLT_WRITE_RGB (1<<20) #define XY_MONO_SRC_BLT_CMD ((0x2<<29)|(0x54<<22)|(0x6)) #define XY_MONO_SRC_BLT_WRITE_ALPHA (1<<21) #define XY_MONO_SRC_BLT_WRITE_RGB (1<<20) #define CMD_3D (0x3<<29) #define PRIM3D_INLINE (CMD_3D | (0x1f<<24)) #define PRIM3D_TRILIST (0x0<<18) #define PRIM3D_TRISTRIP (0x1<<18) #define PRIM3D_TRISTRIP_RVRSE (0x2<<18) #define PRIM3D_TRIFAN (0x3<<18) #define PRIM3D_POLY (0x4<<18) #define PRIM3D_LINELIST (0x5<<18) #define PRIM3D_LINESTRIP (0x6<<18) #define PRIM3D_RECTLIST (0x7<<18) #define PRIM3D_POINTLIST (0x8<<18) #define PRIM3D_DIB (0x9<<18) #define PRIM3D_CLEAR_RECT (0xa<<18) #define PRIM3D_ZONE_INIT (0xd<<18) #define PRIM3D_MASK (0x1f<<18) #define _3DSTATE_AA_CMD (CMD_3D | (0x06<<24)) #define AA_LINE_ECAAR_WIDTH_ENABLE (1<<16) #define AA_LINE_ECAAR_WIDTH_0_5 0 #define AA_LINE_ECAAR_WIDTH_1_0 (1<<14) #define AA_LINE_ECAAR_WIDTH_2_0 (2<<14) #define AA_LINE_ECAAR_WIDTH_4_0 (3<<14) #define AA_LINE_REGION_WIDTH_ENABLE (1<<8) #define AA_LINE_REGION_WIDTH_0_5 0 #define AA_LINE_REGION_WIDTH_1_0 (1<<6) #define AA_LINE_REGION_WIDTH_2_0 (2<<6) #define AA_LINE_REGION_WIDTH_4_0 (3<<6) #define AA_LINE_ENABLE ((1<<1) | 1) #define AA_LINE_DISABLE (1<<1) #define _3DSTATE_BUF_INFO_CMD (CMD_3D | (0x1d<<24) | (0x8e<<16) | 1) /* Dword 1 */ #define BUF_3D_ID_COLOR_BACK (0x3<<24) #define BUF_3D_ID_DEPTH (0x7<<24) #define BUF_3D_USE_FENCE (1<<23) #define BUF_3D_TILED_SURFACE (1<<22) #define BUF_3D_TILE_WALK_X 0 #define BUF_3D_TILE_WALK_Y (1<<21) #define BUF_3D_PITCH(x) (((x)/4)<<2) /* Dword 2 */ #define BUF_3D_ADDR(x) ((x) & ~0x3) #define _3DSTATE_COLOR_FACTOR_CMD (CMD_3D | (0x1d<<24) | (0x1<<16)) #define _3DSTATE_COLOR_FACTOR_N_CMD(stage) (CMD_3D | (0x1d<<24) | \ ((0x90+(stage))<<16)) #define _3DSTATE_CONST_BLEND_COLOR_CMD (CMD_3D | (0x1d<<24) | (0x88<<16)) #define _3DSTATE_DFLT_DIFFUSE_CMD (CMD_3D | (0x1d<<24) | (0x99<<16)) #define _3DSTATE_DFLT_SPEC_CMD (CMD_3D | (0x1d<<24) | (0x9a<<16)) #define _3DSTATE_DFLT_Z_CMD (CMD_3D | (0x1d<<24) | (0x98<<16)) #define _3DSTATE_DST_BUF_VARS_CMD (CMD_3D | (0x1d<<24) | (0x85<<16)) /* Dword 1 */ #define DSTORG_HORT_BIAS(x) ((x)<<20) #define DSTORG_VERT_BIAS(x) ((x)<<16) #define COLOR_4_2_2_CHNL_WRT_ALL 0 #define COLOR_4_2_2_CHNL_WRT_Y (1<<12) #define COLOR_4_2_2_CHNL_WRT_CR (2<<12) #define COLOR_4_2_2_CHNL_WRT_CB (3<<12) #define COLOR_4_2_2_CHNL_WRT_CRCB (4<<12) #define COLR_BUF_8BIT 0 #define COLR_BUF_RGB555 (1<<8) #define COLR_BUF_RGB565 (2<<8) #define COLR_BUF_ARGB8888 (3<<8) #define COLR_BUF_ARGB4444 (8<<8) #define COLR_BUF_ARGB1555 (9<<8) #define DEPTH_IS_Z 0 #define DEPTH_IS_W (1<<6) #define DEPTH_FRMT_16_FIXED 0 #define DEPTH_FRMT_16_FLOAT (1<<2) #define DEPTH_FRMT_24_FIXED_8_OTHER (2<<2) #define DEPTH_FRMT_24_FLOAT_8_OTHER (3<<2) #define VERT_LINE_STRIDE_1 (1<<1) #define VERT_LINE_STRIDE_0 0 #define VERT_LINE_STRIDE_OFS_1 1 #define VERT_LINE_STRIDE_OFS_0 0 #define _3DSTATE_DRAW_RECT_CMD (CMD_3D|(0x1d<<24)|(0x80<<16)|3) /* Dword 1 */ #define DRAW_RECT_DIS_DEPTH_OFS (1<<30) #define DRAW_DITHER_OFS_X(x) ((x)<<26) #define DRAW_DITHER_OFS_Y(x) ((x)<<24) /* Dword 2 */ #define DRAW_YMIN(x) ((x)<<16) #define DRAW_XMIN(x) (x) /* Dword 3 */ #define DRAW_YMAX(x) ((x)<<16) #define DRAW_XMAX(x) (x) /* Dword 4 */ #define DRAW_YORG(x) ((x)<<16) #define DRAW_XORG(x) (x) #define _3DSTATE_ENABLES_1_CMD (CMD_3D|(0x3<<24)) #define ENABLE_LOGIC_OP_MASK ((1<<23)|(1<<22)) #define ENABLE_LOGIC_OP ((1<<23)|(1<<22)) #define DISABLE_LOGIC_OP (1<<23) #define ENABLE_STENCIL_TEST ((1<<21)|(1<<20)) #define DISABLE_STENCIL_TEST (1<<21) #define ENABLE_DEPTH_BIAS ((1<<11)|(1<<10)) #define DISABLE_DEPTH_BIAS (1<<11) #define ENABLE_SPEC_ADD_MASK ((1<<9)|(1<<8)) #define ENABLE_SPEC_ADD ((1<<9)|(1<<8)) #define DISABLE_SPEC_ADD (1<<9) #define ENABLE_DIS_FOG_MASK ((1<<7)|(1<<6)) #define ENABLE_FOG ((1<<7)|(1<<6)) #define DISABLE_FOG (1<<7) #define ENABLE_DIS_ALPHA_TEST_MASK ((1<<5)|(1<<4)) #define ENABLE_ALPHA_TEST ((1<<5)|(1<<4)) #define DISABLE_ALPHA_TEST (1<<5) #define ENABLE_DIS_CBLEND_MASK ((1<<3)|(1<<2)) #define ENABLE_COLOR_BLEND ((1<<3)|(1<<2)) #define DISABLE_COLOR_BLEND (1<<3) #define ENABLE_DIS_DEPTH_TEST_MASK ((1<<1)|1) #define ENABLE_DEPTH_TEST ((1<<1)|1) #define DISABLE_DEPTH_TEST (1<<1) /* _3DSTATE_ENABLES_2, p138 */ #define _3DSTATE_ENABLES_2_CMD (CMD_3D|(0x4<<24)) #define ENABLE_STENCIL_WRITE ((1<<21)|(1<<20)) #define DISABLE_STENCIL_WRITE (1<<21) #define ENABLE_TEX_CACHE ((1<<17)|(1<<16)) #define DISABLE_TEX_CACHE (1<<17) #define ENABLE_DITHER ((1<<9)|(1<<8)) #define DISABLE_DITHER (1<<9) #define ENABLE_COLOR_MASK (1<<10) #define WRITEMASK_ALPHA (1<<7) #define WRITEMASK_ALPHA_SHIFT 7 #define WRITEMASK_RED (1<<6) #define WRITEMASK_RED_SHIFT 6 #define WRITEMASK_GREEN (1<<5) #define WRITEMASK_GREEN_SHIFT 5 #define WRITEMASK_BLUE (1<<4) #define WRITEMASK_BLUE_SHIFT 4 #define WRITEMASK_MASK ((1<<4)|(1<<5)|(1<<6)|(1<<7)) #define ENABLE_COLOR_WRITE ((1<<3)|(1<<2)) #define DISABLE_COLOR_WRITE (1<<3) #define ENABLE_DIS_DEPTH_WRITE_MASK 0x3 #define ENABLE_DEPTH_WRITE ((1<<1)|1) #define DISABLE_DEPTH_WRITE (1<<1) /* _3DSTATE_FOG_COLOR, p139 */ #define _3DSTATE_FOG_COLOR_CMD (CMD_3D|(0x15<<24)) #define FOG_COLOR_RED(x) ((x)<<16) #define FOG_COLOR_GREEN(x) ((x)<<8) #define FOG_COLOR_BLUE(x) (x) /* _3DSTATE_FOG_MODE, p140 */ #define _3DSTATE_FOG_MODE_CMD (CMD_3D|(0x1d<<24)|(0x89<<16)|2) /* Dword 1 */ #define FOGFUNC_ENABLE (1<<31) #define FOGFUNC_VERTEX 0 #define FOGFUNC_PIXEL_EXP (1<<28) #define FOGFUNC_PIXEL_EXP2 (2<<28) #define FOGFUNC_PIXEL_LINEAR (3<<28) #define FOGSRC_INDEX_Z (1<<27) #define FOGSRC_INDEX_W ((1<<27)|(1<<25)) #define FOG_LINEAR_CONST (1<<24) #define FOG_CONST_1(x) ((x)<<4) #define ENABLE_FOG_DENSITY (1<<23) /* Dword 2 */ #define FOG_CONST_2(x) (x) /* Dword 3 */ #define FOG_DENSITY(x) (x) /* _3DSTATE_INDEPENDENT_ALPHA_BLEND, p142 */ #define _3DSTATE_INDPT_ALPHA_BLEND_CMD (CMD_3D|(0x0b<<24)) #define ENABLE_INDPT_ALPHA_BLEND ((1<<23)|(1<<22)) #define DISABLE_INDPT_ALPHA_BLEND (1<<23) #define ALPHA_BLENDFUNC_MASK 0x3f0000 #define ENABLE_ALPHA_BLENDFUNC (1<<21) #define ABLENDFUNC_ADD 0 #define ABLENDFUNC_SUB (1<<16) #define ABLENDFUNC_RVSE_SUB (2<<16) #define ABLENDFUNC_MIN (3<<16) #define ABLENDFUNC_MAX (4<<16) #define SRC_DST_ABLEND_MASK 0xfff #define ENABLE_SRC_ABLEND_FACTOR (1<<11) #define SRC_ABLEND_FACT(x) ((x)<<6) #define ENABLE_DST_ABLEND_FACTOR (1<<5) #define DST_ABLEND_FACT(x) (x) #define BLENDFACTOR_ZERO 0x01 #define BLENDFACTOR_ONE 0x02 #define BLENDFACTOR_SRC_COLR 0x03 #define BLENDFACTOR_INV_SRC_COLR 0x04 #define BLENDFACTOR_SRC_ALPHA 0x05 #define BLENDFACTOR_INV_SRC_ALPHA 0x06 #define BLENDFACTOR_DST_ALPHA 0x07 #define BLENDFACTOR_INV_DST_ALPHA 0x08 #define BLENDFACTOR_DST_COLR 0x09 #define BLENDFACTOR_INV_DST_COLR 0x0a #define BLENDFACTOR_SRC_ALPHA_SATURATE 0x0b #define BLENDFACTOR_CONST_COLOR 0x0c #define BLENDFACTOR_INV_CONST_COLOR 0x0d #define BLENDFACTOR_CONST_ALPHA 0x0e #define BLENDFACTOR_INV_CONST_ALPHA 0x0f #define BLENDFACTOR_MASK 0x0f /* _3DSTATE_MAP_BLEND_ARG, p152 */ #define _3DSTATE_MAP_BLEND_ARG_CMD(stage) (CMD_3D|(0x0e<<24)|((stage)<<20)) #define TEXPIPE_COLOR 0 #define TEXPIPE_ALPHA (1<<18) #define TEXPIPE_KILL (2<<18) #define TEXBLEND_ARG0 0 #define TEXBLEND_ARG1 (1<<15) #define TEXBLEND_ARG2 (2<<15) #define TEXBLEND_ARG3 (3<<15) #define TEXBLENDARG_MODIFY_PARMS (1<<6) #define TEXBLENDARG_REPLICATE_ALPHA (1<<5) #define TEXBLENDARG_INV_ARG (1<<4) #define TEXBLENDARG_ONE 0 #define TEXBLENDARG_FACTOR 0x01 #define TEXBLENDARG_ACCUM 0x02 #define TEXBLENDARG_DIFFUSE 0x03 #define TEXBLENDARG_SPEC 0x04 #define TEXBLENDARG_CURRENT 0x05 #define TEXBLENDARG_TEXEL0 0x06 #define TEXBLENDARG_TEXEL1 0x07 #define TEXBLENDARG_TEXEL2 0x08 #define TEXBLENDARG_TEXEL3 0x09 #define TEXBLENDARG_FACTOR_N 0x0e /* _3DSTATE_MAP_BLEND_OP, p155 */ #define _3DSTATE_MAP_BLEND_OP_CMD(stage) (CMD_3D|(0x0d<<24)|((stage)<<20)) #if 0 # define TEXPIPE_COLOR 0 # define TEXPIPE_ALPHA (1<<18) # define TEXPIPE_KILL (2<<18) #endif #define ENABLE_TEXOUTPUT_WRT_SEL (1<<17) #define TEXOP_OUTPUT_CURRENT 0 #define TEXOP_OUTPUT_ACCUM (1<<15) #define ENABLE_TEX_CNTRL_STAGE ((1<<12)|(1<<11)) #define DISABLE_TEX_CNTRL_STAGE (1<<12) #define TEXOP_SCALE_SHIFT 9 #define TEXOP_SCALE_1X (0 << TEXOP_SCALE_SHIFT) #define TEXOP_SCALE_2X (1 << TEXOP_SCALE_SHIFT) #define TEXOP_SCALE_4X (2 << TEXOP_SCALE_SHIFT) #define TEXOP_MODIFY_PARMS (1<<8) #define TEXOP_LAST_STAGE (1<<7) #define TEXBLENDOP_KILLPIXEL 0x02 #define TEXBLENDOP_ARG1 0x01 #define TEXBLENDOP_ARG2 0x02 #define TEXBLENDOP_MODULATE 0x03 #define TEXBLENDOP_ADD 0x06 #define TEXBLENDOP_ADDSIGNED 0x07 #define TEXBLENDOP_BLEND 0x08 #define TEXBLENDOP_BLEND_AND_ADD 0x09 #define TEXBLENDOP_SUBTRACT 0x0a #define TEXBLENDOP_DOT3 0x0b #define TEXBLENDOP_DOT4 0x0c #define TEXBLENDOP_MODULATE_AND_ADD 0x0d #define TEXBLENDOP_MODULATE_2X_AND_ADD 0x0e #define TEXBLENDOP_MODULATE_4X_AND_ADD 0x0f /* _3DSTATE_MAP_BUMP_TABLE, p160 TODO */ /* _3DSTATE_MAP_COLOR_CHROMA_KEY, p161 TODO */ #define _3DSTATE_MAP_COORD_TRANSFORM ((3<<29)|(0x1d<<24)|(0x8c<<16)) #define DISABLE_TEX_TRANSFORM (1<<28) #define TEXTURE_SET(x) (x<<29) #define _3DSTATE_VERTEX_TRANSFORM ((3<<29)|(0x1d<<24)|(0x8b<<16)) #define DISABLE_VIEWPORT_TRANSFORM (1<<31) #define DISABLE_PERSPECTIVE_DIVIDE (1<<29) /* _3DSTATE_MAP_COORD_SET_BINDINGS, p162 */ #define _3DSTATE_MAP_COORD_SETBIND_CMD (CMD_3D|(0x1d<<24)|(0x02<<16)) #define TEXBIND_MASK3 ((1<<15)|(1<<14)|(1<<13)|(1<<12)) #define TEXBIND_MASK2 ((1<<11)|(1<<10)|(1<<9)|(1<<8)) #define TEXBIND_MASK1 ((1<<7)|(1<<6)|(1<<5)|(1<<4)) #define TEXBIND_MASK0 ((1<<3)|(1<<2)|(1<<1)|1) #define TEXBIND_SET3(x) ((x)<<12) #define TEXBIND_SET2(x) ((x)<<8) #define TEXBIND_SET1(x) ((x)<<4) #define TEXBIND_SET0(x) (x) #define TEXCOORDSRC_KEEP 0 #define TEXCOORDSRC_DEFAULT 0x01 #define TEXCOORDSRC_VTXSET_0 0x08 #define TEXCOORDSRC_VTXSET_1 0x09 #define TEXCOORDSRC_VTXSET_2 0x0a #define TEXCOORDSRC_VTXSET_3 0x0b #define TEXCOORDSRC_VTXSET_4 0x0c #define TEXCOORDSRC_VTXSET_5 0x0d #define TEXCOORDSRC_VTXSET_6 0x0e #define TEXCOORDSRC_VTXSET_7 0x0f #define MAP_UNIT(unit) ((unit)<<16) #define MAP_UNIT_MASK (0x7<<16) /* _3DSTATE_MAP_COORD_SETS, p164 */ #define _3DSTATE_MAP_COORD_SET_CMD (CMD_3D|(0x1c<<24)|(0x01<<19)) #define TEXCOORD_SET(n) ((n)<<16) #define ENABLE_TEXCOORD_PARAMS (1<<15) #define TEXCOORDS_ARE_NORMAL (1<<14) #define TEXCOORDS_ARE_IN_TEXELUNITS 0 #define TEXCOORDTYPE_CARTESIAN 0 #define TEXCOORDTYPE_HOMOGENEOUS (1<<11) #define TEXCOORDTYPE_VECTOR (2<<11) #define TEXCOORDTYPE_MASK (0x7<<11) #define ENABLE_ADDR_V_CNTL (1<<7) #define ENABLE_ADDR_U_CNTL (1<<3) #define TEXCOORD_ADDR_V_MODE(x) ((x)<<4) #define TEXCOORD_ADDR_U_MODE(x) (x) #define TEXCOORDMODE_WRAP 0 #define TEXCOORDMODE_MIRROR 1 #define TEXCOORDMODE_CLAMP 2 #define TEXCOORDMODE_WRAP_SHORTEST 3 #define TEXCOORDMODE_CLAMP_BORDER 4 #define TEXCOORD_ADDR_V_MASK 0x70 #define TEXCOORD_ADDR_U_MASK 0x7 /* _3DSTATE_MAP_CUBE, p168 TODO */ #define _3DSTATE_MAP_CUBE (CMD_3D|(0x1c<<24)|(0x0a<<19)) #define CUBE_NEGX_ENABLE (1<<5) #define CUBE_POSX_ENABLE (1<<4) #define CUBE_NEGY_ENABLE (1<<3) #define CUBE_POSY_ENABLE (1<<2) #define CUBE_NEGZ_ENABLE (1<<1) #define CUBE_POSZ_ENABLE (1<<0) #define _3DSTATE_MAP_INFO_CMD (CMD_3D|(0x1d<<24)|(0x0<<16)|3) #define TEXMAP_INDEX(x) ((x)<<28) #define MAP_SURFACE_8BIT (1<<24) #define MAP_SURFACE_16BIT (2<<24) #define MAP_SURFACE_32BIT (3<<24) #define MAP_FORMAT_2D (0) #define MAP_FORMAT_3D_CUBE (1<<11) /* _3DSTATE_MODES_1, p190 */ #define _3DSTATE_MODES_1_CMD (CMD_3D|(0x08<<24)) #define BLENDFUNC_MASK 0x3f0000 #define ENABLE_COLR_BLND_FUNC (1<<21) #define BLENDFUNC_ADD 0 #define BLENDFUNC_SUB (1<<16) #define BLENDFUNC_RVRSE_SUB (2<<16) #define BLENDFUNC_MIN (3<<16) #define BLENDFUNC_MAX (4<<16) #define SRC_DST_BLND_MASK 0xfff #define ENABLE_SRC_BLND_FACTOR (1<<11) #define ENABLE_DST_BLND_FACTOR (1<<5) #define SRC_BLND_FACT(x) ((x)<<6) #define DST_BLND_FACT(x) (x) /* _3DSTATE_MODES_2, p192 */ #define _3DSTATE_MODES_2_CMD (CMD_3D|(0x0f<<24)) #define ENABLE_GLOBAL_DEPTH_BIAS (1<<22) #define GLOBAL_DEPTH_BIAS(x) ((x)<<14) #define ENABLE_ALPHA_TEST_FUNC (1<<13) #define ENABLE_ALPHA_REF_VALUE (1<<8) #define ALPHA_TEST_FUNC(x) ((x)<<9) #define ALPHA_REF_VALUE(x) (x) #define ALPHA_TEST_REF_MASK 0x3fff /* _3DSTATE_MODES_3, p193 */ #define _3DSTATE_MODES_3_CMD (CMD_3D|(0x02<<24)) #define DEPTH_TEST_FUNC_MASK 0x1f0000 #define ENABLE_DEPTH_TEST_FUNC (1<<20) /* Uses COMPAREFUNC */ #define DEPTH_TEST_FUNC(x) ((x)<<16) #define ENABLE_ALPHA_SHADE_MODE (1<<11) #define ENABLE_FOG_SHADE_MODE (1<<9) #define ENABLE_SPEC_SHADE_MODE (1<<7) #define ENABLE_COLOR_SHADE_MODE (1<<5) #define ALPHA_SHADE_MODE(x) ((x)<<10) #define FOG_SHADE_MODE(x) ((x)<<8) #define SPEC_SHADE_MODE(x) ((x)<<6) #define COLOR_SHADE_MODE(x) ((x)<<4) #define CULLMODE_MASK 0xf #define ENABLE_CULL_MODE (1<<3) #define CULLMODE_BOTH 0 #define CULLMODE_NONE 1 #define CULLMODE_CW 2 #define CULLMODE_CCW 3 #define SHADE_MODE_LINEAR 0 #define SHADE_MODE_FLAT 0x1 /* _3DSTATE_MODES_4, p195 */ #define _3DSTATE_MODES_4_CMD (CMD_3D|(0x16<<24)) #define ENABLE_LOGIC_OP_FUNC (1<<23) #define LOGIC_OP_FUNC(x) ((x)<<18) #define LOGICOP_MASK ((1<<18)|(1<<19)|(1<<20)|(1<<21)) #define LOGICOP_CLEAR 0 #define LOGICOP_NOR 0x1 #define LOGICOP_AND_INV 0x2 #define LOGICOP_COPY_INV 0x3 #define LOGICOP_AND_RVRSE 0x4 #define LOGICOP_INV 0x5 #define LOGICOP_XOR 0x6 #define LOGICOP_NAND 0x7 #define LOGICOP_AND 0x8 #define LOGICOP_EQUIV 0x9 #define LOGICOP_NOOP 0xa #define LOGICOP_OR_INV 0xb #define LOGICOP_COPY 0xc #define LOGICOP_OR_RVRSE 0xd #define LOGICOP_OR 0xe #define LOGICOP_SET 0xf #define MODE4_ENABLE_STENCIL_TEST_MASK ((1<<17)|(0xff00)) #define ENABLE_STENCIL_TEST_MASK (1<<17) #define STENCIL_TEST_MASK(x) ((x)<<8) #define MODE4_ENABLE_STENCIL_WRITE_MASK ((1<<16)|(0x00ff)) #define ENABLE_STENCIL_WRITE_MASK (1<<16) #define STENCIL_WRITE_MASK(x) ((x)&0xff) /* _3DSTATE_MODES_5, p196 */ #define _3DSTATE_MODES_5_CMD (CMD_3D|(0x0c<<24)) #define ENABLE_SPRITE_POINT_TEX (1<<23) #define SPRITE_POINT_TEX_ON (1<<22) #define SPRITE_POINT_TEX_OFF 0 #define FLUSH_RENDER_CACHE (1<<18) #define FLUSH_TEXTURE_CACHE (1<<16) #define FIXED_LINE_WIDTH_MASK 0xfc00 #define ENABLE_FIXED_LINE_WIDTH (1<<15) #define FIXED_LINE_WIDTH(x) ((x)<<10) #define FIXED_POINT_WIDTH_MASK 0x3ff #define ENABLE_FIXED_POINT_WIDTH (1<<9) #define FIXED_POINT_WIDTH(x) (x) /* _3DSTATE_RASTERIZATION_RULES, p198 */ #define _3DSTATE_RASTER_RULES_CMD (CMD_3D|(0x07<<24)) #define ENABLE_POINT_RASTER_RULE (1<<15) #define OGL_POINT_RASTER_RULE (1<<13) #define ENABLE_LINE_STRIP_PROVOKE_VRTX (1<<8) #define ENABLE_TRI_FAN_PROVOKE_VRTX (1<<5) #define ENABLE_TRI_STRIP_PROVOKE_VRTX (1<<2) #define LINE_STRIP_PROVOKE_VRTX(x) ((x)<<6) #define TRI_FAN_PROVOKE_VRTX(x) ((x)<<3) #define TRI_STRIP_PROVOKE_VRTX(x) (x) /* _3DSTATE_SCISSOR_ENABLE, p200 */ #define _3DSTATE_SCISSOR_ENABLE_CMD (CMD_3D|(0x1c<<24)|(0x10<<19)) #define ENABLE_SCISSOR_RECT ((1<<1) | 1) #define DISABLE_SCISSOR_RECT (1<<1) /* _3DSTATE_SCISSOR_RECTANGLE_0, p201 */ #define _3DSTATE_SCISSOR_RECT_0_CMD (CMD_3D|(0x1d<<24)|(0x81<<16)|1) /* Dword 1 */ #define SCISSOR_RECT_0_YMIN(x) ((x)<<16) #define SCISSOR_RECT_0_XMIN(x) (x) /* Dword 2 */ #define SCISSOR_RECT_0_YMAX(x) ((x)<<16) #define SCISSOR_RECT_0_XMAX(x) (x) /* _3DSTATE_STENCIL_TEST, p202 */ #define _3DSTATE_STENCIL_TEST_CMD (CMD_3D|(0x09<<24)) #define ENABLE_STENCIL_PARMS (1<<23) #define STENCIL_OPS_MASK (0xffc000) #define STENCIL_FAIL_OP(x) ((x)<<20) #define STENCIL_PASS_DEPTH_FAIL_OP(x) ((x)<<17) #define STENCIL_PASS_DEPTH_PASS_OP(x) ((x)<<14) #define ENABLE_STENCIL_TEST_FUNC_MASK ((1<<13)|(1<<12)|(1<<11)|(1<<10)|(1<<9)) #define ENABLE_STENCIL_TEST_FUNC (1<<13) /* Uses COMPAREFUNC */ #define STENCIL_TEST_FUNC(x) ((x)<<9) #define STENCIL_REF_VALUE_MASK ((1<<8)|0xff) #define ENABLE_STENCIL_REF_VALUE (1<<8) #define STENCIL_REF_VALUE(x) (x) /* _3DSTATE_VERTEX_FORMAT, p204 */ #define _3DSTATE_VFT0_CMD (CMD_3D|(0x05<<24)) #define VFT0_POINT_WIDTH (1<<12) #define VFT0_TEX_COUNT_MASK (7<<8) #define VFT0_TEX_COUNT_SHIFT 8 #define VFT0_TEX_COUNT(x) ((x)<<8) #define VFT0_SPEC (1<<7) #define VFT0_DIFFUSE (1<<6) #define VFT0_DEPTH_OFFSET (1<<5) #define VFT0_XYZ (1<<1) #define VFT0_XYZW (2<<1) #define VFT0_XY (3<<1) #define VFT0_XYW (4<<1) #define VFT0_XYZW_MASK (7<<1) /* _3DSTATE_VERTEX_FORMAT_2, p206 */ #define _3DSTATE_VERTEX_FORMAT_2_CMD (CMD_3D|(0x0a<<24)) #define VFT1_TEX7_FMT(x) ((x)<<14) #define VFT1_TEX6_FMT(x) ((x)<<12) #define VFT1_TEX5_FMT(x) ((x)<<10) #define VFT1_TEX4_FMT(x) ((x)<<8) #define VFT1_TEX3_FMT(x) ((x)<<6) #define VFT1_TEX2_FMT(x) ((x)<<4) #define VFT1_TEX1_FMT(x) ((x)<<2) #define VFT1_TEX0_FMT(x) (x) #define VFT1_TEX0_MASK 3 #define VFT1_TEX1_SHIFT 2 #define TEXCOORDFMT_2D 0 #define TEXCOORDFMT_3D 1 #define TEXCOORDFMT_4D 2 #define TEXCOORDFMT_1D 3 /*New stuff picked up along the way */ #define MLC_LOD_BIAS_MASK ((1<<7)-1) /* _3DSTATE_VERTEX_TRANSFORM, p207 */ #define _3DSTATE_VERTEX_TRANS_CMD (CMD_3D|(0x1d<<24)|(0x8b<<16)|0) #define _3DSTATE_VERTEX_TRANS_MTX_CMD (CMD_3D|(0x1d<<24)|(0x8b<<16)|6) /* Dword 1 */ #define ENABLE_VIEWPORT_TRANSFORM ((1<<31)|(1<<30)) #define DISABLE_VIEWPORT_TRANSFORM (1<<31) #define ENABLE_PERSP_DIVIDE ((1<<29)|(1<<28)) #define DISABLE_PERSP_DIVIDE (1<<29) #define VRTX_TRANS_LOAD_MATRICES 0x7421 #define VRTX_TRANS_NO_LOAD_MATRICES 0x0000 /* Dword 2 -> 7 are matrix elements */ /* _3DSTATE_W_STATE, p209 */ #define _3DSTATE_W_STATE_CMD (CMD_3D|(0x1d<<24)|(0x8d<<16)|1) /* Dword 1 */ #define MAGIC_W_STATE_DWORD1 0x00000008 /* Dword 2 */ #define WFAR_VALUE(x) (x) /* Stipple command, carried over from the i810, apparently: */ #define _3DSTATE_STIPPLE (CMD_3D|(0x1d<<24)|(0x83<<16)) #define ST1_ENABLE (1<<16) #define ST1_MASK (0xffff) #define _3DSTATE_LOAD_STATE_IMMEDIATE_1 (CMD_3D|(0x1d<<24)|(0x04<<16)) #define I1_LOAD_S(n) (1<<((n)+4)) #define S3_POINT_WIDTH_SHIFT 23 #define S3_LINE_WIDTH_SHIFT 19 #define S3_ALPHA_SHADE_MODE_SHIFT 18 #define S3_FOG_SHADE_MODE_SHIFT 17 #define S3_SPEC_SHADE_MODE_SHIFT 16 #define S3_COLOR_SHADE_MODE_SHIFT 15 #define S3_CULL_MODE_SHIFT 13 #define S3_CULLMODE_BOTH (0) #define S3_CULLMODE_NONE (1<<13) #define S3_CULLMODE_CW (2<<13) #define S3_CULLMODE_CCW (3<<13) #define S3_POINT_WIDTH_PRESENT (1<<12) #define S3_SPEC_FOG_PRESENT (1<<11) #define S3_DIFFUSE_PRESENT (1<<10) #define S3_DEPTH_OFFSET_PRESENT (1<<9) #define S3_POSITION_SHIFT 6 #define S3_VERTEXHAS_XYZ (1<<6) #define S3_VERTEXHAS_XYZW (2<<6) #define S3_VERTEXHAS_XY (3<<6) #define S3_VERTEXHAS_XYW (4<<6) #define S3_ENABLE_SPEC_ADD (1<<5) #define S3_ENABLE_FOG (1<<4) #define S3_ENABLE_LOCAL_DEPTH_BIAS (1<<3) #define S3_ENABLE_SPRITE_POINT (1<<1) #define S3_ENABLE_ANTIALIASING 1 #define S8_ENABLE_ALPHA_TEST (1<<31) #define S8_ALPHA_TEST_FUNC_SHIFT 28 #define S8_ALPHA_REFVALUE_SHIFT 20 #define S8_ENABLE_DEPTH_TEST (1<<19) #define S8_DEPTH_TEST_FUNC_SHIFT 16 #define S8_ENABLE_COLOR_BLEND (1<<15) #define S8_COLOR_BLEND_FUNC_SHIFT 12 #define S8_BLENDFUNC_ADD (0) #define S8_BLENDFUNC_SUB (1<<12) #define S8_BLENDFUNC_RVRSE_SUB (2<<12) #define S8_BLENDFUNC_MIN (3<<12) #define S8_BLENDFUNC_MAX (4<<12) #define S8_SRC_BLEND_FACTOR_SHIFT 8 #define S8_DST_BLEND_FACTOR_SHIFT 4 #define S8_ENABLE_DEPTH_BUFFER_WRITE (1<<3) #define S8_ENABLE_COLOR_BUFFER_WRITE (1<<2) #define _3DSTATE_LOAD_STATE_IMMEDIATE_2 (CMD_3D|(0x1d<<24)|(0x03<<16)) #define LOAD_TEXTURE_MAP(x) (1<<((x)+11)) #define LOAD_TEXTURE_BLEND_STAGE(x) (1<<((x)+7)) #define LOAD_GLOBAL_COLOR_FACTOR (1<<6) #define TM0S0_ADDRESS_MASK 0xfffffffc #define TM0S0_USE_FENCE (1<<1) #define TM0S1_HEIGHT_SHIFT 21 #define TM0S1_WIDTH_SHIFT 10 #define TM0S1_PALETTE_SELECT (1<<9) #define TM0S1_MAPSURF_FORMAT_MASK (0x7 << 6) #define TM0S1_MAPSURF_FORMAT_SHIFT 6 #define MAPSURF_8BIT_INDEXED (0<<6) #define MAPSURF_8BIT (1<<6) #define MAPSURF_16BIT (2<<6) #define MAPSURF_32BIT (3<<6) #define MAPSURF_411 (4<<6) #define MAPSURF_422 (5<<6) #define MAPSURF_COMPRESSED (6<<6) #define MAPSURF_4BIT_INDEXED (7<<6) #define TM0S1_MT_FORMAT_MASK (0x7 << 3) #define TM0S1_MT_FORMAT_SHIFT 3 #define MT_4BIT_IDX_ARGB8888 (7<<3) /* SURFACE_4BIT_INDEXED */ #define MT_8BIT_IDX_RGB565 (0<<3) /* SURFACE_8BIT_INDEXED */ #define MT_8BIT_IDX_ARGB1555 (1<<3) #define MT_8BIT_IDX_ARGB4444 (2<<3) #define MT_8BIT_IDX_AY88 (3<<3) #define MT_8BIT_IDX_ABGR8888 (4<<3) #define MT_8BIT_IDX_BUMP_88DVDU (5<<3) #define MT_8BIT_IDX_BUMP_655LDVDU (6<<3) #define MT_8BIT_IDX_ARGB8888 (7<<3) #define MT_8BIT_I8 (0<<3) /* SURFACE_8BIT */ #define MT_8BIT_L8 (1<<3) #define MT_8BIT_A8 (4<<3) #define MT_16BIT_RGB565 (0<<3) /* SURFACE_16BIT */ #define MT_16BIT_ARGB1555 (1<<3) #define MT_16BIT_ARGB4444 (2<<3) #define MT_16BIT_AY88 (3<<3) #define MT_16BIT_DIB_ARGB1555_8888 (4<<3) #define MT_16BIT_BUMP_88DVDU (5<<3) #define MT_16BIT_BUMP_655LDVDU (6<<3) #define MT_16BIT_DIB_RGB565_8888 (7<<3) #define MT_32BIT_ARGB8888 (0<<3) /* SURFACE_32BIT */ #define MT_32BIT_ABGR8888 (1<<3) #define MT_32BIT_XRGB8888 (2<<3) #define MT_32BIT_XBGR8888 (3<<3) #define MT_32BIT_BUMP_XLDVDU_8888 (6<<3) #define MT_32BIT_DIB_8888 (7<<3) #define MT_411_YUV411 (0<<3) /* SURFACE_411 */ #define MT_422_YCRCB_SWAPY (0<<3) /* SURFACE_422 */ #define MT_422_YCRCB_NORMAL (1<<3) #define MT_422_YCRCB_SWAPUV (2<<3) #define MT_422_YCRCB_SWAPUVY (3<<3) #define MT_COMPRESS_DXT1 (0<<3) /* SURFACE_COMPRESSED */ #define MT_COMPRESS_DXT2_3 (1<<3) #define MT_COMPRESS_DXT4_5 (2<<3) #define MT_COMPRESS_FXT1 (3<<3) #define TM0S1_COLORSPACE_CONVERSION (1 << 2) #define TM0S1_TILED_SURFACE (1 << 1) #define TM0S1_TILE_WALK (1 << 0) #define TM0S2_PITCH_SHIFT 21 #define TM0S2_CUBE_FACE_ENA_SHIFT 15 #define TM0S2_CUBE_FACE_ENA_MASK (1<<15) #define TM0S2_MAP_FORMAT (1<<14) #define TM0S2_MAP_2D (0<<14) #define TM0S2_MAP_3D_CUBE (1<<14) #define TM0S2_VERTICAL_LINE_STRIDE (1<<13) #define TM0S2_VERITCAL_LINE_STRIDE_OFF (1<<12) #define TM0S2_OUTPUT_CHAN_SHIFT 10 #define TM0S2_OUTPUT_CHAN_MASK (3<<10) #define TM0S3_MIP_FILTER_MASK (0x3<<30) #define TM0S3_MIP_FILTER_SHIFT 30 #define MIPFILTER_NONE 0 #define MIPFILTER_NEAREST 1 #define MIPFILTER_LINEAR 3 #define TM0S3_MAG_FILTER_MASK (0x3<<28) #define TM0S3_MAG_FILTER_SHIFT 28 #define TM0S3_MIN_FILTER_MASK (0x3<<26) #define TM0S3_MIN_FILTER_SHIFT 26 #define FILTER_NEAREST 0 #define FILTER_LINEAR 1 #define FILTER_ANISOTROPIC 2 #define TM0S3_LOD_BIAS_SHIFT 17 #define TM0S3_LOD_BIAS_MASK (0x1ff<<17) #define TM0S3_MAX_MIP_SHIFT 9 #define TM0S3_MAX_MIP_MASK (0xff<<9) #define TM0S3_MIN_MIP_SHIFT 3 #define TM0S3_MIN_MIP_MASK (0x3f<<3) #define TM0S3_KILL_PIXEL (1<<2) #define TM0S3_KEYED_FILTER (1<<1) #define TM0S3_CHROMA_KEY (1<<0) /* _3DSTATE_MAP_TEXEL_STREAM, p188 */ #define _3DSTATE_MAP_TEX_STREAM_CMD (CMD_3D|(0x1c<<24)|(0x05<<19)) #define DISABLE_TEX_STREAM_BUMP (1<<12) #define ENABLE_TEX_STREAM_BUMP ((1<<12)|(1<<11)) #define TEX_MODIFY_UNIT_0 0 #define TEX_MODIFY_UNIT_1 (1<<8) #define ENABLE_TEX_STREAM_COORD_SET (1<<7) #define TEX_STREAM_COORD_SET(x) ((x)<<4) #define ENABLE_TEX_STREAM_MAP_IDX (1<<3) #define TEX_STREAM_MAP_IDX(x) (x) #define FLUSH_MAP_CACHE (1<<0) #define _3DSTATE_MAP_FILTER_CMD (CMD_3D|(0x1c<<24)|(0x02<<19)) #define FILTER_TEXMAP_INDEX(x) ((x) << 16) #define MAG_MODE_FILTER_ENABLE (1 << 5) #define MIN_MODE_FILTER_ENABLE (1 << 2) #define MAG_MAPFILTER_NEAREST (0 << 3) #define MAG_MAPFILTER_LINEAR (1 << 3) #define MAG_MAPFILTER_ANISOTROPIC (2 << 3) #define MIN_MAPFILTER_NEAREST (0) #define MIN_MAPFILTER_LINEAR (1) #define MIN_MAPFILTER_ANISOTROPIC (2) #define ENABLE_KEYS (1<<15) #define DISABLE_COLOR_KEY 0 #define DISABLE_CHROMA_KEY 0 #define DISABLE_KILL_PIXEL 0 #define ENABLE_MIP_MODE_FILTER (1 << 9) #define MIPFILTER_NONE 0 #define MIPFILTER_NEAREST 1 #define MIPFILTER_LINEAR 3 #endif intel-gpu-tools-1.3/lib/gen7_render.h0000664000175100017510000001310011775241246014466 00000000000000#ifndef GEN7_RENDER_H #define GEN7_RENDER_H #include "gen6_render.h" #define GEN7_3DSTATE_URB_VS (0x7830 << 16) #define GEN7_3DSTATE_URB_HS (0x7831 << 16) #define GEN7_3DSTATE_URB_DS (0x7832 << 16) #define GEN7_3DSTATE_URB_GS (0x7833 << 16) #define GEN6_3DSTATE_SCISSOR_STATE_POINTERS GEN6_3D(3, 0, 0xf) #define GEN7_3DSTATE_CLEAR_PARAMS GEN6_3D(3, 0, 0x04) #define GEN7_3DSTATE_DEPTH_BUFFER GEN6_3D(3, 0, 0x05) #define GEN7_3DSTATE_STENCIL_BUFFER GEN6_3D(3, 0, 0x06) #define GEN7_3DSTATE_HIER_DEPTH_BUFFER GEN6_3D(3, 0, 0x07) #define GEN7_3DSTATE_GS GEN6_3D(3, 0, 0x11) #define GEN7_3DSTATE_CONSTANT_GS GEN6_3D(3, 0, 0x16) #define GEN7_3DSTATE_CONSTANT_HS GEN6_3D(3, 0, 0x19) #define GEN7_3DSTATE_CONSTANT_DS GEN6_3D(3, 0, 0x1a) #define GEN7_3DSTATE_HS GEN6_3D(3, 0, 0x1b) #define GEN7_3DSTATE_TE GEN6_3D(3, 0, 0x1c) #define GEN7_3DSTATE_DS GEN6_3D(3, 0, 0x1d) #define GEN7_3DSTATE_STREAMOUT GEN6_3D(3, 0, 0x1e) #define GEN7_3DSTATE_SBE GEN6_3D(3, 0, 0x1f) #define GEN7_3DSTATE_PS GEN6_3D(3, 0, 0x20) #define GEN7_3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP \ GEN6_3D(3, 0, 0x21) #define GEN7_3DSTATE_VIEWPORT_STATE_POINTERS_CC GEN6_3D(3, 0, 0x23) #define GEN7_3DSTATE_BLEND_STATE_POINTERS GEN6_3D(3, 0, 0x24) #define GEN7_3DSTATE_DS_STATE_POINTERS GEN6_3D(3, 0, 0x25) #define GEN7_3DSTATE_BINDING_TABLE_POINTERS_VS GEN6_3D(3, 0, 0x26) #define GEN7_3DSTATE_BINDING_TABLE_POINTERS_HS GEN6_3D(3, 0, 0x27) #define GEN7_3DSTATE_BINDING_TABLE_POINTERS_DS GEN6_3D(3, 0, 0x28) #define GEN7_3DSTATE_BINDING_TABLE_POINTERS_GS GEN6_3D(3, 0, 0x29) #define GEN7_3DSTATE_BINDING_TABLE_POINTERS_PS GEN6_3D(3, 0, 0x2a) #define GEN7_3DSTATE_SAMPLER_STATE_POINTERS_VS GEN6_3D(3, 0, 0x2b) #define GEN7_3DSTATE_SAMPLER_STATE_POINTERS_HS GEN6_3D(3, 0, 0x2c) #define GEN7_3DSTATE_SAMPLER_STATE_POINTERS_DS GEN6_3D(3, 0, 0x2d) #define GEN7_3DSTATE_SAMPLER_STATE_POINTERS_GS GEN6_3D(3, 0, 0x2e) #define GEN7_3DSTATE_SAMPLER_STATE_POINTERS_PS GEN6_3D(3, 0, 0x2f) #define GEN7_3DSTATE_PUSH_CONSTANT_ALLOC_VS GEN6_3D(3, 1, 0x12) #define GEN7_3DSTATE_PUSH_CONSTANT_ALLOC_HS GEN6_3D(3, 1, 0x13) #define GEN7_3DSTATE_PUSH_CONSTANT_ALLOC_DS GEN6_3D(3, 1, 0x14) #define GEN7_3DSTATE_PUSH_CONSTANT_ALLOC_GS GEN6_3D(3, 1, 0x15) #define GEN7_3DSTATE_PUSH_CONSTANT_ALLOC_PS GEN6_3D(3, 1, 0x16) /* Some random bits that we care about */ #define GEN7_VB0_BUFFER_ADDR_MOD_EN (1 << 14) #define GEN7_WM_DISPATCH_ENABLE (1 << 29) #define GEN7_3DSTATE_PS_PERSPECTIVE_PIXEL_BARYCENTRIC (1 << 11) #define GEN7_3DSTATE_PS_ATTRIBUTE_ENABLED (1 << 10) /* Random shifts */ #define GEN7_3DSTATE_WM_MAX_THREADS_SHIFT 24 #define HSW_3DSTATE_WM_MAX_THREADS_SHIFT 23 /* Shamelessly ripped from mesa */ struct gen7_surface_state { struct { uint32_t cube_pos_z:1; uint32_t cube_neg_z:1; uint32_t cube_pos_y:1; uint32_t cube_neg_y:1; uint32_t cube_pos_x:1; uint32_t cube_neg_x:1; uint32_t pad2:2; uint32_t render_cache_read_write:1; uint32_t pad1:1; uint32_t surface_array_spacing:1; uint32_t vert_line_stride_ofs:1; uint32_t vert_line_stride:1; uint32_t tile_walk:1; uint32_t tiled_surface:1; uint32_t horizontal_alignment:1; uint32_t vertical_alignment:2; uint32_t surface_format:9; /**< BRW_SURFACEFORMAT_x */ uint32_t pad0:1; uint32_t is_array:1; uint32_t surface_type:3; /**< BRW_SURFACE_1D/2D/3D/CUBE */ } ss0; struct { uint32_t base_addr; } ss1; struct { uint32_t width:14; uint32_t pad1:2; uint32_t height:14; uint32_t pad0:2; } ss2; struct { uint32_t pitch:18; uint32_t pad:3; uint32_t depth:11; } ss3; struct { uint32_t multisample_position_palette_index:3; uint32_t num_multisamples:3; uint32_t multisampled_surface_storage_format:1; uint32_t render_target_view_extent:11; uint32_t min_array_elt:11; uint32_t rotation:2; uint32_t pad0:1; } ss4; struct { uint32_t mip_count:4; uint32_t min_lod:4; uint32_t pad1:12; uint32_t y_offset:4; uint32_t pad0:1; uint32_t x_offset:7; } ss5; struct { uint32_t pad; /* Multisample Control Surface stuff */ } ss6; struct { uint32_t resource_min_lod:12; /* Only on Haswell */ uint32_t pad0:4; uint32_t shader_chanel_select_a:3; uint32_t shader_chanel_select_b:3; uint32_t shader_chanel_select_g:3; uint32_t shader_chanel_select_r:3; uint32_t alpha_clear_color:1; uint32_t blue_clear_color:1; uint32_t green_clear_color:1; uint32_t red_clear_color:1; } ss7; }; struct gen7_sampler_state { struct { uint32_t aniso_algorithm:1; uint32_t lod_bias:13; uint32_t min_filter:3; uint32_t mag_filter:3; uint32_t mip_filter:2; uint32_t base_level:5; uint32_t pad1:1; uint32_t lod_preclamp:1; uint32_t default_color_mode:1; uint32_t pad0:1; uint32_t disable:1; } ss0; struct { uint32_t cube_control_mode:1; uint32_t shadow_function:3; uint32_t pad:4; uint32_t max_lod:12; uint32_t min_lod:12; } ss1; struct { uint32_t pad:5; uint32_t default_color_pointer:27; } ss2; struct { uint32_t r_wrap_mode:3; uint32_t t_wrap_mode:3; uint32_t s_wrap_mode:3; uint32_t pad:1; uint32_t non_normalized_coord:1; uint32_t trilinear_quality:2; uint32_t address_round:6; uint32_t max_aniso:3; uint32_t chroma_key_mode:1; uint32_t chroma_key_index:2; uint32_t chroma_key_enable:1; uint32_t pad0:6; } ss3; }; struct gen7_sf_clip_viewport { struct { float m00; float m11; float m22; float m30; float m31; float m32; } viewport; uint32_t pad0[2]; struct { float xmin; float xmax; float ymin; float ymax; } guardband; float pad1[4]; }; struct gen6_scissor_rect { uint32_t xmin:16; uint32_t ymin:16; uint32_t xmax:16; uint32_t ymax:16; }; #endif intel-gpu-tools-1.3/lib/intel_dpio.c0000644000175100017510000000573412014634425014414 00000000000000/* * Copyright © 2008 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * * Authors: * Vijay Purushothaman * */ #include #include #include #include #include "intel_gpu_tools.h" static uint32_t intel_display_reg_read(uint32_t reg) { struct pci_device *dev = intel_get_pci_device(); if (IS_VALLEYVIEW(dev->device_id)) reg += VLV_DISPLAY_BASE; return (*(volatile uint32_t*)((volatile char*)mmio + reg)); } static void intel_display_reg_write(uint32_t reg, uint32_t val) { volatile uint32_t *ptr; struct pci_device *dev = intel_get_pci_device(); if (IS_VALLEYVIEW(dev->device_id)) reg += VLV_DISPLAY_BASE; ptr = (volatile uint32_t*)((volatile char*)mmio + reg); *ptr = val; } /* * In SoCs like Valleyview some of the PLL & Lane control registers * can be accessed only through IO side band fabric called DPIO */ uint32_t intel_dpio_reg_read(uint32_t reg) { /* Check whether the side band fabric is ready to accept commands */ do { usleep(1); } while (intel_display_reg_read(DPIO_PKT) & DPIO_BUSY); intel_display_reg_write(DPIO_REG, reg); intel_display_reg_write(DPIO_PKT, DPIO_RID | DPIO_OP_READ | DPIO_PORTID | DPIO_BYTE); do { usleep(1); } while (intel_display_reg_read(DPIO_PKT) & DPIO_BUSY); return intel_display_reg_read(DPIO_DATA); } /* * In SoCs like Valleyview some of the PLL & Lane control registers * can be accessed only through IO side band fabric called DPIO */ void intel_dpio_reg_write(uint32_t reg, uint32_t val) { /* Check whether the side band fabric is ready to accept commands */ do { usleep(1); } while (intel_display_reg_read(DPIO_PKT) & DPIO_BUSY); intel_display_reg_write(DPIO_DATA, val); intel_display_reg_write(DPIO_REG, reg); intel_display_reg_write(DPIO_PKT, DPIO_RID | DPIO_OP_WRITE | DPIO_PORTID | DPIO_BYTE); do { usleep(1); } while (intel_display_reg_read(DPIO_PKT) & DPIO_BUSY); } intel-gpu-tools-1.3/lib/Makefile.am0000644000175100017510000000120512014634425014143 00000000000000 noinst_LTLIBRARIES = libintel_tools.la AM_CPPFLAGS = -I$(top_srcdir) AM_CFLAGS = $(DRM_CFLAGS) $(CWARNFLAGS) libintel_tools_la_SOURCES = \ debug.h \ drmtest.c \ drmtest.h \ i830_reg.h \ i915_3d.h \ i915_reg.h \ instdone.c \ instdone.h \ intel_batchbuffer.c \ intel_batchbuffer.h \ intel_chipset.h \ intel_drm.c \ intel_gpu_tools.h \ intel_mmio.c \ intel_pci.c \ intel_reg.h \ rendercopy_i915.c \ rendercopy_i830.c \ gen6_render.h \ gen7_render.h \ rendercopy_gen6.c \ rendercopy_gen7.c \ rendercopy.h \ intel_reg_map.c \ intel_dpio.c \ $(NULL) LDADD = $(CAIRO_LIBS) AM_CFLAGS += $(CAIRO_CFLAGS) intel-gpu-tools-1.3/lib/debug.h0000664000175100017510000000503111631112215013341 00000000000000/* * Copyright © 2011 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Ben Widawsky * */ #ifndef _DEBUG_H_ #define _DEBUG_H_ #define DEBUG_PROTOCOL_VERSION 1 #define COMMUNICATION_OFFSET 0xc00 #define COMMUNICATION_QWORD 0xc0 #define STATE_EU_MSG 0x47534d65 /* eMSG */ #define STATE_CPU_ACK 0x4b434163 /* cACK */ #define STATE_OFFSET 0xc20 #define STATE_QWORD 0xc2 #define TX_OFFSET 0xc40 #define TX_QWORD 0xc4 #define RX_OFFSET 0xc60 #define RX_QWORD 0xc6 #ifndef GEN_ASM typedef uint32_t grf[8]; typedef uint32_t mrf[8]; typedef uint8_t cr[12]; typedef uint32_t sr; #define DWORD8(x) {x, x, x, x, x, x, x, x} const static grf protocol_version = DWORD8(DEBUG_PROTOCOL_VERSION); const static grf eu_msg = DWORD8(STATE_EU_MSG); const static grf cpu_ack = DWORD8(STATE_CPU_ACK); struct eu_state { mrf m_regs[15]; grf g_regs[16]; grf pad; /* 0x400 */ cr cr0; sr sr0; uint32_t beef_pad[4]; uint8_t pad2[992 + 1024]; /* 0xc00 COMMUNICATION_OFFSET */ grf version; grf state_magic; grf eu_tx; grf eu_rx; uint8_t pad3[896]; } __attribute__((packed)); static inline void print_reg(uint8_t reg[32]) { uint32_t *dwords = (uint32_t *)reg; printf("%08x %08x %08x %08x %08x %08x %08x %08x", dwords[7], dwords[6], dwords[5], dwords[4], dwords[3], dwords[2], dwords[1], dwords[0]); } static inline void print_creg(uint8_t reg[12]) { uint32_t *dwords = (uint32_t *)reg; printf("%08x %08x %08x", dwords[2], dwords[1], dwords[0]); } #endif #endif intel-gpu-tools-1.3/lib/rendercopy_gen6.c0000664000175100017510000004041011715035437015354 00000000000000#include "rendercopy.h" #include "gen6_render.h" #include #define ALIGN(x, y) (((x) + (y)-1) & ~((y)-1)) #define VERTEX_SIZE (3*4) static const uint32_t ps_kernel_nomask_affine[][4] = { { 0x0060005a, 0x204077be, 0x000000c0, 0x008d0040 }, { 0x0060005a, 0x206077be, 0x000000c0, 0x008d0080 }, { 0x0060005a, 0x208077be, 0x000000d0, 0x008d0040 }, { 0x0060005a, 0x20a077be, 0x000000d0, 0x008d0080 }, { 0x00000201, 0x20080061, 0x00000000, 0x00000000 }, { 0x00600001, 0x20200022, 0x008d0000, 0x00000000 }, { 0x02800031, 0x21c01cc9, 0x00000020, 0x0a8a0001 }, { 0x00600001, 0x204003be, 0x008d01c0, 0x00000000 }, { 0x00600001, 0x206003be, 0x008d01e0, 0x00000000 }, { 0x00600001, 0x208003be, 0x008d0200, 0x00000000 }, { 0x00600001, 0x20a003be, 0x008d0220, 0x00000000 }, { 0x00600001, 0x20c003be, 0x008d0240, 0x00000000 }, { 0x00600001, 0x20e003be, 0x008d0260, 0x00000000 }, { 0x00600001, 0x210003be, 0x008d0280, 0x00000000 }, { 0x00600001, 0x212003be, 0x008d02a0, 0x00000000 }, { 0x05800031, 0x24001cc8, 0x00000040, 0x90019000 }, { 0x0000007e, 0x00000000, 0x00000000, 0x00000000 }, { 0x0000007e, 0x00000000, 0x00000000, 0x00000000 }, { 0x0000007e, 0x00000000, 0x00000000, 0x00000000 }, { 0x0000007e, 0x00000000, 0x00000000, 0x00000000 }, { 0x0000007e, 0x00000000, 0x00000000, 0x00000000 }, { 0x0000007e, 0x00000000, 0x00000000, 0x00000000 }, { 0x0000007e, 0x00000000, 0x00000000, 0x00000000 }, { 0x0000007e, 0x00000000, 0x00000000, 0x00000000 }, }; static uint32_t batch_used(struct intel_batchbuffer *batch) { return batch->ptr - batch->buffer; } static uint32_t batch_align(struct intel_batchbuffer *batch, uint32_t align) { uint32_t offset = batch_used(batch); offset = ALIGN(offset, align); batch->ptr = batch->buffer + offset; return offset; } static uint32_t batch_round_upto(struct intel_batchbuffer *batch, uint32_t divisor) { uint32_t offset = batch_used(batch); offset = (offset + divisor-1) / divisor * divisor; batch->ptr = batch->buffer + offset; return offset; } static void * batch_alloc(struct intel_batchbuffer *batch, uint32_t size, uint32_t align) { uint32_t offset = batch_align(batch, align); batch->ptr += size; return memset(batch->buffer + offset, 0, size); } static uint32_t batch_offset(struct intel_batchbuffer *batch, void *ptr) { return (uint8_t *)ptr - batch->buffer; } static uint32_t batch_copy(struct intel_batchbuffer *batch, const void *ptr, uint32_t size, uint32_t align) { return batch_offset(batch, memcpy(batch_alloc(batch, size, align), ptr, size)); } static void gen6_render_flush(struct intel_batchbuffer *batch, uint32_t batch_end) { int ret; ret = drm_intel_bo_subdata(batch->bo, 0, 4096, batch->buffer); if (ret == 0) ret = drm_intel_bo_mrb_exec(batch->bo, batch_end, NULL, 0, 0, 0); assert(ret == 0); } static uint32_t gen6_bind_buf(struct intel_batchbuffer *batch, struct scratch_buf *buf, uint32_t format, int is_dst) { struct gen6_surface_state *ss; uint32_t write_domain, read_domain; int ret; if (is_dst) { write_domain = read_domain = I915_GEM_DOMAIN_RENDER; } else { write_domain = 0; read_domain = I915_GEM_DOMAIN_SAMPLER; } ss = batch_alloc(batch, sizeof(*ss), 32); ss->ss0.surface_type = GEN6_SURFACE_2D; ss->ss0.surface_format = format; ss->ss0.data_return_format = GEN6_SURFACERETURNFORMAT_FLOAT32; ss->ss0.color_blend = 1; ss->ss1.base_addr = buf->bo->offset; ret = drm_intel_bo_emit_reloc(batch->bo, batch_offset(batch, ss) + 4, buf->bo, 0, read_domain, write_domain); assert(ret == 0); ss->ss2.height = buf_height(buf) - 1; ss->ss2.width = buf_width(buf) - 1; ss->ss3.pitch = buf->stride - 1; ss->ss3.tiled_surface = buf->tiling != I915_TILING_NONE; ss->ss3.tile_walk = buf->tiling == I915_TILING_Y; return batch_offset(batch, ss); } static uint32_t gen6_bind_surfaces(struct intel_batchbuffer *batch, struct scratch_buf *src, struct scratch_buf *dst) { uint32_t *binding_table; binding_table = batch_alloc(batch, 32, 32); binding_table[0] = gen6_bind_buf(batch, dst, GEN6_SURFACEFORMAT_B8G8R8A8_UNORM, 1); binding_table[1] = gen6_bind_buf(batch, src, GEN6_SURFACEFORMAT_B8G8R8A8_UNORM, 0); return batch_offset(batch, binding_table); } static void gen6_emit_sip(struct intel_batchbuffer *batch) { OUT_BATCH(GEN6_STATE_SIP | 0); OUT_BATCH(0); } static void gen6_emit_urb(struct intel_batchbuffer *batch) { OUT_BATCH(GEN6_3DSTATE_URB | (3 - 2)); OUT_BATCH((1 - 1) << GEN6_3DSTATE_URB_VS_SIZE_SHIFT | 24 << GEN6_3DSTATE_URB_VS_ENTRIES_SHIFT); /* at least 24 on GEN6 */ OUT_BATCH(0 << GEN6_3DSTATE_URB_GS_SIZE_SHIFT | 0 << GEN6_3DSTATE_URB_GS_ENTRIES_SHIFT); /* no GS thread */ } static void gen6_emit_state_base_address(struct intel_batchbuffer *batch) { OUT_BATCH(GEN6_STATE_BASE_ADDRESS | (10 - 2)); OUT_BATCH(0); /* general */ OUT_RELOC(batch->bo, /* surface */ I915_GEM_DOMAIN_INSTRUCTION, 0, BASE_ADDRESS_MODIFY); OUT_RELOC(batch->bo, /* instruction */ I915_GEM_DOMAIN_INSTRUCTION, 0, BASE_ADDRESS_MODIFY); OUT_BATCH(0); /* indirect */ OUT_RELOC(batch->bo, /* dynamic */ I915_GEM_DOMAIN_INSTRUCTION, 0, BASE_ADDRESS_MODIFY); /* upper bounds, disable */ OUT_BATCH(0); OUT_BATCH(BASE_ADDRESS_MODIFY); OUT_BATCH(0); OUT_BATCH(BASE_ADDRESS_MODIFY); } static void gen6_emit_viewports(struct intel_batchbuffer *batch, uint32_t cc_vp) { OUT_BATCH(GEN6_3DSTATE_VIEWPORT_STATE_POINTERS | GEN6_3DSTATE_VIEWPORT_STATE_MODIFY_CC | (4 - 2)); OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(cc_vp); } static void gen6_emit_vs(struct intel_batchbuffer *batch) { /* disable VS constant buffer */ OUT_BATCH(GEN6_3DSTATE_CONSTANT_VS | (5 - 2)); OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(GEN6_3DSTATE_VS | (6 - 2)); OUT_BATCH(0); /* no VS kernel */ OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(0); /* pass-through */ } static void gen6_emit_gs(struct intel_batchbuffer *batch) { /* disable GS constant buffer */ OUT_BATCH(GEN6_3DSTATE_CONSTANT_GS | (5 - 2)); OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(GEN6_3DSTATE_GS | (7 - 2)); OUT_BATCH(0); /* no GS kernel */ OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(0); /* pass-through */ } static void gen6_emit_clip(struct intel_batchbuffer *batch) { OUT_BATCH(GEN6_3DSTATE_CLIP | (4 - 2)); OUT_BATCH(0); OUT_BATCH(0); /* pass-through */ OUT_BATCH(0); } static void gen6_emit_wm_constants(struct intel_batchbuffer *batch) { /* disable WM constant buffer */ OUT_BATCH(GEN6_3DSTATE_CONSTANT_PS | (5 - 2)); OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(0); } static void gen6_emit_null_depth_buffer(struct intel_batchbuffer *batch) { OUT_BATCH(GEN6_3DSTATE_DEPTH_BUFFER | (7 - 2)); OUT_BATCH(GEN6_SURFACE_NULL << GEN6_3DSTATE_DEPTH_BUFFER_TYPE_SHIFT | GEN6_DEPTHFORMAT_D32_FLOAT << GEN6_3DSTATE_DEPTH_BUFFER_FORMAT_SHIFT); OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(GEN6_3DSTATE_CLEAR_PARAMS | (2 - 2)); OUT_BATCH(0); } static void gen6_emit_invariant(struct intel_batchbuffer *batch) { OUT_BATCH(GEN6_PIPELINE_SELECT | PIPELINE_SELECT_3D); OUT_BATCH(GEN6_3DSTATE_MULTISAMPLE | (3 - 2)); OUT_BATCH(GEN6_3DSTATE_MULTISAMPLE_PIXEL_LOCATION_CENTER | GEN6_3DSTATE_MULTISAMPLE_NUMSAMPLES_1); /* 1 sample/pixel */ OUT_BATCH(0); OUT_BATCH(GEN6_3DSTATE_SAMPLE_MASK | (2 - 2)); OUT_BATCH(1); } static void gen6_emit_cc(struct intel_batchbuffer *batch, uint32_t blend) { OUT_BATCH(GEN6_3DSTATE_CC_STATE_POINTERS | (4 - 2)); OUT_BATCH(blend | 1); OUT_BATCH(1024 | 1); OUT_BATCH(1024 | 1); } static void gen6_emit_sampler(struct intel_batchbuffer *batch, uint32_t state) { OUT_BATCH(GEN6_3DSTATE_SAMPLER_STATE_POINTERS | GEN6_3DSTATE_SAMPLER_STATE_MODIFY_PS | (4 - 2)); OUT_BATCH(0); /* VS */ OUT_BATCH(0); /* GS */ OUT_BATCH(state); } static void gen6_emit_sf(struct intel_batchbuffer *batch) { OUT_BATCH(GEN6_3DSTATE_SF | (20 - 2)); OUT_BATCH(1 << GEN6_3DSTATE_SF_NUM_OUTPUTS_SHIFT | 1 << GEN6_3DSTATE_SF_URB_ENTRY_READ_LENGTH_SHIFT | 1 << GEN6_3DSTATE_SF_URB_ENTRY_READ_OFFSET_SHIFT); OUT_BATCH(0); OUT_BATCH(GEN6_3DSTATE_SF_CULL_NONE); OUT_BATCH(2 << GEN6_3DSTATE_SF_TRIFAN_PROVOKE_SHIFT); /* DW4 */ OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(0); /* DW9 */ OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(0); /* DW14 */ OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(0); /* DW19 */ } static void gen6_emit_wm(struct intel_batchbuffer *batch, int kernel) { OUT_BATCH(GEN6_3DSTATE_WM | (9 - 2)); OUT_BATCH(kernel); OUT_BATCH(1 << GEN6_3DSTATE_WM_SAMPLER_COUNT_SHIFT | 2 << GEN6_3DSTATE_WM_BINDING_TABLE_ENTRY_COUNT_SHIFT); OUT_BATCH(0); OUT_BATCH(6 << GEN6_3DSTATE_WM_DISPATCH_START_GRF_0_SHIFT); /* DW4 */ OUT_BATCH((40 - 1) << GEN6_3DSTATE_WM_MAX_THREADS_SHIFT | GEN6_3DSTATE_WM_DISPATCH_ENABLE | GEN6_3DSTATE_WM_16_DISPATCH_ENABLE); OUT_BATCH(1 << GEN6_3DSTATE_WM_NUM_SF_OUTPUTS_SHIFT | GEN6_3DSTATE_WM_PERSPECTIVE_PIXEL_BARYCENTRIC); OUT_BATCH(0); OUT_BATCH(0); } static void gen6_emit_binding_table(struct intel_batchbuffer *batch, uint32_t wm_table) { OUT_BATCH(GEN6_3DSTATE_BINDING_TABLE_POINTERS | GEN6_3DSTATE_BINDING_TABLE_MODIFY_PS | (4 - 2)); OUT_BATCH(0); /* vs */ OUT_BATCH(0); /* gs */ OUT_BATCH(wm_table); } static void gen6_emit_drawing_rectangle(struct intel_batchbuffer *batch, struct scratch_buf *dst) { OUT_BATCH(GEN6_3DSTATE_DRAWING_RECTANGLE | (4 - 2)); OUT_BATCH(0); OUT_BATCH((buf_height(dst) - 1) << 16 | (buf_width(dst) - 1)); OUT_BATCH(0); } static void gen6_emit_vertex_elements(struct intel_batchbuffer *batch) { /* The VUE layout * dword 0-3: pad (0.0, 0.0, 0.0. 0.0) * dword 4-7: position (x, y, 1.0, 1.0), * dword 8-11: texture coordinate 0 (u0, v0, 0, 0) * * dword 4-11 are fetched from vertex buffer */ OUT_BATCH(GEN6_3DSTATE_VERTEX_ELEMENTS | (2 * 3 + 1 - 2)); OUT_BATCH(0 << VE0_VERTEX_BUFFER_INDEX_SHIFT | VE0_VALID | GEN6_SURFACEFORMAT_R32G32B32A32_FLOAT << VE0_FORMAT_SHIFT | 0 << VE0_OFFSET_SHIFT); OUT_BATCH(GEN6_VFCOMPONENT_STORE_0 << VE1_VFCOMPONENT_0_SHIFT | GEN6_VFCOMPONENT_STORE_0 << VE1_VFCOMPONENT_1_SHIFT | GEN6_VFCOMPONENT_STORE_0 << VE1_VFCOMPONENT_2_SHIFT | GEN6_VFCOMPONENT_STORE_0 << VE1_VFCOMPONENT_3_SHIFT); /* x,y */ OUT_BATCH(0 << VE0_VERTEX_BUFFER_INDEX_SHIFT | VE0_VALID | GEN6_SURFACEFORMAT_R16G16_SSCALED << VE0_FORMAT_SHIFT | 0 << VE0_OFFSET_SHIFT); /* offsets vb in bytes */ OUT_BATCH(GEN6_VFCOMPONENT_STORE_SRC << VE1_VFCOMPONENT_0_SHIFT | GEN6_VFCOMPONENT_STORE_SRC << VE1_VFCOMPONENT_1_SHIFT | GEN6_VFCOMPONENT_STORE_1_FLT << VE1_VFCOMPONENT_2_SHIFT | GEN6_VFCOMPONENT_STORE_1_FLT << VE1_VFCOMPONENT_3_SHIFT); /* u0, v0 */ OUT_BATCH(0 << VE0_VERTEX_BUFFER_INDEX_SHIFT | VE0_VALID | GEN6_SURFACEFORMAT_R32G32_FLOAT << VE0_FORMAT_SHIFT | 4 << VE0_OFFSET_SHIFT); /* offset vb in bytes */ OUT_BATCH(GEN6_VFCOMPONENT_STORE_SRC << VE1_VFCOMPONENT_0_SHIFT | GEN6_VFCOMPONENT_STORE_SRC << VE1_VFCOMPONENT_1_SHIFT | GEN6_VFCOMPONENT_STORE_0 << VE1_VFCOMPONENT_2_SHIFT | GEN6_VFCOMPONENT_STORE_0 << VE1_VFCOMPONENT_3_SHIFT); } static uint32_t gen6_create_cc_viewport(struct intel_batchbuffer *batch) { struct gen6_cc_viewport *vp; vp = batch_alloc(batch, sizeof(*vp), 32); vp->min_depth = -1.e35; vp->max_depth = 1.e35; return batch_offset(batch, vp); } static uint32_t gen6_create_cc_blend(struct intel_batchbuffer *batch) { struct gen6_blend_state *blend; blend = batch_alloc(batch, sizeof(*blend), 64); blend->blend0.dest_blend_factor = GEN6_BLENDFACTOR_ZERO; blend->blend0.source_blend_factor = GEN6_BLENDFACTOR_ONE; blend->blend0.blend_func = GEN6_BLENDFUNCTION_ADD; blend->blend0.blend_enable = 1; blend->blend1.post_blend_clamp_enable = 1; blend->blend1.pre_blend_clamp_enable = 1; return batch_offset(batch, blend); } static uint32_t gen6_create_kernel(struct intel_batchbuffer *batch) { return batch_copy(batch, ps_kernel_nomask_affine, sizeof(ps_kernel_nomask_affine), 64); } static uint32_t gen6_create_sampler(struct intel_batchbuffer *batch, sampler_filter_t filter, sampler_extend_t extend) { struct gen6_sampler_state *ss; ss = batch_alloc(batch, sizeof(*ss), 32); ss->ss0.lod_preclamp = 1; /* GL mode */ /* We use the legacy mode to get the semantics specified by * the Render extension. */ ss->ss0.border_color_mode = GEN6_BORDER_COLOR_MODE_LEGACY; switch (filter) { default: case SAMPLER_FILTER_NEAREST: ss->ss0.min_filter = GEN6_MAPFILTER_NEAREST; ss->ss0.mag_filter = GEN6_MAPFILTER_NEAREST; break; case SAMPLER_FILTER_BILINEAR: ss->ss0.min_filter = GEN6_MAPFILTER_LINEAR; ss->ss0.mag_filter = GEN6_MAPFILTER_LINEAR; break; } switch (extend) { default: case SAMPLER_EXTEND_NONE: ss->ss1.r_wrap_mode = GEN6_TEXCOORDMODE_CLAMP_BORDER; ss->ss1.s_wrap_mode = GEN6_TEXCOORDMODE_CLAMP_BORDER; ss->ss1.t_wrap_mode = GEN6_TEXCOORDMODE_CLAMP_BORDER; break; case SAMPLER_EXTEND_REPEAT: ss->ss1.r_wrap_mode = GEN6_TEXCOORDMODE_WRAP; ss->ss1.s_wrap_mode = GEN6_TEXCOORDMODE_WRAP; ss->ss1.t_wrap_mode = GEN6_TEXCOORDMODE_WRAP; break; case SAMPLER_EXTEND_PAD: ss->ss1.r_wrap_mode = GEN6_TEXCOORDMODE_CLAMP; ss->ss1.s_wrap_mode = GEN6_TEXCOORDMODE_CLAMP; ss->ss1.t_wrap_mode = GEN6_TEXCOORDMODE_CLAMP; break; case SAMPLER_EXTEND_REFLECT: ss->ss1.r_wrap_mode = GEN6_TEXCOORDMODE_MIRROR; ss->ss1.s_wrap_mode = GEN6_TEXCOORDMODE_MIRROR; ss->ss1.t_wrap_mode = GEN6_TEXCOORDMODE_MIRROR; break; } return batch_offset(batch, ss); } static void gen6_emit_vertex_buffer(struct intel_batchbuffer *batch) { OUT_BATCH(GEN6_3DSTATE_VERTEX_BUFFERS | 3); OUT_BATCH(VB0_VERTEXDATA | 0 << VB0_BUFFER_INDEX_SHIFT | VERTEX_SIZE << VB0_BUFFER_PITCH_SHIFT); OUT_RELOC(batch->bo, I915_GEM_DOMAIN_VERTEX, 0, 0); OUT_RELOC(batch->bo, I915_GEM_DOMAIN_VERTEX, 0, batch->bo->size-1); OUT_BATCH(0); } static uint32_t gen6_emit_primitive(struct intel_batchbuffer *batch) { uint32_t offset; OUT_BATCH(GEN6_3DPRIMITIVE | GEN6_3DPRIMITIVE_VERTEX_SEQUENTIAL | _3DPRIM_RECTLIST << GEN6_3DPRIMITIVE_TOPOLOGY_SHIFT | 0 << 9 | 4); OUT_BATCH(3); /* vertex count */ offset = batch_used(batch); OUT_BATCH(0); /* vertex_index */ OUT_BATCH(1); /* single instance */ OUT_BATCH(0); /* start instance location */ OUT_BATCH(0); /* index buffer offset, ignored */ return offset; } void gen6_render_copyfunc(struct intel_batchbuffer *batch, struct scratch_buf *src, unsigned src_x, unsigned src_y, unsigned width, unsigned height, struct scratch_buf *dst, unsigned dst_x, unsigned dst_y) { uint32_t wm_state, wm_kernel, wm_table; uint32_t cc_vp, cc_blend, offset; uint32_t batch_end; intel_batchbuffer_flush(batch); batch->ptr = batch->buffer + 1024; batch_alloc(batch, 64, 64); wm_table = gen6_bind_surfaces(batch, src, dst); wm_kernel = gen6_create_kernel(batch); wm_state = gen6_create_sampler(batch, SAMPLER_FILTER_NEAREST, SAMPLER_EXTEND_NONE); cc_vp = gen6_create_cc_viewport(batch); cc_blend = gen6_create_cc_blend(batch); batch->ptr = batch->buffer; gen6_emit_invariant(batch); gen6_emit_state_base_address(batch); gen6_emit_sip(batch); gen6_emit_urb(batch); gen6_emit_viewports(batch, cc_vp); gen6_emit_vs(batch); gen6_emit_gs(batch); gen6_emit_clip(batch); gen6_emit_wm_constants(batch); gen6_emit_null_depth_buffer(batch); gen6_emit_drawing_rectangle(batch, dst); gen6_emit_cc(batch, cc_blend); gen6_emit_sampler(batch, wm_state); gen6_emit_sf(batch); gen6_emit_wm(batch, wm_kernel); gen6_emit_vertex_elements(batch); gen6_emit_binding_table(batch, wm_table); gen6_emit_vertex_buffer(batch); offset = gen6_emit_primitive(batch); OUT_BATCH(MI_BATCH_BUFFER_END); batch_end = batch_align(batch, 8); *(uint32_t*)(batch->buffer + offset) = batch_round_upto(batch, VERTEX_SIZE)/VERTEX_SIZE; emit_vertex_2s(batch, dst_x + width, dst_y + height); emit_vertex_normalized(batch, src_x + width, buf_width(src)); emit_vertex_normalized(batch, src_y + height, buf_height(src)); emit_vertex_2s(batch, dst_x, dst_y + height); emit_vertex_normalized(batch, src_x, buf_width(src)); emit_vertex_normalized(batch, src_y + height, buf_height(src)); emit_vertex_2s(batch, dst_x, dst_y); emit_vertex_normalized(batch, src_x, buf_width(src)); emit_vertex_normalized(batch, src_y, buf_height(src)); gen6_render_flush(batch, batch_end); intel_batchbuffer_reset(batch); } intel-gpu-tools-1.3/lib/intel_batchbuffer.h0000664000175100017510000000607411775241246015751 00000000000000#ifndef INTEL_BATCHBUFFER_H #define INTEL_BATCHBUFFER_H #include #include "intel_bufmgr.h" #define BATCH_SZ 4096 #define BATCH_RESERVED 16 struct intel_batchbuffer { drm_intel_bufmgr *bufmgr; uint32_t devid; drm_intel_bo *bo; uint8_t buffer[BATCH_SZ]; uint8_t *ptr; }; struct intel_batchbuffer *intel_batchbuffer_alloc(drm_intel_bufmgr *bufmgr, uint32_t devid); void intel_batchbuffer_free(struct intel_batchbuffer *batch); void intel_batchbuffer_flush(struct intel_batchbuffer *batch); void intel_batchbuffer_flush_on_ring(struct intel_batchbuffer *batch, int ring); void intel_batchbuffer_flush_with_context(struct intel_batchbuffer *batch, drm_intel_context *context); void intel_batchbuffer_reset(struct intel_batchbuffer *batch); void intel_batchbuffer_data(struct intel_batchbuffer *batch, const void *data, unsigned int bytes); void intel_batchbuffer_emit_reloc(struct intel_batchbuffer *batch, drm_intel_bo *buffer, uint32_t delta, uint32_t read_domains, uint32_t write_domain, int fenced); /* Inline functions - might actually be better off with these * non-inlined. Certainly better off switching all command packets to * be passed as structs rather than dwords, but that's a little bit of * work... */ #pragma GCC diagnostic ignored "-Winline" static inline int intel_batchbuffer_space(struct intel_batchbuffer *batch) { return (BATCH_SZ - BATCH_RESERVED) - (batch->ptr - batch->buffer); } static inline void intel_batchbuffer_emit_dword(struct intel_batchbuffer *batch, uint32_t dword) { assert(intel_batchbuffer_space(batch) >= 4); *(uint32_t *) (batch->ptr) = dword; batch->ptr += 4; } static inline void intel_batchbuffer_require_space(struct intel_batchbuffer *batch, unsigned int sz) { assert(sz < BATCH_SZ - BATCH_RESERVED); if (intel_batchbuffer_space(batch) < sz) intel_batchbuffer_flush(batch); } /* Here are the crusty old macros, to be removed: */ #define BATCH_LOCALS #define BEGIN_BATCH(n) do { \ intel_batchbuffer_require_space(batch, (n)*4); \ } while (0) #define OUT_BATCH(d) intel_batchbuffer_emit_dword(batch, d) #define OUT_RELOC_FENCED(buf, read_domains, write_domain, delta) do { \ assert((delta) >= 0); \ intel_batchbuffer_emit_reloc(batch, buf, delta, \ read_domains, write_domain, 1); \ } while (0) #define OUT_RELOC(buf, read_domains, write_domain, delta) do { \ assert((delta) >= 0); \ intel_batchbuffer_emit_reloc(batch, buf, delta, \ read_domains, write_domain, 0); \ } while (0) #define ADVANCE_BATCH() do { \ } while(0) void intel_batchbuffer_emit_mi_flush(struct intel_batchbuffer *batch); void intel_copy_bo(struct intel_batchbuffer *batch, drm_intel_bo *dst_bo, drm_intel_bo *src_bo, int width, int height); #define I915_EXEC_CONTEXT_ID_MASK (0xffffffff) #define i915_execbuffer2_set_context_id(eb2, context) \ (eb2).rsvd1 = context & I915_EXEC_CONTEXT_ID_MASK #define i915_execbuffer2_get_context_id(eb2) \ ((eb2).rsvd1 & I915_EXEC_CONTEXT_ID_MASK) #endif intel-gpu-tools-1.3/lib/rendercopy_i830.c0000664000175100017510000001662411746063357015220 00000000000000#include "i830_reg.h" #include "rendercopy.h" #define TB0C_LAST_STAGE (1 << 31) #define TB0C_RESULT_SCALE_1X (0 << 29) #define TB0C_RESULT_SCALE_2X (1 << 29) #define TB0C_RESULT_SCALE_4X (2 << 29) #define TB0C_OP_ARG1 (1 << 25) #define TB0C_OP_MODULE (3 << 25) #define TB0C_OUTPUT_WRITE_CURRENT (0 << 24) #define TB0C_OUTPUT_WRITE_ACCUM (1 << 24) #define TB0C_ARG3_REPLICATE_ALPHA (1<<23) #define TB0C_ARG3_INVERT (1<<22) #define TB0C_ARG3_SEL_XXX #define TB0C_ARG2_REPLICATE_ALPHA (1<<17) #define TB0C_ARG2_INVERT (1<<16) #define TB0C_ARG2_SEL_ONE (0 << 12) #define TB0C_ARG2_SEL_FACTOR (1 << 12) #define TB0C_ARG2_SEL_TEXEL0 (6 << 12) #define TB0C_ARG2_SEL_TEXEL1 (7 << 12) #define TB0C_ARG2_SEL_TEXEL2 (8 << 12) #define TB0C_ARG2_SEL_TEXEL3 (9 << 12) #define TB0C_ARG1_REPLICATE_ALPHA (1<<11) #define TB0C_ARG1_INVERT (1<<10) #define TB0C_ARG1_SEL_ONE (0 << 6) #define TB0C_ARG1_SEL_TEXEL0 (6 << 6) #define TB0C_ARG1_SEL_TEXEL1 (7 << 6) #define TB0C_ARG1_SEL_TEXEL2 (8 << 6) #define TB0C_ARG1_SEL_TEXEL3 (9 << 6) #define TB0C_ARG0_REPLICATE_ALPHA (1<<5) #define TB0C_ARG0_SEL_XXX #define TB0A_CTR_STAGE_ENABLE (1<<31) #define TB0A_RESULT_SCALE_1X (0 << 29) #define TB0A_RESULT_SCALE_2X (1 << 29) #define TB0A_RESULT_SCALE_4X (2 << 29) #define TB0A_OP_ARG1 (1 << 25) #define TB0A_OP_MODULE (3 << 25) #define TB0A_OUTPUT_WRITE_CURRENT (0<<24) #define TB0A_OUTPUT_WRITE_ACCUM (1<<24) #define TB0A_CTR_STAGE_SEL_BITS_XXX #define TB0A_ARG3_SEL_XXX #define TB0A_ARG3_INVERT (1<<17) #define TB0A_ARG2_INVERT (1<<16) #define TB0A_ARG2_SEL_ONE (0 << 12) #define TB0A_ARG2_SEL_TEXEL0 (6 << 12) #define TB0A_ARG2_SEL_TEXEL1 (7 << 12) #define TB0A_ARG2_SEL_TEXEL2 (8 << 12) #define TB0A_ARG2_SEL_TEXEL3 (9 << 12) #define TB0A_ARG1_INVERT (1<<10) #define TB0A_ARG1_SEL_ONE (0 << 6) #define TB0A_ARG1_SEL_TEXEL0 (6 << 6) #define TB0A_ARG1_SEL_TEXEL1 (7 << 6) #define TB0A_ARG1_SEL_TEXEL2 (8 << 6) #define TB0A_ARG1_SEL_TEXEL3 (9 << 6) static void gen2_emit_invariant(struct intel_batchbuffer *batch) { int i; for (i = 0; i < 4; i++) { OUT_BATCH(_3DSTATE_MAP_CUBE | MAP_UNIT(i)); OUT_BATCH(_3DSTATE_MAP_TEX_STREAM_CMD | MAP_UNIT(i) | DISABLE_TEX_STREAM_BUMP | ENABLE_TEX_STREAM_COORD_SET | TEX_STREAM_COORD_SET(i) | ENABLE_TEX_STREAM_MAP_IDX | TEX_STREAM_MAP_IDX(i)); OUT_BATCH(_3DSTATE_MAP_COORD_TRANSFORM); OUT_BATCH(DISABLE_TEX_TRANSFORM | TEXTURE_SET(i)); } OUT_BATCH(_3DSTATE_MAP_COORD_SETBIND_CMD); OUT_BATCH(TEXBIND_SET3(TEXCOORDSRC_VTXSET_3) | TEXBIND_SET2(TEXCOORDSRC_VTXSET_2) | TEXBIND_SET1(TEXCOORDSRC_VTXSET_1) | TEXBIND_SET0(TEXCOORDSRC_VTXSET_0)); OUT_BATCH(_3DSTATE_SCISSOR_ENABLE_CMD | DISABLE_SCISSOR_RECT); OUT_BATCH(_3DSTATE_VERTEX_TRANSFORM); OUT_BATCH(DISABLE_VIEWPORT_TRANSFORM | DISABLE_PERSPECTIVE_DIVIDE); OUT_BATCH(_3DSTATE_W_STATE_CMD); OUT_BATCH(MAGIC_W_STATE_DWORD1); OUT_BATCH(0x3f800000 /* 1.0 in IEEE float */ ); OUT_BATCH(_3DSTATE_INDPT_ALPHA_BLEND_CMD | DISABLE_INDPT_ALPHA_BLEND | ENABLE_ALPHA_BLENDFUNC | ABLENDFUNC_ADD); OUT_BATCH(_3DSTATE_CONST_BLEND_COLOR_CMD); OUT_BATCH(0); OUT_BATCH(_3DSTATE_MODES_1_CMD | ENABLE_COLR_BLND_FUNC | BLENDFUNC_ADD | ENABLE_SRC_BLND_FACTOR | SRC_BLND_FACT(BLENDFACTOR_ONE) | ENABLE_DST_BLND_FACTOR | DST_BLND_FACT(BLENDFACTOR_ZERO)); OUT_BATCH(_3DSTATE_ENABLES_1_CMD | DISABLE_LOGIC_OP | DISABLE_STENCIL_TEST | DISABLE_DEPTH_BIAS | DISABLE_SPEC_ADD | DISABLE_FOG | DISABLE_ALPHA_TEST | DISABLE_DEPTH_TEST | ENABLE_COLOR_BLEND); OUT_BATCH(_3DSTATE_ENABLES_2_CMD | DISABLE_STENCIL_WRITE | DISABLE_DITHER | DISABLE_DEPTH_WRITE | ENABLE_COLOR_MASK | ENABLE_COLOR_WRITE | ENABLE_TEX_CACHE); } static void gen2_emit_target(struct intel_batchbuffer *batch, struct scratch_buf *dst) { uint32_t tiling; tiling = 0; if (dst->tiling != I915_TILING_NONE) tiling = BUF_3D_TILED_SURFACE; if (dst->tiling == I915_TILING_Y) tiling |= BUF_3D_TILE_WALK_Y; OUT_BATCH(_3DSTATE_BUF_INFO_CMD); OUT_BATCH(BUF_3D_ID_COLOR_BACK | tiling | BUF_3D_PITCH(dst->stride)); OUT_RELOC(dst->bo, I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER, 0); OUT_BATCH(_3DSTATE_DST_BUF_VARS_CMD); OUT_BATCH(COLR_BUF_ARGB8888 | DSTORG_HORT_BIAS(0x8) | DSTORG_VERT_BIAS(0x8)); OUT_BATCH(_3DSTATE_DRAW_RECT_CMD); OUT_BATCH(0); OUT_BATCH(0); /* ymin, xmin */ OUT_BATCH(DRAW_YMAX(buf_height(dst) - 1) | DRAW_XMAX(buf_width(dst) - 1)); OUT_BATCH(0); /* yorig, xorig */ } static void gen2_emit_texture(struct intel_batchbuffer *batch, struct scratch_buf *src, int unit) { uint32_t tiling; tiling = 0; if (src->tiling != I915_TILING_NONE) tiling = TM0S1_TILED_SURFACE; if (src->tiling == I915_TILING_Y) tiling |= TM0S1_TILE_WALK; OUT_BATCH(_3DSTATE_LOAD_STATE_IMMEDIATE_2 | LOAD_TEXTURE_MAP(unit) | 4); OUT_RELOC(src->bo, I915_GEM_DOMAIN_SAMPLER, 0, 0); OUT_BATCH((buf_height(src) - 1) << TM0S1_HEIGHT_SHIFT | (buf_width(src) - 1) << TM0S1_WIDTH_SHIFT | MAPSURF_32BIT | MT_32BIT_ARGB8888 | tiling); OUT_BATCH((src->stride / 4 - 1) << TM0S2_PITCH_SHIFT | TM0S2_MAP_2D); OUT_BATCH(FILTER_NEAREST << TM0S3_MAG_FILTER_SHIFT | FILTER_NEAREST << TM0S3_MIN_FILTER_SHIFT | MIPFILTER_NONE << TM0S3_MIP_FILTER_SHIFT); OUT_BATCH(0); /* default color */ OUT_BATCH(_3DSTATE_MAP_COORD_SET_CMD | TEXCOORD_SET(unit) | ENABLE_TEXCOORD_PARAMS | TEXCOORDS_ARE_NORMAL | TEXCOORDTYPE_CARTESIAN | ENABLE_ADDR_V_CNTL | TEXCOORD_ADDR_V_MODE(TEXCOORDMODE_CLAMP_BORDER) | ENABLE_ADDR_U_CNTL | TEXCOORD_ADDR_U_MODE(TEXCOORDMODE_CLAMP_BORDER)); } static void gen2_emit_copy_pipeline(struct intel_batchbuffer *batch) { OUT_BATCH(_3DSTATE_INDPT_ALPHA_BLEND_CMD | DISABLE_INDPT_ALPHA_BLEND); OUT_BATCH(_3DSTATE_ENABLES_1_CMD | DISABLE_LOGIC_OP | DISABLE_STENCIL_TEST | DISABLE_DEPTH_BIAS | DISABLE_SPEC_ADD | DISABLE_FOG | DISABLE_ALPHA_TEST | DISABLE_COLOR_BLEND | DISABLE_DEPTH_TEST); OUT_BATCH(_3DSTATE_LOAD_STATE_IMMEDIATE_2 | LOAD_TEXTURE_BLEND_STAGE(0) | 1); OUT_BATCH(TB0C_LAST_STAGE | TB0C_RESULT_SCALE_1X | TB0C_OUTPUT_WRITE_CURRENT | TB0C_OP_ARG1 | TB0C_ARG1_SEL_TEXEL0); OUT_BATCH(TB0A_RESULT_SCALE_1X | TB0A_OUTPUT_WRITE_CURRENT | TB0A_OP_ARG1 | TB0A_ARG1_SEL_TEXEL0); } void gen2_render_copyfunc(struct intel_batchbuffer *batch, struct scratch_buf *src, unsigned src_x, unsigned src_y, unsigned width, unsigned height, struct scratch_buf *dst, unsigned dst_x, unsigned dst_y) { gen2_emit_invariant(batch); gen2_emit_copy_pipeline(batch); gen2_emit_target(batch, dst); gen2_emit_texture(batch, src, 0); OUT_BATCH(_3DSTATE_LOAD_STATE_IMMEDIATE_1 | I1_LOAD_S(2) | I1_LOAD_S(3) | I1_LOAD_S(8) | 2); OUT_BATCH(1<<12); OUT_BATCH(S3_CULLMODE_NONE | S3_VERTEXHAS_XY); OUT_BATCH(S8_ENABLE_COLOR_BUFFER_WRITE); OUT_BATCH(_3DSTATE_VERTEX_FORMAT_2_CMD | TEXCOORDFMT_2D << 0); OUT_BATCH(PRIM3D_INLINE | PRIM3D_RECTLIST | (3*4 -1)); emit_vertex(batch, dst_x + width); emit_vertex(batch, dst_y + height); emit_vertex_normalized(batch, src_x + width, buf_width(src)); emit_vertex_normalized(batch, src_y + height, buf_height(src)); emit_vertex(batch, dst_x); emit_vertex(batch, dst_y + height); emit_vertex_normalized(batch, src_x, buf_width(src)); emit_vertex_normalized(batch, src_y + height, buf_height(src)); emit_vertex(batch, dst_x); emit_vertex(batch, dst_y); emit_vertex_normalized(batch, src_x, buf_width(src)); emit_vertex_normalized(batch, src_y, buf_height(src)); intel_batchbuffer_flush(batch); } intel-gpu-tools-1.3/lib/intel_batchbuffer.c0000664000175100017510000001462312004013767015732 00000000000000/************************************************************************** * * Copyright 2006 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sub license, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial portions * of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * **************************************************************************/ #include #include #include #include #include #include "drm.h" #include "drmtest.h" #include "intel_batchbuffer.h" #include "intel_bufmgr.h" #include "intel_chipset.h" #include "intel_reg.h" #include void intel_batchbuffer_reset(struct intel_batchbuffer *batch) { if (batch->bo != NULL) { drm_intel_bo_unreference(batch->bo); batch->bo = NULL; } batch->bo = drm_intel_bo_alloc(batch->bufmgr, "batchbuffer", BATCH_SZ, 4096); batch->ptr = batch->buffer; } struct intel_batchbuffer * intel_batchbuffer_alloc(drm_intel_bufmgr *bufmgr, uint32_t devid) { struct intel_batchbuffer *batch = calloc(sizeof(*batch), 1); batch->bufmgr = bufmgr; batch->devid = devid; intel_batchbuffer_reset(batch); return batch; } void intel_batchbuffer_free(struct intel_batchbuffer *batch) { drm_intel_bo_unreference(batch->bo); batch->bo = NULL; free(batch); } #define CMD_POLY_STIPPLE_OFFSET 0x7906 static unsigned int flush_on_ring_common(struct intel_batchbuffer *batch, int ring) { unsigned int used = batch->ptr - batch->buffer; if (used == 0) return 0; if (IS_GEN5(batch->devid)) { /* emit gen5 w/a without batch space checks - we reserve that * already. */ *(uint32_t *) (batch->ptr) = CMD_POLY_STIPPLE_OFFSET << 16; *(uint32_t *) (batch->ptr) = 0; batch->ptr += 8; } /* Round batchbuffer usage to 2 DWORDs. */ if ((used & 4) == 0) { *(uint32_t *) (batch->ptr) = 0; /* noop */ batch->ptr += 4; } /* Mark the end of the buffer. */ *(uint32_t *)(batch->ptr) = MI_BATCH_BUFFER_END; /* noop */ batch->ptr += 4; return batch->ptr - batch->buffer; } void intel_batchbuffer_flush_on_ring(struct intel_batchbuffer *batch, int ring) { unsigned int used = flush_on_ring_common(batch, ring); if (used == 0) return; do_or_die(drm_intel_bo_subdata(batch->bo, 0, used, batch->buffer)); batch->ptr = NULL; do_or_die(drm_intel_bo_mrb_exec(batch->bo, used, NULL, 0, 0, ring)); intel_batchbuffer_reset(batch); } void intel_batchbuffer_flush_with_context(struct intel_batchbuffer *batch, drm_intel_context *context) { int ret; unsigned int used = flush_on_ring_common(batch, I915_EXEC_RENDER); if (used == 0) return; ret = drm_intel_bo_subdata(batch->bo, 0, used, batch->buffer); assert(ret == 0); batch->ptr = NULL; ret = drm_intel_gem_bo_context_exec(batch->bo, context, used, I915_EXEC_RENDER); assert(ret == 0); intel_batchbuffer_reset(batch); } void intel_batchbuffer_flush(struct intel_batchbuffer *batch) { int ring = 0; if (HAS_BLT_RING(batch->devid)) ring = I915_EXEC_BLT; intel_batchbuffer_flush_on_ring(batch, ring); } /* This is the only way buffers get added to the validate list. */ void intel_batchbuffer_emit_reloc(struct intel_batchbuffer *batch, drm_intel_bo *buffer, uint32_t delta, uint32_t read_domains, uint32_t write_domain, int fenced) { int ret; if (batch->ptr - batch->buffer > BATCH_SZ) printf("bad relocation ptr %p map %p offset %d size %d\n", batch->ptr, batch->buffer, (int)(batch->ptr - batch->buffer), BATCH_SZ); if (fenced) ret = drm_intel_bo_emit_reloc_fence(batch->bo, batch->ptr - batch->buffer, buffer, delta, read_domains, write_domain); else ret = drm_intel_bo_emit_reloc(batch->bo, batch->ptr - batch->buffer, buffer, delta, read_domains, write_domain); intel_batchbuffer_emit_dword(batch, buffer->offset + delta); assert(ret == 0); } void intel_batchbuffer_data(struct intel_batchbuffer *batch, const void *data, unsigned int bytes) { assert((bytes & 3) == 0); intel_batchbuffer_require_space(batch, bytes); memcpy(batch->ptr, data, bytes); batch->ptr += bytes; } void intel_copy_bo(struct intel_batchbuffer *batch, drm_intel_bo *dst_bo, drm_intel_bo *src_bo, int width, int height) { uint32_t src_tiling, dst_tiling, swizzle; uint32_t src_pitch, dst_pitch; uint32_t cmd_bits = 0; drm_intel_bo_get_tiling(src_bo, &src_tiling, &swizzle); drm_intel_bo_get_tiling(dst_bo, &dst_tiling, &swizzle); src_pitch = width * 4; if (IS_965(batch->devid) && src_tiling != I915_TILING_NONE) { src_pitch /= 4; cmd_bits |= XY_SRC_COPY_BLT_SRC_TILED; } dst_pitch = width * 4; if (IS_965(batch->devid) && dst_tiling != I915_TILING_NONE) { dst_pitch /= 4; cmd_bits |= XY_SRC_COPY_BLT_DST_TILED; } BEGIN_BATCH(8); OUT_BATCH(XY_SRC_COPY_BLT_CMD | XY_SRC_COPY_BLT_WRITE_ALPHA | XY_SRC_COPY_BLT_WRITE_RGB | cmd_bits); OUT_BATCH((3 << 24) | /* 32 bits */ (0xcc << 16) | /* copy ROP */ dst_pitch); OUT_BATCH(0); /* dst x1,y1 */ OUT_BATCH((height << 16) | width); /* dst x2,y2 */ OUT_RELOC(dst_bo, I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER, 0); OUT_BATCH(0); /* src x1,y1 */ OUT_BATCH(src_pitch); OUT_RELOC(src_bo, I915_GEM_DOMAIN_RENDER, 0, 0); ADVANCE_BATCH(); intel_batchbuffer_flush(batch); } void intel_batchbuffer_emit_mi_flush(struct intel_batchbuffer *batch) { intel_batchbuffer_require_space(batch, 4); intel_batchbuffer_emit_dword(batch, MI_FLUSH); } intel-gpu-tools-1.3/lib/drmtest.c0000644000175100017510000004067312004237424013746 00000000000000/* * Copyright © 2007, 2011 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Eric Anholt * Daniel Vetter * */ #define _GNU_SOURCE #include #include #include #include #include #include #include #include #include #include "drmtest.h" #include "i915_drm.h" #include "intel_chipset.h" #include "intel_gpu_tools.h" /* This file contains a bunch of wrapper functions to directly use gem ioctls. * Mostly useful to write kernel tests. */ static int is_intel(int fd) { struct drm_i915_getparam gp; int devid; gp.param = I915_PARAM_CHIPSET_ID; gp.value = &devid; if (ioctl(fd, DRM_IOCTL_I915_GETPARAM, &gp, sizeof(gp))) return 0; return IS_INTEL(devid); } bool gem_uses_aliasing_ppgtt(int fd) { struct drm_i915_getparam gp; int val; gp.param = 18; /* HAS_ALIASING_PPGTT */ gp.value = &val; if (ioctl(fd, DRM_IOCTL_I915_GETPARAM, &gp, sizeof(gp))) return 0; return val; } int gem_available_fences(int fd) { struct drm_i915_getparam gp; int val; gp.param = I915_PARAM_NUM_FENCES_AVAIL; gp.value = &val; if (ioctl(fd, DRM_IOCTL_I915_GETPARAM, &gp, sizeof(gp))) return 0; return val; } /* Ensure the gpu is idle by launching a nop execbuf and stalling for it. */ void gem_quiescent_gpu(int fd) { uint32_t batch[2] = {MI_BATCH_BUFFER_END, 0}; uint32_t handle; struct drm_i915_gem_execbuffer2 execbuf; struct drm_i915_gem_exec_object2 gem_exec[1]; handle = gem_create(fd, 4096); gem_write(fd, handle, 0, batch, sizeof(batch)); gem_exec[0].handle = handle; gem_exec[0].relocation_count = 0; gem_exec[0].relocs_ptr = 0; gem_exec[0].alignment = 0; gem_exec[0].offset = 0; gem_exec[0].flags = 0; gem_exec[0].rsvd1 = 0; gem_exec[0].rsvd2 = 0; execbuf.buffers_ptr = (uintptr_t)gem_exec; execbuf.buffer_count = 1; execbuf.batch_start_offset = 0; execbuf.batch_len = 8; execbuf.cliprects_ptr = 0; execbuf.num_cliprects = 0; execbuf.DR1 = 0; execbuf.DR4 = 0; execbuf.flags = 0; i915_execbuffer2_set_context_id(execbuf, 0); execbuf.rsvd2 = 0; do_ioctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, &execbuf); gem_sync(fd, handle); } static bool is_master(int fd) { drm_client_t client; int ret; /* Check that we're the only opener and authed. */ client.idx = 0; ret = ioctl(fd, DRM_IOCTL_GET_CLIENT, &client); assert (ret == 0); if (!client.auth) { return 0; } client.idx = 1; ret = ioctl(fd, DRM_IOCTL_GET_CLIENT, &client); if (ret != -1 || errno != EINVAL) { return 0; } return 1; } /** * drm_get_card() - get an intel card number for use in /dev or /sys * * @master: -1 not a master, 0 don't care, 1 is the master * * returns -1 on error */ int drm_get_card(int master) { char *name; int i, fd; for (i = 0; i < 16; i++) { int ret; ret = asprintf(&name, "/dev/dri/card%u", i); if (ret == -1) return -1; fd = open(name, O_RDWR); free(name); if (fd == -1) continue; if (is_intel(fd) && master == 0) { gem_quiescent_gpu(fd); close(fd); break; } if (master == 1 && is_master(fd)) { close(fd); break; } if (master == -1 && !is_master(fd)) { close(fd); break; } close(fd); } return i; } /** Open the first DRM device we can find, searching up to 16 device nodes */ int drm_open_any(void) { char *name; int ret, fd; ret = asprintf(&name, "/dev/dri/card%d", drm_get_card(0)); if (ret == -1) return -1; fd = open(name, O_RDWR); free(name); if (fd == -1) fprintf(stderr, "failed to open any drm device. retry as root?\n"); assert(is_intel(fd)); return fd; } /** * Open the first DRM device we can find where we end up being the master. */ int drm_open_any_master(void) { char *name; int ret, fd; ret = asprintf(&name, "/dev/dri/card%d", drm_get_card(1)); if (ret == -1) return -1; fd = open(name, O_RDWR); free(name); if (fd == -1) fprintf(stderr, "Couldn't find an un-controlled DRM device\n"); assert(is_intel(fd)); return fd; } void gem_set_tiling(int fd, uint32_t handle, int tiling, int stride) { struct drm_i915_gem_set_tiling st; int ret; memset(&st, 0, sizeof(st)); do { st.handle = handle; st.tiling_mode = tiling; st.stride = tiling ? stride : 0; ret = ioctl(fd, DRM_IOCTL_I915_GEM_SET_TILING, &st); } while (ret == -1 && (errno == EINTR || errno == EAGAIN)); assert(ret == 0); assert(st.tiling_mode == tiling); } void gem_close(int fd, uint32_t handle) { struct drm_gem_close close_bo; close_bo.handle = handle; do_ioctl(fd, DRM_IOCTL_GEM_CLOSE, &close_bo); } void gem_write(int fd, uint32_t handle, uint32_t offset, const void *buf, uint32_t size) { struct drm_i915_gem_pwrite gem_pwrite; gem_pwrite.handle = handle; gem_pwrite.offset = offset; gem_pwrite.size = size; gem_pwrite.data_ptr = (uintptr_t)buf; do_ioctl(fd, DRM_IOCTL_I915_GEM_PWRITE, &gem_pwrite); } void gem_read(int fd, uint32_t handle, uint32_t offset, void *buf, uint32_t length) { struct drm_i915_gem_pread gem_pread; gem_pread.handle = handle; gem_pread.offset = offset; gem_pread.size = length; gem_pread.data_ptr = (uintptr_t)buf; do_ioctl(fd, DRM_IOCTL_I915_GEM_PREAD, &gem_pread); } void gem_set_domain(int fd, uint32_t handle, uint32_t read_domains, uint32_t write_domain) { struct drm_i915_gem_set_domain set_domain; set_domain.handle = handle; set_domain.read_domains = read_domains; set_domain.write_domain = write_domain; do_ioctl(fd, DRM_IOCTL_I915_GEM_SET_DOMAIN, &set_domain); } void gem_sync(int fd, uint32_t handle) { gem_set_domain(fd, handle, I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT); } uint32_t gem_create(int fd, int size) { struct drm_i915_gem_create create; create.handle = 0; create.size = size; do_ioctl(fd, DRM_IOCTL_I915_GEM_CREATE, &create); assert(create.handle); return create.handle; } void *gem_mmap__gtt(int fd, uint32_t handle, int size, int prot) { struct drm_i915_gem_mmap_gtt mmap_arg; void *ptr; mmap_arg.handle = handle; if (drmIoctl(fd, DRM_IOCTL_I915_GEM_MMAP_GTT, &mmap_arg)) return NULL; ptr = mmap64(0, size, prot, MAP_SHARED, fd, mmap_arg.offset); if (ptr == MAP_FAILED) ptr = NULL; return ptr; } void *gem_mmap__cpu(int fd, uint32_t handle, int size, int prot) { struct drm_i915_gem_mmap mmap_arg; mmap_arg.handle = handle; mmap_arg.offset = 0; mmap_arg.size = size; if (drmIoctl(fd, DRM_IOCTL_I915_GEM_MMAP, &mmap_arg)) return NULL; return (void *)(uintptr_t)mmap_arg.addr_ptr; } uint64_t gem_aperture_size(int fd) { struct drm_i915_gem_get_aperture aperture; aperture.aper_size = 256*1024*1024; do_ioctl(fd, DRM_IOCTL_I915_GEM_GET_APERTURE, &aperture); return aperture.aper_size; } uint64_t gem_mappable_aperture_size(void) { struct pci_device *pci_dev; int bar; pci_dev = intel_get_pci_device(); if (intel_gen(pci_dev->device_id) < 3) bar = 0; else bar = 2; return pci_dev->regions[bar].size; } int gem_madvise(int fd, uint32_t handle, int state) { struct drm_i915_gem_madvise madv; madv.handle = handle; madv.madv = state; madv.retained = 1; do_ioctl(fd, DRM_IOCTL_I915_GEM_MADVISE, &madv); return madv.retained; } /* prime */ int prime_handle_to_fd(int fd, uint32_t handle) { struct drm_prime_handle args; args.handle = handle; args.flags = DRM_CLOEXEC; args.fd = -1; do_ioctl(fd, DRM_IOCTL_PRIME_HANDLE_TO_FD, &args); return args.fd; } uint32_t prime_fd_to_handle(int fd, int dma_buf_fd) { struct drm_prime_handle args; args.fd = dma_buf_fd; args.flags = 0; args.handle = 0; do_ioctl(fd, DRM_IOCTL_PRIME_FD_TO_HANDLE, &args); return args.handle; } /* signal interrupt helpers */ static pid_t signal_helper = -1; long long int sig_stat; static void signal_helper_process(pid_t pid) { /* Interrupt the parent process at 500Hz, just to be annoying */ while (1) { usleep(1000 * 1000 / 500); if (kill(pid, SIGUSR1)) /* Parent has died, so must we. */ exit(0); } } static void sig_handler(int i) { sig_stat++; } void drmtest_fork_signal_helper(void) { pid_t pid; signal(SIGUSR1, sig_handler); pid = fork(); if (pid == 0) { signal_helper_process(getppid()); return; } signal_helper = pid; } void drmtest_stop_signal_helper(void) { if (signal_helper != -1) kill(signal_helper, SIGQUIT); if (sig_stat) fprintf(stderr, "signal handler called %llu times\n", sig_stat); signal_helper = -1; } /* other helpers */ void drmtest_exchange_int(void *array, unsigned i, unsigned j) { int *int_arr, tmp; int_arr = array; tmp = int_arr[i]; int_arr[i] = int_arr[j]; int_arr[j] = tmp; } void drmtest_permute_array(void *array, unsigned size, void (*exchange_func)(void *array, unsigned i, unsigned j)) { int i; for (i = size - 1; i > 1; i--) { /* yes, not perfectly uniform, who cares */ long l = random() % (i +1); if (i != l) exchange_func(array, i, l); } } void drmtest_progress(const char *header, uint64_t i, uint64_t total) { if (i+1 >= total) { fprintf(stderr, "\r%s100%%\n", header); return; } /* only bother updating about every 0.5% */ if (i % (total / 200) == 0 || i+1 >= total) { fprintf(stderr, "\r%s%3llu%%", header, (long long unsigned) i * 100 / total); } } /* mappable aperture trasher helper */ drm_intel_bo **trash_bos; int num_trash_bos; void drmtest_init_aperture_trashers(drm_intel_bufmgr *bufmgr) { int i; num_trash_bos = gem_mappable_aperture_size() / (1024*1024); trash_bos = malloc(num_trash_bos * sizeof(drm_intel_bo *)); assert(trash_bos); for (i = 0; i < num_trash_bos; i++) trash_bos[i] = drm_intel_bo_alloc(bufmgr, "trash bo", 1024*1024, 4096); } void drmtest_trash_aperture(void) { int i; uint8_t *gtt_ptr; for (i = 0; i < num_trash_bos; i++) { drm_intel_gem_bo_map_gtt(trash_bos[i]); gtt_ptr = trash_bos[i]->virtual; *gtt_ptr = 0; drm_intel_gem_bo_unmap_gtt(trash_bos[i]); } } void drmtest_cleanup_aperture_trashers(void) { int i; for (i = 0; i < num_trash_bos; i++) drm_intel_bo_unreference(trash_bos[i]); free(trash_bos); } /* helpers to create nice-looking framebuffers */ static cairo_surface_t * paint_allocate_surface(int fd, int width, int height, int depth, int bpp, bool tiled, struct kmstest_fb *fb_info) { cairo_format_t format; struct drm_i915_gem_set_tiling set_tiling; int size; unsigned stride; uint32_t *fb_ptr; if (tiled) { int v; /* Round the tiling up to the next power-of-two and the * region up to the next pot fence size so that this works * on all generations. * * This can still fail if the framebuffer is too large to * be tiled. But then that failure is expected. */ v = width * bpp / 8; for (stride = 512; stride < v; stride *= 2) ; v = stride * height; for (size = 1024*1024; size < v; size *= 2) ; } else { /* Scan-out has a 64 byte alignment restriction */ stride = (width * (bpp / 8) + 63) & ~63; size = stride * height; } switch (depth) { case 16: format = CAIRO_FORMAT_RGB16_565; break; case 24: format = CAIRO_FORMAT_RGB24; break; #if 0 case 30: format = CAIRO_FORMAT_RGB30; break; #endif case 32: format = CAIRO_FORMAT_ARGB32; break; default: fprintf(stderr, "bad depth %d\n", depth); return NULL; } assert (bpp >= depth); fb_info->gem_handle = gem_create(fd, size); if (tiled) { set_tiling.handle = fb_info->gem_handle; set_tiling.tiling_mode = I915_TILING_X; set_tiling.stride = stride; if (ioctl(fd, DRM_IOCTL_I915_GEM_SET_TILING, &set_tiling)) { fprintf(stderr, "set tiling failed: %s (stride=%d, size=%d)\n", strerror(errno), stride, size); return NULL; } } fb_ptr = gem_mmap(fd, fb_info->gem_handle, size, PROT_READ | PROT_WRITE); fb_info->stride = stride; fb_info->size = size; return cairo_image_surface_create_for_data((unsigned char *)fb_ptr, format, width, height, stride); } static void paint_color_gradient(cairo_t *cr, int x, int y, int w, int h, int r, int g, int b) { cairo_pattern_t *pat; pat = cairo_pattern_create_linear(x, y, x + w, y + h); cairo_pattern_add_color_stop_rgba(pat, 1, 0, 0, 0, 1); cairo_pattern_add_color_stop_rgba(pat, 0, r, g, b, 1); cairo_rectangle(cr, x, y, w, h); cairo_set_source(cr, pat); cairo_fill(cr); cairo_pattern_destroy(pat); } static void paint_test_patterns(cairo_t *cr, int width, int height) { double gr_height, gr_width; int x, y; y = height * 0.10; gr_width = width * 0.75; gr_height = height * 0.08; x = (width / 2) - (gr_width / 2); paint_color_gradient(cr, x, y, gr_width, gr_height, 1, 0, 0); y += gr_height; paint_color_gradient(cr, x, y, gr_width, gr_height, 0, 1, 0); y += gr_height; paint_color_gradient(cr, x, y, gr_width, gr_height, 0, 0, 1); y += gr_height; paint_color_gradient(cr, x, y, gr_width, gr_height, 1, 1, 1); } enum corner { topleft, topright, bottomleft, bottomright, }; static void paint_marker(cairo_t *cr, int x, int y, char *str, enum corner text_location) { cairo_text_extents_t extents; int xoff, yoff; cairo_set_font_size(cr, 18); cairo_text_extents(cr, str, &extents); switch (text_location) { case topleft: xoff = -20; xoff -= extents.width; yoff = -20; break; case topright: xoff = 20; yoff = -20; break; case bottomleft: xoff = -20; xoff -= extents.width; yoff = 20; break; case bottomright: xoff = 20; yoff = 20; break; default: xoff = 0; yoff = 0; } cairo_move_to(cr, x, y - 20); cairo_line_to(cr, x, y + 20); cairo_move_to(cr, x - 20, y); cairo_line_to(cr, x + 20, y); cairo_new_sub_path(cr); cairo_arc(cr, x, y, 10, 0, M_PI * 2); cairo_set_line_width(cr, 4); cairo_set_source_rgb(cr, 0, 0, 0); cairo_stroke_preserve(cr); cairo_set_source_rgb(cr, 1, 1, 1); cairo_set_line_width(cr, 2); cairo_stroke(cr); cairo_move_to(cr, x + xoff, y + yoff); cairo_text_path(cr, str); cairo_set_source_rgb(cr, 0, 0, 0); cairo_stroke_preserve(cr); cairo_set_source_rgb(cr, 1, 1, 1); cairo_fill(cr); } unsigned int kmstest_create_fb(int fd, int width, int height, int bpp, int depth, bool tiled, struct kmstest_fb *fb_info, kmstest_paint_func paint_func, void *func_arg) { cairo_surface_t *surface; cairo_status_t status; cairo_t *cr; char buf[128]; int ret; unsigned int fb_id; surface = paint_allocate_surface(fd, width, height, depth, bpp, tiled, fb_info); assert(surface); cr = cairo_create(surface); paint_test_patterns(cr, width, height); cairo_set_line_cap(cr, CAIRO_LINE_CAP_SQUARE); /* Paint corner markers */ snprintf(buf, sizeof buf, "(%d, %d)", 0, 0); paint_marker(cr, 0, 0, buf, bottomright); snprintf(buf, sizeof buf, "(%d, %d)", width, 0); paint_marker(cr, width, 0, buf, bottomleft); snprintf(buf, sizeof buf, "(%d, %d)", 0, height); paint_marker(cr, 0, height, buf, topright); snprintf(buf, sizeof buf, "(%d, %d)", width, height); paint_marker(cr, width, height, buf, topleft); if (paint_func) paint_func(cr, width, height, func_arg); status = cairo_status(cr); assert(!status); cairo_destroy(cr); ret = drmModeAddFB(fd, width, height, depth, bpp, fb_info->stride, fb_info->gem_handle, &fb_id); assert(ret == 0); cairo_surface_destroy(surface); fb_info->fb_id = fb_id; return fb_id; } void kmstest_dump_mode(drmModeModeInfo *mode) { printf(" %s %d %d %d %d %d %d %d %d %d 0x%x 0x%x %d\n", mode->name, mode->vrefresh, mode->hdisplay, mode->hsync_start, mode->hsync_end, mode->htotal, mode->vdisplay, mode->vsync_start, mode->vsync_end, mode->vtotal, mode->flags, mode->type, mode->clock); fflush(stdout); } intel-gpu-tools-1.3/lib/i915_3d.h0000664000175100017510000005522111566027747013364 00000000000000/* -*- c-basic-offset: 4 -*- */ /* * Copyright © 2006,2010 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * * Authors: * Eric Anholt * Chris Wilson * */ /* Each instruction is 3 dwords long, though most don't require all * this space. Maximum of 123 instructions. Smaller maxes per insn * type. */ #define _3DSTATE_PIXEL_SHADER_PROGRAM (CMD_3D|(0x1d<<24)|(0x5<<16)) #define REG_TYPE_R 0 /* temporary regs, no need to * dcl, must be written before * read -- Preserved between * phases. */ #define REG_TYPE_T 1 /* Interpolated values, must be * dcl'ed before use. * * 0..7: texture coord, * 8: diffuse spec, * 9: specular color, * 10: fog parameter in w. */ #define REG_TYPE_CONST 2 /* Restriction: only one const * can be referenced per * instruction, though it may be * selected for multiple inputs. * Constants not initialized * default to zero. */ #define REG_TYPE_S 3 /* sampler */ #define REG_TYPE_OC 4 /* output color (rgba) */ #define REG_TYPE_OD 5 /* output depth (w), xyz are * temporaries. If not written, * interpolated depth is used? */ #define REG_TYPE_U 6 /* unpreserved temporaries */ #define REG_TYPE_MASK 0x7 #define REG_TYPE_SHIFT 4 #define REG_NR_MASK 0xf /* REG_TYPE_T: */ #define T_TEX0 0 #define T_TEX1 1 #define T_TEX2 2 #define T_TEX3 3 #define T_TEX4 4 #define T_TEX5 5 #define T_TEX6 6 #define T_TEX7 7 #define T_DIFFUSE 8 #define T_SPECULAR 9 #define T_FOG_W 10 /* interpolated fog is in W coord */ /* Arithmetic instructions */ /* .replicate_swizzle == selection and replication of a particular * scalar channel, ie., .xxxx, .yyyy, .zzzz or .wwww */ #define A0_NOP (0x0<<24) /* no operation */ #define A0_ADD (0x1<<24) /* dst = src0 + src1 */ #define A0_MOV (0x2<<24) /* dst = src0 */ #define A0_MUL (0x3<<24) /* dst = src0 * src1 */ #define A0_MAD (0x4<<24) /* dst = src0 * src1 + src2 */ #define A0_DP2ADD (0x5<<24) /* dst.xyzw = src0.xy dot src1.xy + src2.replicate_swizzle */ #define A0_DP3 (0x6<<24) /* dst.xyzw = src0.xyz dot src1.xyz */ #define A0_DP4 (0x7<<24) /* dst.xyzw = src0.xyzw dot src1.xyzw */ #define A0_FRC (0x8<<24) /* dst = src0 - floor(src0) */ #define A0_RCP (0x9<<24) /* dst.xyzw = 1/(src0.replicate_swizzle) */ #define A0_RSQ (0xa<<24) /* dst.xyzw = 1/(sqrt(abs(src0.replicate_swizzle))) */ #define A0_EXP (0xb<<24) /* dst.xyzw = exp2(src0.replicate_swizzle) */ #define A0_LOG (0xc<<24) /* dst.xyzw = log2(abs(src0.replicate_swizzle)) */ #define A0_CMP (0xd<<24) /* dst = (src0 >= 0.0) ? src1 : src2 */ #define A0_MIN (0xe<<24) /* dst = (src0 < src1) ? src0 : src1 */ #define A0_MAX (0xf<<24) /* dst = (src0 >= src1) ? src0 : src1 */ #define A0_FLR (0x10<<24) /* dst = floor(src0) */ #define A0_MOD (0x11<<24) /* dst = src0 fmod 1.0 */ #define A0_TRC (0x12<<24) /* dst = int(src0) */ #define A0_SGE (0x13<<24) /* dst = src0 >= src1 ? 1.0 : 0.0 */ #define A0_SLT (0x14<<24) /* dst = src0 < src1 ? 1.0 : 0.0 */ #define A0_DEST_SATURATE (1<<22) #define A0_DEST_TYPE_SHIFT 19 /* Allow: R, OC, OD, U */ #define A0_DEST_NR_SHIFT 14 /* Allow R: 0..15, OC,OD: 0..0, U: 0..2 */ #define A0_DEST_CHANNEL_X (1<<10) #define A0_DEST_CHANNEL_Y (2<<10) #define A0_DEST_CHANNEL_Z (4<<10) #define A0_DEST_CHANNEL_W (8<<10) #define A0_DEST_CHANNEL_ALL (0xf<<10) #define A0_DEST_CHANNEL_SHIFT 10 #define A0_SRC0_TYPE_SHIFT 7 #define A0_SRC0_NR_SHIFT 2 #define A0_DEST_CHANNEL_XY (A0_DEST_CHANNEL_X|A0_DEST_CHANNEL_Y) #define A0_DEST_CHANNEL_XYZ (A0_DEST_CHANNEL_XY|A0_DEST_CHANNEL_Z) #define SRC_X 0 #define SRC_Y 1 #define SRC_Z 2 #define SRC_W 3 #define SRC_ZERO 4 #define SRC_ONE 5 #define A1_SRC0_CHANNEL_X_NEGATE (1<<31) #define A1_SRC0_CHANNEL_X_SHIFT 28 #define A1_SRC0_CHANNEL_Y_NEGATE (1<<27) #define A1_SRC0_CHANNEL_Y_SHIFT 24 #define A1_SRC0_CHANNEL_Z_NEGATE (1<<23) #define A1_SRC0_CHANNEL_Z_SHIFT 20 #define A1_SRC0_CHANNEL_W_NEGATE (1<<19) #define A1_SRC0_CHANNEL_W_SHIFT 16 #define A1_SRC1_TYPE_SHIFT 13 #define A1_SRC1_NR_SHIFT 8 #define A1_SRC1_CHANNEL_X_NEGATE (1<<7) #define A1_SRC1_CHANNEL_X_SHIFT 4 #define A1_SRC1_CHANNEL_Y_NEGATE (1<<3) #define A1_SRC1_CHANNEL_Y_SHIFT 0 #define A2_SRC1_CHANNEL_Z_NEGATE (1<<31) #define A2_SRC1_CHANNEL_Z_SHIFT 28 #define A2_SRC1_CHANNEL_W_NEGATE (1<<27) #define A2_SRC1_CHANNEL_W_SHIFT 24 #define A2_SRC2_TYPE_SHIFT 21 #define A2_SRC2_NR_SHIFT 16 #define A2_SRC2_CHANNEL_X_NEGATE (1<<15) #define A2_SRC2_CHANNEL_X_SHIFT 12 #define A2_SRC2_CHANNEL_Y_NEGATE (1<<11) #define A2_SRC2_CHANNEL_Y_SHIFT 8 #define A2_SRC2_CHANNEL_Z_NEGATE (1<<7) #define A2_SRC2_CHANNEL_Z_SHIFT 4 #define A2_SRC2_CHANNEL_W_NEGATE (1<<3) #define A2_SRC2_CHANNEL_W_SHIFT 0 /* Texture instructions */ #define T0_TEXLD (0x15<<24) /* Sample texture using predeclared * sampler and address, and output * filtered texel data to destination * register */ #define T0_TEXLDP (0x16<<24) /* Same as texld but performs a * perspective divide of the texture * coordinate .xyz values by .w before * sampling. */ #define T0_TEXLDB (0x17<<24) /* Same as texld but biases the * computed LOD by w. Only S4.6 two's * comp is used. This implies that a * float to fixed conversion is * done. */ #define T0_TEXKILL (0x18<<24) /* Does not perform a sampling * operation. Simply kills the pixel * if any channel of the address * register is < 0.0. */ #define T0_DEST_TYPE_SHIFT 19 /* Allow: R, OC, OD, U */ /* Note: U (unpreserved) regs do not retain their values between * phases (cannot be used for feedback) * * Note: oC and OD registers can only be used as the destination of a * texture instruction once per phase (this is an implementation * restriction). */ #define T0_DEST_NR_SHIFT 14 /* Allow R: 0..15, OC,OD: 0..0, U: 0..2 */ #define T0_SAMPLER_NR_SHIFT 0 /* This field ignored for TEXKILL */ #define T0_SAMPLER_NR_MASK (0xf<<0) #define T1_ADDRESS_REG_TYPE_SHIFT 24 /* Reg to use as texture coord */ /* Allow R, T, OC, OD -- R, OC, OD are 'dependent' reads, new program phase */ #define T1_ADDRESS_REG_NR_SHIFT 17 #define T2_MBZ 0 /* Declaration instructions */ #define D0_DCL (0x19<<24) /* Declare a t (interpolated attrib) * register or an s (sampler) * register. */ #define D0_SAMPLE_TYPE_SHIFT 22 #define D0_SAMPLE_TYPE_2D (0x0<<22) #define D0_SAMPLE_TYPE_CUBE (0x1<<22) #define D0_SAMPLE_TYPE_VOLUME (0x2<<22) #define D0_SAMPLE_TYPE_MASK (0x3<<22) #define D0_TYPE_SHIFT 19 /* Allow: T, S */ #define D0_NR_SHIFT 14 /* Allow T: 0..10, S: 0..15 */ #define D0_CHANNEL_X (1<<10) #define D0_CHANNEL_Y (2<<10) #define D0_CHANNEL_Z (4<<10) #define D0_CHANNEL_W (8<<10) #define D0_CHANNEL_ALL (0xf<<10) #define D0_CHANNEL_NONE (0<<10) #define D0_CHANNEL_XY (D0_CHANNEL_X|D0_CHANNEL_Y) #define D0_CHANNEL_XYZ (D0_CHANNEL_XY|D0_CHANNEL_Z) /* I915 Errata: Do not allow (xz), (xw), (xzw) combinations for diffuse * or specular declarations. * * For T dcls, only allow: (x), (xy), (xyz), (w), (xyzw) * * Must be zero for S (sampler) dcls */ #define D1_MBZ 0 #define D2_MBZ 0 /* MASK_* are the unshifted bitmasks of the destination mask in arithmetic * operations */ #define MASK_X 0x1 #define MASK_Y 0x2 #define MASK_Z 0x4 #define MASK_W 0x8 #define MASK_XYZ (MASK_X | MASK_Y | MASK_Z) #define MASK_XYZW (MASK_XYZ | MASK_W) #define MASK_SATURATE 0x10 /* Temporary, undeclared regs. Preserved between phases */ #define FS_R0 ((REG_TYPE_R << REG_TYPE_SHIFT) | 0) #define FS_R1 ((REG_TYPE_R << REG_TYPE_SHIFT) | 1) #define FS_R2 ((REG_TYPE_R << REG_TYPE_SHIFT) | 2) #define FS_R3 ((REG_TYPE_R << REG_TYPE_SHIFT) | 3) /* Texture coordinate regs. Must be declared. */ #define FS_T0 ((REG_TYPE_T << REG_TYPE_SHIFT) | 0) #define FS_T1 ((REG_TYPE_T << REG_TYPE_SHIFT) | 1) #define FS_T2 ((REG_TYPE_T << REG_TYPE_SHIFT) | 2) #define FS_T3 ((REG_TYPE_T << REG_TYPE_SHIFT) | 3) #define FS_T4 ((REG_TYPE_T << REG_TYPE_SHIFT) | 4) #define FS_T5 ((REG_TYPE_T << REG_TYPE_SHIFT) | 5) #define FS_T6 ((REG_TYPE_T << REG_TYPE_SHIFT) | 6) #define FS_T7 ((REG_TYPE_T << REG_TYPE_SHIFT) | 7) #define FS_T8 ((REG_TYPE_T << REG_TYPE_SHIFT) | 8) #define FS_T9 ((REG_TYPE_T << REG_TYPE_SHIFT) | 9) #define FS_T10 ((REG_TYPE_T << REG_TYPE_SHIFT) | 10) /* Constant values */ #define FS_C0 ((REG_TYPE_CONST << REG_TYPE_SHIFT) | 0) #define FS_C1 ((REG_TYPE_CONST << REG_TYPE_SHIFT) | 1) #define FS_C2 ((REG_TYPE_CONST << REG_TYPE_SHIFT) | 2) #define FS_C3 ((REG_TYPE_CONST << REG_TYPE_SHIFT) | 3) #define FS_C4 ((REG_TYPE_CONST << REG_TYPE_SHIFT) | 4) #define FS_C5 ((REG_TYPE_CONST << REG_TYPE_SHIFT) | 5) #define FS_C6 ((REG_TYPE_CONST << REG_TYPE_SHIFT) | 6) #define FS_C7 ((REG_TYPE_CONST << REG_TYPE_SHIFT) | 7) /* Sampler regs */ #define FS_S0 ((REG_TYPE_S << REG_TYPE_SHIFT) | 0) #define FS_S1 ((REG_TYPE_S << REG_TYPE_SHIFT) | 1) #define FS_S2 ((REG_TYPE_S << REG_TYPE_SHIFT) | 2) #define FS_S3 ((REG_TYPE_S << REG_TYPE_SHIFT) | 3) /* Output color */ #define FS_OC ((REG_TYPE_OC << REG_TYPE_SHIFT) | 0) /* Output depth */ #define FS_OD ((REG_TYPE_OD << REG_TYPE_SHIFT) | 0) /* Unpreserved temporary regs */ #define FS_U0 ((REG_TYPE_U << REG_TYPE_SHIFT) | 0) #define FS_U1 ((REG_TYPE_U << REG_TYPE_SHIFT) | 1) #define FS_U2 ((REG_TYPE_U << REG_TYPE_SHIFT) | 2) #define FS_U3 ((REG_TYPE_U << REG_TYPE_SHIFT) | 3) #define X_CHANNEL_SHIFT (REG_TYPE_SHIFT + 3) #define Y_CHANNEL_SHIFT (X_CHANNEL_SHIFT + 4) #define Z_CHANNEL_SHIFT (Y_CHANNEL_SHIFT + 4) #define W_CHANNEL_SHIFT (Z_CHANNEL_SHIFT + 4) #define REG_CHANNEL_MASK 0xf #define REG_NR(reg) ((reg) & REG_NR_MASK) #define REG_TYPE(reg) (((reg) >> REG_TYPE_SHIFT) & REG_TYPE_MASK) #define REG_X(reg) (((reg) >> X_CHANNEL_SHIFT) & REG_CHANNEL_MASK) #define REG_Y(reg) (((reg) >> Y_CHANNEL_SHIFT) & REG_CHANNEL_MASK) #define REG_Z(reg) (((reg) >> Z_CHANNEL_SHIFT) & REG_CHANNEL_MASK) #define REG_W(reg) (((reg) >> W_CHANNEL_SHIFT) & REG_CHANNEL_MASK) enum i915_fs_channel { X_CHANNEL_VAL = 0, Y_CHANNEL_VAL, Z_CHANNEL_VAL, W_CHANNEL_VAL, ZERO_CHANNEL_VAL, ONE_CHANNEL_VAL, NEG_X_CHANNEL_VAL = X_CHANNEL_VAL | 0x8, NEG_Y_CHANNEL_VAL = Y_CHANNEL_VAL | 0x8, NEG_Z_CHANNEL_VAL = Z_CHANNEL_VAL | 0x8, NEG_W_CHANNEL_VAL = W_CHANNEL_VAL | 0x8, NEG_ONE_CHANNEL_VAL = ONE_CHANNEL_VAL | 0x8 }; #define i915_fs_operand(reg, x, y, z, w) \ (reg) | \ (x##_CHANNEL_VAL << X_CHANNEL_SHIFT) | \ (y##_CHANNEL_VAL << Y_CHANNEL_SHIFT) | \ (z##_CHANNEL_VAL << Z_CHANNEL_SHIFT) | \ (w##_CHANNEL_VAL << W_CHANNEL_SHIFT) /** * Construct an operand description for using a register with no swizzling */ #define i915_fs_operand_reg(reg) \ i915_fs_operand(reg, X, Y, Z, W) #define i915_fs_operand_reg_negate(reg) \ i915_fs_operand(reg, NEG_X, NEG_Y, NEG_Z, NEG_W) /** * Returns an operand containing (0.0, 0.0, 0.0, 0.0). */ #define i915_fs_operand_zero() i915_fs_operand(FS_R0, ZERO, ZERO, ZERO, ZERO) /** * Returns an unused operand */ #define i915_fs_operand_none() i915_fs_operand_zero() /** * Returns an operand containing (1.0, 1.0, 1.0, 1.0). */ #define i915_fs_operand_one() i915_fs_operand(FS_R0, ONE, ONE, ONE, ONE) #define i915_get_hardware_channel_val(val, shift, negate) \ (((val & 0x7) << shift) | ((val & 0x8) ? negate : 0)) /** * Outputs a fragment shader command to declare a sampler or texture register. */ #define i915_fs_dcl(reg) \ do { \ OUT_BATCH(D0_DCL | \ (REG_TYPE(reg) << D0_TYPE_SHIFT) | \ (REG_NR(reg) << D0_NR_SHIFT) | \ ((REG_TYPE(reg) != REG_TYPE_S) ? D0_CHANNEL_ALL : 0)); \ OUT_BATCH(0); \ OUT_BATCH(0); \ } while (0) #define i915_fs_texld(dest_reg, sampler_reg, address_reg) \ do { \ OUT_BATCH(T0_TEXLD | \ (REG_TYPE(dest_reg) << T0_DEST_TYPE_SHIFT) | \ (REG_NR(dest_reg) << T0_DEST_NR_SHIFT) | \ (REG_NR(sampler_reg) << T0_SAMPLER_NR_SHIFT)); \ OUT_BATCH((REG_TYPE(address_reg) << T1_ADDRESS_REG_TYPE_SHIFT) | \ (REG_NR(address_reg) << T1_ADDRESS_REG_NR_SHIFT)); \ OUT_BATCH(0); \ } while (0) #define i915_fs_texldp(dest_reg, sampler_reg, address_reg) \ do { \ OUT_BATCH(T0_TEXLDP | \ (REG_TYPE(dest_reg) << T0_DEST_TYPE_SHIFT) | \ (REG_NR(dest_reg) << T0_DEST_NR_SHIFT) | \ (REG_NR(sampler_reg) << T0_SAMPLER_NR_SHIFT)); \ OUT_BATCH((REG_TYPE(address_reg) << T1_ADDRESS_REG_TYPE_SHIFT) | \ (REG_NR(address_reg) << T1_ADDRESS_REG_NR_SHIFT)); \ OUT_BATCH(0); \ } while (0) #define i915_fs_arith_masked(op, dest_reg, dest_mask, operand0, operand1, operand2) \ _i915_fs_arith_masked(A0_##op, dest_reg, dest_mask, operand0, operand1, operand2) #define i915_fs_arith(op, dest_reg, operand0, operand1, operand2) \ _i915_fs_arith(A0_##op, dest_reg, operand0, operand1, operand2) #define _i915_fs_arith_masked(cmd, dest_reg, dest_mask, operand0, operand1, operand2) \ do { \ /* Set up destination register and write mask */ \ OUT_BATCH(cmd | \ (REG_TYPE(dest_reg) << A0_DEST_TYPE_SHIFT) | \ (REG_NR(dest_reg) << A0_DEST_NR_SHIFT) | \ (((dest_mask) & ~MASK_SATURATE) << A0_DEST_CHANNEL_SHIFT) | \ (((dest_mask) & MASK_SATURATE) ? A0_DEST_SATURATE : 0) | \ /* Set up operand 0 */ \ (REG_TYPE(operand0) << A0_SRC0_TYPE_SHIFT) | \ (REG_NR(operand0) << A0_SRC0_NR_SHIFT)); \ OUT_BATCH(i915_get_hardware_channel_val(REG_X(operand0), \ A1_SRC0_CHANNEL_X_SHIFT, \ A1_SRC0_CHANNEL_X_NEGATE) | \ i915_get_hardware_channel_val(REG_Y(operand0), \ A1_SRC0_CHANNEL_Y_SHIFT, \ A1_SRC0_CHANNEL_Y_NEGATE) | \ i915_get_hardware_channel_val(REG_Z(operand0), \ A1_SRC0_CHANNEL_Z_SHIFT, \ A1_SRC0_CHANNEL_Z_NEGATE) | \ i915_get_hardware_channel_val(REG_W(operand0), \ A1_SRC0_CHANNEL_W_SHIFT, \ A1_SRC0_CHANNEL_W_NEGATE) | \ /* Set up operand 1 */ \ (REG_TYPE(operand1) << A1_SRC1_TYPE_SHIFT) | \ (REG_NR(operand1) << A1_SRC1_NR_SHIFT) | \ i915_get_hardware_channel_val(REG_X(operand1), \ A1_SRC1_CHANNEL_X_SHIFT, \ A1_SRC1_CHANNEL_X_NEGATE) | \ i915_get_hardware_channel_val(REG_Y(operand1), \ A1_SRC1_CHANNEL_Y_SHIFT, \ A1_SRC1_CHANNEL_Y_NEGATE)); \ OUT_BATCH(i915_get_hardware_channel_val(REG_Z(operand1), \ A2_SRC1_CHANNEL_Z_SHIFT, \ A2_SRC1_CHANNEL_Z_NEGATE) | \ i915_get_hardware_channel_val(REG_W(operand1), \ A2_SRC1_CHANNEL_W_SHIFT, \ A2_SRC1_CHANNEL_W_NEGATE) | \ /* Set up operand 2 */ \ (REG_TYPE(operand2) << A2_SRC2_TYPE_SHIFT) | \ (REG_NR(operand2) << A2_SRC2_NR_SHIFT) | \ i915_get_hardware_channel_val(REG_X(operand2), \ A2_SRC2_CHANNEL_X_SHIFT, \ A2_SRC2_CHANNEL_X_NEGATE) | \ i915_get_hardware_channel_val(REG_Y(operand2), \ A2_SRC2_CHANNEL_Y_SHIFT, \ A2_SRC2_CHANNEL_Y_NEGATE) | \ i915_get_hardware_channel_val(REG_Z(operand2), \ A2_SRC2_CHANNEL_Z_SHIFT, \ A2_SRC2_CHANNEL_Z_NEGATE) | \ i915_get_hardware_channel_val(REG_W(operand2), \ A2_SRC2_CHANNEL_W_SHIFT, \ A2_SRC2_CHANNEL_W_NEGATE)); \ } while (0) #define _i915_fs_arith(cmd, dest_reg, operand0, operand1, operand2) do {\ /* Set up destination register and write mask */ \ OUT_BATCH(cmd | \ (REG_TYPE(dest_reg) << A0_DEST_TYPE_SHIFT) | \ (REG_NR(dest_reg) << A0_DEST_NR_SHIFT) | \ (A0_DEST_CHANNEL_ALL) | \ /* Set up operand 0 */ \ (REG_TYPE(operand0) << A0_SRC0_TYPE_SHIFT) | \ (REG_NR(operand0) << A0_SRC0_NR_SHIFT)); \ OUT_BATCH(i915_get_hardware_channel_val(REG_X(operand0), \ A1_SRC0_CHANNEL_X_SHIFT, \ A1_SRC0_CHANNEL_X_NEGATE) | \ i915_get_hardware_channel_val(REG_Y(operand0), \ A1_SRC0_CHANNEL_Y_SHIFT, \ A1_SRC0_CHANNEL_Y_NEGATE) | \ i915_get_hardware_channel_val(REG_Z(operand0), \ A1_SRC0_CHANNEL_Z_SHIFT, \ A1_SRC0_CHANNEL_Z_NEGATE) | \ i915_get_hardware_channel_val(REG_W(operand0), \ A1_SRC0_CHANNEL_W_SHIFT, \ A1_SRC0_CHANNEL_W_NEGATE) | \ /* Set up operand 1 */ \ (REG_TYPE(operand1) << A1_SRC1_TYPE_SHIFT) | \ (REG_NR(operand1) << A1_SRC1_NR_SHIFT) | \ i915_get_hardware_channel_val(REG_X(operand1), \ A1_SRC1_CHANNEL_X_SHIFT, \ A1_SRC1_CHANNEL_X_NEGATE) | \ i915_get_hardware_channel_val(REG_Y(operand1), \ A1_SRC1_CHANNEL_Y_SHIFT, \ A1_SRC1_CHANNEL_Y_NEGATE)); \ OUT_BATCH(i915_get_hardware_channel_val(REG_Z(operand1), \ A2_SRC1_CHANNEL_Z_SHIFT, \ A2_SRC1_CHANNEL_Z_NEGATE) | \ i915_get_hardware_channel_val(REG_W(operand1), \ A2_SRC1_CHANNEL_W_SHIFT, \ A2_SRC1_CHANNEL_W_NEGATE) | \ /* Set up operand 2 */ \ (REG_TYPE(operand2) << A2_SRC2_TYPE_SHIFT) | \ (REG_NR(operand2) << A2_SRC2_NR_SHIFT) | \ i915_get_hardware_channel_val(REG_X(operand2), \ A2_SRC2_CHANNEL_X_SHIFT, \ A2_SRC2_CHANNEL_X_NEGATE) | \ i915_get_hardware_channel_val(REG_Y(operand2), \ A2_SRC2_CHANNEL_Y_SHIFT, \ A2_SRC2_CHANNEL_Y_NEGATE) | \ i915_get_hardware_channel_val(REG_Z(operand2), \ A2_SRC2_CHANNEL_Z_SHIFT, \ A2_SRC2_CHANNEL_Z_NEGATE) | \ i915_get_hardware_channel_val(REG_W(operand2), \ A2_SRC2_CHANNEL_W_SHIFT, \ A2_SRC2_CHANNEL_W_NEGATE)); \ } while (0) #define i915_fs_mov(dest_reg, operand0) \ i915_fs_arith(MOV, dest_reg, \ operand0, \ i915_fs_operand_none(), \ i915_fs_operand_none()) #define i915_fs_mov_masked(dest_reg, dest_mask, operand0) \ i915_fs_arith_masked (MOV, dest_reg, dest_mask, \ operand0, \ i915_fs_operand_none(), \ i915_fs_operand_none()) #define i915_fs_frc(dest_reg, operand0) \ i915_fs_arith (FRC, dest_reg, \ operand0, \ i915_fs_operand_none(), \ i915_fs_operand_none()) /** Add operand0 and operand1 and put the result in dest_reg */ #define i915_fs_add(dest_reg, operand0, operand1) \ i915_fs_arith (ADD, dest_reg, \ operand0, operand1, \ i915_fs_operand_none()) /** Multiply operand0 and operand1 and put the result in dest_reg */ #define i915_fs_mul(dest_reg, operand0, operand1) \ i915_fs_arith (MUL, dest_reg, \ operand0, operand1, \ i915_fs_operand_none()) /** Computes 1/sqrt(operand0.replicate_swizzle) puts the result in dest_reg */ #define i915_fs_rsq(dest_reg, dest_mask, operand0) \ do { \ if (dest_mask) { \ i915_fs_arith_masked (RSQ, dest_reg, dest_mask, \ operand0, \ i915_fs_operand_none (), \ i915_fs_operand_none ()); \ } else { \ i915_fs_arith (RSQ, dest_reg, \ operand0, \ i915_fs_operand_none (), \ i915_fs_operand_none ()); \ } \ } while (0) /** Puts the minimum of operand0 and operand1 in dest_reg */ #define i915_fs_min(dest_reg, operand0, operand1) \ i915_fs_arith (MIN, dest_reg, \ operand0, operand1, \ i915_fs_operand_none()) /** Puts the maximum of operand0 and operand1 in dest_reg */ #define i915_fs_max(dest_reg, operand0, operand1) \ i915_fs_arith (MAX, dest_reg, \ operand0, operand1, \ i915_fs_operand_none()) #define i915_fs_cmp(dest_reg, operand0, operand1, operand2) \ i915_fs_arith (CMP, dest_reg, operand0, operand1, operand2) /** Perform operand0 * operand1 + operand2 and put the result in dest_reg */ #define i915_fs_mad(dest_reg, dest_mask, op0, op1, op2) \ do { \ if (dest_mask) { \ i915_fs_arith_masked (MAD, dest_reg, dest_mask, op0, op1, op2); \ } else { \ i915_fs_arith (MAD, dest_reg, op0, op1, op2); \ } \ } while (0) #define i915_fs_dp2add(dest_reg, dest_mask, op0, op1, op2) \ do { \ if (dest_mask) { \ i915_fs_arith_masked (DP2ADD, dest_reg, dest_mask, op0, op1, op2); \ } else { \ i915_fs_arith (DP2ADD, dest_reg, op0, op1, op2); \ } \ } while (0) /** * Perform a 3-component dot-product of operand0 and operand1 and put the * resulting scalar in the channels of dest_reg specified by the dest_mask. */ #define i915_fs_dp3(dest_reg, dest_mask, op0, op1) \ do { \ if (dest_mask) { \ i915_fs_arith_masked (DP3, dest_reg, dest_mask, \ op0, op1,\ i915_fs_operand_none()); \ } else { \ i915_fs_arith (DP3, dest_reg, op0, op1,\ i915_fs_operand_none()); \ } \ } while (0) /** * Sets up local state for accumulating a fragment shader buffer. * * \param x maximum number of shader commands that may be used between * a FS_START and FS_END */ #define FS_LOCALS() \ uint32_t _shader_offset #define FS_BEGIN() \ do { \ _shader_offset = intel->batch_used++; \ } while (0) #define FS_END() \ do { \ intel->batch_ptr[_shader_offset] = \ _3DSTATE_PIXEL_SHADER_PROGRAM | \ (intel->batch_used - _shader_offset - 2); \ } while (0); intel-gpu-tools-1.3/lib/intel_gpu_tools.h0000644000175100017510000000607612014634425015501 00000000000000/* * Copyright © 2009 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * * Authors: * Eric Anholt * */ #ifndef INTEL_GPU_TOOLS_H #define INTEL_GPU_TOOLS_H #include #include #include #include "intel_chipset.h" #include "intel_reg.h" #define ARRAY_SIZE(arr) (sizeof(arr)/sizeof(arr[0])) extern void *mmio; void intel_get_mmio(struct pci_device *pci_dev); /* New style register access API */ int intel_register_access_init(struct pci_device *pci_dev, int safe); void intel_register_access_fini(void); uint32_t intel_register_read(uint32_t reg); void intel_register_write(uint32_t reg, uint32_t val); /* Following functions are relevant only for SoCs like Valleyview */ uint32_t intel_dpio_reg_read(uint32_t reg); void intel_dpio_reg_write(uint32_t reg, uint32_t val); #define INTEL_RANGE_RSVD (0<<0) /* Shouldn't be read or written */ #define INTEL_RANGE_READ (1<<0) #define INTEL_RANGE_WRITE (1<<1) #define INTEL_RANGE_RW (INTEL_RANGE_READ | INTEL_RANGE_WRITE) #define INTEL_RANGE_END (1<<31) struct intel_register_range { uint32_t base; uint32_t size; uint32_t flags; }; struct intel_register_map { struct intel_register_range *map; uint32_t top; uint32_t alignment_mask; }; struct intel_register_map intel_get_register_map(uint32_t devid); struct intel_register_range *intel_get_register_range(struct intel_register_map map, uint32_t offset, int mode); static inline uint32_t INREG(uint32_t reg) { return *(volatile uint32_t *)((volatile char *)mmio + reg); } static inline void OUTREG(uint32_t reg, uint32_t val) { *(volatile uint32_t *)((volatile char *)mmio + reg) = val; } struct pci_device *intel_get_pci_device(void); uint32_t intel_get_drm_devid(int fd); int intel_gen(uint32_t devid); uint64_t intel_get_total_ram_mb(void); uint64_t intel_get_total_swap_mb(void); void intel_map_file(char *); enum pch_type { PCH_IBX, PCH_CPT, }; extern enum pch_type pch; void intel_check_pch(void); #define HAS_CPT (pch == PCH_CPT) #endif /* INTEL_GPU_TOOLS_H */ intel-gpu-tools-1.3/lib/intel_pci.c0000664000175100017510000000453711721136153014235 00000000000000/* * Copyright © 2008 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * * Authors: * Eric Anholt * */ #include #include #include #include #include #include #include #include #include #include #include #include "intel_gpu_tools.h" enum pch_type pch; struct pci_device * intel_get_pci_device(void) { struct pci_device *pci_dev; int error; error = pci_system_init(); if (error != 0) { fprintf(stderr, "Couldn't initialize PCI system: %s\n", strerror(error)); exit(1); } /* Grab the graphics card */ pci_dev = pci_device_find_by_slot(0, 0, 2, 0); if (pci_dev == NULL) errx(1, "Couldn't find graphics card"); error = pci_device_probe(pci_dev); if (error != 0) { fprintf(stderr, "Couldn't probe graphics card: %s\n", strerror(error)); exit(1); } if (pci_dev->vendor_id != 0x8086) errx(1, "Graphics card is non-intel"); return pci_dev; } void intel_check_pch(void) { struct pci_device *pch_dev; pch_dev = pci_device_find_by_slot(0, 0, 31, 0); if (pch_dev == NULL) return; if (pch_dev->vendor_id == 0x8086 && (((pch_dev->device_id & 0xff00) == 0x1c00) || (pch_dev->device_id & 0xff00) == 0x1e00)) pch = PCH_CPT; } intel-gpu-tools-1.3/lib/intel_mmio.c0000644000175100017510000001325112016621411014404 00000000000000/* * Copyright © 2008 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * * Authors: * Eric Anholt * Ben Widawsky * */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "intel_gpu_tools.h" void *mmio; static struct _mmio_data { int inited; bool safe; char debugfs_path[FILENAME_MAX]; char debugfs_forcewake_path[FILENAME_MAX]; uint32_t i915_devid; struct intel_register_map map; int key; } mmio_data; void intel_map_file(char *file) { int fd; struct stat st; fd = open(file, O_RDWR); if (fd == -1) { fprintf(stderr, "Couldn't open %s: %s\n", file, strerror(errno)); exit(1); } fstat(fd, &st); mmio = mmap(NULL, st.st_size, PROT_READ|PROT_WRITE, MAP_PRIVATE, fd, 0); if (mmio == MAP_FAILED) { fprintf(stderr, "Couldn't mmap %s: %s\n", file, strerror(errno)); exit(1); } close(fd); } void intel_get_mmio(struct pci_device *pci_dev) { uint32_t devid, gen; int mmio_bar, mmio_size; int error; devid = pci_dev->device_id; if (IS_GEN2(devid)) mmio_bar = 1; else mmio_bar = 0; gen = intel_gen(devid); if (gen < 3) mmio_size = 64*1024; else if (gen < 5) mmio_size = 512*1024; else mmio_size = 2*1024*1024; error = pci_device_map_range (pci_dev, pci_dev->regions[mmio_bar].base_addr, mmio_size, PCI_DEV_MAP_FLAG_WRITABLE, &mmio); if (error != 0) { fprintf(stderr, "Couldn't map MMIO region: %s\n", strerror(error)); exit(1); } } /* * If successful, i915_debugfs_path and i915_debugfs_forcewake_path are both * updated with the correct path. */ static int find_debugfs_path(const char *dri_base) { char buf[FILENAME_MAX]; struct stat sb; int i, ret; for (i = 0; i < 16; i++) { snprintf(buf, FILENAME_MAX, "%s/%i/name", dri_base, i); snprintf(mmio_data.debugfs_path, FILENAME_MAX, "%s/%i/", dri_base, i); snprintf(mmio_data.debugfs_forcewake_path, FILENAME_MAX, "%s/%i/i915_forcewake_user", dri_base, i); ret = stat(mmio_data.debugfs_forcewake_path, &sb); if (ret) { mmio_data.debugfs_path[0] = 0; mmio_data.debugfs_forcewake_path[0] = 0; } else return 0; } return -1; } static int get_forcewake_lock(void) { return open(mmio_data.debugfs_forcewake_path, 0); } static void release_forcewake_lock(int fd) { close(fd); } /* * Initialize register access library. * * @pci_dev: pci device we're mucking with * @safe: use safe register access tables */ int intel_register_access_init(struct pci_device *pci_dev, int safe) { int ret; /* after old API is deprecated, remove this */ if (mmio == NULL) intel_get_mmio(pci_dev); assert(mmio != NULL); if (mmio_data.inited) return -1; mmio_data.safe = safe != 0 ? true : false; mmio_data.i915_devid = pci_dev->device_id; if (mmio_data.safe) mmio_data.map = intel_get_register_map(mmio_data.i915_devid); if (!(IS_GEN6(pci_dev->device_id) || IS_GEN7(pci_dev->device_id))) goto done; /* Find where the forcewake lock is */ ret = find_debugfs_path("/sys/kernel/debug/dri"); if (ret) { ret = find_debugfs_path("/debug/dri"); if (ret) { fprintf(stderr, "Couldn't find path to dri/debugfs entry\n"); return ret; } } mmio_data.key = get_forcewake_lock(); done: mmio_data.inited++; return 0; } void intel_register_access_fini(void) { if (mmio_data.key) release_forcewake_lock(mmio_data.key); mmio_data.inited--; } uint32_t intel_register_read(uint32_t reg) { struct intel_register_range *range; uint32_t ret; assert(mmio_data.inited); if (intel_gen(mmio_data.i915_devid) >= 6) assert(mmio_data.key != -1); if (!mmio_data.safe) goto read_out; range = intel_get_register_range(mmio_data.map, reg, INTEL_RANGE_READ); if(!range) { fprintf(stderr, "Register read blocked for safety " "(*0x%08x)\n", reg); ret = 0xffffffff; goto out; } read_out: ret = *(volatile uint32_t *)((volatile char *)mmio + reg); out: return ret; } void intel_register_write(uint32_t reg, uint32_t val) { struct intel_register_range *range; assert(mmio_data.inited); if (intel_gen(mmio_data.i915_devid) >= 6) assert(mmio_data.key != -1); if (!mmio_data.safe) goto write_out; range = intel_get_register_range(mmio_data.map, reg, INTEL_RANGE_WRITE); if (!range) { fprintf(stderr, "Register write blocked for safety " "(*0x%08x = 0x%x)\n", reg, val); } write_out: *(volatile uint32_t *)((volatile char *)mmio + reg) = val; } intel-gpu-tools-1.3/lib/rendercopy_i915.c0000664000175100017510000001351311715035430015201 00000000000000#include "i915_reg.h" #include "i915_3d.h" #include "rendercopy.h" void gen3_render_copyfunc(struct intel_batchbuffer *batch, struct scratch_buf *src, unsigned src_x, unsigned src_y, unsigned width, unsigned height, struct scratch_buf *dst, unsigned dst_x, unsigned dst_y) { /* invariant state */ { OUT_BATCH(_3DSTATE_AA_CMD | AA_LINE_ECAAR_WIDTH_ENABLE | AA_LINE_ECAAR_WIDTH_1_0 | AA_LINE_REGION_WIDTH_ENABLE | AA_LINE_REGION_WIDTH_1_0); OUT_BATCH(_3DSTATE_INDEPENDENT_ALPHA_BLEND_CMD | IAB_MODIFY_ENABLE | IAB_MODIFY_FUNC | (BLENDFUNC_ADD << IAB_FUNC_SHIFT) | IAB_MODIFY_SRC_FACTOR | (BLENDFACT_ONE << IAB_SRC_FACTOR_SHIFT) | IAB_MODIFY_DST_FACTOR | (BLENDFACT_ZERO << IAB_DST_FACTOR_SHIFT)); OUT_BATCH(_3DSTATE_DFLT_DIFFUSE_CMD); OUT_BATCH(0); OUT_BATCH(_3DSTATE_DFLT_SPEC_CMD); OUT_BATCH(0); OUT_BATCH(_3DSTATE_DFLT_Z_CMD); OUT_BATCH(0); OUT_BATCH(_3DSTATE_COORD_SET_BINDINGS | CSB_TCB(0, 0) | CSB_TCB(1, 1) | CSB_TCB(2, 2) | CSB_TCB(3, 3) | CSB_TCB(4, 4) | CSB_TCB(5, 5) | CSB_TCB(6, 6) | CSB_TCB(7, 7)); OUT_BATCH(_3DSTATE_RASTER_RULES_CMD | ENABLE_POINT_RASTER_RULE | OGL_POINT_RASTER_RULE | ENABLE_LINE_STRIP_PROVOKE_VRTX | ENABLE_TRI_FAN_PROVOKE_VRTX | LINE_STRIP_PROVOKE_VRTX(1) | TRI_FAN_PROVOKE_VRTX(2) | ENABLE_TEXKILL_3D_4D | TEXKILL_4D); OUT_BATCH(_3DSTATE_MODES_4_CMD | ENABLE_LOGIC_OP_FUNC | LOGIC_OP_FUNC(LOGICOP_COPY) | ENABLE_STENCIL_WRITE_MASK | STENCIL_WRITE_MASK(0xff) | ENABLE_STENCIL_TEST_MASK | STENCIL_TEST_MASK(0xff)); OUT_BATCH(_3DSTATE_LOAD_STATE_IMMEDIATE_1 | I1_LOAD_S(3) | I1_LOAD_S(4) | I1_LOAD_S(5) | 2); OUT_BATCH(0x00000000); /* Disable texture coordinate wrap-shortest */ OUT_BATCH((1 << S4_POINT_WIDTH_SHIFT) | S4_LINE_WIDTH_ONE | S4_CULLMODE_NONE | S4_VFMT_XY); OUT_BATCH(0x00000000); /* Stencil. */ OUT_BATCH(_3DSTATE_SCISSOR_ENABLE_CMD | DISABLE_SCISSOR_RECT); OUT_BATCH(_3DSTATE_SCISSOR_RECT_0_CMD); OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(_3DSTATE_DEPTH_SUBRECT_DISABLE); OUT_BATCH(_3DSTATE_LOAD_INDIRECT | 0); /* disable indirect state */ OUT_BATCH(0); OUT_BATCH(_3DSTATE_STIPPLE); OUT_BATCH(0x00000000); OUT_BATCH(_3DSTATE_BACKFACE_STENCIL_OPS | BFO_ENABLE_STENCIL_TWO_SIDE | 0); } /* samler state */ { #define TEX_COUNT 1 uint32_t tiling_bits = 0; if (src->tiling != I915_TILING_NONE) tiling_bits = MS3_TILED_SURFACE; if (src->tiling == I915_TILING_Y) tiling_bits |= MS3_TILE_WALK; OUT_BATCH(_3DSTATE_MAP_STATE | (3 * TEX_COUNT)); OUT_BATCH((1 << TEX_COUNT) - 1); OUT_RELOC(src->bo, I915_GEM_DOMAIN_SAMPLER, 0, 0); OUT_BATCH(MAPSURF_32BIT | MT_32BIT_ARGB8888 | tiling_bits | (buf_height(src) - 1) << MS3_HEIGHT_SHIFT | (buf_width(src) - 1) << MS3_WIDTH_SHIFT); OUT_BATCH((src->stride/4-1) << MS4_PITCH_SHIFT); OUT_BATCH(_3DSTATE_SAMPLER_STATE | (3 * TEX_COUNT)); OUT_BATCH((1 << TEX_COUNT) - 1); OUT_BATCH(MIPFILTER_NONE << SS2_MIP_FILTER_SHIFT | FILTER_NEAREST << SS2_MAG_FILTER_SHIFT | FILTER_NEAREST << SS2_MIN_FILTER_SHIFT); OUT_BATCH(TEXCOORDMODE_WRAP << SS3_TCX_ADDR_MODE_SHIFT | TEXCOORDMODE_WRAP << SS3_TCY_ADDR_MODE_SHIFT | 0 << SS3_TEXTUREMAP_INDEX_SHIFT); OUT_BATCH(0x00000000); } /* render target state */ { uint32_t tiling_bits = 0; if (dst->tiling != I915_TILING_NONE) tiling_bits = BUF_3D_TILED_SURFACE; if (dst->tiling == I915_TILING_Y) tiling_bits |= BUF_3D_TILE_WALK_Y; OUT_BATCH(_3DSTATE_BUF_INFO_CMD); OUT_BATCH(BUF_3D_ID_COLOR_BACK | tiling_bits | BUF_3D_PITCH(dst->stride)); OUT_RELOC(dst->bo, I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER, 0); OUT_BATCH(_3DSTATE_DST_BUF_VARS_CMD); OUT_BATCH(COLR_BUF_ARGB8888 | DSTORG_HORT_BIAS(0x8) | DSTORG_VERT_BIAS(0x8)); /* draw rect is unconditional */ OUT_BATCH(_3DSTATE_DRAW_RECT_CMD); OUT_BATCH(0x00000000); OUT_BATCH(0x00000000); /* ymin, xmin */ OUT_BATCH(DRAW_YMAX(buf_height(dst) - 1) | DRAW_XMAX(buf_width(dst) - 1)); /* yorig, xorig (relate to color buffer?) */ OUT_BATCH(0x00000000); } /* texfmt */ { OUT_BATCH(_3DSTATE_LOAD_STATE_IMMEDIATE_1 | I1_LOAD_S(1) | I1_LOAD_S(2) | I1_LOAD_S(6) | 2); OUT_BATCH((4 << S1_VERTEX_WIDTH_SHIFT) | (4 << S1_VERTEX_PITCH_SHIFT)); OUT_BATCH(~S2_TEXCOORD_FMT(0, TEXCOORDFMT_NOT_PRESENT) | S2_TEXCOORD_FMT(0, TEXCOORDFMT_2D)); OUT_BATCH(S6_CBUF_BLEND_ENABLE | S6_COLOR_WRITE_ENABLE | BLENDFUNC_ADD << S6_CBUF_BLEND_FUNC_SHIFT | BLENDFACT_ONE << S6_CBUF_SRC_BLEND_FACT_SHIFT | BLENDFACT_ZERO << S6_CBUF_DST_BLEND_FACT_SHIFT); } /* frage shader */ { OUT_BATCH(_3DSTATE_PIXEL_SHADER_PROGRAM | (1 + 3*3 - 2)); /* decl FS_T0 */ OUT_BATCH(D0_DCL | REG_TYPE(FS_T0) << D0_TYPE_SHIFT | REG_NR(FS_T0) << D0_NR_SHIFT | ((REG_TYPE(FS_T0) != REG_TYPE_S) ? D0_CHANNEL_ALL : 0)); OUT_BATCH(0); OUT_BATCH(0); /* decl FS_S0 */ OUT_BATCH(D0_DCL | (REG_TYPE(FS_S0) << D0_TYPE_SHIFT) | (REG_NR(FS_S0) << D0_NR_SHIFT) | ((REG_TYPE(FS_S0) != REG_TYPE_S) ? D0_CHANNEL_ALL : 0)); OUT_BATCH(0); OUT_BATCH(0); /* texld(FS_OC, FS_S0, FS_T0 */ OUT_BATCH(T0_TEXLD | (REG_TYPE(FS_OC) << T0_DEST_TYPE_SHIFT) | (REG_NR(FS_OC) << T0_DEST_NR_SHIFT) | (REG_NR(FS_S0) << T0_SAMPLER_NR_SHIFT)); OUT_BATCH((REG_TYPE(FS_T0) << T1_ADDRESS_REG_TYPE_SHIFT) | (REG_NR(FS_T0) << T1_ADDRESS_REG_NR_SHIFT)); OUT_BATCH(0); } OUT_BATCH(PRIM3D_RECTLIST | (3*4 - 1)); emit_vertex(batch, dst_x + width); emit_vertex(batch, dst_y + height); emit_vertex(batch, src_x + width); emit_vertex(batch, src_y + height); emit_vertex(batch, dst_x); emit_vertex(batch, dst_y + height); emit_vertex(batch, src_x); emit_vertex(batch, src_y + height); emit_vertex(batch, dst_x); emit_vertex(batch, dst_y); emit_vertex(batch, src_x); emit_vertex(batch, src_y); intel_batchbuffer_flush(batch); } intel-gpu-tools-1.3/lib/intel_drm.c0000664000175100017510000001055011746063446014247 00000000000000/* * Copyright © 2008 Intel Corporation * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * * Authors: * Eric Anholt * */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include #ifdef HAVE_STRUCT_SYSINFO_TOTALRAM #include #elif defined(HAVE_SWAPCTL) /* Solaris */ #include #endif #include "intel_gpu_tools.h" #include "i915_drm.h" uint32_t intel_get_drm_devid(int fd) { int ret; struct drm_i915_getparam gp; uint32_t devid; gp.param = I915_PARAM_CHIPSET_ID; gp.value = (int *)&devid; ret = ioctl(fd, DRM_IOCTL_I915_GETPARAM, &gp, sizeof(gp)); assert(ret == 0); return devid; } int intel_gen(uint32_t devid) { if (IS_GEN2(devid)) return 2; if (IS_GEN3(devid)) return 3; if (IS_GEN4(devid)) return 4; if (IS_GEN5(devid)) return 5; if (IS_GEN6(devid)) return 6; if (IS_GEN7(devid)) return 7; return -1; } uint64_t intel_get_total_ram_mb(void) { uint64_t retval; #ifdef HAVE_STRUCT_SYSINFO_TOTALRAM /* Linux */ struct sysinfo sysinf; int ret; ret = sysinfo(&sysinf); assert(ret == 0); retval = sysinf.totalram; retval *= sysinf.mem_unit; #elif defined(_SC_PAGESIZE) && defined(_SC_PHYS_PAGES) /* Solaris */ long pagesize, npages; pagesize = sysconf(_SC_PAGESIZE); npages = sysconf(_SC_PHYS_PAGES); retval = (uint64_t) pagesize * npages; #else #error "Unknown how to get RAM size for this OS" #endif return retval / (1024*1024); } uint64_t intel_get_total_swap_mb(void) { uint64_t retval; #ifdef HAVE_STRUCT_SYSINFO_TOTALRAM /* Linux */ struct sysinfo sysinf; int ret; ret = sysinfo(&sysinf); assert(ret == 0); retval = sysinf.totalswap; retval *= sysinf.mem_unit; #elif defined(HAVE_SWAPCTL) /* Solaris */ long pagesize = sysconf(_SC_PAGESIZE); uint64_t totalpages = 0; swaptbl_t *swt; char *buf; int n, i; if ((n = swapctl(SC_GETNSWP, NULL)) == -1) { perror("swapctl: GETNSWP"); return 0; } if (n == 0) { /* no error, but no swap devices either */ return 0; } swt = malloc(sizeof(struct swaptable) + (n * sizeof(swapent_t))); buf = malloc(n * MAXPATHLEN); if (!swt || !buf) { perror("malloc"); } else { swt->swt_n = n; for (i = 0 ; i < n; i++) { swt->swt_ent[i].ste_path = buf + (i * MAXPATHLEN); } if ((n = swapctl(SC_LIST, swt)) == -1) { perror("swapctl: LIST"); } else { for (i = 0; i < swt->swt_n; i++) { totalpages += swt->swt_ent[i].ste_pages; } } } free(swt); free(buf); retval = (uint64_t) pagesize * totalpages; #else #warning "Unknown how to get swap size for this OS" return 0; #endif return retval / (1024*1024); } /* * When testing a port to a new platform, create a standalone test binary * by running: * cc -o porttest intel_drm.c -I.. -DSTANDALONE_TEST `pkg-config --cflags libdrm` * and then running the resulting porttest program. */ #ifdef STANDALONE_TEST void *mmio; int main(int argc, char **argv) { printf("Total RAM: %" PRIu64 " Mb\n", intel_get_total_ram_mb()); printf("Total Swap: %" PRIu64 " Mb\n", intel_get_total_swap_mb()); return 0; } #endif /* STANDALONE_TEST */ intel-gpu-tools-1.3/lib/rendercopy.h0000664000175100017510000000445411775241246014455 00000000000000#include #include #include #include #include #include #include #include #include #include #include #include "drm.h" #include "i915_drm.h" #include "drmtest.h" #include "intel_bufmgr.h" #include "intel_batchbuffer.h" #include "intel_gpu_tools.h" struct scratch_buf { drm_intel_bo *bo; uint32_t stride; uint32_t tiling; uint32_t *data; uint32_t *cpu_mapping; uint32_t size; unsigned num_tiles; }; static inline void emit_vertex_2s(struct intel_batchbuffer *batch, int16_t x, int16_t y) { OUT_BATCH((uint16_t)y << 16 | (uint16_t)x); } static inline void emit_vertex(struct intel_batchbuffer *batch, float f) { union { float f; uint32_t ui; } u; u.f = f; OUT_BATCH(u.ui); } static inline void emit_vertex_normalized(struct intel_batchbuffer *batch, float f, float total) { union { float f; uint32_t ui; } u; u.f = f / total; OUT_BATCH(u.ui); } static inline unsigned buf_width(struct scratch_buf *buf) { return buf->stride/sizeof(uint32_t); } static inline unsigned buf_height(struct scratch_buf *buf) { return buf->size/buf->stride; } typedef void (*render_copyfunc_t)(struct intel_batchbuffer *batch, struct scratch_buf *src, unsigned src_x, unsigned src_y, unsigned width, unsigned height, struct scratch_buf *dst, unsigned dst_x, unsigned dst_y); void gen7_render_copyfunc(struct intel_batchbuffer *batch, struct scratch_buf *src, unsigned src_x, unsigned src_y, unsigned width, unsigned height, struct scratch_buf *dst, unsigned dst_x, unsigned dst_y); void gen6_render_copyfunc(struct intel_batchbuffer *batch, struct scratch_buf *src, unsigned src_x, unsigned src_y, unsigned width, unsigned height, struct scratch_buf *dst, unsigned dst_x, unsigned dst_y); void gen3_render_copyfunc(struct intel_batchbuffer *batch, struct scratch_buf *src, unsigned src_x, unsigned src_y, unsigned width, unsigned height, struct scratch_buf *dst, unsigned dst_x, unsigned dst_y); void gen2_render_copyfunc(struct intel_batchbuffer *batch, struct scratch_buf *src, unsigned src_x, unsigned src_y, unsigned width, unsigned height, struct scratch_buf *dst, unsigned dst_x, unsigned dst_y); intel-gpu-tools-1.3/lib/rendercopy_gen7.c0000664000175100017510000005310111775241246015361 00000000000000#include "rendercopy.h" #include "gen7_render.h" #include #define ALIGN(x, y) (((x) + (y)-1) & ~((y)-1)) #define VERTEX_SIZE (3*4) #if DEBUG_RENDERCPY static void dump_batch(struct intel_batchbuffer *batch) #else #define dump_batch(x) do { } while(0) #endif struct { uint32_t cc_state; uint32_t blend_state; uint32_t ds_state; } cc; struct { uint32_t cc_state; uint32_t sf_clip_state; } viewport; /* see shaders/ps/blit.g7a */ static const uint32_t ps_kernel[][4] = { #if 1 { 0x0060005a, 0x214077bd, 0x000000c0, 0x008d0040 }, { 0x0060005a, 0x216077bd, 0x000000c0, 0x008d0080 }, { 0x0060005a, 0x218077bd, 0x000000d0, 0x008d0040 }, { 0x0060005a, 0x21a077bd, 0x000000d0, 0x008d0080 }, { 0x02800031, 0x2e001e3d, 0x00000140, 0x08840001 }, { 0x05800031, 0x20001e3c, 0x00000e00, 0x90031000 }, #else /* Write all -1 */ { 0x00600001, 0x2e000061, 0x00000000, 0x3f800000 }, { 0x00600001, 0x2e200061, 0x00000000, 0x3f800000 }, { 0x00600001, 0x2e400061, 0x00000000, 0x3f800000 }, { 0x00600001, 0x2e600061, 0x00000000, 0x3f800000 }, { 0x00600001, 0x2e800061, 0x00000000, 0x3f800000 }, { 0x00600001, 0x2ea00061, 0x00000000, 0x3f800000 }, { 0x00600001, 0x2ec00061, 0x00000000, 0x3f800000 }, { 0x00600001, 0x2ee00061, 0x00000000, 0x3f800000 }, { 0x05800031, 0x20001e3c, 0x00000e00, 0x90031000 }, #endif }; static uint32_t batch_used(struct intel_batchbuffer *batch) { return batch->ptr - batch->buffer; } static uint32_t batch_align(struct intel_batchbuffer *batch, uint32_t align) { uint32_t offset = batch_used(batch); offset = ALIGN(offset, align); batch->ptr = batch->buffer + offset; return offset; } static void * batch_alloc(struct intel_batchbuffer *batch, uint32_t size, uint32_t align) { uint32_t offset = batch_align(batch, align); batch->ptr += size; return memset(batch->buffer + offset, 0, size); } static uint32_t batch_offset(struct intel_batchbuffer *batch, void *ptr) { return (uint8_t *)ptr - batch->buffer; } static uint32_t batch_copy(struct intel_batchbuffer *batch, const void *ptr, uint32_t size, uint32_t align) { return batch_offset(batch, memcpy(batch_alloc(batch, size, align), ptr, size)); } static void gen6_render_flush(struct intel_batchbuffer *batch, uint32_t batch_end) { int ret; ret = drm_intel_bo_subdata(batch->bo, 0, 4096, batch->buffer); if (ret == 0) ret = drm_intel_bo_mrb_exec(batch->bo, batch_end, NULL, 0, 0, 0); assert(ret == 0); } /* Mostly copy+paste from gen6, except height, width, pitch moved */ static uint32_t gen7_bind_buf(struct intel_batchbuffer *batch, struct scratch_buf *buf, uint32_t format, int is_dst) { struct gen7_surface_state *ss; uint32_t write_domain, read_domain; int ret; if (is_dst) { write_domain = read_domain = I915_GEM_DOMAIN_RENDER; } else { write_domain = 0; read_domain = I915_GEM_DOMAIN_SAMPLER; } ss = batch_alloc(batch, sizeof(*ss), 32); ss->ss0.surface_type = GEN6_SURFACE_2D; ss->ss0.surface_format = format; ss->ss0.render_cache_read_write = 1; /* GEN7+ */ ss->ss0.tiled_surface = buf->tiling != I915_TILING_NONE; ss->ss0.tile_walk = buf->tiling == I915_TILING_Y; ss->ss1.base_addr = buf->bo->offset; ret = drm_intel_bo_emit_reloc(batch->bo, batch_offset(batch, ss) + 4, buf->bo, 0, read_domain, write_domain); assert(ret == 0); ss->ss2.height = buf_height(buf) - 1; ss->ss2.width = buf_width(buf) - 1; ss->ss3.pitch = buf->stride - 1; if (IS_HASWELL(batch->devid)) { ss->ss7.shader_chanel_select_a = 4; ss->ss7.shader_chanel_select_g = 5; ss->ss7.shader_chanel_select_b = 6; ss->ss7.shader_chanel_select_a = 7; } return batch_offset(batch, ss); } static uint32_t gen7_bind_surfaces(struct intel_batchbuffer *batch, struct scratch_buf *src, struct scratch_buf *dst) { uint32_t *binding_table; binding_table = batch_alloc(batch, 8, 32); binding_table[0] = gen7_bind_buf(batch, dst, GEN6_SURFACEFORMAT_B8G8R8A8_UNORM, 1); binding_table[1] = gen7_bind_buf(batch, src, GEN6_SURFACEFORMAT_B8G8R8A8_UNORM, 0); return batch_offset(batch, binding_table); } /* Mostly copy+paste from gen6, except wrap modes moved */ static uint32_t gen7_create_sampler(struct intel_batchbuffer *batch) { struct gen7_sampler_state *ss; ss = batch_alloc(batch, sizeof(*ss), 32); ss->ss0.min_filter = GEN6_MAPFILTER_NEAREST; ss->ss0.mag_filter = GEN6_MAPFILTER_NEAREST; ss->ss3.r_wrap_mode = GEN6_TEXCOORDMODE_CLAMP; ss->ss3.s_wrap_mode = GEN6_TEXCOORDMODE_CLAMP; ss->ss3.t_wrap_mode = GEN6_TEXCOORDMODE_CLAMP; /* I've experimented with non-normalized coordinates and using the LD * sampler fetch, but couldn't make it work. */ ss->ss3.non_normalized_coord = 0; return batch_offset(batch, ss); } /** * gen7_fill_vertex_buffer_data populate vertex buffer with data. * * The vertex buffer consists of 3 vertices to construct a RECTLIST. The 4th * vertex is implied (automatically derived by the HW). Each element has the * destination offset, and the normalized texture offset (src). The rectangle * itself will span the entire subsurface to be copied. * * see gen6_emit_vertex_elements */ static uint32_t gen7_fill_vertex_buffer_data(struct intel_batchbuffer *batch, struct scratch_buf *src, uint32_t src_x, uint32_t src_y, uint32_t dst_x, uint32_t dst_y, uint32_t width, uint32_t height) { void *ret; ret = batch->ptr; emit_vertex_2s(batch, dst_x + width, dst_y + height); emit_vertex_normalized(batch, src_x + width, buf_width(src)); emit_vertex_normalized(batch, src_y + height, buf_height(src)); emit_vertex_2s(batch, dst_x, dst_y + height); emit_vertex_normalized(batch, src_x, buf_width(src)); emit_vertex_normalized(batch, src_y + height, buf_height(src)); emit_vertex_2s(batch, dst_x, dst_y); emit_vertex_normalized(batch, src_x, buf_width(src)); emit_vertex_normalized(batch, src_y, buf_height(src)); return batch_offset(batch, ret); } /** * gen6_emit_vertex_elements - The vertex elements describe the contents of the * vertex buffer. We pack the vertex buffer in a semi weird way, conforming to * what gen6_rendercopy did. The most straightforward would be to store * everything as floats. * * see gen7_fill_vertex_buffer_data() for where the corresponding elements are * packed. */ static void gen6_emit_vertex_elements(struct intel_batchbuffer *batch) { /* * The VUE layout * dword 0-3: pad (0, 0, 0. 0) * dword 4-7: position (x, y, 0, 1.0), * dword 8-11: texture coordinate 0 (u0, v0, 0, 1.0) */ OUT_BATCH(GEN6_3DSTATE_VERTEX_ELEMENTS | (3 * 2 + 1 - 2)); /* Element state 0. These are 4 dwords of 0 required for the VUE format. * We don't really know or care what they do. */ OUT_BATCH(0 << VE0_VERTEX_BUFFER_INDEX_SHIFT | VE0_VALID | GEN6_SURFACEFORMAT_R32G32B32A32_FLOAT << VE0_FORMAT_SHIFT | 0 << VE0_OFFSET_SHIFT); /* we specify 0, but it's really does not exist */ OUT_BATCH(GEN6_VFCOMPONENT_STORE_0 << VE1_VFCOMPONENT_0_SHIFT | GEN6_VFCOMPONENT_STORE_0 << VE1_VFCOMPONENT_1_SHIFT | GEN6_VFCOMPONENT_STORE_0 << VE1_VFCOMPONENT_2_SHIFT | GEN6_VFCOMPONENT_STORE_0 << VE1_VFCOMPONENT_3_SHIFT); /* Element state 1 - Our "destination" vertices. These are passed down * through the pipeline, and eventually make it to the pixel shader as * the offsets in the destination surface. It's packed as the 16 * signed/scaled because of gen6 rendercopy. I see no particular reason * for doing this though. */ OUT_BATCH(0 << VE0_VERTEX_BUFFER_INDEX_SHIFT | VE0_VALID | GEN6_SURFACEFORMAT_R16G16_SSCALED << VE0_FORMAT_SHIFT | 0 << VE0_OFFSET_SHIFT); /* offsets vb in bytes */ OUT_BATCH(GEN6_VFCOMPONENT_STORE_SRC << VE1_VFCOMPONENT_0_SHIFT | GEN6_VFCOMPONENT_STORE_SRC << VE1_VFCOMPONENT_1_SHIFT | GEN6_VFCOMPONENT_STORE_0 << VE1_VFCOMPONENT_2_SHIFT | GEN6_VFCOMPONENT_STORE_1_FLT << VE1_VFCOMPONENT_3_SHIFT); /* Element state 2. Last but not least we store the U,V components as * normalized floats. These will be used in the pixel shader to sample * from the source buffer. */ OUT_BATCH(0 << VE0_VERTEX_BUFFER_INDEX_SHIFT | VE0_VALID | GEN6_SURFACEFORMAT_R32G32_FLOAT << VE0_FORMAT_SHIFT | 4 << VE0_OFFSET_SHIFT); /* offset vb in bytes */ OUT_BATCH(GEN6_VFCOMPONENT_STORE_SRC << VE1_VFCOMPONENT_0_SHIFT | GEN6_VFCOMPONENT_STORE_SRC << VE1_VFCOMPONENT_1_SHIFT | GEN6_VFCOMPONENT_STORE_0 << VE1_VFCOMPONENT_2_SHIFT | GEN6_VFCOMPONENT_STORE_1_FLT << VE1_VFCOMPONENT_3_SHIFT); } /** * gen7_emit_vertex_buffer emit the vertex buffers command * * @batch * @offset - bytw offset within the @batch where the vertex buffer starts. */ static void gen7_emit_vertex_buffer(struct intel_batchbuffer *batch, uint32_t offset) { OUT_BATCH(GEN6_3DSTATE_VERTEX_BUFFERS | (4 * 1 - 1)); OUT_BATCH(0 << VB0_BUFFER_INDEX_SHIFT | /* VB 0th index */ VB0_VERTEXDATA | GEN7_VB0_BUFFER_ADDR_MOD_EN | /* Address Modify Enable */ VERTEX_SIZE << VB0_BUFFER_PITCH_SHIFT); OUT_RELOC(batch->bo, I915_GEM_DOMAIN_VERTEX, 0, offset); OUT_RELOC(batch->bo, I915_GEM_DOMAIN_VERTEX, 0, offset + (VERTEX_SIZE * 3) - 1); OUT_BATCH(0); } static uint32_t gen6_create_cc_state(struct intel_batchbuffer *batch) { struct gen6_color_calc_state *cc_state; cc_state = batch_alloc(batch, sizeof(*cc_state), 64); return batch_offset(batch, cc_state); } static uint32_t gen6_create_depth_stencil_state(struct intel_batchbuffer *batch) { struct gen6_depth_stencil_state *depth; depth = batch_alloc(batch, sizeof(*depth), 64); depth->ds0.stencil_enable = 0; return batch_offset(batch, depth); } static uint32_t gen6_create_blend_state(struct intel_batchbuffer *batch) { struct gen6_blend_state *blend; blend = batch_alloc(batch, sizeof(*blend), 64); blend->blend0.blend_enable = 0; blend->blend1.pre_blend_clamp_enable = 1; return batch_offset(batch, blend); } static uint32_t gen6_create_cc_viewport(struct intel_batchbuffer *batch) { struct gen6_cc_viewport *vp; vp = batch_alloc(batch, sizeof(*vp), 32); /* XXX I don't understand this */ vp->min_depth = -1.e35; vp->max_depth = 1.e35; return batch_offset(batch, vp); } static uint32_t gen7_create_sf_clip_viewport(struct intel_batchbuffer *batch) { /* XXX these are likely not needed */ struct gen7_sf_clip_viewport *scv_state; scv_state = batch_alloc(batch, sizeof(*scv_state), 64); scv_state->guardband.xmin = 0; scv_state->guardband.xmax = 1.0f; scv_state->guardband.ymin = 0; scv_state->guardband.ymax = 1.0f; return batch_offset(batch, scv_state); } static uint32_t gen6_create_scissor_rect(struct intel_batchbuffer *batch) { struct gen6_scissor_rect *scissor; scissor = batch_alloc(batch, sizeof(*scissor), 64); return batch_offset(batch, scissor); } static void gen6_emit_sip(struct intel_batchbuffer *batch) { OUT_BATCH(GEN6_STATE_SIP | 0); OUT_BATCH(0); } static void gen7_emit_push_constants(struct intel_batchbuffer *batch) { OUT_BATCH(GEN7_3DSTATE_PUSH_CONSTANT_ALLOC_VS); OUT_BATCH(0); OUT_BATCH(GEN7_3DSTATE_PUSH_CONSTANT_ALLOC_HS); OUT_BATCH(0); OUT_BATCH(GEN7_3DSTATE_PUSH_CONSTANT_ALLOC_DS); OUT_BATCH(0); OUT_BATCH(GEN7_3DSTATE_PUSH_CONSTANT_ALLOC_GS); OUT_BATCH(0); OUT_BATCH(GEN7_3DSTATE_PUSH_CONSTANT_ALLOC_PS); OUT_BATCH(0); } static void gen7_emit_state_base_address(struct intel_batchbuffer *batch) { OUT_BATCH(GEN6_STATE_BASE_ADDRESS | (10 - 2)); /* general (stateless) */ /* surface */ /* instruction */ /* indirect */ /* dynamic */ OUT_BATCH(0 | BASE_ADDRESS_MODIFY); OUT_RELOC(batch->bo, I915_GEM_DOMAIN_SAMPLER, 0, BASE_ADDRESS_MODIFY); OUT_RELOC(batch->bo, I915_GEM_DOMAIN_RENDER | I915_GEM_DOMAIN_INSTRUCTION, 0, BASE_ADDRESS_MODIFY); OUT_BATCH(0 | BASE_ADDRESS_MODIFY); OUT_RELOC(batch->bo, I915_GEM_DOMAIN_INSTRUCTION, 0, BASE_ADDRESS_MODIFY); OUT_BATCH(0 | BASE_ADDRESS_MODIFY); OUT_BATCH(0xfffff000 | BASE_ADDRESS_MODIFY); // copied from mesa OUT_BATCH(0 | BASE_ADDRESS_MODIFY); OUT_BATCH(0 | BASE_ADDRESS_MODIFY); } static void gen7_emit_urb(struct intel_batchbuffer *batch) { /* XXX: Min valid values from mesa */ const int vs_entries = 32; const int vs_size = 2; const int vs_start = 2; OUT_BATCH(GEN7_3DSTATE_URB_VS); OUT_BATCH(vs_entries | ((vs_size - 1) << 16) | (vs_start << 25)); OUT_BATCH(GEN7_3DSTATE_URB_GS); OUT_BATCH(vs_start << 25); OUT_BATCH(GEN7_3DSTATE_URB_HS); OUT_BATCH(vs_start << 25); OUT_BATCH(GEN7_3DSTATE_URB_DS); OUT_BATCH(vs_start << 25); } static void gen7_emit_cc(struct intel_batchbuffer *batch) { OUT_BATCH(GEN7_3DSTATE_BLEND_STATE_POINTERS); OUT_BATCH(cc.blend_state | 1); OUT_BATCH(GEN6_3DSTATE_CC_STATE_POINTERS); OUT_BATCH(cc.cc_state | 1); OUT_BATCH(GEN7_3DSTATE_DS_STATE_POINTERS); OUT_BATCH(cc.ds_state | 1); } static void gen7_emit_multisample(struct intel_batchbuffer *batch) { OUT_BATCH(GEN6_3DSTATE_MULTISAMPLE | 2); OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(GEN6_3DSTATE_SAMPLE_MASK); OUT_BATCH(1); } static void gen7_emit_vs(struct intel_batchbuffer *batch) { OUT_BATCH(GEN7_3DSTATE_BINDING_TABLE_POINTERS_VS); OUT_BATCH(0); OUT_BATCH(GEN7_3DSTATE_SAMPLER_STATE_POINTERS_VS); OUT_BATCH(0); OUT_BATCH(GEN6_3DSTATE_CONSTANT_VS | (7-2)); OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(GEN6_3DSTATE_VS | (6-2)); OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(0); } static void gen7_emit_hs(struct intel_batchbuffer *batch) { OUT_BATCH(GEN7_3DSTATE_CONSTANT_HS | (7-2)); OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(GEN7_3DSTATE_HS | (7-2)); OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(GEN7_3DSTATE_BINDING_TABLE_POINTERS_HS); OUT_BATCH(0); OUT_BATCH(GEN7_3DSTATE_SAMPLER_STATE_POINTERS_HS); OUT_BATCH(0); } static void gen7_emit_gs(struct intel_batchbuffer *batch) { OUT_BATCH(GEN7_3DSTATE_CONSTANT_GS | (7-2)); OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(GEN7_3DSTATE_GS | (7-2)); OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(GEN7_3DSTATE_BINDING_TABLE_POINTERS_GS); OUT_BATCH(0); OUT_BATCH(GEN7_3DSTATE_SAMPLER_STATE_POINTERS_GS); OUT_BATCH(0); } static void gen7_emit_ds(struct intel_batchbuffer *batch) { OUT_BATCH(GEN7_3DSTATE_CONSTANT_DS | (7-2)); OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(GEN7_3DSTATE_DS | (6-2)); OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(GEN7_3DSTATE_BINDING_TABLE_POINTERS_DS); OUT_BATCH(0); OUT_BATCH(GEN7_3DSTATE_SAMPLER_STATE_POINTERS_DS); OUT_BATCH(0); } static void gen7_emit_null_state(struct intel_batchbuffer *batch) { gen7_emit_hs(batch); OUT_BATCH(GEN7_3DSTATE_TE | (4-2)); OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(0); gen7_emit_gs(batch); gen7_emit_ds(batch); gen7_emit_vs(batch); } static void gen7_emit_clip(struct intel_batchbuffer *batch) { OUT_BATCH(GEN6_3DSTATE_CLIP | (4 - 2)); OUT_BATCH(0); OUT_BATCH(0); /* pass-through */ OUT_BATCH(0); } static void gen7_emit_sf(struct intel_batchbuffer *batch) { OUT_BATCH(GEN7_3DSTATE_SBE | (14 - 2)); #ifdef GPU_HANG OUT_BATCH(0 << 22 | 1 << 11 | 1 << 4); #else OUT_BATCH(1 << 22 | 1 << 11 | 1 << 4); #endif OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(GEN6_3DSTATE_SF | (7 - 2)); OUT_BATCH(0); OUT_BATCH(GEN6_3DSTATE_SF_CULL_NONE); // OUT_BATCH(2 << GEN6_3DSTATE_SF_TRIFAN_PROVOKE_SHIFT); OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(0); } static void gen7_emit_ps(struct intel_batchbuffer *batch, uint32_t kernel) { const int max_threads = 86; OUT_BATCH(GEN6_3DSTATE_WM | (3 - 2)); OUT_BATCH(GEN7_WM_DISPATCH_ENABLE | /* XXX: I don't understand the BARYCENTRIC stuff, but it * appears we need it to put our setup data in the place we * expect (g6, see below) */ GEN7_3DSTATE_PS_PERSPECTIVE_PIXEL_BARYCENTRIC); OUT_BATCH(0); OUT_BATCH(GEN6_3DSTATE_CONSTANT_PS | (7-2)); OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(GEN7_3DSTATE_PS | (8-2)); OUT_BATCH(kernel); OUT_BATCH(1 << GEN6_3DSTATE_WM_SAMPLER_COUNT_SHITF | 2 << GEN6_3DSTATE_WM_BINDING_TABLE_ENTRY_COUNT_SHIFT); OUT_BATCH(0); /* scratch space stuff */ if (IS_HASWELL(batch->devid)) { OUT_BATCH((max_threads - 1) << GEN7_3DSTATE_WM_MAX_THREADS_SHIFT | GEN7_3DSTATE_PS_ATTRIBUTE_ENABLED | GEN6_3DSTATE_WM_16_DISPATCH_ENABLE); } else { OUT_BATCH((max_threads - 1) << HSW_3DSTATE_WM_MAX_THREADS_SHIFT | GEN7_3DSTATE_PS_ATTRIBUTE_ENABLED | GEN6_3DSTATE_WM_16_DISPATCH_ENABLE); } OUT_BATCH(6 << GEN6_3DSTATE_WM_DISPATCH_START_GRF_0_SHIFT); OUT_BATCH(0); // kernel 1 OUT_BATCH(0); // kernel 2 } static void gen7_emit_depth(struct intel_batchbuffer *batch) { OUT_BATCH(GEN7_3DSTATE_DEPTH_BUFFER | (7-2)); OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(GEN7_3DSTATE_HIER_DEPTH_BUFFER | (3-2)); OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(GEN7_3DSTATE_STENCIL_BUFFER | (3-2)); OUT_BATCH(0); OUT_BATCH(0); } static void gen7_emit_clear(struct intel_batchbuffer *batch) { OUT_BATCH(GEN7_3DSTATE_CLEAR_PARAMS | (3-2)); OUT_BATCH(0); OUT_BATCH(1); // clear valid } static void gen6_emit_drawing_rectangle(struct intel_batchbuffer *batch, struct scratch_buf *dst) { OUT_BATCH(GEN6_3DSTATE_DRAWING_RECTANGLE | (4 - 2)); OUT_BATCH(0); OUT_BATCH((buf_height(dst) - 1) << 16 | (buf_width(dst) - 1)); OUT_BATCH(0); } /* Vertex elements MUST be defined before this according to spec */ static void gen7_emit_primitive(struct intel_batchbuffer *batch, uint32_t offset) { OUT_BATCH(GEN6_3DPRIMITIVE | (7-2)); OUT_BATCH(_3DPRIM_RECTLIST); OUT_BATCH(3); /* vertex count */ OUT_BATCH(0); /* We're specifying this instead with offset in GEN6_3DSTATE_VERTEX_BUFFERS */ OUT_BATCH(1); /* single instance */ OUT_BATCH(0); /* start instance location */ OUT_BATCH(0); /* index buffer offset, ignored */ } /* The general rule is if it's named gen6 it is directly copied from * gen6_render_copyfunc. * * This sets up most of the 3d pipeline, and most of that to NULL state. The * docs aren't specific about exactly what must be set up NULL, but the general * rule is we could be run at any time, and so the most state we set to NULL, * the better our odds of success. * * +---------------+ <---- 4096 * | ^ | * | | | * | various | * | state | * | | | * |_______|_______| <---- 2048 + ? * | ^ | * | | | * | batch | * | commands | * | | | * | | | * +---------------+ <---- 0 + ? * * The batch commands point to state within tthe batch, so all state offsets should be * 0 < offset < 4096. Both commands and state build upwards, and are constructed * in that order. This means too many batch commands can delete state if not * careful. * */ #define BATCH_STATE_SPLIT 2048 void gen7_render_copyfunc(struct intel_batchbuffer *batch, struct scratch_buf *src, unsigned src_x, unsigned src_y, unsigned width, unsigned height, struct scratch_buf *dst, unsigned dst_x, unsigned dst_y) { uint32_t ps_sampler_state, ps_kernel_off, ps_binding_table; uint32_t scissor_state; uint32_t vertex_buffer; uint32_t batch_end; intel_batchbuffer_flush(batch); batch_align(batch, 8); batch->ptr = &batch->buffer[BATCH_STATE_SPLIT]; ps_binding_table = gen7_bind_surfaces(batch, src, dst); ps_sampler_state = gen7_create_sampler(batch); ps_kernel_off = batch_copy(batch, ps_kernel, sizeof(ps_kernel), 64); vertex_buffer = gen7_fill_vertex_buffer_data(batch, src, src_x, src_y, dst_x, dst_y, width, height); cc.cc_state = gen6_create_cc_state(batch); cc.ds_state = gen6_create_depth_stencil_state(batch); cc.blend_state = gen6_create_blend_state(batch); viewport.cc_state = gen6_create_cc_viewport(batch); viewport.sf_clip_state = gen7_create_sf_clip_viewport(batch); scissor_state = gen6_create_scissor_rect(batch); /* TODO: theree is other state which isn't setup */ assert(batch->ptr < &batch->buffer[4095]); batch->ptr = batch->buffer; /* Start emitting the commands. The order roughly follows the mesa blorp * order */ OUT_BATCH(GEN6_PIPELINE_SELECT | PIPELINE_SELECT_3D); gen6_emit_sip(batch); gen7_emit_push_constants(batch); gen7_emit_state_base_address(batch); OUT_BATCH(GEN7_3DSTATE_VIEWPORT_STATE_POINTERS_CC); OUT_BATCH(viewport.cc_state); OUT_BATCH(GEN7_3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP); OUT_BATCH(viewport.sf_clip_state); gen7_emit_urb(batch); gen7_emit_cc(batch); gen7_emit_multisample(batch); gen7_emit_null_state(batch); OUT_BATCH(GEN7_3DSTATE_STREAMOUT | 1); OUT_BATCH(0); OUT_BATCH(0); gen7_emit_clip(batch); gen7_emit_sf(batch); OUT_BATCH(GEN7_3DSTATE_BINDING_TABLE_POINTERS_PS); OUT_BATCH(ps_binding_table); OUT_BATCH(GEN7_3DSTATE_SAMPLER_STATE_POINTERS_PS); OUT_BATCH(ps_sampler_state); gen7_emit_ps(batch, ps_kernel_off); OUT_BATCH(GEN6_3DSTATE_SCISSOR_STATE_POINTERS); OUT_BATCH(scissor_state); gen7_emit_depth(batch); gen7_emit_clear(batch); gen6_emit_drawing_rectangle(batch, dst); gen7_emit_vertex_buffer(batch, vertex_buffer); gen6_emit_vertex_elements(batch); gen7_emit_primitive(batch, vertex_buffer); OUT_BATCH(MI_BATCH_BUFFER_END); batch_end = batch_align(batch, 8); assert(batch_end < BATCH_STATE_SPLIT); dump_batch(batch); gen6_render_flush(batch, batch_end); intel_batchbuffer_reset(batch); } #if DEBUG_RENDERCPY static void dump_batch(struct intel_batchbuffer *batch) { int fd = open("/tmp/i965-batchbuffers.dump", O_WRONLY | O_CREAT, 0666); if (fd != -1) { write(fd, batch->buffer, 4096); fd = close(fd); } } #endif intel-gpu-tools-1.3/lib/intel_reg.h0000644000175100017510000035523312015774623014253 00000000000000/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810_reg.h,v 1.13 2003/02/06 04:18:04 dawes Exp $ */ /************************************************************************** Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. All Rights Reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sub license, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. **************************************************************************/ /** @file * Register names and fields for Intel graphics. */ /* * Authors: * Keith Whitwell * Eric Anholt * * based on the i740 driver by * Kevin E. Martin * * */ #ifndef _I810_REG_H #define _I810_REG_H /* I/O register offsets */ #define SRX 0x3C4 /* p208 */ #define GRX 0x3CE /* p213 */ #define ARX 0x3C0 /* p224 */ /* VGA Color Palette Registers */ #define DACMASK 0x3C6 /* p232 */ #define DACSTATE 0x3C7 /* p232 */ #define DACRX 0x3C7 /* p233 */ #define DACWX 0x3C8 /* p233 */ #define DACDATA 0x3C9 /* p233 */ /* CRT Controller Registers (CRX) */ #define START_ADDR_HI 0x0C /* p246 */ #define START_ADDR_LO 0x0D /* p247 */ #define VERT_SYNC_END 0x11 /* p249 */ #define EXT_VERT_TOTAL 0x30 /* p257 */ #define EXT_VERT_DISPLAY 0x31 /* p258 */ #define EXT_VERT_SYNC_START 0x32 /* p259 */ #define EXT_VERT_BLANK_START 0x33 /* p260 */ #define EXT_HORIZ_TOTAL 0x35 /* p261 */ #define EXT_HORIZ_BLANK 0x39 /* p261 */ #define EXT_START_ADDR 0x40 /* p262 */ #define EXT_START_ADDR_ENABLE 0x80 #define EXT_OFFSET 0x41 /* p263 */ #define EXT_START_ADDR_HI 0x42 /* p263 */ #define INTERLACE_CNTL 0x70 /* p264 */ #define INTERLACE_ENABLE 0x80 #define INTERLACE_DISABLE 0x00 /* Miscellaneous Output Register */ #define MSR_R 0x3CC /* p207 */ #define MSR_W 0x3C2 /* p207 */ #define IO_ADDR_SELECT 0x01 #define MDA_BASE 0x3B0 /* p207 */ #define CGA_BASE 0x3D0 /* p207 */ /* CR80 - IO Control, p264 */ #define IO_CTNL 0x80 #define EXTENDED_ATTR_CNTL 0x02 #define EXTENDED_CRTC_CNTL 0x01 /* GR10 - Address mapping, p221 */ #define ADDRESS_MAPPING 0x10 #define PAGE_TO_LOCAL_MEM_ENABLE 0x10 #define GTT_MEM_MAP_ENABLE 0x08 #define PACKED_MODE_ENABLE 0x04 #define LINEAR_MODE_ENABLE 0x02 #define PAGE_MAPPING_ENABLE 0x01 #define HOTKEY_VBIOS_SWITCH_BLOCK 0x80 #define HOTKEY_SWITCH 0x20 #define HOTKEY_TOGGLE 0x10 /* Blitter control, p378 */ #define BITBLT_CNTL 0x7000c #define COLEXP_MODE 0x30 #define COLEXP_8BPP 0x00 #define COLEXP_16BPP 0x10 #define COLEXP_24BPP 0x20 #define COLEXP_RESERVED 0x30 #define BITBLT_STATUS 0x01 #define CHDECMISC 0x10111 #define DCC 0x10200 #define C0DRB0 0x10200 #define C0DRB1 0x10202 #define C0DRB2 0x10204 #define C0DRB3 0x10206 #define C0DRA01 0x10208 #define C0DRA23 0x1020a #define C1DRB0 0x10600 #define C1DRB1 0x10602 #define C1DRB2 0x10604 #define C1DRB3 0x10606 #define C1DRA01 0x10608 #define C1DRA23 0x1060a /* p375. */ #define DISPLAY_CNTL 0x70008 #define VGA_WRAP_MODE 0x02 #define VGA_WRAP_AT_256KB 0x00 #define VGA_NO_WRAP 0x02 #define GUI_MODE 0x01 #define STANDARD_VGA_MODE 0x00 #define HIRES_MODE 0x01 /* p375 */ #define PIXPIPE_CONFIG_0 0x70009 #define DAC_8_BIT 0x80 #define DAC_6_BIT 0x00 #define HW_CURSOR_ENABLE 0x10 #define EXTENDED_PALETTE 0x01 /* p375 */ #define PIXPIPE_CONFIG_1 0x7000a #define DISPLAY_COLOR_MODE 0x0F #define DISPLAY_VGA_MODE 0x00 #define DISPLAY_8BPP_MODE 0x02 #define DISPLAY_15BPP_MODE 0x04 #define DISPLAY_16BPP_MODE 0x05 #define DISPLAY_24BPP_MODE 0x06 #define DISPLAY_32BPP_MODE 0x07 /* p375 */ #define PIXPIPE_CONFIG_2 0x7000b #define DISPLAY_GAMMA_ENABLE 0x08 #define DISPLAY_GAMMA_DISABLE 0x00 #define OVERLAY_GAMMA_ENABLE 0x04 #define OVERLAY_GAMMA_DISABLE 0x00 /* p380 */ #define DISPLAY_BASE 0x70020 #define DISPLAY_BASE_MASK 0x03fffffc /* Cursor control registers, pp383-384 */ /* Desktop (845G, 865G) */ #define CURSOR_CONTROL 0x70080 #define CURSOR_ENABLE 0x80000000 #define CURSOR_GAMMA_ENABLE 0x40000000 #define CURSOR_STRIDE_MASK 0x30000000 #define CURSOR_FORMAT_SHIFT 24 #define CURSOR_FORMAT_MASK (0x07 << CURSOR_FORMAT_SHIFT) #define CURSOR_FORMAT_2C (0x00 << CURSOR_FORMAT_SHIFT) #define CURSOR_FORMAT_3C (0x01 << CURSOR_FORMAT_SHIFT) #define CURSOR_FORMAT_4C (0x02 << CURSOR_FORMAT_SHIFT) #define CURSOR_FORMAT_ARGB (0x04 << CURSOR_FORMAT_SHIFT) #define CURSOR_FORMAT_XRGB (0x05 << CURSOR_FORMAT_SHIFT) /* Mobile and i810 */ #define CURSOR_A_CONTROL CURSOR_CONTROL #define CURSOR_ORIGIN_SCREEN 0x00 /* i810 only */ #define CURSOR_ORIGIN_DISPLAY 0x1 /* i810 only */ #define CURSOR_MODE 0x27 #define CURSOR_MODE_DISABLE 0x00 #define CURSOR_MODE_32_4C_AX 0x01 /* i810 only */ #define CURSOR_MODE_64_3C 0x04 #define CURSOR_MODE_64_4C_AX 0x05 #define CURSOR_MODE_64_4C 0x06 #define CURSOR_MODE_64_32B_AX 0x07 #define CURSOR_MODE_64_ARGB_AX (0x20 | CURSOR_MODE_64_32B_AX) #define MCURSOR_PIPE_SELECT (1 << 28) #define MCURSOR_PIPE_A 0x00 #define MCURSOR_PIPE_B (1 << 28) #define MCURSOR_GAMMA_ENABLE (1 << 26) #define MCURSOR_MEM_TYPE_LOCAL (1 << 25) #define CURSOR_BASEADDR 0x70084 #define CURSOR_A_BASE CURSOR_BASEADDR #define CURSOR_BASEADDR_MASK 0x1FFFFF00 #define CURSOR_A_POSITION 0x70088 #define CURSOR_POS_SIGN 0x8000 #define CURSOR_POS_MASK 0x007FF #define CURSOR_X_SHIFT 0 #define CURSOR_Y_SHIFT 16 #define CURSOR_X_LO 0x70088 #define CURSOR_X_HI 0x70089 #define CURSOR_X_POS 0x00 #define CURSOR_X_NEG 0x80 #define CURSOR_Y_LO 0x7008A #define CURSOR_Y_HI 0x7008B #define CURSOR_Y_POS 0x00 #define CURSOR_Y_NEG 0x80 #define CURSOR_A_PALETTE0 0x70090 #define CURSOR_A_PALETTE1 0x70094 #define CURSOR_A_PALETTE2 0x70098 #define CURSOR_A_PALETTE3 0x7009C #define CURSOR_SIZE 0x700A0 #define CURSOR_SIZE_MASK 0x3FF #define CURSOR_SIZE_HSHIFT 0 #define CURSOR_SIZE_VSHIFT 12 #define CURSOR_B_CONTROL 0x700C0 #define CURSOR_B_BASE 0x700C4 #define CURSOR_B_POSITION 0x700C8 #define CURSOR_B_PALETTE0 0x700D0 #define CURSOR_B_PALETTE1 0x700D4 #define CURSOR_B_PALETTE2 0x700D8 #define CURSOR_B_PALETTE3 0x700DC /* Similar registers exist in Device 0 on the i810 (pp55-65), but I'm * not sure they refer to local (graphics) memory. * * These details are for the local memory control registers, * (pp301-310). The test machines are not equiped with local memory, * so nothing is tested. Only a single row seems to be supported. */ #define DRAM_ROW_TYPE 0x3000 #define DRAM_ROW_0 0x01 #define DRAM_ROW_0_SDRAM 0x01 #define DRAM_ROW_0_EMPTY 0x00 #define DRAM_ROW_CNTL_LO 0x3001 #define DRAM_PAGE_MODE_CTRL 0x10 #define DRAM_RAS_TO_CAS_OVRIDE 0x08 #define DRAM_CAS_LATENCY 0x04 #define DRAM_RAS_TIMING 0x02 #define DRAM_RAS_PRECHARGE 0x01 #define DRAM_ROW_CNTL_HI 0x3002 #define DRAM_REFRESH_RATE 0x18 #define DRAM_REFRESH_DISABLE 0x00 #define DRAM_REFRESH_60HZ 0x08 #define DRAM_REFRESH_FAST_TEST 0x10 #define DRAM_REFRESH_RESERVED 0x18 #define DRAM_SMS 0x07 #define DRAM_SMS_NORMAL 0x00 #define DRAM_SMS_NOP_ENABLE 0x01 #define DRAM_SMS_ABPCE 0x02 #define DRAM_SMS_MRCE 0x03 #define DRAM_SMS_CBRCE 0x04 /* p307 */ #define DPMS_SYNC_SELECT 0x5002 #define VSYNC_CNTL 0x08 #define VSYNC_ON 0x00 #define VSYNC_OFF 0x08 #define HSYNC_CNTL 0x02 #define HSYNC_ON 0x00 #define HSYNC_OFF 0x02 #define GPIOA 0x5010 #define GPIOB 0x5014 #define GPIOC 0x5018 #define GPIOD 0x501c #define GPIOE 0x5020 #define GPIOF 0x5024 #define GPIOG 0x5028 #define GPIOH 0x502c # define GPIO_CLOCK_DIR_MASK (1 << 0) # define GPIO_CLOCK_DIR_IN (0 << 1) # define GPIO_CLOCK_DIR_OUT (1 << 1) # define GPIO_CLOCK_VAL_MASK (1 << 2) # define GPIO_CLOCK_VAL_OUT (1 << 3) # define GPIO_CLOCK_VAL_IN (1 << 4) # define GPIO_CLOCK_PULLUP_DISABLE (1 << 5) # define GPIO_DATA_DIR_MASK (1 << 8) # define GPIO_DATA_DIR_IN (0 << 9) # define GPIO_DATA_DIR_OUT (1 << 9) # define GPIO_DATA_VAL_MASK (1 << 10) # define GPIO_DATA_VAL_OUT (1 << 11) # define GPIO_DATA_VAL_IN (1 << 12) # define GPIO_DATA_PULLUP_DISABLE (1 << 13) /* GMBus registers for hardware-assisted (non-bitbanging) I2C access */ #define GMBUS0 0x5100 #define GMBUS1 0x5104 #define GMBUS2 0x5108 #define GMBUS3 0x510c #define GMBUS4 0x5110 #define GMBUS5 0x5120 /* p317, 319 */ #define VCLK2_VCO_M 0x6008 /* treat as 16 bit? (includes msbs) */ #define VCLK2_VCO_N 0x600a #define VCLK2_VCO_DIV_SEL 0x6012 #define VCLK_DIVISOR_VGA0 0x6000 #define VCLK_DIVISOR_VGA1 0x6004 #define VCLK_POST_DIV 0x6010 /** Selects a post divisor of 4 instead of 2. */ # define VGA1_PD_P2_DIV_4 (1 << 15) /** Overrides the p2 post divisor field */ # define VGA1_PD_P1_DIV_2 (1 << 13) # define VGA1_PD_P1_SHIFT 8 /** P1 value is 2 greater than this field */ # define VGA1_PD_P1_MASK (0x1f << 8) /** Selects a post divisor of 4 instead of 2. */ # define VGA0_PD_P2_DIV_4 (1 << 7) /** Overrides the p2 post divisor field */ # define VGA0_PD_P1_DIV_2 (1 << 5) # define VGA0_PD_P1_SHIFT 0 /** P1 value is 2 greater than this field */ # define VGA0_PD_P1_MASK (0x1f << 0) #define POST_DIV_SELECT 0x70 #define POST_DIV_1 0x00 #define POST_DIV_2 0x10 #define POST_DIV_4 0x20 #define POST_DIV_8 0x30 #define POST_DIV_16 0x40 #define POST_DIV_32 0x50 #define VCO_LOOP_DIV_BY_4M 0x00 #define VCO_LOOP_DIV_BY_16M 0x04 /* Instruction Parser Mode Register * - p281 * - 2 new bits. */ #define INST_PM 0x20c0 #define AGP_SYNC_PACKET_FLUSH_ENABLE 0x20 /* reserved */ #define SYNC_PACKET_FLUSH_ENABLE 0x10 #define TWO_D_INST_DISABLE 0x08 #define THREE_D_INST_DISABLE 0x04 #define STATE_VAR_UPDATE_DISABLE 0x02 #define PAL_STIP_DISABLE 0x01 #define GEN6_GLOBAL_DEBUG_ENABLE 0x10 #define MEMMODE 0x20dc /* Instruction parser error register. p279 */ #define IPEIR 0x2088 #define IPEHR 0x208C #define INST_DONE 0x2090 # define IDCT_DONE (1 << 30) # define IQ_DONE (1 << 29) # define PR_DONE (1 << 28) # define VLD_DONE (1 << 27) # define IP_DONE (1 << 26) # define FBC_DONE (1 << 25) # define BINNER_DONE (1 << 24) # define SF_DONE (1 << 23) # define SE_DONE (1 << 22) # define WM_DONE (1 << 21) # define IZ_DONE (1 << 20) # define PERSPECTIVE_INTERP_DONE (1 << 19) # define DISPATCHER_DONE (1 << 18) # define PROJECTION_DONE (1 << 17) # define DEPENDENT_ADDRESS_DONE (1 << 16) # define QUAD_CACHE_DONE (1 << 15) # define TEXTURE_FETCH_DONE (1 << 14) # define TEXTURE_DECOMPRESS_DONE (1 << 13) # define SAMPLER_CACHE_DONE (1 << 12) # define FILTER_DONE (1 << 11) # define BYPASS_FIFO_DONE (1 << 10) # define PS_DONE (1 << 9) # define CC_DONE (1 << 8) # define MAP_FILTER_DONE (1 << 7) # define MAP_L2_IDLE (1 << 6) # define RING_2_ENABLE (1 << 2) # define RING_1_ENABLE (1 << 1) # define RING_0_ENABLE (1 << 0) # define I830_GMBUS_DONE (1 << 26) # define I830_FBC_DONE (1 << 25) # define I830_BINNER_DONE (1 << 24) # define I830_MPEG_DONE (1 << 23) # define I830_MECO_DONE (1 << 22) # define I830_MCD_DONE (1 << 21) # define I830_MCSTP_DONE (1 << 20) # define I830_CC_DONE (1 << 19) # define I830_DG_DONE (1 << 18) # define I830_DCMP_DONE (1 << 17) # define I830_FTCH_DONE (1 << 16) # define I830_IT_DONE (1 << 15) # define I830_MG_DONE (1 << 14) # define I830_MEC_DONE (1 << 13) # define I830_PC_DONE (1 << 12) # define I830_QCC_DONE (1 << 11) # define I830_TB_DONE (1 << 10) # define I830_WM_DONE (1 << 9) # define I830_EF_DONE (1 << 8) # define I830_BLITTER_DONE (1 << 7) # define I830_MAP_L2_DONE (1 << 6) # define I830_SECONDARY_RING_3_DONE (1 << 5) # define I830_SECONDARY_RING_2_DONE (1 << 4) # define I830_SECONDARY_RING_1_DONE (1 << 3) # define I830_SECONDARY_RING_0_DONE (1 << 2) # define I830_PRIMARY_RING_1_DONE (1 << 1) # define I830_PRIMARY_RING_0_DONE (1 << 0) #define NOP_ID 0x2094 #define SCPD0 0x209c /* debug */ #define INST_PS 0x20c4 #define IPEIR_I965 0x2064 /* i965 */ #define IPEHR_I965 0x2068 /* i965 */ #define INST_DONE_I965 0x206c # define I965_ROW_0_EU_0_DONE (1 << 31) # define I965_ROW_0_EU_1_DONE (1 << 30) # define I965_ROW_0_EU_2_DONE (1 << 29) # define I965_ROW_0_EU_3_DONE (1 << 28) # define I965_ROW_1_EU_0_DONE (1 << 27) # define I965_ROW_1_EU_1_DONE (1 << 26) # define I965_ROW_1_EU_2_DONE (1 << 25) # define I965_ROW_1_EU_3_DONE (1 << 24) # define I965_SF_DONE (1 << 23) # define I965_SE_DONE (1 << 22) # define I965_WM_DONE (1 << 21) # define I965_DISPATCHER_DONE (1 << 18) # define I965_PROJECTION_DONE (1 << 17) # define I965_DG_DONE (1 << 16) # define I965_QUAD_CACHE_DONE (1 << 15) # define I965_TEXTURE_FETCH_DONE (1 << 14) # define I965_TEXTURE_DECOMPRESS_DONE (1 << 13) # define I965_SAMPLER_CACHE_DONE (1 << 12) # define I965_FILTER_DONE (1 << 11) # define I965_BYPASS_DONE (1 << 10) # define I965_PS_DONE (1 << 9) # define I965_CC_DONE (1 << 8) # define I965_MAP_FILTER_DONE (1 << 7) # define I965_MAP_L2_IDLE (1 << 6) # define I965_MA_ROW_0_DONE (1 << 5) # define I965_MA_ROW_1_DONE (1 << 4) # define I965_IC_ROW_0_DONE (1 << 3) # define I965_IC_ROW_1_DONE (1 << 2) # define I965_CP_DONE (1 << 1) # define I965_RING_0_ENABLE (1 << 0) # define ILK_ROW_0_EU_0_DONE (1 << 31) # define ILK_ROW_0_EU_1_DONE (1 << 30) # define ILK_ROW_0_EU_2_DONE (1 << 29) # define ILK_ROW_0_EU_3_DONE (1 << 28) # define ILK_ROW_1_EU_0_DONE (1 << 27) # define ILK_ROW_1_EU_1_DONE (1 << 26) # define ILK_ROW_1_EU_2_DONE (1 << 25) # define ILK_ROW_1_EU_3_DONE (1 << 24) # define ILK_ROW_2_EU_0_DONE (1 << 23) # define ILK_ROW_2_EU_1_DONE (1 << 22) # define ILK_ROW_2_EU_2_DONE (1 << 21) # define ILK_ROW_2_EU_3_DONE (1 << 20) # define ILK_VCP_DONE (1 << 19) # define ILK_ROW_0_MATH_DONE (1 << 18) # define ILK_ROW_1_MATH_DONE (1 << 17) # define ILK_ROW_2_MATH_DONE (1 << 16) # define ILK_VC1_DONE (1 << 15) # define ILK_ROW_0_MA_DONE (1 << 14) # define ILK_ROW_1_MA_DONE (1 << 13) # define ILK_ROW_2_MA_DONE (1 << 12) # define ILK_ROW_0_ISC_DONE (1 << 11) # define ILK_ROW_1_ISC_DONE (1 << 10) # define ILK_ROW_2_ISC_DONE (1 << 9) # define ILK_VFE_DONE (1 << 8) # define ILK_TD_DONE (1 << 7) # define ILK_SVTS_DONE (1 << 6) # define ILK_TS_DONE (1 << 5) # define ILK_GW_DONE (1 << 4) # define ILK_AI_DONE (1 << 3) # define ILK_AC_DONE (1 << 2) # define ILK_AM_DONE (1 << 1) #define GEN6_INSTDONE_1 0x206c # define GEN6_MA_3_DONE (1 << 31) # define GEN6_EU_32_DONE (1 << 30) # define GEN6_EU_31_DONE (1 << 29) # define GEN6_EU_30_DONE (1 << 28) # define GEN6_MA_2_DONE (1 << 27) # define GEN6_EU_22_DONE (1 << 26) # define GEN6_EU_21_DONE (1 << 25) # define GEN6_EU_20_DONE (1 << 24) # define GEN6_MA_1_DONE (1 << 23) # define GEN6_EU_12_DONE (1 << 22) # define GEN6_EU_11_DONE (1 << 21) # define GEN6_EU_10_DONE (1 << 20) # define GEN6_MA_0_DONE (1 << 19) # define GEN6_EU_02_DONE (1 << 18) # define GEN6_EU_01_DONE (1 << 17) # define GEN6_EU_00_DONE (1 << 16) # define GEN6_IC_3_DONE (1 << 15) # define GEN6_IC_2_DONE (1 << 14) # define GEN6_IC_1_DONE (1 << 13) # define GEN6_IC_0_DONE (1 << 12) # define GEN6_ISC_10_DONE (1 << 11) # define GEN6_ISC_32_DONE (1 << 10) # define GEN6_VSC_DONE (1 << 9) # define GEN6_IEF_DONE (1 << 8) # define GEN6_VFE_DONE (1 << 7) # define GEN6_TD_DONE (1 << 6) # define GEN6_TS_DONE (1 << 4) # define GEN6_GW_DONE (1 << 3) # define GEN6_HIZ_DONE (1 << 2) # define GEN6_AVS_DONE (1 << 1) #define INST_PS_I965 0x2070 /* Current active ring head address: */ #define ACTHD_I965 0x2074 #define ACTHD 0x20C8 /* Current primary/secondary DMA fetch addresses: */ #define DMA_FADD_P 0x2078 #define DMA_FADD_S 0x20d4 #define INST_DONE_1 0x207c # define I965_GW_CS_DONE_CR (1 << 19) # define I965_SVSM_CS_DONE_CR (1 << 18) # define I965_SVDW_CS_DONE_CR (1 << 17) # define I965_SVDR_CS_DONE_CR (1 << 16) # define I965_SVRW_CS_DONE_CR (1 << 15) # define I965_SVRR_CS_DONE_CR (1 << 14) # define I965_SVTW_CS_DONE_CR (1 << 13) # define I965_MASM_CS_DONE_CR (1 << 12) # define I965_MASF_CS_DONE_CR (1 << 11) # define I965_MAW_CS_DONE_CR (1 << 10) # define I965_EM1_CS_DONE_CR (1 << 9) # define I965_EM0_CS_DONE_CR (1 << 8) # define I965_UC1_CS_DONE (1 << 7) # define I965_UC0_CS_DONE (1 << 6) # define I965_URB_CS_DONE (1 << 5) # define I965_ISC_CS_DONE (1 << 4) # define I965_CL_CS_DONE (1 << 3) # define I965_GS_CS_DONE (1 << 2) # define I965_VS0_CS_DONE (1 << 1) # define I965_VF_CS_DONE (1 << 0) # define G4X_BCS_DONE (1 << 31) # define G4X_CS_DONE (1 << 30) # define G4X_MASF_DONE (1 << 29) # define G4X_SVDW_DONE (1 << 28) # define G4X_SVDR_DONE (1 << 27) # define G4X_SVRW_DONE (1 << 26) # define G4X_SVRR_DONE (1 << 25) # define G4X_ISC_DONE (1 << 24) # define G4X_MT_DONE (1 << 23) # define G4X_RC_DONE (1 << 22) # define G4X_DAP_DONE (1 << 21) # define G4X_MAWB_DONE (1 << 20) # define G4X_MT_IDLE (1 << 19) # define G4X_GBLT_BUSY (1 << 18) # define G4X_SVSM_DONE (1 << 17) # define G4X_MASM_DONE (1 << 16) # define G4X_QC_DONE (1 << 15) # define G4X_FL_DONE (1 << 14) # define G4X_SC_DONE (1 << 13) # define G4X_DM_DONE (1 << 12) # define G4X_FT_DONE (1 << 11) # define G4X_DG_DONE (1 << 10) # define G4X_SI_DONE (1 << 9) # define G4X_SO_DONE (1 << 8) # define G4X_PL_DONE (1 << 7) # define G4X_WIZ_DONE (1 << 6) # define G4X_URB_DONE (1 << 5) # define G4X_SF_DONE (1 << 4) # define G4X_CL_DONE (1 << 3) # define G4X_GS_DONE (1 << 2) # define G4X_VS0_DONE (1 << 1) # define G4X_VF_DONE (1 << 0) #define GEN6_INSTDONE_2 0x207c # define GEN6_GAM_DONE (1 << 31) # define GEN6_CS_DONE (1 << 30) # define GEN6_WMBE_DONE (1 << 29) # define GEN6_SVRW_DONE (1 << 28) # define GEN6_RCC_DONE (1 << 27) # define GEN6_SVG_DONE (1 << 26) # define GEN6_ISC_DONE (1 << 25) # define GEN6_MT_DONE (1 << 24) # define GEN6_RCPFE_DONE (1 << 23) # define GEN6_RCPBE_DONE (1 << 22) # define GEN6_VDI_DONE (1 << 21) # define GEN6_RCZ_DONE (1 << 20) # define GEN6_DAP_DONE (1 << 19) # define GEN6_PSD_DONE (1 << 18) # define GEN6_IZ_DONE (1 << 17) # define GEN6_WMFE_DONE (1 << 16) # define GEN6_SVSM_DONE (1 << 15) # define GEN6_QC_DONE (1 << 14) # define GEN6_FL_DONE (1 << 13) # define GEN6_SC_DONE (1 << 12) # define GEN6_DM_DONE (1 << 11) # define GEN6_FT_DONE (1 << 10) # define GEN6_DG_DONE (1 << 9) # define GEN6_SI_DONE (1 << 8) # define GEN6_SO_DONE (1 << 7) # define GEN6_PL_DONE (1 << 6) # define GEN6_VME_DONE (1 << 5) # define GEN6_SF_DONE (1 << 4) # define GEN6_CL_DONE (1 << 3) # define GEN6_GS_DONE (1 << 2) # define GEN6_VS0_DONE (1 << 1) # define GEN6_VF_DONE (1 << 0) #define CACHE_MODE_0 0x2120 #define CACHE_MODE_1 0x2124 #define MI_MODE 0x209c #define MI_DISPLAY_POWER_DOWN 0x20e0 #define MI_ARB_STATE 0x20e4 #define MI_RDRET_STATE 0x20fc /* Start addresses for each of the primary rings: */ #define PR0_STR 0x20f0 #define PR1_STR 0x20f4 #define PR2_STR 0x20f8 #define WIZ_CTL 0x7c00 #define WIZ_CTL_SINGLE_SUBSPAN (1<<6) #define WIZ_CTL_IGNORE_STALLS (1<<5) #define SVG_WORK_CTL 0x7408 #define TS_CTL 0x7e00 #define TS_MUX_ERR_CODE (0<<8) #define TS_MUX_URB_0 (1<<8) #define TS_MUX_DISPATCH_ID_0 (10<<8) #define TS_MUX_ERR_CODE_VALID (15<<8) #define TS_MUX_TID_0 (16<<8) #define TS_MUX_EUID_0 (18<<8) #define TS_MUX_FFID_0 (22<<8) #define TS_MUX_EOT (26<<8) #define TS_MUX_SIDEBAND_0 (27<<8) #define TS_SNAP_ALL_CHILD (1<<2) #define TS_SNAP_ALL_ROOT (1<<1) #define TS_SNAP_ENABLE (1<<0) #define TS_DEBUG_DATA 0x7e0c #define TD_CTL 0x8000 #define TD_CTL2 0x8004 #define ECOSKPD 0x21d0 #define EXCC 0x2028 /* I965 debug regs: */ #define IA_VERTICES_COUNT_QW 0x2310 #define IA_PRIMITIVES_COUNT_QW 0x2318 #define VS_INVOCATION_COUNT_QW 0x2320 #define GS_INVOCATION_COUNT_QW 0x2328 #define GS_PRIMITIVES_COUNT_QW 0x2330 #define CL_INVOCATION_COUNT_QW 0x2338 #define CL_PRIMITIVES_COUNT_QW 0x2340 #define PS_INVOCATION_COUNT_QW 0x2348 #define PS_DEPTH_COUNT_QW 0x2350 #define TIMESTAMP_QW 0x2358 #define CLKCMP_QW 0x2360 /* General error reporting regs, p296 */ #define EIR 0x20B0 #define EMR 0x20B4 #define ESR 0x20B8 # define ERR_VERTEX_MAX (1 << 5) /* lpt/cst */ # define ERR_PGTBL_ERROR (1 << 4) # define ERR_DISPLAY_OVERLAY_UNDERRUN (1 << 3) # define ERR_MAIN_MEMORY_REFRESH (1 << 1) # define ERR_INSTRUCTION_ERROR (1 << 0) /* Interrupt Control Registers * - new bits for i810 * - new register hwstam (mask) */ #define HWS_PGA 0x2080 #define PWRCTXA 0x2088 /* 965GM+ only */ #define PWRCTX_EN (1<<0) #define HWSTAM 0x2098 /* p290 */ #define IER 0x20a0 /* p291 */ #define IIR 0x20a4 /* p292 */ #define IMR 0x20a8 /* p293 */ #define ISR 0x20ac /* p294 */ #define HW_ERROR 0x8000 #define SYNC_STATUS_TOGGLE 0x1000 #define DPY_0_FLIP_PENDING 0x0800 #define DPY_1_FLIP_PENDING 0x0400 /* not implemented on i810 */ #define OVL_0_FLIP_PENDING 0x0200 #define OVL_1_FLIP_PENDING 0x0100 /* not implemented on i810 */ #define DPY_0_VBLANK 0x0080 #define DPY_0_EVENT 0x0040 #define DPY_1_VBLANK 0x0020 /* not implemented on i810 */ #define DPY_1_EVENT 0x0010 /* not implemented on i810 */ #define HOST_PORT_EVENT 0x0008 /* */ #define CAPTURE_EVENT 0x0004 /* */ #define USER_DEFINED 0x0002 #define BREAKPOINT 0x0001 #define INTR_RESERVED (0x6000 | \ DPY_1_FLIP_PENDING | \ OVL_1_FLIP_PENDING | \ DPY_1_VBLANK | \ DPY_1_EVENT | \ HOST_PORT_EVENT | \ CAPTURE_EVENT ) /* FIFO Watermark and Burst Length Control Register * * - different offset and contents on i810 (p299) (fewer bits per field) * - some overlay fields added * - what does it all mean? */ #define FWATER_BLC 0x20d8 #define FWATER_BLC2 0x20dc #define MM_BURST_LENGTH 0x00700000 #define MM_FIFO_WATERMARK 0x0001F000 #define LM_BURST_LENGTH 0x00000700 #define LM_FIFO_WATERMARK 0x0000001F /* Fence/Tiling ranges [0..7] */ #define FENCE 0x2000 #define FENCE_NR 8 #define FENCE_NEW 0x3000 #define FENCE_NEW_NR 16 #define FENCE_LINEAR 0 #define FENCE_XMAJOR 1 #define FENCE_YMAJOR 2 #define I915G_FENCE_START_MASK 0x0ff00000 #define I830_FENCE_START_MASK 0x07f80000 #define FENCE_START_MASK 0x03F80000 #define FENCE_X_MAJOR 0x00000000 #define FENCE_Y_MAJOR 0x00001000 #define FENCE_SIZE_MASK 0x00000700 #define FENCE_SIZE_512K 0x00000000 #define FENCE_SIZE_1M 0x00000100 #define FENCE_SIZE_2M 0x00000200 #define FENCE_SIZE_4M 0x00000300 #define FENCE_SIZE_8M 0x00000400 #define FENCE_SIZE_16M 0x00000500 #define FENCE_SIZE_32M 0x00000600 #define FENCE_SIZE_64M 0x00000700 #define I915G_FENCE_SIZE_1M 0x00000000 #define I915G_FENCE_SIZE_2M 0x00000100 #define I915G_FENCE_SIZE_4M 0x00000200 #define I915G_FENCE_SIZE_8M 0x00000300 #define I915G_FENCE_SIZE_16M 0x00000400 #define I915G_FENCE_SIZE_32M 0x00000500 #define I915G_FENCE_SIZE_64M 0x00000600 #define I915G_FENCE_SIZE_128M 0x00000700 #define I965_FENCE_X_MAJOR 0x00000000 #define I965_FENCE_Y_MAJOR 0x00000002 #define FENCE_PITCH_1 0x00000000 #define FENCE_PITCH_2 0x00000010 #define FENCE_PITCH_4 0x00000020 #define FENCE_PITCH_8 0x00000030 #define FENCE_PITCH_16 0x00000040 #define FENCE_PITCH_32 0x00000050 #define FENCE_PITCH_64 0x00000060 #define FENCE_VALID 0x00000001 /* Registers to control page table, p274 */ #define PGETBL_CTL 0x2020 #define PGETBL_ADDR_MASK 0xFFFFF000 #define PGETBL_ENABLE_MASK 0x00000001 #define PGETBL_ENABLED 0x00000001 /** Added in 965G, this field has the actual size of the global GTT */ #define PGETBL_SIZE_MASK 0x0000000e #define PGETBL_SIZE_512KB (0 << 1) #define PGETBL_SIZE_256KB (1 << 1) #define PGETBL_SIZE_128KB (2 << 1) #define PGETBL_SIZE_1MB (3 << 1) #define PGETBL_SIZE_2MB (4 << 1) #define PGETBL_SIZE_1_5MB (5 << 1) #define G33_PGETBL_SIZE_MASK (3 << 8) #define G33_PGETBL_SIZE_1M (1 << 8) #define G33_PGETBL_SIZE_2M (2 << 8) #define I830_PTE_BASE 0x10000 #define PTE_ADDRESS_MASK 0xfffff000 #define PTE_ADDRESS_MASK_HIGH 0x000000f0 /* i915+ */ #define PTE_MAPPING_TYPE_UNCACHED (0 << 1) #define PTE_MAPPING_TYPE_DCACHE (1 << 1) /* i830 only */ #define PTE_MAPPING_TYPE_CACHED (3 << 1) #define PTE_MAPPING_TYPE_MASK (3 << 1) #define PTE_VALID (1 << 0) /** @defgroup PGE_ERR * @{ */ /** Page table debug register for i845 */ #define PGE_ERR 0x2024 #define PGE_ERR_ADDR_MASK 0xFFFFF000 #define PGE_ERR_ID_MASK 0x00000038 #define PGE_ERR_CAPTURE 0x00000000 #define PGE_ERR_OVERLAY 0x00000008 #define PGE_ERR_DISPLAY 0x00000010 #define PGE_ERR_HOST 0x00000018 #define PGE_ERR_RENDER 0x00000020 #define PGE_ERR_BLITTER 0x00000028 #define PGE_ERR_MAPPING 0x00000030 #define PGE_ERR_CMD_PARSER 0x00000038 #define PGE_ERR_TYPE_MASK 0x00000007 #define PGE_ERR_INV_TABLE 0x00000000 #define PGE_ERR_INV_PTE 0x00000001 #define PGE_ERR_MIXED_TYPES 0x00000002 #define PGE_ERR_PAGE_MISS 0x00000003 #define PGE_ERR_ILLEGAL_TRX 0x00000004 #define PGE_ERR_LOCAL_MEM 0x00000005 #define PGE_ERR_TILED 0x00000006 /** @} */ /** @defgroup PGTBL_ER * @{ */ /** Page table debug register for i945 */ # define PGTBL_ER 0x2024 # define PGTBL_ERR_MT_TILING (1 << 27) # define PGTBL_ERR_MT_GTT_PTE (1 << 26) # define PGTBL_ERR_LC_TILING (1 << 25) # define PGTBL_ERR_LC_GTT_PTE (1 << 24) # define PGTBL_ERR_BIN_VERTEXDATA_GTT_PTE (1 << 23) # define PGTBL_ERR_BIN_INSTRUCTION_GTT_PTE (1 << 22) # define PGTBL_ERR_CS_VERTEXDATA_GTT_PTE (1 << 21) # define PGTBL_ERR_CS_INSTRUCTION_GTT_PTE (1 << 20) # define PGTBL_ERR_CS_GTT (1 << 19) # define PGTBL_ERR_OVERLAY_TILING (1 << 18) # define PGTBL_ERR_OVERLAY_GTT_PTE (1 << 16) # define PGTBL_ERR_DISPC_TILING (1 << 14) # define PGTBL_ERR_DISPC_GTT_PTE (1 << 12) # define PGTBL_ERR_DISPB_TILING (1 << 10) # define PGTBL_ERR_DISPB_GTT_PTE (1 << 8) # define PGTBL_ERR_DISPA_TILING (1 << 6) # define PGTBL_ERR_DISPA_GTT_PTE (1 << 4) # define PGTBL_ERR_HOST_PTE_DATA (1 << 1) # define PGTBL_ERR_HOST_GTT_PTE (1 << 0) /** @} */ /* Ring buffer registers, p277, overview p19 */ #define LP_RING 0x2030 #define HP_RING 0x2040 #define RING_TAIL 0x00 #define TAIL_ADDR 0x000FFFF8 #define I830_TAIL_MASK 0x001FFFF8 #define RING_HEAD 0x04 #define HEAD_WRAP_COUNT 0xFFE00000 #define HEAD_WRAP_ONE 0x00200000 #define HEAD_ADDR 0x001FFFFC #define I830_HEAD_MASK 0x001FFFFC #define RING_START 0x08 #define START_ADDR 0x03FFFFF8 #define I830_RING_START_MASK 0xFFFFF000 #define RING_LEN 0x0C #define RING_NR_PAGES 0x001FF000 #define I830_RING_NR_PAGES 0x001FF000 #define RING_REPORT_MASK 0x00000006 #define RING_REPORT_64K 0x00000002 #define RING_REPORT_128K 0x00000004 #define RING_NO_REPORT 0x00000000 #define RING_VALID_MASK 0x00000001 #define RING_VALID 0x00000001 #define RING_INVALID 0x00000000 /* BitBlt Instructions * * There are many more masks & ranges yet to add. */ #define BR00_BITBLT_CLIENT 0x40000000 #define BR00_OP_COLOR_BLT 0x10000000 #define BR00_OP_SRC_COPY_BLT 0x10C00000 #define BR00_OP_FULL_BLT 0x11400000 #define BR00_OP_MONO_SRC_BLT 0x11800000 #define BR00_OP_MONO_SRC_COPY_BLT 0x11000000 #define BR00_OP_MONO_PAT_BLT 0x11C00000 #define BR00_OP_MONO_SRC_COPY_IMMEDIATE_BLT (0x61 << 22) #define BR00_OP_TEXT_IMMEDIATE_BLT 0xc000000 #define BR00_TPCY_DISABLE 0x00000000 #define BR00_TPCY_ENABLE 0x00000010 #define BR00_TPCY_ROP 0x00000000 #define BR00_TPCY_NO_ROP 0x00000020 #define BR00_TPCY_EQ 0x00000000 #define BR00_TPCY_NOT_EQ 0x00000040 #define BR00_PAT_MSB_FIRST 0x00000000 /* ? */ #define BR00_PAT_VERT_ALIGN 0x000000e0 #define BR00_LENGTH 0x0000000F #define BR09_DEST_ADDR 0x03FFFFFF #define BR11_SOURCE_PITCH 0x00003FFF #define BR12_SOURCE_ADDR 0x03FFFFFF #define BR13_SOLID_PATTERN 0x80000000 #define BR13_RIGHT_TO_LEFT 0x40000000 #define BR13_LEFT_TO_RIGHT 0x00000000 #define BR13_MONO_TRANSPCY 0x20000000 #define BR13_MONO_PATN_TRANS 0x10000000 #define BR13_USE_DYN_DEPTH 0x04000000 #define BR13_DYN_8BPP 0x00000000 #define BR13_DYN_16BPP 0x01000000 #define BR13_DYN_24BPP 0x02000000 #define BR13_ROP_MASK 0x00FF0000 #define BR13_DEST_PITCH 0x0000FFFF #define BR13_PITCH_SIGN_BIT 0x00008000 #define BR14_DEST_HEIGHT 0xFFFF0000 #define BR14_DEST_WIDTH 0x0000FFFF #define BR15_PATTERN_ADDR 0x03FFFFFF #define BR16_SOLID_PAT_COLOR 0x00FFFFFF #define BR16_BACKGND_PAT_CLR 0x00FFFFFF #define BR17_FGND_PAT_CLR 0x00FFFFFF #define BR18_SRC_BGND_CLR 0x00FFFFFF #define BR19_SRC_FGND_CLR 0x00FFFFFF /* Instruction parser instructions */ #define INST_PARSER_CLIENT 0x00000000 #define INST_OP_FLUSH 0x02000000 #define INST_FLUSH_MAP_CACHE 0x00000001 #define GFX_OP_USER_INTERRUPT ((0<<29)|(2<<23)) /* Registers in the i810 host-pci bridge pci config space which affect * the i810 graphics operations. */ #define SMRAM_MISCC 0x70 #define GMS 0x000000c0 #define GMS_DISABLE 0x00000000 #define GMS_ENABLE_BARE 0x00000040 #define GMS_ENABLE_512K 0x00000080 #define GMS_ENABLE_1M 0x000000c0 #define USMM 0x00000030 #define USMM_DISABLE 0x00000000 #define USMM_TSEG_ZERO 0x00000010 #define USMM_TSEG_512K 0x00000020 #define USMM_TSEG_1M 0x00000030 #define GFX_MEM_WIN_SIZE 0x00010000 #define GFX_MEM_WIN_32M 0x00010000 #define GFX_MEM_WIN_64M 0x00000000 /* Overkill? I don't know. Need to figure out top of mem to make the * SMRAM calculations come out. Linux seems to have problems * detecting it all on its own, so this seems a reasonable double * check to any user supplied 'mem=...' boot param. * * ... unfortunately this reg doesn't work according to spec on the * test hardware. */ #define WHTCFG_PAMR_DRP 0x50 #define SYS_DRAM_ROW_0_SHIFT 16 #define SYS_DRAM_ROW_1_SHIFT 20 #define DRAM_MASK 0x0f #define DRAM_VALUE_0 0 #define DRAM_VALUE_1 8 /* No 2 value defined */ #define DRAM_VALUE_3 16 #define DRAM_VALUE_4 16 #define DRAM_VALUE_5 24 #define DRAM_VALUE_6 32 #define DRAM_VALUE_7 32 #define DRAM_VALUE_8 48 #define DRAM_VALUE_9 64 #define DRAM_VALUE_A 64 #define DRAM_VALUE_B 96 #define DRAM_VALUE_C 128 #define DRAM_VALUE_D 128 #define DRAM_VALUE_E 192 #define DRAM_VALUE_F 256 /* nice one, geezer */ #define LM_FREQ_MASK 0x10 #define LM_FREQ_133 0x10 #define LM_FREQ_100 0x00 /* These are 3d state registers, but the state is invarient, so we let * the X server handle it: */ /* GFXRENDERSTATE_COLOR_CHROMA_KEY, p135 */ #define GFX_OP_COLOR_CHROMA_KEY ((0x3<<29)|(0x1d<<24)|(0x2<<16)|0x1) #define CC1_UPDATE_KILL_WRITE (1<<28) #define CC1_ENABLE_KILL_WRITE (1<<27) #define CC1_DISABLE_KILL_WRITE 0 #define CC1_UPDATE_COLOR_IDX (1<<26) #define CC1_UPDATE_CHROMA_LOW (1<<25) #define CC1_UPDATE_CHROMA_HI (1<<24) #define CC1_CHROMA_LOW_MASK ((1<<24)-1) #define CC2_COLOR_IDX_SHIFT 24 #define CC2_COLOR_IDX_MASK (0xff<<24) #define CC2_CHROMA_HI_MASK ((1<<24)-1) #define GFX_CMD_CONTEXT_SEL ((0<<29)|(0x5<<23)) #define CS_UPDATE_LOAD (1<<17) #define CS_UPDATE_USE (1<<16) #define CS_UPDATE_LOAD (1<<17) #define CS_LOAD_CTX0 0 #define CS_LOAD_CTX1 (1<<8) #define CS_USE_CTX0 0 #define CS_USE_CTX1 (1<<0) /* I810 LCD/TV registers */ #define LCD_TV_HTOTAL 0x60000 #define LCD_TV_C 0x60018 #define LCD_TV_OVRACT 0x6001C #define LCD_TV_ENABLE (1 << 31) #define LCD_TV_VGAMOD (1 << 28) /* I830 CRTC registers */ #define HTOTAL_A 0x60000 #define HBLANK_A 0x60004 #define HSYNC_A 0x60008 #define VTOTAL_A 0x6000c #define VBLANK_A 0x60010 #define VSYNC_A 0x60014 #define PIPEASRC 0x6001c #define BCLRPAT_A 0x60020 #define VSYNCSHIFT_A 0x60028 #define HTOTAL_B 0x61000 #define HBLANK_B 0x61004 #define HSYNC_B 0x61008 #define VTOTAL_B 0x6100c #define VBLANK_B 0x61010 #define VSYNC_B 0x61014 #define PIPEBSRC 0x6101c #define BCLRPAT_B 0x61020 #define VSYNCSHIFT_B 0x61028 #define HTOTAL_C 0x62000 #define HBLANK_C 0x62004 #define HSYNC_C 0x62008 #define VTOTAL_C 0x6200c #define VBLANK_C 0x62010 #define VSYNC_C 0x62014 #define PIPECSRC 0x6201c #define BCLRPAT_C 0x62020 #define VSYNCSHIFT_C 0x62028 #define PP_STATUS 0x61200 # define PP_ON (1 << 31) /** * Indicates that all dependencies of the panel are on: * * - PLL enabled * - pipe enabled * - LVDS/DVOB/DVOC on */ # define PP_READY (1 << 30) # define PP_SEQUENCE_NONE (0 << 28) # define PP_SEQUENCE_ON (1 << 28) # define PP_SEQUENCE_OFF (2 << 28) # define PP_SEQUENCE_MASK 0x30000000 #define PP_CONTROL 0x61204 # define POWER_DOWN_ON_RESET (1 << 1) # define POWER_TARGET_ON (1 << 0) #define PP_ON_DELAYS 0x61208 #define PP_OFF_DELAYS 0x6120c #define PP_DIVISOR 0x61210 #define PFIT_CONTROL 0x61230 # define PFIT_ENABLE (1 << 31) /* Pre-965 */ # define VERT_INTERP_DISABLE (0 << 10) # define VERT_INTERP_BILINEAR (1 << 10) # define VERT_INTERP_MASK (3 << 10) # define VERT_AUTO_SCALE (1 << 9) # define HORIZ_INTERP_DISABLE (0 << 6) # define HORIZ_INTERP_BILINEAR (1 << 6) # define HORIZ_INTERP_MASK (3 << 6) # define HORIZ_AUTO_SCALE (1 << 5) # define PANEL_8TO6_DITHER_ENABLE (1 << 3) /* 965+ */ # define PFIT_PIPE_MASK (3 << 29) # define PFIT_PIPE_SHIFT 29 # define PFIT_SCALING_MODE_MASK (7 << 26) # define PFIT_SCALING_AUTO (0 << 26) # define PFIT_SCALING_PROGRAMMED (1 << 26) # define PFIT_SCALING_PILLAR (2 << 26) # define PFIT_SCALING_LETTER (3 << 26) # define PFIT_FILTER_SELECT_MASK (3 << 24) # define PFIT_FILTER_FUZZY (0 << 24) # define PFIT_FILTER_CRISP (1 << 24) # define PFIT_FILTER_MEDIAN (2 << 24) #define PFIT_PGM_RATIOS 0x61234 /* Pre-965 */ # define PFIT_VERT_SCALE_SHIFT 20 # define PFIT_VERT_SCALE_MASK 0xfff00000 # define PFIT_HORIZ_SCALE_SHIFT 4 # define PFIT_HORIZ_SCALE_MASK 0x0000fff0 /* 965+ */ # define PFIT_VERT_SCALE_SHIFT_965 16 # define PFIT_VERT_SCALE_MASK_965 0x1fff0000 # define PFIT_HORIZ_SCALE_SHIFT_965 0 # define PFIT_HORIZ_SCALE_MASK_965 0x00001fff #define DPLL_A 0x06014 #define DPLL_B 0x06018 # define DPLL_VCO_ENABLE (1 << 31) # define DPLL_DVO_HIGH_SPEED (1 << 30) # define DPLL_SYNCLOCK_ENABLE (1 << 29) # define DPLL_VGA_MODE_DIS (1 << 28) # define DPLLB_MODE_DAC_SERIAL (1 << 26) /* i915 */ # define DPLLB_MODE_LVDS (2 << 26) /* i915 */ # define DPLL_MODE_MASK (3 << 26) # define DPLL_DAC_SERIAL_P2_CLOCK_DIV_10 (0 << 24) /* i915 */ # define DPLL_DAC_SERIAL_P2_CLOCK_DIV_5 (1 << 24) /* i915 */ # define DPLLB_LVDS_P2_CLOCK_DIV_14 (0 << 24) /* i915 */ # define DPLLB_LVDS_P2_CLOCK_DIV_7 (1 << 24) /* i915 */ # define DPLL_P2_CLOCK_DIV_MASK 0x03000000 /* i915 */ # define DPLL_FPA01_P1_POST_DIV_MASK 0x00ff0000 /* i915 */ # define DPLL_FPA01_P1_POST_DIV_MASK_IGD 0x00ff8000 /* IGD */ /** * The i830 generation, in DAC/serial mode, defines p1 as two plus this * bitfield, or just 2 if PLL_P1_DIVIDE_BY_TWO is set. */ # define DPLL_FPA01_P1_POST_DIV_MASK_I830 0x001f0000 /** * The i830 generation, in LVDS mode, defines P1 as the bit number set within * this field (only one bit may be set). */ # define DPLL_FPA01_P1_POST_DIV_MASK_I830_LVDS 0x003f0000 # define DPLL_FPA01_P1_POST_DIV_SHIFT 16 # define DPLL_FPA01_P1_POST_DIV_SHIFT_IGD 15 # define PLL_P2_DIVIDE_BY_4 (1 << 23) /* i830, required in DVO non-gang */ # define PLL_P1_DIVIDE_BY_TWO (1 << 21) /* i830 */ # define PLL_REF_INPUT_DREFCLK (0 << 13) # define PLL_REF_INPUT_TVCLKINA (1 << 13) /* i830 */ # define PLL_REF_INPUT_SUPER_SSC (1 << 13) /* Ironlake: 120M SSC */ # define PLL_REF_INPUT_TVCLKINBC (2 << 13) /* SDVO TVCLKIN */ # define PLLB_REF_INPUT_SPREADSPECTRUMIN (3 << 13) # define PLL_REF_INPUT_MASK (3 << 13) # define PLL_REF_INPUT_DMICLK (5 << 13) /* Ironlake: DMI refclk */ # define PLL_LOAD_PULSE_PHASE_SHIFT 9 /* * Parallel to Serial Load Pulse phase selection. * Selects the phase for the 10X DPLL clock for the PCIe * digital display port. The range is 4 to 13; 10 or more * is just a flip delay. The default is 6 */ # define PLL_LOAD_PULSE_PHASE_MASK (0xf << PLL_LOAD_PULSE_PHASE_SHIFT) # define DISPLAY_RATE_SELECT_FPA1 (1 << 8) /* Ironlake */ # define PLL_REF_SDVO_HDMI_MULTIPLIER_SHIFT 9 # define PLL_REF_SDVO_HDMI_MULTIPLIER_MASK (7 << 9) # define PLL_REF_SDVO_HDMI_MULTIPLIER(x) (((x)-1)<< PLL_REF_SDVO_HDMI_MULTIPLIER_SHIFT) # define DPLL_FPA1_P1_POST_DIV_SHIFT 0 # define DPLL_FPA1_P1_POST_DIV_MASK 0xff /** * SDVO multiplier for 945G/GM. Not used on 965. * * \sa DPLL_MD_UDI_MULTIPLIER_MASK */ # define SDVO_MULTIPLIER_MASK 0x000000ff # define SDVO_MULTIPLIER_SHIFT_HIRES 4 # define SDVO_MULTIPLIER_SHIFT_VGA 0 /** @defgroup DPLL_MD * @{ */ /** Pipe A SDVO/UDI clock multiplier/divider register for G965. */ #define DPLL_A_MD 0x0601c /** Pipe B SDVO/UDI clock multiplier/divider register for G965. */ #define DPLL_B_MD 0x06020 /** * UDI pixel divider, controlling how many pixels are stuffed into a packet. * * Value is pixels minus 1. Must be set to 1 pixel for SDVO. */ # define DPLL_MD_UDI_DIVIDER_MASK 0x3f000000 # define DPLL_MD_UDI_DIVIDER_SHIFT 24 /** UDI pixel divider for VGA, same as DPLL_MD_UDI_DIVIDER_MASK. */ # define DPLL_MD_VGA_UDI_DIVIDER_MASK 0x003f0000 # define DPLL_MD_VGA_UDI_DIVIDER_SHIFT 16 /** * SDVO/UDI pixel multiplier. * * SDVO requires that the bus clock rate be between 1 and 2 Ghz, and the bus * clock rate is 10 times the DPLL clock. At low resolution/refresh rate * modes, the bus rate would be below the limits, so SDVO allows for stuffing * dummy bytes in the datastream at an increased clock rate, with both sides of * the link knowing how many bytes are fill. * * So, for a mode with a dotclock of 65Mhz, we would want to double the clock * rate to 130Mhz to get a bus rate of 1.30Ghz. The DPLL clock rate would be * set to 130Mhz, and the SDVO multiplier set to 2x in this register and * through an SDVO command. * * This register field has values of multiplication factor minus 1, with * a maximum multiplier of 5 for SDVO. */ # define DPLL_MD_UDI_MULTIPLIER_MASK 0x00003f00 # define DPLL_MD_UDI_MULTIPLIER_SHIFT 8 /** SDVO/UDI pixel multiplier for VGA, same as DPLL_MD_UDI_MULTIPLIER_MASK. * This best be set to the default value (3) or the CRT won't work. No, * I don't entirely understand what this does... */ # define DPLL_MD_VGA_UDI_MULTIPLIER_MASK 0x0000003f # define DPLL_MD_VGA_UDI_MULTIPLIER_SHIFT 0 /** @} */ #define DPLL_TEST 0x606c # define DPLLB_TEST_SDVO_DIV_1 (0 << 22) # define DPLLB_TEST_SDVO_DIV_2 (1 << 22) # define DPLLB_TEST_SDVO_DIV_4 (2 << 22) # define DPLLB_TEST_SDVO_DIV_MASK (3 << 22) # define DPLLB_TEST_N_BYPASS (1 << 19) # define DPLLB_TEST_M_BYPASS (1 << 18) # define DPLLB_INPUT_BUFFER_ENABLE (1 << 16) # define DPLLA_TEST_N_BYPASS (1 << 3) # define DPLLA_TEST_M_BYPASS (1 << 2) # define DPLLA_INPUT_BUFFER_ENABLE (1 << 0) #define D_STATE 0x6104 #define DSPCLK_GATE_D 0x6200 # define DPUNIT_B_CLOCK_GATE_DISABLE (1 << 30) /* 965 */ # define VSUNIT_CLOCK_GATE_DISABLE (1 << 29) /* 965 */ # define VRHUNIT_CLOCK_GATE_DISABLE (1 << 28) /* 965 */ # define VRDUNIT_CLOCK_GATE_DISABLE (1 << 27) /* 965 */ # define AUDUNIT_CLOCK_GATE_DISABLE (1 << 26) /* 965 */ # define DPUNIT_A_CLOCK_GATE_DISABLE (1 << 25) /* 965 */ # define DPCUNIT_CLOCK_GATE_DISABLE (1 << 24) /* 965 */ # define TVRUNIT_CLOCK_GATE_DISABLE (1 << 23) /* 915-945 */ # define TVCUNIT_CLOCK_GATE_DISABLE (1 << 22) /* 915-945 */ # define TVFUNIT_CLOCK_GATE_DISABLE (1 << 21) /* 915-945 */ # define TVEUNIT_CLOCK_GATE_DISABLE (1 << 20) /* 915-945 */ # define DVSUNIT_CLOCK_GATE_DISABLE (1 << 19) /* 915-945 */ # define DSSUNIT_CLOCK_GATE_DISABLE (1 << 18) /* 915-945 */ # define DDBUNIT_CLOCK_GATE_DISABLE (1 << 17) /* 915-945 */ # define DPRUNIT_CLOCK_GATE_DISABLE (1 << 16) /* 915-945 */ # define DPFUNIT_CLOCK_GATE_DISABLE (1 << 15) /* 915-945 */ # define DPBMUNIT_CLOCK_GATE_DISABLE (1 << 14) /* 915-945 */ # define DPLSUNIT_CLOCK_GATE_DISABLE (1 << 13) /* 915-945 */ # define DPLUNIT_CLOCK_GATE_DISABLE (1 << 12) /* 915-945 */ # define DPOUNIT_CLOCK_GATE_DISABLE (1 << 11) # define DPBUNIT_CLOCK_GATE_DISABLE (1 << 10) # define DCUNIT_CLOCK_GATE_DISABLE (1 << 9) # define DPUNIT_CLOCK_GATE_DISABLE (1 << 8) # define VRUNIT_CLOCK_GATE_DISABLE (1 << 7) /* 915+: reserved */ # define OVHUNIT_CLOCK_GATE_DISABLE (1 << 6) /* 830-865 */ # define DPIOUNIT_CLOCK_GATE_DISABLE (1 << 6) /* 915-945 */ # define OVFUNIT_CLOCK_GATE_DISABLE (1 << 5) # define OVBUNIT_CLOCK_GATE_DISABLE (1 << 4) /** * This bit must be set on the 830 to prevent hangs when turning off the * overlay scaler. */ # define OVRUNIT_CLOCK_GATE_DISABLE (1 << 3) # define OVCUNIT_CLOCK_GATE_DISABLE (1 << 2) # define OVUUNIT_CLOCK_GATE_DISABLE (1 << 1) # define ZVUNIT_CLOCK_GATE_DISABLE (1 << 0) /* 830 */ # define OVLUNIT_CLOCK_GATE_DISABLE (1 << 0) /* 845,865 */ #define RENCLK_GATE_D1 0x6204 # define BLITTER_CLOCK_GATE_DISABLE (1 << 13) /* 945GM only */ # define MPEG_CLOCK_GATE_DISABLE (1 << 12) /* 945GM only */ # define PC_FE_CLOCK_GATE_DISABLE (1 << 11) # define PC_BE_CLOCK_GATE_DISABLE (1 << 10) # define WINDOWER_CLOCK_GATE_DISABLE (1 << 9) # define INTERPOLATOR_CLOCK_GATE_DISABLE (1 << 8) # define COLOR_CALCULATOR_CLOCK_GATE_DISABLE (1 << 7) # define MOTION_COMP_CLOCK_GATE_DISABLE (1 << 6) # define MAG_CLOCK_GATE_DISABLE (1 << 5) /** This bit must be unset on 855,865 */ # define MECI_CLOCK_GATE_DISABLE (1 << 4) # define DCMP_CLOCK_GATE_DISABLE (1 << 3) # define MEC_CLOCK_GATE_DISABLE (1 << 2) # define MECO_CLOCK_GATE_DISABLE (1 << 1) /** This bit must be set on 855,865. */ # define SV_CLOCK_GATE_DISABLE (1 << 0) # define I915_MPEG_CLOCK_GATE_DISABLE (1 << 16) # define I915_VLD_IP_PR_CLOCK_GATE_DISABLE (1 << 15) # define I915_MOTION_COMP_CLOCK_GATE_DISABLE (1 << 14) # define I915_BD_BF_CLOCK_GATE_DISABLE (1 << 13) # define I915_SF_SE_CLOCK_GATE_DISABLE (1 << 12) # define I915_WM_CLOCK_GATE_DISABLE (1 << 11) # define I915_IZ_CLOCK_GATE_DISABLE (1 << 10) # define I915_PI_CLOCK_GATE_DISABLE (1 << 9) # define I915_DI_CLOCK_GATE_DISABLE (1 << 8) # define I915_SH_SV_CLOCK_GATE_DISABLE (1 << 7) # define I915_PL_DG_QC_FT_CLOCK_GATE_DISABLE (1 << 6) # define I915_SC_CLOCK_GATE_DISABLE (1 << 5) # define I915_FL_CLOCK_GATE_DISABLE (1 << 4) # define I915_DM_CLOCK_GATE_DISABLE (1 << 3) # define I915_PS_CLOCK_GATE_DISABLE (1 << 2) # define I915_CC_CLOCK_GATE_DISABLE (1 << 1) # define I915_BY_CLOCK_GATE_DISABLE (1 << 0) # define I965_RCZ_CLOCK_GATE_DISABLE (1 << 30) /** This bit must always be set on 965G/965GM */ # define I965_RCC_CLOCK_GATE_DISABLE (1 << 29) # define I965_RCPB_CLOCK_GATE_DISABLE (1 << 28) # define I965_DAP_CLOCK_GATE_DISABLE (1 << 27) # define I965_ROC_CLOCK_GATE_DISABLE (1 << 26) # define I965_GW_CLOCK_GATE_DISABLE (1 << 25) # define I965_TD_CLOCK_GATE_DISABLE (1 << 24) /** This bit must always be set on 965G */ # define I965_ISC_CLOCK_GATE_DISABLE (1 << 23) # define I965_IC_CLOCK_GATE_DISABLE (1 << 22) # define I965_EU_CLOCK_GATE_DISABLE (1 << 21) # define I965_IF_CLOCK_GATE_DISABLE (1 << 20) # define I965_TC_CLOCK_GATE_DISABLE (1 << 19) # define I965_SO_CLOCK_GATE_DISABLE (1 << 17) # define I965_FBC_CLOCK_GATE_DISABLE (1 << 16) # define I965_MARI_CLOCK_GATE_DISABLE (1 << 15) # define I965_MASF_CLOCK_GATE_DISABLE (1 << 14) # define I965_MAWB_CLOCK_GATE_DISABLE (1 << 13) # define I965_EM_CLOCK_GATE_DISABLE (1 << 12) # define I965_UC_CLOCK_GATE_DISABLE (1 << 11) # define I965_SI_CLOCK_GATE_DISABLE (1 << 6) # define I965_MT_CLOCK_GATE_DISABLE (1 << 5) # define I965_PL_CLOCK_GATE_DISABLE (1 << 4) # define I965_DG_CLOCK_GATE_DISABLE (1 << 3) # define I965_QC_CLOCK_GATE_DISABLE (1 << 2) # define I965_FT_CLOCK_GATE_DISABLE (1 << 1) # define I965_DM_CLOCK_GATE_DISABLE (1 << 0) #define RENCLK_GATE_D2 0x6208 #define VF_UNIT_CLOCK_GATE_DISABLE (1 << 9) #define GS_UNIT_CLOCK_GATE_DISABLE (1 << 7) #define CL_UNIT_CLOCK_GATE_DISABLE (1 << 6) #define RAMCLK_GATE_D 0x6210 /* CRL only */ #define DEUC 0x6214 /* CRL only */ /* * This is a PCI config space register to manipulate backlight brightness * It is used when the BLM_LEGACY_MODE is turned on. When enabled, the first * byte of this config register sets brightness within the range from * 0 to 0xff */ #define LEGACY_BACKLIGHT_BRIGHTNESS 0xf4 #define BLC_PWM_CTL 0x61254 #define BACKLIGHT_MODULATION_FREQ_SHIFT (17) #define BACKLIGHT_MODULATION_FREQ_SHIFT2 (16) /** * This is the most significant 15 bits of the number of backlight cycles in a * complete cycle of the modulated backlight control. * * The actual value is this field multiplied by two. */ #define BACKLIGHT_MODULATION_FREQ_MASK (0x7fff << 17) #define BACKLIGHT_MODULATION_FREQ_MASK2 (0xffff << 16) #define BLM_LEGACY_MODE (1 << 16) /** * This is the number of cycles out of the backlight modulation cycle for which * the backlight is on. * * This field must be no greater than the number of cycles in the complete * backlight modulation cycle. */ #define BACKLIGHT_DUTY_CYCLE_SHIFT (0) #define BACKLIGHT_DUTY_CYCLE_MASK (0xffff) /* On 965+ backlight control is in another register */ #define BLC_PWM_CTL2 0x61250 #define BLM_LEGACY_MODE2 (1 << 30) #define BLM_CTL 0x61260 #define BLM_THRESHOLD_0 0x61270 #define BLM_THRESHOLD_1 0x61274 #define BLM_THRESHOLD_2 0x61278 #define BLM_THRESHOLD_3 0x6127c #define BLM_THRESHOLD_4 0x61280 #define BLM_THRESHOLD_5 0x61284 #define BLM_ACCUMULATOR_0 0x61290 #define BLM_ACCUMULATOR_1 0x61294 #define BLM_ACCUMULATOR_2 0x61298 #define BLM_ACCUMULATOR_3 0x6129c #define BLM_ACCUMULATOR_4 0x612a0 #define BLM_ACCUMULATOR_5 0x612a4 #define FPA0 0x06040 #define FPA1 0x06044 #define FPB0 0x06048 #define FPB1 0x0604c # define FP_N_DIV_MASK 0x003f0000 # define FP_N_IGD_DIV_MASK 0x00ff0000 # define FP_N_DIV_SHIFT 16 # define FP_M1_DIV_MASK 0x00003f00 # define FP_M1_DIV_SHIFT 8 # define FP_M2_DIV_MASK 0x0000003f # define FP_M2_IGD_DIV_MASK 0x000000ff # define FP_M2_DIV_SHIFT 0 #define PORT_HOTPLUG_EN 0x61110 # define HDMIB_HOTPLUG_INT_EN (1 << 29) # define HDMIC_HOTPLUG_INT_EN (1 << 28) # define HDMID_HOTPLUG_INT_EN (1 << 27) # define SDVOB_HOTPLUG_INT_EN (1 << 26) # define SDVOC_HOTPLUG_INT_EN (1 << 25) # define TV_HOTPLUG_INT_EN (1 << 18) # define CRT_HOTPLUG_INT_EN (1 << 9) # define CRT_HOTPLUG_ACTIVATION_PERIOD_32 (0 << 8) /* must use period 64 on GM45 according to docs */ # define CRT_HOTPLUG_ACTIVATION_PERIOD_64 (1 << 8) # define CRT_HOTPLUG_DAC_ON_TIME_2M (0 << 7) # define CRT_HOTPLUG_DAC_ON_TIME_4M (1 << 7) # define CRT_HOTPLUG_VOLTAGE_COMPARE_40 (0 << 5) # define CRT_HOTPLUG_VOLTAGE_COMPARE_50 (1 << 5) # define CRT_HOTPLUG_VOLTAGE_COMPARE_60 (2 << 5) # define CRT_HOTPLUG_VOLTAGE_COMPARE_70 (3 << 5) # define CRT_HOTPLUG_VOLTAGE_COMPARE_MASK (3 << 5) # define CRT_HOTPLUG_DETECT_DELAY_1G (0 << 4) # define CRT_HOTPLUG_DETECT_DELAY_2G (1 << 4) # define CRT_HOTPLUG_FORCE_DETECT (1 << 3) # define CRT_HOTPLUG_DETECT_VOLTAGE_325MV (0 << 2) # define CRT_HOTPLUG_DETECT_VOLTAGE_475MV (1 << 2) # define CRT_HOTPLUG_MASK (0x3fc) /* Bits 9-2 */ #define PORT_HOTPLUG_STAT 0x61114 # define HDMIB_HOTPLUG_INT_STATUS (1 << 29) # define HDMIC_HOTPLUG_INT_STATUS (1 << 28) # define HDMID_HOTPLUG_INT_STATUS (1 << 27) # define CRT_HOTPLUG_INT_STATUS (1 << 11) # define TV_HOTPLUG_INT_STATUS (1 << 10) # define CRT_HOTPLUG_MONITOR_MASK (3 << 8) # define CRT_HOTPLUG_MONITOR_COLOR (3 << 8) # define CRT_HOTPLUG_MONITOR_MONO (2 << 8) # define CRT_HOTPLUG_MONITOR_NONE (0 << 8) # define SDVOC_HOTPLUG_INT_STATUS (1 << 7) # define SDVOB_HOTPLUG_INT_STATUS (1 << 6) #define SDVOB 0x61140 #define SDVOC 0x61160 #define SDVO_ENABLE (1 << 31) #define SDVO_PIPE_B_SELECT (1 << 30) #define SDVO_STALL_SELECT (1 << 29) #define SDVO_INTERRUPT_ENABLE (1 << 26) /** * 915G/GM SDVO pixel multiplier. * * Programmed value is multiplier - 1, up to 5x. * * \sa DPLL_MD_UDI_MULTIPLIER_MASK */ #define SDVO_PORT_MULTIPLY_MASK (7 << 23) #define SDVO_PORT_MULTIPLY_SHIFT 23 #define SDVO_PHASE_SELECT_MASK (15 << 19) #define SDVO_PHASE_SELECT_DEFAULT (6 << 19) #define SDVO_CLOCK_OUTPUT_INVERT (1 << 18) #define SDVOC_GANG_MODE (1 << 16) #define SDVO_ENCODING_SDVO (0x0 << 10) #define SDVO_ENCODING_HDMI (0x2 << 10) /** Requird for HDMI operation */ #define SDVO_NULL_PACKETS_DURING_VSYNC (1 << 9) #define SDVO_BORDER_ENABLE (1 << 7) #define SDVO_AUDIO_ENABLE (1 << 6) /** New with 965, default is to be set */ #define SDVO_VSYNC_ACTIVE_HIGH (1 << 4) /** New with 965, default is to be set */ #define SDVO_HSYNC_ACTIVE_HIGH (1 << 3) /** 915/945 only, read-only bit */ #define SDVOB_PCIE_CONCURRENCY (1 << 3) #define SDVO_DETECTED (1 << 2) /* Bits to be preserved when writing */ #define SDVOB_PRESERVE_MASK ((1 << 17) | (1 << 16) | (1 << 14)) #define SDVOC_PRESERVE_MASK (1 << 17) #define UDIB_SVB_SHB_CODES 0x61144 #define UDIB_SHA_BLANK_CODES 0x61148 #define UDIB_START_END_FILL_CODES 0x6114c #define SDVOUDI 0x61150 #define I830_HTOTAL_MASK 0xfff0000 #define I830_HACTIVE_MASK 0x7ff #define I830_HBLANKEND_MASK 0xfff0000 #define I830_HBLANKSTART_MASK 0xfff #define I830_HSYNCEND_MASK 0xfff0000 #define I830_HSYNCSTART_MASK 0xfff #define I830_VTOTAL_MASK 0xfff0000 #define I830_VACTIVE_MASK 0x7ff #define I830_VBLANKEND_MASK 0xfff0000 #define I830_VBLANKSTART_MASK 0xfff #define I830_VSYNCEND_MASK 0xfff0000 #define I830_VSYNCSTART_MASK 0xfff #define I830_PIPEA_HORZ_MASK 0x7ff0000 #define I830_PIPEA_VERT_MASK 0x7ff #define ADPA 0x61100 #define ADPA_DAC_ENABLE (1<<31) #define ADPA_DAC_DISABLE 0 #define ADPA_PIPE_SELECT_MASK (1<<30) #define ADPA_PIPE_A_SELECT 0 #define ADPA_PIPE_B_SELECT (1<<30) #define ADPA_USE_VGA_HVPOLARITY (1<<15) #define ADPA_SETS_HVPOLARITY 0 #define ADPA_VSYNC_CNTL_DISABLE (1<<11) #define ADPA_VSYNC_CNTL_ENABLE 0 #define ADPA_HSYNC_CNTL_DISABLE (1<<10) #define ADPA_HSYNC_CNTL_ENABLE 0 #define ADPA_VSYNC_ACTIVE_HIGH (1<<4) #define ADPA_VSYNC_ACTIVE_LOW 0 #define ADPA_HSYNC_ACTIVE_HIGH (1<<3) #define ADPA_HSYNC_ACTIVE_LOW 0 #define PCH_DSPCLK_GATE_D 0x42020 #define PCH_DSPRAMCLK_GATE_D 0x42024 #define PCH_3DCGDIS0 0x46020 #define PCH_3DCGDIS1 0x46024 #define PCH_3DRAMCGDIS0 0x46028 #define SOUTH_DSPCLK_GATE_D 0xc2020 #define CPU_eDP_A 0x64000 #define PCH_DP_B 0xe4100 #define PCH_DP_C 0xe4200 #define PCH_DP_D 0xe4300 #define DVOA 0x61120 #define DVOB 0x61140 #define DVOC 0x61160 #define DVO_ENABLE (1 << 31) #define DVO_PIPE_B_SELECT (1 << 30) #define DVO_PIPE_STALL_UNUSED (0 << 28) #define DVO_PIPE_STALL (1 << 28) #define DVO_PIPE_STALL_TV (2 << 28) #define DVO_PIPE_STALL_MASK (3 << 28) #define DVO_USE_VGA_SYNC (1 << 15) #define DVO_DATA_ORDER_I740 (0 << 14) #define DVO_DATA_ORDER_FP (1 << 14) #define DVO_VSYNC_DISABLE (1 << 11) #define DVO_HSYNC_DISABLE (1 << 10) #define DVO_VSYNC_TRISTATE (1 << 9) #define DVO_HSYNC_TRISTATE (1 << 8) #define DVO_BORDER_ENABLE (1 << 7) #define DVO_DATA_ORDER_GBRG (1 << 6) #define DVO_DATA_ORDER_RGGB (0 << 6) #define DVO_DATA_ORDER_GBRG_ERRATA (0 << 6) #define DVO_DATA_ORDER_RGGB_ERRATA (1 << 6) #define DVO_VSYNC_ACTIVE_HIGH (1 << 4) #define DVO_HSYNC_ACTIVE_HIGH (1 << 3) #define DVO_BLANK_ACTIVE_HIGH (1 << 2) #define DVO_OUTPUT_CSTATE_PIXELS (1 << 1) /* SDG only */ #define DVO_OUTPUT_SOURCE_SIZE_PIXELS (1 << 0) /* SDG only */ #define DVO_PRESERVE_MASK (0x7<<24) #define DVOA_SRCDIM 0x61124 #define DVOB_SRCDIM 0x61144 #define DVOC_SRCDIM 0x61164 #define DVO_SRCDIM_HORIZONTAL_SHIFT 12 #define DVO_SRCDIM_VERTICAL_SHIFT 0 /** @defgroup LVDS * @{ */ /** * This register controls the LVDS output enable, pipe selection, and data * format selection. * * All of the clock/data pairs are force powered down by power sequencing. */ #define LVDS 0x61180 /** * Enables the LVDS port. This bit must be set before DPLLs are enabled, as * the DPLL semantics change when the LVDS is assigned to that pipe. */ # define LVDS_PORT_EN (1 << 31) /** Selects pipe B for LVDS data. Must be set on pre-965. */ # define LVDS_PIPEB_SELECT (1 << 30) /* on 965, dithering is enabled in this register, not PFIT_CONTROL */ # define LVDS_DITHER_ENABLE (1 << 25) /* * Selects between .0 and .1 formats: * * 0 = 1x18.0, 2x18.0, 1x24.0 or 2x24.0 * 1 = 1x24.1 or 2x24.1 */ # define LVDS_DATA_FORMAT_DOT_ONE (1 << 24) /* Using LE instead of HS on second channel control signal */ # define LVDS_LE_CONTROL_ENABLE (1 << 23) /* Using LF instead of VS on second channel control signal */ # define LVDS_LF_CONTROL_ENABLE (1 << 22) /* invert vsync signal polarity */ # define LVDS_VSYNC_POLARITY_INVERT (1 << 21) /* invert hsync signal polarity */ # define LVDS_HSYNC_POLARITY_INVERT (1 << 20) /* invert display enable signal polarity */ # define LVDS_DE_POLARITY_INVERT (1 << 19) /* * Control signals for second channel, ignored in single channel modes */ /* send DE, HS, VS on second channel */ # define LVDS_SECOND_CHANNEL_DE_HS_VS (0 << 17) # define LVDS_SECOND_CHANNEL_RESERVED (1 << 17) /* Send zeros instead of DE, HS, VS on second channel */ # define LVDS_SECOND_CHANNEL_ZEROS (2 << 17) /* Set DE=0, HS=LE, VS=LF on second channel */ # define LVDS_SECOND_CHANNEL_HS_VS (3 << 17) /* * Send duplicate data for channel reserved bits, otherwise send zeros */ # define LVDS_CHANNEL_DUP_RESERVED (1 << 16) /* * Enable border for unscaled (or aspect-scaled) display */ # define LVDS_BORDER_ENABLE (1 << 15) /* * Tri-state the LVDS buffers when powered down, otherwise * they are set to 0V */ # define LVDS_POWER_DOWN_TRI_STATE (1 << 10) /** * Enables the A0-A2 data pairs and CLKA, containing 18 bits of color data per * pixel. */ # define LVDS_A0A2_CLKA_POWER_MASK (3 << 8) # define LVDS_A0A2_CLKA_POWER_DOWN (0 << 8) # define LVDS_A0A2_CLKA_POWER_UP (3 << 8) /** * Controls the A3 data pair, which contains the additional LSBs for 24 bit * mode. Only enabled if LVDS_A0A2_CLKA_POWER_UP also indicates it should be * on. */ # define LVDS_A3_POWER_MASK (3 << 6) # define LVDS_A3_POWER_DOWN (0 << 6) # define LVDS_A3_POWER_UP (3 << 6) /** * Controls the CLKB pair. This should only be set when LVDS_B0B3_POWER_UP * is set. */ # define LVDS_CLKB_POWER_MASK (3 << 4) # define LVDS_CLKB_POWER_DOWN (0 << 4) # define LVDS_CLKB_POWER_UP (3 << 4) /** * Controls the B0-B3 data pairs. This must be set to match the DPLL p2 * setting for whether we are in dual-channel mode. The B3 pair will * additionally only be powered up when LVDS_A3_POWER_UP is set. */ # define LVDS_B0B3_POWER_MASK (3 << 2) # define LVDS_B0B3_POWER_DOWN (0 << 2) # define LVDS_B0B3_POWER_UP (3 << 2) /** @} */ #define DP_B 0x64100 #define DPB_AUX_CH_CTL 0x64110 #define DPB_AUX_CH_DATA1 0x64114 #define DPB_AUX_CH_DATA2 0x64118 #define DPB_AUX_CH_DATA3 0x6411c #define DPB_AUX_CH_DATA4 0x64120 #define DPB_AUX_CH_DATA5 0x64124 #define DP_C 0x64200 #define DPC_AUX_CH_CTL 0x64210 #define DPC_AUX_CH_DATA1 0x64214 #define DPC_AUX_CH_DATA2 0x64218 #define DPC_AUX_CH_DATA3 0x6421c #define DPC_AUX_CH_DATA4 0x64220 #define DPC_AUX_CH_DATA5 0x64224 #define DP_D 0x64300 #define DPD_AUX_CH_CTL 0x64310 #define DPD_AUX_CH_DATA1 0x64314 #define DPD_AUX_CH_DATA2 0x64318 #define DPD_AUX_CH_DATA3 0x6431c #define DPD_AUX_CH_DATA4 0x64320 #define DPD_AUX_CH_DATA5 0x64324 /* * Two channel clock control. Turn this on if you need clkb for two channel mode * Overridden by global LVDS power sequencing */ /* clkb off */ # define LVDS_CLKB_POWER_DOWN (0 << 4) /* powered up, but clkb forced to 0 */ # define LVDS_CLKB_POWER_PARTIAL (1 << 4) /* clock B running */ # define LVDS_CLKB_POWER_UP (3 << 4) /* * Two channel mode B0-B2 control. Sets state when power is on. * Set to POWER_DOWN in single channel mode, other settings enable * two channel mode. The CLKB power control controls whether that clock * is enabled during two channel mode. * */ /* Everything is off, including B3 and CLKB */ # define LVDS_B_POWER_DOWN (0 << 2) /* B0, B1, B2 and data lines forced to 0. timing is active */ # define LVDS_B_POWER_PARTIAL (1 << 2) /* data lines active (both timing and colour) */ # define LVDS_B_POWER_UP (3 << 2) /** @defgroup TV_CTL * @{ */ #define TV_CTL 0x68000 /** Enables the TV encoder */ # define TV_ENC_ENABLE (1 << 31) /** Sources the TV encoder input from pipe B instead of A. */ # define TV_ENC_PIPEB_SELECT (1 << 30) /** Outputs composite video (DAC A only) */ # define TV_ENC_OUTPUT_COMPOSITE (0 << 28) /** Outputs SVideo video (DAC B/C) */ # define TV_ENC_OUTPUT_SVIDEO (1 << 28) /** Outputs Component video (DAC A/B/C) */ # define TV_ENC_OUTPUT_COMPONENT (2 << 28) /** Outputs Composite and SVideo (DAC A/B/C) */ # define TV_ENC_OUTPUT_SVIDEO_COMPOSITE (3 << 28) # define TV_TRILEVEL_SYNC (1 << 21) /** Enables slow sync generation (945GM only) */ # define TV_SLOW_SYNC (1 << 20) /** Selects 4x oversampling for 480i and 576p */ # define TV_OVERSAMPLE_4X (0 << 18) /** Selects 2x oversampling for 720p and 1080i */ # define TV_OVERSAMPLE_2X (1 << 18) /** Selects no oversampling for 1080p */ # define TV_OVERSAMPLE_NONE (2 << 18) /** Selects 8x oversampling */ # define TV_OVERSAMPLE_8X (3 << 18) /** Selects progressive mode rather than interlaced */ # define TV_PROGRESSIVE (1 << 17) /** Sets the colorburst to PAL mode. Required for non-M PAL modes. */ # define TV_PAL_BURST (1 << 16) /** Field for setting delay of Y compared to C */ # define TV_YC_SKEW_MASK (7 << 12) /** Enables a fix for 480p/576p standard definition modes on the 915GM only */ # define TV_ENC_SDP_FIX (1 << 11) /** * Enables a fix for the 915GM only. * * Not sure what it does. */ # define TV_ENC_C0_FIX (1 << 10) /** Bits that must be preserved by software */ # define TV_CTL_SAVE ((1 << 11) | (3 << 9) | (7 << 6) | 0xf) # define TV_FUSE_STATE_MASK (3 << 4) /** Read-only state that reports all features enabled */ # define TV_FUSE_STATE_ENABLED (0 << 4) /** Read-only state that reports that Macrovision is disabled in hardware*/ # define TV_FUSE_STATE_NO_MACROVISION (1 << 4) /** Read-only state that reports that TV-out is disabled in hardware. */ # define TV_FUSE_STATE_DISABLED (2 << 4) /** Normal operation */ # define TV_TEST_MODE_NORMAL (0 << 0) /** Encoder test pattern 1 - combo pattern */ # define TV_TEST_MODE_PATTERN_1 (1 << 0) /** Encoder test pattern 2 - full screen vertical 75% color bars */ # define TV_TEST_MODE_PATTERN_2 (2 << 0) /** Encoder test pattern 3 - full screen horizontal 75% color bars */ # define TV_TEST_MODE_PATTERN_3 (3 << 0) /** Encoder test pattern 4 - random noise */ # define TV_TEST_MODE_PATTERN_4 (4 << 0) /** Encoder test pattern 5 - linear color ramps */ # define TV_TEST_MODE_PATTERN_5 (5 << 0) /** * This test mode forces the DACs to 50% of full output. * * This is used for load detection in combination with TVDAC_SENSE_MASK */ # define TV_TEST_MODE_MONITOR_DETECT (7 << 0) # define TV_TEST_MODE_MASK (7 << 0) /** @} */ /** @defgroup TV_DAC * @{ */ #define TV_DAC 0x68004 /** * Reports that DAC state change logic has reported change (RO). * * This gets cleared when TV_DAC_STATE_EN is cleared */ # define TVDAC_STATE_CHG (1 << 31) # define TVDAC_SENSE_MASK (7 << 28) /** Reports that DAC A voltage is above the detect threshold */ # define TVDAC_A_SENSE (1 << 30) /** Reports that DAC B voltage is above the detect threshold */ # define TVDAC_B_SENSE (1 << 29) /** Reports that DAC C voltage is above the detect threshold */ # define TVDAC_C_SENSE (1 << 28) /** * Enables DAC state detection logic, for load-based TV detection. * * The PLL of the chosen pipe (in TV_CTL) must be running, and the encoder set * to off, for load detection to work. */ # define TVDAC_STATE_CHG_EN (1 << 27) /** Sets the DAC A sense value to high */ # define TVDAC_A_SENSE_CTL (1 << 26) /** Sets the DAC B sense value to high */ # define TVDAC_B_SENSE_CTL (1 << 25) /** Sets the DAC C sense value to high */ # define TVDAC_C_SENSE_CTL (1 << 24) /** Overrides the ENC_ENABLE and DAC voltage levels */ # define DAC_CTL_OVERRIDE (1 << 7) /** Sets the slew rate. Must be preserved in software */ # define ENC_TVDAC_SLEW_FAST (1 << 6) # define DAC_A_1_3_V (0 << 4) # define DAC_A_1_1_V (1 << 4) # define DAC_A_0_7_V (2 << 4) # define DAC_A_OFF (3 << 4) # define DAC_B_1_3_V (0 << 2) # define DAC_B_1_1_V (1 << 2) # define DAC_B_0_7_V (2 << 2) # define DAC_B_OFF (3 << 2) # define DAC_C_1_3_V (0 << 0) # define DAC_C_1_1_V (1 << 0) # define DAC_C_0_7_V (2 << 0) # define DAC_C_OFF (3 << 0) /** @} */ /** * CSC coefficients are stored in a floating point format with 9 bits of * mantissa and 2 or 3 bits of exponent. The exponent is represented as 2**-n, * where 2-bit exponents are unsigned n, and 3-bit exponents are signed n with * -1 (0x3) being the only legal negative value. */ #define TV_CSC_Y 0x68010 # define TV_RY_MASK 0x07ff0000 # define TV_RY_SHIFT 16 # define TV_GY_MASK 0x00000fff # define TV_GY_SHIFT 0 #define TV_CSC_Y2 0x68014 # define TV_BY_MASK 0x07ff0000 # define TV_BY_SHIFT 16 /** * Y attenuation for component video. * * Stored in 1.9 fixed point. */ # define TV_AY_MASK 0x000003ff # define TV_AY_SHIFT 0 #define TV_CSC_U 0x68018 # define TV_RU_MASK 0x07ff0000 # define TV_RU_SHIFT 16 # define TV_GU_MASK 0x000007ff # define TV_GU_SHIFT 0 #define TV_CSC_U2 0x6801c # define TV_BU_MASK 0x07ff0000 # define TV_BU_SHIFT 16 /** * U attenuation for component video. * * Stored in 1.9 fixed point. */ # define TV_AU_MASK 0x000003ff # define TV_AU_SHIFT 0 #define TV_CSC_V 0x68020 # define TV_RV_MASK 0x0fff0000 # define TV_RV_SHIFT 16 # define TV_GV_MASK 0x000007ff # define TV_GV_SHIFT 0 #define TV_CSC_V2 0x68024 # define TV_BV_MASK 0x07ff0000 # define TV_BV_SHIFT 16 /** * V attenuation for component video. * * Stored in 1.9 fixed point. */ # define TV_AV_MASK 0x000007ff # define TV_AV_SHIFT 0 /** @defgroup TV_CSC_KNOBS * @{ */ #define TV_CLR_KNOBS 0x68028 /** 2s-complement brightness adjustment */ # define TV_BRIGHTNESS_MASK 0xff000000 # define TV_BRIGHTNESS_SHIFT 24 /** Contrast adjustment, as a 2.6 unsigned floating point number */ # define TV_CONTRAST_MASK 0x00ff0000 # define TV_CONTRAST_SHIFT 16 /** Saturation adjustment, as a 2.6 unsigned floating point number */ # define TV_SATURATION_MASK 0x0000ff00 # define TV_SATURATION_SHIFT 8 /** Hue adjustment, as an integer phase angle in degrees */ # define TV_HUE_MASK 0x000000ff # define TV_HUE_SHIFT 0 /** @} */ /** @defgroup TV_CLR_LEVEL * @{ */ #define TV_CLR_LEVEL 0x6802c /** Controls the DAC level for black */ # define TV_BLACK_LEVEL_MASK 0x01ff0000 # define TV_BLACK_LEVEL_SHIFT 16 /** Controls the DAC level for blanking */ # define TV_BLANK_LEVEL_MASK 0x000001ff # define TV_BLANK_LEVEL_SHIFT 0 /* @} */ /** @defgroup TV_H_CTL_1 * @{ */ #define TV_H_CTL_1 0x68030 /** Number of pixels in the hsync. */ # define TV_HSYNC_END_MASK 0x1fff0000 # define TV_HSYNC_END_SHIFT 16 /** Total number of pixels minus one in the line (display and blanking). */ # define TV_HTOTAL_MASK 0x00001fff # define TV_HTOTAL_SHIFT 0 /** @} */ /** @defgroup TV_H_CTL_2 * @{ */ #define TV_H_CTL_2 0x68034 /** Enables the colorburst (needed for non-component color) */ # define TV_BURST_ENA (1 << 31) /** Offset of the colorburst from the start of hsync, in pixels minus one. */ # define TV_HBURST_START_SHIFT 16 # define TV_HBURST_START_MASK 0x1fff0000 /** Length of the colorburst */ # define TV_HBURST_LEN_SHIFT 0 # define TV_HBURST_LEN_MASK 0x0001fff /** @} */ /** @defgroup TV_H_CTL_3 * @{ */ #define TV_H_CTL_3 0x68038 /** End of hblank, measured in pixels minus one from start of hsync */ # define TV_HBLANK_END_SHIFT 16 # define TV_HBLANK_END_MASK 0x1fff0000 /** Start of hblank, measured in pixels minus one from start of hsync */ # define TV_HBLANK_START_SHIFT 0 # define TV_HBLANK_START_MASK 0x0001fff /** @} */ /** @defgroup TV_V_CTL_1 * @{ */ #define TV_V_CTL_1 0x6803c /** XXX */ # define TV_NBR_END_SHIFT 16 # define TV_NBR_END_MASK 0x07ff0000 /** XXX */ # define TV_VI_END_F1_SHIFT 8 # define TV_VI_END_F1_MASK 0x00003f00 /** XXX */ # define TV_VI_END_F2_SHIFT 0 # define TV_VI_END_F2_MASK 0x0000003f /** @} */ /** @defgroup TV_V_CTL_2 * @{ */ #define TV_V_CTL_2 0x68040 /** Length of vsync, in half lines */ # define TV_VSYNC_LEN_MASK 0x07ff0000 # define TV_VSYNC_LEN_SHIFT 16 /** Offset of the start of vsync in field 1, measured in one less than the * number of half lines. */ # define TV_VSYNC_START_F1_MASK 0x00007f00 # define TV_VSYNC_START_F1_SHIFT 8 /** * Offset of the start of vsync in field 2, measured in one less than the * number of half lines. */ # define TV_VSYNC_START_F2_MASK 0x0000007f # define TV_VSYNC_START_F2_SHIFT 0 /** @} */ /** @defgroup TV_V_CTL_3 * @{ */ #define TV_V_CTL_3 0x68044 /** Enables generation of the equalization signal */ # define TV_EQUAL_ENA (1 << 31) /** Length of vsync, in half lines */ # define TV_VEQ_LEN_MASK 0x007f0000 # define TV_VEQ_LEN_SHIFT 16 /** Offset of the start of equalization in field 1, measured in one less than * the number of half lines. */ # define TV_VEQ_START_F1_MASK 0x0007f00 # define TV_VEQ_START_F1_SHIFT 8 /** * Offset of the start of equalization in field 2, measured in one less than * the number of half lines. */ # define TV_VEQ_START_F2_MASK 0x000007f # define TV_VEQ_START_F2_SHIFT 0 /** @} */ /** @defgroup TV_V_CTL_4 * @{ */ #define TV_V_CTL_4 0x68048 /** * Offset to start of vertical colorburst, measured in one less than the * number of lines from vertical start. */ # define TV_VBURST_START_F1_MASK 0x003f0000 # define TV_VBURST_START_F1_SHIFT 16 /** * Offset to the end of vertical colorburst, measured in one less than the * number of lines from the start of NBR. */ # define TV_VBURST_END_F1_MASK 0x000000ff # define TV_VBURST_END_F1_SHIFT 0 /** @} */ /** @defgroup TV_V_CTL_5 * @{ */ #define TV_V_CTL_5 0x6804c /** * Offset to start of vertical colorburst, measured in one less than the * number of lines from vertical start. */ # define TV_VBURST_START_F2_MASK 0x003f0000 # define TV_VBURST_START_F2_SHIFT 16 /** * Offset to the end of vertical colorburst, measured in one less than the * number of lines from the start of NBR. */ # define TV_VBURST_END_F2_MASK 0x000000ff # define TV_VBURST_END_F2_SHIFT 0 /** @} */ /** @defgroup TV_V_CTL_6 * @{ */ #define TV_V_CTL_6 0x68050 /** * Offset to start of vertical colorburst, measured in one less than the * number of lines from vertical start. */ # define TV_VBURST_START_F3_MASK 0x003f0000 # define TV_VBURST_START_F3_SHIFT 16 /** * Offset to the end of vertical colorburst, measured in one less than the * number of lines from the start of NBR. */ # define TV_VBURST_END_F3_MASK 0x000000ff # define TV_VBURST_END_F3_SHIFT 0 /** @} */ /** @defgroup TV_V_CTL_7 * @{ */ #define TV_V_CTL_7 0x68054 /** * Offset to start of vertical colorburst, measured in one less than the * number of lines from vertical start. */ # define TV_VBURST_START_F4_MASK 0x003f0000 # define TV_VBURST_START_F4_SHIFT 16 /** * Offset to the end of vertical colorburst, measured in one less than the * number of lines from the start of NBR. */ # define TV_VBURST_END_F4_MASK 0x000000ff # define TV_VBURST_END_F4_SHIFT 0 /** @} */ /** @defgroup TV_SC_CTL_1 * @{ */ #define TV_SC_CTL_1 0x68060 /** Turns on the first subcarrier phase generation DDA */ # define TV_SC_DDA1_EN (1 << 31) /** Turns on the first subcarrier phase generation DDA */ # define TV_SC_DDA2_EN (1 << 30) /** Turns on the first subcarrier phase generation DDA */ # define TV_SC_DDA3_EN (1 << 29) /** Sets the subcarrier DDA to reset frequency every other field */ # define TV_SC_RESET_EVERY_2 (0 << 24) /** Sets the subcarrier DDA to reset frequency every fourth field */ # define TV_SC_RESET_EVERY_4 (1 << 24) /** Sets the subcarrier DDA to reset frequency every eighth field */ # define TV_SC_RESET_EVERY_8 (2 << 24) /** Sets the subcarrier DDA to never reset the frequency */ # define TV_SC_RESET_NEVER (3 << 24) /** Sets the peak amplitude of the colorburst.*/ # define TV_BURST_LEVEL_MASK 0x00ff0000 # define TV_BURST_LEVEL_SHIFT 16 /** Sets the increment of the first subcarrier phase generation DDA */ # define TV_SCDDA1_INC_MASK 0x00000fff # define TV_SCDDA1_INC_SHIFT 0 /** @} */ /** @defgroup TV_SC_CTL_2 * @{ */ #define TV_SC_CTL_2 0x68064 /** Sets the rollover for the second subcarrier phase generation DDA */ # define TV_SCDDA2_SIZE_MASK 0x7fff0000 # define TV_SCDDA2_SIZE_SHIFT 16 /** Sets the increent of the second subcarrier phase generation DDA */ # define TV_SCDDA2_INC_MASK 0x00007fff # define TV_SCDDA2_INC_SHIFT 0 /** @} */ /** @defgroup TV_SC_CTL_3 * @{ */ #define TV_SC_CTL_3 0x68068 /** Sets the rollover for the third subcarrier phase generation DDA */ # define TV_SCDDA3_SIZE_MASK 0x7fff0000 # define TV_SCDDA3_SIZE_SHIFT 16 /** Sets the increent of the third subcarrier phase generation DDA */ # define TV_SCDDA3_INC_MASK 0x00007fff # define TV_SCDDA3_INC_SHIFT 0 /** @} */ /** @defgroup TV_WIN_POS * @{ */ #define TV_WIN_POS 0x68070 /** X coordinate of the display from the start of horizontal active */ # define TV_XPOS_MASK 0x1fff0000 # define TV_XPOS_SHIFT 16 /** Y coordinate of the display from the start of vertical active (NBR) */ # define TV_YPOS_MASK 0x00000fff # define TV_YPOS_SHIFT 0 /** @} */ /** @defgroup TV_WIN_SIZE * @{ */ #define TV_WIN_SIZE 0x68074 /** Horizontal size of the display window, measured in pixels*/ # define TV_XSIZE_MASK 0x1fff0000 # define TV_XSIZE_SHIFT 16 /** * Vertical size of the display window, measured in pixels. * * Must be even for interlaced modes. */ # define TV_YSIZE_MASK 0x00000fff # define TV_YSIZE_SHIFT 0 /** @} */ /** @defgroup TV_FILTER_CTL_1 * @{ */ #define TV_FILTER_CTL_1 0x68080 /** * Enables automatic scaling calculation. * * If set, the rest of the registers are ignored, and the calculated values can * be read back from the register. */ # define TV_AUTO_SCALE (1 << 31) /** * Disables the vertical filter. * * This is required on modes more than 1024 pixels wide */ # define TV_V_FILTER_BYPASS (1 << 29) /** Enables adaptive vertical filtering */ # define TV_VADAPT (1 << 28) # define TV_VADAPT_MODE_MASK (3 << 26) /** Selects the least adaptive vertical filtering mode */ # define TV_VADAPT_MODE_LEAST (0 << 26) /** Selects the moderately adaptive vertical filtering mode */ # define TV_VADAPT_MODE_MODERATE (1 << 26) /** Selects the most adaptive vertical filtering mode */ # define TV_VADAPT_MODE_MOST (3 << 26) /** * Sets the horizontal scaling factor. * * This should be the fractional part of the horizontal scaling factor divided * by the oversampling rate. TV_HSCALE should be less than 1, and set to: * * (src width - 1) / ((oversample * dest width) - 1) */ # define TV_HSCALE_FRAC_MASK 0x00003fff # define TV_HSCALE_FRAC_SHIFT 0 /** @} */ /** @defgroup TV_FILTER_CTL_2 * @{ */ #define TV_FILTER_CTL_2 0x68084 /** * Sets the integer part of the 3.15 fixed-point vertical scaling factor. * * TV_VSCALE should be (src height - 1) / ((interlace * dest height) - 1) */ # define TV_VSCALE_INT_MASK 0x00038000 # define TV_VSCALE_INT_SHIFT 15 /** * Sets the fractional part of the 3.15 fixed-point vertical scaling factor. * * \sa TV_VSCALE_INT_MASK */ # define TV_VSCALE_FRAC_MASK 0x00007fff # define TV_VSCALE_FRAC_SHIFT 0 /** @} */ /** @defgroup TV_FILTER_CTL_3 * @{ */ #define TV_FILTER_CTL_3 0x68088 /** * Sets the integer part of the 3.15 fixed-point vertical scaling factor. * * TV_VSCALE should be (src height - 1) / (1/4 * (dest height - 1)) * * For progressive modes, TV_VSCALE_IP_INT should be set to zeroes. */ # define TV_VSCALE_IP_INT_MASK 0x00038000 # define TV_VSCALE_IP_INT_SHIFT 15 /** * Sets the fractional part of the 3.15 fixed-point vertical scaling factor. * * For progressive modes, TV_VSCALE_IP_INT should be set to zeroes. * * \sa TV_VSCALE_IP_INT_MASK */ # define TV_VSCALE_IP_FRAC_MASK 0x00007fff # define TV_VSCALE_IP_FRAC_SHIFT 0 /** @} */ /** @defgroup TV_CC_CONTROL * @{ */ #define TV_CC_CONTROL 0x68090 # define TV_CC_ENABLE (1 << 31) /** * Specifies which field to send the CC data in. * * CC data is usually sent in field 0. */ # define TV_CC_FID_MASK (1 << 27) # define TV_CC_FID_SHIFT 27 /** Sets the horizontal position of the CC data. Usually 135. */ # define TV_CC_HOFF_MASK 0x03ff0000 # define TV_CC_HOFF_SHIFT 16 /** Sets the vertical position of the CC data. Usually 21 */ # define TV_CC_LINE_MASK 0x0000003f # define TV_CC_LINE_SHIFT 0 /** @} */ /** @defgroup TV_CC_DATA * @{ */ #define TV_CC_DATA 0x68094 # define TV_CC_RDY (1 << 31) /** Second word of CC data to be transmitted. */ # define TV_CC_DATA_2_MASK 0x007f0000 # define TV_CC_DATA_2_SHIFT 16 /** First word of CC data to be transmitted. */ # define TV_CC_DATA_1_MASK 0x0000007f # define TV_CC_DATA_1_SHIFT 0 /** @} */ /** @{ */ #define TV_H_LUMA_0 0x68100 #define TV_H_LUMA_59 0x681ec #define TV_H_CHROMA_0 0x68200 #define TV_H_CHROMA_59 0x682ec #define TV_V_LUMA_0 0x68300 #define TV_V_LUMA_42 0x683a8 #define TV_V_CHROMA_0 0x68400 #define TV_V_CHROMA_42 0x684a8 /** @} */ #define PIPEA_DSL 0x70000 #define PIPEACONF 0x70008 #define PIPEACONF_ENABLE (1<<31) #define PIPEACONF_DISABLE 0 #define PIPEACONF_DOUBLE_WIDE (1<<30) #define I965_PIPECONF_ACTIVE (1<<30) #define PIPEACONF_SINGLE_WIDE 0 #define PIPEACONF_PIPE_UNLOCKED 0 #define PIPEACONF_PIPE_LOCKED (1<<25) #define PIPEACONF_PALETTE 0 #define PIPEACONF_GAMMA (1<<24) #define PIPECONF_FORCE_BORDER (1<<25) #define PIPECONF_PROGRESSIVE (0 << 21) #define PIPECONF_INTERLACE_W_FIELD_INDICATION (6 << 21) #define PIPECONF_INTERLACE_FIELD_0_ONLY (7 << 21) /* ironlake: gamma */ #define PIPECONF_PALETTE_8BIT (0<<24) #define PIPECONF_PALETTE_10BIT (1<<24) #define PIPECONF_PALETTE_12BIT (2<<24) #define PIPECONF_FORCE_BORDER (1<<25) #define PIPECONF_PROGRESSIVE (0 << 21) #define PIPECONF_INTERLACE_W_FIELD_INDICATION (6 << 21) #define PIPECONF_INTERLACE_FIELD_0_ONLY (7 << 21) /* ironlake */ #define PIPECONF_MSA_TIMING_DELAY (0<<18) /* for eDP */ #define PIPECONF_NO_DYNAMIC_RATE_CHANGE (0 << 16) #define PIPECONF_NO_ROTATION (0<<14) #define PIPECONF_FULL_COLOR_RANGE (0<<13) #define PIPECONF_CE_COLOR_RANGE (1<<13) #define PIPECONF_COLOR_SPACE_RGB (0<<11) #define PIPECONF_COLOR_SPACE_YUV601 (1<<11) #define PIPECONF_COLOR_SPACE_YUV709 (2<<11) #define PIPECONF_CONNECT_DEFAULT (0<<9) #define PIPECONF_8BPP (0<<5) #define PIPECONF_10BPP (1<<5) #define PIPECONF_6BPP (2<<5) #define PIPECONF_12BPP (3<<5) #define PIPECONF_ENABLE_DITHER (1<<4) #define PIPECONF_DITHER_SPATIAL (0<<2) #define PIPECONF_DITHER_ST1 (1<<2) #define PIPECONF_DITHER_ST2 (2<<2) #define PIPECONF_DITHER_TEMPORAL (3<<2) #define PIPEAGCMAXRED 0x70010 #define PIPEAGCMAXGREEN 0x70014 #define PIPEAGCMAXBLUE 0x70018 #define PIPEASTAT 0x70024 # define FIFO_UNDERRUN (1 << 31) # define CRC_ERROR_ENABLE (1 << 29) # define CRC_DONE_ENABLE (1 << 28) # define GMBUS_EVENT_ENABLE (1 << 27) # define VSYNC_INT_ENABLE (1 << 25) # define DLINE_COMPARE_ENABLE (1 << 24) # define DPST_EVENT_ENABLE (1 << 23) # define LBLC_EVENT_ENABLE (1 << 22) # define OFIELD_INT_ENABLE (1 << 21) # define EFIELD_INT_ENABLE (1 << 20) # define SVBLANK_INT_ENABLE (1 << 18) # define VBLANK_INT_ENABLE (1 << 17) # define OREG_UPDATE_ENABLE (1 << 16) # define CRC_ERROR_INT_STATUS (1 << 13) # define CRC_DONE_INT_STATUS (1 << 12) # define GMBUS_INT_STATUS (1 << 11) # define VSYNC_INT_STATUS (1 << 9) # define DLINE_COMPARE_STATUS (1 << 8) # define DPST_EVENT_STATUS (1 << 7) # define LBLC_EVENT_STATUS (1 << 6) # define OFIELD_INT_STATUS (1 << 5) # define EFIELD_INT_STATUS (1 << 4) # define SVBLANK_INT_STATUS (1 << 2) # define VBLANK_INT_STATUS (1 << 1) # define OREG_UPDATE_STATUS (1 << 0) #define DSPARB 0x70030 #define DSPARB_CSTART_SHIFT 7 #define DSPARB_BSTART_SHIFT 0 #define DSPARB_BEND_SHIFT 9 /* on 855 */ #define DSPARB_AEND_SHIFT 0 #define DSPFW1 0x70034 #define DSPFW2 0x70038 #define DSPFW3 0x7003c /* * The two pipe frame counter registers are not synchronized, so * reading a stable value is somewhat tricky. The following code * should work: * * do { * high1 = ((INREG(PIPEAFRAMEHIGH) & PIPE_FRAME_HIGH_MASK) >> PIPE_FRAME_HIGH_SHIFT; * low1 = ((INREG(PIPEAFRAMEPIXEL) & PIPE_FRAME_LOW_MASK) >> PIPE_FRAME_LOW_SHIFT); * high2 = ((INREG(PIPEAFRAMEHIGH) & PIPE_FRAME_HIGH_MASK) >> PIPE_FRAME_HIGH_SHIFT); * } while (high1 != high2); * frame = (high1 << 8) | low1; */ #define PIPEAFRAMEHIGH 0x70040 #define PIPE_FRAME_HIGH_MASK 0x0000ffff #define PIPE_FRAME_HIGH_SHIFT 0 #define PIPEAFRAMEPIXEL 0x70044 #define PIPE_FRAME_LOW_MASK 0xff000000 #define PIPE_FRAME_LOW_SHIFT 24 /* * Pixel within the current frame is counted in the PIPEAFRAMEPIXEL register * and is 24 bits wide. */ #define PIPE_PIXEL_MASK 0x00ffffff #define PIPE_PIXEL_SHIFT 0 /* * Computing GMCH M and N values. * * GMCH M/N = dot clock * bytes per pixel / ls_clk * # of lanes * * ls_clk (we assume) is the DP link clock (1.62 or 2.7 GHz) * * The GMCH value is used internally */ #define PIPEA_GMCH_DATA_M 0x70050 /* Transfer unit size for display port - 1, default is 0x3f (for TU size 64) */ #define PIPE_GMCH_DATA_M_TU_SIZE_MASK (0x3f << 25) #define PIPE_GMCH_DATA_M_TU_SIZE_SHIFT 25 #define PIPE_GMCH_DATA_M_MASK (0xffffff) #define PIPEA_GMCH_DATA_N 0x70054 #define PIPE_GMCH_DATA_N_MASK (0xffffff) /* * Computing Link M and N values. * * Link M / N = pixel_clock / ls_clk * * (the DP spec calls pixel_clock the 'strm_clk') * * The Link value is transmitted in the Main Stream * Attributes and VB-ID. */ #define PIPEA_DP_LINK_M 0x70060 #define PIPEA_DP_LINK_M_MASK (0xffffff) #define PIPEA_DP_LINK_N 0x70064 #define PIPEA_DP_LINK_N_MASK (0xffffff) #define PIPEB_DSL 0x71000 #define PIPEBCONF 0x71008 #define PIPEBGCMAXRED 0x71010 #define PIPEBGCMAXGREEN 0x71014 #define PIPEBGCMAXBLUE 0x71018 #define PIPEBSTAT 0x71024 #define PIPEBFRAMEHIGH 0x71040 #define PIPEBFRAMEPIXEL 0x71044 #define PIPEB_GMCH_DATA_M 0x71050 #define PIPEB_GMCH_DATA_N 0x71054 #define PIPEB_DP_LINK_M 0x71060 #define PIPEB_DP_LINK_N 0x71064 #define PIPECCONF 0x72008 #define PIPECGCMAXRED 0x72010 #define PIPECGCMAXGREEN 0x72014 #define PIPECGCMAXBLUE 0x72018 #define PIPECSTAT 0x72024 #define PIPECFRAMEHIGH 0x72040 #define PIPECFRAMEPIXEL 0x72044 #define PIPEC_GMCH_DATA_M 0x72050 #define PIPEC_GMCH_DATA_N 0x72054 #define PIPEC_DP_LINK_M 0x72060 #define PIPEC_DP_LINK_N 0x72064 #define DSPACNTR 0x70180 #define DSPBCNTR 0x71180 #define DSPCCNTR 0x72180 #define DISPLAY_PLANE_ENABLE (1<<31) #define DISPLAY_PLANE_DISABLE 0 #define DISPLAY_PLANE_TILED (1<<10) #define DISPPLANE_GAMMA_ENABLE (1<<30) #define DISPPLANE_GAMMA_DISABLE 0 #define DISPPLANE_PIXFORMAT_MASK (0xf<<26) #define DISPPLANE_8BPP (0x2<<26) #define DISPPLANE_15_16BPP (0x4<<26) #define DISPPLANE_16BPP (0x5<<26) #define DISPPLANE_32BPP_NO_ALPHA (0x6<<26) #define DISPPLANE_32BPP (0x7<<26) #define DISPPLANE_STEREO_ENABLE (1<<25) #define DISPPLANE_STEREO_DISABLE 0 #define DISPPLANE_SEL_PIPE_MASK (1<<24) #define DISPPLANE_SEL_PIPE_A 0 #define DISPPLANE_SEL_PIPE_B (1<<24) #define DISPPLANE_SRC_KEY_ENABLE (1<<22) #define DISPPLANE_SRC_KEY_DISABLE 0 #define DISPPLANE_LINE_DOUBLE (1<<20) #define DISPPLANE_NO_LINE_DOUBLE 0 #define DISPPLANE_STEREO_POLARITY_FIRST 0 #define DISPPLANE_STEREO_POLARITY_SECOND (1<<18) /* plane B only */ #define DISPPLANE_ALPHA_TRANS_ENABLE (1<<15) #define DISPPLANE_ALPHA_TRANS_DISABLE 0 #define DISPPLANE_SPRITE_ABOVE_DISPLAYA 0 #define DISPPLANE_SPRITE_ABOVE_OVERLAY (1) #define DSPABASE 0x70184 #define DSPASTRIDE 0x70188 #define DSPBBASE 0x71184 #define DSPBADDR DSPBBASE #define DSPBSTRIDE 0x71188 #define DSPCBASE 0x72184 #define DSPCADDR DSPCBASE #define DSPCSTRIDE 0x72188 #define DSPAKEYVAL 0x70194 #define DSPAKEYMASK 0x70198 #define DSPAPOS 0x7018C /* reserved */ #define DSPASIZE 0x70190 #define DSPBPOS 0x7118C #define DSPBSIZE 0x71190 #define DSPASURF 0x7019C #define DSPATILEOFF 0x701A4 #define DSPBSURF 0x7119C #define DSPBTILEOFF 0x711A4 #define DSPCSURF 0x7219C #define DSPCTILEOFF 0x721A4 #define VGACNTRL 0x71400 # define VGA_DISP_DISABLE (1 << 31) # define VGA_2X_MODE (1 << 30) # define VGA_PIPE_B_SELECT (1 << 29) /* Various masks for reserved bits, etc. */ #define I830_FWATER1_MASK (~((1<<11)|(1<<10)|(1<<9)| \ (1<<8)|(1<<26)|(1<<25)|(1<<24)|(1<<5)|(1<<4)|(1<<3)| \ (1<<2)|(1<<1)|1|(1<<20)|(1<<19)|(1<<18)|(1<<17)|(1<<16))) #define I830_FWATER2_MASK ~(0) #define DV0A_RESERVED ((1<<26)|(1<<25)|(1<<24)|(1<<23)|(1<<22)|(1<<21)|(1<<20)|(1<<19)|(1<<18)|(1<<16)|(1<<5)|(1<<1)|1) #define DV0B_RESERVED ((1<<27)|(1<<26)|(1<<25)|(1<<24)|(1<<23)|(1<<22)|(1<<21)|(1<<20)|(1<<19)|(1<<18)|(1<<16)|(1<<5)|(1<<1)|1) #define VGA0_N_DIVISOR_MASK ((1<<21)|(1<<20)|(1<<19)|(1<<18)|(1<<17)|(1<<16)) #define VGA0_M1_DIVISOR_MASK ((1<<13)|(1<<12)|(1<<11)|(1<<10)|(1<<9)|(1<<8)) #define VGA0_M2_DIVISOR_MASK ((1<<5)|(1<<4)|(1<<3)|(1<<2)|(1<<1)|1) #define VGA0_M1M2N_RESERVED ~(VGA0_N_DIVISOR_MASK|VGA0_M1_DIVISOR_MASK|VGA0_M2_DIVISOR_MASK) #define VGA0_POSTDIV_MASK ((1<<7)|(1<<5)|(1<<4)|(1<<3)|(1<<2)|(1<<1)|1) #define VGA1_POSTDIV_MASK ((1<<15)|(1<<13)|(1<<12)|(1<<11)|(1<<10)|(1<<9)|(1<<8)) #define VGA_POSTDIV_RESERVED ~(VGA0_POSTDIV_MASK|VGA1_POSTDIV_MASK|(1<<7)|(1<<15)) #define DPLLA_POSTDIV_MASK ((1<<23)|(1<<21)|(1<<20)|(1<<19)|(1<<18)|(1<<17)|(1<<16)) #define DPLLA_RESERVED ((1<<27)|(1<<26)|(1<<25)|(1<<24)|(1<<22)|(1<<15)|(1<<12)|(1<<11)|(1<<10)|(1<<9)|(1<<8)|(1<<7)|(1<<6)|(1<<5)|(1<<4)|(1<<3)|(1<<2)|(1<<1)|1) #define ADPA_RESERVED ((1<<2)|(1<<1)|1|(1<<9)|(1<<8)|(1<<7)|(1<<6)|(1<<5)|(1<<30)|(1<<29)|(1<<28)|(1<<27)|(1<<26)|(1<<25)|(1<<24)|(1<<23)|(1<<22)|(1<<21)|(1<<20)|(1<<19)|(1<<18)|(1<<17)|(1<<16)) #define SUPER_WORD 32 #define BURST_A_MASK ((1<<11)|(1<<10)|(1<<9)|(1<<8)) #define BURST_B_MASK ((1<<26)|(1<<25)|(1<<24)) #define WATER_A_MASK ((1<<5)|(1<<4)|(1<<3)|(1<<2)|(1<<1)|1) #define WATER_B_MASK ((1<<20)|(1<<19)|(1<<18)|(1<<17)|(1<<16)) #define WATER_RESERVED ((1<<31)|(1<<30)|(1<<29)|(1<<28)|(1<<27)|(1<<23)|(1<<22)|(1<<21)|(1<<15)|(1<<14)|(1<<13)|(1<<12)|(1<<7)|(1<<6)) #define PIPEACONF_RESERVED ((1<<29)|(1<<28)|(1<<27)|(1<<23)|(1<<22)|(1<<21)|(1<<20)|(1<<19)|(1<<18)|(1<<17)|(1<<16)|0xffff) #define PIPEBCONF_RESERVED ((1<<30)|(1<<29)|(1<<28)|(1<<27)|(1<<26)|(1<<25)|(1<<23)|(1<<22)|(1<<21)|(1<<20)|(1<<19)|(1<<18)|(1<<17)|(1<<16)|0xffff) #define DSPACNTR_RESERVED ((1<<23)|(1<<19)|(1<<17)|(1<<16)|0xffff) #define DSPBCNTR_RESERVED ((1<<23)|(1<<19)|(1<<17)|(1<<16)|0x7ffe) #define I830_GMCH_CTRL 0x52 #define I830_GMCH_ENABLED 0x4 #define I830_GMCH_MEM_MASK 0x1 #define I830_GMCH_MEM_64M 0x1 #define I830_GMCH_MEM_128M 0 #define I830_GMCH_GMS_MASK 0x70 #define I830_GMCH_GMS_DISABLED 0x00 #define I830_GMCH_GMS_LOCAL 0x10 #define I830_GMCH_GMS_STOLEN_512 0x20 #define I830_GMCH_GMS_STOLEN_1024 0x30 #define I830_GMCH_GMS_STOLEN_8192 0x40 #define I830_RDRAM_CHANNEL_TYPE 0x03010 #define I830_RDRAM_ND(x) (((x) & 0x20) >> 5) #define I830_RDRAM_DDT(x) (((x) & 0x18) >> 3) #define I855_GMCH_GMS_MASK (0xF << 4) #define I855_GMCH_GMS_DISABLED 0x00 #define I855_GMCH_GMS_STOLEN_1M (0x1 << 4) #define I855_GMCH_GMS_STOLEN_4M (0x2 << 4) #define I855_GMCH_GMS_STOLEN_8M (0x3 << 4) #define I855_GMCH_GMS_STOLEN_16M (0x4 << 4) #define I855_GMCH_GMS_STOLEN_32M (0x5 << 4) #define I915G_GMCH_GMS_STOLEN_48M (0x6 << 4) #define I915G_GMCH_GMS_STOLEN_64M (0x7 << 4) #define G33_GMCH_GMS_STOLEN_128M (0x8 << 4) #define G33_GMCH_GMS_STOLEN_256M (0x9 << 4) #define INTEL_GMCH_GMS_STOLEN_96M (0xa << 4) #define INTEL_GMCH_GMS_STOLEN_160M (0xb << 4) #define INTEL_GMCH_GMS_STOLEN_224M (0xc << 4) #define INTEL_GMCH_GMS_STOLEN_352M (0xd << 4) #define I85X_CAPID 0x44 #define I85X_VARIANT_MASK 0x7 #define I85X_VARIANT_SHIFT 5 #define I855_GME 0x0 #define I855_GM 0x4 #define I852_GME 0x2 #define I852_GM 0x5 #define I915_GCFGC 0xf0 #define I915_LOW_FREQUENCY_ENABLE (1 << 7) #define I915_DISPLAY_CLOCK_190_200_MHZ (0 << 4) #define I915_DISPLAY_CLOCK_333_MHZ (4 << 4) #define I915_DISPLAY_CLOCK_MASK (7 << 4) #define I855_HPLLCC 0xc0 #define I855_CLOCK_CONTROL_MASK (3 << 0) #define I855_CLOCK_133_200 (0 << 0) #define I855_CLOCK_100_200 (1 << 0) #define I855_CLOCK_100_133 (2 << 0) #define I855_CLOCK_166_250 (3 << 0) /* BLT commands */ #define COLOR_BLT_CMD ((2<<29)|(0x40<<22)|(0x3)) #define COLOR_BLT_WRITE_ALPHA (1<<21) #define COLOR_BLT_WRITE_RGB (1<<20) #define XY_COLOR_BLT_CMD ((2<<29)|(0x50<<22)|(0x4)) #define XY_COLOR_BLT_WRITE_ALPHA (1<<21) #define XY_COLOR_BLT_WRITE_RGB (1<<20) #define XY_COLOR_BLT_TILED (1<<11) #define XY_SETUP_CLIP_BLT_CMD ((2<<29)|(3<<22)|1) #define XY_SRC_COPY_BLT_CMD ((2<<29)|(0x53<<22)|6) #define XY_SRC_COPY_BLT_WRITE_ALPHA (1<<21) #define XY_SRC_COPY_BLT_WRITE_RGB (1<<20) #define XY_SRC_COPY_BLT_SRC_TILED (1<<15) #define XY_SRC_COPY_BLT_DST_TILED (1<<11) #define SRC_COPY_BLT_CMD ((2<<29)|(0x43<<22)|0x4) #define SRC_COPY_BLT_WRITE_ALPHA (1<<21) #define SRC_COPY_BLT_WRITE_RGB (1<<20) #define XY_PAT_BLT_IMMEDIATE ((2<<29)|(0x72<<22)) #define XY_MONO_PAT_BLT_CMD ((0x2<<29)|(0x52<<22)|0x7) #define XY_MONO_PAT_VERT_SEED ((1<<10)|(1<<9)|(1<<8)) #define XY_MONO_PAT_HORT_SEED ((1<<14)|(1<<13)|(1<<12)) #define XY_MONO_PAT_BLT_WRITE_ALPHA (1<<21) #define XY_MONO_PAT_BLT_WRITE_RGB (1<<20) #define XY_MONO_SRC_BLT_CMD ((0x2<<29)|(0x54<<22)|(0x6)) #define XY_MONO_SRC_BLT_WRITE_ALPHA (1<<21) #define XY_MONO_SRC_BLT_WRITE_RGB (1<<20) #define MI_STORE_DWORD_IMM ((0x20<<23)|2) #define MI_MEM_VIRTUAL (1 << 22) /* 965+ only */ #define MI_SET_CONTEXT (0x18<<23) #define CTXT_NO_RESTORE (1) #define CTXT_PALETTE_SAVE_DISABLE (1<<3) #define CTXT_PALETTE_RESTORE_DISABLE (1<<2) /* Dword 0 */ #define MI_VERTEX_BUFFER (0x17<<23) #define MI_VERTEX_BUFFER_IDX(x) (x<<20) #define MI_VERTEX_BUFFER_PITCH(x) (x<<13) #define MI_VERTEX_BUFFER_WIDTH(x) (x<<6) /* Dword 1 */ #define MI_VERTEX_BUFFER_DISABLE (1) /* Overlay Flip */ #define MI_OVERLAY_FLIP (0x11<<23) #define MI_OVERLAY_FLIP_CONTINUE (0<<21) #define MI_OVERLAY_FLIP_ON (1<<21) #define MI_OVERLAY_FLIP_OFF (2<<21) /* Wait for Events */ #define MI_WAIT_FOR_EVENT (0x03<<23) #define MI_WAIT_FOR_PIPEB_SVBLANK (1<<18) #define MI_WAIT_FOR_PIPEA_SVBLANK (1<<17) #define MI_WAIT_FOR_OVERLAY_FLIP (1<<16) #define MI_WAIT_FOR_PIPEB_VBLANK (1<<7) #define MI_WAIT_FOR_PIPEA_VBLANK (1<<3) #define MI_WAIT_FOR_PIPEB_SCAN_LINE_WINDOW (1<<5) #define MI_WAIT_FOR_PIPEA_SCAN_LINE_WINDOW (1<<1) #define MI_LOAD_SCAN_LINES_INCL (0x12<<23) /* Flush */ #define MI_FLUSH (0x04<<23) #define MI_WRITE_DIRTY_STATE (1<<4) #define MI_END_SCENE (1<<3) #define MI_GLOBAL_SNAPSHOT_COUNT_RESET (1<<3) #define MI_INHIBIT_RENDER_CACHE_FLUSH (1<<2) #define MI_STATE_INSTRUCTION_CACHE_FLUSH (1<<1) #define MI_INVALIDATE_MAP_CACHE (1<<0) /* broadwater flush bits */ #define BRW_MI_GLOBAL_SNAPSHOT_RESET (1 << 3) /* Noop */ #define MI_NOOP 0x00 #define MI_NOOP_WRITE_ID (1<<22) #define MI_NOOP_ID_MASK (1<<22 - 1) #define STATE3D_COLOR_FACTOR ((0x3<<29)|(0x1d<<24)|(0x01<<16)) /* Batch */ #define MI_BATCH_BUFFER ((0x30 << 23) | 1) #define MI_BATCH_BUFFER_START (0x31 << 23) #define MI_BATCH_BUFFER_END (0xA << 23) #define MI_BATCH_NON_SECURE (1) #define MI_BATCH_NON_SECURE_I965 (1 << 8) #define MAX_DISPLAY_PIPES 2 typedef enum { CrtIndex = 0, TvIndex, DfpIndex, LfpIndex, Crt2Index, Tv2Index, Dfp2Index, Lfp2Index, NumDisplayTypes } DisplayType; /* What's connected to the pipes (as reported by the BIOS) */ #define PIPE_ACTIVE_MASK 0xff #define PIPE_CRT_ACTIVE (1 << CrtIndex) #define PIPE_TV_ACTIVE (1 << TvIndex) #define PIPE_DFP_ACTIVE (1 << DfpIndex) #define PIPE_LCD_ACTIVE (1 << LfpIndex) #define PIPE_CRT2_ACTIVE (1 << Crt2Index) #define PIPE_TV2_ACTIVE (1 << Tv2Index) #define PIPE_DFP2_ACTIVE (1 << Dfp2Index) #define PIPE_LCD2_ACTIVE (1 << Lfp2Index) #define PIPE_SIZED_DISP_MASK (PIPE_DFP_ACTIVE | \ PIPE_LCD_ACTIVE | \ PIPE_DFP2_ACTIVE) #define PIPE_A_SHIFT 0 #define PIPE_B_SHIFT 8 #define PIPE_SHIFT(n) ((n) == 0 ? \ PIPE_A_SHIFT : PIPE_B_SHIFT) /* * Some BIOS scratch area registers. The 845 (and 830?) store the amount * of video memory available to the BIOS in SWF1. */ #define SWF0 0x71410 #define SWF1 0x71414 #define SWF2 0x71418 #define SWF3 0x7141c #define SWF4 0x71420 #define SWF5 0x71424 #define SWF6 0x71428 /* * 855 scratch registers. */ #define SWF00 0x70410 #define SWF01 0x70414 #define SWF02 0x70418 #define SWF03 0x7041c #define SWF04 0x70420 #define SWF05 0x70424 #define SWF06 0x70428 #define SWF10 SWF0 #define SWF11 SWF1 #define SWF12 SWF2 #define SWF13 SWF3 #define SWF14 SWF4 #define SWF15 SWF5 #define SWF16 SWF6 #define SWF30 0x72414 #define SWF31 0x72418 #define SWF32 0x7241c /* * Overlay registers. These are overlay registers accessed via MMIO. * Those loaded via the overlay register page are defined in i830_video.c. */ #define OVADD 0x30000 #define DOVSTA 0x30008 #define OC_BUF (0x3<<20) #define OGAMC5 0x30010 #define OGAMC4 0x30014 #define OGAMC3 0x30018 #define OGAMC2 0x3001c #define OGAMC1 0x30020 #define OGAMC0 0x30024 /* * Palette registers */ #define PALETTE_A 0x0a000 #define PALETTE_B 0x0a800 /* Framebuffer compression */ #define FBC_CFB_BASE 0x03200 /* 4k page aligned */ #define FBC_LL_BASE 0x03204 /* 4k page aligned */ #define FBC_CONTROL 0x03208 #define FBC_CTL_EN (1<<31) #define FBC_CTL_PERIODIC (1<<30) #define FBC_CTL_INTERVAL_SHIFT (16) #define FBC_CTL_UNCOMPRESSIBLE (1<<14) #define FBC_CTL_STRIDE_SHIFT (5) #define FBC_CTL_FENCENO (1<<0) #define FBC_COMMAND 0x0320c #define FBC_CMD_COMPRESS (1<<0) #define FBC_STATUS 0x03210 #define FBC_STAT_COMPRESSING (1<<31) #define FBC_STAT_COMPRESSED (1<<30) #define FBC_STAT_MODIFIED (1<<29) #define FBC_STAT_CURRENT_LINE (1<<0) #define FBC_CONTROL2 0x03214 #define FBC_CTL_FENCE_DBL (0<<4) #define FBC_CTL_IDLE_IMM (0<<2) #define FBC_CTL_IDLE_FULL (1<<2) #define FBC_CTL_IDLE_LINE (2<<2) #define FBC_CTL_IDLE_DEBUG (3<<2) #define FBC_CTL_CPU_FENCE (1<<1) #define FBC_CTL_PLANEA (0<<0) #define FBC_CTL_PLANEB (1<<0) #define FBC_FENCE_OFF 0x0321b #define FBC_MOD_NUM 0x03220 #define FBC_TAG_DEBUG 0x03300 #define FBC_LL_SIZE (1536) #define FBC_LL_PAD (32) /* Framebuffer compression version 2 */ #define DPFC_CB_BASE 0x3200 #define DPFC_CONTROL 0x3208 #define DPFC_CTL_EN (1<<31) #define DPFC_CTL_PLANEA (0<<30) #define DPFC_CTL_PLANEB (1<<30) #define DPFC_CTL_FENCE_EN (1<<29) #define DPFC_CTL_LIMIT_1X (0<<6) #define DPFC_CTL_LIMIT_2X (1<<6) #define DPFC_CTL_LIMIT_4X (2<<6) #define DPFC_RECOMP_CTL 0x320c #define DPFC_RECOMP_STALL_EN (1<<27) #define DPFC_RECOMP_STALL_WM_SHIFT (16) #define DPFC_RECOMP_STALL_WM_MASK (0x07ff0000) #define DPFC_RECOMP_TIMER_COUNT_SHIFT (0) #define DPFC_RECOMP_TIMER_COUNT_MASK (0x0000003f) #define DPFC_STATUS 0x3210 #define DPFC_INVAL_SEG_SHIFT (16) #define DPFC_INVAL_SEG_MASK (0x07ff0000) #define DPFC_COMP_SEG_SHIFT (0) #define DPFC_COMP_SEG_MASK (0x000003ff) #define DPFC_STATUS2 0x3214 #define DPFC_FENCE_YOFF 0x3218 #define PEG_BAND_GAP_DATA 0x14d68 #define MCHBAR_RENDER_STANDBY 0x111B8 #define RENDER_STANDBY_ENABLE (1 << 30) /* Ironlake */ /* warmup time in us */ #define WARMUP_PCH_REF_CLK_SSC_MOD 1 #define WARMUP_PCH_FDI_RECEIVER_PLL 25 #define WARMUP_PCH_DPLL 50 #define WARMUP_CPU_DP_PLL 20 #define WARMUP_CPU_FDI_TRANSMITTER_PLL 10 #define WARMUP_DMI_LATENCY 20 #define FDI_TRAIN_PATTERN_1_TIME 0.5 #define FDI_TRAIN_PATTERN_2_TIME 1.5 #define FDI_ONE_IDLE_PATTERN_TIME 31 #define CPU_VGACNTRL 0x41000 #define DIGITAL_PORT_HOTPLUG_CNTRL 0x44030 #define DIGITAL_PORTA_HOTPLUG_ENABLE (1 << 4) #define DIGITAL_PORTA_SHORT_PULSE_2MS (0 << 2) #define DIGITAL_PORTA_SHORT_PULSE_4_5MS (1 << 2) #define DIGITAL_PORTA_SHORT_PULSE_6MS (2 << 2) #define DIGITAL_PORTA_SHORT_PULSE_100MS (3 << 2) #define DIGITAL_PORTA_NO_DETECT (0 << 0) #define DIGITAL_PORTA_LONG_PULSE_DETECT_MASK (1 << 1) #define DIGITAL_PORTA_SHORT_PULSE_DETECT_MASK (1 << 0) /* refresh rate hardware control */ #define RR_HW_CTL 0x45300 #define RR_HW_LOW_POWER_FRAMES_MASK 0xff #define RR_HW_HIGH_POWER_FRAMES_MASK 0xff00 #define FDI_PLL_BIOS_0 0x46000 #define FDI_PLL_BIOS_1 0x46004 #define FDI_PLL_BIOS_2 0x46008 #define DISPLAY_PORT_PLL_BIOS_0 0x4600c #define DISPLAY_PORT_PLL_BIOS_1 0x46010 #define DISPLAY_PORT_PLL_BIOS_2 0x46014 #define FDI_PLL_FREQ_CTL 0x46030 #define FDI_PLL_FREQ_CHANGE_REQUEST (1<<24) #define FDI_PLL_FREQ_LOCK_LIMIT_MASK 0xfff00 #define FDI_PLL_FREQ_DISABLE_COUNT_LIMIT_MASK 0xff #define PIPEA_DATA_M1 0x60030 #define TU_SIZE(x) (((x)-1) << 25) /* default size 64 */ #define TU_SIZE_MASK 0x7e000000 #define PIPEA_DATA_M1_OFFSET 0 #define PIPEA_DATA_N1 0x60034 #define PIPEA_DATA_N1_OFFSET 0 #define PIPEA_DATA_M2 0x60038 #define PIPEA_DATA_M2_OFFSET 0 #define PIPEA_DATA_N2 0x6003c #define PIPEA_DATA_N2_OFFSET 0 #define PIPEA_LINK_M1 0x60040 #define PIPEA_LINK_M1_OFFSET 0 #define PIPEA_LINK_N1 0x60044 #define PIPEA_LINK_N1_OFFSET 0 #define PIPEA_LINK_M2 0x60048 #define PIPEA_LINK_M2_OFFSET 0 #define PIPEA_LINK_N2 0x6004c #define PIPEA_LINK_N2_OFFSET 0 /* PIPEB timing regs are same start from 0x61000 */ #define PIPEB_DATA_M1 0x61030 #define PIPEB_DATA_N1 0x61034 #define PIPEB_DATA_M2 0x61038 #define PIPEB_DATA_N2 0x6103c #define PIPEB_LINK_M1 0x61040 #define PIPEB_LINK_N1 0x61044 #define PIPEB_LINK_M2 0x61048 #define PIPEB_LINK_N2 0x6104c /* PIPEC timing regs */ #define PIPEC_DATA_M1 0x62030 #define PIPEC_DATA_N1 0x62034 #define PIPEC_DATA_M2 0x62038 #define PIPEC_DATA_N2 0x6203c #define PIPEC_LINK_M1 0x62040 #define PIPEC_LINK_N1 0x62044 #define PIPEC_LINK_M2 0x62048 #define PIPEC_LINK_N2 0x6204c /* PIPECONF for pipe A/B addr is same */ /* cusor A is only connected to pipe A, cursor B is connected to pipe B. Otherwise no change. */ /* Plane A/B, DSPACNTR/DSPBCNTR addr not changed */ /* CPU panel fitter */ #define PFA_CTL_1 0x68080 #define PFB_CTL_1 0x68880 #define PFC_CTL_1 0x69080 #define PF_ENABLE (1<<31) #define PFA_CTL_2 0x68084 #define PFB_CTL_2 0x68884 #define PFC_CTL_2 0x69084 #define PFA_CTL_3 0x68088 #define PFB_CTL_3 0x68888 #define PFC_CTL_3 0x69088 #define PFA_CTL_4 0x68090 #define PFB_CTL_4 0x68890 #define PFC_CTL_4 0x69090 #define PFA_WIN_POS 0x68070 #define PFB_WIN_POS 0x68870 #define PFC_WIN_POS 0x69070 #define PFA_WIN_SIZE 0x68074 #define PFB_WIN_SIZE 0x68874 #define PFC_WIN_SIZE 0x69074 /* legacy palette */ #define LGC_PALETTE_A 0x4a000 #define LGC_PALETTE_B 0x4a800 /* interrupts */ #define DE_MASTER_IRQ_CONTROL (1 << 31) #define DE_SPRITEB_FLIP_DONE (1 << 29) #define DE_SPRITEA_FLIP_DONE (1 << 28) #define DE_PLANEB_FLIP_DONE (1 << 27) #define DE_PLANEA_FLIP_DONE (1 << 26) #define DE_PCU_EVENT (1 << 25) #define DE_GTT_FAULT (1 << 24) #define DE_POISON (1 << 23) #define DE_PERFORM_COUNTER (1 << 22) #define DE_PCH_EVENT (1 << 21) #define DE_AUX_CHANNEL_A (1 << 20) #define DE_DP_A_HOTPLUG (1 << 19) #define DE_GSE (1 << 18) #define DE_PIPEB_VBLANK (1 << 15) #define DE_PIPEB_EVEN_FIELD (1 << 14) #define DE_PIPEB_ODD_FIELD (1 << 13) #define DE_PIPEB_LINE_COMPARE (1 << 12) #define DE_PIPEB_VSYNC (1 << 11) #define DE_PIPEB_FIFO_UNDERRUN (1 << 8) #define DE_PIPEA_VBLANK (1 << 7) #define DE_PIPEA_EVEN_FIELD (1 << 6) #define DE_PIPEA_ODD_FIELD (1 << 5) #define DE_PIPEA_LINE_COMPARE (1 << 4) #define DE_PIPEA_VSYNC (1 << 3) #define DE_PIPEA_FIFO_UNDERRUN (1 << 0) #define DEISR 0x44000 #define DEIMR 0x44004 #define DEIIR 0x44008 #define DEIER 0x4400c /* GT interrupt */ #define GT_SYNC_STATUS (1 << 2) #define GT_USER_INTERRUPT (1 << 0) #define GTISR 0x44010 #define GTIMR 0x44014 #define GTIIR 0x44018 #define GTIER 0x4401c /* PCH */ /* south display engine interrupt */ #define SDE_CRT_HOTPLUG (1 << 11) #define SDE_PORTD_HOTPLUG (1 << 10) #define SDE_PORTC_HOTPLUG (1 << 9) #define SDE_PORTB_HOTPLUG (1 << 8) #define SDE_SDVOB_HOTPLUG (1 << 6) #define SDEISR 0xc4000 #define SDEIMR 0xc4004 #define SDEIIR 0xc4008 #define SDEIER 0xc400c /* digital port hotplug */ #define PCH_PORT_HOTPLUG 0xc4030 #define PORTD_HOTPLUG_ENABLE (1 << 20) #define PORTD_PULSE_DURATION_2ms (0) #define PORTD_PULSE_DURATION_4_5ms (1 << 18) #define PORTD_PULSE_DURATION_6ms (2 << 18) #define PORTD_PULSE_DURATION_100ms (3 << 18) #define PORTD_HOTPLUG_NO_DETECT (0) #define PORTD_HOTPLUG_SHORT_DETECT (1 << 16) #define PORTD_HOTPLUG_LONG_DETECT (1 << 17) #define PORTC_HOTPLUG_ENABLE (1 << 12) #define PORTC_PULSE_DURATION_2ms (0) #define PORTC_PULSE_DURATION_4_5ms (1 << 10) #define PORTC_PULSE_DURATION_6ms (2 << 10) #define PORTC_PULSE_DURATION_100ms (3 << 10) #define PORTC_HOTPLUG_NO_DETECT (0) #define PORTC_HOTPLUG_SHORT_DETECT (1 << 8) #define PORTC_HOTPLUG_LONG_DETECT (1 << 9) #define PORTB_HOTPLUG_ENABLE (1 << 4) #define PORTB_PULSE_DURATION_2ms (0) #define PORTB_PULSE_DURATION_4_5ms (1 << 2) #define PORTB_PULSE_DURATION_6ms (2 << 2) #define PORTB_PULSE_DURATION_100ms (3 << 2) #define PORTB_HOTPLUG_NO_DETECT (0) #define PORTB_HOTPLUG_SHORT_DETECT (1 << 0) #define PORTB_HOTPLUG_LONG_DETECT (1 << 1) #define PCH_GPIOA 0xc5010 #define PCH_GPIOB 0xc5014 #define PCH_GPIOC 0xc5018 #define PCH_GPIOD 0xc501c #define PCH_GPIOE 0xc5020 #define PCH_GPIOF 0xc5024 #define PCH_GMBUS0 0xc5100 #define PCH_GMBUS1 0xc5104 #define PCH_GMBUS2 0xc5108 #define PCH_GMBUS3 0xc510c #define PCH_GMBUS4 0xc5110 #define PCH_GMBUS5 0xc5120 #define PCH_DPLL_A 0xc6014 #define PCH_DPLL_B 0xc6018 #define PCH_FPA0 0xc6040 #define PCH_FPA1 0xc6044 #define PCH_FPB0 0xc6048 #define PCH_FPB1 0xc604c #define PCH_DPLL_TEST 0xc606c #define PCH_DREF_CONTROL 0xC6200 #define DREF_CONTROL_MASK 0x7fc3 #define DREF_CPU_SOURCE_OUTPUT_DISABLE (0<<13) #define DREF_CPU_SOURCE_OUTPUT_DOWNSPREAD (2<<13) #define DREF_CPU_SOURCE_OUTPUT_NONSPREAD (3<<13) #define DREF_SSC_SOURCE_DISABLE (0<<11) #define DREF_SSC_SOURCE_ENABLE (2<<11) #define DREF_NONSPREAD_SOURCE_DISABLE (0<<9) #define DREF_NONSPREAD_SOURCE_ENABLE (2<<9) #define DREF_SUPERSPREAD_SOURCE_DISABLE (0<<7) #define DREF_SUPERSPREAD_SOURCE_ENABLE (2<<7) #define DREF_SSC4_DOWNSPREAD (0<<6) #define DREF_SSC4_CENTERSPREAD (1<<6) #define DREF_SSC1_DISABLE (0<<1) #define DREF_SSC1_ENABLE (1<<1) #define DREF_SSC4_DISABLE (0) #define DREF_SSC4_ENABLE (1) #define PCH_RAWCLK_FREQ 0xc6204 #define FDL_TP1_TIMER_SHIFT 12 #define FDL_TP1_TIMER_MASK (3<<12) #define FDL_TP2_TIMER_SHIFT 10 #define FDL_TP2_TIMER_MASK (3<<10) #define RAWCLK_FREQ_MASK 0x3ff #define PCH_DPLL_TMR_CFG 0xc6208 #define PCH_SSC4_PARMS 0xc6210 #define PCH_SSC4_AUX_PARMS 0xc6214 /* CPT */ #define PCH_DPLL_ANALOG_CTL 0xc6300 #define PCH_DPLL_SEL 0xc7000 #define TRANSA_DPLL_ENABLE (1<<3) #define TRANSA_DPLLA_SEL (0) #define TRANSA_DPLLB_SEL (1<<0) #define TRANSB_DPLL_ENABLE (1<<7) #define TRANSB_DPLLA_SEL (0<<4) #define TRANSB_DPLLB_SEL (1<<4) #define TRANSC_DPLL_ENABLE (1<<11) #define TRANSC_DPLLA_SEL (0<<8) #define TRANSC_DPLLB_SEL (1<<8) /* transcoder */ #define TRANS_HTOTAL_A 0xe0000 #define TRANS_HTOTAL_SHIFT 16 #define TRANS_HACTIVE_SHIFT 0 #define TRANS_HBLANK_A 0xe0004 #define TRANS_HBLANK_END_SHIFT 16 #define TRANS_HBLANK_START_SHIFT 0 #define TRANS_HSYNC_A 0xe0008 #define TRANS_HSYNC_END_SHIFT 16 #define TRANS_HSYNC_START_SHIFT 0 #define TRANS_VTOTAL_A 0xe000c #define TRANS_VTOTAL_SHIFT 16 #define TRANS_VACTIVE_SHIFT 0 #define TRANS_VBLANK_A 0xe0010 #define TRANS_VBLANK_END_SHIFT 16 #define TRANS_VBLANK_START_SHIFT 0 #define TRANS_VSYNC_A 0xe0014 #define TRANS_VSYNC_END_SHIFT 16 #define TRANS_VSYNC_START_SHIFT 0 #define TRANS_VSYNCSHIFT_A 0xe0028 #define TRANSA_DATA_M1 0xe0030 #define TRANSA_DATA_N1 0xe0034 #define TRANSA_DATA_M2 0xe0038 #define TRANSA_DATA_N2 0xe003c #define TRANSA_DP_LINK_M1 0xe0040 #define TRANSA_DP_LINK_N1 0xe0044 #define TRANSA_DP_LINK_M2 0xe0048 #define TRANSA_DP_LINK_N2 0xe004c #define TRANS_HTOTAL_B 0xe1000 #define TRANS_HBLANK_B 0xe1004 #define TRANS_HSYNC_B 0xe1008 #define TRANS_VTOTAL_B 0xe100c #define TRANS_VBLANK_B 0xe1010 #define TRANS_VSYNC_B 0xe1014 #define TRANS_VSYNCSHIFT_B 0xe1028 #define TRANSB_DATA_M1 0xe1030 #define TRANSB_DATA_N1 0xe1034 #define TRANSB_DATA_M2 0xe1038 #define TRANSB_DATA_N2 0xe103c #define TRANSB_DP_LINK_M1 0xe1040 #define TRANSB_DP_LINK_N1 0xe1044 #define TRANSB_DP_LINK_M2 0xe1048 #define TRANSB_DP_LINK_N2 0xe104c #define TRANS_HTOTAL_C 0xe2000 #define TRANS_HBLANK_C 0xe2004 #define TRANS_HSYNC_C 0xe2008 #define TRANS_VTOTAL_C 0xe200c #define TRANS_VBLANK_C 0xe2010 #define TRANS_VSYNC_C 0xe2014 #define TRANS_VSYNCSHIFT_C 0xe2028 #define TRANSC_DATA_M1 0xe2030 #define TRANSC_DATA_N1 0xe2034 #define TRANSC_DATA_M2 0xe2038 #define TRANSC_DATA_N2 0xe203c #define TRANSC_DP_LINK_M1 0xe2040 #define TRANSC_DP_LINK_N1 0xe2044 #define TRANSC_DP_LINK_M2 0xe2048 #define TRANSC_DP_LINK_N2 0xe204c #define TRANSACONF 0xf0008 #define TRANSBCONF 0xf1008 #define TRANSCCONF 0xf2008 #define TRANS_DISABLE (0<<31) #define TRANS_ENABLE (1<<31) #define TRANS_STATE_MASK (1<<30) #define TRANS_STATE_DISABLE (0<<30) #define TRANS_STATE_ENABLE (1<<30) #define TRANS_FSYNC_DELAY_HB1 (0<<27) #define TRANS_FSYNC_DELAY_HB2 (1<<27) #define TRANS_FSYNC_DELAY_HB3 (2<<27) #define TRANS_FSYNC_DELAY_HB4 (3<<27) #define TRANS_DP_AUDIO_ONLY (1<<26) #define TRANS_DP_VIDEO_AUDIO (0<<26) #define TRANS_PROGRESSIVE (0<<21) #define TRANS_8BPC (0<<5) #define TRANS_10BPC (1<<5) #define TRANS_6BPC (2<<5) #define TRANS_12BPC (3<<5) #define FDI_RXA_CHICKEN 0xc200c #define FDI_RXB_CHICKEN 0xc2010 #define FDI_RX_PHASE_SYNC_POINTER_ENABLE (1) /* CPU: FDI_TX */ #define FDI_TXA_CTL 0x60100 #define FDI_TXB_CTL 0x61100 #define FDI_TXC_CTL 0x62100 #define FDI_TX_DISABLE (0<<31) #define FDI_TX_ENABLE (1<<31) #define FDI_LINK_TRAIN_PATTERN_1 (0<<28) #define FDI_LINK_TRAIN_PATTERN_2 (1<<28) #define FDI_LINK_TRAIN_PATTERN_IDLE (2<<28) #define FDI_LINK_TRAIN_NONE (3<<28) #define FDI_LINK_TRAIN_VOLTAGE_0_4V (0<<25) #define FDI_LINK_TRAIN_VOLTAGE_0_6V (1<<25) #define FDI_LINK_TRAIN_VOLTAGE_0_8V (2<<25) #define FDI_LINK_TRAIN_VOLTAGE_1_2V (3<<25) #define FDI_LINK_TRAIN_PRE_EMPHASIS_NONE (0<<22) #define FDI_LINK_TRAIN_PRE_EMPHASIS_1_5X (1<<22) #define FDI_LINK_TRAIN_PRE_EMPHASIS_2X (2<<22) #define FDI_LINK_TRAIN_PRE_EMPHASIS_3X (3<<22) /* ILK always use 400mV 0dB for voltage swing and pre-emphasis level. SNB has different settings. */ /* SNB A-stepping */ #define FDI_LINK_TRAIN_400MV_0DB_SNB_A (0x38<<22) #define FDI_LINK_TRAIN_400MV_6DB_SNB_A (0x02<<22) #define FDI_LINK_TRAIN_600MV_3_5DB_SNB_A (0x01<<22) #define FDI_LINK_TRAIN_800MV_0DB_SNB_A (0x0<<22) /* SNB B-stepping */ #define FDI_LINK_TRAIN_400MV_0DB_SNB_B (0x0<<22) #define FDI_LINK_TRAIN_400MV_6DB_SNB_B (0x3a<<22) #define FDI_LINK_TRAIN_600MV_3_5DB_SNB_B (0x39<<22) #define FDI_LINK_TRAIN_800MV_0DB_SNB_B (0x38<<22) #define FDI_LINK_TRAIN_VOL_EMP_MASK (0x3f<<22) #define FDI_DP_PORT_WIDTH_X1 (0<<19) #define FDI_DP_PORT_WIDTH_X2 (1<<19) #define FDI_DP_PORT_WIDTH_X3 (2<<19) #define FDI_DP_PORT_WIDTH_X4 (3<<19) #define FDI_TX_ENHANCE_FRAME_ENABLE (1<<18) /* Ironlake: hardwired to 1 */ #define FDI_TX_PLL_ENABLE (1<<14) /* both Tx and Rx */ #define FDI_SCRAMBLING_ENABLE (0<<7) #define FDI_SCRAMBLING_DISABLE (1<<7) /* FDI_RX, FDI_X is hard-wired to Transcoder_X */ #define FDI_RXA_CTL 0xf000c #define FDI_RXB_CTL 0xf100c #define FDI_RXC_CTL 0xf200c #define FDI_RX_ENABLE (1<<31) #define FDI_RX_DISABLE (0<<31) /* train, dp width same as FDI_TX */ #define FDI_DP_PORT_WIDTH_X8 (7<<19) #define FDI_8BPC (0<<16) #define FDI_10BPC (1<<16) #define FDI_6BPC (2<<16) #define FDI_12BPC (3<<16) #define FDI_LINK_REVERSE_OVERWRITE (1<<15) #define FDI_DMI_LINK_REVERSE_MASK (1<<14) #define FDI_RX_PLL_ENABLE (1<<13) #define FDI_FS_ERR_CORRECT_ENABLE (1<<11) #define FDI_FE_ERR_CORRECT_ENABLE (1<<10) #define FDI_FS_ERR_REPORT_ENABLE (1<<9) #define FDI_FE_ERR_REPORT_ENABLE (1<<8) #define FDI_RX_ENHANCE_FRAME_ENABLE (1<<6) #define FDI_SEL_RAWCLK (0<<4) #define FDI_SEL_PCDCLK (1<<4) /* CPT */ #define FDI_AUTO_TRAINING (1<<10) #define FDI_LINK_TRAIN_PATTERN_1_CPT (0<<8) #define FDI_LINK_TRAIN_PATTERN_2_CPT (1<<8) #define FDI_LINK_TRAIN_PATTERN_IDLE_CPT (2<<8) #define FDI_LINK_TRAIN_NORMAL_CPT (3<<8) #define FDI_LINK_TRAIN_PATTERN_MASK_CPT (3<<8) #define FDI_RXA_MISC 0xf0010 #define FDI_RXB_MISC 0xf1010 #define FDI_RXC_MISC 0xf2010 #define FDI_RXA_TUSIZE1 0xf0030 #define FDI_RXA_TUSIZE2 0xf0038 #define FDI_RXB_TUSIZE1 0xf1030 #define FDI_RXB_TUSIZE2 0xf1038 #define FDI_RXC_TUSIZE1 0xf2030 #define FDI_RXC_TUSIZE2 0xf2038 /* FDI_RX interrupt register format */ #define FDI_RX_INTER_LANE_ALIGN (1<<10) #define FDI_RX_SYMBOL_LOCK (1<<9) /* train 2 */ #define FDI_RX_BIT_LOCK (1<<8) /* train 1 */ #define FDI_RX_TRAIN_PATTERN_2_FAIL (1<<7) #define FDI_RX_FS_CODE_ERR (1<<6) #define FDI_RX_FE_CODE_ERR (1<<5) #define FDI_RX_SYMBOL_ERR_RATE_ABOVE (1<<4) #define FDI_RX_HDCP_LINK_FAIL (1<<3) #define FDI_RX_PIXEL_FIFO_OVERFLOW (1<<2) #define FDI_RX_CROSS_CLOCK_OVERFLOW (1<<1) #define FDI_RX_SYMBOL_QUEUE_OVERFLOW (1<<0) #define FDI_RXA_IIR 0xf0014 #define FDI_RXA_IMR 0xf0018 #define FDI_RXB_IIR 0xf1014 #define FDI_RXB_IMR 0xf1018 #define FDI_PLL_CTL_1 0xfe000 #define FDI_PLL_CTL_2 0xfe004 /* CRT */ #define PCH_ADPA 0xe1100 #define ADPA_TRANS_SELECT_MASK (1<<30) #define ADPA_TRANS_A_SELECT 0 #define ADPA_TRANS_B_SELECT (1<<30) /* HPD is here */ #define ADPA_CRT_HOTPLUG_MASK 0x03ff0000 /* bit 25-16 */ #define ADPA_CRT_HOTPLUG_MONITOR_NONE (0<<24) #define ADPA_CRT_HOTPLUG_MONITOR_MASK (3<<24) #define ADPA_CRT_HOTPLUG_MONITOR_COLOR (3<<24) #define ADPA_CRT_HOTPLUG_MONITOR_MONO (2<<24) #define ADPA_CRT_HOTPLUG_ENABLE (1<<23) #define ADPA_CRT_HOTPLUG_PERIOD_64 (0<<22) #define ADPA_CRT_HOTPLUG_PERIOD_128 (1<<22) #define ADPA_CRT_HOTPLUG_WARMUP_5MS (0<<21) #define ADPA_CRT_HOTPLUG_WARMUP_10MS (1<<21) #define ADPA_CRT_HOTPLUG_SAMPLE_2S (0<<20) #define ADPA_CRT_HOTPLUG_SAMPLE_4S (1<<20) #define ADPA_CRT_HOTPLUG_VOLTAGE_40 (0<<18) #define ADPA_CRT_HOTPLUG_VOLTAGE_50 (1<<18) #define ADPA_CRT_HOTPLUG_VOLTAGE_60 (2<<18) #define ADPA_CRT_HOTPLUG_VOLTAGE_70 (3<<18) #define ADPA_CRT_HOTPLUG_VOLREF_325MV (0<<17) #define ADPA_CRT_HOTPLUG_VOLREF_475MV (1<<17) #define ADPA_CRT_HOTPLUG_FORCE_TRIGGER (1<<16) /* polarity control not changed */ /* or SDVOB */ #define HDMIB 0xe1140 #define PORT_ENABLE (1 << 31) #define TRANSCODER_A (0) #define TRANSCODER_B (1 << 30) #define COLOR_FORMAT_8bpc (0) #define COLOR_FORMAT_12bpc (3 << 26) #define SDVOB_HOTPLUG_ENABLE (1 << 23) #define SDVO_ENCODING (0) #define TMDS_ENCODING (2 << 10) #define NULL_PACKET_VSYNC_ENABLE (1 << 9) #define SDVOB_BORDER_ENABLE (1 << 7) #define AUDIO_ENABLE (1 << 6) #define VSYNC_ACTIVE_HIGH (1 << 4) #define HSYNC_ACTIVE_HIGH (1 << 3) #define PORT_DETECTED (1 << 2) #define HDMIC 0xe1150 #define HDMID 0xe1160 #define PCH_LVDS 0xe1180 #define BLC_PWM_CPU_CTL2 0x48250 #define PWM_ENABLE (1 << 31) #define PWM_PIPE_A (0 << 29) #define PWM_PIPE_B (1 << 29) #define BLC_PWM_CPU_CTL 0x48254 #define BLC_PWM_PCH_CTL1 0xc8250 #define PWM_PCH_ENABLE (1 << 31) #define PWM_POLARITY_ACTIVE_LOW (1 << 29) #define PWM_POLARITY_ACTIVE_HIGH (0 << 29) #define PWM_POLARITY_ACTIVE_LOW2 (1 << 28) #define PWM_POLARITY_ACTIVE_HIGH2 (0 << 28) #define BLC_PWM_PCH_CTL2 0xc8254 #define PCH_PP_STATUS 0xc7200 #define PCH_PP_CONTROL 0xc7204 #define EDP_FORCE_VDD (1 << 3) #define EDP_BLC_ENABLE (1 << 2) #define PANEL_POWER_RESET (1 << 1) #define PANEL_POWER_OFF (0 << 0) #define PANEL_POWER_ON (1 << 0) #define PCH_PP_ON_DELAYS 0xc7208 #define EDP_PANEL (1 << 30) #define PCH_PP_OFF_DELAYS 0xc720c #define PCH_PP_DIVISOR 0xc7210 #define AUD_CONFIG 0x62000 #define AUD_DEBUG 0x62010 #define AUD_VID_DID 0x62020 #define AUD_RID 0x62024 #define AUD_SUBN_CNT 0x62028 #define AUD_FUNC_GRP 0x62040 #define AUD_SUBN_CNT2 0x62044 #define AUD_GRP_CAP 0x62048 #define AUD_PWRST 0x6204c #define AUD_SUPPWR 0x62050 #define AUD_SID 0x62054 #define AUD_OUT_CWCAP 0x62070 #define AUD_OUT_PCMSIZE 0x62074 #define AUD_OUT_STR 0x62078 #define AUD_OUT_DIG_CNVT 0x6207c #define AUD_OUT_CH_STR 0x62080 #define AUD_OUT_STR_DESC 0x62084 #define AUD_PINW_CAP 0x620a0 #define AUD_PIN_CAP 0x620a4 #define AUD_PINW_CONNLNG 0x620a8 #define AUD_PINW_CONNLST 0x620ac #define AUD_PINW_CNTR 0x620b0 #define AUD_PINW_UNSOLRESP 0x620b8 #define AUD_CNTL_ST 0x620b4 #define AUD_PINW_CONFIG 0x620bc #define AUD_HDMIW_STATUS 0x620d4 #define AUD_HDMIW_HDMIEDID 0x6210c #define AUD_HDMIW_INFOFR 0x62118 #define AUD_CONV_CHCNT 0x62120 #define AUD_CTS_ENABLE 0x62128 #define VIDEO_DIP_CTL 0x61170 #define VIDEO_DIP_DATA 0x61178 /* CPT */ #define TRANS_DP_CTL_A 0xe0300 #define TRANS_DP_CTL_B 0xe1300 #define TRANS_DP_CTL_C 0xe2300 #define TRANS_DP_OUTPUT_ENABLE (1<<31) #define TRANS_DP_PORT_SEL_B (0<<29) #define TRANS_DP_PORT_SEL_C (1<<29) #define TRANS_DP_PORT_SEL_D (2<<29) #define TRANS_DP_PORT_SEL_MASK (3<<29) #define TRANS_DP_AUDIO_ONLY (1<<26) #define TRANS_DP_ENH_FRAMING (1<<18) #define TRANS_DP_8BPC (0<<9) #define TRANS_DP_10BPC (1<<9) #define TRANS_DP_6BPC (2<<9) #define TRANS_DP_12BPC (3<<9) #define TRANS_DP_VSYNC_ACTIVE_HIGH (1<<4) #define TRANS_DP_VSYNC_ACTIVE_LOW 0 #define TRANS_DP_HSYNC_ACTIVE_HIGH (1<<3) #define TRANS_DP_HSYNC_ACTIVE_LOW 0 /* Debug regs */ #define GEN6_TD_CTL 0x7000 /* <= GEN5 was at 0x8000 */ #define GEN6_TD_CTL_FORCE_TD_BKPT (1<<4) /* Port debugging */ #define PORT_DBG 0x42308 #define PORT_DBG_DRRS_HW_STATE_OFF (0<<30) #define PORT_DBG_DRRS_HW_STATE_LOW (1<<30) #define PORT_DBG_DRRS_HW_STATE_HIGH (2<<30) /* RC6 residence counters */ #define RC6_RESIDENCY_TIME 0x138108 #define RC6p_RESIDENCY_TIME 0x13810C #define RC6pp_RESIDENCY_TIME 0x138110 #define GEN6_RPNSWREQ 0xA008 #define GEN6_RC_VIDEO_FREQ 0xA00C #define GEN6_RC_CONTROL 0xA090 #define GEN6_RP_DOWN_TIMEOUT 0xA010 #define GEN6_RP_INTERRUPT_LIMITS 0xA014 #define GEN6_RPSTAT1 0xA01C #define GEN6_RP_CONTROL 0xA024 #define GEN6_RP_UP_THRESHOLD 0xA02C #define GEN6_RP_DOWN_THRESHOLD 0xA030 #define GEN6_RP_CUR_UP_EI 0xA050 #define GEN6_RP_CUR_UP 0xA054 #define GEN6_RP_PREV_UP 0xA058 #define GEN6_RP_CUR_DOWN_EI 0xA05C #define GEN6_RP_CUR_DOWN 0xA060 #define GEN6_RP_PREV_DOWN 0xA064 #define GEN6_RP_UP_EI 0xA068 #define GEN6_RP_DOWN_EI 0xA06C #define GEN6_RP_IDLE_HYSTERSIS 0xA070 #define GEN6_RC_STATE 0xA094 #define GEN6_RC1_WAKE_RATE_LIMIT 0xA098 #define GEN6_RC6_WAKE_RATE_LIMIT 0xA09C #define GEN6_RC6pp_WAKE_RATE_LIMIT 0xA0A0 #define GEN6_RC_EVALUATION_INTERVAL 0xA0A8 #define GEN6_RC_IDLE_HYSTERSIS 0xA0AC #define GEN6_RC_SLEEP 0xA0B0 #define GEN6_RC1e_THRESHOLD 0xA0B4 #define GEN6_RC6_THRESHOLD 0xA0B8 #define GEN6_RC6p_THRESHOLD 0xA0BC #define GEN6_RC6pp_THRESHOLD 0xA0C0 #define GEN6_PMINTRMSK 0xA168 #define GEN6_RC_EVALUATION_INTERVAL 0xA0A8 #define GEN6_RC_IDLE_HYSTERSIS 0xA0AC #define GEN6_PMIER 0x4402C #define GEN6_PMIMR 0x44024 /* rps_lock */ #define GEN6_PMINTRMSK 0xA168 /* Haswell-related items */ /* HSW Power Wells */ #define HSW_PWR_WELL_CTL1 0x45400 /* BIOS */ #define HSW_PWR_WELL_CTL2 0x45404 /* Driver */ #define HSW_PWR_WELL_CTL3 0x45408 /* KVMR */ #define HSW_PWR_WELL_CTL4 0x4540C /* Debug */ #define HSW_PWR_WELL_ENABLE (1<<31) #define HSW_PWR_WELL_STATE (1<<30) #define HSW_PWR_WELL_CTL5 0x45410 #define HSW_PWR_WELL_ENABLE_SINGLE_STEP (1<<31) #define HSW_PWR_WELL_PWR_GATE_OVERRIDE (1<<20) #define HSW_PWR_WELL_FORCE_ON (1<<19) #define HSW_PWR_WELL_CTL6 0x45414 /* Per-pipe DDI Function Control */ #define PIPE_DDI_FUNC_CTL_A 0x60400 #define PIPE_DDI_FUNC_CTL_B 0x61400 #define PIPE_DDI_FUNC_CTL_C 0x62400 #define PIPE_DDI_FUNC_CTL_EDP 0x6F400 #define DDI_FUNC_CTL(pipe) _PIPE(pipe, \ PIPE_DDI_FUNC_CTL_A, \ PIPE_DDI_FUNC_CTL_B) #define PIPE_DDI_FUNC_ENABLE (1<<31) /* Those bits are ignored by pipe EDP since it can only connect to DDI A */ #define PIPE_DDI_PORT_MASK (0xf<<28) #define PIPE_DDI_SELECT_PORT(x) ((x)<<28) #define PIPE_DDI_MODE_SELECT_HDMI (0<<24) #define PIPE_DDI_MODE_SELECT_DVI (1<<24) #define PIPE_DDI_MODE_SELECT_DP_SST (2<<24) #define PIPE_DDI_MODE_SELECT_DP_MST (3<<24) #define PIPE_DDI_MODE_SELECT_FDI (4<<24) #define PIPE_DDI_BPC_8 (0<<20) #define PIPE_DDI_BPC_10 (1<<20) #define PIPE_DDI_BPC_6 (2<<20) #define PIPE_DDI_BPC_12 (3<<20) #define PIPE_DDI_BFI_ENABLE (1<<4) #define PIPE_DDI_PORT_WIDTH_X1 (0<<1) #define PIPE_DDI_PORT_WIDTH_X2 (1<<1) #define PIPE_DDI_PORT_WIDTH_X4 (3<<1) /* DisplayPort Transport Control */ #define DP_TP_CTL_A 0x64040 #define DP_TP_CTL_B 0x64140 #define DP_TP_CTL_C 0x64240 #define DP_TP_CTL_D 0x64340 #define DP_TP_CTL_E 0x64440 #define DP_TP_CTL_ENABLE (1<<31) #define DP_TP_CTL_MODE_SST (0<<27) #define DP_TP_CTL_MODE_MST (1<<27) #define DP_TP_CTL_ENHANCED_FRAME_ENABLE (1<<18) #define DP_TP_CTL_FDI_AUTOTRAIN (1<<15) #define DP_TP_CTL_LINK_TRAIN_MASK (7<<8) #define DP_TP_CTL_LINK_TRAIN_PAT1 (0<<8) #define DP_TP_CTL_LINK_TRAIN_PAT2 (1<<8) #define DP_TP_CTL_LINK_TRAIN_NORMAL (3<<8) /* DisplayPort Transport Status */ #define DP_TP_STATUS_A 0x64044 #define DP_TP_STATUS_B 0x64144 #define DP_TP_STATUS_C 0x64244 #define DP_TP_STATUS_D 0x64344 #define DP_TP_STATUS_E 0x64444 #define DP_TP_STATUS_AUTOTRAIN_DONE (1<<12) /* DDI Buffer Control */ #define DDI_BUF_CTL_A 0x64000 #define DDI_BUF_CTL_B 0x64100 #define DDI_BUF_CTL_C 0x64200 #define DDI_BUF_CTL_D 0x64300 #define DDI_BUF_CTL_E 0x64400 #define DDI_BUF_CTL_ENABLE (1<<31) #define DDI_BUF_EMP_400MV_0DB_HSW (0<<24) /* Sel0 */ #define DDI_BUF_EMP_400MV_3_5DB_HSW (1<<24) /* Sel1 */ #define DDI_BUF_EMP_400MV_6DB_HSW (2<<24) /* Sel2 */ #define DDI_BUF_EMP_400MV_9_5DB_HSW (3<<24) /* Sel3 */ #define DDI_BUF_EMP_600MV_0DB_HSW (4<<24) /* Sel4 */ #define DDI_BUF_EMP_600MV_3_5DB_HSW (5<<24) /* Sel5 */ #define DDI_BUF_EMP_600MV_6DB_HSW (6<<24) /* Sel6 */ #define DDI_BUF_EMP_800MV_0DB_HSW (7<<24) /* Sel7 */ #define DDI_BUF_EMP_800MV_3_5DB_HSW (8<<24) /* Sel8 */ #define DDI_BUF_EMP_MASK (0xf<<24) #define DDI_BUF_IS_IDLE (1<<7) #define DDI_PORT_WIDTH_X1 (0<<1) #define DDI_PORT_WIDTH_X2 (1<<1) #define DDI_PORT_WIDTH_X4 (3<<1) #define DDI_INIT_DISPLAY_DETECTED (1<<0) /* LPT PIXCLK_GATE */ #define PIXCLK_GATE 0xC6020 #define PIXCLK_GATE_UNGATE 1<<0 #define PIXCLK_GATE_GATE 0<<0 /* SPLL */ #define SPLL_CTL 0x46020 #define SPLL_PLL_ENABLE (1<<31) #define SPLL_PLL_SCC (1<<28) #define SPLL_PLL_NON_SCC (2<<28) #define SPLL_PLL_FREQ_810MHz (0<<26) #define SPLL_PLL_FREQ_1350MHz (1<<26) /* WRPLL */ #define WRPLL_CTL1 0x46040 #define WRPLL_CTL2 0x46060 #define WRPLL_PLL_ENABLE (1<<31) #define WRPLL_PLL_SELECT_SSC (0x01<<28) #define WRPLL_PLL_SELECT_NON_SCC (0x02<<28) #define WRPLL_PLL_SELECT_LCPLL_2700 (0x03<<28) /* WRPLL divider programming */ #define WRPLL_DIVIDER_REFERENCE(x) ((x)<<0) #define WRPLL_DIVIDER_POST(x) ((x)<<8) #define WRPLL_DIVIDER_FEEDBACK(x) ((x)<<16) /* Port clock selection */ #define PORT_CLK_SEL_A 0x46100 #define PORT_CLK_SEL_B 0x46104 #define PORT_CLK_SEL_C 0x46108 #define PORT_CLK_SEL_D 0x4610C #define PORT_CLK_SEL_E 0x46110 #define PORT_CLK_SEL_LCPLL_2700 (0<<29) #define PORT_CLK_SEL_LCPLL_1350 (1<<29) #define PORT_CLK_SEL_LCPLL_810 (2<<29) #define PORT_CLK_SEL_SPLL (3<<29) #define PORT_CLK_SEL_WRPLL1 (4<<29) #define PORT_CLK_SEL_WRPLL2 (5<<29) /* Pipe clock selection */ #define PIPE_CLK_SEL_A 0x46140 #define PIPE_CLK_SEL_B 0x46144 #define PIPE_CLK_SEL_C 0x46148 /* For each pipe, we need to select the corresponding port clock */ #define PIPE_CLK_SEL_DISABLED (0x0<<29) #define PIPE_CLK_SEL_PORT(x) ((x+1)<<29) /* LCPLL Control */ #define LCPLL_CTL 0x130040 #define LCPLL_PLL_DISABLE (1<<31) #define LCPLL_PLL_LOCK (1<<30) #define LCPLL_CD_CLOCK_DISABLE (1<<25) #define LCPLL_CD2X_CLOCK_DISABLE (1<<23) /* Pipe WM_LINETIME - watermark line time */ #define PIPE_WM_LINETIME_A 0x45270 #define PIPE_WM_LINETIME_B 0x45274 #define PIPE_WM_LINETIME_C 0x45278 #define PIPE_WM_LINETIME_MASK (0x1ff) #define PIPE_WM_LINETIME_TIME(x) ((x)) #define PIPE_WM_LINETIME_IPS_LINETIME_MASK (0x1ff<<16) #define PIPE_WM_LINETIME_IPS_LINETIME(x) ((x)<<16) /* SFUSE_STRAP */ #define SFUSE_STRAP 0xc2014 #define SFUSE_STRAP_DDIB_DETECTED (1<<2) #define SFUSE_STRAP_DDIC_DETECTED (1<<1) #define SFUSE_STRAP_DDID_DETECTED (1<<0) /* Valleyview related items */ /* Valleyview DPIO registers */ #define VLV_DISPLAY_BASE 0x180000 #define DPIO_PKT 0x2100 #define DPIO_RID (0 << 24) #define DPIO_OP_WRITE (1 << 16) #define DPIO_OP_READ (0 << 16) #define DPIO_PORTID (0x12 << 8) #define DPIO_BYTE (0xf << 4) #define DPIO_BUSY (1 << 0) #define DPIO_DATA 0x2104 #define DPIO_REG 0x2108 #endif /* _I810_REG_H */ intel-gpu-tools-1.3/lib/intel_reg_map.c0000644000175100017510000001433011714556251015071 00000000000000/* * Copyright 2011 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Ben Widawsky * */ #include #include #include #include #include "intel_gpu_tools.h" static struct intel_register_range gen_bwcl_register_map[] = { {0x00000000, 0x00000fff, INTEL_RANGE_RW}, {0x00001000, 0x00000fff, INTEL_RANGE_RSVD}, {0x00002000, 0x00000fff, INTEL_RANGE_RW}, {0x00003000, 0x000001ff, INTEL_RANGE_RW}, {0x00003200, 0x00000dff, INTEL_RANGE_RW}, {0x00004000, 0x000003ff, INTEL_RANGE_RSVD}, {0x00004400, 0x00000bff, INTEL_RANGE_RSVD}, {0x00005000, 0x00000fff, INTEL_RANGE_RW}, {0x00006000, 0x00000fff, INTEL_RANGE_RW}, {0x00007000, 0x000003ff, INTEL_RANGE_RW}, {0x00007400, 0x000014ff, INTEL_RANGE_RW}, {0x00008900, 0x000006ff, INTEL_RANGE_RSVD}, {0x00009000, 0x00000fff, INTEL_RANGE_RSVD}, {0x0000a000, 0x00000fff, INTEL_RANGE_RW}, {0x0000b000, 0x00004fff, INTEL_RANGE_RSVD}, {0x00010000, 0x00003fff, INTEL_RANGE_RW}, {0x00014000, 0x0001bfff, INTEL_RANGE_RSVD}, {0x00030000, 0x0000ffff, INTEL_RANGE_RW}, {0x00040000, 0x0001ffff, INTEL_RANGE_RSVD}, {0x00060000, 0x0000ffff, INTEL_RANGE_RW}, {0x00070000, 0x00002fff, INTEL_RANGE_RW}, {0x00073000, 0x00000fff, INTEL_RANGE_RW}, {0x00074000, 0x0000bfff, INTEL_RANGE_RSVD}, {0x00000000, 0x00000000, INTEL_RANGE_END} }; static struct intel_register_range gen4_register_map[] = { {0x00000000, 0x00000fff, INTEL_RANGE_RW}, {0x00001000, 0x00000fff, INTEL_RANGE_RSVD}, {0x00002000, 0x00000fff, INTEL_RANGE_RW}, {0x00003000, 0x000001ff, INTEL_RANGE_RW}, {0x00003200, 0x00000dff, INTEL_RANGE_RW}, {0x00004000, 0x000003ff, INTEL_RANGE_RW}, {0x00004400, 0x00000bff, INTEL_RANGE_RW}, {0x00005000, 0x00000fff, INTEL_RANGE_RW}, {0x00006000, 0x00000fff, INTEL_RANGE_RW}, {0x00007000, 0x000003ff, INTEL_RANGE_RW}, {0x00007400, 0x000014ff, INTEL_RANGE_RW}, {0x00008900, 0x000006ff, INTEL_RANGE_RSVD}, {0x00009000, 0x00000fff, INTEL_RANGE_RSVD}, {0x0000a000, 0x00000fff, INTEL_RANGE_RW}, {0x0000b000, 0x00004fff, INTEL_RANGE_RSVD}, {0x00010000, 0x00003fff, INTEL_RANGE_RW}, {0x00014000, 0x0001bfff, INTEL_RANGE_RSVD}, {0x00030000, 0x0000ffff, INTEL_RANGE_RW}, {0x00040000, 0x0001ffff, INTEL_RANGE_RSVD}, {0x00060000, 0x0000ffff, INTEL_RANGE_RW}, {0x00070000, 0x00002fff, INTEL_RANGE_RW}, {0x00073000, 0x00000fff, INTEL_RANGE_RW}, {0x00074000, 0x0000bfff, INTEL_RANGE_RSVD}, {0x00000000, 0x00000000, INTEL_RANGE_END} }; /* The documentation is a little sketchy on these register ranges. */ static struct intel_register_range gen6_gt_register_map[] = { {0x00000000, 0x00000fff, INTEL_RANGE_RW}, {0x00001000, 0x00000fff, INTEL_RANGE_RSVD}, {0x00002000, 0x00000fff, INTEL_RANGE_RW}, {0x00003000, 0x000001ff, INTEL_RANGE_RW}, {0x00003200, 0x00000dff, INTEL_RANGE_RW}, {0x00004000, 0x00000fff, INTEL_RANGE_RW}, {0x00005000, 0x0000017f, INTEL_RANGE_RW}, {0x00005180, 0x00000e7f, INTEL_RANGE_RW}, {0x00006000, 0x00001fff, INTEL_RANGE_RW}, {0x00008000, 0x000007ff, INTEL_RANGE_RW}, {0x00008800, 0x000000ff, INTEL_RANGE_RSVD}, {0x00008900, 0x000006ff, INTEL_RANGE_RW}, {0x00009000, 0x00000fff, INTEL_RANGE_RSVD}, {0x0000a000, 0x00000fff, INTEL_RANGE_RW}, {0x0000b000, 0x00004fff, INTEL_RANGE_RSVD}, {0x00010000, 0x00001fff, INTEL_RANGE_RW}, {0x00012000, 0x000003ff, INTEL_RANGE_RW}, {0x00012400, 0x00000bff, INTEL_RANGE_RW}, {0x00013000, 0x00000fff, INTEL_RANGE_RW}, {0x00014000, 0x00000fff, INTEL_RANGE_RW}, {0x00015000, 0x0000cfff, INTEL_RANGE_RW}, {0x00022000, 0x00000fff, INTEL_RANGE_RW}, {0x00023000, 0x00000fff, INTEL_RANGE_RSVD}, {0x00024000, 0x00000fff, INTEL_RANGE_RW}, {0x00025000, 0x0000afff, INTEL_RANGE_RSVD}, {0x00030000, 0x0000ffff, INTEL_RANGE_RW}, {0x00040000, 0x0000ffff, INTEL_RANGE_RW}, {0x00050000, 0x0000ffff, INTEL_RANGE_RW}, {0x00060000, 0x0000ffff, INTEL_RANGE_RW}, {0x00070000, 0x00003fff, INTEL_RANGE_RW}, {0x00074000, 0x0008bfff, INTEL_RANGE_RSVD}, {0x00100000, 0x00007fff, INTEL_RANGE_RW}, {0x00108000, 0x00037fff, INTEL_RANGE_RSVD}, {0x00140000, 0x0003ffff, INTEL_RANGE_RW}, {0x00000000, 0x00000000, INTEL_RANGE_END} }; struct intel_register_map intel_get_register_map(uint32_t devid) { struct intel_register_map map; const int gen = intel_gen(devid); if (gen >= 6) { map.map = gen6_gt_register_map; map.top = 0x180000; } else if (IS_BROADWATER(devid) || IS_CRESTLINE(devid)) { map.map = gen_bwcl_register_map; map.top = 0x80000; } else if (gen >= 4) { map.map = gen4_register_map; map.top = 0x80000; } else { fprintf(stderr, "Gen2/3 Ranges are not supported. Please use " "unsafe access."); abort(); } map.alignment_mask = 0x3; return map; } struct intel_register_range * intel_get_register_range(struct intel_register_map map, uint32_t offset, int mode) { struct intel_register_range *range = map.map; uint32_t align = map.alignment_mask; if (offset & map.alignment_mask) return NULL; if (offset >= map.top) return NULL; while (!(range->flags & INTEL_RANGE_END)) { /* list is assumed to be in order */ if (offset < range->base) break; if ( (offset >= range->base) && (offset + align) <= (range->base + range->size)) { if ((mode & range->flags) == mode) return range; } range++; } return NULL; } intel-gpu-tools-1.3/lib/drmtest.h0000664000175100017510000000760612004013767013756 00000000000000/* * Copyright © 2007 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Eric Anholt * */ #include #include #include #include #include #include #include #include "xf86drm.h" #include "xf86drmMode.h" #include "intel_batchbuffer.h" int drm_get_card(int master); int drm_open_any(void); int drm_open_any_master(void); void gem_quiescent_gpu(int fd); /* ioctl wrappers and similar stuff for bare metal testing */ void gem_set_tiling(int fd, uint32_t handle, int tiling, int stride); void gem_close(int fd, uint32_t handle); void gem_write(int fd, uint32_t handle, uint32_t offset, const void *buf, uint32_t size); void gem_read(int fd, uint32_t handle, uint32_t offset, void *buf, uint32_t size); void gem_set_domain(int fd, uint32_t handle, uint32_t read_domains, uint32_t write_domain); void gem_sync(int fd, uint32_t handle); uint32_t gem_create(int fd, int size); void *gem_mmap__gtt(int fd, uint32_t handle, int size, int prot); void *gem_mmap__cpu(int fd, uint32_t handle, int size, int prot); #define gem_mmap gem_mmap__gtt uint64_t gem_aperture_size(int fd); uint64_t gem_mappable_aperture_size(void); int gem_madvise(int fd, uint32_t handle, int state); /* feature test helpers */ bool gem_uses_aliasing_ppgtt(int fd); int gem_available_fences(int fd); /* prime */ int prime_handle_to_fd(int fd, uint32_t handle); uint32_t prime_fd_to_handle(int fd, int dma_buf_fd); /* generally useful helpers */ void drmtest_fork_signal_helper(void); void drmtest_stop_signal_helper(void); void drmtest_exchange_int(void *array, unsigned i, unsigned j); void drmtest_permute_array(void *array, unsigned size, void (*exchange_func)(void *array, unsigned i, unsigned j)); void drmtest_progress(const char *header, uint64_t i, uint64_t total); /* helpers based upon the libdrm buffer manager */ void drmtest_init_aperture_trashers(drm_intel_bufmgr *bufmgr); void drmtest_trash_aperture(void); void drmtest_cleanup_aperture_trashers(void); /* helpers to create nice-looking framebuffers */ struct kmstest_fb { uint32_t fb_id; uint32_t gem_handle; unsigned stride; unsigned size; }; typedef void (*kmstest_paint_func)(cairo_t *cr, int width, int height, void *priv); unsigned int kmstest_create_fb(int fd, int width, int height, int bpp, int depth, bool tiled, struct kmstest_fb *fb_info, kmstest_paint_func paint_func, void *func_arg); void kmstest_dump_mode(drmModeModeInfo *mode); inline static void _do_or_die(const char *function, int line, int ret) { if (ret == 0) return; fprintf(stderr, "%s:%d failed, ret=%d, errno=%d\n", function, line, ret, errno); abort(); } #define do_or_die(x) _do_or_die(__FUNCTION__, __LINE__, x) #define do_ioctl(fd, ptr, sz) do_or_die(drmIoctl((fd), (ptr), (sz))) intel-gpu-tools-1.3/lib/instdone.h0000664000175100017510000000272611566027747014134 00000000000000/* * Copyright © 2007,2009 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * * Authors: * Eric Anholt * */ #include #define MAX_INSTDONE_BITS 100 struct instdone_bit { uint32_t reg; uint32_t bit; const char *name; }; extern struct instdone_bit instdone_bits[MAX_INSTDONE_BITS]; extern int num_instdone_bits; void init_instdone_definitions(uint32_t devid); intel-gpu-tools-1.3/lib/gen6_render.h0000664000175100017510000016553511706636070014506 00000000000000#ifndef GEN6_RENDER_H #define GEN6_RENDER_H #define GEN6_3D(Pipeline,Opcode,Subopcode) ((3 << 29) | \ ((Pipeline) << 27) | \ ((Opcode) << 24) | \ ((Subopcode) << 16)) #define GEN6_STATE_BASE_ADDRESS GEN6_3D(0, 1, 1) #define GEN6_STATE_SIP GEN6_3D(0, 1, 2) #define GEN6_PIPELINE_SELECT GEN6_3D(1, 1, 4) #define GEN6_MEDIA_STATE_POINTERS GEN6_3D(2, 0, 0) #define GEN6_MEDIA_OBJECT GEN6_3D(2, 1, 0) #define GEN6_3DSTATE_BINDING_TABLE_POINTERS GEN6_3D(3, 0, 1) # define GEN6_3DSTATE_BINDING_TABLE_MODIFY_PS (1 << 12)/* for GEN6 */ # define GEN6_3DSTATE_BINDING_TABLE_MODIFY_GS (1 << 9) /* for GEN6 */ # define GEN6_3DSTATE_BINDING_TABLE_MODIFY_VS (1 << 8) /* for GEN6 */ #define GEN6_3DSTATE_VERTEX_BUFFERS GEN6_3D(3, 0, 8) #define GEN6_3DSTATE_VERTEX_ELEMENTS GEN6_3D(3, 0, 9) #define GEN6_3DSTATE_INDEX_BUFFER GEN6_3D(3, 0, 0xa) #define GEN6_3DSTATE_VF_STATISTICS GEN6_3D(3, 0, 0xb) #define GEN6_3DSTATE_DRAWING_RECTANGLE GEN6_3D(3, 1, 0) #define GEN6_3DSTATE_CONSTANT_COLOR GEN6_3D(3, 1, 1) #define GEN6_3DSTATE_SAMPLER_PALETTE_LOAD GEN6_3D(3, 1, 2) #define GEN6_3DSTATE_CHROMA_KEY GEN6_3D(3, 1, 4) #define GEN6_3DSTATE_DEPTH_BUFFER GEN6_3D(3, 1, 5) # define GEN6_3DSTATE_DEPTH_BUFFER_TYPE_SHIFT 29 # define GEN6_3DSTATE_DEPTH_BUFFER_FORMAT_SHIFT 18 #define GEN6_3DSTATE_POLY_STIPPLE_OFFSET GEN6_3D(3, 1, 6) #define GEN6_3DSTATE_POLY_STIPPLE_PATTERN GEN6_3D(3, 1, 7) #define GEN6_3DSTATE_LINE_STIPPLE GEN6_3D(3, 1, 8) #define GEN6_3DSTATE_GLOBAL_DEPTH_OFFSET_CLAMP GEN6_3D(3, 1, 9) /* These two are BLC and CTG only, not BW or CL */ #define GEN6_3DSTATE_AA_LINE_PARAMS GEN6_3D(3, 1, 0xa) #define GEN6_3DSTATE_GS_SVB_INDEX GEN6_3D(3, 1, 0xb) #define GEN6_3DPRIMITIVE GEN6_3D(3, 3, 0) #define GEN6_3DSTATE_CLEAR_PARAMS GEN6_3D(3, 1, 0x10) /* DW1 */ # define GEN6_3DSTATE_DEPTH_CLEAR_VALID (1 << 15) #define GEN6_3DSTATE_SAMPLER_STATE_POINTERS GEN6_3D(3, 0, 0x02) # define GEN6_3DSTATE_SAMPLER_STATE_MODIFY_PS (1 << 12) # define GEN6_3DSTATE_SAMPLER_STATE_MODIFY_GS (1 << 9) # define GEN6_3DSTATE_SAMPLER_STATE_MODIFY_VS (1 << 8) #define GEN6_3DSTATE_URB GEN6_3D(3, 0, 0x05) /* DW1 */ # define GEN6_3DSTATE_URB_VS_SIZE_SHIFT 16 # define GEN6_3DSTATE_URB_VS_ENTRIES_SHIFT 0 /* DW2 */ # define GEN6_3DSTATE_URB_GS_ENTRIES_SHIFT 8 # define GEN6_3DSTATE_URB_GS_SIZE_SHIFT 0 #define GEN6_3DSTATE_VIEWPORT_STATE_POINTERS GEN6_3D(3, 0, 0x0d) # define GEN6_3DSTATE_VIEWPORT_STATE_MODIFY_CC (1 << 12) # define GEN6_3DSTATE_VIEWPORT_STATE_MODIFY_SF (1 << 11) # define GEN6_3DSTATE_VIEWPORT_STATE_MODIFY_CLIP (1 << 10) #define GEN6_3DSTATE_CC_STATE_POINTERS GEN6_3D(3, 0, 0x0e) #define GEN6_3DSTATE_VS GEN6_3D(3, 0, 0x10) #define GEN6_3DSTATE_GS GEN6_3D(3, 0, 0x11) /* DW4 */ # define GEN6_3DSTATE_GS_DISPATCH_START_GRF_SHIFT 0 #define GEN6_3DSTATE_CLIP GEN6_3D(3, 0, 0x12) #define GEN6_3DSTATE_SF GEN6_3D(3, 0, 0x13) /* DW1 */ # define GEN6_3DSTATE_SF_NUM_OUTPUTS_SHIFT 22 # define GEN6_3DSTATE_SF_URB_ENTRY_READ_LENGTH_SHIFT 11 # define GEN6_3DSTATE_SF_URB_ENTRY_READ_OFFSET_SHIFT 4 /* DW2 */ /* DW3 */ # define GEN6_3DSTATE_SF_CULL_BOTH (0 << 29) # define GEN6_3DSTATE_SF_CULL_NONE (1 << 29) # define GEN6_3DSTATE_SF_CULL_FRONT (2 << 29) # define GEN6_3DSTATE_SF_CULL_BACK (3 << 29) /* DW4 */ # define GEN6_3DSTATE_SF_TRI_PROVOKE_SHIFT 29 # define GEN6_3DSTATE_SF_LINE_PROVOKE_SHIFT 27 # define GEN6_3DSTATE_SF_TRIFAN_PROVOKE_SHIFT 25 #define GEN6_3DSTATE_WM GEN6_3D(3, 0, 0x14) /* DW2 */ # define GEN6_3DSTATE_WM_SAMPLER_COUNT_SHIFT 27 # define GEN6_3DSTATE_WM_BINDING_TABLE_ENTRY_COUNT_SHIFT 18 /* DW4 */ # define GEN6_3DSTATE_WM_DISPATCH_START_GRF_0_SHIFT 16 /* DW5 */ # define GEN6_3DSTATE_WM_MAX_THREADS_SHIFT 25 # define GEN6_3DSTATE_WM_DISPATCH_ENABLE (1 << 19) # define GEN6_3DSTATE_WM_16_DISPATCH_ENABLE (1 << 1) # define GEN6_3DSTATE_WM_8_DISPATCH_ENABLE (1 << 0) /* DW6 */ # define GEN6_3DSTATE_WM_NUM_SF_OUTPUTS_SHIFT 20 # define GEN6_3DSTATE_WM_NONPERSPECTIVE_SAMPLE_BARYCENTRIC (1 << 15) # define GEN6_3DSTATE_WM_NONPERSPECTIVE_CENTROID_BARYCENTRIC (1 << 14) # define GEN6_3DSTATE_WM_NONPERSPECTIVE_PIXEL_BARYCENTRIC (1 << 13) # define GEN6_3DSTATE_WM_PERSPECTIVE_SAMPLE_BARYCENTRIC (1 << 12) # define GEN6_3DSTATE_WM_PERSPECTIVE_CENTROID_BARYCENTRIC (1 << 11) # define GEN6_3DSTATE_WM_PERSPECTIVE_PIXEL_BARYCENTRIC (1 << 10) #define GEN6_3DSTATE_CONSTANT_VS GEN6_3D(3, 0, 0x15) #define GEN6_3DSTATE_CONSTANT_GS GEN6_3D(3, 0, 0x16) #define GEN6_3DSTATE_CONSTANT_PS GEN6_3D(3, 0, 0x17) #define GEN6_3DSTATE_SAMPLE_MASK GEN6_3D(3, 0, 0x18) #define GEN6_3DSTATE_MULTISAMPLE GEN6_3D(3, 1, 0x0d) /* DW1 */ # define GEN6_3DSTATE_MULTISAMPLE_PIXEL_LOCATION_CENTER (0 << 4) # define GEN6_3DSTATE_MULTISAMPLE_PIXEL_LOCATION_UPPER_LEFT (1 << 4) # define GEN6_3DSTATE_MULTISAMPLE_NUMSAMPLES_1 (0 << 1) # define GEN6_3DSTATE_MULTISAMPLE_NUMSAMPLES_4 (2 << 1) # define GEN6_3DSTATE_MULTISAMPLE_NUMSAMPLES_8 (3 << 1) #define PIPELINE_SELECT_3D 0 #define PIPELINE_SELECT_MEDIA 1 /* for GEN6_STATE_BASE_ADDRESS */ #define BASE_ADDRESS_MODIFY (1 << 0) /* for GEN6_PIPE_CONTROL */ #define GEN6_PIPE_CONTROL_NOWRITE (0 << 14) #define GEN6_PIPE_CONTROL_WRITE_QWORD (1 << 14) #define GEN6_PIPE_CONTROL_WRITE_DEPTH (2 << 14) #define GEN6_PIPE_CONTROL_WRITE_TIME (3 << 14) #define GEN6_PIPE_CONTROL_DEPTH_STALL (1 << 13) #define GEN6_PIPE_CONTROL_WC_FLUSH (1 << 12) #define GEN6_PIPE_CONTROL_IS_FLUSH (1 << 11) #define GEN6_PIPE_CONTROL_TC_FLUSH (1 << 10) #define GEN6_PIPE_CONTROL_NOTIFY_ENABLE (1 << 8) #define GEN6_PIPE_CONTROL_GLOBAL_GTT (1 << 2) #define GEN6_PIPE_CONTROL_LOCAL_PGTT (0 << 2) #define GEN6_PIPE_CONTROL_DEPTH_CACHE_FLUSH (1 << 0) /* VERTEX_BUFFER_STATE Structure */ #define VB0_BUFFER_INDEX_SHIFT 26 #define VB0_VERTEXDATA (0 << 20) #define VB0_INSTANCEDATA (1 << 20) #define VB0_BUFFER_PITCH_SHIFT 0 /* VERTEX_ELEMENT_STATE Structure */ #define VE0_VERTEX_BUFFER_INDEX_SHIFT 26 /* for GEN6 */ #define VE0_VALID (1 << 25) /* for GEN6 */ #define VE0_FORMAT_SHIFT 16 #define VE0_OFFSET_SHIFT 0 #define VE1_VFCOMPONENT_0_SHIFT 28 #define VE1_VFCOMPONENT_1_SHIFT 24 #define VE1_VFCOMPONENT_2_SHIFT 20 #define VE1_VFCOMPONENT_3_SHIFT 16 #define VE1_DESTINATION_ELEMENT_OFFSET_SHIFT 0 /* 3DPRIMITIVE bits */ #define GEN6_3DPRIMITIVE_VERTEX_SEQUENTIAL (0 << 15) #define GEN6_3DPRIMITIVE_VERTEX_RANDOM (1 << 15) /* Primitive types are in gen6_defines.h */ #define GEN6_3DPRIMITIVE_TOPOLOGY_SHIFT 10 #define GEN6_SVG_CTL 0x7400 #define GEN6_SVG_CTL_GS_BA (0 << 8) #define GEN6_SVG_CTL_SS_BA (1 << 8) #define GEN6_SVG_CTL_IO_BA (2 << 8) #define GEN6_SVG_CTL_GS_AUB (3 << 8) #define GEN6_SVG_CTL_IO_AUB (4 << 8) #define GEN6_SVG_CTL_SIP (5 << 8) #define GEN6_SVG_RDATA 0x7404 #define GEN6_SVG_WORK_CTL 0x7408 #define GEN6_VF_CTL 0x7500 #define GEN6_VF_CTL_SNAPSHOT_COMPLETE (1 << 31) #define GEN6_VF_CTL_SNAPSHOT_MUX_SELECT_THREADID (0 << 8) #define GEN6_VF_CTL_SNAPSHOT_MUX_SELECT_VF_DEBUG (1 << 8) #define GEN6_VF_CTL_SNAPSHOT_TYPE_VERTEX_SEQUENCE (0 << 4) #define GEN6_VF_CTL_SNAPSHOT_TYPE_VERTEX_INDEX (1 << 4) #define GEN6_VF_CTL_SKIP_INITIAL_PRIMITIVES (1 << 3) #define GEN6_VF_CTL_MAX_PRIMITIVES_LIMIT_ENABLE (1 << 2) #define GEN6_VF_CTL_VERTEX_RANGE_LIMIT_ENABLE (1 << 1) #define GEN6_VF_CTL_SNAPSHOT_ENABLE (1 << 0) #define GEN6_VF_STRG_VAL 0x7504 #define GEN6_VF_STR_VL_OVR 0x7508 #define GEN6_VF_VC_OVR 0x750c #define GEN6_VF_STR_PSKIP 0x7510 #define GEN6_VF_MAX_PRIM 0x7514 #define GEN6_VF_RDATA 0x7518 #define GEN6_VS_CTL 0x7600 #define GEN6_VS_CTL_SNAPSHOT_COMPLETE (1 << 31) #define GEN6_VS_CTL_SNAPSHOT_MUX_VERTEX_0 (0 << 8) #define GEN6_VS_CTL_SNAPSHOT_MUX_VERTEX_1 (1 << 8) #define GEN6_VS_CTL_SNAPSHOT_MUX_VALID_COUNT (2 << 8) #define GEN6_VS_CTL_SNAPSHOT_MUX_VS_KERNEL_POINTER (3 << 8) #define GEN6_VS_CTL_SNAPSHOT_ALL_THREADS (1 << 2) #define GEN6_VS_CTL_THREAD_SNAPSHOT_ENABLE (1 << 1) #define GEN6_VS_CTL_SNAPSHOT_ENABLE (1 << 0) #define GEN6_VS_STRG_VAL 0x7604 #define GEN6_VS_RDATA 0x7608 #define GEN6_SF_CTL 0x7b00 #define GEN6_SF_CTL_SNAPSHOT_COMPLETE (1 << 31) #define GEN6_SF_CTL_SNAPSHOT_MUX_VERTEX_0_FF_ID (0 << 8) #define GEN6_SF_CTL_SNAPSHOT_MUX_VERTEX_0_REL_COUNT (1 << 8) #define GEN6_SF_CTL_SNAPSHOT_MUX_VERTEX_1_FF_ID (2 << 8) #define GEN6_SF_CTL_SNAPSHOT_MUX_VERTEX_1_REL_COUNT (3 << 8) #define GEN6_SF_CTL_SNAPSHOT_MUX_VERTEX_2_FF_ID (4 << 8) #define GEN6_SF_CTL_SNAPSHOT_MUX_VERTEX_2_REL_COUNT (5 << 8) #define GEN6_SF_CTL_SNAPSHOT_MUX_VERTEX_COUNT (6 << 8) #define GEN6_SF_CTL_SNAPSHOT_MUX_SF_KERNEL_POINTER (7 << 8) #define GEN6_SF_CTL_MIN_MAX_PRIMITIVE_RANGE_ENABLE (1 << 4) #define GEN6_SF_CTL_DEBUG_CLIP_RECTANGLE_ENABLE (1 << 3) #define GEN6_SF_CTL_SNAPSHOT_ALL_THREADS (1 << 2) #define GEN6_SF_CTL_THREAD_SNAPSHOT_ENABLE (1 << 1) #define GEN6_SF_CTL_SNAPSHOT_ENABLE (1 << 0) #define GEN6_SF_STRG_VAL 0x7b04 #define GEN6_SF_RDATA 0x7b18 #define GEN6_WIZ_CTL 0x7c00 #define GEN6_WIZ_CTL_SNAPSHOT_COMPLETE (1 << 31) #define GEN6_WIZ_CTL_SUBSPAN_INSTANCE_SHIFT 16 #define GEN6_WIZ_CTL_SNAPSHOT_MUX_WIZ_KERNEL_POINTER (0 << 8) #define GEN6_WIZ_CTL_SNAPSHOT_MUX_SUBSPAN_INSTANCE (1 << 8) #define GEN6_WIZ_CTL_SNAPSHOT_MUX_PRIMITIVE_SEQUENCE (2 << 8) #define GEN6_WIZ_CTL_SINGLE_SUBSPAN_DISPATCH (1 << 6) #define GEN6_WIZ_CTL_IGNORE_COLOR_SCOREBOARD_STALLS (1 << 5) #define GEN6_WIZ_CTL_ENABLE_SUBSPAN_INSTANCE_COMPARE (1 << 4) #define GEN6_WIZ_CTL_USE_UPSTREAM_SNAPSHOT_FLAG (1 << 3) #define GEN6_WIZ_CTL_SNAPSHOT_ALL_THREADS (1 << 2) #define GEN6_WIZ_CTL_THREAD_SNAPSHOT_ENABLE (1 << 1) #define GEN6_WIZ_CTL_SNAPSHOT_ENABLE (1 << 0) #define GEN6_WIZ_STRG_VAL 0x7c04 #define GEN6_WIZ_RDATA 0x7c18 #define GEN6_TS_CTL 0x7e00 #define GEN6_TS_CTL_SNAPSHOT_COMPLETE (1 << 31) #define GEN6_TS_CTL_SNAPSHOT_MESSAGE_ERROR (0 << 8) #define GEN6_TS_CTL_SNAPSHOT_INTERFACE_DESCRIPTOR (3 << 8) #define GEN6_TS_CTL_SNAPSHOT_ALL_CHILD_THREADS (1 << 2) #define GEN6_TS_CTL_SNAPSHOT_ALL_ROOT_THREADS (1 << 1) #define GEN6_TS_CTL_SNAPSHOT_ENABLE (1 << 0) #define GEN6_TS_STRG_VAL 0x7e04 #define GEN6_TS_RDATA 0x7e08 /* TD_CTL on gen6 is 0x7000, to not break stuff which depends on this... */ #ifndef GEN6_TD_CTL #define GEN6_TD_CTL 0x8000 #endif #define GEN6_TD_CTL_MUX_SHIFT 8 #define GEN6_TD_CTL_EXTERNAL_HALT_R0_DEBUG_MATCH (1 << 7) #define GEN6_TD_CTL_FORCE_EXTERNAL_HALT (1 << 6) #define GEN6_TD_CTL_EXCEPTION_MASK_OVERRIDE (1 << 5) #define GEN6_TD_CTL_FORCE_THREAD_BREAKPOINT_ENABLE (1 << 4) #define GEN6_TD_CTL_BREAKPOINT_ENABLE (1 << 2) #define GEN6_TD_CTL2 0x8004 #define GEN6_TD_CTL2_ILLEGAL_OPCODE_EXCEPTION_OVERRIDE (1 << 28) #define GEN6_TD_CTL2_MASKSTACK_EXCEPTION_OVERRIDE (1 << 26) #define GEN6_TD_CTL2_SOFTWARE_EXCEPTION_OVERRIDE (1 << 25) #define GEN6_TD_CTL2_ACTIVE_THREAD_LIMIT_SHIFT 16 #define GEN6_TD_CTL2_ACTIVE_THREAD_LIMIT_ENABLE (1 << 8) #define GEN6_TD_CTL2_THREAD_SPAWNER_EXECUTION_MASK_ENABLE (1 << 7) #define GEN6_TD_CTL2_WIZ_EXECUTION_MASK_ENABLE (1 << 6) #define GEN6_TD_CTL2_SF_EXECUTION_MASK_ENABLE (1 << 5) #define GEN6_TD_CTL2_CLIPPER_EXECUTION_MASK_ENABLE (1 << 4) #define GEN6_TD_CTL2_GS_EXECUTION_MASK_ENABLE (1 << 3) #define GEN6_TD_CTL2_VS_EXECUTION_MASK_ENABLE (1 << 0) #define GEN6_TD_VF_VS_EMSK 0x8008 #define GEN6_TD_GS_EMSK 0x800c #define GEN6_TD_CLIP_EMSK 0x8010 #define GEN6_TD_SF_EMSK 0x8014 #define GEN6_TD_WIZ_EMSK 0x8018 #define GEN6_TD_0_6_EHTRG_VAL 0x801c #define GEN6_TD_0_7_EHTRG_VAL 0x8020 #define GEN6_TD_0_6_EHTRG_MSK 0x8024 #define GEN6_TD_0_7_EHTRG_MSK 0x8028 #define GEN6_TD_RDATA 0x802c #define GEN6_TD_TS_EMSK 0x8030 #define GEN6_EU_CTL 0x8800 #define GEN6_EU_CTL_SELECT_SHIFT 16 #define GEN6_EU_CTL_DATA_MUX_SHIFT 8 #define GEN6_EU_ATT_0 0x8810 #define GEN6_EU_ATT_1 0x8814 #define GEN6_EU_ATT_DATA_0 0x8820 #define GEN6_EU_ATT_DATA_1 0x8824 #define GEN6_EU_ATT_CLR_0 0x8830 #define GEN6_EU_ATT_CLR_1 0x8834 #define GEN6_EU_RDATA 0x8840 #define GEN6_3D(Pipeline,Opcode,Subopcode) ((3 << 29) | \ ((Pipeline) << 27) | \ ((Opcode) << 24) | \ ((Subopcode) << 16)) #define GEN6_STATE_BASE_ADDRESS GEN6_3D(0, 1, 1) #define GEN6_STATE_SIP GEN6_3D(0, 1, 2) #define GEN6_PIPELINE_SELECT GEN6_3D(1, 1, 4) #define GEN6_MEDIA_STATE_POINTERS GEN6_3D(2, 0, 0) #define GEN6_MEDIA_OBJECT GEN6_3D(2, 1, 0) #define GEN6_3DSTATE_BINDING_TABLE_POINTERS GEN6_3D(3, 0, 1) # define GEN6_3DSTATE_BINDING_TABLE_MODIFY_PS (1 << 12)/* for GEN6 */ # define GEN6_3DSTATE_BINDING_TABLE_MODIFY_GS (1 << 9) /* for GEN6 */ # define GEN6_3DSTATE_BINDING_TABLE_MODIFY_VS (1 << 8) /* for GEN6 */ #define GEN6_3DSTATE_VERTEX_BUFFERS GEN6_3D(3, 0, 8) #define GEN6_3DSTATE_VERTEX_ELEMENTS GEN6_3D(3, 0, 9) #define GEN6_3DSTATE_INDEX_BUFFER GEN6_3D(3, 0, 0xa) #define GEN6_3DSTATE_VF_STATISTICS GEN6_3D(3, 0, 0xb) #define GEN6_3DSTATE_DRAWING_RECTANGLE GEN6_3D(3, 1, 0) #define GEN6_3DSTATE_CONSTANT_COLOR GEN6_3D(3, 1, 1) #define GEN6_3DSTATE_SAMPLER_PALETTE_LOAD GEN6_3D(3, 1, 2) #define GEN6_3DSTATE_CHROMA_KEY GEN6_3D(3, 1, 4) #define GEN6_3DSTATE_DEPTH_BUFFER GEN6_3D(3, 1, 5) # define GEN6_3DSTATE_DEPTH_BUFFER_TYPE_SHIFT 29 # define GEN6_3DSTATE_DEPTH_BUFFER_FORMAT_SHIFT 18 #define GEN6_3DSTATE_POLY_STIPPLE_OFFSET GEN6_3D(3, 1, 6) #define GEN6_3DSTATE_POLY_STIPPLE_PATTERN GEN6_3D(3, 1, 7) #define GEN6_3DSTATE_LINE_STIPPLE GEN6_3D(3, 1, 8) #define GEN6_3DSTATE_GLOBAL_DEPTH_OFFSET_CLAMP GEN6_3D(3, 1, 9) /* These two are BLC and CTG only, not BW or CL */ #define GEN6_3DSTATE_AA_LINE_PARAMS GEN6_3D(3, 1, 0xa) #define GEN6_3DSTATE_GS_SVB_INDEX GEN6_3D(3, 1, 0xb) #define GEN6_PIPE_CONTROL GEN6_3D(3, 2, 0) #define GEN6_3DPRIMITIVE GEN6_3D(3, 3, 0) #define GEN6_3DSTATE_CLEAR_PARAMS GEN6_3D(3, 1, 0x10) /* DW1 */ # define GEN6_3DSTATE_DEPTH_CLEAR_VALID (1 << 15) /* for GEN6+ */ #define GEN6_3DSTATE_SAMPLER_STATE_POINTERS GEN6_3D(3, 0, 0x02) # define GEN6_3DSTATE_SAMPLER_STATE_MODIFY_PS (1 << 12) # define GEN6_3DSTATE_SAMPLER_STATE_MODIFY_GS (1 << 9) # define GEN6_3DSTATE_SAMPLER_STATE_MODIFY_VS (1 << 8) #define GEN6_3DSTATE_URB GEN6_3D(3, 0, 0x05) /* DW1 */ # define GEN6_3DSTATE_URB_VS_SIZE_SHIFT 16 # define GEN6_3DSTATE_URB_VS_ENTRIES_SHIFT 0 /* DW2 */ # define GEN6_3DSTATE_URB_GS_ENTRIES_SHIFT 8 # define GEN6_3DSTATE_URB_GS_SIZE_SHIFT 0 #define GEN6_3DSTATE_VIEWPORT_STATE_POINTERS GEN6_3D(3, 0, 0x0d) # define GEN6_3DSTATE_VIEWPORT_STATE_MODIFY_CC (1 << 12) # define GEN6_3DSTATE_VIEWPORT_STATE_MODIFY_SF (1 << 11) # define GEN6_3DSTATE_VIEWPORT_STATE_MODIFY_CLIP (1 << 10) #define GEN6_3DSTATE_CC_STATE_POINTERS GEN6_3D(3, 0, 0x0e) #define GEN6_3DSTATE_VS GEN6_3D(3, 0, 0x10) #define GEN6_3DSTATE_GS GEN6_3D(3, 0, 0x11) /* DW4 */ # define GEN6_3DSTATE_GS_DISPATCH_START_GRF_SHIFT 0 #define GEN6_3DSTATE_CLIP GEN6_3D(3, 0, 0x12) #define GEN6_3DSTATE_SF GEN6_3D(3, 0, 0x13) /* DW1 */ # define GEN6_3DSTATE_SF_NUM_OUTPUTS_SHIFT 22 # define GEN6_3DSTATE_SF_URB_ENTRY_READ_LENGTH_SHIFT 11 # define GEN6_3DSTATE_SF_URB_ENTRY_READ_OFFSET_SHIFT 4 /* DW2 */ /* DW3 */ # define GEN6_3DSTATE_SF_CULL_BOTH (0 << 29) # define GEN6_3DSTATE_SF_CULL_NONE (1 << 29) # define GEN6_3DSTATE_SF_CULL_FRONT (2 << 29) # define GEN6_3DSTATE_SF_CULL_BACK (3 << 29) /* DW4 */ # define GEN6_3DSTATE_SF_TRI_PROVOKE_SHIFT 29 # define GEN6_3DSTATE_SF_LINE_PROVOKE_SHIFT 27 # define GEN6_3DSTATE_SF_TRIFAN_PROVOKE_SHIFT 25 #define GEN6_3DSTATE_WM GEN6_3D(3, 0, 0x14) /* DW2 */ # define GEN6_3DSTATE_WM_SAMPLER_COUNT_SHITF 27 # define GEN6_3DSTATE_WM_BINDING_TABLE_ENTRY_COUNT_SHIFT 18 /* DW4 */ # define GEN6_3DSTATE_WM_DISPATCH_START_GRF_0_SHIFT 16 /* DW5 */ # define GEN6_3DSTATE_WM_MAX_THREADS_SHIFT 25 # define GEN6_3DSTATE_WM_DISPATCH_ENABLE (1 << 19) # define GEN6_3DSTATE_WM_16_DISPATCH_ENABLE (1 << 1) # define GEN6_3DSTATE_WM_8_DISPATCH_ENABLE (1 << 0) /* DW6 */ # define GEN6_3DSTATE_WM_NUM_SF_OUTPUTS_SHIFT 20 # define GEN6_3DSTATE_WM_NONPERSPECTIVE_SAMPLE_BARYCENTRIC (1 << 15) # define GEN6_3DSTATE_WM_NONPERSPECTIVE_CENTROID_BARYCENTRIC (1 << 14) # define GEN6_3DSTATE_WM_NONPERSPECTIVE_PIXEL_BARYCENTRIC (1 << 13) # define GEN6_3DSTATE_WM_PERSPECTIVE_SAMPLE_BARYCENTRIC (1 << 12) # define GEN6_3DSTATE_WM_PERSPECTIVE_CENTROID_BARYCENTRIC (1 << 11) # define GEN6_3DSTATE_WM_PERSPECTIVE_PIXEL_BARYCENTRIC (1 << 10) #define GEN6_3DSTATE_CONSTANT_VS GEN6_3D(3, 0, 0x15) #define GEN6_3DSTATE_CONSTANT_GS GEN6_3D(3, 0, 0x16) #define GEN6_3DSTATE_CONSTANT_PS GEN6_3D(3, 0, 0x17) #define GEN6_3DSTATE_SAMPLE_MASK GEN6_3D(3, 0, 0x18) #define GEN6_3DSTATE_MULTISAMPLE GEN6_3D(3, 1, 0x0d) /* DW1 */ # define GEN6_3DSTATE_MULTISAMPLE_PIXEL_LOCATION_CENTER (0 << 4) # define GEN6_3DSTATE_MULTISAMPLE_PIXEL_LOCATION_UPPER_LEFT (1 << 4) # define GEN6_3DSTATE_MULTISAMPLE_NUMSAMPLES_1 (0 << 1) # define GEN6_3DSTATE_MULTISAMPLE_NUMSAMPLES_4 (2 << 1) # define GEN6_3DSTATE_MULTISAMPLE_NUMSAMPLES_8 (3 << 1) #define PIPELINE_SELECT_3D 0 #define PIPELINE_SELECT_MEDIA 1 #define UF0_CS_REALLOC (1 << 13) #define UF0_VFE_REALLOC (1 << 12) #define UF0_SF_REALLOC (1 << 11) #define UF0_CLIP_REALLOC (1 << 10) #define UF0_GS_REALLOC (1 << 9) #define UF0_VS_REALLOC (1 << 8) #define UF1_CLIP_FENCE_SHIFT 20 #define UF1_GS_FENCE_SHIFT 10 #define UF1_VS_FENCE_SHIFT 0 #define UF2_CS_FENCE_SHIFT 20 #define UF2_VFE_FENCE_SHIFT 10 #define UF2_SF_FENCE_SHIFT 0 /* for GEN6_STATE_BASE_ADDRESS */ #define BASE_ADDRESS_MODIFY (1 << 0) /* for GEN6_3DSTATE_PIPELINED_POINTERS */ #define GEN6_GS_DISABLE 0 #define GEN6_GS_ENABLE 1 #define GEN6_CLIP_DISABLE 0 #define GEN6_CLIP_ENABLE 1 /* for GEN6_PIPE_CONTROL */ #define GEN6_PIPE_CONTROL_NOWRITE (0 << 14) #define GEN6_PIPE_CONTROL_WRITE_QWORD (1 << 14) #define GEN6_PIPE_CONTROL_WRITE_DEPTH (2 << 14) #define GEN6_PIPE_CONTROL_WRITE_TIME (3 << 14) #define GEN6_PIPE_CONTROL_DEPTH_STALL (1 << 13) #define GEN6_PIPE_CONTROL_WC_FLUSH (1 << 12) #define GEN6_PIPE_CONTROL_IS_FLUSH (1 << 11) #define GEN6_PIPE_CONTROL_TC_FLUSH (1 << 10) #define GEN6_PIPE_CONTROL_NOTIFY_ENABLE (1 << 8) #define GEN6_PIPE_CONTROL_GLOBAL_GTT (1 << 2) #define GEN6_PIPE_CONTROL_LOCAL_PGTT (0 << 2) #define GEN6_PIPE_CONTROL_DEPTH_CACHE_FLUSH (1 << 0) /* 3DPRIMITIVE bits */ #define GEN6_3DPRIMITIVE_VERTEX_SEQUENTIAL (0 << 15) #define GEN6_3DPRIMITIVE_VERTEX_RANDOM (1 << 15) /* Primitive types are in gen6_defines.h */ #define GEN6_3DPRIMITIVE_TOPOLOGY_SHIFT 10 #define GEN6_SVG_CTL 0x7400 #define GEN6_SVG_CTL_GS_BA (0 << 8) #define GEN6_SVG_CTL_SS_BA (1 << 8) #define GEN6_SVG_CTL_IO_BA (2 << 8) #define GEN6_SVG_CTL_GS_AUB (3 << 8) #define GEN6_SVG_CTL_IO_AUB (4 << 8) #define GEN6_SVG_CTL_SIP (5 << 8) #define GEN6_SVG_RDATA 0x7404 #define GEN6_SVG_WORK_CTL 0x7408 #define GEN6_VF_CTL 0x7500 #define GEN6_VF_CTL_SNAPSHOT_COMPLETE (1 << 31) #define GEN6_VF_CTL_SNAPSHOT_MUX_SELECT_THREADID (0 << 8) #define GEN6_VF_CTL_SNAPSHOT_MUX_SELECT_VF_DEBUG (1 << 8) #define GEN6_VF_CTL_SNAPSHOT_TYPE_VERTEX_SEQUENCE (0 << 4) #define GEN6_VF_CTL_SNAPSHOT_TYPE_VERTEX_INDEX (1 << 4) #define GEN6_VF_CTL_SKIP_INITIAL_PRIMITIVES (1 << 3) #define GEN6_VF_CTL_MAX_PRIMITIVES_LIMIT_ENABLE (1 << 2) #define GEN6_VF_CTL_VERTEX_RANGE_LIMIT_ENABLE (1 << 1) #define GEN6_VF_CTL_SNAPSHOT_ENABLE (1 << 0) #define GEN6_VF_STRG_VAL 0x7504 #define GEN6_VF_STR_VL_OVR 0x7508 #define GEN6_VF_VC_OVR 0x750c #define GEN6_VF_STR_PSKIP 0x7510 #define GEN6_VF_MAX_PRIM 0x7514 #define GEN6_VF_RDATA 0x7518 #define GEN6_VS_CTL 0x7600 #define GEN6_VS_CTL_SNAPSHOT_COMPLETE (1 << 31) #define GEN6_VS_CTL_SNAPSHOT_MUX_VERTEX_0 (0 << 8) #define GEN6_VS_CTL_SNAPSHOT_MUX_VERTEX_1 (1 << 8) #define GEN6_VS_CTL_SNAPSHOT_MUX_VALID_COUNT (2 << 8) #define GEN6_VS_CTL_SNAPSHOT_MUX_VS_KERNEL_POINTER (3 << 8) #define GEN6_VS_CTL_SNAPSHOT_ALL_THREADS (1 << 2) #define GEN6_VS_CTL_THREAD_SNAPSHOT_ENABLE (1 << 1) #define GEN6_VS_CTL_SNAPSHOT_ENABLE (1 << 0) #define GEN6_VS_STRG_VAL 0x7604 #define GEN6_VS_RDATA 0x7608 #define GEN6_SF_CTL 0x7b00 #define GEN6_SF_CTL_SNAPSHOT_COMPLETE (1 << 31) #define GEN6_SF_CTL_SNAPSHOT_MUX_VERTEX_0_FF_ID (0 << 8) #define GEN6_SF_CTL_SNAPSHOT_MUX_VERTEX_0_REL_COUNT (1 << 8) #define GEN6_SF_CTL_SNAPSHOT_MUX_VERTEX_1_FF_ID (2 << 8) #define GEN6_SF_CTL_SNAPSHOT_MUX_VERTEX_1_REL_COUNT (3 << 8) #define GEN6_SF_CTL_SNAPSHOT_MUX_VERTEX_2_FF_ID (4 << 8) #define GEN6_SF_CTL_SNAPSHOT_MUX_VERTEX_2_REL_COUNT (5 << 8) #define GEN6_SF_CTL_SNAPSHOT_MUX_VERTEX_COUNT (6 << 8) #define GEN6_SF_CTL_SNAPSHOT_MUX_SF_KERNEL_POINTER (7 << 8) #define GEN6_SF_CTL_MIN_MAX_PRIMITIVE_RANGE_ENABLE (1 << 4) #define GEN6_SF_CTL_DEBUG_CLIP_RECTANGLE_ENABLE (1 << 3) #define GEN6_SF_CTL_SNAPSHOT_ALL_THREADS (1 << 2) #define GEN6_SF_CTL_THREAD_SNAPSHOT_ENABLE (1 << 1) #define GEN6_SF_CTL_SNAPSHOT_ENABLE (1 << 0) #define GEN6_SF_STRG_VAL 0x7b04 #define GEN6_SF_RDATA 0x7b18 #define GEN6_WIZ_CTL 0x7c00 #define GEN6_WIZ_CTL_SNAPSHOT_COMPLETE (1 << 31) #define GEN6_WIZ_CTL_SUBSPAN_INSTANCE_SHIFT 16 #define GEN6_WIZ_CTL_SNAPSHOT_MUX_WIZ_KERNEL_POINTER (0 << 8) #define GEN6_WIZ_CTL_SNAPSHOT_MUX_SUBSPAN_INSTANCE (1 << 8) #define GEN6_WIZ_CTL_SNAPSHOT_MUX_PRIMITIVE_SEQUENCE (2 << 8) #define GEN6_WIZ_CTL_SINGLE_SUBSPAN_DISPATCH (1 << 6) #define GEN6_WIZ_CTL_IGNORE_COLOR_SCOREBOARD_STALLS (1 << 5) #define GEN6_WIZ_CTL_ENABLE_SUBSPAN_INSTANCE_COMPARE (1 << 4) #define GEN6_WIZ_CTL_USE_UPSTREAM_SNAPSHOT_FLAG (1 << 3) #define GEN6_WIZ_CTL_SNAPSHOT_ALL_THREADS (1 << 2) #define GEN6_WIZ_CTL_THREAD_SNAPSHOT_ENABLE (1 << 1) #define GEN6_WIZ_CTL_SNAPSHOT_ENABLE (1 << 0) #define GEN6_WIZ_STRG_VAL 0x7c04 #define GEN6_WIZ_RDATA 0x7c18 #define GEN6_TS_CTL 0x7e00 #define GEN6_TS_CTL_SNAPSHOT_COMPLETE (1 << 31) #define GEN6_TS_CTL_SNAPSHOT_MESSAGE_ERROR (0 << 8) #define GEN6_TS_CTL_SNAPSHOT_INTERFACE_DESCRIPTOR (3 << 8) #define GEN6_TS_CTL_SNAPSHOT_ALL_CHILD_THREADS (1 << 2) #define GEN6_TS_CTL_SNAPSHOT_ALL_ROOT_THREADS (1 << 1) #define GEN6_TS_CTL_SNAPSHOT_ENABLE (1 << 0) #define GEN6_TS_STRG_VAL 0x7e04 #define GEN6_TS_RDATA 0x7e08 /* TD_CTL on gen6 is 0x7000, to not break stuff which depends on this... */ #ifndef GEN6_TD_CTL #define GEN6_TD_CTL 0x8000 #endif #define GEN6_TD_CTL_MUX_SHIFT 8 #define GEN6_TD_CTL_EXTERNAL_HALT_R0_DEBUG_MATCH (1 << 7) #define GEN6_TD_CTL_FORCE_EXTERNAL_HALT (1 << 6) #define GEN6_TD_CTL_EXCEPTION_MASK_OVERRIDE (1 << 5) #define GEN6_TD_CTL_FORCE_THREAD_BREAKPOINT_ENABLE (1 << 4) #define GEN6_TD_CTL_BREAKPOINT_ENABLE (1 << 2) #define GEN6_TD_CTL2 0x8004 #define GEN6_TD_CTL2_ILLEGAL_OPCODE_EXCEPTION_OVERRIDE (1 << 28) #define GEN6_TD_CTL2_MASKSTACK_EXCEPTION_OVERRIDE (1 << 26) #define GEN6_TD_CTL2_SOFTWARE_EXCEPTION_OVERRIDE (1 << 25) #define GEN6_TD_CTL2_ACTIVE_THREAD_LIMIT_SHIFT 16 #define GEN6_TD_CTL2_ACTIVE_THREAD_LIMIT_ENABLE (1 << 8) #define GEN6_TD_CTL2_THREAD_SPAWNER_EXECUTION_MASK_ENABLE (1 << 7) #define GEN6_TD_CTL2_WIZ_EXECUTION_MASK_ENABLE (1 << 6) #define GEN6_TD_CTL2_SF_EXECUTION_MASK_ENABLE (1 << 5) #define GEN6_TD_CTL2_CLIPPER_EXECUTION_MASK_ENABLE (1 << 4) #define GEN6_TD_CTL2_GS_EXECUTION_MASK_ENABLE (1 << 3) #define GEN6_TD_CTL2_VS_EXECUTION_MASK_ENABLE (1 << 0) #define GEN6_TD_VF_VS_EMSK 0x8008 #define GEN6_TD_GS_EMSK 0x800c #define GEN6_TD_CLIP_EMSK 0x8010 #define GEN6_TD_SF_EMSK 0x8014 #define GEN6_TD_WIZ_EMSK 0x8018 #define GEN6_TD_0_6_EHTRG_VAL 0x801c #define GEN6_TD_0_7_EHTRG_VAL 0x8020 #define GEN6_TD_0_6_EHTRG_MSK 0x8024 #define GEN6_TD_0_7_EHTRG_MSK 0x8028 #define GEN6_TD_RDATA 0x802c #define GEN6_TD_TS_EMSK 0x8030 #define GEN6_EU_CTL 0x8800 #define GEN6_EU_CTL_SELECT_SHIFT 16 #define GEN6_EU_CTL_DATA_MUX_SHIFT 8 #define GEN6_EU_ATT_0 0x8810 #define GEN6_EU_ATT_1 0x8814 #define GEN6_EU_ATT_DATA_0 0x8820 #define GEN6_EU_ATT_DATA_1 0x8824 #define GEN6_EU_ATT_CLR_0 0x8830 #define GEN6_EU_ATT_CLR_1 0x8834 #define GEN6_EU_RDATA 0x8840 /* 3D state: */ #define _3DOP_3DSTATE_PIPELINED 0x0 #define _3DOP_3DSTATE_NONPIPELINED 0x1 #define _3DOP_3DCONTROL 0x2 #define _3DOP_3DPRIMITIVE 0x3 #define _3DSTATE_PIPELINED_POINTERS 0x00 #define _3DSTATE_BINDING_TABLE_POINTERS 0x01 #define _3DSTATE_VERTEX_BUFFERS 0x08 #define _3DSTATE_VERTEX_ELEMENTS 0x09 #define _3DSTATE_INDEX_BUFFER 0x0A #define _3DSTATE_VF_STATISTICS 0x0B #define _3DSTATE_DRAWING_RECTANGLE 0x00 #define _3DSTATE_CONSTANT_COLOR 0x01 #define _3DSTATE_SAMPLER_PALETTE_LOAD 0x02 #define _3DSTATE_CHROMA_KEY 0x04 #define _3DSTATE_DEPTH_BUFFER 0x05 #define _3DSTATE_POLY_STIPPLE_OFFSET 0x06 #define _3DSTATE_POLY_STIPPLE_PATTERN 0x07 #define _3DSTATE_LINE_STIPPLE 0x08 #define _3DSTATE_GLOBAL_DEPTH_OFFSET_CLAMP 0x09 #define _3DCONTROL 0x00 #define _3DPRIMITIVE 0x00 #define _3DPRIM_POINTLIST 0x01 #define _3DPRIM_LINELIST 0x02 #define _3DPRIM_LINESTRIP 0x03 #define _3DPRIM_TRILIST 0x04 #define _3DPRIM_TRISTRIP 0x05 #define _3DPRIM_TRIFAN 0x06 #define _3DPRIM_QUADLIST 0x07 #define _3DPRIM_QUADSTRIP 0x08 #define _3DPRIM_LINELIST_ADJ 0x09 #define _3DPRIM_LINESTRIP_ADJ 0x0A #define _3DPRIM_TRILIST_ADJ 0x0B #define _3DPRIM_TRISTRIP_ADJ 0x0C #define _3DPRIM_TRISTRIP_REVERSE 0x0D #define _3DPRIM_POLYGON 0x0E #define _3DPRIM_RECTLIST 0x0F #define _3DPRIM_LINELOOP 0x10 #define _3DPRIM_POINTLIST_BF 0x11 #define _3DPRIM_LINESTRIP_CONT 0x12 #define _3DPRIM_LINESTRIP_BF 0x13 #define _3DPRIM_LINESTRIP_CONT_BF 0x14 #define _3DPRIM_TRIFAN_NOSTIPPLE 0x15 #define _3DPRIM_VERTEXBUFFER_ACCESS_SEQUENTIAL 0 #define _3DPRIM_VERTEXBUFFER_ACCESS_RANDOM 1 #define GEN6_ANISORATIO_2 0 #define GEN6_ANISORATIO_4 1 #define GEN6_ANISORATIO_6 2 #define GEN6_ANISORATIO_8 3 #define GEN6_ANISORATIO_10 4 #define GEN6_ANISORATIO_12 5 #define GEN6_ANISORATIO_14 6 #define GEN6_ANISORATIO_16 7 #define GEN6_BLENDFACTOR_ONE 0x1 #define GEN6_BLENDFACTOR_SRC_COLOR 0x2 #define GEN6_BLENDFACTOR_SRC_ALPHA 0x3 #define GEN6_BLENDFACTOR_DST_ALPHA 0x4 #define GEN6_BLENDFACTOR_DST_COLOR 0x5 #define GEN6_BLENDFACTOR_SRC_ALPHA_SATURATE 0x6 #define GEN6_BLENDFACTOR_CONST_COLOR 0x7 #define GEN6_BLENDFACTOR_CONST_ALPHA 0x8 #define GEN6_BLENDFACTOR_SRC1_COLOR 0x9 #define GEN6_BLENDFACTOR_SRC1_ALPHA 0x0A #define GEN6_BLENDFACTOR_ZERO 0x11 #define GEN6_BLENDFACTOR_INV_SRC_COLOR 0x12 #define GEN6_BLENDFACTOR_INV_SRC_ALPHA 0x13 #define GEN6_BLENDFACTOR_INV_DST_ALPHA 0x14 #define GEN6_BLENDFACTOR_INV_DST_COLOR 0x15 #define GEN6_BLENDFACTOR_INV_CONST_COLOR 0x17 #define GEN6_BLENDFACTOR_INV_CONST_ALPHA 0x18 #define GEN6_BLENDFACTOR_INV_SRC1_COLOR 0x19 #define GEN6_BLENDFACTOR_INV_SRC1_ALPHA 0x1A #define GEN6_BLENDFUNCTION_ADD 0 #define GEN6_BLENDFUNCTION_SUBTRACT 1 #define GEN6_BLENDFUNCTION_REVERSE_SUBTRACT 2 #define GEN6_BLENDFUNCTION_MIN 3 #define GEN6_BLENDFUNCTION_MAX 4 #define GEN6_ALPHATEST_FORMAT_UNORM8 0 #define GEN6_ALPHATEST_FORMAT_FLOAT32 1 #define GEN6_CHROMAKEY_KILL_ON_ANY_MATCH 0 #define GEN6_CHROMAKEY_REPLACE_BLACK 1 #define GEN6_CLIP_API_OGL 0 #define GEN6_CLIP_API_DX 1 #define GEN6_CLIPMODE_NORMAL 0 #define GEN6_CLIPMODE_CLIP_ALL 1 #define GEN6_CLIPMODE_CLIP_NON_REJECTED 2 #define GEN6_CLIPMODE_REJECT_ALL 3 #define GEN6_CLIPMODE_ACCEPT_ALL 4 #define GEN6_CLIP_NDCSPACE 0 #define GEN6_CLIP_SCREENSPACE 1 #define GEN6_COMPAREFUNCTION_ALWAYS 0 #define GEN6_COMPAREFUNCTION_NEVER 1 #define GEN6_COMPAREFUNCTION_LESS 2 #define GEN6_COMPAREFUNCTION_EQUAL 3 #define GEN6_COMPAREFUNCTION_LEQUAL 4 #define GEN6_COMPAREFUNCTION_GREATER 5 #define GEN6_COMPAREFUNCTION_NOTEQUAL 6 #define GEN6_COMPAREFUNCTION_GEQUAL 7 #define GEN6_COVERAGE_PIXELS_HALF 0 #define GEN6_COVERAGE_PIXELS_1 1 #define GEN6_COVERAGE_PIXELS_2 2 #define GEN6_COVERAGE_PIXELS_4 3 #define GEN6_CULLMODE_BOTH 0 #define GEN6_CULLMODE_NONE 1 #define GEN6_CULLMODE_FRONT 2 #define GEN6_CULLMODE_BACK 3 #define GEN6_DEFAULTCOLOR_R8G8B8A8_UNORM 0 #define GEN6_DEFAULTCOLOR_R32G32B32A32_FLOAT 1 #define GEN6_DEPTHFORMAT_D32_FLOAT_S8X24_UINT 0 #define GEN6_DEPTHFORMAT_D32_FLOAT 1 #define GEN6_DEPTHFORMAT_D24_UNORM_S8_UINT 2 #define GEN6_DEPTHFORMAT_D16_UNORM 5 #define GEN6_FLOATING_POINT_IEEE_754 0 #define GEN6_FLOATING_POINT_NON_IEEE_754 1 #define GEN6_FRONTWINDING_CW 0 #define GEN6_FRONTWINDING_CCW 1 #define GEN6_INDEX_BYTE 0 #define GEN6_INDEX_WORD 1 #define GEN6_INDEX_DWORD 2 #define GEN6_LOGICOPFUNCTION_CLEAR 0 #define GEN6_LOGICOPFUNCTION_NOR 1 #define GEN6_LOGICOPFUNCTION_AND_INVERTED 2 #define GEN6_LOGICOPFUNCTION_COPY_INVERTED 3 #define GEN6_LOGICOPFUNCTION_AND_REVERSE 4 #define GEN6_LOGICOPFUNCTION_INVERT 5 #define GEN6_LOGICOPFUNCTION_XOR 6 #define GEN6_LOGICOPFUNCTION_NAND 7 #define GEN6_LOGICOPFUNCTION_AND 8 #define GEN6_LOGICOPFUNCTION_EQUIV 9 #define GEN6_LOGICOPFUNCTION_NOOP 10 #define GEN6_LOGICOPFUNCTION_OR_INVERTED 11 #define GEN6_LOGICOPFUNCTION_COPY 12 #define GEN6_LOGICOPFUNCTION_OR_REVERSE 13 #define GEN6_LOGICOPFUNCTION_OR 14 #define GEN6_LOGICOPFUNCTION_SET 15 #define GEN6_MAPFILTER_NEAREST 0x0 #define GEN6_MAPFILTER_LINEAR 0x1 #define GEN6_MAPFILTER_ANISOTROPIC 0x2 #define GEN6_MIPFILTER_NONE 0 #define GEN6_MIPFILTER_NEAREST 1 #define GEN6_MIPFILTER_LINEAR 3 #define GEN6_POLYGON_FRONT_FACING 0 #define GEN6_POLYGON_BACK_FACING 1 #define GEN6_PREFILTER_ALWAYS 0x0 #define GEN6_PREFILTER_NEVER 0x1 #define GEN6_PREFILTER_LESS 0x2 #define GEN6_PREFILTER_EQUAL 0x3 #define GEN6_PREFILTER_LEQUAL 0x4 #define GEN6_PREFILTER_GREATER 0x5 #define GEN6_PREFILTER_NOTEQUAL 0x6 #define GEN6_PREFILTER_GEQUAL 0x7 #define GEN6_PROVOKING_VERTEX_0 0 #define GEN6_PROVOKING_VERTEX_1 1 #define GEN6_PROVOKING_VERTEX_2 2 #define GEN6_RASTRULE_UPPER_LEFT 0 #define GEN6_RASTRULE_UPPER_RIGHT 1 #define GEN6_RENDERTARGET_CLAMPRANGE_UNORM 0 #define GEN6_RENDERTARGET_CLAMPRANGE_SNORM 1 #define GEN6_RENDERTARGET_CLAMPRANGE_FORMAT 2 #define GEN6_STENCILOP_KEEP 0 #define GEN6_STENCILOP_ZERO 1 #define GEN6_STENCILOP_REPLACE 2 #define GEN6_STENCILOP_INCRSAT 3 #define GEN6_STENCILOP_DECRSAT 4 #define GEN6_STENCILOP_INCR 5 #define GEN6_STENCILOP_DECR 6 #define GEN6_STENCILOP_INVERT 7 #define GEN6_SURFACE_MIPMAPLAYOUT_BELOW 0 #define GEN6_SURFACE_MIPMAPLAYOUT_RIGHT 1 #define GEN6_SURFACEFORMAT_R32G32B32A32_FLOAT 0x000 #define GEN6_SURFACEFORMAT_R32G32B32A32_SINT 0x001 #define GEN6_SURFACEFORMAT_R32G32B32A32_UINT 0x002 #define GEN6_SURFACEFORMAT_R32G32B32A32_UNORM 0x003 #define GEN6_SURFACEFORMAT_R32G32B32A32_SNORM 0x004 #define GEN6_SURFACEFORMAT_R64G64_FLOAT 0x005 #define GEN6_SURFACEFORMAT_R32G32B32X32_FLOAT 0x006 #define GEN6_SURFACEFORMAT_R32G32B32A32_SSCALED 0x007 #define GEN6_SURFACEFORMAT_R32G32B32A32_USCALED 0x008 #define GEN6_SURFACEFORMAT_R32G32B32_FLOAT 0x040 #define GEN6_SURFACEFORMAT_R32G32B32_SINT 0x041 #define GEN6_SURFACEFORMAT_R32G32B32_UINT 0x042 #define GEN6_SURFACEFORMAT_R32G32B32_UNORM 0x043 #define GEN6_SURFACEFORMAT_R32G32B32_SNORM 0x044 #define GEN6_SURFACEFORMAT_R32G32B32_SSCALED 0x045 #define GEN6_SURFACEFORMAT_R32G32B32_USCALED 0x046 #define GEN6_SURFACEFORMAT_R16G16B16A16_UNORM 0x080 #define GEN6_SURFACEFORMAT_R16G16B16A16_SNORM 0x081 #define GEN6_SURFACEFORMAT_R16G16B16A16_SINT 0x082 #define GEN6_SURFACEFORMAT_R16G16B16A16_UINT 0x083 #define GEN6_SURFACEFORMAT_R16G16B16A16_FLOAT 0x084 #define GEN6_SURFACEFORMAT_R32G32_FLOAT 0x085 #define GEN6_SURFACEFORMAT_R32G32_SINT 0x086 #define GEN6_SURFACEFORMAT_R32G32_UINT 0x087 #define GEN6_SURFACEFORMAT_R32_FLOAT_X8X24_TYPELESS 0x088 #define GEN6_SURFACEFORMAT_X32_TYPELESS_G8X24_UINT 0x089 #define GEN6_SURFACEFORMAT_L32A32_FLOAT 0x08A #define GEN6_SURFACEFORMAT_R32G32_UNORM 0x08B #define GEN6_SURFACEFORMAT_R32G32_SNORM 0x08C #define GEN6_SURFACEFORMAT_R64_FLOAT 0x08D #define GEN6_SURFACEFORMAT_R16G16B16X16_UNORM 0x08E #define GEN6_SURFACEFORMAT_R16G16B16X16_FLOAT 0x08F #define GEN6_SURFACEFORMAT_A32X32_FLOAT 0x090 #define GEN6_SURFACEFORMAT_L32X32_FLOAT 0x091 #define GEN6_SURFACEFORMAT_I32X32_FLOAT 0x092 #define GEN6_SURFACEFORMAT_R16G16B16A16_SSCALED 0x093 #define GEN6_SURFACEFORMAT_R16G16B16A16_USCALED 0x094 #define GEN6_SURFACEFORMAT_R32G32_SSCALED 0x095 #define GEN6_SURFACEFORMAT_R32G32_USCALED 0x096 #define GEN6_SURFACEFORMAT_B8G8R8A8_UNORM 0x0C0 #define GEN6_SURFACEFORMAT_B8G8R8A8_UNORM_SRGB 0x0C1 #define GEN6_SURFACEFORMAT_R10G10B10A2_UNORM 0x0C2 #define GEN6_SURFACEFORMAT_R10G10B10A2_UNORM_SRGB 0x0C3 #define GEN6_SURFACEFORMAT_R10G10B10A2_UINT 0x0C4 #define GEN6_SURFACEFORMAT_R10G10B10_SNORM_A2_UNORM 0x0C5 #define GEN6_SURFACEFORMAT_R8G8B8A8_UNORM 0x0C7 #define GEN6_SURFACEFORMAT_R8G8B8A8_UNORM_SRGB 0x0C8 #define GEN6_SURFACEFORMAT_R8G8B8A8_SNORM 0x0C9 #define GEN6_SURFACEFORMAT_R8G8B8A8_SINT 0x0CA #define GEN6_SURFACEFORMAT_R8G8B8A8_UINT 0x0CB #define GEN6_SURFACEFORMAT_R16G16_UNORM 0x0CC #define GEN6_SURFACEFORMAT_R16G16_SNORM 0x0CD #define GEN6_SURFACEFORMAT_R16G16_SINT 0x0CE #define GEN6_SURFACEFORMAT_R16G16_UINT 0x0CF #define GEN6_SURFACEFORMAT_R16G16_FLOAT 0x0D0 #define GEN6_SURFACEFORMAT_B10G10R10A2_UNORM 0x0D1 #define GEN6_SURFACEFORMAT_B10G10R10A2_UNORM_SRGB 0x0D2 #define GEN6_SURFACEFORMAT_R11G11B10_FLOAT 0x0D3 #define GEN6_SURFACEFORMAT_R32_SINT 0x0D6 #define GEN6_SURFACEFORMAT_R32_UINT 0x0D7 #define GEN6_SURFACEFORMAT_R32_FLOAT 0x0D8 #define GEN6_SURFACEFORMAT_R24_UNORM_X8_TYPELESS 0x0D9 #define GEN6_SURFACEFORMAT_X24_TYPELESS_G8_UINT 0x0DA #define GEN6_SURFACEFORMAT_L16A16_UNORM 0x0DF #define GEN6_SURFACEFORMAT_I24X8_UNORM 0x0E0 #define GEN6_SURFACEFORMAT_L24X8_UNORM 0x0E1 #define GEN6_SURFACEFORMAT_A24X8_UNORM 0x0E2 #define GEN6_SURFACEFORMAT_I32_FLOAT 0x0E3 #define GEN6_SURFACEFORMAT_L32_FLOAT 0x0E4 #define GEN6_SURFACEFORMAT_A32_FLOAT 0x0E5 #define GEN6_SURFACEFORMAT_B8G8R8X8_UNORM 0x0E9 #define GEN6_SURFACEFORMAT_B8G8R8X8_UNORM_SRGB 0x0EA #define GEN6_SURFACEFORMAT_R8G8B8X8_UNORM 0x0EB #define GEN6_SURFACEFORMAT_R8G8B8X8_UNORM_SRGB 0x0EC #define GEN6_SURFACEFORMAT_R9G9B9E5_SHAREDEXP 0x0ED #define GEN6_SURFACEFORMAT_B10G10R10X2_UNORM 0x0EE #define GEN6_SURFACEFORMAT_L16A16_FLOAT 0x0F0 #define GEN6_SURFACEFORMAT_R32_UNORM 0x0F1 #define GEN6_SURFACEFORMAT_R32_SNORM 0x0F2 #define GEN6_SURFACEFORMAT_R10G10B10X2_USCALED 0x0F3 #define GEN6_SURFACEFORMAT_R8G8B8A8_SSCALED 0x0F4 #define GEN6_SURFACEFORMAT_R8G8B8A8_USCALED 0x0F5 #define GEN6_SURFACEFORMAT_R16G16_SSCALED 0x0F6 #define GEN6_SURFACEFORMAT_R16G16_USCALED 0x0F7 #define GEN6_SURFACEFORMAT_R32_SSCALED 0x0F8 #define GEN6_SURFACEFORMAT_R32_USCALED 0x0F9 #define GEN6_SURFACEFORMAT_B5G6R5_UNORM 0x100 #define GEN6_SURFACEFORMAT_B5G6R5_UNORM_SRGB 0x101 #define GEN6_SURFACEFORMAT_B5G5R5A1_UNORM 0x102 #define GEN6_SURFACEFORMAT_B5G5R5A1_UNORM_SRGB 0x103 #define GEN6_SURFACEFORMAT_B4G4R4A4_UNORM 0x104 #define GEN6_SURFACEFORMAT_B4G4R4A4_UNORM_SRGB 0x105 #define GEN6_SURFACEFORMAT_R8G8_UNORM 0x106 #define GEN6_SURFACEFORMAT_R8G8_SNORM 0x107 #define GEN6_SURFACEFORMAT_R8G8_SINT 0x108 #define GEN6_SURFACEFORMAT_R8G8_UINT 0x109 #define GEN6_SURFACEFORMAT_R16_UNORM 0x10A #define GEN6_SURFACEFORMAT_R16_SNORM 0x10B #define GEN6_SURFACEFORMAT_R16_SINT 0x10C #define GEN6_SURFACEFORMAT_R16_UINT 0x10D #define GEN6_SURFACEFORMAT_R16_FLOAT 0x10E #define GEN6_SURFACEFORMAT_I16_UNORM 0x111 #define GEN6_SURFACEFORMAT_L16_UNORM 0x112 #define GEN6_SURFACEFORMAT_A16_UNORM 0x113 #define GEN6_SURFACEFORMAT_L8A8_UNORM 0x114 #define GEN6_SURFACEFORMAT_I16_FLOAT 0x115 #define GEN6_SURFACEFORMAT_L16_FLOAT 0x116 #define GEN6_SURFACEFORMAT_A16_FLOAT 0x117 #define GEN6_SURFACEFORMAT_R5G5_SNORM_B6_UNORM 0x119 #define GEN6_SURFACEFORMAT_B5G5R5X1_UNORM 0x11A #define GEN6_SURFACEFORMAT_B5G5R5X1_UNORM_SRGB 0x11B #define GEN6_SURFACEFORMAT_R8G8_SSCALED 0x11C #define GEN6_SURFACEFORMAT_R8G8_USCALED 0x11D #define GEN6_SURFACEFORMAT_R16_SSCALED 0x11E #define GEN6_SURFACEFORMAT_R16_USCALED 0x11F #define GEN6_SURFACEFORMAT_R8_UNORM 0x140 #define GEN6_SURFACEFORMAT_R8_SNORM 0x141 #define GEN6_SURFACEFORMAT_R8_SINT 0x142 #define GEN6_SURFACEFORMAT_R8_UINT 0x143 #define GEN6_SURFACEFORMAT_A8_UNORM 0x144 #define GEN6_SURFACEFORMAT_I8_UNORM 0x145 #define GEN6_SURFACEFORMAT_L8_UNORM 0x146 #define GEN6_SURFACEFORMAT_P4A4_UNORM 0x147 #define GEN6_SURFACEFORMAT_A4P4_UNORM 0x148 #define GEN6_SURFACEFORMAT_R8_SSCALED 0x149 #define GEN6_SURFACEFORMAT_R8_USCALED 0x14A #define GEN6_SURFACEFORMAT_R1_UINT 0x181 #define GEN6_SURFACEFORMAT_YCRCB_NORMAL 0x182 #define GEN6_SURFACEFORMAT_YCRCB_SWAPUVY 0x183 #define GEN6_SURFACEFORMAT_BC1_UNORM 0x186 #define GEN6_SURFACEFORMAT_BC2_UNORM 0x187 #define GEN6_SURFACEFORMAT_BC3_UNORM 0x188 #define GEN6_SURFACEFORMAT_BC4_UNORM 0x189 #define GEN6_SURFACEFORMAT_BC5_UNORM 0x18A #define GEN6_SURFACEFORMAT_BC1_UNORM_SRGB 0x18B #define GEN6_SURFACEFORMAT_BC2_UNORM_SRGB 0x18C #define GEN6_SURFACEFORMAT_BC3_UNORM_SRGB 0x18D #define GEN6_SURFACEFORMAT_MONO8 0x18E #define GEN6_SURFACEFORMAT_YCRCB_SWAPUV 0x18F #define GEN6_SURFACEFORMAT_YCRCB_SWAPY 0x190 #define GEN6_SURFACEFORMAT_DXT1_RGB 0x191 #define GEN6_SURFACEFORMAT_FXT1 0x192 #define GEN6_SURFACEFORMAT_R8G8B8_UNORM 0x193 #define GEN6_SURFACEFORMAT_R8G8B8_SNORM 0x194 #define GEN6_SURFACEFORMAT_R8G8B8_SSCALED 0x195 #define GEN6_SURFACEFORMAT_R8G8B8_USCALED 0x196 #define GEN6_SURFACEFORMAT_R64G64B64A64_FLOAT 0x197 #define GEN6_SURFACEFORMAT_R64G64B64_FLOAT 0x198 #define GEN6_SURFACEFORMAT_BC4_SNORM 0x199 #define GEN6_SURFACEFORMAT_BC5_SNORM 0x19A #define GEN6_SURFACEFORMAT_R16G16B16_UNORM 0x19C #define GEN6_SURFACEFORMAT_R16G16B16_SNORM 0x19D #define GEN6_SURFACEFORMAT_R16G16B16_SSCALED 0x19E #define GEN6_SURFACEFORMAT_R16G16B16_USCALED 0x19F #define GEN6_SURFACERETURNFORMAT_FLOAT32 0 #define GEN6_SURFACERETURNFORMAT_S1 1 #define GEN6_SURFACE_1D 0 #define GEN6_SURFACE_2D 1 #define GEN6_SURFACE_3D 2 #define GEN6_SURFACE_CUBE 3 #define GEN6_SURFACE_BUFFER 4 #define GEN6_SURFACE_NULL 7 #define GEN6_BORDER_COLOR_MODE_DEFAULT 0 #define GEN6_BORDER_COLOR_MODE_LEGACY 1 #define GEN6_TEXCOORDMODE_WRAP 0 #define GEN6_TEXCOORDMODE_MIRROR 1 #define GEN6_TEXCOORDMODE_CLAMP 2 #define GEN6_TEXCOORDMODE_CUBE 3 #define GEN6_TEXCOORDMODE_CLAMP_BORDER 4 #define GEN6_TEXCOORDMODE_MIRROR_ONCE 5 #define GEN6_THREAD_PRIORITY_NORMAL 0 #define GEN6_THREAD_PRIORITY_HIGH 1 #define GEN6_TILEWALK_XMAJOR 0 #define GEN6_TILEWALK_YMAJOR 1 #define GEN6_VERTEX_SUBPIXEL_PRECISION_8BITS 0 #define GEN6_VERTEX_SUBPIXEL_PRECISION_4BITS 1 #define GEN6_VERTEXBUFFER_ACCESS_VERTEXDATA 0 #define GEN6_VERTEXBUFFER_ACCESS_INSTANCEDATA 1 #define GEN6_VFCOMPONENT_NOSTORE 0 #define GEN6_VFCOMPONENT_STORE_SRC 1 #define GEN6_VFCOMPONENT_STORE_0 2 #define GEN6_VFCOMPONENT_STORE_1_FLT 3 #define GEN6_VFCOMPONENT_STORE_1_INT 4 #define GEN6_VFCOMPONENT_STORE_VID 5 #define GEN6_VFCOMPONENT_STORE_IID 6 #define GEN6_VFCOMPONENT_STORE_PID 7 /* Execution Unit (EU) defines */ #define GEN6_ALIGN_1 0 #define GEN6_ALIGN_16 1 #define GEN6_ADDRESS_DIRECT 0 #define GEN6_ADDRESS_REGISTER_INDIRECT_REGISTER 1 #define GEN6_CHANNEL_X 0 #define GEN6_CHANNEL_Y 1 #define GEN6_CHANNEL_Z 2 #define GEN6_CHANNEL_W 3 #define GEN6_COMPRESSION_NONE 0 #define GEN6_COMPRESSION_2NDHALF 1 #define GEN6_COMPRESSION_COMPRESSED 2 #define GEN6_CONDITIONAL_NONE 0 #define GEN6_CONDITIONAL_Z 1 #define GEN6_CONDITIONAL_NZ 2 #define GEN6_CONDITIONAL_EQ 1 /* Z */ #define GEN6_CONDITIONAL_NEQ 2 /* NZ */ #define GEN6_CONDITIONAL_G 3 #define GEN6_CONDITIONAL_GE 4 #define GEN6_CONDITIONAL_L 5 #define GEN6_CONDITIONAL_LE 6 #define GEN6_CONDITIONAL_C 7 #define GEN6_CONDITIONAL_O 8 #define GEN6_DEBUG_NONE 0 #define GEN6_DEBUG_BREAKPOINT 1 #define GEN6_DEPENDENCY_NORMAL 0 #define GEN6_DEPENDENCY_NOTCLEARED 1 #define GEN6_DEPENDENCY_NOTCHECKED 2 #define GEN6_DEPENDENCY_DISABLE 3 #define GEN6_EXECUTE_1 0 #define GEN6_EXECUTE_2 1 #define GEN6_EXECUTE_4 2 #define GEN6_EXECUTE_8 3 #define GEN6_EXECUTE_16 4 #define GEN6_EXECUTE_32 5 #define GEN6_HORIZONTAL_STRIDE_0 0 #define GEN6_HORIZONTAL_STRIDE_1 1 #define GEN6_HORIZONTAL_STRIDE_2 2 #define GEN6_HORIZONTAL_STRIDE_4 3 #define GEN6_INSTRUCTION_NORMAL 0 #define GEN6_INSTRUCTION_SATURATE 1 #define GEN6_MASK_ENABLE 0 #define GEN6_MASK_DISABLE 1 #define GEN6_OPCODE_MOV 1 #define GEN6_OPCODE_SEL 2 #define GEN6_OPCODE_NOT 4 #define GEN6_OPCODE_AND 5 #define GEN6_OPCODE_OR 6 #define GEN6_OPCODE_XOR 7 #define GEN6_OPCODE_SHR 8 #define GEN6_OPCODE_SHL 9 #define GEN6_OPCODE_RSR 10 #define GEN6_OPCODE_RSL 11 #define GEN6_OPCODE_ASR 12 #define GEN6_OPCODE_CMP 16 #define GEN6_OPCODE_JMPI 32 #define GEN6_OPCODE_IF 34 #define GEN6_OPCODE_IFF 35 #define GEN6_OPCODE_ELSE 36 #define GEN6_OPCODE_ENDIF 37 #define GEN6_OPCODE_DO 38 #define GEN6_OPCODE_WHILE 39 #define GEN6_OPCODE_BREAK 40 #define GEN6_OPCODE_CONTINUE 41 #define GEN6_OPCODE_HALT 42 #define GEN6_OPCODE_MSAVE 44 #define GEN6_OPCODE_MRESTORE 45 #define GEN6_OPCODE_PUSH 46 #define GEN6_OPCODE_POP 47 #define GEN6_OPCODE_WAIT 48 #define GEN6_OPCODE_SEND 49 #define GEN6_OPCODE_ADD 64 #define GEN6_OPCODE_MUL 65 #define GEN6_OPCODE_AVG 66 #define GEN6_OPCODE_FRC 67 #define GEN6_OPCODE_RNDU 68 #define GEN6_OPCODE_RNDD 69 #define GEN6_OPCODE_RNDE 70 #define GEN6_OPCODE_RNDZ 71 #define GEN6_OPCODE_MAC 72 #define GEN6_OPCODE_MACH 73 #define GEN6_OPCODE_LZD 74 #define GEN6_OPCODE_SAD2 80 #define GEN6_OPCODE_SADA2 81 #define GEN6_OPCODE_DP4 84 #define GEN6_OPCODE_DPH 85 #define GEN6_OPCODE_DP3 86 #define GEN6_OPCODE_DP2 87 #define GEN6_OPCODE_DPA2 88 #define GEN6_OPCODE_LINE 89 #define GEN6_OPCODE_NOP 126 #define GEN6_PREDICATE_NONE 0 #define GEN6_PREDICATE_NORMAL 1 #define GEN6_PREDICATE_ALIGN1_ANYV 2 #define GEN6_PREDICATE_ALIGN1_ALLV 3 #define GEN6_PREDICATE_ALIGN1_ANY2H 4 #define GEN6_PREDICATE_ALIGN1_ALL2H 5 #define GEN6_PREDICATE_ALIGN1_ANY4H 6 #define GEN6_PREDICATE_ALIGN1_ALL4H 7 #define GEN6_PREDICATE_ALIGN1_ANY8H 8 #define GEN6_PREDICATE_ALIGN1_ALL8H 9 #define GEN6_PREDICATE_ALIGN1_ANY16H 10 #define GEN6_PREDICATE_ALIGN1_ALL16H 11 #define GEN6_PREDICATE_ALIGN16_REPLICATE_X 2 #define GEN6_PREDICATE_ALIGN16_REPLICATE_Y 3 #define GEN6_PREDICATE_ALIGN16_REPLICATE_Z 4 #define GEN6_PREDICATE_ALIGN16_REPLICATE_W 5 #define GEN6_PREDICATE_ALIGN16_ANY4H 6 #define GEN6_PREDICATE_ALIGN16_ALL4H 7 #define GEN6_ARCHITECTURE_REGISTER_FILE 0 #define GEN6_GENERAL_REGISTER_FILE 1 #define GEN6_MESSAGE_REGISTER_FILE 2 #define GEN6_IMMEDIATE_VALUE 3 #define GEN6_REGISTER_TYPE_UD 0 #define GEN6_REGISTER_TYPE_D 1 #define GEN6_REGISTER_TYPE_UW 2 #define GEN6_REGISTER_TYPE_W 3 #define GEN6_REGISTER_TYPE_UB 4 #define GEN6_REGISTER_TYPE_B 5 #define GEN6_REGISTER_TYPE_VF 5 /* packed float vector, immediates only? */ #define GEN6_REGISTER_TYPE_HF 6 #define GEN6_REGISTER_TYPE_V 6 /* packed int vector, immediates only, uword dest only */ #define GEN6_REGISTER_TYPE_F 7 #define GEN6_ARF_NULL 0x00 #define GEN6_ARF_ADDRESS 0x10 #define GEN6_ARF_ACCUMULATOR 0x20 #define GEN6_ARF_FLAG 0x30 #define GEN6_ARF_MASK 0x40 #define GEN6_ARF_MASK_STACK 0x50 #define GEN6_ARF_MASK_STACK_DEPTH 0x60 #define GEN6_ARF_STATE 0x70 #define GEN6_ARF_CONTROL 0x80 #define GEN6_ARF_NOTIFICATION_COUNT 0x90 #define GEN6_ARF_IP 0xA0 #define GEN6_AMASK 0 #define GEN6_IMASK 1 #define GEN6_LMASK 2 #define GEN6_CMASK 3 #define GEN6_THREAD_NORMAL 0 #define GEN6_THREAD_ATOMIC 1 #define GEN6_THREAD_SWITCH 2 #define GEN6_VERTICAL_STRIDE_0 0 #define GEN6_VERTICAL_STRIDE_1 1 #define GEN6_VERTICAL_STRIDE_2 2 #define GEN6_VERTICAL_STRIDE_4 3 #define GEN6_VERTICAL_STRIDE_8 4 #define GEN6_VERTICAL_STRIDE_16 5 #define GEN6_VERTICAL_STRIDE_32 6 #define GEN6_VERTICAL_STRIDE_64 7 #define GEN6_VERTICAL_STRIDE_128 8 #define GEN6_VERTICAL_STRIDE_256 9 #define GEN6_VERTICAL_STRIDE_ONE_DIMENSIONAL 0xF #define GEN6_WIDTH_1 0 #define GEN6_WIDTH_2 1 #define GEN6_WIDTH_4 2 #define GEN6_WIDTH_8 3 #define GEN6_WIDTH_16 4 #define GEN6_STATELESS_BUFFER_BOUNDARY_1K 0 #define GEN6_STATELESS_BUFFER_BOUNDARY_2K 1 #define GEN6_STATELESS_BUFFER_BOUNDARY_4K 2 #define GEN6_STATELESS_BUFFER_BOUNDARY_8K 3 #define GEN6_STATELESS_BUFFER_BOUNDARY_16K 4 #define GEN6_STATELESS_BUFFER_BOUNDARY_32K 5 #define GEN6_STATELESS_BUFFER_BOUNDARY_64K 6 #define GEN6_STATELESS_BUFFER_BOUNDARY_128K 7 #define GEN6_STATELESS_BUFFER_BOUNDARY_256K 8 #define GEN6_STATELESS_BUFFER_BOUNDARY_512K 9 #define GEN6_STATELESS_BUFFER_BOUNDARY_1M 10 #define GEN6_STATELESS_BUFFER_BOUNDARY_2M 11 #define GEN6_POLYGON_FACING_FRONT 0 #define GEN6_POLYGON_FACING_BACK 1 #define GEN6_MESSAGE_TARGET_NULL 0 #define GEN6_MESSAGE_TARGET_MATH 1 #define GEN6_MESSAGE_TARGET_SAMPLER 2 #define GEN6_MESSAGE_TARGET_GATEWAY 3 #define GEN6_MESSAGE_TARGET_DATAPORT_READ 4 #define GEN6_MESSAGE_TARGET_DATAPORT_WRITE 5 #define GEN6_MESSAGE_TARGET_URB 6 #define GEN6_MESSAGE_TARGET_THREAD_SPAWNER 7 #define GEN6_SAMPLER_RETURN_FORMAT_FLOAT32 0 #define GEN6_SAMPLER_RETURN_FORMAT_UINT32 2 #define GEN6_SAMPLER_RETURN_FORMAT_SINT32 3 #define GEN6_SAMPLER_MESSAGE_SIMD8_SAMPLE 0 #define GEN6_SAMPLER_MESSAGE_SIMD16_SAMPLE 0 #define GEN6_SAMPLER_MESSAGE_SIMD16_SAMPLE_BIAS 0 #define GEN6_SAMPLER_MESSAGE_SIMD8_KILLPIX 1 #define GEN6_SAMPLER_MESSAGE_SIMD4X2_SAMPLE_LOD 1 #define GEN6_SAMPLER_MESSAGE_SIMD16_SAMPLE_LOD 1 #define GEN6_SAMPLER_MESSAGE_SIMD4X2_SAMPLE_GRADIENTS 2 #define GEN6_SAMPLER_MESSAGE_SIMD8_SAMPLE_GRADIENTS 2 #define GEN6_SAMPLER_MESSAGE_SIMD4X2_SAMPLE_COMPARE 0 #define GEN6_SAMPLER_MESSAGE_SIMD16_SAMPLE_COMPARE 2 #define GEN6_SAMPLER_MESSAGE_SIMD4X2_RESINFO 2 #define GEN6_SAMPLER_MESSAGE_SIMD8_RESINFO 2 #define GEN6_SAMPLER_MESSAGE_SIMD16_RESINFO 2 #define GEN6_SAMPLER_MESSAGE_SIMD4X2_LD 3 #define GEN6_SAMPLER_MESSAGE_SIMD8_LD 3 #define GEN6_SAMPLER_MESSAGE_SIMD16_LD 3 #define GEN6_DATAPORT_OWORD_BLOCK_1_OWORDLOW 0 #define GEN6_DATAPORT_OWORD_BLOCK_1_OWORDHIGH 1 #define GEN6_DATAPORT_OWORD_BLOCK_2_OWORDS 2 #define GEN6_DATAPORT_OWORD_BLOCK_4_OWORDS 3 #define GEN6_DATAPORT_OWORD_BLOCK_8_OWORDS 4 #define GEN6_DATAPORT_OWORD_DUAL_BLOCK_1OWORD 0 #define GEN6_DATAPORT_OWORD_DUAL_BLOCK_4OWORDS 2 #define GEN6_DATAPORT_DWORD_SCATTERED_BLOCK_8DWORDS 2 #define GEN6_DATAPORT_DWORD_SCATTERED_BLOCK_16DWORDS 3 #define GEN6_DATAPORT_READ_MESSAGE_OWORD_BLOCK_READ 0 #define GEN6_DATAPORT_READ_MESSAGE_OWORD_DUAL_BLOCK_READ 1 #define GEN6_DATAPORT_READ_MESSAGE_DWORD_BLOCK_READ 2 #define GEN6_DATAPORT_READ_MESSAGE_DWORD_SCATTERED_READ 3 #define GEN6_DATAPORT_READ_TARGET_DATA_CACHE 0 #define GEN6_DATAPORT_READ_TARGET_RENDER_CACHE 1 #define GEN6_DATAPORT_READ_TARGET_SAMPLER_CACHE 2 #define GEN6_DATAPORT_RENDER_TARGET_WRITE_SIMD16_SINGLE_SOURCE 0 #define GEN6_DATAPORT_RENDER_TARGET_WRITE_SIMD16_SINGLE_SOURCE_REPLICATED 1 #define GEN6_DATAPORT_RENDER_TARGET_WRITE_SIMD8_DUAL_SOURCE_SUBSPAN01 2 #define GEN6_DATAPORT_RENDER_TARGET_WRITE_SIMD8_DUAL_SOURCE_SUBSPAN23 3 #define GEN6_DATAPORT_RENDER_TARGET_WRITE_SIMD8_SINGLE_SOURCE_SUBSPAN01 4 #define GEN6_DATAPORT_WRITE_MESSAGE_OWORD_BLOCK_WRITE 0 #define GEN6_DATAPORT_WRITE_MESSAGE_OWORD_DUAL_BLOCK_WRITE 1 #define GEN6_DATAPORT_WRITE_MESSAGE_DWORD_BLOCK_WRITE 2 #define GEN6_DATAPORT_WRITE_MESSAGE_DWORD_SCATTERED_WRITE 3 #define GEN6_DATAPORT_WRITE_MESSAGE_RENDER_TARGET_WRITE 4 #define GEN6_DATAPORT_WRITE_MESSAGE_STREAMED_VERTEX_BUFFER_WRITE 5 #define GEN6_DATAPORT_WRITE_MESSAGE_FLUSH_RENDER_CACHE 7 #define GEN6_MATH_FUNCTION_INV 1 #define GEN6_MATH_FUNCTION_LOG 2 #define GEN6_MATH_FUNCTION_EXP 3 #define GEN6_MATH_FUNCTION_SQRT 4 #define GEN6_MATH_FUNCTION_RSQ 5 #define GEN6_MATH_FUNCTION_SIN 6 /* was 7 */ #define GEN6_MATH_FUNCTION_COS 7 /* was 8 */ #define GEN6_MATH_FUNCTION_SINCOS 8 /* was 6 */ #define GEN6_MATH_FUNCTION_TAN 9 #define GEN6_MATH_FUNCTION_POW 10 #define GEN6_MATH_FUNCTION_INT_DIV_QUOTIENT_AND_REMAINDER 11 #define GEN6_MATH_FUNCTION_INT_DIV_QUOTIENT 12 #define GEN6_MATH_FUNCTION_INT_DIV_REMAINDER 13 #define GEN6_MATH_INTEGER_UNSIGNED 0 #define GEN6_MATH_INTEGER_SIGNED 1 #define GEN6_MATH_PRECISION_FULL 0 #define GEN6_MATH_PRECISION_PARTIAL 1 #define GEN6_MATH_SATURATE_NONE 0 #define GEN6_MATH_SATURATE_SATURATE 1 #define GEN6_MATH_DATA_VECTOR 0 #define GEN6_MATH_DATA_SCALAR 1 #define GEN6_URB_OPCODE_WRITE 0 #define GEN6_URB_SWIZZLE_NONE 0 #define GEN6_URB_SWIZZLE_INTERLEAVE 1 #define GEN6_URB_SWIZZLE_TRANSPOSE 2 #define GEN6_SCRATCH_SPACE_SIZE_1K 0 #define GEN6_SCRATCH_SPACE_SIZE_2K 1 #define GEN6_SCRATCH_SPACE_SIZE_4K 2 #define GEN6_SCRATCH_SPACE_SIZE_8K 3 #define GEN6_SCRATCH_SPACE_SIZE_16K 4 #define GEN6_SCRATCH_SPACE_SIZE_32K 5 #define GEN6_SCRATCH_SPACE_SIZE_64K 6 #define GEN6_SCRATCH_SPACE_SIZE_128K 7 #define GEN6_SCRATCH_SPACE_SIZE_256K 8 #define GEN6_SCRATCH_SPACE_SIZE_512K 9 #define GEN6_SCRATCH_SPACE_SIZE_1M 10 #define GEN6_SCRATCH_SPACE_SIZE_2M 11 /* The hardware supports two different modes for border color. The * default (OpenGL) mode uses floating-point color channels, while the * legacy mode uses 4 bytes. * * More significantly, the legacy mode respects the components of the * border color for channels not present in the source, (whereas the * default mode will ignore the border color's alpha channel and use * alpha==1 for an RGB source, for example). * * The legacy mode matches the semantics specified by the Render * extension. */ struct gen6_sampler_default_border_color { float color[4]; }; struct gen6_sampler_legacy_border_color { uint8_t color[4]; }; struct gen6_sampler_state { struct { uint32_t shadow_function:3; uint32_t lod_bias:11; uint32_t min_filter:3; uint32_t mag_filter:3; uint32_t mip_filter:2; uint32_t base_level:5; uint32_t pad:1; uint32_t lod_preclamp:1; uint32_t border_color_mode:1; uint32_t pad0:1; uint32_t disable:1; } ss0; struct { uint32_t r_wrap_mode:3; uint32_t t_wrap_mode:3; uint32_t s_wrap_mode:3; uint32_t pad:3; uint32_t max_lod:10; uint32_t min_lod:10; } ss1; struct { uint32_t border_color; } ss2; struct { uint32_t pad:19; uint32_t max_aniso:3; uint32_t chroma_key_mode:1; uint32_t chroma_key_index:2; uint32_t chroma_key_enable:1; uint32_t monochrome_filter_width:3; uint32_t monochrome_filter_height:3; } ss3; }; struct gen6_blend_state { struct { uint32_t dest_blend_factor:5; uint32_t source_blend_factor:5; uint32_t pad3:1; uint32_t blend_func:3; uint32_t pad2:1; uint32_t ia_dest_blend_factor:5; uint32_t ia_source_blend_factor:5; uint32_t pad1:1; uint32_t ia_blend_func:3; uint32_t pad0:1; uint32_t ia_blend_enable:1; uint32_t blend_enable:1; } blend0; struct { uint32_t post_blend_clamp_enable:1; uint32_t pre_blend_clamp_enable:1; uint32_t clamp_range:2; uint32_t pad0:4; uint32_t x_dither_offset:2; uint32_t y_dither_offset:2; uint32_t dither_enable:1; uint32_t alpha_test_func:3; uint32_t alpha_test_enable:1; uint32_t pad1:1; uint32_t logic_op_func:4; uint32_t logic_op_enable:1; uint32_t pad2:1; uint32_t write_disable_b:1; uint32_t write_disable_g:1; uint32_t write_disable_r:1; uint32_t write_disable_a:1; uint32_t pad3:1; uint32_t alpha_to_coverage_dither:1; uint32_t alpha_to_one:1; uint32_t alpha_to_coverage:1; } blend1; }; struct gen6_color_calc_state { struct { uint32_t alpha_test_format:1; uint32_t pad0:14; uint32_t round_disable:1; uint32_t bf_stencil_ref:8; uint32_t stencil_ref:8; } cc0; union { float alpha_ref_f; struct { uint32_t ui:8; uint32_t pad0:24; } alpha_ref_fi; } cc1; float constant_r; float constant_g; float constant_b; float constant_a; }; struct gen6_depth_stencil_state { struct { uint32_t pad0:3; uint32_t bf_stencil_pass_depth_pass_op:3; uint32_t bf_stencil_pass_depth_fail_op:3; uint32_t bf_stencil_fail_op:3; uint32_t bf_stencil_func:3; uint32_t bf_stencil_enable:1; uint32_t pad1:2; uint32_t stencil_write_enable:1; uint32_t stencil_pass_depth_pass_op:3; uint32_t stencil_pass_depth_fail_op:3; uint32_t stencil_fail_op:3; uint32_t stencil_func:3; uint32_t stencil_enable:1; } ds0; struct { uint32_t bf_stencil_write_mask:8; uint32_t bf_stencil_test_mask:8; uint32_t stencil_write_mask:8; uint32_t stencil_test_mask:8; } ds1; struct { uint32_t pad0:26; uint32_t depth_write_enable:1; uint32_t depth_test_func:3; uint32_t pad1:1; uint32_t depth_test_enable:1; } ds2; }; struct gen6_surface_state { struct { uint32_t cube_pos_z:1; uint32_t cube_neg_z:1; uint32_t cube_pos_y:1; uint32_t cube_neg_y:1; uint32_t cube_pos_x:1; uint32_t cube_neg_x:1; uint32_t pad:3; uint32_t render_cache_read_mode:1; uint32_t mipmap_layout_mode:1; uint32_t vert_line_stride_ofs:1; uint32_t vert_line_stride:1; uint32_t color_blend:1; uint32_t writedisable_blue:1; uint32_t writedisable_green:1; uint32_t writedisable_red:1; uint32_t writedisable_alpha:1; uint32_t surface_format:9; uint32_t data_return_format:1; uint32_t pad0:1; uint32_t surface_type:3; } ss0; struct { uint32_t base_addr; } ss1; struct { uint32_t render_target_rotation:2; uint32_t mip_count:4; uint32_t width:13; uint32_t height:13; } ss2; struct { uint32_t tile_walk:1; uint32_t tiled_surface:1; uint32_t pad:1; uint32_t pitch:18; uint32_t depth:11; } ss3; struct { uint32_t pad:19; uint32_t min_array_elt:9; uint32_t min_lod:4; } ss4; struct { uint32_t pad:20; uint32_t y_offset:4; uint32_t pad2:1; uint32_t x_offset:7; } ss5; }; struct gen6_cc_viewport { float min_depth; float max_depth; }; typedef enum { SAMPLER_FILTER_NEAREST = 0, SAMPLER_FILTER_BILINEAR, FILTER_COUNT } sampler_filter_t; typedef enum { SAMPLER_EXTEND_NONE = 0, SAMPLER_EXTEND_REPEAT, SAMPLER_EXTEND_PAD, SAMPLER_EXTEND_REFLECT, EXTEND_COUNT } sampler_extend_t; #endif intel-gpu-tools-1.3/lib/i915_reg.h0000664000175100017510000007762611566027747013650 00000000000000/************************************************************************** * * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sub license, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial portions * of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * **************************************************************************/ #ifndef _I915_REG_H_ #define _I915_REG_H_ #define I915_SET_FIELD( var, mask, value ) (var &= ~(mask), var |= value) #define CMD_3D (0x3<<29) #define PRIM3D (CMD_3D | (0x1f<<24)) #define PRIM3D_INDIRECT_SEQUENTIAL ((1<<23) | (0<<17)) #define PRIM3D_TRILIST (PRIM3D | (0x0<<18)) #define PRIM3D_TRISTRIP (PRIM3D | (0x1<<18)) #define PRIM3D_TRISTRIP_RVRSE (PRIM3D | (0x2<<18)) #define PRIM3D_TRIFAN (PRIM3D | (0x3<<18)) #define PRIM3D_POLY (PRIM3D | (0x4<<18)) #define PRIM3D_LINELIST (PRIM3D | (0x5<<18)) #define PRIM3D_LINESTRIP (PRIM3D | (0x6<<18)) #define PRIM3D_RECTLIST (PRIM3D | (0x7<<18)) #define PRIM3D_POINTLIST (PRIM3D | (0x8<<18)) #define PRIM3D_DIB (PRIM3D | (0x9<<18)) #define PRIM3D_CLEAR_RECT (PRIM3D | (0xa<<18)) #define PRIM3D_ZONE_INIT (PRIM3D | (0xd<<18)) #define PRIM3D_MASK (0x1f<<18) /* p137 */ #define _3DSTATE_AA_CMD (CMD_3D | (0x06<<24)) #define AA_LINE_ECAAR_WIDTH_ENABLE (1<<16) #define AA_LINE_ECAAR_WIDTH_0_5 0 #define AA_LINE_ECAAR_WIDTH_1_0 (1<<14) #define AA_LINE_ECAAR_WIDTH_2_0 (2<<14) #define AA_LINE_ECAAR_WIDTH_4_0 (3<<14) #define AA_LINE_REGION_WIDTH_ENABLE (1<<8) #define AA_LINE_REGION_WIDTH_0_5 0 #define AA_LINE_REGION_WIDTH_1_0 (1<<6) #define AA_LINE_REGION_WIDTH_2_0 (2<<6) #define AA_LINE_REGION_WIDTH_4_0 (3<<6) /* 3DSTATE_BACKFACE_STENCIL_OPS, p138*/ #define _3DSTATE_BACKFACE_STENCIL_OPS (CMD_3D | (0x8<<24)) #define BFO_ENABLE_STENCIL_REF (1<<23) #define BFO_STENCIL_REF_SHIFT 15 #define BFO_STENCIL_REF_MASK (0xff<<15) #define BFO_ENABLE_STENCIL_FUNCS (1<<14) #define BFO_STENCIL_TEST_SHIFT 11 #define BFO_STENCIL_TEST_MASK (0x7<<11) #define BFO_STENCIL_FAIL_SHIFT 8 #define BFO_STENCIL_FAIL_MASK (0x7<<8) #define BFO_STENCIL_PASS_Z_FAIL_SHIFT 5 #define BFO_STENCIL_PASS_Z_FAIL_MASK (0x7<<5) #define BFO_STENCIL_PASS_Z_PASS_SHIFT 2 #define BFO_STENCIL_PASS_Z_PASS_MASK (0x7<<2) #define BFO_ENABLE_STENCIL_TWO_SIDE (1<<1) #define BFO_STENCIL_TWO_SIDE (1<<0) /* 3DSTATE_BACKFACE_STENCIL_MASKS, p140 */ #define _3DSTATE_BACKFACE_STENCIL_MASKS (CMD_3D | (0x9<<24)) #define BFM_ENABLE_STENCIL_TEST_MASK (1<<17) #define BFM_ENABLE_STENCIL_WRITE_MASK (1<<16) #define BFM_STENCIL_TEST_MASK_SHIFT 8 #define BFM_STENCIL_TEST_MASK_MASK (0xff<<8) #define BFM_STENCIL_WRITE_MASK_SHIFT 0 #define BFM_STENCIL_WRITE_MASK_MASK (0xff<<0) /* 3DSTATE_BIN_CONTROL p141 */ /* p143 */ #define _3DSTATE_BUF_INFO_CMD (CMD_3D | (0x1d<<24) | (0x8e<<16) | 1) /* Dword 1 */ #define BUF_3D_ID_COLOR_BACK (0x3<<24) #define BUF_3D_ID_DEPTH (0x7<<24) #define BUF_3D_USE_FENCE (1<<23) #define BUF_3D_TILED_SURFACE (1<<22) #define BUF_3D_TILE_WALK_X 0 #define BUF_3D_TILE_WALK_Y (1<<21) #define BUF_3D_PITCH(x) (((x)/4)<<2) /* Dword 2 */ #define BUF_3D_ADDR(x) ((x) & ~0x3) /* 3DSTATE_CHROMA_KEY */ /* 3DSTATE_CLEAR_PARAMETERS, p150 */ #define _3DSTATE_CLEAR_PARAMETERS (CMD_3D | (0x1d<<24) | (0x9c<<16) | 5) /* Dword 1 */ #define CLEARPARAM_CLEAR_RECT (1 << 16) #define CLEARPARAM_ZONE_INIT (0 << 16) #define CLEARPARAM_WRITE_COLOR (1 << 2) #define CLEARPARAM_WRITE_DEPTH (1 << 1) #define CLEARPARAM_WRITE_STENCIL (1 << 0) /* 3DSTATE_CONSTANT_BLEND_COLOR, p153 */ #define _3DSTATE_CONST_BLEND_COLOR_CMD (CMD_3D | (0x1d<<24) | (0x88<<16)) /* 3DSTATE_COORD_SET_BINDINGS, p154 */ #define _3DSTATE_COORD_SET_BINDINGS (CMD_3D | (0x16<<24)) #define CSB_TCB(iunit, eunit) ((eunit)<<(iunit*3)) /* p156 */ #define _3DSTATE_DFLT_DIFFUSE_CMD (CMD_3D | (0x1d<<24) | (0x99<<16)) /* p157 */ #define _3DSTATE_DFLT_SPEC_CMD (CMD_3D | (0x1d<<24) | (0x9a<<16)) /* p158 */ #define _3DSTATE_DFLT_Z_CMD (CMD_3D | (0x1d<<24) | (0x98<<16)) /* 3DSTATE_DEPTH_OFFSET_SCALE, p159 */ #define _3DSTATE_DEPTH_OFFSET_SCALE (CMD_3D | (0x1d<<24) | (0x97<<16)) /* scale in dword 1 */ /* The depth subrectangle is not supported, but must be disabled. */ /* 3DSTATE_DEPTH_SUBRECT_DISABLE, p160 */ #define _3DSTATE_DEPTH_SUBRECT_DISABLE (CMD_3D | (0x1c<<24) | (0x11<<19) | (1 << 1) | (0 << 0)) /* p161 */ #define _3DSTATE_DST_BUF_VARS_CMD (CMD_3D | (0x1d<<24) | (0x85<<16)) /* Dword 1 */ #define TEX_DEFAULT_COLOR_OGL (0<<30) #define TEX_DEFAULT_COLOR_D3D (1<<30) #define ZR_EARLY_DEPTH (1<<29) #define LOD_PRECLAMP_OGL (1<<28) #define LOD_PRECLAMP_D3D (0<<28) #define DITHER_FULL_ALWAYS (0<<26) #define DITHER_FULL_ON_FB_BLEND (1<<26) #define DITHER_CLAMPED_ALWAYS (2<<26) #define LINEAR_GAMMA_BLEND_32BPP (1<<25) #define DEBUG_DISABLE_ENH_DITHER (1<<24) #define DSTORG_HORT_BIAS(x) ((x)<<20) #define DSTORG_VERT_BIAS(x) ((x)<<16) #define COLOR_4_2_2_CHNL_WRT_ALL 0 #define COLOR_4_2_2_CHNL_WRT_Y (1<<12) #define COLOR_4_2_2_CHNL_WRT_CR (2<<12) #define COLOR_4_2_2_CHNL_WRT_CB (3<<12) #define COLOR_4_2_2_CHNL_WRT_CRCB (4<<12) #define COLR_BUF_8BIT 0 #define COLR_BUF_RGB555 (1<<8) #define COLR_BUF_RGB565 (2<<8) #define COLR_BUF_ARGB8888 (3<<8) #define COLR_BUF_ARGB4444 (8<<8) #define COLR_BUF_ARGB1555 (9<<8) #define COLR_BUF_ARGB2AAA (0xa<<8) #define DEPTH_FRMT_16_FIXED 0 #define DEPTH_FRMT_16_FLOAT (1<<2) #define DEPTH_FRMT_24_FIXED_8_OTHER (2<<2) #define VERT_LINE_STRIDE_1 (1<<1) #define VERT_LINE_STRIDE_0 (0<<1) #define VERT_LINE_STRIDE_OFS_1 1 #define VERT_LINE_STRIDE_OFS_0 0 /* p166 */ #define _3DSTATE_DRAW_RECT_CMD (CMD_3D|(0x1d<<24)|(0x80<<16)|3) /* Dword 1 */ #define DRAW_RECT_DIS_DEPTH_OFS (1<<30) #define DRAW_DITHER_OFS_X(x) ((x)<<26) #define DRAW_DITHER_OFS_Y(x) ((x)<<24) /* Dword 2 */ #define DRAW_YMIN(x) ((x)<<16) #define DRAW_XMIN(x) (x) /* Dword 3 */ #define DRAW_YMAX(x) ((x)<<16) #define DRAW_XMAX(x) (x) /* Dword 4 */ #define DRAW_YORG(x) ((x)<<16) #define DRAW_XORG(x) (x) /* 3DSTATE_FILTER_COEFFICIENTS_4X4, p170 */ /* 3DSTATE_FILTER_COEFFICIENTS_6X5, p172 */ /* _3DSTATE_FOG_COLOR, p173 */ #define _3DSTATE_FOG_COLOR_CMD (CMD_3D|(0x15<<24)) #define FOG_COLOR_RED(x) ((x)<<16) #define FOG_COLOR_GREEN(x) ((x)<<8) #define FOG_COLOR_BLUE(x) (x) /* _3DSTATE_FOG_MODE, p174 */ #define _3DSTATE_FOG_MODE_CMD (CMD_3D|(0x1d<<24)|(0x89<<16)|2) /* Dword 1 */ #define FMC1_FOGFUNC_MODIFY_ENABLE (1<<31) #define FMC1_FOGFUNC_VERTEX (0<<28) #define FMC1_FOGFUNC_PIXEL_EXP (1<<28) #define FMC1_FOGFUNC_PIXEL_EXP2 (2<<28) #define FMC1_FOGFUNC_PIXEL_LINEAR (3<<28) #define FMC1_FOGFUNC_MASK (3<<28) #define FMC1_FOGINDEX_MODIFY_ENABLE (1<<27) #define FMC1_FOGINDEX_Z (0<<25) #define FMC1_FOGINDEX_W (1<<25) #define FMC1_C1_C2_MODIFY_ENABLE (1<<24) #define FMC1_DENSITY_MODIFY_ENABLE (1<<23) #define FMC1_C1_ONE (1<<13) #define FMC1_C1_MASK (0xffff<<4) /* Dword 2 */ #define FMC2_C2_ONE (1<<16) /* Dword 3 */ #define FMC3_D_ONE (1<<16) /* _3DSTATE_INDEPENDENT_ALPHA_BLEND, p177 */ #define _3DSTATE_INDEPENDENT_ALPHA_BLEND_CMD (CMD_3D|(0x0b<<24)) #define IAB_MODIFY_ENABLE (1<<23) #define IAB_ENABLE (1<<22) #define IAB_MODIFY_FUNC (1<<21) #define IAB_FUNC_SHIFT 16 #define IAB_MODIFY_SRC_FACTOR (1<<11) #define IAB_SRC_FACTOR_SHIFT 6 #define IAB_SRC_FACTOR_MASK (BLENDFACT_MASK<<6) #define IAB_MODIFY_DST_FACTOR (1<<5) #define IAB_DST_FACTOR_SHIFT 0 #define IAB_DST_FACTOR_MASK (BLENDFACT_MASK<<0) #define BLENDFACT_ZERO 0x01 #define BLENDFACT_ONE 0x02 #define BLENDFACT_SRC_COLR 0x03 #define BLENDFACT_INV_SRC_COLR 0x04 #define BLENDFACT_SRC_ALPHA 0x05 #define BLENDFACT_INV_SRC_ALPHA 0x06 #define BLENDFACT_DST_ALPHA 0x07 #define BLENDFACT_INV_DST_ALPHA 0x08 #define BLENDFACT_DST_COLR 0x09 #define BLENDFACT_INV_DST_COLR 0x0a #define BLENDFACT_SRC_ALPHA_SATURATE 0x0b #define BLENDFACT_CONST_COLOR 0x0c #define BLENDFACT_INV_CONST_COLOR 0x0d #define BLENDFACT_CONST_ALPHA 0x0e #define BLENDFACT_INV_CONST_ALPHA 0x0f #define BLENDFACT_MASK 0x0f #define BLENDFUNC_ADD 0x0 #define BLENDFUNC_SUBTRACT 0x1 #define BLENDFUNC_REVERSE_SUBTRACT 0x2 #define BLENDFUNC_MIN 0x3 #define BLENDFUNC_MAX 0x4 #define BLENDFUNC_MASK 0x7 /* 3DSTATE_LOAD_INDIRECT, p180 */ #define _3DSTATE_LOAD_INDIRECT (CMD_3D|(0x1d<<24)|(0x7<<16)) #define LI0_STATE_STATIC_INDIRECT (0x01<<8) #define LI0_STATE_DYNAMIC_INDIRECT (0x02<<8) #define LI0_STATE_SAMPLER (0x04<<8) #define LI0_STATE_MAP (0x08<<8) #define LI0_STATE_PROGRAM (0x10<<8) #define LI0_STATE_CONSTANTS (0x20<<8) #define SIS0_BUFFER_ADDRESS(x) ((x)&~0x3) #define SIS0_FORCE_LOAD (1<<1) #define SIS0_BUFFER_VALID (1<<0) #define SIS1_BUFFER_LENGTH(x) ((x)&0xff) #define DIS0_BUFFER_ADDRESS(x) ((x)&~0x3) #define DIS0_BUFFER_RESET (1<<1) #define DIS0_BUFFER_VALID (1<<0) #define SSB0_BUFFER_ADDRESS(x) ((x)&~0x3) #define SSB0_FORCE_LOAD (1<<1) #define SSB0_BUFFER_VALID (1<<0) #define SSB1_BUFFER_LENGTH(x) ((x)&0xff) #define MSB0_BUFFER_ADDRESS(x) ((x)&~0x3) #define MSB0_FORCE_LOAD (1<<1) #define MSB0_BUFFER_VALID (1<<0) #define MSB1_BUFFER_LENGTH(x) ((x)&0xff) #define PSP0_BUFFER_ADDRESS(x) ((x)&~0x3) #define PSP0_FORCE_LOAD (1<<1) #define PSP0_BUFFER_VALID (1<<0) #define PSP1_BUFFER_LENGTH(x) ((x)&0xff) #define PSC0_BUFFER_ADDRESS(x) ((x)&~0x3) #define PSC0_FORCE_LOAD (1<<1) #define PSC0_BUFFER_VALID (1<<0) #define PSC1_BUFFER_LENGTH(x) ((x)&0xff) /* _3DSTATE_RASTERIZATION_RULES */ #define _3DSTATE_RASTER_RULES_CMD (CMD_3D|(0x07<<24)) #define ENABLE_POINT_RASTER_RULE (1<<15) #define OGL_POINT_RASTER_RULE (1<<13) #define ENABLE_TEXKILL_3D_4D (1<<10) #define TEXKILL_3D (0<<9) #define TEXKILL_4D (1<<9) #define ENABLE_LINE_STRIP_PROVOKE_VRTX (1<<8) #define ENABLE_TRI_FAN_PROVOKE_VRTX (1<<5) #define LINE_STRIP_PROVOKE_VRTX(x) ((x)<<6) #define TRI_FAN_PROVOKE_VRTX(x) ((x)<<3) /* _3DSTATE_SCISSOR_ENABLE, p256 */ #define _3DSTATE_SCISSOR_ENABLE_CMD (CMD_3D|(0x1c<<24)|(0x10<<19)) #define ENABLE_SCISSOR_RECT ((1<<1) | 1) #define DISABLE_SCISSOR_RECT (1<<1) /* _3DSTATE_SCISSOR_RECTANGLE_0, p257 */ #define _3DSTATE_SCISSOR_RECT_0_CMD (CMD_3D|(0x1d<<24)|(0x81<<16)|1) /* Dword 1 */ #define SCISSOR_RECT_0_YMIN(x) ((x)<<16) #define SCISSOR_RECT_0_XMIN(x) (x) /* Dword 2 */ #define SCISSOR_RECT_0_YMAX(x) ((x)<<16) #define SCISSOR_RECT_0_XMAX(x) (x) /* p189 */ #define _3DSTATE_LOAD_STATE_IMMEDIATE_1 ((0x3<<29)|(0x1d<<24)|(0x04<<16)) #define I1_LOAD_S(n) (1<<(4+n)) #define S0_VB_OFFSET_MASK 0xffffffc #define S0_AUTO_CACHE_INV_DISABLE (1<<0) #define S1_VERTEX_WIDTH_SHIFT 24 #define S1_VERTEX_WIDTH_MASK (0x3f<<24) #define S1_VERTEX_PITCH_SHIFT 16 #define S1_VERTEX_PITCH_MASK (0x3f<<16) #define TEXCOORDFMT_2D 0x0 #define TEXCOORDFMT_3D 0x1 #define TEXCOORDFMT_4D 0x2 #define TEXCOORDFMT_1D 0x3 #define TEXCOORDFMT_2D_16 0x4 #define TEXCOORDFMT_4D_16 0x5 #define TEXCOORDFMT_NOT_PRESENT 0xf #define S2_TEXCOORD_FMT0_MASK 0xf #define S2_TEXCOORD_FMT1_SHIFT 4 #define S2_TEXCOORD_FMT(unit, type) ((type)<<(unit*4)) #define S2_TEXCOORD_NONE (~0) #define TEXCOORD_WRAP_SHORTEST_TCX 8 #define TEXCOORD_WRAP_SHORTEST_TCY 4 #define TEXCOORD_WRAP_SHORTEST_TCZ 2 #define TEXCOORD_PERSPECTIVE_DISABLE 1 #define S3_WRAP_SHORTEST_TCX(unit) (TEXCOORD_WRAP_SHORTEST_TCX << ((unit) * 4)) #define S3_WRAP_SHORTEST_TCY(unit) (TEXCOORD_WRAP_SHORTEST_TCY << ((unit) * 4)) #define S3_WRAP_SHORTEST_TCZ(unit) (TEXCOORD_WRAP_SHORTEST_TCZ << ((unit) * 4)) #define S3_PERSPECTIVE_DISABLE(unit) (TEXCOORD_PERSPECTIVE_DISABLE << ((unit) * 4)) /* S3 not interesting */ #define S4_POINT_WIDTH_SHIFT 23 #define S4_POINT_WIDTH_MASK (0x1ff<<23) #define S4_LINE_WIDTH_SHIFT 19 #define S4_LINE_WIDTH_ONE (0x2<<19) #define S4_LINE_WIDTH_MASK (0xf<<19) #define S4_FLATSHADE_ALPHA (1<<18) #define S4_FLATSHADE_FOG (1<<17) #define S4_FLATSHADE_SPECULAR (1<<16) #define S4_FLATSHADE_COLOR (1<<15) #define S4_CULLMODE_BOTH (0<<13) #define S4_CULLMODE_NONE (1<<13) #define S4_CULLMODE_CW (2<<13) #define S4_CULLMODE_CCW (3<<13) #define S4_CULLMODE_MASK (3<<13) #define S4_VFMT_POINT_WIDTH (1<<12) #define S4_VFMT_SPEC_FOG (1<<11) #define S4_VFMT_COLOR (1<<10) #define S4_VFMT_DEPTH_OFFSET (1<<9) #define S4_VFMT_XYZ (1<<6) #define S4_VFMT_XYZW (2<<6) #define S4_VFMT_XY (3<<6) #define S4_VFMT_XYW (4<<6) #define S4_VFMT_XYZW_MASK (7<<6) #define S4_FORCE_DEFAULT_DIFFUSE (1<<5) #define S4_FORCE_DEFAULT_SPECULAR (1<<4) #define S4_LOCAL_DEPTH_OFFSET_ENABLE (1<<3) #define S4_VFMT_FOG_PARAM (1<<2) #define S4_SPRITE_POINT_ENABLE (1<<1) #define S4_LINE_ANTIALIAS_ENABLE (1<<0) #define S4_VFMT_MASK (S4_VFMT_POINT_WIDTH | \ S4_VFMT_SPEC_FOG | \ S4_VFMT_COLOR | \ S4_VFMT_DEPTH_OFFSET | \ S4_VFMT_XYZW_MASK | \ S4_VFMT_FOG_PARAM) #define S5_WRITEDISABLE_ALPHA (1<<31) #define S5_WRITEDISABLE_RED (1<<30) #define S5_WRITEDISABLE_GREEN (1<<29) #define S5_WRITEDISABLE_BLUE (1<<28) #define S5_WRITEDISABLE_MASK (0xf<<28) #define S5_FORCE_DEFAULT_POINT_SIZE (1<<27) #define S5_LAST_PIXEL_ENABLE (1<<26) #define S5_GLOBAL_DEPTH_OFFSET_ENABLE (1<<25) #define S5_FOG_ENABLE (1<<24) #define S5_STENCIL_REF_SHIFT 16 #define S5_STENCIL_REF_MASK (0xff<<16) #define S5_STENCIL_TEST_FUNC_SHIFT 13 #define S5_STENCIL_TEST_FUNC_MASK (0x7<<13) #define S5_STENCIL_FAIL_SHIFT 10 #define S5_STENCIL_FAIL_MASK (0x7<<10) #define S5_STENCIL_PASS_Z_FAIL_SHIFT 7 #define S5_STENCIL_PASS_Z_FAIL_MASK (0x7<<7) #define S5_STENCIL_PASS_Z_PASS_SHIFT 4 #define S5_STENCIL_PASS_Z_PASS_MASK (0x7<<4) #define S5_STENCIL_WRITE_ENABLE (1<<3) #define S5_STENCIL_TEST_ENABLE (1<<2) #define S5_COLOR_DITHER_ENABLE (1<<1) #define S5_LOGICOP_ENABLE (1<<0) #define S6_ALPHA_TEST_ENABLE (1<<31) #define S6_ALPHA_TEST_FUNC_SHIFT 28 #define S6_ALPHA_TEST_FUNC_MASK (0x7<<28) #define S6_ALPHA_REF_SHIFT 20 #define S6_ALPHA_REF_MASK (0xff<<20) #define S6_DEPTH_TEST_ENABLE (1<<19) #define S6_DEPTH_TEST_FUNC_SHIFT 16 #define S6_DEPTH_TEST_FUNC_MASK (0x7<<16) #define S6_CBUF_BLEND_ENABLE (1<<15) #define S6_CBUF_BLEND_FUNC_SHIFT 12 #define S6_CBUF_BLEND_FUNC_MASK (0x7<<12) #define S6_CBUF_SRC_BLEND_FACT_SHIFT 8 #define S6_CBUF_SRC_BLEND_FACT_MASK (0xf<<8) #define S6_CBUF_DST_BLEND_FACT_SHIFT 4 #define S6_CBUF_DST_BLEND_FACT_MASK (0xf<<4) #define S6_DEPTH_WRITE_ENABLE (1<<3) #define S6_COLOR_WRITE_ENABLE (1<<2) #define S6_TRISTRIP_PV_SHIFT 0 #define S6_TRISTRIP_PV_MASK (0x3<<0) #define S7_DEPTH_OFFSET_CONST_MASK ~0 /* 3DSTATE_MAP_DEINTERLACER_PARAMETERS */ /* 3DSTATE_MAP_PALETTE_LOAD_32, p206 */ /* _3DSTATE_MODES_4, p218 */ #define _3DSTATE_MODES_4_CMD (CMD_3D|(0x0d<<24)) #define ENABLE_LOGIC_OP_FUNC (1<<23) #define LOGIC_OP_FUNC(x) ((x)<<18) #define LOGICOP_MASK (0xf<<18) #define LOGICOP_COPY 0xc #define MODE4_ENABLE_STENCIL_TEST_MASK ((1<<17)|(0xff00)) #define ENABLE_STENCIL_TEST_MASK (1<<17) #define STENCIL_TEST_MASK(x) ((x)<<8) #define MODE4_ENABLE_STENCIL_WRITE_MASK ((1<<16)|(0x00ff)) #define ENABLE_STENCIL_WRITE_MASK (1<<16) #define STENCIL_WRITE_MASK(x) ((x)&0xff) /* _3DSTATE_MODES_5, p220 */ #define _3DSTATE_MODES_5_CMD (CMD_3D|(0x0c<<24)) #define PIPELINE_FLUSH_RENDER_CACHE (1<<18) #define PIPELINE_FLUSH_TEXTURE_CACHE (1<<16) /* p221 */ #define _3DSTATE_PIXEL_SHADER_CONSTANTS (CMD_3D|(0x1d<<24)|(0x6<<16)) #define PS1_REG(n) (1<<(n)) #define PS2_CONST_X(n) (n) #define PS3_CONST_Y(n) (n) #define PS4_CONST_Z(n) (n) #define PS5_CONST_W(n) (n) /* p222 */ #define I915_MAX_TEX_INDIRECT 4 #define I915_MAX_TEX_INSN 32 #define I915_MAX_ALU_INSN 64 #define I915_MAX_DECL_INSN 27 #define I915_MAX_TEMPORARY 16 /* Each instruction is 3 dwords long, though most don't require all * this space. Maximum of 123 instructions. Smaller maxes per insn * type. */ #define _3DSTATE_PIXEL_SHADER_PROGRAM (CMD_3D|(0x1d<<24)|(0x5<<16)) #define REG_TYPE_R 0 /* temporary regs, no need to * dcl, must be written before * read -- Preserved between * phases. */ #define REG_TYPE_T 1 /* Interpolated values, must be * dcl'ed before use. * * 0..7: texture coord, * 8: diffuse spec, * 9: specular color, * 10: fog parameter in w. */ #define REG_TYPE_CONST 2 /* Restriction: only one const * can be referenced per * instruction, though it may be * selected for multiple inputs. * Constants not initialized * default to zero. */ #define REG_TYPE_S 3 /* sampler */ #define REG_TYPE_OC 4 /* output color (rgba) */ #define REG_TYPE_OD 5 /* output depth (w), xyz are * temporaries. If not written, * interpolated depth is used? */ #define REG_TYPE_U 6 /* unpreserved temporaries */ #define REG_TYPE_MASK 0x7 #define REG_NR_MASK 0xf /* REG_TYPE_T: */ #define T_TEX0 0 #define T_TEX1 1 #define T_TEX2 2 #define T_TEX3 3 #define T_TEX4 4 #define T_TEX5 5 #define T_TEX6 6 #define T_TEX7 7 #define T_DIFFUSE 8 #define T_SPECULAR 9 #define T_FOG_W 10 /* interpolated fog is in W coord */ /* Arithmetic instructions */ /* .replicate_swizzle == selection and replication of a particular * scalar channel, ie., .xxxx, .yyyy, .zzzz or .wwww */ #define A0_NOP (0x0<<24) /* no operation */ #define A0_ADD (0x1<<24) /* dst = src0 + src1 */ #define A0_MOV (0x2<<24) /* dst = src0 */ #define A0_MUL (0x3<<24) /* dst = src0 * src1 */ #define A0_MAD (0x4<<24) /* dst = src0 * src1 + src2 */ #define A0_DP2ADD (0x5<<24) /* dst.xyzw = src0.xy dot src1.xy + src2.replicate_swizzle */ #define A0_DP3 (0x6<<24) /* dst.xyzw = src0.xyz dot src1.xyz */ #define A0_DP4 (0x7<<24) /* dst.xyzw = src0.xyzw dot src1.xyzw */ #define A0_FRC (0x8<<24) /* dst = src0 - floor(src0) */ #define A0_RCP (0x9<<24) /* dst.xyzw = 1/(src0.replicate_swizzle) */ #define A0_RSQ (0xa<<24) /* dst.xyzw = 1/(sqrt(abs(src0.replicate_swizzle))) */ #define A0_EXP (0xb<<24) /* dst.xyzw = exp2(src0.replicate_swizzle) */ #define A0_LOG (0xc<<24) /* dst.xyzw = log2(abs(src0.replicate_swizzle)) */ #define A0_CMP (0xd<<24) /* dst = (src0 >= 0.0) ? src1 : src2 */ #define A0_MIN (0xe<<24) /* dst = (src0 < src1) ? src0 : src1 */ #define A0_MAX (0xf<<24) /* dst = (src0 >= src1) ? src0 : src1 */ #define A0_FLR (0x10<<24) /* dst = floor(src0) */ #define A0_MOD (0x11<<24) /* dst = src0 fmod 1.0 */ #define A0_TRC (0x12<<24) /* dst = int(src0) */ #define A0_SGE (0x13<<24) /* dst = src0 >= src1 ? 1.0 : 0.0 */ #define A0_SLT (0x14<<24) /* dst = src0 < src1 ? 1.0 : 0.0 */ #define A0_DEST_SATURATE (1<<22) #define A0_DEST_TYPE_SHIFT 19 /* Allow: R, OC, OD, U */ #define A0_DEST_NR_SHIFT 14 /* Allow R: 0..15, OC,OD: 0..0, U: 0..2 */ #define A0_DEST_CHANNEL_X (1<<10) #define A0_DEST_CHANNEL_Y (2<<10) #define A0_DEST_CHANNEL_Z (4<<10) #define A0_DEST_CHANNEL_W (8<<10) #define A0_DEST_CHANNEL_ALL (0xf<<10) #define A0_DEST_CHANNEL_SHIFT 10 #define A0_SRC0_TYPE_SHIFT 7 #define A0_SRC0_NR_SHIFT 2 #define A0_DEST_CHANNEL_XY (A0_DEST_CHANNEL_X|A0_DEST_CHANNEL_Y) #define A0_DEST_CHANNEL_XYZ (A0_DEST_CHANNEL_XY|A0_DEST_CHANNEL_Z) #define SRC_X 0 #define SRC_Y 1 #define SRC_Z 2 #define SRC_W 3 #define SRC_ZERO 4 #define SRC_ONE 5 #define A1_SRC0_CHANNEL_X_NEGATE (1<<31) #define A1_SRC0_CHANNEL_X_SHIFT 28 #define A1_SRC0_CHANNEL_Y_NEGATE (1<<27) #define A1_SRC0_CHANNEL_Y_SHIFT 24 #define A1_SRC0_CHANNEL_Z_NEGATE (1<<23) #define A1_SRC0_CHANNEL_Z_SHIFT 20 #define A1_SRC0_CHANNEL_W_NEGATE (1<<19) #define A1_SRC0_CHANNEL_W_SHIFT 16 #define A1_SRC1_TYPE_SHIFT 13 #define A1_SRC1_NR_SHIFT 8 #define A1_SRC1_CHANNEL_X_NEGATE (1<<7) #define A1_SRC1_CHANNEL_X_SHIFT 4 #define A1_SRC1_CHANNEL_Y_NEGATE (1<<3) #define A1_SRC1_CHANNEL_Y_SHIFT 0 #define A2_SRC1_CHANNEL_Z_NEGATE (1<<31) #define A2_SRC1_CHANNEL_Z_SHIFT 28 #define A2_SRC1_CHANNEL_W_NEGATE (1<<27) #define A2_SRC1_CHANNEL_W_SHIFT 24 #define A2_SRC2_TYPE_SHIFT 21 #define A2_SRC2_NR_SHIFT 16 #define A2_SRC2_CHANNEL_X_NEGATE (1<<15) #define A2_SRC2_CHANNEL_X_SHIFT 12 #define A2_SRC2_CHANNEL_Y_NEGATE (1<<11) #define A2_SRC2_CHANNEL_Y_SHIFT 8 #define A2_SRC2_CHANNEL_Z_NEGATE (1<<7) #define A2_SRC2_CHANNEL_Z_SHIFT 4 #define A2_SRC2_CHANNEL_W_NEGATE (1<<3) #define A2_SRC2_CHANNEL_W_SHIFT 0 /* Texture instructions */ #define T0_TEXLD (0x15<<24) /* Sample texture using predeclared * sampler and address, and output * filtered texel data to destination * register */ #define T0_TEXLDP (0x16<<24) /* Same as texld but performs a * perspective divide of the texture * coordinate .xyz values by .w before * sampling. */ #define T0_TEXLDB (0x17<<24) /* Same as texld but biases the * computed LOD by w. Only S4.6 two's * comp is used. This implies that a * float to fixed conversion is * done. */ #define T0_TEXKILL (0x18<<24) /* Does not perform a sampling * operation. Simply kills the pixel * if any channel of the address * register is < 0.0. */ #define T0_DEST_TYPE_SHIFT 19 /* Allow: R, OC, OD, U */ /* Note: U (unpreserved) regs do not retain their values between * phases (cannot be used for feedback) * * Note: oC and OD registers can only be used as the destination of a * texture instruction once per phase (this is an implementation * restriction). */ #define T0_DEST_NR_SHIFT 14 /* Allow R: 0..15, OC,OD: 0..0, U: 0..2 */ #define T0_SAMPLER_NR_SHIFT 0 /* This field ignored for TEXKILL */ #define T0_SAMPLER_NR_MASK (0xf<<0) #define T1_ADDRESS_REG_TYPE_SHIFT 24 /* Reg to use as texture coord */ /* Allow R, T, OC, OD -- R, OC, OD are 'dependent' reads, new program phase */ #define T1_ADDRESS_REG_NR_SHIFT 17 #define T2_MBZ 0 /* Declaration instructions */ #define D0_DCL (0x19<<24) /* Declare a t (interpolated attrib) * register or an s (sampler) * register. */ #define D0_SAMPLE_TYPE_SHIFT 22 #define D0_SAMPLE_TYPE_2D (0x0<<22) #define D0_SAMPLE_TYPE_CUBE (0x1<<22) #define D0_SAMPLE_TYPE_VOLUME (0x2<<22) #define D0_SAMPLE_TYPE_MASK (0x3<<22) #define D0_TYPE_SHIFT 19 /* Allow: T, S */ #define D0_NR_SHIFT 14 /* Allow T: 0..10, S: 0..15 */ #define D0_CHANNEL_X (1<<10) #define D0_CHANNEL_Y (2<<10) #define D0_CHANNEL_Z (4<<10) #define D0_CHANNEL_W (8<<10) #define D0_CHANNEL_ALL (0xf<<10) #define D0_CHANNEL_NONE (0<<10) #define D0_CHANNEL_XY (D0_CHANNEL_X|D0_CHANNEL_Y) #define D0_CHANNEL_XYZ (D0_CHANNEL_XY|D0_CHANNEL_Z) /* I915 Errata: Do not allow (xz), (xw), (xzw) combinations for diffuse * or specular declarations. * * For T dcls, only allow: (x), (xy), (xyz), (w), (xyzw) * * Must be zero for S (sampler) dcls */ #define D1_MBZ 0 #define D2_MBZ 0 /* p207. * The DWORD count is 3 times the number of bits set in MS1_MAPMASK_MASK */ #define _3DSTATE_MAP_STATE (CMD_3D|(0x1d<<24)|(0x0<<16)) #define MS1_MAPMASK_SHIFT 0 #define MS1_MAPMASK_MASK (0x8fff<<0) #define MS2_UNTRUSTED_SURFACE (1<<31) #define MS2_ADDRESS_MASK 0xfffffffc #define MS2_VERTICAL_LINE_STRIDE (1<<1) #define MS2_VERTICAL_OFFSET (1<<1) #define MS3_HEIGHT_SHIFT 21 #define MS3_WIDTH_SHIFT 10 #define MS3_PALETTE_SELECT (1<<9) #define MS3_MAPSURF_FORMAT_SHIFT 7 #define MS3_MAPSURF_FORMAT_MASK (0x7<<7) #define MAPSURF_8BIT (1<<7) #define MAPSURF_16BIT (2<<7) #define MAPSURF_32BIT (3<<7) #define MAPSURF_422 (5<<7) #define MAPSURF_COMPRESSED (6<<7) #define MAPSURF_4BIT_INDEXED (7<<7) #define MS3_MT_FORMAT_MASK (0x7 << 3) #define MS3_MT_FORMAT_SHIFT 3 #define MT_4BIT_IDX_ARGB8888 (7<<3) /* SURFACE_4BIT_INDEXED */ #define MT_8BIT_I8 (0<<3) /* SURFACE_8BIT */ #define MT_8BIT_L8 (1<<3) #define MT_8BIT_A8 (4<<3) #define MT_8BIT_MONO8 (5<<3) #define MT_16BIT_RGB565 (0<<3) /* SURFACE_16BIT */ #define MT_16BIT_ARGB1555 (1<<3) #define MT_16BIT_ARGB4444 (2<<3) #define MT_16BIT_AY88 (3<<3) #define MT_16BIT_88DVDU (5<<3) #define MT_16BIT_BUMP_655LDVDU (6<<3) #define MT_16BIT_I16 (7<<3) #define MT_16BIT_L16 (8<<3) #define MT_16BIT_A16 (9<<3) #define MT_32BIT_ARGB8888 (0<<3) /* SURFACE_32BIT */ #define MT_32BIT_ABGR8888 (1<<3) #define MT_32BIT_XRGB8888 (2<<3) #define MT_32BIT_XBGR8888 (3<<3) #define MT_32BIT_QWVU8888 (4<<3) #define MT_32BIT_AXVU8888 (5<<3) #define MT_32BIT_LXVU8888 (6<<3) #define MT_32BIT_XLVU8888 (7<<3) #define MT_32BIT_ARGB2101010 (8<<3) #define MT_32BIT_ABGR2101010 (9<<3) #define MT_32BIT_AWVU2101010 (0xA<<3) #define MT_32BIT_GR1616 (0xB<<3) #define MT_32BIT_VU1616 (0xC<<3) #define MT_32BIT_xI824 (0xD<<3) #define MT_32BIT_xA824 (0xE<<3) #define MT_32BIT_xL824 (0xF<<3) #define MT_422_YCRCB_SWAPY (0<<3) /* SURFACE_422 */ #define MT_422_YCRCB_NORMAL (1<<3) #define MT_422_YCRCB_SWAPUV (2<<3) #define MT_422_YCRCB_SWAPUVY (3<<3) #define MT_COMPRESS_DXT1 (0<<3) /* SURFACE_COMPRESSED */ #define MT_COMPRESS_DXT2_3 (1<<3) #define MT_COMPRESS_DXT4_5 (2<<3) #define MT_COMPRESS_FXT1 (3<<3) #define MT_COMPRESS_DXT1_RGB (4<<3) #define MS3_USE_FENCE_REGS (1<<2) #define MS3_TILED_SURFACE (1<<1) #define MS3_TILE_WALK (1<<0) /* The pitch is the pitch measured in DWORDS, minus 1 */ #define MS4_PITCH_SHIFT 21 #define MS4_CUBE_FACE_ENA_NEGX (1<<20) #define MS4_CUBE_FACE_ENA_POSX (1<<19) #define MS4_CUBE_FACE_ENA_NEGY (1<<18) #define MS4_CUBE_FACE_ENA_POSY (1<<17) #define MS4_CUBE_FACE_ENA_NEGZ (1<<16) #define MS4_CUBE_FACE_ENA_POSZ (1<<15) #define MS4_CUBE_FACE_ENA_MASK (0x3f<<15) #define MS4_MAX_LOD_SHIFT 9 #define MS4_MAX_LOD_MASK (0x3f<<9) #define MS4_MIP_LAYOUT_LEGACY (0<<8) #define MS4_MIP_LAYOUT_BELOW_LPT (0<<8) #define MS4_MIP_LAYOUT_RIGHT_LPT (1<<8) #define MS4_VOLUME_DEPTH_SHIFT 0 #define MS4_VOLUME_DEPTH_MASK (0xff<<0) /* p244. * The DWORD count is 3 times the number of bits set in SS1_MAPMASK_MASK. */ #define _3DSTATE_SAMPLER_STATE (CMD_3D|(0x1d<<24)|(0x1<<16)) #define SS1_MAPMASK_SHIFT 0 #define SS1_MAPMASK_MASK (0x8fff<<0) #define SS2_REVERSE_GAMMA_ENABLE (1<<31) #define SS2_PACKED_TO_PLANAR_ENABLE (1<<30) #define SS2_COLORSPACE_CONVERSION (1<<29) #define SS2_CHROMAKEY_SHIFT 27 #define SS2_BASE_MIP_LEVEL_SHIFT 22 #define SS2_BASE_MIP_LEVEL_MASK (0x1f<<22) #define SS2_MIP_FILTER_SHIFT 20 #define SS2_MIP_FILTER_MASK (0x3<<20) #define MIPFILTER_NONE 0 #define MIPFILTER_NEAREST 1 #define MIPFILTER_LINEAR 3 #define SS2_MAG_FILTER_SHIFT 17 #define SS2_MAG_FILTER_MASK (0x7<<17) #define FILTER_NEAREST 0 #define FILTER_LINEAR 1 #define FILTER_ANISOTROPIC 2 #define FILTER_4X4_1 3 #define FILTER_4X4_2 4 #define FILTER_4X4_FLAT 5 #define FILTER_6X5_MONO 6 /* XXX - check */ #define SS2_MIN_FILTER_SHIFT 14 #define SS2_MIN_FILTER_MASK (0x7<<14) #define SS2_LOD_BIAS_SHIFT 5 #define SS2_LOD_BIAS_ONE (0x10<<5) #define SS2_LOD_BIAS_MASK (0x1ff<<5) /* Shadow requires: * MT_X8{I,L,A}24 or MT_{I,L,A}16 texture format * FILTER_4X4_x MIN and MAG filters */ #define SS2_SHADOW_ENABLE (1<<4) #define SS2_MAX_ANISO_MASK (1<<3) #define SS2_MAX_ANISO_2 (0<<3) #define SS2_MAX_ANISO_4 (1<<3) #define SS2_SHADOW_FUNC_SHIFT 0 #define SS2_SHADOW_FUNC_MASK (0x7<<0) /* SS2_SHADOW_FUNC values: see COMPAREFUNC_* */ #define SS3_MIN_LOD_SHIFT 24 #define SS3_MIN_LOD_ONE (0x10<<24) #define SS3_MIN_LOD_MASK (0xff<<24) #define SS3_KILL_PIXEL_ENABLE (1<<17) #define SS3_TCX_ADDR_MODE_SHIFT 12 #define SS3_TCX_ADDR_MODE_MASK (0x7<<12) #define TEXCOORDMODE_WRAP 0 #define TEXCOORDMODE_MIRROR 1 #define TEXCOORDMODE_CLAMP_EDGE 2 #define TEXCOORDMODE_CUBE 3 #define TEXCOORDMODE_CLAMP_BORDER 4 #define TEXCOORDMODE_MIRROR_ONCE 5 #define SS3_TCY_ADDR_MODE_SHIFT 9 #define SS3_TCY_ADDR_MODE_MASK (0x7<<9) #define SS3_TCZ_ADDR_MODE_SHIFT 6 #define SS3_TCZ_ADDR_MODE_MASK (0x7<<6) #define SS3_NORMALIZED_COORDS (1<<5) #define SS3_TEXTUREMAP_INDEX_SHIFT 1 #define SS3_TEXTUREMAP_INDEX_MASK (0xf<<1) #define SS3_DEINTERLACER_ENABLE (1<<0) #define SS4_BORDER_COLOR_MASK (~0) /* 3DSTATE_SPAN_STIPPLE, p258 */ #define _3DSTATE_STIPPLE ((0x3<<29)|(0x1d<<24)|(0x83<<16)) #define ST1_ENABLE (1<<16) #define ST1_MASK (0xffff) #define FLUSH_MAP_CACHE (1<<0) #define FLUSH_RENDER_CACHE (1<<1) #endif intel-gpu-tools-1.3/lib/instdone.c0000664000175100017510000003422511721136153014107 00000000000000/* * Copyright © 2007,2009 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * * Authors: * Eric Anholt * */ #include #include "instdone.h" #include "intel_chipset.h" #include "intel_reg.h" struct instdone_bit instdone_bits[MAX_INSTDONE_BITS]; int num_instdone_bits = 0; static void add_instdone_bit(uint32_t reg, uint32_t bit, const char *name) { instdone_bits[num_instdone_bits].reg = reg; instdone_bits[num_instdone_bits].bit = bit; instdone_bits[num_instdone_bits].name = name; num_instdone_bits++; } static void gen3_instdone_bit(uint32_t bit, const char *name) { add_instdone_bit(INST_DONE, bit, name); } static void gen4_instdone_bit(uint32_t bit, const char *name) { add_instdone_bit(INST_DONE_I965, bit, name); } static void gen4_instdone1_bit(uint32_t bit, const char *name) { add_instdone_bit(INST_DONE_1, bit, name); } static void gen6_instdone1_bit(uint32_t bit, const char *name) { add_instdone_bit(GEN6_INSTDONE_1, bit, name); } static void gen6_instdone2_bit(uint32_t bit, const char *name) { add_instdone_bit(GEN6_INSTDONE_2, bit, name); } static void init_g965_instdone1(void) { gen4_instdone1_bit(I965_GW_CS_DONE_CR, "GW CS CR"); gen4_instdone1_bit(I965_SVSM_CS_DONE_CR, "SVSM CS CR"); gen4_instdone1_bit(I965_SVDW_CS_DONE_CR, "SVDW CS CR"); gen4_instdone1_bit(I965_SVDR_CS_DONE_CR, "SVDR CS CR"); gen4_instdone1_bit(I965_SVRW_CS_DONE_CR, "SVRW CS CR"); gen4_instdone1_bit(I965_SVRR_CS_DONE_CR, "SVRR CS CR"); gen4_instdone1_bit(I965_SVTW_CS_DONE_CR, "SVTW CS CR"); gen4_instdone1_bit(I965_MASM_CS_DONE_CR, "MASM CS CR"); gen4_instdone1_bit(I965_MASF_CS_DONE_CR, "MASF CS CR"); gen4_instdone1_bit(I965_MAW_CS_DONE_CR, "MAW CS CR"); gen4_instdone1_bit(I965_EM1_CS_DONE_CR, "EM1 CS CR"); gen4_instdone1_bit(I965_EM0_CS_DONE_CR, "EM0 CS CR"); gen4_instdone1_bit(I965_UC1_CS_DONE, "UC1 CS"); gen4_instdone1_bit(I965_UC0_CS_DONE, "UC0 CS"); gen4_instdone1_bit(I965_URB_CS_DONE, "URB CS"); gen4_instdone1_bit(I965_ISC_CS_DONE, "ISC CS"); gen4_instdone1_bit(I965_CL_CS_DONE, "CL CS"); gen4_instdone1_bit(I965_GS_CS_DONE, "GS CS"); gen4_instdone1_bit(I965_VS0_CS_DONE, "VS0 CS"); gen4_instdone1_bit(I965_VF_CS_DONE, "VF CS"); } static void init_g4x_instdone1(void) { gen4_instdone1_bit(G4X_BCS_DONE, "BCS"); gen4_instdone1_bit(G4X_CS_DONE, "CS"); gen4_instdone1_bit(G4X_MASF_DONE, "MASF"); gen4_instdone1_bit(G4X_SVDW_DONE, "SVDW"); gen4_instdone1_bit(G4X_SVDR_DONE, "SVDR"); gen4_instdone1_bit(G4X_SVRW_DONE, "SVRW"); gen4_instdone1_bit(G4X_SVRR_DONE, "SVRR"); gen4_instdone1_bit(G4X_ISC_DONE, "ISC"); gen4_instdone1_bit(G4X_MT_DONE, "MT"); gen4_instdone1_bit(G4X_RC_DONE, "RC"); gen4_instdone1_bit(G4X_DAP_DONE, "DAP"); gen4_instdone1_bit(G4X_MAWB_DONE, "MAWB"); gen4_instdone1_bit(G4X_MT_IDLE, "MT idle"); //gen4_instdone1_bit(G4X_GBLT_BUSY, "GBLT"); gen4_instdone1_bit(G4X_SVSM_DONE, "SVSM"); gen4_instdone1_bit(G4X_MASM_DONE, "MASM"); gen4_instdone1_bit(G4X_QC_DONE, "QC"); gen4_instdone1_bit(G4X_FL_DONE, "FL"); gen4_instdone1_bit(G4X_SC_DONE, "SC"); gen4_instdone1_bit(G4X_DM_DONE, "DM"); gen4_instdone1_bit(G4X_FT_DONE, "FT"); gen4_instdone1_bit(G4X_DG_DONE, "DG"); gen4_instdone1_bit(G4X_SI_DONE, "SI"); gen4_instdone1_bit(G4X_SO_DONE, "SO"); gen4_instdone1_bit(G4X_PL_DONE, "PL"); gen4_instdone1_bit(G4X_WIZ_DONE, "WIZ"); gen4_instdone1_bit(G4X_URB_DONE, "URB"); gen4_instdone1_bit(G4X_SF_DONE, "SF"); gen4_instdone1_bit(G4X_CL_DONE, "CL"); gen4_instdone1_bit(G4X_GS_DONE, "GS"); gen4_instdone1_bit(G4X_VS0_DONE, "VS0"); gen4_instdone1_bit(G4X_VF_DONE, "VF"); } static void init_gen7_instdone(void) { gen6_instdone1_bit(1 << 19, "GAM"); gen6_instdone1_bit(1 << 18, "GAFM"); gen6_instdone1_bit(1 << 17, "TSG"); gen6_instdone1_bit(1 << 16, "VFE"); gen6_instdone1_bit(1 << 15, "GAFS"); gen6_instdone1_bit(1 << 14, "SVG"); gen6_instdone1_bit(1 << 13, "URBM"); gen6_instdone1_bit(1 << 12, "TDG"); gen6_instdone1_bit(1 << 9, "SF"); gen6_instdone1_bit(1 << 8, "CL"); gen6_instdone1_bit(1 << 7, "SOL"); gen6_instdone1_bit(1 << 6, "GS"); gen6_instdone1_bit(1 << 5, "DS"); gen6_instdone1_bit(1 << 4, "TE"); gen6_instdone1_bit(1 << 3, "HS"); gen6_instdone1_bit(1 << 2, "VS"); gen6_instdone1_bit(1 << 1, "VF"); } void init_instdone_definitions(uint32_t devid) { if (IS_GEN7(devid)) { init_gen7_instdone(); } else if (IS_GEN6(devid)) { /* Now called INSTDONE_1 in the docs. */ gen6_instdone1_bit(GEN6_MA_3_DONE, "Message Arbiter 3"); gen6_instdone1_bit(GEN6_EU_32_DONE, "EU 32"); gen6_instdone1_bit(GEN6_EU_31_DONE, "EU 31"); gen6_instdone1_bit(GEN6_EU_30_DONE, "EU 30"); gen6_instdone1_bit(GEN6_MA_3_DONE, "Message Arbiter 2"); gen6_instdone1_bit(GEN6_EU_22_DONE, "EU 22"); gen6_instdone1_bit(GEN6_EU_21_DONE, "EU 21"); gen6_instdone1_bit(GEN6_EU_20_DONE, "EU 20"); gen6_instdone1_bit(GEN6_MA_3_DONE, "Message Arbiter 1"); gen6_instdone1_bit(GEN6_EU_12_DONE, "EU 12"); gen6_instdone1_bit(GEN6_EU_11_DONE, "EU 11"); gen6_instdone1_bit(GEN6_EU_10_DONE, "EU 10"); gen6_instdone1_bit(GEN6_MA_3_DONE, "Message Arbiter 0"); gen6_instdone1_bit(GEN6_EU_02_DONE, "EU 02"); gen6_instdone1_bit(GEN6_EU_01_DONE, "EU 01"); gen6_instdone1_bit(GEN6_EU_00_DONE, "EU 00"); gen6_instdone1_bit(GEN6_IC_3_DONE, "IC 3"); gen6_instdone1_bit(GEN6_IC_2_DONE, "IC 2"); gen6_instdone1_bit(GEN6_IC_1_DONE, "IC 1"); gen6_instdone1_bit(GEN6_IC_0_DONE, "IC 0"); gen6_instdone1_bit(GEN6_ISC_10_DONE, "ISC 1/0"); gen6_instdone1_bit(GEN6_ISC_32_DONE, "ISC 3/2"); gen6_instdone1_bit(GEN6_VSC_DONE, "VSC"); gen6_instdone1_bit(GEN6_IEF_DONE, "IEF"); gen6_instdone1_bit(GEN6_VFE_DONE, "VFE"); gen6_instdone1_bit(GEN6_TD_DONE, "TD"); gen6_instdone1_bit(GEN6_TS_DONE, "TS"); gen6_instdone1_bit(GEN6_GW_DONE, "GW"); gen6_instdone1_bit(GEN6_HIZ_DONE, "HIZ"); gen6_instdone1_bit(GEN6_AVS_DONE, "AVS"); /* Now called INSTDONE_2 in the docs. */ gen6_instdone2_bit(GEN6_GAM_DONE, "GAM"); gen6_instdone2_bit(GEN6_CS_DONE, "CS"); gen6_instdone2_bit(GEN6_WMBE_DONE, "WMBE"); gen6_instdone2_bit(GEN6_SVRW_DONE, "SVRW"); gen6_instdone2_bit(GEN6_RCC_DONE, "RCC"); gen6_instdone2_bit(GEN6_SVG_DONE, "SVG"); gen6_instdone2_bit(GEN6_ISC_DONE, "ISC"); gen6_instdone2_bit(GEN6_MT_DONE, "MT"); gen6_instdone2_bit(GEN6_RCPFE_DONE, "RCPFE"); gen6_instdone2_bit(GEN6_RCPBE_DONE, "RCPBE"); gen6_instdone2_bit(GEN6_VDI_DONE, "VDI"); gen6_instdone2_bit(GEN6_RCZ_DONE, "RCZ"); gen6_instdone2_bit(GEN6_DAP_DONE, "DAP"); gen6_instdone2_bit(GEN6_PSD_DONE, "PSD"); gen6_instdone2_bit(GEN6_IZ_DONE, "IZ"); gen6_instdone2_bit(GEN6_WMFE_DONE, "WMFE"); gen6_instdone2_bit(GEN6_SVSM_DONE, "SVSM"); gen6_instdone2_bit(GEN6_QC_DONE, "QC"); gen6_instdone2_bit(GEN6_FL_DONE, "FL"); gen6_instdone2_bit(GEN6_SC_DONE, "SC"); gen6_instdone2_bit(GEN6_DM_DONE, "DM"); gen6_instdone2_bit(GEN6_FT_DONE, "FT"); gen6_instdone2_bit(GEN6_DG_DONE, "DG"); gen6_instdone2_bit(GEN6_SI_DONE, "SI"); gen6_instdone2_bit(GEN6_SO_DONE, "SO"); gen6_instdone2_bit(GEN6_PL_DONE, "PL"); gen6_instdone2_bit(GEN6_VME_DONE, "VME"); gen6_instdone2_bit(GEN6_SF_DONE, "SF"); gen6_instdone2_bit(GEN6_CL_DONE, "CL"); gen6_instdone2_bit(GEN6_GS_DONE, "GS"); gen6_instdone2_bit(GEN6_VS0_DONE, "VS0"); gen6_instdone2_bit(GEN6_VF_DONE, "VF"); } else if (IS_GEN5(devid)) { gen4_instdone_bit(ILK_ROW_0_EU_0_DONE, "Row 0, EU 0"); gen4_instdone_bit(ILK_ROW_0_EU_1_DONE, "Row 0, EU 1"); gen4_instdone_bit(ILK_ROW_0_EU_2_DONE, "Row 0, EU 2"); gen4_instdone_bit(ILK_ROW_0_EU_3_DONE, "Row 0, EU 3"); gen4_instdone_bit(ILK_ROW_1_EU_0_DONE, "Row 1, EU 0"); gen4_instdone_bit(ILK_ROW_1_EU_1_DONE, "Row 1, EU 1"); gen4_instdone_bit(ILK_ROW_1_EU_2_DONE, "Row 1, EU 2"); gen4_instdone_bit(ILK_ROW_1_EU_3_DONE, "Row 1, EU 3"); gen4_instdone_bit(ILK_ROW_2_EU_0_DONE, "Row 2, EU 0"); gen4_instdone_bit(ILK_ROW_2_EU_1_DONE, "Row 2, EU 1"); gen4_instdone_bit(ILK_ROW_2_EU_2_DONE, "Row 2, EU 2"); gen4_instdone_bit(ILK_ROW_2_EU_3_DONE, "Row 2, EU 3"); gen4_instdone_bit(ILK_VCP_DONE, "VCP"); gen4_instdone_bit(ILK_ROW_0_MATH_DONE, "Row 0 math"); gen4_instdone_bit(ILK_ROW_1_MATH_DONE, "Row 1 math"); gen4_instdone_bit(ILK_ROW_2_MATH_DONE, "Row 2 math"); gen4_instdone_bit(ILK_VC1_DONE, "VC1"); gen4_instdone_bit(ILK_ROW_0_MA_DONE, "Row 0 MA"); gen4_instdone_bit(ILK_ROW_1_MA_DONE, "Row 1 MA"); gen4_instdone_bit(ILK_ROW_2_MA_DONE, "Row 2 MA"); gen4_instdone_bit(ILK_ROW_0_ISC_DONE, "Row 0 ISC"); gen4_instdone_bit(ILK_ROW_1_ISC_DONE, "Row 1 ISC"); gen4_instdone_bit(ILK_ROW_2_ISC_DONE, "Row 2 ISC"); gen4_instdone_bit(ILK_VFE_DONE, "VFE"); gen4_instdone_bit(ILK_TD_DONE, "TD"); gen4_instdone_bit(ILK_SVTS_DONE, "SVTS"); gen4_instdone_bit(ILK_TS_DONE, "TS"); gen4_instdone_bit(ILK_GW_DONE, "GW"); gen4_instdone_bit(ILK_AI_DONE, "AI"); gen4_instdone_bit(ILK_AC_DONE, "AC"); gen4_instdone_bit(ILK_AM_DONE, "AM"); init_g4x_instdone1(); } else if (IS_GEN4(devid)) { gen4_instdone_bit(I965_ROW_0_EU_0_DONE, "Row 0, EU 0"); gen4_instdone_bit(I965_ROW_0_EU_1_DONE, "Row 0, EU 1"); gen4_instdone_bit(I965_ROW_0_EU_2_DONE, "Row 0, EU 2"); gen4_instdone_bit(I965_ROW_0_EU_3_DONE, "Row 0, EU 3"); gen4_instdone_bit(I965_ROW_1_EU_0_DONE, "Row 1, EU 0"); gen4_instdone_bit(I965_ROW_1_EU_1_DONE, "Row 1, EU 1"); gen4_instdone_bit(I965_ROW_1_EU_2_DONE, "Row 1, EU 2"); gen4_instdone_bit(I965_ROW_1_EU_3_DONE, "Row 1, EU 3"); gen4_instdone_bit(I965_SF_DONE, "Strips and Fans"); gen4_instdone_bit(I965_SE_DONE, "Setup Engine"); gen4_instdone_bit(I965_WM_DONE, "Windowizer"); gen4_instdone_bit(I965_DISPATCHER_DONE, "Dispatcher"); gen4_instdone_bit(I965_PROJECTION_DONE, "Projection and LOD"); gen4_instdone_bit(I965_DG_DONE, "Dependent address generator"); gen4_instdone_bit(I965_QUAD_CACHE_DONE, "Texture fetch"); gen4_instdone_bit(I965_TEXTURE_FETCH_DONE, "Texture fetch"); gen4_instdone_bit(I965_TEXTURE_DECOMPRESS_DONE, "Texture decompress"); gen4_instdone_bit(I965_SAMPLER_CACHE_DONE, "Sampler cache"); gen4_instdone_bit(I965_FILTER_DONE, "Filtering"); gen4_instdone_bit(I965_BYPASS_DONE, "Bypass FIFO"); gen4_instdone_bit(I965_PS_DONE, "Pixel shader"); gen4_instdone_bit(I965_CC_DONE, "Color calculator"); gen4_instdone_bit(I965_MAP_FILTER_DONE, "Map filter"); gen4_instdone_bit(I965_MAP_L2_IDLE, "Map L2"); gen4_instdone_bit(I965_MA_ROW_0_DONE, "Message Arbiter row 0"); gen4_instdone_bit(I965_MA_ROW_1_DONE, "Message Arbiter row 1"); gen4_instdone_bit(I965_IC_ROW_0_DONE, "Instruction cache row 0"); gen4_instdone_bit(I965_IC_ROW_1_DONE, "Instruction cache row 1"); gen4_instdone_bit(I965_CP_DONE, "Command Processor"); if (IS_G4X(devid)) { init_g4x_instdone1(); } else { init_g965_instdone1(); } } else if (IS_GEN3(devid)) { gen3_instdone_bit(IDCT_DONE, "IDCT"); gen3_instdone_bit(IQ_DONE, "IQ"); gen3_instdone_bit(PR_DONE, "PR"); gen3_instdone_bit(VLD_DONE, "VLD"); gen3_instdone_bit(IP_DONE, "Instruction parser"); gen3_instdone_bit(FBC_DONE, "Framebuffer Compression"); gen3_instdone_bit(BINNER_DONE, "Binner"); gen3_instdone_bit(SF_DONE, "Strips and fans"); gen3_instdone_bit(SE_DONE, "Setup engine"); gen3_instdone_bit(WM_DONE, "Windowizer"); gen3_instdone_bit(IZ_DONE, "Intermediate Z"); gen3_instdone_bit(PERSPECTIVE_INTERP_DONE, "Perspective interpolation"); gen3_instdone_bit(DISPATCHER_DONE, "Dispatcher"); gen3_instdone_bit(PROJECTION_DONE, "Projection and LOD"); gen3_instdone_bit(DEPENDENT_ADDRESS_DONE, "Dependent address calculation"); gen3_instdone_bit(TEXTURE_FETCH_DONE, "Texture fetch"); gen3_instdone_bit(TEXTURE_DECOMPRESS_DONE, "Texture decompression"); gen3_instdone_bit(SAMPLER_CACHE_DONE, "Sampler Cache"); gen3_instdone_bit(FILTER_DONE, "Filtering"); gen3_instdone_bit(BYPASS_FIFO_DONE, "Bypass FIFO"); gen3_instdone_bit(PS_DONE, "Pixel shader"); gen3_instdone_bit(CC_DONE, "Color calculator"); gen3_instdone_bit(MAP_FILTER_DONE, "Map filter"); gen3_instdone_bit(MAP_L2_IDLE, "Map L2"); } else { assert(IS_GEN2(devid)); gen3_instdone_bit(I830_GMBUS_DONE, "GMBUS"); gen3_instdone_bit(I830_FBC_DONE, "FBC"); gen3_instdone_bit(I830_BINNER_DONE, "BINNER"); gen3_instdone_bit(I830_MPEG_DONE, "MPEG"); gen3_instdone_bit(I830_MECO_DONE, "MECO"); gen3_instdone_bit(I830_MCD_DONE, "MCD"); gen3_instdone_bit(I830_MCSTP_DONE, "MCSTP"); gen3_instdone_bit(I830_CC_DONE, "CC"); gen3_instdone_bit(I830_DG_DONE, "DG"); gen3_instdone_bit(I830_DCMP_DONE, "DCMP"); gen3_instdone_bit(I830_FTCH_DONE, "FTCH"); gen3_instdone_bit(I830_IT_DONE, "IT"); gen3_instdone_bit(I830_MG_DONE, "MG"); gen3_instdone_bit(I830_MEC_DONE, "MEC"); gen3_instdone_bit(I830_PC_DONE, "PC"); gen3_instdone_bit(I830_QCC_DONE, "QCC"); gen3_instdone_bit(I830_TB_DONE, "TB"); gen3_instdone_bit(I830_WM_DONE, "WM"); gen3_instdone_bit(I830_EF_DONE, "EF"); gen3_instdone_bit(I830_BLITTER_DONE, "Blitter"); gen3_instdone_bit(I830_MAP_L2_DONE, "Map L2 cache"); gen3_instdone_bit(I830_SECONDARY_RING_3_DONE, "Secondary ring 3"); gen3_instdone_bit(I830_SECONDARY_RING_2_DONE, "Secondary ring 2"); gen3_instdone_bit(I830_SECONDARY_RING_1_DONE, "Secondary ring 1"); gen3_instdone_bit(I830_SECONDARY_RING_0_DONE, "Secondary ring 0"); gen3_instdone_bit(I830_PRIMARY_RING_1_DONE, "Primary ring 1"); gen3_instdone_bit(I830_PRIMARY_RING_0_DONE, "Primary ring 0"); } } intel-gpu-tools-1.3/lib/Makefile.in0000664000175100017510000004431212016622041014155 00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } 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 = lib DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libintel_tools_la_LIBADD = am_libintel_tools_la_OBJECTS = drmtest.lo instdone.lo \ intel_batchbuffer.lo intel_drm.lo intel_mmio.lo intel_pci.lo \ rendercopy_i915.lo rendercopy_i830.lo rendercopy_gen6.lo \ rendercopy_gen7.lo intel_reg_map.lo intel_dpio.lo libintel_tools_la_OBJECTS = $(am_libintel_tools_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; SOURCES = $(libintel_tools_la_SOURCES) DIST_SOURCES = $(libintel_tools_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ADMIN_MAN_DIR = @ADMIN_MAN_DIR@ ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@ AMTAR = @AMTAR@ 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@ CAIRO_CFLAGS = @CAIRO_CFLAGS@ CAIRO_LIBS = @CAIRO_LIBS@ 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@ DRM_CFLAGS = @DRM_CFLAGS@ DRM_LIBS = @DRM_LIBS@ DRM_NOUVEAU_CFLAGS = @DRM_NOUVEAU_CFLAGS@ DRM_NOUVEAU_LIBS = @DRM_NOUVEAU_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILE_MAN_DIR = @FILE_MAN_DIR@ FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@ GEN4ASM = @GEN4ASM@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_LIBS = @GLIB_LIBS@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_CMD = @INSTALL_CMD@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBUDEV_CFLAGS = @LIBUDEV_CFLAGS@ LIBUDEV_LIBS = @LIBUDEV_LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MAN_SUBSTS = @MAN_SUBSTS@ MISC_MAN_DIR = @MISC_MAN_DIR@ MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJCOPY = @OBJCOPY@ 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@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ THREAD_CFLAGS = @THREAD_CFLAGS@ VERSION = @VERSION@ 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@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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@ noinst_LTLIBRARIES = libintel_tools.la AM_CPPFLAGS = -I$(top_srcdir) AM_CFLAGS = $(DRM_CFLAGS) $(CWARNFLAGS) $(CAIRO_CFLAGS) libintel_tools_la_SOURCES = \ debug.h \ drmtest.c \ drmtest.h \ i830_reg.h \ i915_3d.h \ i915_reg.h \ instdone.c \ instdone.h \ intel_batchbuffer.c \ intel_batchbuffer.h \ intel_chipset.h \ intel_drm.c \ intel_gpu_tools.h \ intel_mmio.c \ intel_pci.c \ intel_reg.h \ rendercopy_i915.c \ rendercopy_i830.c \ gen6_render.h \ gen7_render.h \ rendercopy_gen6.c \ rendercopy_gen7.c \ rendercopy.h \ intel_reg_map.c \ intel_dpio.c \ $(NULL) LDADD = $(CAIRO_LIBS) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign lib/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign lib/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libintel_tools.la: $(libintel_tools_la_OBJECTS) $(libintel_tools_la_DEPENDENCIES) $(EXTRA_libintel_tools_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libintel_tools_la_OBJECTS) $(libintel_tools_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/drmtest.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/instdone.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/intel_batchbuffer.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/intel_dpio.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/intel_drm.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/intel_mmio.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/intel_pci.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/intel_reg_map.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rendercopy_gen6.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rendercopy_gen7.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rendercopy_i830.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rendercopy_i915.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am # 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: intel-gpu-tools-1.3/lib/intel_chipset.h0000744000175100017510000002431412014634425015121 00000000000000/* * Copyright © 2007 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Eric Anholt * */ #define PCI_CHIP_I810 0x7121 #define PCI_CHIP_I810_DC100 0x7123 #define PCI_CHIP_I810_E 0x7125 #define PCI_CHIP_I815 0x1132 #define PCI_CHIP_I830_M 0x3577 #define PCI_CHIP_845_G 0x2562 #define PCI_CHIP_I855_GM 0x3582 #define PCI_CHIP_I865_G 0x2572 #define PCI_CHIP_I915_G 0x2582 #define PCI_CHIP_E7221_G 0x258A #define PCI_CHIP_I915_GM 0x2592 #define PCI_CHIP_I945_G 0x2772 #define PCI_CHIP_I945_GM 0x27A2 #define PCI_CHIP_I945_GME 0x27AE #define PCI_CHIP_Q35_G 0x29B2 #define PCI_CHIP_G33_G 0x29C2 #define PCI_CHIP_Q33_G 0x29D2 #define PCI_CHIP_IGD_GM 0xA011 #define PCI_CHIP_IGD_G 0xA001 #define IS_IGDGM(devid) (devid == PCI_CHIP_IGD_GM) #define IS_IGDG(devid) (devid == PCI_CHIP_IGD_G) #define IS_IGD(devid) (IS_IGDG(devid) || IS_IGDGM(devid)) #define PCI_CHIP_I965_G 0x29A2 #define PCI_CHIP_I965_Q 0x2992 #define PCI_CHIP_I965_G_1 0x2982 #define PCI_CHIP_I946_GZ 0x2972 #define PCI_CHIP_I965_GM 0x2A02 #define PCI_CHIP_I965_GME 0x2A12 #define PCI_CHIP_GM45_GM 0x2A42 #define PCI_CHIP_IGD_E_G 0x2E02 #define PCI_CHIP_Q45_G 0x2E12 #define PCI_CHIP_G45_G 0x2E22 #define PCI_CHIP_G41_G 0x2E32 #define PCI_CHIP_ILD_G 0x0042 #define PCI_CHIP_ILM_G 0x0046 #define PCI_CHIP_SANDYBRIDGE_GT1 0x0102 /* desktop */ #define PCI_CHIP_SANDYBRIDGE_GT2 0x0112 #define PCI_CHIP_SANDYBRIDGE_GT2_PLUS 0x0122 #define PCI_CHIP_SANDYBRIDGE_M_GT1 0x0106 /* mobile */ #define PCI_CHIP_SANDYBRIDGE_M_GT2 0x0116 #define PCI_CHIP_SANDYBRIDGE_M_GT2_PLUS 0x0126 #define PCI_CHIP_SANDYBRIDGE_S 0x010A /* server */ #define PCI_CHIP_IVYBRIDGE_GT1 0x0152 /* desktop */ #define PCI_CHIP_IVYBRIDGE_GT2 0x0162 #define PCI_CHIP_IVYBRIDGE_M_GT1 0x0156 /* mobile */ #define PCI_CHIP_IVYBRIDGE_M_GT2 0x0166 #define PCI_CHIP_IVYBRIDGE_S 0x015a /* server */ #define PCI_CHIP_IVYBRIDGE_S_GT2 0x016a /* server */ #define PCI_CHIP_HASWELL_GT1 0x0402 /* Desktop */ #define PCI_CHIP_HASWELL_GT2 0x0412 #define PCI_CHIP_HASWELL_GT2_PLUS 0x0422 #define PCI_CHIP_HASWELL_M_GT1 0x0406 /* Mobile */ #define PCI_CHIP_HASWELL_M_GT2 0x0416 #define PCI_CHIP_HASWELL_M_GT2_PLUS 0x0426 #define PCI_CHIP_HASWELL_S_GT1 0x040A /* Server */ #define PCI_CHIP_HASWELL_S_GT2 0x041A #define PCI_CHIP_HASWELL_S_GT2_PLUS 0x042A #define PCI_CHIP_HASWELL_SDV_GT1 0x0C02 /* Desktop */ #define PCI_CHIP_HASWELL_SDV_GT2 0x0C12 #define PCI_CHIP_HASWELL_SDV_GT2_PLUS 0x0C22 #define PCI_CHIP_HASWELL_SDV_M_GT1 0x0C06 /* Mobile */ #define PCI_CHIP_HASWELL_SDV_M_GT2 0x0C16 #define PCI_CHIP_HASWELL_SDV_M_GT2_PLUS 0x0C26 #define PCI_CHIP_HASWELL_SDV_S_GT1 0x0C0A /* Server */ #define PCI_CHIP_HASWELL_SDV_S_GT2 0x0C1A #define PCI_CHIP_HASWELL_SDV_S_GT2_PLUS 0x0C2A #define PCI_CHIP_HASWELL_ULT_GT1 0x0A02 /* Desktop */ #define PCI_CHIP_HASWELL_ULT_GT2 0x0A12 #define PCI_CHIP_HASWELL_ULT_GT2_PLUS 0x0A22 #define PCI_CHIP_HASWELL_ULT_M_GT1 0x0A06 /* Mobile */ #define PCI_CHIP_HASWELL_ULT_M_GT2 0x0A16 #define PCI_CHIP_HASWELL_ULT_M_GT2_PLUS 0x0A26 #define PCI_CHIP_HASWELL_ULT_S_GT1 0x0A0A /* Server */ #define PCI_CHIP_HASWELL_ULT_S_GT2 0x0A1A #define PCI_CHIP_HASWELL_ULT_S_GT2_PLUS 0x0A2A #define PCI_CHIP_HASWELL_CRW_GT1 0x0D12 /* Desktop */ #define PCI_CHIP_HASWELL_CRW_GT2 0x0D22 #define PCI_CHIP_HASWELL_CRW_GT2_PLUS 0x0D32 #define PCI_CHIP_HASWELL_CRW_M_GT1 0x0D16 /* Mobile */ #define PCI_CHIP_HASWELL_CRW_M_GT2 0x0D26 #define PCI_CHIP_HASWELL_CRW_M_GT2_PLUS 0x0D36 #define PCI_CHIP_HASWELL_CRW_S_GT1 0x0D1A /* Server */ #define PCI_CHIP_HASWELL_CRW_S_GT2 0x0D2A #define PCI_CHIP_HASWELL_CRW_S_GT2_PLUS 0x0D3A #define PCI_CHIP_VALLEYVIEW_PO 0x0f30 /* VLV PO board */ #define IS_MOBILE(devid) (devid == PCI_CHIP_I855_GM || \ devid == PCI_CHIP_I915_GM || \ devid == PCI_CHIP_I945_GM || \ devid == PCI_CHIP_I945_GME || \ devid == PCI_CHIP_I965_GM || \ devid == PCI_CHIP_I965_GME || \ devid == PCI_CHIP_GM45_GM || IS_IGD(devid) || \ devid == PCI_CHIP_IVYBRIDGE_M_GT1 || \ devid == PCI_CHIP_IVYBRIDGE_M_GT2) #define IS_G45(devid) (devid == PCI_CHIP_IGD_E_G || \ devid == PCI_CHIP_Q45_G || \ devid == PCI_CHIP_G45_G || \ devid == PCI_CHIP_G41_G) #define IS_GM45(devid) (devid == PCI_CHIP_GM45_GM) #define IS_G4X(devid) (IS_G45(devid) || IS_GM45(devid)) #define IS_ILD(devid) (devid == PCI_CHIP_ILD_G) #define IS_ILM(devid) (devid == PCI_CHIP_ILM_G) #define IS_915(devid) (devid == PCI_CHIP_I915_G || \ devid == PCI_CHIP_E7221_G || \ devid == PCI_CHIP_I915_GM) #define IS_945GM(devid) (devid == PCI_CHIP_I945_GM || \ devid == PCI_CHIP_I945_GME) #define IS_945(devid) (devid == PCI_CHIP_I945_G || \ devid == PCI_CHIP_I945_GM || \ devid == PCI_CHIP_I945_GME || \ IS_G33(devid)) #define IS_G33(devid) (devid == PCI_CHIP_G33_G || \ devid == PCI_CHIP_Q33_G || \ devid == PCI_CHIP_Q35_G || IS_IGD(devid)) #define IS_GEN2(devid) (devid == PCI_CHIP_I830_M || \ devid == PCI_CHIP_845_G || \ devid == PCI_CHIP_I855_GM || \ devid == PCI_CHIP_I865_G) #define IS_GEN3(devid) (IS_945(devid) || IS_915(devid)) #define IS_GEN4(devid) (devid == PCI_CHIP_I965_G || \ devid == PCI_CHIP_I965_Q || \ devid == PCI_CHIP_I965_G_1 || \ devid == PCI_CHIP_I965_GM || \ devid == PCI_CHIP_I965_GME || \ devid == PCI_CHIP_I946_GZ || \ IS_G4X(devid)) #define IS_GEN5(devid) (IS_ILD(devid) || IS_ILM(devid)) #define IS_GEN6(devid) (devid == PCI_CHIP_SANDYBRIDGE_GT1 || \ devid == PCI_CHIP_SANDYBRIDGE_GT2 || \ devid == PCI_CHIP_SANDYBRIDGE_GT2_PLUS || \ devid == PCI_CHIP_SANDYBRIDGE_M_GT1 || \ devid == PCI_CHIP_SANDYBRIDGE_M_GT2 || \ devid == PCI_CHIP_SANDYBRIDGE_M_GT2_PLUS || \ devid == PCI_CHIP_SANDYBRIDGE_S) #define IS_GEN7(devid) (IS_IVYBRIDGE(devid) || \ IS_HASWELL(devid)) #define IS_IVYBRIDGE(dev) (dev == PCI_CHIP_IVYBRIDGE_GT1 || \ dev == PCI_CHIP_IVYBRIDGE_GT2 || \ dev == PCI_CHIP_IVYBRIDGE_M_GT1 || \ dev == PCI_CHIP_IVYBRIDGE_M_GT2 || \ dev == PCI_CHIP_IVYBRIDGE_S || \ dev == PCI_CHIP_IVYBRIDGE_S_GT2 || \ dev == PCI_CHIP_VALLEYVIEW_PO) #define IS_VALLEYVIEW(devid) (devid == PCI_CHIP_VALLEYVIEW_PO) #define IS_HSW_GT1(devid) (devid == PCI_CHIP_HASWELL_GT1 || \ devid == PCI_CHIP_HASWELL_M_GT1 || \ devid == PCI_CHIP_HASWELL_S_GT1 || \ devid == PCI_CHIP_HASWELL_SDV_GT1 || \ devid == PCI_CHIP_HASWELL_SDV_M_GT1 || \ devid == PCI_CHIP_HASWELL_SDV_S_GT1 || \ devid == PCI_CHIP_HASWELL_ULT_GT1 || \ devid == PCI_CHIP_HASWELL_ULT_M_GT1 || \ devid == PCI_CHIP_HASWELL_ULT_S_GT1 || \ devid == PCI_CHIP_HASWELL_CRW_GT1 || \ devid == PCI_CHIP_HASWELL_CRW_M_GT1 || \ devid == PCI_CHIP_HASWELL_CRW_S_GT1) #define IS_HSW_GT2(devid) (devid == PCI_CHIP_HASWELL_GT2 || \ devid == PCI_CHIP_HASWELL_M_GT2 || \ devid == PCI_CHIP_HASWELL_S_GT2 || \ devid == PCI_CHIP_HASWELL_SDV_GT2 || \ devid == PCI_CHIP_HASWELL_SDV_M_GT2 || \ devid == PCI_CHIP_HASWELL_SDV_S_GT2 || \ devid == PCI_CHIP_HASWELL_ULT_GT2 || \ devid == PCI_CHIP_HASWELL_ULT_M_GT2 || \ devid == PCI_CHIP_HASWELL_ULT_S_GT2 || \ devid == PCI_CHIP_HASWELL_CRW_GT2 || \ devid == PCI_CHIP_HASWELL_CRW_M_GT2 || \ devid == PCI_CHIP_HASWELL_CRW_S_GT2 || \ devid == PCI_CHIP_HASWELL_GT2_PLUS || \ devid == PCI_CHIP_HASWELL_M_GT2_PLUS || \ devid == PCI_CHIP_HASWELL_S_GT2_PLUS || \ devid == PCI_CHIP_HASWELL_SDV_GT2_PLUS || \ devid == PCI_CHIP_HASWELL_SDV_M_GT2_PLUS || \ devid == PCI_CHIP_HASWELL_SDV_S_GT2_PLUS || \ devid == PCI_CHIP_HASWELL_ULT_GT2_PLUS || \ devid == PCI_CHIP_HASWELL_ULT_M_GT2_PLUS || \ devid == PCI_CHIP_HASWELL_ULT_S_GT2_PLUS || \ devid == PCI_CHIP_HASWELL_CRW_GT2_PLUS || \ devid == PCI_CHIP_HASWELL_CRW_M_GT2_PLUS || \ devid == PCI_CHIP_HASWELL_CRW_S_GT2_PLUS) #define IS_HASWELL(devid) (IS_HSW_GT1(devid) || \ IS_HSW_GT2(devid)) #define IS_965(devid) (IS_GEN4(devid) || \ IS_GEN5(devid) || \ IS_GEN6(devid) || \ IS_GEN7(devid)) #define IS_INTEL(devid) (IS_GEN2(devid) || \ IS_GEN3(devid) || \ IS_GEN4(devid) || \ IS_GEN5(devid) || \ IS_GEN6(devid) || \ IS_GEN7(devid)) #define HAS_PCH_SPLIT(devid) (IS_GEN5(devid) || \ IS_GEN6(devid) || \ IS_GEN7(devid)) #define HAS_BLT_RING(devid) (IS_GEN6(devid) || \ IS_GEN7(devid)) #define HAS_BSD_RING(devid) (IS_GEN5(devid) || \ IS_GEN6(devid) || \ IS_GEN7(devid)) #define IS_BROADWATER(devid) (devid == PCI_CHIP_I946_GZ || \ devid == PCI_CHIP_I965_G_1 || \ devid == PCI_CHIP_I965_Q || \ devid == PCI_CHIP_I965_G) #define IS_CRESTLINE(devid) (devid == PCI_CHIP_I965_GM || \ devid == PCI_CHIP_I965_GME) intel-gpu-tools-1.3/Makefile.in0000664000175100017510000006533712016622041013421 00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Copyright © 2005 Adam Jackson. # Copyright © 2009 Intel Corporation # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"), # to deal in the Software without restriction, including without limitation # on the rights to use, copy, modify, merge, publish, distribute, sub # license, and/or sell copies of the Software, and to permit persons to whom # the Software is furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice (including the next # paragraph) shall be included in all copies or substantial portions of the # Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL # ADAM JACKSON BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER # IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } 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@ @BUILD_SHADER_DEBUGGER_TRUE@am__append_1 = debugger subdir = . DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/config.h.in \ $(top_srcdir)/configure COPYING ChangeLog INSTALL \ build-aux/config.guess build-aux/config.sub build-aux/depcomp \ build-aux/install-sh build-aux/ltmain.sh build-aux/missing \ build-aux/py-compile ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir dist dist-all distcheck ETAGS = etags CTAGS = ctags DIST_SUBDIRS = lib man tools scripts tests benchmarks demos debugger DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ if test -d "$(distdir)"; then \ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2 GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ ADMIN_MAN_DIR = @ADMIN_MAN_DIR@ ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@ AMTAR = @AMTAR@ 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@ CAIRO_CFLAGS = @CAIRO_CFLAGS@ CAIRO_LIBS = @CAIRO_LIBS@ 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@ DRM_CFLAGS = @DRM_CFLAGS@ DRM_LIBS = @DRM_LIBS@ DRM_NOUVEAU_CFLAGS = @DRM_NOUVEAU_CFLAGS@ DRM_NOUVEAU_LIBS = @DRM_NOUVEAU_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILE_MAN_DIR = @FILE_MAN_DIR@ FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@ GEN4ASM = @GEN4ASM@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_LIBS = @GLIB_LIBS@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_CMD = @INSTALL_CMD@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBUDEV_CFLAGS = @LIBUDEV_CFLAGS@ LIBUDEV_LIBS = @LIBUDEV_LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MAN_SUBSTS = @MAN_SUBSTS@ MISC_MAN_DIR = @MISC_MAN_DIR@ MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJCOPY = @OBJCOPY@ 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@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ THREAD_CFLAGS = @THREAD_CFLAGS@ VERSION = @VERSION@ 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@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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@ ACLOCAL_AMFLAGS = ${ACLOCAL_FLAGS} SUBDIRS = lib man tools scripts tests benchmarks demos $(am__append_1) MAINTAINERCLEANFILES = ChangeLog INSTALL all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: am--refresh: Makefile @: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): config.h: stamp-h1 @if test ! -f $@; then rm -f stamp-h1; else :; fi @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool config.lt # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-hook -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__remove_distdir) dist-lzma: distdir tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma $(am__remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__remove_distdir) dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__remove_distdir) dist dist-all: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lzma*) \ lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir); chmod u+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @test -n '$(distuninstallcheck_dir)' || { \ echo 'ERROR: trying to run $@ with an empty' \ '$$(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ $(am__cd) '$(distuninstallcheck_dir)' || { \ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile config.h installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-hdr \ distclean-libtool distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \ ctags-recursive install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am am--refresh check check-am clean clean-generic \ clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \ dist-gzip dist-hook dist-lzip dist-lzma dist-shar dist-tarZ \ dist-xz dist-zip distcheck distclean distclean-generic \ distclean-hdr distclean-libtool distclean-tags distcleancheck \ distdir distuninstallcheck dvi dvi-am html html-am info \ info-am install install-am install-data install-data-am \ install-dvi install-dvi-am install-exec install-exec-am \ install-html install-html-am install-info install-info-am \ install-man install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am test: ${MAKE} -C tests test .PHONY: ChangeLog INSTALL INSTALL: $(INSTALL_CMD) ChangeLog: $(CHANGELOG_CMD) dist-hook: ChangeLog INSTALL # 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: