diff -Nru intel-gpu-tools-1.13/aclocal.m4 intel-gpu-tools-1.15/aclocal.m4 --- intel-gpu-tools-1.13/aclocal.m4 2015-12-02 16:47:57.000000000 +0000 +++ intel-gpu-tools-1.15/aclocal.m4 2016-05-31 17:03:28.000000000 +0000 @@ -20,32 +20,63 @@ 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'.])]) -# 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]) -# ---------------------------------- +dnl pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- +dnl serial 11 (pkg-config-0.29) +dnl +dnl Copyright © 2004 Scott James Remnant . +dnl Copyright © 2012-2015 Dan Nicholson +dnl +dnl This program is free software; you can redistribute it and/or modify +dnl it under the terms of the GNU General Public License as published by +dnl the Free Software Foundation; either version 2 of the License, or +dnl (at your option) any later version. +dnl +dnl This program is distributed in the hope that it will be useful, but +dnl WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +dnl General Public License for more details. +dnl +dnl You should have received a copy of the GNU General Public License +dnl along with this program; if not, write to the Free Software +dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +dnl 02111-1307, USA. +dnl +dnl As a special exception to the GNU General Public License, if you +dnl distribute this file as part of a program that contains a +dnl configuration script generated by Autoconf, you may include it under +dnl the same distribution terms that you use for the rest of that +dnl program. + +dnl PKG_PREREQ(MIN-VERSION) +dnl ----------------------- +dnl Since: 0.29 +dnl +dnl Verify that the version of the pkg-config macros are at least +dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's +dnl installed version of pkg-config, this checks the developer's version +dnl of pkg.m4 when generating configure. +dnl +dnl To ensure that this macro is defined, also add: +dnl m4_ifndef([PKG_PREREQ], +dnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])]) +dnl +dnl See the "Since" comment for each macro you use to see what version +dnl of the macros you require. +m4_defun([PKG_PREREQ], +[m4_define([PKG_MACROS_VERSION], [0.29]) +m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1, + [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])]) +])dnl PKG_PREREQ + +dnl PKG_PROG_PKG_CONFIG([MIN-VERSION]) +dnl ---------------------------------- +dnl Since: 0.16 +dnl +dnl Search for the pkg-config tool and set the PKG_CONFIG variable to +dnl first found in the path. Checks that the version of pkg-config found +dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is +dnl used since that's the first version where most current features of +dnl pkg-config existed. 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)))?$]) @@ -67,18 +98,19 @@ PKG_CONFIG="" fi fi[]dnl -])# PKG_PROG_PKG_CONFIG +])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 -# -------------------------------------------------------------- +dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +dnl ------------------------------------------------------------------- +dnl Since: 0.18 +dnl +dnl Check to see whether a particular set of modules exists. Similar to +dnl PKG_CHECK_MODULES(), but does not set variables or print errors. +dnl +dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) +dnl only at the first occurence in configure.ac, so if the first place +dnl it's called might be skipped (such as if it is within an "if", you +dnl have to call PKG_CHECK_EXISTS manually AC_DEFUN([PKG_CHECK_EXISTS], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl if test -n "$PKG_CONFIG" && \ @@ -88,8 +120,10 @@ $3])dnl fi]) -# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) -# --------------------------------------------- +dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) +dnl --------------------------------------------- +dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting +dnl pkg_failed based on the result. m4_define([_PKG_CONFIG], [if test -n "$$1"; then pkg_cv_[]$1="$$1" @@ -101,10 +135,11 @@ else pkg_failed=untried fi[]dnl -])# _PKG_CONFIG +])dnl _PKG_CONFIG -# _PKG_SHORT_ERRORS_SUPPORTED -# ----------------------------- +dnl _PKG_SHORT_ERRORS_SUPPORTED +dnl --------------------------- +dnl Internal check to see if pkg-config supports short errors. AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], [AC_REQUIRE([PKG_PROG_PKG_CONFIG]) if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then @@ -112,19 +147,17 @@ else _pkg_short_errors_supported=no fi[]dnl -])# _PKG_SHORT_ERRORS_SUPPORTED +])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 -# -# -# -------------------------------------------------------------- +dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], +dnl [ACTION-IF-NOT-FOUND]) +dnl -------------------------------------------------------------- +dnl Since: 0.4.0 +dnl +dnl Note that if there is a possibility the first call to +dnl PKG_CHECK_MODULES might not happen, you should be sure to include an +dnl 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 @@ -178,16 +211,40 @@ AC_MSG_RESULT([yes]) $3 fi[]dnl -])# PKG_CHECK_MODULES +])dnl PKG_CHECK_MODULES + + +dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], +dnl [ACTION-IF-NOT-FOUND]) +dnl --------------------------------------------------------------------- +dnl Since: 0.29 +dnl +dnl Checks for existence of MODULES and gathers its build flags with +dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags +dnl and VARIABLE-PREFIX_LIBS from --libs. +dnl +dnl Note that if there is a possibility the first call to +dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to +dnl include an explicit call to PKG_PROG_PKG_CONFIG in your +dnl configure.ac. +AC_DEFUN([PKG_CHECK_MODULES_STATIC], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +_save_PKG_CONFIG=$PKG_CONFIG +PKG_CONFIG="$PKG_CONFIG --static" +PKG_CHECK_MODULES($@) +PKG_CONFIG=$_save_PKG_CONFIG[]dnl +])dnl PKG_CHECK_MODULES_STATIC -# PKG_INSTALLDIR(DIRECTORY) -# ------------------------- -# Substitutes the variable pkgconfigdir as the location where a module -# should install pkg-config .pc files. By default the directory is -# $libdir/pkgconfig, but the default can be changed by passing -# DIRECTORY. The user can override through the --with-pkgconfigdir -# parameter. +dnl PKG_INSTALLDIR([DIRECTORY]) +dnl ------------------------- +dnl Since: 0.27 +dnl +dnl Substitutes the variable pkgconfigdir as the location where a module +dnl should install pkg-config .pc files. By default the directory is +dnl $libdir/pkgconfig, but the default can be changed by passing +dnl DIRECTORY. The user can override through the --with-pkgconfigdir +dnl parameter. AC_DEFUN([PKG_INSTALLDIR], [m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])]) m4_pushdef([pkg_description], @@ -198,16 +255,18 @@ AC_SUBST([pkgconfigdir], [$with_pkgconfigdir]) m4_popdef([pkg_default]) m4_popdef([pkg_description]) -]) dnl PKG_INSTALLDIR +])dnl PKG_INSTALLDIR -# PKG_NOARCH_INSTALLDIR(DIRECTORY) -# ------------------------- -# Substitutes the variable noarch_pkgconfigdir as the location where a -# module should install arch-independent pkg-config .pc files. By -# default the directory is $datadir/pkgconfig, but the default can be -# changed by passing DIRECTORY. The user can override through the -# --with-noarch-pkgconfigdir parameter. +dnl PKG_NOARCH_INSTALLDIR([DIRECTORY]) +dnl -------------------------------- +dnl Since: 0.27 +dnl +dnl Substitutes the variable noarch_pkgconfigdir as the location where a +dnl module should install arch-independent pkg-config .pc files. By +dnl default the directory is $datadir/pkgconfig, but the default can be +dnl changed by passing DIRECTORY. The user can override through the +dnl --with-noarch-pkgconfigdir parameter. AC_DEFUN([PKG_NOARCH_INSTALLDIR], [m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])]) m4_pushdef([pkg_description], @@ -218,13 +277,15 @@ AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir]) m4_popdef([pkg_default]) m4_popdef([pkg_description]) -]) dnl PKG_NOARCH_INSTALLDIR +])dnl PKG_NOARCH_INSTALLDIR -# PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, -# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) -# ------------------------------------------- -# Retrieves the value of the pkg-config variable for the given module. +dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, +dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +dnl ------------------------------------------- +dnl Since: 0.28 +dnl +dnl Retrieves the value of the pkg-config variable for the given module. AC_DEFUN([PKG_CHECK_VAR], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl @@ -233,7 +294,7 @@ AS_VAR_COPY([$1], [pkg_cv_][$1]) AS_VAR_IF([$1], [""], [$5], [$4])dnl -])# PKG_CHECK_VAR +])dnl PKG_CHECK_VAR dnl xorg-macros.m4. Generated from xorg-macros.m4.in xorgversion.m4 by configure. dnl @@ -659,13 +720,24 @@ fi]) # Test for the ability of xmlto to generate a text target +# +# NOTE: xmlto 0.0.27 or higher return a non-zero return code in the +# following test for empty XML docbook files. +# For compatibility reasons use the following empty XML docbook file and if +# it fails try it again with a non-empty XML file. 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])])]) + [# Try it again with a non-empty XML file. + cat > conftest.xml << "EOF" + +EOF + 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]) diff -Nru intel-gpu-tools-1.13/assembler/doc/Makefile.in intel-gpu-tools-1.15/assembler/doc/Makefile.in --- intel-gpu-tools-1.13/assembler/doc/Makefile.in 2015-12-02 16:47:58.000000000 +0000 +++ intel-gpu-tools-1.15/assembler/doc/Makefile.in 2016-05-31 17:03:32.000000000 +0000 @@ -87,6 +87,7 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ +target_triplet = @target@ subdir = assembler/doc ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/as-compiler-flag.m4 \ @@ -157,6 +158,8 @@ DRM_LIBS = @DRM_LIBS@ DRM_NOUVEAU_CFLAGS = @DRM_NOUVEAU_CFLAGS@ DRM_NOUVEAU_LIBS = @DRM_NOUVEAU_LIBS@ +DRM_VC4_CFLAGS = @DRM_VC4_CFLAGS@ +DRM_VC4_LIBS = @DRM_VC4_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -201,6 +204,7 @@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MAN_SUBSTS = @MAN_SUBSTS@ @@ -245,6 +249,7 @@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ THREAD_CFLAGS = @THREAD_CFLAGS@ +TIMER_LIBS = @TIMER_LIBS@ VERSION = @VERSION@ XORG_MAN_PAGE = @XORG_MAN_PAGE@ XRANDR_CFLAGS = @XRANDR_CFLAGS@ @@ -299,11 +304,16 @@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ +target = @target@ target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ diff -Nru intel-gpu-tools-1.13/assembler/gram.c intel-gpu-tools-1.15/assembler/gram.c --- intel-gpu-tools-1.13/assembler/gram.c 2015-12-02 16:17:41.000000000 +0000 +++ intel-gpu-tools-1.15/assembler/gram.c 2016-05-31 17:03:43.000000000 +0000 @@ -1,8 +1,8 @@ -/* A Bison parser, made by GNU Bison 3.0.2. */ +/* A Bison parser, made by GNU Bison 3.0.4. */ /* Bison implementation for Yacc-like parsers in C - Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. + Copyright (C) 1984, 1989-1990, 2000-2015 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 @@ -44,7 +44,7 @@ #define YYBISON 1 /* Bison version. */ -#define YYBISON_VERSION "3.0.2" +#define YYBISON_VERSION "3.0.4" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -956,7 +956,7 @@ /* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE YYSTYPE; + union YYSTYPE { #line 437 "gram.y" /* yacc.c:355 */ @@ -979,6 +979,8 @@ #line 981 "gram.c" /* yacc.c:355 */ }; + +typedef union YYSTYPE YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define YYSTYPE_IS_DECLARED 1 #endif @@ -1006,7 +1008,7 @@ /* Copy the second part of user declarations. */ -#line 1010 "gram.c" /* yacc.c:358 */ +#line 1012 "gram.c" /* yacc.c:358 */ /* Unqualified %code blocks. */ #line 570 "gram.y" /* yacc.c:359 */ @@ -1062,7 +1064,7 @@ } -#line 1066 "gram.c" /* yacc.c:359 */ +#line 1068 "gram.c" /* yacc.c:359 */ #ifdef short # undef short @@ -2839,55 +2841,55 @@ case 2: #line 625 "gram.y" /* yacc.c:1646 */ { (yyval.integer) = (yyvsp[0].integer); } -#line 2843 "gram.c" /* yacc.c:1646 */ +#line 2845 "gram.c" /* yacc.c:1646 */ break; case 3: #line 626 "gram.y" /* yacc.c:1646 */ { (yyval.integer) = -(yyvsp[0].integer);} -#line 2849 "gram.c" /* yacc.c:1646 */ +#line 2851 "gram.c" /* yacc.c:1646 */ break; case 4: #line 629 "gram.y" /* yacc.c:1646 */ { (yyval.integer) = (yyvsp[0].integer); } -#line 2855 "gram.c" /* yacc.c:1646 */ +#line 2857 "gram.c" /* yacc.c:1646 */ break; case 5: #line 630 "gram.y" /* yacc.c:1646 */ { (yyval.integer) = (yyvsp[-2].integer) + (yyvsp[0].integer); } -#line 2861 "gram.c" /* yacc.c:1646 */ +#line 2863 "gram.c" /* yacc.c:1646 */ break; case 6: #line 631 "gram.y" /* yacc.c:1646 */ { (yyval.integer) = (yyvsp[-2].integer) - (yyvsp[0].integer); } -#line 2867 "gram.c" /* yacc.c:1646 */ +#line 2869 "gram.c" /* yacc.c:1646 */ break; case 7: #line 632 "gram.y" /* yacc.c:1646 */ { (yyval.integer) = (yyvsp[-2].integer) * (yyvsp[0].integer); } -#line 2873 "gram.c" /* yacc.c:1646 */ +#line 2875 "gram.c" /* yacc.c:1646 */ break; case 8: #line 633 "gram.y" /* yacc.c:1646 */ { if ((yyvsp[0].integer)) (yyval.integer) = (yyvsp[-2].integer) / (yyvsp[0].integer); else YYERROR;} -#line 2879 "gram.c" /* yacc.c:1646 */ +#line 2881 "gram.c" /* yacc.c:1646 */ break; case 9: #line 634 "gram.y" /* yacc.c:1646 */ { (yyval.integer) = -(yyvsp[0].integer);} -#line 2885 "gram.c" /* yacc.c:1646 */ +#line 2887 "gram.c" /* yacc.c:1646 */ break; case 10: #line 635 "gram.y" /* yacc.c:1646 */ { (yyval.integer) = (yyvsp[-1].integer); } -#line 2891 "gram.c" /* yacc.c:1646 */ +#line 2893 "gram.c" /* yacc.c:1646 */ break; case 11: @@ -2895,7 +2897,7 @@ { compiled_program = (yyvsp[0].program); } -#line 2899 "gram.c" /* yacc.c:1646 */ +#line 2901 "gram.c" /* yacc.c:1646 */ break; case 13: @@ -2903,7 +2905,7 @@ { (yyval.reg) = (yyvsp[0].reg); } -#line 2907 "gram.c" /* yacc.c:1646 */ +#line 2909 "gram.c" /* yacc.c:1646 */ break; case 14: @@ -2911,7 +2913,7 @@ { (yyval.integer) = (yyvsp[0].integer); } -#line 2915 "gram.c" /* yacc.c:1646 */ +#line 2917 "gram.c" /* yacc.c:1646 */ break; case 15: @@ -2923,7 +2925,7 @@ (yyval.region).width = BRW_WIDTH_1; (yyval.region).horiz_stride = ffs(0); } -#line 2927 "gram.c" /* yacc.c:1646 */ +#line 2929 "gram.c" /* yacc.c:1646 */ break; case 16: @@ -2931,7 +2933,7 @@ { (yyval.region) = (yyvsp[0].region); } -#line 2935 "gram.c" /* yacc.c:1646 */ +#line 2937 "gram.c" /* yacc.c:1646 */ break; case 17: @@ -2939,7 +2941,7 @@ { (yyval.integer) = 1; } -#line 2943 "gram.c" /* yacc.c:1646 */ +#line 2945 "gram.c" /* yacc.c:1646 */ break; case 18: @@ -2947,7 +2949,7 @@ { (yyval.integer) = (yyvsp[0].integer); } -#line 2951 "gram.c" /* yacc.c:1646 */ +#line 2953 "gram.c" /* yacc.c:1646 */ break; case 19: @@ -2955,7 +2957,7 @@ { (yyval.integer) = (yyvsp[0].regtype).type; } -#line 2959 "gram.c" /* yacc.c:1646 */ +#line 2961 "gram.c" /* yacc.c:1646 */ break; case 20: @@ -2982,7 +2984,7 @@ insert_register(new_reg); } } -#line 2986 "gram.c" /* yacc.c:1646 */ +#line 2988 "gram.c" /* yacc.c:1646 */ break; case 23: @@ -2990,7 +2992,7 @@ { program_defaults.execute_size = (yyvsp[0].integer); } -#line 2994 "gram.c" /* yacc.c:1646 */ +#line 2996 "gram.c" /* yacc.c:1646 */ break; case 24: @@ -2998,7 +3000,7 @@ { program_defaults.register_type = (yyvsp[0].regtype).type; } -#line 3002 "gram.c" /* yacc.c:1646 */ +#line 3004 "gram.c" /* yacc.c:1646 */ break; case 30: @@ -3006,7 +3008,7 @@ { (yyval.program) = (yyvsp[-1].program); } -#line 3010 "gram.c" /* yacc.c:1646 */ +#line 3012 "gram.c" /* yacc.c:1646 */ break; case 31: @@ -3015,7 +3017,7 @@ brw_program_add_instruction(&(yyvsp[-2].program), &(yyvsp[-1].instruction)); (yyval.program) = (yyvsp[-2].program); } -#line 3019 "gram.c" /* yacc.c:1646 */ +#line 3021 "gram.c" /* yacc.c:1646 */ break; case 32: @@ -3024,7 +3026,7 @@ brw_program_init(&(yyval.program)); brw_program_add_instruction(&(yyval.program), &(yyvsp[-1].instruction)); } -#line 3028 "gram.c" /* yacc.c:1646 */ +#line 3030 "gram.c" /* yacc.c:1646 */ break; case 33: @@ -3033,7 +3035,7 @@ brw_program_add_relocatable(&(yyvsp[-2].program), &(yyvsp[-1].instruction)); (yyval.program) = (yyvsp[-2].program); } -#line 3037 "gram.c" /* yacc.c:1646 */ +#line 3039 "gram.c" /* yacc.c:1646 */ break; case 34: @@ -3042,7 +3044,7 @@ brw_program_init(&(yyval.program)); brw_program_add_relocatable(&(yyval.program), &(yyvsp[-1].instruction)); } -#line 3046 "gram.c" /* yacc.c:1646 */ +#line 3048 "gram.c" /* yacc.c:1646 */ break; case 35: @@ -3050,7 +3052,7 @@ { (yyval.program) = (yyvsp[-1].program); } -#line 3054 "gram.c" /* yacc.c:1646 */ +#line 3056 "gram.c" /* yacc.c:1646 */ break; case 36: @@ -3059,7 +3061,7 @@ brw_program_add_label(&(yyvsp[-1].program), (yyvsp[0].string)); (yyval.program) = (yyvsp[-1].program); } -#line 3063 "gram.c" /* yacc.c:1646 */ +#line 3065 "gram.c" /* yacc.c:1646 */ break; case 37: @@ -3068,7 +3070,7 @@ brw_program_init(&(yyval.program)); brw_program_add_label(&(yyval.program), (yyvsp[0].string)); } -#line 3072 "gram.c" /* yacc.c:1646 */ +#line 3074 "gram.c" /* yacc.c:1646 */ break; case 38: @@ -3077,7 +3079,7 @@ (yyval.program).first = NULL; (yyval.program).last = NULL; } -#line 3081 "gram.c" /* yacc.c:1646 */ +#line 3083 "gram.c" /* yacc.c:1646 */ break; case 39: @@ -3085,7 +3087,7 @@ { (yyval.program) = (yyvsp[-2].program); } -#line 3089 "gram.c" /* yacc.c:1646 */ +#line 3091 "gram.c" /* yacc.c:1646 */ break; case 55: @@ -3101,7 +3103,7 @@ GEN(&(yyval.instruction))->bits1.da1.src1_reg_file = BRW_ARCHITECTURE_REGISTER_FILE; GEN(&(yyval.instruction))->bits1.da1.src1_reg_type = BRW_REGISTER_TYPE_UD; } -#line 3105 "gram.c" /* yacc.c:1646 */ +#line 3107 "gram.c" /* yacc.c:1646 */ break; case 56: @@ -3117,7 +3119,7 @@ (yyval.instruction).reloc.first_reloc_target = (yyvsp[-1].src_operand).reloc_target; (yyval.instruction).reloc.first_reloc_offset = (yyvsp[-1].src_operand).imm32; } -#line 3121 "gram.c" /* yacc.c:1646 */ +#line 3123 "gram.c" /* yacc.c:1646 */ break; case 57: @@ -3147,7 +3149,7 @@ error(&(yylsp[-3]), "'ELSE' instruction is not implemented.\n"); } } -#line 3151 "gram.c" /* yacc.c:1646 */ +#line 3153 "gram.c" /* yacc.c:1646 */ break; case 58: @@ -3174,7 +3176,7 @@ (yyval.instruction).reloc.first_reloc_target = (yyvsp[0].src_operand).reloc_target; (yyval.instruction).reloc.first_reloc_offset = (yyvsp[0].src_operand).imm32; } -#line 3178 "gram.c" /* yacc.c:1646 */ +#line 3180 "gram.c" /* yacc.c:1646 */ break; case 59: @@ -3193,7 +3195,7 @@ (yyval.instruction).reloc.second_reloc_target = (yyvsp[0].src_operand).reloc_target; (yyval.instruction).reloc.second_reloc_offset = (yyvsp[0].src_operand).imm32; } -#line 3197 "gram.c" /* yacc.c:1646 */ +#line 3199 "gram.c" /* yacc.c:1646 */ break; case 60: @@ -3229,7 +3231,7 @@ error(&(yylsp[-3]), "'WHILE' instruction is not implemented!\n"); } } -#line 3233 "gram.c" /* yacc.c:1646 */ +#line 3235 "gram.c" /* yacc.c:1646 */ break; case 61: @@ -3239,7 +3241,7 @@ memset(&(yyval.instruction), 0, sizeof((yyval.instruction))); set_instruction_opcode(&(yyval.instruction), (yyvsp[0].integer)); } -#line 3243 "gram.c" /* yacc.c:1646 */ +#line 3245 "gram.c" /* yacc.c:1646 */ break; case 62: @@ -3258,7 +3260,7 @@ set_instruction_dest(&(yyval.instruction), &dst_null_reg); set_instruction_src0(&(yyval.instruction), &src_null_reg, NULL); } -#line 3262 "gram.c" /* yacc.c:1646 */ +#line 3264 "gram.c" /* yacc.c:1646 */ break; case 63: @@ -3277,7 +3279,7 @@ dst_null_reg.width = (yyvsp[-2].integer); set_instruction_dest(&(yyval.instruction), &dst_null_reg); } -#line 3281 "gram.c" /* yacc.c:1646 */ +#line 3283 "gram.c" /* yacc.c:1646 */ break; case 64: @@ -3299,7 +3301,7 @@ set_instruction_dest(&(yyval.instruction), &dst_null_reg); set_instruction_src0(&(yyval.instruction), &src_null_reg, NULL); } -#line 3303 "gram.c" /* yacc.c:1646 */ +#line 3305 "gram.c" /* yacc.c:1646 */ break; case 65: @@ -3339,7 +3341,7 @@ (yyval.instruction).reloc.first_reloc_target = (yyvsp[-1].src_operand).reloc_target; (yyval.instruction).reloc.first_reloc_offset = (yyvsp[-1].src_operand).imm32; } -#line 3343 "gram.c" /* yacc.c:1646 */ +#line 3345 "gram.c" /* yacc.c:1646 */ break; case 66: @@ -3362,7 +3364,7 @@ (yyvsp[-1].src_operand).reg.vstride = 2; /*encoded 2*/ set_instruction_src0(&(yyval.instruction), &(yyvsp[-1].src_operand), NULL); } -#line 3366 "gram.c" /* yacc.c:1646 */ +#line 3368 "gram.c" /* yacc.c:1646 */ break; case 67: @@ -3383,7 +3385,7 @@ get_type_size(GEN(&(yyval.instruction))->bits1.da1.dest_reg_type) * (1 << (yyvsp[-2].reg).width) == 64) GEN(&(yyval.instruction))->header.compression_control = BRW_COMPRESSION_COMPRESSED; } -#line 3387 "gram.c" /* yacc.c:1646 */ +#line 3389 "gram.c" /* yacc.c:1646 */ break; case 82: @@ -3406,7 +3408,7 @@ get_type_size(GEN(&(yyval.instruction))->bits1.da1.dest_reg_type) * (1 << (yyvsp[-3].reg).width) == 64) GEN(&(yyval.instruction))->header.compression_control = BRW_COMPRESSION_COMPRESSED; } -#line 3410 "gram.c" /* yacc.c:1646 */ +#line 3412 "gram.c" /* yacc.c:1646 */ break; case 95: @@ -3429,7 +3431,7 @@ get_type_size(GEN(&(yyval.instruction))->bits1.da1.dest_reg_type) * (1 << (yyvsp[-3].reg).width) == 64) GEN(&(yyval.instruction))->header.compression_control = BRW_COMPRESSION_COMPRESSED; } -#line 3433 "gram.c" /* yacc.c:1646 */ +#line 3435 "gram.c" /* yacc.c:1646 */ break; case 113: @@ -3453,7 +3455,7 @@ YYERROR; set_instruction_options(&(yyval.instruction), (yyvsp[0].options)); } -#line 3457 "gram.c" /* yacc.c:1646 */ +#line 3459 "gram.c" /* yacc.c:1646 */ break; case 116: @@ -3535,7 +3537,7 @@ GEN(&(yyval.instruction))->bits3.generic.end_of_thread = (yyvsp[0].options).end_of_thread; } } -#line 3539 "gram.c" /* yacc.c:1646 */ +#line 3541 "gram.c" /* yacc.c:1646 */ break; case 117: @@ -3560,7 +3562,7 @@ YYERROR; } -#line 3564 "gram.c" /* yacc.c:1646 */ +#line 3566 "gram.c" /* yacc.c:1646 */ break; case 118: @@ -3588,7 +3590,7 @@ if (set_instruction_src1(&(yyval.instruction), &(yyvsp[-1].src_operand), &(yylsp[-1])) != 0) YYERROR; } -#line 3592 "gram.c" /* yacc.c:1646 */ +#line 3594 "gram.c" /* yacc.c:1646 */ break; case 119: @@ -3642,7 +3644,7 @@ GEN(&(yyval.instruction))->bits3.generic_gen5.end_of_thread = !!((yyvsp[-2].integer) & EX_DESC_EOT_MASK); } } -#line 3646 "gram.c" /* yacc.c:1646 */ +#line 3648 "gram.c" /* yacc.c:1646 */ break; case 120: @@ -3697,7 +3699,7 @@ GEN(&(yyval.instruction))->bits3.generic_gen5.end_of_thread = !!((yyvsp[-2].integer) & EX_DESC_EOT_MASK); } } -#line 3701 "gram.c" /* yacc.c:1646 */ +#line 3703 "gram.c" /* yacc.c:1646 */ break; case 121: @@ -3730,7 +3732,7 @@ GEN(&(yyval.instruction))->bits3.generic_gen5.end_of_thread = !!((yyvsp[-2].integer) & EX_DESC_EOT_MASK); } } -#line 3734 "gram.c" /* yacc.c:1646 */ +#line 3736 "gram.c" /* yacc.c:1646 */ break; case 122: @@ -3757,7 +3759,7 @@ GEN(&(yyval.instruction))->bits2.send_gen5.sfid = (yyvsp[-2].integer); } } -#line 3761 "gram.c" /* yacc.c:1646 */ +#line 3763 "gram.c" /* yacc.c:1646 */ break; case 123: @@ -3765,7 +3767,7 @@ { (yyval.integer) = (yyvsp[0].integer); } -#line 3769 "gram.c" /* yacc.c:1646 */ +#line 3771 "gram.c" /* yacc.c:1646 */ break; case 124: @@ -3792,7 +3794,7 @@ (yyval.instruction).reloc.first_reloc_target = (yyvsp[0].src_operand).reloc_target; (yyval.instruction).reloc.first_reloc_offset = (yyvsp[0].src_operand).imm32; } -#line 3796 "gram.c" /* yacc.c:1646 */ +#line 3798 "gram.c" /* yacc.c:1646 */ break; case 125: @@ -3816,7 +3818,7 @@ if (set_instruction_src1(&(yyval.instruction), &(yyvsp[-2].src_operand), &(yylsp[-2])) != 0) YYERROR; } -#line 3820 "gram.c" /* yacc.c:1646 */ +#line 3822 "gram.c" /* yacc.c:1646 */ break; case 126: @@ -3832,7 +3834,7 @@ (yyval.instruction).reloc.second_reloc_target = (yyvsp[-1].src_operand).reloc_target; (yyval.instruction).reloc.second_reloc_offset = (yyvsp[-1].src_operand).imm32; } -#line 3836 "gram.c" /* yacc.c:1646 */ +#line 3838 "gram.c" /* yacc.c:1646 */ break; case 129: @@ -3850,7 +3852,7 @@ set_instruction_src0(&(yyval.instruction), ¬ify_src, NULL); set_instruction_src1(&(yyval.instruction), &src_null_reg, NULL); } -#line 3854 "gram.c" /* yacc.c:1646 */ +#line 3856 "gram.c" /* yacc.c:1646 */ break; case 130: @@ -3859,7 +3861,7 @@ memset(&(yyval.instruction), 0, sizeof((yyval.instruction))); set_instruction_opcode(&(yyval.instruction), (yyvsp[0].integer)); } -#line 3863 "gram.c" /* yacc.c:1646 */ +#line 3865 "gram.c" /* yacc.c:1646 */ break; case 133: @@ -3875,7 +3877,7 @@ GEN(&(yyval.instruction))->bits3.generic.msg_target = BRW_SFID_NULL; } } -#line 3879 "gram.c" /* yacc.c:1646 */ +#line 3881 "gram.c" /* yacc.c:1646 */ break; case 134: @@ -3919,7 +3921,7 @@ } } } -#line 3923 "gram.c" /* yacc.c:1646 */ +#line 3925 "gram.c" /* yacc.c:1646 */ break; case 135: @@ -3944,7 +3946,7 @@ GEN(&(yyval.instruction))->bits3.math.data_type = (yyvsp[0].integer); } } -#line 3948 "gram.c" /* yacc.c:1646 */ +#line 3950 "gram.c" /* yacc.c:1646 */ break; case 136: @@ -3957,7 +3959,7 @@ GEN(&(yyval.instruction))->bits3.generic.msg_target = BRW_SFID_MESSAGE_GATEWAY; } } -#line 3961 "gram.c" /* yacc.c:1646 */ +#line 3963 "gram.c" /* yacc.c:1646 */ break; case 137: @@ -4021,7 +4023,7 @@ GEN(&(yyval.instruction))->bits3.dp_read.msg_type = (yyvsp[-1].integer); } } -#line 4025 "gram.c" /* yacc.c:1646 */ +#line 4027 "gram.c" /* yacc.c:1646 */ break; case 138: @@ -4095,7 +4097,7 @@ GEN(&(yyval.instruction))->bits3.dp_write.send_commit_msg = (yyvsp[-1].integer); } } -#line 4099 "gram.c" /* yacc.c:1646 */ +#line 4101 "gram.c" /* yacc.c:1646 */ break; case 139: @@ -4165,7 +4167,7 @@ GEN(&(yyval.instruction))->bits3.dp_write.send_commit_msg = (yyvsp[-3].integer); } } -#line 4169 "gram.c" /* yacc.c:1646 */ +#line 4171 "gram.c" /* yacc.c:1646 */ break; case 140: @@ -4193,7 +4195,7 @@ GEN(&(yyval.instruction))->bits3.urb.complete = (yyvsp[0].integer); } } -#line 4197 "gram.c" /* yacc.c:1646 */ +#line 4199 "gram.c" /* yacc.c:1646 */ break; case 141: @@ -4224,7 +4226,7 @@ } } } -#line 4228 "gram.c" /* yacc.c:1646 */ +#line 4230 "gram.c" /* yacc.c:1646 */ break; case 142: @@ -4248,7 +4250,7 @@ error (&(yylsp[-9]), "Gen6- doesn't have vme function\n"); } } -#line 4252 "gram.c" /* yacc.c:1646 */ +#line 4254 "gram.c" /* yacc.c:1646 */ break; case 143: @@ -4271,7 +4273,7 @@ GEN(&(yyval.instruction))->bits3.generic_gen5.header_present = 1; } } -#line 4275 "gram.c" /* yacc.c:1646 */ +#line 4277 "gram.c" /* yacc.c:1646 */ break; case 144: @@ -4324,85 +4326,85 @@ } } } -#line 4328 "gram.c" /* yacc.c:1646 */ +#line 4330 "gram.c" /* yacc.c:1646 */ break; case 145: #line 1964 "gram.y" /* yacc.c:1646 */ { (yyval.integer) = 1; } -#line 4334 "gram.c" /* yacc.c:1646 */ +#line 4336 "gram.c" /* yacc.c:1646 */ break; case 146: #line 1965 "gram.y" /* yacc.c:1646 */ { (yyval.integer) = 0; } -#line 4340 "gram.c" /* yacc.c:1646 */ +#line 4342 "gram.c" /* yacc.c:1646 */ break; case 147: #line 1968 "gram.y" /* yacc.c:1646 */ { (yyval.integer) = 1; } -#line 4346 "gram.c" /* yacc.c:1646 */ +#line 4348 "gram.c" /* yacc.c:1646 */ break; case 148: #line 1969 "gram.y" /* yacc.c:1646 */ { (yyval.integer) = 0; } -#line 4352 "gram.c" /* yacc.c:1646 */ +#line 4354 "gram.c" /* yacc.c:1646 */ break; case 149: #line 1972 "gram.y" /* yacc.c:1646 */ { (yyval.integer) = 1; } -#line 4358 "gram.c" /* yacc.c:1646 */ +#line 4360 "gram.c" /* yacc.c:1646 */ break; case 150: #line 1973 "gram.y" /* yacc.c:1646 */ { (yyval.integer) = 0; } -#line 4364 "gram.c" /* yacc.c:1646 */ +#line 4366 "gram.c" /* yacc.c:1646 */ break; case 151: #line 1976 "gram.y" /* yacc.c:1646 */ { (yyval.integer) = BRW_URB_SWIZZLE_TRANSPOSE; } -#line 4370 "gram.c" /* yacc.c:1646 */ +#line 4372 "gram.c" /* yacc.c:1646 */ break; case 152: #line 1977 "gram.y" /* yacc.c:1646 */ { (yyval.integer) = BRW_URB_SWIZZLE_INTERLEAVE; } -#line 4376 "gram.c" /* yacc.c:1646 */ +#line 4378 "gram.c" /* yacc.c:1646 */ break; case 153: #line 1978 "gram.y" /* yacc.c:1646 */ { (yyval.integer) = BRW_URB_SWIZZLE_NONE; } -#line 4382 "gram.c" /* yacc.c:1646 */ +#line 4384 "gram.c" /* yacc.c:1646 */ break; case 168: #line 1991 "gram.y" /* yacc.c:1646 */ { (yyval.integer) = 0; } -#line 4388 "gram.c" /* yacc.c:1646 */ +#line 4390 "gram.c" /* yacc.c:1646 */ break; case 169: #line 1992 "gram.y" /* yacc.c:1646 */ { (yyval.integer) = 1; } -#line 4394 "gram.c" /* yacc.c:1646 */ +#line 4396 "gram.c" /* yacc.c:1646 */ break; case 170: #line 1995 "gram.y" /* yacc.c:1646 */ { (yyval.integer) = 0; } -#line 4400 "gram.c" /* yacc.c:1646 */ +#line 4402 "gram.c" /* yacc.c:1646 */ break; case 171: #line 1996 "gram.y" /* yacc.c:1646 */ { (yyval.integer) = 1; } -#line 4406 "gram.c" /* yacc.c:1646 */ +#line 4408 "gram.c" /* yacc.c:1646 */ break; case 174: @@ -4411,7 +4413,7 @@ (yyval.reg) = (yyvsp[-1].symbol_reg).reg; (yyval.reg).hstride = resolve_dst_region(&(yyvsp[-1].symbol_reg), (yyvsp[0].integer)); } -#line 4415 "gram.c" /* yacc.c:1646 */ +#line 4417 "gram.c" /* yacc.c:1646 */ break; case 175: @@ -4425,7 +4427,7 @@ (yyval.reg).dw1.bits.writemask = (yyvsp[-1].reg).dw1.bits.writemask; (yyval.reg).type = (yyvsp[0].regtype).type; } -#line 4429 "gram.c" /* yacc.c:1646 */ +#line 4431 "gram.c" /* yacc.c:1646 */ break; case 176: @@ -4435,7 +4437,7 @@ (yyval.reg).hstride = resolve_dst_region(NULL, (yyvsp[-1].integer)); (yyval.reg).type = (yyvsp[0].regtype).type; } -#line 4439 "gram.c" /* yacc.c:1646 */ +#line 4441 "gram.c" /* yacc.c:1646 */ break; case 177: @@ -4445,7 +4447,7 @@ (yyval.reg).hstride = 1; (yyval.reg).type = BRW_REGISTER_TYPE_UW; } -#line 4449 "gram.c" /* yacc.c:1646 */ +#line 4451 "gram.c" /* yacc.c:1646 */ break; case 178: @@ -4455,7 +4457,7 @@ (yyval.reg).hstride = 1; (yyval.reg).type = BRW_REGISTER_TYPE_UD; } -#line 4459 "gram.c" /* yacc.c:1646 */ +#line 4461 "gram.c" /* yacc.c:1646 */ break; case 179: @@ -4465,7 +4467,7 @@ (yyval.reg).hstride = 1; (yyval.reg).type = BRW_REGISTER_TYPE_UD; } -#line 4469 "gram.c" /* yacc.c:1646 */ +#line 4471 "gram.c" /* yacc.c:1646 */ break; case 180: @@ -4475,7 +4477,7 @@ (yyval.reg).hstride = resolve_dst_region(NULL, (yyvsp[-1].integer)); (yyval.reg).type = (yyvsp[0].regtype).type; } -#line 4479 "gram.c" /* yacc.c:1646 */ +#line 4481 "gram.c" /* yacc.c:1646 */ break; case 185: @@ -4489,7 +4491,7 @@ memcpy(&(yyval.symbol_reg), dcl_reg, sizeof(*dcl_reg)); free((yyvsp[0].string)); // $1 has been malloc'ed by strdup } -#line 4493 "gram.c" /* yacc.c:1646 */ +#line 4495 "gram.c" /* yacc.c:1646 */ break; case 186: @@ -4497,7 +4499,7 @@ { (yyval.symbol_reg)=(yyvsp[0].symbol_reg); } -#line 4501 "gram.c" /* yacc.c:1646 */ +#line 4503 "gram.c" /* yacc.c:1646 */ break; case 187: @@ -4512,7 +4514,7 @@ (yyval.symbol_reg).reg.nr += (yyvsp[-1].integer); free((yyvsp[-3].string)); } -#line 4516 "gram.c" /* yacc.c:1646 */ +#line 4518 "gram.c" /* yacc.c:1646 */ break; case 188: @@ -4535,7 +4537,7 @@ } free((yyvsp[-5].string)); } -#line 4539 "gram.c" /* yacc.c:1646 */ +#line 4541 "gram.c" /* yacc.c:1646 */ break; case 189: @@ -4544,7 +4546,7 @@ (yyval.reg) = (yyvsp[0].reg); (yyval.reg).address_mode = BRW_ADDRESS_DIRECT; } -#line 4548 "gram.c" /* yacc.c:1646 */ +#line 4550 "gram.c" /* yacc.c:1646 */ break; case 190: @@ -4553,7 +4555,7 @@ (yyval.reg) = (yyvsp[0].reg); (yyval.reg).address_mode = BRW_ADDRESS_DIRECT; } -#line 4557 "gram.c" /* yacc.c:1646 */ +#line 4559 "gram.c" /* yacc.c:1646 */ break; case 191: @@ -4562,7 +4564,7 @@ (yyval.reg) = (yyvsp[0].reg); (yyval.reg).address_mode = BRW_ADDRESS_REGISTER_INDIRECT_REGISTER; } -#line 4566 "gram.c" /* yacc.c:1646 */ +#line 4568 "gram.c" /* yacc.c:1646 */ break; case 192: @@ -4571,7 +4573,7 @@ (yyval.reg) = (yyvsp[0].reg); (yyval.reg).address_mode = BRW_ADDRESS_REGISTER_INDIRECT_REGISTER; } -#line 4575 "gram.c" /* yacc.c:1646 */ +#line 4577 "gram.c" /* yacc.c:1646 */ break; case 200: @@ -4634,7 +4636,7 @@ (yyval.src_operand).reg.type = (yyvsp[0].integer); (yyval.src_operand).reg.dw1.ud = d; } -#line 4638 "gram.c" /* yacc.c:1646 */ +#line 4640 "gram.c" /* yacc.c:1646 */ break; case 202: @@ -4646,7 +4648,7 @@ (yyval.src_operand).reg.hstride = (yyvsp[-1].region).horiz_stride; (yyval.src_operand).default_region = (yyvsp[-1].region).is_default; } -#line 4650 "gram.c" /* yacc.c:1646 */ +#line 4652 "gram.c" /* yacc.c:1646 */ break; case 203: @@ -4664,7 +4666,7 @@ (yyval.src_operand).reg.negate = 0; (yyval.src_operand).reg.abs = 0; } -#line 4668 "gram.c" /* yacc.c:1646 */ +#line 4670 "gram.c" /* yacc.c:1646 */ break; case 204: @@ -4672,7 +4674,7 @@ { set_direct_src_operand(&(yyval.src_operand), &(yyvsp[0].reg), BRW_REGISTER_TYPE_UB); } -#line 4676 "gram.c" /* yacc.c:1646 */ +#line 4678 "gram.c" /* yacc.c:1646 */ break; case 205: @@ -4680,7 +4682,7 @@ { set_direct_src_operand(&(yyval.src_operand), &(yyvsp[0].reg), BRW_REGISTER_TYPE_UD); } -#line 4684 "gram.c" /* yacc.c:1646 */ +#line 4686 "gram.c" /* yacc.c:1646 */ break; case 206: @@ -4688,7 +4690,7 @@ { set_direct_src_operand(&(yyval.src_operand), &(yyvsp[0].reg), BRW_REGISTER_TYPE_UD); } -#line 4692 "gram.c" /* yacc.c:1646 */ +#line 4694 "gram.c" /* yacc.c:1646 */ break; case 207: @@ -4696,7 +4698,7 @@ { set_direct_src_operand(&(yyval.src_operand), &(yyvsp[0].reg), BRW_REGISTER_TYPE_UD); } -#line 4700 "gram.c" /* yacc.c:1646 */ +#line 4702 "gram.c" /* yacc.c:1646 */ break; case 208: @@ -4709,7 +4711,7 @@ } (yyval.src_operand).default_region = 1; } -#line 4713 "gram.c" /* yacc.c:1646 */ +#line 4715 "gram.c" /* yacc.c:1646 */ break; case 212: @@ -4720,7 +4722,7 @@ (yyval.reg).nr = (yyvsp[0].symbol_reg).reg.nr; (yyval.reg).subnr = (yyvsp[0].symbol_reg).reg.subnr; } -#line 4724 "gram.c" /* yacc.c:1646 */ +#line 4726 "gram.c" /* yacc.c:1646 */ break; case 217: @@ -4748,7 +4750,7 @@ (yyval.src_operand).reg.negate = (yyvsp[-4].integer); (yyval.src_operand).reg.abs = (yyvsp[-3].integer); } -#line 4752 "gram.c" /* yacc.c:1646 */ +#line 4754 "gram.c" /* yacc.c:1646 */ break; case 218: @@ -4770,7 +4772,7 @@ (yyval.src_operand).reg.type = (yyvsp[0].regtype).type; } } -#line 4774 "gram.c" /* yacc.c:1646 */ +#line 4776 "gram.c" /* yacc.c:1646 */ break; case 219: @@ -4790,7 +4792,7 @@ (yyval.src_operand).reg.abs = (yyvsp[-4].integer); (yyval.src_operand).reg.dw1.bits.swizzle = (yyvsp[-1].src_operand).reg.dw1.bits.swizzle; } -#line 4794 "gram.c" /* yacc.c:1646 */ +#line 4796 "gram.c" /* yacc.c:1646 */ break; case 221: @@ -4809,7 +4811,7 @@ (yyval.src_operand).reg.abs = (yyvsp[-4].integer); (yyval.src_operand).reg.dw1.bits.swizzle = (yyvsp[0].src_operand).reg.dw1.bits.swizzle; } -#line 4813 "gram.c" /* yacc.c:1646 */ +#line 4815 "gram.c" /* yacc.c:1646 */ break; case 222: @@ -4821,7 +4823,7 @@ (yyval.reg).subnr = (yyvsp[-2].reg).subnr; (yyval.reg).dw1.bits.indirect_offset = (yyvsp[0].integer); } -#line 4825 "gram.c" /* yacc.c:1646 */ +#line 4827 "gram.c" /* yacc.c:1646 */ break; case 223: @@ -4831,13 +4833,13 @@ (yyval.reg).subnr = (yyvsp[0].reg).subnr; (yyval.reg).dw1.bits.indirect_offset = 0; } -#line 4835 "gram.c" /* yacc.c:1646 */ +#line 4837 "gram.c" /* yacc.c:1646 */ break; case 224: #line 2377 "gram.y" /* yacc.c:1646 */ { (yyval.integer) = 0; } -#line 4841 "gram.c" /* yacc.c:1646 */ +#line 4843 "gram.c" /* yacc.c:1646 */ break; case 226: @@ -4845,7 +4847,7 @@ { (yyval.integer) = (yyvsp[0].integer); } -#line 4849 "gram.c" /* yacc.c:1646 */ +#line 4851 "gram.c" /* yacc.c:1646 */ break; case 227: @@ -4854,7 +4856,7 @@ /* Default to subreg 0 if unspecified. */ (yyval.integer) = 0; } -#line 4858 "gram.c" /* yacc.c:1646 */ +#line 4860 "gram.c" /* yacc.c:1646 */ break; case 228: @@ -4865,7 +4867,7 @@ (yyval.reg).nr = (yyvsp[-1].integer); (yyval.reg).subnr = (yyvsp[0].integer); } -#line 4869 "gram.c" /* yacc.c:1646 */ +#line 4871 "gram.c" /* yacc.c:1646 */ break; case 229: @@ -4876,7 +4878,7 @@ (yyval.reg).subnr = (yyvsp[-1].reg).subnr; (yyval.reg).dw1.bits.indirect_offset = (yyvsp[-1].reg).dw1.bits.indirect_offset; } -#line 4880 "gram.c" /* yacc.c:1646 */ +#line 4882 "gram.c" /* yacc.c:1646 */ break; case 230: @@ -4887,7 +4889,7 @@ (yyval.reg).nr = (yyvsp[-1].integer); (yyval.reg).subnr = (yyvsp[0].integer); } -#line 4891 "gram.c" /* yacc.c:1646 */ +#line 4893 "gram.c" /* yacc.c:1646 */ break; case 231: @@ -4898,7 +4900,7 @@ (yyval.reg).subnr = (yyvsp[-1].reg).subnr; (yyval.reg).dw1.bits.indirect_offset = (yyvsp[-1].reg).dw1.bits.indirect_offset; } -#line 4902 "gram.c" /* yacc.c:1646 */ +#line 4904 "gram.c" /* yacc.c:1646 */ break; case 232: @@ -4912,7 +4914,7 @@ (yyval.reg).nr = BRW_ARF_ADDRESS | (yyvsp[-1].integer); (yyval.reg).subnr = (yyvsp[0].integer); } -#line 4916 "gram.c" /* yacc.c:1646 */ +#line 4918 "gram.c" /* yacc.c:1646 */ break; case 233: @@ -4925,7 +4927,7 @@ (yyval.reg).nr = BRW_ARF_ACCUMULATOR | (yyvsp[-1].integer); (yyval.reg).subnr = (yyvsp[0].integer); } -#line 4929 "gram.c" /* yacc.c:1646 */ +#line 4931 "gram.c" /* yacc.c:1646 */ break; case 234: @@ -4944,7 +4946,7 @@ (yyval.reg).nr = BRW_ARF_FLAG | (yyvsp[-1].integer); (yyval.reg).subnr = (yyvsp[0].integer); } -#line 4948 "gram.c" /* yacc.c:1646 */ +#line 4950 "gram.c" /* yacc.c:1646 */ break; case 235: @@ -4958,7 +4960,7 @@ (yyval.reg).nr = BRW_ARF_MASK; (yyval.reg).subnr = (yyvsp[0].integer); } -#line 4962 "gram.c" /* yacc.c:1646 */ +#line 4964 "gram.c" /* yacc.c:1646 */ break; case 236: @@ -4969,7 +4971,7 @@ (yyval.reg).nr = BRW_ARF_MASK; (yyval.reg).subnr = (yyvsp[0].integer); } -#line 4973 "gram.c" /* yacc.c:1646 */ +#line 4975 "gram.c" /* yacc.c:1646 */ break; case 241: @@ -4982,7 +4984,7 @@ (yyval.reg).nr = BRW_ARF_MASK_STACK; (yyval.reg).subnr = (yyvsp[0].integer); } -#line 4986 "gram.c" /* yacc.c:1646 */ +#line 4988 "gram.c" /* yacc.c:1646 */ break; case 242: @@ -4993,7 +4995,7 @@ (yyval.reg).nr = BRW_ARF_MASK_STACK; (yyval.reg).subnr = (yyvsp[0].integer); } -#line 4997 "gram.c" /* yacc.c:1646 */ +#line 4999 "gram.c" /* yacc.c:1646 */ break; case 245: @@ -5016,7 +5018,7 @@ (yyval.reg).subnr = 0; } } -#line 5020 "gram.c" /* yacc.c:1646 */ +#line 5022 "gram.c" /* yacc.c:1646 */ break; case 246: @@ -5033,7 +5035,7 @@ (yyval.reg).nr = BRW_ARF_STATE | (yyvsp[-1].integer); (yyval.reg).subnr = (yyvsp[0].integer); } -#line 5037 "gram.c" /* yacc.c:1646 */ +#line 5039 "gram.c" /* yacc.c:1646 */ break; case 247: @@ -5049,7 +5051,7 @@ (yyval.reg).nr = BRW_ARF_CONTROL | (yyvsp[-1].integer); (yyval.reg).subnr = (yyvsp[0].integer); } -#line 5053 "gram.c" /* yacc.c:1646 */ +#line 5055 "gram.c" /* yacc.c:1646 */ break; case 248: @@ -5060,7 +5062,7 @@ (yyval.reg).nr = BRW_ARF_IP; (yyval.reg).subnr = 0; } -#line 5064 "gram.c" /* yacc.c:1646 */ +#line 5066 "gram.c" /* yacc.c:1646 */ break; case 249: @@ -5071,7 +5073,7 @@ (yyval.reg).nr = BRW_ARF_NULL; (yyval.reg).subnr = 0; } -#line 5075 "gram.c" /* yacc.c:1646 */ +#line 5077 "gram.c" /* yacc.c:1646 */ break; case 250: @@ -5085,7 +5087,7 @@ (yyval.src_operand).reg.type = BRW_REGISTER_TYPE_D; (yyval.src_operand).imm32 = (yyvsp[0].integer) & 0x0000ffff; } -#line 5089 "gram.c" /* yacc.c:1646 */ +#line 5091 "gram.c" /* yacc.c:1646 */ break; case 251: @@ -5096,7 +5098,7 @@ (yyval.src_operand).reg.type = BRW_REGISTER_TYPE_D; (yyval.src_operand).reloc_target = (yyvsp[0].string); } -#line 5100 "gram.c" /* yacc.c:1646 */ +#line 5102 "gram.c" /* yacc.c:1646 */ break; case 252: @@ -5107,7 +5109,7 @@ (yyval.src_operand).reg.type = BRW_REGISTER_TYPE_D; (yyval.src_operand).reloc_target = (yyvsp[0].string); } -#line 5111 "gram.c" /* yacc.c:1646 */ +#line 5113 "gram.c" /* yacc.c:1646 */ break; case 253: @@ -5118,7 +5120,7 @@ (yyval.src_operand).reg.type = BRW_REGISTER_TYPE_D; (yyval.src_operand).imm32 = (yyvsp[0].integer); } -#line 5122 "gram.c" /* yacc.c:1646 */ +#line 5124 "gram.c" /* yacc.c:1646 */ break; case 254: @@ -5130,7 +5132,7 @@ (yyval.src_operand).reg.hstride = (yyvsp[-1].region).horiz_stride; (yyval.src_operand).default_region = (yyvsp[-1].region).is_default; } -#line 5134 "gram.c" /* yacc.c:1646 */ +#line 5136 "gram.c" /* yacc.c:1646 */ break; case 255: @@ -5146,7 +5148,7 @@ (yyval.src_operand).reg.width = (yyvsp[0].symbol_reg).src_region.width; (yyval.src_operand).reg.hstride = (yyvsp[0].symbol_reg).src_region.horiz_stride; } -#line 5150 "gram.c" /* yacc.c:1646 */ +#line 5152 "gram.c" /* yacc.c:1646 */ break; case 256: @@ -5162,7 +5164,7 @@ (yyval.src_operand).reg.width = (yyvsp[-1].region).width; (yyval.src_operand).reg.hstride = (yyvsp[-1].region).horiz_stride; } -#line 5166 "gram.c" /* yacc.c:1646 */ +#line 5168 "gram.c" /* yacc.c:1646 */ break; case 257: @@ -5170,7 +5172,7 @@ { (yyval.integer) = DEFAULT_DSTREGION; } -#line 5174 "gram.c" /* yacc.c:1646 */ +#line 5176 "gram.c" /* yacc.c:1646 */ break; case 258: @@ -5184,7 +5186,7 @@ (yyval.integer) = ffs((yyvsp[-1].integer)); } -#line 5188 "gram.c" /* yacc.c:1646 */ +#line 5190 "gram.c" /* yacc.c:1646 */ break; case 259: @@ -5197,7 +5199,7 @@ (yyval.region).horiz_stride = ffs(0); (yyval.region).is_default = 1; } -#line 5201 "gram.c" /* yacc.c:1646 */ +#line 5203 "gram.c" /* yacc.c:1646 */ break; case 260: @@ -5209,7 +5211,7 @@ (yyval.region).width = BRW_WIDTH_1; (yyval.region).horiz_stride = ffs(0); } -#line 5213 "gram.c" /* yacc.c:1646 */ +#line 5215 "gram.c" /* yacc.c:1646 */ break; case 261: @@ -5220,7 +5222,7 @@ (yyval.region).width = ffs((yyvsp[-3].integer)) - 1; (yyval.region).horiz_stride = ffs((yyvsp[-1].integer)); } -#line 5224 "gram.c" /* yacc.c:1646 */ +#line 5226 "gram.c" /* yacc.c:1646 */ break; case 262: @@ -5231,7 +5233,7 @@ (yyval.region).width = ffs((yyvsp[-3].integer)) - 1; (yyval.region).horiz_stride = ffs((yyvsp[-1].integer)); } -#line 5235 "gram.c" /* yacc.c:1646 */ +#line 5237 "gram.c" /* yacc.c:1646 */ break; case 263: @@ -5242,55 +5244,55 @@ (yyval.region).width = ffs((yyvsp[-3].integer)) - 1; (yyval.region).horiz_stride = ffs((yyvsp[-1].integer)); } -#line 5246 "gram.c" /* yacc.c:1646 */ +#line 5248 "gram.c" /* yacc.c:1646 */ break; case 266: #line 2761 "gram.y" /* yacc.c:1646 */ { (yyval.regtype).type = program_defaults.register_type;(yyval.regtype).is_default = 1;} -#line 5252 "gram.c" /* yacc.c:1646 */ +#line 5254 "gram.c" /* yacc.c:1646 */ break; case 267: #line 2762 "gram.y" /* yacc.c:1646 */ { (yyval.regtype).type = BRW_REGISTER_TYPE_F;(yyval.regtype).is_default = 0; } -#line 5258 "gram.c" /* yacc.c:1646 */ +#line 5260 "gram.c" /* yacc.c:1646 */ break; case 268: #line 2763 "gram.y" /* yacc.c:1646 */ { (yyval.regtype).type = BRW_REGISTER_TYPE_UD;(yyval.regtype).is_default = 0; } -#line 5264 "gram.c" /* yacc.c:1646 */ +#line 5266 "gram.c" /* yacc.c:1646 */ break; case 269: #line 2764 "gram.y" /* yacc.c:1646 */ { (yyval.regtype).type = BRW_REGISTER_TYPE_D;(yyval.regtype).is_default = 0; } -#line 5270 "gram.c" /* yacc.c:1646 */ +#line 5272 "gram.c" /* yacc.c:1646 */ break; case 270: #line 2765 "gram.y" /* yacc.c:1646 */ { (yyval.regtype).type = BRW_REGISTER_TYPE_UW;(yyval.regtype).is_default = 0; } -#line 5276 "gram.c" /* yacc.c:1646 */ +#line 5278 "gram.c" /* yacc.c:1646 */ break; case 271: #line 2766 "gram.y" /* yacc.c:1646 */ { (yyval.regtype).type = BRW_REGISTER_TYPE_W;(yyval.regtype).is_default = 0; } -#line 5282 "gram.c" /* yacc.c:1646 */ +#line 5284 "gram.c" /* yacc.c:1646 */ break; case 272: #line 2767 "gram.y" /* yacc.c:1646 */ { (yyval.regtype).type = BRW_REGISTER_TYPE_UB;(yyval.regtype).is_default = 0; } -#line 5288 "gram.c" /* yacc.c:1646 */ +#line 5290 "gram.c" /* yacc.c:1646 */ break; case 273: #line 2768 "gram.y" /* yacc.c:1646 */ { (yyval.regtype).type = BRW_REGISTER_TYPE_B;(yyval.regtype).is_default = 0; } -#line 5294 "gram.c" /* yacc.c:1646 */ +#line 5296 "gram.c" /* yacc.c:1646 */ break; case 274: @@ -5299,49 +5301,49 @@ /* XXX change to default when pragma parse is done */ (yyval.integer) = BRW_REGISTER_TYPE_D; } -#line 5303 "gram.c" /* yacc.c:1646 */ +#line 5305 "gram.c" /* yacc.c:1646 */ break; case 275: #line 2776 "gram.y" /* yacc.c:1646 */ { (yyval.integer) = BRW_REGISTER_TYPE_F; } -#line 5309 "gram.c" /* yacc.c:1646 */ +#line 5311 "gram.c" /* yacc.c:1646 */ break; case 276: #line 2777 "gram.y" /* yacc.c:1646 */ { (yyval.integer) = BRW_REGISTER_TYPE_UD; } -#line 5315 "gram.c" /* yacc.c:1646 */ +#line 5317 "gram.c" /* yacc.c:1646 */ break; case 277: #line 2778 "gram.y" /* yacc.c:1646 */ { (yyval.integer) = BRW_REGISTER_TYPE_D; } -#line 5321 "gram.c" /* yacc.c:1646 */ +#line 5323 "gram.c" /* yacc.c:1646 */ break; case 278: #line 2779 "gram.y" /* yacc.c:1646 */ { (yyval.integer) = BRW_REGISTER_TYPE_UW; } -#line 5327 "gram.c" /* yacc.c:1646 */ +#line 5329 "gram.c" /* yacc.c:1646 */ break; case 279: #line 2780 "gram.y" /* yacc.c:1646 */ { (yyval.integer) = BRW_REGISTER_TYPE_W; } -#line 5333 "gram.c" /* yacc.c:1646 */ +#line 5335 "gram.c" /* yacc.c:1646 */ break; case 280: #line 2781 "gram.y" /* yacc.c:1646 */ { (yyval.integer) = BRW_REGISTER_TYPE_V; } -#line 5339 "gram.c" /* yacc.c:1646 */ +#line 5341 "gram.c" /* yacc.c:1646 */ break; case 281: #line 2782 "gram.y" /* yacc.c:1646 */ { (yyval.integer) = BRW_REGISTER_TYPE_VF; } -#line 5345 "gram.c" /* yacc.c:1646 */ +#line 5347 "gram.c" /* yacc.c:1646 */ break; case 282: @@ -5349,7 +5351,7 @@ { (yyval.src_operand).reg.dw1.bits.swizzle = BRW_SWIZZLE_NOOP; } -#line 5353 "gram.c" /* yacc.c:1646 */ +#line 5355 "gram.c" /* yacc.c:1646 */ break; case 283: @@ -5357,7 +5359,7 @@ { (yyval.src_operand).reg.dw1.bits.swizzle = BRW_SWIZZLE4((yyvsp[0].integer), (yyvsp[0].integer), (yyvsp[0].integer), (yyvsp[0].integer)); } -#line 5361 "gram.c" /* yacc.c:1646 */ +#line 5363 "gram.c" /* yacc.c:1646 */ break; case 284: @@ -5365,7 +5367,7 @@ { (yyval.src_operand).reg.dw1.bits.swizzle = BRW_SWIZZLE4((yyvsp[-3].integer), (yyvsp[-2].integer), (yyvsp[-1].integer), (yyvsp[0].integer)); } -#line 5369 "gram.c" /* yacc.c:1646 */ +#line 5371 "gram.c" /* yacc.c:1646 */ break; case 289: @@ -5373,7 +5375,7 @@ { (yyval.reg).dw1.bits.writemask = BRW_WRITEMASK_XYZW; } -#line 5377 "gram.c" /* yacc.c:1646 */ +#line 5379 "gram.c" /* yacc.c:1646 */ break; case 290: @@ -5381,67 +5383,67 @@ { (yyval.reg).dw1.bits.writemask = (yyvsp[-3].integer) | (yyvsp[-2].integer) | (yyvsp[-1].integer) | (yyvsp[0].integer); } -#line 5385 "gram.c" /* yacc.c:1646 */ +#line 5387 "gram.c" /* yacc.c:1646 */ break; case 291: #line 2820 "gram.y" /* yacc.c:1646 */ { (yyval.integer) = 0; } -#line 5391 "gram.c" /* yacc.c:1646 */ +#line 5393 "gram.c" /* yacc.c:1646 */ break; case 292: #line 2821 "gram.y" /* yacc.c:1646 */ { (yyval.integer) = 1 << BRW_CHANNEL_X; } -#line 5397 "gram.c" /* yacc.c:1646 */ +#line 5399 "gram.c" /* yacc.c:1646 */ break; case 293: #line 2824 "gram.y" /* yacc.c:1646 */ { (yyval.integer) = 0; } -#line 5403 "gram.c" /* yacc.c:1646 */ +#line 5405 "gram.c" /* yacc.c:1646 */ break; case 294: #line 2825 "gram.y" /* yacc.c:1646 */ { (yyval.integer) = 1 << BRW_CHANNEL_Y; } -#line 5409 "gram.c" /* yacc.c:1646 */ +#line 5411 "gram.c" /* yacc.c:1646 */ break; case 295: #line 2828 "gram.y" /* yacc.c:1646 */ { (yyval.integer) = 0; } -#line 5415 "gram.c" /* yacc.c:1646 */ +#line 5417 "gram.c" /* yacc.c:1646 */ break; case 296: #line 2829 "gram.y" /* yacc.c:1646 */ { (yyval.integer) = 1 << BRW_CHANNEL_Z; } -#line 5421 "gram.c" /* yacc.c:1646 */ +#line 5423 "gram.c" /* yacc.c:1646 */ break; case 297: #line 2832 "gram.y" /* yacc.c:1646 */ { (yyval.integer) = 0; } -#line 5427 "gram.c" /* yacc.c:1646 */ +#line 5429 "gram.c" /* yacc.c:1646 */ break; case 298: #line 2833 "gram.y" /* yacc.c:1646 */ { (yyval.integer) = 1 << BRW_CHANNEL_W; } -#line 5433 "gram.c" /* yacc.c:1646 */ +#line 5435 "gram.c" /* yacc.c:1646 */ break; case 299: #line 2837 "gram.y" /* yacc.c:1646 */ { (yyval.imm32).r = imm32_d; (yyval.imm32).u.d = (yyvsp[0].integer); } -#line 5439 "gram.c" /* yacc.c:1646 */ +#line 5441 "gram.c" /* yacc.c:1646 */ break; case 300: #line 2838 "gram.y" /* yacc.c:1646 */ { (yyval.imm32).r = imm32_f; (yyval.imm32).u.f = (yyvsp[0].number); } -#line 5445 "gram.c" /* yacc.c:1646 */ +#line 5447 "gram.c" /* yacc.c:1646 */ break; case 301: @@ -5452,7 +5454,7 @@ (yyval.predicate).flag_subreg_nr = 0; (yyval.predicate).pred_inverse = 0; } -#line 5456 "gram.c" /* yacc.c:1646 */ +#line 5458 "gram.c" /* yacc.c:1646 */ break; case 302: @@ -5463,139 +5465,139 @@ (yyval.predicate).flag_subreg_nr = (yyvsp[-2].reg).subnr; (yyval.predicate).pred_inverse = (yyvsp[-3].integer); } -#line 5467 "gram.c" /* yacc.c:1646 */ +#line 5469 "gram.c" /* yacc.c:1646 */ break; case 303: #line 2858 "gram.y" /* yacc.c:1646 */ { (yyval.integer) = 0; } -#line 5473 "gram.c" /* yacc.c:1646 */ +#line 5475 "gram.c" /* yacc.c:1646 */ break; case 304: #line 2859 "gram.y" /* yacc.c:1646 */ { (yyval.integer) = 0; } -#line 5479 "gram.c" /* yacc.c:1646 */ +#line 5481 "gram.c" /* yacc.c:1646 */ break; case 305: #line 2860 "gram.y" /* yacc.c:1646 */ { (yyval.integer) = 1; } -#line 5485 "gram.c" /* yacc.c:1646 */ +#line 5487 "gram.c" /* yacc.c:1646 */ break; case 306: #line 2863 "gram.y" /* yacc.c:1646 */ { (yyval.integer) = BRW_PREDICATE_NORMAL; } -#line 5491 "gram.c" /* yacc.c:1646 */ +#line 5493 "gram.c" /* yacc.c:1646 */ break; case 307: #line 2864 "gram.y" /* yacc.c:1646 */ { (yyval.integer) = BRW_PREDICATE_ALIGN16_REPLICATE_X; } -#line 5497 "gram.c" /* yacc.c:1646 */ +#line 5499 "gram.c" /* yacc.c:1646 */ break; case 308: #line 2865 "gram.y" /* yacc.c:1646 */ { (yyval.integer) = BRW_PREDICATE_ALIGN16_REPLICATE_Y; } -#line 5503 "gram.c" /* yacc.c:1646 */ +#line 5505 "gram.c" /* yacc.c:1646 */ break; case 309: #line 2866 "gram.y" /* yacc.c:1646 */ { (yyval.integer) = BRW_PREDICATE_ALIGN16_REPLICATE_Z; } -#line 5509 "gram.c" /* yacc.c:1646 */ +#line 5511 "gram.c" /* yacc.c:1646 */ break; case 310: #line 2867 "gram.y" /* yacc.c:1646 */ { (yyval.integer) = BRW_PREDICATE_ALIGN16_REPLICATE_W; } -#line 5515 "gram.c" /* yacc.c:1646 */ +#line 5517 "gram.c" /* yacc.c:1646 */ break; case 311: #line 2868 "gram.y" /* yacc.c:1646 */ { (yyval.integer) = BRW_PREDICATE_ALIGN1_ANYV; } -#line 5521 "gram.c" /* yacc.c:1646 */ +#line 5523 "gram.c" /* yacc.c:1646 */ break; case 312: #line 2869 "gram.y" /* yacc.c:1646 */ { (yyval.integer) = BRW_PREDICATE_ALIGN1_ALLV; } -#line 5527 "gram.c" /* yacc.c:1646 */ +#line 5529 "gram.c" /* yacc.c:1646 */ break; case 313: #line 2870 "gram.y" /* yacc.c:1646 */ { (yyval.integer) = BRW_PREDICATE_ALIGN1_ANY2H; } -#line 5533 "gram.c" /* yacc.c:1646 */ +#line 5535 "gram.c" /* yacc.c:1646 */ break; case 314: #line 2871 "gram.y" /* yacc.c:1646 */ { (yyval.integer) = BRW_PREDICATE_ALIGN1_ALL2H; } -#line 5539 "gram.c" /* yacc.c:1646 */ +#line 5541 "gram.c" /* yacc.c:1646 */ break; case 315: #line 2872 "gram.y" /* yacc.c:1646 */ { (yyval.integer) = BRW_PREDICATE_ALIGN1_ANY4H; } -#line 5545 "gram.c" /* yacc.c:1646 */ +#line 5547 "gram.c" /* yacc.c:1646 */ break; case 316: #line 2873 "gram.y" /* yacc.c:1646 */ { (yyval.integer) = BRW_PREDICATE_ALIGN1_ALL4H; } -#line 5551 "gram.c" /* yacc.c:1646 */ +#line 5553 "gram.c" /* yacc.c:1646 */ break; case 317: #line 2874 "gram.y" /* yacc.c:1646 */ { (yyval.integer) = BRW_PREDICATE_ALIGN1_ANY8H; } -#line 5557 "gram.c" /* yacc.c:1646 */ +#line 5559 "gram.c" /* yacc.c:1646 */ break; case 318: #line 2875 "gram.y" /* yacc.c:1646 */ { (yyval.integer) = BRW_PREDICATE_ALIGN1_ALL8H; } -#line 5563 "gram.c" /* yacc.c:1646 */ +#line 5565 "gram.c" /* yacc.c:1646 */ break; case 319: #line 2876 "gram.y" /* yacc.c:1646 */ { (yyval.integer) = BRW_PREDICATE_ALIGN1_ANY16H; } -#line 5569 "gram.c" /* yacc.c:1646 */ +#line 5571 "gram.c" /* yacc.c:1646 */ break; case 320: #line 2877 "gram.y" /* yacc.c:1646 */ { (yyval.integer) = BRW_PREDICATE_ALIGN1_ALL16H; } -#line 5575 "gram.c" /* yacc.c:1646 */ +#line 5577 "gram.c" /* yacc.c:1646 */ break; case 321: #line 2880 "gram.y" /* yacc.c:1646 */ { (yyval.integer) = 0; } -#line 5581 "gram.c" /* yacc.c:1646 */ +#line 5583 "gram.c" /* yacc.c:1646 */ break; case 322: #line 2881 "gram.y" /* yacc.c:1646 */ { (yyval.integer) = 1; } -#line 5587 "gram.c" /* yacc.c:1646 */ +#line 5589 "gram.c" /* yacc.c:1646 */ break; case 323: #line 2884 "gram.y" /* yacc.c:1646 */ { (yyval.integer) = 0; } -#line 5593 "gram.c" /* yacc.c:1646 */ +#line 5595 "gram.c" /* yacc.c:1646 */ break; case 324: #line 2885 "gram.y" /* yacc.c:1646 */ { (yyval.integer) = 1; } -#line 5599 "gram.c" /* yacc.c:1646 */ +#line 5601 "gram.c" /* yacc.c:1646 */ break; case 325: @@ -5603,7 +5605,7 @@ { (yyval.integer) = ffs(program_defaults.execute_size) - 1; } -#line 5607 "gram.c" /* yacc.c:1646 */ +#line 5609 "gram.c" /* yacc.c:1646 */ break; case 326: @@ -5618,19 +5620,19 @@ (yyval.integer) = ffs((yyvsp[-1].integer)) - 1; } -#line 5622 "gram.c" /* yacc.c:1646 */ +#line 5624 "gram.c" /* yacc.c:1646 */ break; case 327: #line 2905 "gram.y" /* yacc.c:1646 */ { (yyval.integer) = BRW_INSTRUCTION_NORMAL; } -#line 5628 "gram.c" /* yacc.c:1646 */ +#line 5630 "gram.c" /* yacc.c:1646 */ break; case 328: #line 2906 "gram.y" /* yacc.c:1646 */ { (yyval.integer) = BRW_INSTRUCTION_SATURATE; } -#line 5634 "gram.c" /* yacc.c:1646 */ +#line 5636 "gram.c" /* yacc.c:1646 */ break; case 329: @@ -5640,7 +5642,7 @@ (yyval.condition).flag_reg_nr = 0; (yyval.condition).flag_subreg_nr = -1; } -#line 5644 "gram.c" /* yacc.c:1646 */ +#line 5646 "gram.c" /* yacc.c:1646 */ break; case 330: @@ -5650,25 +5652,25 @@ (yyval.condition).flag_reg_nr = ((yyvsp[0].reg).nr & 0xF); (yyval.condition).flag_subreg_nr = (yyvsp[0].reg).subnr; } -#line 5654 "gram.c" /* yacc.c:1646 */ +#line 5656 "gram.c" /* yacc.c:1646 */ break; case 331: #line 2921 "gram.y" /* yacc.c:1646 */ { (yyval.integer) = BRW_CONDITIONAL_NONE; } -#line 5660 "gram.c" /* yacc.c:1646 */ +#line 5662 "gram.c" /* yacc.c:1646 */ break; case 343: #line 2937 "gram.y" /* yacc.c:1646 */ { memset(&(yyval.options), 0, sizeof((yyval.options))); } -#line 5666 "gram.c" /* yacc.c:1646 */ +#line 5668 "gram.c" /* yacc.c:1646 */ break; case 344: #line 2939 "gram.y" /* yacc.c:1646 */ { (yyval.options) = (yyvsp[-1].options); } -#line 5672 "gram.c" /* yacc.c:1646 */ +#line 5674 "gram.c" /* yacc.c:1646 */ break; case 345: @@ -5677,7 +5679,7 @@ (yyval.options) = (yyvsp[-2].options); add_option(&(yyval.options), (yyvsp[0].integer)); } -#line 5681 "gram.c" /* yacc.c:1646 */ +#line 5683 "gram.c" /* yacc.c:1646 */ break; case 346: @@ -5686,7 +5688,7 @@ (yyval.options) = (yyvsp[-1].options); add_option(&(yyval.options), (yyvsp[0].integer)); } -#line 5690 "gram.c" /* yacc.c:1646 */ +#line 5692 "gram.c" /* yacc.c:1646 */ break; case 347: @@ -5694,83 +5696,83 @@ { memset(&(yyval.options), 0, sizeof((yyval.options))); } -#line 5698 "gram.c" /* yacc.c:1646 */ +#line 5700 "gram.c" /* yacc.c:1646 */ break; case 348: #line 2958 "gram.y" /* yacc.c:1646 */ { (yyval.integer) = ALIGN1; } -#line 5704 "gram.c" /* yacc.c:1646 */ +#line 5706 "gram.c" /* yacc.c:1646 */ break; case 349: #line 2959 "gram.y" /* yacc.c:1646 */ { (yyval.integer) = ALIGN16; } -#line 5710 "gram.c" /* yacc.c:1646 */ +#line 5712 "gram.c" /* yacc.c:1646 */ break; case 350: #line 2960 "gram.y" /* yacc.c:1646 */ { (yyval.integer) = SECHALF; } -#line 5716 "gram.c" /* yacc.c:1646 */ +#line 5718 "gram.c" /* yacc.c:1646 */ break; case 351: #line 2961 "gram.y" /* yacc.c:1646 */ { (yyval.integer) = COMPR; } -#line 5722 "gram.c" /* yacc.c:1646 */ +#line 5724 "gram.c" /* yacc.c:1646 */ break; case 352: #line 2962 "gram.y" /* yacc.c:1646 */ { (yyval.integer) = SWITCH; } -#line 5728 "gram.c" /* yacc.c:1646 */ +#line 5730 "gram.c" /* yacc.c:1646 */ break; case 353: #line 2963 "gram.y" /* yacc.c:1646 */ { (yyval.integer) = ATOMIC; } -#line 5734 "gram.c" /* yacc.c:1646 */ +#line 5736 "gram.c" /* yacc.c:1646 */ break; case 354: #line 2964 "gram.y" /* yacc.c:1646 */ { (yyval.integer) = NODDCHK; } -#line 5740 "gram.c" /* yacc.c:1646 */ +#line 5742 "gram.c" /* yacc.c:1646 */ break; case 355: #line 2965 "gram.y" /* yacc.c:1646 */ { (yyval.integer) = NODDCLR; } -#line 5746 "gram.c" /* yacc.c:1646 */ +#line 5748 "gram.c" /* yacc.c:1646 */ break; case 356: #line 2966 "gram.y" /* yacc.c:1646 */ { (yyval.integer) = MASK_DISABLE; } -#line 5752 "gram.c" /* yacc.c:1646 */ +#line 5754 "gram.c" /* yacc.c:1646 */ break; case 357: #line 2967 "gram.y" /* yacc.c:1646 */ { (yyval.integer) = BREAKPOINT; } -#line 5758 "gram.c" /* yacc.c:1646 */ +#line 5760 "gram.c" /* yacc.c:1646 */ break; case 358: #line 2968 "gram.y" /* yacc.c:1646 */ { (yyval.integer) = ACCWRCTRL; } -#line 5764 "gram.c" /* yacc.c:1646 */ +#line 5766 "gram.c" /* yacc.c:1646 */ break; case 359: #line 2969 "gram.y" /* yacc.c:1646 */ { (yyval.integer) = EOT; } -#line 5770 "gram.c" /* yacc.c:1646 */ +#line 5772 "gram.c" /* yacc.c:1646 */ break; -#line 5774 "gram.c" /* yacc.c:1646 */ +#line 5776 "gram.c" /* yacc.c:1646 */ default: break; } /* User semantic actions sometimes alter yychar, and that requires diff -Nru intel-gpu-tools-1.13/assembler/gram.h intel-gpu-tools-1.15/assembler/gram.h --- intel-gpu-tools-1.13/assembler/gram.h 2015-12-02 16:17:41.000000000 +0000 +++ intel-gpu-tools-1.15/assembler/gram.h 2016-05-31 17:03:43.000000000 +0000 @@ -1,8 +1,8 @@ -/* A Bison parser, made by GNU Bison 3.0.2. */ +/* A Bison parser, made by GNU Bison 3.0.4. */ /* Bison interface for Yacc-like parsers in C - Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. + Copyright (C) 1984, 1989-1990, 2000-2015 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 @@ -471,7 +471,7 @@ /* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE YYSTYPE; + union YYSTYPE { #line 437 "gram.y" /* yacc.c:1909 */ @@ -494,6 +494,8 @@ #line 496 "gram.h" /* yacc.c:1909 */ }; + +typedef union YYSTYPE YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define YYSTYPE_IS_DECLARED 1 #endif diff -Nru intel-gpu-tools-1.13/assembler/lex.c intel-gpu-tools-1.15/assembler/lex.c --- intel-gpu-tools-1.13/assembler/lex.c 2015-12-02 16:17:40.000000000 +0000 +++ intel-gpu-tools-1.15/assembler/lex.c 2016-05-31 17:03:43.000000000 +0000 @@ -7,8 +7,8 @@ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 37 +#define YY_FLEX_MINOR_VERSION 6 +#define YY_FLEX_SUBMINOR_VERSION 0 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif @@ -141,7 +141,15 @@ /* Size of default input buffer. */ #ifndef YY_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k. + * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. + * Ditto for the __ia64__ case accordingly. + */ +#define YY_BUF_SIZE 32768 +#else #define YY_BUF_SIZE 16384 +#endif /* __ia64__ */ #endif /* The state buf must be large enough to hold one state per character in the main buffer. @@ -180,6 +188,13 @@ if ( yytext[yyl] == '\n' )\ --yylineno;\ }while(0) + #define YY_LINENO_REWIND_TO(dst) \ + do {\ + const char *p;\ + for ( p = yy_cp-1; p >= (dst); --p)\ + if ( *p == '\n' )\ + --yylineno;\ + }while(0) /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ @@ -214,7 +229,7 @@ /* Number of characters read into yy_ch_buf, not including EOB * characters. */ - yy_size_t yy_n_chars; + int yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to @@ -284,7 +299,7 @@ /* yy_hold_char holds the character lost when yytext is formed. */ static char yy_hold_char; -static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */ +static int yy_n_chars; /* number of characters read into yy_ch_buf */ yy_size_t yyleng; /* Points to current character in buffer. */ @@ -356,11 +371,17 @@ int yylineno = 1; extern char *yytext; +#ifdef yytext_ptr +#undef yytext_ptr +#endif #define yytext_ptr yytext static yy_state_type yy_get_previous_state (void ); static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); static int yy_get_next_buffer (void ); +#if defined(__GNUC__) && __GNUC__ >= 3 +__attribute__((__noreturn__)) +#endif static void yy_fatal_error (yyconst char msg[] ); /* Done after the current pattern has been matched and before the @@ -460,7 +481,7 @@ 0, 0, 0, 0, 0, 180, 179, 0 } ; -static yyconst flex_int32_t yy_ec[256] = +static yyconst YY_CHAR yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, @@ -492,7 +513,7 @@ 1, 1, 1, 1, 1 } ; -static yyconst flex_int32_t yy_meta[86] = +static yyconst YY_CHAR yy_meta[86] = { 0, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, @@ -505,7 +526,7 @@ 4, 4, 4, 1, 1 } ; -static yyconst flex_int16_t yy_base[693] = +static yyconst flex_uint16_t yy_base[693] = { 0, 0, 0, 83, 85, 87, 91, 80, 88, 598, 593, 172, 198, 224, 305, 584, 1695, 110, 1695, 77, 63, @@ -667,7 +688,7 @@ } ; -static yyconst flex_int16_t yy_nxt[1781] = +static yyconst flex_uint16_t yy_nxt[1781] = { 0, 16, 17, 18, 16, 17, 16, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 29, 29, 29, @@ -1123,7 +1144,7 @@ -#line 1127 "lex.c" +#line 1148 "lex.c" #define INITIAL 0 #define BLOCK_COMMENT 1 @@ -1162,11 +1183,11 @@ FILE *yyget_in (void ); -void yyset_in (FILE * in_str ); +void yyset_in (FILE * _in_str ); FILE *yyget_out (void ); -void yyset_out (FILE * out_str ); +void yyset_out (FILE * _out_str ); yy_size_t yyget_leng (void ); @@ -1174,7 +1195,7 @@ int yyget_lineno (void ); -void yyset_lineno (int line_number ); +void yyset_lineno (int _line_number ); /* Macros after this point can all be overridden by user definitions in * section 1. @@ -1188,8 +1209,12 @@ #endif #endif +#ifndef YY_NO_UNPUT + static void yyunput (int c,char *buf_ptr ); +#endif + #ifndef yytext_ptr static void yy_flex_strncpy (char *,yyconst char *,int ); #endif @@ -1210,7 +1235,12 @@ /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k */ +#define YY_READ_BUF_SIZE 16384 +#else #define YY_READ_BUF_SIZE 8192 +#endif /* __ia64__ */ #endif /* Copy whatever the last rule matched to the standard output. */ @@ -1297,7 +1327,7 @@ /* Code executed at the end of each rule. */ #ifndef YY_BREAK -#define YY_BREAK break; +#define YY_BREAK /*LINTED*/break; #endif #define YY_RULE_SETUP \ @@ -1307,14 +1337,10 @@ */ YY_DECL { - register yy_state_type yy_current_state; - register char *yy_cp, *yy_bp; - register int yy_act; + yy_state_type yy_current_state; + char *yy_cp, *yy_bp; + int yy_act; -#line 30 "lex.l" - -#line 1317 "lex.c" - if ( !(yy_init) ) { (yy_init) = 1; @@ -1341,7 +1367,12 @@ yy_load_buffer_state( ); } - while ( 1 ) /* loops until end-of-file is reached */ + { +#line 30 "lex.l" + +#line 1374 "lex.c" + + while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ { yy_cp = (yy_c_buf_p); @@ -1357,7 +1388,7 @@ yy_match: do { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; + YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; @@ -2797,7 +2828,7 @@ #line 475 "lex.l" ECHO; YY_BREAK -#line 2801 "lex.c" +#line 2832 "lex.c" case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(BLOCK_COMMENT): case YY_STATE_EOF(CHANNEL): @@ -2934,6 +2965,7 @@ "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ + } /* end of user's declarations */ } /* end of yylex */ /* yy_get_next_buffer - try to read in a new buffer @@ -2945,9 +2977,9 @@ */ static int yy_get_next_buffer (void) { - register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; - register char *source = (yytext_ptr); - register int number_to_move, i; + char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + char *source = (yytext_ptr); + yy_size_t number_to_move, i; int ret_val; if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) @@ -2976,7 +3008,7 @@ /* Try to read more data. */ /* First move last chars to start of buffer. */ - number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; + number_to_move = (yy_size_t) ((yy_c_buf_p) - (yytext_ptr)) - 1; for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); @@ -3058,9 +3090,9 @@ else ret_val = EOB_ACT_CONTINUE_SCAN; - if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + if ((int) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { /* Extend the array by 50%, plus the number we really need. */ - yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); + int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); @@ -3079,14 +3111,14 @@ static yy_state_type yy_get_previous_state (void) { - register yy_state_type yy_current_state; - register char *yy_cp; + yy_state_type yy_current_state; + char *yy_cp; yy_current_state = (yy_start); for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) { - register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; @@ -3111,10 +3143,10 @@ */ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) { - register int yy_is_jam; - register char *yy_cp = (yy_c_buf_p); + int yy_is_jam; + char *yy_cp = (yy_c_buf_p); - register YY_CHAR yy_c = 1; + YY_CHAR yy_c = 1; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; @@ -3132,9 +3164,11 @@ return yy_is_jam ? 0 : yy_current_state; } - static void yyunput (int c, register char * yy_bp ) +#ifndef YY_NO_UNPUT + + static void yyunput (int c, char * yy_bp ) { - register char *yy_cp; + char *yy_cp; yy_cp = (yy_c_buf_p); @@ -3144,10 +3178,10 @@ if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) { /* need to shift things up to make room */ /* +2 for EOB chars. */ - register yy_size_t number_to_move = (yy_n_chars) + 2; - register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ + yy_size_t number_to_move = (yy_n_chars) + 2; + char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; - register char *source = + char *source = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) @@ -3173,6 +3207,8 @@ (yy_c_buf_p) = yy_cp; } +#endif + #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput (void) @@ -3327,7 +3363,7 @@ if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - b->yy_buf_size = size; + b->yy_buf_size = (yy_size_t)size; /* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. @@ -3482,7 +3518,7 @@ * scanner will even need a stack. We use 2 instead of 1 to avoid an * immediate realloc on the next call. */ - num_to_alloc = 1; + num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc (num_to_alloc * sizeof(struct yy_buffer_state*) ); @@ -3499,7 +3535,7 @@ if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ /* Increase the buffer to prepare for a possible push. */ - int grow_size = 8 /* arbitrary grow size */; + yy_size_t grow_size = 8 /* arbitrary grow size */; num_to_alloc = (yy_buffer_stack_max) + grow_size; (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc @@ -3607,7 +3643,7 @@ static void yy_fatal_error (yyconst char* msg ) { - (void) fprintf( stderr, "%s\n", msg ); + (void) fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); } @@ -3673,29 +3709,29 @@ } /** Set the current line number. - * @param line_number + * @param _line_number line number * */ -void yyset_lineno (int line_number ) +void yyset_lineno (int _line_number ) { - yylineno = line_number; + yylineno = _line_number; } /** Set the input stream. This does not discard the current * input buffer. - * @param in_str A readable stream. + * @param _in_str A readable stream. * * @see yy_switch_to_buffer */ -void yyset_in (FILE * in_str ) +void yyset_in (FILE * _in_str ) { - yyin = in_str ; + yyin = _in_str ; } -void yyset_out (FILE * out_str ) +void yyset_out (FILE * _out_str ) { - yyout = out_str ; + yyout = _out_str ; } int yyget_debug (void) @@ -3703,9 +3739,9 @@ return yy_flex_debug; } -void yyset_debug (int bdebug ) +void yyset_debug (int _bdebug ) { - yy_flex_debug = bdebug ; + yy_flex_debug = _bdebug ; } static int yy_init_globals (void) @@ -3768,7 +3804,8 @@ #ifndef yytext_ptr static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) { - register int i; + + int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } @@ -3777,7 +3814,7 @@ #ifdef YY_NEED_STRLEN static int yy_flex_strlen (yyconst char * s ) { - register int n; + int n; for ( n = 0; s[n]; ++n ) ; @@ -3787,11 +3824,12 @@ void *yyalloc (yy_size_t size ) { - return (void *) malloc( size ); + return (void *) malloc( size ); } void *yyrealloc (void * ptr, yy_size_t size ) { + /* The cast to (char *) in the following accommodates both * implementations that use char* generic pointers, and those * that use void* generic pointers. It works with the latter @@ -3804,7 +3842,7 @@ void yyfree (void * ptr ) { - free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ + free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ } #define YYTABLES_NAME "yytables" diff -Nru intel-gpu-tools-1.13/assembler/Makefile.in intel-gpu-tools-1.15/assembler/Makefile.in --- intel-gpu-tools-1.13/assembler/Makefile.in 2015-12-02 16:47:58.000000000 +0000 +++ intel-gpu-tools-1.15/assembler/Makefile.in 2016-05-31 17:03:32.000000000 +0000 @@ -90,6 +90,7 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ +target_triplet = @target@ bin_PROGRAMS = intel-gen4asm$(EXEEXT) intel-gen4disasm$(EXEEXT) subdir = assembler ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 @@ -310,6 +311,8 @@ DRM_LIBS = @DRM_LIBS@ DRM_NOUVEAU_CFLAGS = @DRM_NOUVEAU_CFLAGS@ DRM_NOUVEAU_LIBS = @DRM_NOUVEAU_LIBS@ +DRM_VC4_CFLAGS = @DRM_VC4_CFLAGS@ +DRM_VC4_LIBS = @DRM_VC4_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -354,6 +357,7 @@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MAN_SUBSTS = @MAN_SUBSTS@ @@ -398,6 +402,7 @@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ THREAD_CFLAGS = @THREAD_CFLAGS@ +TIMER_LIBS = @TIMER_LIBS@ VERSION = @VERSION@ XORG_MAN_PAGE = @XORG_MAN_PAGE@ XRANDR_CFLAGS = @XRANDR_CFLAGS@ @@ -452,11 +457,16 @@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ +target = @target@ target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ diff -Nru intel-gpu-tools-1.13/assembler/test/Makefile.in intel-gpu-tools-1.15/assembler/test/Makefile.in --- intel-gpu-tools-1.13/assembler/test/Makefile.in 2015-12-02 16:47:58.000000000 +0000 +++ intel-gpu-tools-1.15/assembler/test/Makefile.in 2016-05-31 17:03:32.000000000 +0000 @@ -87,6 +87,7 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ +target_triplet = @target@ XFAIL_TESTS = subdir = assembler/test ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 @@ -363,6 +364,8 @@ DRM_LIBS = @DRM_LIBS@ DRM_NOUVEAU_CFLAGS = @DRM_NOUVEAU_CFLAGS@ DRM_NOUVEAU_LIBS = @DRM_NOUVEAU_LIBS@ +DRM_VC4_CFLAGS = @DRM_VC4_CFLAGS@ +DRM_VC4_LIBS = @DRM_VC4_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -407,6 +410,7 @@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MAN_SUBSTS = @MAN_SUBSTS@ @@ -451,6 +455,7 @@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ THREAD_CFLAGS = @THREAD_CFLAGS@ +TIMER_LIBS = @TIMER_LIBS@ VERSION = @VERSION@ XORG_MAN_PAGE = @XORG_MAN_PAGE@ XRANDR_CFLAGS = @XRANDR_CFLAGS@ @@ -505,11 +510,16 @@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ +target = @target@ target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ diff -Nru intel-gpu-tools-1.13/benchmarks/gem_blt.c intel-gpu-tools-1.15/benchmarks/gem_blt.c --- intel-gpu-tools-1.13/benchmarks/gem_blt.c 2015-11-13 14:08:54.000000000 +0000 +++ intel-gpu-tools-1.15/benchmarks/gem_blt.c 2016-05-23 10:51:28.000000000 +0000 @@ -53,6 +53,37 @@ static int has_64bit_reloc; +static double +elapsed(const struct timespec *start, const struct timespec *end) +{ + return (end->tv_sec - start->tv_sec) + 1e-9*(end->tv_nsec - start->tv_nsec); +} + +static int baseline(uint64_t bytes, int milliseconds) +{ + struct timespec start, end; + const int size = 64*1024*1024; + int count = 0; + void *mem; + + mem = malloc(size); + if (mem == NULL) + return 1; + + clock_gettime(CLOCK_MONOTONIC, &start); + do { + memset(mem, count, size); + count++; + clock_gettime(CLOCK_MONOTONIC, &end); + if (elapsed(&start, &end) > 0.1) + break; + } while (1); + + free(mem); + + return ceil(1e-3*milliseconds/elapsed(&start, &end) * (count * size) / bytes); +} + static int gem_linear_blt(int fd, uint32_t *batch, int offset, @@ -147,27 +178,19 @@ return (b+2 - batch) * sizeof(uint32_t); } -static double elapsed(const struct timespec *start, const struct timespec *end) -{ - return (end->tv_sec - start->tv_sec) + 1e-9*(end->tv_nsec - start->tv_nsec); -} +#define SYNC 0x1 -static int __gem_execbuf(int fd, struct drm_i915_gem_execbuffer2 *execbuf) -{ - int err = 0; - if (drmIoctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, execbuf)) - err = -errno; - return err; -} - -static int run(int object, int batch, int count, int set, int reps) +static int run(int object, int batch, int time, int reps, int ncpus, unsigned flags) { struct drm_i915_gem_execbuffer2 execbuf; struct drm_i915_gem_exec_object2 exec[3]; struct drm_i915_gem_relocation_entry *reloc; uint32_t *buf, handle, src, dst; int fd, len, gen, size, nreloc; - int ring; + int ring, count; + double *shared; + + shared = mmap(0, 4096, PROT_WRITE, MAP_SHARED | MAP_ANON, -1, 0); size = ALIGN(batch * 64, 4096); reloc = malloc(sizeof(*reloc)*size/32*2); @@ -237,25 +260,41 @@ if (execbuf.flags & LOCAL_I915_EXEC_HANDLE_LUT) execbuf.flags |= LOCAL_I915_EXEC_NO_RELOC; + /* Guess how many loops we need for 0.1s */ + count = baseline((uint64_t)object * batch, 100) / ncpus; + if (flags & SYNC) { + time *= count / 2; + count = 1; + } + while (reps--) { - double min = HUGE_VAL; + memset(shared, 0, 4096); + + igt_fork(child, ncpus) { + double min = HUGE_VAL; + + for (int s = 0; s <= time / 100; s++) { + struct timespec start, end; + double t; + + clock_gettime(CLOCK_MONOTONIC, &start); + for (int loop = 0; loop < count; loop++) + gem_execbuf(fd, &execbuf); + gem_sync(fd, handle); + clock_gettime(CLOCK_MONOTONIC, &end); + + t = elapsed(&start, &end); + if (t < min) + min = t; + } - for (int s = 0; s < set; s++) { - struct timespec start, end; - double t; - - clock_gettime(CLOCK_MONOTONIC, &start); - for (int loop = 0; loop < count; loop++) - gem_execbuf(fd, &execbuf); - gem_sync(fd, handle); - clock_gettime(CLOCK_MONOTONIC, &end); - - t = elapsed(&start, &end); - if (t < min) - min = t; + shared[child] = object/(1024*1024.)*batch*count/min; } + igt_waitchildren(); - printf("%7.3f\n", object/(1024*1024.)*batch*count/min); + for (int child = 0; child < ncpus; child++) + shared[ncpus] += shared[child]; + printf("%7.3f\n", shared[ncpus] / ncpus); } close(fd); @@ -265,20 +304,15 @@ int main(int argc, char **argv) { int size = 1024*1024; - int count = 1; int reps = 13; - int set = 30; + int time = 2000; + int ncpus = 1; int batch = 1; + unsigned flags = 0; int c; - while ((c = getopt (argc, argv, "c:r:s:b:S:")) != -1) { + while ((c = getopt (argc, argv, "Ss:b:r:t:f")) != -1) { switch (c) { - case 'c': - count = atoi(optarg); - if (count < 1) - count = 1; - break; - case 's': size = atoi(optarg); if (size < 4096) @@ -286,9 +320,13 @@ break; case 'S': - set = atoi(optarg); - if (set < 1) - set = 1; + flags |= SYNC; + break; + + case 't': + time = atoi(optarg); + if (time < 1) + time = 1; break; case 'r': @@ -303,10 +341,14 @@ batch = 1; break; + case 'f': + ncpus = sysconf(_SC_NPROCESSORS_ONLN); + break; + default: break; } } - return run(size, batch, count, set, reps); + return run(size, batch, time, reps, ncpus, flags); } diff -Nru intel-gpu-tools-1.13/benchmarks/gem_create.c intel-gpu-tools-1.15/benchmarks/gem_create.c --- intel-gpu-tools-1.13/benchmarks/gem_create.c 2015-11-12 17:30:48.000000000 +0000 +++ intel-gpu-tools-1.15/benchmarks/gem_create.c 2016-05-23 10:51:28.000000000 +0000 @@ -49,15 +49,6 @@ #define LOCAL_I915_EXEC_NO_RELOC (1<<11) #define LOCAL_I915_EXEC_HANDLE_LUT (1<<12) -static int __gem_execbuf(int fd, struct drm_i915_gem_execbuffer2 *execbuf) -{ - int err = 0; - if (drmIoctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, execbuf)) - err = -errno; - return err; -} - - static double elapsed(const struct timespec *start, const struct timespec *end) { @@ -92,9 +83,10 @@ int size = 0; int busy = 0; int reps = 13; + int ncpus = 1; int c, n, s; - while ((c = getopt (argc, argv, "bs:r:")) != -1) { + while ((c = getopt (argc, argv, "bs:r:f")) != -1) { switch (c) { case 's': size = atoi(optarg); @@ -106,6 +98,10 @@ reps = 1; break; + case 'f': + ncpus = sysconf(_SC_NPROCESSORS_ONLN); + break; + case 'b': busy = true; break; @@ -147,28 +143,41 @@ igt_stats_fini(&stats); } } else { + double *shared; + + shared = mmap(0, 4096, PROT_WRITE, MAP_SHARED | MAP_ANON, -1, 0); for (n = 0; n < reps; n++) { - struct timespec start, end; - uint64_t count = 0; + memset(shared, 0, 4096); + + igt_fork(child, ncpus) { + struct timespec start, end; + uint64_t count = 0; + + clock_gettime(CLOCK_MONOTONIC, &start); + do { + for (c = 0; c < 1000; c++) { + uint32_t handle; + + handle = gem_create(fd, size); + gem_set_domain(fd, handle, + I915_GEM_DOMAIN_GTT, + I915_GEM_DOMAIN_GTT); + if (busy) + make_busy(fd, handle); + gem_close(fd, handle); + } + count += c; + clock_gettime(CLOCK_MONOTONIC, &end); + } while (end.tv_sec - start.tv_sec < 2); + + shared[child] = count / elapsed(&start, &end); + } + igt_waitchildren(); - clock_gettime(CLOCK_MONOTONIC, &start); - do { - for (c = 0; c < 1000; c++) { - uint32_t handle; - - handle = gem_create(fd, size); - gem_set_domain(fd, handle, - I915_GEM_DOMAIN_GTT, - I915_GEM_DOMAIN_GTT); - if (busy) - make_busy(fd, handle); - gem_close(fd, handle); - } - count += c; - clock_gettime(CLOCK_MONOTONIC, &end); - } while (end.tv_sec - start.tv_sec < 2); + for (int child = 0; child < ncpus; child++) + shared[ncpus] += shared[child]; - printf("%f\n", count / elapsed(&start, &end)); + printf("%7.3f\n", shared[ncpus]); } } diff -Nru intel-gpu-tools-1.13/benchmarks/gem_exec_ctx.c intel-gpu-tools-1.15/benchmarks/gem_exec_ctx.c --- intel-gpu-tools-1.13/benchmarks/gem_exec_ctx.c 2015-11-27 14:38:53.000000000 +0000 +++ intel-gpu-tools-1.15/benchmarks/gem_exec_ctx.c 2016-05-23 10:51:28.000000000 +0000 @@ -45,23 +45,15 @@ #include "igt_stats.h" enum mode { NOP, CREATE, SWITCH, DEFAULT }; +#define SYNC 0x1 #define LOCAL_I915_EXEC_NO_RELOC (1<<11) #define LOCAL_I915_EXEC_HANDLE_LUT (1<<12) -static uint64_t elapsed(const struct timespec *start, - const struct timespec *end, - int loop) +static double elapsed(const struct timespec *start, + const struct timespec *end) { - return (1000000000ULL*(end->tv_sec - start->tv_sec) + (end->tv_nsec - start->tv_nsec))/loop; -} - -static int __gem_execbuf(int fd, struct drm_i915_gem_execbuffer2 *execbuf) -{ - int err = 0; - if (drmIoctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, execbuf)) - err = -errno; - return err; + return (end->tv_sec - start->tv_sec) + 1e-9*(end->tv_nsec - start->tv_nsec); } static uint32_t batch(int fd) @@ -82,22 +74,28 @@ return create.ctx_id; } -static int loop(unsigned ring, int reps, enum mode mode) +static int loop(unsigned ring, + int reps, + enum mode mode, + int ncpus, + unsigned flags) { struct drm_i915_gem_execbuffer2 execbuf; - struct drm_i915_gem_exec_object2 gem_exec; - int count, fds[2], fd; - uint32_t ctx; + struct drm_i915_gem_exec_object2 obj; + double *shared; + int fds[2], fd; + + shared = mmap(0, 4096, PROT_WRITE, MAP_SHARED | MAP_ANON, -1, 0); fd = fds[0] = drm_open_driver(DRIVER_INTEL); fds[1] = drm_open_driver(DRIVER_INTEL); - memset(&gem_exec, 0, sizeof(gem_exec)); - gem_exec.handle = batch(fd); - igt_assert(gem_open(fds[1], gem_flink(fds[0], gem_exec.handle)) == gem_exec.handle); + memset(&obj, 0, sizeof(obj)); + obj.handle = batch(fd); + igt_assert(gem_open(fds[1], gem_flink(fds[0], obj.handle)) == obj.handle); memset(&execbuf, 0, sizeof(execbuf)); - execbuf.buffers_ptr = (uintptr_t)&gem_exec; + execbuf.buffers_ptr = (uintptr_t)&obj; execbuf.buffer_count = 1; execbuf.flags = ring; execbuf.flags |= LOCAL_I915_EXEC_HANDLE_LUT; @@ -113,20 +111,26 @@ if (__gem_execbuf(fd, &execbuf)) return 77; } - ctx = gem_context_create(fd); + if (mode != DEFAULT && mode != NOP) + gem_context_destroy(fd, execbuf.rsvd1); - for (count = 1; count <= 1<<16; count <<= 1) { - igt_stats_t stats; - int n; + while (reps--) { + sleep(1); /* wait for the hw to go back to sleep */ - igt_stats_init_with_size(&stats, reps); + memset(shared, 0, 4096); - for (n = 0; n < reps; n++) { + igt_fork(child, ncpus) { struct timespec start, end; - int loops = count; - sleep(1); /* wait for the hw to go back to sleep */ + unsigned count = 0; + uint32_t ctx = 0; + + if (mode != DEFAULT && mode != NOP) { + execbuf.rsvd1 = __gem_context_create(fd); + ctx = gem_context_create(fd); + } + clock_gettime(CLOCK_MONOTONIC, &start); - while (loops--) { + do { uint32_t tmp; switch (mode) { case CREATE: @@ -147,17 +151,33 @@ case NOP: break; } - do_ioctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, &execbuf); + gem_execbuf(fd, &execbuf); + count++; if (mode == CREATE) gem_context_destroy(fd, ctx); - } - gem_sync(fd, gem_exec.handle); + + if (flags & SYNC) + gem_sync(fd, obj.handle); + + clock_gettime(CLOCK_MONOTONIC, &end); + } while (elapsed(&start, &end) < 2.); + + gem_sync(fd, obj.handle); + clock_gettime(CLOCK_MONOTONIC, &end); - igt_stats_push(&stats, elapsed(&start, &end, count)); + shared[child] = 1e6*elapsed(&start, &end) / count; + + if (mode != DEFAULT && mode != NOP) { + if (mode != CREATE) + gem_context_destroy(fd, ctx); + gem_context_destroy(fd, execbuf.rsvd1); + } } + igt_waitchildren(); - printf("%7.3f\n", igt_stats_get_trimean(&stats)/1000); - igt_stats_fini(&stats); + for (int child = 0; child < ncpus; child++) + shared[ncpus] += shared[child]; + printf("%7.3f\n", shared[ncpus] / ncpus); } return 0; } @@ -165,11 +185,13 @@ int main(int argc, char **argv) { unsigned ring = I915_EXEC_RENDER; + unsigned flags = 0; enum mode mode = NOP; - int reps = 13; + int reps = 1; + int ncpus = 1; int c; - while ((c = getopt (argc, argv, "e:r:b:")) != -1) { + while ((c = getopt (argc, argv, "e:r:b:sf")) != -1) { switch (c) { case 'e': if (strcmp(optarg, "rcs") == 0) @@ -197,16 +219,24 @@ abort(); break; + case 'f': + ncpus = sysconf(_SC_NPROCESSORS_ONLN); + break; + case 'r': reps = atoi(optarg); if (reps < 1) reps = 1; break; + case 's': + flags |= SYNC; + break; + default: break; } } - return loop(ring, reps, mode); + return loop(ring, reps, mode, ncpus, flags); } diff -Nru intel-gpu-tools-1.13/benchmarks/gem_exec_fault.c intel-gpu-tools-1.15/benchmarks/gem_exec_fault.c --- intel-gpu-tools-1.13/benchmarks/gem_exec_fault.c 1970-01-01 00:00:00.000000000 +0000 +++ intel-gpu-tools-1.15/benchmarks/gem_exec_fault.c 2016-05-23 10:51:28.000000000 +0000 @@ -0,0 +1,199 @@ +/* + * 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 + * + */ + +/* Measure the time it to takes to bind/unbind objects from the ppGTT */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "drm.h" +#include "ioctl_wrappers.h" +#include "drmtest.h" +#include "intel_io.h" +#include "igt_stats.h" + +#define LOCAL_I915_EXEC_NO_RELOC (1<<11) +#define LOCAL_I915_EXEC_HANDLE_LUT (1<<12) + +#define LOCAL_I915_EXEC_BSD_SHIFT (13) +#define LOCAL_I915_EXEC_BSD_MASK (3 << LOCAL_I915_EXEC_BSD_SHIFT) + +#define ENGINE_FLAGS (I915_EXEC_RING_MASK | LOCAL_I915_EXEC_BSD_MASK) + +static double elapsed(const struct timespec *start, + const struct timespec *end) +{ + return (end->tv_sec - start->tv_sec) + 1e-9*(end->tv_nsec - start->tv_nsec); +} + +static uint32_t batch(int fd, int size) +{ + const uint32_t buf[] = {MI_BATCH_BUFFER_END}; + uint32_t handle = gem_create(fd, size); + gem_write(fd, handle, 0, buf, sizeof(buf)); + return handle; +} + +static int loop(int size, unsigned ring, int reps, int ncpus, unsigned flags) +{ + struct drm_i915_gem_execbuffer2 execbuf; + struct drm_i915_gem_exec_object2 obj; + unsigned engines[16]; + unsigned nengine; + double *shared; + int fd; + + shared = mmap(0, 4096, PROT_WRITE, MAP_SHARED | MAP_ANON, -1, 0); + + fd = drm_open_driver(DRIVER_INTEL); + + memset(&obj, 0, sizeof(obj)); + obj.handle = batch(fd, size); + + memset(&execbuf, 0, sizeof(execbuf)); + execbuf.buffers_ptr = (uintptr_t)&obj; + execbuf.buffer_count = 1; + execbuf.flags |= LOCAL_I915_EXEC_HANDLE_LUT; + execbuf.flags |= LOCAL_I915_EXEC_NO_RELOC; + if (__gem_execbuf(fd, &execbuf)) { + execbuf.flags = 0; + if (__gem_execbuf(fd, &execbuf)) + return 77; + } + gem_close(fd, obj.handle); + + nengine = 0; + if (ring == -1) { + for (ring = 1; ring < 16; ring++) { + execbuf.flags &= ~ENGINE_FLAGS; + execbuf.flags |= ring; + if (__gem_execbuf(fd, &execbuf) == 0) + engines[nengine++] = ring; + } + } else + engines[nengine++] = ring; + + while (reps--) { + memset(shared, 0, 4096); + + igt_fork(child, ncpus) { + struct timespec start, end; + unsigned count = 0; + + obj.handle = batch(fd, size); + + clock_gettime(CLOCK_MONOTONIC, &start); + do { + for (int inner = 0; inner < 1024; inner++) { + execbuf.flags &= ~ENGINE_FLAGS; + execbuf.flags |= engines[count++ % nengine]; + /* fault in */ + obj.alignment = 0; + gem_execbuf(fd, &execbuf); + + /* fault out */ + obj.alignment = 1ull << 63; + __gem_execbuf(fd, &execbuf); + } + + clock_gettime(CLOCK_MONOTONIC, &end); + } while (elapsed(&start, &end) < 2.); + + gem_sync(fd, obj.handle); + clock_gettime(CLOCK_MONOTONIC, &end); + shared[child] = 1e6*elapsed(&start, &end) / count / 2; + + gem_close(fd, obj.handle); + } + igt_waitchildren(); + + for (int child = 0; child < ncpus; child++) + shared[ncpus] += shared[child]; + printf("%7.3f\n", shared[ncpus] / ncpus); + } + return 0; +} + +int main(int argc, char **argv) +{ + unsigned ring = I915_EXEC_RENDER; + unsigned flags = 0; + int size = 4096; + int reps = 1; + int ncpus = 1; + int c; + + while ((c = getopt (argc, argv, "e:r:s:f")) != -1) { + switch (c) { + case 'e': + if (strcmp(optarg, "rcs") == 0) + ring = I915_EXEC_RENDER; + else if (strcmp(optarg, "vcs") == 0) + ring = I915_EXEC_BSD; + else if (strcmp(optarg, "bcs") == 0) + ring = I915_EXEC_BLT; + else if (strcmp(optarg, "vecs") == 0) + ring = I915_EXEC_VEBOX; + else if (strcmp(optarg, "all") == 0) + ring = -1; + else + ring = atoi(optarg); + break; + + case 'r': + reps = atoi(optarg); + if (reps < 1) + reps = 1; + break; + + case 'f': + ncpus = sysconf(_SC_NPROCESSORS_ONLN); + break; + + case 's': + size = atoi(optarg); + if (size < 4096) + size = 4096; + break; + + default: + break; + } + } + + return loop(size, ring, reps, ncpus, flags); +} diff -Nru intel-gpu-tools-1.13/benchmarks/gem_exec_nop.c intel-gpu-tools-1.15/benchmarks/gem_exec_nop.c --- intel-gpu-tools-1.13/benchmarks/gem_exec_nop.c 2015-11-12 17:30:48.000000000 +0000 +++ intel-gpu-tools-1.15/benchmarks/gem_exec_nop.c 2016-05-23 10:51:28.000000000 +0000 @@ -47,19 +47,17 @@ #define LOCAL_I915_EXEC_NO_RELOC (1<<11) #define LOCAL_I915_EXEC_HANDLE_LUT (1<<12) -static uint64_t elapsed(const struct timespec *start, - const struct timespec *end, - int loop) -{ - return (1000000000ULL*(end->tv_sec - start->tv_sec) + (end->tv_nsec - start->tv_nsec))/loop; -} +#define LOCAL_I915_EXEC_BSD_SHIFT (13) +#define LOCAL_I915_EXEC_BSD_MASK (3 << LOCAL_I915_EXEC_BSD_SHIFT) + +#define ENGINE_FLAGS (I915_EXEC_RING_MASK | LOCAL_I915_EXEC_BSD_MASK) -static int __gem_execbuf(int fd, struct drm_i915_gem_execbuffer2 *execbuf) +#define SYNC 0x1 + +static double elapsed(const struct timespec *start, + const struct timespec *end) { - int err = 0; - if (drmIoctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, execbuf)) - err = -errno; - return err; + return (end->tv_sec - start->tv_sec) + 1e-9*(end->tv_nsec - start->tv_nsec); } static uint32_t batch(int fd) @@ -70,49 +68,86 @@ return handle; } -static int loop(unsigned ring, int reps) +static int loop(unsigned ring, int reps, int ncpus, unsigned flags) { struct drm_i915_gem_execbuffer2 execbuf; - struct drm_i915_gem_exec_object2 gem_exec; - int count, fd; + struct drm_i915_gem_exec_object2 obj; + unsigned engines[16]; + unsigned nengine; + double *shared; + int fd; + + shared = mmap(0, 4096, PROT_WRITE, MAP_SHARED | MAP_ANON, -1, 0); fd = drm_open_driver(DRIVER_INTEL); - memset(&gem_exec, 0, sizeof(gem_exec)); - gem_exec.handle = batch(fd); + memset(&obj, 0, sizeof(obj)); + obj.handle = batch(fd); memset(&execbuf, 0, sizeof(execbuf)); - execbuf.buffers_ptr = (uintptr_t)&gem_exec; + execbuf.buffers_ptr = (uintptr_t)&obj; execbuf.buffer_count = 1; - execbuf.flags = ring; execbuf.flags |= LOCAL_I915_EXEC_HANDLE_LUT; execbuf.flags |= LOCAL_I915_EXEC_NO_RELOC; if (__gem_execbuf(fd, &execbuf)) { - execbuf.flags = ring; + execbuf.flags = 0; if (__gem_execbuf(fd, &execbuf)) return 77; } - for (count = 1; count <= 1<<16; count <<= 1) { - igt_stats_t stats; - int n; + nengine = 0; + if (ring == -1) { + for (ring = 1; ring < 16; ring++) { + execbuf.flags &= ~ENGINE_FLAGS; + execbuf.flags |= ring; + if (__gem_execbuf(fd, &execbuf) == 0) + engines[nengine++] = ring; + } + } else + engines[nengine++] = ring; + + while (reps--) { + memset(shared, 0, 4096); - igt_stats_init_with_size(&stats, reps); + gem_set_domain(fd, obj.handle, I915_GEM_DOMAIN_GTT, 0); + sleep(1); /* wait for the hw to go back to sleep */ - for (n = 0; n < reps; n++) { + igt_fork(child, ncpus) { struct timespec start, end; - int loops = count; - sleep(1); /* wait for the hw to go back to sleep */ + unsigned count = 0; + + obj.handle = batch(fd); + clock_gettime(CLOCK_MONOTONIC, &start); - while (loops--) - do_ioctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, &execbuf); - gem_sync(fd, gem_exec.handle); + do { + for (int inner = 0; inner < 1024; inner++) { + execbuf.flags &= ~ENGINE_FLAGS; + execbuf.flags |= engines[count++ % nengine]; + gem_execbuf(fd, &execbuf); + if (flags & SYNC) + gem_sync(fd, obj.handle); + } + + clock_gettime(CLOCK_MONOTONIC, &end); + } while (elapsed(&start, &end) < 2.); + + gem_sync(fd, obj.handle); clock_gettime(CLOCK_MONOTONIC, &end); - igt_stats_push(&stats, elapsed(&start, &end, count)); + shared[child] = 1e6*elapsed(&start, &end) / count; + + gem_close(fd, obj.handle); } + igt_waitchildren(); - printf("%7.3f\n", igt_stats_get_trimean(&stats)/1000); - igt_stats_fini(&stats); + for (int child = 0; child < ncpus; child++) + shared[ncpus] += shared[child]; + printf("%7.3f\n", shared[ncpus] / ncpus); + + for (int n = 0; n < nengine; n++) { + execbuf.flags &= ~ENGINE_FLAGS; + execbuf.flags |= engines[n]; + gem_execbuf(fd, &execbuf); + } } return 0; } @@ -120,10 +155,12 @@ int main(int argc, char **argv) { unsigned ring = I915_EXEC_RENDER; - int reps = 13; + unsigned flags = 0; + int reps = 1; + int ncpus = 1; int c; - while ((c = getopt (argc, argv, "e:r:")) != -1) { + while ((c = getopt (argc, argv, "e:r:sf")) != -1) { switch (c) { case 'e': if (strcmp(optarg, "rcs") == 0) @@ -134,6 +171,8 @@ ring = I915_EXEC_BLT; else if (strcmp(optarg, "vecs") == 0) ring = I915_EXEC_VEBOX; + else if (strcmp(optarg, "all") == 0) + ring = -1; else ring = atoi(optarg); break; @@ -144,10 +183,18 @@ reps = 1; break; + case 'f': + ncpus = sysconf(_SC_NPROCESSORS_ONLN); + break; + + case 's': + flags |= SYNC; + break; + default: break; } } - return loop(ring, reps); + return loop(ring, reps, ncpus, flags); } diff -Nru intel-gpu-tools-1.13/benchmarks/gem_exec_reloc.c intel-gpu-tools-1.15/benchmarks/gem_exec_reloc.c --- intel-gpu-tools-1.13/benchmarks/gem_exec_reloc.c 2015-11-12 17:30:48.000000000 +0000 +++ intel-gpu-tools-1.15/benchmarks/gem_exec_reloc.c 2016-05-23 10:51:28.000000000 +0000 @@ -144,7 +144,7 @@ reloc[n].target_handle = target[n]; else reloc[n].target_handle = objects[target[n]].handle; - reloc[n].presumed_offset = 0; + reloc[n].presumed_offset = -1; } gem_execbuf(fd, &execbuf); @@ -154,7 +154,7 @@ for (count = 0; count < 1000; count++) { if ((flags & SKIP_RELOC) == 0) { for (n = 0; n < num_relocs; n++) - reloc[n].presumed_offset = 0; + reloc[n].presumed_offset = -1; if (flags & CYCLE_BATCH) { c = (c + 1) % 16; gem_exec[num_objects].handle = cycle[c]; diff -Nru intel-gpu-tools-1.13/benchmarks/gem_latency.c intel-gpu-tools-1.15/benchmarks/gem_latency.c --- intel-gpu-tools-1.13/benchmarks/gem_latency.c 1970-01-01 00:00:00.000000000 +0000 +++ intel-gpu-tools-1.15/benchmarks/gem_latency.c 2016-05-23 10:51:28.000000000 +0000 @@ -0,0 +1,639 @@ +/* + * Copyright © 2015 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 "igt.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "drm.h" + +#define CONTEXT 0x1 +#define REALTIME 0x2 +#define CMDPARSER 0x4 + +static int done; +static int fd; +static volatile uint32_t *timestamp_reg; + +#define REG(x) (volatile uint32_t *)((volatile char *)igt_global_mmio + x) +#define REG_OFFSET(x) ((volatile char *)(x) - (volatile char *)igt_global_mmio) + +#if defined(__USE_XOPEN2K) && defined(gen7_safe_mmio) +static pthread_spinlock_t timestamp_lock; + +static uint32_t read_timestamp_locked(void) +{ + uint32_t t; + + pthread_spin_lock(×tamp_lock); + t = *timestamp_reg; + pthread_spin_unlock(×tamp_lock); + + return t; +} +static int setup_timestamp_locked(void) +{ + if (pthread_spin_init(×tamp_lock, 0)) + return 0; + + read_timestamp = read_timestamp_locked; + return 1; +} + +static uint32_t read_timestamp_unlocked(void) +{ + return *timestamp_reg; +} + +static uint32_t (*read_timestamp)(void) = read_timestamp_unlocked; + +#else +static int setup_timestamp_locked(void) +{ + return 1; +} + +inline static uint32_t read_timestamp(void) +{ + return *timestamp_reg; +} +#endif + +struct consumer { + pthread_t thread; + + int go; + + struct igt_mean latency; + struct producer *producer; +}; + +struct producer { + pthread_t thread; + uint32_t ctx; + struct { + struct drm_i915_gem_exec_object2 exec[1]; + struct drm_i915_gem_execbuffer2 execbuf; + } nop_dispatch; + struct { + struct drm_i915_gem_exec_object2 exec[2]; + struct drm_i915_gem_execbuffer2 execbuf; + } workload_dispatch; + struct { + struct drm_i915_gem_exec_object2 exec[1]; + struct drm_i915_gem_relocation_entry reloc[1]; + struct drm_i915_gem_execbuffer2 execbuf; + } latency_dispatch; + + pthread_mutex_t lock; + pthread_cond_t p_cond, c_cond; + uint32_t *last_timestamp; + int wait; + int complete; + int done; + struct igt_mean latency, dispatch; + + int nop; + int nconsumers; + struct consumer *consumers; +}; + +#define LOCAL_EXEC_NO_RELOC (1<<11) +#define COPY_BLT_CMD (2<<29|0x53<<22|0x6) +#define BLT_WRITE_ALPHA (1<<21) +#define BLT_WRITE_RGB (1<<20) + +#define WIDTH 1024 +#define HEIGHT 1024 + +#define RCS_TIMESTAMP (0x2000 + 0x358) +#define BCS_TIMESTAMP (0x22000 + 0x358) +#define CYCLES_TO_NS(x) (80.*(x)) +#define CYCLES_TO_US(x) (CYCLES_TO_NS(x)/1000.) + +static uint32_t create_workload(int gen, int factor) +{ + const int has_64bit_reloc = gen >= 8; + uint32_t handle = gem_create(fd, 4096); + uint32_t *map = gem_mmap__cpu(fd, handle, 0, 4096, PROT_WRITE); + int i = 0; + + while (factor--) { + /* XY_SRC_COPY */ + map[i++] = COPY_BLT_CMD | BLT_WRITE_ALPHA | BLT_WRITE_RGB; + if (has_64bit_reloc) + map[i-1] += 2; + map[i++] = 0xcc << 16 | 1 << 25 | 1 << 24 | (4*WIDTH); + map[i++] = 0; + map[i++] = HEIGHT << 16 | WIDTH; + map[i++] = 0; + if (has_64bit_reloc) + map[i++] = 0; + map[i++] = 0; + map[i++] = 4096; + map[i++] = 0; + if (has_64bit_reloc) + map[i++] = 0; + } + map[i++] = MI_BATCH_BUFFER_END; + munmap(map, 4096); + + return handle; +} + +static void setup_workload(struct producer *p, int gen, + uint32_t scratch, + uint32_t batch, + int factor, + unsigned flags) +{ + struct drm_i915_gem_execbuffer2 *eb; + const int has_64bit_reloc = gen >= 8; + struct drm_i915_gem_relocation_entry *reloc; + int offset; + + reloc = calloc(sizeof(*reloc), 2*factor); + + p->workload_dispatch.exec[0].handle = scratch; + p->workload_dispatch.exec[1].relocation_count = 2*factor; + p->workload_dispatch.exec[1].relocs_ptr = (uintptr_t)reloc; + p->workload_dispatch.exec[1].handle = batch; + + offset = 0; + while (factor--) { + reloc->offset = (offset+4) * sizeof(uint32_t); + reloc->target_handle = scratch; + reloc->read_domains = I915_GEM_DOMAIN_RENDER; + reloc->write_domain = I915_GEM_DOMAIN_RENDER; + reloc++; + + reloc->offset = (offset+7) * sizeof(uint32_t); + if (has_64bit_reloc) + reloc->offset += sizeof(uint32_t); + reloc->target_handle = scratch; + reloc->read_domains = I915_GEM_DOMAIN_RENDER; + reloc++; + + offset += 8; + if (has_64bit_reloc) + offset += 2; + } + + eb = memset(&p->workload_dispatch.execbuf, 0, sizeof(*eb)); + eb->buffers_ptr = (uintptr_t)p->workload_dispatch.exec; + eb->buffer_count = 2; + if (flags & CMDPARSER) + eb->batch_len = 4096; + eb->flags = I915_EXEC_BLT | LOCAL_EXEC_NO_RELOC; + eb->rsvd1 = p->ctx; +} + +static void setup_latency(struct producer *p, int gen, unsigned flags) +{ + struct drm_i915_gem_execbuffer2 *eb; + const int has_64bit_reloc = gen >= 8; + uint32_t handle; + uint32_t *map; + int i = 0; + + handle = gem_create(fd, 4096); + if (gem_has_llc(fd)) + map = gem_mmap__cpu(fd, handle, 0, 4096, PROT_WRITE); + else + map = gem_mmap__gtt(fd, handle, 4096, PROT_WRITE); + + p->latency_dispatch.exec[0].relocation_count = 1; + p->latency_dispatch.exec[0].relocs_ptr = + (uintptr_t)p->latency_dispatch.reloc; + p->latency_dispatch.exec[0].handle = handle; + + /* MI_STORE_REG_MEM */ + map[i++] = 0x24 << 23 | 1; + if (has_64bit_reloc) + map[i-1]++; + map[i++] = REG_OFFSET(timestamp_reg); + p->latency_dispatch.reloc[0].offset = i * sizeof(uint32_t); + p->latency_dispatch.reloc[0].delta = 4000; + p->latency_dispatch.reloc[0].target_handle = handle; + p->latency_dispatch.reloc[0].read_domains = I915_GEM_DOMAIN_INSTRUCTION; + p->latency_dispatch.reloc[0].write_domain = 0; /* We lie! */ + p->latency_dispatch.reloc[0].presumed_offset = 0; + p->last_timestamp = &map[1000]; + map[i++] = 4000; + if (has_64bit_reloc) + map[i++] = 0; + + map[i++] = MI_BATCH_BUFFER_END; + + eb = memset(&p->latency_dispatch.execbuf, 0, sizeof(*eb)); + eb->buffers_ptr = (uintptr_t)p->latency_dispatch.exec; + eb->buffer_count = 1; + if (flags & CMDPARSER) + eb->batch_len = sizeof(*map) * ((i + 1) & ~1); + eb->flags = I915_EXEC_BLT | LOCAL_EXEC_NO_RELOC; + eb->rsvd1 = p->ctx; +} + +static uint32_t create_nop(void) +{ + uint32_t buf = MI_BATCH_BUFFER_END; + uint32_t handle; + + handle = gem_create(fd, 4096); + gem_write(fd, handle, 0, &buf, sizeof(buf)); + + return handle; +} + +static void setup_nop(struct producer *p, uint32_t batch, unsigned flags) +{ + struct drm_i915_gem_execbuffer2 *eb; + + p->nop_dispatch.exec[0].handle = batch; + + eb = memset(&p->nop_dispatch.execbuf, 0, sizeof(*eb)); + eb->buffers_ptr = (uintptr_t)p->nop_dispatch.exec; + eb->buffer_count = 1; + if (flags & CMDPARSER) + eb->batch_len = 8; + eb->flags = I915_EXEC_BLT | LOCAL_EXEC_NO_RELOC; + eb->rsvd1 = p->ctx; +} + +static void measure_latency(struct producer *p, struct igt_mean *mean) +{ + gem_sync(fd, p->latency_dispatch.exec[0].handle); + igt_mean_add(mean, read_timestamp() - *p->last_timestamp); +} + +static void *producer(void *arg) +{ + struct producer *p = arg; + int n; + + while (!done) { + uint32_t start = read_timestamp(); + int batches; + + /* Control the amount of work we do, similar to submitting + * empty buffers below, except this time we will load the + * GPU with a small amount of real work - so there is a small + * period between execution and interrupts. + */ + gem_execbuf(fd, &p->workload_dispatch.execbuf); + + /* Submitting a set of empty batches has a two fold effect: + * - increases contention on execbuffer, i.e. measure dispatch + * latency with number of clients. + * - generates lots of spurious interrupts (if someone is + * waiting). + */ + batches = p->nop; + while (batches--) + gem_execbuf(fd, &p->nop_dispatch.execbuf); + + /* Finally, execute a batch that just reads the current + * TIMESTAMP so we can measure the latency. + */ + gem_execbuf(fd, &p->latency_dispatch.execbuf); + + /* Wake all the associated clients to wait upon our batch */ + p->wait = p->nconsumers; + for (n = 0; n < p->nconsumers; n++) + p->consumers[n].go = 1; + pthread_cond_broadcast(&p->c_cond); + + /* Wait for this batch to finish and record how long we waited, + * and how long it took for the batch to be submitted + * (including the nop delays). + */ + measure_latency(p, &p->latency); + igt_mean_add(&p->dispatch, *p->last_timestamp - start); + + /* Tidy up all the extra threads before we submit again. */ + pthread_mutex_lock(&p->lock); + while (p->wait) + pthread_cond_wait(&p->p_cond, &p->lock); + pthread_mutex_unlock(&p->lock); + + p->complete++; + } + + pthread_mutex_lock(&p->lock); + p->wait = p->nconsumers; + p->done = true; + for (n = 0; n < p->nconsumers; n++) + p->consumers[n].go = 1; + pthread_cond_broadcast(&p->c_cond); + pthread_mutex_unlock(&p->lock); + + return NULL; +} + +static void *consumer(void *arg) +{ + struct consumer *c = arg; + struct producer *p = c->producer; + + /* Sit around waiting for the "go" signal from the producer, then + * wait upon the batch to finish. This is to add extra waiters to + * the same request - increasing wakeup contention. + */ + do { + pthread_mutex_lock(&p->lock); + if (--p->wait == 0) + pthread_cond_signal(&p->p_cond); + while (!c->go) + pthread_cond_wait(&p->c_cond, &p->lock); + c->go = 0; + pthread_mutex_unlock(&p->lock); + if (p->done) + return NULL; + + measure_latency(p, &c->latency); + } while (1); +} + +static double l_estimate(igt_stats_t *stats) +{ + if (stats->n_values > 9) + return igt_stats_get_trimean(stats); + else if (stats->n_values > 5) + return igt_stats_get_median(stats); + else + return igt_stats_get_mean(stats); +} + +static double cpu_time(const struct rusage *r) +{ + return 10e6*(r->ru_utime.tv_sec + r->ru_stime.tv_sec) + + (r->ru_utime.tv_usec + r->ru_stime.tv_usec); +} + +static int run(int seconds, + int nproducers, + int nconsumers, + int nop, + int workload, + unsigned flags) +{ + pthread_attr_t attr; + struct producer *p; + igt_stats_t platency, latency, dispatch; + struct rusage rused; + uint32_t nop_batch; + uint32_t workload_batch; + uint32_t scratch; + int gen, n, m; + int complete; + int nrun; + +#if 0 + printf("producers=%d, consumers=%d, nop=%d, workload=%d, flags=%x\n", + nproducers, nconsumers, nop, workload, flags); +#endif + + fd = drm_open_driver(DRIVER_INTEL); + gen = intel_gen(intel_get_drm_devid(fd)); + if (gen < 6) + return IGT_EXIT_SKIP; /* Needs BCS timestamp */ + + intel_register_access_init(intel_get_pci_device(), false); + + if (gen == 6) + timestamp_reg = REG(RCS_TIMESTAMP); + else + timestamp_reg = REG(BCS_TIMESTAMP); + + if (gen < 8 && !setup_timestamp_locked()) + return IGT_EXIT_SKIP; + + nrun = read_timestamp(); + usleep(1); + if (read_timestamp() == nrun) + return IGT_EXIT_SKIP; + + scratch = gem_create(fd, 4*WIDTH*HEIGHT); + nop_batch = create_nop(); + workload_batch = create_workload(gen, workload); + + p = calloc(nproducers, sizeof(*p)); + for (n = 0; n < nproducers; n++) { + if (flags & CONTEXT) + p[n].ctx = gem_context_create(fd); + + setup_nop(&p[n], nop_batch, flags); + setup_workload(&p[n], gen, scratch, workload_batch, workload, flags); + setup_latency(&p[n], gen, flags); + + pthread_mutex_init(&p[n].lock, NULL); + pthread_cond_init(&p[n].p_cond, NULL); + pthread_cond_init(&p[n].c_cond, NULL); + + igt_mean_init(&p[n].latency); + igt_mean_init(&p[n].dispatch); + p[n].wait = nconsumers; + p[n].nop = nop; + p[n].nconsumers = nconsumers; + p[n].consumers = calloc(nconsumers, sizeof(struct consumer)); + for (m = 0; m < nconsumers; m++) { + p[n].consumers[m].producer = &p[n]; + igt_mean_init(&p[n].consumers[m].latency); + pthread_create(&p[n].consumers[m].thread, NULL, + consumer, &p[n].consumers[m]); + } + pthread_mutex_lock(&p[n].lock); + while (p[n].wait) + pthread_cond_wait(&p[n].p_cond, &p[n].lock); + pthread_mutex_unlock(&p[n].lock); + } + + pthread_attr_init(&attr); + if (flags & REALTIME) { +#ifdef PTHREAD_EXPLICIT_SCHED + struct sched_param param = { .sched_priority = 99 }; + pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED); + pthread_attr_setschedpolicy(&attr, SCHED_FIFO); + pthread_attr_setschedparam(&attr, ¶m); +#else + return IGT_EXIT_SKIP; +#endif + } + for (n = 0; n < nproducers; n++) + pthread_create(&p[n].thread, &attr, producer, &p[n]); + + sleep(seconds); + done = true; + + nrun = complete = 0; + igt_stats_init_with_size(&dispatch, nproducers); + igt_stats_init_with_size(&platency, nproducers); + igt_stats_init_with_size(&latency, nconsumers*nproducers); + for (n = 0; n < nproducers; n++) { + pthread_join(p[n].thread, NULL); + + if (!p[n].complete) + continue; + + nrun++; + complete += p[n].complete; + igt_stats_push_float(&latency, p[n].latency.mean); + igt_stats_push_float(&platency, p[n].latency.mean); + igt_stats_push_float(&dispatch, p[n].dispatch.mean); + + for (m = 0; m < nconsumers; m++) { + pthread_join(p[n].consumers[m].thread, NULL); + igt_stats_push_float(&latency, + p[n].consumers[m].latency.mean); + } + } + + getrusage(RUSAGE_SELF, &rused); + + switch ((flags >> 8) & 0xf) { + default: + printf("%d/%d: %7.3fus %7.3fus %7.3fus %7.3fus\n", + complete, nrun, + CYCLES_TO_US(l_estimate(&dispatch)), + CYCLES_TO_US(l_estimate(&latency)), + CYCLES_TO_US(l_estimate(&platency)), + cpu_time(&rused) / complete); + break; + case 1: + printf("%f\n", CYCLES_TO_US(l_estimate(&dispatch))); + break; + case 2: + printf("%f\n", CYCLES_TO_US(l_estimate(&latency))); + break; + case 3: + printf("%f\n", CYCLES_TO_US(l_estimate(&platency))); + break; + case 4: + printf("%f\n", cpu_time(&rused) / complete); + break; + case 5: + printf("%d\n", complete); + break; + } + + return 0; +} + +int main(int argc, char **argv) +{ + int time = 10; + int producers = 1; + int consumers = 0; + int nop = 0; + int workload = 0; + unsigned flags = 0; + int c; + + while ((c = getopt(argc, argv, "Cp:c:n:w:t:f:sR")) != -1) { + switch (c) { + case 'p': + /* How many threads generate work? */ + producers = atoi(optarg); + if (producers < 1) + producers = 1; + break; + + case 'c': + /* How many threads wait upon each piece of work? */ + consumers = atoi(optarg); + if (consumers < 0) + consumers = 0; + break; + + case 'n': + /* Extra dispatch contention + interrupts */ + nop = atoi(optarg); + if (nop < 0) + nop = 0; + break; + + case 'w': + /* Control the amount of real work done */ + workload = atoi(optarg); + if (workload < 0) + workload = 0; + if (workload > 100) + workload = 100; + break; + + case 't': + /* How long to run the benchmark for (seconds) */ + time = atoi(optarg); + if (time < 0) + time = INT_MAX; + break; + + case 'f': + /* Select an output field */ + flags |= atoi(optarg) << 8; + break; + + case 's': + /* Assign each producer to its own context, adding + * context switching into the mix (e.g. execlists + * can amalgamate requests from one context, so + * having each producer submit in different contexts + * should force more execlist interrupts). + */ + flags |= CONTEXT; + break; + + case 'R': + /* Run the producers at RealTime priority */ + flags |= REALTIME; + break; + + case 'C': + /* Don't hide from the command parser (gen7) */ + flags |= CMDPARSER; + break; + + default: + break; + } + } + + return run(time, producers, consumers, nop, workload, flags); +} diff -Nru intel-gpu-tools-1.13/benchmarks/gem_mmap.c intel-gpu-tools-1.15/benchmarks/gem_mmap.c --- intel-gpu-tools-1.13/benchmarks/gem_mmap.c 2015-11-12 17:30:48.000000000 +0000 +++ intel-gpu-tools-1.15/benchmarks/gem_mmap.c 2016-05-23 10:51:28.000000000 +0000 @@ -46,10 +46,10 @@ #define OBJECT_SIZE (1<<23) -static uint64_t elapsed(const struct timespec *start, - const struct timespec *end) +static double elapsed(const struct timespec *start, + const struct timespec *end) { - return 1000000000ULL*(end->tv_sec - start->tv_sec) + (end->tv_nsec - start->tv_nsec); + return (end->tv_sec - start->tv_sec) + 1e-9*(end->tv_nsec - start->tv_nsec); } int main(int argc, char **argv) @@ -58,11 +58,13 @@ enum map {CPU, GTT, WC} map = CPU; enum dir {READ, WRITE, CLEAR, FAULT} dir = READ; int tiling = I915_TILING_NONE; + struct timespec start, end; void *buf = malloc(OBJECT_SIZE); uint32_t handle; void *ptr, *src, *dst; - int reps = 13; - int c, size; + int reps = 1; + int loops; + int c; while ((c = getopt (argc, argv, "m:d:r:t:")) != -1) { switch (c) { @@ -140,38 +142,56 @@ dst = ptr; } - for (size = 1; size <= OBJECT_SIZE; size <<= 1) { - igt_stats_t stats; - int n; - - igt_stats_init_with_size(&stats, reps); + clock_gettime(CLOCK_MONOTONIC, &start); + switch (dir) { + case CLEAR: + case FAULT: + memset(dst, 0, OBJECT_SIZE); + break; + default: + memcpy(dst, src, OBJECT_SIZE); + break; + } + clock_gettime(CLOCK_MONOTONIC, &end); - for (n = 0; n < reps; n++) { - struct timespec start, end; + loops = 2 / elapsed(&start, &end); + while (reps--) { + clock_gettime(CLOCK_MONOTONIC, &start); + for (c = 0; c < loops; c++) { int page; - clock_gettime(CLOCK_MONOTONIC, &start); switch (dir) { case CLEAR: - memset(dst, 0, size); + memset(dst, 0, OBJECT_SIZE); break; case FAULT: + munmap(ptr, OBJECT_SIZE); + switch (map) { + case CPU: + ptr = gem_mmap__cpu(fd, handle, 0, OBJECT_SIZE, PROT_WRITE); + break; + case GTT: + ptr = gem_mmap__gtt(fd, handle, OBJECT_SIZE, PROT_WRITE); + break; + case WC: + ptr = gem_mmap__wc(fd, handle, 0, OBJECT_SIZE, PROT_WRITE); + break; + default: + abort(); + } for (page = 0; page < OBJECT_SIZE; page += 4096) { uint32_t *x = (uint32_t *)ptr + page/4; + __asm__ __volatile__("": : :"memory"); page += *x; /* should be zero! */ } break; default: - memcpy(dst, src, size); + memcpy(dst, src, OBJECT_SIZE); break; } - clock_gettime(CLOCK_MONOTONIC, &end); - - igt_stats_push(&stats, elapsed(&start, &end)); } - - printf("%7.3f\n", igt_stats_get_trimean(&stats)/1000); - igt_stats_fini(&stats); + clock_gettime(CLOCK_MONOTONIC, &end); + printf("%7.3f\n", OBJECT_SIZE / elapsed(&start, &end) * loops / (1024*1024)); } return 0; diff -Nru intel-gpu-tools-1.13/benchmarks/gem_syslatency.c intel-gpu-tools-1.15/benchmarks/gem_syslatency.c --- intel-gpu-tools-1.13/benchmarks/gem_syslatency.c 1970-01-01 00:00:00.000000000 +0000 +++ intel-gpu-tools-1.15/benchmarks/gem_syslatency.c 2016-05-23 10:51:28.000000000 +0000 @@ -0,0 +1,333 @@ +/* + * Copyright © 2016 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. + * + */ + +#define _GNU_SOURCE + +#include "igt.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "drm.h" + +#include + +#define gettid() syscall(__NR_gettid) +#define sigev_notify_thread_id _sigev_un._tid + +static volatile int done; + +struct gem_busyspin { + pthread_t thread; + unsigned long count; +}; + +struct sys_wait { + pthread_t thread; + struct igt_mean mean; +}; + +static void force_low_latency(void) +{ + int32_t target = 0; + int fd = open("/dev/cpu_dma_latency", O_RDWR); + if (fd < 0 || write(fd, &target, sizeof(target)) < 0) + fprintf(stderr, + "Unable to prevent CPU sleeps and force low latency using /dev/cpu_dma_latency: %s\n", + strerror(errno)); +} + +#define LOCAL_I915_EXEC_NO_RELOC (1<<11) +#define LOCAL_I915_EXEC_HANDLE_LUT (1<<12) + +#define LOCAL_I915_EXEC_BSD_SHIFT (13) +#define LOCAL_I915_EXEC_BSD_MASK (3 << LOCAL_I915_EXEC_BSD_SHIFT) + +#define ENGINE_FLAGS (I915_EXEC_RING_MASK | LOCAL_I915_EXEC_BSD_MASK) + +static bool ignore_engine(int fd, unsigned engine) +{ + if (engine == 0) + return true; + + if (gem_has_bsd2(fd) && engine == I915_EXEC_BSD) + return true; + + return false; +} + +static void *gem_busyspin(void *arg) +{ + const uint32_t bbe = MI_BATCH_BUFFER_END; + struct gem_busyspin *bs = arg; + struct drm_i915_gem_execbuffer2 execbuf; + struct drm_i915_gem_exec_object2 obj; + unsigned engines[16]; + unsigned nengine; + unsigned engine; + int fd; + + fd = drm_open_driver(DRIVER_INTEL); + + nengine = 0; + for_each_engine(fd, engine) + if (!ignore_engine(fd, engine)) engines[nengine++] = engine; + + memset(&obj, 0, sizeof(obj)); + obj.handle = gem_create(fd, 4096); + gem_write(fd, obj.handle, 0, &bbe, sizeof(bbe)); + + memset(&execbuf, 0, sizeof(execbuf)); + execbuf.buffers_ptr = (uintptr_t)&obj; + execbuf.buffer_count = 1; + execbuf.flags |= LOCAL_I915_EXEC_HANDLE_LUT; + execbuf.flags |= LOCAL_I915_EXEC_NO_RELOC; + if (__gem_execbuf(fd, &execbuf)) { + execbuf.flags = 0; + gem_execbuf(fd, &execbuf); + } + + while (!done) { + for (int n = 0; n < nengine; n++) { + execbuf.flags &= ~ENGINE_FLAGS; + execbuf.flags |= engines[n]; + gem_execbuf(fd, &execbuf); + } + bs->count += nengine; + } + + close(fd); + return NULL; +} + +#define MSEC_PER_SEC (1000) +#define USEC_PER_SEC (1000 * MSEC_PER_SEC) +#define NSEC_PER_SEC (1000 * USEC_PER_SEC) + +static double elapsed(const struct timespec *a, const struct timespec *b) +{ + return 1e9*(b->tv_sec - a->tv_sec) + (b->tv_nsec - a ->tv_nsec); +} + +static void *sys_wait(void *arg) +{ + struct sys_wait *w = arg; + struct sigevent sev; + timer_t timer; + sigset_t mask; + struct timespec now; +#define SIG SIGRTMIN + + sigemptyset(&mask); + sigaddset(&mask, SIG); + sigprocmask(SIG_SETMASK, &mask, NULL); + + sev.sigev_notify = SIGEV_SIGNAL | SIGEV_THREAD_ID; + sev.sigev_notify_thread_id = gettid(); + sev.sigev_signo = SIG; + timer_create(CLOCK_MONOTONIC, &sev, &timer); + + clock_gettime(CLOCK_MONOTONIC, &now); + while (!done) { + struct itimerspec its; + int sigs; + + its.it_value = now; + its.it_value.tv_nsec += 100 * 1000; + its.it_value.tv_nsec += rand() % (NSEC_PER_SEC / 1000); + if (its.it_value.tv_nsec >= NSEC_PER_SEC) { + its.it_value.tv_nsec -= NSEC_PER_SEC; + its.it_value.tv_sec += 1; + } + its.it_interval.tv_sec = its.it_interval.tv_nsec = 0; + timer_settime(timer, TIMER_ABSTIME, &its, NULL); + + sigwait(&mask, &sigs); + clock_gettime(CLOCK_MONOTONIC, &now); + igt_mean_add(&w->mean, elapsed(&its.it_value, &now)); + } + + sigprocmask(SIG_UNBLOCK, &mask, NULL); + timer_delete(timer); + + return NULL; +} + +static void bind_cpu(pthread_attr_t *attr, int cpu) +{ +#ifdef __USE_GNU +#ifndef ANDROID + cpu_set_t mask; + + if (cpu == -1) + return; + + CPU_ZERO(&mask); + CPU_SET(cpu, &mask); + + pthread_attr_setaffinity_np(attr, sizeof(mask), &mask); +#endif +#endif +} + +static void rtprio(pthread_attr_t *attr, int prio) +{ +#ifdef PTHREAD_EXPLICIT_SCHED + struct sched_param param = { .sched_priority = 99 }; + pthread_attr_setinheritsched(attr, PTHREAD_EXPLICIT_SCHED); + pthread_attr_setschedpolicy(attr, SCHED_FIFO); + pthread_attr_setschedparam(attr, ¶m); +#endif +} + +static double l_estimate(igt_stats_t *stats) +{ + if (stats->n_values > 9) + return igt_stats_get_trimean(stats); + else if (stats->n_values > 5) + return igt_stats_get_median(stats); + else + return igt_stats_get_mean(stats); +} + +static double min_measurement_error(void) +{ + struct timespec start, end; + int n; + + clock_gettime(CLOCK_MONOTONIC, &start); + for (n = 0; n < 1024; n++) + clock_gettime(CLOCK_MONOTONIC, &end); + + return elapsed(&start, &end) / n; +} + +int main(int argc, char **argv) +{ + struct gem_busyspin *busy; + struct sys_wait *wait; + pthread_attr_t attr; + int ncpus = sysconf(_SC_NPROCESSORS_ONLN); + igt_stats_t cycles, mean, max; + double min; + int time = 10; + int field = -1; + int enable_gem_sysbusy = 1; + int n, c; + + while ((c = getopt(argc, argv, "t:f:n")) != -1) { + switch (c) { + case 'n': /* dry run, measure baseline system latency */ + enable_gem_sysbusy = 0; + break; + case 't': + /* How long to run the benchmark for (seconds) */ + time = atoi(optarg); + if (time < 0) + time = INT_MAX; + break; + case 'f': + /* Select an output field */ + field = atoi(optarg); + break; + default: + break; + } + } + + /* Prevent CPU sleeps so that busy and idle loads are consistent. */ + force_low_latency(); + min = min_measurement_error(); + + busy = calloc(ncpus, sizeof(*busy)); + pthread_attr_init(&attr); + if (enable_gem_sysbusy) { + for (n = 0; n < ncpus; n++) { + bind_cpu(&attr, n); + pthread_create(&busy[n].thread, &attr, + gem_busyspin, &busy[n]); + } + } + + wait = calloc(ncpus, sizeof(*wait)); + pthread_attr_init(&attr); + rtprio(&attr, 99); + for (n = 0; n < ncpus; n++) { + igt_mean_init(&wait[n].mean); + bind_cpu(&attr, n); + pthread_create(&wait[n].thread, &attr, sys_wait, &wait[n]); + } + + sleep(time); + done = 1; + + igt_stats_init_with_size(&cycles, ncpus); + if (enable_gem_sysbusy) { + for (n = 0; n < ncpus; n++) { + pthread_join(busy[n].thread, NULL); + igt_stats_push(&cycles, busy[n].count); + } + } + + igt_stats_init_with_size(&mean, ncpus); + igt_stats_init_with_size(&max, ncpus); + for (n = 0; n < ncpus; n++) { + pthread_join(wait[n].thread, NULL); + igt_stats_push_float(&mean, wait[n].mean.mean); + igt_stats_push_float(&max, wait[n].mean.max); + } + + switch (field) { + default: + printf("gem_syslatency: cycles=%.0f, latency mean=%.3fus max=%.0fus\n", + igt_stats_get_mean(&cycles), + (igt_stats_get_mean(&mean) - min)/ 1000, + (l_estimate(&max) - min) / 1000); + break; + case 0: + printf("%.0f\n", igt_stats_get_mean(&cycles)); + break; + case 1: + printf("%.3f\n", (igt_stats_get_mean(&mean) - min) / 1000); + break; + case 2: + printf("%.0f\n", (l_estimate(&max) - min) / 1000); + break; + } + + return 0; + +} diff -Nru intel-gpu-tools-1.13/benchmarks/gem_userptr_benchmark.c intel-gpu-tools-1.15/benchmarks/gem_userptr_benchmark.c --- intel-gpu-tools-1.13/benchmarks/gem_userptr_benchmark.c 2015-11-16 10:39:02.000000000 +0000 +++ intel-gpu-tools-1.15/benchmarks/gem_userptr_benchmark.c 2016-05-23 10:51:28.000000000 +0000 @@ -58,17 +58,6 @@ #define PAGE_SIZE 4096 #endif -#define LOCAL_I915_GEM_USERPTR 0x33 -#define LOCAL_IOCTL_I915_GEM_USERPTR DRM_IOWR (DRM_COMMAND_BASE + LOCAL_I915_GEM_USERPTR, struct local_i915_gem_userptr) -struct local_i915_gem_userptr { - uint64_t user_ptr; - uint64_t user_size; - uint32_t flags; -#define LOCAL_I915_USERPTR_READ_ONLY (1<<0) -#define LOCAL_I915_USERPTR_UNSYNCHRONIZED (1<<31) - uint32_t handle; -}; - static uint32_t userptr_flags = LOCAL_I915_USERPTR_UNSYNCHRONIZED; #define BO_SIZE (65536) @@ -83,30 +72,6 @@ userptr_flags = 0; } -static int gem_userptr(int fd, void *ptr, int size, int read_only, uint32_t *handle) -{ - struct local_i915_gem_userptr userptr; - int ret; - - userptr.user_ptr = (uintptr_t)ptr; - userptr.user_size = size; - userptr.flags = userptr_flags; - if (read_only) - userptr.flags |= LOCAL_I915_USERPTR_READ_ONLY; - - ret = drmIoctl(fd, LOCAL_IOCTL_I915_GEM_USERPTR, &userptr); - if (ret) - ret = errno; - igt_skip_on_f(ret == ENODEV && - (userptr_flags & LOCAL_I915_USERPTR_UNSYNCHRONIZED) == 0 && - !read_only, - "Skipping, synchronized mappings with no kernel CONFIG_MMU_NOTIFIER?"); - if (ret == 0) - *handle = userptr.handle; - - return ret; -} - static void **handle_ptr_map; static unsigned int num_handle_ptr_map; @@ -144,8 +109,7 @@ ret = posix_memalign(&ptr, PAGE_SIZE, size); igt_assert(ret == 0); - ret = gem_userptr(fd, (uint32_t *)ptr, size, 0, &handle); - igt_assert(ret == 0); + gem_userptr(fd, (uint32_t *)ptr, size, 0, userptr_flags, &handle); add_handle_ptr(handle, ptr); return handle; @@ -167,7 +131,7 @@ assert(posix_memalign(&ptr, PAGE_SIZE, PAGE_SIZE) == 0); oldflags = userptr_flags; gem_userptr_test_unsynchronized(); - ret = gem_userptr(fd, ptr, PAGE_SIZE, 0, &handle); + ret = __gem_userptr(fd, ptr, PAGE_SIZE, 0, userptr_flags, &handle); userptr_flags = oldflags; if (ret != 0) { free(ptr); @@ -379,9 +343,7 @@ for (i = 0, p = block; i < nr_bos[subtest]; i++, p += PAGE_SIZE) - ret = gem_userptr(fd, (uint32_t *)p, BO_SIZE, 0, - &handles[i]); - igt_assert(ret == 0); + gem_userptr(fd, (uint32_t *)p, BO_SIZE, 0, userptr_flags, &handles[i]); } if (nr_bos[subtest] > 0) @@ -427,7 +389,6 @@ char *ptr, *bo_ptr; uint32_t handle = 0; unsigned long iter = 0; - int ret; unsigned long map_size = BO_SIZE + PAGE_SIZE - 1; ptr = mmap(NULL, map_size, PROT_READ | PROT_WRITE, @@ -439,8 +400,7 @@ start_test(test_duration_sec); while (run_test) { - ret = gem_userptr(fd, bo_ptr, BO_SIZE, 0, &handle); - assert(ret == 0); + gem_userptr(fd, bo_ptr, BO_SIZE, 0, userptr_flags, &handle); gem_close(fd, handle); iter++; } @@ -456,7 +416,6 @@ uint32_t handles[10000]; int map[10000]; unsigned long iter = 0; - int ret; int i; unsigned long map_size = batch * BO_SIZE + PAGE_SIZE - 1; @@ -478,10 +437,8 @@ if (random) igt_permute_array(map, batch, igt_exchange_int); for (i = 0; i < batch; i++) { - ret = gem_userptr(fd, bo_ptr + map[i] * BO_SIZE, - BO_SIZE, - 0, &handles[i]); - assert(ret == 0); + gem_userptr(fd, bo_ptr + map[i] * BO_SIZE, BO_SIZE, + 0, userptr_flags, &handles[i]); } if (random) igt_permute_array(map, batch, igt_exchange_int); diff -Nru intel-gpu-tools-1.13/benchmarks/gem_wait.c intel-gpu-tools-1.15/benchmarks/gem_wait.c --- intel-gpu-tools-1.13/benchmarks/gem_wait.c 2015-11-12 17:30:48.000000000 +0000 +++ intel-gpu-tools-1.15/benchmarks/gem_wait.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,303 +0,0 @@ -/* - * 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 "igt.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "drm.h" - -#define LOCAL_I915_EXEC_NO_RELOC (1<<11) -#define LOCAL_I915_EXEC_HANDLE_LUT (1<<12) - -#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 OBJECT 1024*1024 - -static int has_64bit_reloc; - -static int gem_linear_blt(int fd, - uint32_t *batch, - int offset, - uint32_t src, - uint32_t dst, - uint32_t length, - struct drm_i915_gem_relocation_entry *reloc) -{ - uint32_t *b = batch + offset/4; - int height = length / (16 * 1024); - - igt_assert_lte(height, 1 << 16); - - if (height) { - int i = 0; - b[i++] = COPY_BLT_CMD | BLT_WRITE_ALPHA | BLT_WRITE_RGB; - if (has_64bit_reloc) - b[i-1]+=2; - b[i++] = 0xcc << 16 | 1 << 25 | 1 << 24 | (16*1024); - b[i++] = 0; - b[i++] = height << 16 | (4*1024); - b[i++] = 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++; - if (has_64bit_reloc) - b[i++] = 0; /* FIXME */ - - b[i++] = 0; - b[i++] = 16*1024; - b[i++] = 0; - reloc->offset = (b-batch+7) * sizeof(uint32_t); - if (has_64bit_reloc) - reloc->offset += 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++; - if (has_64bit_reloc) - b[i++] = 0; /* FIXME */ - - b += i; - length -= height * 16*1024; - } - - if (length) { - int i = 0; - b[i++] = COPY_BLT_CMD | BLT_WRITE_ALPHA | BLT_WRITE_RGB; - if (has_64bit_reloc) - b[i-1]+=2; - b[i++] = 0xcc << 16 | 1 << 25 | 1 << 24 | (16*1024); - b[i++] = height << 16; - b[i++] = (1+height) << 16 | (length / 4); - b[i++] = 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++; - if (has_64bit_reloc) - b[i++] = 0; /* FIXME */ - - b[i++] = height << 16; - b[i++] = 16*1024; - b[i++] = 0; - reloc->offset = (b-batch+7) * sizeof(uint32_t); - if (has_64bit_reloc) - reloc->offset += 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++; - if (has_64bit_reloc) - b[i++] = 0; /* FIXME */ - - b += i; - } - - b[0] = MI_BATCH_BUFFER_END; - b[1] = 0; - - return (b+2 - batch) * sizeof(uint32_t); -} - -static int __gem_execbuf(int fd, struct drm_i915_gem_execbuffer2 *execbuf) -{ - int err = 0; - if (drmIoctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, execbuf)) - err = -errno; - return err; -} - -static void waiter(int child) -{ - struct drm_i915_gem_execbuffer2 execbuf; - struct drm_i915_gem_exec_object2 exec[3]; - struct drm_i915_gem_relocation_entry reloc[2*4096/32]; - uint32_t *buf, handle, src, dst; - int fd, len, gen, nreloc, last = 0; - int ring; - - fd = drm_open_driver(DRIVER_INTEL); - handle = gem_create(fd, 4096); - buf = gem_mmap__cpu(fd, handle, 0, 4096, PROT_WRITE); - - gen = intel_gen(intel_get_drm_devid(fd)); - has_64bit_reloc = gen >= 8; - - src = gem_create(fd, OBJECT); - dst = gem_create(fd, OBJECT); - - len = gem_linear_blt(fd, buf, 0, 0, 1, OBJECT, reloc); - - memset(exec, 0, sizeof(exec)); - exec[0].handle = src; - exec[1].handle = dst; - - exec[2].handle = handle; - if (has_64bit_reloc) - exec[2].relocation_count = len > 56 ? 4 : 2; - else - exec[2].relocation_count = len > 40 ? 4 : 2; - exec[2].relocs_ptr = (uintptr_t)reloc; - - ring = 0; - if (gen >= 6) - ring = I915_EXEC_BLT; - - memset(&execbuf, 0, sizeof(execbuf)); - execbuf.buffers_ptr = (uintptr_t)exec; - execbuf.buffer_count = 3; - execbuf.batch_len = len; - execbuf.flags = ring; - execbuf.flags |= LOCAL_I915_EXEC_HANDLE_LUT; - execbuf.flags |= LOCAL_I915_EXEC_NO_RELOC; - - if (__gem_execbuf(fd, &execbuf)) { - gem_set_domain(fd, handle, I915_GEM_DOMAIN_CPU, I915_GEM_DOMAIN_CPU); - len = gem_linear_blt(fd, buf, 0, src, dst, OBJECT, reloc); - igt_assert(len == execbuf.batch_len); - execbuf.flags = ring; - gem_execbuf(fd, &execbuf); - } - gem_sync(fd, handle); - - if (execbuf.flags & LOCAL_I915_EXEC_HANDLE_LUT) { - src = 0; - dst = 1; - } - - nreloc = exec[2].relocation_count; - while (execbuf.batch_len + len <= 4096) { - last = len - 8; - len = gem_linear_blt(fd, buf, len - 8, - src, dst, OBJECT, - reloc + exec[2].relocation_count); - exec[2].relocation_count += nreloc; - } - munmap(buf, 4096); - - execbuf.batch_len = len; - gem_execbuf(fd, &execbuf); - usleep(0); - - execbuf.batch_len = len - last; - execbuf.batch_start_offset = last; - for (int loop = 0; loop < 16*1024; loop++) - gem_execbuf(fd, &execbuf); - usleep(0); - - execbuf.batch_len = len; - execbuf.batch_start_offset = 0; - gem_execbuf(fd, &execbuf); - - gem_sync(fd, handle); - - close(fd); -} - -static volatile int done; - -static void *thread(void *arg) -{ - volatile uint64_t *c = arg; - - while (!done) - ++*c; - - return NULL; -} - -static int run(int num_waiters) -{ - int num_cpus = sysconf(_SC_NPROCESSORS_ONLN); - pthread_t *threads = calloc(num_cpus, sizeof(pthread_t)); - uint64_t *counters = calloc(num_cpus, 8*sizeof(uint64_t)); - uint64_t count; - - for (int n = 0; n < num_cpus; n++) - pthread_create(&threads[n], NULL, thread, &counters[8*n]); - - igt_fork(child, num_waiters) - waiter(child); - igt_waitchildren(); - - done = 1; - for (int n = 0; n < num_cpus; n++) - pthread_join(threads[n], NULL); - - count = 0; - for (int n = 0; n < num_cpus; n++) - count += counters[8*n]; - printf("%llu\n", (long long unsigned)count); - - return 0; -} - -int main(int argc, char **argv) -{ - int num_waiters = 128; - int c; - - while ((c = getopt (argc, argv, "w:")) != -1) { - switch (c) { - case 'w': - num_waiters = atoi(optarg); - if (num_waiters < 1) - num_waiters = 1; - break; - } - } - - return run(num_waiters); -} diff -Nru intel-gpu-tools-1.13/benchmarks/Makefile.am intel-gpu-tools-1.15/benchmarks/Makefile.am --- intel-gpu-tools-1.13/benchmarks/Makefile.am 2015-11-12 17:30:48.000000000 +0000 +++ intel-gpu-tools-1.15/benchmarks/Makefile.am 2016-05-23 10:51:28.000000000 +0000 @@ -2,14 +2,17 @@ include Makefile.sources AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/lib -AM_CFLAGS = $(DRM_CFLAGS) $(CWARNFLAGS) $(CAIRO_CFLAGS) $(LIBUNWIND_CFLAGS) -LDADD = $(top_builddir)/lib/libintel_tools.la $(DRM_LIBS) $(PCIACCESS_LIBS) $(CAIRO_LIBS) $(LIBUNWIND_LIBS) -lm +AM_CFLAGS = $(DRM_CFLAGS) $(CWARNFLAGS) $(CAIRO_CFLAGS) $(LIBUNWIND_CFLAGS) \ + $(WERROR_CFLAGS) +LDADD = $(top_builddir)/lib/libintel_tools.la benchmarks_LTLIBRARIES = gem_exec_tracer.la gem_exec_tracer_la_LDFLAGS = -module -avoid-version -no-undefined gem_exec_tracer_la_LIBADD = -ldl -gem_wait_CFLAGS = $(AM_CFLAGS) $(THREAD_CFLAGS) -gem_wait_LDADD = $(LDADD) -lpthread +gem_latency_CFLAGS = $(AM_CFLAGS) $(THREAD_CFLAGS) +gem_latency_LDADD = $(LDADD) -lpthread +gem_syslatency_CFLAGS = $(AM_CFLAGS) $(THREAD_CFLAGS) +gem_syslatency_LDADD = $(LDADD) -lpthread -lrt EXTRA_DIST=README diff -Nru intel-gpu-tools-1.13/benchmarks/Makefile.in intel-gpu-tools-1.15/benchmarks/Makefile.in --- intel-gpu-tools-1.13/benchmarks/Makefile.in 2015-12-02 16:47:58.000000000 +0000 +++ intel-gpu-tools-1.15/benchmarks/Makefile.in 2016-05-31 17:03:32.000000000 +0000 @@ -89,15 +89,17 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ +target_triplet = @target@ benchmarks_PROGRAMS = intel_upload_blit_large$(EXEEXT) \ intel_upload_blit_large_gtt$(EXEEXT) \ intel_upload_blit_large_map$(EXEEXT) \ intel_upload_blit_small$(EXEEXT) gem_blt$(EXEEXT) \ gem_create$(EXEEXT) gem_exec_ctx$(EXEEXT) \ - gem_exec_nop$(EXEEXT) gem_exec_reloc$(EXEEXT) \ - gem_exec_trace$(EXEEXT) gem_mmap$(EXEEXT) gem_prw$(EXEEXT) \ - gem_set_domain$(EXEEXT) gem_userptr_benchmark$(EXEEXT) \ - gem_wait$(EXEEXT) kms_vblank$(EXEEXT) + gem_exec_fault$(EXEEXT) gem_exec_nop$(EXEEXT) \ + gem_exec_reloc$(EXEEXT) gem_exec_trace$(EXEEXT) \ + gem_latency$(EXEEXT) gem_mmap$(EXEEXT) gem_prw$(EXEEXT) \ + gem_set_domain$(EXEEXT) gem_syslatency$(EXEEXT) \ + gem_userptr_benchmark$(EXEEXT) kms_vblank$(EXEEXT) subdir = benchmarks ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/as-compiler-flag.m4 \ @@ -157,110 +159,87 @@ gem_blt_SOURCES = gem_blt.c gem_blt_OBJECTS = gem_blt.$(OBJEXT) gem_blt_LDADD = $(LDADD) -am__DEPENDENCIES_1 = -gem_blt_DEPENDENCIES = $(top_builddir)/lib/libintel_tools.la \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +gem_blt_DEPENDENCIES = $(top_builddir)/lib/libintel_tools.la gem_create_SOURCES = gem_create.c gem_create_OBJECTS = gem_create.$(OBJEXT) gem_create_LDADD = $(LDADD) -gem_create_DEPENDENCIES = $(top_builddir)/lib/libintel_tools.la \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +gem_create_DEPENDENCIES = $(top_builddir)/lib/libintel_tools.la gem_exec_ctx_SOURCES = gem_exec_ctx.c gem_exec_ctx_OBJECTS = gem_exec_ctx.$(OBJEXT) gem_exec_ctx_LDADD = $(LDADD) -gem_exec_ctx_DEPENDENCIES = $(top_builddir)/lib/libintel_tools.la \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +gem_exec_ctx_DEPENDENCIES = $(top_builddir)/lib/libintel_tools.la +gem_exec_fault_SOURCES = gem_exec_fault.c +gem_exec_fault_OBJECTS = gem_exec_fault.$(OBJEXT) +gem_exec_fault_LDADD = $(LDADD) +gem_exec_fault_DEPENDENCIES = $(top_builddir)/lib/libintel_tools.la 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 = $(top_builddir)/lib/libintel_tools.la \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +gem_exec_nop_DEPENDENCIES = $(top_builddir)/lib/libintel_tools.la gem_exec_reloc_SOURCES = gem_exec_reloc.c gem_exec_reloc_OBJECTS = gem_exec_reloc.$(OBJEXT) gem_exec_reloc_LDADD = $(LDADD) -gem_exec_reloc_DEPENDENCIES = $(top_builddir)/lib/libintel_tools.la \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +gem_exec_reloc_DEPENDENCIES = $(top_builddir)/lib/libintel_tools.la gem_exec_trace_SOURCES = gem_exec_trace.c gem_exec_trace_OBJECTS = gem_exec_trace.$(OBJEXT) gem_exec_trace_LDADD = $(LDADD) -gem_exec_trace_DEPENDENCIES = $(top_builddir)/lib/libintel_tools.la \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +gem_exec_trace_DEPENDENCIES = $(top_builddir)/lib/libintel_tools.la +gem_latency_SOURCES = gem_latency.c +gem_latency_OBJECTS = gem_latency-gem_latency.$(OBJEXT) +gem_latency_DEPENDENCIES = $(LDADD) +gem_latency_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(gem_latency_CFLAGS) \ + $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ gem_mmap_SOURCES = gem_mmap.c gem_mmap_OBJECTS = gem_mmap.$(OBJEXT) gem_mmap_LDADD = $(LDADD) -gem_mmap_DEPENDENCIES = $(top_builddir)/lib/libintel_tools.la \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +gem_mmap_DEPENDENCIES = $(top_builddir)/lib/libintel_tools.la gem_prw_SOURCES = gem_prw.c gem_prw_OBJECTS = gem_prw.$(OBJEXT) gem_prw_LDADD = $(LDADD) -gem_prw_DEPENDENCIES = $(top_builddir)/lib/libintel_tools.la \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +gem_prw_DEPENDENCIES = $(top_builddir)/lib/libintel_tools.la gem_set_domain_SOURCES = gem_set_domain.c gem_set_domain_OBJECTS = gem_set_domain.$(OBJEXT) gem_set_domain_LDADD = $(LDADD) -gem_set_domain_DEPENDENCIES = $(top_builddir)/lib/libintel_tools.la \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +gem_set_domain_DEPENDENCIES = $(top_builddir)/lib/libintel_tools.la +gem_syslatency_SOURCES = gem_syslatency.c +gem_syslatency_OBJECTS = gem_syslatency-gem_syslatency.$(OBJEXT) +gem_syslatency_DEPENDENCIES = $(LDADD) +gem_syslatency_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(gem_syslatency_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o \ + $@ gem_userptr_benchmark_SOURCES = gem_userptr_benchmark.c gem_userptr_benchmark_OBJECTS = gem_userptr_benchmark.$(OBJEXT) gem_userptr_benchmark_LDADD = $(LDADD) gem_userptr_benchmark_DEPENDENCIES = \ - $(top_builddir)/lib/libintel_tools.la $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) -gem_wait_SOURCES = gem_wait.c -gem_wait_OBJECTS = gem_wait-gem_wait.$(OBJEXT) -am__DEPENDENCIES_2 = $(top_builddir)/lib/libintel_tools.la \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) -gem_wait_DEPENDENCIES = $(am__DEPENDENCIES_2) -gem_wait_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(gem_wait_CFLAGS) \ - $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ + $(top_builddir)/lib/libintel_tools.la 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) intel_upload_blit_large_DEPENDENCIES = \ - $(top_builddir)/lib/libintel_tools.la $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) + $(top_builddir)/lib/libintel_tools.la 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) \ - $(am__DEPENDENCIES_1) + $(top_builddir)/lib/libintel_tools.la 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) \ - $(am__DEPENDENCIES_1) + $(top_builddir)/lib/libintel_tools.la 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) \ - $(am__DEPENDENCIES_1) + $(top_builddir)/lib/libintel_tools.la kms_vblank_SOURCES = kms_vblank.c kms_vblank_OBJECTS = kms_vblank.$(OBJEXT) kms_vblank_LDADD = $(LDADD) -kms_vblank_DEPENDENCIES = $(top_builddir)/lib/libintel_tools.la \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +kms_vblank_DEPENDENCIES = $(top_builddir)/lib/libintel_tools.la AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false @@ -296,14 +275,16 @@ am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = gem_exec_tracer.c gem_blt.c gem_create.c gem_exec_ctx.c \ - gem_exec_nop.c gem_exec_reloc.c gem_exec_trace.c gem_mmap.c \ - gem_prw.c gem_set_domain.c gem_userptr_benchmark.c gem_wait.c \ + gem_exec_fault.c gem_exec_nop.c gem_exec_reloc.c \ + gem_exec_trace.c gem_latency.c gem_mmap.c gem_prw.c \ + gem_set_domain.c gem_syslatency.c gem_userptr_benchmark.c \ intel_upload_blit_large.c intel_upload_blit_large_gtt.c \ intel_upload_blit_large_map.c intel_upload_blit_small.c \ kms_vblank.c DIST_SOURCES = gem_exec_tracer.c gem_blt.c gem_create.c gem_exec_ctx.c \ - gem_exec_nop.c gem_exec_reloc.c gem_exec_trace.c gem_mmap.c \ - gem_prw.c gem_set_domain.c gem_userptr_benchmark.c gem_wait.c \ + gem_exec_fault.c gem_exec_nop.c gem_exec_reloc.c \ + gem_exec_trace.c gem_latency.c gem_mmap.c gem_prw.c \ + gem_set_domain.c gem_syslatency.c gem_userptr_benchmark.c \ intel_upload_blit_large.c intel_upload_blit_large_gtt.c \ intel_upload_blit_large_map.c intel_upload_blit_small.c \ kms_vblank.c @@ -368,6 +349,8 @@ DRM_LIBS = @DRM_LIBS@ DRM_NOUVEAU_CFLAGS = @DRM_NOUVEAU_CFLAGS@ DRM_NOUVEAU_LIBS = @DRM_NOUVEAU_LIBS@ +DRM_VC4_CFLAGS = @DRM_VC4_CFLAGS@ +DRM_VC4_LIBS = @DRM_VC4_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -412,6 +395,7 @@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MAN_SUBSTS = @MAN_SUBSTS@ @@ -456,6 +440,7 @@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ THREAD_CFLAGS = @THREAD_CFLAGS@ +TIMER_LIBS = @TIMER_LIBS@ VERSION = @VERSION@ XORG_MAN_PAGE = @XORG_MAN_PAGE@ XRANDR_CFLAGS = @XRANDR_CFLAGS@ @@ -510,23 +495,32 @@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ +target = @target@ target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ benchmarksdir = $(libexecdir)/intel-gpu-tools/benchmarks AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/lib -AM_CFLAGS = $(DRM_CFLAGS) $(CWARNFLAGS) $(CAIRO_CFLAGS) $(LIBUNWIND_CFLAGS) -LDADD = $(top_builddir)/lib/libintel_tools.la $(DRM_LIBS) $(PCIACCESS_LIBS) $(CAIRO_LIBS) $(LIBUNWIND_LIBS) -lm +AM_CFLAGS = $(DRM_CFLAGS) $(CWARNFLAGS) $(CAIRO_CFLAGS) $(LIBUNWIND_CFLAGS) \ + $(WERROR_CFLAGS) + +LDADD = $(top_builddir)/lib/libintel_tools.la benchmarks_LTLIBRARIES = gem_exec_tracer.la gem_exec_tracer_la_LDFLAGS = -module -avoid-version -no-undefined gem_exec_tracer_la_LIBADD = -ldl -gem_wait_CFLAGS = $(AM_CFLAGS) $(THREAD_CFLAGS) -gem_wait_LDADD = $(LDADD) -lpthread +gem_latency_CFLAGS = $(AM_CFLAGS) $(THREAD_CFLAGS) +gem_latency_LDADD = $(LDADD) -lpthread +gem_syslatency_CFLAGS = $(AM_CFLAGS) $(THREAD_CFLAGS) +gem_syslatency_LDADD = $(LDADD) -lpthread -lrt EXTRA_DIST = README all: all-am @@ -662,6 +656,10 @@ @rm -f gem_exec_ctx$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gem_exec_ctx_OBJECTS) $(gem_exec_ctx_LDADD) $(LIBS) +gem_exec_fault$(EXEEXT): $(gem_exec_fault_OBJECTS) $(gem_exec_fault_DEPENDENCIES) $(EXTRA_gem_exec_fault_DEPENDENCIES) + @rm -f gem_exec_fault$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(gem_exec_fault_OBJECTS) $(gem_exec_fault_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) @@ -674,6 +672,10 @@ @rm -f gem_exec_trace$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gem_exec_trace_OBJECTS) $(gem_exec_trace_LDADD) $(LIBS) +gem_latency$(EXEEXT): $(gem_latency_OBJECTS) $(gem_latency_DEPENDENCIES) $(EXTRA_gem_latency_DEPENDENCIES) + @rm -f gem_latency$(EXEEXT) + $(AM_V_CCLD)$(gem_latency_LINK) $(gem_latency_OBJECTS) $(gem_latency_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) @@ -686,14 +688,14 @@ @rm -f gem_set_domain$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gem_set_domain_OBJECTS) $(gem_set_domain_LDADD) $(LIBS) +gem_syslatency$(EXEEXT): $(gem_syslatency_OBJECTS) $(gem_syslatency_DEPENDENCIES) $(EXTRA_gem_syslatency_DEPENDENCIES) + @rm -f gem_syslatency$(EXEEXT) + $(AM_V_CCLD)$(gem_syslatency_LINK) $(gem_syslatency_OBJECTS) $(gem_syslatency_LDADD) $(LIBS) + gem_userptr_benchmark$(EXEEXT): $(gem_userptr_benchmark_OBJECTS) $(gem_userptr_benchmark_DEPENDENCIES) $(EXTRA_gem_userptr_benchmark_DEPENDENCIES) @rm -f gem_userptr_benchmark$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gem_userptr_benchmark_OBJECTS) $(gem_userptr_benchmark_LDADD) $(LIBS) -gem_wait$(EXEEXT): $(gem_wait_OBJECTS) $(gem_wait_DEPENDENCIES) $(EXTRA_gem_wait_DEPENDENCIES) - @rm -f gem_wait$(EXEEXT) - $(AM_V_CCLD)$(gem_wait_LINK) $(gem_wait_OBJECTS) $(gem_wait_LDADD) $(LIBS) - 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) @@ -723,15 +725,17 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_blt.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_create.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_exec_ctx.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_exec_fault.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_exec_nop.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_exec_reloc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_exec_trace.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_exec_tracer.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_latency-gem_latency.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_mmap.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_prw.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_set_domain.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_syslatency-gem_syslatency.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_userptr_benchmark.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_wait-gem_wait.Po@am__quote@ @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@ @@ -762,19 +766,33 @@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< -gem_wait-gem_wait.o: gem_wait.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gem_wait_CFLAGS) $(CFLAGS) -MT gem_wait-gem_wait.o -MD -MP -MF $(DEPDIR)/gem_wait-gem_wait.Tpo -c -o gem_wait-gem_wait.o `test -f 'gem_wait.c' || echo '$(srcdir)/'`gem_wait.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/gem_wait-gem_wait.Tpo $(DEPDIR)/gem_wait-gem_wait.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gem_wait.c' object='gem_wait-gem_wait.o' libtool=no @AMDEPBACKSLASH@ +gem_latency-gem_latency.o: gem_latency.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gem_latency_CFLAGS) $(CFLAGS) -MT gem_latency-gem_latency.o -MD -MP -MF $(DEPDIR)/gem_latency-gem_latency.Tpo -c -o gem_latency-gem_latency.o `test -f 'gem_latency.c' || echo '$(srcdir)/'`gem_latency.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/gem_latency-gem_latency.Tpo $(DEPDIR)/gem_latency-gem_latency.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gem_latency.c' object='gem_latency-gem_latency.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_latency_CFLAGS) $(CFLAGS) -c -o gem_latency-gem_latency.o `test -f 'gem_latency.c' || echo '$(srcdir)/'`gem_latency.c + +gem_latency-gem_latency.obj: gem_latency.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gem_latency_CFLAGS) $(CFLAGS) -MT gem_latency-gem_latency.obj -MD -MP -MF $(DEPDIR)/gem_latency-gem_latency.Tpo -c -o gem_latency-gem_latency.obj `if test -f 'gem_latency.c'; then $(CYGPATH_W) 'gem_latency.c'; else $(CYGPATH_W) '$(srcdir)/gem_latency.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/gem_latency-gem_latency.Tpo $(DEPDIR)/gem_latency-gem_latency.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gem_latency.c' object='gem_latency-gem_latency.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_latency_CFLAGS) $(CFLAGS) -c -o gem_latency-gem_latency.obj `if test -f 'gem_latency.c'; then $(CYGPATH_W) 'gem_latency.c'; else $(CYGPATH_W) '$(srcdir)/gem_latency.c'; fi` + +gem_syslatency-gem_syslatency.o: gem_syslatency.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gem_syslatency_CFLAGS) $(CFLAGS) -MT gem_syslatency-gem_syslatency.o -MD -MP -MF $(DEPDIR)/gem_syslatency-gem_syslatency.Tpo -c -o gem_syslatency-gem_syslatency.o `test -f 'gem_syslatency.c' || echo '$(srcdir)/'`gem_syslatency.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/gem_syslatency-gem_syslatency.Tpo $(DEPDIR)/gem_syslatency-gem_syslatency.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gem_syslatency.c' object='gem_syslatency-gem_syslatency.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_wait_CFLAGS) $(CFLAGS) -c -o gem_wait-gem_wait.o `test -f 'gem_wait.c' || echo '$(srcdir)/'`gem_wait.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gem_syslatency_CFLAGS) $(CFLAGS) -c -o gem_syslatency-gem_syslatency.o `test -f 'gem_syslatency.c' || echo '$(srcdir)/'`gem_syslatency.c -gem_wait-gem_wait.obj: gem_wait.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gem_wait_CFLAGS) $(CFLAGS) -MT gem_wait-gem_wait.obj -MD -MP -MF $(DEPDIR)/gem_wait-gem_wait.Tpo -c -o gem_wait-gem_wait.obj `if test -f 'gem_wait.c'; then $(CYGPATH_W) 'gem_wait.c'; else $(CYGPATH_W) '$(srcdir)/gem_wait.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/gem_wait-gem_wait.Tpo $(DEPDIR)/gem_wait-gem_wait.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gem_wait.c' object='gem_wait-gem_wait.obj' libtool=no @AMDEPBACKSLASH@ +gem_syslatency-gem_syslatency.obj: gem_syslatency.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gem_syslatency_CFLAGS) $(CFLAGS) -MT gem_syslatency-gem_syslatency.obj -MD -MP -MF $(DEPDIR)/gem_syslatency-gem_syslatency.Tpo -c -o gem_syslatency-gem_syslatency.obj `if test -f 'gem_syslatency.c'; then $(CYGPATH_W) 'gem_syslatency.c'; else $(CYGPATH_W) '$(srcdir)/gem_syslatency.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/gem_syslatency-gem_syslatency.Tpo $(DEPDIR)/gem_syslatency-gem_syslatency.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gem_syslatency.c' object='gem_syslatency-gem_syslatency.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_wait_CFLAGS) $(CFLAGS) -c -o gem_wait-gem_wait.obj `if test -f 'gem_wait.c'; then $(CYGPATH_W) 'gem_wait.c'; else $(CYGPATH_W) '$(srcdir)/gem_wait.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gem_syslatency_CFLAGS) $(CFLAGS) -c -o gem_syslatency-gem_syslatency.obj `if test -f 'gem_syslatency.c'; then $(CYGPATH_W) 'gem_syslatency.c'; else $(CYGPATH_W) '$(srcdir)/gem_syslatency.c'; fi` mostlyclean-libtool: -rm -f *.lo diff -Nru intel-gpu-tools-1.13/benchmarks/Makefile.sources intel-gpu-tools-1.15/benchmarks/Makefile.sources --- intel-gpu-tools-1.13/benchmarks/Makefile.sources 2015-11-23 17:46:24.000000000 +0000 +++ intel-gpu-tools-1.15/benchmarks/Makefile.sources 2016-05-23 10:51:28.000000000 +0000 @@ -8,13 +8,15 @@ gem_blt \ gem_create \ gem_exec_ctx \ + gem_exec_fault \ gem_exec_nop \ gem_exec_reloc \ gem_exec_trace \ + gem_latency \ gem_mmap \ gem_prw \ gem_set_domain \ + gem_syslatency \ gem_userptr_benchmark \ - gem_wait \ kms_vblank \ $(NULL) diff -Nru intel-gpu-tools-1.13/build-aux/config.guess intel-gpu-tools-1.15/build-aux/config.guess --- intel-gpu-tools-1.13/build-aux/config.guess 2015-09-11 15:13:13.000000000 +0000 +++ intel-gpu-tools-1.15/build-aux/config.guess 2016-05-31 17:03:12.000000000 +0000 @@ -2,7 +2,7 @@ # Attempt to guess a canonical system name. # Copyright 1992-2015 Free Software Foundation, Inc. -timestamp='2015-01-01' +timestamp='2015-08-20' # 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 @@ -168,20 +168,27 @@ # 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)` + UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ + /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 ;; + earmv*) + arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'` + endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'` + machine=${arch}${endian}-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) + arm*|earm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ @@ -197,6 +204,13 @@ os=netbsd ;; esac + # Determine ABI tags. + case "${UNAME_MACHINE_ARCH}" in + earm*) + expr='s/^earmv[0-9]/-eabi/;s/eb$//' + abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"` + ;; + esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need @@ -207,13 +221,13 @@ release='-gnu' ;; *) - release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + release=`echo ${UNAME_RELEASE} | sed -e 's/[-_].*//' | cut -d. -f1,2` ;; 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}" + echo "${machine}-${os}${release}${abi}" exit ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` @@ -235,6 +249,9 @@ *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; + *:Sortix:*:*) + echo ${UNAME_MACHINE}-unknown-sortix + exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) @@ -933,6 +950,9 @@ crisv32:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; + e2k:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; frv:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; @@ -1021,7 +1041,7 @@ echo ${UNAME_MACHINE}-dec-linux-${LIBC} exit ;; x86_64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo ${UNAME_MACHINE}-pc-linux-${LIBC} exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} diff -Nru intel-gpu-tools-1.13/build-aux/config.sub intel-gpu-tools-1.15/build-aux/config.sub --- intel-gpu-tools-1.13/build-aux/config.sub 2015-09-11 15:13:13.000000000 +0000 +++ intel-gpu-tools-1.15/build-aux/config.sub 2016-05-31 17:03:12.000000000 +0000 @@ -2,7 +2,7 @@ # Configuration validation subroutine script. # Copyright 1992-2015 Free Software Foundation, Inc. -timestamp='2015-01-01' +timestamp='2015-08-20' # 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 @@ -117,7 +117,7 @@ case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ - knetbsd*-gnu* | netbsd*-gnu* | \ + knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os @@ -255,11 +255,12 @@ | arc | arceb \ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ | avr | avr32 \ + | ba \ | be32 | be64 \ | bfin \ | c4x | c8051 | clipper \ | d10v | d30v | dlx | dsp16xx \ - | epiphany \ + | e2k | epiphany \ | fido | fr30 | frv | ft32 \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ @@ -305,7 +306,7 @@ | riscv32 | riscv64 \ | 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 \ + | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ @@ -376,12 +377,13 @@ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ + | ba-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | c8051-* | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ - | elxsi-* \ + | e2k-* | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ @@ -428,12 +430,13 @@ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pyramid-* \ + | riscv32-* | riscv64-* \ | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ - | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ @@ -518,6 +521,9 @@ basic_machine=i386-pc os=-aros ;; + asmjs) + basic_machine=asmjs-unknown + ;; aux) basic_machine=m68k-apple os=-aux @@ -1025,7 +1031,7 @@ ;; ppc64) basic_machine=powerpc64-unknown ;; - ppc64-* | ppc64p7-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown @@ -1373,7 +1379,7 @@ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* | -plan9* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ - | -aos* | -aros* \ + | -aos* | -aros* | -cloudabi* | -sortix* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ diff -Nru intel-gpu-tools-1.13/build-aux/install-sh intel-gpu-tools-1.15/build-aux/install-sh --- intel-gpu-tools-1.13/build-aux/install-sh 2015-09-11 15:13:13.000000000 +0000 +++ intel-gpu-tools-1.15/build-aux/install-sh 2016-05-31 17:03:12.000000000 +0000 @@ -1,7 +1,7 @@ #!/bin/sh # install - install a program, script, or datafile -scriptversion=2013-12-25.23; # UTC +scriptversion=2014-09-12.12; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the @@ -324,34 +324,41 @@ # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) + # $RANDOM is not portable (e.g. dash); use it when possible to + # lower collision chance tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ - trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 + trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0 + # As "mkdir -p" follows symlinks and we work in /tmp possibly; so + # create the $tmpdir first (and fail if unsuccessful) to make sure + # that nobody tries to guess the $tmpdir name. if (umask $mkdir_umask && - exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 + $mkdirprog $mkdir_mode "$tmpdir" && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/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-writable 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"` + test_tmpdir="$tmpdir/a" + ls_ld_tmpdir=`ls -ld "$test_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"` + $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi - rmdir "$tmpdir/d" "$tmpdir" + rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. - rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null + rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null fi trap '' 0;; esac;; diff -Nru intel-gpu-tools-1.13/build-aux/ltmain.sh intel-gpu-tools-1.15/build-aux/ltmain.sh --- intel-gpu-tools-1.13/build-aux/ltmain.sh 2015-09-11 15:13:09.000000000 +0000 +++ intel-gpu-tools-1.15/build-aux/ltmain.sh 2016-05-31 17:03:08.000000000 +0000 @@ -1,9 +1,12 @@ +#! /bin/sh +## DO NOT EDIT - This file generated from ./build-aux/ltmain.in +## by inline-source v2014-01-03.01 -# libtool (GNU libtool) 2.4.2 +# libtool (GNU libtool) 2.4.6 +# Provide generalized library-building support services. # 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. +# Copyright (C) 1996-2015 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. @@ -23,881 +26,2112 @@ # 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. +# along with this program. If not, see . -# Usage: $progname [OPTION]... [MODE-ARG]... -# -# Provide generalized library-building support services. -# -# --config show all configuration variables -# --debug enable verbose shell tracing -# -n, --dry-run display commands without modifying any files -# --features display basic configuration information and exit -# --mode=MODE use operation mode MODE -# --preserve-dup-deps don't remove duplicate dependency libraries -# --quiet, --silent don't print informational messages -# --no-quiet, --no-silent -# print informational messages (default) -# --no-warn don't display warning messages -# --tag=TAG use configuration variables from tag TAG -# -v, --verbose print more informational messages than default -# --no-verbose don't print the extra informational messages -# --version print version information -# -h, --help, --help-all print short, long, or detailed help message -# -# MODE must be one of the following: -# -# clean remove files from the build directory -# compile compile a source file into a libtool object -# execute automatically set library path, then run a program -# finish complete the installation of libtool libraries -# install install libraries or executables -# link create a library or an executable -# uninstall remove libraries from an installed directory -# -# MODE-ARGS vary depending on the MODE. When passed as first option, -# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that. -# Try `$progname --help --mode=MODE' for a more detailed description of MODE. -# -# When reporting a bug, please describe a test case to reproduce it and -# include the following information: -# -# host-triplet: $host -# shell: $SHELL -# compiler: $LTCC -# compiler flags: $LTCFLAGS -# linker: $LD (gnu? $with_gnu_ld) -# $progname: (GNU libtool) 2.4.2 -# automake: $automake_version -# autoconf: $autoconf_version -# -# Report bugs to . -# GNU libtool home page: . -# General help using GNU software: . PROGRAM=libtool PACKAGE=libtool -VERSION=2.4.2 -TIMESTAMP="" -package_revision=1.3337 +VERSION="2.4.6 Debian-2.4.6-0.1" +package_revision=2.4.6 -# Be Bourne compatible -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + +## ------ ## +## Usage. ## +## ------ ## + +# Run './libtool --help' for help with using this script from the +# command line. + + +## ------------------------------- ## +## User overridable command paths. ## +## ------------------------------- ## + +# After configure completes, it has a better idea of some of the +# shell tools we need than the defaults used by the functions shared +# with bootstrap, so set those here where they can still be over- +# ridden by the user, but otherwise take precedence. + +: ${AUTOCONF="autoconf"} +: ${AUTOMAKE="automake"} + + +## -------------------------- ## +## Source external libraries. ## +## -------------------------- ## + +# Much of our low-level functionality needs to be sourced from external +# libraries, which are installed to $pkgauxdir. + +# Set a version string for this script. +scriptversion=2015-01-20.17; # UTC + +# General shell script boiler plate, and helper functions. +# Written by Gary V. Vaughan, 2004 + +# Copyright (C) 2004-2015 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. + +# 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. + +# 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. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNES 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 . + +# Please report bugs or propose patches to gary@gnu.org. + + +## ------ ## +## Usage. ## +## ------ ## + +# Evaluate this file near the top of your script to gain access to +# the functions and variables defined here: +# +# . `echo "$0" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh +# +# If you need to override any of the default environment variable +# settings, do that before evaluating this file. + + +## -------------------- ## +## Shell normalisation. ## +## -------------------- ## + +# Some shells need a little help to be as Bourne compatible as possible. +# Before doing anything else, make sure all that help has been provided! + +DUALCASE=1; export DUALCASE # for MKS sh +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 + # 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 + 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 +# NLS nuisances: We save the old values in case they are required later. +_G_user_locale= +_G_safe_locale= +for _G_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\" + eval "if test set = \"\${$_G_var+set}\"; then + save_$_G_var=\$$_G_var + $_G_var=C + export $_G_var + _G_user_locale=\"$_G_var=\\\$save_\$_G_var; \$_G_user_locale\" + _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\" fi" done -LC_ALL=C -LANGUAGE=C -export LANGUAGE LC_ALL -$lt_unset CDPATH +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +# Make sure IFS has a sensible default +sp=' ' +nl=' +' +IFS="$sp $nl" +# There are apparently some retarded systems that use ';' as a PATH separator! +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 -# 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" +## ------------------------- ## +## Locate command utilities. ## +## ------------------------- ## + + +# func_executable_p FILE +# ---------------------- +# Check that FILE is an executable regular file. +func_executable_p () +{ + test -f "$1" && test -x "$1" +} + + +# func_path_progs PROGS_LIST CHECK_FUNC [PATH] +# -------------------------------------------- +# Search for either a program that responds to --version with output +# containing "GNU", or else returned by CHECK_FUNC otherwise, by +# trying all the directories in PATH with each of the elements of +# PROGS_LIST. +# +# CHECK_FUNC should accept the path to a candidate program, and +# set $func_check_prog_result if it truncates its output less than +# $_G_path_prog_max characters. +func_path_progs () +{ + _G_progs_list=$1 + _G_check_func=$2 + _G_PATH=${3-"$PATH"} + + _G_path_prog_max=0 + _G_path_prog_found=false + _G_save_IFS=$IFS; IFS=${PATH_SEPARATOR-:} + for _G_dir in $_G_PATH; do + IFS=$_G_save_IFS + test -z "$_G_dir" && _G_dir=. + for _G_prog_name in $_G_progs_list; do + for _exeext in '' .EXE; do + _G_path_prog=$_G_dir/$_G_prog_name$_exeext + func_executable_p "$_G_path_prog" || continue + case `"$_G_path_prog" --version 2>&1` in + *GNU*) func_path_progs_result=$_G_path_prog _G_path_prog_found=: ;; + *) $_G_check_func $_G_path_prog + func_path_progs_result=$func_check_prog_result + ;; + esac + $_G_path_prog_found && break 3 + done + done + done + IFS=$_G_save_IFS + test -z "$func_path_progs_result" && { + echo "no acceptable sed could be found in \$PATH" >&2 + exit 1 + } +} + + +# We want to be able to use the functions in this file before configure +# has figured out where the best binaries are kept, which means we have +# to search for them ourselves - except when the results are already set +# where we skip the searches. + +# Unless the user overrides by setting SED, search the path for either GNU +# sed, or the sed that truncates its output the least. +test -z "$SED" && { + _G_sed_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ + for _G_i in 1 2 3 4 5 6 7; do + _G_sed_script=$_G_sed_script$nl$_G_sed_script + done + echo "$_G_sed_script" 2>/dev/null | sed 99q >conftest.sed + _G_sed_script= + + func_check_prog_sed () + { + _G_path_prog=$1 + + _G_count=0 + printf 0123456789 >conftest.in + while : + do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo '' >> conftest.nl + "$_G_path_prog" -f conftest.sed conftest.out 2>/dev/null || break + diff conftest.out conftest.nl >/dev/null 2>&1 || break + _G_count=`expr $_G_count + 1` + if test "$_G_count" -gt "$_G_path_prog_max"; then + # Best one so far, save it but keep looking for a better one + func_check_prog_result=$_G_path_prog + _G_path_prog_max=$_G_count + fi + # 10*(2^10) chars as input seems more than enough + test 10 -lt "$_G_count" && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out + } + + func_path_progs "sed gsed" func_check_prog_sed $PATH:/usr/xpg4/bin + rm -f conftest.sed + SED=$func_path_progs_result +} + + +# Unless the user overrides by setting GREP, search the path for either GNU +# grep, or the grep that truncates its output the least. +test -z "$GREP" && { + func_check_prog_grep () + { + _G_path_prog=$1 + + _G_count=0 + _G_path_prog_max=0 + printf 0123456789 >conftest.in + while : + do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo 'GREP' >> conftest.nl + "$_G_path_prog" -e 'GREP$' -e '-(cannot match)-' conftest.out 2>/dev/null || break + diff conftest.out conftest.nl >/dev/null 2>&1 || break + _G_count=`expr $_G_count + 1` + if test "$_G_count" -gt "$_G_path_prog_max"; then + # Best one so far, save it but keep looking for a better one + func_check_prog_result=$_G_path_prog + _G_path_prog_max=$_G_count + fi + # 10*(2^10) chars as input seems more than enough + test 10 -lt "$_G_count" && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out + } + + func_path_progs "grep ggrep" func_check_prog_grep $PATH:/usr/xpg4/bin + GREP=$func_path_progs_result +} + + +## ------------------------------- ## +## User overridable command paths. ## +## ------------------------------- ## + +# All uppercase variable names are used for environment variables. These +# variables can be overridden by the user before calling a script that +# uses them if a suitable command of that name is not already available +# in the command search PATH. : ${CP="cp -f"} -test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} +: ${ECHO="printf %s\n"} +: ${EGREP="$GREP -E"} +: ${FGREP="$GREP -F"} +: ${LN_S="ln -s"} : ${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 +## -------------------- ## +## Useful sed snippets. ## +## -------------------- ## +sed_dirname='s|/[^/]*$||' +sed_basename='s|^.*/||' -# func_basename file -func_basename () -{ - func_basename_result=`$ECHO "${1}" | $SED "$basename"` -} # func_basename may be replaced by extended shell implementation +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +sed_quote_subst='s|\([`"$\\]\)|\\\1|g' +# Same as above, but do not quote variable references. +sed_double_quote_subst='s/\(["`\\]\)/\\\1/g' -# 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 +# 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 +# that contains forward slashes, into one that contains +# (escaped) backslashes. A very naive implementation. +sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' -# 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 +# Re-'\' parameter expansions in output of sed_double_quote_subst that +# were '\'-ed in input to the same. If an odd number of '\' preceded a +# '$' in input to sed_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 '$'. +_G_bs='\\' +_G_bs2='\\\\' +_G_bs4='\\\\\\\\' +_G_dollar='\$' +sed_double_backslash="\ + s/$_G_bs4/&\\ +/g + s/^$_G_bs2$_G_dollar/$_G_bs&/ + s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g + s/\n//g" -# 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,/*$,/,' +## ----------------- ## +## Global variables. ## +## ----------------- ## + +# Except for the global variables explicitly listed below, the following +# functions in the '^func_' namespace, and the '^require_' namespace +# variables initialised in the 'Resource management' section, sourcing +# this file will not pollute your global namespace with anything +# else. There's no portable way to scope variables in Bourne shell +# though, so actually running these functions will sometimes place +# results into a variable named after the function, and often use +# temporary variables in the '^_G_' namespace. If you are careful to +# avoid using those namespaces casually in your sourcing script, things +# should continue to work as you expect. And, of course, you can freely +# overwrite any of the functions or variables defined here before +# calling anything to customize them. -# 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 -} +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. -# 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 +# Allow overriding, eg assuming that you follow the convention of +# putting '$debug_cmd' at the start of all your functions, you can get +# bash to show function call trace with: +# +# debug_cmd='eval echo "${FUNCNAME[0]} $*" >&2' bash your-script-name +debug_cmd=${debug_cmd-":"} +exit_cmd=: - # 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 +# By convention, finish your script with: +# +# exit $exit_status +# +# so that you can set exit_status to non-zero if you want to indicate +# something went wrong during execution without actually bailing out at +# the point of failure. +exit_status=$EXIT_SUCCESS - # 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 -} +# 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 -# The name of this program: -func_dirname_and_basename "$progpath" -progname=$func_basename_result +# The name of this program. +progname=`$ECHO "$progpath" |$SED "$sed_basename"` -# Make sure we have an absolute path for reexecution: +# Make sure we have an absolute progpath for reexecution: case $progpath in [\\/]*|[A-Za-z]:\\*) ;; *[\\/]*) - progdir=$func_dirname_result + progdir=`$ECHO "$progpath" |$SED "$sed_dirname"` progdir=`cd "$progdir" && pwd` - progpath="$progdir/$progname" + progpath=$progdir/$progname ;; *) - save_IFS="$IFS" + _G_IFS=$IFS IFS=${PATH_SEPARATOR-:} for progdir in $PATH; do - IFS="$save_IFS" + IFS=$_G_IFS test -x "$progdir/$progname" && break done - IFS="$save_IFS" + IFS=$_G_IFS test -n "$progdir" || progdir=`pwd` - progpath="$progdir/$progname" + 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. ## +## ----------------- ## + +# The following options affect the operation of the functions defined +# below, and should be set appropriately depending on run-time para- +# meters passed on the command line. -# 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+"$@"} +# Categories 'all' and 'none' are always available. Append any others +# you will pass as the first argument to func_warning from your own +# code. +warning_categories= + +# By default, display warnings according to 'opt_warning_types'. Set +# 'warning_func' to ':' to elide all warnings, or func_fatal_error to +# treat the next displayed warning as a fatal error. +warning_func=func_warn_and_continue + +# Set to 'all' to display all warnings, 'none' to suppress all +# warnings, or a space delimited list of some subset of +# 'warning_categories' to display only the listed warnings. +opt_warning_types=all + + +## -------------------- ## +## Resource management. ## +## -------------------- ## + +# This section contains definitions for functions that each ensure a +# particular resource (a file, or a non-empty configuration variable for +# example) is available, and if appropriate to extract default values +# from pertinent package files. Call them using their associated +# 'require_*' variable to ensure that they are executed, at most, once. +# +# It's entirely deliberate that calling these functions can set +# variables that don't obey the namespace limitations obeyed by the rest +# of this file, in order that that they be as useful as possible to +# callers. + + +# require_term_colors +# ------------------- +# Allow display of bold text on terminals that support it. +require_term_colors=func_require_term_colors +func_require_term_colors () +{ + $debug_cmd + + test -t 1 && { + # COLORTERM and USE_ANSI_COLORS environment variables take + # precedence, because most terminfo databases neglect to describe + # whether color sequences are supported. + test -n "${COLORTERM+set}" && : ${USE_ANSI_COLORS="1"} + + if test 1 = "$USE_ANSI_COLORS"; then + # Standard ANSI escape sequences + tc_reset='' + tc_bold=''; tc_standout='' + tc_red=''; tc_green='' + tc_blue=''; tc_cyan='' + else + # Otherwise trust the terminfo database after all. + test -n "`tput sgr0 2>/dev/null`" && { + tc_reset=`tput sgr0` + test -n "`tput bold 2>/dev/null`" && tc_bold=`tput bold` + tc_standout=$tc_bold + test -n "`tput smso 2>/dev/null`" && tc_standout=`tput smso` + test -n "`tput setaf 1 2>/dev/null`" && tc_red=`tput setaf 1` + test -n "`tput setaf 2 2>/dev/null`" && tc_green=`tput setaf 2` + test -n "`tput setaf 4 2>/dev/null`" && tc_blue=`tput setaf 4` + test -n "`tput setaf 5 2>/dev/null`" && tc_cyan=`tput setaf 5` + } + fi + } - # 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: - : + require_term_colors=: } -# 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 -} +## ----------------- ## +## Function library. ## +## ----------------- ## -# 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 +# This section contains a variety of useful functions to call in your +# scripts. Take note of the portable wrappers for features provided by +# some modern shells, which will fall back to slower equivalents on +# less featureful shells. - # 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_append VAR VALUE +# --------------------- +# Append VALUE onto the existing contents of VAR. -# 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 + # We should try to minimise forks, especially on Windows where they are + # unreasonably slow, so skip the feature probes when bash or zsh are + # being used: + if test set = "${BASH_VERSION+set}${ZSH_VERSION+set}"; then + : ${_G_HAVE_ARITH_OP="yes"} + : ${_G_HAVE_XSI_OPS="yes"} + # The += operator was introduced in bash 3.1 + case $BASH_VERSION in + [12].* | 3.0 | 3.0*) ;; + *) + : ${_G_HAVE_PLUSEQ_OP="yes"} + ;; + esac + fi + # _G_HAVE_PLUSEQ_OP + # Can be empty, in which case the shell is probed, "yes" if += is + # useable or anything else if it does not work. + test -z "$_G_HAVE_PLUSEQ_OP" \ + && (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \ + && _G_HAVE_PLUSEQ_OP=yes + +if test yes = "$_G_HAVE_PLUSEQ_OP" +then + # This is an XSI compatible shell, allowing a faster implementation... + eval 'func_append () + { + $debug_cmd + + eval "$1+=\$2" + }' +else + # ...otherwise fall back to using expr, which is often a shell builtin. + func_append () + { + $debug_cmd + + eval "$1=\$$1\$2" + } +fi + + +# func_append_quoted VAR VALUE +# ---------------------------- +# Quote VALUE and append to the end of shell variable VAR, separated +# by a space. +if test yes = "$_G_HAVE_PLUSEQ_OP"; then + eval 'func_append_quoted () + { + $debug_cmd + + func_quote_for_eval "$2" + eval "$1+=\\ \$func_quote_for_eval_result" + }' +else + func_append_quoted () + { + $debug_cmd + + func_quote_for_eval "$2" + eval "$1=\$$1\\ \$func_quote_for_eval_result" + } +fi + + +# func_append_uniq VAR VALUE +# -------------------------- +# Append unique VALUE onto the existing contents of VAR, assuming +# entries are delimited by the first character of VALUE. For example: +# +# func_append_uniq options " --another-option option-argument" +# +# will only append to $options if " --another-option option-argument " +# is not already present somewhere in $options already (note spaces at +# each end implied by leading space in second argument). +func_append_uniq () +{ + $debug_cmd + + eval _G_current_value='`$ECHO $'$1'`' + _G_delim=`expr "$2" : '\(.\)'` + + case $_G_delim$_G_current_value$_G_delim in + *"$2$_G_delim"*) ;; + *) func_append "$@" ;; + esac +} + + +# func_arith TERM... +# ------------------ +# Set func_arith_result to the result of evaluating TERMs. + test -z "$_G_HAVE_ARITH_OP" \ + && (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \ + && _G_HAVE_ARITH_OP=yes + +if test yes = "$_G_HAVE_ARITH_OP"; then + eval 'func_arith () + { + $debug_cmd + + func_arith_result=$(( $* )) + }' +else + func_arith () + { + $debug_cmd + + func_arith_result=`expr "$@"` + } +fi + + +# func_basename FILE +# ------------------ +# Set func_basename_result to FILE with everything up to and including +# the last / stripped. +if test yes = "$_G_HAVE_XSI_OPS"; then + # If this shell supports suffix pattern removal, then use it to avoid + # forking. Hide the definitions single quotes in case the shell chokes + # on unsupported syntax... + _b='func_basename_result=${1##*/}' + _d='case $1 in + */*) func_dirname_result=${1%/*}$2 ;; + * ) func_dirname_result=$3 ;; + esac' + +else + # ...otherwise fall back to using sed. + _b='func_basename_result=`$ECHO "$1" |$SED "$sed_basename"`' + _d='func_dirname_result=`$ECHO "$1" |$SED "$sed_dirname"` + if test "X$func_dirname_result" = "X$1"; then + func_dirname_result=$3 + else + func_append func_dirname_result "$2" + fi' +fi + +eval 'func_basename () +{ + $debug_cmd + + '"$_b"' +}' + + +# func_dirname FILE APPEND NONDIR_REPLACEMENT +# ------------------------------------------- +# Compute the dirname of FILE. If nonempty, add APPEND to the result, +# otherwise set result to NONDIR_REPLACEMENT. +eval 'func_dirname () +{ + $debug_cmd + + '"$_d"' +}' + + +# 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" +# For efficiency, we do not delegate to the functions above but instead +# duplicate the functionality here. +eval 'func_dirname_and_basename () +{ + $debug_cmd + + '"$_b"' + '"$_d"' +}' + + +# func_echo ARG... +# ---------------- +# Echo program name prefixed message. +func_echo () +{ + $debug_cmd + + _G_message=$* + + func_echo_IFS=$IFS + IFS=$nl + for _G_line in $_G_message; do + IFS=$func_echo_IFS + $ECHO "$progname: $_G_line" + done + IFS=$func_echo_IFS +} + + +# func_echo_all ARG... +# -------------------- +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "$*" +} + + +# func_echo_infix_1 INFIX ARG... +# ------------------------------ +# Echo program name, followed by INFIX on the first line, with any +# additional lines not showing INFIX. +func_echo_infix_1 () +{ + $debug_cmd + + $require_term_colors + + _G_infix=$1; shift + _G_indent=$_G_infix + _G_prefix="$progname: $_G_infix: " + _G_message=$* + + # Strip color escape sequences before counting printable length + for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$tc_blue" "$tc_cyan" + do + test -n "$_G_tc" && { + _G_esc_tc=`$ECHO "$_G_tc" | $SED "$sed_make_literal_regex"` + _G_indent=`$ECHO "$_G_indent" | $SED "s|$_G_esc_tc||g"` + } + done + _G_indent="$progname: "`echo "$_G_indent" | $SED 's|.| |g'`" " ## exclude from sc_prohibit_nested_quotes + + func_echo_infix_1_IFS=$IFS + IFS=$nl + for _G_line in $_G_message; do + IFS=$func_echo_infix_1_IFS + $ECHO "$_G_prefix$tc_bold$_G_line$tc_reset" >&2 + _G_prefix=$_G_indent + done + IFS=$func_echo_infix_1_IFS +} + + +# func_error ARG... +# ----------------- +# Echo program name prefixed message to standard error. +func_error () +{ + $debug_cmd + + $require_term_colors -# func_grep expression filename + func_echo_infix_1 " $tc_standout${tc_red}error$tc_reset" "$*" >&2 +} + + +# func_fatal_error ARG... +# ----------------------- +# Echo program name prefixed message to standard error, and exit. +func_fatal_error () +{ + $debug_cmd + + func_error "$*" + exit $EXIT_FAILURE +} + + +# func_grep EXPRESSION FILENAME +# ----------------------------- # Check whether EXPRESSION matches any line of FILENAME, without output. func_grep () { + $debug_cmd + $GREP "$1" "$2" >/dev/null 2>&1 } -# func_mkdir_p directory-path +# func_len STRING +# --------------- +# Set func_len_result to the length of STRING. STRING may not +# start with a hyphen. + test -z "$_G_HAVE_XSI_OPS" \ + && (eval 'x=a/b/c; + test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ + && _G_HAVE_XSI_OPS=yes + +if test yes = "$_G_HAVE_XSI_OPS"; then + eval 'func_len () + { + $debug_cmd + + func_len_result=${#1} + }' +else + func_len () + { + $debug_cmd + + func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` + } +fi + + +# 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= + $debug_cmd + + _G_directory_path=$1 + _G_dir_list= - if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then + if test -n "$_G_directory_path" && test : != "$opt_dry_run"; then - # Protect directory names starting with `-' - case $my_directory_path in - -*) my_directory_path="./$my_directory_path" ;; + # Protect directory names starting with '-' + case $_G_directory_path in + -*) _G_directory_path=./$_G_directory_path ;; esac # While some portion of DIR does not yet exist... - while test ! -d "$my_directory_path"; do + while test ! -d "$_G_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" + _G_dir_list=$_G_directory_path:$_G_dir_list # If the last portion added has no slash in it, the list is done - case $my_directory_path in */*) ;; *) break ;; esac + case $_G_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop - my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"` + _G_directory_path=`$ECHO "$_G_directory_path" | $SED -e "$sed_dirname"` done - my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'` + _G_dir_list=`$ECHO "$_G_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 + func_mkdir_p_IFS=$IFS; IFS=: + for _G_dir in $_G_dir_list; do + IFS=$func_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 || : + $MKDIR "$_G_dir" 2>/dev/null || : done - IFS="$save_mkdir_p_IFS" + IFS=$func_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'" + test -d "$_G_directory_path" || \ + func_fatal_error "Failed to create '$1'" fi } -# func_mktempdir [string] +# func_mktempdir [BASENAME] +# ------------------------- # 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. +# given, BASENAME is the basename for that directory. func_mktempdir () { - my_template="${TMPDIR-/tmp}/${1-$progname}" + $debug_cmd - if test "$opt_dry_run" = ":"; then + _G_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}-$$" + _G_tmpdir=$_G_template-$$ else # If mktemp works, use that first and foremost - my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` + _G_tmpdir=`mktemp -d "$_G_template-XXXXXXXX" 2>/dev/null` - if test ! -d "$my_tmpdir"; then + if test ! -d "$_G_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race - my_tmpdir="${my_template}-${RANDOM-0}$$" + _G_tmpdir=$_G_template-${RANDOM-0}$$ - save_mktempdir_umask=`umask` + func_mktempdir_umask=`umask` umask 0077 - $MKDIR "$my_tmpdir" - umask $save_mktempdir_umask + $MKDIR "$_G_tmpdir" + umask $func_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'" + test -d "$_G_tmpdir" || \ + func_fatal_error "cannot create temporary directory '$_G_tmpdir'" fi - $ECHO "$my_tmpdir" + $ECHO "$_G_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_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. +func_normal_abspath () +{ + $debug_cmd + + # These SED scripts presuppose an absolute path with a trailing slash. + _G_pathcar='s|^/\([^/]*\).*$|\1|' + _G_pathcdr='s|^/[^/]*||' + _G_removedotparts=':dotsl + s|/\./|/|g + t dotsl + s|/\.$|/|' + _G_collapseslashes='s|/\{1,\}|/|g' + _G_finalslash='s|/*$|/|' + + # 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 "$_G_removedotparts" -e "$_G_collapseslashes" -e "$_G_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 "$_G_pathcar"` + func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$_G_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_append 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_notquiet ARG... +# -------------------- +# Echo program name prefixed message only when not in quiet mode. +func_notquiet () +{ + $debug_cmd + + $opt_quiet || 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_relative_path SRCDIR DSTDIR +# -------------------------------- +# Set func_relative_path_result to the relative path from SRCDIR to DSTDIR. +func_relative_path () +{ + $debug_cmd + + 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 -z "$func_relative_path_tlibdir"; 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 -n "$func_stripname_result"; then + func_append func_relative_path_result "/$func_stripname_result" + fi + + # Normalisation. If bindir is libdir, return '.' else relative path. + if test -n "$func_relative_path_result"; then + func_stripname './' '' "$func_relative_path_result" + func_relative_path_result=$func_stripname_result + fi + + test -n "$func_relative_path_result" || func_relative_path_result=. + + : +} + + +# func_quote_for_eval ARG... +# -------------------------- +# Aesthetically quote ARGs to be evaled later. +# This function returns two values: +# i) func_quote_for_eval_result +# double-quoted, suitable for a subsequent eval +# ii) func_quote_for_eval_unquoted_result +# has all characters that are still active within double +# quotes backslashified. func_quote_for_eval () { + $debug_cmd + + func_quote_for_eval_unquoted_result= + func_quote_for_eval_result= + while test 0 -lt $#; do + case $1 in + *[\\\`\"\$]*) + _G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;; + *) + _G_unquoted_arg=$1 ;; + esac + if test -n "$func_quote_for_eval_unquoted_result"; then + func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg" + else + func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg" + fi + + case $_G_unquoted_arg in + # Double-quote args containing shell metacharacters to delay + # word splitting, command substitution and variable expansion + # for a subsequent eval. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + _G_quoted_arg=\"$_G_unquoted_arg\" + ;; + *) + _G_quoted_arg=$_G_unquoted_arg + ;; + esac + + if test -n "$func_quote_for_eval_result"; then + func_append func_quote_for_eval_result " $_G_quoted_arg" + else + func_append func_quote_for_eval_result "$_G_quoted_arg" + fi + shift + done +} + + +# 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 () +{ + $debug_cmd + case $1 in - *[\\\`\"\$]*) - func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;; + *[\\\`\"]*) + _G_arg=`$ECHO "$1" | $SED \ + -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;; *) - func_quote_for_eval_unquoted_result="$1" ;; + _G_arg=$1 ;; esac - case $func_quote_for_eval_unquoted_result in + case $_G_arg in # Double-quote args containing shell metacharacters to delay - # word splitting, command substitution and and variable - # expansion for a subsequent eval. + # 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. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" + _G_arg=\"$_G_arg\" ;; - *) - func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" esac + + func_quote_for_expand_result=$_G_arg } -# 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 () +# func_stripname PREFIX SUFFIX NAME +# --------------------------------- +# strip PREFIX and SUFFIX from NAME, and store in func_stripname_result. +# 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). +if test yes = "$_G_HAVE_XSI_OPS"; then + eval 'func_stripname () + { + $debug_cmd + + # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are + # positional parameters, so assign one to ordinary variable first. + func_stripname_result=$3 + func_stripname_result=${func_stripname_result#"$1"} + func_stripname_result=${func_stripname_result%"$2"} + }' +else + func_stripname () + { + $debug_cmd + + case $2 in + .*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%\\\\$2\$%%"`;; + *) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%$2\$%%"`;; + esac + } +fi + + +# func_show_eval CMD [FAIL_EXP] +# ----------------------------- +# Unless opt_quiet 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 () +{ + $debug_cmd + + _G_cmd=$1 + _G_fail_exp=${2-':'} + + func_quote_for_expand "$_G_cmd" + eval "func_notquiet $func_quote_for_expand_result" + + $opt_dry_run || { + eval "$_G_cmd" + _G_status=$? + if test 0 -ne "$_G_status"; then + eval "(exit $_G_status); $_G_fail_exp" + fi + } +} + + +# func_show_eval_locale CMD [FAIL_EXP] +# ------------------------------------ +# Unless opt_quiet 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 () { + $debug_cmd + + _G_cmd=$1 + _G_fail_exp=${2-':'} + + $opt_quiet || { + func_quote_for_expand "$_G_cmd" + eval "func_echo $func_quote_for_expand_result" + } + + $opt_dry_run || { + eval "$_G_user_locale + $_G_cmd" + _G_status=$? + eval "$_G_safe_locale" + if test 0 -ne "$_G_status"; then + eval "(exit $_G_status); $_G_fail_exp" + 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 () +{ + $debug_cmd + case $1 in - *[\\\`\"]*) - my_arg=`$ECHO "$1" | $SED \ - -e "$double_quote_subst" -e "$sed_double_backslash"` ;; - *) - my_arg="$1" ;; + [0-9]* | *[!a-zA-Z0-9_]*) + func_tr_sh_result=`$ECHO "$1" | $SED -e 's/^\([0-9]\)/_\1/' -e 's/[^a-zA-Z0-9_]/_/g'` + ;; + * ) + func_tr_sh_result=$1 + ;; esac +} + + +# func_verbose ARG... +# ------------------- +# Echo program name prefixed message in verbose mode only. +func_verbose () +{ + $debug_cmd + + $opt_verbose && func_echo "$*" + + : +} + + +# func_warn_and_continue ARG... +# ----------------------------- +# Echo program name prefixed warning message to standard error. +func_warn_and_continue () +{ + $debug_cmd + + $require_term_colors + + func_echo_infix_1 "${tc_red}warning$tc_reset" "$*" >&2 +} + + +# func_warning CATEGORY ARG... +# ---------------------------- +# Echo program name prefixed warning message to standard error. Warning +# messages can be filtered according to CATEGORY, where this function +# elides messages where CATEGORY is not listed in the global variable +# 'opt_warning_types'. +func_warning () +{ + $debug_cmd + + # CATEGORY must be in the warning_categories list! + case " $warning_categories " in + *" $1 "*) ;; + *) func_internal_error "invalid warning category '$1'" ;; + esac + + _G_category=$1 + shift + + case " $opt_warning_types " in + *" $_G_category "*) $warning_func ${1+"$@"} ;; + esac +} + + +# func_sort_ver VER1 VER2 +# ----------------------- +# 'sort -V' is not generally available. +# Note this deviates from the version comparison in automake +# in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a +# but this should suffice as we won't be specifying old +# version formats or redundant trailing .0 in bootstrap.conf. +# If we did want full compatibility then we should probably +# use m4_version_compare from autoconf. +func_sort_ver () +{ + $debug_cmd + + printf '%s\n%s\n' "$1" "$2" \ + | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n -k 5,5n -k 6,6n -k 7,7n -k 8,8n -k 9,9n +} + +# func_lt_ver PREV CURR +# --------------------- +# Return true if PREV and CURR are in the correct order according to +# func_sort_ver, otherwise false. Use it like this: +# +# func_lt_ver "$prev_ver" "$proposed_ver" || func_fatal_error "..." +func_lt_ver () +{ + $debug_cmd + + test "x$1" = x`func_sort_ver "$1" "$2" | $SED 1q` +} + + +# Local variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'before-save-hook 'time-stamp) +# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" +# time-stamp-time-zone: "UTC" +# End: +#! /bin/sh + +# Set a version string for this script. +scriptversion=2014-01-07.03; # UTC + +# A portable, pluggable option parser for Bourne shell. +# Written by Gary V. Vaughan, 2010 + +# Copyright (C) 2010-2015 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. + +# 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 . + +# Please report bugs or propose patches to gary@gnu.org. + + +## ------ ## +## Usage. ## +## ------ ## + +# This file is a library for parsing options in your shell scripts along +# with assorted other useful supporting features that you can make use +# of too. +# +# For the simplest scripts you might need only: +# +# #!/bin/sh +# . relative/path/to/funclib.sh +# . relative/path/to/options-parser +# scriptversion=1.0 +# func_options ${1+"$@"} +# eval set dummy "$func_options_result"; shift +# ...rest of your script... +# +# In order for the '--version' option to work, you will need to have a +# suitably formatted comment like the one at the top of this file +# starting with '# Written by ' and ending with '# warranty; '. +# +# For '-h' and '--help' to work, you will also need a one line +# description of your script's purpose in a comment directly above the +# '# Written by ' line, like the one at the top of this file. +# +# The default options also support '--debug', which will turn on shell +# execution tracing (see the comment above debug_cmd below for another +# use), and '--verbose' and the func_verbose function to allow your script +# to display verbose messages only when your user has specified +# '--verbose'. +# +# After sourcing this file, you can plug processing for additional +# options by amending the variables from the 'Configuration' section +# below, and following the instructions in the 'Option parsing' +# section further down. + +## -------------- ## +## Configuration. ## +## -------------- ## + +# You should override these variables in your script after sourcing this +# file so that they reflect the customisations you have added to the +# option parser. + +# The usage line for option parsing errors and the start of '-h' and +# '--help' output messages. You can embed shell variables for delayed +# expansion at the time the message is displayed, but you will need to +# quote other shell meta-characters carefully to prevent them being +# expanded when the contents are evaled. +usage='$progpath [OPTION]...' + +# Short help message in response to '-h' and '--help'. Add to this or +# override it after sourcing this library to reflect the full set of +# options your script accepts. +usage_message="\ + --debug enable verbose shell tracing + -W, --warnings=CATEGORY + report the warnings falling in CATEGORY [all] + -v, --verbose verbosely report processing + --version print version information and exit + -h, --help print short or long help message and exit +" + +# Additional text appended to 'usage_message' in response to '--help'. +long_help_message=" +Warning categories include: + 'all' show all warnings + 'none' turn off all the warnings + 'error' warnings are treated as fatal errors" + +# Help message printed before fatal option parsing errors. +fatal_help="Try '\$progname --help' for more information." + + + +## ------------------------- ## +## Hook function management. ## +## ------------------------- ## + +# This section contains functions for adding, removing, and running hooks +# to the main code. A hook is just a named list of of function, that can +# be run in order later on. + +# func_hookable FUNC_NAME +# ----------------------- +# Declare that FUNC_NAME will run hooks added with +# 'func_add_hook FUNC_NAME ...'. +func_hookable () +{ + $debug_cmd + + func_append hookable_fns " $1" +} + + +# func_add_hook FUNC_NAME HOOK_FUNC +# --------------------------------- +# Request that FUNC_NAME call HOOK_FUNC before it returns. FUNC_NAME must +# first have been declared "hookable" by a call to 'func_hookable'. +func_add_hook () +{ + $debug_cmd + + case " $hookable_fns " in + *" $1 "*) ;; + *) func_fatal_error "'$1' does not accept hook functions." ;; + esac + + eval func_append ${1}_hooks '" $2"' +} + + +# func_remove_hook FUNC_NAME HOOK_FUNC +# ------------------------------------ +# Remove HOOK_FUNC from the list of functions called by FUNC_NAME. +func_remove_hook () +{ + $debug_cmd + + eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`' +} + + +# func_run_hooks FUNC_NAME [ARG]... +# --------------------------------- +# Run all hook functions registered to FUNC_NAME. +# It is assumed that the list of hook functions contains nothing more +# than a whitespace-delimited list of legal shell function names, and +# no effort is wasted trying to catch shell meta-characters or preserve +# whitespace. +func_run_hooks () +{ + $debug_cmd + + case " $hookable_fns " in + *" $1 "*) ;; + *) func_fatal_error "'$1' does not support hook funcions.n" ;; + esac + + eval _G_hook_fns=\$$1_hooks; shift + + for _G_hook in $_G_hook_fns; do + eval $_G_hook '"$@"' + + # store returned options list back into positional + # parameters for next 'cmd' execution. + eval _G_hook_result=\$${_G_hook}_result + eval set dummy "$_G_hook_result"; shift + done + + func_quote_for_eval ${1+"$@"} + func_run_hooks_result=$func_quote_for_eval_result +} + + + +## --------------- ## +## Option parsing. ## +## --------------- ## + +# In order to add your own option parsing hooks, you must accept the +# full positional parameter list in your hook function, remove any +# options that you action, and then pass back the remaining unprocessed +# options in '_result', escaped suitably for +# 'eval'. Like this: +# +# my_options_prep () +# { +# $debug_cmd +# +# # Extend the existing usage message. +# usage_message=$usage_message' +# -s, --silent don'\''t print informational messages +# ' +# +# func_quote_for_eval ${1+"$@"} +# my_options_prep_result=$func_quote_for_eval_result +# } +# func_add_hook func_options_prep my_options_prep +# +# +# my_silent_option () +# { +# $debug_cmd +# +# # Note that for efficiency, we parse as many options as we can +# # recognise in a loop before passing the remainder back to the +# # caller on the first unrecognised argument we encounter. +# while test $# -gt 0; do +# opt=$1; shift +# case $opt in +# --silent|-s) opt_silent=: ;; +# # Separate non-argument short options: +# -s*) func_split_short_opt "$_G_opt" +# set dummy "$func_split_short_opt_name" \ +# "-$func_split_short_opt_arg" ${1+"$@"} +# shift +# ;; +# *) set dummy "$_G_opt" "$*"; shift; break ;; +# esac +# done +# +# func_quote_for_eval ${1+"$@"} +# my_silent_option_result=$func_quote_for_eval_result +# } +# func_add_hook func_parse_options my_silent_option +# +# +# my_option_validation () +# { +# $debug_cmd +# +# $opt_silent && $opt_verbose && func_fatal_help "\ +# '--silent' and '--verbose' options are mutually exclusive." +# +# func_quote_for_eval ${1+"$@"} +# my_option_validation_result=$func_quote_for_eval_result +# } +# func_add_hook func_validate_options my_option_validation +# +# You'll alse need to manually amend $usage_message to reflect the extra +# options you parse. It's preferable to append if you can, so that +# multiple option parsing hooks can be added safely. + - 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_options [ARG]... +# --------------------- +# All the functions called inside func_options are hookable. See the +# individual implementations for details. +func_hookable func_options +func_options () +{ + $debug_cmd - func_quote_for_expand_result="$my_arg" + func_options_prep ${1+"$@"} + eval func_parse_options \ + ${func_options_prep_result+"$func_options_prep_result"} + eval func_validate_options \ + ${func_parse_options_result+"$func_parse_options_result"} + + eval func_run_hooks func_options \ + ${func_validate_options_result+"$func_validate_options_result"} + + # save modified positional parameters for caller + func_options_result=$func_run_hooks_result } -# 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 () +# func_options_prep [ARG]... +# -------------------------- +# All initialisations required before starting the option parse loop. +# Note that when calling hook functions, we pass through the list of +# positional parameters. If a hook function modifies that list, and +# needs to propogate that back to rest of this script, then the complete +# modified list must be put in 'func_run_hooks_result' before +# returning. +func_hookable func_options_prep +func_options_prep () { - my_cmd="$1" - my_fail_exp="${2-:}" + $debug_cmd - ${opt_silent-false} || { - func_quote_for_expand "$my_cmd" - eval "func_echo $func_quote_for_expand_result" - } + # Option defaults: + opt_verbose=false + opt_warning_types= - 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_run_hooks func_options_prep ${1+"$@"} + + # save modified positional parameters for caller + func_options_prep_result=$func_run_hooks_result } -# 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 () +# func_parse_options [ARG]... +# --------------------------- +# The main option parsing loop. +func_hookable func_parse_options +func_parse_options () { - my_cmd="$1" - my_fail_exp="${2-:}" + $debug_cmd - ${opt_silent-false} || { - func_quote_for_expand "$my_cmd" - eval "func_echo $func_quote_for_expand_result" - } + func_parse_options_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 -} + # this just eases exit handling + while test $# -gt 0; do + # Defer to hook functions for initial option parsing, so they + # get priority in the event of reusing an option name. + func_run_hooks func_parse_options ${1+"$@"} -# 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 + # Adjust func_parse_options positional parameters to match + eval set dummy "$func_run_hooks_result"; shift + + # Break out of the loop if we already parsed every option. + test $# -gt 0 || break + + _G_opt=$1 + shift + case $_G_opt in + --debug|-x) debug_cmd='set -x' + func_echo "enabling shell trace mode" + $debug_cmd + ;; + + --no-warnings|--no-warning|--no-warn) + set dummy --warnings none ${1+"$@"} + shift + ;; + + --warnings|--warning|-W) + test $# = 0 && func_missing_arg $_G_opt && break + case " $warning_categories $1" in + *" $1 "*) + # trailing space prevents matching last $1 above + func_append_uniq opt_warning_types " $1" + ;; + *all) + opt_warning_types=$warning_categories + ;; + *none) + opt_warning_types=none + warning_func=: + ;; + *error) + opt_warning_types=$warning_categories + warning_func=func_fatal_error + ;; + *) + func_fatal_error \ + "unsupported warning category: '$1'" + ;; + esac + shift + ;; + + --verbose|-v) opt_verbose=: ;; + --version) func_version ;; + -\?|-h) func_usage ;; + --help) func_help ;; + + # Separate optargs to long options (plugins may need this): + --*=*) func_split_equals "$_G_opt" + set dummy "$func_split_equals_lhs" \ + "$func_split_equals_rhs" ${1+"$@"} + shift + ;; + + # Separate optargs to short options: + -W*) + func_split_short_opt "$_G_opt" + set dummy "$func_split_short_opt_name" \ + "$func_split_short_opt_arg" ${1+"$@"} + shift + ;; + + # Separate non-argument short options: + -\?*|-h*|-v*|-x*) + func_split_short_opt "$_G_opt" + set dummy "$func_split_short_opt_name" \ + "-$func_split_short_opt_arg" ${1+"$@"} + shift + ;; + + --) break ;; + -*) func_fatal_help "unrecognised option: '$_G_opt'" ;; + *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; + esac + done + + # save modified positional parameters for caller + func_quote_for_eval ${1+"$@"} + func_parse_options_result=$func_quote_for_eval_result } -# func_version -# Echo version message to standard output and exit. -func_version () +# func_validate_options [ARG]... +# ------------------------------ +# Perform any sanity checks on option settings and/or unconsumed +# arguments. +func_hookable func_validate_options +func_validate_options () { - $opt_debug + $debug_cmd - $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 $? + # Display all warnings if -W was not given. + test -n "$opt_warning_types" || opt_warning_types=" $warning_categories" + + func_run_hooks func_validate_options ${1+"$@"} + + # Bail if the options were screwed! + $exit_cmd $EXIT_FAILURE + + # save modified positional parameters for caller + func_validate_options_result=$func_run_hooks_result } -# func_usage -# Echo short help message to standard output and exit. -func_usage () + + +## ----------------- ## +## Helper functions. ## +## ----------------- ## + +# This section contains the helper functions used by the rest of the +# hookable option parser framework in ascii-betical order. + + +# func_fatal_help ARG... +# ---------------------- +# Echo program name prefixed message to standard error, followed by +# a help hint, and exit. +func_fatal_help () { - $opt_debug + $debug_cmd - $SED -n '/^# Usage:/,/^# *.*--help/ { - s/^# // - s/^# *$// - s/\$progname/'$progname'/ - p - }' < "$progpath" - echo - $ECHO "run \`$progname --help | more' for full usage" - exit $? + eval \$ECHO \""Usage: $usage"\" + eval \$ECHO \""$fatal_help"\" + func_error ${1+"$@"} + exit $EXIT_FAILURE } -# func_help [NOEXIT] -# Echo long help message to standard output and exit, -# unless 'noexit' is passed as argument. + +# func_help +# --------- +# Echo long help message to standard output and exit. func_help () { - $opt_debug + $debug_cmd - $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_usage_message + $ECHO "$long_help_message" + exit 0 } -# func_missing_arg argname + +# func_missing_arg ARGNAME +# ------------------------ # Echo program name prefixed message to standard error and set global # exit_cmd. func_missing_arg () { - $opt_debug + $debug_cmd - func_error "missing argument for $1." + func_error "Missing argument for '$1'." exit_cmd=exit } -# func_split_short_opt shortopt +# func_split_equals STRING +# ------------------------ +# Set func_split_equals_lhs and func_split_equals_rhs shell variables after +# splitting STRING at the '=' sign. +test -z "$_G_HAVE_XSI_OPS" \ + && (eval 'x=a/b/c; + test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ + && _G_HAVE_XSI_OPS=yes + +if test yes = "$_G_HAVE_XSI_OPS" +then + # This is an XSI compatible shell, allowing a faster implementation... + eval 'func_split_equals () + { + $debug_cmd + + func_split_equals_lhs=${1%%=*} + func_split_equals_rhs=${1#*=} + test "x$func_split_equals_lhs" = "x$1" \ + && func_split_equals_rhs= + }' +else + # ...otherwise fall back to using expr, which is often a shell builtin. + func_split_equals () + { + $debug_cmd + + func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'` + func_split_equals_rhs= + test "x$func_split_equals_lhs" = "x$1" \ + || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'` + } +fi #func_split_equals + + +# 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 () +if test yes = "$_G_HAVE_XSI_OPS" +then + # This is an XSI compatible shell, allowing a faster implementation... + eval 'func_split_short_opt () + { + $debug_cmd + + func_split_short_opt_arg=${1#??} + func_split_short_opt_name=${1%"$func_split_short_opt_arg"} + }' +else + # ...otherwise fall back to using expr, which is often a shell builtin. + func_split_short_opt () + { + $debug_cmd + + func_split_short_opt_name=`expr "x$1" : 'x-\(.\)'` + func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'` + } +fi #func_split_short_opt + + +# func_usage +# ---------- +# Echo short help message to standard output and exit. +func_usage () { - my_sed_short_opt='1s/^\(..\).*$/\1/;q' - my_sed_short_rest='1s/^..\(.*\)$/\1/;q' + $debug_cmd - 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_usage_message + $ECHO "Run '$progname --help |${PAGER-more}' for full usage" + exit 0 +} -# 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 () +# func_usage_message +# ------------------ +# Echo short help message to standard output. +func_usage_message () { - my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q' - my_sed_long_arg='1s/^--[^=]*=//' + $debug_cmd - 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 + eval \$ECHO \""Usage: $usage"\" + echo + $SED -n 's|^# || + /^Written by/{ + x;p;x + } + h + /^Written by/q' < "$progpath" + echo + eval \$ECHO \""$usage_message"\" +} -exit_cmd=: +# func_version +# ------------ +# Echo version message to standard output and exit. +func_version () +{ + $debug_cmd + printf '%s\n' "$progname $scriptversion" + $SED -n ' + /(C)/!b go + :more + /\./!{ + N + s|\n# | | + b more + } + :go + /^# Written by /,/# warranty; / { + s|^# || + s|^# *$|| + s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2| + p + } + /^# Written by / { + s|^# || + p + } + /^warranty; /q' < "$progpath" + exit $? +} -magic="%%%MAGIC variable%%%" -magic_exe="%%%MAGIC EXE variable%%%" +# Local variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'before-save-hook 'time-stamp) +# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" +# time-stamp-time-zone: "UTC" +# End: -# Global variables. -nonopt= -preserve_args= -lo2o="s/\\.lo\$/.${objext}/" -o2lo="s/\\.${objext}\$/.lo/" -extracted_archives= -extracted_serial=0 +# Set a version string. +scriptversion='(GNU libtool) 2.4.6' -# 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 () +# func_echo ARG... +# ---------------- +# Libtool also displays the current mode in messages, so override +# funclib.sh func_echo with this custom definition. +func_echo () { - eval "${1}=\$${1}\${2}" -} # func_append may be replaced by extended shell implementation + $debug_cmd -# 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 + _G_message=$* + + func_echo_IFS=$IFS + IFS=$nl + for _G_line in $_G_message; do + IFS=$func_echo_IFS + $ECHO "$progname${opt_mode+: $opt_mode}: $_G_line" + done + IFS=$func_echo_IFS +} -# func_arith arithmetic-term... -func_arith () +# func_warning ARG... +# ------------------- +# Libtool warnings are not categorized, so override funclib.sh +# func_warning with this simpler definition. +func_warning () { - func_arith_result=`expr "${@}"` -} # func_arith may be replaced by extended shell implementation + $debug_cmd + $warning_func ${1+"$@"} +} -# 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 +## ---------------- ## +## Options parsing. ## +## ---------------- ## + +# Hook in the functions to make sure our own options are parsed during +# the option parsing loop. + +usage='$progpath [OPTION]... [MODE-ARG]...' + +# Short help message in response to '-h'. +usage_message="Options: + --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 + --no-warnings equivalent to '-Wnone' + --preserve-dup-deps don't remove duplicate dependency libraries + --quiet, --silent don't print informational messages + --tag=TAG use configuration variables from tag TAG + -v, --verbose print more informational messages than default + --version print version information + -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all] + -h, --help, --help-all print short, long, or detailed help message +" -# func_lo2o object -func_lo2o () +# Additional text appended to 'usage_message' in response to '--help'. +func_help () { - func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` -} # func_lo2o may be replaced by extended shell implementation + $debug_cmd + func_usage_message + $ECHO "$long_help_message -# func_xform libobj-or-source -func_xform () -{ - func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` -} # func_xform may be replaced by extended shell implementation +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) + version: $progname (GNU libtool) 2.4.6 + automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q` + autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q` + +Report bugs to . +GNU libtool home page: . +General help using GNU software: ." + exit 0 +} -# func_fatal_configuration arg... +# func_lo2o OBJECT-NAME +# --------------------- +# Transform OBJECT-NAME from a '.lo' suffix to the platform specific +# object suffix. + +lo2o=s/\\.lo\$/.$objext/ +o2lo=s/\\.$objext\$/.lo/ + +if test yes = "$_G_HAVE_XSI_OPS"; then + eval 'func_lo2o () + { + case $1 in + *.lo) func_lo2o_result=${1%.lo}.$objext ;; + * ) func_lo2o_result=$1 ;; + esac + }' + + # func_xform LIBOBJ-OR-SOURCE + # --------------------------- + # Transform LIBOBJ-OR-SOURCE from a '.o' or '.c' (or otherwise) + # suffix to a '.lo' libtool-object suffix. + eval 'func_xform () + { + func_xform_result=${1%.*}.lo + }' +else + # ...otherwise fall back to using sed. + func_lo2o () + { + func_lo2o_result=`$ECHO "$1" | $SED "$lo2o"` + } + + func_xform () + { + func_xform_result=`$ECHO "$1" | $SED 's|\.[^.]*$|.lo|'` + } +fi + + +# 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__fatal_error ${1+"$@"} \ + "See the $PACKAGE documentation for more information." \ + "Fatal configuration error." } # func_config +# ----------- # Display the configuration for all the tags in this script. func_config () { @@ -915,17 +2149,19 @@ exit $? } + # func_features +# ------------- # Display the features supported by this script. func_features () { echo "host: $host" - if test "$build_libtool_libs" = yes; then + if test yes = "$build_libtool_libs"; then echo "enable shared libraries" else echo "disable shared libraries" fi - if test "$build_old_libs" = yes; then + if test yes = "$build_old_libs"; then echo "enable static libraries" else echo "disable static libraries" @@ -934,314 +2170,350 @@ exit $? } -# func_enable_tag tagname + +# 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" + # 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 + 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) ;; + # 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" + 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 + # 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 + 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 + 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 + 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 + fi - exit $EXIT_MISMATCH - 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 +# libtool_options_prep [ARG]... +# ----------------------------- +# Preparation for options parsed by libtool. +libtool_options_prep () +{ + $debug_mode + # Option defaults: + opt_config=false + opt_dlopen= + opt_dry_run=false + opt_help=false + opt_mode= + opt_preserve_dup_deps=false + opt_quiet=false + nonopt= + preserve_args= -# 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 + # 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 + # Pass back the list of options. + func_quote_for_eval ${1+"$@"} + libtool_options_prep_result=$func_quote_for_eval_result +} +func_add_hook func_options_prep libtool_options_prep -# 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: +# libtool_parse_options [ARG]... +# --------------------------------- +# Provide handling for libtool specific options. +libtool_parse_options () +{ + $debug_cmd - # save first non-option argument - if test "$#" -gt 0; then - nonopt="$opt" - shift - fi + # Perform our own loop to consume as many options as possible in + # each iteration. + while test $# -gt 0; do + _G_opt=$1 + shift + case $_G_opt in + --dry-run|--dryrun|-n) + opt_dry_run=: + ;; + + --config) func_config ;; + + --dlopen|-dlopen) + opt_dlopen="${opt_dlopen+$opt_dlopen +}$1" + shift + ;; + + --preserve-dup-deps) + opt_preserve_dup_deps=: ;; + + --features) func_features ;; + + --finish) set dummy --mode finish ${1+"$@"}; shift ;; + + --help) opt_help=: ;; + + --help-all) opt_help=': help-all' ;; + + --mode) test $# = 0 && func_missing_arg $_G_opt && break + opt_mode=$1 + case $1 in + # Valid mode arguments: + clean|compile|execute|finish|install|link|relink|uninstall) ;; + + # Catch anything else as an error + *) func_error "invalid argument for $_G_opt" + exit_cmd=exit + break + ;; + esac + shift + ;; + + --no-silent|--no-quiet) + opt_quiet=false + func_append preserve_args " $_G_opt" + ;; + + --no-warnings|--no-warning|--no-warn) + opt_warning=false + func_append preserve_args " $_G_opt" + ;; + + --no-verbose) + opt_verbose=false + func_append preserve_args " $_G_opt" + ;; + + --silent|--quiet) + opt_quiet=: + opt_verbose=false + func_append preserve_args " $_G_opt" + ;; + + --tag) test $# = 0 && func_missing_arg $_G_opt && break + opt_tag=$1 + func_append preserve_args " $_G_opt $1" + func_enable_tag "$1" + shift + ;; + + --verbose|-v) opt_quiet=false + opt_verbose=: + func_append preserve_args " $_G_opt" + ;; - # preserve --debug - test "$opt_debug" = : || func_append preserve_args " --debug" + # An option not handled by this hook function: + *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; + esac + done - 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 + # save modified positional parameters for caller + func_quote_for_eval ${1+"$@"} + libtool_parse_options_result=$func_quote_for_eval_result +} +func_add_hook func_parse_options libtool_parse_options - 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 +# libtool_validate_options [ARG]... +# --------------------------------- +# Perform any sanity checks on option settings and/or unconsumed +# arguments. +libtool_validate_options () +{ + # save first non-option argument + if test 0 -lt $#; then + nonopt=$1 + shift fi - # Change the help message to a mode-specific one. - generic_help="$help" - help="Try \`$progname --help --mode=$opt_mode' for more information." - } + # preserve --debug + test : = "$debug_cmd" || func_append preserve_args " --debug" + + case $host in + # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452 + # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788 + *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*) + # 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 + + test yes != "$build_libtool_libs" \ + && test yes != "$build_old_libs" \ + && func_fatal_configuration "not configured to build any kind of library" + + # Darwin sucks + eval std_shrext=\"$shrext_cmds\" + + # Only execute mode is allowed to have -dlopen flags. + if test -n "$opt_dlopen" && test execute != "$opt_mode"; 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 + # Pass back the unparsed argument list + func_quote_for_eval ${1+"$@"} + libtool_validate_options_result=$func_quote_for_eval_result } +func_add_hook func_validate_options libtool_validate_options +# Process options as early as possible so that --help and --version +# can return quickly. +func_options ${1+"$@"} +eval set dummy "$func_options_result"; shift + ## ----------- ## ## Main. ## ## ----------- ## +magic='%%%MAGIC variable%%%' +magic_exe='%%%MAGIC EXE variable%%%' + +# Global variables. +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= + + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +$1 +_LTECHO_EOF' +} + +# func_generated_by_libtool +# True iff stdin has been generated by Libtool. This function is only +# a basic sanity check; it will hardly flush out determined imposters. +func_generated_by_libtool_p () +{ + $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 +} + # func_lalib_p file -# True iff FILE is a libtool `.la' library or `.lo' object 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 + $SED -e 4q "$1" 2>/dev/null | func_generated_by_libtool_p } # func_lalib_unsafe_p file -# True iff FILE is a libtool `.la' library or `.lo' object 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. +# fatal anyway. Works if 'file' does not exist. func_lalib_unsafe_p () { lalib_p=no @@ -1249,13 +2521,13 @@ for lalib_p_l in 1 2 3 4 do read lalib_p_line - case "$lalib_p_line" in + case $lalib_p_line in \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; esac done exec 0<&5 5<&- fi - test "$lalib_p" = yes + test yes = "$lalib_p" } # func_ltwrapper_script_p file @@ -1264,7 +2536,8 @@ # determined imposters. func_ltwrapper_script_p () { - func_lalib_p "$1" + test -f "$1" && + $lt_truncate_bin < "$1" 2>/dev/null | func_generated_by_libtool_p } # func_ltwrapper_executable_p file @@ -1289,7 +2562,7 @@ { 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_scriptname_result=$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper } # func_ltwrapper_p file @@ -1308,11 +2581,13 @@ # FAIL_CMD may read-access the current command in variable CMD! func_execute_cmds () { - $opt_debug + $debug_cmd + save_ifs=$IFS; IFS='~' for cmd in $1; do - IFS=$save_ifs + IFS=$sp$nl eval cmd=\"$cmd\" + IFS=$save_ifs func_show_eval "$cmd" "${2-:}" done IFS=$save_ifs @@ -1324,10 +2599,11 @@ # 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. +# 'FILE.' does not work on cygwin managed mounts. func_source () { - $opt_debug + $debug_cmd + case $1 in */* | *\\*) . "$1" ;; *) . "./$1" ;; @@ -1354,10 +2630,10 @@ # store the result into func_replace_sysroot_result. func_replace_sysroot () { - case "$lt_sysroot:$1" in + case $lt_sysroot:$1 in ?*:"$lt_sysroot"*) func_stripname "$lt_sysroot" '' "$1" - func_replace_sysroot_result="=$func_stripname_result" + func_replace_sysroot_result='='$func_stripname_result ;; *) # Including no sysroot. @@ -1374,7 +2650,8 @@ # arg is usually of the form 'gcc ...' func_infer_tag () { - $opt_debug + $debug_cmd + if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do @@ -1393,7 +2670,7 @@ 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`" + 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. @@ -1418,7 +2695,7 @@ # 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'" + func_fatal_error "specify a tag with '--tag'" # else # func_verbose "using $tagname tagged configuration" fi @@ -1434,15 +2711,15 @@ # 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}\' + write_libobj=$1 + if test yes = "$build_libtool_libs"; then + write_lobj=\'$2\' else write_lobj=none fi - if test "$build_old_libs" = yes; then - write_oldobj=\'${3}\' + if test yes = "$build_old_libs"; then + write_oldobj=\'$3\' else write_oldobj=none fi @@ -1450,7 +2727,7 @@ $opt_dry_run || { cat >${write_libobj}T </dev/null` - if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then + 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"` + $SED -e "$sed_naive_backslashify"` else func_convert_core_file_wine_to_w32_result= fi @@ -1514,18 +2792,19 @@ # are convertible, then the result may be empty. func_convert_core_path_wine_to_w32 () { - $opt_debug + $debug_cmd + # unfortunately, winepath doesn't convert paths, only file names - func_convert_core_path_wine_to_w32_result="" + 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 -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" + 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 @@ -1554,7 +2833,8 @@ # environment variable; do not put it in $PATH. func_cygpath () { - $opt_debug + $debug_cmd + if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` if test "$?" -ne 0; then @@ -1563,7 +2843,7 @@ fi else func_cygpath_result= - func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'" + func_error "LT_CYGPATH is empty or specifies non-existent file: '$LT_CYGPATH'" fi } #end: func_cygpath @@ -1574,10 +2854,11 @@ # result in func_convert_core_msys_to_w32_result. func_convert_core_msys_to_w32 () { - $opt_debug + $debug_cmd + # 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"` + $SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"` } #end: func_convert_core_msys_to_w32 @@ -1588,13 +2869,14 @@ # func_to_host_file_result to ARG1). func_convert_file_check () { - $opt_debug - if test -z "$2" && test -n "$1" ; then + $debug_cmd + + if test -z "$2" && test -n "$1"; then func_error "Could not determine host file name corresponding to" - func_error " \`$1'" + func_error " '$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback: - func_to_host_file_result="$1" + func_to_host_file_result=$1 fi } # end func_convert_file_check @@ -1606,10 +2888,11 @@ # func_to_host_file_result to a simplistic fallback value (see below). func_convert_path_check () { - $opt_debug + $debug_cmd + if test -z "$4" && test -n "$3"; then func_error "Could not determine the host path corresponding to" - func_error " \`$3'" + 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. @@ -1618,7 +2901,7 @@ func_to_host_path_result=`echo "$3" | $SED -e "$lt_replace_pathsep_chars"` else - func_to_host_path_result="$3" + func_to_host_path_result=$3 fi fi } @@ -1630,9 +2913,10 @@ # and appending REPL if ORIG matches BACKPAT. func_convert_path_front_back_pathsep () { - $opt_debug + $debug_cmd + case $4 in - $1 ) func_to_host_path_result="$3$func_to_host_path_result" + $1 ) func_to_host_path_result=$3$func_to_host_path_result ;; esac case $4 in @@ -1646,7 +2930,7 @@ ################################################## # $build to $host FILE NAME CONVERSION FUNCTIONS # ################################################## -# invoked via `$to_host_file_cmd ARG' +# 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. @@ -1657,7 +2941,8 @@ # in func_to_host_file_result. func_to_host_file () { - $opt_debug + $debug_cmd + $to_host_file_cmd "$1" } # end func_to_host_file @@ -1669,7 +2954,8 @@ # in (the comma separated) LAZY, no conversion takes place. func_to_tool_file () { - $opt_debug + $debug_cmd + case ,$2, in *,"$to_tool_file_cmd",*) func_to_tool_file_result=$1 @@ -1687,7 +2973,7 @@ # Copy ARG to func_to_host_file_result. func_convert_file_noop () { - func_to_host_file_result="$1" + func_to_host_file_result=$1 } # end func_convert_file_noop @@ -1698,11 +2984,12 @@ # func_to_host_file_result. func_convert_file_msys_to_w32 () { - $opt_debug - func_to_host_file_result="$1" + $debug_cmd + + 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" + func_to_host_file_result=$func_convert_core_msys_to_w32_result fi func_convert_file_check "$1" "$func_to_host_file_result" } @@ -1714,8 +3001,9 @@ # func_to_host_file_result. func_convert_file_cygwin_to_w32 () { - $opt_debug - func_to_host_file_result="$1" + $debug_cmd + + 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. @@ -1731,11 +3019,12 @@ # 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" + $debug_cmd + + 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" + func_to_host_file_result=$func_convert_core_file_wine_to_w32_result fi func_convert_file_check "$1" "$func_to_host_file_result" } @@ -1747,12 +3036,13 @@ # Returns result in func_to_host_file_result. func_convert_file_msys_to_cygwin () { - $opt_debug - func_to_host_file_result="$1" + $debug_cmd + + 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" + func_to_host_file_result=$func_cygpath_result fi func_convert_file_check "$1" "$func_to_host_file_result" } @@ -1765,13 +3055,14 @@ # in func_to_host_file_result. func_convert_file_nix_to_cygwin () { - $opt_debug - func_to_host_file_result="$1" + $debug_cmd + + 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" + func_to_host_file_result=$func_cygpath_result fi func_convert_file_check "$1" "$func_to_host_file_result" } @@ -1781,7 +3072,7 @@ ############################################# # $build to $host PATH CONVERSION FUNCTIONS # ############################################# -# invoked via `$to_host_path_cmd ARG' +# 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. @@ -1805,10 +3096,11 @@ to_host_path_cmd= func_init_to_host_path_cmd () { - $opt_debug + $debug_cmd + 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}" + to_host_path_cmd=func_convert_path_$func_stripname_result fi } @@ -1818,7 +3110,8 @@ # in func_to_host_path_result. func_to_host_path () { - $opt_debug + $debug_cmd + func_init_to_host_path_cmd $to_host_path_cmd "$1" } @@ -1829,7 +3122,7 @@ # Copy ARG to func_to_host_path_result. func_convert_path_noop () { - func_to_host_path_result="$1" + func_to_host_path_result=$1 } # end func_convert_path_noop @@ -1840,8 +3133,9 @@ # func_to_host_path_result. func_convert_path_msys_to_w32 () { - $opt_debug - func_to_host_path_result="$1" + $debug_cmd + + 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 ';.'; @@ -1849,7 +3143,7 @@ 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_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" @@ -1863,8 +3157,9 @@ # func_to_host_file_result. func_convert_path_cygwin_to_w32 () { - $opt_debug - func_to_host_path_result="$1" + $debug_cmd + + func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" @@ -1883,14 +3178,15 @@ # 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" + $debug_cmd + + 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_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" @@ -1904,15 +3200,16 @@ # Returns result in func_to_host_file_result. func_convert_path_msys_to_cygwin () { - $opt_debug - func_to_host_path_result="$1" + $debug_cmd + + 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_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" @@ -1927,8 +3224,9 @@ # func_to_host_file_result. func_convert_path_nix_to_cygwin () { - $opt_debug - func_to_host_path_result="$1" + $debug_cmd + + 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 @@ -1937,7 +3235,7 @@ 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_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" @@ -1946,13 +3244,31 @@ # end func_convert_path_nix_to_cygwin +# func_dll_def_p FILE +# True iff FILE is a Windows DLL '.def' file. +# Keep in sync with _LT_DLL_DEF_P in libtool.m4 +func_dll_def_p () +{ + $debug_cmd + + func_dll_def_p_tmp=`$SED -n \ + -e 's/^[ ]*//' \ + -e '/^\(;.*\)*$/d' \ + -e 's/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p' \ + -e q \ + "$1"` + test DEF = "$func_dll_def_p_tmp" +} + + # func_mode_compile arg... func_mode_compile () { - $opt_debug + $debug_cmd + # Get the compilation command and the source file. base_compile= - srcfile="$nonopt" # always keep a non-empty value in "srcfile" + srcfile=$nonopt # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal @@ -1965,12 +3281,12 @@ case $arg_mode in arg ) # do not "continue". Instead, add this to base_compile - lastarg="$arg" + lastarg=$arg arg_mode=normal ;; target ) - libobj="$arg" + libobj=$arg arg_mode=normal continue ;; @@ -1980,7 +3296,7 @@ case $arg in -o) test -n "$libobj" && \ - func_fatal_error "you cannot specify \`-o' more than once" + func_fatal_error "you cannot specify '-o' more than once" arg_mode=target continue ;; @@ -2009,12 +3325,12 @@ func_stripname '-Wc,' '' "$arg" args=$func_stripname_result lastarg= - save_ifs="$IFS"; IFS=',' + save_ifs=$IFS; IFS=, for arg in $args; do - IFS="$save_ifs" + IFS=$save_ifs func_append_quoted lastarg "$arg" done - IFS="$save_ifs" + IFS=$save_ifs func_stripname ' ' '' "$lastarg" lastarg=$func_stripname_result @@ -2027,8 +3343,8 @@ # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # - lastarg="$srcfile" - srcfile="$arg" + lastarg=$srcfile + srcfile=$arg ;; esac # case $arg ;; @@ -2043,13 +3359,13 @@ func_fatal_error "you must specify an argument for -Xcompile" ;; target) - func_fatal_error "you must specify a target with \`-o'" + 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" + libobj=$func_basename_result } ;; esac @@ -2069,7 +3385,7 @@ case $libobj in *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; *) - func_fatal_error "cannot determine name of library object from \`$libobj'" + func_fatal_error "cannot determine name of library object from '$libobj'" ;; esac @@ -2078,8 +3394,8 @@ for arg in $later; do case $arg in -shared) - test "$build_libtool_libs" != yes && \ - func_fatal_configuration "can not build a shared library" + test yes = "$build_libtool_libs" \ + || func_fatal_configuration "cannot build a shared library" build_old_libs=no continue ;; @@ -2105,17 +3421,17 @@ 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_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 + 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 + if test yes = "$build_old_libs"; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" @@ -2127,16 +3443,16 @@ pic_mode=default ;; esac - if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then + if test no = "$pic_mode" && test pass_all != "$deplibs_check_method"; 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" + if test no = "$compiler_c_o"; then + output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.$objext + lockfile=$output_obj.lock else output_obj= need_locks=no @@ -2145,12 +3461,12 @@ # 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 + if test yes = "$need_locks"; 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 + elif test warn = "$need_locks"; then if test -f "$lockfile"; then $ECHO "\ *** ERROR, $lockfile exists and contains: @@ -2158,7 +3474,7 @@ 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 +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." @@ -2180,11 +3496,11 @@ qsrcfile=$func_quote_for_eval_result # Only build a PIC object if we are building libtool libraries. - if test "$build_libtool_libs" = yes; then + if test yes = "$build_libtool_libs"; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile - if test "$pic_mode" != no; then + if test no != "$pic_mode"; then command="$base_compile $qsrcfile $pic_flag" else # Don't build PIC code @@ -2201,7 +3517,7 @@ func_show_eval_locale "$command" \ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' - if test "$need_locks" = warn && + if test warn = "$need_locks" && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: @@ -2212,7 +3528,7 @@ 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 +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." @@ -2228,20 +3544,20 @@ fi # Allow error messages only from the first compilation. - if test "$suppress_opt" = yes; then + if test yes = "$suppress_opt"; 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 + if test yes = "$build_old_libs"; then + if test yes != "$pic_mode"; 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 + if test yes = "$compiler_c_o"; then func_append command " -o $obj" fi @@ -2250,7 +3566,7 @@ func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' - if test "$need_locks" = warn && + if test warn = "$need_locks" && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: @@ -2261,7 +3577,7 @@ 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 +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." @@ -2281,7 +3597,7 @@ func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" # Unlock the critical section if it was locked - if test "$need_locks" != no; then + if test no != "$need_locks"; then removelist=$lockfile $RM "$lockfile" fi @@ -2291,7 +3607,7 @@ } $opt_help || { - test "$opt_mode" = compile && func_mode_compile ${1+"$@"} + test compile = "$opt_mode" && func_mode_compile ${1+"$@"} } func_mode_help () @@ -2311,7 +3627,7 @@ 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 +(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 @@ -2330,16 +3646,16 @@ -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 + -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 +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'." +SOURCEFILE, then substituting the C source code suffix '.c' with the +library object suffix, '.lo'." ;; execute) @@ -2352,7 +3668,7 @@ -dlopen FILE add the directory containing FILE to the library path -This mode sets the library path environment variable according to \`-dlopen' +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 @@ -2371,7 +3687,7 @@ 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." +the '--dry-run' option if you just want to see what would be executed." ;; install) @@ -2381,7 +3697,7 @@ Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be -either the \`install' or \`cp' program. +either the 'install' or 'cp' program. The following components of INSTALL-COMMAND are treated specially: @@ -2407,7 +3723,7 @@ -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 + -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 @@ -2421,7 +3737,8 @@ -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 + -objectlist FILE use a list of object files found in FILE to specify objects + -os2dllname NAME force a short DLL name on OS/2 (no effect on other OSes) -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information @@ -2441,20 +3758,20 @@ -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. +All other options (arguments beginning with '-') are ignored. -Every other argument is treated as a filename. Files ending in \`.la' are +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 +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 '.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 +If OUTPUT-FILE ends in '.lo' or '.$objext', then a reloadable object file is created, otherwise an executable program is created." ;; @@ -2465,7 +3782,7 @@ 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 +(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. @@ -2473,17 +3790,17 @@ ;; *) - func_fatal_help "invalid operation mode \`$opt_mode'" + func_fatal_help "invalid operation mode '$opt_mode'" ;; esac echo - $ECHO "Try \`$progname --help' for more information about other modes." + $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 + if test : = "$opt_help"; then func_mode_help else { @@ -2491,7 +3808,7 @@ for opt_mode in compile link execute install finish uninstall clean; do func_mode_help done - } | sed -n '1p; 2,$s/^Usage:/ or: /p' + } | $SED -n '1p; 2,$s/^Usage:/ or: /p' { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do @@ -2499,7 +3816,7 @@ func_mode_help done } | - sed '1d + $SED '1d /^When reporting/,/^Report/{ H d @@ -2516,16 +3833,17 @@ # func_mode_execute arg... func_mode_execute () { - $opt_debug + $debug_cmd + # The first argument is the command name. - cmd="$nonopt" + 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" + || func_fatal_help "'$file' is not a file" dir= case $file in @@ -2535,7 +3853,7 @@ # 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" + || func_fatal_help "'$lib' is not a valid libtool archive" # Read the libtool library. dlname= @@ -2546,18 +3864,18 @@ 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'" + func_warning "'$file' was not linked with '-export-dynamic'" continue fi func_dirname "$file" "" "." - dir="$func_dirname_result" + 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'" + func_fatal_error "cannot find '$dlname' in '$dir' or '$dir/$objdir'" fi fi ;; @@ -2565,18 +3883,18 @@ *.lo) # Just add the directory containing the .lo file. func_dirname "$file" "" "." - dir="$func_dirname_result" + dir=$func_dirname_result ;; *) - func_warning "\`-dlopen' is ignored for non-libtool libraries and objects" + 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" + test -n "$absdir" && dir=$absdir # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then @@ -2588,7 +3906,7 @@ # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. - libtool_execute_magic="$magic" + libtool_execute_magic=$magic # Check if any of the arguments is a wrapper script. args= @@ -2601,12 +3919,12 @@ if func_ltwrapper_script_p "$file"; then func_source "$file" # Transform arg to wrapped name. - file="$progdir/$program" + 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" + file=$progdir/$program fi ;; esac @@ -2614,7 +3932,15 @@ func_append_quoted args "$file" done - if test "X$opt_dry_run" = Xfalse; then + if $opt_dry_run; then + # 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 + else if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" @@ -2631,25 +3957,18 @@ 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 + exec_cmd=\$cmd$args fi } -test "$opt_mode" = execute && func_mode_execute ${1+"$@"} +test execute = "$opt_mode" && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { - $opt_debug + $debug_cmd + libs= libdirs= admincmds= @@ -2663,11 +3982,11 @@ if func_lalib_unsafe_p "$opt"; then func_append libs " $opt" else - func_warning "\`$opt' is not a valid libtool archive" + func_warning "'$opt' is not a valid libtool archive" fi else - func_fatal_error "invalid argument \`$opt'" + func_fatal_error "invalid argument '$opt'" fi done @@ -2682,12 +4001,12 @@ # Remove sysroot references if $opt_dry_run; then for lib in $libs; do - echo "removing references to $lt_sysroot and \`=' prefixes from $lib" + 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 \ + $SED -e "$sysroot_cmd s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ > $tmpdir/tmp-la mv -f $tmpdir/tmp-la $lib done @@ -2712,7 +4031,7 @@ fi # Exit here if they wanted silent mode. - $opt_silent && exit $EXIT_SUCCESS + $opt_quiet && exit $EXIT_SUCCESS if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then echo "----------------------------------------------------------------------" @@ -2723,27 +4042,27 @@ 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 "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 " - 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 " - 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" + $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'" + echo " - have your system administrator add LIBDIR to '/etc/ld.so.conf'" fi echo @@ -2762,18 +4081,20 @@ exit $EXIT_SUCCESS } -test "$opt_mode" = finish && func_mode_finish ${1+"$@"} +test finish = "$opt_mode" && func_mode_finish ${1+"$@"} # func_mode_install arg... func_mode_install () { - $opt_debug + $debug_cmd + # 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 || + if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" || # Allow the use of GNU shtool's install command. - case $nonopt in *shtool*) :;; *) false;; esac; then + case $nonopt in *shtool*) :;; *) false;; esac + then # Aesthetically quote it. func_quote_for_eval "$nonopt" install_prog="$func_quote_for_eval_result " @@ -2800,7 +4121,7 @@ opts= prev= install_type= - isdir=no + isdir=false stripme= no_mode=: for arg @@ -2813,7 +4134,7 @@ fi case $arg in - -d) isdir=yes ;; + -d) isdir=: ;; -f) if $install_cp; then :; else prev=$arg @@ -2831,7 +4152,7 @@ *) # 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 + if test X-m = "X$prev" && test -n "$install_override_mode"; then arg2=$install_override_mode no_mode=false fi @@ -2856,7 +4177,7 @@ func_fatal_help "you must specify an install program" test -n "$prev" && \ - func_fatal_help "the \`$prev' option requires an argument" + func_fatal_help "the '$prev' option requires an argument" if test -n "$install_override_mode" && $no_mode; then if $install_cp; then :; else @@ -2878,19 +4199,19 @@ 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" + test -d "$dest" && isdir=: + if $isdir; then + destdir=$dest destname= else func_dirname_and_basename "$dest" "" "." - destdir="$func_dirname_result" - destname="$func_basename_result" + 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" + func_fatal_help "'$dest' is not a directory" fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; @@ -2899,7 +4220,7 @@ case $file in *.lo) ;; *) - func_fatal_help "\`$destdir' must be an absolute directory name" + func_fatal_help "'$destdir' must be an absolute directory name" ;; esac done @@ -2908,7 +4229,7 @@ # This variable tells wrapper scripts just to set variables rather # than running their programs. - libtool_install_magic="$magic" + libtool_install_magic=$magic staticlibs= future_libdirs= @@ -2928,7 +4249,7 @@ # 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" + || func_fatal_help "'$file' is not a valid libtool archive" library_names= old_library= @@ -2950,7 +4271,7 @@ fi func_dirname "$file" "/" "" - dir="$func_dirname_result" + dir=$func_dirname_result func_append dir "$objdir" if test -n "$relink_command"; then @@ -2964,7 +4285,7 @@ # 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" + 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. @@ -2973,29 +4294,36 @@ relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi - func_warning "relinking \`$file'" + func_warning "relinking '$file'" func_show_eval "$relink_command" \ - 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' + '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" + realname=$1 shift - srcname="$realname" - test -n "$relink_command" && srcname="$realname"T + 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" + tstripme=$stripme case $host_os in cygwin* | mingw* | pw32* | cegcc*) case $realname in *.dll.a) - tstripme="" + tstripme= + ;; + esac + ;; + os2*) + case $realname in + *_dll.a) + tstripme= ;; esac ;; @@ -3006,7 +4334,7 @@ if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. - # Try `ln -sf' first, because the `ln' binary might depend on + # 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 @@ -3017,14 +4345,14 @@ fi # Do each command in the postinstall commands. - lib="$destdir/$realname" + 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 + name=$func_basename_result + instname=$dir/${name}i func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' # Maybe install the static library, too. @@ -3036,11 +4364,11 @@ # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then - destfile="$destdir/$destname" + destfile=$destdir/$destname else func_basename "$file" - destfile="$func_basename_result" - destfile="$destdir/$destfile" + destfile=$func_basename_result + destfile=$destdir/$destfile fi # Deduce the name of the destination old-style object file. @@ -3050,11 +4378,11 @@ staticdest=$func_lo2o_result ;; *.$objext) - staticdest="$destfile" + staticdest=$destfile destfile= ;; *) - func_fatal_help "cannot copy a libtool object to \`$destfile'" + func_fatal_help "cannot copy a libtool object to '$destfile'" ;; esac @@ -3063,7 +4391,7 @@ func_show_eval "$install_prog $file $destfile" 'exit $?' # Install the old object if enabled. - if test "$build_old_libs" = yes; then + if test yes = "$build_old_libs"; then # Deduce the name of the old-style object file. func_lo2o "$file" staticobj=$func_lo2o_result @@ -3075,23 +4403,23 @@ *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then - destfile="$destdir/$destname" + destfile=$destdir/$destname else func_basename "$file" - destfile="$func_basename_result" - destfile="$destdir/$destfile" + 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="" + stripped_ext= case $file in *.exe) if test ! -f "$file"; then func_stripname '' '.exe' "$file" file=$func_stripname_result - stripped_ext=".exe" + stripped_ext=.exe fi ;; esac @@ -3119,19 +4447,19 @@ # Check the variables that should have been set. test -z "$generated_by_libtool_version" && \ - func_fatal_error "invalid libtool wrapper script \`$wrapper'" + func_fatal_error "invalid libtool wrapper script '$wrapper'" - finalize=yes + finalize=: 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 + libfile=$libdir/`$ECHO "$lib" | $SED 's%^.*/%%g'` if test -n "$libdir" && test ! -f "$libfile"; then - func_warning "\`$lib' has not been installed in \`$libdir'" - finalize=no + func_warning "'$lib' has not been installed in '$libdir'" + finalize=false fi done @@ -3139,29 +4467,29 @@ func_source "$wrapper" outputname= - if test "$fast_install" = no && test -n "$relink_command"; then + if test no = "$fast_install" && test -n "$relink_command"; then $opt_dry_run || { - if test "$finalize" = yes; then + if $finalize; then tmpdir=`func_mktempdir` func_basename "$file$stripped_ext" - file="$func_basename_result" - outputname="$tmpdir/$file" + file=$func_basename_result + outputname=$tmpdir/$file # Replace the output file specification. relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` - $opt_silent || { + $opt_quiet || { 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" + func_error "error: relink '$file' with the above command before installing it" $opt_dry_run || ${RM}r "$tmpdir" continue fi - file="$outputname" + file=$outputname else - func_warning "cannot relink \`$file'" + func_warning "cannot relink '$file'" fi } else @@ -3198,10 +4526,10 @@ for file in $staticlibs; do func_basename "$file" - name="$func_basename_result" + name=$func_basename_result # Set up the ranlib parameters. - oldlib="$destdir/$name" + oldlib=$destdir/$name func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result @@ -3216,18 +4544,18 @@ done test -n "$future_libdirs" && \ - func_warning "remember to run \`$progname --finish$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' + exec_cmd='$SHELL "$progpath" $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi } -test "$opt_mode" = install && func_mode_install ${1+"$@"} +test install = "$opt_mode" && func_mode_install ${1+"$@"} # func_generate_dlsyms outputname originator pic_p @@ -3235,16 +4563,17 @@ # 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'` + $debug_cmd + + my_outputname=$1 + my_originator=$2 + my_pic_p=${3-false} + 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 "$dlfiles$dlprefiles" || test no != "$dlself"; then if test -n "$NM" && test -n "$global_symbol_pipe"; then - my_dlsyms="${my_outputname}S.c" + my_dlsyms=${my_outputname}S.c else func_error "not configured to extract global symbols from dlpreopened files" fi @@ -3255,7 +4584,7 @@ "") ;; *.c) # Discover the nlist of each of the dlfiles. - nlist="$output_objdir/${my_outputname}.nm" + nlist=$output_objdir/$my_outputname.nm func_show_eval "$RM $nlist ${nlist}S ${nlist}T" @@ -3263,34 +4592,36 @@ 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 */ +/* $my_dlsyms - symbol resolution table for '$my_outputname' dlsym emulation. */ +/* Generated by $PROGRAM (GNU $PACKAGE) $VERSION */ #ifdef __cplusplus extern \"C\" { #endif -#if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) +#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 +#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE +/* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST -#elif defined(__osf__) +#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 +#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) + /* External symbol declarations for the compiler. */\ " - if test "$dlself" = yes; then - func_verbose "generating symbol list for \`$output'" + if test yes = "$dlself"; then + func_verbose "generating symbol list for '$output'" $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" @@ -3298,7 +4629,7 @@ 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'" + 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 @@ -3318,10 +4649,10 @@ # Prepare the list of exported symbols if test -z "$export_symbols"; then - export_symbols="$output_objdir/$outputname.exp" + 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"' + 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"' @@ -3331,7 +4662,7 @@ } else $opt_dry_run || { - eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' + 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 @@ -3345,22 +4676,22 @@ fi for dlprefile in $dlprefiles; do - func_verbose "extracting global C symbols from \`$dlprefile'" + func_verbose "extracting global C symbols from '$dlprefile'" func_basename "$dlprefile" - name="$func_basename_result" + 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="" + 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 + if test -n "$dlprefile_dlname"; then func_basename "$dlprefile_dlname" - dlprefile_dlbasename="$func_basename_result" + dlprefile_dlbasename=$func_basename_result else # no lafile. user explicitly requested -dlpreopen . $sharedlib_from_linklib_cmd "$dlprefile" @@ -3368,7 +4699,7 @@ fi fi $opt_dry_run || { - if test -n "$dlprefile_dlbasename" ; then + if test -n "$dlprefile_dlbasename"; then eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' else func_warning "Could not compute DLL name from $name" @@ -3424,6 +4755,11 @@ echo '/* NONE */' >> "$output_objdir/$my_dlsyms" fi + func_show_eval '$RM "${nlist}I"' + if test -n "$global_symbol_to_import"; then + eval "$global_symbol_to_import"' < "$nlist"S > "$nlist"I' + fi + echo >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ @@ -3432,11 +4768,30 @@ void *address; } lt_dlsymlist; extern LT_DLSYM_CONST lt_dlsymlist -lt_${my_prefix}_LTX_preloaded_symbols[]; +lt_${my_prefix}_LTX_preloaded_symbols[];\ +" + + if test -s "$nlist"I; then + echo >> "$output_objdir/$my_dlsyms" "\ +static void lt_syminit(void) +{ + LT_DLSYM_CONST lt_dlsymlist *symbol = lt_${my_prefix}_LTX_preloaded_symbols; + for (; symbol->name; ++symbol) + {" + $SED 's/.*/ if (STREQ (symbol->name, \"&\")) symbol->address = (void *) \&&;/' < "$nlist"I >> "$output_objdir/$my_dlsyms" + echo >> "$output_objdir/$my_dlsyms" "\ + } +}" + fi + echo >> "$output_objdir/$my_dlsyms" "\ LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = -{\ - { \"$my_originator\", (void *) 0 }," +{ {\"$my_originator\", (void *) 0}," + + if test -s "$nlist"I; then + echo >> "$output_objdir/$my_dlsyms" "\ + {\"@INIT@\", (void *) <_syminit}," + fi case $need_lib_prefix in no) @@ -3478,9 +4833,7 @@ *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; *) - if test "X$my_pic_p" != Xno; then - pic_flag_for_symtable=" $pic_flag" - fi + $my_pic_p && pic_flag_for_symtable=" $pic_flag" ;; esac ;; @@ -3497,10 +4850,10 @@ 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"' + func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T" "${nlist}I"' # Transform the symbol file into the correct name. - symfileobj="$output_objdir/${my_outputname}S.$objext" + symfileobj=$output_objdir/${my_outputname}S.$objext case $host in *cygwin* | *mingw* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then @@ -3518,7 +4871,7 @@ esac ;; *) - func_fatal_error "unknown suffix for \`$my_dlsyms'" + func_fatal_error "unknown suffix for '$my_dlsyms'" ;; esac else @@ -3532,6 +4885,32 @@ fi } +# 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 () +{ + $debug_cmd + + 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 () +{ + $debug_cmd + + 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_win32_libid arg # return the library type of file 'arg' # @@ -3541,8 +4920,9 @@ # Despite the name, also deal with 64 bit binaries. func_win32_libid () { - $opt_debug - win32_libid_type="unknown" + $debug_cmd + + win32_libid_type=unknown win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import @@ -3552,16 +4932,29 @@ # 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 ' + case $nm_interface in + "MS dumpbin") + if func_cygming_ms_implib_p "$1" || + func_cygming_gnu_implib_p "$1" + then + win32_nmres=import + else + win32_nmres= + fi + ;; + *) + 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, + s|.*|import| p q } }'` + ;; + esac case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; @@ -3593,7 +4986,8 @@ # $sharedlib_from_linklib_result func_cygming_dll_for_implib () { - $opt_debug + $debug_cmd + sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` } @@ -3610,7 +5004,8 @@ # specified import library. func_cygming_dll_for_implib_fallback_core () { - $opt_debug + $debug_cmd + match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` $OBJDUMP -s --section "$1" "$2" 2>/dev/null | $SED '/^Contents of section '"$match_literal"':/{ @@ -3646,8 +5041,8 @@ /./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 + # archive that possess that section. Heuristic: eliminate + # all those that 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 @@ -3658,30 +5053,6 @@ $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 @@ -3695,16 +5066,17 @@ # $sharedlib_from_linklib_result func_cygming_dll_for_implib_fallback () { - $opt_debug - if func_cygming_gnu_implib_p "$1" ; then + $debug_cmd + + 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 + 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="" + sharedlib_from_linklib_result= fi } @@ -3712,10 +5084,11 @@ # 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 + $debug_cmd + + f_ex_an_ar_dir=$1; shift + f_ex_an_ar_oldlib=$1 + if test yes = "$lock_old_archive_extraction"; 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" @@ -3724,7 +5097,7 @@ 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 + if test yes = "$lock_old_archive_extraction"; then $opt_dry_run || rm -f "$lockfile" fi if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then @@ -3738,22 +5111,23 @@ # func_extract_archives gentop oldlib ... func_extract_archives () { - $opt_debug - my_gentop="$1"; shift + $debug_cmd + + my_gentop=$1; shift my_oldlibs=${1+"$@"} - my_oldobjs="" - my_xlib="" - my_xabs="" - my_xdir="" + 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" ;; + [\\/]* | [A-Za-z]:[\\/]*) my_xabs=$my_xlib ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac func_basename "$my_xlib" - my_xlib="$func_basename_result" + my_xlib=$func_basename_result my_xlib_u=$my_xlib while :; do case " $extracted_archives " in @@ -3765,7 +5139,7 @@ esac done extracted_archives="$extracted_archives $my_xlib_u" - my_xdir="$my_gentop/$my_xlib_u" + my_xdir=$my_gentop/$my_xlib_u func_mkdir_p "$my_xdir" @@ -3778,22 +5152,23 @@ cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` - darwin_base_archive=`basename "$darwin_archive"` + func_basename "$darwin_archive" + darwin_base_archive=$func_basename_result 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}" + 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}" + $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_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$sed_basename" | sort -u` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do @@ -3815,7 +5190,7 @@ my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` done - func_extract_archives_result="$my_oldobjs" + func_extract_archives_result=$my_oldobjs } @@ -3830,7 +5205,7 @@ # # 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 +# will assume that the directory where it is stored is # the $objdir directory. This is a cygwin/mingw-specific # behavior. func_emit_wrapper () @@ -3841,7 +5216,7 @@ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname -# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION +# Generated by $PROGRAM (GNU $PACKAGE) $VERSION # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. @@ -3898,9 +5273,9 @@ # 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 +# /script/ and the wrapper /executable/ that is used only on # windows platforms, and (c) all begin with the string "--lt-" -# (application programs are unlikely to have options which match +# (application programs are unlikely to have options that match # this pattern). # # There are only two supported options: --lt-debug and @@ -3933,7 +5308,7 @@ # Print the debug banner immediately: if test -n \"\$lt_option_debug\"; then - echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2 + echo \"$outputname:$output:\$LINENO: libtool wrapper (GNU $PACKAGE) $VERSION\" 1>&2 fi } @@ -3944,7 +5319,7 @@ lt_dump_args_N=1; for lt_arg do - \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\" + \$ECHO \"$outputname:$output:\$LINENO: newargv[\$lt_dump_args_N]: \$lt_arg\" lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` done } @@ -3958,7 +5333,7 @@ *-*-mingw | *-*-os2* | *-cegcc*) $ECHO "\ if test -n \"\$lt_option_debug\"; then - \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2 + \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} @@ -3968,7 +5343,7 @@ *) $ECHO "\ if test -n \"\$lt_option_debug\"; then - \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2 + \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir/\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir/\$program\" \${1+\"\$@\"} @@ -4043,13 +5418,13 @@ test -n \"\$absdir\" && thisdir=\"\$absdir\" " - if test "$fast_install" = yes; then + if test yes = "$fast_install"; 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\`; \\ + { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | $SED 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" @@ -4066,7 +5441,7 @@ if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else - $ECHO \"\$relink_command_output\" >&2 + \$ECHO \"\$relink_command_output\" >&2 $RM \"\$progdir/\$file\" exit 1 fi @@ -4101,7 +5476,7 @@ fi # Export our shlibpath_var if we have one. - if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then + if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $ECHO "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" @@ -4121,7 +5496,7 @@ fi else # The program doesn't exist. - \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 + \$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 @@ -4140,7 +5515,7 @@ cat < #include +#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) + /* declarations of non-ANSI functions */ -#if defined(__MINGW32__) +#if defined __MINGW32__ # ifdef __STRICT_ANSI__ int _putenv (const char *); # endif -#elif defined(__CYGWIN__) +#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) ... */ +/* #elif defined other_platform || defined ... */ #endif /* portability defines, excluding path handling macros */ -#if defined(_MSC_VER) +#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__) +#elif defined __MINGW32__ # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv -#elif defined(__CYGWIN__) +#elif defined __CYGWIN__ # define HAVE_SETENV # define FOPEN_WB "wb" -/* #elif defined (other platforms) ... */ +/* #elif defined other platforms ... */ #endif -#if defined(PATH_MAX) +#if defined PATH_MAX # define LT_PATHMAX PATH_MAX -#elif defined(MAXPATHLEN) +#elif defined MAXPATHLEN # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 @@ -4234,8 +5607,8 @@ # define PATH_SEPARATOR ':' #endif -#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ - defined (__OS2__) +#if defined _WIN32 || defined __MSDOS__ || defined __DJGPP__ || \ + defined __OS2__ # define HAVE_DOS_BASED_FILE_SYSTEM # define FOPEN_WB "wb" # ifndef DIR_SEPARATOR_2 @@ -4268,10 +5641,10 @@ #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ - if (stale) { free ((void *) stale); stale = 0; } \ + if (stale) { free (stale); stale = 0; } \ } while (0) -#if defined(LT_DEBUGWRAPPER) +#if defined LT_DEBUGWRAPPER static int lt_debug = 1; #else static int lt_debug = 0; @@ -4300,11 +5673,16 @@ EOF cat < 0) && IS_PATH_SEPARATOR (new_value[len-1])) + size_t len = strlen (new_value); + while ((len > 0) && IS_PATH_SEPARATOR (new_value[len-1])) { - new_value[len-1] = '\0'; + new_value[--len] = '\0'; } lt_setenv (name, new_value); XFREE (new_value); @@ -5082,27 +6460,47 @@ # True if ARG is an import lib, as indicated by $file_magic_cmd func_win32_import_lib_p () { - $opt_debug + $debug_cmd + case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in *import*) : ;; *) false ;; esac } +# func_suncc_cstd_abi +# !!ONLY CALL THIS FOR SUN CC AFTER $compile_command IS FULLY EXPANDED!! +# Several compiler flags select an ABI that is incompatible with the +# Cstd library. Avoid specifying it if any are in CXXFLAGS. +func_suncc_cstd_abi () +{ + $debug_cmd + + case " $compile_command " in + *" -compat=g "*|*\ -std=c++[0-9][0-9]\ *|*" -library=stdcxx4 "*|*" -library=stlport4 "*) + suncc_use_cstd_abi=no + ;; + *) + suncc_use_cstd_abi=yes + ;; + esac +} + # func_mode_link arg... func_mode_link () { - $opt_debug + $debug_cmd + 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 + # what 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 + # to make a dll that 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. @@ -5146,10 +6544,11 @@ module=no no_install=no objs= + os2dllname= non_pic_objects= precious_files_regex= prefer_static_libs=no - preload=no + preload=false prev= prevarg= release= @@ -5161,7 +6560,7 @@ vinfo= vinfo_number=no weak_libs= - single_module="${wl}-single_module" + single_module=$wl-single_module func_infer_tag $base_compile # We need to know -static, to get the right output filenames. @@ -5169,15 +6568,15 @@ do case $arg in -shared) - test "$build_libtool_libs" != yes && \ - func_fatal_configuration "can not build a shared library" + test yes != "$build_libtool_libs" \ + && func_fatal_configuration "cannot 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 + if test yes = "$build_libtool_libs" && test -z "$link_static_flag"; then func_warning "complete static linking is impossible in this configuration" fi if test -n "$link_static_flag"; then @@ -5210,7 +6609,7 @@ # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do - arg="$1" + arg=$1 shift func_quote_for_eval "$arg" qarg=$func_quote_for_eval_unquoted_result @@ -5227,21 +6626,21 @@ case $prev in bindir) - bindir="$arg" + bindir=$arg prev= continue ;; dlfiles|dlprefiles) - if test "$preload" = no; then + $preload || { # Add the symbol object into the linking commands. func_append compile_command " @SYMFILE@" func_append finalize_command " @SYMFILE@" - preload=yes - fi + preload=: + } case $arg in *.la | *.lo) ;; # We handle these cases below. force) - if test "$dlself" = no; then + if test no = "$dlself"; then dlself=needless export_dynamic=yes fi @@ -5249,9 +6648,9 @@ continue ;; self) - if test "$prev" = dlprefiles; then + if test dlprefiles = "$prev"; then dlself=yes - elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then + elif test dlfiles = "$prev" && test yes != "$dlopen_self"; then dlself=yes else dlself=needless @@ -5261,7 +6660,7 @@ continue ;; *) - if test "$prev" = dlfiles; then + if test dlfiles = "$prev"; then func_append dlfiles " $arg" else func_append dlprefiles " $arg" @@ -5272,14 +6671,14 @@ esac ;; expsyms) - export_symbols="$arg" + export_symbols=$arg test -f "$arg" \ - || func_fatal_error "symbol file \`$arg' does not exist" + || func_fatal_error "symbol file '$arg' does not exist" prev= continue ;; expsyms_regex) - export_symbols_regex="$arg" + export_symbols_regex=$arg prev= continue ;; @@ -5297,7 +6696,13 @@ continue ;; inst_prefix) - inst_prefix_dir="$arg" + inst_prefix_dir=$arg + prev= + continue + ;; + mllvm) + # Clang does not use LLVM to link, so we can simply discard any + # '-mllvm $arg' options when doing the link step. prev= continue ;; @@ -5321,21 +6726,21 @@ 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'" + test none = "$pic_object" && + test none = "$non_pic_object"; then + func_fatal_error "cannot find name of object for '$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" - xdir="$func_dirname_result" + xdir=$func_dirname_result - if test "$pic_object" != none; then + if test none != "$pic_object"; then # Prepend the subdirectory the object is found in. - pic_object="$xdir$pic_object" + pic_object=$xdir$pic_object - if test "$prev" = dlfiles; then - if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then + if test dlfiles = "$prev"; then + if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then func_append dlfiles " $pic_object" prev= continue @@ -5346,7 +6751,7 @@ fi # CHECK ME: I think I busted this. -Ossama - if test "$prev" = dlprefiles; then + if test dlprefiles = "$prev"; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= @@ -5354,23 +6759,23 @@ # A PIC object. func_append libobjs " $pic_object" - arg="$pic_object" + arg=$pic_object fi # Non-PIC object. - if test "$non_pic_object" != none; then + if test none != "$non_pic_object"; then # Prepend the subdirectory the object is found in. - non_pic_object="$xdir$non_pic_object" + 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" + if test -z "$pic_object" || test none = "$pic_object"; 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" + non_pic_object=$pic_object func_append non_pic_objects " $non_pic_object" fi else @@ -5378,7 +6783,7 @@ if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" - xdir="$func_dirname_result" + xdir=$func_dirname_result func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result @@ -5386,24 +6791,29 @@ func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else - func_fatal_error "\`$arg' is not a valid libtool object" + func_fatal_error "'$arg' is not a valid libtool object" fi fi done else - func_fatal_error "link input file \`$arg' does not exist" + func_fatal_error "link input file '$arg' does not exist" fi arg=$save_arg prev= continue ;; + os2dllname) + os2dllname=$arg + prev= + continue + ;; precious_regex) - precious_files_regex="$arg" + precious_files_regex=$arg prev= continue ;; release) - release="-$arg" + release=-$arg prev= continue ;; @@ -5415,7 +6825,7 @@ func_fatal_error "only absolute run-paths are allowed" ;; esac - if test "$prev" = rpath; then + if test rpath = "$prev"; then case "$rpath " in *" $arg "*) ;; *) func_append rpath " $arg" ;; @@ -5430,7 +6840,7 @@ continue ;; shrext) - shrext_cmds="$arg" + shrext_cmds=$arg prev= continue ;; @@ -5470,7 +6880,7 @@ esac fi # test -n "$prev" - prevarg="$arg" + prevarg=$arg case $arg in -all-static) @@ -5484,7 +6894,7 @@ -allow-undefined) # FIXME: remove this flag sometime in the future. - func_fatal_error "\`-allow-undefined' must not be used because it is the default" + func_fatal_error "'-allow-undefined' must not be used because it is the default" ;; -avoid-version) @@ -5516,7 +6926,7 @@ 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 + if test X-export-symbols = "X$arg"; then prev=expsyms else prev=expsyms_regex @@ -5550,9 +6960,9 @@ 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'" + func_fatal_error "require no space between '-L' and '$1'" else - func_fatal_error "need path for \`-L' option" + func_fatal_error "need path for '-L' option" fi fi func_resolve_sysroot "$func_stripname_result" @@ -5563,8 +6973,8 @@ *) absdir=`cd "$dir" && pwd` test -z "$absdir" && \ - func_fatal_error "cannot determine absolute directory name of \`$dir'" - dir="$absdir" + func_fatal_error "cannot determine absolute directory name of '$dir'" + dir=$absdir ;; esac case "$deplibs " in @@ -5599,7 +7009,7 @@ ;; -l*) - if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then + if test X-lc = "X$arg" || test X-lm = "X$arg"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) # These systems don't actually have a C or math library (as such) @@ -5607,11 +7017,11 @@ ;; *-*-os2*) # These systems don't actually have a C library (as such) - test "X$arg" = "X-lc" && continue + test X-lc = "X$arg" && continue ;; - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*) # Do not include libc due to us having libc/libc_r. - test "X$arg" = "X-lc" && continue + test X-lc = "X$arg" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework @@ -5620,16 +7030,16 @@ ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype - test "X$arg" = "X-lc" && continue + test X-lc = "X$arg" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work - test "X$arg" = "X-lc" && continue + test X-lc = "X$arg" && continue ;; esac - elif test "X$arg" = "X-lc_r"; then + elif test X-lc_r = "X$arg"; then case $host in - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*) # Do not include libc_r directly, use -pthread flag. continue ;; @@ -5639,6 +7049,11 @@ continue ;; + -mllvm) + prev=mllvm + continue + ;; + -module) module=yes continue @@ -5668,7 +7083,7 @@ ;; -multi_module) - single_module="${wl}-multi_module" + single_module=$wl-multi_module continue ;; @@ -5682,8 +7097,8 @@ *-*-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" + func_warning "'-no-install' is ignored for $host" + func_warning "assuming '-no-fast-install' instead" fast_install=no ;; *) no_install=yes ;; @@ -5701,6 +7116,11 @@ continue ;; + -os2dllname) + prev=os2dllname + continue + ;; + -o) prev=output ;; -precious-files-regex) @@ -5788,14 +7208,14 @@ func_stripname '-Wc,' '' "$arg" args=$func_stripname_result arg= - save_ifs="$IFS"; IFS=',' + save_ifs=$IFS; IFS=, for flag in $args; do - IFS="$save_ifs" + 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" + IFS=$save_ifs func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; @@ -5804,15 +7224,15 @@ func_stripname '-Wl,' '' "$arg" args=$func_stripname_result arg= - save_ifs="$IFS"; IFS=',' + save_ifs=$IFS; IFS=, for flag in $args; do - IFS="$save_ifs" + 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" + IFS=$save_ifs func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; @@ -5835,7 +7255,7 @@ # -msg_* for osf cc -msg_*) func_quote_for_eval "$arg" - arg="$func_quote_for_eval_result" + arg=$func_quote_for_eval_result ;; # Flags to be passed through unchanged, with rationale: @@ -5847,25 +7267,49 @@ # -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 + # -fstack-protector* stack protector 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 + # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization + # -specs=* GCC specs files + # -stdlib=* select c++ std lib with clang + # -fsanitize=* Clang/GCC memory and address sanitizer -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) + -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \ + -specs=*|-fsanitize=*) func_quote_for_eval "$arg" - arg="$func_quote_for_eval_result" + arg=$func_quote_for_eval_result func_append compile_command " $arg" func_append finalize_command " $arg" func_append compiler_flags " $arg" continue ;; + -Z*) + if test os2 = "`expr $host : '.*\(os2\)'`"; then + # OS/2 uses -Zxxx to specify OS/2-specific options + compiler_flags="$compiler_flags $arg" + func_append compile_command " $arg" + func_append finalize_command " $arg" + case $arg in + -Zlinker | -Zstack) + prev=xcompiler + ;; + esac + continue + else + # Otherwise treat like 'Some other compiler flag' below + func_quote_for_eval "$arg" + arg=$func_quote_for_eval_result + fi + ;; + # Some other compiler flag. -* | +*) func_quote_for_eval "$arg" - arg="$func_quote_for_eval_result" + arg=$func_quote_for_eval_result ;; *.$objext) @@ -5886,21 +7330,21 @@ 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'" + test none = "$pic_object" && + test none = "$non_pic_object"; then + func_fatal_error "cannot find name of object for '$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" - xdir="$func_dirname_result" + xdir=$func_dirname_result - if test "$pic_object" != none; then + test none = "$pic_object" || { # Prepend the subdirectory the object is found in. - pic_object="$xdir$pic_object" + pic_object=$xdir$pic_object - if test "$prev" = dlfiles; then - if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then + if test dlfiles = "$prev"; then + if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then func_append dlfiles " $pic_object" prev= continue @@ -5911,7 +7355,7 @@ fi # CHECK ME: I think I busted this. -Ossama - if test "$prev" = dlprefiles; then + if test dlprefiles = "$prev"; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= @@ -5919,23 +7363,23 @@ # A PIC object. func_append libobjs " $pic_object" - arg="$pic_object" - fi + arg=$pic_object + } # Non-PIC object. - if test "$non_pic_object" != none; then + if test none != "$non_pic_object"; then # Prepend the subdirectory the object is found in. - non_pic_object="$xdir$non_pic_object" + 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" + if test -z "$pic_object" || test none = "$pic_object"; 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" + non_pic_object=$pic_object func_append non_pic_objects " $non_pic_object" fi else @@ -5943,7 +7387,7 @@ if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" - xdir="$func_dirname_result" + xdir=$func_dirname_result func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result @@ -5951,7 +7395,7 @@ func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else - func_fatal_error "\`$arg' is not a valid libtool object" + func_fatal_error "'$arg' is not a valid libtool object" fi fi ;; @@ -5967,11 +7411,11 @@ # A libtool-controlled library. func_resolve_sysroot "$arg" - if test "$prev" = dlfiles; then + if test dlfiles = "$prev"; then # This library was specified with -dlopen. func_append dlfiles " $func_resolve_sysroot_result" prev= - elif test "$prev" = dlprefiles; then + elif test dlprefiles = "$prev"; then # The library was specified with -dlpreopen. func_append dlprefiles " $func_resolve_sysroot_result" prev= @@ -5986,7 +7430,7 @@ # 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" + arg=$func_quote_for_eval_result ;; esac # arg @@ -5998,9 +7442,9 @@ done # argument parsing loop test -n "$prev" && \ - func_fatal_help "the \`$prevarg' option requires an argument" + func_fatal_help "the '$prevarg' option requires an argument" - if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then + if test yes = "$export_dynamic" && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" func_append compile_command " $arg" func_append finalize_command " $arg" @@ -6009,20 +7453,23 @@ oldlibs= # calculate the name of the file, without its directory func_basename "$output" - outputname="$func_basename_result" - libobjs_save="$libobjs" + 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\'\` + 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\" + # Definition is injected by LT_CONFIG during libtool generation. + func_munge_path_list sys_lib_dlsearch_path "$LT_SYS_LIBRARY_PATH" + func_dirname "$output" "/" "" - output_objdir="$func_dirname_result$objdir" + output_objdir=$func_dirname_result$objdir func_to_tool_file "$output_objdir/" tool_output_objdir=$func_to_tool_file_result # Create the object directory. @@ -6045,7 +7492,7 @@ # 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 + if $opt_preserve_dup_deps; then case "$libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac @@ -6053,7 +7500,7 @@ func_append libs " $deplib" done - if test "$linkmode" = lib; then + if test lib = "$linkmode"; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps @@ -6085,7 +7532,7 @@ case $file in *.la) ;; *) - func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file" + func_fatal_help "libraries can '-dlopen' only libtool libraries: $file" ;; esac done @@ -6093,7 +7540,7 @@ prog) compile_deplibs= finalize_deplibs= - alldeplibs=no + alldeplibs=false newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" @@ -6105,29 +7552,32 @@ 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 + if test lib,link = "$linkmode,$pass"; 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" + deplibs=$tmp_deplibs fi - if test "$linkmode,$pass" = "lib,link" || - test "$linkmode,$pass" = "prog,scan"; then - libs="$deplibs" + if test lib,link = "$linkmode,$pass" || + test prog,scan = "$linkmode,$pass"; then + libs=$deplibs deplibs= fi - if test "$linkmode" = prog; then + if test prog = "$linkmode"; then case $pass in - dlopen) libs="$dlfiles" ;; - dlpreopen) libs="$dlprefiles" ;; - link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; + 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 + if test lib,dlpreopen = "$linkmode,$pass"; then # Collect and forward deplibs of preopened libtool libs for lib in $dlprefiles; do # Ignore non-libtool-libs @@ -6148,26 +7598,26 @@ esac done done - libs="$dlprefiles" + libs=$dlprefiles fi - if test "$pass" = dlopen; then + if test dlopen = "$pass"; then # Collect dlpreopened libraries - save_deplibs="$deplibs" + save_deplibs=$deplibs deplibs= fi for deplib in $libs; do lib= - found=no + found=false 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 + if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append compiler_flags " $deplib" - if test "$linkmode" = lib ; then + if test lib = "$linkmode"; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; @@ -6177,13 +7627,13 @@ continue ;; -l*) - if test "$linkmode" != lib && test "$linkmode" != prog; then - func_warning "\`-l' is ignored for archives/objects" + if test lib != "$linkmode" && test prog != "$linkmode"; then + func_warning "'-l' is ignored for archives/objects" continue fi func_stripname '-l' '' "$deplib" name=$func_stripname_result - if test "$linkmode" = lib; then + if test lib = "$linkmode"; 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" @@ -6191,31 +7641,22 @@ 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}" + lib=$searchdir/lib$name$search_ext if test -f "$lib"; then - if test "$search_ext" = ".la"; then - found=yes + if test .la = "$search_ext"; then + found=: else - found=no + found=false 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 $found; then + # 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 + if test yes = "$allow_libtool_libs_with_static_runtimes"; then case " $predeps $postdeps " in *" $deplib "*) if func_lalib_p "$lib"; then @@ -6223,19 +7664,19 @@ old_library= func_source "$lib" for l in $old_library $library_names; do - ll="$l" + ll=$l done - if test "X$ll" = "X$old_library" ; then # only static version available - found=no + if test "X$ll" = "X$old_library"; then # only static version available + found=false func_dirname "$lib" "" "." - ladir="$func_dirname_result" + ladir=$func_dirname_result lib=$ladir/$old_library - if test "$linkmode,$pass" = "prog,link"; then + if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" - test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" + test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs" fi continue fi @@ -6244,15 +7685,25 @@ *) ;; esac fi + else + # deplib doesn't seem to be a libtool library + if test prog,link = "$linkmode,$pass"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs" + fi + continue fi ;; # -l *.ltframework) - if test "$linkmode,$pass" = "prog,link"; then + if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" - if test "$linkmode" = lib ; then + if test lib = "$linkmode"; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; @@ -6265,18 +7716,18 @@ case $linkmode in lib) deplibs="$deplib $deplibs" - test "$pass" = conv && continue + test conv = "$pass" && 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 + if test conv = "$pass"; then deplibs="$deplib $deplibs" continue fi - if test "$pass" = scan; then + if test scan = "$pass"; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" @@ -6287,13 +7738,13 @@ func_append newlib_search_path " $func_resolve_sysroot_result" ;; *) - func_warning "\`-L' is ignored for archives/objects" + func_warning "'-L' is ignored for archives/objects" ;; esac # linkmode continue ;; # -L -R*) - if test "$pass" = link; then + if test link = "$pass"; then func_stripname '-R' '' "$deplib" func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result @@ -6311,7 +7762,7 @@ lib=$func_resolve_sysroot_result ;; *.$libext) - if test "$pass" = conv; then + if test conv = "$pass"; then deplibs="$deplib $deplibs" continue fi @@ -6322,21 +7773,26 @@ case " $dlpreconveniencelibs " in *" $deplib "*) ;; *) - valid_a_lib=no + valid_a_lib=false 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 + valid_a_lib=: fi ;; pass_all) - valid_a_lib=yes + valid_a_lib=: ;; esac - if test "$valid_a_lib" != yes; then + if $valid_a_lib; then + echo + $ECHO "*** Warning: Linking the shared library $output against the" + $ECHO "*** static library $deplib is not portable!" + deplibs="$deplib $deplibs" + else echo $ECHO "*** Warning: Trying to link with static lib archive $deplib." echo "*** I have the capability to make that library automatically link in when" @@ -6344,18 +7800,13 @@ 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 + if test link != "$pass"; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" @@ -6366,10 +7817,10 @@ esac # linkmode ;; # *.$libext *.lo | *.$objext) - if test "$pass" = conv; then + if test conv = "$pass"; then deplibs="$deplib $deplibs" - elif test "$linkmode" = prog; then - if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then + elif test prog = "$linkmode"; then + if test dlpreopen = "$pass" || test yes != "$dlopen_support" || test no = "$build_libtool_libs"; then # If there is no dlopen support or we're linking statically, # we need to preload. func_append newdlprefiles " $deplib" @@ -6382,22 +7833,20 @@ continue ;; %DEPLIBS%) - alldeplibs=yes + alldeplibs=: 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 + $found || test -f "$lib" \ + || func_fatal_error "cannot find the library '$lib' or unhandled argument '$deplib'" # 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_fatal_error "'$lib' is not a valid libtool archive" func_dirname "$lib" "" "." - ladir="$func_dirname_result" + ladir=$func_dirname_result dlname= dlopen= @@ -6427,36 +7876,36 @@ 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 + if test lib,link = "$linkmode,$pass" || + test prog,scan = "$linkmode,$pass" || + { test prog != "$linkmode" && test lib != "$linkmode"; }; then test -n "$dlopen" && func_append dlfiles " $dlopen" test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" fi - if test "$pass" = conv; then + if test conv = "$pass"; 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'" + func_fatal_error "cannot find name of link library for '$lib'" fi # It is a libtool convenience library, so add in its objects. func_append convenience " $ladir/$objdir/$old_library" func_append old_convenience " $ladir/$objdir/$old_library" - elif test "$linkmode" != prog && test "$linkmode" != lib; then - func_fatal_error "\`$lib' is not a convenience library" + 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 prog != "$linkmode" && test lib != "$linkmode"; then + func_fatal_error "'$lib' is not a convenience library" fi - tmp_libs= - for deplib in $dependency_libs; do - deplibs="$deplib $deplibs" - if $opt_preserve_dup_deps ; then - case "$tmp_libs " in - *" $deplib "*) func_append specialdeplibs " $deplib" ;; - esac - fi - func_append tmp_libs " $deplib" - done continue fi # $pass = conv @@ -6464,26 +7913,26 @@ # 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 + { test yes = "$prefer_static_libs" || + test built,no = "$prefer_static_libs,$installed"; }; then linklib=$old_library else for l in $old_library $library_names; do - linklib="$l" + linklib=$l done fi if test -z "$linklib"; then - func_fatal_error "cannot find name of link library for \`$lib'" + 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 dlopen = "$pass"; then + test -z "$libdir" \ + && func_fatal_error "cannot -dlopen a convenience library: '$lib'" if test -z "$dlname" || - test "$dlopen_support" != yes || - test "$build_libtool_libs" = no; then + test yes != "$dlopen_support" || + test no = "$build_libtool_libs" + 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 @@ -6497,40 +7946,40 @@ # We need an absolute path. case $ladir in - [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; + [\\/]* | [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 "cannot determine absolute directory name of '$ladir'" func_warning "passing it literally to the linker, although it might fail" - abs_ladir="$ladir" + abs_ladir=$ladir fi ;; esac func_basename "$lib" - laname="$func_basename_result" + laname=$func_basename_result # Find the relevant object directory and library name. - if test "X$installed" = Xyes; then + if test yes = "$installed"; 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" + func_warning "library '$lib' was moved." + dir=$ladir + absdir=$abs_ladir + libdir=$abs_ladir else - dir="$lt_sysroot$libdir" - absdir="$lt_sysroot$libdir" + dir=$lt_sysroot$libdir + absdir=$lt_sysroot$libdir fi - test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes + test yes = "$hardcode_automatic" && avoidtemprpath=yes else if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then - dir="$ladir" - absdir="$abs_ladir" + dir=$ladir + absdir=$abs_ladir # Remove this search path later func_append notinst_path " $abs_ladir" else - dir="$ladir/$objdir" - absdir="$abs_ladir/$objdir" + dir=$ladir/$objdir + absdir=$abs_ladir/$objdir # Remove this search path later func_append notinst_path " $abs_ladir" fi @@ -6539,11 +7988,11 @@ 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'" + if test dlpreopen = "$pass"; then + if test -z "$libdir" && test prog = "$linkmode"; then + func_fatal_error "only libraries may -dlpreopen a convenience library: '$lib'" fi - case "$host" in + case $host in # special handling for platforms with PE-DLLs. *cygwin* | *mingw* | *cegcc* ) # Linker will automatically link against shared library if both @@ -6587,9 +8036,9 @@ if test -z "$libdir"; then # Link the convenience library - if test "$linkmode" = lib; then + if test lib = "$linkmode"; then deplibs="$dir/$old_library $deplibs" - elif test "$linkmode,$pass" = "prog,link"; then + elif test prog,link = "$linkmode,$pass"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else @@ -6599,14 +8048,14 @@ fi - if test "$linkmode" = prog && test "$pass" != link; then + if test prog = "$linkmode" && test link != "$pass"; 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 + linkalldeplibs=false + if test no != "$link_all_deplibs" || test -z "$library_names" || + test no = "$build_libtool_libs"; then + linkalldeplibs=: fi tmp_libs= @@ -6618,14 +8067,14 @@ ;; esac # Need to link against all dependency_libs? - if test "$linkalldeplibs" = yes; then + if $linkalldeplibs; 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 + if $opt_preserve_dup_deps; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac @@ -6635,15 +8084,15 @@ continue fi # $linkmode = prog... - if test "$linkmode,$pass" = "prog,link"; then + if test prog,link = "$linkmode,$pass"; then if test -n "$library_names" && - { { test "$prefer_static_libs" = no || - test "$prefer_static_libs,$installed" = "built,yes"; } || + { { test no = "$prefer_static_libs" || + test built,yes = "$prefer_static_libs,$installed"; } || test -z "$old_library"; }; then # We need to hardcode the library path - if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then + if test -n "$shlibpath_var" && test -z "$avoidtemprpath"; then # Make sure the rpath contains only unique directories. - case "$temp_rpath:" in + case $temp_rpath: in *"$absdir:"*) ;; *) func_append temp_rpath "$absdir:" ;; esac @@ -6672,9 +8121,9 @@ esac fi # $linkmode,$pass = prog,link... - if test "$alldeplibs" = yes && - { test "$deplibs_check_method" = pass_all || - { test "$build_libtool_libs" = yes && + if $alldeplibs && + { test pass_all = "$deplibs_check_method" || + { test yes = "$build_libtool_libs" && test -n "$library_names"; }; }; then # We only need to search for static libraries continue @@ -6683,19 +8132,19 @@ 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 + if test built = "$use_static_libs" && test yes = "$installed"; then use_static_libs=no fi if test -n "$library_names" && - { test "$use_static_libs" = no || test -z "$old_library"; }; then + { test no = "$use_static_libs" || test -z "$old_library"; }; then case $host in - *cygwin* | *mingw* | *cegcc*) + *cygwin* | *mingw* | *cegcc* | *os2*) # No point in relinking DLLs because paths are not encoded func_append notinst_deplibs " $lib" need_relink=no ;; *) - if test "$installed" = no; then + if test no = "$installed"; then func_append notinst_deplibs " $lib" need_relink=yes fi @@ -6705,24 +8154,24 @@ # Warn about portability, can't link against -module's on some # systems (darwin). Don't bleat about dlopened modules though! - dlopenmodule="" + dlopenmodule= for dlpremoduletest in $dlprefiles; do if test "X$dlpremoduletest" = "X$lib"; then - dlopenmodule="$dlpremoduletest" + dlopenmodule=$dlpremoduletest break fi done - if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then + if test -z "$dlopenmodule" && test yes = "$shouldnotlink" && test link = "$pass"; then echo - if test "$linkmode" = prog; then + if test prog = "$linkmode"; 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 + if test lib = "$linkmode" && + test yes = "$hardcode_into_libs"; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. @@ -6750,43 +8199,43 @@ # figure out the soname set dummy $library_names shift - realname="$1" + 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" + soname=$dlname elif test -n "$soname_spec"; then # bleh windows case $host in - *cygwin* | mingw* | *cegcc*) + *cygwin* | mingw* | *cegcc* | *os2*) func_arith $current - $age major=$func_arith_result - versuffix="-$major" + versuffix=-$major ;; esac eval soname=\"$soname_spec\" else - soname="$realname" + soname=$realname fi # Make a new name for the extract_expsyms_cmds to use - soroot="$soname" + soroot=$soname func_basename "$soroot" - soname="$func_basename_result" + 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_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_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 @@ -6794,58 +8243,58 @@ linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" - if test "$linkmode" = prog || test "$opt_mode" != relink; then + if test prog = "$linkmode" || test relink != "$opt_mode"; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) - if test "$hardcode_direct" = no; then - add="$dir/$linklib" + if test no = "$hardcode_direct"; then + add=$dir/$linklib case $host in - *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; - *-*-sysv4*uw2*) add_dir="-L$dir" ;; + *-*-sco3.2v5.0.[024]*) add_dir=-L$dir ;; + *-*-sysv4*uw2*) add_dir=-L$dir ;; *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ - *-*-unixware7*) add_dir="-L$dir" ;; + *-*-unixware7*) add_dir=-L$dir ;; *-*-darwin* ) - # if the lib is a (non-dlopened) module then we can not + # if the lib is a (non-dlopened) module then we cannot # link against it, someone is ignoring the earlier warnings if /usr/bin/file -L $add 2> /dev/null | - $GREP ": [^:]* bundle" >/dev/null ; then + $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 + 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" + add=$dir/$old_library fi elif test -n "$old_library"; then - add="$dir/$old_library" + add=$dir/$old_library fi fi esac - elif test "$hardcode_minus_L" = no; then + elif test no = "$hardcode_minus_L"; then case $host in - *-*-sunos*) add_shlibpath="$dir" ;; + *-*-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" + add_dir=-L$dir + add=-l$name + elif test no = "$hardcode_shlibpath_var"; 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" + if test yes = "$hardcode_direct" && + test no = "$hardcode_direct_absolute"; then + add=$dir/$linklib + elif test yes = "$hardcode_minus_L"; 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 @@ -6854,10 +8303,10 @@ ;; esac fi - add="-l$name" - elif test "$hardcode_shlibpath_var" = yes; then - add_shlibpath="$dir" - add="-l$name" + add=-l$name + elif test yes = "$hardcode_shlibpath_var"; then + add_shlibpath=$dir + add=-l$name else lib_linked=no fi @@ -6865,7 +8314,7 @@ *) lib_linked=no ;; esac - if test "$lib_linked" != yes; then + if test yes != "$lib_linked"; then func_fatal_configuration "unsupported hardcode properties" fi @@ -6875,15 +8324,15 @@ *) func_append compile_shlibpath "$add_shlibpath:" ;; esac fi - if test "$linkmode" = prog; then + if test prog = "$linkmode"; 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 + if test yes != "$hardcode_direct" && + test yes != "$hardcode_minus_L" && + test yes = "$hardcode_shlibpath_var"; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; @@ -6892,33 +8341,33 @@ fi fi - if test "$linkmode" = prog || test "$opt_mode" = relink; then + if test prog = "$linkmode" || test relink = "$opt_mode"; 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 + if test yes = "$hardcode_direct" && + test no = "$hardcode_direct_absolute"; then + add=$libdir/$linklib + elif test yes = "$hardcode_minus_L"; then + add_dir=-L$libdir + add=-l$name + elif test yes = "$hardcode_shlibpath_var"; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac - add="-l$name" - elif test "$hardcode_automatic" = yes; then + add=-l$name + elif test yes = "$hardcode_automatic"; then if test -n "$inst_prefix_dir" && - test -f "$inst_prefix_dir$libdir/$linklib" ; then - add="$inst_prefix_dir$libdir/$linklib" + test -f "$inst_prefix_dir$libdir/$linklib"; then + add=$inst_prefix_dir$libdir/$linklib else - add="$libdir/$linklib" + add=$libdir/$linklib fi else # We cannot seem to hardcode it, guess we'll fake it. - add_dir="-L$libdir" + 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 @@ -6927,10 +8376,10 @@ ;; esac fi - add="-l$name" + add=-l$name fi - if test "$linkmode" = prog; then + if test prog = "$linkmode"; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else @@ -6938,43 +8387,43 @@ test -n "$add" && deplibs="$add $deplibs" fi fi - elif test "$linkmode" = prog; then + elif test prog = "$linkmode"; 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" + if test unsupported != "$hardcode_direct"; 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 + elif test yes = "$build_libtool_libs"; then # Not a shared library - if test "$deplibs_check_method" != pass_all; then + if test pass_all != "$deplibs_check_method"; 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 "*** Warning: This system cannot 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 + if test yes = "$module"; 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 "*** 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." + echo "*** 'nm' from GNU binutils and a full rebuild may help." fi - if test "$build_old_libs" = no; then + if test no = "$build_old_libs"; then build_libtool_libs=module build_old_libs=yes else @@ -6987,11 +8436,11 @@ fi fi # link shared/static library? - if test "$linkmode" = lib; then + if test lib = "$linkmode"; then if test -n "$dependency_libs" && - { test "$hardcode_into_libs" != yes || - test "$build_old_libs" = yes || - test "$link_static" = yes; }; then + { test yes != "$hardcode_into_libs" || + test yes = "$build_old_libs" || + test yes = "$link_static"; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do @@ -7005,12 +8454,12 @@ *) func_append temp_deplibs " $libdir";; esac done - dependency_libs="$temp_deplibs" + 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" + test no = "$link_static" && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do @@ -7020,7 +8469,7 @@ func_resolve_sysroot "$func_stripname_result";; *) func_resolve_sysroot "$deplib" ;; esac - if $opt_preserve_dup_deps ; then + if $opt_preserve_dup_deps; then case "$tmp_libs " in *" $func_resolve_sysroot_result "*) func_append specialdeplibs " $func_resolve_sysroot_result" ;; @@ -7029,12 +8478,12 @@ func_append tmp_libs " $func_resolve_sysroot_result" done - if test "$link_all_deplibs" != no; then + if test no != "$link_all_deplibs"; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do path= case $deplib in - -L*) path="$deplib" ;; + -L*) path=$deplib ;; *.la) func_resolve_sysroot "$deplib" deplib=$func_resolve_sysroot_result @@ -7042,12 +8491,12 @@ dir=$func_dirname_result # We need an absolute path. case $dir in - [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; + [\\/]* | [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" + func_warning "cannot determine absolute directory name of '$dir'" + absdir=$dir fi ;; esac @@ -7055,35 +8504,35 @@ 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 + 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 -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}}'` + 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}" + 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" + path=-L$absdir/$objdir ;; esac else - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` + eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ - func_fatal_error "\`$deplib' is not a valid libtool archive" + func_fatal_error "'$deplib' is not a valid libtool archive" test "$absdir" != "$libdir" && \ - func_warning "\`$deplib' seems to be moved" + func_warning "'$deplib' seems to be moved" - path="-L$absdir" + path=-L$absdir fi ;; esac @@ -7095,23 +8544,23 @@ fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs - if test "$pass" = link; then - if test "$linkmode" = "prog"; then + if test link = "$pass"; then + if test prog = "$linkmode"; 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 + dependency_libs=$newdependency_libs + if test dlpreopen = "$pass"; 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 + if test dlopen != "$pass"; then + test conv = "$pass" || { # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do @@ -7121,12 +8570,12 @@ esac done newlib_search_path= - fi + } - if test "$linkmode,$pass" != "prog,link"; then - vars="deplibs" - else + if test prog,link = "$linkmode,$pass"; then vars="compile_deplibs finalize_deplibs" + else + vars=deplibs fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order @@ -7184,62 +8633,93 @@ eval $var=\"$tmp_libs\" done # for var fi + + # Add Sun CC postdeps if required: + test CXX = "$tagname" && { + case $host_os in + linux*) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C++ 5.9 + func_suncc_cstd_abi + + if test no != "$suncc_use_cstd_abi"; then + func_append postdeps ' -library=Cstd -library=Crun' + fi + ;; + esac + ;; + + solaris*) + func_cc_basename "$CC" + case $func_cc_basename_result in + CC* | sunCC*) + func_suncc_cstd_abi + + if test no != "$suncc_use_cstd_abi"; then + func_append postdeps ' -library=Cstd -library=Crun' + fi + ;; + esac + ;; + esac + } + # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= - for i in $dependency_libs ; do + for i in $dependency_libs; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) - i="" + i= ;; esac - if test -n "$i" ; then + 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" + if test prog = "$linkmode"; then + dlfiles=$newdlfiles fi - if test "$linkmode" = prog || test "$linkmode" = lib; then - dlprefiles="$newdlprefiles" + if test prog = "$linkmode" || test lib = "$linkmode"; then + dlprefiles=$newdlprefiles fi case $linkmode in oldlib) - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - func_warning "\`-dlopen' is ignored for archives" + if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then + func_warning "'-dlopen' is ignored for archives" fi case " $deplibs" in *\ -l* | *\ -L*) - func_warning "\`-l' and \`-L' are ignored for archives" ;; + func_warning "'-l' and '-L' are ignored for archives" ;; esac test -n "$rpath" && \ - func_warning "\`-rpath' is ignored for archives" + func_warning "'-rpath' is ignored for archives" test -n "$xrpath" && \ - func_warning "\`-R' is ignored for archives" + func_warning "'-R' is ignored for archives" test -n "$vinfo" && \ - func_warning "\`-version-info/-version-number' is ignored for archives" + func_warning "'-version-info/-version-number' is ignored for archives" test -n "$release" && \ - func_warning "\`-release' is ignored for archives" + func_warning "'-release' is ignored for archives" test -n "$export_symbols$export_symbols_regex" && \ - func_warning "\`-export-symbols' is ignored for archives" + func_warning "'-export-symbols' is ignored for archives" # Now set the variables for building old libraries. build_libtool_libs=no - oldlibs="$output" + oldlibs=$output func_append objs "$old_deplibs" ;; lib) - # Make sure we only generate libraries of the form `libNAME.la'. + # Make sure we only generate libraries of the form 'libNAME.la'. case $outputname in lib*) func_stripname 'lib' '.la' "$outputname" @@ -7248,10 +8728,10 @@ eval libname=\"$libname_spec\" ;; *) - test "$module" = no && \ - func_fatal_help "libtool library \`$output' must begin with \`lib'" + test no = "$module" \ + && func_fatal_help "libtool library '$output' must begin with 'lib'" - if test "$need_lib_prefix" != no; then + if test no != "$need_lib_prefix"; then # Add the "lib" prefix for modules if required func_stripname '' '.la' "$outputname" name=$func_stripname_result @@ -7265,8 +8745,8 @@ 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" + if test pass_all != "$deplibs_check_method"; 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" @@ -7275,21 +8755,21 @@ fi fi - test "$dlself" != no && \ - func_warning "\`-dlopen self' is ignored for libtool libraries" + test no = "$dlself" \ + || 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" + test 1 -lt "$#" \ + && func_warning "ignoring multiple '-rpath's for a libtool library" - install_libdir="$1" + install_libdir=$1 oldlibs= if test -z "$rpath"; then - if test "$build_libtool_libs" = yes; then + if test yes = "$build_libtool_libs"; then # Building a libtool convenience library. - # Some compilers have problems with a `.al' extension so + # 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" @@ -7298,20 +8778,20 @@ fi test -n "$vinfo" && \ - func_warning "\`-version-info/-version-number' is ignored for convenience libraries" + func_warning "'-version-info/-version-number' is ignored for convenience libraries" test -n "$release" && \ - func_warning "\`-release' is ignored for convenience libraries" + func_warning "'-release' is ignored for convenience libraries" else # Parse the version information argument. - save_ifs="$IFS"; IFS=':' + save_ifs=$IFS; IFS=: set dummy $vinfo 0 0 0 shift - IFS="$save_ifs" + IFS=$save_ifs test -n "$7" && \ - func_fatal_help "too many parameters to \`-version-info'" + func_fatal_help "too many parameters to '-version-info'" # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts @@ -7319,42 +8799,45 @@ case $vinfo_number in yes) - number_major="$1" - number_minor="$2" - number_revision="$3" + 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 + # that 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) + darwin|freebsd-elf|linux|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result - age="$number_minor" - revision="$number_revision" + age=$number_minor + revision=$number_revision ;; - freebsd-aout|freebsd-elf|qnx|sunos) - current="$number_major" - revision="$number_minor" - age="0" + freebsd-aout|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" + 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" + current=$1 + revision=$2 + age=$3 ;; esac @@ -7362,30 +8845,30 @@ 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" + 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" + 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" + 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" + 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. @@ -7400,26 +8883,36 @@ # verstring for coding it into the library header func_arith $current - $age major=.$func_arith_result - versuffix="$major.$age.$revision" + 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" + xlcverstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision" verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" + # On Darwin other compilers + case $CC in + nagfor*) + verstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision" + ;; + *) + verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" + ;; + esac ;; freebsd-aout) - major=".$current" - versuffix=".$current.$revision"; + major=.$current + versuffix=.$current.$revision ;; freebsd-elf) - major=".$current" - versuffix=".$current" + func_arith $current - $age + major=.$func_arith_result + versuffix=$major.$age.$revision ;; irix | nonstopux) - if test "X$lt_irix_increment" = "Xno"; then + if test no = "$lt_irix_increment"; then func_arith $current - $age else func_arith $current - $age + 1 @@ -7430,69 +8923,74 @@ nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac - verstring="$verstring_prefix$major.$revision" + verstring=$verstring_prefix$major.$revision # Add in all the interfaces that we are compatible with. loop=$revision - while test "$loop" -ne 0; do + while test 0 -ne "$loop"; do func_arith $revision - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result - verstring="$verstring_prefix$major.$iface:$verstring" + verstring=$verstring_prefix$major.$iface:$verstring done - # Before this point, $major must not contain `.'. + # Before this point, $major must not contain '.'. major=.$major - versuffix="$major.$revision" + 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" + versuffix=$major.$age.$revision ;; osf) func_arith $current - $age major=.$func_arith_result - versuffix=".$current.$age.$revision" - verstring="$current.$age.$revision" + 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 + while test 0 -ne "$loop"; do func_arith $current - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result - verstring="$verstring:${iface}.0" + verstring=$verstring:$iface.0 done # Make executables depend on our current version. - func_append verstring ":${current}.0" + func_append verstring ":$current.0" ;; qnx) - major=".$current" - versuffix=".$current" + major=.$current + versuffix=.$current + ;; + + sco) + major=.$current + versuffix=.$current ;; sunos) - major=".$current" - versuffix=".$current.$revision" + major=.$current + versuffix=.$current.$revision ;; windows) # Use '-' rather than '.', since we only want one - # extension on DOS 8.3 filesystems. + # extension on DOS 8.3 file systems. func_arith $current - $age major=$func_arith_result - versuffix="-$major" + versuffix=-$major ;; *) - func_fatal_configuration "unknown library version type \`$version_type'" + func_fatal_configuration "unknown library version type '$version_type'" ;; esac @@ -7506,42 +9004,45 @@ verstring= ;; *) - verstring="0.0" + verstring=0.0 ;; esac - if test "$need_version" = no; then + if test no = "$need_version"; then versuffix= else - versuffix=".0.0" + 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 + if test yes,no = "$avoid_version,$need_version"; then major= versuffix= - verstring="" + 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 + if test yes = "$allow_undefined"; then + if test unsupported = "$allow_undefined_flag"; then + if test yes = "$build_old_libs"; then + func_warning "undefined symbols not allowed in $host shared libraries; building static only" + build_libtool_libs=no + else + func_fatal_error "can't build $host shared library unless -no-undefined is specified" + fi fi else # Don't allow undefined symbols. - allow_undefined_flag="$no_undefined_flag" + allow_undefined_flag=$no_undefined_flag fi fi - func_generate_dlsyms "$libname" "$libname" "yes" + func_generate_dlsyms "$libname" "$libname" : func_append libobjs " $symfileobj" - test "X$libobjs" = "X " && libobjs= + test " " = "$libobjs" && libobjs= - if test "$opt_mode" != relink; then + if test relink != "$opt_mode"; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= @@ -7550,8 +9051,8 @@ case $p in *.$objext | *.gcno) ;; - $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) - if test "X$precious_files_regex" != "X"; then + $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/$libname$release.*) + if test -n "$precious_files_regex"; then if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue @@ -7567,11 +9068,11 @@ fi # Now set the variables for building old libraries. - if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then + if test yes = "$build_old_libs" && test convenience != "$build_libtool_libs"; then func_append oldlibs " $output_objdir/$libname.$libext" # Transform .lo files to .o files. - oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP` + oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; $lo2o" | $NL2SP` fi # Eliminate all temporary directories. @@ -7592,13 +9093,13 @@ *) func_append finalize_rpath " $libdir" ;; esac done - if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then + if test yes != "$hardcode_into_libs" || test yes = "$build_old_libs"; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened - old_dlfiles="$dlfiles" + old_dlfiles=$dlfiles dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in @@ -7608,7 +9109,7 @@ done # Make sure dlprefiles contains only unique files - old_dlprefiles="$dlprefiles" + old_dlprefiles=$dlprefiles dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in @@ -7617,7 +9118,7 @@ esac done - if test "$build_libtool_libs" = yes; then + if test yes = "$build_libtool_libs"; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) @@ -7641,7 +9142,7 @@ ;; *) # Add libc to deplibs on all other systems if necessary. - if test "$build_libtool_need_lc" = "yes"; then + if test yes = "$build_libtool_need_lc"; then func_append deplibs " -lc" fi ;; @@ -7657,9 +9158,9 @@ # 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="" + release= + versuffix= + major= newdeplibs= droppeddeps=no case $deplibs_check_method in @@ -7688,20 +9189,20 @@ -l*) func_stripname -l '' "$i" name=$func_stripname_result - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + if test yes = "$allow_libtool_libs_with_static_runtimes"; then case " $predeps $postdeps " in *" $i "*) func_append newdeplibs " $i" - i="" + i= ;; esac fi - if test -n "$i" ; then + if test -n "$i"; then libname=`eval "\\$ECHO \"$libname_spec\""` deplib_matches=`eval "\\$ECHO \"$library_names_spec\""` set dummy $deplib_matches; shift deplib_match=$1 - if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then + if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then func_append newdeplibs " $i" else droppeddeps=yes @@ -7731,20 +9232,20 @@ $opt_dry_run || $RM conftest if $LTCC $LTCFLAGS -o conftest conftest.c $i; then ldd_output=`ldd conftest` - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + if test yes = "$allow_libtool_libs_with_static_runtimes"; then case " $predeps $postdeps " in *" $i "*) func_append newdeplibs " $i" - i="" + i= ;; esac fi - if test -n "$i" ; then + if test -n "$i"; then libname=`eval "\\$ECHO \"$libname_spec\""` deplib_matches=`eval "\\$ECHO \"$library_names_spec\""` set dummy $deplib_matches; shift deplib_match=$1 - if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then + if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then func_append newdeplibs " $i" else droppeddeps=yes @@ -7781,24 +9282,24 @@ -l*) func_stripname -l '' "$a_deplib" name=$func_stripname_result - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + if test yes = "$allow_libtool_libs_with_static_runtimes"; then case " $predeps $postdeps " in *" $a_deplib "*) func_append newdeplibs " $a_deplib" - a_deplib="" + a_deplib= ;; esac fi - if test -n "$a_deplib" ; then + if test -n "$a_deplib"; then libname=`eval "\\$ECHO \"$libname_spec\""` if test -n "$file_magic_glob"; then libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob` else libnameglob=$libname fi - test "$want_nocaseglob" = yes && nocaseglob=`shopt -p nocaseglob` + test yes = "$want_nocaseglob" && nocaseglob=`shopt -p nocaseglob` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do - if test "$want_nocaseglob" = yes; then + if test yes = "$want_nocaseglob"; then shopt -s nocaseglob potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` $nocaseglob @@ -7816,25 +9317,25 @@ # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? - potlib="$potent_lib" + potlib=$potent_lib while test -h "$potlib" 2>/dev/null; do - potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` + potliblink=`ls -ld $potlib | $SED 's/.* -> //'` case $potliblink in - [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; - *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";; + [\\/]* | [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="" + a_deplib= break 2 fi done done fi - if test -n "$a_deplib" ; then + if test -n "$a_deplib"; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." @@ -7842,7 +9343,7 @@ 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 + 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" @@ -7865,30 +9366,30 @@ -l*) func_stripname -l '' "$a_deplib" name=$func_stripname_result - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + if test yes = "$allow_libtool_libs_with_static_runtimes"; then case " $predeps $postdeps " in *" $a_deplib "*) func_append newdeplibs " $a_deplib" - a_deplib="" + a_deplib= ;; esac fi - if test -n "$a_deplib" ; then + 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 + 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="" + a_deplib= break 2 fi done done fi - if test -n "$a_deplib" ; then + if test -n "$a_deplib"; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." @@ -7896,7 +9397,7 @@ 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 + 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" @@ -7912,18 +9413,18 @@ done # Gone through all deplibs. ;; none | unknown | *) - newdeplibs="" + 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 + if test yes = "$allow_libtool_libs_with_static_runtimes"; then + for i in $predeps $postdeps; do # can't use Xsed below, because $i might contain '/' - tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"` + tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s|$i||"` done fi case $tmp_deplibs in *[!\ \ ]*) echo - if test "X$deplibs_check_method" = "Xnone"; then + if test none = "$deplibs_check_method"; then echo "*** Warning: inter-library dependencies are not supported in this platform." else echo "*** Warning: inter-library dependencies are not known to be supported." @@ -7947,8 +9448,8 @@ ;; esac - if test "$droppeddeps" = yes; then - if test "$module" = yes; then + if test yes = "$droppeddeps"; then + if test yes = "$module"; then echo echo "*** Warning: libtool could not satisfy all declared inter-library" $ECHO "*** dependencies of module $libname. Therefore, libtool will create" @@ -7957,12 +9458,12 @@ 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 "*** 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." + echo "*** 'nm' from GNU binutils and a full rebuild may help." fi - if test "$build_old_libs" = no; then - oldlibs="$output_objdir/$libname.$libext" + if test no = "$build_old_libs"; then + oldlibs=$output_objdir/$libname.$libext build_libtool_libs=module build_old_libs=yes else @@ -7973,14 +9474,14 @@ echo "*** automatically added whenever a program is linked with this library" echo "*** or is declared to -dlopen it." - if test "$allow_undefined" = no; then + if test no = "$allow_undefined"; 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" + if test no = "$build_old_libs"; then + oldlibs=$output_objdir/$libname.$libext build_libtool_libs=module build_old_libs=yes else @@ -8026,7 +9527,7 @@ *) func_append new_libs " $deplib" ;; esac done - deplibs="$new_libs" + deplibs=$new_libs # All the library-specific variables (install_libdir is set above). library_names= @@ -8034,25 +9535,25 @@ 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. + if test yes = "$build_libtool_libs"; 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 + if test yes = "$hardcode_into_libs"; then # Hardcode the library paths hardcode_libdirs= dep_rpath= - rpath="$finalize_rpath" - test "$opt_mode" != relink && rpath="$compile_rpath$rpath" + rpath=$finalize_rpath + test relink = "$opt_mode" || 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" + hardcode_libdirs=$libdir else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in @@ -8077,7 +9578,7 @@ # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then - libdir="$hardcode_libdirs" + libdir=$hardcode_libdirs eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" fi if test -n "$runpath_var" && test -n "$perm_rpath"; then @@ -8091,8 +9592,8 @@ test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi - shlibpath="$finalize_shlibpath" - test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath" + shlibpath=$finalize_shlibpath + test relink = "$opt_mode" || shlibpath=$compile_shlibpath$shlibpath if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi @@ -8102,19 +9603,19 @@ eval library_names=\"$library_names_spec\" set dummy $library_names shift - realname="$1" + realname=$1 shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else - soname="$realname" + soname=$realname fi if test -z "$dlname"; then dlname=$soname fi - lib="$output_objdir/$realname" + lib=$output_objdir/$realname linknames= for link do @@ -8128,7 +9629,7 @@ 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" + export_symbols=$output_objdir/$libname.uexp func_append delfiles " $export_symbols" fi @@ -8137,31 +9638,31 @@ 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 + func_dll_def_p "$export_symbols" || { # 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" + 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" + if test yes = "$always_export_symbols" || 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='~' + save_ifs=$IFS; IFS='~' for cmd1 in $cmds; do - IFS="$save_ifs" + 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 @@ -8175,7 +9676,7 @@ try_normal_branch=no ;; esac - if test "$try_normal_branch" = yes \ + if test yes = "$try_normal_branch" \ && { test "$len" -lt "$max_cmd_len" \ || test "$max_cmd_len" -le -1; } then @@ -8186,7 +9687,7 @@ output_la=$func_basename_result save_libobjs=$libobjs save_output=$output - output=${output_objdir}/${output_la}.nm + 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" @@ -8209,8 +9710,8 @@ break fi done - IFS="$save_ifs" - if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then + IFS=$save_ifs + if test -n "$export_symbols_regex" && test : != "$skipped_export"; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi @@ -8218,16 +9719,16 @@ 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" + 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 + if test : != "$skipped_export" && 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" + 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 + # '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. @@ -8246,11 +9747,11 @@ ;; esac done - deplibs="$tmp_deplibs" + deplibs=$tmp_deplibs if test -n "$convenience"; then if test -n "$whole_archive_flag_spec" && - test "$compiler_needs_object" = yes && + test yes = "$compiler_needs_object" && test -z "$libobjs"; then # extract the archives, so we have objects to list. # TODO: could optimize this to just extract one archive. @@ -8261,7 +9762,7 @@ eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= else - gentop="$output_objdir/${outputname}x" + gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $convenience @@ -8270,18 +9771,18 @@ fi fi - if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then + if test yes = "$thread_safe" && 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 + if test relink = "$opt_mode"; 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 yes = "$module" && 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 @@ -8299,7 +9800,7 @@ fi fi - if test "X$skipped_export" != "X:" && + if test : != "$skipped_export" && func_len " $test_cmds" && len=$func_len_result && test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then @@ -8332,8 +9833,8 @@ 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 + if test -n "$save_libobjs" && test : != "$skipped_export" && test yes = "$with_gnu_ld"; then + output=$output_objdir/$output_la.lnkscript func_verbose "creating GNU ld script: $output" echo 'INPUT (' > $output for obj in $save_libobjs @@ -8345,14 +9846,14 @@ 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 + elif test -n "$save_libobjs" && test : != "$skipped_export" && test -n "$file_list_spec"; 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 + if test yes = "$compiler_needs_object"; then firstobj="$1 " shift fi @@ -8367,7 +9868,7 @@ else if test -n "$save_libobjs"; then func_verbose "creating reloadable object files..." - output=$output_objdir/$output_la-${k}.$objext + output=$output_objdir/$output_la-$k.$objext eval test_cmds=\"$reload_cmds\" func_len " $test_cmds" len0=$func_len_result @@ -8379,13 +9880,13 @@ func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result - if test "X$objlist" = X || + if test -z "$objlist" || 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 + if test 1 -eq "$k"; then # The first file doesn't have a previous command to add. reload_objs=$objlist eval concat_cmds=\"$reload_cmds\" @@ -8395,10 +9896,10 @@ reload_objs="$objlist $last_robj" eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" fi - last_robj=$output_objdir/$output_la-${k}.$objext + last_robj=$output_objdir/$output_la-$k.$objext func_arith $k + 1 k=$func_arith_result - output=$output_objdir/$output_la-${k}.$objext + output=$output_objdir/$output_la-$k.$objext objlist=" $obj" func_len " $last_robj" func_arith $len0 + $func_len_result @@ -8410,9 +9911,9 @@ # 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\" + eval concat_cmds=\"\$concat_cmds$reload_cmds\" if test -n "$last_robj"; then - eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" + eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi func_append delfiles " $output" @@ -8420,9 +9921,9 @@ output= fi - if ${skipped_export-false}; then - func_verbose "generating symbol list for \`$libname.la'" - export_symbols="$output_objdir/$libname.exp" + ${skipped_export-false} && { + 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. @@ -8431,16 +9932,16 @@ 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='~' + save_ifs=$IFS; IFS='~' for cmd in $concat_cmds; do - IFS="$save_ifs" - $opt_silent || { + IFS=$save_ifs + $opt_quiet || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } @@ -8448,7 +9949,7 @@ lt_exit=$? # Restore the uninstalled library and exit - if test "$opt_mode" = relink; then + if test relink = "$opt_mode"; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) @@ -8457,7 +9958,7 @@ exit $lt_exit } done - IFS="$save_ifs" + 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"' @@ -8465,18 +9966,18 @@ fi fi - if ${skipped_export-false}; then + ${skipped_export-false} && { 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" + 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" + 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 + # '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. @@ -8485,7 +9986,7 @@ 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. @@ -8499,7 +10000,7 @@ # value of $libobjs for piecewise linking. # Do each of the archive commands. - if test "$module" = yes && test -n "$module_cmds" ; then + if test yes = "$module" && test -n "$module_cmds"; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else @@ -8521,7 +10022,7 @@ # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then - gentop="$output_objdir/${outputname}x" + gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $dlprefiles @@ -8529,11 +10030,12 @@ test "X$libobjs" = "X " && libobjs= fi - save_ifs="$IFS"; IFS='~' + save_ifs=$IFS; IFS='~' for cmd in $cmds; do - IFS="$save_ifs" + IFS=$sp$nl eval cmd=\"$cmd\" - $opt_silent || { + IFS=$save_ifs + $opt_quiet || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } @@ -8541,7 +10043,7 @@ lt_exit=$? # Restore the uninstalled library and exit - if test "$opt_mode" = relink; then + if test relink = "$opt_mode"; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) @@ -8550,10 +10052,10 @@ exit $lt_exit } done - IFS="$save_ifs" + IFS=$save_ifs # Restore the uninstalled library and exit - if test "$opt_mode" = relink; then + if test relink = "$opt_mode"; 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 @@ -8573,39 +10075,39 @@ done # If -module or -export-dynamic was specified, set the dlname. - if test "$module" = yes || test "$export_dynamic" = yes; then + if test yes = "$module" || test yes = "$export_dynamic"; then # On all known operating systems, these are identical. - dlname="$soname" + dlname=$soname fi fi ;; obj) - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - func_warning "\`-dlopen' is ignored for objects" + if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then + func_warning "'-dlopen' is ignored for objects" fi case " $deplibs" in *\ -l* | *\ -L*) - func_warning "\`-l' and \`-L' are ignored for objects" ;; + func_warning "'-l' and '-L' are ignored for objects" ;; esac test -n "$rpath" && \ - func_warning "\`-rpath' is ignored for objects" + func_warning "'-rpath' is ignored for objects" test -n "$xrpath" && \ - func_warning "\`-R' is ignored for objects" + func_warning "'-R' is ignored for objects" test -n "$vinfo" && \ - func_warning "\`-version-info' is ignored for objects" + func_warning "'-version-info' is ignored for objects" test -n "$release" && \ - func_warning "\`-release' is ignored for objects" + 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" + func_fatal_error "cannot build library object '$output' from non-libtool objects" libobj=$output func_lo2o "$libobj" @@ -8613,7 +10115,7 @@ ;; *) libobj= - obj="$output" + obj=$output ;; esac @@ -8626,17 +10128,19 @@ # 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 reload_cmds runs $LD directly, get rid of -Wl from + # whole_archive_flag_spec and hope we can get by with turning comma + # into space. + case $reload_cmds in + *\$LD[\ \$]*) wl= ;; + esac 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'` + test -n "$wl" || tmp_whole_archive_flags=`$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` + reload_conv_objs=$reload_objs\ $tmp_whole_archive_flags else - gentop="$output_objdir/${obj}x" + gentop=$output_objdir/${obj}x func_append generated " $gentop" func_extract_archives $gentop $convenience @@ -8645,12 +10149,12 @@ fi # If we're not building shared, we need to use non_pic_objs - test "$build_libtool_libs" != yes && libobjs="$non_pic_objects" + test yes = "$build_libtool_libs" || 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 + reload_objs=$objs$old_deplibs' '`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; /\.lib$/d; $lo2o" | $NL2SP`' '$reload_conv_objs - output="$obj" + output=$obj func_execute_cmds "$reload_cmds" 'exit $?' # Exit if we aren't doing a library object file. @@ -8662,7 +10166,7 @@ exit $EXIT_SUCCESS fi - if test "$build_libtool_libs" != yes; then + test yes = "$build_libtool_libs" || { if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi @@ -8672,12 +10176,12 @@ # $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 + if test -n "$pic_flag" || test default != "$pic_mode"; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" - output="$libobj" + output=$libobj func_execute_cmds "$reload_cmds" 'exit $?' fi @@ -8694,16 +10198,14 @@ output=$func_stripname_result.exe;; esac test -n "$vinfo" && \ - func_warning "\`-version-info' is ignored for programs" + func_warning "'-version-info' is ignored for programs" test -n "$release" && \ - func_warning "\`-release' is ignored for programs" + 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." + $preload \ + && test unknown,unknown,unknown = "$dlopen_support,$dlopen_self,$dlopen_self_static" \ + && func_warning "'LT_INIT([dlopen])' not used. Assuming no dlopen support." case $host in *-*-rhapsody* | *-*-darwin1.[012]) @@ -8717,11 +10219,11 @@ *-*-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 + if test CXX = "$tagname"; 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" + func_append compile_command " $wl-bind_at_load" + func_append finalize_command " $wl-bind_at_load" ;; esac fi @@ -8757,7 +10259,7 @@ *) func_append new_libs " $deplib" ;; esac done - compile_deplibs="$new_libs" + compile_deplibs=$new_libs func_append compile_command " $compile_deplibs" @@ -8781,7 +10283,7 @@ if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then - hardcode_libdirs="$libdir" + hardcode_libdirs=$libdir else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in @@ -8804,7 +10306,7 @@ fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) - testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` + testbindir=`$ECHO "$libdir" | $SED -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; ::) dllsearchpath=$libdir;; @@ -8821,10 +10323,10 @@ # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then - libdir="$hardcode_libdirs" + libdir=$hardcode_libdirs eval rpath=\" $hardcode_libdir_flag_spec\" fi - compile_rpath="$rpath" + compile_rpath=$rpath rpath= hardcode_libdirs= @@ -8832,7 +10334,7 @@ if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then - hardcode_libdirs="$libdir" + hardcode_libdirs=$libdir else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in @@ -8857,45 +10359,43 @@ # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then - libdir="$hardcode_libdirs" + libdir=$hardcode_libdirs eval rpath=\" $hardcode_libdir_flag_spec\" fi - finalize_rpath="$rpath" + finalize_rpath=$rpath - if test -n "$libobjs" && test "$build_old_libs" = yes; then + if test -n "$libobjs" && test yes = "$build_old_libs"; 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" + func_generate_dlsyms "$outputname" "@PROGRAM@" false # template prelinking step if test -n "$prelink_cmds"; then func_execute_cmds "$prelink_cmds" 'exit $?' fi - wrappers_required=yes + wrappers_required=: case $host in *cegcc* | *mingw32ce*) # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. - wrappers_required=no + wrappers_required=false ;; *cygwin* | *mingw* ) - if test "$build_libtool_libs" != yes; then - wrappers_required=no - fi + test yes = "$build_libtool_libs" || wrappers_required=false ;; *) - if test "$need_relink" = no || test "$build_libtool_libs" != yes; then - wrappers_required=no + if test no = "$need_relink" || test yes != "$build_libtool_libs"; then + wrappers_required=false fi ;; esac - if test "$wrappers_required" = no; then + $wrappers_required || { # Replace the output file specification. compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` - link_command="$compile_command$compile_rpath" + link_command=$compile_command$compile_rpath # We have no uninstalled library dependencies, so finalize right now. exit_status=0 @@ -8908,12 +10408,12 @@ fi # Delete the generated files. - if test -f "$output_objdir/${outputname}S.${objext}"; then - func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' + 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" @@ -8943,9 +10443,9 @@ fi fi - if test "$no_install" = yes; then + if test yes = "$no_install"; then # We don't need to create a wrapper script. - link_command="$compile_var$compile_command$compile_rpath" + 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. @@ -8962,27 +10462,28 @@ 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 + case $hardcode_action,$fast_install in + relink,*) + # 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" + ;; + *,yes) + link_command=$finalize_var$compile_command$finalize_rpath + relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` + ;; + *,no) + link_command=$compile_var$compile_command$compile_rpath + relink_command=$finalize_var$finalize_command$finalize_rpath + ;; + *,needless) + link_command=$finalize_var$compile_command$finalize_rpath + relink_command= + ;; + esac # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` @@ -9039,8 +10540,8 @@ 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" + 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 @@ -9061,7 +10562,7 @@ 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 + if test "x$build" = "x$host"; then $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result else func_emit_wrapper no > $func_ltwrapper_scriptname_result @@ -9084,25 +10585,27 @@ # 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" + case $build_libtool_libs in + convenience) + oldobjs="$libobjs_save $symfileobj" + addlibs=$convenience build_libtool_libs=no - else + ;; + module) + oldobjs=$libobjs_save + addlibs=$old_convenience + build_libtool_libs=no + ;; + *) oldobjs="$old_deplibs $non_pic_objects" - if test "$preload" = yes && test -f "$symfileobj"; then - func_append oldobjs " $symfileobj" - fi - fi - addlibs="$old_convenience" - fi + $preload && test -f "$symfileobj" \ + && func_append oldobjs " $symfileobj" + addlibs=$old_convenience + ;; + esac if test -n "$addlibs"; then - gentop="$output_objdir/${outputname}x" + gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $addlibs @@ -9110,13 +10613,13 @@ fi # Do each command in the archive commands. - if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then + if test -n "$old_archive_from_new_cmds" && test yes = "$build_libtool_libs"; 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" + gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $dlprefiles @@ -9137,7 +10640,7 @@ : else echo "copying selected object files to avoid basename conflicts..." - gentop="$output_objdir/${outputname}x" + gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_mkdir_p "$gentop" save_oldobjs=$oldobjs @@ -9146,7 +10649,7 @@ for obj in $save_oldobjs do func_basename "$obj" - objbase="$func_basename_result" + objbase=$func_basename_result case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) @@ -9215,18 +10718,18 @@ else # the above command should be used before it gets too long oldobjs=$objlist - if test "$obj" = "$last_oldobj" ; then + 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\" + eval concat_cmds=\"\$concat_cmds$old_archive_cmds\" objlist= len=$len0 fi done RANLIB=$save_RANLIB oldobjs=$objlist - if test "X$oldobjs" = "X" ; then + if test -z "$oldobjs"; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" @@ -9243,7 +10746,7 @@ case $output in *.la) old_library= - test "$build_old_libs" = yes && old_library="$libname.$libext" + test yes = "$build_old_libs" && old_library=$libname.$libext func_verbose "creating $output" # Preserve any variables that may affect compiler behavior @@ -9258,31 +10761,31 @@ 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="(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 + if test yes = "$hardcode_automatic"; 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 yes = "$installed"; then if test -z "$install_libdir"; then break fi - output="$output_objdir/$outputname"i + 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" + name=$func_basename_result func_resolve_sysroot "$deplib" - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` + 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_fatal_error "'$deplib' is not a valid libtool archive" func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" ;; -L*) @@ -9298,23 +10801,23 @@ *) func_append newdependency_libs " $deplib" ;; esac done - dependency_libs="$newdependency_libs" + 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` + 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_fatal_error "'$lib' is not a valid libtool archive" func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" ;; *) func_append newdlfiles " $lib" ;; esac done - dlfiles="$newdlfiles" + dlfiles=$newdlfiles newdlprefiles= for lib in $dlprefiles; do case $lib in @@ -9324,34 +10827,34 @@ # 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` + 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_fatal_error "'$lib' is not a valid libtool archive" func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" ;; esac done - dlprefiles="$newdlprefiles" + dlprefiles=$newdlprefiles else newdlfiles= for lib in $dlfiles; do case $lib in - [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; + [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlfiles " $abs" done - dlfiles="$newdlfiles" + dlfiles=$newdlfiles newdlprefiles= for lib in $dlprefiles; do case $lib in - [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; + [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlprefiles " $abs" done - dlprefiles="$newdlprefiles" + dlprefiles=$newdlprefiles fi $RM $output # place dlname in correct position for cygwin @@ -9367,10 +10870,9 @@ 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 + if test -n "$bindir"; then func_relative_path "$install_libdir" "$bindir" - tdlname=$func_relative_path_result$dlname + tdlname=$func_relative_path_result/$dlname else # Otherwise fall back on heuristic. tdlname=../bin/$dlname @@ -9379,7 +10881,7 @@ esac $ECHO > $output "\ # $outputname - a libtool library file -# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION +# Generated by $PROGRAM (GNU $PACKAGE) $VERSION # # Please DO NOT delete this file! # It is necessary for linking the library. @@ -9393,7 +10895,7 @@ # The name of the static archive. old_library='$old_library' -# Linker flags that can not go in dependency_libs. +# Linker flags that cannot go in dependency_libs. inherited_linker_flags='$new_inherited_linker_flags' # Libraries that this one depends upon. @@ -9419,7 +10921,7 @@ # Directory that this library needs to be installed in: libdir='$install_libdir'" - if test "$installed" = no && test "$need_relink" = yes; then + if test no,yes = "$installed,$need_relink"; then $ECHO >> $output "\ relink_command=\"$relink_command\"" fi @@ -9434,27 +10936,29 @@ exit $EXIT_SUCCESS } -{ test "$opt_mode" = link || test "$opt_mode" = relink; } && - func_mode_link ${1+"$@"} +if test link = "$opt_mode" || test relink = "$opt_mode"; then + func_mode_link ${1+"$@"} +fi # func_mode_uninstall arg... func_mode_uninstall () { - $opt_debug - RM="$nonopt" + $debug_cmd + + RM=$nonopt files= - rmforce= + rmforce=false exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. - libtool_install_magic="$magic" + libtool_install_magic=$magic for arg do case $arg in - -f) func_append RM " $arg"; rmforce=yes ;; + -f) func_append RM " $arg"; rmforce=: ;; -*) func_append RM " $arg" ;; *) func_append files " $arg" ;; esac @@ -9467,18 +10971,18 @@ for file in $files; do func_dirname "$file" "" "." - dir="$func_dirname_result" - if test "X$dir" = X.; then - odir="$objdir" + dir=$func_dirname_result + if test . = "$dir"; then + odir=$objdir else - odir="$dir/$objdir" + odir=$dir/$objdir fi func_basename "$file" - name="$func_basename_result" - test "$opt_mode" = uninstall && odir="$dir" + name=$func_basename_result + test uninstall = "$opt_mode" && odir=$dir # Remember odir for removal later, being careful to avoid duplicates - if test "$opt_mode" = clean; then + if test clean = "$opt_mode"; then case " $rmdirs " in *" $odir "*) ;; *) func_append rmdirs " $odir" ;; @@ -9493,11 +10997,11 @@ elif test -d "$file"; then exit_status=1 continue - elif test "$rmforce" = yes; then + elif $rmforce; then continue fi - rmfiles="$file" + rmfiles=$file case $name in *.la) @@ -9511,7 +11015,7 @@ done test -n "$old_library" && func_append rmfiles " $odir/$old_library" - case "$opt_mode" in + case $opt_mode in clean) case " $library_names " in *" $dlname "*) ;; @@ -9522,12 +11026,12 @@ 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' + func_execute_cmds "$postuninstall_cmds" '$rmforce || 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' + func_execute_cmds "$old_postuninstall_cmds" '$rmforce || exit_status=1' fi # FIXME: should reinstall the best remaining shared library. ;; @@ -9543,21 +11047,19 @@ func_source $dir/$name # Add PIC object to the list of files to remove. - if test -n "$pic_object" && - test "$pic_object" != none; then + if test -n "$pic_object" && test none != "$pic_object"; 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 + if test -n "$non_pic_object" && test none != "$non_pic_object"; then func_append rmfiles " $dir/$non_pic_object" fi fi ;; *) - if test "$opt_mode" = clean ; then + if test clean = "$opt_mode"; then noexename=$name case $file in *.exe) @@ -9584,12 +11086,12 @@ # 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/$name $odir/${name}S.$objext" + if test yes = "$fast_install" && 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" + if test "X$noexename" != "X$name"; then + func_append rmfiles " $odir/lt-$noexename.c" fi fi fi @@ -9598,7 +11100,7 @@ func_show_eval "$RM $rmfiles" 'exit_status=1' done - # Try to remove the ${objdir}s in the directories where we deleted files + # 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" @@ -9608,16 +11110,17 @@ exit $exit_status } -{ test "$opt_mode" = uninstall || test "$opt_mode" = clean; } && - func_mode_uninstall ${1+"$@"} +if test uninstall = "$opt_mode" || test clean = "$opt_mode"; then + func_mode_uninstall ${1+"$@"} +fi test -z "$opt_mode" && { - help="$generic_help" + help=$generic_help func_fatal_help "you must specify a MODE" } test -z "$exec_cmd" && \ - func_fatal_help "invalid operation mode \`$opt_mode'" + func_fatal_help "invalid operation mode '$opt_mode'" if test -n "$exec_cmd"; then eval exec "$exec_cmd" @@ -9628,7 +11131,7 @@ # The TAGs below are defined such that we never get into a situation -# in which we disable both kinds of libraries. Given conflicting +# where 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 @@ -9651,5 +11154,3 @@ # mode:shell-script # sh-indentation:2 # End: -# vi:sw=2 - diff -Nru intel-gpu-tools-1.13/ChangeLog intel-gpu-tools-1.15/ChangeLog --- intel-gpu-tools-1.13/ChangeLog 2015-12-02 16:48:03.000000000 +0000 +++ intel-gpu-tools-1.15/ChangeLog 2016-05-31 17:09:20.000000000 +0000 @@ -1,3 +1,7713 @@ +commit 3ce58b6f9502329d03207a786301d077e7f0cf6c +Author: Marius Vlad +Date: Tue May 31 18:33:24 2016 +0300 + + Updated NEWS, and bumped to 1.15. + + Signed-off-by: Marius Vlad + +commit 7be235c1247a8cf51f55938ef05cb41708924b8f +Author: Tomeu Vizoso +Date: Fri Apr 22 11:08:45 2016 +0200 + + lib: Actually use provided size when creating BO + + When reworking igt_create_fb_with_bo_size to use + igt_create_bo_with_dimensions, we mistakenly stopped acknowledging + non-zero size parameters. + + To fix this, we move the core of the code to create_bo_for_fb and teach + it to use the GEM APIs when a size is passed. + + igt_create_bo_with_dimensions ends up calling just create_bo_for_fb with + a zero size because now the later is more generic than the former. + + Also, create_bo_for_fb now returns the handle of the BO that was + created, as there's no point anymore in having it be a parameter passed + by reference. + + Signed-off-by: Tomeu Vizoso + +commit 303b380d728bc870c399ba46525854d323f894e7 +Author: Matt Roper +Date: Thu May 26 16:02:05 2016 -0700 + + igt_core: Search "." as final fallback for igt_fopen_data() + + Some validation teams seem to run tests out of source directories that + have been nfs mounted or rsync'd to different locations on the target + machine. This causes the igt_srcdir that the tests were built with to + be invalid on the machine the tests get run on. Add the current + directory as a final fallback for data file searches. + + Reference: https://bugs.freedesktop.org/show_bug.cgi?id=92248 + Cc: Humberto Israel Perez Rodriguez + Signed-off-by: Matt Roper + Signed-off-by: Marius Vlad + +commit 04b8f0e025d92b7b8f08a14c22ebe0686b9ba5ea +Author: Chris Wilson +Date: Wed May 25 14:53:34 2016 +0100 + + igt/kms_cursor_legacy: Fixup !fixture + + igt_fixture and its byzantine requirements + + Signed-off-by: Chris Wilson + +commit cce2ff084eeb0e2f95d56b2b1d8b74515c589a9e +Author: Chris Wilson +Date: Wed May 25 08:34:25 2016 +0100 + + igt/kms_cursor_legacy: Stress each CRTC individually as well + + Just to compare handling of plane->mutexes + + Signed-off-by: Chris Wilson + +commit c74e07121085bb9d1957e8e8795a2464e43bd592 +Author: Chris Wilson +Date: Tue May 24 16:24:15 2016 +0100 + + igt/kms_cursor_legacy: Show basic stats of iterations per child + + Signed-off-by: Chris Wilson + +commit dab6b6b62dce6baf041ea5387af197626737c8a2 +Author: Chris Wilson +Date: Tue May 24 16:14:32 2016 +0100 + + igt/kms_cursor_legacy: Add uncontended cursor updates + + Looking at the uncontended cases reveals a major contention cliff. + + Signed-off-by: Chris Wilson + +commit 2da624e28ce7485a1c67e7650355b5273d88d690 +Author: Derek Morton +Date: Tue May 24 15:32:35 2016 +0100 + + tests/Android.mk: Update cairo dependant test list + + drm_read + gem_exec_blt + prime_mmap_kms + Have cairo dependency through igt_kms.c so add to skip_tests_list + to fix android build errors. + + Signed-off-by: Derek Morton + Reviewed-by: Tim Gore + Signed-off-by: Marius Vlad + +commit 9c67adfe88786cb0a1f4fcc4ff11cdaeeaa617cb +Author: Feceoru, Gabriel +Date: Tue May 17 15:05:47 2016 +0300 + + tests: Moved gem_concurrent_blit back to the normal set + + Repairing the damage I caused not reading properly Daniel's comment in: + https://patchwork.freedesktop.org/patch/81600/ + + Leaving gem_concurrent_all only in the EXTRA set + + Cc: Daniel Vetter + Cc: Marius Vlad + Acked-By: Daniel Vetter + Signed-off-by: Gabriel Feceoru + Signed-off-by: Marius Vlad + +commit e4e18ddc59155ba30b2df30cc9dfd18767b03cec +Author: Robert Foss +Date: Fri May 20 18:59:30 2016 -0400 + + tests/gem_render_tiled_blits: Switched to new aliases of intel specific functions. + + Switched from drm_XXX aliases drm_intel_XXX aliases for symbols where that + switch is possible. + + Signed-off-by: Robert Foss + Reviewed-by: Emil Velikov + Signed-off-by: Daniel Vetter + +commit 29f080d5fb942badc8f02d459bc9174a23e9ee7c +Author: Robert Foss +Date: Fri May 20 18:59:29 2016 -0400 + + tests/gem_ppgtt: Switched to new aliases of intel specific functions. + + Switched from drm_XXX aliases drm_intel_XXX aliases for symbols where that + switch is possible. + + Signed-off-by: Robert Foss + Reviewed-by: Emil Velikov + Signed-off-by: Daniel Vetter + +commit bd860da689fbd810d68da3b1bca67f81e9b720b7 +Author: Chris Wilson +Date: Tue May 24 08:31:22 2016 +0100 + + igt/kms_cursor_legacy: Give each child a different CRTC access pattern + + Signed-off-by: Chris Wilson + +commit 9579e5447aa304d0b8d36688b8d0da0c97ca284a +Author: Chris Wilson +Date: Mon May 23 21:56:01 2016 +0100 + + test: Add legacy cursor stress test + + Signed-off-by: Chris Wilson + +commit f68735773c7b6597cf416c89c21e3be38c58f864 +Author: Daniel Vetter +Date: Mon May 23 10:40:24 2016 +0200 + + lib/crc: Update doc for igt_pipe_crc_get_crcs + + Noticed while discussing CRC tests with Ville that this was totally + wrong. + + v2: Ville pointed out that it only does not block when opened using + igt_pipe_crc_new_nonblocking. Still different from + igt_pipe_crc_collect_crc, which will always block. + + v3: Fix type (Ville). + + Cc: Ville Syrjälä + Acked-by: Ville Syrjälä + Signed-off-by: Daniel Vetter + +commit a56cacc924109447b166f495122fd005b3b44b24 +Author: Chris Wilson +Date: Sat May 21 20:58:58 2016 +0100 + + igt/gem_exec_gttfill: qword writes require an extra bit on bdw+ + + Set bit 21 to enable qword writes for Broadwell. + + Signed-off-by: Chris Wilson + +commit 415398a778e60354492d2adad2c3952133f8c6da +Author: Chris Wilson +Date: Fri May 20 22:06:09 2016 +0100 + + lib/gt: Replace hanging instruction + + First try an illegal instruction before the infinite loop to try and + trigger a gpu hang more gracefully as the infinite loop is causing some + older machines issues as the GPU hogs the entire systems and makes the + machine laggy, unresponsive for long periods. + + Signed-off-by: Chris Wilson + +commit a7d58541977f7922b04ecd13159e186d1086c312 +Author: Chris Wilson +Date: Fri May 20 20:56:29 2016 +0100 + + igt/gem_exec_gttfill: Limit to using 4GiB of GTT + + Since we do not use the allow-48b GTT per-object flag, even on + Broadwell+ we will be constrained to 4GiB of usage GTT. + + Also only do a single pass for BAT as suggested by Marius Vlad. + + Signed-off-by: Chris Wilson + +commit 2b4c35efb132168933ba6660fcf556a033b0b17b +Author: Chris Wilson +Date: Fri May 20 11:20:49 2016 +0100 + + igt/gem_exec_whisper: Exclude from BAT + + At its heart gem_exec_whisper is a race detector between submission + between multiple rings and the execution. It is made even more + unreliable by debug kernels making it nigh impossible to submit batches + faster than the GPU can execute. As such, it's relevance for BAT is + dubious. + + Signed-off-by: Chris Wilson + +commit fbf5edb7ec527d807edcf5deb0af17c6d763f08a +Author: Chris Wilson +Date: Fri May 20 11:19:17 2016 +0100 + + igt/gem_sync: Drop individual engines from BAT + + Rely on testing every engine in parallel to detect the most common + synchronisation problems ("missed interrupt syndrome") for BAT. + + Signed-off-by: Chris Wilson + +commit bde2aeea008910bb38361ff92285f0d9df9f1c1e +Author: Chris Wilson +Date: Thu May 19 16:59:37 2016 +0100 + + benchmarks/gem_exec_fault: Reset alignment to 0 + + Oops, because -nightly doesn't handle 64bit alignments correctly, this + was not working quite as expected. + + Signed-off-by: Chris Wilson + +commit 096056594cd6c58151b6bff8625f678e057dd7a8 +Author: Chris Wilson +Date: Thu May 19 16:12:34 2016 +0100 + + igt/gem_exec_gttfill: Exclude the page allocation from the timeout + + Since we want to focus on the issue of running with a full-gtt, and part + of that is in handling the eviction, do a warm-up pass before we start + the clock that allocates the objects and fills the gtt. + + Signed-off-by: Chris Wilson + +commit 99c015af48f55b63df26e3c45bbff4d3c1fcb54b +Author: Chris Wilson +Date: Thu May 19 15:20:38 2016 +0100 + + benchmarks: Add gem_exec_fault + + If we specify an unobtainable alignment (e.g, 63bits) the kernel will + eviction the object from the GTT and fail to rebind it. We can use this, + to measure how long it takes to move objects around in the GTT by + running execbuf followed by the unbind. For small objects, this will be + dominated by the nop execution time, but for larger objects this will be + ratelimited by how fast we can rewrite the PTE. + + Signed-off-by: Chris Wilson + +commit dc8cf567a830e9fc1557693115740cfc52fa8406 +Author: Chris Wilson +Date: Thu May 19 14:32:56 2016 +0100 + + igt/gem_cs_prefetch: Remove from BAT + + With the introduction of gem_exec_gttfill, we have a basic test that + fulfils the role that I was using gem_cs_prefetch for (stressing the + allotment of the full GTT) without the requirement for carefully + checking for a prefetch layout bug. + + Signed-off-by: Chris Wilson + +commit 51fcf03952ee416703c449acb13ec37cec2be00b +Author: Chris Wilson +Date: Thu May 19 12:26:59 2016 +0100 + + tests: Add gem_exec_gttfill + + This is an attempt to emulate the stressful nature of gem_cs_prefetch + without being as slow i.e. without trying to detect the GPU prefetch + issues and just emphasive the basic correctness in handling enough + batches to fill the GTT similar to gem_ringfill aims to fill a ring. + + Signed-off-by: Chris Wilson + +commit 12fd590b5ccf9683e72830b88a6baf87fa27fb68 +Author: Tomeu Vizoso +Date: Thu May 19 10:49:29 2016 +0200 + + build: Skip configure step if is NOCONFIGURE set + + Allow users of autogen.sh to skip the call to configure, which is needed + when building out of tree. + + Signed-off-by: Tomeu Vizoso + +commit 7aee5110f0ac355674cfc07055eb08784314547f +Author: Tomeu Vizoso +Date: Fri May 6 15:36:23 2016 +0200 + + tests/testdisplay: Open DRM device with DRIVER_ANY + + So that this test can be run in drivers other than i915. + + Signed-off-by: Tomeu Vizoso + +commit 99bdf4f0ff3e2000afb4bf71f4a73e4589946050 +Author: Tomeu Vizoso +Date: Fri May 6 15:36:22 2016 +0200 + + tests/testdisplay: Use cairo helpers to draw to plane + + Paint the color key with cairo, so the test doesn't have to map the BO + by itself, which depends on the driver being tested. + + Signed-off-by: Tomeu Vizoso + +commit a1b0ed1dc48ea209b2a3a07a2d24245ad2cd1948 +Author: Chris Wilson +Date: Thu May 19 11:35:14 2016 +0100 + + igt/gem_exec_flush: Exclude -before- subtests from BAT + + The *-before-* tests were designed to detect a potential issue with long + speculative prefetches that would load the map[] before we have even + called execbuf(). As CPUs get smarter and able to look ahead further we + are starting to see failures and as we know the code is deliberately + buggy exclude the tests from BAT. (I want to keep the tests in the full + suite so that we can record which processors are affected, and look for + related issues.) + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=95378 + References: https://bugs.freedesktop.org/show_bug.cgi?id=95488 + Signed-off-by: Chris Wilson + +commit 4dc4ebf3ee5445e0888c6a793961b7840a6d5dd8 +Author: Jani Nikula +Date: Tue May 17 14:41:23 2016 +0300 + + lib/igt_kms: move gtk-doc comments next to the definition + + Now that we have actual functions for kms_test_*_str since + + commit 2d432fc5773df17f04283f4780dab161dd2e1c85 + Author: Jani Nikula + Date: Wed May 11 12:42:06 2016 +0300 + + lib/igt_aux: define actual functions for kmstest_*_str + + move also the gtk-doc comments next to the definitions, for consistency. + + Acked-by: Daniel Vetter + Signed-off-by: Jani Nikula + +commit 5cc3175ca5a0374c17bd201ba5a35ef4ff076003 +Author: Feceoru, Gabriel +Date: Fri May 13 14:45:09 2016 +0300 + + tests/kms_flip: Adjust tolerance when counting frames + + basic-flip-vs-wf_vblank subtest sometimes fails asserting counted frames to + be aproximately equal with the estimated number. + + This is a false negative, one of the reasons being the precision lost when + truncating a fractional number. + + Fixed this by using floating point arithmetic. + + Cc: Jani Nikula + Cc: Daniel Vetter + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=95380 [mvlad] + Signed-off-by: Gabriel Feceoru + Signed-off-by: Marius Vlad + +commit c785a89ee61807d2e8d76847481225e649aa5aec +Author: marius vlad +Date: Mon May 16 13:36:48 2016 +0300 + + autotools/: Allow building tests/gem_concurrent_{all, blit} + + Introduced by a633ad03c6 (tests: Separate tests with lots of subtests). + + v2: Fix commit typo (Jani Nikula). + + Signed-off-by: Marius Vlad + +commit b88bce40a25d2393a51298f0d699e66491975cc9 +Author: Mika Kuoppala +Date: Fri May 13 16:53:57 2016 +0300 + + tests/gem_evict_everything: use uint64_t in subtest params + + Use large enough datatype so that we get the accurate + mem requirements and thus skips on 48bit ppgtt. + + References: https://bugs.freedesktop.org/show_bug.cgi?id=94146 + Acked-by: Chris Wilson + Signed-off-by: Mika Kuoppala + +commit 1dd3ff00148776961b20c6970916181b8482ae41 +Author: Jani Nikula +Date: Thu May 12 15:35:37 2016 +0300 + + tools/intel_bios_reader: print errors to stderr, return EXIT_FAILURE + + Be consistent with exit status and printing errors to stderr. + + Signed-off-by: Jani Nikula + +commit 4daac359fd896ac29007aba2659c34e88dfcbcdd +Author: Jani Nikula +Date: Thu May 12 15:25:13 2016 +0300 + + tools/intel_bios_reader: clean up VBT/BDB header dumping + + Make the output nicer. Do not print the header if a specific block is + requested. + + Signed-off-by: Jani Nikula + +commit f482e234d4f481d1ff886523e77922dcac87dee5 +Author: Jani Nikula +Date: Thu May 12 14:28:50 2016 +0300 + + tools/intel_bios_reader: abstract header information dumping + + Signed-off-by: Jani Nikula + +commit e380239dc838f1e8a2ebcc9ddac556e3842ea195 +Author: Chris Wilson +Date: Fri May 13 10:30:05 2016 +0100 + + igt/gem_reset_stats: Fix pending batch count for bans + + Since 9ba9af2ea4 ("lib: Skip execution in gem_has_ring()"), we no longer + do a double execbuf for each hang, as the gem_require_ring() check now + does a dummy execution that does not contribuee to the pending batch + count. + + Signed-off-by: Chris Wilson + +commit fb6129797ab8fc97a39e89990ccd3d9247ccf313 +Author: Chris Wilson +Date: Fri May 13 09:49:29 2016 +0100 + + igt/gem_exec_flush: Include a bit of information about the test setup + + When reading reports, it is much easier for the test to tell us how it + will be run than try and remember the configuration of a random machine. + + Signed-off-by: Chris Wilson + +commit ec779458b22de6355343b28bd636a1092882c217 +Author: Marius Vlad +Date: Wed May 4 20:35:18 2016 +0300 + + tools/intel_bios_reader: add help + + Signed-off-by: Marius Vlad + Signed-off-by: Jani Nikula + +commit be5864ee1d9765d00a342b34f3e87836d7e509e3 +Author: Jani Nikula +Date: Tue May 3 15:40:13 2016 +0300 + + man: update intel_bios_reader man page + + Signed-off-by: Jani Nikula + +commit b4f96db92d1469f8b41f82557b198c838803e9a1 +Author: Jani Nikula +Date: Tue May 3 12:48:38 2016 +0300 + + tools/intel_bios_reader: free the block returned by find_section + + Since we no longer store pointers to previous blocks, we can free them. + + Signed-off-by: Jani Nikula + +commit 96647f1845a8b17584883395eda209523fbf6088 +Author: Jani Nikula +Date: Tue May 3 12:36:32 2016 +0300 + + tools/intel_bios_reader: add --all-panels option to dump all panels + + Only dump the one matching panel_type by default. Cleans up the output, + and allows the users to get more verbose output if he so chooses. + + Signed-off-by: Jani Nikula + +commit 1c33231d9daf71282ca85d0c66a4d717e3aa0397 +Author: Jani Nikula +Date: Tue May 3 12:26:22 2016 +0300 + + tools/intel_bios_reader: add support for dumping only specific section + + Now that the parsers for blocks don't depend on the dump ordering, we + can also choose to dump specific sections only. + + Signed-off-by: Jani Nikula + +commit b0a8b08b84908350a461ff20a483faf45f348ec3 +Author: Jani Nikula +Date: Tue May 3 12:17:16 2016 +0300 + + tools/intel_bios_reader: add --hexdump option to dump hex, disable by default + + The hex dump is useful, just not by default. + + Signed-off-by: Jani Nikula + +commit eb416de99e6284ae8e6a331a1031a8a1c4f46e24 +Author: Jani Nikula +Date: Tue May 3 12:10:21 2016 +0300 + + tools/intel_bios_reader: dump the blocks in numerical order + + All parsers fetch the information they need without ordering + constraints, so dump all in numerical order. This also makes it + unnecessary to track already dumped blocks. + + Signed-off-by: Jani Nikula + +commit 21467dc5e48ff32892e3f390aaba3f72bc5c532f +Author: Jani Nikula +Date: Tue May 3 12:07:30 2016 +0300 + + tools/intel_bios_reader: let the user specify panel type on the command line + + On some systems the VBT panel type may be overridden in the opregion, + and we can't necessarily get at that. Let the user specify it on the + command line. + + As a byproduct, the section parsing order no longer matters. + + Signed-off-by: Jani Nikula + +commit 17ae0a6d6b7c4aba359875988e2a896cf4943751 +Author: Jani Nikula +Date: Tue May 3 11:52:12 2016 +0300 + + tools/intel_bios_reader: drop dependencies on lvds block parsing + + Don't mandate a specific ordering on the parsing of the blocks. + + Signed-off-by: Jani Nikula + +commit b6ccc55f074241341af5ee025d86d3d05c263180 +Author: Jani Nikula +Date: Thu May 12 14:02:05 2016 +0300 + + tools/intel_bios_reader: move devid to context too + + Signed-off-by: Jani Nikula + +commit 3a81cf510fd0a5ee1b93ea343abc30533833b9d5 +Author: Jani Nikula +Date: Tue May 3 11:44:32 2016 +0300 + + tools/intel_bios_reader: move more globals to struct context + + It's just good hygiene. + + Signed-off-by: Jani Nikula + +commit 76a0462439b4186ceb590b3479eb7a7f6acae995 +Author: Jani Nikula +Date: Mon May 2 18:33:19 2016 +0300 + + tools/intel_bios_reader: pass around a context pointer instead of bdb_header + + Allow putting stuff in there instead of a global. A bit like passing + dev_priv in the kernel. + + Signed-off-by: Jani Nikula + +commit 474e58eb18be6c8f75a526819edf460105ad2e46 +Author: Jani Nikula +Date: Tue May 3 11:31:36 2016 +0300 + + tools/intel_bios_reader: drop silly tv_present variable and printout + + There's no point in dumping a fixed value. + + Signed-off-by: Jani Nikula + +commit c6ccbb5b870e45622a96d6e489100ad9ea2fdab5 +Author: Jani Nikula +Date: Tue May 3 11:30:40 2016 +0300 + + tools/intel_bios_reader: drop unused lvds_support variable + + Signed-off-by: Jani Nikula + +commit 4d4b1c22cfcd841ebb751a1170e6d1f8096b16a0 +Author: Jani Nikula +Date: Mon May 2 18:15:55 2016 +0300 + + tools/intel_bios_reader: add --devid parameter + + Not sure it's a great idea to do platform specific parsing of the BIOS, + but at least make it possible to pass in the devid on the command line + and not just the environment. + + Signed-off-by: Jani Nikula + +commit 8a06cc12382dc999a32198d4fdf37a1e5ba6c436 +Author: Jani Nikula +Date: Tue May 3 11:29:43 2016 +0300 + + tools/intel_bios_reader: add command line option parsing and --file parameter + + Keep positional parameter support for entering filename for backwards + compatibility. + + Signed-off-by: Jani Nikula + +commit 1272b9cd20895533f765ed030fe57282ece6ae48 +Author: Jani Nikula +Date: Tue May 3 11:29:25 2016 +0300 + + tools/intel_bios_reader: make VBIOS non-global + + No need for it to be global. + + Signed-off-by: Jani Nikula + +commit 88648205e3a884e04362a502b1793a2cd3f8ab83 +Author: Daniel Vetter +Date: Wed May 11 17:07:26 2016 +0200 + + lib/igt_aux: Polish docs for igt_timeout + + Add docs, rename parameter and rename the macro to igt_do_timeout to + make it clear it works like a loop. + + v2: Rename instead to igt_until_timeout (Chris). + + Acked-by: Chris Wilson + Signed-off-by: Daniel Vetter + +commit d7050f9f79fee8fb7c790f355c984d9e5141e1c5 +Author: Daniel Vetter +Date: Wed May 11 17:06:28 2016 +0200 + + lib/igt_aux: Polish docs for igt_interruptible + + - Give __ prefix to internal funcstion and structs, only + igt_interruptible is used by tests. + + - Move docs to igt_interruptible and adjust. + + - Explain more clearly how the timeout is getting doubled each + iteration until no more interruptions happen. Also rename the + argument to give it a more meaningful name in the docs. + + - Link from other functions to this one for cross-referencing. + + - Rename to igt_do_interruptible to make it clearer it's a loop, + inspired by do {} while () loops. + + v2: Rename instead to igt_while_interruptible and fix typos (Chris). + And add gtk-doc for igt_ioctl, too. + + Acked-by: Chris Wilson + Signed-off-by: Daniel Vetter + +commit 701d8fdb363443453c4b613e9180f75ad36a7321 +Author: marius vlad +Date: Tue May 10 17:32:15 2016 +0300 + + benchmarks/, overlay/, demos/, tools/, tests/: Add optional Werror. + + v2: Initially added Werror by default. Make it optional so it doesn't + break android build and (potential) distros maintaing the package + (Hinted by Damien Lespiau). + + --enable-werror will enable -Werror compiler flag. + + Signed-off-by: Marius Vlad + Acked-by: Damien Lespiau + +commit 2d432fc5773df17f04283f4780dab161dd2e1c85 +Author: Jani Nikula +Date: Wed May 11 12:42:06 2016 +0300 + + lib/igt_aux: define actual functions for kmstest_*_str + + Macro generated function definitions considered harmful. You can't find + them with code search tools or grep. There may be places where such + things might be useful, but this is not it. + + Define actual functions for kmstest_encoder_type_str(), + kmstest_connector_status_str() and kmstest_connector_type_str(). While + at it, make the arrays static const. + + Signed-off-by: Jani Nikula + Signed-off-by: Marius Vlad + +commit dfe896489c32aab316ae92f54ae251df21a7c411 +Author: Jani Nikula +Date: Wed May 11 12:42:05 2016 +0300 + + lib/igt_aux: update encoder and type names + + Virtual, DSI, DP MST. + + Signed-off-by: Jani Nikula + Signed-off-by: Marius Vlad + +commit c39ab952e5fdd5d921d41d825eeadaf7ec70dd6a +Author: Jani Nikula +Date: Mon May 2 18:21:47 2016 +0300 + + tools/intel_bios_reader: drop unused macros + + Signed-off-by: Jani Nikula + +commit cc247550603173a37ff6f55ee6cbd65e74ff7dc7 +Author: marius vlad +Date: Mon May 9 16:23:11 2016 +0300 + + tests/{gem_ctx_switch, gem_exec_create}: Fix shadow declaration of child variable. + + Signed-off-by: Marius Vlad + Reviewed-by: Chris Wilson + +commit ef8fc998a74b7a858542e87c69334be8d6a527d0 +Author: Marius Vlad +Date: Mon May 9 14:43:20 2016 +0300 + + tests/prime_mmap_kms: Fix white-space. + + Signed-off-by: Marius Vlad + +commit c2a2ab61948252078bdf8c84f272890522961adc +Author: Marius Vlad +Date: Mon May 9 14:37:30 2016 +0300 + + NEWS: Update news. + + Signed-off-by: Marius Vlad + +commit 122f34c3901b40ae1ae8a12c0d482b84a60efc81 +Author: Tiago Vignatti +Date: Fri May 6 16:51:29 2016 -0300 + + prime_mmap_kms: show case dma-buf new API and processes restrictions + + dma-buf new API consists of: + + - mmap(dma_buf_fd, ...): the ability to map a dma-buf file-descriptor of a + graphics buffer to the userspace, and more importantly, to actually write on + the mapped pointer (which was not possible before). It’s worth noting that the + Direct Rendering Manager (DRM) and the hardware driver implementation are + fundamentally important to safely export the graphics handle to be mapped. + + - ioctl(dma_buf_fd, DMA_BUF_IOCTL_SYNC, &args): cache coherency management in + cases where the CPU and GPU devices are being accessed through dma-buf at the + same time. Coherency markers, which forward directly to existing dma-buf + device drivers vfunc hooks, are exposed to the userspace through the + DMA_BUF_IOCTL_SYNC ioctl and have to be used before and after the mapped area + is accessed. This is fundamentally important in hardware architectures where + the graphics engine and the CPU cores don't share caches but also important in + other type of hardware where the memory hierarchy is (most of the time) + coherent. More details can be found in this patch set: + + http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=c11e391da2a8fe973c3c2398452000bed505851e + + v2: use uint32_t for color type, increment the variable and add + --interactive-debug=paint + v3: use igt_display_commit() to mode set the crtc so the rectangle is shown + painted; also added Testcase description on the beginning of the file. + v4: remove crtc actually which seems superfluous; add a igt_skip_on in case + support for dma-buf mmap is nonexistent. + + Signed-off-by: Tiago Vignatti + Signed-off-by: Marius Vlad + +commit f942e42815ad81901dbccd984d0f8a4775826be7 +Author: Chris Wilson +Date: Sun May 8 20:58:26 2016 +0100 + + benchmarks/gem_latency: Revert to unsafe mmio access on gen7 + + In theory, we need to only worry about concurrent mmio writes to the + same cacheline. So far, disabling the spinlock hasn't hung the machine. + + Signed-off-by: Chris Wilson + +commit 049150307889a1870cf961e18b964ffa70ae1b59 +Author: Chris Wilson +Date: Sun May 8 14:42:10 2016 +0100 + + benchmarks/gem_blt: Add forked variants + + Signed-off-by: Chris Wilson + +commit 76f3b3103710a912e691cb56745a38a869dd2fa5 +Author: Chris Wilson +Date: Sun May 8 14:42:10 2016 +0100 + + benchmarks/gem_exec_nop: Add forked variants + + Signed-off-by: Chris Wilson + +commit 0a67950a73d4c9180d7c55b66d4cfc0f1a96e42e +Author: Chris Wilson +Date: Sun May 8 14:35:08 2016 +0100 + + benchmarks/gem_create: Report combined concurrent allocation rate + + Signed-off-by: Chris Wilson + +commit 8ceab4f2166e6510df1614c360cb1828cbb4c160 +Author: Chris Wilson +Date: Thu May 5 14:53:12 2016 +0100 + + igt/gem_exec_parse: Simple exercise for MI_LOAD_REGISTER_REG + + Command parser version 7 introduces the ability to copy between + regsiters from the Haswell RCS with MI_LOAD_REGISTER_REG. This provides + a quick smoketest of that ability. + + v2: Add some negative tests as well + + Signed-off-by: Chris Wilson + +commit 6ec897c6102a20b93ec8c8e5245d3bf61dde511e +Author: Chris Wilson +Date: Sat May 7 21:26:56 2016 +0100 + + benchmarks: Add some contention tests for object/context creation + + Signed-off-by: Chris Wilson + +commit 4b0f3bfc2edd4228ec469327ab9fe53e8b9722e9 +Author: Chris Wilson +Date: Sat May 7 21:06:50 2016 +0100 + + igt: Add a few more forked variants of basic tests + + Check contention for context and object creation. + + Signed-off-by: Chris Wilson + +commit b1083e59bd90b212d85d8fc34f5715c10cefe88e +Author: Tomeu Vizoso +Date: Fri Apr 15 14:58:26 2016 +0200 + + tests/kms_addfb_basic: Move tiling tests into their own groups + + So those subtests that require tiling don't cause unrelated subtests to + be skipped. + + Signed-off-by: Tomeu Vizoso + +commit aa2867249da1d54fd8d28c899db1f20d1a670b79 +Author: Chris Wilson +Date: Fri May 6 11:53:07 2016 +0100 + + igt/gem_exec_flush: Add some commentary about clflush testing + + Signed-off-by: Chris Wilson + +commit a10ef457ca778e1a560bc7635c0d1726ed191e6d +Author: Chris Wilson +Date: Fri May 6 11:41:06 2016 +0100 + + igt/gem_exec_flush: Flush before each use + + After we inspect map[i], we must flush again before checking map[i] for + the xor pass. + + Signed-off-by: Chris Wilson + +commit 2c3144aaee6547c70720b80b7f00c0be8bb7c214 +Author: Chris Wilson +Date: Fri May 6 10:46:50 2016 +0100 + + igt/gem_exec_flush: Add a WC mmapping of the target buffer + + Signed-off-by: Chris Wilson + +commit 93ab767511cb7a82fded43f2ee181dd9cf6d588c +Author: Chris Wilson +Date: Fri May 6 10:42:28 2016 +0100 + + igt/gem_exec_flush: Test cacheline invalidation before execbuf + + Signed-off-by: Chris Wilson + +commit 5f7835c878735ee78df680d46a66a70eecd90210 +Author: Chris Wilson +Date: Fri May 6 09:06:49 2016 +0100 + + igt/gem_exec_flush: Restrict BAT batch testing + + Only do one mode of batch writing for BAT, and hope that is sufficient + to route out all the coherency problems when doing the cmdparser and + when not. We still have the full set for non-BAT, just less of a + smokescreen. + + Signed-off-by: Chris Wilson + +commit b4b2ac346c92fcfad9bc33ff6cc27849ce6240bc +Author: Chris Wilson +Date: Wed May 4 16:43:59 2016 +0100 + + igt/gem_exec_flush: Halve the number of BAT tests, but double their runtime + + On the CI machines, the coherency tests are flip-flopping on byt/bsw. + Undesirable as they should always fail (until we have a good w/a). + + Signed-off-by: Chris Wilson + +commit a263a043ecd53a1c15848c51a7b3232878391130 +Author: Chris Wilson +Date: Wed May 4 13:51:58 2016 +0100 + + igt/gem_exec_flush: Also check flushing before the cmdparser + + Signed-off-by: Chris Wilson + +commit 8adb5a07f2a3c7eadd9704b83692f72070ef946c +Author: Feceoru, Gabriel +Date: Fri Feb 26 14:59:03 2016 +0200 + + tests/kms_plane: Skip the test when configuration couldn't be applied + + This could happen when the selected pipe cannot be used with the connected + port due do HW constrains. + + v2: Apply review comment (Marius) + + bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=86763 + Signed-off-by: Gabriel Feceoru + Signed-off-by: Marius Vlad + +commit 26bec97c21bbff761231e350dfea47f1a02e2e99 +Author: Feceoru, Gabriel +Date: Fri Feb 26 13:21:15 2016 +0200 + + lib/igt_kms: Add fail exit branch in do_display_commit() + + On Cherryview PIPE_C can only be connected to PORT_D (bspec). + The driver properly reports the crtc_mask for the encoder, however the + mismatch between pipe and port is not reported back to the test. + + Add support for detecting this case so the test can be skipped. + + v2: Apply review comments (Marius) + + Signed-off-by: Gabriel Feceoru + Signed-off-by: Marius Vlad + +commit 11a2b0dc8a7bc6224ec3ca34d2f617de8e54b652 +Author: Feceoru, Gabriel +Date: Fri Feb 19 14:34:51 2016 +0200 + + tests/kms_plane: Skip on no connected outputs + + When no display is connected all kms_plane subtests pass although + no testing is done. + + Change it by reporting the subtests as skipped. + + Signed-off-by: Gabriel Feceoru + Signed-off-by: Marius Vlad + +commit 786d584624556103e784c021d103db1f8232bd35 +Author: Jani Nikula +Date: Tue May 3 17:34:05 2016 +0300 + + man: add .gitignore with defs.rst + + Signed-off-by: Jani Nikula + +commit 6102e2eca949b6827def000407224f3c30a37204 +Author: Chris Wilson +Date: Tue May 3 21:12:12 2016 +0100 + + igt/gem_exec_flush: Give even batch write a unique value + + One property lost in the expansion for various coherency checks was + ensuring that every time we overwrote the batch it had a unique value + (to ensure that the GPU was seeing the latest value). + + Signed-off-by: Chris Wilson + +commit 7b7503fb6ccbe7fd05f712c3e286b42c30b084d7 +Author: Chris Wilson +Date: Tue May 3 17:03:49 2016 +0100 + + igt/gem_exec_flush: Stress a few more synchronisation paths for execbuf + + Look at handling of multiple batches within the buffer and avoiding as + much synchronisation as possible. + + Signed-off-by: Chris Wilson + +commit ec83ef916779d837efb29d8978cfbb8b690c6ce1 +Author: Robert Foss +Date: Tue May 3 10:40:22 2016 -0400 + + kms_panel_fitting: Enable connectors with "scaling mode" property set. + + Enable testing on all connectors that have the "scaling mode" + property set. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93012 + Signed-off-by: Robert Foss + Reviewed-by: Daniel Vetter + Signed-off-by: Marius Vlad + +commit 2254aff17eca95ab570947701c79690965705f60 +Author: Robert Foss +Date: Tue May 3 10:40:21 2016 -0400 + + kms_panel_fitting: Enabled test on non-Intel hardware. + + Switched from DRIVER_INTEL to DRIVER_ANY to enable test + on all hardware. + + Signed-off-by: Robert Foss + Reviewed-by: Tomeu Vizoso + Signed-off-by: Marius Vlad + +commit 0fee72d8100ebdf4907d8c36c95f6d03273def56 +Author: Robert Foss +Date: Tue May 3 10:40:20 2016 -0400 + + kms_panel_fitting: Switched DRM format to a hardware agnostic alternative. + + Changed the DRM format to LOCAL_DRM_FORMAT_MOD_NONE since it + is hardware agnostic. + + Also fixed formatting/tabs. + + Signed-off-by: Robert Foss + Reviewed-by: Tomeu Vizoso + Signed-off-by: Marius Vlad + +commit a9c0943fa2009721cf368977bd7c7c74e29b3b08 +Author: Robert Foss +Date: Tue May 3 10:40:19 2016 -0400 + + kms_panel_fitting: Remove un-used variable. + + ref_crc is never assigned or read, and can be safely + removed. + + Signed-off-by: Robert Foss + Reviewed-by: Tomeu Vizoso + Signed-off-by: Marius Vlad + +commit e2e56a903970b672a9fde7c1b4e044a5950daefd +Author: Robert Foss +Date: Tue May 3 10:40:18 2016 -0400 + + kms_panel_fitting: Remove un-read variable pipe_crc. + + pipe_crc in data_t is assigned an allocated memory space and + then later free'd. But it is never used for any comparisons. + It should therefore be safe to remove pipe_crc and the crc + requirement. + + Signed-off-by: Robert Foss + Reviewed-by: Tomeu Vizoso + Signed-off-by: Marius Vlad + +commit 761ac544e7fd3f708b04a7b7853416716753c101 +Author: Robert Foss +Date: Tue May 3 10:40:17 2016 -0400 + + kms_panel_fitting: Remove un-read variable. + + Remove devid from data_t since it is never read. + Also remove one assignment to devid. + + Signed-off-by: Robert Foss + Reviewed-by: Tomeu Vizoso + Signed-off-by: Marius Vlad + +commit 26afcfc002c369f6dd5e3dfa95f10b29396fd1a8 +Author: Robert Foss +Date: Tue May 3 10:40:16 2016 -0400 + + kms_panel_fitting: skips if there's a non-eDP display connected. Fix it. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93012 + Signed-off-by: Jani Nikula + Signed-off-by: Marius Vlad + +commit a1e38c52c618b6c08ccce78d3ca315c62000096f +Author: Jani Nikula +Date: Fri Apr 22 13:00:01 2016 +0300 + + tests/kms_sink_crc_basic: clean up assert_color and provide more details + + We can simply sscanf the crc in one go. Also split up the igt asserts to + get better details about what went wrong. + + Signed-off-by: Jani Nikula + +commit 18170d211c10595eef850138fce598fec2a89a17 +Author: Jani Nikula +Date: Wed Nov 18 12:52:40 2015 +0200 + + tests: limit pm_backlight actual brightness tolerance between 0 and max + + Signed-off-by: Jani Nikula + +commit 7afd94ed62176961ea8a90f8b07c276b5afaf2d8 +Author: Jani Nikula +Date: Wed Nov 18 12:28:06 2015 +0200 + + tests: add context param to pm_backlight tests + + We'll be adding more context for the subtests than just the max + brightness. + + Signed-off-by: Jani Nikula + +commit 77a76ba09acc1cf2e6fa16b9038460ecac81404d +Author: Jani Nikula +Date: Wed Nov 18 12:46:53 2015 +0200 + + tests: use igt_assert_lte to verify pm_backlight test results + + Gives out better diagnostics than just igt_asssert. + + Signed-off-by: Jani Nikula + +commit f201495575a36b2c2202a45c34dd304cb40d7d3f +Author: Chris Wilson +Date: Tue May 3 11:04:00 2016 +0100 + + lib: compute exitcode first + + Before we print the exitcode to the debug/kmsg logs, we should inspect + what its final value will be. For example, in the case of running + multiple subtests which all happen to be skipped, igt_exitcode is 0, but + the final exit code will be 77. + + Signed-off-by: Chris Wilson + Cc: Tvrtko Ursulin + Tested-by: Tvrtko Ursulin + +commit 9f2621e1b5301f33c676a99c52879d3c6984b524 +Author: Chris Wilson +Date: Tue May 3 09:10:52 2016 +0100 + + igt/gem_exec_flush: Test continuously rewriting the batch + + Signed-off-by: Chris Wilson + +commit d654aa0d091c0d7ccb7c8b13d00460ad6ce99714 +Author: Chris Wilson +Date: Tue May 3 08:37:54 2016 +0100 + + igt/gem_ringfill: Avoid CPU -> GTT -> CPU transition + + Avoid the second pair of full clflushes when setting up the batch. + + Signed-off-by: Chris Wilson + +commit 3edaa1d347e5c91058a5dfab821e57beb5217ccc +Author: Jani Nikula +Date: Fri Apr 29 17:55:29 2016 +0300 + + tools/intel_reg_decode: drop confusing use of IS_965() + + Unlike in the kernel driver coding style, IS_965() matches the platform + and all subsequent ones. Replace IS_965() with suitable but less + confusing alternatives. + + Most occurences are on code paths that only get called for gens 2, 3 and + 4, so replace those with IS_GEN4(). In the one other call site just flip + the condition to check for gens 2 and 3 instead. + + Signed-off-by: Jani Nikula + +commit c038518438e85f5f91a8608b062f8353d9b6dede +Author: Jani Nikula +Date: Fri Apr 29 17:43:58 2016 +0300 + + lib/intel_chipset: drop unused IS_9XX() + + It's also confusing as the style differs from the kernel (exact platform + in the kernel vs. the platform and any later ones in igt). + + Signed-off-by: Jani Nikula + +commit e279954f1eb2c5cf9234ebbc3c1de201013ca422 +Author: Rodrigo Vivi +Date: Mon Apr 25 14:21:22 2016 -0700 + + tools: Add missing Kabylake codename strings. + + No functional change and no change in the current format. + Just introducing the missing Kabylake name strings. + + v2: Duh! forgot the ")"... + + Signed-off-by: Rodrigo Vivi + +commit d9025d3298d8cb647b754e7f5d5e95e3dca67244 +Author: Chris Wilson +Date: Mon May 2 18:55:24 2016 +0100 + + igt/gem_exec_flush: Match gem_set_domain to pointer access + + When using the kernel set-domain cache management, we need to set the + domain as appropriate for our pointer access. In this case we access the + buffer through a CPU mmap, and so we must request access via the CPU + domain. + + Signed-off-by: Chris Wilson + +commit 22e6157d383c5fe1115ed05aab3909c77feb8856 +Author: Chris Wilson +Date: Mon May 2 16:08:46 2016 +0100 + + igt/gem_exec_flush: Immediately repeat the same cacheline + + When looking at a pair of GPU writes, where we want to make sure that + the clean cacheline is invalidated automatically, we want to reuse that + cacheline whilst we know it remains valid (i.e. repeat the test using a + new value to the same location). + + Signed-off-by: Chris Wilson + +commit cf07aa2fc6a50b2fd2ff8bd2d0953818bee33690 +Author: Chris Wilson +Date: Mon May 2 15:35:56 2016 +0100 + + lib: Fixup u64 multiply for computing nanoseconds + + 32bit builds ran into a silly multiplication issue when computing + elapsed nanoseconds of more than 2s... + + Signed-off-by: Chris Wilson + +commit 6862b33d50f771538f439691c1f9c10e7bc01630 +Author: Chris Wilson +Date: Mon May 2 14:49:17 2016 +0100 + + igt/gem_exec_flush: Move assertions out of interruptible loops + + Since the value in the bo may be altered by the test, we only want to + repeat phases of the test to avoid breaking the test itself. + + Signed-off-by: Chris Wilson + +commit 47825918733b3761f640ec9e1b8743da0932de9f +Author: Chris Wilson +Date: Mon May 2 14:42:54 2016 +0100 + + lib: Tweak calibration of initial settimer delay + + If we assume that the first settimer and clock_gettime() itself have + appreciable overhead, try to exclude those from the calibration delay. + + Signed-off-by: Chris Wilson + +commit 92a95888410d0d0c4be2bdc74f30367e07207cfd +Author: Ville Syrjälä +Date: Mon Apr 25 23:21:34 2016 +0300 + + tools/intel_watermark: Dump linetime watermarks on hsw/bdw + + Signed-off-by: Ville Syrjälä + +commit 7c70d2fca25e5630b2fa2fb25da5dc953ce3c6e1 +Author: Chris Wilson +Date: Mon May 2 13:22:45 2016 +0100 + + igt/gem_exec_flush: Mark mmap-wc dependency + + Add a requirement for mmap-wc so that failure on older kernels is explained. + + Signed-off-by: Chris Wilson + +commit 5715089c5139221cb6a0bfda2352cf8e5c416b32 +Author: Chris Wilson +Date: Mon May 2 09:20:00 2016 +0100 + + benchmarks/gem_latency: Report throughput + + Signed-off-by: Chris Wilson + +commit 691b76a84bd0f49130ae80e85b5b7553a2e1d9ba +Author: Chris Wilson +Date: Mon May 2 09:15:23 2016 +0100 + + igt/gem_exec_flush: Use a cacheline stride + + Look at different cachelines on each pass, otherwise each group of 16 + flush the same cachline. + + Signed-off-by: Chris Wilson + +commit 805a05caaeb529732cbc01b2f3a9b6fc6e7cb3da +Author: Chris Wilson +Date: Mon May 2 09:01:48 2016 +0100 + + igt/gem_exec_flush: Add interruptible testing + + Signed-off-by: Chris Wilson + +commit 16c9edb464bdf076ab9ae4219c02106d326855d4 +Author: Chris Wilson +Date: Mon May 2 08:57:29 2016 +0100 + + igt/gem_exec_flush: Add basic set-domain checks + + Signed-off-by: Chris Wilson + +commit f3532cab978ec715cce8eeb8c4e355dbcf53a374 +Author: Chris Wilson +Date: Sun May 1 21:45:00 2016 +0100 + + igt/gem_exec_flush: For good measure, check pread/pwrite + + As a point of comparison, test the pread/pwrite interface as well. + + Signed-off-by: Chris Wilson + +commit 7d08913aeb80cc609678e6b73a836af9f1aa0da2 +Author: Chris Wilson +Date: Sun May 1 16:39:14 2016 +0100 + + lib: Enable clflush for 32bit x86 builds + + Signed-off-by: Chris Wilson + +commit 89f354e0a5008f7a51a785c52c1d25a32b052c26 +Author: Chris Wilson +Date: Sun May 1 15:34:56 2016 +0100 + + igt/gem_exec_flush: Use subtest groups to tidy requirement checking + + We can make the requirement testing and reporting tidier by using + igt_subtest_group. + + Signed-off-by: Chris Wilson + +commit a0d6645d45a282834c0d169a44e8a68d8fe37b17 +Author: Chris Wilson +Date: Sun May 1 15:14:37 2016 +0100 + + igt/gem_exec_flush: Add a read-only variation + + Alternate between two values written by the GPU so that we can look for + stale cachelines without having to overwrite the value with the CPU. + + Signed-off-by: Chris Wilson + +commit b4817052080fdc85e2376a5d63dafd8238e95d67 +Author: Chris Wilson +Date: Sun May 1 09:07:29 2016 +0100 + + lib: Apply magic clflush serialisation + + On Baytrail, Braswell and Atoms beyond we see an issue where the mfence + is insufficient to force the cacheline to be coherent (i.e. such that + writes from the GPU are visible by the CPU after the call to clflush). A + second clflush is ordered with an earlier clflush to the same address + and this appears sufficient to give the coherency required for GPU/CPU + interop. + + Testcase: igt/gem_exec_flush + Signed-off-by: Chris Wilson + Cc: Akash Goel + +commit ef3f61a6d304c5bcec1ea892f292a0cf2c9062cc +Author: Chris Wilson +Date: Fri Apr 29 20:00:25 2016 +0100 + + tests: Add gem_exec_flush + + A basic check that the execbuf flushes writes from the batch and that + they are coherent afterwards. + + Signed-off-by: Chris Wilson + +commit 1aebeeb440b2c418ff8c3e057e57826647a152b7 +Author: Tvrtko Ursulin +Date: Wed Apr 27 15:58:24 2016 +0100 + + igt_kms: Fix use after free in kmstest_get_pipe_from_crtc_id + + Signed-off-by: Tvrtko Ursulin + +commit 79f804e8d89937b16247f6a6b30657e70a9ff722 +Author: Chris Wilson +Date: Wed Apr 27 17:59:40 2016 +0100 + + benchmark/gem_latency: sync startup correctly + + When waiting for the producers to start, use the cond/mutex of the + Nth producer and not always the first. + + Spotted-by: "Goel, Akash" + Signed-off-by: Chris Wilson + +commit 4a62f0b43f12c68d86e77fd0529c0f18e6a78ba1 +Author: Chris Wilson +Date: Wed Apr 27 17:58:15 2016 +0100 + + igt: Add gem_exec_parallel + + Attempt to fill buffers using many clients working in parallel. + + Signed-off-by: Chris Wilson + +commit abc8aa40dec9c875f4eb65d7cdd842940224e9e4 +Author: marius vlad +Date: Tue Apr 26 17:30:59 2016 +0300 + + tests/gem_close_race: Add igt_fixture block for igt_stop_hang_detector. + + igt_fork_hang_detector() was called from a igt_fixture block, while its + counterpart (igt_stop_hang_detector) was called normally, causing + SIGTERM to be sent when running under check target. + + Signed-off-by: Marius Vlad + Reviewed-by: Daniel Vetter + Signed-off-by: Marius Vlad + +commit 102943d1bab55e789ffc14f84cdc2567e5916c8c +Author: Chris Wilson +Date: Mon Apr 25 18:35:49 2016 +0100 + + igt/gem_busy: Avoid BSD emission on gen6 + + Remember to skip using BSD on gen6, unless you want to kill the machine. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=95134 + Signed-off-by: Chris Wilson + +commit 81864b55b0d3023711a090e75c68e4ea4a185ba2 +Author: Robert Foss +Date: Wed Apr 20 12:25:52 2016 -0400 + + core_getversion: Only verify major version for i915. + + This change mirrors the change in drm made by krh@redhat.com + on "Mon Apr 6 17:18:17 2009" on the drm branch intel_on_all_hw. + + The assert(major < 1) is only needed for the legacy intel driver. + + Signed-off-by: Robert Foss + Signed-off-by: Tomeu Vizoso + Reviewed-by: Daniel Stone + Acked-by: Daniel Vetter + +commit 4aeed6e8295cd4961ecc47d44334943ad08d73af +Author: Robert Foss +Date: Wed Apr 20 12:25:51 2016 -0400 + + core_getversion: Switched from igt_assert to assert helpers. + + Switched to assert helpers to enable better error output. + + Signed-off-by: Robert Foss + [tomeu: fix test of major version to be lte] + Signed-off-by: Tomeu Vizoso + Reviewed-by: Daniel Stone + Acked-by: Daniel Vetter + +commit 8753f7769202607ecfd3d2705728ab7665e62864 +Author: marius vlad +Date: Mon Apr 25 15:25:00 2016 +0300 + + tests/gem_busy: Fix passing invalid fd for basic-parallel-* tests. + + Caught by check target. + + Signed-off-by: Marius Vlad + Reviewed-by: Chris Wilson + Signed-off-by: Marius Vlad + +commit b7135575e7dfb7b610afeb08ac2b70f50d28c79e +Author: Tomeu Vizoso +Date: Mon Apr 18 09:53:47 2016 +0200 + + tests/kms_flip_event_leak: Open DRM device with DRIVER_ANY + + So that this test can be run in drivers other than i915. + + Signed-off-by: Tomeu Vizoso + Series-version: 1 + Series-to: intel-gfx + Series-cc: padovan, daniels, marcheu, seanpaul, xexaxo, fedkem, mvlad, danvet + Series-prefix: i-g-t + Cover-letter: + Make more tests generic + Hi, + + these patches allow a few more tests to run on drivers other than i915, + mainly by removing the last usage of + DRM_IOCTL_I915_GET_PIPE_FROM_CRTC_ID and removing superfluous dependencies + on bufmgr and tiled BOs. + + Thanks, + + Tomeu + END + +commit 0b741cec0ebfb4b772768aeb2f711b1eb34397a8 +Author: Tomeu Vizoso +Date: Mon Apr 18 09:53:27 2016 +0200 + + tests/kms_flip_event_leak: Use non-tiled formats + + As the test doesn't actually need tiled BOs, drop the tiled formats so + the test can run on drivers other than i915. + + Signed-off-by: Tomeu Vizoso + +commit 857b8b47d1ca2745ae0856548f5521463175b132 +Author: Tomeu Vizoso +Date: Thu Apr 14 10:39:23 2016 +0200 + + tests/kms_flip: Open DRM device with DRIVER_ANY + + So that this test can be run in drivers other than i915. + + Signed-off-by: Tomeu Vizoso + +commit 52a5518c3eda09e50277e4f731e0383923dddbb1 +Author: Tomeu Vizoso +Date: Thu Apr 14 10:38:23 2016 +0200 + + tests/kms_flip: Move bufmgr requirement into subtests + + Because bufmgr is currently a i915-only thing and it's only needed in a + subset of the subtests, require it only in the subtests that actually + need it so that the other subtests aren't skipped without a reason. + + Signed-off-by: Tomeu Vizoso + +commit 39eb7043e63bb30e5e3c375a4577103c88235d2f +Author: Tomeu Vizoso +Date: Fri Mar 25 10:58:42 2016 +0100 + + tests/kms_flip: Create tiled BOs only when needed + + Because attempts to create a tiled BO will cause a igt_require call to + fail on drivers that don't support tiling, do so in the subtest that + actually needs it so that other subtests aren't skipped without reason. + + Signed-off-by: Tomeu Vizoso + +commit 331585573cf0c2a061ad5527b2226f448815e093 +Author: Tomeu Vizoso +Date: Wed Mar 23 11:53:46 2016 +0100 + + tests/kms_render: Move dependency on i915 into subtest + + Batchbuffers are only needed in the subtest that does the blit on the + GPU, so move that dependency into it so the other subtest can be ran on + !i915. + + Signed-off-by: Tomeu Vizoso + +commit a8be527172022d3a12196505ee6a78bee852da94 +Author: Tomeu Vizoso +Date: Fri Feb 26 09:55:48 2016 +0100 + + tests/drm_read: Drop DRM_IOCTL_I915_GET_PIPE_FROM_CRTC_ID + + So the test runs on other drivers, drop the usage of the i915-specific + DRM_IOCTL_I915_GET_PIPE_FROM_CRTC_ID ioctl. + + Wait for a vblank event on pipe0 and if we get it, then the test can + proceed (code copied from kms_vblank). + + Signed-off-by: Tomeu Vizoso + +commit 90a7e3bae5987d1b5fb7fe4d5413bde2b9755bca +Author: marius vlad +Date: Wed Apr 20 20:49:56 2016 +0300 + + lib/igt_aux: Half the timeout for suspend to RAM and a third for suspend to disk. + + Signed-off-by: Marius Vlad + +commit 660147488e3391c1b0c887ee199860fc2a2ca8af +Author: Tvrtko Ursulin +Date: Fri Apr 22 16:16:15 2016 +0100 + + kms_flip: Shorten basic tests a bit + + Seems like an overkill for a basic test to keep flipping for + a full minute. Dial it down a bit. + + Signed-off-by: Tvrtko Ursulin + Signed-off-by: Marius Vlad + +commit 14f7959038c6a79a3a409c420f33d00902497daa +Author: Chris Wilson +Date: Mon Apr 25 10:56:37 2016 +0100 + + igt/gem_close_race: Restore threads test to BAT status + + Let's try it again because it would have caught a bug in a patch I sent + to the ml... + + References: https://bugs.freedesktop.org/show_bug.cgi?id=95048 + Signed-off-by: Chris Wilson + +commit 13cfccd665703a4ca830fe33ea1152cdecf71331 +Author: Chris Wilson +Date: Mon Apr 25 09:16:20 2016 +0100 + + igt/gem_busy: Test parallel execution + + Parallel but not concurrent! + + Signed-off-by: Chris Wilson + +commit 1e9a3acfd4cf6fd5b17505c79fd72fda19a5c356 +Author: Chris Wilson +Date: Fri Apr 22 19:08:10 2016 +0100 + + igt/gem_busy: Discard the indirect batchbuffers + + The stack of batchbuffers is myth. In general there are only 2 levels of + stack for HEAD (ringbuffer, batchbuffer) and chaining up the batch + buffer just updates the lowest level of the stack. A BATCH_BUFFER_END at + any depth then returns to the ring. + + So be creative and modify the batch buffer on the fly... + + Signed-off-by: Chris Wilson + +commit 71f41532873b026d26ef458b5fd5a31a1862e0fc +Author: Chris Wilson +Date: Fri Apr 22 16:55:29 2016 +0100 + + igt/gem_exec_nop: Apply missed interrupt detection + + Signed-off-by: Chris Wilson + +commit 2f859537b59907a3e0a082c1cb6f6dfb8e99b616 +Author: Chris Wilson +Date: Fri Apr 22 16:37:35 2016 +0100 + + igt/gem_close_race: Import the scratch + + Rather than create a new scratch buffer every pass, import the original + as this provides stress upon less commonly trod paths (i.e. handling + objects with many vma) as well as many objects in general. + + Signed-off-by: Chris Wilson + +commit 757b9be460e06c8466f6c49ab7f0d7ff234b5b54 +Author: Chris Wilson +Date: Fri Apr 22 16:02:12 2016 +0100 + + igt/gem_close_race: Avoid using threads, use signals instead + + Emulate the behaviour of the second thread killing fd at random by + having a signal fire at a random time instead. Only one thread and so we + do not have the issue of accessing another valid handle on another fd + and so executing a blank buffer - triggering GPU hangs. + + References: https://bugs.freedesktop.org/show_bug.cgi?id=95048 + Signed-off-by: Chris Wilson + +commit d9dca5f12a3f4f88f30f2134cc13376f56549912 +Author: Daniel Vetter +Date: Thu Apr 21 17:48:53 2016 +0200 + + lib/igt_kms: Move IGT_MAX_PLANES into the igt_plane enum + + Makes sure we automatically extend that when adding more planes. + Inspired by a patch from Robert Foss who extended the max, but forgot + all about the enum. + + While at it, also fix up the whitespace damage. + + Cc: robert.foss@collabora.com + Acked-by: robert.foss@collabora.com + Signed-off-by: Daniel Vetter + +commit ea7dac11b736df2292fdaf112d157937546adf5f +Author: Chris Wilson +Date: Fri Apr 22 08:25:04 2016 +0100 + + scripts: Add a simple trybot driver + + Basic script that may prove useful to others to send a pile of patches + to intel-gfx-trybot@ + + Signed-off-by: Chris Wilson + +commit de4f3ab4187dc24a6b379418ff44d84e65fe9cb2 +Author: Marius Vlad +Date: Thu Apr 21 20:46:27 2016 +0300 + + tests/gem_close_race: Remove basic-threads from BAT. + + Currently this test causes some machines to hang and segfaults on others. + Rename it for now until we figure out the root cause. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=95048 + Acked-by: Chris Wilson + Signed-off-by: Marius Vlad + +commit 27372851c8cdec29b198bc9ec8e21f83cd1ec083 +Author: Ville Syrjälä +Date: Wed Apr 20 21:10:58 2016 +0300 + + lib: Pass format instead of bpp to create_bo_for_fb() + + create_bo_for_fb() expects the drm format as a parameter since + commit 8a1a38661f56 ("lib: Add igt_create_bo_with_dimensions") + but not all callers were updated. Fix that up. + + Cc: Tomeu Vizoso + Fixes: 8a1a38661f56 ("lib: Add igt_create_bo_with_dimensions") + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93328 + Signed-off-by: Ville Syrjälä + Reviewed-by: Tomeu Vizoso + +commit f650aa2dd640a4a8941bae90fbd85c83da5fbb1c +Author: Chris Wilson +Date: Wed Apr 20 18:35:37 2016 +0100 + + igt/gem_close_race: Batify + + Signed-off-by: Chris Wilson + +commit ed6fb66a50b35efc7e879deb23742d3da31b81be +Author: Marius Vlad +Date: Wed Apr 20 20:03:53 2016 +0300 + + NEWS: COMMIT_ATOMIC landed a while ago and a test that makes use of it. + + Signed-off-by: Marius Vlad + +commit 8b8d7aaffd35be7f4f81623165f26c21b83dfa54 +Author: pvishwak +Date: Mon Apr 11 11:24:56 2016 +0530 + + tests/kms_rotation_crc: Adding rotation tests using COMMIT_ATOMIC path + + Modified kms_rotation_crc to follow COMMIT_ATOMIC path if ATOMIC support is + available from driver. If ATOMIC support is not present, tests + will follow COMMIT_UNIVERSAL path. + + v2: (Marius) + Updated commit message + https://patchwork.freedesktop.org/patch/76040/ + + v3: (Marius) + Added description in commit message + https://patchwork.freedesktop.org/patch/79492/ + + Signed-off-by: Pratik Vishwakarma + [mcvlad: Re-worked a little comment description] + Signed-off-by: Marius Vlad + +commit a256df9dc6337fb8f10df5e1033ac36352c1f6a7 +Author: Robert Foss +Date: Wed Apr 20 10:11:04 2016 -0400 + + kms_atomic: Fix crtc_id comparison failing. + + Fixed ctrc_id comparison failing due to bad initialization of + crtc variable. + + Signed-off-by: Robert Foss + Signed-off-by: Marius Vlad + +commit 213b073aad4d4a2e87697e11b98add1efee4408c +Author: Marius Vlad +Date: Wed Apr 20 18:41:24 2016 +0300 + + NEWS: Updated info about tests/tests-list.txt. + + Signed-off-by: Marius Vlad + +commit a633ad03c6a0e96eecfd4933ea0dffb68ed40e07 +Author: Feceoru, Gabriel +Date: Wed Apr 20 17:21:58 2016 +0300 + + tests: Separate tests with lots of subtests + + Currently, when trying to run i-g-t tests with piglit, it takes up + to 20s until the first test is executed. + The main reason is that gem_concurrent_all has ~500k subtests, + overkilling piglit. + + This patch separates gem_concurrent_* tests from the rest of the tests, + creating two files test-list.txt and test-list-full.txt. + The piglit can now enumerate the i-g-t tests within a decent few seconds. + The second list could be used when trying to execute specific these tests. + + v2: Rebased + + Signed-off-by: Gabriel Feceoru + Signed-off-by: Marius Vlad + +commit 3450cba30efb554db9de080735fc6a74acca5d4c +Author: Tomeu Vizoso +Date: Fri Apr 15 14:00:04 2016 +0200 + + lib: Declare loop variable as volatile before setjmp + + The variable used as loop counter in the igt_fixture macro had + unspecified value from the setjmp(3) man page quoted below. Because of + that, in certain circumstances and with -O2 and -Os, the initialization + of that variable would be eliminated and the compiler would complain of + uninitialized usage. Below can be found a snippet that reproduces the + problem with GCC 5.3.1 and 4.9.3 and the errors as printed by 5.3.1. + + "The compiler may optimize variables into registers, and longjmp() may + restore the values of other registers in addition to the stack pointer + and program counter. Consequently, the values of automatic variables + are unspecified after a call to longjmp() if they meet all the following + criteria: + + · they are local to the function that made the corresponding setjmp(3) + call; + + · their values are changed between the calls to setjmp(3) and + longjmp(); and + + · they are not declared as volatile." + + static void test(void) + { + igt_subtest_group { + igt_fixture { + } + + igt_subtest("foo") { + } + + igt_fixture { + } + } + } + + In file included from lib/intel_batchbuffer.h:8:0, + from lib/drmtest.h:39, + from lib/igt.h:27, + from tests/kms_addfb_basic.c:28: + tests/kms_addfb_basic.c: In function 'tiling_tests.isra.0': + lib/igt_core.h:110:43: warning: '__tmpint245' is used uninitialized in + this function [-Wuninitialized] + #define igt_fixture for (int igt_tokencat(__tmpint,__LINE__) = 0; \ + ^ + lib/igt_core.h:110:43: note: '__tmpint245' was declared here + #define igt_fixture for (int igt_tokencat(__tmpint,__LINE__) = 0; \ + ^ + lib/igt_core.h:148:31: note: in definition of macro '__igt_tokencat2' + #define __igt_tokencat2(x, y) x ## y + ^ + lib/igt_core.h:110:30: note: in expansion of macro 'igt_tokencat' + #define igt_fixture for (int igt_tokencat(__tmpint,__LINE__) = 0; \ + ^ + tests/kms_addfb_basic.c:245:3: note: in expansion of macro 'igt_fixture' + igt_fixture { + + Signed-off-by: Tomeu Vizoso + Signed-off-by: Daniel Vetter + +commit be354f444e03edb7b73c8393762e90fc503d03b6 +Author: Micah Fedke +Date: Wed Mar 9 16:57:37 2016 +0100 + + lib: update kmstest_get_pipe_from_crtc_id + + This function uses an intel-specific ioctl to fetch a mapping between pipes and + crtc ids, but this technique is outdated as the crtc id is now always + equivalent to its index in the array of crtcs returned by the kernel. + + Signed-off-by: Tomeu Vizoso + Signed-off-by: Daniel Vetter + +commit f8af3565bd9d79c16c48bc017d3698b4c19bed4f +Author: marius vlad +Date: Mon Feb 8 19:12:58 2016 +0200 + + tests/kms_pipe_crc_basic: Don't suspend the machine if the pipe is not present. + + suspend-read-crc-pipe will perform a suspend and then skip the test in case the + pipe is not present or is fused w/ another pipe. Skip the test before doing + the suspend. + + v2: Somehow the subject was trimmed. + + Reviewed-by: Daniel Vetter + Signed-off-by: Marius Vlad + +commit e3e00bae23ce3687f7e465d67318fca54f84f0ab +Author: Bob Paauwe +Date: Mon Apr 11 10:41:35 2016 -0700 + + ksm_pipe_color: Set legacy gamma values inside loop. + + When testing multple outputs, make sure to set the gamma values before + testing the output. Otherwise we're testing using the gamma values + that were reset after last output was tested. Without this, the first + output passes, but each output after that will fail. + + Signed-off-by: Bob Paauwe + Reviewed-by: Lionel Landwerlin + Signed-off-by: Marius Vlad + +commit 459ff6b7e24dc0bda5d45b41afdf1fe9aaafc936 +Author: Chris Wilson +Date: Wed Apr 20 07:49:02 2016 +0100 + + igt/gem_concurrent_blit: Ensure we only shrink the child buffers + + As we reuse the parent arrays under the assumption that the child uses + fewer buffers, make sure that is true. + + Signed-off-by: Chris Wilson + +commit 87acd98a2c89f058719332dd18e6824bc7e64580 +Author: Marius Vlad +Date: Tue Apr 19 19:49:43 2016 +0300 + + NEWS: a newer version of piglit is required. + + Signed-off-by: Marius Vlad + +commit 203591ba877922fa05c89e64511fd77f0f516089 +Author: Feceoru, Gabriel +Date: Mon Mar 7 17:16:25 2016 +0200 + + scripts: Adapt run-tests.sh to the piglit changes + + Piglit changed its behaviour to prevent overwriting the results + directory unless explicitly specified with -o + + Added -o flag in run-tests.sh to keep user experience. + + Signed-off-by: Gabriel Feceoru + Acked-by: Rodrigo Vivi + Signed-off-by: Marius Vlad + +commit 77b8a5bfd386b8cec1b5df55f6d28a130a0356f9 +Author: Chris Wilson +Date: Mon Apr 18 10:26:05 2016 +0100 + + igt/gem_exec_nop: Fix time units for assertion printf + + Signed-off-by: Chris Wilson + +commit ca4f42ba1748e350a992c72a964a8849dc3b7516 +Author: Chris Wilson +Date: Mon Apr 18 10:24:26 2016 +0100 + + igt/gem_ctx_param: Relabel + + Checking parameters is not interesting for BAT, it is a simple ABI test + that only provides coverage of the CONTEXT_GETPARAM and CONTEXT_SETPARAM + ioctls, and no deeper. + + Signed-off-by: Chris Wilson + +commit 7bd2ac6642248fdd865e7b32a1b4f20bda992e27 +Author: Chris Wilson +Date: Sat Apr 16 17:15:38 2016 +0100 + + gem_exec_lut_handle: Fix presumed_offset to force relocation on full-ppgtt + + If the object is at offset 0, quite likely using full-ppgtt, then the + presumed_offset set also to 0 causes the relocation to be skipped. + + Signed-off-by: Chris Wilson + +commit c84853ba32a7f49a4606ff6aa91f6bc81217054b +Author: Chris Wilson +Date: Thu Apr 14 12:25:52 2016 +0100 + + igt/gem_mocs_settings: Check for pollution of default contexts + + Signed-off-by: Chris Wilson + +commit cfb9e8ec29be5233134b954a4dfbb21643fac41c +Author: Tvrtko Ursulin +Date: Fri Apr 15 10:11:43 2016 +0100 + + igt/drv_module_reload_basic: Do not require snd-hda-intel + + Recent refactoring has made absence of snd-hda-intel a test + failure do the respective modprobe being at the end of a + reload function now. + + Only fail in this case if module was previously unloaded. + + Signed-off-by: Tvrtko Ursulin + Cc: Chris Wilson + Reviewed-by: Chris Wilson + +commit da3ae5c8619f437d9bc8a954b98896a6afdef045 +Author: Tomeu Vizoso +Date: Fri Apr 15 11:50:21 2016 +0200 + + tests/kms_addfb_basic: Set tiling in addfb25 subtest + + When moving the call to gem_set_tiling into the subtests, the one needed + by addfb25-framebuffer-vs-set-tiling was left out. + + Signed-off-by: Tomeu Vizoso + Reviewed-by: Tvrtko Ursulin + +commit e0145eabbaf25c34ac4c443c88ef39e6e89efb6f +Author: Chris Wilson +Date: Fri Apr 15 09:45:45 2016 +0100 + + igt/gem_pwrite: Add backwards/random access patterns + + Signed-off-by: Chris Wilson + +commit 4233b59608ce655298228b8b606aed0461c7af77 +Author: Chris Wilson +Date: Fri Apr 15 10:39:36 2016 +0100 + + igt/gem_busy: Slow down the writer + + Add a few more (128) loops to the page full of MI_STORE_DWORD in an + attempt to try and slow down the execution to the point where a + full-debug kernel can beat the GPU. + + Signed-off-by: Chris Wilson + +commit 082fb26ce92442493543104d06af3a86382a4a8b +Author: Chris Wilson +Date: Fri Apr 15 10:57:33 2016 +0100 + + igt/gem_exec_nop: Correct %3.f typo + + Signed-off-by: Chris Wilson + +commit 7bd4f918c46135762e14c359a5b3c6340364082c +Author: Chris Wilson +Date: Thu Apr 14 17:03:07 2016 +0100 + + igt/gem_exec_nop: Explain the parallel execution assertion + + Signed-off-by: Chris Wilson + +commit 286992102ee1028a3cb70a4b536ff4ad1650df3f +Author: Daniel Vetter +Date: Sat Mar 19 15:14:19 2016 +0100 + + lib: Fix doc warnings for real! + + Signed-off-by: Daniel Vetter + +commit f4718c2b6c264c1825cde5213f61965e78c19c9d +Author: Tomeu Vizoso +Date: Wed Feb 24 10:47:09 2016 +0100 + + tests: Open any driver + + For those tests that now pass on drivers other than i915, call + drm_open_driver_master with DRIVER_ANY. + + Also do so from igt_enable_connectors. + + Signed-off-by: Tomeu Vizoso + Reviewed-by: Daniel Stone + Acked-by: Daniel Vetter + +commit 17a5d7168d4a4e5cdce6afa7ca125c4e60ebfb3f +Author: Tomeu Vizoso +Date: Wed Feb 24 10:49:14 2016 +0100 + + kms_addfb_basic: Get intel gen from within subtest + + Because determining the Intel GFX generation requires a call to + DRM_IOCTL_I915_GETPARAM, move the code that requires it to a subtest + that can be skipped on drivers other than i915. + + Signed-off-by: Tomeu Vizoso + Reviewed-by: Daniel Stone + Acked-by: Daniel Vetter + +commit 6694b6a6699ae3414ad27c7a5271fffdc9d33710 +Author: Tomeu Vizoso +Date: Tue Mar 1 16:21:13 2016 +0100 + + kms_addfb_basic: Move calls to gem_set_tiling to the subtests + + So they don't cause unrelated subtests to be skipped when testing + drivers other than i915. + + Signed-off-by: Tomeu Vizoso + Reviewed-by: Daniel Stone + Acked-by: Daniel Vetter + +commit b2671e8e70bc541284f4ad77a3ca204c195bb163 +Author: Tomeu Vizoso +Date: Tue Mar 1 16:07:47 2016 +0100 + + kms_addfb_basic: Split tiling_tests off + + Move tests requiring tiled BOs to the end so they don't cause unrelated + subtests to be skipped when testing drivers with only dumb buffer + support. + + Signed-off-by: Tomeu Vizoso + Reviewed-by: Daniel Stone + Acked-by: Daniel Vetter + +commit c94a828f151686faab5bfa2fe0955cd440cead16 +Author: Tomeu Vizoso +Date: Wed Feb 24 10:39:47 2016 +0100 + + kms_addfb_basic: move tiling functionality into each subtest + + Because calls to gem_set_tiling will cause the subtest to be skipped on + drivers other than i915, move them to each subtest that needs them so + the other subtests aren't skipped as well. + + Signed-off-by: Tomeu Vizoso + Reviewed-by: Daniel Stone + Acked-by: Daniel Vetter + +commit decbf5a3b11878b93caaddda7c738b866939c1e2 +Author: Tomeu Vizoso +Date: Wed Feb 24 10:38:25 2016 +0100 + + kms_addfb_basic: call igt_create_bo_with_dimensions + + Many tests can do their work on drivers other than i915 and even with + just dumb buffers, so call igt_create_bo_with_dimensions instead of + gem_create which will paper out the differences and call the proper + ioctls or cause the subtest to be skipped if that's not possible. + + Signed-off-by: Tomeu Vizoso + Reviewed-by: Daniel Stone + Acked-by: Daniel Vetter + +commit 8a1a38661f5693409ad92b7ce60189dc52fe4ff6 +Author: Tomeu Vizoso +Date: Wed Feb 24 09:04:04 2016 +0100 + + lib: Add igt_create_bo_with_dimensions + + igt_create_bo_with_dimensions() is intended to abstract differences + between drivers in buffer object creation. + + The driver-specific ioctls will be called if the driver that is being + tested can satisfy the needs of the calling subtest, or it will be + skipped otherwise. + + Signed-off-by: Tomeu Vizoso + Reviewed-by: Daniel Stone + Acked-by: Daniel Vetter + +commit 89b3ffe02c2a308c4663b6781ac1302c221932c2 +Author: Tomeu Vizoso +Date: Wed Feb 24 09:04:41 2016 +0100 + + lib: Map dumb buffers + + If a buffer object is dumb, call DRM_IOCTL_MODE_MAP_DUMB when mapping + it. Also, don't call DRM_IOCTL_I915_GEM_SET_DOMAIN on dumb buffers. + + Signed-off-by: Tomeu Vizoso + Reviewed-by: Daniel Stone + Acked-by: Daniel Vetter + +commit a2d5b348ee0f9b51ef3b38393ce91ddbefbfaacb +Author: Tomeu Vizoso +Date: Mon Mar 7 16:25:43 2016 +0100 + + lib: Add igt_dirty_fb + + Just wraps drmModeDirtyFB and for now invalidates the whole FB. + + Signed-off-by: Tomeu Vizoso + Reviewed-by: Daniel Stone + Acked-by: Daniel Vetter + +commit fb66a5df937b44b594f17a30663938250c759b35 +Author: Tomeu Vizoso +Date: Mon Mar 7 16:37:36 2016 +0100 + + lib: Add helper kmstest_dumb_map_buffer + + Which basically just calls DRM_IOCTL_MODE_MAP_DUMB and is similar to + gem_mmap__gtt(). + + Signed-off-by: Tomeu Vizoso + Reviewed-by: Daniel Stone + Acked-by: Daniel Vetter + +commit dc84e7d6ada3c4dbf07a5cfafdbdd597ab03c635 +Author: Tomeu Vizoso +Date: Wed Mar 2 13:39:44 2016 +0100 + + lib: Add wrapper for DRM_IOCTL_MODE_CREATE_DUMB + + In order to test drivers that don't have support for proper buffer + objects, add a wrapper for creating dumb buffer objects that will be + called from the lib code for those subtests that don't need to care. + + Signed-off-by: Tomeu Vizoso + Reviewed-by: Daniel Stone + Acked-by: Daniel Vetter + +commit 85a1d45c4a93753f73c32b6b52bcb4de5c42354e +Author: Tomeu Vizoso +Date: Wed Feb 24 08:39:53 2016 +0100 + + lib: Call intel_get_drm_devid only from intel code + + It only makes sense when testing the i915 driver, so don't call it + otherwise. + + Signed-off-by: Tomeu Vizoso + Reviewed-by: Daniel Stone + Acked-by: Daniel Vetter + +commit 644f364da22f486ef0ab5f50e71d0b6802302a44 +Author: Tomeu Vizoso +Date: Thu Feb 18 14:23:25 2016 +0100 + + lib: Assert we are on i915 from intel_get_drm_devid + + I915_PARAM_CHIPSET_ID is a i915-only thing, so if a subtest ends up + calling it when testing another driver, the subtest (or the library) + needs to be fixed. + + Signed-off-by: Tomeu Vizoso + Reviewed-by: Daniel Stone + Acked-by: Daniel Vetter + +commit e0e3a063ae3680ad1848dcf16d54f51c8d1f459a +Author: Tomeu Vizoso +Date: Thu Feb 18 14:25:43 2016 +0100 + + lib: Expose is_i915_device + + Lib and test code can use this function to avoid i915-specific behavior + when running on other drivers. + + Signed-off-by: Tomeu Vizoso + Reviewed-by: Daniel Stone + Acked-by: Daniel Vetter + +commit 6755757e9f71918949ac02e6971d97fa662c1ba2 +Author: Tomeu Vizoso +Date: Tue Feb 9 10:17:18 2016 +0100 + + lib: Have gem_set_tiling require intel + + Before calling a i915-specific IOCTL, require i915. + + This allows us to skip subtests that are specific to that driver, though + what should eventually happen is that tests don't generally call + gem_set_tiling directly but go through an abstraction layer that + constructs the buffer object in a driver-specific way. + + Signed-off-by: Tomeu Vizoso + Reviewed-by: Daniel Stone + Acked-by: Daniel Vetter + +commit 3fee80efcfb41cc7f25afa968bb38e68faa6c34c +Author: Tomeu Vizoso +Date: Tue Feb 9 10:16:51 2016 +0100 + + lib: add igt_require_intel + + Add function that requires that the driver we are talking to is i915. + + This allows us to skip subtests that are specific to that driver. + + Signed-off-by: Tomeu Vizoso + Reviewed-by: Daniel Stone + Acked-by: Daniel Vetter + +commit 0eadf638e4e11394adcb574b986f5dea077d4a4c +Author: Tomeu Vizoso +Date: Tue Mar 8 09:18:45 2016 +0100 + + lib: Rename is_intel to has_known_intel_chipset + + As it reflects more clearly what the function actually does. + + Suggested-by: Chris Wilson + Signed-off-by: Tomeu Vizoso + Reviewed-by: Daniel Stone + Acked-by: Daniel Vetter + +commit e609955067b628c85297665e233b56da2c64c48d +Author: Chris Wilson +Date: Thu Apr 14 10:15:26 2016 +0100 + + igt/gem_ctx_create: Broaden per-engine testing + + Signed-off-by: Chris Wilson + +commit 30769516984f404a54a60e7815a20de2a88b8d2a +Author: Chris Wilson +Date: Tue Apr 12 16:50:34 2016 +0100 + + igt/gem_exec_create: Add a "leak" test + + Don't close the objects, but just mark them as unneded. + + Signed-off-by: Chris Wilson + +commit 539abffc3e73b462479e2763739786c55d784a00 +Author: Chris Wilson +Date: Tue Apr 12 13:14:05 2016 +0100 + + igt: Add a basic test to stress allocation of batches + + Run for 20s and don't expect to crash from memory exhaustion or sillies. + + Signed-off-by: Chris Wilson + +commit 8af67d1980a1251bd8efb51d4a31062084fe8e03 +Author: Peter Antoine +Date: Mon Apr 11 17:50:09 2016 +0100 + + test/gem_mocs_settings: Testing MOCS register settings + + The MOCS registers were added in Gen9 and define the caching policy. + The registers are split into two sets. The first set controls the + EDRAM policy and have a set for each engine, the second set controls + the L3 policy. The two sets use the same index. + + The RCS registers and the L3CC registers are stored in the RCS context. + + The test checks that the registers are correct by checking the values by + directly reading them via MMIO, then again it tests them by reading them + from within a batch buffer. RCS engine is tested last as it programs the + registers via a batch buffer and this will invalidate the test for + workloads that don't use the render ring or don't run a render batch + first. + + v2: Reorganised the structure. + Added more tests. (Chris Wilson) + v3: Fixed a few bugs. (Chris Wilson) + v4: More Tidy-ups. (Chris Wilson) + SKL does does not have a snoop bit. (Peter Antoine) + + Signed-off-by: Peter Antoine + +commit d6a85f042cf0ac7f297189ef48f85caf972515a9 +Author: Chris Wilson +Date: Mon Apr 11 12:52:48 2016 +0100 + + igt/gem_busy: fix compaction of multiple store commands + + Missed increment of the batch offset between commands. + + Signed-off-by: Chris Wilson + +commit 9e7e7c38a0fe48a64eb946fd4449283e01039573 +Author: Chris Wilson +Date: Mon Apr 11 09:17:33 2016 +0100 + + igt/gem_concurrent_blit: Tweak num_buffers to just exceed target + + Remember that we allocate and use twice as many buffers as specified (we + have a num_buffers array of src and dst) and so adjust the computation + such that the combined allocation matches the target. + + Signed-off-by: Chris Wilson + +commit 4a3fa3532a3d6605d0ce08b13b224bbf1807ee03 +Author: Chris Wilson +Date: Mon Apr 11 07:40:11 2016 +0100 + + lib: Tidy presentations of pread/pwrite failures + + Make the assertion failure message readable if gem_read or gem_write + fail. + + Signed-off-by: Chris Wilson + +commit c46f3c341caebfbe114aaafa412173db419083e9 +Author: Chris Wilson +Date: Sun Apr 10 20:44:58 2016 +0100 + + igt/gem_concurrent_blit: Purge the libdrm caches before cloning + + When forking, the entire VM is cloned including the VMA backed by GEM + objects from the libdrm buffer cache. This is not only slow, but can also + cause the system to exceed the maximum number of VMA and premature test + failure. + + Signed-off-by: Chris Wilson + +commit e8bcd678a6e570ccda0d694939d17285fb394da2 +Author: Chris Wilson +Date: Sun Apr 10 18:40:26 2016 +0100 + + igt/gem_shrink: Fix execution object offset + + An off-by-one caused us to execute the blank object rather than the + batch. + + References: https://bugs.freedesktop.org/show_bug.cgi?id=94801 + Signed-off-by: Chris Wilson + +commit 645c95400ccfd743a17b4ab90488cea7eb316776 +Author: Chris Wilson +Date: Fri Dec 11 21:43:11 2015 +0000 + + lib: Remove defunct stop_rings + + Signed-off-by: Chris Wilson + +commit 1ba9717e6eda2bdd6f1f9e5d1f8e8138cbb3edd1 +Author: Chris Wilson +Date: Fri Dec 11 21:32:32 2015 +0000 + + igt/kms_flip: Convert over to real hang injection + + Signed-off-by: Chris Wilson + +commit 7f05d31c39b2e195cc50c976a15b5dd0e0c29203 +Author: Chris Wilson +Date: Fri Dec 11 21:23:09 2015 +0000 + + igt/kms_pipe_crc_basic: Replace stop_rings with igt_hang_ring + + We can inject a real GPU hang for greater effect! + + Signed-off-by: Chris Wilson + +commit eaf7f46cdc0b743dc22d81003f6efa8a0c9031f7 +Author: Ville Syrjälä +Date: Tue Apr 5 20:45:42 2016 +0300 + + tests/pm_rps: Increase timeouts to 15 seconds + + My BSW takes ~12 seconds to go back to idle after high load, so the + current 10s timeouts are too short. Bump them up to 15s. + + Signed-off-by: Ville Syrjälä + +commit fd7fef66013092f0fb2b9f52a0de0c4de65cc839 +Author: Ville Syrjälä +Date: Tue Mar 8 23:21:09 2016 +0200 + + tools/intel_reg: Add extra pipe B registers for CHV + + CHV pipe B has some extra features (programmable sprite CSC, + primary plane windowing, primary plane scaler, fancier blending). + Add all the relevant registers to the "quickdump" register list. + + Signed-off-by: Ville Syrjälä + +commit 78a97fe1575616519e755be1ff72029c6d7fcbd7 +Author: Matt Roper +Date: Mon Apr 4 13:54:41 2016 -0700 + + kms_atomic: Skip rather than fail on non-atomic drivers + + i915 does not yet support the atomic modesetting interface by default; + at the moment it must be turned on explicitly via an + 'i915.nuclear_pageflip' kernel command line option. We should skip + (rather than fail) this IGT test when running on kernels that don't + advertise support for atomic modesetting. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93014 + Signed-off-by: Matt Roper + Reviewed-by: Daniel Stone + +commit cd8da3f65d6d6956b50e4629cb43d3a8d55faab3 +Author: Lionel Landwerlin +Date: Tue Apr 5 14:13:53 2016 +0100 + + lib: kms: move framebuffer scanout offset/size to plane + + This fixes potential crashes when the framebuffer is unset from a + given plane. + + v2: s/with/within/ typo in header + + Signed-off-by: Lionel Landwerlin + Cc: Maarten Lankhorst + Cc: Marius Vlad + Cc: Ville Syrjälä + Reviewed-by: Ville Syrjälä + Signed-off-by: Marius Vlad + +commit 54b8a1f2d3b1651448645c89dda278536406cbda +Author: Ville Syrjälä +Date: Tue Apr 5 15:00:23 2016 +0300 + + tools/intel_reg: Fix builtin register spec for gen4 + + Actually use the builtin register spec on gen4. Makes intel_reg dump + actually do something on gen4. + + Signed-off-by: Ville Syrjälä + Reviewed-by: Matthew Auld + +commit 9cff3be12731bf73bee15a545bee50377f307f55 +Author: Chris Wilson +Date: Mon Apr 4 16:24:47 2016 +0100 + + igt/gem_shrink: Reduce oom spam + + Since we are deliberately going to fail the mmap() allocation, don't + assert. + + Signed-off-by: Chris Wilson + +commit 7a977554cb85c79b470312028712c4dad1626f84 +Author: Chris Wilson +Date: Mon Apr 4 15:03:10 2016 +0100 + + igt/gem_shrink: Fix leak in userptr, add another + + Hitting oom from userptr because we had N threads all consuming all of + memory, wasn't the intention but the bugs it found were useful! + + Signed-off-by: Chris Wilson + +commit 1a501723029ac519aca0f7c633cda0133ac5141a +Author: Chris Wilson +Date: Sun Apr 3 16:45:22 2016 +0100 + + benchmarks: Include my ezbench test runners + + Just a set of scripts to integrate these benchmarks with ezbench. They + need to be revised to plugin into latest version of ezbench. + + Signed-off-by: Chris Wilson + +commit eac26718e62a0c7cb5506f2cf188a4cac4794726 +Author: Chris Wilson +Date: Sun Apr 3 16:44:27 2016 +0100 + + benchmarks/gem_latency: Add a -C switch to measure impact of cmdparser + + Signed-off-by: Chris Wilson + +commit bd292436ed0bbc06552fc77c2f10bd02a4d7c797 +Author: Chris Wilson +Date: Sun Apr 3 09:51:49 2016 +0100 + + lib: Avoid assertion if sig_ioctl is unsed from a child accidentally + + The timer is tied to the creator thread, i.e. it is not inheritable + across fork() or clone()/pthread_create(). Using it thus causes an + assertion failure in the test after the one that aborts (and so on until + we perform an interruptible test correctly) - one mistake snowballs. We + can stop the snowball by doing an initial check and diverting back to + drmIoctl(). + + Signed-off-by: Chris Wilson + +commit cb12d05e79aedaf4f1873b1262b7eeb127e87e80 +Author: Chris Wilson +Date: Sun Apr 3 09:47:58 2016 +0100 + + lib: Don't report the last errno inside the async GPU hang detector + + Since the last errno doesn't correspond with the signal, reporting it + when we detect the GPU hang is confusing. + + Signed-off-by: Chris Wilson + +commit 8833648b5c29f77a876fa08829f0facf38f08982 +Author: Chris Wilson +Date: Sat Apr 2 17:22:46 2016 +0100 + + igt/gem_shrink: Exercise with userptr stress + + Add additional mempressure in the form of userptr. + + Signed-off-by: Chris Wilson + +commit 88bfe6ac417f3eb52e9915047ebf7443bc91c828 +Author: Chris Wilson +Date: Sat Apr 2 16:37:20 2016 +0100 + + igt/gem_shrink: Add pread/pwrite stress + + Signed-off-by: Chris Wilson + +commit d081953e67b3e15d9dc32a68b1248bb81e586bc5 +Author: Chris Wilson +Date: Fri Dec 11 21:41:58 2015 +0000 + + igt/pm_rps: Trigger a real GPU reset + + Signed-off-by: Chris Wilson + +commit 3dd5fe8ab294075c558d4f4bd9a74077decfb8c7 +Author: Chris Wilson +Date: Fri Apr 1 20:07:13 2016 +0100 + + igt/gem_exec_reloc: Exercise read-only relocation arrays + + Signed-off-by: Chris Wilson + +commit aec81019e1140aa043761e07e36d8ba3245ab66b +Author: Chris Wilson +Date: Fri Apr 1 16:52:37 2016 +0100 + + igt/gem_busy: Try to slow down execution + + With lockdep enabled, the driver overhead is enormous and we need to + slow down the GPU to compenstate (otherwise the GPU is already idle when + we expect busyness). So do more work per batch. + + Signed-off-by: Chris Wilson + +commit 92ee3cc1f69af8b6c94b93463fe9dcf484b484b9 +Author: Chris Wilson +Date: Fri Apr 1 14:58:18 2016 +0100 + + igt/gem_busy: Cap number of tries to create busy rings + + Signed-off-by: Chris Wilson + +commit 0f5b03fa3801a8b6dcf72d4f402ff89d9863f180 +Author: Chris Wilson +Date: Fri Apr 1 13:19:07 2016 +0100 + + igt/gem_busy: Use a boatload of store-dwords to force ring busyness + + A little more inelegant as we can't control the delay very well, but it + should prove more vesatile and broaden the test coverge (and still be + quick enough for basic). + + Signed-off-by: Chris Wilson + +commit c89e8dbfd8d8cebe56f68869c6b9b30ef7356889 +Author: Chris Wilson +Date: Tue Mar 29 17:21:18 2016 +0100 + + lib: Ignore udev failure to report an event + + Fixes gem_exec_suspend complaining that the hang detector spontaneously + combusts. + + Signed-off-by: Chris Wilson + +commit 2b804c33e7511a3036b5f86d6b8a8ae806120c10 +Author: Chris Wilson +Date: Tue Mar 29 17:19:31 2016 +0100 + + lib: Tidy error message for a helper process who unexpectedly dies + + Transform + + gem_exec_suspend: igt_core.c:1429: igt_stop_helper: Assertion `(((signed char) ((((__extension__ (((union { __typeof(status) __in; int __i; }) { .__in = (status) }).__i))) & 0x7f) + 1) >> 1) > 0) && (((__extension__ (((union { __typeof(status) __in; int __i; }) { .__in = (status) }).__i))) & 0x7f) == (proc->use_SIGKILL ? 9 : 15)' failed. + + into + + (gem_exec_suspend:16589) igt-core-DEBUG: Helper died too early with status=0 + gem_exec_suspend: igt_core.c:1437: igt_stop_helper: Assertion `helper_was_alive(proc, status)' failed. + + Signed-off-by: Chris Wilson + +commit 0bd117fa66d80a0285e860e22a973353f731ed2d +Author: Chris Wilson +Date: Tue Mar 29 13:52:24 2016 +0100 + + igt/gem_exec_suspend: Add basic selftest + + The selftest is already before the suspend/hibernate tests, but to be + clear also run it first (it only takes a millisecond) by itself. + + Signed-off-by: Chris Wilson + +commit e56de3c900edbcce831b756e8e850f89836614b1 +Author: Chris Wilson +Date: Tue Mar 29 10:53:37 2016 +0100 + + igt/gem_exec_store: Exercise write ordering + + Signed-off-by: Chris Wilson + +commit 41a26b5152a5f7fa87a13c3bb70a50acc2e45668 +Author: Chris Wilson +Date: Mon Mar 28 16:26:01 2016 +0100 + + igt/gem_exec_nop: Relax parallel assertion for short rings + + On bdw, the render ring becomes full and limits dispatch across all rings. + Adjust the expected latency to take this into account. + + Signed-off-by: Chris Wilson + +commit 870c774b866c62e9fa5b0de94364b2c044968ed3 +Author: Chris Wilson +Date: Mon Mar 28 15:29:46 2016 +0100 + + igt/gem_exec_nop: Add expectancy of independent execution between engines + + Signed-off-by: Chris Wilson + +commit 633854e8f4f752478fc7d6ccc55fe36b0e828d79 +Author: Chris Wilson +Date: Sat Mar 26 10:55:46 2016 +0000 + + igt/gem_ctx_switch: Add basic test for context switching + + Signed-off-by: Chris Wilson + +commit 1a722fa6cf87ae12fc1b3446fe30c200a0201752 +Author: Chris Wilson +Date: Sat Mar 26 10:54:43 2016 +0000 + + igt/gem_exec_whisper: Add simple interruptible pass + + Signed-off-by: Chris Wilson + +commit 5dcb0263489f3009cb9b65f531771d516baa131d +Author: Chris Wilson +Date: Sat Mar 26 09:48:16 2016 +0000 + + igt/gem_exec_whisper: Check for inconsistent reloc offset vs object offset + + Signed-off-by: Chris Wilson + +commit 3fd9b910d20335cea5a675c1181f4942ddaa0bdd +Author: Chris Wilson +Date: Fri Mar 25 20:27:34 2016 +0000 + + igt/gem_sync: Add a basic test to wait upon a batch on all rings + + Execute the batch concurrently on all rings and then wait (as opposed to + executing a different batch on each engine). + + Signed-off-by: Chris Wilson + +commit 9d61a685e982aa544ca802fe1758aa19ea9987cc +Author: Chris Wilson +Date: Fri Mar 25 18:22:54 2016 +0000 + + igt/gem: Add GPU hang detection to basic tests + + Signed-off-by: Chris Wilson + +commit 98dcf2f0dcf7097a9404c0598ade4fc94cffeaac +Author: Chris Wilson +Date: Fri Mar 25 00:50:45 2016 +0000 + + igt/gem_concurrent_blit: Relax maxfiles restrictions + + Only fail the dmabuf tests if we cannot prep the system to support + "unlimited" fd. + + Signed-off-by: Chris Wilson + +commit 4e2a785e2412f148693b993d1a29d62f48da4937 +Author: Chris Wilson +Date: Wed Mar 23 12:37:38 2016 +0000 + + benchmarks/gem_exec_nop: Include a measurement across all rings + + For sync, it really is just the average latency across all rings, but + for continuous we can expect to see the effect of concurrent dispatch + across rings. Hopefully. + + Signed-off-by: Chris Wilson + +commit 6867b87b73f3fc0d70d5b64efce7ec096007dd20 +Author: Chris Wilson +Date: Thu Mar 24 07:57:30 2016 +0000 + + igt/gem_concurrent_blit: Enable hang detection + + When we aren't deliberately injecting hangs, we don't expect to see any + GPU hang. Detect them and fail early. + + Signed-off-by: Chris Wilson + +commit 756f3e0cb7e7d7351e3eb955ca782a438c6aa887 +Author: Chris Wilson +Date: Tue Mar 22 11:33:41 2016 +0000 + + lib: Add a GPU error detector + + If we listen to the uevents from the kernel, we can detect when the GPU + hangs. This requires us to fork a helper process to do so and send a + signal back to the parent. + + Signed-off-by: Chris Wilson + +commit eb572106b4721dcfb6bf873ae40c5200f5369039 +Author: Chris Wilson +Date: Wed Mar 23 10:01:10 2016 +0000 + + igt/gem_shrink: Consume all of total ram in each process + + "Leak" the objects from each test until each process has allocated + enough objects to consume all of RAM. + + Doing so from each process not only ensures we do stress the allocation + paths, but also obsoletes the separate purgeable helper. + + Signed-off-by: Chris Wilson + +commit a9436e6693ddb3d3e76027b7ad43733900fa0466 +Author: Chris Wilson +Date: Wed Mar 23 09:53:34 2016 +0000 + + igt/gem_shrink: Include a shrinker vs GPU hang + + Signed-off-by: Chris Wilson + +commit 54ec3782dcdb7949756615ef7aa8f9f330bc87c7 +Author: Chris Wilson +Date: Wed Mar 23 09:37:43 2016 +0000 + + tests: Add gem_shrink + + This test exercise purely to exercise the shrinker under some common + stress (i.e. paths leading to i915_gem_object_get_pages()). We try to + fill the entirely of memory split amongst many processes so that each + individual process only consumes a small fraction of RAM (less than the + mappable aperture) and a single process should not be individually + blamed. + + Based on an idea to have a seperate set of memory stress tests by Piotr + Luc. + + Cc: Piotr Luc + Signed-off-by: Chris Wilson + +commit 7fc5256f56a5a76596aeab5fc47dd1f4cf80ae98 +Author: Lionel Landwerlin +Date: Fri Mar 18 17:33:05 2016 +0000 + + test/kms_pipe_color: add test to verify legacy ioctl resets GAMMA_LUT + + The GAMMA_LUT/DEGAMMA_LUT/CTM properties must be updated when the + legacy ioctl is triggered to ensure the new properties do not impact + older userspace code. + + v2: Add checks verifying the content of CTM & DEGAMMA_LUT properties + + Signed-off-by: Lionel Landwerlin + Reviewed-by: Matt Roper + Signed-off-by: Matt Roper + +commit aa55641d4fdfb3ba7f6259d2b1ba7c56a0d4df13 +Author: Lionel Landwerlin +Date: Fri Mar 18 17:33:04 2016 +0000 + + tests/kms_color: New test for pipe level color management + + This test enables testing of : + + * degamma LUTs + * csc matrix + * gamma LUTs + * legacy gamma LUTs + + v2: turn assert into require to skip on platform not supporting color + management + + v3: add invalid blob ids tests + + v4: Try to match CRC results against several values around the + expected result for platforms with odd LUT items + + v5: Fix running tests with multiple screens + + Signed-off-by: Lionel Landwerlin + Reviewed-by: Matt Roper + Signed-off-by: Matt Roper + +commit c7e9be2302ab3dea289edc86b8c63e22d668fe2b +Author: Lionel Landwerlin +Date: Fri Mar 18 17:33:03 2016 +0000 + + lib: add crc comparison function without an assert + + Signed-off-by: Lionel Landwerlin + Reviewed-by: Matt Roper + Signed-off-by: Matt Roper + +commit a511310244ed82391a45a438b0d7126a8f9c974b +Author: Lionel Landwerlin +Date: Fri Mar 18 17:33:02 2016 +0000 + + lib: fb: add igt_paint_color_gradient_range + + This is a helper to draw a gradient between 2 colors. + + Signed-off-by: Lionel Landwerlin + Reviewed-by: Matt Roper + Signed-off-by: Matt Roper + +commit 1716625e1e77c4e42afa3ed7afe4151ae787258d +Author: Lionel Landwerlin +Date: Fri Mar 18 17:33:01 2016 +0000 + + lib: kms: add helpers for color management properties on pipes + + v2: Rename CTM_MATRIX property to CTM + + v3: Add support for atomic commits + + Signed-off-by: Lionel Landwerlin + Reviewed-by: Matt Roper + Signed-off-by: Matt Roper + +commit 59b5487625b537f15533e163728053a6e56a7c57 +Author: Lionel Landwerlin +Date: Fri Mar 18 17:33:00 2016 +0000 + + lib: kms: add crtc_id to igt_pipe_t + + Signed-off-by: Lionel Landwerlin + Reviewed-by: Matt Roper + Signed-off-by: Matt Roper + +commit 8520037e5479c1b9ca20a560bbc695d2969d4e1b +Author: Chris Wilson +Date: Mon Mar 21 16:09:56 2016 +0000 + + lib: Measure the cost of calling timer_settimer() for sigiter + + We wish to delay the first signal from the igt_sigiter_ioctl + sufficiently to skip over the timer_settime() and into the drmIoctl + kernel context before firing. If we fire too early, we will think that + the ioctl doesn't respond to signals and ignore it in future. If we fire + too late, we won't probe the ioctl for signal handling at all. Let's try + measuring the timer_settime() call time as a first approximation. + + Signed-off-by: Chris Wilson + +commit f1a3d0d96f8cd281446d5a79e11a29173057e730 +Author: Chris Wilson +Date: Mon Mar 21 14:27:15 2016 +0000 + + igt/gem_ringfill: Fix basic- reversal + + Rushed flipping around the logic to add basic- and forgot to apply the + corrected patch. + + Signed-off-by: Chris Wilson + +commit 87a4d8ab64a858d71b73d7c1dd5f8f3ba3506fb6 +Author: Chris Wilson +Date: Mon Mar 21 14:34:18 2016 +0000 + + igt/gem_ringfill: Fine-tune list of BAT tests + + Drop -bomb as with forking * interruptible repeating, it takes too long + to include in the BAT. + + Signed-off-by: Chris Wilson + +commit a43f40741ba84ab84db0e3ebd76b0d72484dfd95 +Author: Chris Wilson +Date: Mon Mar 21 12:18:11 2016 +0000 + + igt/gem_exec_suspend: Add BAT runs + + Add a couple of all-engine busy tests in order to exercise coherency and + general bugs across suspend. (In particular, I expect this to trigger a + fresh case of lockdeps on Braswell, as well as the usual battery of + missing rpm references. This is an exerciser for my lockless-suspend + patches.) + + Signed-off-by: Chris Wilson + +commit a03ee8f6c899c5c3731b8c3e26908754f23ab378 +Author: Chris Wilson +Date: Mon Mar 21 11:59:34 2016 +0000 + + igt/gem_exec_suspend: Allow suspend testing on gen6 + + Filter out the request to execute on gen6/bsd to prevent skips. + + Signed-off-by: Chris Wilson + +commit d5e550f5c61b205727aab3f8fe914e590fcd1cb4 +Author: Chris Wilson +Date: Mon Mar 21 11:58:21 2016 +0000 + + igt/gem_exec_whisper: Tweak migration logging + + reloc.presumed_offset == -1 => implies we hit the fallback path and not + that we strictly needed to patch the relocation. + + Signed-off-by: Chris Wilson + +commit fcb4cfa520ab987c46b588564b2a057b40e6b02f +Author: Chris Wilson +Date: Sun Mar 20 11:38:26 2016 +0000 + + igt/gem_concurrent_all: Inject a hang onto all rings + + Also test a hang across all rings, rather than just one engine. + + Signed-off-by: Chris Wilson + +commit 3b22b89dd89245b9d174365b43ff53cfb995f210 +Author: Chris Wilson +Date: Mon Mar 21 11:00:52 2016 +0000 + + igt/gem_exec_whisper: Prevent MI_STORE_DWORD on gen6/bsd again + + Signed-off-by: Chris Wilson + +commit c19b049d9c2ea54e248c064171f4c5c419e4252b +Author: Chris Wilson +Date: Sun Mar 20 11:13:30 2016 +0000 + + igt/gem_concurent_blit: Prevent a memleak if we assert whilst creating buffers + + Assume that we may halt partway through buffers_create() and so be + careful to clear up the partial state in buffers_destroy(). + + Signed-off-by: Chris Wilson + +commit 3d8af56ed2f08e57e58944c1baf8dc15fafa3f27 +Author: Chris Wilson +Date: Sun Mar 20 10:49:54 2016 +0000 + + igt/gem_concurrent_blit: Reset process limits to allow dmabuf tests + + Since dmabuf requires an actual fd for every object, we need to increase + the number of files our process is allowed. + + Signed-off-by: Chris Wilson + +commit 82e9113bfbc342d3f839797471a7eab16ec40548 +Author: Chris Wilson +Date: Sat Mar 19 15:55:22 2016 +0000 + + lib/igt_aux: Refine decision to stop signal injection + + The goal of injecting signals into the ioctl() is to trigger an EINTR. + If we did not succeed on the last pass, we are not going to on the next + or subsequent passes either. + + Signed-off-by: Chris Wilson + +commit f338e9834ccf96f4eb66e33435866abfd1f55883 +Author: Chris Wilson +Date: Sat Mar 19 13:10:17 2016 +0000 + + igt/gem_concurrent_blit: Enable quicker interruptible testing + + v2: Because I managed to push the wrong version. + + Make --list-subtests happer by creating the name before the igt_fixture, + not inside it. + + Signed-off-by: Chris Wilson + +commit 1abbd6974013a5ed1f6db1bbcdd492fef610af02 +Author: Chris Wilson +Date: Sat Mar 19 15:04:24 2016 +0000 + + igt/gem_softpin: Convert to igt_interruptible + + Convert the fixed time interruptible tests to igt_interruptible() for a + speed improvement. + + Signed-off-by: Chris Wilson + +commit 22674ae88bb1302a3d6326d908f593e46e3564c1 +Author: Chris Wilson +Date: Sat Mar 19 14:57:10 2016 +0000 + + igt/prime_mmap_coherency: Speed up interruptible testing + + Use the new fangled igt_interruptible() to limit the number of passes we + require when performing signal injection. + + Signed-off-by: Chris Wilson + +commit 83cfed8c396a0a5b08c498829fe68d2b10af8425 +Author: Chris Wilson +Date: Sat Mar 19 14:21:34 2016 +0000 + + igt/gem_exec_whisper: Add interruptibles tests + + Signed-off-by: Chris Wilson + +commit 87cad37c7849800b0e17ac55431ad3c1131739d4 +Author: Chris Wilson +Date: Sat Mar 19 13:13:06 2016 +0000 + + igt/gem_ringfill: Use igt_sigiter to focus the interruptible testing + + Use the igt_sigiter interface to repeat the ringfill testing for as much + as is required to exercise all potential injection sites. + + Signed-off-by: Chris Wilson + +commit e85613b47c3ca40eeecd436dab3d6c660298d559 +Author: Chris Wilson +Date: Sat Mar 19 14:01:38 2016 +0000 + + igt/gem_concurrent_blit: dmabuf requires twice the number of files + + In order to keep the dmabuf mmap around whilst we keep the object alive, + we need a file descriptor for each. Check that the VFS supports that + many fd. + + Signed-off-by: Chris Wilson + +commit c2248efbca452d1c657ace1b51aa6308504d0c7f +Author: Chris Wilson +Date: Sat Mar 19 13:10:17 2016 +0000 + + igt/gem_concurrent_blit: Enable quicker interruptible testing + + Use the igt_sigiter interface to only repeat the -interruptible tests + when we can make further progress with another change at injecting a + signal. + + Signed-off-by: Chris Wilson + +commit d54561086189d3bc83403d0ae19a389d0a68f89d +Author: Chris Wilson +Date: Sat Mar 19 13:04:02 2016 +0000 + + lib/igt_aux: Divert ioctls for signal injection + + To simplify and speed up running interruptible tests, use a custom + ioctl() function that control the signaling and detect when we need no + more iterations to trigger an interruption. + + We use a realtime timer to inject the signal after a certain delay, + increasing the delay on every loop to try and exercise different code + paths within the function. The first delay is very short such that we + hopefully enter the kernel with a pending signal. + + Clients should use + + struct igt_sigiter iter = {}; + while (igt_sigiter_repeat(&iter, enable_interrupts=true)) + do_test() + + to automatically repeat the test until we can inject no more signals + into the ioctls. This is condensed into a macro + + igt_interruptible(enable_interrupts=true) + do_test(); + + for convenience. + + Signed-off-by: Chris Wilson + +commit c1fed522ae98b7c74700521f7b3e0368f0f0948e +Author: Chris Wilson +Date: Sat Mar 19 13:00:29 2016 +0000 + + lib: Replace drmIoctl() with a layer of indirection + + Insted of calling drmIoctl() directly, call igt_ioctl() instead. In the + normal scenario this is function pointer that calls drmIoctl() (so no + penalty), but allows us to divert ioctls into our own routines for + nefarious purposes. One such purpose will be to control interrupt + generation into the ioctl, to be able to detect when we successfully + interrupt the ioctl and when we no longer need more interrupts. + + Signed-off-by: Chris Wilson + +commit 4e4f5b4fdca7ea2a9da79fe5b0266d1d31908e1c +Author: Daniel Vetter +Date: Sat Mar 19 12:15:47 2016 +0100 + + lib/tests: More igt_subtest_group checks + + ... for some cases discussed with Chris on irc. We seem to get them all + right. + + Signed-off-by: Daniel Vetter + +commit 483d1c0a239a49fbf2384c94092c530c8de61fdc +Author: Daniel Vetter +Date: Sat Mar 19 12:12:47 2016 +0100 + + lib: Fix some doc warnings + + Cc: Marius Vlad + Signed-off-by: Daniel Vetter + +commit 9665073c339d587e6a96884c0de0bb7f8c84f21a +Author: Daniel Vetter +Date: Fri Mar 18 21:55:00 2016 +0100 + + tests/gem_concurrent_blt|all: Use igt_subtest_group + + Looks tidy again, and doesn't break igt assumptions. + + Signed-off-by: Daniel Vetter + +commit 72d04b8453bf74b1fcd73f898c13398db4abc381 +Author: Daniel Vetter +Date: Fri Mar 18 21:46:54 2016 +0100 + + lib: Add igt_subtest_group + + Useful for creating common setup code in igt_fixture which is only + needed by a subset of tests. And since I'm a good citizen it comes + with a library testcase/example included. + + v2: Make testcase nastier to ensure a subtest group SKIPS when it's + parent is skipping already. I accidentally got this right, but let's + make sure. + + Signed-off-by: Daniel Vetter + +commit f129ee8a39eaaa2b9a8c97d845309e372af00ce9 +Author: Tiago Vignatti +Date: Fri Mar 18 15:08:56 2016 -0300 + + prime_mmap_coherency: Add return error tests for prime sync ioctl + + This patch adds ioctl-errors subtest to be used for exercising prime sync ioctl + errors. + + The subtest constantly interrupts via signals a function doing concurrent blit + to stress out the right usage of prime_sync_*, making sure these ioctl errors + are handled accordingly. Important to note that in case of failure (e.g. in a + case where the ioctl wouldn't try again in a return error) this test does not + reliably catch the problem with 100% of accuracy. + + v2: fix prime sync direction when reading mmap'ed file. + v3: change the upper bound using time rather than loops + + Cc: Chris Wilson + Signed-off-by: Tiago Vignatti + [ickle: fix memleak, run for longer] + +commit dbc74dd99097adc2bd32cd5945186791a8d2d806 +Author: Rodrigo Vivi +Date: Thu Mar 17 14:37:39 2016 -0700 + + intel: Adding missing Broxton PCI IDs. + + These IDs were already part of the kernel since: + + kernel commit 985dd4360fdf2533fe48a33a4a2094f2e4718dc0 + Author: Imre Deak + Date: Thu Jan 28 16:04:12 2016 +0200 + + drm/i915/bxt: update list of PCIIDs + + Signed-off-by: Rodrigo Vivi + Reviewed-by: Arun Siluvery + +commit 5d669bf1ddfb0f16162d91a6a47cf36855bc513e +Author: Chris Wilson +Date: Fri Mar 18 14:44:53 2016 +0000 + + igt/gem_concurent_blit: Exercise different object sizes + + Searching for coherency problems that may arise with + smaller-then-cache/large-then-cache objects. + + Signed-off-by: Chris Wilson + +commit 95090bb50befda15f27c9c5e74991625dd5b40f0 +Author: Chris Wilson +Date: Fri Mar 18 11:49:23 2016 +0000 + + lib/ioctl_wrappers: Explain a couple of igt_require(ret == 0) + + Use more verbose igt_require(), here assocaited with SET_CACHING, such + that the requirements are explained in the debug/failure log. + + Signed-off-by: Chris Wilson + +commit a8a685f877c013c3e5b1f33a5e2201aa436eeffc +Author: Chris Wilson +Date: Fri Mar 18 11:32:04 2016 +0000 + + lib/intel_os: Squelch dmesg spam when purging VM caches + + Signed-off-by: Chris Wilson + +commit 4eba8e22fa738ddf2cd8c367a1a36ee03f20fec7 +Author: Chris Wilson +Date: Fri Mar 18 10:44:31 2016 +0000 + + igt/gem_concurrent_all: struct buffers for all + + Now that we started packaging all parameters in one handy struct, pass + them everywhere. This allows us to pass along requirements so that we + can perform the checks inside each indvidual subtest and so not anger + the igt gods. + + Signed-off-by: Chris Wilson + +commit dcb39b5270b5ff4d91a595ae05c9e74528bce546 +Author: Chris Wilson +Date: Fri Mar 18 09:04:07 2016 +0000 + + igt/gem_softpin: Repeat tests with signal interruptions + + For the long running tests probing error conditions, throwing in the + signal interruptions is a good idea. + + Signed-off-by: Chris Wilson + +commit 34098b71fa1b365ffb0c12fb84ebb7aa26c8f300 +Author: Chris Wilson +Date: Thu Mar 17 09:53:45 2016 +0000 + + lib/igt_gt: Handle SIGINT whilst writing to i915_error_state + + Becareful in case we try and eat the error state whilst interrupts are + being sent and repeat the write() until we finish uninterrupted. + + References: https://bugs.freedesktop.org/show_bug.cgi?id=94573 + Signed-off-by: Chris Wilson + +commit 5df2de7e14ec320223825db7a5a29a1ac7253ba6 +Author: Chris Wilson +Date: Tue Mar 15 09:52:57 2016 +0000 + + igt/gem_exec_whisper: Move testing of "default" engine to standalone + + Exclude the symbolic "default" engine from the interengine sync testing, + and move it onto the standalone testing. + + Signed-off-by: Chris Wilson + +commit c8d5c353bf7eca652fd3a6ad6cd151d3127d2de5 +Author: Ville Syrjälä +Date: Mon Mar 7 19:38:30 2016 +0200 + + tests/pm_rps: Fix assert for sysfs writes + + fprintf() returns a negative value on error. Fix the assert + to catch that. + + Signed-off-by: Ville Syrjälä + +commit f651493a6bcea77b0c8ffe2e4f986bd167d6cb92 +Author: Imre Deak +Date: Tue Mar 15 23:13:43 2016 +0200 + + igt/drv_module_reload_basic: Pass correct inject_load_failure module option + + The latest version of the inject_load_failure module option expects the + number of the checkpoint where the failure should be injected, so adjust + the test accordingly. + + Signed-off-by: Imre Deak + +commit 431f6c49189470763c34f82cc4f688a967310f52 +Author: Mika Kuoppala +Date: Thu Feb 11 12:32:40 2016 +0200 + + tests/gem_evict_alignment: use uint64_t in eviction memory parameters + + With large apertures we need to use uint64_t for + counts and sizes. commit 0e2071411a4d4e1488a821daf522dffde2809e03 + paved way for this but forgot to change the subtest parameters. + + v2: Pass correctly to the copy() also (Chris) + + References: https://bugs.freedesktop.org/show_bug.cgi?id=93849 + Signed-off-by: Mika Kuoppala + +commit 0e2e880e04e344b62c76bc3d12a3f596ae0233cd +Author: Mayuresh Gharpure +Date: Fri Mar 11 13:55:29 2016 +0530 + + lib/igt_kms: Add COMMIT_ATOMIC to igt_display_commit2() + + Co-Author : Marius Vlad + Co-Author : Pratik Vishwakarma + + So far we have had only two commit styles, COMMIT_LEGACY + and COMMIT_UNIVERSAL. This patch adds another commit style + COMMIT_ATOMIC which makes use of drmModeAtomicCommit() + + v2: (Marius) + i)Set CRTC_ID to zero while disabling plane + ii)Modified the log message in igt_atomic_prepare_plane_commit + https://patchwork.freedesktop.org/patch/71945/ + + v3: (Marius)Set FB_ID to zero while disabling plane + https://patchwork.freedesktop.org/patch/72179/ + + v4: (Maarten) Corrected the typo in commit message + https://patchwork.freedesktop.org/patch/72598/ + + v5: Added check for DRM_CLIENT_CAP_ATOMIC in igt_display_init + (Marius) + i)Removed unused props from igt_display_init + ii)Removed unused ret. Changed function to void + iii)Declare the variable before checking if we have + DRM_CLIENT_CAP_ATOMIC. + https://patchwork.freedesktop.org/patch/73505/ + + v6: (Jani) Corrected typo in commit message + + v7: Added is_atomic check for DRM_CLIENT_CAP_ATOMIC in + igt_display_init and igt_atomic_commit + + v8: (Matthew Auld) Replaced for loops by for_each_connected_output and + for_each_plane_on_pipe + (Lionel) Populate properties only if the value has changed + Remove the resetting of values in disable case + Note : I've used Maarten's diff patch + + v9: (Lionel) Added resetting of rotation property + + v10: (Marius) Modified the macro declaration to avoid shadow declaration + warning, also removed one unused variable + + Signed-off-by: Mayuresh Gharpure + Signed-off-by: Pratik Vishwakarma + Signed-off-by: Mayuresh Gharpure + Signed-off-by: Maarten Lankhorst + +commit 314fa179c8718a8d0b383c31576cf145e05bf657 +Author: Chris Wilson +Date: Tue Mar 15 09:44:48 2016 +0000 + + igt/gem_bad_reloc: Rename conflicting negative-reloc-blt + + Signed-off-by: Chris Wilson + +commit 488dc3b1acf825c1db9750b1158de56b50e7b4ff +Author: Chris Wilson +Date: Tue Mar 15 09:16:30 2016 +0000 + + igt/gem_exec_whisper: Beware PIN_HIGH + + Certain kernels/gen like to move execbuf around for relocations, + disrupting our prewritten batches. Be more careful and try and keep the + relocation/execobjects accurate. + + Signed-off-by: Chris Wilson + +commit 1430eb065f110c899ce7f097a002cb1efe33212d +Author: Chris Wilson +Date: Mon Mar 14 20:40:53 2016 +0000 + + igt/gem_bad_reloc: Fix handling of 64bit relocations + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94537 + Signed-off-by: Chris Wilson + +commit f0d5874bd824b4b452607e055fc86b38a399acf8 +Author: Imre Deak +Date: Mon Mar 14 17:17:12 2016 +0200 + + drv_module_reload_basic: skip alive check after load failure injection + + After loading the module with load failure injection enabled don't try + check the alive state. Also limit the number of failure points to + existing ones, to reduce the run time of the test. + + v2: + - make VT binding/snd module loading part of reload and VT bind fail + silently (Chris) + + Signed-off-by: Imre Deak + +commit 772393e806791c9af1c050262c92300c9565e823 +Author: Chris Wilson +Date: Mon Mar 14 14:31:36 2016 +0000 + + igt/gem_exec_nop: Decrease BAT timing + + For basic, since CI doesn't hit the same hard lockup on Braswell that is + possible without hpet, stop running for so long! + + Signed-off-by: Chris Wilson + +commit 2fdf5ac917aad95e9e4ca251b0c35cfa005c2b69 +Author: Chris Wilson +Date: Mon Mar 14 13:41:15 2016 +0000 + + igt/gem_exec_whisper: Exercise rings individually + + Not as stressful as testing inter-ring synchronisation, but it does + allow inspecting the simpler testcases if need be. + + Signed-off-by: Chris Wilson + +commit 5459374120fd1c7d89ec50e2c59df23a126b5dcb +Author: Chris Wilson +Date: Mon Mar 14 14:00:32 2016 +0000 + + lib: Remove dead gem_get_num_rings() + + No users so time to die. + + Signed-off-by: Chris Wilson + +commit 5acda10e7f794cf136f2daebcf4ca66a0ae9324b +Author: Chris Wilson +Date: Mon Mar 14 13:59:18 2016 +0000 + + igt/gem_exec_reloc: Exercise updating relocations of an active object + + Supersedes gem_dummy_reloc_loop. + + Signed-off-by: Chris Wilson + +commit e5abd779cfa1135bdb7218f7b069eb60b553f6da +Author: Chris Wilson +Date: Mon Mar 14 13:36:56 2016 +0000 + + tests/gem_ring_sync_loop: Exercise all rings + + Fix the engine selection to exercise all possible rings and in doing so + completely obsoletes gem_multi_bsd_sync_loop. + + Signed-off-by: Chris Wilson + +commit 3d9bcd080498052e73021efdb1e38b5107c0fcc8 +Author: Chris Wilson +Date: Mon Mar 14 13:24:54 2016 +0000 + + lib: Remove unused gem_has_enable_ring() + + No one uses this nor should they as it just gem_get_param() in disguise + and they are better feature queries for whether individual execution + engines are functional. + + Signed-off-by: Chris Wilson + +commit 8f6ed9e692647a50b19c7838d09d6b6335005ef7 +Author: Chris Wilson +Date: Sat Mar 12 11:20:03 2016 +0000 + + igt/gem_exec_whisper: Persistent relocation support + + The goal is to test interengine synchronisation so remove any likelihood + that we introduce synchronisation for performing relocations. + + Signed-off-by: Chris Wilson + +commit f14d56c42d9e43df2790465aba6a2ea2593418fc +Author: Chris Wilson +Date: Fri Mar 11 21:25:48 2016 +0000 + + igt/drv_module_reload_basic: Rinse and repeat with addition module parameters + + An idea for testing failure paths along module load is to use a parameter + to perform fault injection. This rudimentary framework should get us + started. + + Signed-off-by: Chris Wilson + +commit 9eacbd2acd19aa91d9a21029957799f66cc8fef3 +Author: Chris Wilson +Date: Fri Mar 11 14:31:56 2016 +0000 + + igt/gem_exec_whisper: Test submission between fds + + Signed-off-by: Chris Wilson + +commit 6291678f316405ddd6885831701b7512228218b2 +Author: Chris Wilson +Date: Fri Mar 11 14:16:13 2016 +0000 + + igt/gem_exec_whisper: Stop passing NO_RELOC + + We don't preserve the execobj.offset nor set the right values into the + batches between iterations. + + Signed-off-by: Chris Wilson + +commit d99db0990e6b6aae43bcda13dc0f6e46335cffa8 +Author: Chris Wilson +Date: Fri Mar 11 12:01:55 2016 +0000 + + igt/gem_exec_whisper: Don't forget that 0 is a valid address on full-ppgtt + + Signed-off-by: Chris Wilson + +commit d264c73929e95f5dfb26235b8e6e9af7dca4b701 +Author: Derek Morton +Date: Thu Mar 10 14:27:05 2016 +0000 + + benchmarks/gem_syslatency: Add extra android guard to attr_setaffinity_np + + Android defines __USE_GNU but does not provide pthread_attr_setaffinity_np() + so added an extra guard arround pthread_attr_setaffinity_np(). + + Signed-off-by: Derek Morton + +commit 5615ab2a9dceaf101e1faa0fa132ef1dadbabc04 +Author: Chris Wilson +Date: Fri Mar 11 10:48:47 2016 +0000 + + tests: Add gem_exec_whisper + + A more complicated store variant to stress inter-engine dependencies + (i.e. semaphores and sync). We write a control value from one batch into + the next and then execute it. This is repeated a few times with each + execution happening on a different engine (so the kernel has to + serialise operations between engines) until we finally write the value + out into our scratch buffer where we can check the result, just like a + Chinese whisper. + + Signed-off-by: Chris Wilson + +commit 3e2443f8386166dbd2586af1d454b766182f04b3 +Author: Chris Wilson +Date: Thu Mar 10 11:50:53 2016 +0000 + + igt/gem_exec_nop: Fix logical inversion for checking of valid execbuf + + Only if the trial __gem_execbuf reports an error do we want to remove + the fancy LUT flags. + + Signed-off-by: Chris Wilson + +commit 544ba6ca88e9ff01fd9f308252f5e08679b275da +Author: Chris Wilson +Date: Thu Mar 10 12:25:59 2016 +0000 + + benchmarks/gem_syslatency: Guard setaffinity_np + + pthread_setaffinity_np is a GNU extensions, so add some __USE_GNU + ifdeffry and hope for the best if unavailable. + + Signed-off-by: Chris Wilson + +commit 778f0796e8afd977ac2f455f2a71c62683ff2006 +Author: Chris Wilson +Date: Thu Mar 10 10:40:05 2016 +0000 + + igt/gem_reloc_overflow: 32bit compilation warning + + gem_reloc_overflow.c: In function ‘__real_main365’: + gem_reloc_overflow.c:384:3: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 6 has type ‘size_t’ [-Wformat=] + igt_require_f(mlock(reloc, reloc_size) == 0, + ^ + + Signed-off-by: Chris Wilson + +commit 5ec85f5bf8969e46cd70cffccaafb62078355414 +Author: Chris Wilson +Date: Thu Mar 10 10:36:24 2016 +0000 + + igt/gem_concurrent_blit: 32bit compilation warning + + gem_concurrent_all.c: In function ‘__real_main1556’: + gem_concurrent_all.c:1642:4: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 4 has type ‘uint64_t’ [-Wformat=] + igt_debug("Pinning %ld MiB\n", pin_sz); + + Signed-off-by: Chris Wilson + +commit eb59497a83323b9fd02e24ae21a78d795d220351 +Author: Chris Wilson +Date: Thu Mar 10 10:35:37 2016 +0000 + + igt/drv_hangman: 32bit compilation warning + + drv_hangman.c: In function ‘hangcheck_unterminated’: + drv_hangman.c:290:27: warning: integer overflow in expression [-Woverflow] + int64_t timeout_ns = 100 * NSEC_PER_SEC; /* 100 seconds */ + + Signed-off-by: Chris Wilson + +commit 3e0d9ef02cc38ab8b121acfa99ff205305aa4442 +Author: Chris Wilson +Date: Thu Mar 10 10:14:25 2016 +0000 + + benchmarks/gem_syslatency: Subtract the clock_gettime() overhead + + Since clock_gettime() should be a fixed overhead that adds to the + latency result, subtract it from the result. + + Signed-off-by: Chris Wilson + +commit 2a41c4b18391c2cd9094101edcdfdb6811313399 +Author: Chris Wilson +Date: Thu Mar 10 09:27:32 2016 +0000 + + benchmarks/gem_syslatency: Prevent CPU sleeps (C-states) + + In order to keep the latency as low as possible for the idle load, we + need to keep the CPU awake. Otherwise we end up with the busy workload + having lower latency than the idle workload! + + Signed-off-by: Chris Wilson + +commit c084c2b88b1ef6a1453de8a24b7a4cf01a82e0d2 +Author: Chris Wilson +Date: Thu Mar 10 08:40:06 2016 +0000 + + benchmarks/gem_syslatency: Measure unloaded latency + + Also useful to know how much worse than baseline the latency is when the + gem load is applied. For slower systems, presenting in nanoseconds makes + it hard to read, so switch to microseconds for output. + + Signed-off-by: Chris Wilson + +commit 6cd15fb930793f441eaa829bd087ac34e644e492 +Author: Chris Wilson +Date: Wed Mar 9 22:39:16 2016 +0000 + + benchmarks: Add gem_syslatency + + Instead of measuring the wakeup latency of a GEM client, we turn the + tables here and ask what is the wakeup latency of a normal process + competing with GEM. In particular, a realtime process that expects + deterministic latency. + + Signed-off-by: Chris Wilson + +commit 0aacdac56fc3179b1fe6bc28bb1a3beb64c64619 +Author: Chris Wilson +Date: Wed Mar 9 21:06:16 2016 +0000 + + igt/gem_exec_nop: Only combine unique rings + + Ignore the default ring as that is purely symbolic. On BSD2 systems it + is similarly useful to ignore the symbolic BSD ring. + + Signed-off-by: Chris Wilson + +commit e1ca201fe9ac23e187aeaf5143d9720042aead88 +Author: Daniel Vetter +Date: Wed Mar 9 14:49:27 2016 +0100 + + tests/gem_reloc_overflow: Add missing igt_fixture + + Boom when running with --list on non-intel machines or as non-root. + + Signed-off-by: Daniel Vetter + +commit 598deeda52c068257812d077937f0592be867e4f +Author: Daniel Vetter +Date: Wed Mar 9 14:44:45 2016 +0100 + + lib: remove saved_sig_mask + + Oversight from the exit handler cleanup, spotted by Chris Wilson. + + Signed-off-by: Daniel Vetter + +commit c684065be080d446018f5fc34de647d8e39d04e0 +Author: Chris Wilson +Date: Wed Mar 9 11:35:50 2016 +0000 + + igt/gem_exec_store: The simplest batch that does something! + + A very simple, the simplest!, batch that can execution on any known + engine that just writes a value into memory. + + Signed-off-by: Chris Wilson + +commit 93824f0cd09f7f7fec6366504c46b3ede5223436 +Author: Daniel Vetter +Date: Thu Feb 18 13:37:16 2016 +0100 + + lib: Unit test for exit handler + + Checks that + - exit handlers are run only once, even when registered multiple + times. + - run in reverse order + - actually run for all ways a test could exit. + + This is prep work to extend exit handlers to also work in a subtest + aware way. + + Signed-off-by: Daniel Vetter + +commit 78f2ea3bc8ff450ea675919bcd1f3fc5747b8ee8 +Author: Daniel Vetter +Date: Thu Feb 18 00:24:33 2016 +0100 + + lib/igt_core: remove igt_disable/enable_exit_handlers + + No longer needed, and also not really a safe idea. + + Signed-off-by: Daniel Vetter + +commit 926bcc56f97a5a3bea8d058f2c56bc575eaf024c +Author: Daniel Vetter +Date: Thu Feb 18 00:22:38 2016 +0100 + + gitignore: Add .dirstamp + + autofu apparently adds these files for non-recoursive make. Fallout + from the uwildmat addition. + + While at it also exclude stuff generated by make distcheck + + Cc: Derek Morton + Signed-off-by: Daniel Vetter + +commit c644c551777a1867b45bd4bc0f83fa333ac5af29 +Author: Daniel Vetter +Date: Thu Feb 18 00:17:11 2016 +0100 + + tests/kms_mmap_write_crc: Use the right fork helpers + + For a background task the fork helpers are more appropriate, since we + can explicitly cancel children. Also, anything that does real work is + supposed to be in fixtures. + + Cc: Tiago Vignatti + Signed-off-by: Daniel Vetter + + -- + Tiago, can you pls check that I haven't broken anythig? + + Thanks, Daniel + +commit 771dbb06b52247ce86222b0d88c7ee48616c7a22 +Author: Daniel Vetter +Date: Wed Feb 17 18:33:50 2016 +0100 + + lib/igt_kms: Don't disable exit handlers around set_vt_mode + + This was originally added to work around a race, but then that's + broken now. And set_vt_mode generally never results in a test binary + crash, so overkill. + + I want to get rid of this interface since I spotted some abuse. + + Signed-off-by: Daniel Vetter + +commit 74761382b3cf4093da4d10a7b92d25721ad92fc7 +Author: Chris Wilson +Date: Tue Mar 8 14:10:56 2016 +0000 + + benchmarks/gem_latency: Replace igt_stats with igt_mean + + Use a simpler statically allocated struct for computing the mean as + otherwise we many run out of memeory! + + Signed-off-by: Chris Wilson + +commit 3a7325e4989352c7a3150628e0f941573dffbf62 +Author: Chris Wilson +Date: Tue Mar 8 11:43:31 2016 +0000 + + igt/gem_exec_nop: Add a basic test + + Demonstrate how trivial it is to lockup Braswell, at least my N3050 nuc, + by saturating the interrupt handler with a few requests. + + References: https://bugs.freedesktop.org/show_bug.cgi?id=93467 + Signed-off-by: Chris Wilson + +commit 1985459b095cb463d434b6be91a464998ff538d9 +Author: Chris Wilson +Date: Fri Mar 4 21:06:40 2016 +0000 + + igt/gem_ringfill: Check full rings across suspend/hibernate + + Signed-off-by: Chris Wilson + +commit d8842d385cf4cc7928b478d45274320620bfdcc7 +Author: Chris Wilson +Date: Fri Mar 4 20:28:28 2016 +0000 + + igt/gem_exec_suspend: Check with both cached/uncached objects + + Keep an eye on domain tracking for both cached/uncached objects across + suspend. + + Signed-off-by: Chris Wilson + +commit 697c3f5550d8a58901c010635ecb7a76a524d296 +Author: Chris Wilson +Date: Fri Mar 4 10:19:38 2016 +0000 + + lib: Magic for_each_engine() macro to iterate over available engines + + Signed-off-by: Chris Wilson + +commit 60eafc548911d8625d20443a203c5aff3662c39a +Author: Chris Wilson +Date: Fri Mar 4 09:40:51 2016 +0000 + + igt/gem_exec_suspend: Do pre/post suspend double checks + + Check that the system operates normally before and after the suspend (as + well as across the suspend). The goal is to isolate the breakage to the + subtest. + + Signed-off-by: Chris Wilson + +commit 9ba9af2ea4306796cbb72c76bc0de05a0fb14c6b +Author: Chris Wilson +Date: Fri Mar 4 20:38:16 2016 +0000 + + lib: Skip execution in gem_has_ring() + + By looking for a particular error we can avoid actually executing + anything when testing whether the kernel supports an individual ring. + + Signed-off-by: Chris Wilson + +commit 0501dcfd0fd93709366db43d37c0aba09aab81b4 +Author: Chris Wilson +Date: Fri Mar 4 15:35:24 2016 +0000 + + lib: Flush all possible rings + + Signed-off-by: Chris Wilson + +commit 310f99ceb86a13d10665cd7c7861bfd1cbeff8ed +Author: Chris Wilson +Date: Fri Mar 4 15:03:42 2016 +0000 + + lib: Flush BSD2 as well when available + + When flushing work and idling the GPU, we need to flush all engines, + including the forgotten BSD2. + + Signed-off-by: Chris Wilson + +commit 2d2b61e1608433733de3d04a492d0d85a93933cd +Author: Chris Wilson +Date: Mon Mar 7 15:34:02 2016 +0000 + + igt/gem_reloc_overflow: Fix errno tests for "overflow" + + The execbuffer2 ABI is not strictly limited to a total of UINT32_MAX + entries, rather each object can have a maximum of UINT32_MAX relocation + entries and the current implementation imposes that the total must be + allocable in a contiguous buffer when necessary (i.e as large as the + kernel can conceivably allocate). This is not an ABI constraint per-se, + just an implementation issue. + + Whilst updating the limits for 64bit kernels, review usable of + ioctl-wrappers (i.e. use __gem_execbuf now available) and include a + batch of more tests to explore the boundary conditions of the maximum + relocation size. Note that rather than guess the reloc-max, it would be + better if we queried it. Also it is of vital importance that when + constructing a test to fail in a particular fashion, it must not include + any other error (e.g. we were passing in relocation arrays with invalid + target handle and domains when looking for a potential overflow across + multiple objects). + + Signed-off-by: Chris Wilson + +commit ec1ac2e2e952778c204374a6d186ec40951bc256 +Author: Chris Wilson +Date: Mon Mar 7 14:01:18 2016 +0000 + + igt/pm_rpm: Wait for PCI D3 + + The transition to PCI device state D3 is not instantaneous and only + started when runtime suspended. Allow the driver/hardware a little bit + of time to complete the transition before declaring a test failure. + + References: https://bugs.freedesktop.org/show_bug.cgi?id=93123 + Signed-off-by: Chris Wilson + +commit 174a06b129d63a09486dd9ee8d6368cbf46a64c1 +Author: Tvrtko Ursulin +Date: Fri Mar 4 14:39:06 2016 +0000 + + gem_ppgtt: Fix flink-and-exit-vma-leak for engine->last_context + + Now that engines keep references on the last executed contexts, + to fix this test we need to execute an unrelated context last to + ensure the one we are interested in is free to be cleaned up when + we expect it to be. + + Signed-off-by: Tvrtko Ursulin + +commit afa38a4d454c4d7058e56fd84d5b9fe42dad1ee2 +Author: Marius Vlad +Date: Mon Mar 7 12:59:55 2016 +0200 + + tests/kms_setmode: Fix compilation warnings. + + kms_setmode.c:384:30: warning: declaration of ‘drm_fd’ shadows a global + declaration [-Wshadow] + + kms_setmode.c:45:12: note: shadowed declaration is here static int drm_fd; + + kms_setmode.c:391:38: warning: passing argument 8 of ‘drmModeSetCrtc’ + discards ‘const’ qualifier from pointer target type + [-Wdiscarded-qualifiers] ids, crtc->connector_count, &crtc->mode); + + Signed-off-by: Marius Vlad + Signed-off-by: Maarten Lankhorst + +commit b33a78b9b1bb5e0f718dfaf44497b07bd468372f +Author: Maarten Lankhorst +Date: Tue Feb 23 16:23:26 2016 +0100 + + tests/kms_setmode: Add tests when not stealing encoders on same crtc. + + Excercise connector stealing harder. There is a border case in atomic currently where + encoder stealing is not prevented on the same crtc when the encoder is not reassigned. + + The following testcase excercises that path and causes a OOPS on my system with nightly. + + Signed-off-by: Maarten Lankhorst + Reviewed-by: Daniel Vetter + +commit 364d3785bfa240a56c350970d4523c5e59390184 +Author: Paulo Zanoni +Date: Fri Mar 4 18:48:24 2016 -0300 + + tests/kms_draw_crc: remove hardcoded PIPE_A + + The test used to assume pipe A was being used for everything, and we + tried to fix this in commit "tests: fix CRTC assignment for a few + tests", but the pipe CRC code was forgotten. + + Signed-off-by: Paulo Zanoni + +commit 55fa16b6547ee9b0f305fee8bf14338626f91dfa +Author: Gabriel Feceoru +Date: Fri Mar 4 12:02:14 2016 +0200 + + kms_frontbuffer_tracking: Remove hardcoded PIPE_A + + Use the pipe which is given from the possible_crcs for that connected port + instead. + + On BSW there are constrains for the crtc<-->connector, this fix make this test + passing on BSW. + + v2 (from Paulo): bikeshed the blank lines. + + Signed-off-by: Gabriel Feceoru + Signed-off-by: Paulo Zanoni + +commit 5267f2447146b1d8fc555f0d8253bd8eb215f39b +Author: Paulo Zanoni +Date: Wed Feb 24 17:34:00 2016 -0300 + + kms_frontbuffer_tracking: add missing igt_remove_fb calls + + Let's be good citizens and properly handle our garbage. + + Signed-off-by: Paulo Zanoni + +commit d8bf28f0cbe990d5b1906c686cdaa76c74b1cffd +Author: Paulo Zanoni +Date: Fri Feb 26 11:27:20 2016 -0300 + + tests: fix CRTC assignment for a few tests + + All the tests I wrote always assumed that every connector supported + CRTC 0. This is not the case for BSW and possibly others, so fix the + tests before the CI reports more failures. + + Signed-off-by: Paulo Zanoni + +commit 9751e602b7e10310b011586fe16d7eea2cfb9026 +Author: Paulo Zanoni +Date: Fri Feb 26 09:54:43 2016 -0300 + + kms_frontbuffer_tracking: try harder to find suitable connectors + + Instead of just giving preference to an eDP primary connector, give + preference to one that's eDP and supports pipe A, then try lesser + optimal combinations later. + + We could try to make our test suite use different sets of connectors + when testing FBC and PSR, but that would require some rework, and we + would still be helpless when testing the combination of FBC+PSR. + + Also notice that we still hardcode pipe A for the primary connector, + regardless of whether it supports it. This will be solved in the next + commits. + + Signed-off-by: Paulo Zanoni + +commit 1d5dbbf844852d520b40e6cdf7cddf53b8f72b47 +Author: Paulo Zanoni +Date: Fri Feb 26 09:12:21 2016 -0300 + + kms_frontbuffer_tracking: extract find_connector function + + We're going to make our search for connnectors a little more + complicated, so extract the function since we're going to call it a + few more times. + + Signed-off-by: Paulo Zanoni + +commit b1388963313ba701816cef7b7e470709ba50b5d3 +Author: Paulo Zanoni +Date: Fri Feb 26 08:57:31 2016 -0300 + + kms_frontbuffer_tracking: don't pass the crtc idx to init_mode_params + + We already pass the crtc id, so use the id to retrieve the index. + We'll change the way we pass the crtc id in the next commits, so we'll + have to call a function to calculate the index based on the id at that + point. Do the change now in order to avoid big commits later. + + Signed-off-by: Paulo Zanoni + +commit c6279ec4bbbc628bf8d759d17528d32d5469db61 +Author: Paulo Zanoni +Date: Fri Feb 26 08:54:57 2016 -0300 + + lib/igt_kms: add kmstest_get_crtc_idx + + Move it from pm_rpm.c to lib/igt_kms and remove the hardcoded version + from kms_frontbuffer_tracking. I'm also planning to add other callers. + + Signed-off-by: Paulo Zanoni + +commit b6b130c5ebb82145000eed0b16f951d844e8a126 +Author: Jani Nikula +Date: Tue Mar 1 12:57:25 2016 +0200 + + man: update intel_reg.rst to be more in line with the others + + Use the definitions and formatting used in other man pages, etc. + + Signed-off-by: Jani Nikula + +commit cc7387f17ce5750fc640355d94ed60b6936c2d7b +Author: Jani Nikula +Date: Tue Mar 1 12:57:48 2016 +0200 + + man: rewrite manual pages in reStructuredText + + intel_reg.rst was the first man page written in reStructuredText. Follow + suit with the rest of the man pages. + + Add a generated defs.rst include file for definitions such as + intel-gpu-tools version. This replaces the MAN_SUBSTS sed script + substitutions from xorg-macros for old man pages. + + Signed-off-by: Jani Nikula + +commit 037bc69fde7e66511781ebd3fb3f712056fc1ff2 +Author: Ville Syrjälä +Date: Fri Feb 12 21:28:54 2016 +0200 + + lib/igt_fb: Fix gen2 and 915 Y tile sizes + + gen2 tile dimensions are 128x32 for both X and Y tiling + 915 tile dimensions are 512x8 for both X and Y tiling + + Fix igt_get_fb_tile_size() to return the correct Y tile dimensions + for these platforms. X tile was fine already. + + Cc: Paulo Zanoni + Signed-off-by: Ville Syrjälä + +commit 0c0287322069cfac97011b6d24d906a10cfd6b25 +Author: Ville Syrjälä +Date: Fri Feb 12 21:15:07 2016 +0200 + + lib/igt_kms: Fix igt_fb_set_size() debug message + + The debug message in igt_fb_set_size() was copy pasted + from igt_fb_set_position() and not adjusted to say the + right thing. Fix it up. + + Signed-off-by: Ville Syrjälä + +commit 7499b913b340c56f9d566cc13300d305385eea96 +Author: Chris Wilson +Date: Thu Mar 3 11:51:18 2016 +0000 + + lib/igt_gt: Replace asm clflush/mfence with __builtin_ia32 variants + + Signed-off-by: Chris Wilson + +commit 4133c7f85bbb89684c326b0ab178c7c11b09df22 +Author: David Weinehall +Date: Wed Mar 2 19:01:28 2016 +0200 + + tests/pm_rpm: Fix CRASH on machines that lack LLC + + On machines that lack an LLC the pm-caching subtest will + terminate with sigbus and thus CRASH during the + I915_CACHING_CACHED iteration. To work around this we reset + the caching to I915_CACHING_NONE before doing memory access. + + v2: Various improvements based on feedback from Chris Wilson + + v3: Fix incorrect Signed-off-by: line + + v4: Further improvements based on feedback from Chris Wilson + + Signed-off-by: David Weinehall + Reviewed-by: Imre Deak + Signed-off-by: Marius Vlad + +commit cb4589af094cd839ab50d4ca9836d5d6a65e063c +Author: Chris Wilson +Date: Thu Mar 3 10:15:35 2016 +0000 + + lib: Tidy testing for rtcwake + + When performing a dummy-run of rtcwake, hide the output as it doesn't + print anything useful (just when it will wake up). + + Signed-off-by: Chris Wilson + +commit af22497ac99d77f4d1d70372d9039c4dc0905995 +Author: Chris Wilson +Date: Thu Mar 3 10:11:54 2016 +0000 + + igt/gem_softpin: Check norelocations hold versus suspend/resume + + Signed-off-by: Chris Wilson + +commit 95fbf7efed07a58edf39f28b3ad485b8792e4548 +Author: Chris Wilson +Date: Thu Mar 3 09:05:13 2016 +0000 + + igt/gem_exec_basic: Check that we don't write into the const execbuf arg + + For good measure, also check that we can read the args from a GTT + mmaping. + + Signed-off-by: Chris Wilson + +commit a25983e0b12c99bb49ce8e83d40f46bf1aed8298 +Author: Chris Wilson +Date: Wed Mar 2 16:35:40 2016 +0000 + + igt/gem_exec_suspend: Exercise simple exec-and-read across suspend + + Signed-off-by: Chris Wilson + +commit 18d0b1efb8759000d7ccb82334ea823b9857dfc9 +Author: Chris Wilson +Date: Wed Mar 2 14:12:12 2016 +0000 + + lib/igt_fb: Fix domain tracking for GTT cairo surfaces + + If we create a cairo surface using a GTT mmaping, then we need to use + the GTT access domain. cairo surfaces created with a blit temporary (for + unfenced surfaces) still use the CPU domain. + + Signed-off-by: Chris Wilson + +commit 5533f22c354af2efd137a2f711d2e1ec86d70cb2 +Author: Chris Wilson +Date: Wed Mar 2 13:57:35 2016 +0000 + + lib: Show the command that fails when suspending + + Include the system("") in the debug output for the assertion failure. + + Signed-off-by: Chris Wilson + +commit a3de0bc9df07918d08298d954127f07085a086e5 +Author: Chris Wilson +Date: Wed Mar 2 10:11:14 2016 +0000 + + tests/drv_missed_irq_hang: Wait harder + + Improve the busy-load for triggering a wait-on-interrupt and check for + extraneous missed-interrupts before and after our tests. + + References: https://bugs.freedesktop.org/show_bug.cgi?id=88437 + Signed-off-by: Chris Wilson + +commit 02befb8b03f8c052394670f9988571429d13b227 +Author: Chris Wilson +Date: Wed Mar 2 09:19:28 2016 +0000 + + igt/gem_ctx_create: Exercise implicit per-fd context creation + + Signed-off-by: Chris Wilson + +commit fbe92a222ecffbb848147509674b4c12377d7a4d +Author: Chris Wilson +Date: Tue Mar 1 21:18:51 2016 +0000 + + igt/gem_ctx_create: Exercise a trivial allocation failure + + Trying to allocate and use lots of contexts with execlists and !llc end + ups in faliure very quickly. + + Signed-off-by: Chris Wilson + +commit 1112abe5ece9b2a991c9af2d11b6943784e0e657 +Author: Marius Vlad +Date: Tue Mar 1 18:01:33 2016 +0200 + + Bump again to 1.14, as Chris managed to push before I got chance to do a + release. Modified REAMDE to include link for doing releases. + + Signed-off-by: Marius Vlad + +commit f3751d53bda785810acf85692e809627360252bf +Author: Chris Wilson +Date: Tue Mar 1 15:06:43 2016 +0000 + + benchmarks/gem_blt: Measure the throughput of synchronous copies + + Signed-off-by: Chris Wilson + +commit b59bcb811a402c716302f61ca8d4d9af6a967807 +Author: Marius Vlad +Date: Tue Mar 1 17:03:55 2016 +0200 + + NEWS: Updates and bump release to 1.14. + + Signed-off-by: Marius Vlad + +commit 95ca7644dbed799744b877d3b451d86c286627fe +Author: Daniele Ceraolo Spurio +Date: Tue Mar 1 11:01:33 2016 +0000 + + tests/drv_hangman: test for acthd increasing through invalid VM space + + The hangcheck logic will not flag an hang if acthd keeps increasing. + However, if a malformed batch jumps to an invalid offset in the ppgtt it + can potentially continue executing through the whole address space + without triggering the hangcheck mechanism. + + This patch adds a test to simulate the issue. I've kept the test running + for more than 10 minutes before killing it on a BDW and no hang occurred. + I've sampled i915_hangcheck_info a few times during the run and got the + following: + + Hangcheck active, fires in 468ms + render ring: + seqno = fffff55e [current fffff55e] + ACTHD = 0x47df685ecc [current 0x4926b81d90] + max ACTHD = 0x47df685ecc + score = 0 + action = 2 + instdone read = 0xffd7ffff 0xffffffff 0xffffffff 0xffffffff + instdone accu = 0x00000000 0x00000000 0x00000000 0x00000000 + + Hangcheck active, fires in 424ms + render ring: + seqno = fffff55e [current fffff55e] + ACTHD = 0x6c953d3a34 [current 0x6de5e76fa4] + max ACTHD = 0x6c953d3a34 + score = 0 + action = 2 + instdone read = 0xffd7ffff 0xffffffff 0xffffffff 0xffffffff + instdone accu = 0x00000000 0x00000000 0x00000000 0x00000000 + + Hangcheck active, fires in 1692ms + render ring: + seqno = fffff55e [current fffff55e] + ACTHD = 0x1f49b0366dc [current 0x1f4dcbd88ec] + max ACTHD = 0x1f49b0366dc + score = 0 + action = 2 + instdone read = 0xffd7ffff 0xffffffff 0xffffffff 0xffffffff + instdone accu = 0x00000000 0x00000000 0x00000000 0x00000000 + + v2: use the new gem_wait() function (Chris) + + v3: switch to unterminated batch and rename test, remove redundant + check, update test requirements (Chris), update top comment + + v4: force gpu reset if the hang detection fails (Mika) + + Cc: Mika Kuoppala + Cc: Arun Siluvery + Cc: Chris Wilson + Signed-off-by: Daniele Ceraolo Spurio + [Mika: removed batch_len=8] + Signed-off-by: Mika Kuoppala + +commit 03c7f84eb1c95b9761bbff3c9fcaed8472c3c6fb +Author: Daniele Ceraolo Spurio +Date: Tue Mar 1 11:01:32 2016 +0000 + + lib: move i915_wedged_set to ig_gt.c + + Upcoming tests will call it to recover from bad states caused by + hangcheck bugs.the function was renamed to igt_force_gpu_reset to have a + naming closer to other hang-related functions in the same file. + + The value written to the debugfs has also been changed to -1; this makes + no differences with the current implementation but copes with upcoming + TDR changes (still under discussion) that should allow the resetting of + a mask of rings. + + Signed-off-by: Daniele Ceraolo Spurio + Signed-off-by: Mika Kuoppala + +commit 094e0cbabb9615c87d8e813a91f158fe439b536d +Author: Chris Wilson +Date: Tue Mar 1 13:22:03 2016 +0000 + + igt/gem_concurrent_blit: Deglobalify num_buffers + + More num_buffers onto the local struct passed down into the tests to + avoid the issue with having to modify the global value inside the tests + leading to hilarity if the test asserts. + + Signed-off-by: Chris Wilson + +commit aed69b56d4c63a19594440be6679307b2781ae2c +Author: Chris Wilson +Date: Thu Feb 25 21:43:01 2016 +0000 + + lib: Add read/write direction support for dmabuf synchronisation + + Allow read-only synchronisation on dmabuf mmaps, useful to allow + concurrent read-read testing between the CPU and GPU. + + Signed-off-by: Chris Wilson + +commit 925e5e1caef9b56bd53df457735514b644c7a399 +Author: Chris Wilson +Date: Mon Feb 29 15:33:26 2016 +0000 + + lib: Check required number of surfaces against VFS file limits + + If we want to create more file handles than VFS supports (itself often a + memory limited value), report that we can not create that many objects + via intel_require_memory(). + + Signed-off-by: Chris Wilson + +commit a508fc86224887c413d99e55b524f3b03a073ed5 +Author: Maarten Lankhorst +Date: Mon Feb 29 10:04:31 2016 +0100 + + tests/kms_force_connector_basic: Disable all crtc's for load-detect. + + Load detection requires a inactive crtc to run. The CI igt tests are + failing, so ensure there is at least 1 inactive crtc. + + Signed-off-by: Maarten Lankhorst + Reviewed-by: Daniel Vetter + +commit 754876378d6c9b2775e8c07b4d16f9878c55949f +Author: Chris Wilson +Date: Fri Feb 26 22:11:10 2016 +0000 + + igt/gem_sync: Enforce a timeout of 20s + + The sync test is supposed to complete in 10s. But some bugs cause it to + run very, very slowly. As a defence against those, terminate the test if + we wait for more than 20s. + + Signed-off-by: Chris Wilson + +commit 3482925454da8c107f720448d24789ce6bf884c4 +Author: Matt Roper +Date: Fri Feb 26 08:46:30 2016 -0800 + + kms_atomic: drop unnecessary connector looping from plane_primary test + + Local variable num_connectors is never initialized before being + auto-incremented in the loop. If we wind up with a non-zero garbage + value, it will lead us to try to write to an out-of-bounds array index. + We should probably initialize it to zero before use. + + However on closer inspection, the plane_primary test doesn't actually + wind up using the connector list or number of connectors, so just remove + the whole block of code; it was probably brought in by accident as part + of a copy-paste operation. + + Cc: Daniel Stone + Signed-off-by: Matt Roper + +commit 405b3478d1ac28141a334fe42e2908f2ea59e976 +Author: Chris Wilson +Date: Fri Feb 26 12:47:33 2016 +0000 + + igt/drv_hangman: Tidy up assertion failure message + + Because + + (drv_hangman:6035) CRITICAL: Failed assertion: !((__extension__ + (__builtin_constant_p (l) && ((__builtin_constant_p (tmp) && strlen + (tmp) < ((size_t) (l))) || (__builtin_constant_p (s) && strlen (s) < + ((size_t) (l)))) ? __extension__ ({ size_t __s1_len, __s2_len; + (__builtin_constant_p (tmp) && __builtin_constant_p (s) && (__s1_len = + strlen (tmp), __s2_len = strlen (s), (!((size_t)(const void *)((tmp) + + 1) - (size_t)(const void *)(tmp) == 1) || __s1_len >= 4) && + (!((size_t)(const void *)((s) + 1) - (size_t)(const void *)(s) == 1) || + __s2_len >= 4)) ? __builtin_strcmp (tmp, s) : (__builtin_constant_p + (tmp) && ((size_t)(const void *)((tmp) + 1) - (size_t)(const void + *)(tmp) == 1) && (__s1_len = strlen (tmp), __s1_len < 4) ? + (__builtin_constant_p (s) && ((size_t)(const void *)((s) + 1) - + (size_t)(const void *)(s) == 1) ? __builtin_strcmp (tmp, s) : + (__extension__ ({ const unsigned char *__s2 = (const unsigned char *) + (const char *) (s); int __result = (((const unsigned char *) (const char + *) (tmp))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = + (((const unsigned char *) (const char *) (tmp))[1] - __s2[1]); if + (__s1_len > 1 && __result == 0) { __result = (((const unsigned char *) + (const char *) (tmp))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) + __result = (((const unsigned char *) (const char *) (tmp))[3] - + __s2[3]); } } __result; }))) : (__builtin_constant_p (s) && + ((size_t)(const void *)((s) + 1) - (size_t)(const void *)(s) == 1) && + (__s2_len = strlen (s), __s2_len < 4) ? (__builtin_constant_p (tmp) && + ((size_t)(const void *)((tmp) + 1) - (size_t)(const void *)(tmp) == 1) ? + __builtin_strcmp (tmp, s) : (- (__extension__ ({ const unsigned char + *__s2 = (const unsigned char *) (const char *) (tmp); int __result = + (((const unsigned char *) (const char *) (s))[0] - __s2[0]); if + (__s2_len > 0 && __result == 0) { __result = (((const unsigned char *) + (const char *) (s))[1] - __s2[1]); if (__s2_len > 1 && __result == 0) { + __result = (((const unsigned char *) (const char *) (s))[2] - __s2[2]); + if (__s2_len > 2 && __result == 0) __result = (((const unsigned char *) + (const char *) (s))[3] - __s2[3]); } } __result; })))) : + __builtin_strcmp (tmp, s)))); }) : strncmp (tmp, s, l))) == 0) + + is a little hard to understand at a glance. + + Signed-off-by: Chris Wilson + +commit 430439541cc1ee6003569bf4b906e5095541e542 +Author: Chris Wilson +Date: Fri Feb 26 10:06:51 2016 +0000 + + igt/gem_sync: Test across all rings simultaneously + + Signed-off-by: Chris Wilson + +commit 0667cf56691e9f72685e36ce506790d8e279183a +Author: Chris Wilson +Date: Fri Feb 26 09:09:51 2016 +0000 + + igt/gem_sync: Add some forked variants + + Repeat the synchronisation test with a few competing processes. + + Signed-off-by: Chris Wilson + +commit d627e30c9e7be7c8ab03fe486ce7ab0d68b5c33c +Author: Chris Wilson +Date: Thu Feb 25 19:54:47 2016 +0000 + + igt/gem_concurrent_blit: Pretend tests exist + + Signed-off-by: Chris Wilson + +commit cf569c216b7b53c2a2f78d9e76a0ea093184c27b +Author: Chris Wilson +Date: Thu Feb 25 17:58:24 2016 +0000 + + igt/gem_concurrent_blit: Add dmabuf exercisers + + Create and use dmabuf mmaps as well to ensure correct synchronisation + between concurrent rendering and CPU access. + + Signed-off-by: Chris Wilson + +commit f27d295fe3a1ca005dfa0fbfd81d6808b1f5ca47 +Author: Chris Wilson +Date: Tue Feb 23 17:45:49 2016 +0000 + + lib: Move gem_wait() to ioctl-wrappers + + We intend to use gem_wait() in more tests than gem_wait.c, so move the + simple ioctl wrapper into the core. + + Signed-off-by: Chris Wilson + +commit babcf40f29d9e9cce5d0739b1784eb94fe91bd26 +Author: Paulo Zanoni +Date: Mon Feb 15 15:00:16 2016 -0200 + + kms_frontbuffer_tracking: add basic subtest + + This test executes one of each of the very basic operations with + whatever features are enabled by default in the Kernel, without + checking their statuses: we only care about the CRCs. Although it's + completely redundant, it will be ran by the CI so we can spot + regressions both in the specific features and in the frontbuffer + tracking subsystem. + + We're not checking sink CRCs since they're still unreliable and we + don't want false negatives in the CI. + + It takes 5 seconds to run this test on my machines. + + Signed-off-by: Paulo Zanoni + +commit b87188795e9fda89c7e376726283a63817e83c60 +Author: Paulo Zanoni +Date: Mon Feb 15 12:15:14 2016 -0200 + + kms_frontbuffer_tracking: don't fail fbc-farfromfence on SKL + + SKL doesn't do the same dspaddr_offset magic as the older gens, so FBC + may not be enabled on fbc-farfromfence. This is not a bug since FBC is + just disabled, and this is the expected case of the current Kernel, so + let's not fail the test. + + If/once we land the proper infrastructure to fix this in the Kernel we + may revert this commit. + + Signed-off-by: Paulo Zanoni + +commit 556535400c0b3058569d7df13fcdea826bdeb875 +Author: Chris Wilson +Date: Fri Feb 19 10:31:44 2016 +0000 + + igt/gem_exec_reloc: Check WC mmaps as well + + Signed-off-by: Chris Wilson + +commit 15deba45756eeeacca2ad83ac931606986f8d669 +Author: David Weinehall +Date: Thu Feb 18 13:08:46 2016 +0200 + + lib/igt_pm: Lib for power management + + Move power management related code to a separate library. + Initially this is done only for workarounds that apply to external + components. Modify the users of such workarounds accordingly. + This currently involves HD audio and SATA link power management. + For SATA link PM there's also code to save the previous settings, + to allow for resetting the values after we've finished testing. + + Signed-off-by: David Weinehall + Reviewed-by: Marius Vlad + Signed-off-by: Marius Vlad + +commit 16038908de5ef491c8c795ae48ed880de235c532 +Author: Chris Wilson +Date: Thu Feb 18 10:35:10 2016 +0000 + + lib: Restore gem_available_aperture_size() + + Missed an error whilst rebasing and trying to modify the previous patch + to keep this function intact... Instead, I now have to add this patch to + restore gem_available_aperture_size() and its one usage. + + Signed-off-by: Chris Wilson + +commit 391b32c3822993a6dd5874d2898b0c16b8eb9d03 +Author: Chris Wilson +Date: Fri Feb 5 18:35:21 2016 +0000 + + igt: Report the global GTT size + + For many tests, the relevant aperture is not the ppGTT but the internal + global GTT managed by the kernel. Use this limit appropriately. + + Signed-off-by: Chris Wilson + +commit e85c530eab9ef20b2708ff36bfc6f6fa3990e1f4 +Author: Chris Wilson +Date: Thu Feb 18 10:27:07 2016 +0000 + + igt: Mark gem_cs_tlb/gem_cs_prefetch as a pair of basic GTT layout tests + + Signed-off-by: Chris Wilson + +commit 3990dd87b60bf8092671cb3c536666936b460b0c +Author: Chris Wilson +Date: Tue Feb 16 14:42:04 2016 +0000 + + igt/gem_ctx_thrash: Combine context thrashing with a render test + + Signed-off-by: Chris Wilson + +commit 3b12d9e6dc115939ddd110c7a7f7ad319b731524 +Author: Chris Wilson +Date: Fri Feb 5 11:46:41 2016 +0000 + + igt/gem_ctx_thrash: Double number of threads/proceesses + + Slightly increase the stress by doubling the number of contending + threads and the number of times we try and use each ctx/fd. + + Signed-off-by: Chris Wilson + +commit ef724ab2bba7a51113542c0bc9e77d34e8935c60 +Author: Derek Morton +Date: Thu Feb 4 12:06:57 2016 +0000 + + lib/igt_core.c: Expand --run-subtest functionality. + + Added extended wildcard support when specifying --run-subtest. + + Wildcard format is as specified in rfc3977 and the uwildmat() implementation + is taken from libinn. + See https://tools.ietf.org/html/rfc3977#section-4 for a description of + allowed wildcard expressions. + + v2: Use comma as list separator (Ville Syrjala) + support both ^ and ! as not operators (Dave Gordon) + + v3: Updated to use uwildmat() (Dave Gordon) + + Signed-off-by: Derek Morton + [danvet: Fixup whitespace. Add #include . Run lint.] + Signed-off-by: Daniel Vetter + +commit 0a45d6ba1371bb879f55d9f75d893552c2f71c97 +Author: Marius Vlad +Date: Fri Feb 12 15:26:10 2016 +0200 + + tests/prime_mmap: Encapsulate check_for_dma_buf_mmap() in igt_fixture. + + This unbreaks distcheck target that in turn runs each test with --list-subtests. + + Signed-off-by: Marius Vlad + +commit 42c7dd1255cd1e37298b76d38ea9962e76efd63a +Author: Marius Vlad +Date: Sun Feb 14 19:14:48 2016 +0200 + + Update MAINTAINERS file. + + Signed-off-by: Marius Vlad + +commit c5c1270f0f0f892f0e2a14c789e85f09f79ef1a6 +Author: Kristian Høgsberg Kristensen +Date: Sat Feb 13 12:37:34 2016 -0800 + + aubdump: Add a get_bo() lookup function + + We'll use this instead of accessing the bo array directly and add a few + sanity checks. + +commit 68a064ec64dab22d353dcde0b3208fa067abed51 +Author: Kristian Høgsberg Kristensen +Date: Sat Feb 13 12:34:22 2016 -0800 + + aubdump: Don't use .so constructors for initializing + + This doesn't seem to work when mixed with constructors in other shared + objects or other creative uses of the linker. Let's stick with a simpler + mechanism, where we look up the libc functions when our hooks are called + for the first time. + +commit a3506b52199d2ac8dbc358fbb562f700f1d9ded4 +Author: Kristian Høgsberg Kristensen +Date: Sat Feb 13 12:33:30 2016 -0800 + + aubdump: Raise SIGTRAP on failure + +commit ca3d355846c0b9746d2d6892bd0a4c1413b2abab +Author: Chris Wilson +Date: Fri Feb 12 16:38:04 2016 +0000 + + igt/gem_userptr_blits: Flip sign on error check + + Following conversion to __gem_execbuf() we need to consider that it + returns -errno when checking the result. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94117 + Signed-off-by: Chris Wilson + +commit ed40329c30b50c69b25c38fa728151ab9dae00cb +Author: Tiago Vignatti +Date: Tue Dec 8 19:37:32 2015 -0200 + + tests: Add prime_mmap_coherency for cache coherency tests + + Different than kms_mmap_write_crc that captures the coherency issues within the + scanout mapped buffer, this one is meant for test dma-buf mmap on !llc + platforms mostly and provoke coherency bugs so we know where we need the sync + ioctls. + + I tested this with !llc and llc platforms, BTY and IVY respectively. + + Signed-off-by: Tiago Vignatti + Reviewed-by: Stéphane Marchesin + Signed-off-by: Daniel Vetter + +commit 7c89c9d7346ca940a4c5d2828ac0c85921fa52c3 +Author: Tiago Vignatti +Date: Mon Aug 10 13:28:37 2015 -0300 + + tests: Add kms_mmap_write_crc for cache coherency tests + + This program can be used to detect when CPU writes in the dma-buf mapped object + don't land in scanout due cache incoherency. + + Although this seems a problem inherently of non-LCC machines ("Atom"), this + particular test catches a cache dirt on scanout on LLC machines as well. It's + inspired in Ville's kms_pwrite_crc.c and can be used also to test the + correctness of the driver's begin_cpu_access and end_cpu_access (which requires + i915 implementation. + + To see the need for flush, one has to run using '-n' option to not call the + sync ioctls which, via a rather simple CPU hog the system will trashes the + caches, while the test will catch the coherency issue. If you now suppress + '-n', then things should just work like expected. + + I tested this with !llc and llc platforms, BTY and IVY respectively. + + v2: use prime_handle_to_fd_for_mmap instead. + v3: merge end_cpu_access() patch with this and provide options to disable sync. + v4: use library's prime_sync_{start,end} instead. + v7: use CPU hog instead and use testing rounds to catch the sync problems. + + Signed-off-by: Tiago Vignatti + Reviewed-by: Stéphane Marchesin + Signed-off-by: Daniel Vetter + +commit 35debab2d9690aa6c26528358e882168e90dcb2b +Author: Tiago Vignatti +Date: Fri Dec 11 18:50:35 2015 -0200 + + lib: Add prime_sync_start and prime_sync_end helpers + + This patch adds dma-buf mmap synchronization ioctls that can be used by tests + for cache coherency management e.g. when CPU and GPU domains are being accessed + through dma-buf at the same time. + + v7: add sync invalid flags test. + + Signed-off-by: Tiago Vignatti + Reviewed-by: Stéphane Marchesin + Signed-off-by: Daniel Vetter + +commit 4edfa09ae4c184177389e339c57d090914936421 +Author: Tiago Vignatti +Date: Wed Jul 29 18:26:29 2015 -0300 + + prime_mmap: Add basic tests to write in a bo using CPU + + This patch adds test_correct_cpu_write, which maps the texture buffer through a + prime fd and then writes directly to it using the CPU. It stresses the driver + to guarantee cache synchronization among the different domains. + + This test also adds test_forked_cpu_write, which creates the GEM bo in one + process and pass the prime handle of the it to another process, which in turn + uses the handle only to map and write. Roughly speaking this test simulates + Chrome OS architecture, where the Web content ("unpriviledged process") maps + and CPU-draws a buffer, which was previously allocated in the GPU process + ("priviledged process"). + + This requires kernel modifications (Daniel Thompson's "drm: prime: Honour + O_RDWR during prime-handle-to-fd") and therefore prime_handle_to_fd_for_mmap is + added to fail in case these lack. Also, upcoming tests (e.g. next patch) are + going to use it as well, so make it public and available in the lib. + + v2: adds prime_handle_to_fd_with_mmap for skipping test in older kernels and + test for invalid flags. + + Signed-off-by: Tiago Vignatti + Reviewed-by: Stéphane Marchesin + Signed-off-by: Daniel Vetter + +commit e0efeb97a970fbbd5adaeef472bf9f78777c6cb4 +Author: Rob Bradford +Date: Wed Jul 29 17:23:58 2015 -0300 + + prime_mmap: Add new test for calling mmap() on dma-buf fds + + This test has the following subtests: + - test_correct for correctness of the data + - test_map_unmap checks for mapping idempotency + - test_reprime checks for dma-buf creation idempotency + - test_forked checks for multiprocess access + - test_refcounting checks for buffer reference counting + - test_dup checks that dup()ing the fd works + - test_userptr make sure it fails when mmaping due the lack of obj->base.filp + in a userptr. + - test_errors checks the error return values for failures + - test_aperture_limit tests multiple buffer creation at the gtt aperture + limit + + v2 (Tiago): Removed pattern_check(), which was walking through a useless + iterator. Removed superfluous PROT_WRITE from gem_mmap, in test_correct(). + Added binary file to .gitignore + v3 (Tiago): squash patch "prime_mmap: Test for userptr mmap" into this one. + v4 (Tiago): use synchronized userptr for testing. Add test for buffer + overlapping. + + Signed-off-by: Rob Bradford + Signed-off-by: Tiago Vignatti + Reviewed-by: Stéphane Marchesin + Signed-off-by: Daniel Vetter + +commit e1f663b543e89a58746b0d0bebb7bab30d325e1c +Author: Tiago Vignatti +Date: Wed Aug 12 15:57:12 2015 -0300 + + lib: Add gem_userptr and __gem_userptr helpers + + This patch moves userptr definitions and helpers implementation that were + locally in gem_userptr_benchmark and gem_userptr_blits to the library, so other + tests can make use of them as well. There's no functional changes. + + v2: added __ function to differentiate when errors want to be handled back in + the caller; bring gem_userptr_sync back to gem_userptr_blits; added gtkdoc. + v8: remove local_i915_gem_userptr from gem_concurrent_all.c to use the global + helpers instead. + + Signed-off-by: Tiago Vignatti + Reviewed-by: Stéphane Marchesin + Signed-off-by: Daniel Vetter + +commit 7670e286f5043d04af0cd1e6df1f092b5bcaf09e +Author: Maarten Lankhorst +Date: Thu Feb 11 12:46:24 2016 +0100 + + kms_force_connector_basic: Add force-load-detect test + + Signed-off-by: Maarten Lankhorst + Reviewed-by: Daniel Vetter + +commit 0e388f409a9cbbcbd9a8fd5cfa4df1e0d09599cc +Author: Daniele Ceraolo Spurio +Date: Mon Feb 1 14:24:37 2016 +0000 + + tests/gem_exec_params: test all valid execution flags + + The control subtest has been extended to check the execution flags for + all the rings that are present in the HW. + + Cc: Chris Wilson + Signed-off-by: Daniele Ceraolo Spurio + Signed-off-by: Daniel Vetter + +commit 2629f3aeef9989297da9bdd2c8dcb607e0bbfcea +Author: Tomeu Vizoso +Date: Tue Feb 9 15:45:37 2016 +0100 + + lib: Fix build when vc4 headers are present + + Automake seems to not like variable assignments indented with tabs. + + Signed-off-by: Tomeu Vizoso + Fixes: 9e5478dc4345 ("lib: Only compile igt_vc4 is we have it") + Signed-off-by: Daniel Vetter + +commit 9e5478dc4345ec8747c4e109ba4f739a26b9341f +Author: Daniel Vetter +Date: Tue Feb 9 09:44:00 2016 +0100 + + lib: Only compile igt_vc4 is we have it + + Unbreaks compilation fail. + + Also appease gcc in gem_exec_basic because. + + Cc: Eric Anholt + Signed-off-by: Daniel Vetter + +commit 467a9fac9bbb6385c0372a6c6a0f1d2f891984e9 +Author: Eric Anholt +Date: Mon Jan 25 10:36:12 2016 -0800 + + igt/vc4_wait_bo: Add tests with rendering performed. + + These caught an unexpected bug with clear colors (we'd get the last + executed clear's color in our new BO), while failing to catch the bug + I'd been hoping to find all along. + + Signed-off-by: Eric Anholt + Reviewed-by: Daniel Stone + +commit e7e094f444ac59ee93b96d9021d8c11d51fecd59 +Author: Eric Anholt +Date: Mon Jan 25 13:13:09 2016 -0800 + + igt/vc4_create_bo: Test various paths in BO creation. + + create-bo-0 fails on the current kernel, and it's something I want to + fix. + + v2: Use do_ioctl_err(). + + Signed-off-by: Eric Anholt + Reviewed-by: Daniel Stone + +commit 59f98997ab315465a052ed11e43ed7f6b0ec708a +Author: Eric Anholt +Date: Mon Jan 25 13:15:36 2016 -0800 + + igt: Add a helper function for creating VC4 BOs. + + v2: Use do_ioctl(). + + Signed-off-by: Eric Anholt + Reviewed-by: Daniel Stone + +commit b8badc243630e88f243b66c20599cfd035286382 +Author: Eric Anholt +Date: Mon Jan 25 10:01:35 2016 -0800 + + igt: Add a helper function for mapping VC4 BOs. + + v2: Use do_ioctl(). + + Signed-off-by: Eric Anholt + Reviewed-by: Daniel Stone + +commit 4880e13d04c005c1d7918b4499be45704dea9aca +Author: Eric Anholt +Date: Fri Jan 22 18:04:29 2016 -0800 + + igt: Add a helper function for getting a VC4 BO that's been drawn to. + + v2: Use do_ioctl(). + + Signed-off-by: Eric Anholt + Reviewed-by: Daniel Stone + +commit 7f421acb60793f5b25a8af5f668197331ba09d2a +Author: Eric Anholt +Date: Fri Jan 22 17:37:46 2016 -0800 + + igt/vc4_wait_bo: Add a test for VC4's wait-for-BO ioctl. + + The pad subtest fails currently. + + v2: Use do_ioctl() and do_ioctl_err(). + + Signed-off-by: Eric Anholt + Reviewed-by: Daniel Stone + +commit d333a0ed69937cefdfe9b9937f6d9556e1c2238d +Author: Eric Anholt +Date: Fri Jan 22 17:18:29 2016 -0800 + + igt/vc4_wait_seqno: Add a test for VC4's wait-for-seqno ioctl. + + v2: Use do_ioctl_err(). + + Signed-off-by: Eric Anholt + Reviewed-by: Daniel Stone + +commit 3f83f07039753131f01dbc09f312ffd61c088e31 +Author: Eric Anholt +Date: Fri Jan 22 17:18:56 2016 -0800 + + igt: Add support for DRIVER_VC4 flags on tests. + + Signed-off-by: Eric Anholt + Reviewed-by: Daniel Stone + +commit ceca9ef8d0a9fb64c1a4da11381f13adb6eca303 +Author: Eric Anholt +Date: Mon Jan 25 11:40:15 2016 -0800 + + configure.ac: Test for libdrm_vc4 and build vc4 tests based on it. + + Signed-off-by: Eric Anholt + Reviewed-by: Daniel Stone + +commit 8d441ee491ad91d67a650d99cc1bcd3ccbb9b662 +Author: Damien Lespiau +Date: Mon Feb 8 12:01:48 2016 +0000 + + list-workarounds: Fix python 2 print statement + + That script is a python 3 script, so we can't use the python 2 print + statement, it's a function now. + + I missed it in the review because reviewing a diff without additional + context gives you a partial story. + + Cc: Sameer Kibey + Cc: Dylan Baker + Signed-off-by: Damien Lespiau + +commit fb9df0e5102253ab5b1017fc5347209727552831 +Author: Kibey, Sameer +Date: Fri Feb 5 13:55:19 2016 -0800 + + list-workarounds: Extend the script to Mesa + + Updated the list-workarounds script so that it + can parse Mesa directory if provided. Moved the + common code to a separate function to allow + reuse for both kernel and mesa. + + The new command line is: + Usage: list-workarounds [options] path-to-kernel + -k path-to-kernel -m path-to-mesa + + The legacy usage is retained to avoid breaking + backwards compatibility. New parameters -k and + -m are added for the new behavior. + + Either kernel or mesa or both paths can be specified. + If path-to-mesa is invalid, error is reported. + + Signed-off-by: Sameer Kibey + Signed-off-by: Damien Lespiau + Reviewed-by: Damien Lespiau + +commit 6b3c832cfb0f9a4bd4e6784e0d0c70788937537b +Author: Chris Wilson +Date: Fri Dec 11 21:34:42 2015 +0000 + + igt/gem_workarounds: Convert to real GPU hang injection + + Signed-off-by: Chris Wilson + +commit 6f7372f6644bed5b615d24bedc06fa84488e3c39 +Author: Chris Wilson +Date: Fri Feb 5 15:55:40 2016 +0000 + + igt/gem_exec_alignment: Fix off-by-one in buffer objects + + When reducing the buffer count to fit into the aperture whilst aligned, + remember to adjust the pointer so that the batch is the last object! + + Signed-off-by: Chris Wilson + +commit b081257d749b536de857952037ad3d9bbe40ddad +Author: Chris Wilson +Date: Fri Feb 5 15:33:23 2016 +0000 + + igt/gem_exec_alignment: Mark batch buffer as also requiring 48B + + If we completely fill the lower 4G of address space with our alignment + objects, then we also need to mark the batch as requiring high-address. + Though the kernel should be reordering in this case... + + Signed-off-by: Chris Wilson + +commit ffbc59a3ef9b0d4347c43fd03681bbbd9d0e43d8 +Author: Chris Wilson +Date: Fri Feb 5 11:16:18 2016 +0000 + + lib: Silence a common debug message when creating a context + + In context tests, we may create thousands of contexts, the noise from + each requirement passing drowning out the real information. Let's only + do the requirement test (to detect if contexts are meant to be supported + or plain broken) only on the error path. + + Signed-off-by: Chris Wilson + +commit e7faf33ec791b78b2bf1ebb81be228364c3439c4 +Author: Chris Wilson +Date: Thu Feb 4 22:18:33 2016 +0000 + + igt/gem_ctx_thrash: Rewrite to avoid extraneous allocations + + The goal of the test is to exercise what happens when we fill the Global + GTT with the contexts. To that end, we only need to allocate 2/4GiB of + context objects, and can forgo filling each context with buffers. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94005 + Signed-off-by: Chris Wilson + +commit 0e96238bf35959f933b545d2ec85ada6b769cf8b +Author: Chris Wilson +Date: Thu Feb 4 17:41:05 2016 +0000 + + igt/gem_userptr_blits: Limit amount of mlocked surfaces + + When testing surface eviction we don't need that many surfaces as we + mlock surplus memory. Reducing the number of surfaces speeds up the test + and prevents a couple of integer overflow bugs. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94004 + Signed-off-by: Chris Wilson + +commit 7b5a81858193d775c08892b5072019488d7cdb0f +Author: Chris Wilson +Date: Sat Dec 12 18:56:53 2015 +0000 + + igt/gem_reset_stats: Convert from stop-rings to real hang injection + + Signed-off-by: Chris Wilson + +commit 9cc2b1336b60392b834e099ce3a3eb8ea723e29a +Author: Chris Wilson +Date: Fri Dec 11 13:40:11 2015 +0000 + + igt/gem_ctx_exec: Convert from stop-rings to a real GPU hang/reset + + Signed-off-by: Chris Wilson + +commit 38fe49d9a80a45ca529adaf8bbbba63e271ad30d +Author: Chris Wilson +Date: Thu Feb 4 11:17:42 2016 +0000 + + tests/drv_hangman: Convert to using central list of engines + + Rather than encoding our own list of engines, use the common one for + greater coverage. + + Signed-off-by: Chris Wilson + +commit 01e467a6312184f963b82c9004b6d7ce09961cc2 +Author: Chris Wilson +Date: Fri Jan 1 11:29:51 2016 +0000 + + igt/drv_hangman: Make the batchbuffer check more robust + + All the external viewer expects of the GPU error capture is to extract + the exact batch that triggered the hang. Everything else is internal + detail to aide in post-mortem debugging of the kernel driver (i.e. + subject to change) and not of the userspace portion (under control of + the test). + + Signed-off-by: Chris Wilson + +commit 0753057446da0c74843c8a1000f589797da9388d +Author: Chris Wilson +Date: Fri Dec 11 13:27:49 2015 +0000 + + igt/drv_hangman: Inject a true hang + + Wean drv_hangman off the atrocious stop_rings and use a real GPU hang + instead. + + Signed-off-by: Chris Wilson + +commit 8f6957a05a5176037d72d9a4c7d17c9bf8ac8f11 +Author: Chris Wilson +Date: Wed Jan 27 17:14:57 2016 +0000 + + igt/gem_ringfill: Add exercising the default-ring to basic testing + + ringfill generates a few very common errors when submitting requests, + and historically these have been where we have had many implementation + bugs, repeated over and over again. + + Signed-off-by: Chris Wilson + +commit 348742ec0da6f2dff68bcdce02debc8d8538cf02 +Author: Chris Wilson +Date: Fri Jan 29 10:45:43 2016 +0000 + + igt/gem_streaming_writes: Set bb start alignment to 64b for Ironlake + + Signed-off-by: Chris Wilson + +commit 3992babd985e1c70e216cdc42aab3e8872c07ad8 +Author: Chris Wilson +Date: Thu Jan 28 22:01:37 2016 +0000 + + igt/gem_busy: Refactor to use gem_require_ring() + + Now that gem_require_ring() does the right thing with BSD1/BSD2 we can + use it to our advantage here. + + Signed-off-by: Chris Wilson + +commit 3005665ead7b88607269e034f03742d5771dd924 +Author: Paulo Zanoni +Date: Mon Jan 25 19:36:25 2016 -0200 + + tools/intel_residency: use setitimer instead of {,u}alarm + + It seems that Android doesn't have ualarm(). Let's use setitimer() + instead. + + The tool still won't compile on Android due to igt_fb requiring Cairo, + but we're supposed to solve this in another patch since our igt_fb + calls don't actually require Cairo. + + Reported-by: Derek Morton + Tested-by: Derek Morton + Acked-by: Daniel Vetter + Signed-off-by: Paulo Zanoni + +commit ec5deb218de44cdd698a4cdb3e79b63854de15c0 +Author: Paulo Zanoni +Date: Wed Jan 6 18:53:17 2016 -0200 + + tests/pm_rpm: find an appropriate CRTC instead of hardcoding CRTC 0 + + BSW does not allow CRTC 0 to be used on every connector, so we need to + write code to actually find a suitable CRTC. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93124 + Acked-by: Daniel Vetter + Signed-off-by: Paulo Zanoni + +commit 84157ad1b43117798e88c664bf1c82f7421cb770 +Author: Paulo Zanoni +Date: Wed Jan 6 14:45:34 2016 -0200 + + tests/pm_rpm: remove POWER_DIR definition + + Unused ever since we moved some code from pm_rpm.c to lib/. This is + currently defined inside igt_aux.c. + + Acked-by: Daniel Vetter + Signed-off-by: Paulo Zanoni + +commit 7ca55f433c1e1fa722a46d1303524579581d6037 +Author: Paulo Zanoni +Date: Tue Jan 26 10:52:29 2016 -0200 + + tests/igt_fb: rename igt_get_all_formats to igt_get_all_cairo_formats + + I recently had this discussion with Daniel where I didn't want to use + igt_drm_format_to_bpp() because it uses the format_desc array, and + igt_fb currently assumes that all the format_desc formats have a + matching valid Cairo format, so I wouldn't be able to easily add + formats such as ARGB2101010. + + The function that has the assumption mentioned above is + igt_get_all_formats: its current users call igt_get_all_formats, and + then call cairo-dependent functions, such as igt_get_cairo_ctx on the + returned formats. + + In order to document the current behavior and prevent any problems in + case we start adding new formats without matching Cairo versions to + format_desc, rename igt_get_all_formats to igt_get_all_cairo_formats + and make it explicitly check for CAIRO_FORMAT_INVALID. + + Requested-by: Daniel Vetter + Acked-by: Daniel Vetter + Signed-off-by: Paulo Zanoni + +commit 55229f173e00947ecc05747a9038289940e30340 +Author: Paulo Zanoni +Date: Tue Jan 26 10:40:43 2016 -0200 + + lib/igt_fb: fix igt_get_all_formats documentation + + We give the callers a const pointer to a static variable that we reuse + between multiple calls: they're not supposed to free it, and they + don't free it today. + + Fix the documentation and leave the still reachable pointer instead of + reworking the function and its callers. + + Acked-by: Daniel Vetter + Signed-off-by: Paulo Zanoni + +commit 12c1eb653fcf26ad3483478e497e09333422d7cd +Author: Paulo Zanoni +Date: Mon Jan 25 21:17:50 2016 -0200 + + lib/igt_draw: use igt_drm_format_to_bpp() + + Don't reimplement the function. + + Acked-by: Daniel Vetter + Signed-off-by: Paulo Zanoni + +commit 0432201e6d85e84cdaf5b4b82404345014f93316 +Author: Paulo Zanoni +Date: Mon Nov 30 17:10:43 2015 -0200 + + kms_frontbuffer_tracking: standardize the used FB sizes + + We want to make sure that both tiled and untiled buffers have the same + size for the same width/height/format. This will allow better control + over the failure paths exercised by our tests: when we try to flip + from tiled to untiled, we'll be sure that we won't execute the error + path that checks for buffer sizes. + + v2: Use the new igt_calc_fb_size() instead of implementing our own + size calculation (Daniel). + v3: We can now use igt_drm_format_to_bpp() (Daniel). + + Acked-by: Daniel Vetter + Signed-off-by: Paulo Zanoni + +commit 096e020743b7e5500e36c4be73512ca548955829 +Author: Paulo Zanoni +Date: Mon Jan 25 21:04:37 2016 -0200 + + kms_frontbuffer_tracking: use igt_drm_format_to_bpp() + + The only format from fb_get_bpp() not supported by + igt_drm_format_to_bpp() is ARGB2101010, but we don't really use it in + kms_frontbuffer_tracking, so we can do the switch. + + Adding ARGB2101010 to igt_fb won't be that simple since there's no + equivalent Cairo format, and igt_fb users assume that all formats + known by igt_fb have equivalent Cairo formats. + + Acked-by: Daniel Vetter + Signed-off-by: Paulo Zanoni + +commit be6f3fadaf2c45972f7a9830baa6fd35f4d755a6 +Author: Paulo Zanoni +Date: Fri Nov 27 12:13:41 2015 -0200 + + lib/igt_fb: make the automatic buffer sizes/strides smaller + + The big motivation behind this patch is that the current power-of-two + granularity from igt_fb is way too big. There was more than one + occasion where I had to work around this problem on + kms_frontbuffer_tracking, and during my last workaround I was + requested to just make igt_fb use more minimal buffers. + + I also need to export the size computation function so I won't need to + reimplement it inside kms_frontbuffer_tracking. + + v2: + - Fix the Yf sizes (Ville). + - Don't change the Gen 2/3 behavior for both tiled and non-tiled. + v3: + - Edit the commit message, clarify that v1 was wrongly treating gen + 2/3 non-tiled as tiled (Chris). + + Requested-by: Daniel Vetter + Acked-by: Daniel Vetter + Signed-off-by: Paulo Zanoni + +commit d63e72f0ad281f295b058a572741b995a5a0f64a +Author: Chris Wilson +Date: Thu Jan 28 17:02:11 2016 +0000 + + igt/gem_cs_tlb: Increase BB start alignment to 64bytes + + Ironlake requires 64byte alignment for its MI_BATCH_BUFFER_START. + + Signed-off-by: Chris Wilson + +commit 89f81e039636c1fe8a4df846c769bbab7de609dc +Author: Chris Wilson +Date: Thu Jan 28 16:21:17 2016 +0000 + + igt: More MI_STORE_DWORD fixes for gen5 + + A few other tests I have updated recently to use MI_STORE_DWORD also need + the magic bit for gen4/5. + + Signed-off-by: Chris Wilson + +commit 3ec8b1d28e8d5ac924bd8f2e28baa31445bc5279 +Author: Chris Wilson +Date: Thu Jan 28 13:59:57 2016 +0000 + + igt/gem_ringfill: Set MI_MEM_VIRTUAL flag for gen<6 + + bit22 of MI_STORE_DWORD is confusing as the meaning changed between + physical/virtual addressing in early gen and GTT/ppGTT in later gen. It + looks like gen4 and gen5 still need the flag. + + Signed-off-by: Chris Wilson + +commit eaa03678b00179da89f194113c0740c033857c1c +Author: Chris Wilson +Date: Thu Jan 28 13:44:19 2016 +0000 + + lib: Hide BSD1/BSD2 rings on hardware without BSD2 + + The kernel happily lets us run on I915_EXEC_BSD2 even with such hardware + existing. Sigh. + + Signed-off-by: Chris Wilson + +commit 506d683da138a7b90f5e338d522012f00d3145e9 +Author: Chris Wilson +Date: Thu Jan 28 11:46:21 2016 +0000 + + tests: Add gem_exec_reloc + + The first steps towards basic relocation handling. In today's edition, + we ask how well does the kernel fare if we pass it relocations via + mmappings of our buffer objects. + + Signed-off-by: Chris Wilson + +commit d18d1eca811fff9871bb619558aee48568fc1b4d +Author: Chris Wilson +Date: Wed Jan 27 20:22:13 2016 +0000 + + igt/gem_reset_stats: Convert residual calllers of gem_exec() to gem_execbuf() + + Missed from e3b68bb66683ad4cb4c80df904a3a21c98a2b6c2 due to rebasing + fun. + + gem_reset_stats.c: In function 'inject_hang_ring': + gem_reset_stats.c:227:19: error: implicit declaration of function 'gem_exec' [-Werror=implicit-function-declaration] + gem_reset_stats.c:227:2: warning: nested extern declaration of 'gem_exec' [-Wnested-externs] + + Signed-off-by: Chris Wilson + +commit a1b47ef6ae6b92be4de0cf87f1ad2ee84029f8b7 +Author: Chris Wilson +Date: Wed Jan 27 19:44:16 2016 +0000 + + igt/gem_concurrent_blit: Disable libdrm buffer cache for child inheritance + + It just ends up with buffer leaks all over. On the flip side, it does + allow us to inherit the bufmgr directly without worry of stomping over + the aliased entries (and causing double closes). + + Signed-off-by: Chris Wilson + +commit 37f4da0d981f7990e9183be2eab2197d092fb701 +Author: Chris Wilson +Date: Wed Jan 27 13:02:35 2016 +0000 + + igt/gem_concurrent_all: Pass buffer data down + + In order reduce the number of parameters being passed everywhere, whilst + simultaneously making more information available to the lower levels, + pass the struct buffers around. + + Signed-off-by: Chris Wilson + +commit 5dea5deffc31e833a7cff1f70d29e49a5152fd3e +Author: Chris Wilson +Date: Wed Jan 27 18:22:28 2016 +0000 + + igt/gem_cs_prefetch: Check each ring + + Since each engine has its own ring, each is subject to CS prefetching + and has its own layout that needs probing. + + Signed-off-by: Chris Wilson + +commit de70769cc0a24d4d594aaa4c1f99b4a3fc8f05fe +Author: Chris Wilson +Date: Wed Jan 27 16:28:35 2016 +0000 + + Add I915_EXEC_DEFAULT to list of known engines + + I dropped this from the list of rings for some tests when refactoring to + a common array. Almost all of the tests should be run over the default + exec engine to ensure ABI backwards compatiblity. + + Signed-off-by: Chris Wilson + +commit d1308990842fec5f523c129951a5c649d817be81 +Author: Chris Wilson +Date: Wed Jan 27 14:17:53 2016 +0000 + + igt/gem_sync: Use common array of rings + + Signed-off-by: Chris Wilson + +commit dd6b45235b5f1eea9b37e686460fdf1a1c56f431 +Author: Chris Wilson +Date: Wed Jan 27 14:17:53 2016 +0000 + + igt/gem_ringfill: Use common array of rings + + Signed-off-by: Chris Wilson + +commit 8cd52893346c647e475e801c5f5267f2f2b75ebe +Author: Chris Wilson +Date: Wed Jan 27 14:17:53 2016 +0000 + + igt/gem_cs_tlb: Use common array of rings + + Signed-off-by: Chris Wilson + +commit 7e0853c9c717f8e1ce6ed7f0d2fa6bd973bd0f6a +Author: Chris Wilson +Date: Wed Jan 27 14:17:53 2016 +0000 + + igt/gem_exec_nop: Use common array of rings + + Signed-off-by: Chris Wilson + +commit b09ef449af3ad8dcb0af19c48d716104ce18d76e +Author: Chris Wilson +Date: Wed Jan 27 14:17:53 2016 +0000 + + igt/gem_storedw_loop: Use common array of rings + + Signed-off-by: Chris Wilson + +commit 01acd70762a17df2f889d4b6a4161c3540a8ce00 +Author: Chris Wilson +Date: Wed Jan 27 13:08:35 2016 +0000 + + igt: Add gem_exec_basic + + Extremely basic check that we can dispatch an execbuf on every ring. + + Signed-off-by: Chris Wilson + Acked-by: Daniel Vetter + +commit 04f5215f00962f746c5bd1aa7bdbcaf62280f235 +Author: Chris Wilson +Date: Wed Jan 27 14:07:27 2016 +0000 + + Extract array of execution engines + + A few tests wish to execute on every engine, so centralise the array of + known engines. + + Signed-off-by: Chris Wilson + +commit b7f150b606bc27199a007dab8d248d9510967173 +Author: Chris Wilson +Date: Wed Jan 27 14:30:24 2016 +0000 + + lib: Query the kernel for support of a particular exec id + + Signed-off-by: Chris Wilson + +commit e3b68bb66683ad4cb4c80df904a3a21c98a2b6c2 +Author: Chris Wilson +Date: Sat Jan 23 09:44:19 2016 +0000 + + lib: Share common __gem_execbuf() + + An oft-repeated function to check EXECBUFFER2 for a particular fail + condition. + + Signed-off-by: Chris Wilson + +commit 711398e82af469394559105a4f4c6dc21f582ffe +Author: Gabriel Feceoru +Date: Tue Jan 26 19:40:58 2016 +0200 + + igt/gem_ringfill: Allow listing subtests in gem_ringfill + + Moved gem_quiescent_gpu() call to the run path. + + Signed-off-by: Gabriel Feceoru + Signed-off-by: Maarten Lankhorst + +commit 336235c0a8554ccd3d276718ba5bacf811da3e49 +Author: Maarten Lankhorst +Date: Wed Jan 27 13:30:52 2016 +0100 + + gem_ringfill: fix typo in test name + + Missing a r! + + Signed-off-by: Maarten Lankhorst + +commit 5f6ebb2cb7c4ddd30e6efbcb896996d00d0016ca +Author: Chris Wilson +Date: Wed Jan 27 11:30:43 2016 +0000 + + igt/gem_concurrent_blit: Tighter scoping of buffers variable + + Signed-off-by: Chris Wilson + +commit a64f31b31e7dcaa5c75792ecb0956c7abcaef3dd +Author: Chris Wilson +Date: Wed Jan 27 11:19:26 2016 +0000 + + igt/gem_concurrent_blit: Close userptr handle after importing into bufmgr + + The bufmgr import creates a new handle from a name for the userptr - we + can discard our original handle immediately. + + Signed-off-by: Chris Wilson + +commit 6f75990af0e8867ddbb10efaddb3f14333766a3f +Author: Chris Wilson +Date: Wed Jan 27 11:17:03 2016 +0000 + + igt/gem_concurrent_blit: Tidy blt-fill using gem wrappers + + Replace the open-coded ioctls with the thin gem wrappers. + + Signed-off-by: Chris Wilson + +commit 3598fff994a0446376c1a2689921730a55f0d2aa +Author: Derek Morton +Date: Tue Jan 26 13:04:42 2016 +0000 + + tests/Android.mk: Make intel_residency CAIRO dependant + + intel_residency has a cairo dependency through igt_fb.c. Remove it + if ANDROID_HAS_CAIRO is not defined. + + Signed-off-by: Derek Morton + Signed-off-by: Paulo Zanoni + +commit e28acefc5c22b41e3f141ca959c8f96cd16feb47 +Author: Jesse Barnes +Date: Thu Jan 14 14:03:53 2016 -0800 + + lib/igt_kms, tests/testdisplay: allow probing of new connector modes + + Fixup some fallout from the connector probing changes so testdisplay -m + will pick up newly hotplugged displays correctly. + + Signed-off-by: Jesse Barnes +Date: Tue Jan 26 09:03:46 2016 +0000 + + igt/gem_exec_alignment: Reduce GTT usage if !full-ppgtt + + If we have to share the GTT with others, we cannot rely on being able to + fill it and have to factor in some slack for others. + + Signed-off-by: Chris Wilson + +commit 49b13378812df0b53a77df733e24b4a29ca8650e +Author: Chris Wilson +Date: Tue Jan 26 08:54:46 2016 +0000 + + igt/gem_exec_alignment: Actually check aligned locations after many + + As well as ensuring the kernel doesn't simply crash when asked to do + lots of objects, check it actually aligns them. + + Signed-off-by: Chris Wilson + +commit ea3331d1201fa04904d87698055b84fa29f23869 +Author: Eric Anholt +Date: Mon Jan 25 19:51:21 2016 +0000 + + igt: Disable igt_clflush_range() implementation on ARM builds + + Daniel has suggested that I put vc4 testing into igt, since it's got + the piglit integration and KMS coverage already. This gets the ccore + building so that I can start writing tests. + + Signed-off-by: Eric Anholt + Reviewed-by: Daniel Stone + +commit bccc0ec6a3fdae880e14770c2ff5770fb86ea6fc +Author: Daniel Stone +Date: Mon Jan 25 18:33:12 2016 +0000 + + build: Disable x86-specific utilities on non-x86 + + Some bits can't be built on non-x86 architectures, mostly because they + require x86-specific assembly primitives. Disable these by default on + non-x86 architectures. + + Signed-off-by: Daniel Stone + Reviewed-by: Eric Anholt + +commit e6ca4bd7cd911c2a422fd6961970fc5df2b071a0 +Author: Michał Winiarski +Date: Mon Jan 25 19:35:02 2016 +0100 + + lib/ioctl_wrappers: Add gem_has_softpin + + We can move it from softpin test into lib, and since softpin support is + highly unlikely to go away in-between getparam ioctl calls, let's just + do a single call and store the value. + + v2: rebase + + Signed-off-by: Michał Winiarski + Reviewed-by: Chris Wilson + Signed-off-by: Daniel Vetter + +commit 52b5d5016edfac14ca99c01fc7c2800eccbe11c0 +Author: Michał Winiarski +Date: Mon Jan 25 19:35:01 2016 +0100 + + lib/ioctl_wrappers: Add gem_gtt_type exposing raw HAS_ALIASING_PPGTT param + + No functional changes. + While I'm here, let's also rename gem_uses_aliasing_ppgtt (since it's + being used to indicate if we are using ANY kind of ppgtt) and introduce + gem_uses_full_ppgtt to drop some unnecessary code from tests that were + previously calling getparam directly instead of using ioctl wrapper. + + v2: drop gem_uses_full_48b_ppgtt since it's no longer used anywhere, + s/48b/64b (Chris) + v3: rebase + + Cc: Chris Wilson + Signed-off-by: Michał Winiarski + Reviewed-by: Chris Wilson + Signed-off-by: Daniel Vetter + +commit 0e2071411a4d4e1488a821daf522dffde2809e03 +Author: Chris Wilson +Date: Mon Jan 25 13:51:00 2016 +0000 + + Promote eviction memory sizes and buffer counts to uint64_t + + References: https://bugs.freedesktop.org/show_bug.cgi?id=93849 + Signed-off-by: Chris Wilson + +commit beb936f1888d3dcd18907097dfac09ef639036ab +Author: Paulo Zanoni +Date: Fri Nov 27 08:38:39 2015 -0200 + + tools: add intel_residency + + After the recent discussions regarding the effects of the vblank + disabling policies on PC state residencies, I started running some + experiments to reevaluate some non-intuitive conclusions I had + reached. In order to help me do this, I decided to write this tool. + + The idea is very simple: the tool puts the system on an screen-on idle + state, checks which PC state residency is the deepest we can reach, + measures its residency, then does some not-so-idle tests and measures + the residencies. You can use the tool to compare different Kernel + trees and you can also use the tool to compare enabled vs disabled + features. + + It's obvious that these cases do not represent real-world use cases of + our driver, but they are already enough to highlight differences + between the many patches I wrote. I was even able to catch a bug in + one of my patches by spotting an unexpected regression in the + residencies. + + I've been using this tool for FBC, but I expect it to also be useful + for PSR, DRRS and similar features. I've been measuring the effects of + different optimizations I wrote, and I've also been measuring the FBC + vs no-FBC cases. + + It is also important to highlight that if your system is not properly + configured for efficient power savings the tool may not be able to + show differences between the results. On my Broadwell machine, for + example, if I don't run "powertop --auto-tune" before running the + tool, I get PC2 as the deepest state, and 90%+ residency for every + workload. After properly configuring the machine, I get PC7 as the + deepest state, which is the expected. + + So far I only tested this tool on BDW and SKL, and it may hit some + unexpected assertions for older platforms. + + I only implemented the cases that are immediately useful for me, but + we may also expand the tool in the future. We can add more important + workloads. We can add support for screen-off cases, so we can compare + the effects of runtime PM and other screen-off features. There's a lot + we can do, but none of this is on my current priority list. + + And remember: /usr/bin/paste is your friend when comparing results. + + v2: + - Be more idle at setup_idle(). + - Improve printing for /usr/bin/paste usage. + + Signed-off-by: Paulo Zanoni + +commit 9bf4e19125597ed11a23027270f5ecb3099b5ea9 +Author: Chris Wilson +Date: Sun Jan 24 15:34:08 2016 +0000 + + igt/gem_softpin: Keep last_handle around to vary hole generation + + If we don't close the handle from the last pass, we don't free up the + previous pass's vma immediately, changing the hole allocation. + + Signed-off-by: Chris Wilson + +commit c5b0293ca301ea643529d92b7e47f916ec59a762 +Author: Chris Wilson +Date: Sat Jan 23 18:10:46 2016 +0000 + + igt/gem_softpin: Exercise snoop+uncached abutting + + snooped objects are not allowed to abutt uncached objects on older gen + (!llc and global GTT) or else the GPU may hang if it prefetches across a + page boundary into a different memory type (i.e. CS reading from snoop). + The kernel should be checking the alignment rules as normal. + + Signed-off-by: Chris Wilson + +commit d4a05bc009e0634e06df7fb65d3fe4c5a10e3319 +Author: Chris Wilson +Date: Sat Jan 23 09:07:12 2016 +0000 + + igt/gem_concurrent_blit: Switch to a shared mmap for userptr + + If we use a MAP_SHARED mmaping for the our backing storage for userptr, + then it will be inherited across the fork with the same address. ideal + for continuity testing of children. + + Signed-off-by: Chris Wilson + +commit 69ecedea735425cfb9a5d7dfcaa5840393553fd1 +Author: Chris Wilson +Date: Fri Jan 22 22:14:33 2016 +0000 + + igt/gem_concurrent_blit: Allocate a private batch cache for the child + + We have to avoid the COW alias for the intel_bufmgr and intel_batch + cache as the child may close the object (in its local cache) leaving an + alias in the parent cache pointing to a stale object. + + Signed-off-by: Chris Wilson + +commit 3eae640b817fc506aafafb417e432b521517ed1a +Author: Chris Wilson +Date: Fri Jan 22 19:52:51 2016 +0000 + + igt/gem_concurrent_blit: Disable userptr+child tests + + The issue here is that the pointer inherited upon the child is + copied-on-write, i.e. the pointer is private to each process, but the + handle is shared. This means that writes and reads in the child are + going to a different set of pages than the GPU's object - the test is + simply broken. To overcome this we would need to mmap the shared buffer + into the child. + + Signed-off-by: Chris Wilson + +commit 4645630d3e7d1dcc8050e5f7da42318747002944 +Author: Chris Wilson +Date: Fri Jan 22 19:29:07 2016 +0000 + + igt/gem_concurrent_blit: Check inheritance of buffers + + The current forked modes recreate their handles in the children and just + look at any complications arising from contention. This mode looks at + inheriting the fd+handles from the parent into the child and seeing if + we can use them within the child. + + Signed-off-by: Chris Wilson + +commit 512f846f377ee97c90467ccd121519586263993f +Author: Chris Wilson +Date: Fri Jan 22 19:26:50 2016 +0000 + + igt/gem_ringfill: Mark the write object as EXEC_OBJECT_WRITE + + After setting the flag for NORELOC (to avoid having to pay the cost of + validating the relocations on every pass), we need to make sure that + we set EXEC_OBJECT_WRITE so that we do track the outstanding writes. + + Signed-off-by: Chris Wilson + +commit 291ff6bcf1678192c1cc59728e1f69797962372a +Author: Chris Wilson +Date: Fri Jan 22 19:01:02 2016 +0000 + + igt/gem_ringfill: Disable MI_STORE_DATA_IMM on BSD/gen6 + + It's broken, avoid at all costs. + + Signed-off-by: Chris Wilson + +commit 0091e6787cf4da668068f82d58f7169516acbc1f +Author: Chris Wilson +Date: Fri Jan 22 18:02:50 2016 +0000 + + igt/gem_userptr_blits: Exercise applying relocations to a userptr bo + + Signed-off-by: Chris Wilson + +commit 5b675f7b2f6487548a91c01eb9a7e36e808617b4 +Author: Chris Wilson +Date: Fri Jan 22 17:33:40 2016 +0000 + + lib: Refactor common detection of missed interrupts + + As we have the same function in a few places to read the + debugfs/i915_ring_missed_irq file, move it to the core. + + Signed-off-by: Chris Wilson + +commit e0ee36141ed1747f68580559a7cbfbeba902f05c +Author: Chris Wilson +Date: Fri Jan 22 17:28:54 2016 +0000 + + igt/gem_softpin: Fix MI_STORE_DATA_IMM for gen3 + + We need both a secure batch and to flag it to use the virtual GTT + address. + + Signed-off-by: Chris Wilson + +commit fbb0f636bd8ac898145b52961f5f7996f01ddc08 +Author: Chris Wilson +Date: Fri Jan 22 17:25:08 2016 +0000 + + igt: Fix use MI_STORE_DATA_IMM on gen3 + + For the older gen, MI_STORE_DATA_IMM is a privileged command so we need + to set the "secure" batch flag, and we also need to instruct the command + to use the GTT virtual address. + + Signed-off-by: Chris Wilson + +commit 4a3a8263427db6e1d2779a092ab6fc035e8aca3f +Author: Chris Wilson +Date: Wed Jan 13 14:02:50 2016 +0000 + + lib: Print memory requirements as MiB + + Since we need a lot of memory, trim off the less significant digits for + easier human consumption. + + Signed-off-by: Chris Wilson + +commit e180bec7bc16e727cea2f99aeff10b642f7778be +Author: Chris Wilson +Date: Fri Jan 22 15:00:11 2016 +0000 + + igt/gem_ringfill: Reduce ringfill to just filling the rings + + The objective of this test is to check how the driver handles a full + ring. To that end we need only submit enough work to fill the ring by + submitting work faster than the GPU can execute it. If we are more + careful in our batch construction, we can feed them much faster and + achieve the same results much quicker. + + Signed-off-by: Chris Wilson + +commit c4bcffcd109bfee6b70a60f2309d9acd881f7aec +Author: Chris Wilson +Date: Fri Jan 22 15:27:24 2016 +0000 + + igt/gem_exec_alignment: Tweaks count for large alignments + + We can fit a few more objects in at high alignment, so do so. + + Signed-off-by: Chris Wilson + +commit bd9842eadead0dc17f176f2c7124ab365264c945 +Author: Chris Wilson +Date: Fri Jan 22 00:26:56 2016 +0000 + + igt/gem_cs_tlb: Use softpin to remove GTT layout assumptions + + With softpin we can explicitly manage the layout of the objects to be + executed, deliberately forcing the reuse of active pages in an attempt + to spot misbehaviour in the CS TLBs. Being explicit allows us to + eliminate a lot of the CPU overhead between execbuf, hopefully + increasing the likelihood of a conflict. + + Signed-off-by: Chris Wilson + +commit 0143d4f3379b60650e4951f167822fcc76bb24d9 +Author: Chris Wilson +Date: Thu Jan 21 09:53:50 2016 +0000 + + igt/gem_concurrent_blit: Add userptr backing storage tests + + Signed-off-by: Chris Wilson + +commit a4493a54f348e547027eff3cb1607805f39f955d +Author: Chris Wilson +Date: Thu Jan 21 09:19:02 2016 +0000 + + igt/gem_softpin: Fix MI_STORE_DWORD_IMM for gen2-3 + + Before gen4, MI_STORE_DWORD was just 3 dwords long (cmd, offset, value). + + Signed-off-by: Chris Wilson + +commit 19642c604bb0c987e6e0069974042a98d128b9fc +Author: Chris Wilson +Date: Fri Dec 11 13:27:49 2015 +0000 + + lib: Expand igt_hang_ring() to select target context and various options + + Some potential callers want to inject a hang into a particular context, + some want to trigger an actual ban and others may or may not want to + capture the associated error state. Expand the hang injection interface + to suit all. + + v2: Disable the new kernel API, but push to provide a missing piece of + infrastucture to unbreak compilation. + + Signed-off-by: Chris Wilson + +commit 92caf138f2d878429f91397120e215dcb524efac +Author: Chris Wilson +Date: Wed Dec 16 09:23:56 2015 +0000 + + tests: Drop the superfluous igt_require_hang_ring() + + As the hang injection now itself checks for validity before use, the + tests don't need to do so themselves. Except in certain situations! If + the test forks, it should do requirement checks before the fork (so that + we don't anger the igt gods) and if the test plays around i915.reset + then it needs to do an early igt_require_hang_ring() that is not + affected by the changes to i915.reset. + + Signed-off-by: Chris Wilson + +commit a2eb63720b939d58a39cc7e5ef5ad2204fec260a +Author: Chris Wilson +Date: Fri Dec 11 21:24:21 2015 +0000 + + lib: Always double check igt_require_hang_ring() on use + + If we move the igt_require() into the hang injector, this makes simple + test cases even more convenient. More complex test cases can always do + their own precursory check before settting up the test. + + However, this does embed the assumption that the first context we are + called from is safe (i.e no i915.enable_hangcheck/i915.reset + interferrence). + + v2: A couple of environment variables to skip hang testing or to force + hang injection even if the GPU cannot be reset. + + Signed-off-by: Chris Wilson + +commit 47b61378426002c0f71644c65c73477265a5751d +Author: Chris Wilson +Date: Fri Jan 8 10:40:33 2016 +0000 + + igt/gem_partial_pwrite_pread: Fix range computation + + The range we chose to overwrite in the target had an off-by-one error + that could cause it to compute a size that went past the end of the + buffer (and so trigger EINVAL). Fortuituously with our seed this did not + occur. Whilst changing the range calculation, update the error logging + to include the range information. + + Signed-off-by: Chris Wilson + +commit 6bada3e2d494e0823a31773e916c62bd36facbe7 +Author: Chris Wilson +Date: Wed Jan 13 16:47:21 2016 +0000 + + igt/gem_softpin: Remove false dependencies on esoteric features + + For softpinning, we do not require either userptr or extended ppgtt, so + remove those requirements and make the tests work universally. (Certain + ABI tests require large GTT, or per-process GTT.) + + In the process, make the tests more extensive - validate overlapping + handling more careful, explicitly test no-relocation support, validate + more ABI handling. And for fun, cause a kernel GPF. + + Signed-off-by: Chris Wilson + +commit ad9b78f443be71c093d56e513f58442f46da496b +Author: Chris Wilson +Date: Tue Jan 19 23:59:33 2016 +0000 + + igt/gem_exec_alignment: Convert to subtests + + Allow both parts (single, many) to be run independently. + + Signed-off-by: Chris Wilson + +commit 28c33c6f90016f494d387ff8e886632ad3b5dfc6 +Author: Chris Wilson +Date: Tue Jan 19 21:11:28 2016 +0000 + + igt/gem_exec_alignment: Fix off-by-one in evalation of find_last_bit() + + Signed-off-by: Chris Wilson + +commit 6cf9d911ab0887f481f25351ab480d44cf044e07 +Author: Chris Wilson +Date: Tue Jan 19 21:02:40 2016 +0000 + + igt/gem_exec_alignment: Remember to require 48b objects! + + In order to actually use the high space we need to set the can-use-48bit + flag. + + Signed-off-by: Chris Wilson + +commit 167fb9e7b2d77c6b672384f880988b386129d964 +Author: Chris Wilson +Date: Tue Jan 19 16:52:32 2016 +0000 + + igt/gem_exec_alignment: Test multiple objects with alignment as well + + Compute the largest alignment for the most number of objects we can create, + then trying an execbuf with them. + + Signed-off-by: Chris Wilson + +commit e7bdc5c91692fba3f74aea4dc6ec662c98d1fec3 +Author: Chris Wilson +Date: Tue Jan 19 13:44:09 2016 +0000 + + igt/gem_exec_alignment: Test all possible pot alignments + + Signed-off-by: Chris Wilson + +commit de45ceb6678724d2c6a5ce4b0b614071e72b4f32 +Author: Chris Wilson +Date: Sat Jan 16 00:35:20 2016 +0000 + + igt/gem_ring_sync_loop: Be explicit! + + The test just aims to execute batches on alternating rings with a write + target such that every batch must be executed after the previous + completes. This stresses the inter-ring synchronisation, which is + interrupt driven if the gpu does not support semaphores, and so is a + good stress tests for detecting "missed interrupt syndrome". Make that + detection explicit. + + Signed-off-by: Chris Wilson + +commit a8f0963af5c217210f333790385a3d753794f6ad +Author: Chris Wilson +Date: Wed Jan 13 15:06:41 2016 +0000 + + igt/gem_storedw_loop: Add a few more iterations + + Whilst still keeping the runtime down, extend the pipeline slightly. + + Signed-off-by: Chris Wilson + +commit e2b9dfd0aa4295ecbd8d7c8ab3f58fa43514cf61 +Author: Chris Wilson +Date: Wed Jan 13 14:57:47 2016 +0000 + + igt/gem_storedw_loop: Remove libdrm crutches + + Make the behaviour of the test more explicit wrt to the handle management, + mmap and domain handling. + + Signed-off-by: Chris Wilson + +commit 38790b77d562a3b1cf31996aff160081d276796f +Author: Chris Wilson +Date: Mon Jan 11 14:12:54 2016 +0000 + + igt/gem_cs_prefetch: Replace explicit sync with implicit sync + + We can trade off the explicit sync (presumably to avoid some resource + starvation issue?) with the implicit sync of having to perform a + relocation. Using an implicit sync helps stress core kernel code, + besides being much faster! + + Signed-off-by: Chris Wilson + +commit a6090c71918ae4c0a54eda133081dbd1e6fe8018 +Author: Chris Wilson +Date: Fri Jan 8 16:32:29 2016 +0000 + + igt/gem_mmap_wc: Test cpu mmap vs wc mmap coherency + + Similar to the cpu mmap vs gtt mmap coherency test. + + Signed-off-by: Chris Wilson + +commit 571b876544933c4c6cab16065b1ade76246a7f55 +Author: Chris Wilson +Date: Fri Jan 8 11:51:56 2016 +0000 + + gem_concurrent_all: Add a "quick" tiny pass + + Signed-off-by: Chris Wilson + +commit 1c61c0f75097983d1a19e03e2c6dfd631307d1ef +Author: Chris Wilson +Date: Fri Jan 8 10:51:09 2016 +0000 + + gem_concurrent_blit: Add a pread/pwrite variant to only set part of the buffer + + The idea is to check partial cacheline reads/writes. + + Signed-off-by: Chris Wilson + +commit 42291f25100cd01653b3fb3a2a1fbe6975e9c1bf +Author: Chris Wilson +Date: Thu Jan 7 11:19:26 2016 +0000 + + gem_concurrent_blit: Don't call igt_require() outside of a subtest/fixture + + gem_concurrent_blit tries to ensure that it doesn't try and run a test + that would grind the system to a halt, i.e. unexpectedly cause swap + thrashing. It currently calls intel_require_memory(), but outside of + the subtest (as the tests use fork, it cannot do requirement testing + within the test children) - but intel_require_memory() calls + igt_require() and triggers and abort. Wrapping that initial require + within an igt_fixture() stops the abort(), but also prevents any further + testing. + + This patch restructures the requirement checking to ordinary conditions, + which though allowing the test to run, also prevents listing of subtests + on machines which cannot handle them. + +commit 51e965f299284b3c9b96ac5e384ddeb22bd8d1fd +Author: Chris Wilson +Date: Sun Jan 17 16:21:01 2016 +0000 + + tests: Add basic gem_sync test + + A very basic test of functionality, execute a nop and wait for it to + complete. It should be very effective at stimulating the "missed + interrupt syndrome" on all devices. + + Signed-off-by: Chris Wilson + +commit 136d6c796141b9b9fc9c96fe57dc2352c5224548 +Author: Chris Wilson +Date: Sat Jan 16 17:49:46 2016 +0000 + + igt/gem_streaming_writes: Set the initial CPU write domain + + Remove one assumption from the test and amek the domain management + explict - when we write through the CPU to construction the batch, mark + it as having been written. + + Signed-off-by: Chris Wilson + +commit 59adb00129acd1f9aff76edd19f7774876149d4f +Author: Chris Wilson +Date: Fri Jan 15 13:34:39 2016 +0000 + + tests: Add gem_busy + + Exercise the busy-ioctl and verify it reports the right active engines + using the execbuffer notation. + + Signed-off-by: Chris Wilson + +commit 825482a25c3efd82ad4630169d62248b06be4bc0 +Author: Derek Morton +Date: Mon Jan 11 13:32:04 2016 +0000 + + tools/Android.mk: Add zlib support + + IGT does not build for Android due to a zlib dependency being added + to intel_error_decode.c in a recent patch. + This patch fixes the error by updating the Android makefile to add + the path to the zlib library and using any LDFLAGS specified in + Makefile.sources. + + Signed-off-by: Derek Morton + Signed-off-by: Damien Lespiau + +commit fe7a42bff6c09cda864021d291a842ffd563e30e +Author: Mika Kahola +Date: Fri Jan 15 10:24:55 2016 +0200 + + tools/intel_bios_reader: Fix typo on dump info + + Fix typo on intel_bios_reader.c + + Signed-off-by: Mika Kahola + Signed-off-by: Jani Nikula + +commit 480479d7dce38715ca82741fce047a9eca06e8cc +Author: Jani Nikula +Date: Thu Jan 14 17:43:06 2016 +0200 + + intel_bios_reader: dump MIPI sequence block v3 + + Similar to what's done in kernel. It's a bit artificial that the parsing + and dumping are two separate steps in the userspace tool, but it's + easier to follow and debug the code when both the kernel and userspace + are similar. + + v2: don't segfault so much on dumping null pointers + + Signed-off-by: Jani Nikula + +commit 70dc8c85f1ba543b6f6ef16c49718b68d7dafba8 +Author: Jani Nikula +Date: Thu Jan 14 16:41:53 2016 +0200 + + intel_bios_reader: port the sequence block parsing from kernel + + Reuse the same code as kernel. Also parses v3, although does not + actually dump that stuff yet. + + Signed-off-by: Jani Nikula + +commit 7d1a37282b39026fe55fd9aee637d914b237a4f7 +Author: Jani Nikula +Date: Thu Jan 14 16:24:11 2016 +0200 + + intel_bios_reader: port find_panel_sequence_block from kernel + + No need to reinvent wheels, reuse the code from kernel. + + Signed-off-by: Jani Nikula + +commit b26393489ef8cba34773d3132c33c18b08d835bd +Author: Jani Nikula +Date: Thu Jan 14 16:08:55 2016 +0200 + + intel_bios_reader: make the VBT pointers more const + + In const we trust. + + Signed-off-by: Jani Nikula + +commit d9588c891d0dd252230b363c02ca962eed1d2303 +Author: Jani Nikula +Date: Thu Jan 14 15:48:13 2016 +0200 + + intel_bios_reader: fix size handling for 32-bit block size + + The MIPI DSI sequence block v3+ has a separate block size field. + + Signed-off-by: Jani Nikula + +commit 2e2fffa7a5e0debb1ea2cc70b46c4818b48b0d53 +Author: Jani Nikula +Date: Thu Jan 14 15:27:50 2016 +0200 + + intel_bios_reader: pass bdb pointer around instead of having as global + + Signed-off-by: Jani Nikula + +commit 065d73619f33c3ac92c80d06b7a48992406940cf +Author: Ville Syrjälä +Date: Fri Jan 8 20:37:51 2016 +0200 + + tests/kms_chv_cursor_fail: Skip when the pipe doesn't exist + + Looks like I fumbled things when I made kms_chv_cursor_fail iterate + over all pipes. It fails to check that the pipe actually exists, and + so fails on < 3 pipe platforms. Add the necessary checks to skip + on non-existing pipes. + + Signed-off-by: Ville Syrjälä + +commit cd658a7c6bca74eb897a8ae87751029793f0c4f4 +Author: Chris Wilson +Date: Thu Jan 7 09:04:03 2016 +0000 + + core/sighelper: Interrupt everyone in the process group + + Some stress tests create both the signal helper and a lot of competing + processes. In these tests, the parent is just waiting upon the children, + and the intention is not to keep waking up the waiting parent, but to + keep interrupting the children (as we hope to trigger races in our + kernel code). kill(-pid) sends the signal to all members of the process + group, not just the target pid. + + We also switch from using SIGUSR1 to SIGCONT to paper over a race + condition when forking children that saw the default signal action being + run (and thus killing the child). + + Signed-off-by: Chris Wilson + Acked-by: Daniel Vetter + +commit 05ac611358e61f914d99e00e1738f2ff9cfb05d4 +Author: Rodrigo Vivi +Date: Fri Jan 8 07:40:45 2016 -0800 + + kms_psr_sink_crc: Simplify debugfs reading. + + Let's start using igt_debugfs_read helper so we + can change the debugfs interface at anytime. + + Signed-off-by: Rodrigo Vivi + +commit f1bb20eb7c4fa5f8b98bfd9876adc69c250e9bea +Author: Ville Syrjälä +Date: Mon Dec 14 00:54:33 2015 +0200 + + tests/kms_flip: Increase TEST_TS_CONT max seq difference to 150 + + During suspend tests we can exceed the current 100 frame difference + in sequence numbers. Bump the limit to 150 frames. + + Signed-off-by: Ville Syrjälä + +commit 39aecb05d5c608cb7916fe376341de1828945167 +Author: Ville Syrjälä +Date: Mon Dec 14 00:55:11 2015 +0200 + + tests/kms_pipe_crc_basic: Use igt_assert_eq() to see the failing frame counts + + Use igt_assert_eq() to compare the frame numbers during the frame + sequence tests so that we'll see exactly what the bad frame counts + are when the test fails. + + Signed-off-by: Ville Syrjälä + +commit 7ff8223d44b875e0eec02f32b9fce8baeca689a3 +Author: Ville Syrjälä +Date: Sun Dec 13 06:58:40 2015 +0200 + + tests/gem_mmap_gtt: Make the small-bo tiling tests work on old platforms + + Several factors conspire against us when trying to execute + the tiled small-bo tests: + - pre-gen4 require power of two fences, with natural alignment + - the entire gtt may be mappable + - we put a guard page at the end of gtt + + What all that means is that when we try to use a tiled object half + the size of the mappable area, we can only fit it in the first half + of the gtt. That leads to a SIGBUS when we try to fault in the + object when there's already something (eg. fbdev) occupying the + first half of gtt. + + So in order to make the tests run on old machines, let's further + halve the object size when things look too tight. + + Signed-off-by: Ville Syrjälä + +commit 21022f076d4047348f377a1938079c046de13f42 +Author: Ville Syrjälä +Date: Sun Dec 13 06:54:06 2015 +0200 + + tests/gem_mmap_gtt: Add progress indicators + + Some of the copy tests take a while, so let the user know how + far along we are via a progress indicator. + + Signed-off-by: Ville Syrjälä + +commit 86382de3fb17582470b32bd955ad31be201b7304 +Author: Ville Syrjälä +Date: Sun Dec 13 06:53:28 2015 +0200 + + tests/gem_mmap_gtt: Deal with tile sizes on gen2/3 + + Gen2/3 platforms have some unusual tile dimensions. Account + for them to make the test work correctly. + + Signed-off-by: Ville Syrjälä + +commit 1ecd91a8c6575c663492eee81cd48c8d1cb36914 +Author: Ville Syrjälä +Date: Sun Dec 13 00:04:43 2015 +0200 + + Fix a bunch of printf types + + igt_kms.c: In function ‘igt_crtc_set_background’: + igt_kms.c:1940:2: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 5 has type ‘uint64_t’ [-Wformat=] + LOG(display, "%s.%d: crtc_set_background(%lu)\n", + ^ + intel_firmware_decode.c: In function ‘csr_open’: + intel_firmware_decode.c:169:2: warning: format ‘%zd’ expects argument of type ‘signed size_t’, but argument 3 has type ‘__off_t’ [-Wformat=] + printf("Firmware: %s (%zd bytes)\n", filename, st.st_size); + ^ + intel_gpu_top.c: In function ‘main’: + intel_gpu_top.c:683:10: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘uint64_t’ [-Wformat=] + stats[i] - last_stats[i]); + ^ + hsw_compute_wrpll.c: In function ‘main’: + hsw_compute_wrpll.c:644:3: warning: format ‘%li’ expects argument of type ‘long int’, but argument 7 has type ‘long long int’ [-Wformat=] + igt_fail_on_f(ref->r2 != r2 || ref->n2 != n2 || ref->p != p, + ^ + gem_gtt_hog.c: In function ‘__real_main155’: + gem_gtt_hog.c:177:2: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘unsigned int’ [-Wformat=] + igt_info("Time to execute %lu children: %7.3fms\n", + ^ + kms_flip.c: In function ‘run_test_step’: + kms_flip.c:985:3: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 10 has type ‘__time_t’ [-Wformat=] + igt_assert_f(end - start > 0.9 * frame_time(o) && + ^ + kms_flip.c:985:3: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 11 has type ‘__suseconds_t’ [-Wformat=] + kms_frontbuffer_tracking.c: In function ‘setup_sink_crc’: + kms_frontbuffer_tracking.c:1364:3: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 4 has type ‘ssize_t’ [-Wformat=] + igt_info("Unexpected sink CRC error, rc=:%ld errno:%d %s\n", + ^ + Signed-off-by: Ville Syrjälä + +commit a7882a31cb9f516b6068a81221c0fdaf7e9d4073 +Author: Ville Syrjälä +Date: Fri Dec 18 14:21:27 2015 +0200 + + tests/kms_chv_cursor_fail: Add a test to exercise CHV pipe C cursor fail + + The test tries to anger CHV pipe C cursor by walking the edges of the + screen while moving the cursor across the screen edge. + + The actual hw issue only occurs on pipe C, and only on the left screen + edge. The testcase can walk all the edges though, and on all pipes, just + so I could make sure the failure doesn't occur there. + + Signed-off-by: Ville Syrjälä + +commit a7a2c76a806e7aa93c7e8c998465a8cb63dbaa37 +Author: Ville Syrjälä +Date: Fri Dec 18 16:10:34 2015 +0200 + + tests/kms_pipe_crc_basic: Add tests for O_NONBLOCK CRC reads + + v2: Rebased due to __attribute__((warn_unused_result)) + + Signed-off-by: Ville Syrjälä + +commit 909074503012a11fc631118cd3180b4a1c27646e +Author: Ville Syrjälä +Date: Fri Dec 18 14:35:05 2015 +0200 + + lib: Add igt_pipe_crc_new_nonblock() + + Add support for reading the CRC in non-blocking mode. Useful for tests + that want to start the CRC capture, then do a bunch of operations, then + collect however many CRCs that got generated. The current + igt_pipe_crc_new() + igt_pipe_crc_get_crcs() method would block until + it gets the requested number of CRCs, whreas in non-blocking mode we + can just read as many as got generated thus far. + + v2: __attribute__((warn_unused_result)), document the + new igt_pipe_crc_get_crcs() return value (Daniel) + + Signed-off-by: Ville Syrjälä + +commit 5b113d323dde18ef3bbae2f57d613be4ab7eb267 +Author: Ville Syrjälä +Date: Thu Dec 17 01:39:31 2015 +0200 + + lib: Extract some common fb create+fill methods into helpers + + Several tests do one or more of the following: + * igt_create_fb() + igt_paint_test_pattern() + * igt_create_color_fb() + igt_paint_test_pattern() + * igt_create_fb() + igt_paint_image() + + Extract them into new helpers: igt_create_pattern_fb(), + igt_create_color_pattern_fb(), igt_create_image_fb(). + + v2: Fix typos, and improve API docs (Thomas) + + Signed-off-by: Ville Syrjälä + +commit 7cb35109645e6495f67981b9930587c1ddfe4f90 +Author: Michel Thierry +Date: Wed Jan 6 15:00:39 2016 +0000 + + tests/gem_softpin: Use offset addresses in canonical form + + i915 validates that requested offset is in canonical form, so tests need + to convert the offsets as required. + + Also add test to verify non-canonical 48-bit address will be rejected. + + v2: Use sign_extend64 for converting to canonical form (Tvrtko) + + Cc: Vinay Belgaumkar + Cc: Tvrtko Ursulin + Reviewed-by: Vinay Belgaumkar + Signed-off-by: Michel Thierry + +commit fca862cdd3a1152a64f062caff4475478e2bd50a +Author: Chris Wilson +Date: Thu Jan 7 10:54:30 2016 +0000 + + igt/gem_mmap_gtt: Add a test to exercise coherency between GTT/CPU + + This checks whether a write through the GTT is immediately visible to + the CPU. + + Signed-off-by: Chris Wilson + +commit 8528b484e8cf9d8e9c627f99e283285726967f74 +Author: Derek Morton +Date: Wed Dec 23 15:34:48 2015 +0000 + + igt_core: Fix logging to display extended line + + line[strlen(line)] will always evaluate to NULL so line_continuation + was always true. That prevented the program name, pid and log level + ever being printed. + Changed to [strlen(line) - 1] so the last character before the null + terminator is compared with '\n' to determine line_continuation. + + Signed-off-by: Derek Morton + Signed-off-by: Daniel Vetter + +commit 51bb53663e2d0c57e9e40c1961d67ddc1e086be5 +Author: Chris Wilson +Date: Wed Jan 6 10:19:03 2016 +0000 + + benchmarks/gem_latency: Allow setting an infinite time + + Well, 24000 years. + + Signed-off-by: Chris Wilson + +commit 3c1362f0a6a930f874b7533cb0a03ba9177278b4 +Author: Maarten Lankhorst +Date: Tue Jan 5 15:19:13 2016 +0100 + + tests: Bump pageflip wait timeout to 50 ms. + + The default is too low for panels that are 30 fps or lower. + Bump the timeout to 50 ms to prevent spurious errors on those + displays. + + Signed-off-by: Maarten Lankhorst + +commit 1d6e5d3197eebf682e218a34c56139f2df4ea090 +Author: Chris Wilson +Date: Sun Jan 3 13:44:17 2016 +0000 + + igt/gem_concurrent_all: Preparatory work for testing different create flags + + In order to do concurrency checks using different allocation functions, + we need to hook those functions up to gem_concurrent_all. So let's add + another layer of combinations! The actual enabling for create2-ioctl + will come in the future. + + Signed-off-by: Chris Wilson + +commit e21368c53a23ccf62dc6651bda9591c1dbbb39c4 +Author: Chris Wilson +Date: Sat Jan 2 16:07:34 2016 +0000 + + benchmarks/gem_mmap: Convert to run over a fixed period + + Signed-off-by: Chris Wilson + +commit 9b902344149f87a7abce4b0b08792db2cd4d424d +Author: Chris Wilson +Date: Sat Jan 2 15:19:27 2016 +0000 + + benchmarks/gem_exec_nop: Convert to running for a fixed time + + Like the previous patch to gem_exec_ctx, retrict gem_exec_nop to running + for a fixed length of time, rather than over a range of different + execution counts. In order to retain some measurement of that range, + allow measuring individual execution versus continuous dispatch. + + Signed-off-by: Chris Wilson + +commit 6953899beb5ef7311429ebf77faca02b564de473 +Author: Chris Wilson +Date: Sat Jan 2 12:10:14 2016 +0000 + + benchmarks/gem_exec_ctx: Run for a fixed time + + Rather than investigate the curve for dispatch latency, just run for a + fixed time and report an average latency. Instead offer two modes, + average single dispatch latency, average continuous dispatch latency. + + Signed-off-by: Chris Wilson + +commit 276fb3d3f4bc0214454fe172106efce71c7b0ff0 +Author: Chris Wilson +Date: Fri Jan 1 13:29:23 2016 +0000 + + benchmarks/gem_exec_ctx: Fix fd switching between default contexts + + Signed-off-by: Chris Wilson + +commit bb35716d25999260c2cc491ed832a9a39f204dcb +Author: Chris Wilson +Date: Thu Dec 31 21:34:27 2015 +0000 + + intel_error_decode: Update address parsing for 64bit offsets + + Signed-off-by: Chris Wilson + +commit 8f9df28a82f49681cc9bcfa70dd7369af56b3f70 +Author: Chris Wilson +Date: Wed Nov 5 11:24:49 2014 +0000 + + intel_error_decode: Fix decode headers for HW context + + As we didn't recognise the different buffer type, we confused it with + whatever we last decoded (i.e. the render ring buffer). + + Signed-off-by: Chris Wilson + +commit d4c3cd4d04ab7f317d3429708d19cd5fc4d0f5fa +Author: Chris Wilson +Date: Fri Oct 31 11:27:21 2014 +0000 + + intel_error_decode: Inflate compressed error state + + Recent kernels compress the active objects using zlib + ascii85 + encoding. This adapts the tool to decompress those inplace. + + Signed-off-by: Chris Wilson + +commit 3d5b50b4f0784faf565a781e1ab151ac4e5370f8 +Author: Chris Wilson +Date: Tue Dec 29 13:51:08 2015 +0000 + + benchmarks/gem_blt: Estimate memory bandwidth to improve test runtime + + If we autotune the workload to only take 0.1s and then repeat the + measurements over 2s, we can bound the benchmark runtime. (Roughly of + course! Sometimes the dispartity between main memory CPU bandwidth, and + GPU execution bandwidth throws off the runtime, but that's the purpose + of the benchmark!) + + Signed-off-by: Chris Wilson + +commit 9764247dc57036e1d1c73b2f69411906504a8288 +Author: Jani Nikula +Date: Mon Dec 21 16:50:47 2015 +0200 + + intel_bios_reader: add dumping of i2c element in mipi sequence + + Due to the clever way the whole sequence block is specified without + forward compatibility, it's not possible to dump most blocks without + this. + + Signed-off-by: Jani Nikula + +commit cb89add9793b04288cb332a0d17dd8d8d6f09680 +Author: Jani Nikula +Date: Mon Dec 21 16:36:32 2015 +0200 + + intel_bios_reader: improve element dumpers + + Try to print something useful and helpful for the user. + + Signed-off-by: Jani Nikula + +commit 9c4aa072f071d4cfe1513a723419f43e43fe3293 +Author: Jani Nikula +Date: Mon Dec 21 16:18:20 2015 +0200 + + intel_bios_reader: rewrite the mipi sequence block dumping + + Simplify things a lot, make it correct, don't pass random pointers to + free() on errors, etc. + + Signed-off-by: Jani Nikula + +commit 68cfe4ba575064c798ef9857781fa4969319e876 +Author: Jani Nikula +Date: Mon Dec 21 15:51:10 2015 +0200 + + intel_bios_reader: check mipi sequence block version + + Bail out on v3+, we don't support that just yet. + + Signed-off-by: Jani Nikula + +commit bdf7b1c0eb753268f9059615ec92efee693abb77 +Author: Jani Nikula +Date: Mon Dec 21 15:22:08 2015 +0200 + + intel_opregion_decode: add new ASLE fields + + Signed-off-by: Jani Nikula + +commit fa24ce6b9606fac69234f27550de19f5c07cdcc3 +Author: Thomas Wood +Date: Mon Dec 21 16:50:16 2015 +0000 + + docs: add igt_edid_template.h to IGNORE_HFILES + + Signed-off-by: Thomas Wood + +commit 1b9085b9795c588d5503439c8e23ed780e927730 +Author: Chris Wilson +Date: Mon Dec 21 16:24:45 2015 +0000 + + benchmarks/gem_latency: Hide spinlocks for android + + Signed-off-by: Chris Wilson + +commit 23aa051369c2b930d35359a5c06fae5290c06291 +Author: Ville Syrjälä +Date: Fri Dec 18 19:25:47 2015 +0200 + + lib: Use igt_assert_eq() to check for crc component count + + It's nice to see just how many components the crc claims to have + when the count don't match what we expect. + + Signed-off-by: Ville Syrjälä + Signed-off-by: Daniel Vetter + +commit 793aff199f21cdb4136e39f227ced5553eec04dc +Author: Ville Syrjälä +Date: Fri Dec 18 19:25:45 2015 +0200 + + lib: Make 'extra_long_opts' const + + The extra_long_opts passed to igt_*_parse_opts() isn't modified, + so let's make it const. + + Signed-off-by: Ville Syrjälä + Signed-off-by: Daniel Vetter + +commit a1d465a3c542d965a56e794590b3f00095a1db62 +Author: Chris Wilson +Date: Mon Dec 21 12:53:21 2015 +0000 + + benchmarks/gem_latency: Serialise mmio reads + + The joy of our hardware; don't let two threads attempt to read the same + register at the same time. + + Signed-off-by: Chris Wilson + +commit 3ebce37b65ddb292161498ac4f6a07e3667c9b03 +Author: Chris Wilson +Date: Mon Dec 21 09:57:52 2015 +0000 + + benchmarks/gem_latency: Guard against inferior pthreads.h + + Signed-off-by: Chris Wilson + +commit 3cc8f957f1c443f012b292dbb5d81acb59dffb25 +Author: Chris Wilson +Date: Sun Dec 20 15:18:56 2015 +0000 + + benchmarks/gem_latency: Measure CPU usage + + Try and gauge the amount of CPU time used for each dispatch/wait cycle. + + Signed-off-by: Chris Wilson + +commit a91ee853b1a1e733c0d4e291d8fc3008a9ac232f +Author: Chris Wilson +Date: Sun Dec 20 14:55:42 2015 +0000 + + benchmarks/gem_latency: Measure effect of using RealTime priority + + Allow the producers to be set with maximum RT priority to verify that + the waiters are not exhibiting priorty-inversion. + + Signed-off-by: Chris Wilson + +commit 27e093dd1fe3c49389c302f1f3234a0769fd75dc +Author: Chris Wilson +Date: Sat Dec 19 17:05:32 2015 +0000 + + benchmarks/gem_latency: Use RCS on Sandybridge + + Reading BCS_TIMESTAMP just returns 0... + + Signed-off-by: Chris Wilson + +commit c0942bf52866d3182cf2e6dcf7c6960098420aeb +Author: Chris Wilson +Date: Sat Dec 19 16:27:19 2015 +0000 + + benchmarks/gem_latency: Rearrange thread cancellation + + Try a different pattern to cascade the cancellation from producers to + their consumers in order to avoid one potential deadlock. + + Signed-off-by: Chris Wilson + +commit 8ea61ec1ff96c4303f6de49def142f134a7243a0 +Author: Chris Wilson +Date: Sat Dec 19 16:14:03 2015 +0000 + + benchmarks/gem_latency: Tweak workload + + Do the workload before the nop, so that if combining both, there is a + better chance for the spurious interrupts. Emit just one workload batch + (use the nops to generate spurious interrupts) and apply the factor to + the number of copies to make inside the workload - the intention is that + this gives sufficient time for all producers to run concurrently. + + Signed-off-by: Chris Wilson + +commit db011021a1c9c40e4fc3ec7a8c31bfee7b9fb623 +Author: Chris Wilson +Date: Sat Dec 19 14:51:08 2015 +0000 + + benchmarks/gem_latency: Add output field specifier + + Just to make it easier to integrate into ezbench. + + Signed-off-by: Chris Wilson + +commit 646cab4c0c73dce310ff8020ffb96272647780ba +Author: Chris Wilson +Date: Sat Dec 19 12:07:26 2015 +0000 + + benchmarks/gem_latency: Split the nop/work/latency measurement + + Split the distinct phases (generate interrupts, busywork, measure + latency) into separate batches for finer control. + + Signed-off-by: Chris Wilson + +commit e37a4c80922aaeb79a419a7d7f96b0ac4c6ffb88 +Author: Chris Wilson +Date: Sat Dec 19 11:36:37 2015 +0000 + + benchmarks/gem_latency: Add time control + + Allow the user to choose a time to run for, default 10s + + Signed-off-by: Chris Wilson + +commit 2ef368acfa5c3863543663f03c3eb26fba93cca6 +Author: Chris Wilson +Date: Sat Dec 19 11:36:37 2015 +0000 + + benchmarks/gem_latency: Add nop dispatch latency measurement + + Signed-off-by: Chris Wilson + +commit 1db5b05243c0d0e84af4fc2845fc320aa5787436 +Author: Chris Wilson +Date: Sat Dec 19 10:52:12 2015 +0000 + + benchmarks/gem_latency: Expose the workload factor + + Allow the user to select how many batches each producer submits before + waiting. + + Signed-off-by: Chris Wilson + +commit 6dbe0a301223f177ef80078c5ffdbf8575a8bae1 +Author: Chris Wilson +Date: Sat Dec 19 10:46:06 2015 +0000 + + benchmarks/gem_latency: Measure whole execution throughput + + Knowing how long it takes to execute the workload (and how that scales) + is interesting to put the latency figures into perspective. + + Signed-off-by: Chris Wilson + +commit 2f74892ebd4d23b352e2e089e9b74c950f3864b8 +Author: Chris Wilson +Date: Sat Dec 19 10:31:49 2015 +0000 + + benchmarks/gem_latency: Fix for !LLC + + Late last night I forgot I had only added the llc CPU mmaping and not + the !llc GTT mapping for byt/bsw. + + Signed-off-by: Chris Wilson + +commit 39bad606c5e24dbb144f01e5d889f8a31c294d22 +Author: Chris Wilson +Date: Fri Dec 18 20:51:57 2015 +0000 + + benchmarks: Remove gem_wait + + Superseded by gem_latency. + + Signed-off-by: Chris Wilson + +commit c9da0b5221cfd7dd2f22bbc5bcddf73d31214e2e +Author: Chris Wilson +Date: Fri Dec 18 14:45:03 2015 +0000 + + benchmark: Measure of latency of producers -> consumers, gem_latency + + The goal is measure how long it takes for clients waiting on results to + wakeup after a buffer completes, and in doing so ensure scalibilty of + the kernel to large number of clients. + + We spawn a number of producers. Each producer submits a busyload to the + system and records in the GPU the BCS timestamp of when the batch + completes. Then each producer spawns a number of waiters, who wait upon + the batch completion and measure the current BCS timestamp register and + compare against the recorded value. + + By varying the number of producers and consumers, we can study different + aspects of the design, in particular how many wakeups the kernel does + for each interrupt (end of batch). The more wakeups on each batch, the + longer it takes for any one client to finish. + + Signed-off-by: Chris Wilson + +commit 8bf09f3d12f5a8d984f084f116b195925dca571b +Author: Chris Wilson +Date: Thu Dec 17 09:16:42 2015 +0000 + + tests/gem_concurrent_all: Add a couple more sanitycheck patterns + + As always, the goal is to quickly stress a variety of workloads that + often lead to kernel bugs. + + Signed-off-by: Chris Wilson + +commit 04bd964527bf1962d3fd94f863161f5828eba767 +Author: Chris Wilson +Date: Wed Dec 16 19:51:08 2015 +0000 + + igt/gem_exec_nop: Restore SLOW_QUICK loop terminator + + The upper bound for SLOW_QUICK was added for the benefit of the slow + simulator, not because, as I wrongly thought, of the latency + measurements. + + SLOW_QUICK was added in + + commit d1e862324b747a0ab5d985eaa6830076817231c5 + Author: Damien Lespiau + Date: Mon Mar 25 20:06:20 2013 +0000 + + tests: Instrument tests run in simulation to run quickly + + and dropped in + + commit 89bcdb9022fb7a1f66635b9f2546356ad0c0761a + Author: Chris Wilson + Date: Tue Dec 8 13:42:50 2015 +0000 + + igt/gem_exec_nop: Remove nop latency measurements + + Reported-by: Ben Widawsky + Signed-off-by: Chris Wilson + +commit a012e44b6a68b12e676a4ef48bebe97206fbeb1c +Author: Thomas Wood +Date: Mon Dec 7 15:12:15 2015 +0000 + + tests: remove .gitignore and add a Makefile rule to create it + + v2: generate the .gitignore file with the default target + v3: remove the .gitignore file + + Signed-off-by: Thomas Wood + +commit 40798efd859e26386d32ec61272c210685b6a204 +Author: Daniel Vetter +Date: Wed Dec 16 13:13:58 2015 +0000 + + tests/gem_eio: New ABI - no EIO even from wait_ioctl + + So there's 3 competing proposals for what wait_ioctl should do wrt + -EIO: + + - return -EIO when the gpu is wedged. Not terribly useful for + userspace since it might race with a hang and then there's no + guarantee that a subsequent execbuf won't end up in an -EIO. + Terminally wedge really can only be reliably signalled at execbuf + time, and userspace needs to cope with that (or decide not to + bother). + + - EIO for any obj that suffered from a reset. This means big internal + reorginazation in the kernel since currently we track reset stats + per-ctx and not on the obj. That's also what arb robustness wants. + We could do this, but this feels like new ABI territory with the + usual userspace requirements and high hurdles. + + - No -EIO at all. Consistent with set_domain_ioctl and simplest to + implement. Which is what this patch does. + + We can always opt to change this later on if there's a real need. + + To make the test really exercise this do a full wedged gpu hang, to + make sure -EIO doesn't leak out at all. + + Signed-off-by: Daniel Vetter + Signed-off-by: Chris Wilson + +commit 3953d2dd22ea1c87aa77e3a9415aaf767d2ec3ed +Author: Derek Morton +Date: Mon Dec 14 09:59:17 2015 +0000 + + gem_flink_race/prime_self_import: Improve test reliability + + gem_flink_race and prime_self_import have subtests which read the + number of open gem objects from debugfs to determine if objects have + leaked during the test. However the test can fail sporadically if + the number of gem objects changes due to other process activity. + This patch introduces a change to check the number of gem objects + several times to filter out any fluctuations. + + v2: Moved the common code to a library and made the loop android + specific (Daniel Vetter) + v3: Renamed get_stable_obj_count -> igt_get_stable_obj_count + + Signed-off-by: Derek Morton + Signed-off-by: Daniel Vetter + +commit 5a8d063e42c7b5843a0f069d4c2216f8f4fb81fe +Author: Mika Kuoppala +Date: Thu Dec 10 16:54:40 2015 +0200 + + tests/gem_softpin: Fix compiler warning on 32bit systems + + We get build error as we try to cast from ptr to integer + of different size on 32 bit platforms. Use unsigned long + as the cast, it will work with both 32 and 64 bit + systems. + + Cc: Vinay Belgaumkar + Signed-off-by: Mika Kuoppala + Reviewed-by: Tvrtko Ursulin + Reviewed-by: Vinay Belgaumkar + +commit 14f70a861b66f8a62a53911cf587fadeebca5957 +Author: Chris Wilson +Date: Sun Dec 13 12:46:47 2015 +0000 + + igt/gem_read_read_speed: Tweak to show comparison against write-write + + Since we hold an exclusive write lock we expect 2 writes to happen + serially, but we expect 2 reads to happen in parallel. Expand the testing + to demonstrate this effect (i.e. we expect read-read to be roughly 2x + faster than write-write for small copies on big core.) + + Signed-off-by: Chris Wilson + +commit 866a6f2c41da8505cf868a9d83301cddd41cc9fb +Author: Chris Wilson +Date: Sat Dec 12 18:56:37 2015 +0000 + + tests/gem_pread,gem_pwrite: Fix compiler warnings + + Many warnings of the form + + gem_pread.c: In function ‘main’: + gem_pread.c:128:8: warning: assignment discards ‘const’ qualifier from + pointer target type [-Wdiscarded-qualifiers] + bps = bytes_per_sec(buf, object_size/usecs*1e6); + + Regression from + commit 48c945322b4c5f6443758143cccb9c4c04da4aaa + Author: Ankitprasad Sharma + Date: Wed Dec 2 14:54:51 2015 +0530 + + igt/gem_pread: Support to verify pread/pwrite for non-shmem backed obj + + Signed-off-by: Chris Wilson + +commit 2d08e9e9a1fd05b0d7bf824f3ca98de820c7d615 +Author: Chris Wilson +Date: Fri Dec 11 09:25:03 2015 +0000 + + igt/gem_concurrent_all: Expand testing to cover different memory regimes + + Signed-off-by: Chris Wilson + +commit 6672da5e8f430c65901adf1294647f0f4659bc54 +Author: Daniel Vetter +Date: Thu Dec 10 12:29:14 2015 +0100 + + Revert "igt: s/basic/sanitycheck/ on prior smoketesting" + + This reverts commit 4f5efc5c844f6fe69209982463f9220f8f3951ed. + + There was a bit a misunderstanding on IRC between Chris&me. We want + basic tests as sanity test to be run in the BAT CI. It's just unfortunate + that right now we have fairly limited ability to absorb new ones, both + because of a pile of existing bugs in the kernel and because the CI + infrastructure is still being scaled out. + + The idea was just to remove the BAT tests added yesterday, not all of + the ones we've had for a while longer. + + Cc: Chris Wilson + Grumpily-acked-by: Chris Wilson + Signed-off-by: Daniel Vetter + +commit 4f5efc5c844f6fe69209982463f9220f8f3951ed +Author: Chris Wilson +Date: Thu Dec 10 10:02:46 2015 +0000 + + igt: s/basic/sanitycheck/ on prior smoketesting + + In times past, I added "basic" variants of tests just to ensure that the + general principle of operation was sound before proceeding on to the + main test (which typically looked at thrashing, i.e. were long and + tedious and pointless if the test didn't even work in the normal + situation). Since "basic" now collides with BAT, rename my trivial tests + to "sanitycheck". + + Signed-off-by: Chris Wilson + +commit 197db8607d910c7d5252c1d928b715ff4c4c28ce +Author: Chris Wilson +Date: Wed Dec 9 20:54:10 2015 +0000 + + igt/gem_concurrent_blit: Explicitly check for "missed interrupts" + + As the concurrency tests are a good source of stress for + i915_wait_request() (the tests are primarily designed to ensure that GPU + activity of one form or another is completed before access by third + parties), one of the common form of errors we can detect are the + "missing interrupts" (i.e. where the waits do not terminate because of a + race between the interrupt and the seqno write). Add an explicit check + for this error and flag it as a definite fail - which also helps narrow + it down to certain subtests when run as a batch. + + Signed-off-by: Chris Wilson + +commit 4cc40ad4fe80f4d107e8e4279b0b07243b91f77c +Author: Bob Paauwe +Date: Mon Dec 7 13:53:35 2015 -0800 + + igt/test/pm_rps: load GPU to force not-idle to idle transition. + + When changing the sysfs GT min frequency, the kernel won't + automatcilly drop the GT frequency to idle unless the GPU + transitions from busy to idle. + + Load the GPU after increasing the GT min frequency to force + a busy to idle transition. This matches the behavior when + decreasing the GT min frequency. + + Signed-off-by: Bob Paauwe + Reviewed-by: Imre Deak + +commit 4aa1b99a121a6cb843f463af64cbd92942f809e0 +Author: Rodrigo Vivi +Date: Tue Dec 8 00:11:21 2015 -0800 + + kms_psr_sink_crc: Add BAT test for PSR active. + + It takes from 2 to 5 seconds to run. + + Cc: Daniel Vetter + Signed-off-by: Rodrigo Vivi + +commit 4a004d9cb36ff845aebb8590b8bb08c460620a72 +Author: Rodrigo Vivi +Date: Mon Dec 7 01:26:17 2015 -0800 + + kms_psr_sink_crc: Reduce our time out for PSR active. + + Using same timeout value as kms_fronbuffer_tracking and for + same reasons exposed at 'commit 83582f9b ("kms_frontbuffer_tracking: + Increase the time we wait for PSR.")' + + Signed-off-by: Rodrigo Vivi + +commit be2d5188f6fa14e80847fe51ab546902f2483e35 +Author: Vinay Belgaumkar +Date: Tue Dec 8 11:57:19 2015 +0000 + + tests/gem_softpin: New tests for softpin feature + + These tests exercise the userptr ioctl to create shared buffers + between CPU and GPU. They contain error and normal usage scenarios. + They also contain a couple of stress tests which copy buffers between + CPU and GPU. These tests rely on the softpin patch in order to pin buffers + to a certain VA. + + Caveat: These tests were designed to run on 64-bit system. Future work + includes adding logic to ensure these tests can run on 32-bit systems with + PPGTT support. Some tests are currently disabled for 32-bit systems for that + reason. + + v2: Added cc and signed-off-by fields + + v3: Fixed review comments, added helper functions. Removed userptr error + scenarios covered by existing userptr tests. Modified stress test to have + 100K buffers, it now runs for ~30 mins, checks every element has been written + to correctly, and pins buffers at different VMAs. + + v4: Changed name to gem_softpin + + v5: More fixes. Removed the file based tests, will move them to userptr tests. + Added a function that validates appropriate PPGTT support before running tests. + Optimized stack space and memory footprint in stress test. Removed the eviction + test, will add it back after verifying proper functionality. + + v6: Split basic test into userptr and bo + Fixed some coding style issues. + + v7: Enhanced invalid vma pinning test to verify 32-bit PPGTT functionality. + Enabled the test for 32-bit PPGTT systems, and verify pinning fails above + 32-bit addresses. Enhanced the high adress pinning test to ensure pinning + fails when EXEC_OBJECT_PINNED flag is not used. Some more cosmetic fixes to + close buffer handles. Changed userptr function to used synchronized operations. + + v8: Minor change to high address pinning test as per comment. + + v9: Skip the tests if softpin support is not present. + + v10: Removed trailing white spaces. + + v11: Keep alphabetical order in Makefile and gitignore; update error code + returned while trying to pin above the max vm size (EINVAL); test attempt + to pin above 4GB without the support 48b flag. + + Cc: Michel Thierry + Cc: Tvrtko Ursulin + Signed-off-by: Vinay Belgaumkar + Signed-off-by: Michel Thierry (v11) + Reviewed-by: Tvrtko Ursulin + +commit 89bcdb9022fb7a1f66635b9f2546356ad0c0761a +Author: Chris Wilson +Date: Tue Dec 8 13:42:50 2015 +0000 + + igt/gem_exec_nop: Remove nop latency measurements + + Since commit c8beadb811bdc2b9c21f95144852f3e55867b546 + Author: Derek Morton + Date: Wed Nov 11 14:46:58 2015 +0000 + + tests/gem_exec_nop: Improved test run time + + the stablity of the measurement regressed and it is once again no longer + a reliable metric for detecting regressions. Give up. + + Signed-off-by: Chris Wilson + Cc: Derek Morton + +commit 870548b6533318b10c414663ea4ad2af01bab8b9 +Author: Ville Syrjälä +Date: Fri Dec 4 15:49:30 2015 +0200 + + tests/kms_force_connector_basic: Add prune-stale-modes subtest + + Add a new subtest that makes sure old stale modes get pruned from the + connector's mode list when the EDID changes. + + v2: s/drmModeGetConnector/drmModeGetConnectorCurrent/ since + kmstest_force_edid() already takes care of doing the heavier + call for us (Daniel) + + Signed-off-by: Ville Syrjälä + Acked-by: Daniel Vetter + +commit b0f4df31baf3ddda72a276f3b2b03ae8363d0843 +Author: Ville Syrjälä +Date: Thu Dec 3 19:01:21 2015 +0200 + + lib/kms: Turn base_edid into a template + + Signed-off-by: Ville Syrjälä + +commit 7bd31d090e78d87076f736071a9302aa349164e2 +Author: Rodrigo Vivi +Date: Tue Nov 3 10:02:14 2015 -0800 + + kms_psr_sink_crc: Add suspend/resume sub test. + + Although kms_frontbuffer_tracking already has psr-suspend testcase + this one here can complement it by testing different combination + and mainly covering 2 different cases individually: + + 1. wait-for-psr, suspend-resume tehn run 1 operation. + + 2. suspend-resume, wait-for-psr then run 1 operation. + + v2: Remove no-suspend option since this should be done with piglit + if necessary for now. + + v3: argh! remove remaining no-suspend checks... + + Signed-off-by: Rodrigo Vivi + +commit 63980babcf9a104b12a726953cbe7d946a0aadd2 +Author: Rodrigo Vivi +Date: Tue Nov 3 09:37:56 2015 -0800 + + kms_psr_sink_crc: Fix no-psr option. + + commit 75b286e821 ("tests/kms_psr_sink_crc: test even + if PSR is disabled by default")' force PSR enabling without + respecting the no-psr (running-with-psr-disabled) option. + + Signed-off-by: Rodrigo Vivi + +commit e6848c5839f5506fbc4a496da3815403668e00d7 +Author: Rodrigo Vivi +Date: Thu Dec 3 08:27:08 2015 -0800 + + kms_frontbuffer_tracking: Skip on unreliable CRC. + + Even with all sink crc re-works we still have platforms + where after 6 vblanks it is unable to calculate the + sink crc. But if we don't get the sink crc it isn't true + that test failed, but that we have no ways to say test + passed or failed. + + So let's print a message and move forward in case sink crc + cannot help us to know if the screen has been updated. + + v2: Also include a message on setup_sink_crc and also + only skip when it is mandatory, i.e. when running for PSR. + + Acked-by: Paulo Zanoni + Signed-off-by: Rodrigo Vivi + +commit ea3806badee7dcb7677edcfe35c17499c1b0f377 +Author: Rodrigo Vivi +Date: Thu Dec 3 08:25:38 2015 -0800 + + kms_frontbuffer_tracking: Make sink crc mandatory only for PSR. + + Unfortunately Sink CRC is not 100% reliable for all platforms. + So we cannot block FBC tests nor skip them when we are getting + unreliable Sink CRC results, or not getting them at all. + + Acked-by: Paulo Zanoni + Signed-off-by: Rodrigo Vivi + +commit d074b44ab6a7ac14cc36b1dc98df5bcf73c82f95 +Author: Rodrigo Vivi +Date: Mon Nov 2 15:54:06 2015 -0800 + + kms_frontbuffer_tracking: Increase the time we wait for PSR. + + With commit (drm/i915: Delay first PSR activation.) in kernel + PSR might take a bit longer to really activate after the modeset. + The first PSR activation after modeset is taking 5 times the panel + power cycle delay time, which is 600ms for our machines here. + So timeout here needs to be a minimum of 3s. However let's use + 5s as the safe value in case we find machines with higher power + cycle delay. + + Since we do a lot of assert(psr_disabled), this commit is increasing + the time it takes to run the whole set of PSR tests by a few minutes, + which had been reduced by commit f4db3b18841 + ("kms_frontbuffer_tracking: reduce the PSR wait timeout to 2s"). + + Reviewed-by: Paulo Zanoni + Signed-off-by: Rodrigo Vivi + +commit 8b22e051e8306a8ee5e78862b403f01cc5b683ec +Author: Bob Paauwe +Date: Thu Dec 3 16:28:00 2015 -0800 + + igt/pm_rps: current freq < user specified min is not a fail (v3) + + Since commit + + commit aed242ff7ebb697e4dff912bd4dc7ec7192f7581 + Author: Chris Wilson + Date: Wed Mar 18 09:48:21 2015 +0000 + + drm/i915: Relax RPS contraints to allows setting minfreq on idle + + it is now possible that the current frequency will drop be the user + specified minimum frequency to the "idle" or RPn frequency. Update the + pm_rps tests to reflect that droping below the user specified minimum + is no longer considered a failure. + + v2: Add check RPn <= current freq. (Me) + v3: Use RPn instead of MIN frequency in idle check (Imre) + Signed-off-by: Bob Paauwe + Reviewed-by: Imre Deak + +commit 6cf72724e225524cd0a4352ba829ffc578f40a4d +Author: Daniel Vetter +Date: Thu Dec 3 07:45:36 2015 +0100 + + tests/drv_hangman: Open drm fd before doing anything + + This way we correctly auto-skip instead of falling over the + lack of i915 debugfs files first and fail the testcase due to + that. + + Signed-off-by: Daniel Vetter + +commit ee0808982f40130d29691c37505dafcbf45f9da5 +Author: Daniel Vetter +Date: Thu Dec 3 07:45:35 2015 +0100 + + tests/drm_lib.sh: Skip when i915 debugfs wasn't found + + Instead of failing. We might want to move this into i915 tests + eventually, but this is good for now. + + v2: Use the correct exit code (Derek) and use the new symbolic values + Thomas added. + + Signed-off-by: Daniel Vetter + +commit d8d1eab318f2f22c9199dcefc2b7b96ba4793cdc +Author: Daniel Vetter +Date: Thu Dec 3 07:45:34 2015 +0100 + + lib: igt_fork_hang_helper must be run in fixtures + + Because it opens an intel-specific drm fd. Fixes crashes when running + igt on no-intel. + + Signed-off-by: Daniel Vetter + +commit 39e44dfa4c0ba2f979dab5ea81074343de0ad2cb +Author: Chris Wilson +Date: Fri Dec 4 10:22:16 2015 +0000 + + benchmarks/gem_exec_nop: Flush retirement lists before executing + + wait-ioctl skips a couple of side-effects of retiring, so provoke them + using set-domain before we sleep. + + Signed-off-by: Chris Wilson + +commit 839a1426ce2a8510cdf0e648b06f28e7c33b64b6 +Author: Daniel Vetter +Date: Tue Dec 1 11:24:20 2015 +0100 + + tests/kms_force_connector: Include in BAT set + + Forcing connector state is a basic piece of our test infrastructure + that we use in all the kms_ tests. It allows us to run tests even if + no outputs are connected. + + They're also really fast, so perfect candidates for inclusion into the + BAT set. + + Signed-off-by: Daniel Vetter + +commit db4f83ca5da29673ab9210e4322156518047130d +Author: Daniel Vetter +Date: Tue Dec 1 11:24:19 2015 +0100 + + lib/kms+tests: Use cached connector state + + Speeds up testcases except for those where we want to exercise the + probing itself. The only exceptions left where we do a full probe are + + - pm_rpm: We use it to make sure the kernel doesn't get things wrong + with power domains, so we really want to exercise the full probe + paths. And there the only place really is the specific validation + done with the data gathered by get_drm_info. + + - kmstest_force_ functions: Newer kernels should be better at + re-probing state when the force sysfs fields change, but better safe + than sorry. + + v2: I also consolidated the start_n_modes and start_connectors while + at it - move one of the fixup hunks to this patch that accidentally + got misplaced (Thomas). + + Cc: Thomas Wood + Signed-off-by: Daniel Vetter + +commit cdb398b5b9a6a1895bbc8213f88bc9e45795db23 +Author: Daniel Vetter +Date: Tue Dec 1 11:24:18 2015 +0100 + + tests/kms_force_connector: Fixes + + The edid we inject stayed the same, but the kernel started to list + more modes for it. No idea whether that's the right thing here since + I'm not really an EDID expert. But then again the testcase wants to + check that the injection works, not validate the kernel's parser. + + v2: Only check the preferred mode for more future-proofing (Thomas). + + v3: Clarify commit message (Jani). + + Cc: Thomas Wood + Signed-off-by: Daniel Vetter + +commit 02cdd9899dbf56ae8b9ae8ee2b83e2afcd479193 +Author: Thomas Wood +Date: Thu Dec 3 11:36:02 2015 +0000 + + tests: add exit value constants for shell script tests + + Signed-off-by: Thomas Wood + +commit 8a58734c110375793306fc10a31d5b17e816471b +Author: Thomas Wood +Date: Thu Dec 3 11:12:38 2015 +0000 + + tests: replace drm_open_any in gem_create and gem_stolen + + drm_open_any has been replaced by drm_open_driver. + + Signed-off-by: Thomas Wood + +commit 67d32c210dab272f02d6b4e19a54451a3e0231e5 +Author: Ankitprasad Sharma +Date: Wed Dec 2 14:54:52 2015 +0530 + + igt/gem_create: Test to validate parameters for GEM_CREATE ioctl + + This test validates the two parameters (size and flags) GEM_CREATE ioctl. + + v2: Added IGT_TEST_DESCRIPTION (Thomas Wood) + + v3: Removed use of hard coded values, updated comments (Tvrtko) + + v4: Removed over-use of macros, updated with multiples of PAGE_SIZE (Tvrtko) + + Signed-off-by: Ankitprasad Sharma + Reviewed-by: Tvrtko Ursulin + Signed-off-by: Thomas Wood + +commit 48c945322b4c5f6443758143cccb9c4c04da4aaa +Author: Ankitprasad Sharma +Date: Wed Dec 2 14:54:51 2015 +0530 + + igt/gem_pread: Support to verify pread/pwrite for non-shmem backed obj + + This patch adds support to verify pread/pwrite for non-shmem backed + objects. It also shows the pread/pwrite speed. + It also tests speeds for pread with and without user side page faults + + v2: Fixed Rebase conflicts (Ankit) + + v3: Precalculating values to avoid redundant function calls (Dave) + Replaced igt_subtest by igt_subtest_f, added asserts for mmap, corrected + indentation (Tvrtko) + + v4: Updated data types to avoid redundant type conversions (Tvrtko) + Corrected pagefault-pread time calculation (Ankit) + + Signed-off-by: Ankitprasad Sharma + Reviewed-by: Tvrtko Ursulin + Signed-off-by: Thomas Wood + +commit 70c3be83a0638cb65518ad2536719996d1f5a40c +Author: Ankitprasad Sharma +Date: Wed Dec 2 14:54:50 2015 +0530 + + igt/gem_stolen: Verifying extended gem_create ioctl + + This patch adds the testcases for verifying the new extended + gem_create ioctl. By means of this extended ioctl, memory + placement of the GEM object can be specified, i.e. either + shmem or stolen memory. + These testcases include functional tests and interface tests for + testing the gem_create ioctl call for stolen memory placement + + v2: Testing pread/pwrite functionality for stolen backed objects, + added local struct for extended gem_create and gem_get_aperture, + until headers catch up (Chris) + + v3: Removed get_aperture related functions, extended gem_pread + to compare speeds for user pages with and without page faults, + unexposed local_gem_create struct, changed gem_create_stolen + usage (Chris) + + v4: Splitting patch to remove changes from gem_pread/gem_pwrite + to another patch (Ankit) + + v5: Fixed Rebase conflicts (Ankit) + Added IGT_TEST_DESCRIPTION (Thomas Wood) + + v6: Added __gem_create_stolen for user to handle error, updated + gem_create_stolen to align with gem_create function, corrected + fill_purge test (out of bound access), added testcase to validate + allocating of more than 32 bit sized buffers (Tvrtko) + + v7: Removed unused variables, Corrected comments & formatting (Tvrtko) + + Signed-off-by: Ankitprasad Sharma + Reviewed-by: Tvrtko Ursulin + Signed-off-by: Thomas Wood + commit 2db78a4995a8ee298ae0cd68879baf80407a0e5e Author: Thomas Wood Date: Wed Dec 2 16:46:39 2015 +0000 diff -Nru intel-gpu-tools-1.13/config.h.in intel-gpu-tools-1.15/config.h.in --- intel-gpu-tools-1.13/config.h.in 2015-12-02 16:48:03.000000000 +0000 +++ intel-gpu-tools-1.15/config.h.in 2016-05-31 17:03:42.000000000 +0000 @@ -69,17 +69,22 @@ /* Define to 1 if you have the header file. */ #undef HAVE_TERMIOS_H +/* Define to 1 if you have the `timer_create' function. */ +#undef HAVE_TIMER_CREATE + /* Enable udev-based monitor hotplug detection */ #undef HAVE_UDEV /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H +/* Have vc4 support */ +#undef HAVE_VC4 + /* Have libXrandr */ #undef HAVE_XRANDR -/* Define to the sub-directory in which libtool stores uninstalled libraries. - */ +/* Define to the sub-directory where libtool stores uninstalled libraries. */ #undef LT_OBJDIR /* Name of package */ diff -Nru intel-gpu-tools-1.13/configure intel-gpu-tools-1.15/configure --- intel-gpu-tools-1.13/configure 2015-12-02 16:47:59.000000000 +0000 +++ intel-gpu-tools-1.15/configure 2016-05-31 17:03:31.000000000 +0000 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for intel-gpu-tools 1.13. +# Generated by GNU Autoconf 2.69 for intel-gpu-tools 1.15. # # Report bugs to . # @@ -591,8 +591,8 @@ # Identity of this package. PACKAGE_NAME='intel-gpu-tools' PACKAGE_TARNAME='intel-gpu-tools' -PACKAGE_VERSION='1.13' -PACKAGE_STRING='intel-gpu-tools 1.13' +PACKAGE_VERSION='1.15' +PACKAGE_STRING='intel-gpu-tools 1.15' PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=DRI&component=DRM/Intel' PACKAGE_URL='' @@ -648,12 +648,14 @@ BUILD_SHADER_DEBUGGER_FALSE BUILD_SHADER_DEBUGGER_TRUE OBJCOPY +HAVE_VC4_FALSE +HAVE_VC4_TRUE +DRM_VC4_LIBS +DRM_VC4_CFLAGS HAVE_NOUVEAU_FALSE HAVE_NOUVEAU_TRUE DRM_NOUVEAU_LIBS DRM_NOUVEAU_CFLAGS -BUILD_ASSEMBLER_FALSE -BUILD_ASSEMBLER_TRUE GLIB_LIBS GLIB_CFLAGS LIBUDEV_LIBS @@ -668,6 +670,10 @@ BUILD_OVERLAY_XLIB_TRUE BUILD_OVERLAY_XVLIB_FALSE BUILD_OVERLAY_XVLIB_TRUE +BUILD_ASSEMBLER_FALSE +BUILD_ASSEMBLER_TRUE +BUILD_X86_FALSE +BUILD_X86_TRUE OVERLAY_XLIB_LIBS OVERLAY_XLIB_CFLAGS OVERLAY_XVLIB_LIBS @@ -696,6 +702,7 @@ STRICT_CFLAGS CWARNFLAGS BASE_CFLAGS +LT_SYS_LIBRARY_PATH OTOOL64 OTOOL LIPO @@ -715,6 +722,7 @@ FGREP SED LIBTOOL +TIMER_LIBS HAVE_RST2MAN_FALSE HAVE_RST2MAN_TRUE RST2MAN @@ -791,6 +799,10 @@ INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM +target_os +target_vendor +target_cpu +target host_os host_vendor host_cpu @@ -828,6 +840,7 @@ docdir oldincludedir includedir +runstatedir localstatedir sharedstatedir sysconfdir @@ -861,15 +874,18 @@ enable_shared with_pic enable_fast_install +with_aix_soname with_gnu_ld with_sysroot enable_libtool_lock enable_selective_werror enable_strict_compilation enable_nouveau +enable_vc4 enable_shader_debugger with_libunwind enable_debug +enable_werror enable_git_hash enable_tests ' @@ -890,6 +906,7 @@ PKG_CONFIG_LIBDIR GTKDOC_DEPS_CFLAGS GTKDOC_DEPS_LIBS +LT_SYS_LIBRARY_PATH DRM_CFLAGS DRM_LIBS PCIACCESS_CFLAGS @@ -908,6 +925,8 @@ GLIB_LIBS DRM_NOUVEAU_CFLAGS DRM_NOUVEAU_LIBS +DRM_VC4_CFLAGS +DRM_VC4_LIBS LIBUNWIND_CFLAGS LIBUNWIND_LIBS' @@ -948,6 +967,7 @@ sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' +runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' @@ -1200,6 +1220,15 @@ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; + -runstatedir | --runstatedir | --runstatedi | --runstated \ + | --runstate | --runstat | --runsta | --runst | --runs \ + | --run | --ru | --r) + ac_prev=runstatedir ;; + -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ + | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ + | --run=* | --ru=* | --r=*) + runstatedir=$ac_optarg ;; + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ @@ -1337,7 +1366,7 @@ 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 + libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. @@ -1450,7 +1479,7 @@ # 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.13 to adapt to many kinds of systems. +\`configure' configures intel-gpu-tools 1.15 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1490,6 +1519,7 @@ --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] + --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] @@ -1515,12 +1545,13 @@ System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] + --target=TARGET configure for building compilers for TARGET [HOST] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of intel-gpu-tools 1.13:";; + short | recursive ) echo "Configuration of intel-gpu-tools 1.15:";; esac cat <<\_ACEOF @@ -1551,9 +1582,11 @@ errors (default: disabled) --disable-nouveau Enable use of nouveau API for prime tests (default: auto) + --disable-vc4 Enable building of vc4 tests (default: auto) --enable-shader-debugger Enable shader debugging support [autodetected] --disable-debug Build tests without debug symbols + --enable-werror Fail on warnings --disable-git-hash Do not use git hash in version --disable-tests Disable tests build (default: enabled) @@ -1563,9 +1596,12 @@ --with-html-dir=PATH path to installed docs --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use both] + --with-aix-soname=aix|svr4|both + shared library versioning (aka "SONAME") variant to + provide on AIX, [default=aix]. --with-gnu-ld assume the C compiler uses GNU ld [default=no] - --with-sysroot=DIR Search for dependent libraries within DIR - (or the compiler's sysroot if not specified). + --with-sysroot[=DIR] Search for dependent libraries within DIR (or the + compiler's sysroot if not specified). --without-libunwind Build tests without libunwind support Some influential environment variables: @@ -1593,6 +1629,8 @@ C compiler flags for GTKDOC_DEPS, overriding pkg-config GTKDOC_DEPS_LIBS linker flags for GTKDOC_DEPS, overriding pkg-config + LT_SYS_LIBRARY_PATH + User-defined run-time library search path. DRM_CFLAGS C compiler flags for DRM, overriding pkg-config DRM_LIBS linker flags for DRM, overriding pkg-config PCIACCESS_CFLAGS @@ -1623,6 +1661,10 @@ C compiler flags for DRM_NOUVEAU, overriding pkg-config DRM_NOUVEAU_LIBS linker flags for DRM_NOUVEAU, overriding pkg-config + DRM_VC4_CFLAGS + C compiler flags for DRM_VC4, overriding pkg-config + DRM_VC4_LIBS + linker flags for DRM_VC4, overriding pkg-config LIBUNWIND_CFLAGS C compiler flags for LIBUNWIND, overriding pkg-config LIBUNWIND_LIBS @@ -1694,7 +1736,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -intel-gpu-tools configure 1.13 +intel-gpu-tools configure 1.15 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2220,7 +2262,7 @@ 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.13, which was +It was created by intel-gpu-tools $as_me 1.15, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3937,7 +3979,7 @@ 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)) +#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; @@ -3983,7 +4025,7 @@ 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)) +#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; @@ -4007,7 +4049,7 @@ 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)) +#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; @@ -4052,7 +4094,7 @@ 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)) +#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; @@ -4076,7 +4118,7 @@ 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)) +#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; @@ -4184,6 +4226,45 @@ case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5 +$as_echo_n "checking target system type... " >&6; } +if ${ac_cv_target+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "x$target_alias" = x; then + ac_cv_target=$ac_cv_host +else + ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5 +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5 +$as_echo "$ac_cv_target" >&6; } +case $ac_cv_target in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical target" "$LINENO" 5;; +esac +target=$ac_cv_target +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_target +shift +target_cpu=$1 +target_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +target_os=$* +IFS=$ac_save_IFS +case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac + + +# The aliases save the names the user supplied, while $host etc. +# will get canonicalized. +test -n "$target_alias" && + test "$program_prefix$program_suffix$program_transform_name" = \ + NONENONEs,x,x, && + program_prefix=${target_alias}- am__api_version='1.15' @@ -4731,7 +4812,7 @@ # Define the identity of the package. PACKAGE='intel-gpu-tools' - VERSION='1.13' + VERSION='1.15' cat >>confdefs.h <<_ACEOF @@ -6734,6 +6815,113 @@ done +for ac_func in timer_create +do : + ac_fn_c_check_func "$LINENO" "timer_create" "ac_cv_func_timer_create" +if test "x$ac_cv_func_timer_create" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_TIMER_CREATE 1 +_ACEOF + +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for timer_create in -lrt" >&5 +$as_echo_n "checking for timer_create in -lrt... " >&6; } +if ${ac_cv_lib_rt_timer_create+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lrt $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 timer_create (); +int +main () +{ +return timer_create (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_rt_timer_create=yes +else + ac_cv_lib_rt_timer_create=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_rt_timer_create" >&5 +$as_echo "$ac_cv_lib_rt_timer_create" >&6; } +if test "x$ac_cv_lib_rt_timer_create" = xyes; then : + + $as_echo "#define HAVE_TIMER_CREATE 1" >>confdefs.h + + TIMER_LIBS="-lrt" + +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for timer_create in -lpthread" >&5 +$as_echo_n "checking for timer_create in -lpthread... " >&6; } +if ${ac_cv_lib_pthread_timer_create+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lpthread $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 timer_create (); +int +main () +{ +return timer_create (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_pthread_timer_create=yes +else + ac_cv_lib_pthread_timer_create=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_pthread_timer_create" >&5 +$as_echo "$ac_cv_lib_pthread_timer_create" >&6; } +if test "x$ac_cv_lib_pthread_timer_create" = xyes; then : + + $as_echo "#define HAVE_TIMER_CREATE 1" >>confdefs.h + + TIMER_LIBS="-lpthread" + +fi + + +fi + + +fi +done + + + # Initialize libtool # Check whether --enable-static was given. if test "${enable_static+set}" = set; then : @@ -6744,14 +6932,14 @@ *) enable_static=no # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do - IFS="$lt_save_ifs" + IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_static=yes fi done - IFS="$lt_save_ifs" + IFS=$lt_save_ifs ;; esac else @@ -6774,8 +6962,8 @@ -macro_version='2.4.2' -macro_revision='1.3337' +macro_version='2.4.6' +macro_revision='2.4.6' @@ -6789,7 +6977,7 @@ -ltmain="$ac_aux_dir/ltmain.sh" +ltmain=$ac_aux_dir/ltmain.sh # Backslashify metacharacters that are still active within # double-quoted strings. @@ -6838,7 +7026,7 @@ $ECHO "" } -case "$ECHO" in +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 @@ -7031,19 +7219,19 @@ # 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 + withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld -if test "$GCC" = yes; then +if test yes = "$GCC"; 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 + # 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` ;; @@ -7057,7 +7245,7 @@ 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" + test -z "$LD" && LD=$ac_prog ;; "") # If it fails, then pretend we aren't using GCC. @@ -7068,7 +7256,7 @@ with_gnu_ld=unknown ;; esac -elif test "$with_gnu_ld" = yes; then +elif test yes = "$with_gnu_ld"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else @@ -7079,32 +7267,32 @@ $as_echo_n "(cached) " >&6 else if test -z "$LD"; then - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do - IFS="$lt_save_ifs" + 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" + 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; } @@ -7147,33 +7335,38 @@ else if test -n "$NM"; then # Let the user override the test. - lt_cv_path_NM="$NM" + lt_cv_path_NM=$NM else - lt_nm_to_check="${ac_tool_prefix}nm" + 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 + 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" + 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 + 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: + # 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'*) + # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty + case $build_os in + mingw*) lt_bad_file=conftest.nm/nofile ;; + *) lt_bad_file=/dev/null ;; + esac + case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in + *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" - break + break 2 ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" - break + break 2 ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but @@ -7184,15 +7377,15 @@ esac fi done - IFS="$lt_save_ifs" + 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" +if test no != "$lt_cv_path_NM"; then + NM=$lt_cv_path_NM else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : @@ -7298,9 +7491,9 @@ fi fi - case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in + case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in *COFF*) - DUMPBIN="$DUMPBIN -symbols" + DUMPBIN="$DUMPBIN -symbols -headers" ;; *) DUMPBIN=: @@ -7308,8 +7501,8 @@ esac fi - if test "$DUMPBIN" != ":"; then - NM="$DUMPBIN" + if test : != "$DUMPBIN"; then + NM=$DUMPBIN fi fi test -z "$NM" && NM=nm @@ -7360,7 +7553,7 @@ $as_echo_n "(cached) " >&6 else i=0 - teststring="ABCD" + teststring=ABCD case $build_os in msdosdjgpp*) @@ -7400,7 +7593,7 @@ lt_cv_sys_max_cmd_len=8192; ;; - netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) + bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` @@ -7450,22 +7643,23 @@ ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` - if test -n "$lt_cv_sys_max_cmd_len"; then + if test -n "$lt_cv_sys_max_cmd_len" && \ + test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. - for i in 1 2 3 4 5 6 7 8 ; do + 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` \ + 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 + test 17 != "$i" # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring @@ -7483,7 +7677,7 @@ fi -if test -n $lt_cv_sys_max_cmd_len ; then +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 @@ -7501,30 +7695,6 @@ : ${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 @@ -7647,13 +7817,13 @@ reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in cygwin* | mingw* | pw32* | cegcc*) - if test "$GCC" != yes; then + if test yes != "$GCC"; then reload_cmds=false fi ;; darwin*) - if test "$GCC" = yes; then - reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' + if test yes = "$GCC"; then + reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi @@ -7781,13 +7951,13 @@ # 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. +# '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. +# that responds to the $file_magic_cmd with a given extended regex. +# If you have 'file' or equivalent on your system and you're not sure +# whether 'pass_all' will *always* work, you probably want this one. case $host_os in aix[4-9]*) @@ -7814,8 +7984,7 @@ # 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 + if ( file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else @@ -7851,10 +8020,6 @@ fi ;; -gnu*) - lt_cv_deplibs_check_method=pass_all - ;; - haiku*) lt_cv_deplibs_check_method=pass_all ;; @@ -7893,11 +8058,11 @@ ;; # This must be glibc/ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; -netbsd*) +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 @@ -7915,8 +8080,8 @@ 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 +openbsd* | bitrig*) + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' @@ -7969,6 +8134,9 @@ tpf*) lt_cv_deplibs_check_method=pass_all ;; +os2*) + lt_cv_deplibs_check_method=pass_all + ;; esac fi @@ -8126,8 +8294,8 @@ 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 + # two different shell functions defined in ltmain.sh; + # decide which one to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib @@ -8139,7 +8307,7 @@ ;; *) # fallback: assume linklib IS sharedlib - lt_cv_sharedlib_from_linklib_cmd="$ECHO" + lt_cv_sharedlib_from_linklib_cmd=$ECHO ;; esac @@ -8293,7 +8461,7 @@ ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } - if test "$ac_status" -eq 0; then + if test 0 -eq "$ac_status"; 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 @@ -8301,7 +8469,7 @@ ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } - if test "$ac_status" -ne 0; then + if test 0 -ne "$ac_status"; then lt_cv_ar_at_file=@ fi fi @@ -8314,7 +8482,7 @@ { $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 +if test no = "$lt_cv_ar_at_file"; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file @@ -8531,7 +8699,7 @@ if test -n "$RANLIB"; then case $host_os in - openbsd*) + bitrig* | openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) @@ -8621,7 +8789,7 @@ symcode='[ABCDGISTW]' ;; hpux*) - if test "$host_cpu" = ia64; then + if test ia64 = "$host_cpu"; then symcode='[ABCDEGRST]' fi ;; @@ -8654,14 +8822,44 @@ symcode='[ABCDGIRSTW]' ;; esac +if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Gets list of data symbols to import. + lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" + # Adjust the below global symbol transforms to fixup imported variables. + lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" + lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" + lt_c_name_lib_hook="\ + -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ + -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" +else + # Disable hooks by default. + lt_cv_sys_global_symbol_to_import= + lt_cdecl_hook= + lt_c_name_hook= + lt_c_name_lib_hook= +fi + # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. -lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" +lt_cv_sys_global_symbol_to_cdecl="sed -n"\ +$lt_cdecl_hook\ +" -e 's/^T .* \(.*\)$/extern int \1();/p'"\ +" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n -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'" +lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ +$lt_c_name_hook\ +" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ +" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" + +# Transform an extracted symbol line into symbol name with lib prefix and +# symbol address. +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ +$lt_c_name_lib_hook\ +" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ +" -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ +" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" # Handle CRLF in mingw tool chain opt_cr= @@ -8679,21 +8877,24 @@ # 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. + # Fake it for dumpbin and say T for any non-static function, + # D for any global variable and I for any imported variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ +" /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ +" /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ +" /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ -" {f=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))}"\ +" {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ +" {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ +" s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ +" s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" @@ -8741,11 +8942,11 @@ 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 +#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE +/* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST -#elif defined(__osf__) +#elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else @@ -8771,7 +8972,7 @@ { { "@PROGRAM@", (void *) 0 }, _LT_EOF - $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext + $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; @@ -8791,13 +8992,13 @@ mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS - LIBS="conftstm.$ac_objext" + 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 + test $ac_status = 0; } && test -s conftest$ac_exeext; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS @@ -8818,7 +9019,7 @@ rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. - if test "$pipe_works" = yes; then + if test yes = "$pipe_works"; then break else lt_cv_sys_global_symbol_pipe= @@ -8871,6 +9072,16 @@ + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 $as_echo_n "checking for sysroot... " >&6; } @@ -8883,9 +9094,9 @@ lt_sysroot= -case ${with_sysroot} in #( +case $with_sysroot in #( yes) - if test "$GCC" = yes; then + if test yes = "$GCC"; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( @@ -8895,8 +9106,8 @@ no|'') ;; #( *) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5 -$as_echo "${with_sysroot}" >&6; } + { $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 @@ -8908,18 +9119,99 @@ +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5 +$as_echo_n "checking for a working dd... " >&6; } +if ${ac_cv_path_lt_DD+:} false; then : + $as_echo_n "(cached) " >&6 +else + printf 0123456789abcdef0123456789abcdef >conftest.i +cat conftest.i conftest.i >conftest2.i +: ${lt_DD:=$DD} +if test -z "$lt_DD"; then + ac_path_lt_DD_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 dd; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_lt_DD="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_lt_DD" || continue +if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then + cmp -s conftest.i conftest.out \ + && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: +fi + $ac_path_lt_DD_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_lt_DD"; then + : + fi +else + ac_cv_path_lt_DD=$lt_DD +fi + +rm -f conftest.i conftest2.i conftest.out +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5 +$as_echo "$ac_cv_path_lt_DD" >&6; } + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5 +$as_echo_n "checking how to truncate binary pipes... " >&6; } +if ${lt_cv_truncate_bin+:} false; then : + $as_echo_n "(cached) " >&6 +else + printf 0123456789abcdef0123456789abcdef >conftest.i +cat conftest.i conftest.i >conftest2.i +lt_cv_truncate_bin= +if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then + cmp -s conftest.i conftest.out \ + && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" +fi +rm -f conftest.i conftest2.i conftest.out +test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5 +$as_echo "$lt_cv_truncate_bin" >&6; } + + + + + + + +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +func_cc_basename () +{ + for cc_temp in $*""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac + done + func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +} + # 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 +test no = "$enable_libtool_lock" || enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) - # Find out which ABI we are using. + # Find out what ABI is being produced by ac_compile, and set mode + # options accordingly. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 @@ -8928,24 +9220,25 @@ test $ac_status = 0; }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) - HPUX_IA64_MODE="32" + HPUX_IA64_MODE=32 ;; *ELF-64*) - HPUX_IA64_MODE="64" + HPUX_IA64_MODE=64 ;; esac fi rm -rf conftest* ;; *-*-irix6*) - # Find out which ABI we are using. + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. 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 + if test yes = "$lt_cv_prog_gnu_ld"; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" @@ -8974,9 +9267,50 @@ rm -rf conftest* ;; +mips64*-*linux*) + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. + echo '#line '$LINENO' "configure"' > conftest.$ac_ext + if { { 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 + emul=elf + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + emul="${emul}32" + ;; + *64-bit*) + emul="${emul}64" + ;; + esac + case `/usr/bin/file conftest.$ac_objext` in + *MSB*) + emul="${emul}btsmip" + ;; + *LSB*) + emul="${emul}ltsmip" + ;; + esac + case `/usr/bin/file conftest.$ac_objext` in + *N32*) + emul="${emul}n32" + ;; + esac + LD="${LD-ld} -m $emul" + fi + rm -rf conftest* + ;; + x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) - # Find out which ABI we are using. + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. Note that the listed cases only cover the + # situations where additional linker options are needed (such as when + # doing 32-bit compilation for a host where ld defaults to 64-bit, or + # vice versa); the common cases where no linker options are needed do + # not appear in the list. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 @@ -8990,7 +9324,14 @@ LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) - LD="${LD-ld} -m elf_i386" + case `/usr/bin/file conftest.o` in + *x86-64*) + LD="${LD-ld} -m elf32_x86_64" + ;; + *) + LD="${LD-ld} -m elf_i386" + ;; + esac ;; powerpc64le-*linux*) LD="${LD-ld} -m elf32lppclinux" @@ -9035,7 +9376,7 @@ *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. - SAVE_CFLAGS="$CFLAGS" + 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; } @@ -9075,13 +9416,14 @@ 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 + if test yes != "$lt_cv_cc_needs_belf"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf - CFLAGS="$SAVE_CFLAGS" + CFLAGS=$SAVE_CFLAGS fi ;; *-*solaris*) - # Find out which ABI we are using. + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 @@ -9093,7 +9435,7 @@ case $lt_cv_prog_gnu_ld in yes*) case $host in - i?86-*-solaris*) + i?86-*-solaris*|x86_64-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) @@ -9102,7 +9444,7 @@ 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" + LD=${LD-ld}_sol2 fi ;; *) @@ -9118,7 +9460,7 @@ ;; esac -need_locks="$enable_libtool_lock" +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. @@ -9229,7 +9571,7 @@ 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 +if test yes != "$lt_cv_path_mainfest_tool"; then MANIFEST_TOOL=: fi @@ -9732,7 +10074,7 @@ $as_echo_n "(cached) " >&6 else lt_cv_apple_cc_single_mod=no - if test -z "${LT_MULTI_MODULE}"; then + 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 @@ -9750,7 +10092,7 @@ 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 + elif test -f libconftest.dylib && test 0 = "$_lt_result"; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 @@ -9789,7 +10131,7 @@ fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext - LDFLAGS="$save_LDFLAGS" + LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 @@ -9818,7 +10160,7 @@ _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 + elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then lt_cv_ld_force_load=yes else cat conftest.err >&5 @@ -9831,32 +10173,32 @@ $as_echo "$lt_cv_ld_force_load" >&6; } case $host_os in rhapsody* | darwin1.[012]) - _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; + _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; darwin1.*) - _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + _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' ;; + _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' ;; + _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; esac ;; esac - if test "$lt_cv_apple_cc_single_mod" = "yes"; then + if test yes = "$lt_cv_apple_cc_single_mod"; 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' + if test yes = "$lt_cv_ld_exported_symbols_list"; then + _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' else - _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' + _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib' fi - if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then + if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= @@ -9864,6 +10206,41 @@ ;; esac +# func_munge_path_list VARIABLE PATH +# ----------------------------------- +# VARIABLE is name of variable containing _space_ separated list of +# directories to be munged by the contents of PATH, which is string +# having a format: +# "DIR[:DIR]:" +# string "DIR[ DIR]" will be prepended to VARIABLE +# ":DIR[:DIR]" +# string "DIR[ DIR]" will be appended to VARIABLE +# "DIRP[:DIRP]::[DIRA:]DIRA" +# string "DIRP[ DIRP]" will be prepended to VARIABLE and string +# "DIRA[ DIRA]" will be appended to VARIABLE +# "DIR[:DIR]" +# VARIABLE will be replaced by "DIR[ DIR]" +func_munge_path_list () +{ + case x$2 in + x) + ;; + *:) + eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" + ;; + x:*) + eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" + ;; + *::*) + eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" + eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" + ;; + *) + eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" + ;; + 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 @@ -9900,14 +10277,14 @@ *) enable_shared=no # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do - IFS="$lt_save_ifs" + IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_shared=yes fi done - IFS="$lt_save_ifs" + IFS=$lt_save_ifs ;; esac else @@ -9932,14 +10309,14 @@ *) pic_mode=default # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for lt_pkg in $withval; do - IFS="$lt_save_ifs" + IFS=$lt_save_ifs if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done - IFS="$lt_save_ifs" + IFS=$lt_save_ifs ;; esac else @@ -9947,8 +10324,6 @@ fi -test -z "$pic_mode" && pic_mode=default - @@ -9964,14 +10339,14 @@ *) 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," + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do - IFS="$lt_save_ifs" + IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done - IFS="$lt_save_ifs" + IFS=$lt_save_ifs ;; esac else @@ -9985,11 +10360,63 @@ + shared_archive_member_spec= +case $host,$enable_shared in +power*-*-aix[5-9]*,yes) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5 +$as_echo_n "checking which variant of shared library versioning to provide... " >&6; } + +# Check whether --with-aix-soname was given. +if test "${with_aix_soname+set}" = set; then : + withval=$with_aix_soname; case $withval in + aix|svr4|both) + ;; + *) + as_fn_error $? "Unknown argument to --with-aix-soname" "$LINENO" 5 + ;; + esac + lt_cv_with_aix_soname=$with_aix_soname +else + if ${lt_cv_with_aix_soname+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_with_aix_soname=aix +fi + + with_aix_soname=$lt_cv_with_aix_soname +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5 +$as_echo "$with_aix_soname" >&6; } + if test aix != "$with_aix_soname"; then + # For the AIX way of multilib, we name the shared archive member + # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', + # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. + # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, + # the AIX toolchain works better with OBJECT_MODE set (default 32). + if test 64 = "${OBJECT_MODE-32}"; then + shared_archive_member_spec=shr_64 + else + shared_archive_member_spec=shr + fi + fi + ;; +*) + with_aix_soname=aix + ;; +esac + + + + + + + # This can be used to rebuild libtool when needed -LIBTOOL_DEPS="$ltmain" +LIBTOOL_DEPS=$ltmain # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' @@ -10038,7 +10465,7 @@ -if test -n "${ZSH_VERSION+set}" ; then +if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi @@ -10077,7 +10504,7 @@ # 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 + if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi @@ -10088,14 +10515,14 @@ ofile=libtool can_build_shared=yes -# All known linkers require a `.a' archive for static linking (except MSVC, +# 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" +with_gnu_ld=$lt_cv_prog_gnu_ld -old_CC="$CC" -old_CFLAGS="$CFLAGS" +old_CC=$CC +old_CFLAGS=$CFLAGS # Set sane defaults for various variables test -z "$CC" && CC=cc @@ -10104,15 +10531,8 @@ 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-%%"` +func_cc_basename $compiler +cc_basename=$func_cc_basename_result # Only perform the check for file, if the check method requires it @@ -10127,22 +10547,22 @@ else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + 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 + 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" + 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 -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" + 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 : @@ -10165,13 +10585,13 @@ break fi done - IFS="$lt_save_ifs" - MAGIC_CMD="$lt_save_MAGIC_CMD" + IFS=$lt_save_ifs + MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac fi -MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +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; } @@ -10193,22 +10613,22 @@ else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + 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 + 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" + 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 -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" + 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 : @@ -10231,13 +10651,13 @@ break fi done - IFS="$lt_save_ifs" - MAGIC_CMD="$lt_save_MAGIC_CMD" + IFS=$lt_save_ifs + MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac fi -MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +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; } @@ -10258,7 +10678,7 @@ # Use C for the default configuration in the libtool script -lt_save_CC="$CC" +lt_save_CC=$CC ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -10320,7 +10740,7 @@ lt_prog_compiler_no_builtin_flag= -if test "$GCC" = yes; then +if test yes = "$GCC"; then case $cc_basename in nvcc*) lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; @@ -10336,7 +10756,7 @@ 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" + lt_compiler_flag="-fno-rtti -fno-exceptions" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins @@ -10366,7 +10786,7 @@ { $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 +if test yes = "$lt_cv_prog_compiler_rtti_exceptions"; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : @@ -10384,17 +10804,18 @@ lt_prog_compiler_static= - if test "$GCC" = yes; then + if test yes = "$GCC"; 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 + if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi + lt_prog_compiler_pic='-fPIC' ;; amigaos*) @@ -10405,8 +10826,8 @@ ;; 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'. + # adding the '-m68020' flag to GCC prevents building anything better, + # like '-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; esac @@ -10422,6 +10843,11 @@ # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic='-DDLL_EXPORT' + case $host_os in + os2*) + lt_prog_compiler_static='$wl-static' + ;; + esac ;; darwin* | rhapsody*) @@ -10492,7 +10918,7 @@ case $host_os in aix*) lt_prog_compiler_wl='-Wl,' - if test "$host_cpu" = ia64; then + if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else @@ -10500,10 +10926,29 @@ fi ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic='-fno-common' + case $cc_basename in + nagfor*) + # NAG Fortran compiler + lt_prog_compiler_wl='-Wl,-Wl,,' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + esac + ;; + mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' + case $host_os in + os2*) + lt_prog_compiler_static='$wl-static' + ;; + esac ;; hpux9* | hpux10* | hpux11*) @@ -10519,7 +10964,7 @@ ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? - lt_prog_compiler_static='${wl}-a ${wl}archive' + lt_prog_compiler_static='$wl-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) @@ -10528,9 +10973,9 @@ lt_prog_compiler_static='-non_shared' ;; - linux* | k*bsd*-gnu | kopensolaris*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in - # old Intel for x86_64 which still supported -KPIC. + # old Intel for x86_64, which still supported -KPIC. ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' @@ -10555,6 +11000,12 @@ lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; + tcc*) + # Fabrice Bellard et al's Tiny C Compiler + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) @@ -10652,7 +11103,7 @@ ;; sysv4*MP*) - if test -d /usr/nec ;then + if test -d /usr/nec; then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi @@ -10681,7 +11132,7 @@ fi case $host_os in - # For platforms which do not support PIC, -DPIC is meaningless: + # For platforms that do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; @@ -10713,7 +11164,7 @@ 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" + lt_compiler_flag="$lt_prog_compiler_pic -DPIC" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins @@ -10743,7 +11194,7 @@ { $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 +if test yes = "$lt_cv_prog_compiler_pic_works"; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; @@ -10775,7 +11226,7 @@ $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works=no - save_LDFLAGS="$LDFLAGS" + 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 @@ -10794,13 +11245,13 @@ fi fi $RM -r conftest* - LDFLAGS="$save_LDFLAGS" + 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 +if test yes = "$lt_cv_prog_compiler_static_works"; then : else lt_prog_compiler_static= @@ -10920,8 +11371,8 @@ -hard_links="nottested" -if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then +hard_links=nottested +if test no = "$lt_cv_prog_compiler_c_o" && test no != "$need_locks"; 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; } @@ -10933,9 +11384,9 @@ 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;} + if test no = "$hard_links"; 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 @@ -10978,9 +11429,9 @@ # 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'. + # 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 @@ -10995,7 +11446,7 @@ # 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 + if test yes != "$GCC"; then with_gnu_ld=no fi ;; @@ -11003,9 +11454,12 @@ # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; - openbsd*) + openbsd* | bitrig*) with_gnu_ld=no ;; + linux* | k*bsd*-gnu | gnu*) + link_all_deplibs=no + ;; esac ld_shlibs=yes @@ -11013,7 +11467,7 @@ # 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 + if test yes = "$with_gnu_ld"; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility @@ -11035,24 +11489,24 @@ esac fi - if test "$lt_use_gnu_ld_interface" = yes; then + if test yes = "$lt_use_gnu_ld_interface"; then # If archive_cmds runs LD, not CC, wlarc should be empty - wlarc='${wl}' + 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' + 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' + 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 + case `$LD -v | $SED -e 's/(^)\+)\s\+//' 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... @@ -11065,7 +11519,7 @@ case $host_os in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken - if test "$host_cpu" != ia64; then + if test ia64 != "$host_cpu"; then ld_shlibs=no cat <<_LT_EOF 1>&2 @@ -11084,7 +11538,7 @@ 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_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) @@ -11100,7 +11554,7 @@ 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' + archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else ld_shlibs=no fi @@ -11110,7 +11564,7 @@ # _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' + export_dynamic_flag_spec='$wl--export-all-symbols' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes @@ -11118,61 +11572,89 @@ 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' + 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, use it as + # is; otherwise, prepend EXPORTS... + archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs=no fi ;; haiku*) - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' link_all_deplibs=yes ;; + os2*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + allow_undefined_flag=unsupported + shrext_cmds=.dll + archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + prefix_cmds="$SED"~ + if test EXPORTS = "`$SED 1q $export_symbols`"; then + prefix_cmds="$prefix_cmds -e 1d"; + fi~ + prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ + cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + enable_shared_with_static_runtimes=yes + ;; + interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no - hardcode_libdir_flag_spec='${wl}-rpath,$libdir' - export_dynamic_flag_spec='${wl}-E' + 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' + 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 + if test linux-dietlibc = "$host_os"; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ - && test "$tmp_diet" = no + && test no = "$tmp_diet" 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' + 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' + 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' ;; @@ -11183,42 +11665,47 @@ lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; + nagfor*) # NAGFOR 5.3 + tmp_sharedflag='-Wl,-shared' ;; xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 - 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' + 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' + 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' + 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 + if test yes = "$supports_anon_versioning"; 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' + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi case $cc_basename in + tcc*) + export_dynamic_flag_spec='-rdynamic' + ;; 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' + 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 + if test yes = "$supports_anon_versioning"; 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' + 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 @@ -11227,13 +11714,13 @@ fi ;; - netbsd*) + 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' + 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 ;; @@ -11251,8 +11738,8 @@ _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' + 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 @@ -11264,7 +11751,7 @@ ld_shlibs=no cat <<_LT_EOF 1>&2 -*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify @@ -11279,9 +11766,9 @@ # 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' + 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 @@ -11298,15 +11785,15 @@ *) 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' + 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 + if test no = "$ld_shlibs"; then runpath_var= hardcode_libdir_flag_spec= export_dynamic_flag_spec= @@ -11322,7 +11809,7 @@ # 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 + if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported @@ -11330,34 +11817,57 @@ ;; aix[4-9]*) - if test "$host_cpu" = ia64; then + if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' - no_entry_flag="" + 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". + # -C means demangle to GNU nm, but means don't demangle to AIX nm. + # Without the "-l" option, or with the "-B" option, AIX nm treats + # weak defined symbols like other global defined symbols, whereas + # GNU nm marks them as "W". + # While the 'weak' keyword is ignored in the Export File, we need + # it in the Import File for the 'aix-soname' feature, so we have + # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - 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' + export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else - 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' + export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. + # have runtime linking enabled, and use it for executables. + # For shared libraries, we enable/disable runtime linking + # depending on the kind of the shared library created - + # when "with_aix_soname,aix_use_runtimelinking" is: + # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables + # "aix,yes" lib.so shared, rtl:yes, for executables + # lib.a static archive + # "both,no" lib.so.V(shr.o) shared, rtl:yes + # lib.a(lib.so.V) shared, rtl:no, for executables + # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a(lib.so.V) shared, rtl:no + # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a static archive case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do - if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then aix_use_runtimelinking=yes break fi done + if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then + # With aix-soname=svr4, we create the lib.so.V shared archives only, + # so we don't have lib.a shared libs to link our executables. + # We have to force runtime linking in this case. + aix_use_runtimelinking=yes + LDFLAGS="$LDFLAGS -Wl,-brtl" + fi ;; esac @@ -11376,13 +11886,21 @@ hardcode_direct_absolute=yes hardcode_libdir_separator=':' link_all_deplibs=yes - file_list_spec='${wl}-f,' + file_list_spec='$wl-f,' + case $with_aix_soname,$aix_use_runtimelinking in + aix,*) ;; # traditional, no import file + svr4,* | *,yes) # use import file + # The Import File defines what to hardcode. + hardcode_direct=no + hardcode_direct_absolute=no + ;; + esac - if test "$GCC" = yes; then + if test yes = "$GCC"; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` + collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then @@ -11401,35 +11919,42 @@ ;; esac shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' + if test yes = "$aix_use_runtimelinking"; then + shared_flag="$shared_flag "'$wl-G' fi + # Need to ensure runtime linking is disabled for the traditional + # shared library, or the linker may eventually find shared libraries + # /with/ Import File - we do not want to mix them. + shared_flag_aix='-shared' + shared_flag_svr4='-shared $wl-G' else # not using gcc - if test "$host_cpu" = ia64; then + if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else - if test "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' + if test yes = "$aix_use_runtimelinking"; then + shared_flag='$wl-G' else - shared_flag='${wl}-bM:SRE' + shared_flag='$wl-bM:SRE' fi + shared_flag_aix='$wl-bM:SRE' + shared_flag_svr4='$wl-G' fi fi - export_dynamic_flag_spec='${wl}-bexpall' + 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 + if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. 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 + if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : @@ -11464,7 +11989,7 @@ 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" + lt_cv_aix_libpath_=/usr/lib:/lib fi fi @@ -11472,17 +11997,17 @@ 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" + 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 -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else - if test "$host_cpu" = ia64; then - hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' + if test ia64 = "$host_cpu"; 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" + 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 + if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : @@ -11517,7 +12042,7 @@ 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" + lt_cv_aix_libpath_=/usr/lib:/lib fi fi @@ -11525,21 +12050,33 @@ aix_libpath=$lt_cv_aix_libpath_ fi - hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + 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 + no_undefined_flag=' $wl-bernotok' + allow_undefined_flag=' $wl-berok' + if test yes = "$with_gnu_ld"; 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' + 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' + archive_expsym_cmds='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' + # -brtl affects multiple linker settings, -berok does not and is overridden later + compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`' + if test svr4 != "$with_aix_soname"; then + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' + fi + if test aix != "$with_aix_soname"; then + archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' + else + # used by -dlpreopen to get the symbols + archive_expsym_cmds="$archive_expsym_cmds"'~$MV $output_objdir/$realname.d/$soname $output_objdir' + fi + archive_expsym_cmds="$archive_expsym_cmds"'~$RM -r $output_objdir/$realname.d' fi fi ;; @@ -11548,7 +12085,7 @@ 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_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) @@ -11578,16 +12115,17 @@ # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" + 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=' + archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' + archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then + cp "$export_symbols" "$output_objdir/$soname.def"; + echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; + else + $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, )='true' enable_shared_with_static_runtimes=yes @@ -11596,18 +12134,18 @@ # 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' + 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 @@ -11616,7 +12154,7 @@ # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" + 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. @@ -11635,24 +12173,24 @@ 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\"`' + if test yes = "$lt_cv_ld_force_load"; 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" + allow_undefined_flag=$_lt_dar_allow_undefined case $cc_basename in - ifort*) _lt_dar_can_shared=yes ;; + ifort*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac - if test "$_lt_dar_can_shared" = "yes"; then + if test yes = "$_lt_dar_can_shared"; 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}" + 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 @@ -11694,33 +12232,33 @@ ;; 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' + if test yes = "$GCC"; 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 "x$output_objdir/$soname" = "x$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' + archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' fi - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + 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' + 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' + if test yes,no = "$GCC,$with_gnu_ld"; 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' + if test no = "$with_gnu_ld"; 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' + 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 @@ -11728,25 +12266,25 @@ ;; hpux11*) - if test "$GCC" = yes && test "$with_gnu_ld" = no; then + if test yes,no = "$GCC,$with_gnu_ld"; then case $host_cpu in hppa*64*) - archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + 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+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' + 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' + 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' + archive_cmds='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) @@ -11758,7 +12296,7 @@ $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler__b=no - save_LDFLAGS="$LDFLAGS" + 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 @@ -11777,14 +12315,14 @@ fi fi $RM -r conftest* - LDFLAGS="$save_LDFLAGS" + 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' +if test yes = "$lt_cv_prog_compiler__b"; 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 @@ -11792,8 +12330,8 @@ ;; esac fi - if test "$with_gnu_ld" = no; then - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + if test no = "$with_gnu_ld"; then + hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: case $host_cpu in @@ -11804,7 +12342,7 @@ *) hardcode_direct=yes hardcode_direct_absolute=yes - export_dynamic_flag_spec='${wl}-E' + export_dynamic_flag_spec='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. @@ -11815,8 +12353,8 @@ ;; 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' + if test yes = "$GCC"; 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. @@ -11826,8 +12364,8 @@ 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" + 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; } @@ -11839,25 +12377,36 @@ fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext - LDFLAGS="$save_LDFLAGS" + 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' + if test yes = "$lt_cv_irix_exported_symbol"; 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 + link_all_deplibs=no 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' + 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_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: inherit_rpath=yes link_all_deplibs=yes ;; - netbsd*) + linux*) + case $cc_basename in + tcc*) + # Fabrice Bellard et al's Tiny C Compiler + ld_shlibs=yes + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + 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 @@ -11871,7 +12420,7 @@ 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_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; @@ -11879,27 +12428,19 @@ *nto* | *qnx*) ;; - openbsd*) + openbsd* | bitrig*) 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 + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; 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' + 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 + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='$wl-rpath,$libdir' fi else ld_shlibs=no @@ -11910,33 +12451,53 @@ 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' + shrext_cmds=.dll + archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + prefix_cmds="$SED"~ + if test EXPORTS = "`$SED 1q $export_symbols`"; then + prefix_cmds="$prefix_cmds -e 1d"; + fi~ + prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ + cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + enable_shared_with_static_runtimes=yes ;; 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' + if test yes = "$GCC"; 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' + 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_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' + if test yes = "$GCC"; 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_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' + $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' @@ -11947,24 +12508,24 @@ 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' + if test yes = "$GCC"; 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' + $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_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' + $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' + 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' + $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi @@ -11974,11 +12535,11 @@ 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 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' + if test yes = "$GCC"; 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 @@ -11988,10 +12549,10 @@ ;; sunos4*) - if test "x$host_vendor" = xsequent; then + if test sequent = "$host_vendor"; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. - archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + 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 @@ -12040,43 +12601,43 @@ ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) - no_undefined_flag='${wl}-z,text' + 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' + if test yes = "$GCC"; 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' + 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 + # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. - no_undefined_flag='${wl}-z,text' - allow_undefined_flag='${wl}-z,nodefs' + 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_flag_spec='$wl-R,$libdir' hardcode_libdir_separator=':' link_all_deplibs=yes - export_dynamic_flag_spec='${wl}-Bexport' + 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' + if test yes = "$GCC"; 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' + 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 ;; @@ -12091,10 +12652,10 @@ ;; esac - if test x$host_vendor = xsni; then + if test sni = "$host_vendor"; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - export_dynamic_flag_spec='${wl}-Blargedynsym' + export_dynamic_flag_spec='$wl-Blargedynsym' ;; esac fi @@ -12102,7 +12663,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 $as_echo "$ld_shlibs" >&6; } -test "$ld_shlibs" = no && can_build_shared=no +test no = "$ld_shlibs" && can_build_shared=no with_gnu_ld=$with_gnu_ld @@ -12128,7 +12689,7 @@ # Assume -lc should be added archive_cmds_need_lc=yes - if test "$enable_shared" = yes && test "$GCC" = yes; then + if test yes,yes = "$GCC,$enable_shared"; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. @@ -12343,14 +12904,14 @@ { $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 +if test yes = "$GCC"; then case $host_os in - darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; - *) lt_awk_arg="/^libraries:/" ;; + 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" ;; + 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 @@ -12366,28 +12927,35 @@ ;; esac # Ok, now we have the path, separated by spaces, we can step through it - # and add multilib dir if necessary. + # 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` + lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + # ...but if some path component already ends with the multilib dir we assume + # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). + case "$lt_multi_os_dir; $lt_search_path_spec " in + "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) + lt_multi_os_dir= + ;; + esac for lt_sys_path in $lt_search_path_spec; do - if test -d "$lt_sys_path/$lt_multi_os_dir"; then - lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" - else + if test -d "$lt_sys_path$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir" + elif test -n "$lt_multi_os_dir"; then test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' -BEGIN {RS=" "; FS="/|\n";} { - lt_foo=""; - lt_count=0; +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; + lt_foo = "/" $lt_i lt_foo; } else { lt_count--; } @@ -12401,7 +12969,7 @@ # 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'` ;; + $SED 's|/\([A-Za-z]:\)|\1|g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else @@ -12410,7 +12978,7 @@ library_names_spec= libname_spec='lib$name' soname_spec= -shrext_cmds=".so" +shrext_cmds=.so postinstall_cmds= postuninstall_cmds= finish_cmds= @@ -12427,14 +12995,16 @@ # 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' + 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' + soname_spec='$libname$release$shared_ext$major' ;; aix[4-9]*) @@ -12442,41 +13012,91 @@ need_lib_prefix=no need_version=no hardcode_into_libs=yes - if test "$host_cpu" = ia64; then + if test ia64 = "$host_cpu"; then # AIX 5 supports IA64 - library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + 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 + # 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 + 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 + # Using Import Files as archive members, it is possible to support + # filename-based versioning of shared library archives on AIX. While + # this would work for both with and without runtime linking, it will + # prevent static linking of such archives. So we do filename-based + # shared library versioning with .so extension only, which is used + # when both runtime linking and shared linking is enabled. + # Unfortunately, runtime linking may impact performance, so we do + # not want this to be the default eventually. Also, we use the + # versioned .so libs for executables only if there is the -brtl + # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. + # To allow for filename-based versioning support, we need to create + # libNAME.so.V as an archive file, containing: + # *) an Import File, referring to the versioned filename of the + # archive as well as the shared archive member, telling the + # bitwidth (32 or 64) of that shared object, and providing the + # list of exported symbols of that shared object, eventually + # decorated with the 'weak' keyword + # *) the shared object with the F_LOADONLY flag set, to really avoid + # it being seen by the linker. + # At run time we better use the real file rather than another symlink, + # but for link time we create the symlink libNAME.so -> libNAME.so.V + + case $with_aix_soname,$aix_use_runtimelinking in + # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. - if test "$aix_use_runtimelinking" = yes; then + aix,yes) # traditional libtool + dynamic_linker='AIX unversionable lib.so' # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - else + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + ;; + aix,no) # traditional AIX only + dynamic_linker='AIX lib.a(lib.so.V)' # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. - library_names_spec='${libname}${release}.a $libname.a' - soname_spec='${libname}${release}${shared_ext}$major' - fi + library_names_spec='$libname$release.a $libname.a' + soname_spec='$libname$release$shared_ext$major' + ;; + svr4,*) # full svr4 only + dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)" + library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' + # We do not specify a path in Import Files, so LIBPATH fires. + shlibpath_overrides_runpath=yes + ;; + *,yes) # both, prefer svr4 + dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)" + library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' + # unpreferred sharedlib libNAME.a needs extra handling + postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' + postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' + # We do not specify a path in Import Files, so LIBPATH fires. + shlibpath_overrides_runpath=yes + ;; + *,no) # both, prefer aix + dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)" + library_names_spec='$libname$release.a $libname.a' + soname_spec='$libname$release$shared_ext$major' + # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling + postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' + postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' + ;; + esac shlibpath_var=LIBPATH fi ;; @@ -12486,18 +13106,18 @@ 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}' + 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' + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) - library_names_spec='${libname}${shared_ext}' + library_names_spec='$libname$shared_ext' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; @@ -12505,8 +13125,8 @@ 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' + 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" @@ -12518,7 +13138,7 @@ cygwin* | mingw* | pw32* | cegcc*) version_type=windows - shrext_cmds=".dll" + shrext_cmds=.dll need_version=no need_lib_prefix=no @@ -12527,8 +13147,8 @@ # 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'\''`~ + 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~ @@ -12544,17 +13164,17 @@ 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}' + 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}' + 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}' + 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' @@ -12563,8 +13183,8 @@ *,cl*) # Native MSVC libname_spec='$name' - soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - library_names_spec='${libname}.dll.lib' + soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + library_names_spec='$libname.dll.lib' case $build_os in mingw*) @@ -12591,7 +13211,7 @@ 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" + 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'` @@ -12604,8 +13224,8 @@ 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'\''`~ + 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' @@ -12618,7 +13238,7 @@ *) # Assume MSVC wrapper - library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac @@ -12631,8 +13251,8 @@ 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' + 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`' @@ -12645,8 +13265,8 @@ 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' + 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 ;; @@ -12664,12 +13284,13 @@ 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}' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' need_version=no need_lib_prefix=no ;; freebsd-*) - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' need_version=yes ;; esac @@ -12694,26 +13315,15 @@ esac ;; -gnu*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + 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 + shlibpath_overrides_runpath=no sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; @@ -12731,14 +13341,15 @@ 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 + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + if test 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' @@ -12746,8 +13357,8 @@ 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' + 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 ;; @@ -12756,8 +13367,8 @@ 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' + 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, ... @@ -12770,8 +13381,8 @@ 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' + 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 @@ -12782,7 +13393,7 @@ case $host_os in nonstopux*) version_type=nonstopux ;; *) - if test "$lt_cv_prog_gnu_ld" = yes; then + if test yes = "$lt_cv_prog_gnu_ld"; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix @@ -12790,8 +13401,8 @@ 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}' + 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= @@ -12810,8 +13421,8 @@ 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}" + 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 ;; @@ -12820,13 +13431,33 @@ dynamic_linker=no ;; +linux*android*) + version_type=none # Android doesn't support versioned libraries. + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext' + soname_spec='$libname$release$shared_ext' + finish_cmds= + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + dynamic_linker='Android linker' + # Don't embed -rpath directories since the linker doesn't support them. + hardcode_libdir_flag_spec='-L$libdir' + ;; + # This must be glibc/ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) +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' + 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 @@ -12870,14 +13501,15 @@ # before this can be enabled. hardcode_into_libs=yes - # Add ABI-specific directories to the system library path. - sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" - - # Append ld.so.conf contents to the search path + # Ideally, we could use ldconfig to report *all* directores which are + # searched for libraries, however this is still not possible. Aside from not + # being certain /sbin/ldconfig is available, command + # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, + # even though it is searched at run-time. Try to do the best guess by + # appending ld.so.conf contents (and includes) to the search path. if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` - sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" - + 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 @@ -12889,17 +13521,29 @@ 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' + 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' + 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 @@ -12909,7 +13553,7 @@ 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}' + 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 ;; @@ -12918,58 +13562,68 @@ 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' + 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*) +openbsd* | bitrig*) version_type=sunos - sys_lib_dlsearch_path_spec="/usr/lib" + 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 + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then + need_version=no else - shlibpath_overrides_runpath=yes + need_version=yes fi + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes ;; os2*) libname_spec='$name' - shrext_cmds=".dll" + version_type=windows + shrext_cmds=.dll + need_version=no need_lib_prefix=no - library_names_spec='$libname${shared_ext} $libname.a' + # OS/2 can only load a DLL with a base name of 8 characters or less. + soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; + v=$($ECHO $release$versuffix | tr -d .-); + n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); + $ECHO $n$v`$shared_ext' + library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' - shlibpath_var=LIBPATH + shlibpath_var=BEGINLIBPATH + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + 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" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; rdos*) @@ -12980,8 +13634,8 @@ 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' + 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 @@ -12991,11 +13645,11 @@ sunos4*) version_type=sunos - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + 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 + if test yes = "$with_gnu_ld"; then need_lib_prefix=no fi need_version=yes @@ -13003,8 +13657,8 @@ 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' + 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) @@ -13025,24 +13679,24 @@ ;; sysv4*MP*) - if test -d /usr/nec ;then + 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' + 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 + version_type=sco need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + 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 + if test yes = "$with_gnu_ld"; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' @@ -13060,7 +13714,7 @@ 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}' + 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 @@ -13068,8 +13722,8 @@ 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' + 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 ;; @@ -13079,20 +13733,35 @@ 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 +test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -if test "$GCC" = yes; then +if test yes = "$GCC"; 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" +if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then + sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi -if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then - sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" + +if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then + sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi +# remember unaugmented sys_lib_dlsearch_path content for libtool script decls... +configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec + +# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code +func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" + +# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool +configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH + + + + + + @@ -13189,15 +13858,15 @@ hardcode_action= if test -n "$hardcode_libdir_flag_spec" || test -n "$runpath_var" || - test "X$hardcode_automatic" = "Xyes" ; then + test yes = "$hardcode_automatic"; then # We can hardcode non-existent directories. - if test "$hardcode_direct" != no && + if test no != "$hardcode_direct" && # 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 + ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, )" && + test no != "$hardcode_minus_L"; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else @@ -13212,12 +13881,12 @@ { $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 +if test relink = "$hardcode_action" || + test yes = "$inherit_rpath"; then # Fast installation is not supported enable_fast_install=no -elif test "$shlibpath_overrides_runpath" = yes || - test "$enable_shared" = no; then +elif test yes = "$shlibpath_overrides_runpath" || + test no = "$enable_shared"; then # Fast installation is not necessary enable_fast_install=needless fi @@ -13227,7 +13896,7 @@ - if test "x$enable_dlopen" != xyes; then + if test yes != "$enable_dlopen"; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown @@ -13237,23 +13906,23 @@ case $host_os in beos*) - lt_cv_dlopen="load_add_on" + 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=LoadLibrary lt_cv_dlopen_libs= ;; cygwin*) - lt_cv_dlopen="dlopen" + lt_cv_dlopen=dlopen lt_cv_dlopen_libs= ;; darwin*) - # if libdl is installed we need to link against it + # 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 : @@ -13291,10 +13960,10 @@ { $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" + lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl else - lt_cv_dlopen="dyld" + lt_cv_dlopen=dyld lt_cv_dlopen_libs= lt_cv_dlopen_self=yes @@ -13302,10 +13971,18 @@ ;; + tpf*) + # Don't try to run any link tests for TPF. We know it's impossible + # because TPF is a cross-compiler, and we know how we open DSOs. + lt_cv_dlopen=dlopen + lt_cv_dlopen_libs= + lt_cv_dlopen_self=no + ;; + *) ac_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" + 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; } @@ -13344,11 +14021,11 @@ { $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" + 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" + 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; } @@ -13387,7 +14064,7 @@ { $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" + 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; } @@ -13426,7 +14103,7 @@ { $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" + 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; } @@ -13465,7 +14142,7 @@ { $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" + lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld fi @@ -13486,21 +14163,21 @@ ;; esac - if test "x$lt_cv_dlopen" != xno; then - enable_dlopen=yes - else + if test no = "$lt_cv_dlopen"; then enable_dlopen=no + else + enable_dlopen=yes fi case $lt_cv_dlopen in dlopen) - save_CPPFLAGS="$CPPFLAGS" - test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + save_CPPFLAGS=$CPPFLAGS + test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" - save_LDFLAGS="$LDFLAGS" + save_LDFLAGS=$LDFLAGS wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" - save_LIBS="$LIBS" + save_LIBS=$LIBS LIBS="$lt_cv_dlopen_libs $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 @@ -13508,7 +14185,7 @@ if ${lt_cv_dlopen_self+:} false; then : $as_echo_n "(cached) " >&6 else - if test "$cross_compiling" = yes; then : + if test yes = "$cross_compiling"; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 @@ -13555,9 +14232,9 @@ # endif #endif -/* When -fvisbility=hidden is used, assume the code has been annotated +/* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ -#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif @@ -13587,7 +14264,7 @@ (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 + 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 @@ -13607,14 +14284,14 @@ { $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 + if test yes = "$lt_cv_dlopen_self"; 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 : + if test yes = "$cross_compiling"; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 @@ -13661,9 +14338,9 @@ # endif #endif -/* When -fvisbility=hidden is used, assume the code has been annotated +/* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ -#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif @@ -13693,7 +14370,7 @@ (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 + 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 @@ -13714,9 +14391,9 @@ $as_echo "$lt_cv_dlopen_self_static" >&6; } fi - CPPFLAGS="$save_CPPFLAGS" - LDFLAGS="$save_LDFLAGS" - LIBS="$save_LIBS" + CPPFLAGS=$save_CPPFLAGS + LDFLAGS=$save_LDFLAGS + LIBS=$save_LIBS ;; esac @@ -13760,7 +14437,7 @@ # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) - if test -n "$STRIP" ; then + if test -n "$STRIP"; then striplib="$STRIP -x" old_striplib="$STRIP -S" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 @@ -13788,7 +14465,7 @@ - # Report which library types will actually be built + # Report what 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 @@ -13796,13 +14473,13 @@ { $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 + test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) - test "$enable_shared" = yes && enable_static=no + test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' @@ -13810,8 +14487,12 @@ ;; aix[4-9]*) - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then - test "$enable_shared" = yes && enable_static=no + if test ia64 != "$host_cpu"; then + case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in + yes,aix,yes) ;; # shared object as lib.so file only + yes,svr4,*) ;; # shared object as lib.so archive member only + yes,*) enable_static=no ;; # shared object in lib.a archive as well + esac fi ;; esac @@ -13821,7 +14502,7 @@ { $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 + test yes = "$enable_shared" || enable_static=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 $as_echo "$enable_static" >&6; } @@ -13835,7 +14516,7 @@ 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" +CC=$lt_save_CC @@ -20252,6 +20933,17 @@ fi +case "$target_cpu" in + x86*) + build_x86="yes" + ;; + *) + build_x86="no" + ;; +esac + +if test x"$build_x86" = xyes; then + pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OVERLAY_XVLIB" >&5 $as_echo_n "checking for OVERLAY_XVLIB... " >&6; } @@ -20393,6 +21085,34 @@ $as_echo "yes" >&6; } enable_overlay_xlib=yes fi + if test x"$LEX" != "x:" -a x"$YACC" != xyacc; then : + enable_assembler=yes +else + enable_assembler=no +fi +else + enable_overlay_xvlib="no" + enable_overlay_xlib="no" + enable_assembler="no" + BUILD_SHADER_DEBUGGER="no" +fi + if test "x$build_x86" = xyes; then + BUILD_X86_TRUE= + BUILD_X86_FALSE='#' +else + BUILD_X86_TRUE='#' + BUILD_X86_FALSE= +fi + + + if test "x$enable_assembler" = xyes; then + BUILD_ASSEMBLER_TRUE= + BUILD_ASSEMBLER_FALSE='#' +else + BUILD_ASSEMBLER_TRUE='#' + BUILD_ASSEMBLER_FALSE= +fi + if test "x$enable_overlay_xvlib" = xyes; then BUILD_OVERLAY_XVLIB_TRUE= @@ -20762,21 +21482,6 @@ fi -# can we build the assembler? -if test x"$LEX" != "x:" -a x"$YACC" != xyacc; then : - enable_assembler=yes -else - enable_assembler=no -fi - if test "x$enable_assembler" = xyes; then - BUILD_ASSEMBLER_TRUE= - BUILD_ASSEMBLER_FALSE='#' -else - BUILD_ASSEMBLER_TRUE='#' - BUILD_ASSEMBLER_FALSE= -fi - - # ----------------------------------------------------------------------------- # Configuration options # ----------------------------------------------------------------------------- @@ -20905,12 +21610,136 @@ fi +# Check whether --enable-vc4 was given. +if test "${enable_vc4+set}" = set; then : + enableval=$enable_vc4; VC4=$enableval +else + VC4=auto +fi + +if test "x$VC4" = xauto; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libdrm_vc4\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libdrm_vc4") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + VC4=yes +else + VC4=no +fi +fi +if test "x$VC4" = xyes; then + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for DRM_VC4" >&5 +$as_echo_n "checking for DRM_VC4... " >&6; } + +if test -n "$DRM_VC4_CFLAGS"; then + pkg_cv_DRM_VC4_CFLAGS="$DRM_VC4_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_vc4\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libdrm_vc4") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_DRM_VC4_CFLAGS=`$PKG_CONFIG --cflags "libdrm_vc4" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$DRM_VC4_LIBS"; then + pkg_cv_DRM_VC4_LIBS="$DRM_VC4_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_vc4\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libdrm_vc4") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_DRM_VC4_LIBS=`$PKG_CONFIG --libs "libdrm_vc4" 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_VC4_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libdrm_vc4" 2>&1` + else + DRM_VC4_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libdrm_vc4" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$DRM_VC4_PKG_ERRORS" >&5 + + as_fn_error $? "Package requirements (libdrm_vc4) were not met: + +$DRM_VC4_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_VC4_CFLAGS +and DRM_VC4_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_VC4_CFLAGS +and DRM_VC4_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_VC4_CFLAGS=$pkg_cv_DRM_VC4_CFLAGS + DRM_VC4_LIBS=$pkg_cv_DRM_VC4_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +fi + +$as_echo "#define HAVE_VC4 1" >>confdefs.h + +fi + if test "x$VC4" = xyes; then + HAVE_VC4_TRUE= + HAVE_VC4_FALSE='#' +else + HAVE_VC4_TRUE='#' + HAVE_VC4_FALSE= +fi + + # Define a configure option for the shader 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 + BUILD_SHADER_DEBUGGER=no fi @@ -21095,6 +21924,14 @@ fi +# Check whether --enable-werror was given. +if test "${enable_werror+set}" = set; then : + enableval=$enable_werror; +else + enable_werror=no +fi + + if test "x$enable_debug" = xyes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking to see if compiler understands -g3" >&5 @@ -21176,6 +22013,46 @@ fi +if test "x$enable_werror" = xyes; then + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking to see if compiler understands -Werror" >&5 +$as_echo_n "checking to see if compiler understands -Werror... " >&6; } + + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -Werror" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + flag_ok=yes +else + flag_ok=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS="$save_CFLAGS" + + if test "X$flag_ok" = Xyes ; then + WERROR_CFLAGS="-Werror" + + true + else + + true + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $flag_ok" >&5 +$as_echo "$flag_ok" >&6; } + +fi + # prevent relinking the world on every commit for developers # Check whether --enable-git-hash was given. if test "${enable_git_hash+set}" = set; then : @@ -21559,6 +22436,14 @@ as_fn_error $? "conditional \"HAVE_RST2MAN\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${BUILD_X86_TRUE}" && test -z "${BUILD_X86_FALSE}"; then + as_fn_error $? "conditional \"BUILD_X86\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${BUILD_ASSEMBLER_TRUE}" && test -z "${BUILD_ASSEMBLER_FALSE}"; then + as_fn_error $? "conditional \"BUILD_ASSEMBLER\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${BUILD_OVERLAY_XVLIB_TRUE}" && test -z "${BUILD_OVERLAY_XVLIB_FALSE}"; then as_fn_error $? "conditional \"BUILD_OVERLAY_XVLIB\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -21571,14 +22456,14 @@ as_fn_error $? "conditional \"BUILD_OVERLAY\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${BUILD_ASSEMBLER_TRUE}" && test -z "${BUILD_ASSEMBLER_FALSE}"; then - as_fn_error $? "conditional \"BUILD_ASSEMBLER\" 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 "${HAVE_VC4_TRUE}" && test -z "${HAVE_VC4_FALSE}"; then + as_fn_error $? "conditional \"HAVE_VC4\" 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 @@ -21984,7 +22869,7 @@ # 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.13, which was +This file was extended by intel-gpu-tools $as_me 1.15, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -22050,7 +22935,7 @@ 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.13 +intel-gpu-tools config.status 1.15 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" @@ -22185,6 +23070,7 @@ 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"`' +shared_archive_member_spec='`$ECHO "$shared_archive_member_spec" | $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"`' @@ -22234,10 +23120,13 @@ 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_import='`$ECHO "$lt_cv_sys_global_symbol_to_import" | $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"`' +lt_cv_nm_interface='`$ECHO "$lt_cv_nm_interface" | $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"`' +lt_cv_truncate_bin='`$ECHO "$lt_cv_truncate_bin" | $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"`' @@ -22302,7 +23191,8 @@ 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"`' +configure_time_dlsearch_path='`$ECHO "$configure_time_dlsearch_path" | $SED "$delay_single_quote_subst"`' +configure_time_lt_sys_library_path='`$ECHO "$configure_time_lt_sys_library_path" | $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"`' @@ -22353,9 +23243,12 @@ compiler \ lt_cv_sys_global_symbol_pipe \ lt_cv_sys_global_symbol_to_cdecl \ +lt_cv_sys_global_symbol_to_import \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ +lt_cv_nm_interface \ nm_file_list_spec \ +lt_cv_truncate_bin \ lt_prog_compiler_no_builtin_flag \ lt_prog_compiler_pic \ lt_prog_compiler_wl \ @@ -22390,7 +23283,7 @@ striplib; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" @@ -22417,10 +23310,11 @@ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ -sys_lib_dlsearch_path_spec; do +configure_time_dlsearch_path \ +configure_time_lt_sys_library_path; 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=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" @@ -22429,19 +23323,16 @@ 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 +# See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes INIT. -if test -n "\${ZSH_VERSION+set}" ; then +if test -n "\${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi PACKAGE='$PACKAGE' VERSION='$VERSION' - TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile' @@ -23172,55 +24063,53 @@ ;; "libtool":C) - # See if we are running on zsh, and set the options which allow our + # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes. - if test -n "${ZSH_VERSION+set}" ; then + if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi - cfgfile="${ofile}T" + 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 +# Generated automatically by $as_me ($PACKAGE) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. + +# Provide generalized library-building support services. +# Written by Gordon Matzigkeit, 1996 + +# Copyright (C) 2014 Free Software Foundation, Inc. +# This is free software; see the source for copying conditions. There is NO +# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +# GNU Libtool is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of of the License, or +# (at your option) any later version. # -# 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. +# 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 +# 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. +# along with this program. If not, see . # The names of the tagged configurations supported by this script. -available_tags="" +available_tags='' + +# Configured defaults for sys_lib_dlsearch_path munging. +: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} # ### BEGIN LIBTOOL CONFIG @@ -23240,6 +24129,9 @@ # Whether or not to optimize for fast installation. fast_install=$enable_fast_install +# Shared archive member basename,for filename based shared library versioning on AIX. +shared_archive_member_spec=$shared_archive_member_spec + # Shell to use when invoking shell scripts. SHELL=$lt_SHELL @@ -23357,18 +24249,27 @@ # 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 into a list of symbols to manually relocate. +global_symbol_to_import=$lt_lt_cv_sys_global_symbol_to_import + # 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 +# The name lister interface. +nm_interface=$lt_lt_cv_nm_interface + # 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. +# The root where to search for dependent libraries,and where our libraries should be installed. lt_sysroot=$lt_sysroot +# Command to truncate a binary pipe. +lt_truncate_bin=$lt_lt_cv_truncate_bin + # The name of the directory that contains temporary libtool files. objdir=$objdir @@ -23459,8 +24360,11 @@ # 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 +# Detected run-time system search path for libraries. +sys_lib_dlsearch_path_spec=$lt_configure_time_dlsearch_path + +# Explicit LT_SYS_LIBRARY_PATH set during ./configure time. +configure_time_lt_sys_library_path=$lt_configure_time_lt_sys_library_path # Whether dlopen is supported. dlopen_support=$enable_dlopen @@ -23553,13 +24457,13 @@ # 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 +# 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 +# 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 +# "absolute",i.e impossible to change by setting \$shlibpath_var if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute @@ -23611,13 +24515,72 @@ _LT_EOF + cat <<'_LT_EOF' >> "$cfgfile" + +# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE + +# func_munge_path_list VARIABLE PATH +# ----------------------------------- +# VARIABLE is name of variable containing _space_ separated list of +# directories to be munged by the contents of PATH, which is string +# having a format: +# "DIR[:DIR]:" +# string "DIR[ DIR]" will be prepended to VARIABLE +# ":DIR[:DIR]" +# string "DIR[ DIR]" will be appended to VARIABLE +# "DIRP[:DIRP]::[DIRA:]DIRA" +# string "DIRP[ DIRP]" will be prepended to VARIABLE and string +# "DIRA[ DIRA]" will be appended to VARIABLE +# "DIR[:DIR]" +# VARIABLE will be replaced by "DIR[ DIR]" +func_munge_path_list () +{ + case x$2 in + x) + ;; + *:) + eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" + ;; + x:*) + eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" + ;; + *::*) + eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" + eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" + ;; + *) + eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" + ;; + esac +} + + +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +func_cc_basename () +{ + for cc_temp in $*""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac + done + func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +} + + +# ### END FUNCTIONS SHARED WITH CONFIGURE + +_LT_EOF + case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. -if test "X${COLLECT_NAMES+set}" != Xset; then +if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi @@ -23626,7 +24589,7 @@ esac -ltmain="$ac_aux_dir/ltmain.sh" +ltmain=$ac_aux_dir/ltmain.sh # We use sed instead of cat because bash on DJGPP gets confused if @@ -23636,165 +24599,6 @@ 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" @@ -23855,8 +24659,10 @@ echo " Assembler : ${enable_assembler}" echo " Debugger : ${enable_debugger}" echo " Overlay : X: ${enable_overlay_xlib}, Xv: ${enable_overlay_xvlib}" +echo " x86-specific tools : ${build_x86}" echo "" echo " • API-Documentation : ${enable_gtk_doc}" +echo " • Fail on warnings : ${enable_werror}" echo "" # vim: set ft=config ts=8 sw=8 tw=0 noet : diff -Nru intel-gpu-tools-1.13/configure.ac intel-gpu-tools-1.15/configure.ac --- intel-gpu-tools-1.13/configure.ac 2015-12-02 16:46:18.000000000 +0000 +++ intel-gpu-tools-1.15/configure.ac 2016-05-31 16:53:51.000000000 +0000 @@ -22,7 +22,7 @@ AC_PREREQ([2.60]) AC_INIT([intel-gpu-tools], - [1.13], + [1.15], [https://bugs.freedesktop.org/enter_bug.cgi?product=DRI&component=DRM/Intel], [intel-gpu-tools]) @@ -34,6 +34,7 @@ AC_SYS_LARGEFILE AC_GNU_SOURCE AC_CANONICAL_HOST +AC_CANONICAL_TARGET AM_INIT_AUTOMAKE([1.12 foreign subdir-objects dist-bzip2]) AM_PATH_PYTHON([3],, [:]) @@ -65,6 +66,20 @@ AC_CHECK_FUNCS([swapctl]) AC_CHECK_FUNCS([asprintf]) +dnl Check for POSIX timers +AC_CHECK_FUNCS(timer_create, [], [ + AC_CHECK_LIB(rt, timer_create, [ + AC_DEFINE(HAVE_TIMER_CREATE, 1) + TIMER_LIBS="-lrt" + ], [ + AC_CHECK_LIB(pthread, timer_create, [ + AC_DEFINE(HAVE_TIMER_CREATE, 1) + TIMER_LIBS="-lpthread" + ]) + ]) +]) +AC_SUBST(TIMER_LIBS) + # Initialize libtool AC_DISABLE_STATIC AC_PROG_LIBTOOL @@ -87,8 +102,31 @@ PKG_CHECK_MODULES(DRM, [libdrm_intel >= 2.4.64 libdrm]) PKG_CHECK_MODULES(PCIACCESS, [pciaccess >= 0.10]) -PKG_CHECK_MODULES(OVERLAY_XVLIB, [xv x11 xext dri2proto >= 2.6], enable_overlay_xvlib=yes, enable_overlay_xvlib=no) -PKG_CHECK_MODULES(OVERLAY_XLIB, [cairo-xlib dri2proto >= 2.6], enable_overlay_xlib=yes, enable_overlay_xlib=no) + +case "$target_cpu" in + x86*) + build_x86="yes" + ;; + *) + build_x86="no" + ;; +esac + +if test x"$build_x86" = xyes; then + PKG_CHECK_MODULES(OVERLAY_XVLIB, [xv x11 xext dri2proto >= 2.6], enable_overlay_xvlib=yes, enable_overlay_xvlib=no) + PKG_CHECK_MODULES(OVERLAY_XLIB, [cairo-xlib dri2proto >= 2.6], enable_overlay_xlib=yes, enable_overlay_xlib=no) + AS_IF([test x"$LEX" != "x:" -a x"$YACC" != xyacc], + [enable_assembler=yes], + [enable_assembler=no]) +else + enable_overlay_xvlib="no" + enable_overlay_xlib="no" + enable_assembler="no" + BUILD_SHADER_DEBUGGER="no" +fi +AM_CONDITIONAL(BUILD_X86, [test "x$build_x86" = xyes]) + +AM_CONDITIONAL(BUILD_ASSEMBLER, [test "x$enable_assembler" = xyes]) AM_CONDITIONAL(BUILD_OVERLAY_XVLIB, [test "x$enable_overlay_xvlib" = xyes]) AM_CONDITIONAL(BUILD_OVERLAY_XLIB, [test "x$enable_overlay_xlib" = xyes]) @@ -109,12 +147,6 @@ fi PKG_CHECK_MODULES(GLIB, glib-2.0) -# can we build the assembler? -AS_IF([test x"$LEX" != "x:" -a x"$YACC" != xyacc], - [enable_assembler=yes], - [enable_assembler=no]) -AM_CONDITIONAL(BUILD_ASSEMBLER, [test "x$enable_assembler" = xyes]) - # ----------------------------------------------------------------------------- # Configuration options # ----------------------------------------------------------------------------- @@ -131,10 +163,22 @@ fi AM_CONDITIONAL(HAVE_NOUVEAU, [test "x$NOUVEAU" = xyes]) +AC_ARG_ENABLE(vc4, AS_HELP_STRING([--disable-vc4], + [Enable building of vc4 tests (default: auto)]), + [VC4=$enableval], [VC4=auto]) +if test "x$VC4" = xauto; then + PKG_CHECK_EXISTS([libdrm_vc4], [VC4=yes], [VC4=no]) +fi +if test "x$VC4" = xyes; then + PKG_CHECK_MODULES(DRM_VC4, [libdrm_vc4]) + AC_DEFINE(HAVE_VC4, 1, [Have vc4 support]) +fi +AM_CONDITIONAL(HAVE_VC4, [test "x$VC4" = xyes]) + # Define a configure option for the shader 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]) + [BUILD_SHADER_DEBUGGER="$enableval"], [BUILD_SHADER_DEBUGGER=no]) # Shader debugger depends on python3, intel-genasm and objcopy if test "x$BUILD_SHADER_DEBUGGER" != xno; then @@ -185,6 +229,11 @@ [Build tests without debug symbols]), [], [enable_debug=yes]) +AC_ARG_ENABLE(werror, + AS_HELP_STRING([--enable-werror], + [Fail on warnings]), + [], [enable_werror=no]) + if test "x$enable_debug" = xyes; then AS_COMPILER_FLAG([-g3], [DEBUG_CFLAGS="-g3"], [DEBUG_CFLAGS="-g"]) AS_COMPILER_FLAG([-Og], [DEBUG_CFLAGS+=" -Og -Wno-maybe-uninitialized"], # disable maybe-uninitialized due to false positives @@ -192,6 +241,10 @@ AC_SUBST([DEBUG_CFLAGS]) fi +if test "x$enable_werror" = xyes; then + AS_COMPILER_FLAG([-Werror], [WERROR_CFLAGS="-Werror"]) +fi + # prevent relinking the world on every commit for developers AC_ARG_ENABLE(git-hash, AS_HELP_STRING([--disable-git-hash], @@ -266,8 +319,10 @@ echo " Assembler : ${enable_assembler}" echo " Debugger : ${enable_debugger}" echo " Overlay : X: ${enable_overlay_xlib}, Xv: ${enable_overlay_xvlib}" +echo " x86-specific tools : ${build_x86}" echo "" echo " • API-Documentation : ${enable_gtk_doc}" +echo " • Fail on warnings : ${enable_werror}" echo "" # vim: set ft=config ts=8 sw=8 tw=0 noet : diff -Nru intel-gpu-tools-1.13/COPYING intel-gpu-tools-1.15/COPYING --- intel-gpu-tools-1.13/COPYING 2015-08-06 15:22:11.000000000 +0000 +++ intel-gpu-tools-1.15/COPYING 2016-05-23 10:51:28.000000000 +0000 @@ -106,3 +106,23 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Copyright (c) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, + 2013, 2014 by Internet Systems Consortium, Inc. ("ISC") +Copyright (c) 1991, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, + 2002, 2003 by The Internet Software Consortium and Rich Salz + +This code is derived from software contributed to the Internet Software +Consortium by Rich Salz. + +Permission to use, copy, modify, and distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY +SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff -Nru intel-gpu-tools-1.13/debian/changelog intel-gpu-tools-1.15/debian/changelog --- intel-gpu-tools-1.13/debian/changelog 2016-08-31 20:26:40.000000000 +0000 +++ intel-gpu-tools-1.15/debian/changelog 2016-08-31 20:26:41.000000000 +0000 @@ -1,8 +1,22 @@ -intel-gpu-tools (1.13-1~ppa14.04+1) trusty; urgency=medium +intel-gpu-tools (1.15-1~ppa14.04+1) trusty; urgency=medium - * Backport from Xenial. + * Merge from Debian Unstable. - -- Nicolas Derive Tue, 12 Jan 2016 18:04:27 +0100 + -- Nicolas Derive Wed, 31 Aug 2016 22:18:57 +0200 + +intel-gpu-tools (1.15-1) unstable; urgency=medium + + * New upstream release. + * Update to Standards version 3.9.8. + + -- Vincent Cheng Tue, 31 May 2016 17:35:02 -0700 + +intel-gpu-tools (1.14-1) unstable; urgency=medium + + * New upstream release. + * control: Add libxv-dev and python-docutils to build-depends. + + -- Timo Aaltonen Thu, 10 Mar 2016 22:01:06 +0200 intel-gpu-tools (1.13-1) unstable; urgency=medium diff -Nru intel-gpu-tools-1.13/debian/control intel-gpu-tools-1.15/debian/control --- intel-gpu-tools-1.13/debian/control 2016-08-31 20:26:40.000000000 +0000 +++ intel-gpu-tools-1.15/debian/control 2016-08-31 20:26:41.000000000 +0000 @@ -18,14 +18,16 @@ libudev-dev, libunwind-dev, libxrandr-dev, + libxv-dev, pkg-config, + python-docutils, quilt, x11proto-dri2-dev, xutils-dev (>= 1:7.6+6) -Standards-Version: 3.9.6 +Standards-Version: 3.9.8 Homepage: https://01.org/linuxgraphics/ -Vcs-Git: git://anonscm.debian.org/pkg-xorg/app/intel-gpu-tools.git -Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-xorg/app/intel-gpu-tools.git +Vcs-Git: https://anonscm.debian.org/git/pkg-xorg/app/intel-gpu-tools.git +Vcs-Browser: https://anonscm.debian.org/cgit/pkg-xorg/app/intel-gpu-tools.git Package: intel-gpu-tools Architecture: amd64 i386 diff -Nru intel-gpu-tools-1.13/debugger/Makefile.am intel-gpu-tools-1.15/debugger/Makefile.am --- intel-gpu-tools-1.13/debugger/Makefile.am 2015-11-12 17:30:48.000000000 +0000 +++ intel-gpu-tools-1.15/debugger/Makefile.am 2016-05-23 10:51:28.000000000 +0000 @@ -15,4 +15,4 @@ $(LIBUNWIND_CFLAGS) \ $(CWARNFLAGS) -LDADD = $(top_builddir)/lib/libintel_tools.la $(DRM_LIBS) $(PCIACCESS_LIBS) $(CAIRO_LIBS) $(LIBUNWIND_LIBS) +LDADD = $(top_builddir)/lib/libintel_tools.la diff -Nru intel-gpu-tools-1.13/debugger/Makefile.in intel-gpu-tools-1.15/debugger/Makefile.in --- intel-gpu-tools-1.13/debugger/Makefile.in 2015-12-02 16:47:58.000000000 +0000 +++ intel-gpu-tools-1.15/debugger/Makefile.in 2016-05-31 17:03:32.000000000 +0000 @@ -88,6 +88,7 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ +target_triplet = @target@ bin_PROGRAMS = eudb$(EXEEXT) noinst_PROGRAMS = debug_rdata$(EXEEXT) subdir = debugger @@ -109,10 +110,7 @@ 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__DEPENDENCIES_1) +debug_rdata_DEPENDENCIES = $(top_builddir)/lib/libintel_tools.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent @@ -120,9 +118,7 @@ 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) $(am__DEPENDENCIES_1) +eudb_DEPENDENCIES = $(top_builddir)/lib/libintel_tools.la AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false @@ -262,6 +258,8 @@ DRM_LIBS = @DRM_LIBS@ DRM_NOUVEAU_CFLAGS = @DRM_NOUVEAU_CFLAGS@ DRM_NOUVEAU_LIBS = @DRM_NOUVEAU_LIBS@ +DRM_VC4_CFLAGS = @DRM_VC4_CFLAGS@ +DRM_VC4_LIBS = @DRM_VC4_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -306,6 +304,7 @@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MAN_SUBSTS = @MAN_SUBSTS@ @@ -350,6 +349,7 @@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ THREAD_CFLAGS = @THREAD_CFLAGS@ +TIMER_LIBS = @TIMER_LIBS@ VERSION = @VERSION@ XORG_MAN_PAGE = @XORG_MAN_PAGE@ XRANDR_CFLAGS = @XRANDR_CFLAGS@ @@ -404,11 +404,16 @@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ +target = @target@ target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ @@ -424,7 +429,7 @@ $(LIBUNWIND_CFLAGS) \ $(CWARNFLAGS) -LDADD = $(top_builddir)/lib/libintel_tools.la $(DRM_LIBS) $(PCIACCESS_LIBS) $(CAIRO_LIBS) $(LIBUNWIND_LIBS) +LDADD = $(top_builddir)/lib/libintel_tools.la all: all-recursive .SUFFIXES: diff -Nru intel-gpu-tools-1.13/debugger/system_routine/Makefile.in intel-gpu-tools-1.15/debugger/system_routine/Makefile.in --- intel-gpu-tools-1.13/debugger/system_routine/Makefile.in 2015-12-02 16:47:58.000000000 +0000 +++ intel-gpu-tools-1.15/debugger/system_routine/Makefile.in 2016-05-31 17:03:32.000000000 +0000 @@ -88,6 +88,7 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ +target_triplet = @target@ noinst_PROGRAMS = eviction_macro$(EXEEXT) sr$(EXEEXT) tiny$(EXEEXT) subdir = debugger/system_routine ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 @@ -214,6 +215,8 @@ DRM_LIBS = @DRM_LIBS@ DRM_NOUVEAU_CFLAGS = @DRM_NOUVEAU_CFLAGS@ DRM_NOUVEAU_LIBS = @DRM_NOUVEAU_LIBS@ +DRM_VC4_CFLAGS = @DRM_VC4_CFLAGS@ +DRM_VC4_LIBS = @DRM_VC4_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -258,6 +261,7 @@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MAN_SUBSTS = @MAN_SUBSTS@ @@ -302,6 +306,7 @@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ THREAD_CFLAGS = @THREAD_CFLAGS@ +TIMER_LIBS = @TIMER_LIBS@ VERSION = @VERSION@ XORG_MAN_PAGE = @XORG_MAN_PAGE@ XRANDR_CFLAGS = @XRANDR_CFLAGS@ @@ -356,11 +361,16 @@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ +target = @target@ target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ diff -Nru intel-gpu-tools-1.13/demos/Makefile.am intel-gpu-tools-1.15/demos/Makefile.am --- intel-gpu-tools-1.13/demos/Makefile.am 2015-11-12 17:30:48.000000000 +0000 +++ intel-gpu-tools-1.15/demos/Makefile.am 2016-05-23 10:51:28.000000000 +0000 @@ -3,5 +3,6 @@ $(NULL) AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/lib -AM_CFLAGS = $(DRM_CFLAGS) $(PCIACCESS_CFLAGS) $(CWARNFLAGS) $(CAIRO_CFLAGS) $(LIBUNWIND_CFLAGS) -LDADD = $(top_builddir)/lib/libintel_tools.la $(DRM_LIBS) $(PCIACCESS_LIBS) $(CAIRO_LIBS) $(LIBUNWIND_LIBS) +AM_CFLAGS = $(DRM_CFLAGS) $(PCIACCESS_CFLAGS) $(CWARNFLAGS) \ + $(CAIRO_CFLAGS) $(LIBUNWIND_CFLAGS) $(WERROR_CFLAGS) +LDADD = $(top_builddir)/lib/libintel_tools.la diff -Nru intel-gpu-tools-1.13/demos/Makefile.in intel-gpu-tools-1.15/demos/Makefile.in --- intel-gpu-tools-1.13/demos/Makefile.in 2015-12-02 16:47:58.000000000 +0000 +++ intel-gpu-tools-1.15/demos/Makefile.in 2016-05-31 17:03:32.000000000 +0000 @@ -88,6 +88,7 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ +target_triplet = @target@ bin_PROGRAMS = intel_sprite_on$(EXEEXT) subdir = demos ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 @@ -108,10 +109,7 @@ 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__DEPENDENCIES_1) +intel_sprite_on_DEPENDENCIES = $(top_builddir)/lib/libintel_tools.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent @@ -213,6 +211,8 @@ DRM_LIBS = @DRM_LIBS@ DRM_NOUVEAU_CFLAGS = @DRM_NOUVEAU_CFLAGS@ DRM_NOUVEAU_LIBS = @DRM_NOUVEAU_LIBS@ +DRM_VC4_CFLAGS = @DRM_VC4_CFLAGS@ +DRM_VC4_LIBS = @DRM_VC4_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -257,6 +257,7 @@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MAN_SUBSTS = @MAN_SUBSTS@ @@ -301,6 +302,7 @@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ THREAD_CFLAGS = @THREAD_CFLAGS@ +TIMER_LIBS = @TIMER_LIBS@ VERSION = @VERSION@ XORG_MAN_PAGE = @XORG_MAN_PAGE@ XRANDR_CFLAGS = @XRANDR_CFLAGS@ @@ -355,17 +357,24 @@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ +target = @target@ target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ 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) $(LIBUNWIND_CFLAGS) -LDADD = $(top_builddir)/lib/libintel_tools.la $(DRM_LIBS) $(PCIACCESS_LIBS) $(CAIRO_LIBS) $(LIBUNWIND_LIBS) +AM_CFLAGS = $(DRM_CFLAGS) $(PCIACCESS_CFLAGS) $(CWARNFLAGS) \ + $(CAIRO_CFLAGS) $(LIBUNWIND_CFLAGS) $(WERROR_CFLAGS) + +LDADD = $(top_builddir)/lib/libintel_tools.la all: all-am .SUFFIXES: diff -Nru intel-gpu-tools-1.13/docs/Makefile.in intel-gpu-tools-1.15/docs/Makefile.in --- intel-gpu-tools-1.13/docs/Makefile.in 2015-12-02 16:47:58.000000000 +0000 +++ intel-gpu-tools-1.15/docs/Makefile.in 2016-05-31 17:03:32.000000000 +0000 @@ -87,6 +87,7 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ +target_triplet = @target@ subdir = docs ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/as-compiler-flag.m4 \ @@ -217,6 +218,8 @@ DRM_LIBS = @DRM_LIBS@ DRM_NOUVEAU_CFLAGS = @DRM_NOUVEAU_CFLAGS@ DRM_NOUVEAU_LIBS = @DRM_NOUVEAU_LIBS@ +DRM_VC4_CFLAGS = @DRM_VC4_CFLAGS@ +DRM_VC4_LIBS = @DRM_VC4_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -261,6 +264,7 @@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MAN_SUBSTS = @MAN_SUBSTS@ @@ -305,6 +309,7 @@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ THREAD_CFLAGS = @THREAD_CFLAGS@ +TIMER_LIBS = @TIMER_LIBS@ VERSION = @VERSION@ XORG_MAN_PAGE = @XORG_MAN_PAGE@ XRANDR_CFLAGS = @XRANDR_CFLAGS@ @@ -359,11 +364,16 @@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ +target = @target@ target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ diff -Nru intel-gpu-tools-1.13/docs/reference/intel-gpu-tools/html/annotation-glossary.html intel-gpu-tools-1.15/docs/reference/intel-gpu-tools/html/annotation-glossary.html --- intel-gpu-tools-1.13/docs/reference/intel-gpu-tools/html/annotation-glossary.html 2015-12-02 16:48:05.000000000 +0000 +++ intel-gpu-tools-1.15/docs/reference/intel-gpu-tools/html/annotation-glossary.html 2016-05-31 17:09:21.000000000 +0000 @@ -3,12 +3,12 @@ Annotation Glossary: intel-gpu-tools Reference Manual - + - + @@ -37,6 +37,6 @@

Free data after the code is done.

+
Generated by GTK-Doc V1.25.1 \ No newline at end of file diff -Nru intel-gpu-tools-1.13/docs/reference/intel-gpu-tools/html/ch01.html intel-gpu-tools-1.15/docs/reference/intel-gpu-tools/html/ch01.html --- intel-gpu-tools-1.13/docs/reference/intel-gpu-tools/html/ch01.html 2015-12-02 16:48:05.000000000 +0000 +++ intel-gpu-tools-1.15/docs/reference/intel-gpu-tools/html/ch01.html 2016-05-31 17:09:21.000000000 +0000 @@ -3,12 +3,12 @@ API Reference: intel-gpu-tools Reference Manual - + - + @@ -51,6 +51,9 @@ GT — GT support library
+Power Management — Power Management related helpers +
+
ioctl wrappers — ioctl wrappers and related functions
@@ -65,6 +68,6 @@ +
Generated by GTK-Doc V1.25.1 \ No newline at end of file diff -Nru intel-gpu-tools-1.13/docs/reference/intel-gpu-tools/html/deprecated-api-index.html intel-gpu-tools-1.15/docs/reference/intel-gpu-tools/html/deprecated-api-index.html --- intel-gpu-tools-1.13/docs/reference/intel-gpu-tools/html/deprecated-api-index.html 2015-12-02 16:48:05.000000000 +0000 +++ intel-gpu-tools-1.15/docs/reference/intel-gpu-tools/html/deprecated-api-index.html 2016-05-31 17:09:21.000000000 +0000 @@ -3,11 +3,11 @@ Index of deprecated API: intel-gpu-tools Reference Manual - + - + @@ -24,6 +24,6 @@ +
Generated by GTK-Doc V1.25.1 \ No newline at end of file diff -Nru intel-gpu-tools-1.13/docs/reference/intel-gpu-tools/html/full-api-index.html intel-gpu-tools-1.15/docs/reference/intel-gpu-tools/html/full-api-index.html --- intel-gpu-tools-1.13/docs/reference/intel-gpu-tools/html/full-api-index.html 2015-12-02 16:48:05.000000000 +0000 +++ intel-gpu-tools-1.15/docs/reference/intel-gpu-tools/html/full-api-index.html 2016-05-31 17:09:21.000000000 +0000 @@ -3,12 +3,12 @@ API Index: intel-gpu-tools Reference Manual - + - + @@ -43,17 +43,11 @@  |  P  |  - R -  |  S  |  T  |  - U -  |  - V -  |  - W + U Home Prev @@ -75,1768 +69,2081 @@ ARRAY_SIZE, macro in drmtest
+

B

-igt_assert, macro in Core +BATCH_RESERVED, macro in Batch Buffer
-igt_assert_cmpdouble, macro in Core +BATCH_SZ, macro in Batch Buffer
-igt_assert_cmpint, macro in Core +BEGIN_BATCH, macro in Batch Buffer
-igt_assert_cmpu64, macro in Core +BLIT_COPY_BATCH_START, macro in Batch Buffer
+

C

-igt_assert_cmpuint, macro in Core +cairo_surface_t, typedef in Framebuffer
-igt_assert_crc_equal, function in debugfs +cairo_t, typedef in Framebuffer
-igt_assert_eq, macro in Core +CHECK_RAM, macro in aux
-igt_assert_eq_double, macro in Core +CHECK_SWAP, macro in aux
-igt_assert_eq_u32, macro in Core +COLOR_BLIT_COPY_BATCH_START, macro in Batch Buffer
+

D

-igt_assert_eq_u64, macro in Core +delta, variable in Stats
-igt_assert_f, macro in Core +do_ioctl, macro in drmtest
-igt_assert_fd, macro in Core +do_ioctl_err, macro in drmtest
-igt_assert_lt, macro in Core +do_or_die, macro in drmtest
-igt_assert_lte, macro in Core +DRIVER_ANY, macro in drmtest
-igt_assert_neq, macro in Core +DRIVER_INTEL, macro in drmtest
-igt_assert_neq_double, macro in Core +DRIVER_VC4, macro in drmtest
-igt_assert_neq_u32, macro in Core +drm_get_card, function in drmtest
-igt_assert_neq_u64, macro in Core +drm_open_driver, function in drmtest
-igt_aub_dump_enabled, function in aux +drm_open_driver_master, function in drmtest
-

B

-BATCH_RESERVED, macro in Batch Buffer +drm_open_driver_render, function in drmtest
-BATCH_SZ, macro in Batch Buffer +DRM_RDWR, macro in ioctl wrappers
-BEGIN_BATCH, macro in Batch Buffer +DROP_ACTIVE, macro in debugfs
-igt_blitter_fast_copy, function in Batch Buffer +DROP_ALL, macro in debugfs
-igt_blitter_fast_copy__raw, function in Batch Buffer +DROP_BOUND, macro in debugfs
-BLIT_COPY_BATCH_START, macro in Batch Buffer +DROP_RETIRE, macro in debugfs
-igt_bpp_depth_to_drm_format, function in Framebuffer +DROP_UNBOUND, macro in debugfs
+

E

-igt_buf, struct in Batch Buffer +EDID_LENGTH, macro in KMS
+

F

-igt_buf_height, function in Batch Buffer +for_each_connected_output, macro in KMS
-igt_buf_width, function in Batch Buffer +for_each_engine, macro in GT
-

C

-igt_cairo_printf_line, function in Framebuffer +for_each_pipe, macro in KMS
-cairo_surface_t, typedef in Framebuffer +for_if, macro in GT
+

G

-cairo_t, typedef in Framebuffer +gem_aperture_size, function in ioctl wrappers
-igt_check_boolean_env_var, function in aux +gem_available_aperture_size, function in ioctl wrappers
-CHECK_RAM, macro in aux +gem_available_fences, function in ioctl wrappers
-CHECK_SWAP, macro in aux +gem_bo_busy, function in ioctl wrappers
-igt_cleanup_aperture_trashers, function in aux +gem_close, function in ioctl wrappers
-COLOR_BLIT_COPY_BATCH_START, macro in Batch Buffer +gem_context_create, function in ioctl wrappers
-igt_commit_style, enum in KMS +gem_context_destroy, function in ioctl wrappers
-igt_crc_t, struct in debugfs +gem_context_get_param, function in ioctl wrappers
-igt_crc_to_string, function in debugfs +gem_context_require_ban_period, function in ioctl wrappers
-igt_create_color_fb, function in Framebuffer +gem_context_require_param, function in ioctl wrappers
-igt_create_fb, function in Framebuffer +gem_context_set_param, function in ioctl wrappers
-igt_create_fb_with_bo_size, function in Framebuffer +gem_create, function in ioctl wrappers
-igt_create_stereo_fb, function in Framebuffer +gem_create_stolen, function in ioctl wrappers
-igt_critical, macro in Core +gem_create__has_stolen_support, function in ioctl wrappers
-igt_crtc_set_background, function in KMS +gem_execbuf, function in ioctl wrappers
-

D

-igt_debug, macro in Core +gem_flink, function in ioctl wrappers
-igt_debugfs_fopen, function in debugfs +gem_get_caching, function in ioctl wrappers
-igt_debugfs_open, function in debugfs +gem_get_tiling, function in ioctl wrappers
-igt_debugfs_read, macro in debugfs +gem_global_aperture_size, function in ioctl wrappers
-igt_debugfs_search, function in debugfs +gem_gtt_type, function in ioctl wrappers
-igt_debug_manual_check, function in aux +gem_handle_to_libdrm_bo, function in ioctl wrappers
-igt_debug_wait_for_keypress, function in aux +gem_has_blt, function in ioctl wrappers
-igt_disable_exit_handler, function in Core +gem_has_bsd, function in ioctl wrappers
-igt_disable_prefault, function in debugfs +gem_has_bsd2, function in ioctl wrappers
-igt_display, struct in KMS +gem_has_llc, function in ioctl wrappers
-igt_display_commit, function in KMS +gem_has_mocs_registers, function in ioctl wrappers
-igt_display_commit2, function in KMS +gem_has_ring, function in ioctl wrappers
-igt_display_fini, function in KMS +gem_has_softpin, function in ioctl wrappers
-igt_display_get_n_pipes, function in KMS +gem_has_vebox, function in ioctl wrappers
-igt_display_init, function in KMS +gem_madvise, function in ioctl wrappers
-igt_display_t, typedef in KMS +gem_mappable_aperture_size, function in ioctl wrappers
-igt_display_try_commit2, function in KMS +gem_mmap__cpu, function in ioctl wrappers
-do_ioctl, macro in drmtest +gem_mmap__gtt, function in ioctl wrappers
-do_ioctl_err, macro in drmtest +gem_mmap__has_wc, function in ioctl wrappers
-do_or_die, macro in drmtest +gem_mmap__wc, function in ioctl wrappers
-igt_draw_fill_fb, function in Draw +gem_open, function in ioctl wrappers
-igt_draw_get_method_name, function in Draw +gem_quiescent_gpu, function in drmtest
-igt_draw_method, enum in Draw +gem_read, function in ioctl wrappers
-igt_draw_rect, function in Draw +gem_require_caching, function in ioctl wrappers
-igt_draw_rect_fb, function in Draw +gem_require_mmap_wc, macro in ioctl wrappers
-DRIVER_ANY, macro in drmtest +gem_require_mocs_registers, function in ioctl wrappers
-DRIVER_INTEL, macro in drmtest +gem_require_ring, function in ioctl wrappers
-igt_drm_format_to_bpp, function in Framebuffer +gem_require_stolen_support, macro in ioctl wrappers
-drm_get_card, function in drmtest +gem_set_caching, function in ioctl wrappers
-drm_open_driver, function in drmtest +gem_set_domain, function in ioctl wrappers
-drm_open_driver_master, function in drmtest +gem_set_tiling, function in ioctl wrappers
-drm_open_driver_render, function in drmtest +gem_sw_finish, function in ioctl wrappers
-DROP_ACTIVE, macro in debugfs +gem_sync, function in ioctl wrappers
-DROP_ALL, macro in debugfs +gem_userptr, function in ioctl wrappers
-DROP_BOUND, macro in debugfs +gem_uses_full_ppgtt, function in ioctl wrappers
-igt_drop_caches_set, function in debugfs +gem_uses_ppgtt, function in ioctl wrappers
-DROP_RETIRE, macro in debugfs +gem_wait, function in ioctl wrappers
-igt_drop_root, function in aux +gem_write, function in ioctl wrappers
+

H

-DROP_UNBOUND, macro in debugfs +HANG_ALLOW_BAN, macro in GT
-

E

-EDID_LENGTH, macro in KMS +HANG_ALLOW_CAPTURE, macro in GT
-igt_enable_connectors, function in KMS +HANG_POISON, macro in GT
-igt_enable_exit_handler, function in Core +HAS_BLT_RING, macro in Chipset
-igt_enable_prefault, function in debugfs +HAS_BSD_RING, macro in Chipset
-igt_exchange_int, function in aux +HAS_CPT, macro in Chipset
-igt_exit, function in Core +HAS_IBX, macro in Chipset
-IGT_EXIT_FAILURE, macro in Core +HAS_LPT, macro in Chipset
-igt_exit_handler_t, user_function in Core +HAS_PCH_SPLIT, macro in Chipset
-IGT_EXIT_INVALID, macro in Core +HAS_VEBOX_RING, macro in Chipset
+

I

-IGT_EXIT_SKIP, macro in Core +I915_TILING_Yf, macro in Batch Buffer
-IGT_EXIT_SUCCESS, macro in Core +I915_TILING_Ys, macro in Batch Buffer
-IGT_EXIT_TIMEOUT, macro in Core +igt_assert, macro in Core
-

F

-igt_fail, function in Core +igt_assert_cmpdouble, macro in Core
-igt_fail_on, macro in Core +igt_assert_cmpint, macro in Core
-igt_fail_on_f, macro in Core +igt_assert_cmpu64, macro in Core
-igt_fb, struct in Framebuffer +igt_assert_cmpuint, macro in Core
-igt_fb_set_position, function in KMS +igt_assert_crc_equal, function in debugfs
-igt_fb_set_size, function in KMS +igt_assert_eq, macro in Core
-igt_fillfunc_t, user_function in Batch Buffer +igt_assert_eq_double, macro in Core
-IGT_FIXED, macro in KMS +igt_assert_eq_u32, macro in Core
-igt_fixed_t, typedef in KMS +igt_assert_eq_u64, macro in Core
-igt_fixture, macro in Core +igt_assert_f, macro in Core
-igt_fopen_data, macro in Core +igt_assert_fd, macro in Core
-igt_fork, macro in Core +igt_assert_lt, macro in Core
-igt_fork_hang_helper, function in GT +igt_assert_lte, macro in Core
-igt_fork_helper, macro in Core +igt_assert_neq, macro in Core
-igt_fork_signal_helper, function in aux +igt_assert_neq_double, macro in Core
-igt_format_str, function in Framebuffer +igt_assert_neq_u32, macro in Core
-for_each_connected_output, macro in KMS +igt_assert_neq_u64, macro in Core
-for_each_pipe, macro in KMS +igt_atomic_connector_properties, enum in KMS
-

G

-gem_aperture_size, function in ioctl wrappers +igt_atomic_crtc_properties, enum in KMS
-gem_available_aperture_size, function in ioctl wrappers +igt_atomic_plane_properties, enum in KMS
-gem_available_fences, function in ioctl wrappers +igt_atomic_populate_connector_req, macro in KMS
-gem_bo_busy, function in ioctl wrappers +igt_atomic_populate_crtc_req, macro in KMS
-gem_close, function in ioctl wrappers +igt_atomic_populate_plane_req, macro in KMS
-gem_context_create, function in ioctl wrappers +igt_aub_dump_enabled, function in aux
-gem_context_destroy, function in ioctl wrappers +igt_blitter_fast_copy, function in Batch Buffer
-gem_context_get_param, function in ioctl wrappers +igt_blitter_fast_copy__raw, function in Batch Buffer
-gem_context_require_ban_period, function in ioctl wrappers +igt_bpp_depth_to_drm_format, function in Framebuffer
-gem_context_require_param, function in ioctl wrappers +igt_buf, struct in Batch Buffer
-gem_context_set_param, function in ioctl wrappers +igt_buf_height, function in Batch Buffer
-gem_create, function in ioctl wrappers +igt_buf_width, function in Batch Buffer
-gem_execbuf, function in ioctl wrappers +igt_cairo_printf_line, function in Framebuffer
-gem_flink, function in ioctl wrappers +igt_calc_fb_size, function in Framebuffer
-gem_get_caching, function in ioctl wrappers +igt_check_boolean_env_var, function in aux
-gem_get_num_rings, function in ioctl wrappers +igt_cleanup_aperture_trashers, function in aux
-gem_get_tiling, function in ioctl wrappers +igt_clflush_range, function in GT
-gem_handle_to_libdrm_bo, function in ioctl wrappers +igt_commit_style, enum in KMS
-gem_has_blt, function in ioctl wrappers +igt_crc_equal, function in debugfs
-gem_has_bsd, function in ioctl wrappers +igt_crc_t, struct in debugfs
-gem_has_bsd2, function in ioctl wrappers +igt_crc_to_string, function in debugfs
-gem_has_enable_ring, function in ioctl wrappers +igt_create_bo_with_dimensions, function in Framebuffer
-gem_has_llc, function in ioctl wrappers +igt_create_color_fb, function in Framebuffer
-gem_has_vebox, function in ioctl wrappers +igt_create_color_pattern_fb, function in Framebuffer
-gem_madvise, function in ioctl wrappers +igt_create_fb, function in Framebuffer
-gem_mappable_aperture_size, function in ioctl wrappers +igt_create_fb_with_bo_size, function in Framebuffer
-gem_mmap__cpu, function in ioctl wrappers +igt_create_image_fb, function in Framebuffer
-gem_mmap__gtt, function in ioctl wrappers +igt_create_pattern_fb, function in Framebuffer
-gem_mmap__has_wc, function in ioctl wrappers +igt_create_stereo_fb, function in Framebuffer
-gem_mmap__wc, function in ioctl wrappers +igt_critical, macro in Core
-gem_open, function in ioctl wrappers +igt_crtc_set_background, function in KMS
-gem_quiescent_gpu, function in drmtest +igt_debug, macro in Core
-gem_read, function in ioctl wrappers +igt_debugfs_fopen, function in debugfs
-gem_require_caching, function in ioctl wrappers +igt_debugfs_open, function in debugfs
-gem_require_mmap_wc, macro in ioctl wrappers +igt_debugfs_read, macro in debugfs
-gem_require_ring, function in ioctl wrappers +igt_debugfs_search, function in debugfs
-gem_set_caching, function in ioctl wrappers +igt_debug_manual_check, function in aux
-gem_set_domain, function in ioctl wrappers +igt_debug_wait_for_keypress, function in aux
-gem_set_tiling, function in ioctl wrappers +igt_dirty_fb, function in Framebuffer
-gem_sw_finish, function in ioctl wrappers +igt_disable_prefault, function in debugfs
-gem_sync, function in ioctl wrappers +igt_display, struct in KMS
-gem_uses_aliasing_ppgtt, function in ioctl wrappers +igt_display_commit, function in KMS
-gem_write, function in ioctl wrappers +igt_display_commit2, function in KMS
-igt_get_all_formats, function in Framebuffer +igt_display_fini, function in KMS
-igt_get_cairo_ctx, function in Framebuffer +igt_display_get_n_pipes, function in KMS
-igt_get_gpgpu_fillfunc, function in Batch Buffer +igt_display_init, function in KMS
-igt_get_media_fillfunc, function in Batch Buffer +igt_display_t, typedef in KMS
-igt_get_media_spinfunc, function in Batch Buffer +igt_display_try_commit2, function in KMS
-igt_get_render_copyfunc, function in Batch Buffer +igt_draw_fill_fb, function in Draw
-igt_get_runtime_pm_status, function in aux +igt_draw_get_method_name, function in Draw
-igt_get_stop_rings, function in GT +igt_draw_method, enum in Draw
-igt_global_mmio, variable in I/O +igt_draw_rect, function in Draw
-

H

-igt_hang_ring, function in GT +igt_draw_rect_fb, function in Draw
-igt_hang_ring_t, struct in GT +igt_drm_format_to_bpp, function in Framebuffer
-HAS_BLT_RING, macro in Chipset +igt_drop_caches_set, function in debugfs
-HAS_BSD_RING, macro in Chipset +igt_drop_root, function in aux
-HAS_CPT, macro in Chipset +igt_enable_connectors, function in KMS
-HAS_IBX, macro in Chipset +igt_enable_prefault, function in debugfs
-HAS_LPT, macro in Chipset +igt_exchange_int, function in aux
-HAS_PCH_SPLIT, macro in Chipset +igt_exit, function in Core
-HAS_VEBOX_RING, macro in Chipset +IGT_EXIT_FAILURE, macro in Core
-igt_helper_process, struct in Core +igt_exit_handler_t, user_function in Core
-

I

-I915_TILING_Yf, macro in Batch Buffer +IGT_EXIT_INVALID, macro in Core
-I915_TILING_Ys, macro in Batch Buffer +IGT_EXIT_SKIP, macro in Core
-igt_info, macro in Core +IGT_EXIT_SUCCESS, macro in Core
-igt_init_aperture_trashers, function in aux +IGT_EXIT_TIMEOUT, macro in Core
-INREG, function in I/O +igt_fail, function in Core
-INREG16, function in I/O +igt_fail_on, macro in Core
-INREG8, function in I/O +igt_fail_on_f, macro in Core
-igt_install_exit_handler, function in Core +igt_fb, struct in Framebuffer
-intel_batchbuffer, struct in Batch Buffer +igt_fb_set_position, function in KMS
-intel_batchbuffer_alloc, function in Batch Buffer +igt_fb_set_size, function in KMS
-intel_batchbuffer_data, function in Batch Buffer +igt_fillfunc_t, user_function in Batch Buffer
-intel_batchbuffer_emit_dword, function in Batch Buffer +IGT_FIXED, macro in KMS
-intel_batchbuffer_emit_reloc, function in Batch Buffer +igt_fixed_t, typedef in KMS
-intel_batchbuffer_flush, function in Batch Buffer +igt_fixture, macro in Core
-intel_batchbuffer_flush_on_ring, function in Batch Buffer +igt_fopen_data, macro in Core
-intel_batchbuffer_flush_with_context, function in Batch Buffer +igt_force_gpu_reset, function in GT
-intel_batchbuffer_free, function in Batch Buffer +igt_fork, macro in Core
-intel_batchbuffer_require_space, function in Batch Buffer +igt_fork_hang_detector, function in aux
-intel_batchbuffer_reset, function in Batch Buffer +igt_fork_hang_helper, function in GT
-intel_batchbuffer_set_context, function in Batch Buffer +igt_fork_helper, macro in Core
-intel_batchbuffer_space, function in Batch Buffer +igt_fork_signal_helper, function in aux
-intel_blt_copy, function in Batch Buffer +igt_format_str, function in Framebuffer
-intel_check_pch, function in Chipset +igt_get_all_cairo_formats, function in Framebuffer
-intel_copy_bo, function in Batch Buffer +igt_get_cairo_ctx, function in Framebuffer
-intel_dpio_reg_read, function in I/O +igt_get_gpgpu_fillfunc, function in Batch Buffer
-intel_dpio_reg_write, function in I/O +igt_get_media_fillfunc, function in Batch Buffer
-intel_flisdsi_reg_read, function in I/O +igt_get_media_spinfunc, function in Batch Buffer
-intel_flisdsi_reg_write, function in I/O +igt_get_render_copyfunc, function in Batch Buffer
-intel_gen, function in Chipset +igt_get_runtime_pm_status, function in aux
-intel_get_avail_ram_mb, function in aux +igt_get_stable_obj_count, function in debugfs
-intel_get_drm_devid, function in Chipset +igt_global_mmio, variable in I/O
-intel_get_pci_device, function in Chipset +igt_hang_ctx, function in GT
-intel_get_total_ram_mb, function in aux +igt_hang_ring, function in GT
-intel_get_total_swap_mb, function in aux +igt_hang_ring_t, struct in GT
-intel_iosf_sb_read, function in I/O +igt_helper_process, struct in Core
-intel_iosf_sb_write, function in I/O +igt_info, macro in Core
-intel_mmio_use_dump_file, function in I/O +igt_init_aperture_trashers, function in aux
-intel_mmio_use_pci_bar, function in I/O +igt_install_exit_handler, function in Core
-intel_nc_read, function in I/O +igt_interactive_debug, variable in Core
-intel_nc_write, function in I/O +igt_ioctl, user_function in ioctl wrappers
-intel_pipe_crc_source, enum in debugfs +igt_kms_get_alt_edid, function in KMS
-intel_punit_read, function in I/O +igt_kms_get_base_edid, function in KMS
-intel_punit_write, function in I/O +igt_lock_mem, function in aux
-intel_purge_vm_caches, function in aux +igt_log, function in Core
-intel_register_access_fini, function in I/O +IGT_LOG_DOMAIN, macro in Core
-intel_register_access_init, function in I/O +igt_log_level, enum in Core
-intel_register_access_needs_fakewake, function in I/O +igt_main, macro in Core
-intel_register_read, function in I/O +igt_mean, struct in Stats
-intel_register_write, function in I/O +igt_media_spinfunc_t, user_function in Batch Buffer
-intel_require_memory, function in aux +igt_nsec_elapsed, function in Core
-igt_interactive_debug, variable in Core +igt_only_list_subtests, function in Core
-IS_915, macro in Chipset +igt_open_forcewake_handle, function in GT
-IS_945, macro in Chipset +igt_opt_handler_t, user_function in Core
-IS_945GM, macro in Chipset +igt_output_get_mode, function in KMS
-IS_965, macro in Chipset +igt_output_get_plane, function in KMS
-IS_9XX, macro in Chipset +igt_output_name, function in KMS
-IS_BROADWATER, macro in Chipset +igt_output_override_mode, function in KMS
-IS_BROADWELL, macro in Chipset +igt_output_set_pipe, function in KMS
-IS_BROXTON, macro in Chipset +igt_output_t, struct in KMS
-IS_CHERRYVIEW, macro in Chipset +igt_paint_color, function in Framebuffer
-IS_CRESTLINE, macro in Chipset +igt_paint_color_alpha, function in Framebuffer
-IS_G33, macro in Chipset +igt_paint_color_gradient, function in Framebuffer
-IS_G45, macro in Chipset +igt_paint_color_gradient_range, function in Framebuffer
-IS_G4X, macro in Chipset +igt_paint_image, function in Framebuffer
-IS_GEN2, macro in Chipset +igt_paint_test_pattern, function in Framebuffer
-IS_GEN3, macro in Chipset +igt_permute_array, function in aux
-IS_GEN4, macro in Chipset +igt_pipe, struct in KMS
-IS_GEN5, macro in Chipset +igt_pipe_crc_collect_crc, function in debugfs
-IS_GEN6, macro in Chipset +igt_pipe_crc_free, function in debugfs
-IS_GEN7, macro in Chipset +igt_pipe_crc_get_crcs, function in debugfs
-IS_GEN8, macro in Chipset +igt_pipe_crc_new, function in debugfs
-IS_GEN9, macro in Chipset +igt_pipe_crc_new_nonblock, function in debugfs
-IS_GM45, macro in Chipset +igt_pipe_crc_start, function in debugfs
-IS_HASWELL, macro in Chipset +igt_pipe_crc_stop, function in debugfs
-IS_HSW_GT1, macro in Chipset +igt_pipe_crc_t, typedef in debugfs
-IS_HSW_GT2, macro in Chipset +igt_pipe_get_property, function in KMS
-IS_HSW_GT3, macro in Chipset +igt_pipe_set_ctm_matrix, function in KMS
-IS_ILD, macro in Chipset +igt_pipe_set_degamma_lut, function in KMS
-IS_ILM, macro in Chipset +igt_pipe_set_gamma_lut, function in KMS
-IS_INTEL, macro in Chipset +igt_pipe_t, typedef in KMS
-IS_IVYBRIDGE, macro in Chipset +igt_plane, enum in KMS
-IS_KABYLAKE, macro in Chipset +igt_plane_set_fb, function in KMS
-IS_KBL_GT1, macro in Chipset +igt_plane_set_panning, function in KMS
-IS_KBL_GT2, macro in Chipset +igt_plane_set_position, function in KMS
-IS_KBL_GT3, macro in Chipset +igt_plane_set_rotation, function in KMS
-IS_KBL_GT4, macro in Chipset +igt_plane_set_size, function in KMS
-IS_MOBILE, macro in Chipset +igt_plane_t, struct in KMS
-IS_SKL_GT1, macro in Chipset +igt_pm_enable_audio_runtime_pm, function in Power Management
-IS_SKL_GT2, macro in Chipset +igt_pm_enable_sata_link_power_management, function in Power Management
-IS_SKL_GT3, macro in Chipset +igt_pm_restore_sata_link_power_management, function in Power Management
-IS_SKL_GT4, macro in Chipset +igt_post_hang_ring, function in GT
-IS_SKYLAKE, macro in Chipset +igt_print_activity, function in aux
-IS_VALLEYVIEW, macro in Chipset +igt_progress, function in aux
-

K

-kmstest_connector_config, struct in KMS +igt_remove_fb, function in Framebuffer
-kmstest_connector_status_str, function in KMS +igt_render_copyfunc_t, user_function in Batch Buffer
-kmstest_connector_type_str, function in KMS +igt_require, macro in Core
-kmstest_dump_mode, function in KMS +igt_require_f, macro in Core
-kmstest_edid_add_3d, function in KMS +igt_require_fb_modifiers, function in ioctl wrappers
-kmstest_encoder_type_str, function in KMS +igt_require_hang_ring, function in GT
-kmstest_force_connector, function in KMS +igt_require_intel, function in drmtest
-kmstest_force_connector_state, enum in KMS +igt_require_pipe_crc, function in debugfs
-kmstest_force_edid, function in KMS +igt_reset_connectors, function in KMS
-kmstest_free_connector_config, function in KMS +igt_rotation_t, enum in KMS
-kmstest_get_connector_config, function in KMS +igt_runtime_pm_status, enum in aux
-kmstest_get_connector_default_mode, function in KMS +igt_run_in_simulation, function in Core
-kmstest_get_pipe_from_crtc_id, function in KMS +igt_setup_clflush, function in GT
-kmstest_get_property, function in KMS +igt_setup_runtime_pm, function in aux
-kmstest_pipe_name, function in KMS +igt_set_module_param, function in aux
-kmstest_plane_name, function in KMS +igt_set_module_param_int, function in aux
-kmstest_port_name, macro in KMS +igt_set_timeout, function in Core
-kmstest_restore_vt_mode, function in KMS +_igt_sigiter, struct in aux
-kmstest_set_connector_dpms, function in KMS +igt_simple_init, macro in Core
-kmstest_set_vt_graphics_mode, function in KMS +igt_simple_init_parse_opts, function in Core
-kmstest_unset_all_crtcs, function in KMS +igt_simple_main, macro in Core
-igt_kms_get_base_edid, function in KMS +igt_skip, function in Core
-

L

-LOCAL_DRM_CAP_ADDFB2_MODIFIERS, macro in ioctl wrappers +igt_skip_check, macro in Core
-LOCAL_DRM_FORMAT_MOD_NONE, macro in ioctl wrappers +igt_skip_on, macro in Core
-LOCAL_DRM_FORMAT_MOD_VENDOR_INTEL, macro in ioctl wrappers +igt_skip_on_f, macro in Core
-LOCAL_DRM_IOCTL_MODE_ADDFB2, macro in ioctl wrappers +igt_skip_on_simulation, function in Core
-local_drm_mode_fb_cmd2, struct in ioctl wrappers +igt_stats_fini, function in Stats
-LOCAL_DRM_MODE_FB_MODIFIERS, macro in ioctl wrappers +igt_stats_get_iqm, function in Stats
-local_fourcc_mod_code, macro in ioctl wrappers +igt_stats_get_iqr, function in Stats
-LOCAL_I915_FORMAT_MOD_X_TILED, macro in ioctl wrappers +igt_stats_get_max, function in Stats +
+
+
+igt_stats_get_mean, function in Stats +
+
+
+igt_stats_get_median, function in Stats +
+
+
+igt_stats_get_min, function in Stats +
+
+
+igt_stats_get_quartiles, function in Stats +
+
+
+igt_stats_get_range, function in Stats +
+
+
+igt_stats_get_std_deviation, function in Stats +
+
+
+igt_stats_get_trimean, function in Stats +
+
+
+igt_stats_get_variance, function in Stats +
+
+
+igt_stats_init, function in Stats +
+
+
+igt_stats_init_with_size, function in Stats +
+
+
+igt_stats_is_population, function in Stats +
+
+
+igt_stats_push, function in Stats +
+
+
+igt_stats_push_array, function in Stats +
+
+
+igt_stats_push_float, function in Stats +
+
+
+igt_stats_set_population, function in Stats +
+
+
+igt_stats_t, struct in Stats +
+
+
+igt_stop_hang_detector, function in aux +
+
+
+igt_stop_hang_helper, function in GT +
+
+
+igt_stop_helper, function in Core +
+
+
+igt_stop_signal_helper, function in aux +
+
+
+igt_subtest, macro in Core +
+
+
+igt_subtest_f, macro in Core +
+
+
+igt_subtest_group, macro in Core +
+
+
+igt_subtest_init, macro in Core +
+
+
+igt_subtest_init_parse_opts, function in Core +
+
+
+igt_subtest_name, function in Core +
+
+
+igt_success, function in Core +
+
+
+igt_swap, macro in aux +
+
+
+igt_system_hibernate_autoresume, function in aux +
+
+
+igt_system_suspend_autoresume, function in aux +
+
+
+IGT_TEST_DESCRIPTION, macro in Core +
+
+
+igt_text_align, enum in Framebuffer +
+
+
+igt_tokencat, macro in Core +
+
+
+igt_trash_aperture, function in aux +
+
+
+igt_unlock_mem, function in aux +
+
+
+igt_until_timeout, macro in aux +
+
+
+igt_vc4_create_bo, function in VC4 +
+
+
+igt_vc4_get_cleared_bo, function in VC4 +
+
+
+igt_vc4_mmap_bo, function in VC4 +
+
+
+igt_vlog, function in Core +
+
+
+igt_wait, macro in aux +
+
+
+igt_waitchildren, function in Core +
+
+
+igt_waitchildren_timeout, function in Core +
+
+
+igt_wait_for_pm_status, function in aux +
+
+
+igt_wait_for_vblank, function in KMS +
+
+
+igt_wait_helper, function in Core +
+
+
+igt_warn, macro in Core +
+
+
+igt_warn_on, macro in Core +
+
+
+igt_warn_on_f, macro in Core +
+
+
+igt_while_interruptible, macro in aux +
+
+
+igt_write_fb_to_png, function in Framebuffer +
+
+
+INREG, function in I/O +
+
+
+INREG16, function in I/O +
+
+
+INREG8, function in I/O +
+
+
+intel_batchbuffer, struct in Batch Buffer +
+
+
+intel_batchbuffer_alloc, function in Batch Buffer +
+
+
+intel_batchbuffer_data, function in Batch Buffer +
+
+
+intel_batchbuffer_emit_dword, function in Batch Buffer +
+
+
+intel_batchbuffer_emit_reloc, function in Batch Buffer +
+
+
+intel_batchbuffer_flush, function in Batch Buffer +
+
+
+intel_batchbuffer_flush_on_ring, function in Batch Buffer +
+
+
+intel_batchbuffer_flush_with_context, function in Batch Buffer +
+
+
+intel_batchbuffer_free, function in Batch Buffer +
+
+
+intel_batchbuffer_require_space, function in Batch Buffer +
+
+
+intel_batchbuffer_reset, function in Batch Buffer +
+
+
+intel_batchbuffer_set_context, function in Batch Buffer +
+
+
+intel_batchbuffer_space, function in Batch Buffer +
+
+
+intel_blt_copy, function in Batch Buffer +
+
+
+intel_check_pch, function in Chipset +
+
+
+intel_copy_bo, function in Batch Buffer +
+
+
+intel_detect_and_clear_missed_interrupts, function in GT +
+
+
+intel_dpio_reg_read, function in I/O +
+
+
+intel_dpio_reg_write, function in I/O +
+
+
+intel_flisdsi_reg_read, function in I/O +
+
+
+intel_flisdsi_reg_write, function in I/O +
+
+
+intel_gen, function in Chipset +
+
+
+intel_get_avail_ram_mb, function in aux +
+
+
+intel_get_drm_devid, function in Chipset +
+
+
+intel_get_pci_device, function in Chipset
-LOCAL_I915_FORMAT_MOD_Yf_TILED, macro in ioctl wrappers +intel_get_total_ram_mb, function in aux
-LOCAL_I915_FORMAT_MOD_Y_TILED, macro in ioctl wrappers +intel_get_total_swap_mb, function in aux
-local_i915_gem_context_param, struct in ioctl wrappers +intel_iosf_sb_read, function in I/O
-igt_lock_mem, function in aux +intel_iosf_sb_write, function in I/O
-igt_log, function in Core +intel_mmio_use_dump_file, function in I/O
-IGT_LOG_DOMAIN, macro in Core +intel_mmio_use_pci_bar, function in I/O
-igt_log_level, enum in Core +intel_nc_read, function in I/O
-

M

-igt_main, macro in Core +intel_nc_write, function in I/O
-max, macro in aux +intel_pipe_crc_source, enum in debugfs
-igt_media_spinfunc_t, user_function in Batch Buffer +intel_punit_read, function in I/O
-min, macro in aux +intel_punit_write, function in I/O
-mmap64, macro in drmtest +intel_purge_vm_caches, function in aux
-

N

-num_trash_bos, variable in aux +intel_register_access_fini, function in I/O
-

O

-igt_only_list_subtests, function in Core +intel_register_access_init, function in I/O
-igt_open_forcewake_handle, function in GT +intel_register_access_needs_fakewake, function in I/O
-igt_opt_handler_t, user_function in Core +intel_register_read, function in I/O
-igt_output_get_mode, function in KMS +intel_register_write, function in I/O
-igt_output_get_plane, function in KMS +intel_require_files, function in aux
-igt_output_name, function in KMS +intel_require_memory, function in aux
-igt_output_override_mode, function in KMS +IS_915, macro in Chipset
-igt_output_set_pipe, function in KMS +IS_945, macro in Chipset
-igt_output_t, struct in KMS +IS_945GM, macro in Chipset
-OUTREG, function in I/O +IS_965, macro in Chipset
-OUTREG16, function in I/O +IS_BROADWATER, macro in Chipset
-OUTREG8, function in I/O +IS_BROADWELL, macro in Chipset
-OUT_BATCH, macro in Batch Buffer +IS_BROXTON, macro in Chipset
-OUT_RELOC, macro in Batch Buffer +IS_CHERRYVIEW, macro in Chipset
-OUT_RELOC_FENCED, macro in Batch Buffer +IS_CRESTLINE, macro in Chipset
-

P

-igt_paint_color, function in Framebuffer +IS_G33, macro in Chipset
-igt_paint_color_alpha, function in Framebuffer +IS_G45, macro in Chipset
-igt_paint_color_gradient, function in Framebuffer +IS_G4X, macro in Chipset
-igt_paint_image, function in Framebuffer +IS_GEN2, macro in Chipset
-igt_paint_test_pattern, function in Framebuffer +IS_GEN3, macro in Chipset
-pch_type, enum in Chipset +IS_GEN4, macro in Chipset
-igt_permute_array, function in aux +IS_GEN5, macro in Chipset
-igt_pipe, struct in KMS +IS_GEN6, macro in Chipset
-pipe, enum in KMS +IS_GEN7, macro in Chipset
-igt_pipe_crc_collect_crc, function in debugfs +IS_GEN8, macro in Chipset
-igt_pipe_crc_free, function in debugfs +IS_GEN9, macro in Chipset
-igt_pipe_crc_get_crcs, function in debugfs +IS_GM45, macro in Chipset
-igt_pipe_crc_new, function in debugfs +IS_HASWELL, macro in Chipset
-igt_pipe_crc_start, function in debugfs +IS_HSW_GT1, macro in Chipset
-igt_pipe_crc_stop, function in debugfs +IS_HSW_GT2, macro in Chipset
-igt_pipe_crc_t, typedef in debugfs +IS_HSW_GT3, macro in Chipset
-igt_pipe_t, typedef in KMS +is_i915_device, function in drmtest
-igt_plane, enum in KMS +IS_ILD, macro in Chipset
-igt_plane_set_fb, function in KMS +IS_ILM, macro in Chipset
-igt_plane_set_panning, function in KMS +IS_INTEL, macro in Chipset
-igt_plane_set_position, function in KMS +IS_IVYBRIDGE, macro in Chipset
-igt_plane_set_rotation, function in KMS +IS_KABYLAKE, macro in Chipset
-igt_plane_set_size, function in KMS +IS_KBL_GT1, macro in Chipset
-igt_plane_t, struct in KMS +IS_KBL_GT2, macro in Chipset
-port, enum in KMS +IS_KBL_GT3, macro in Chipset
-igt_post_hang_ring, function in GT +IS_KBL_GT4, macro in Chipset
-prime_fd_to_handle, function in ioctl wrappers +IS_MOBILE, macro in Chipset
-prime_get_size, function in ioctl wrappers +IS_SKL_GT1, macro in Chipset
-prime_handle_to_fd, function in ioctl wrappers +IS_SKL_GT2, macro in Chipset
-igt_print_activity, function in aux +IS_SKL_GT3, macro in Chipset
-igt_progress, function in aux +IS_SKL_GT4, macro in Chipset
-

R

-igt_remove_fb, function in Framebuffer +IS_SKYLAKE, macro in Chipset
-igt_render_copyfunc_t, user_function in Batch Buffer +is_valid_utf8, function in uwildmat
-igt_require, macro in Core +IS_VALLEYVIEW, macro in Chipset
+

K

-igt_require_f, macro in Core +kmstest_connector_config, struct in KMS
-igt_require_fb_modifiers, function in ioctl wrappers +kmstest_connector_status_str, function in KMS
-igt_require_hang_ring, function in GT +kmstest_connector_type_str, function in KMS
-igt_require_pipe_crc, function in debugfs +kmstest_dumb_create, function in KMS
-igt_reset_connectors, function in KMS +kmstest_dumb_map_buffer, function in KMS
-igt_reset_timeout, function in Core +kmstest_dump_mode, function in KMS
-igt_rotation_t, enum in KMS +kmstest_edid_add_3d, function in KMS
-igt_runtime_pm_status, enum in aux +kmstest_encoder_type_str, function in KMS
-igt_run_in_simulation, function in Core +kmstest_find_crtc_for_connector, function in KMS
-

S

-igt_setup_runtime_pm, function in aux +kmstest_force_connector, function in KMS
-igt_set_module_param, function in aux +kmstest_force_connector_state, enum in KMS
-igt_set_module_param_int, function in aux +kmstest_force_edid, function in KMS
-igt_set_stop_rings, function in GT +kmstest_free_connector_config, function in KMS
-igt_set_timeout, function in Core +kmstest_get_connector_config, function in KMS
-igt_simple_init, macro in Core +kmstest_get_connector_default_mode, function in KMS
-igt_simple_init_parse_opts, function in Core +kmstest_get_crtc_idx, function in KMS
-igt_simple_main, macro in Core +kmstest_get_pipe_from_crtc_id, function in KMS
-igt_skip, function in Core +kmstest_get_property, function in KMS
-igt_skip_check, macro in Core +kmstest_pipe_name, function in KMS
-igt_skip_on, macro in Core +kmstest_plane_name, function in KMS
-igt_skip_on_f, macro in Core +kmstest_port_name, macro in KMS
-igt_skip_on_simulation, function in Core +kmstest_probe_connector_config, function in KMS
-SLOW_QUICK, macro in Core +kmstest_restore_vt_mode, function in KMS
-igt_stats_fini, function in Stats +kmstest_set_connector_dpms, function in KMS
-igt_stats_get_iqm, function in Stats +kmstest_set_vt_graphics_mode, function in KMS
-igt_stats_get_iqr, function in Stats +kmstest_unset_all_crtcs, function in KMS
+

L

-igt_stats_get_max, function in Stats +LOCAL_DMA_BUF_BASE, macro in ioctl wrappers
-igt_stats_get_mean, function in Stats +LOCAL_DMA_BUF_IOCTL_SYNC, macro in ioctl wrappers
-igt_stats_get_median, function in Stats +local_dma_buf_sync, struct in ioctl wrappers
-igt_stats_get_min, function in Stats +LOCAL_DMA_BUF_SYNC_END, macro in ioctl wrappers
-igt_stats_get_quartiles, function in Stats +LOCAL_DMA_BUF_SYNC_READ, macro in ioctl wrappers
-igt_stats_get_range, function in Stats +LOCAL_DMA_BUF_SYNC_RW, macro in ioctl wrappers
-igt_stats_get_std_deviation, function in Stats +LOCAL_DMA_BUF_SYNC_START, macro in ioctl wrappers
-igt_stats_get_trimean, function in Stats +LOCAL_DMA_BUF_SYNC_VALID_FLAGS_MASK, macro in ioctl wrappers
-igt_stats_get_variance, function in Stats +LOCAL_DMA_BUF_SYNC_WRITE, macro in ioctl wrappers
-igt_stats_init, function in Stats +LOCAL_DRM_CAP_ADDFB2_MODIFIERS, macro in ioctl wrappers
-igt_stats_init_with_size, function in Stats +LOCAL_DRM_FORMAT_MOD_NONE, macro in ioctl wrappers
-igt_stats_is_population, function in Stats +LOCAL_DRM_FORMAT_MOD_VENDOR_INTEL, macro in ioctl wrappers
-igt_stats_push, function in Stats +LOCAL_DRM_IOCTL_MODE_ADDFB2, macro in ioctl wrappers
-igt_stats_push_array, function in Stats +local_drm_mode_fb_cmd2, struct in ioctl wrappers
-igt_stats_push_float, function in Stats +LOCAL_DRM_MODE_FB_MODIFIERS, macro in ioctl wrappers
-igt_stats_set_population, function in Stats +local_fourcc_mod_code, macro in ioctl wrappers
-igt_stats_t, struct in Stats +LOCAL_I915_FORMAT_MOD_X_TILED, macro in ioctl wrappers
-igt_stop_hang_helper, function in GT +LOCAL_I915_FORMAT_MOD_Yf_TILED, macro in ioctl wrappers
-igt_stop_helper, function in Core +LOCAL_I915_FORMAT_MOD_Y_TILED, macro in ioctl wrappers
-stop_ring_flags, enum in GT +local_i915_gem_context_param, struct in ioctl wrappers
-igt_stop_signal_helper, function in aux +LOCAL_I915_GEM_USERPTR, macro in ioctl wrappers
-igt_subtest, macro in Core +local_i915_gem_userptr, struct in ioctl wrappers
-igt_subtest_f, macro in Core +LOCAL_IOCTL_I915_GEM_USERPTR, macro in ioctl wrappers
+

M

-igt_subtest_init, macro in Core +max, macro in aux
-igt_subtest_init_parse_opts, function in Core +min, macro in aux
-igt_subtest_name, function in Core +mmap64, macro in drmtest
+

N

-igt_success, function in Core +num_trash_bos, variable in aux
+

O

-igt_swap, macro in aux +OUTREG, function in I/O
-igt_system_hibernate_autoresume, function in aux +OUTREG16, function in I/O
-igt_system_suspend_autoresume, function in aux +OUTREG8, function in I/O
-

T

-IGT_TEST_DESCRIPTION, macro in Core +OUT_BATCH, macro in Batch Buffer
-igt_text_align, enum in Framebuffer +OUT_RELOC, macro in Batch Buffer
-igt_tokencat, macro in Core +OUT_RELOC_FENCED, macro in Batch Buffer
+

P

-igt_to_stop_ring_flag, function in GT +pch_type, enum in Chipset
-igt_trash_aperture, function in aux +pipe, enum in KMS
-trash_bos, variable in aux +port, enum in KMS
-

U

-igt_unlock_mem, function in aux +prime_fd_to_handle, function in ioctl wrappers
-

V

-igt_vlog, function in Core +prime_get_size, function in ioctl wrappers
-

W

-igt_wait, macro in aux +prime_handle_to_fd, function in ioctl wrappers
-igt_waitchildren, function in Core +prime_handle_to_fd_for_mmap, function in ioctl wrappers
-igt_wait_for_pm_status, function in aux +prime_sync_end, function in ioctl wrappers
-igt_wait_for_vblank, function in KMS +prime_sync_start, function in ioctl wrappers
+

S

-igt_wait_helper, function in Core +SLOW_QUICK, macro in Core
+

T

-igt_warn, macro in Core +trash_bos, variable in aux
+

U

-igt_warn_on, macro in Core +uwildmat, enum in uwildmat
-igt_warn_on_f, macro in Core +uwildmat_poison, function in uwildmat
-igt_write_fb_to_png, function in Framebuffer +uwildmat_simple, function in uwildmat
+
Generated by GTK-Doc V1.25.1 \ No newline at end of file diff -Nru intel-gpu-tools-1.13/docs/reference/intel-gpu-tools/html/igt-core-tests.html intel-gpu-tools-1.15/docs/reference/intel-gpu-tools/html/igt-core-tests.html --- intel-gpu-tools-1.13/docs/reference/intel-gpu-tools/html/igt-core-tests.html 2015-12-02 16:48:05.000000000 +0000 +++ intel-gpu-tools-1.15/docs/reference/intel-gpu-tools/html/igt-core-tests.html 2016-05-31 17:09:21.000000000 +0000 @@ -3,12 +3,12 @@ Core Tests: intel-gpu-tools Reference Manual - + - + @@ -30,7 +30,7 @@

Programs

-
+
@@ -189,6 +189,6 @@ +
Generated by GTK-Doc V1.25.1 \ No newline at end of file diff -Nru intel-gpu-tools-1.13/docs/reference/intel-gpu-tools/html/igt-debugfs-tests.html intel-gpu-tools-1.15/docs/reference/intel-gpu-tools/html/igt-debugfs-tests.html --- intel-gpu-tools-1.13/docs/reference/intel-gpu-tools/html/igt-debugfs-tests.html 2015-12-02 16:48:05.000000000 +0000 +++ intel-gpu-tools-1.15/docs/reference/intel-gpu-tools/html/igt-debugfs-tests.html 2016-05-31 17:09:21.000000000 +0000 @@ -3,12 +3,12 @@ Debugfs Tests: intel-gpu-tools Reference Manual - + - + @@ -30,7 +30,7 @@

Programs

-
+
@@ -56,6 +56,6 @@ +
Generated by GTK-Doc V1.25.1 \ No newline at end of file diff -Nru intel-gpu-tools-1.13/docs/reference/intel-gpu-tools/html/igt-drm-tests.html intel-gpu-tools-1.15/docs/reference/intel-gpu-tools/html/igt-drm-tests.html --- intel-gpu-tools-1.13/docs/reference/intel-gpu-tools/html/igt-drm-tests.html 2015-12-02 16:48:05.000000000 +0000 +++ intel-gpu-tools-1.15/docs/reference/intel-gpu-tools/html/igt-drm-tests.html 2016-05-31 17:09:21.000000000 +0000 @@ -3,12 +3,12 @@ DRM Tests: intel-gpu-tools Reference Manual - + - + @@ -30,7 +30,7 @@

Programs

-
+
@@ -169,6 +169,6 @@ +
Generated by GTK-Doc V1.25.1 \ No newline at end of file diff -Nru intel-gpu-tools-1.13/docs/reference/intel-gpu-tools/html/igt-drv-tests.html intel-gpu-tools-1.15/docs/reference/intel-gpu-tools/html/igt-drv-tests.html --- intel-gpu-tools-1.13/docs/reference/intel-gpu-tools/html/igt-drv-tests.html 2015-12-02 16:48:05.000000000 +0000 +++ intel-gpu-tools-1.15/docs/reference/intel-gpu-tools/html/igt-drv-tests.html 2016-05-31 17:09:21.000000000 +0000 @@ -3,12 +3,12 @@ DRV Tests: intel-gpu-tools Reference Manual - + - + @@ -30,7 +30,7 @@

Programs

-
+
@@ -123,9 +123,6 @@ error-state-sysfs-entry - + + +
-ring-stop-sysfs-entry -
error-state-basic
@@ -135,11 +132,20 @@ error-state-capture-bsd
+error-state-capture-bsd1 +
+error-state-capture-bsd2 +
error-state-capture-blt
error-state-capture-vebox
+hangcheck-unterminated +
@@ -207,6 +213,6 @@
+
Generated by GTK-Doc V1.25.1
\ No newline at end of file diff -Nru intel-gpu-tools-1.13/docs/reference/intel-gpu-tools/html/igt-gem-tests.html intel-gpu-tools-1.15/docs/reference/intel-gpu-tools/html/igt-gem-tests.html --- intel-gpu-tools-1.13/docs/reference/intel-gpu-tools/html/igt-gem-tests.html 2015-12-02 16:48:05.000000000 +0000 +++ intel-gpu-tools-1.15/docs/reference/intel-gpu-tools/html/igt-gem-tests.html 2016-05-31 17:09:21.000000000 +0000 @@ -3,12 +3,12 @@ GEM Tests: intel-gpu-tools Reference Manual - + - + @@ -30,7 +30,7 @@

Programs

-
+
@@ -56,19 +56,19 @@ @@ -86,6 +86,12 @@ + + + + @@ -128,25 +134,25 @@ @@ -182,6 +188,12 @@ + + + + @@ -194,12 +206,30 @@ + + + + + + + + + + + + @@ -212,6 +242,12 @@ + + + + @@ -224,6 +260,30 @@ + + + + + + + + + + + + + + + + @@ -344,7 +404,7 @@ @@ -518,6 +578,24 @@ + + + + + + + + + + + + @@ -536,6 +614,12 @@ + + + + @@ -655,14 +739,50 @@

Subtests

-gem_caching +gem_busy  
-gem_close_race +gem_caching  
-gem_concurrent_all +gem_close_race  
+gem_create + 
gem_cs_prefetch  
-gem_ctx_param_basic +gem_ctx_param  
-gem_ctx_thrash +gem_ctx_switch  
-gem_double_irq_loop +gem_ctx_thrash  
-gem_dummy_reloc_loop +gem_double_irq_loop  
+gem_exec_basic + 
gem_exec_big  
+gem_exec_create + 
gem_exec_faulting_reloc  
+gem_exec_flush + 
+gem_exec_gttfill + 
gem_exec_lut_handle  
+gem_exec_parallel + 
gem_exec_params  
+gem_exec_reloc + 
+gem_exec_store + 
+gem_exec_suspend + 
+gem_exec_whisper + 
gem_fd_exhaustion  
-gem_multi_bsd_sync_loop +gem_mocs_settings  
+gem_shrink + 
+gem_softpin + 
+gem_stolen + 
gem_storedw_batches_loop  
+gem_sync + 
gem_threaded_access_tiled  
+ + + + + + + + + + + +
-negative-reloc +negative-reloc-default +
+negative-reloc-lut-default
-negative-reloc-lut +negative-reloc-render +
+negative-reloc-lut-render +
+negative-reloc-bsd +
+negative-reloc-lut-bsd +
+negative-reloc-bsd1 +
+negative-reloc-lut-bsd1 +
+negative-reloc-bsd2 +
+negative-reloc-lut-bsd2
negative-reloc-blt
+negative-reloc-lut-blt +
+negative-reloc-vebox +
+negative-reloc-lut-vebox +
+negative-reloc-bltcopy +
@@ -690,58 +810,118 @@
-

-gem_caching +

+gem_busy

-Test snoop consistency when touching partial cachelines. +Basic check of busy-ioctl ABI.

Subtests

+ + + + + + + + + + + + + + +
-reads +basic-render
-writes +basic-bsd
-read-writes +basic-bsd1 +
+basic-bsd2 +
+basic-blt +
+basic-vebox +
+basic-parallel-render +
+basic-parallel-bsd +
+basic-parallel-bsd1 +
+basic-parallel-bsd2 +
+basic-parallel-blt +
+basic-parallel-vebox +
+semaphore-render +
+semaphore-bsd +
+semaphore-bsd1 +
+semaphore-bsd2 +
+semaphore-blt +
+semaphore-vebox

-

-gem_close_race +

+gem_caching

+Test snoop consistency when touching partial cachelines.

Subtests

+
-process-exit +reads
-gem-close-race +writes +
+read-writes

-

-gem_concurrent_all +

+gem_close_race

-Test of pread/pwrite/mmap behavior when writing to active buffers.

Subtests

-

This test has over 100 subtests. -Run gem_concurrent_all --list-subtests to list them.

+ + + + + +
+basic-process +
+basic-threads +
+process-exit +
+gem-close-race +

@@ -780,12 +960,64 @@
+

+gem_create +

+

+This is a test for the extended & old gem_create ioctl, that includes allocation of object from stolen memory and shmem. +

+
+

Subtests

+ + + + + +
+stolen-invalid-flag +
+create-invalid-size +
+create-valid-nonaligned +
+create-invalid-nonaligned +
+
+
+
+

gem_cs_prefetch

Test the CS prefetch behaviour on batches.

+
+

Subtests

+ + + + + + + + +
+default +
+render +
+bsd +
+bsd1 +
+bsd2 +
+blt +
+vebox +
+

@@ -796,15 +1028,24 @@ Check whether we correctly invalidate the cs tlb.

-

Subtests

+

Subtests

+ + +
+basic-default +
render
bsd
+bsd1 +
+bsd2 +
blt
@@ -822,7 +1063,7 @@ Negative test cases for destroy contexts.

-

Subtests

+

Subtests

double-destroy @@ -848,7 +1089,7 @@ Test that context cannot be submitted to unsupported rings.

-

Subtests

+

Subtests

render @@ -882,7 +1123,7 @@

-

Subtests

+

Subtests

-
basic @@ -890,158 +1131,271 @@
invalid-pad
-
- -
-
-

-gem_ctx_exec -

-

-Test basic context switch functionality. -

-
-

Subtests

- -
-basic +basic-files
-eviction +forked-files
-reset-pin-leak +active-default
-lrc-lite-restore +forked-active-default
-
-
-
-
-

-gem_ctx_param_basic -

-

-Basic test for context set/get param input validation. -

-
-

Subtests

- -
-basic +active-render
-basic-default +forked-active-render
-invalid-ctx-get -
-invalid-ctx-set +active-bsd
-invalid-size-get +forked-active-bsd
-invalid-size-set +active-bsd1
-non-root-set +forked-active-bsd1
-root-set +active-bsd2
-non-root-set-no-zeromap +forked-active-bsd2
-root-set-no-zeromap-enabled +active-blt
-root-set-no-zeromap-disabled +forked-active-blt
-invalid-param-get +active-vebox
-invalid-param-set +forked-active-vebox

-

-gem_ctx_thrash +

+gem_ctx_exec

-Fill the Gobal GTT with context objects and VMs - +Test basic context switch functionality.

-

Subtests

+

Subtests

+ +
-processes +basic
-threads +eviction +
+reset-pin-leak +
+lrc-lite-restore

-

-gem_double_irq_loop +

+gem_ctx_param

-Basic check for missed IRQs on blt ring. +Basic test for context set/get param input validation.

+
+

Subtests

+ + + + + + + + + + + + + + +
+basic +
+basic-default +
+invalid-ctx-get +
+invalid-ctx-set +
+invalid-size-get +
+invalid-size-set +
+non-root-set +
+root-set +
+non-root-set-no-zeromap +
+root-set-no-zeromap-enabled +
+root-set-no-zeromap-disabled +
+invalid-param-get +
+invalid-param-set +
+

-

-gem_dummy_reloc_loop +

+gem_ctx_switch

-Check ring<->cpu sync using a dummy reloc.

-

Subtests

+

Subtests

+ + + + + + + + + + + + + + + + + + + + + + +
+basic-default +
+default-interruptible +
+forked-default +
+forked-default-interruptible +
render
+render-interruptible +
+forked-render +
+forked-render-interruptible +
bsd
+bsd-interruptible +
+forked-bsd +
+forked-bsd-interruptible +
+bsd1 +
+bsd1-interruptible +
+forked-bsd1 +
+forked-bsd1-interruptible +
+bsd2 +
+bsd2-interruptible +
+forked-bsd2 +
+forked-bsd2-interruptible +
blt
+blt-interruptible +
+forked-blt +
+forked-blt-interruptible +
vebox
-bsd-ring1 +vebox-interruptible +
+forked-vebox
-bsd-ring2 +forked-vebox-interruptible +
+
+
+
+
+

+gem_ctx_thrash +

+

+Fill the Gobal GTT with context objects and VMs + +

+
+

Subtests

+ + +
+single +
+engines
-mixed +processes
-mixed_multi_fd +threads

+

+gem_double_irq_loop +

+

+Basic check for missed IRQs on blt ring. +

+
+
+

gem_eio

@@ -1049,7 +1403,7 @@ Test that specific ioctls report a wedged GPU (EIO).

-

Subtests

+

Subtests

throttle @@ -1072,7 +1426,7 @@ Run a couple of big batches to force the unbind on misalignment code.

-

Subtests

+

Subtests

minor-normal @@ -1104,7 +1458,7 @@ Run a couple of big batches to force the eviction code.

-

Subtests

+

Subtests

forked-normal @@ -1201,6 +1555,17 @@

Exercises the basic execbuffer using object alignments

+
+

Subtests

+ + + +
+single +
+many +
+

@@ -1211,7 +1576,7 @@ Test whether the kernel rejects relocations with non-gpu domains.

-

Subtests

+

Subtests

cpu-domain @@ -1233,6 +1598,83 @@
+

+gem_exec_basic +

+

+Basic sanity check of execbuf-ioctl rings. +

+
+

Subtests

+ + + + + + + + + + + + + + + + + + + + + + +
+basic-default +
+readonly-default +
+gtt-default +
+basic-render +
+readonly-render +
+gtt-render +
+basic-bsd +
+readonly-bsd +
+gtt-bsd +
+basic-bsd1 +
+readonly-bsd1 +
+gtt-bsd1 +
+basic-bsd2 +
+readonly-bsd2 +
+gtt-bsd2 +
+basic-blt +
+readonly-blt +
+gtt-blt +
+basic-vebox +
+readonly-vebox +
+gtt-vebox +
+
+
+
+

gem_exec_big

@@ -1248,7 +1690,7 @@

-

Subtests

+

Subtests

+ + + + +
cold @@ -1263,237 +1705,749 @@ cold-min
-normal-min +normal-min +
+dumb-buf-min +
+cold-max +
+normal-max +
+dumb-buf-max +
+
+
+
+
+

+gem_exec_create +

+

+

+
+

Subtests

+ + + + +
+basic +
+forked +
+madvise +
+
+
+
+
+

+gem_exec_faulting_reloc +

+

+Submit patches with relocations in memory that will fault. +

+
+

Subtests

+ + + +
+normal +
+no-prefault +
+
+
+
+
+

+gem_exec_flush +

+

+Basic check of flushing after batches +

+
+

Subtests

+

This test has over 100 subtests. +Run gem_exec_flush --list-subtests to list them.

+
+
+
+
+

+gem_exec_gttfill +

+

+Fill the GTT with batches. +

+
+

Subtests

+ + + + + + + + + + +
+basic +
+default +
+render +
+bsd +
+bsd1 +
+bsd2 +
+blt +
+vebox +
+all +
+
+
+
+
+

+gem_exec_lut_handle +

+

+Exercises the basic execbuffer using the handle LUT interface. +

+
+
+
+

+gem_exec_nop +

+

+

+
+

Subtests

+ + + + + + + + + + +
+basic +
+default +
+render +
+bsd +
+bsd1 +
+bsd2 +
+blt +
+vebox +
+all +
+
+
+
+
+

+gem_exec_parallel +

+

+

+
+

Subtests

+ + + + + + + + + + + + + + + + + + + + + + + + + +
+basic +
+contexts +
+fds +
+default +
+default-contexts +
+default-fds +
+render +
+render-contexts +
+render-fds +
+bsd +
+bsd-contexts +
+bsd-fds +
+bsd1 +
+bsd1-contexts +
+bsd1-fds +
+bsd2 +
+bsd2-contexts +
+bsd2-fds +
+blt +
+blt-contexts +
+blt-fds +
+vebox +
+vebox-contexts +
+vebox-fds +
+
+
+
+
+

+gem_exec_params +

+

+

+
+

Subtests

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+control +
+no-bsd +
+no-blt +
+no-vebox +
+invalid-ring +
+invalid-ring2 +
+invalid-bsd-ring +
+invalid-bsd1-flag-on-render +
+invalid-bsd2-flag-on-render +
+invalid-bsd1-flag-on-blt +
+invalid-bsd2-flag-on-blt +
+invalid-bsd1-flag-on-vebox +
+invalid-bsd2-flag-on-vebox +
+rel-constants-invalid-ring +
+rel-constants-invalid-rel-gen5 +
+rel-constants-invalid +
+sol-reset-invalid +
+sol-reset-not-gen7 +
+secure-non-root +
+secure-non-master +
+invalid-flag +
+cliprects-invalid +
+rs-invalid-on-bsd-ring +
+rs-invalid-on-blt-ring +
+rs-invalid-on-vebox-ring +
+rs-invalid-gen +
+rsvd2-dirt +
+cliprects_ptr-dirt +
+DR1-dirt +
+DR4-dirt +
+
+
+
+
+

+gem_exec_parse +

+

+

+
+

Subtests

+ + + + + + + + + + +
+basic-allowed +
+basic-rejected +
+registers +
+bitmasks +
+batch-without-end +
+cmd-crossing-page +
+oacontrol-tracking +
+chained-batch +
+load-register-reg +
+
+
+
+
+

+gem_exec_reloc +

+

+Basic sanity check of execbuf-ioctl relocations. +

+
+

Subtests

+

This test has over 100 subtests. +Run gem_exec_reloc --list-subtests to list them.

+
+
+
+
+

+gem_exec_store +

+

+

+
+

Subtests

+ + + + + + + + + +
+basic-default +
+basic-render +
+basic-bsd +
+basic-bsd1 +
+basic-bsd2 +
+basic-blt +
+basic-vebox +
+basic-all +
+
+
+
+
+

+gem_exec_suspend +

+

+

+
+

Subtests

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -
+basic +
+basic-S3 +
+basic-S4 +
+default-uncached +
+default-cached +
+default-uncached-S3 +
+default-cached-S3 +
+default-uncached-S4 +
+default-cached-S4 +
+render-uncached +
+render-cached +
+render-uncached-S3 +
+render-cached-S3 +
+render-uncached-S4 +
+render-cached-S4 +
+bsd-uncached +
+bsd-cached +
+bsd-uncached-S3 +
+bsd-cached-S3 +
+bsd-uncached-S4 +
+bsd-cached-S4 +
+bsd1-uncached +
+bsd1-cached +
+bsd1-uncached-S3 +
+bsd1-cached-S3 +
+bsd1-uncached-S4 +
+bsd1-cached-S4 +
+bsd2-uncached +
+bsd2-cached +
+bsd2-uncached-S3 +
+bsd2-cached-S3 +
+bsd2-uncached-S4 +
+bsd2-cached-S4 +
+blt-uncached +
+blt-cached +
+blt-uncached-S3 +
+blt-cached-S3 +
+blt-uncached-S4 +
+blt-cached-S4
-dumb-buf-min +vebox-uncached
-cold-max +vebox-cached
-normal-max +vebox-uncached-S3
-dumb-buf-max +vebox-cached-S3
-
-
-
-
-

-gem_exec_faulting_reloc -

-

-Submit patches with relocations in memory that will fault. -

-
-

Subtests

-
-normal +vebox-uncached-S4
-no-prefault +vebox-cached-S4

-

-gem_exec_lut_handle -

-

-Exercises the basic execbuffer using the handle LUT interface. -

-
-
-
-

-gem_exec_nop +

+gem_exec_whisper

-

Subtests

+

Subtests

- - -
-render -
-bsd -
-blt +normal
-vebox +interruptible
-render-min +contexts
-bsd-min +contexts-interruptible
-blt-min +fds
-vebox-min +fds-interruptible
-render-max +default-normal
-bsd-max +default-interruptible
-blt-max +default-contexts
-vebox-max +default-contexts-interruptible
-
-
-
-
-

-gem_exec_params -

-

-

-
-

Subtests

- -
-control +default-fds
-no-bsd +default-fds-interruptible
-no-blt +render-normal
-no-vebox +render-interruptible
-invalid-ring +render-contexts
-invalid-ring2 +render-contexts-interruptible
-invalid-bsd-ring +render-fds
-invalid-bsd1-flag-on-render +render-fds-interruptible
-invalid-bsd2-flag-on-render +bsd-normal
-invalid-bsd1-flag-on-blt +bsd-interruptible
-invalid-bsd2-flag-on-blt +bsd-contexts
-invalid-bsd1-flag-on-vebox +bsd-contexts-interruptible
-invalid-bsd2-flag-on-vebox +bsd-fds
-rel-constants-invalid-ring +bsd-fds-interruptible
-rel-constants-invalid-rel-gen5 +bsd1-normal
-rel-constants-invalid +bsd1-interruptible
-sol-reset-invalid +bsd1-contexts
-sol-reset-not-gen7 +bsd1-contexts-interruptible
-secure-non-root +bsd1-fds
-secure-non-master +bsd1-fds-interruptible
-invalid-flag +bsd2-normal
-cliprects-invalid +bsd2-interruptible
-rs-invalid-on-bsd-ring +bsd2-contexts
-rs-invalid-on-blt-ring +bsd2-contexts-interruptible
-rs-invalid-on-vebox-ring +bsd2-fds
-rs-invalid-gen +bsd2-fds-interruptible
-rsvd2-dirt +blt-normal
-cliprects_ptr-dirt +blt-interruptible
-DR1-dirt +blt-contexts
-DR4-dirt +blt-contexts-interruptible
-
-
-
-
-

-gem_exec_parse -

-

-

-
-

Subtests

-
-basic-allowed +blt-fds
-basic-rejected +blt-fds-interruptible
-registers +vebox-normal
-bitmasks +vebox-interruptible
-batch-without-end +vebox-contexts
-cmd-crossing-page +vebox-contexts-interruptible
-oacontrol-tracking +vebox-fds
-chained-batch +vebox-fds-interruptible
@@ -1515,7 +2469,7 @@ Test execbuf fence accounting.

-

Subtests

+

Subtests

2-spare-fences @@ -1546,7 +2500,7 @@

-

Subtests

+

Subtests

bo-write-verify-none @@ -1580,7 +2534,7 @@

-

Subtests

+

Subtests

performance @@ -1611,7 +2565,7 @@

-

Subtests

+

Subtests

basic @@ -1640,7 +2594,7 @@ Check for flink/open vs. gem close races.

-

Subtests

+

Subtests

flink_name @@ -1710,7 +2664,7 @@ Test doing many blits with a working set larger than the aperture size.

-

Subtests

+

Subtests

basic @@ -1742,7 +2696,7 @@ Checks that the kernel reports EFAULT when trying to use purged bo.

-

Subtests

+

Subtests

dontneed-before-mmap @@ -1776,7 +2730,7 @@

-

Subtests

+

Subtests

bad-object @@ -1810,7 +2764,7 @@

-

Subtests

+

Subtests

+
basic @@ -1831,6 +2785,9 @@ basic-write-gtt
+coherency +
basic-read-write
@@ -1928,7 +2885,7 @@

-

Subtests

+

Subtests

+
invalid-flags @@ -1946,6 +2903,9 @@ write
+coherency +
write-gtt
@@ -1989,12 +2949,28 @@
-

-gem_multi_bsd_sync_loop +

+gem_mocs_settings

-Basic check of ring<->ring sync using a dummy reloc.

+
+

Subtests

+ + + + + +
+mocs-settings +
+mocs-reset +
+mocs-suspend +
+mocs-hibernate +
+

@@ -2005,7 +2981,7 @@ Test pwrite/pread consistency when touching partial cachelines.

-

Subtests

+

Subtests

reads @@ -2055,7 +3031,7 @@ Test persistent relocations as used by uxa/libva.

-

Subtests

+

Subtests

normal @@ -2120,7 +3096,7 @@ Test (TLB-)Coherency of pipe_control QW writes.

-

Subtests

+

Subtests

fresh-buffer @@ -2139,7 +3115,7 @@

-

Subtests

+

Subtests

blt-vs-render-ctx0 @@ -2164,7 +3140,7 @@

-

Subtests

+

Subtests

+ + + + +
basic @@ -2178,6 +3154,21 @@
display
+stolen-normal +
+stolen-uncached +
+stolen-snoop +
+stolen-display +
+pagefault-pread +
@@ -2190,7 +3181,7 @@ Test pread behavior when getting values out of just-drawn-to buffers.

-

Subtests

+

Subtests

default-normal @@ -2239,7 +3230,7 @@

-

Subtests

+

Subtests

+ + + + + + + + + + + + + + + + + + + + + + + +
basic @@ -2254,16 +3245,88 @@ display
-big-cpu +stolen-normal +
+stolen-uncached +
+stolen-snoop +
+stolen-display +
+small-cpu-forwards +
+small-gtt-forwards +
+big-cpu-forwards +
+big-gtt-forwards +
+huge-cpu-forwards +
+huge-gtt-forwards +
+small-cpu-backwards +
+small-gtt-backwards +
+big-cpu-backwards +
+big-gtt-backwards +
+huge-cpu-backwards +
+huge-gtt-backwards +
+small-cpu-random +
+small-gtt-random
-big-gtt +big-cpu-random
-huge-cpu +big-gtt-random
-huge-gtt +huge-cpu-random +
+huge-gtt-random +
+small-cpu-fbr +
+small-gtt-fbr +
+big-cpu-fbr +
+big-gtt-fbr +
+huge-cpu-fbr +
+huge-gtt-fbr
@@ -2276,7 +3339,7 @@

-

Subtests

+

Subtests

uncached-copy-correctness @@ -2335,32 +3398,104 @@ Test speed of concurrent reads between engines.

-

Subtests

+

Subtests

+ + + + + + + + + + + + + + + + + + + + + + + +
-read-read-1x1 +read-read-1x1 +
+read-write-1x1 +
+write-read-1x1 +
+write-write-1x1 +
+read-read-128x128 +
+read-write-128x128 +
+write-read-128x128 +
+write-write-128x128 +
+read-read-256x256 +
+read-write-256x256 +
+write-read-256x256 +
+write-write-256x256 +
+read-read-512x512 +
+read-write-512x512 +
+write-read-512x512 +
+write-write-512x512 +
+read-read-1024x1024 +
+read-write-1024x1024 +
+write-read-1024x1024 +
+write-write-1024x1024 +
+read-read-2048x2048 +
+read-write-2048x2048
-read-read-128x128 +write-read-2048x2048
-read-read-256x256 +write-write-2048x2048
-read-read-512x512 +read-read-4096x4096
-read-read-1024x1024 +read-write-4096x4096
-read-read-2048x2048 +write-read-4096x4096
-read-read-4096x4096 +write-write-4096x4096
read-read-8192x8192
+read-write-8192x8192 +
+write-read-8192x8192 +
+write-write-8192x8192 +
@@ -2372,7 +3507,7 @@

-

Subtests

+

Subtests

new-obj @@ -2400,7 +3535,7 @@

-

Subtests

+

Subtests

bad-register @@ -2423,13 +3558,13 @@ Check that kernel relocation overflows are caught.

-

Subtests

+

Subtests

+ + + + + + + + +
invalid-address
-single-overflow +single-fault
batch-start-unaligned @@ -2438,9 +3573,36 @@ batch-end-unaligned
+batch-both-unaligned +
+single-overflow +
wrapped-overflow
+invalid-address-noprefault +
+single-fault-noprefault +
+batch-start-unaligned-noprefault +
+batch-end-unaligned-noprefault +
+batch-both-unaligned-noprefault +
+single-overflow-noprefault +
+wrapped-overflow-noprefault +
source-offset-page-stradle-gen8-reloc-cpu
@@ -2497,7 +3659,7 @@ Test kernel relocations vs. gpu races.

-

Subtests

+

Subtests

normal @@ -2610,7 +3772,7 @@ Advanced test for the render_copy() function.

-

Subtests

+

Subtests

normal @@ -2635,7 +3797,7 @@

-

Subtests

+

Subtests

basic @@ -2657,7 +3819,7 @@

-

Subtests

+

Subtests

basic @@ -2680,7 +3842,7 @@ Collection of tests targeting request retirement code paths.

-

Subtests

+

Subtests

retire-vma-not-inactive
@@ -2694,13 +3856,49 @@

-

Subtests

+

Subtests

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
params
-params-ctx-render +params-ctx +
+reset-stats-default +
+reset-stats-ctx-default +
+ban-default +
+ban-ctx-default +
+reset-count-default +
+reset-count-ctx-default +
+unrelated-ctx-default +
+close-pending-default +
+close-pending-ctx-default +
+close-pending-fork-default +
+close-pending-fork-reverse-default +
+defer-hangcheck-default
reset-stats-render @@ -2739,7 +3937,112 @@ defer-hangcheck-render
-params-ctx-blt +reset-stats-bsd +
+reset-stats-ctx-bsd +
+ban-bsd +
+ban-ctx-bsd +
+reset-count-bsd +
+reset-count-ctx-bsd +
+unrelated-ctx-bsd +
+close-pending-bsd +
+close-pending-ctx-bsd +
+close-pending-fork-bsd +
+close-pending-fork-reverse-bsd +
+defer-hangcheck-bsd +
+reset-stats-bsd1 +
+reset-stats-ctx-bsd1 +
+ban-bsd1 +
+ban-ctx-bsd1 +
+reset-count-bsd1 +
+reset-count-ctx-bsd1 +
+unrelated-ctx-bsd1 +
+close-pending-bsd1 +
+close-pending-ctx-bsd1 +
+close-pending-fork-bsd1 +
+close-pending-fork-reverse-bsd1 +
+defer-hangcheck-bsd1 +
+reset-stats-bsd2 +
+reset-stats-ctx-bsd2 +
+ban-bsd2 +
+ban-ctx-bsd2 +
+reset-count-bsd2 +
+reset-count-ctx-bsd2 +
+unrelated-ctx-bsd2 +
+close-pending-bsd2 +
+close-pending-ctx-bsd2 +
+close-pending-fork-bsd2 +
+close-pending-fork-reverse-bsd2 +
+defer-hangcheck-bsd2
reset-stats-blt @@ -2766,131 +4069,233 @@ close-pending-blt
-close-pending-ctx-blt +close-pending-ctx-blt +
+close-pending-fork-blt +
+close-pending-fork-reverse-blt +
+defer-hangcheck-blt +
+reset-stats-vebox +
+reset-stats-ctx-vebox +
+ban-vebox +
+ban-ctx-vebox +
+reset-count-vebox +
+reset-count-ctx-vebox +
+unrelated-ctx-vebox +
+close-pending-vebox +
+close-pending-ctx-vebox +
+close-pending-fork-vebox +
+close-pending-fork-reverse-vebox +
+defer-hangcheck-vebox +
+
+
+
+
+

+gem_ringfill +

+

+

+
+

Subtests

+ + + + + + + + + + + + + + + + + + + + -
+basic-default +
+render +
+bsd +
+bsd1 +
+bsd2 +
+blt +
+vebox +
+basic-default-interruptible +
+render-interruptible +
+bsd-interruptible +
+bsd1-interruptible +
+bsd2-interruptible +
+blt-interruptible +
+vebox-interruptible +
+basic-default-hang +
+render-hang +
+bsd-hang +
+bsd1-hang +
+bsd2-hang
-close-pending-fork-blt +blt-hang
-close-pending-fork-reverse-blt +vebox-hang
-defer-hangcheck-blt +default-child
-params-ctx-bsd +render-child
-reset-stats-bsd +bsd-child
-reset-stats-ctx-bsd +bsd1-child
-ban-bsd +bsd2-child
-ban-ctx-bsd +blt-child
-reset-count-bsd +vebox-child
-reset-count-ctx-bsd +basic-default-forked
-unrelated-ctx-bsd +render-forked
-close-pending-bsd +bsd-forked
-close-pending-ctx-bsd +bsd1-forked
-close-pending-fork-bsd +bsd2-forked
-close-pending-fork-reverse-bsd +blt-forked
-defer-hangcheck-bsd +vebox-forked
-params-ctx-vebox +default-bomb
-reset-stats-vebox +render-bomb
-reset-stats-ctx-vebox +bsd-bomb
-ban-vebox +bsd1-bomb
-ban-ctx-vebox +bsd2-bomb
-reset-count-vebox +blt-bomb
-reset-count-ctx-vebox +vebox-bomb
-unrelated-ctx-vebox +default-S3
-close-pending-vebox +render-S3
-close-pending-ctx-vebox +bsd-S3
-close-pending-fork-vebox +bsd1-S3
-close-pending-fork-reverse-vebox +bsd2-S3
-defer-hangcheck-vebox +blt-S3
-
-
-
-
-

-gem_ringfill -

-

-

-
-

Subtests

-
-blitter +vebox-S3
-render +default-S4
-blitter-interruptible +render-S4
-render-interruptible +bsd-S4
-blitter-forked-1 +bsd1-S4
-render-forked-1 +bsd2-S4
-blitter-forked-4 +blt-S4
-render-forked-4 +vebox-S4
@@ -2904,7 +4309,7 @@ Ensure inter-ring dependencies are respected.

-

Subtests

+

Subtests

sync-render-blitter-write-read @@ -2933,7 +4338,7 @@ gem_ring_sync_loop

-Basic check of ring<->ring sync using a dummy reloc. +Basic check of ring<->ring write synchronisation.


@@ -2954,7 +4359,7 @@ Check for proper synchronization of tiling changes vs. tiled gpu access.

-

Subtests

+

Subtests

untiled-to-tiled @@ -2988,13 +4393,206 @@
+

+gem_shrink +

+

+

+
+

Subtests

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+get-pages-sanitycheck +
+get-pages +
+get-pages-userptr +
+get-pages-oom +
+pwrite-sanitycheck +
+pwrite +
+pwrite-userptr +
+pwrite-oom +
+pread-sanitycheck +
+pread +
+pread-userptr +
+pread-oom +
+mmap-gtt-sanitycheck +
+mmap-gtt +
+mmap-gtt-userptr +
+mmap-gtt-oom +
+mmap-cpu-sanitycheck +
+mmap-cpu +
+mmap-cpu-userptr +
+mmap-cpu-oom +
+execbuf1-sanitycheck +
+execbuf1 +
+execbuf1-userptr +
+execbuf1-oom +
+execbufN-sanitycheck +
+execbufN +
+execbufN-userptr +
+execbufN-oom +
+hang-sanitycheck +
+hang +
+hang-userptr +
+hang-oom +
+
+
+
+
+

+gem_softpin +

+

+

+
+

Subtests

+ + + + + + + + + + + + + +
+invalid +
+softpin +
+overlap +
+noreloc +
+noreloc-interruptible +
+noreloc-S3 +
+noreloc-S4 +
+evict-active +
+evict-snoop +
+evict-active-interruptible +
+evict-snoop-interruptible +
+evict-hang +
+
+
+
+
+

+gem_stolen +

+

+This test verifies the exetended gem_create ioctl, that includes allocation of obj from stolen region +

+
+

Subtests

+ + + + + + + + +
+stolen-clear +
+stolen-no-mmap +
+stolen-pwrite +
+stolen-pread +
+stolen-copy +
+large-object-alloc +
+stolen-fill-purge +
+
+
+
+

gem_storedw_batches_loop

-

Subtests

+

Subtests

normal @@ -3020,13 +4618,13 @@ Basic CS check using MI_STORE_DATA_IMM.

-

Subtests

+

Subtests

+ + + + + +
-basic-bsd +basic-default
-long-bsd +long-default
basic-render @@ -3035,6 +4633,24 @@ long-render
+basic-bsd +
+long-bsd +
+basic-bsd1 +
+long-bsd1 +
+basic-bsd2 +
+long-bsd2 +
basic-blt
@@ -3058,7 +4674,7 @@ Test of streaming writes into active GPU sources

-

Subtests

+

Subtests

cpu-sync @@ -3101,6 +4717,74 @@
+

+gem_sync +

+

+Basic check of ring<->ring write synchronisation. +

+
+

Subtests

+ + + + + + + + + + + + + + + + + + + +
+default +
+forked-default +
+render +
+forked-render +
+bsd +
+forked-bsd +
+bsd1 +
+forked-bsd1 +
+bsd2 +
+forked-bsd2 +
+blt +
+forked-blt +
+vebox +
+forked-vebox +
+basic-each +
+forked-each +
+basic-all +
+forked-all +
+
+
+
+

gem_threaded_access_tiled

@@ -3117,7 +4801,7 @@ Test doing many tiled blits, with a working set larger than the aperture size.

-

Subtests

+

Subtests

basic @@ -3139,7 +4823,7 @@

-

Subtests

+

Subtests

basic @@ -3159,7 +4843,7 @@ Test pwrite/pread consistency when touching partial cachelines.

-

Subtests

+

Subtests

reads @@ -3200,7 +4884,7 @@ Exercise swizzle code for swapping.

-

Subtests

+

Subtests

non-threaded @@ -3263,7 +4947,7 @@

-

Subtests

+

Subtests

+
input-checking @@ -3284,6 +4968,9 @@ forbidden-operations
+relocations +
create-destroy-unsync
@@ -3504,7 +5191,7 @@

-

Subtests

+

Subtests

render_timeout @@ -3526,7 +5213,7 @@

-

Subtests

+

Subtests

read @@ -3549,7 +5236,7 @@ Check read/write syncpoints when switching rings.

-

Subtests

+

Subtests

blt2render @@ -3575,6 +5262,6 @@ +
Generated by GTK-Doc V1.25.1 \ No newline at end of file diff -Nru intel-gpu-tools-1.13/docs/reference/intel-gpu-tools/html/igt-gen3-tests.html intel-gpu-tools-1.15/docs/reference/intel-gpu-tools/html/igt-gen3-tests.html --- intel-gpu-tools-1.13/docs/reference/intel-gpu-tools/html/igt-gen3-tests.html 2015-12-02 16:48:05.000000000 +0000 +++ intel-gpu-tools-1.15/docs/reference/intel-gpu-tools/html/igt-gen3-tests.html 2016-05-31 17:09:21.000000000 +0000 @@ -3,12 +3,12 @@ Gen 3 Tests: intel-gpu-tools Reference Manual - + - + @@ -30,7 +30,7 @@

Programs

-
+
@@ -113,6 +113,6 @@ +
Generated by GTK-Doc V1.25.1 \ No newline at end of file diff -Nru intel-gpu-tools-1.13/docs/reference/intel-gpu-tools/html/igt-kms-tests.html intel-gpu-tools-1.15/docs/reference/intel-gpu-tools/html/igt-kms-tests.html --- intel-gpu-tools-1.13/docs/reference/intel-gpu-tools/html/igt-kms-tests.html 2015-12-02 16:48:05.000000000 +0000 +++ intel-gpu-tools-1.15/docs/reference/intel-gpu-tools/html/igt-kms-tests.html 2016-05-31 17:09:21.000000000 +0000 @@ -3,12 +3,12 @@ KMS Tests: intel-gpu-tools Reference Manual - + - + @@ -30,7 +30,7 @@

Programs

-
+
@@ -56,6 +56,12 @@ + + + + @@ -68,6 +74,12 @@ + + + + @@ -110,7 +122,7 @@ @@ -128,6 +140,12 @@ + + + + @@ -146,6 +164,12 @@ + + + + @@ -285,18 +309,6 @@ bad-pitch-65536 - - - - + + + +
+kms_chv_cursor_fail + 
kms_crtc_background_color  
+kms_cursor_legacy + 
kms_draw_crc  
-kms_force_connector +kms_force_connector_basic  
+kms_mmap_write_crc + 
kms_mmio_vs_cs_flip  
+kms_pipe_color + 
kms_pipe_crc_basic  
-basic-X-tiled -
-framebuffer-vs-set-tiling -
-tile-pitch-mismatch -
-basic-Y-tiled -
size-max
@@ -338,6 +350,18 @@
addfb25-Y-tiled-small
+basic-X-tiled +
+framebuffer-vs-set-tiling +
+tile-pitch-mismatch +
+basic-Y-tiled +
@@ -375,6 +399,128 @@

+

+kms_chv_cursor_fail +

+

+Exercise CHV pipe C cursor fail +

+
+

Subtests

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+pipe-A-64x64-left-edge +
+pipe-A-64x64-right-edge +
+pipe-A-64x64-top-edge +
+pipe-A-64x64-bottom-edge +
+pipe-B-64x64-left-edge +
+pipe-B-64x64-right-edge +
+pipe-B-64x64-top-edge +
+pipe-B-64x64-bottom-edge +
+pipe-C-64x64-left-edge +
+pipe-C-64x64-right-edge +
+pipe-C-64x64-top-edge +
+pipe-C-64x64-bottom-edge +
+pipe-A-128x128-left-edge +
+pipe-A-128x128-right-edge +
+pipe-A-128x128-top-edge +
+pipe-A-128x128-bottom-edge +
+pipe-B-128x128-left-edge +
+pipe-B-128x128-right-edge +
+pipe-B-128x128-top-edge +
+pipe-B-128x128-bottom-edge +
+pipe-C-128x128-left-edge +
+pipe-C-128x128-right-edge +
+pipe-C-128x128-top-edge +
+pipe-C-128x128-bottom-edge +
+pipe-A-256x256-left-edge +
+pipe-A-256x256-right-edge +
+pipe-A-256x256-top-edge +
+pipe-A-256x256-bottom-edge +
+pipe-B-256x256-left-edge +
+pipe-B-256x256-right-edge +
+pipe-B-256x256-top-edge +
+pipe-B-256x256-bottom-edge +
+pipe-C-256x256-left-edge +
+pipe-C-256x256-right-edge +
+pipe-C-256x256-top-edge +
+pipe-C-256x256-bottom-edge +
+
+
+
+

kms_crtc_background_color

@@ -391,7 +537,7 @@ Use the display CRC support to validate cursor plane functionality. The test will position the cursor plane either fully onscreen, partially onscreen, or fully offscreen, using either a fully opaque or fully transparent surface. In each case it then reads the PF CRC and compares it with the CRC value obtained when the cursor plane was disabled.

-

Subtests

+

Subtests

cursor-size-change @@ -533,13 +679,27 @@
+

+kms_cursor_legacy +

+

+Stress legacy cursor ioctl +

+
+

Subtests

+

This test has over 100 subtests. +Run kms_cursor_legacy --list-subtests to list them.

+
+
+
+

kms_draw_crc

-

Subtests

+

Subtests

draw-method-xrgb8888-mmap-cpu-untiled @@ -664,7 +824,7 @@ Performs various write operations to the scanout buffer while FBC is enabled. CRC checks will be used to make sure the modifications to scanout buffer are detected.

-

Subtests

+

Subtests

page_flip @@ -711,7 +871,7 @@ Test the relationship between fbcon and the frontbuffer tracking infrastructure.

-

Subtests

+

Subtests

fbc @@ -745,7 +905,7 @@

-

Subtests

+

Subtests

This test has over 100 subtests. Run kms_flip --list-subtests to list them.

@@ -768,7 +928,7 @@ Test page flips and tiling scenarios

-

Subtests

+

Subtests

flip-changes-tiling @@ -802,21 +962,27 @@
-

-kms_force_connector +

+kms_force_connector_basic

Check the debugfs force connector/edid features work correctly.

-

Subtests

+

Subtests

+ +
+force-load-detect +
force-connector-state
force-edid
+prune-stale-modes +
@@ -829,7 +995,7 @@ Test the Kernel's frontbuffer tracking mechanism and its related features: FBC and PSR

-

Subtests

+

Subtests

This test has over 100 subtests. Run kms_frontbuffer_tracking --list-subtests to list them.

@@ -845,13 +1011,22 @@
+

+kms_mmap_write_crc +

+

+Use the display CRC support to validate mmap write to an already uncached future scanout buffer. +

+
+
+

kms_mmio_vs_cs_flip

-

Subtests

+

Subtests

setplane_vs_cs_flip @@ -880,7 +1055,7 @@ Exercise the FDI lane bifurcation code for IVB in the kernel by settingdifferent combinations of modes for pipes B and C.

-

Subtests

+

Subtests

pipe-B-dpms-off-modeset-pipe-C @@ -902,13 +1077,141 @@
+

+kms_pipe_color +

+

+Test Color Features at Pipe level +

+
+

Subtests

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ctm-red-to-blue-pipe0 +
+ctm-green-to-red-pipe0 +
+ctm-blue-to-red-pipe0 +
+ctm-0-25-pipe0 +
+ctm-0-5-pipe0 +
+ctm-0-75-pipe0 +
+ctm-max-pipe0 +
+ctm-negative-pipe0 +
+degamma-pipe0 +
+gamma-pipe0 +
+legacy-gamma-pipe0 +
+legacy-gamma-reset-pipe0 +
+ctm-red-to-blue-pipe1 +
+ctm-green-to-red-pipe1 +
+ctm-blue-to-red-pipe1 +
+ctm-0-25-pipe1 +
+ctm-0-5-pipe1 +
+ctm-0-75-pipe1 +
+ctm-max-pipe1 +
+ctm-negative-pipe1 +
+degamma-pipe1 +
+gamma-pipe1 +
+legacy-gamma-pipe1 +
+legacy-gamma-reset-pipe1 +
+ctm-red-to-blue-pipe2 +
+ctm-green-to-red-pipe2 +
+ctm-blue-to-red-pipe2 +
+ctm-0-25-pipe2 +
+ctm-0-5-pipe2 +
+ctm-0-75-pipe2 +
+ctm-max-pipe2 +
+ctm-negative-pipe2 +
+degamma-pipe2 +
+gamma-pipe2 +
+legacy-gamma-pipe2 +
+legacy-gamma-reset-pipe2 +
+invalid-lut-sizes +
+invalid-ctm-matrix-sizes +
+
+
+
+

kms_pipe_crc_basic

-

Subtests

+

Subtests

+ + + + + +
bad-pipe @@ -929,6 +1232,12 @@ read-crc-pipe-A-frame-sequence
+nonblocking-crc-pipe-A +
+nonblocking-crc-pipe-A-frame-sequence +
suspend-read-crc-pipe-A
@@ -941,6 +1250,12 @@ read-crc-pipe-B-frame-sequence
+nonblocking-crc-pipe-B +
+nonblocking-crc-pipe-B-frame-sequence +
suspend-read-crc-pipe-B
@@ -953,6 +1268,12 @@ read-crc-pipe-C-frame-sequence
+nonblocking-crc-pipe-C +
+nonblocking-crc-pipe-C-frame-sequence +
suspend-read-crc-pipe-C
@@ -969,7 +1290,7 @@

-

Subtests

+

Subtests

plane-position-covered-pipe-A-plane-1 @@ -1153,9 +1474,12 @@

-

Subtests

+

Subtests

+ + +
+psr_basic +
primary_page_flip
@@ -1221,6 +1545,12 @@
dpms_off_psr_exit
+suspend_psr_active +
+suspend_psr_exit +
@@ -1241,7 +1571,7 @@

-

Subtests

+

Subtests

direct-render @@ -1260,7 +1590,7 @@

-

Subtests

+

Subtests

primary-rotation-180 @@ -1312,7 +1642,7 @@

-

Subtests

+

Subtests

+
basic-clone-single-crtc @@ -1326,6 +1656,9 @@
clone-exclusive-crtc
+invalid-clone-single-crtc-stealing +
@@ -1354,7 +1687,7 @@

-

Subtests

+

Subtests

- +igt_stats_fini(&stats);
universal-plane-pipe-A-functional @@ -1413,7 +1746,7 @@ Test speed of WaitVblank.

-

Subtests

+

Subtests

accuracy @@ -1436,6 +1769,6 @@ +
Generated by GTK-Doc V1.25.1 \ No newline at end of file diff -Nru intel-gpu-tools-1.13/docs/reference/intel-gpu-tools/html/igt-pm-tests.html intel-gpu-tools-1.15/docs/reference/intel-gpu-tools/html/igt-pm-tests.html --- intel-gpu-tools-1.13/docs/reference/intel-gpu-tools/html/igt-pm-tests.html 2015-12-02 16:48:05.000000000 +0000 +++ intel-gpu-tools-1.15/docs/reference/intel-gpu-tools/html/igt-pm-tests.html 2016-05-31 17:09:21.000000000 +0000 @@ -3,12 +3,12 @@ PM Tests: intel-gpu-tools Reference Manual - + - + @@ -30,7 +30,7 @@

Programs

-
+
@@ -338,6 +338,6 @@ +
Generated by GTK-Doc V1.25.1 \ No newline at end of file diff -Nru intel-gpu-tools-1.13/docs/reference/intel-gpu-tools/html/igt-prime-tests.html intel-gpu-tools-1.15/docs/reference/intel-gpu-tools/html/igt-prime-tests.html --- intel-gpu-tools-1.13/docs/reference/intel-gpu-tools/html/igt-prime-tests.html 2015-12-02 16:48:05.000000000 +0000 +++ intel-gpu-tools-1.15/docs/reference/intel-gpu-tools/html/igt-prime-tests.html 2016-05-31 17:09:21.000000000 +0000 @@ -3,12 +3,12 @@ Prime Tests: intel-gpu-tools Reference Manual - + - + @@ -30,7 +30,7 @@

Programs

-
+
@@ -38,6 +38,24 @@ + + + + + + + + + + + + @@ -72,13 +90,106 @@

Description

+

+prime_mmap +

+

+

+
+

Subtests

+
+prime_mmap + 
+prime_mmap_coherency + 
+prime_mmap_kms + 
prime_nv_api  
+ + + + + + + + + + + + +
+test_correct +
+test_map_unmap +
+test_reprime +
+test_forked +
+test_correct_cpu_write +
+test_forked_cpu_write +
+test_refcounting +
+test_dup +
+test_userptr +
+test_errors +
+test_invalid_sync_flags +
+test_aperture_limit +
+
+
+
+
+

+prime_mmap_coherency +

+

+Test dma-buf mmap on !llc platforms mostly and provoke coherency bugs so we know for sure where we need the sync ioctls. +

+
+

Subtests

+ + + + + + +
+read +
+read-and-fail +
+write +
+write-and-fail +
+ioctl-errors +
+
+
+
+
+

+prime_mmap_kms +

+

+Efficiently sharing CPU and GPU buffers +

+
+

Subtests

+
+buffer-sharing +
+
+
+
+

prime_nv_api

-

Subtests

+

Subtests

i915_nv_import_twice @@ -127,7 +238,7 @@

-

Subtests

+

Subtests

test1_macro @@ -167,7 +278,7 @@

-

Subtests

+

Subtests

i915_nv_sharing @@ -202,10 +313,10 @@ prime_self_import

-Check whether prime import/export works on the same device. +Check whether prime import/export works on the same device... but with different fds.

-

Subtests

+

Subtests

basic-with_one_bo @@ -245,6 +356,6 @@ +
Generated by GTK-Doc V1.25.1 \ No newline at end of file diff -Nru intel-gpu-tools-1.13/docs/reference/intel-gpu-tools/html/igt-sysfs-tests.html intel-gpu-tools-1.15/docs/reference/intel-gpu-tools/html/igt-sysfs-tests.html --- intel-gpu-tools-1.13/docs/reference/intel-gpu-tools/html/igt-sysfs-tests.html 2015-12-02 16:48:05.000000000 +0000 +++ intel-gpu-tools-1.15/docs/reference/intel-gpu-tools/html/igt-sysfs-tests.html 2016-05-31 17:09:21.000000000 +0000 @@ -3,12 +3,12 @@ Sysfs Tests: intel-gpu-tools Reference Manual - + - + @@ -30,7 +30,7 @@

Programs

-
+
@@ -56,6 +56,6 @@ +
Generated by GTK-Doc V1.25.1 \ No newline at end of file diff -Nru intel-gpu-tools-1.13/docs/reference/intel-gpu-tools/html/igt-test-programs-common-features.html intel-gpu-tools-1.15/docs/reference/intel-gpu-tools/html/igt-test-programs-common-features.html --- intel-gpu-tools-1.13/docs/reference/intel-gpu-tools/html/igt-test-programs-common-features.html 2015-12-02 16:48:05.000000000 +0000 +++ intel-gpu-tools-1.15/docs/reference/intel-gpu-tools/html/igt-test-programs-common-features.html 2016-05-31 17:09:21.000000000 +0000 @@ -3,12 +3,12 @@ Common Features: intel-gpu-tools Reference Manual - + - + @@ -83,7 +83,7 @@ The following exit status codes are defined:

-
+
@@ -124,6 +124,6 @@ +
Generated by GTK-Doc V1.25.1 \ No newline at end of file diff -Nru intel-gpu-tools-1.13/docs/reference/intel-gpu-tools/html/index.html intel-gpu-tools-1.15/docs/reference/intel-gpu-tools/html/index.html --- intel-gpu-tools-1.13/docs/reference/intel-gpu-tools/html/index.html 2015-12-02 16:48:05.000000000 +0000 +++ intel-gpu-tools-1.15/docs/reference/intel-gpu-tools/html/index.html 2016-05-31 17:09:21.000000000 +0000 @@ -3,10 +3,10 @@ intel-gpu-tools Reference Manual: intel-gpu-tools Reference Manual - + - + @@ -15,7 +15,7 @@

- for intel-gpu-tools 1.13 + for intel-gpu-tools 1.15 .

@@ -52,6 +52,9 @@ GT — GT support library
+Power Management — Power Management related helpers +
+
ioctl wrappers — ioctl wrappers and related functions
@@ -107,6 +110,6 @@ +
Generated by GTK-Doc V1.25.1 \ No newline at end of file diff -Nru intel-gpu-tools-1.13/docs/reference/intel-gpu-tools/html/intel-gpu-tools-aux.html intel-gpu-tools-1.15/docs/reference/intel-gpu-tools/html/intel-gpu-tools-aux.html --- intel-gpu-tools-1.13/docs/reference/intel-gpu-tools/html/intel-gpu-tools-aux.html 2015-12-02 16:48:05.000000000 +0000 +++ intel-gpu-tools-1.15/docs/reference/intel-gpu-tools/html/intel-gpu-tools-aux.html 2016-05-31 17:09:21.000000000 +0000 @@ -3,12 +3,12 @@ aux: intel-gpu-tools Reference Manual - + - + @@ -33,7 +33,7 @@

Functions

-
+
@@ -60,6 +60,34 @@ void + + + + + + + + + + + + + + + + @@ -231,6 +259,14 @@ + + + + - +
+igt_fork_hang_detector () +
+void + +igt_stop_hang_detector () +
#define +igt_while_interruptible() +
#define +igt_until_timeout() +
+void + igt_exchange_int ()
+void + +intel_require_files () +
#define min() @@ -291,7 +327,7 @@

Types and Values

-
+
@@ -306,6 +342,10 @@ + + + + @@ -337,13 +377,16 @@
void
 igt_fork_signal_helper (void);

Fork a child process using igt_fork_helper to interrupt the parent process -with a SIGUSR1 signal at regular quick intervals. The corresponding dummy +with a SIGCONT signal at regular quick intervals. The corresponding dummy signal handler is installed in the parent process.

This is useful to exercise ioctl error paths, at least where those can be exercises by interrupting blocking waits, like stalling for the gpu. This helper can also be used from children spawned with igt_fork.

In tests with subtests this function can be called outside of failure catching code blocks like igt_fixture or igt_subtest.

+

Note that this just spews signals at the current process unconditionally and +hence incurs quite a bit of overhead. For a more focused approach, with less +overhead, look at the igt_while_interruptible code block macro.


@@ -356,6 +399,74 @@

+

igt_fork_hang_detector ()

+
void
+igt_fork_hang_detector (int fd);
+
+
+
+

igt_stop_hang_detector ()

+
void
+igt_stop_hang_detector (void);
+
+
+
+

igt_while_interruptible()

+
#define             igt_while_interruptible(enable)
+

Provides control flow such that all drmIoctl() (strictly igt_ioctl()) +within the loop are forcibly injected with signals (SIGRTMIN).

+

This is useful to exercise ioctl error paths, at least where those can be +exercises by interrupting blocking waits, like stalling for the gpu.

+

The code block attached to this macro is run in a loop with doubling the +interrupt timeout on each ioctl for every run, until no ioctl gets +interrupted any more. The starting timeout is taken to be the signal delivery +latency, measured at runtime. This way the any ioctls called from this code +block should be exhaustively tested for all signal interruption paths.

+

Note that since this overloads the igt_ioctl(), this method is not useful +for widespread signal injection, for example providing coverage of +pagefaults. To interrupt everything, see igt_fork_signal_helper().

+
+

Parameters

+
num_trash_bos
struct_igt_sigiter
enum igt_runtime_pm_status
+++++ + + + + + +

enable

enable igt_ioctl interrupting or not

 
+
+ +
+
+

igt_until_timeout()

+
#define             igt_until_timeout(timeout)
+

Convenience macro loop to run the provided code block in a loop until the +timeout has expired. Of course when an individual execution takes too long, +the actual execution time could be a lot longer.

+

The code block will be executed at least once.

+
+

Parameters

+
+++++ + + + + + +

timeout

timeout in seconds

 
+
+
+
+

igt_exchange_int ()

void
 igt_exchange_int (void *array,
@@ -366,8 +477,8 @@
 . Useful as an exchange
 function for igt_permute_array().

-

Parameters

-
+

Parameters

+
@@ -405,8 +516,8 @@ function is called to exchange two elements in the array when needed.

-

Parameters

-
+

Parameters

+
@@ -444,8 +555,8 @@ automated runs the progress indicator is suppressed when not running on a terminal.

-

Parameters

-
+

Parameters

+
@@ -487,8 +598,8 @@ bool default_value);

This function should be used to parse boolean environment variable options.

-

Parameters

-
+

Parameters

+
@@ -509,7 +620,7 @@
-

Returns

+

Returns

The boolean value of the environment variable env_var as decoded by atoi() if it is set and default_value @@ -522,7 +633,7 @@

bool
 igt_aub_dump_enabled (void);
-

Returns

+

Returns

True if AUB dumping is enabled with IGT_DUMP_AUB=1 in the environment, false otherwise.

@@ -536,8 +647,8 @@ , which can then be run with igt_trash_aperture().

-

Parameters

-
+

Parameters

+
@@ -608,8 +719,8 @@ inspection of the display is useful. Or when running a testcase in the background.

-

Parameters

-
+

Parameters

+
@@ -642,8 +753,8 @@ user isn't seeing what was expected.

Force test fail when N/n is pressed.

-

Parameters

-
+

Parameters

+
@@ -672,7 +783,7 @@

Sets up the runtime PM helper functions and enables runtime PM. To speed up tests the autosuspend delay is set to 0.

-

Returns

+

Returns

True if runtime pm is available, false otherwise.

@@ -682,7 +793,7 @@
enum igt_runtime_pm_status
 igt_get_runtime_pm_status (void);
-

Returns

+

Returns

The current runtime PM status.

@@ -694,8 +805,8 @@

Waits until for the driver to switch to into the desired runtime PM status, with a 10 second timeout.

-

Parameters

-
+

Parameters

+
@@ -709,7 +820,7 @@
-

Returns

+

Returns

True if the desired runtime PM status was attained, false if the operation timed out.

@@ -726,7 +837,7 @@
uint64_t
 intel_get_avail_ram_mb (void);
-

Returns

+

Returns

The amount of unused system RAM available in MB.

@@ -736,7 +847,7 @@
uint64_t
 intel_get_total_ram_mb (void);
-

Returns

+

Returns

The total amount of system RAM available in MB.

@@ -746,7 +857,7 @@
uint64_t
 intel_get_total_swap_mb (void);
-

Returns

+

Returns

The total amount of swap space available in MB.

@@ -754,7 +865,7 @@

intel_require_memory ()

void
-intel_require_memory (uint32_t count,
+intel_require_memory (uint64_t count,
                       uint64_t size,
                       unsigned  mode);

Computes the total amount of memory required to allocate count @@ -775,8 +886,8 @@ assumption that any test that needs to check for memory requirements is a thrashing test unsuitable for slow simulated systems.

-

Parameters

-
+

Parameters

+
@@ -804,6 +915,28 @@
+

intel_require_files ()

+
void
+intel_require_files (uint64_t count);
+

Does the system support enough file descriptors for the test?

+
+

Parameters

+
+++++ + + + + + +

count

number of files that will be created

 
+
+
+
+

min()

#define             min(a, b)
@@ -827,8 +960,8 @@ previously locked memory.

Use igt_unlock_mem to release the currently locked memory.

-

Parameters

-
+

Parameters

+
@@ -858,8 +991,8 @@ problem is that the usleep() calls will return early, making us evaluate COND too often, possibly eating valuable CPU cycles.

-

Parameters

-
+

Parameters

+
@@ -885,7 +1018,7 @@
-

Returns

+

Returns

True of COND evaluated to true, false otherwise.

@@ -901,8 +1034,8 @@

Please consider using igt_set_module_param_int() for the integer and bool parameters.

-

Parameters

-
+

Parameters

+
@@ -932,8 +1065,8 @@

This is a wrapper for igt_set_module_param() that takes an integer instead of a string. Please see igt_set_module_param().

-

Parameters

-
+

Parameters

+
@@ -970,10 +1103,18 @@
+

struct _igt_sigiter

+
struct _igt_sigiter {
+	unsigned pass;
+};
+
+
+
+

enum igt_runtime_pm_status

-

Members

-
+

Members

+
@@ -1024,6 +1165,6 @@ +
Generated by GTK-Doc V1.25.1 \ No newline at end of file diff -Nru intel-gpu-tools-1.13/docs/reference/intel-gpu-tools/html/intel-gpu-tools-Batch-Buffer.html intel-gpu-tools-1.15/docs/reference/intel-gpu-tools/html/intel-gpu-tools-Batch-Buffer.html --- intel-gpu-tools-1.13/docs/reference/intel-gpu-tools/html/intel-gpu-tools-Batch-Buffer.html 2015-12-02 16:48:05.000000000 +0000 +++ intel-gpu-tools-1.15/docs/reference/intel-gpu-tools/html/intel-gpu-tools-Batch-Buffer.html 2016-05-31 17:09:21.000000000 +0000 @@ -3,12 +3,12 @@ Batch Buffer: intel-gpu-tools Reference Manual - + - + @@ -33,7 +33,7 @@

Functions

-
+
@@ -282,7 +282,7 @@

Types and Values

-
+
@@ -344,8 +344,8 @@ must be supplied since libdrm doesn't expose it directly.

-

Parameters

-
+

Parameters

+
@@ -366,7 +366,7 @@
-

Returns

+

Returns

The allocated and initialized batchbuffer object.

@@ -385,8 +385,8 @@

Releases all resource of the batchbuffer object batch .

-

Parameters

-
+

Parameters

+
@@ -408,8 +408,8 @@

Submits the batch for execution on the blitter engine, selecting the right ring depending upon the hardware platform.

-

Parameters

-
+

Parameters

+
@@ -432,8 +432,8 @@

Submits the batch for execution on ring .

-

Parameters

-
+

Parameters

+
@@ -463,8 +463,8 @@

Submits the batch for execution on the render engine with the supplied hardware context.

-

Parameters

-
+

Parameters

+
@@ -493,8 +493,8 @@

Resets batch by allocating a new gem buffer object as backing storage.

-

Parameters

-
+

Parameters

+
@@ -519,8 +519,8 @@ into the batchbuffer. Note that the length must be DWORD aligned, i.e. multiples of 32bits.

-

Parameters

-
+

Parameters

+
@@ -567,8 +567,8 @@ is actually tiled.

This is the only way buffers get added to the validate list.

-

Parameters

-
+

Parameters

+
@@ -640,8 +640,8 @@

This macro needs a pointer to an intel_batchbuffer structure called batch in scope.

-

Parameters

-
+

Parameters

+
@@ -672,8 +672,8 @@

This macro needs a pointer to an intel_batchbuffer structure called batch in scope.

-

Parameters

-
+

Parameters

+
@@ -695,8 +695,8 @@

This macro needs a pointer to an intel_batchbuffer structure called batch in scope.

-

Parameters

-
+

Parameters

+
@@ -736,8 +736,8 @@

This macro needs a pointer to an intel_batchbuffer structure called batch in scope.

-

Parameters

-
+

Parameters

+
@@ -806,8 +806,8 @@

This emits a 2D copy operation using blitter commands into the supplied batch buffer object.

-

Parameters

-
+

Parameters

+
@@ -896,8 +896,8 @@ . Note that size must be page-aligned.

-

Parameters

-
+

Parameters

+
@@ -935,8 +935,8 @@ igt_buf_width (struct igt_buf *buf);

Computes the width in 32-bit pixels of the given buffer.

-

Parameters

-
+

Parameters

+
@@ -950,7 +950,7 @@
-

Returns

+

Returns

The width of the buffer.

@@ -961,8 +961,8 @@ igt_buf_height (struct igt_buf *buf);

Computes the height in 32-bit pixels of the given buffer.

-

Parameters

-
+

Parameters

+
@@ -976,7 +976,7 @@
-

Returns

+

Returns

The height of the buffer.

@@ -998,8 +998,8 @@ using the gen9 fast copy blitter command.

The source and destination surfaces cannot overlap.

-

Parameters

-
+

Parameters

+
@@ -1074,8 +1074,8 @@ unsigned dst_y);

Like igt_blitter_fast_copy(), but talking to the kernel directly.

-

Parameters

-
+

Parameters

+
@@ -1173,8 +1173,8 @@ is optional and can be NULL.

-

Parameters

-
+

Parameters

+
@@ -1241,8 +1241,8 @@
igt_render_copyfunc_t
 igt_get_render_copyfunc (int devid);
-

Parameters

-
+

Parameters

+
@@ -1256,7 +1256,7 @@
-

Returns

+

Returns

The platform-specific render copy function pointer for the device specified with devid . Will return NULL when no render copy function is @@ -1280,8 +1280,8 @@

A fill function will emit a batchbuffer to the kernel which executes the specified blit fill operation using the media/gpgpu engine.

-

Parameters

-
+

Parameters

+
@@ -1333,8 +1333,8 @@
igt_fillfunc_t
 igt_get_media_fillfunc (int devid);
-

Parameters

-
+

Parameters

+
@@ -1348,7 +1348,7 @@
-

Returns

+

Returns

The platform-specific media fill function pointer for the device specified with devid . Will return NULL when no media fill function is implemented.

@@ -1360,8 +1360,8 @@
igt_fillfunc_t
 igt_get_gpgpu_fillfunc (int devid);
-

Parameters

-
+

Parameters

+
@@ -1375,7 +1375,7 @@
-

Returns

+

Returns

The platform-specific gpgpu fill function pointer for the device specified with devid . Will return NULL when no gpgpu fill function is implemented.

@@ -1398,8 +1398,8 @@ destination buffer on completion. This utility provides a simple way to keep the render engine busy for a set time for various tests.

-

Parameters

-
+

Parameters

+
@@ -1431,8 +1431,8 @@
igt_media_spinfunc_t
 igt_get_media_spinfunc (int devid);
-

Parameters

-
+

Parameters

+
@@ -1446,7 +1446,7 @@
-

Returns

+

Returns

The platform-specific media spin function pointer for the device specified with devid . Will return NULL when no media spin function is implemented.

@@ -1510,8 +1510,8 @@ libdrm buffer object with suitable data needed by the render copy and the fill functions.

-

Members

-
+

Members

+
@@ -1550,6 +1550,6 @@ +
Generated by GTK-Doc V1.25.1 \ No newline at end of file diff -Nru intel-gpu-tools-1.13/docs/reference/intel-gpu-tools/html/intel-gpu-tools-Chipset.html intel-gpu-tools-1.15/docs/reference/intel-gpu-tools/html/intel-gpu-tools-Chipset.html --- intel-gpu-tools-1.13/docs/reference/intel-gpu-tools/html/intel-gpu-tools-Chipset.html 2015-12-02 16:48:05.000000000 +0000 +++ intel-gpu-tools-1.15/docs/reference/intel-gpu-tools/html/intel-gpu-tools-Chipset.html 2016-05-31 17:09:21.000000000 +0000 @@ -3,12 +3,12 @@ Chipset: intel-gpu-tools Reference Manual - + - + @@ -33,7 +33,7 @@

Functions

-
+
@@ -301,12 +301,6 @@ - - - - @@ -351,7 +345,7 @@

Types and Values

-
#define -IS_9XX() -
#define IS_INTEL()
+
@@ -395,7 +389,7 @@ intel_get_pci_device (void);

Looks up the main graphics pci device using libpciaccess.

-

Returns

+

Returns

The pci_device, exits the program on any failures.

@@ -407,8 +401,8 @@

Queries the kernel for the pci device id corresponding to the drm file descriptor.

-

Parameters

-
+

Parameters

+
@@ -422,7 +416,7 @@
-

Returns

+

Returns

The devid, exits the program on any failures.

@@ -433,8 +427,8 @@ intel_gen (uint32_t devid);

Computes the Intel GFX generation for the give device id.

-

Parameters

-
+

Parameters

+
@@ -448,7 +442,7 @@
-

Returns

+

Returns

The GFX generation on successful lookup, -1 on failure.

@@ -658,11 +652,6 @@

-

IS_9XX()

-
#define             IS_9XX(devid)
-
-
-

IS_INTEL()

#define             IS_INTEL(devid)
@@ -703,8 +692,8 @@

enum pch_type

-

Members

-
+

Members

+
@@ -756,6 +745,6 @@ +
Generated by GTK-Doc V1.25.1 \ No newline at end of file diff -Nru intel-gpu-tools-1.13/docs/reference/intel-gpu-tools/html/intel-gpu-tools-Core.html intel-gpu-tools-1.15/docs/reference/intel-gpu-tools/html/intel-gpu-tools-Core.html --- intel-gpu-tools-1.13/docs/reference/intel-gpu-tools/html/intel-gpu-tools-Core.html 2015-12-02 16:48:05.000000000 +0000 +++ intel-gpu-tools-1.15/docs/reference/intel-gpu-tools/html/intel-gpu-tools-Core.html 2016-05-31 17:09:21.000000000 +0000 @@ -3,12 +3,12 @@ Core: intel-gpu-tools Reference Manual - + - + @@ -33,7 +33,7 @@

Functions

-
+
@@ -309,6 +309,14 @@ + + + + - - - - - - - - @@ -463,7 +455,7 @@

Types and Values

-
+void + +igt_waitchildren_timeout () +
#define igt_fork_helper() @@ -348,22 +356,6 @@
-void - -igt_enable_exit_handler () -
-void - -igt_disable_exit_handler () -
bool @@ -446,10 +438,10 @@
-void +uint64_t -igt_reset_timeout () +igt_nsec_elapsed ()
+
@@ -495,6 +487,10 @@ + + + + @@ -539,7 +535,9 @@ or opening device driver nodes).

To allow this i-g-t provides igt_fixture code blocks for setup code outside of subtests and automatically skips the subtest code blocks themselves. For -special cases igt_only_list_subtests() is also provided.

+special cases igt_only_list_subtests() is also provided. For setup code only +shared by a group of subtest encapsulate the igt_fixture block and all the +subtestest in a igt_subtest_group block.

Magic Control Blocks

i-g-t makes heavy use of C macros which serve as magic control blocks. They @@ -646,6 +644,19 @@ intel gpu to be present). Then individual subtests can be run with "--run-subtest". Usage help for tests with subtests can be obtained with the "--help" command line option.

+

A wildcard expression can be given to --run-subtest to specify a subset of +subtests to run. See https://tools.ietf.org/html/rfc3977section-4 for a +description of allowed wildcard expressions. +Some examples of allowed wildcard expressions are:

+
    +
  • '*basic*' match any subtest containing basic

  • +
  • 'basic-???' match any subtest named basic- with 3 characters after -

  • +
  • 'basic-[0-9]' match any subtest named basic- with a single number after -

  • +
  • 'basic-[^0-9]' match any subtest named basic- with a single non numerical character after -

  • +
  • 'basic*,advanced*' match any subtest starting basic or advanced

  • +
  • '*,!basic*' match any subtest not starting basic

  • +
  • 'basic*,!basic-render*' match any subtest starting basic but not starting basic-render

  • +
@@ -658,8 +669,8 @@ "--help-description" option and is also included in the generated documentation.

-

Parameters

-
#defineigt_subtest_group
#define igt_main
+

Parameters

+
@@ -698,7 +709,7 @@ igt_subtest_init_parse_opts (int *argc, char **argv, const char *extra_short_opts, - struct option *extra_long_opts, + const struct option *extra_long_opts, const char *help_str, igt_opt_handler_t extra_opt_handler, void *handler_data); @@ -709,8 +720,8 @@

Tests without special needs should just use igt_subtest_init() or use igt_main directly instead of their own main() function.

-

Parameters

-
+

Parameters

+
@@ -757,7 +768,7 @@
-

Returns

+

Returns

Forwards any option parsing errors from getopt_long.

@@ -772,8 +783,8 @@ igt_main block instead of stitching the test's main() function together manually.

-

Parameters

-
+

Parameters

+
@@ -802,8 +813,8 @@

C preprocessor helper to concatenate two variables while properly expanding them.

-

Parameters

-
+

Parameters

+
@@ -834,8 +845,8 @@ combinatorial tests.

This is a simpler version of igt_subtest_f()

-

Parameters

-
+

Parameters

+
@@ -860,8 +871,8 @@

Like igt_subtest(), but also accepts a printf format string instead of a static string.

-

Parameters

-
+

Parameters

+
@@ -881,7 +892,7 @@
const char *
 igt_subtest_name (void);
-

Returns

+

Returns

The name of the currently executed subtest or NULL if called from outside a subtest block.

@@ -892,7 +903,7 @@
bool
 igt_only_list_subtests (void);
-

Returns

+

Returns

Returns true if only subtest should be listed and any setup code must be skipped, false otherwise.

@@ -904,15 +915,15 @@ igt_simple_init_parse_opts (int *argc, char **argv, const char *extra_short_opts, - struct option *extra_long_opts, + const struct option *extra_long_opts, const char *help_str, igt_opt_handler_t extra_opt_handler, void *handler_data);

This initializes a simple test without any support for subtests and allows an arbitrary set of additional options.

-

Parameters

-
+

Parameters

+
@@ -968,8 +979,8 @@ igt_simple_main block instead of stitching the test's main() function together manually.

-

Parameters

-
+

Parameters

+
@@ -1003,8 +1014,8 @@ failed).

For normal tests without subtest it will directly exit.

-

Parameters

-
+

Parameters

+
@@ -1053,8 +1064,8 @@

For normal tests without subtest it will directly exit with the given exitcode.

-

Parameters

-
+

Parameters

+
@@ -1089,8 +1100,8 @@

Fails (sub-)test if the condition is not met.

Should be used everywhere where a test checks results.

-

Parameters

-
+

Parameters

+
@@ -1113,8 +1124,8 @@

In addition to the plain igt_assert() helper this allows to print additional information to help debugging test failures.

-

Parameters

-
+

Parameters

+
@@ -1143,8 +1154,8 @@

Fails (sub-)test if the condition is met.

Should be used everywhere where a test checks results.

-

Parameters

-
+

Parameters

+
@@ -1168,8 +1179,8 @@

In addition to the plain igt_assert() helper this allows to print additional information to help debugging test failures.

-

Parameters

-
+

Parameters

+
@@ -1199,8 +1210,8 @@

Like igt_assert(), but displays the values being compared on failure instead of simply printing the stringified expression.

-

Parameters

-
+

Parameters

+
@@ -1238,8 +1249,8 @@
#define             igt_assert_cmpuint(n1, cmp, ncmp, n2)

Like igt_assert_cmpint(), but for unsigned ints.

-

Parameters

-
+

Parameters

+
@@ -1277,8 +1288,8 @@
#define             igt_assert_cmpu64(n1, cmp, ncmp, n2)

Like igt_assert_cmpuint(), but for larger ints.

-

Parameters

-
+

Parameters

+
@@ -1316,8 +1327,8 @@
#define             igt_assert_cmpdouble(n1, cmp, ncmp, n2)

Like igt_assert_cmpint(), but for doubles.

-

Parameters

-
+

Parameters

+
@@ -1359,8 +1370,8 @@

Like igt_assert(), but displays the values being compared on failure instead of simply printing the stringified expression.

-

Parameters

-
+

Parameters

+
@@ -1388,8 +1399,8 @@

Like igt_assert_eq(), but for uint32_t.

-

Parameters

-
+

Parameters

+
@@ -1417,8 +1428,8 @@

Like igt_assert_eq_u32(), but for uint64_t.

-

Parameters

-
+

Parameters

+
@@ -1446,8 +1457,8 @@

Like igt_assert_eq(), but for doubles.

-

Parameters

-
+

Parameters

+
@@ -1478,8 +1489,8 @@

Like igt_assert(), but displays the values being compared on failure instead of simply printing the stringified expression.

-

Parameters

-
+

Parameters

+
@@ -1507,8 +1518,8 @@

Like igt_assert_neq(), but for uint32_t.

-

Parameters

-
+

Parameters

+
@@ -1536,8 +1547,8 @@

Like igt_assert_neq_u32(), but for uint64_t.

-

Parameters

-
+

Parameters

+
@@ -1565,8 +1576,8 @@

Like igt_assert_neq(), but for doubles.

-

Parameters

-
+

Parameters

+
@@ -1597,8 +1608,8 @@

Like igt_assert(), but displays the values being compared on failure instead of simply printing the stringified expression.

-

Parameters

-
+

Parameters

+
@@ -1629,8 +1640,8 @@

Like igt_assert(), but displays the values being compared on failure instead of simply printing the stringified expression.

-

Parameters

-
+

Parameters

+
@@ -1659,8 +1670,8 @@

Like igt_assert(), but displays the values being compared on failure instead of simply printing the stringified expression.

-

Parameters

-
+

Parameters

+
@@ -1683,8 +1694,8 @@ skipping. This is useful to streamline the skip logic since it allows for a more flat code control flow, similar to igt_assert()

-

Parameters

-
+

Parameters

+
@@ -1707,8 +1718,8 @@ skipping. This is useful to streamline the skip logic since it allows for a more flat code control flow, similar to igt_assert()

-

Parameters

-
+

Parameters

+
@@ -1733,8 +1744,8 @@

In addition to the plain igt_require() helper this allows to print additional information to help debugging test failures.

-

Parameters

-
+

Parameters

+
@@ -1766,8 +1777,8 @@

In addition to the plain igt_skip_on() helper this allows to print additional information to help debugging test failures.

-

Parameters

-
+

Parameters

+
@@ -1800,8 +1811,8 @@

Note that igt_skip() will not be forwarded, feature tests need to be done before spawning threads with igt_fork().

-

Parameters

-
+

Parameters

+
@@ -1837,6 +1848,38 @@
+

igt_waitchildren_timeout ()

+
void
+igt_waitchildren_timeout (int seconds,
+                          const char *reason);
+

Wait for all children forked with igt_fork, for a maximum of seconds +.

+

Wraps igt_waitchildren() and igt_set_timeout()

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

seconds

timeout in seconds to wait

 

reason

debug string explaining what timedout

 
+
+
+
+

igt_fork_helper()

#define             igt_fork_helper(proc)

This is a magic control flow block which denotes an asynchronous helper @@ -1851,8 +1894,8 @@

Calling igt_wait_helper() joins a helper process and igt_stop_helper() forcefully terminates it.

-

Parameters

-
+

Parameters

+
@@ -1874,8 +1917,8 @@

Joins a helper process. It is an error to call this on a helper process which hasn't been spawned yet.

-

Parameters

-
+

Parameters

+
@@ -1897,8 +1940,8 @@

Terminates a helper process. It is an error to call this on a helper process which hasn't been spawned yet.

-

Parameters

-
+

Parameters

+
@@ -1922,8 +1965,8 @@ parameter can be used to figure this out and act accordingly.

-

Parameters

-
+

Parameters

+
@@ -1954,8 +1997,8 @@ igt_fork_helper(). The list of exit handlers is reset when forking to avoid issues with children cleanup up the parent's state too early.

-

Parameters

-
+

Parameters

+
@@ -1971,22 +2014,6 @@
-

igt_enable_exit_handler ()

-
void
-igt_enable_exit_handler (void);
-

Re-enable all exit handlers temporarily disabled with -igt_disable_exit_handler().

-
-
-
-

igt_disable_exit_handler ()

-
void
-igt_disable_exit_handler (void);
-

Temporarily disable all exit handlers. Useful for library code doing tricky -things.

-
-
-

igt_run_in_simulation ()

bool
 igt_run_in_simulation (void);
@@ -1994,7 +2021,7 @@ simulation environments. This i-g-t mode is selected by setting the INTEL_SIMULATION environment variable to 1.

-

Returns

+

Returns

True when run in simulation mode, false otherwise.

@@ -2006,8 +2033,8 @@

Simple macro to select between two values (e.g. number of test rounds or test buffer size) depending upon whether i-g-t is run in simulation mode or not.

-

Parameters

-
+

Parameters

+
@@ -2059,8 +2086,8 @@ recommended since crucial issues only reported at the IGT_LOG_WARN level are ignored.

-

Parameters

-
+

Parameters

+
@@ -2105,8 +2132,8 @@

If there is no need to wrap up a vararg list in the caller it is simpler to just use igt_log().

-

Parameters

-
+

Parameters

+
@@ -2144,8 +2171,8 @@

Wrapper for igt_log() for message at the IGT_LOG_DEBUG level.

-

Parameters

-
+

Parameters

+
@@ -2166,8 +2193,8 @@

Wrapper for igt_log() for message at the IGT_LOG_INFO level.

-

Parameters

-
+

Parameters

+
@@ -2188,8 +2215,8 @@

Wrapper for igt_log() for message at the IGT_LOG_WARN level.

-

Parameters

-
+

Parameters

+
@@ -2210,8 +2237,8 @@

Wrapper for igt_log() for message at the IGT_LOG_CRITICAL level.

-

Parameters

-
+

Parameters

+
@@ -2234,8 +2261,8 @@ printing warnings. This is useful to streamline the test logic since it allows for a more flat code control flow, similar to igt_assert()

-

Parameters

-
+

Parameters

+
@@ -2261,8 +2288,8 @@

In addition to the plain igt_warn_on_f() helper this allows to print additional information (again as warnings) to help debugging test failures.

-

Parameters

-
+

Parameters

+
@@ -2296,10 +2323,10 @@

Any previous timer is cancelled and no timeout is scheduled if seconds is zero. But for clarity the timeout set with this function should be cleared -with igt_reset_timeout().

+with igt_reset_timeout().

-

Parameters

-
+

Parameters

+
@@ -2322,21 +2349,46 @@
-

igt_reset_timeout ()

-
void
-igt_reset_timeout (void);
-

This function resets a timeout set by igt_set_timeout() and disables any -timer set up by the former function.

+

igt_nsec_elapsed ()

+
uint64_t
+igt_nsec_elapsed (struct timespec *start);
+

Reports the difference in the monotonic clock from the start time +in nanoseconds. On the first invocation, start should be zeroed and will +be set by the call.

+

Typical use would be:

+

igt_subtest("test") { + struct timespec start = {}; + while (igt_nsec_elapsed(&start) < test_timeout_ns) + do_test(); +}

+

A handy approximation is to use nsec >> 30 to convert to seconds, +nsec >> 20 to convert to milliseconds - the error is about 8%, acceptable +for test run times.

+
+

Parameters

+
+++++ + + + + + +

start

measure from this point in time

 
+

igt_fopen_data()

#define             igt_fopen_data(filename)
-

Open a datafile for test, first try from installation directory -then from build directory.

+

Open a datafile for test, first try from installation directory, +then from build directory, and finally from current directory.

-

Parameters

-
+

Parameters

+
@@ -2395,6 +2447,20 @@
+

igt_subtest_group

+
#define             igt_subtest_group
+

Group a set of subtests together with their common setup code

+

Testcase with subtests often need to set up a bunch of shared state as the +common test fixture. But if there are multiple with different requirements +the commont setup code can't be extracted, since a test condition failure in +e.g. igt_require() would result in all subsequent tests skipping. Even those +from a different group.

+

This macro allows to group together a set of igt_fixture and igt_subtest +clauses. If any common setup in a fixture fails, only the subtests in this +group will fail or skip. Subtest groups can be arbitrarily nested.

+
+
+

igt_main

#define             igt_main

This is a magic control flow block used instead of a main() function for @@ -2423,8 +2489,8 @@ only set use_SIGKILL directly.

-

Members

-
+

Members

+
@@ -2466,8 +2532,8 @@

enum igt_log_level

-

Members

-
+

Members

+
@@ -2506,6 +2572,6 @@ +
Generated by GTK-Doc V1.25.1 \ No newline at end of file diff -Nru intel-gpu-tools-1.13/docs/reference/intel-gpu-tools/html/intel-gpu-tools-debugfs.html intel-gpu-tools-1.15/docs/reference/intel-gpu-tools/html/intel-gpu-tools-debugfs.html --- intel-gpu-tools-1.13/docs/reference/intel-gpu-tools/html/intel-gpu-tools-debugfs.html 2015-12-02 16:48:05.000000000 +0000 +++ intel-gpu-tools-1.15/docs/reference/intel-gpu-tools/html/intel-gpu-tools-debugfs.html 2016-05-31 17:09:21.000000000 +0000 @@ -3,12 +3,12 @@ debugfs: intel-gpu-tools Reference Manual - + - + @@ -33,7 +33,7 @@

Functions

-
+
@@ -103,6 +103,14 @@ + + + + + + + + + + + +
+igt_pipe_crc_t * + +igt_pipe_crc_new_nonblock () +
void @@ -127,7 +135,7 @@
-void +int igt_pipe_crc_get_crcs () @@ -143,6 +151,14 @@
+bool + +igt_crc_equal () +
void @@ -165,12 +181,20 @@ igt_enable_prefault ()
+int + +igt_get_stable_obj_count () +

Types and Values

-
+
@@ -259,8 +283,8 @@

This opens a debugfs file as a Unix file descriptor. The filename should be relative to the drm device's root, i.e. without "drm/<minor>".

-

Parameters

-
+

Parameters

+
@@ -281,7 +305,7 @@
-

Returns

+

Returns

The Unix file descriptor for the debugfs file or -1 if that didn't work out.

@@ -294,8 +318,8 @@

This opens a debugfs file as a libc FILE. The filename should be relative to the drm device's root, i.e. without "drm/<minor>".

-

Parameters

-
+

Parameters

+
@@ -316,7 +340,7 @@
-

Returns

+

Returns

The libc FILE pointer for the debugfs file or NULL if that didn't work out.

@@ -330,8 +354,8 @@ for the substring specified in substring .

-

Parameters

-
+

Parameters

+
@@ -353,7 +377,7 @@
-

Returns

+

Returns

True if the substring is found to occur in filename

@@ -366,8 +390,8 @@

This is just a convenience wrapper for __igt_debugfs_read. See its documentation.

-

Parameters

-
+

Parameters

+
@@ -400,8 +424,8 @@ be random testcase failures when different screen contents end up with the same CRC by chance.

-

Parameters

-
+

Parameters

+
@@ -433,8 +457,8 @@ unsafe.

This should only ever be used for diagnostic debug output.

-

Parameters

-
+

Parameters

+
@@ -465,10 +489,11 @@ enum intel_pipe_crc_source source);

This sets up a new pipe CRC capture object for the given pipe and source -.

+ +in blocking mode.

-

Parameters

-
+

Parameters

+
@@ -489,8 +514,49 @@
-

Returns

-

A pipe CRC object if the given pipe +

Returns

+

A pipe CRC object for the given pipe +and source +. The library +assumes that the source is always available since recent kernels support at +least INTEL_PIPE_CRC_SOURCE_AUTO everywhere.

+
+
+
+
+

igt_pipe_crc_new_nonblock ()

+
igt_pipe_crc_t *
+igt_pipe_crc_new_nonblock (enum pipe pipe,
+                           enum intel_pipe_crc_source source);
+

This sets up a new pipe CRC capture object for the given pipe + and source + +in nonblocking mode.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

pipe

display pipe to use as source

 

source

CRC tap point to use as source

 
+
+
+

Returns

+

A pipe CRC object for the given pipe and source . The library assumes that the source is always available since recent kernels support at @@ -505,8 +571,8 @@

Frees all resources associated with pipe_crc .

-

Parameters

-
+

Parameters

+
@@ -528,8 +594,8 @@

Starts the CRC capture process on pipe_crc .

-

Parameters

-
+

Parameters

+
@@ -551,8 +617,8 @@

Stops the CRC capture process on pipe_crc .

-

Parameters

-
+

Parameters

+
@@ -569,22 +635,27 @@

igt_pipe_crc_get_crcs ()

-
void
+
int
 igt_pipe_crc_get_crcs (igt_pipe_crc_t *pipe_crc,
                        int n_crcs,
                        igt_crc_t **out_crcs);
-

Read n_crcs +

Read up to n_crcs from pipe_crc -. This function blocks until n_crcs +. This function does not block, and will +return early if not enough CRCs can be captured, if pipe_crc + has been +opened using igt_pipe_crc_new_nonblock(). It will block until n_crcs are -retrieved. out_crcs - is alloced by this function and must be released with -free() by the caller.

+retrieved if pipe_crc + has been opened using igt_pipe_crc_new(). out_crcs + is +alloced by this function and must be released with free() by the caller.

Callers must start and stop the capturing themselves by calling -igt_pipe_crc_start() and igt_pipe_crc_stop().

+igt_pipe_crc_start() and igt_pipe_crc_stop(). For one-shot CRC collecting +look at igt_pipe_crc_collect_crc().

-

Parameters

-
+

Parameters

+
@@ -609,6 +680,12 @@
+
+

Returns

+

The number of CRCs captured. Should be equal to n_crcs +in blocking mode, but +can be less (even zero) in non-blocking mode.

+

@@ -618,15 +695,20 @@ igt_crc_t *out_crc);

Read a single CRC from pipe_crc . This function blocks until the CRC is -retrieved. out_crc - must be allocated by the caller.

+retrieved, irrespective of whether pipe_crc + has been opened with +igt_pipe_crc_new() or igt_pipe_crc_new_nonblock(). out_crc + must be +allocated by the caller.

This function takes care of the pipe_crc book-keeping, it will start/stop the collection of the CRC.

This function also calls the interactive debug with the "crc" domain, so you can make use of this feature to actually see the screen that is being CRC'd.

+

For continuous CRC collection look at igt_pipe_crc_start(), +igt_pipe_crc_get_crcs() and igt_pipe_crc_stop().

-

Parameters

-
+

Parameters

+
@@ -649,14 +731,21 @@
+

igt_crc_equal ()

+
bool
+igt_crc_equal (igt_crc_t *a,
+               igt_crc_t *b);
+
+
+

igt_drop_caches_set ()

void
 igt_drop_caches_set (uint64_t val);

This calls the debugfs interface the drm/i915 GEM driver exposes to drop or evict certain classes of gem buffer objects.

-

Parameters

-
+

Parameters

+
@@ -687,6 +776,30 @@ igt_enable_prefault (void);

Enable prefault (again) through the debugfs interface.

+
+
+

igt_get_stable_obj_count ()

+
int
+igt_get_stable_obj_count (int driver);
+

This puts the driver into a stable (quiescent) state and then returns the +current number of gem buffer objects as reported in the i915_gem_objects +debugFS interface.

+
+

Parameters

+
+++++ + + + + + +

driver

fd to drm/i915 GEM driver

 
+
+

Types and Values

@@ -710,8 +823,8 @@ are private and should not be inspected by testcases.

-

Members

-
+

Members

+
@@ -746,8 +859,8 @@ suitable for checking planes, cursor, color correction and any other output-agnostic features.

-

Members

-
+

Members

+
@@ -872,6 +985,6 @@ +
Generated by GTK-Doc V1.25.1 \ No newline at end of file diff -Nru intel-gpu-tools-1.13/docs/reference/intel-gpu-tools/html/intel-gpu-tools.devhelp2 intel-gpu-tools-1.15/docs/reference/intel-gpu-tools/html/intel-gpu-tools.devhelp2 --- intel-gpu-tools-1.13/docs/reference/intel-gpu-tools/html/intel-gpu-tools.devhelp2 2015-12-02 16:48:05.000000000 +0000 +++ intel-gpu-tools-1.15/docs/reference/intel-gpu-tools/html/intel-gpu-tools.devhelp2 2016-05-31 17:09:21.000000000 +0000 @@ -11,6 +11,7 @@ + @@ -42,11 +43,14 @@ + + + @@ -90,13 +94,12 @@ + - - @@ -109,7 +112,7 @@ - + @@ -117,6 +120,7 @@ + @@ -142,6 +146,8 @@ + + @@ -150,14 +156,17 @@ + + + @@ -186,10 +195,15 @@ + + + + + @@ -201,6 +215,10 @@ + + + + @@ -213,15 +231,22 @@ + + + + + + + @@ -231,15 +256,22 @@ + + + + + + + @@ -247,13 +279,17 @@ - + + + + + @@ -276,6 +312,7 @@ + @@ -286,20 +323,31 @@ + + + - - - + + + + + - + + + + + + + @@ -311,13 +359,17 @@ + + + + @@ -326,28 +378,50 @@ + - - - + + + + + + + + + + + + + + + + + + + + + + + + @@ -437,7 +511,6 @@ - @@ -506,18 +579,41 @@ + + + + + + + + + + + + + + + + + + + + + + + @@ -533,15 +629,6 @@ - - - - - - - - - diff -Nru intel-gpu-tools-1.13/docs/reference/intel-gpu-tools/html/intel-gpu-tools-Draw.html intel-gpu-tools-1.15/docs/reference/intel-gpu-tools/html/intel-gpu-tools-Draw.html --- intel-gpu-tools-1.13/docs/reference/intel-gpu-tools/html/intel-gpu-tools-Draw.html 2015-12-02 16:48:05.000000000 +0000 +++ intel-gpu-tools-1.15/docs/reference/intel-gpu-tools/html/intel-gpu-tools-Draw.html 2016-05-31 17:09:21.000000000 +0000 @@ -3,12 +3,12 @@ Draw: intel-gpu-tools Reference Manual - + - + @@ -33,7 +33,7 @@

Functions

-
+
@@ -75,7 +75,7 @@

Types and Values

-
+
@@ -110,8 +110,8 @@

Simple function to transform the enum into a string. Useful when naming subtests and printing debug messages.

-

Parameters

-
+

Parameters

+
@@ -145,8 +145,8 @@

This function draws a colored rectangle on the destination buffer, allowing you to specify the method used to draw the rectangle.

-

Parameters

-
+

Parameters

+
@@ -240,8 +240,8 @@

This is exactly the same as igt_draw_rect, but you can pass an igt_fb instead of manually providing its details. See igt_draw_rect.

-

Parameters

-
+

Parameters

+
@@ -312,8 +312,8 @@ uint32_t color);

This function just paints an igt_fb using the provided color.

-

Parameters

-
+

Parameters

+
@@ -345,8 +345,8 @@

enum igt_draw_method

-

Members

-
+

Members

+
@@ -409,6 +409,6 @@ +
Generated by GTK-Doc V1.25.1 \ No newline at end of file diff -Nru intel-gpu-tools-1.13/docs/reference/intel-gpu-tools/html/intel-gpu-tools-drmtest.html intel-gpu-tools-1.15/docs/reference/intel-gpu-tools/html/intel-gpu-tools-drmtest.html --- intel-gpu-tools-1.13/docs/reference/intel-gpu-tools/html/intel-gpu-tools-drmtest.html 2015-12-02 16:48:05.000000000 +0000 +++ intel-gpu-tools-1.15/docs/reference/intel-gpu-tools/html/intel-gpu-tools-drmtest.html 2016-05-31 17:09:21.000000000 +0000 @@ -3,12 +3,12 @@ drmtest: intel-gpu-tools Reference Manual - + - + @@ -33,7 +33,7 @@

Functions

-
+
@@ -92,6 +92,22 @@ + + + + + + + +
+void + +igt_require_intel () +
+bool + +is_i915_device () +
#define do_or_die() @@ -114,7 +130,7 @@

Types and Values

-
+
@@ -130,6 +146,10 @@ + + + + @@ -157,8 +177,8 @@

Macro to compute the size of the static array arr .

-

Parameters

-
#defineDRIVER_VC4
#define mmap64
+

Parameters

+
@@ -181,8 +201,8 @@ to a specified unit a .

-

Parameters

-
+

Parameters

+
@@ -211,7 +231,7 @@

Get an i915 drm card index number for use in /dev or /sys. The minor index of the legacy node is returned, not of the control or render node.

-

Returns

+

Returns

The i915 drm index or -1 on error

@@ -223,8 +243,8 @@

Open a drm legacy device node. This function always returns a valid file descriptor.

-

Parameters

-
+

Parameters

+
@@ -238,7 +258,7 @@
-

Returns

+

Returns

a drm file descriptor

@@ -249,8 +269,8 @@ drm_open_driver_master (int chipset);

Open a drm legacy device node and ensure that it is drm master.

-

Parameters

-
+

Parameters

+
@@ -264,7 +284,7 @@
-

Returns

+

Returns

The drm file descriptor or -1 on error

@@ -275,8 +295,8 @@ drm_open_driver_render (int chipset);

Open a drm render device node.

-

Parameters

-
+

Parameters

+
@@ -290,7 +310,7 @@
-

Returns

+

Returns

The drm file descriptor or -1 on error

@@ -306,8 +326,8 @@

This function simply allows tests to make additional calls in-between, if so desired.

-

Parameters

-
+

Parameters

+
@@ -323,6 +343,18 @@
+

igt_require_intel ()

+
void
+igt_require_intel (int fd);
+
+
+
+

is_i915_device ()

+
bool
+is_i915_device (int fd);
+
+
+

do_or_die()

#define do_or_die(x) igt_assert((x) == 0)
 
@@ -330,8 +362,8 @@ that in any failure case the return value is non-zero and a precise error is logged into errno. Uses igt_assert() internally.

-

Parameters

-
+

Parameters

+
@@ -352,8 +384,8 @@

This macro wraps drmIoctl() and uses igt_assert to check that it has been successfully executed.

-

Parameters

-
+

Parameters

+
@@ -386,8 +418,8 @@

This macro wraps drmIoctl() and uses igt_assert to check that it fails, returning a particular value in errno.

-

Parameters

-
+

Parameters

+
@@ -434,6 +466,12 @@
+

DRIVER_VC4

+
#define DRIVER_VC4 (0x1 << 2)
+
+
+
+

mmap64

#define mmap64 igt_mmap64
 
@@ -441,6 +479,6 @@
+
Generated by GTK-Doc V1.25.1 \ No newline at end of file diff -Nru intel-gpu-tools-1.13/docs/reference/intel-gpu-tools/html/intel-gpu-tools-Framebuffer.html intel-gpu-tools-1.15/docs/reference/intel-gpu-tools/html/intel-gpu-tools-Framebuffer.html --- intel-gpu-tools-1.13/docs/reference/intel-gpu-tools/html/intel-gpu-tools-Framebuffer.html 2015-12-02 16:48:05.000000000 +0000 +++ intel-gpu-tools-1.15/docs/reference/intel-gpu-tools/html/intel-gpu-tools-Framebuffer.html 2016-05-31 17:09:21.000000000 +0000 @@ -3,12 +3,12 @@ Framebuffer: intel-gpu-tools Reference Manual - + - + @@ -33,13 +33,21 @@

Functions

-
+
+ + + + + + + + + + + + + + + + @@ -77,6 +106,22 @@ + + + + + + + + + + + + @@ -167,7 +220,7 @@ void @@ -175,7 +228,7 @@

Types and Values

-
+void + +igt_calc_fb_size () +
unsigned int @@ -64,6 +72,27 @@ unsigned int +igt_create_pattern_fb () +
unsigned int + +igt_create_color_pattern_fb () +
unsigned int + +igt_create_image_fb () +
unsigned int + igt_create_stereo_fb ()
+int + +igt_dirty_fb () +
+int + +igt_create_bo_with_dimensions () +
cairo_t * @@ -112,6 +157,14 @@ void +igt_paint_color_gradient_range () +
+void + igt_paint_test_pattern ()
-igt_get_all_formats () +igt_get_all_cairo_formats ()
+
@@ -219,6 +272,67 @@

Functions

+

igt_calc_fb_size ()

+
void
+igt_calc_fb_size (int fd,
+                  int width,
+                  int height,
+                  int bpp,
+                  uint64_t tiling,
+                  unsigned *size_ret,
+                  unsigned *stride_ret);
+

This function returns valid stride and size values for a framebuffer with the +specified parameters.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

fd

the DRM file descriptor

 

width

width of the framebuffer in pixels

 

height

height of the framebuffer in pixels

 

bpp

bytes per pixel of the framebuffer

 

tiling

tiling layout of the framebuffer (as framebuffer modifier)

 

size_ret

returned size for the framebuffer

 

stride_ret

returned stride for the framebuffer

 
+
+
+
+

igt_create_fb_with_bo_size ()

unsigned int
 igt_create_fb_with_bo_size (int fd,
@@ -236,8 +350,8 @@
 

The backing storage of the framebuffer is filled with all zeros, i.e. black for rgb pixel formats.

-

Parameters

-
+

Parameters

+
@@ -288,7 +402,7 @@
-

Returns

+

Returns

The kms id of the created framebuffer.

@@ -309,8 +423,8 @@

The backing storage of the framebuffer is filled with all zeros, i.e. black for rgb pixel formats.

-

Parameters

-
+

Parameters

+
@@ -351,7 +465,7 @@
-

Returns

+

Returns

The kms id of the created framebuffer.

@@ -375,8 +489,8 @@

Compared to igt_create_fb() this function also fills the entire framebuffer with the given color, which is useful for some simple pipe crc based tests.

-

Parameters

-
+

Parameters

+
@@ -415,7 +529,7 @@ - + @@ -432,7 +546,222 @@

g

gree value to use as fill color

green value to use as fill color

 
-

Returns

+

Returns

+

The kms id of the created framebuffer on success or a negative error code on +failure.

+
+ +
+
+

igt_create_pattern_fb ()

+
unsigned int
+igt_create_pattern_fb (int fd,
+                       int width,
+                       int height,
+                       uint32_t format,
+                       uint64_t tiling,
+                       struct igt_fb *fb);
+

This function allocates a gem buffer object suitable to back a framebuffer +with the requested properties and then wraps it up in a drm framebuffer +object. All metadata is stored in fb +.

+

Compared to igt_create_fb() this function also draws the standard test pattern +into the framebuffer.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

fd

open i915 drm file descriptor

 

width

width of the framebuffer in pixel

 

height

height of the framebuffer in pixel

 

format

drm fourcc pixel format code

 

tiling

tiling layout of the framebuffer

 

fb

pointer to an igt_fb structure

 
+
+
+

Returns

+

The kms id of the created framebuffer on success or a negative error code on +failure.

+
+
+
+
+

igt_create_color_pattern_fb ()

+
unsigned int
+igt_create_color_pattern_fb (int fd,
+                             int width,
+                             int height,
+                             uint32_t format,
+                             uint64_t tiling,
+                             double r,
+                             double g,
+                             double b,
+                             struct igt_fb *fb);
+

This function allocates a gem buffer object suitable to back a framebuffer +with the requested properties and then wraps it up in a drm framebuffer +object. All metadata is stored in fb +.

+

Compared to igt_create_fb() this function also fills the entire framebuffer +with the given color, and then draws the standard test pattern into the +framebuffer.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

fd

open i915 drm file descriptor

 

width

width of the framebuffer in pixel

 

height

height of the framebuffer in pixel

 

format

drm fourcc pixel format code

 

tiling

tiling layout of the framebuffer

 

r

red value to use as fill color

 

g

green value to use as fill color

 

b

blue value to use as fill color

 

fb

pointer to an igt_fb structure

 
+
+
+

Returns

+

The kms id of the created framebuffer on success or a negative error code on +failure.

+
+
+
+
+

igt_create_image_fb ()

+
unsigned int
+igt_create_image_fb (int drm_fd,
+                     int width,
+                     int height,
+                     uint32_t format,
+                     uint64_t tiling,
+                     const char *filename,
+                     struct igt_fb *fb);
+

Create a framebuffer with the specified image. If width + is zero the +image width will be used. If height + is zero the image height will be used.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

drm_fd

open i915 drm file descriptor

 

width

width of the framebuffer in pixel or 0

 

height

height of the framebuffer in pixel or 0

 

format

drm fourcc pixel format code

 

tiling

tiling layout of the framebuffer

 

filename

filename of the png image to draw

 

fb

pointer to an igt_fb structure

 
+
+
+

Returns

The kms id of the created framebuffer on success or a negative error code on failure.

@@ -448,8 +777,8 @@

Create a framebuffer for use with the stereo 3D mode specified by mode .

-

Parameters

-
+

Parameters

+
@@ -480,7 +809,7 @@
-

Returns

+

Returns

The kms id of the created framebuffer on success or a negative error code on failure.

@@ -496,8 +825,8 @@ Note that if this framebuffer is still in use on a primary plane the kernel will disable the corresponding crtc.

-

Parameters

-
+

Parameters

+
@@ -520,6 +849,117 @@
+

igt_dirty_fb ()

+
int
+igt_dirty_fb (int fd,
+              struct igt_fb *fb);
+

Flushes out the whole framebuffer.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

fd

open drm file descriptor

 

fb

pointer to an igt_fb structure

 
+
+
+

Returns

+

0 upon success.

+
+
+
+
+

igt_create_bo_with_dimensions ()

+
int
+igt_create_bo_with_dimensions (int fd,
+                               int width,
+                               int height,
+                               uint32_t format,
+                               uint64_t modifier,
+                               unsigned  stride,
+                               unsigned *stride_out,
+                               unsigned *size_out,
+                               bool *is_dumb);
+

This function allocates a gem buffer object matching the requested +properties.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

fd

open drm file descriptor

 

width

width of the buffer object in pixels

 

height

height of the buffer object in pixels

 

format

drm fourcc pixel format code

 

modifier

modifier corresponding to the tiling layout of the buffer object

 

stride

stride of the buffer object in bytes (0 for automatic stride)

 

size_ret

size of the buffer object as created by the kernel

 

stride_ret

stride of the buffer object as created by the kernel

 

is_dumb

whether the created buffer object is a dumb buffer or not

 
+
+
+

Returns

+

The kms id of the created buffer object.

+
+
+
+

igt_get_cairo_ctx ()

cairo_t *
 igt_get_cairo_ctx (int fd,
@@ -527,11 +967,11 @@
 

This initializes a cairo surface for fb and then allocates a drawing context for it. The return cairo drawing context should be released by calling -cairo_destroy(). This also sets a default font for drawing text on +cairo_destroy(). This also sets a default font for drawing text on framebuffers.

-

Parameters

-
+

Parameters

+
@@ -552,7 +992,7 @@
-

Returns

+

Returns

The created cairo drawing context.

@@ -572,8 +1012,8 @@ context cr .

-

Parameters

-
+

Parameters

+
@@ -641,8 +1081,8 @@ the drawing context cr .

-

Parameters

-
+

Parameters

+
@@ -714,8 +1154,8 @@ to the given values using the drawing context cr .

-

Parameters

-
+

Parameters

+
@@ -768,6 +1208,92 @@
+

igt_paint_color_gradient_range ()

+
void
+igt_paint_color_gradient_range (cairo_t *cr,
+                                int x,
+                                int y,
+                                int w,
+                                int h,
+                                double sr,
+                                double sg,
+                                double sb,
+                                double er,
+                                double eg,
+                                double eb);
+

This functions draws a gradient into the rectangle which fades in +from one color to the other using the drawing context cr +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

cr

cairo drawing context

 

x

pixel x-coordination of the fill rectangle

 

y

pixel y-coordination of the fill rectangle

 

w

width of the fill rectangle

 

h

height of the fill rectangle

 

sr

red value to use as start gradient color

 

sg

green value to use as start gradient color

 

sb

blue value to use as start gradient color

 

er

red value to use as end gradient color

 

eg

green value to use as end gradient color

 

eb

blue value to use as end gradient color

 
+
+ +
+

igt_paint_test_pattern ()

void
 igt_paint_test_pattern (cairo_t *cr,
@@ -783,8 +1309,8 @@
 
  • a set of color and b/w gradients.

  • -

    Parameters

    -
    +

    Parameters

    +
    @@ -823,8 +1349,8 @@

    This function can be used to draw a scaled version of the supplied png image, which is loaded from the package data directory.

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -876,8 +1402,8 @@ image stored at filename .

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -917,8 +1443,8 @@ needs to be done manually with explicit cairo calls on cr .

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -954,7 +1480,7 @@
    -

    Returns

    +

    Returns

    The width of the drawn text.

    @@ -965,8 +1491,8 @@ igt_bpp_depth_to_drm_format (int bpp, int depth);
    -

    Parameters

    -
    +

    Parameters

    +
    @@ -987,7 +1513,7 @@
    -

    Returns

    +

    Returns

    The rgb drm fourcc pixel format code corresponding to the given bpp and depth @@ -1000,8 +1526,8 @@

    uint32_t
     igt_drm_format_to_bpp (uint32_t drm_format);
    -

    Parameters

    -
    +

    Parameters

    +
    @@ -1015,7 +1541,7 @@
    -

    Returns

    +

    Returns

    The bits per pixel for the given drm fourcc pixel format code. Fails hard if no match was found.

    @@ -1026,8 +1552,8 @@
    const char *
     igt_format_str (uint32_t drm_format);
    -

    Parameters

    -
    +

    Parameters

    +
    @@ -1041,7 +1567,7 @@
    -

    Returns

    +

    Returns

    Human-readable fourcc pixel format code for drm_format or "invalid" no match was found.

    @@ -1049,15 +1575,15 @@

    -

    igt_get_all_formats ()

    +

    igt_get_all_cairo_formats ()

    void
    -igt_get_all_formats (const uint32_t **formats,
    -                     int *format_count);
    -

    This functions returns an array of all the drm fourcc codes supported by this -library. The caller must free the allocated array again with free().

    +igt_get_all_cairo_formats (const uint32_t **formats, + int *format_count); +

    This functions returns an array of all the drm fourcc codes supported by +cairo and this library.

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -1097,7 +1623,9 @@

    struct igt_fb

    struct igt_fb {
     	uint32_t fb_id;
    +	int fd;
     	uint32_t gem_handle;
    +	bool is_dumb;
     	uint32_t drm_format;
     	int width;
     	int height;
    @@ -1105,10 +1633,7 @@
     	uint64_t tiling;
     	unsigned size;
     	cairo_surface_t *cairo_surface;
    -	uint32_t src_x;
    -	uint32_t src_y;
    -	uint32_t src_w;
    -	uint32_t src_h;
    +	unsigned domain;
     };
     
    @@ -1116,8 +1641,8 @@

    enum igt_text_align

    -

    Members

    -
    +

    Members

    +
    @@ -1161,6 +1686,6 @@ +
    Generated by GTK-Doc V1.25.1 \ No newline at end of file diff -Nru intel-gpu-tools-1.13/docs/reference/intel-gpu-tools/html/intel-gpu-tools-GT.html intel-gpu-tools-1.15/docs/reference/intel-gpu-tools/html/intel-gpu-tools-GT.html --- intel-gpu-tools-1.13/docs/reference/intel-gpu-tools/html/intel-gpu-tools-GT.html 2015-12-02 16:48:05.000000000 +0000 +++ intel-gpu-tools-1.15/docs/reference/intel-gpu-tools/html/intel-gpu-tools-GT.html 2016-05-31 17:09:21.000000000 +0000 @@ -3,12 +3,12 @@ GT: intel-gpu-tools Reference Manual - + - - + + @@ -20,7 +20,7 @@ - +
    Home Up PrevNextNext
    @@ -33,7 +33,7 @@

    Functions

    -
    +
    @@ -51,6 +51,13 @@ + + + + @@ -64,7 +71,15 @@ + + + + - @@ -98,14 +114,27 @@ void + + + + - + + + + @@ -113,7 +142,7 @@

    Types and Values

    -
    struct igt_hang_ring +igt_hang_ctx () +
    struct igt_hang_ring + igt_hang_ring ()
    -int +void + +igt_force_gpu_reset () +
    +void igt_fork_hang_helper () @@ -87,10 +102,11 @@
    enum stop_ring_flags + +int -igt_to_stop_ring_flag () +igt_setup_clflush ()
    -igt_set_stop_rings () +igt_clflush_range () +
    +unsigned + +intel_detect_and_clear_missed_interrupts ()
    enum stop_ring_flags +#define +for_if()
    #define -igt_get_stop_rings () +for_each_engine()
    +
    @@ -124,8 +153,16 @@ - - + + + + + + + + + +
    igt_hang_ring_t
    enumstop_ring_flags#defineHANG_POISON
    #defineHANG_ALLOW_BAN
    #defineHANG_ALLOW_CAPTURE
    @@ -151,9 +188,25 @@

    Convenience helper to check whether advanced hang injection is supported by the kernel. Uses igt_skip to automatically skip the test/subtest if this isn't the case.

    +

    Note that we can't simply just call this from igt_hang_ring since some +tests want to exercise gpu wedging behavior. For which we intentionally +disable gpu reset support, but still want to inject a hang, see for example +tests/gem_eio.c Instead, we expect that the first invocation of +igt_require_hand_ring be from a vanilla context and use the has_gpu_reset() +determined then for all later instances. This allows us the convenience +of double checking when injecting hangs, whilst pushing the complexity +to the tests that are deliberating trying to break the box.

    +

    This function is also controlled by the environment variables:

    +

    IGT_HANG (boolean) - if false, skip all tests that try to inject a hang. +Default: true

    +

    IGT_HANG_WITHOUT_RESET (boolean) - if true, allow the hang even if the +kernel does not support GPU recovery. The machine will be wedged afterwards +(and so require a reboot between testing), but it does allow limited testing +to be done under hang injection. +Default: false

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -176,6 +229,16 @@
    +

    igt_hang_ctx ()

    +
    struct igt_hang_ring
    +igt_hang_ctx (int fd,
    +              uint32_t ctx,
    +              int ring,
    +              unsigned  flags,
    +              uint64_t *offset);
    +
    +
    +

    igt_hang_ring ()

    struct igt_hang_ring
     igt_hang_ring (int fd,
    @@ -185,8 +248,8 @@
     igt_hang_ring_t structure which must be passed to igt_post_hang_ring() for
     hang post-processing (after the gpu hang interaction has been tested.

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -207,7 +270,7 @@
    -

    Returns

    +

    Returns

    Structure with helper internal state for igt_post_hang_ring().

    @@ -220,8 +283,8 @@

    This function does the necessary post-processing after a gpu hang injected with igt_hang_ring().

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -244,15 +307,25 @@
    +

    igt_force_gpu_reset ()

    +
    void
    +igt_force_gpu_reset (void);
    +

    forces a gpu reset using the i915_wedged debugfs interface. To be used to +recover from situations where the hangcheck didn't trigger and/or the gpu is +stuck, either because the test manually disabled gpu resets or because the +test hit an hangcheck bug

    +
    +
    +

    igt_fork_hang_helper ()

    -
    int
    +
    void
     igt_fork_hang_helper (void);

    Fork a child process using igt_fork_helper to hang the default engine of the GPU at regular intervals.

    This is useful to exercise slow running code (such as aperture placement) which needs to be robust against a GPU reset.

    -

    In tests with subtests this function can be called outside of failure -catching code blocks like igt_fixture or igt_subtest.

    +

    This function automatically skips when test requirements aren't met using +igt_skip().


    @@ -271,87 +344,40 @@

    This functions opens the debugfs forcewake file and so prevents the GT from suspending. The reference is automatically dropped when the is closed.

    -

    Returns

    +

    Returns

    The file descriptor of the forcewake handle or -1 if that didn't work out.


    -

    igt_to_stop_ring_flag ()

    -
    enum stop_ring_flags
    -igt_to_stop_ring_flag (int ring);
    -

    This converts the specified ring to a ring flag to be used -with igt_get_stop_rings() and igt_set_stop_rings().

    -
    -

    Parameters

    -
    ----- - - - - - -

    ring

    the specified ring flag from execbuf ioctl (I915_EXEC_*)

     
    -
    -
    -

    Returns

    -

    Ring flag for the given ring.

    -
    +

    igt_setup_clflush ()

    +
    int
    +igt_setup_clflush (void);

    -

    igt_set_stop_rings ()

    +

    igt_clflush_range ()

    void
    -igt_set_stop_rings (enum stop_ring_flags flags);
    -

    This writes flags - to 'i915_ring_stop' debugfs entry. Driver will -prevent the CPU from writing tail pointer for the ring that flags - -specify. Note that the ring is not stopped right away. Instead any -further command emissions won't be executed after the flag is set.

    -

    This is the least invasive way to make the GPU stuck. Hence you must -set this after a batch submission with it's own invalid or endless -looping instructions. In this case it is merely for giving notification -for the driver that this was simulated hang, as the batch would have -caused hang in any case. On the other hand if you use a valid or noop -batch and want to hang the ring (GPU), you must set corresponding flag -before submitting the batch.

    -

    Driver checks periodically if a ring is making any progress, and if -it is not, it will declare the ring to be hung and will reset the GPU. -After reset, the driver will clear flags in 'i915_ring_stop'

    -

    Note: Always when hanging the GPU, use igt_set_stop_rings() to -notify the driver. Driver controls hang log messaging based on -these flags and thus prevents false positives on logs.

    -
    -

    Parameters

    -
    ----- - - - - - -

    flags

    Ring flags to write

     
    +igt_clflush_range (void *addr, + int size);
    +
    +
    +

    intel_detect_and_clear_missed_interrupts ()

    +
    unsigned
    +intel_detect_and_clear_missed_interrupts
    +                               (int fd);

    -

    igt_get_stop_rings ()

    -
    enum stop_ring_flags
    -igt_get_stop_rings (void);
    -

    Read current ring flags from 'i915_ring_stop' debugfs entry.

    -
    -

    Returns

    -

    Current ring flags.

    +

    for_if()

    +
    #define for_if(expr__) if (!(expr__)) {} else
    +
    +
    +
    +

    for_each_engine()

    +
    #define             for_each_engine(fd__, flags__)
    @@ -360,95 +386,33 @@

    igt_hang_ring_t

    typedef struct {
     	unsigned handle;
    +	unsigned ctx;
     	unsigned ban;
    +	unsigned flags;
     } igt_hang_ring_t;
     

    -

    enum stop_ring_flags

    -

    Enumeration of all supported flags for igt_set_stop_rings().

    -
    -

    Members

    -
    ----- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    STOP_RING_NONE

    -

    Can be used to clear the pending stop (warning: hang might -be declared already). Returned by igt_get_stop_rings() if there is -no currently stopped rings.

    -
     

    STOP_RING_RENDER

    -

    Render ring

    -
     

    STOP_RING_BSD

    -

    Video encoding/decoding ring

    -
     

    STOP_RING_BLT

    -

    Blitter ring

    -
     

    STOP_RING_VEBOX

    -

    Video enhancement ring

    -
     

    STOP_RING_ALL

    -

    All rings

    -
     

    STOP_RING_ALLOW_ERRORS

    -

    Driver will not omit expected DRM_ERRORS

    -
     

    STOP_RING_ALLOW_BAN

    -

    Driver will use context ban policy

    -
     

    STOP_RING_DEFAULTS

    -

    STOP_RING_ALL | STOP_RING_ALLOW_ERRORS

    -
     
    +

    HANG_POISON

    +
    #define HANG_POISON 0xc5c5c5c5
    +
    +
    +
    +

    HANG_ALLOW_BAN

    +
    #define HANG_ALLOW_BAN 1
    +
    +
    +
    +
    +

    HANG_ALLOW_CAPTURE

    +
    #define HANG_ALLOW_CAPTURE 2
    +
    +
    Generated by GTK-Doc V1.25.1
    \ No newline at end of file diff -Nru intel-gpu-tools-1.13/docs/reference/intel-gpu-tools/html/intel-gpu-tools-ioctl-wrappers.html intel-gpu-tools-1.15/docs/reference/intel-gpu-tools/html/intel-gpu-tools-ioctl-wrappers.html --- intel-gpu-tools-1.13/docs/reference/intel-gpu-tools/html/intel-gpu-tools-ioctl-wrappers.html 2015-12-02 16:48:05.000000000 +0000 +++ intel-gpu-tools-1.15/docs/reference/intel-gpu-tools/html/intel-gpu-tools-ioctl-wrappers.html 2016-05-31 17:09:21.000000000 +0000 @@ -3,12 +3,12 @@ ioctl wrappers: intel-gpu-tools Reference Manual - + - + - + @@ -19,7 +19,7 @@
    Home UpPrevPrev Next
    @@ -33,7 +33,7 @@

    Functions

    -
    +
    @@ -41,6 +41,14 @@ + + + + + + + + + + + + + + + + + + + + @@ -250,6 +288,14 @@ void + + + + @@ -271,10 +317,10 @@ @@ -282,7 +328,7 @@ bool @@ -290,7 +336,7 @@ bool @@ -298,15 +344,15 @@ bool @@ -314,7 +360,7 @@ bool @@ -322,7 +368,7 @@ bool @@ -354,11 +400,27 @@ uint64_t + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +int + +(*igt_ioctl) () +
    drm_intel_bo * @@ -129,6 +137,14 @@
    +int + +gem_wait () +
    void @@ -137,6 +153,22 @@
    +bool + +gem_create__has_stolen_support () +
    +uint32_t + +gem_create_stolen () +
    uint32_t @@ -186,6 +218,12 @@
    #define +gem_require_stolen_support() +
    #define gem_require_mmap_wc()
    +gem_userptr () +
    +void + gem_sw_finish ()
    -int +bool -gem_get_num_rings () +gem_has_bsd ()
    -gem_has_enable_ring () +gem_has_blt ()
    -gem_has_bsd () +gem_has_vebox ()
    -gem_has_blt () +gem_has_bsd2 ()
    -bool +int -gem_has_vebox () +gem_gtt_type ()
    -gem_has_bsd2 () +gem_uses_ppgtt ()
    -gem_uses_aliasing_ppgtt () +gem_uses_full_ppgtt ()
    +gem_global_aperture_size () +
    +uint64_t + gem_mappable_aperture_size ()
    +bool + +gem_has_softpin () +
    void @@ -367,6 +429,14 @@
    +bool + +gem_has_ring () +
    void @@ -375,6 +445,22 @@
    +bool + +gem_has_mocs_registers () +
    +void + +gem_require_mocs_registers () +
    int @@ -383,6 +469,14 @@
    +int + +prime_handle_to_fd_for_mmap () +
    uint32_t @@ -398,6 +492,22 @@
    +void + +prime_sync_start () +
    +void + +prime_sync_end () +
    #define local_fourcc_mod_code() @@ -416,7 +526,7 @@

    Types and Values

    -
    +
    @@ -427,6 +537,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -486,6 +648,43 @@

    Functions

    +

    igt_ioctl ()

    +
    int
    +(*igt_ioctl) (int fd,
    +              unsigned long  request,
    +              void *arg);
    +

    This is a wrapper around drmIoctl(), which can be augmented with special code +blocks like igt_while_interruptible.

    +
    +

    Parameters

    +
    local_i915_gem_context_param
    #defineLOCAL_I915_GEM_USERPTR
    #defineLOCAL_IOCTL_I915_GEM_USERPTR
    structlocal_i915_gem_userptr
    structlocal_dma_buf_sync
    #defineLOCAL_DMA_BUF_SYNC_READ
    #defineLOCAL_DMA_BUF_SYNC_WRITE
    #defineLOCAL_DMA_BUF_SYNC_RW
    #defineLOCAL_DMA_BUF_SYNC_START
    #defineLOCAL_DMA_BUF_SYNC_END
    #defineLOCAL_DMA_BUF_SYNC_VALID_FLAGS_MASK
    #defineLOCAL_DMA_BUF_BASE
    #defineLOCAL_DMA_BUF_IOCTL_SYNC
    #defineDRM_RDWR
    struct local_drm_mode_fb_cmd2
    +++++ + + + + + + + + + + + + + + + + + +

    fd

    file descriptor

     

    request

    IOCTL request number

     

    arg

    argument pointer

     
    +
    + +
    +

    gem_handle_to_libdrm_bo ()

    drm_intel_bo *
     gem_handle_to_libdrm_bo (drm_intel_bufmgr *bufmgr,
    @@ -495,8 +694,8 @@
     

    This helper function imports a raw gem buffer handle into the libdrm buffer manager.

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -527,7 +726,7 @@
    -

    Returns

    +

    Returns

    The imported libdrm buffer manager object.

    @@ -541,8 +740,8 @@ uint32_t *swizzle);

    This wraps the GET_TILING ioctl.

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -583,8 +782,8 @@ uint32_t stride);

    This wraps the SET_TILING ioctl.

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -627,8 +826,8 @@ test. Therefore always extract test logic which uses this into its own subtest.

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -662,8 +861,8 @@ uint32_t handle);

    This wraps the GET_CACHING ioctl.

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -684,7 +883,7 @@
    -

    Returns

    +

    Returns

    The current caching mode bits.

    @@ -698,8 +897,8 @@ into the device-global flink namespace. See gem_open() for opening such a buffer name on a different i915 drm file descriptor.

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -720,7 +919,7 @@
    -

    Returns

    +

    Returns

    The created flink buffer name.

    @@ -732,8 +931,8 @@ uint32_t name);

    This wraps the GEM_OPEN ioctl, which is used to import an flink name.

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -754,7 +953,7 @@
    -

    Returns

    +

    Returns

    gem file-private buffer handle of the open object.

    @@ -767,8 +966,8 @@

    This wraps the GEM_CLOSE ioctl, which to release a file-private gem buffer handle.

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -801,8 +1000,8 @@

    This wraps the PWRITE ioctl, which is to upload a linear data to a subrange of a gem buffer object.

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -850,8 +1049,8 @@

    This wraps the PREAD ioctl, which is to download a linear data to a subrange of a gem buffer object.

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -900,8 +1099,8 @@ synchronize with outstanding rendering in general, but for that use-case please have a look at gem_sync().

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -934,14 +1133,22 @@
    +

    gem_wait ()

    +
    int
    +gem_wait (int fd,
    +          uint32_t handle,
    +          int64_t *timeout_ns);
    +
    +
    +

    gem_sync ()

    void
     gem_sync (int fd,
               uint32_t handle);

    This functions waits for outstanding rendering to complete.

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -964,6 +1171,48 @@
    +

    gem_create__has_stolen_support ()

    +
    bool
    +gem_create__has_stolen_support (int fd);
    +
    +
    +
    +

    gem_create_stolen ()

    +
    uint32_t
    +gem_create_stolen (int fd,
    +                   uint64_t size);
    +

    This wraps the new GEM_CREATE ioctl, which allocates a new gem buffer +object of size + and placement in stolen memory region.

    +
    +

    Parameters

    +
    +++++ + + + + + + + + + + + + +

    fd

    open i915 drm file descriptor

     

    size

    desired size of the buffer

     
    +
    +
    +

    Returns

    +

    The file-private handle of the created buffer object

    +
    + +
    +

    gem_create ()

    uint32_t
     gem_create (int fd,
    @@ -972,8 +1221,8 @@
     size
     .

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -994,7 +1243,7 @@
    -

    Returns

    +

    Returns

    The file-private handle of the created buffer object

    @@ -1007,8 +1256,8 @@

    This wraps the EXECBUFFER2 ioctl, which submits a batchbuffer for the gpu to run.

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -1039,8 +1288,8 @@ unsigned prot);

    Like __gem_mmap__gtt() except we assert on failure.

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -1071,7 +1320,7 @@
    -

    Returns

    +

    Returns

    A pointer to the created memory mapping

    @@ -1086,8 +1335,8 @@ unsigned prot);

    Like __gem_mmap__cpu() except we assert on failure.

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -1123,7 +1372,7 @@
    -

    Returns

    +

    Returns

    A pointer to the created memory mapping

    @@ -1144,8 +1393,8 @@ unsigned prot);

    Like __gem_mmap__wc() except we assert on failure.

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -1181,12 +1430,34 @@
    -

    Returns

    +

    Returns

    A pointer to the created memory mapping


    +

    gem_require_stolen_support()

    +
    #define             gem_require_stolen_support(fd)
    +

    Test macro to query whether support for allocating objects from stolen +memory is available. Automatically skips through igt_require() if not.

    +
    +

    Parameters

    +
    +++++ + + + + + +

    fd

    open i915 drm file descriptor

     
    +
    +
    +
    +

    gem_require_mmap_wc()

    #define gem_require_mmap_wc(fd) igt_require(gem_mmap__has_wc(fd))
     
    @@ -1194,8 +1465,8 @@ the gtt) write-combine memory mappings are available. Automatically skips through igt_require() if not.

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -1221,8 +1492,8 @@ (internally in the kernel tracked as purgeable objects). When such a cached object is in need again it must be set back to WILLNEED before first use.

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -1248,7 +1519,7 @@
    -

    Returns

    +

    Returns

    When setting the madvise state to WILLNEED this returns whether the backing storage was still available or not.

    @@ -1263,8 +1534,8 @@ igt_require() internally to correctly skip on kernels and platforms where hw context support is not available.

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -1278,7 +1549,7 @@
    -

    Returns

    +

    Returns

    The id of the allocated hw context.

    @@ -1291,8 +1562,8 @@

    This is a wraps the CONTEXT_DESTROY ioctl, which is used to free a hardware context.

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -1329,8 +1600,8 @@ is available. Automatically skips through igt_require() if not.

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -1362,8 +1633,8 @@ igt_require() internally to correctly skip on kernels and platforms where hw context parameter support is not available.

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -1395,8 +1666,8 @@ igt_require() internally to correctly skip on kernels and platforms where hw context parameter support is not available.

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -1419,6 +1690,60 @@
    +

    gem_userptr ()

    +
    void
    +gem_userptr (int fd,
    +             void *ptr,
    +             int size,
    +             int read_only,
    +             uint32_t flags,
    +             uint32_t *handle);
    +

    Returns userptr handle for the GEM object.

    +
    +

    Parameters

    +
    +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    fd

    open i915 drm file descriptor

     

    ptr

    userptr pointer to be passed

     

    size

    desired size of the buffer

     

    read_only

    specify whether userptr is opened read only

     

    flags

    other userptr flags

     

    handle

    returned handle for the object

     
    +
    + +
    +

    gem_sw_finish ()

    void
     gem_sw_finish (int fd,
    @@ -1427,8 +1752,8 @@
     rendering done through the direct cpu memory mappings. Shipping userspace
     does _not_ call this after frontbuffer rendering through gtt memory mappings.

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -1458,8 +1783,8 @@

    This is a wraps the BUSY ioctl, which tells whether a buffer object is still actively used by the gpu in a execbuffer.

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -1480,7 +1805,7 @@
    -

    Returns

    +

    Returns

    The busy state of the buffer object.

    @@ -1492,16 +1817,14 @@
    -

    gem_get_num_rings ()

    -
    int
    -gem_get_num_rings (int fd);
    -

    Feature test macro to query the number of available rings. This is useful in -test loops which need to step through all rings and similar logic.

    -

    For more explicit tests of ring availability see gem_has_enable_ring() and -the ring specific versions like gem_has_bsd().

    +

    gem_has_bsd ()

    +
    bool
    +gem_has_bsd (int fd);
    +

    Feature test macro to query whether the BSD ring is available.

    +

    Note that recent Bspec calls this the VCS ring for Video Command Submission.

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -1515,55 +1838,48 @@
    -

    Returns

    -

    The number of available rings.

    +

    Returns

    +

    Whether the BSD ring is available or not.


    -

    gem_has_enable_ring ()

    +

    gem_has_blt ()

    bool
    -gem_has_enable_ring (int fd,
    -                     int param);
    -

    Feature test macro to query whether a specific ring is available.

    +gem_has_blt (int fd); +

    Feature test macro to query whether the blitter ring is available.

    +

    Note that recent Bspec calls this the BCS ring for Blitter Command Submission.

    -

    Parameters

    -
    +

    Parameters

    +
    - - + - - - - - - - +

    fd

    open i915 drm file descriptor

     

    param

    ring flag bit as used in gem_execbuf()

     
    -

    Returns

    -

    Whether the ring is available or not.

    +

    Returns

    +

    Whether the blitter ring is available or not.


    -

    gem_has_bsd ()

    +

    gem_has_vebox ()

    bool
    -gem_has_bsd (int fd);
    -

    Feature test macro to query whether the BSD ring is available. This is simply -a specific version of gem_has_enable_ring() for the BSD ring.

    -

    Note that recent Bspec calls this the VCS ring for Video Command Submission.

    +gem_has_vebox (int fd); +

    Feature test macro to query whether the vebox ring is available.

    +

    Note that recent Bspec calls this the VECS ring for Video Enhancement Command +Submission.

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -1577,21 +1893,20 @@
    -

    Returns

    -

    Whether the BSD ring is available or not.

    +

    Returns

    +

    Whether the vebox ring is available or not.


    -

    gem_has_blt ()

    +

    gem_has_bsd2 ()

    bool
    -gem_has_blt (int fd);
    -

    Feature test macro to query whether the blitter ring is available. This is simply -a specific version of gem_has_enable_ring() for the blitter ring.

    -

    Note that recent Bspec calls this the BCS ring for Blitter Command Submission.

    +gem_has_bsd2 (int fd); +

    Feature test macro to query whether the BSD2 ring is available.

    +

    Note that recent Bspec calls this the VCS ring for Video Command Submission.

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -1605,22 +1920,23 @@
    -

    Returns

    -

    Whether the blitter ring is available or not.

    +

    Returns

    +

    Whether the BSD ring is avaible or not.


    -

    gem_has_vebox ()

    -
    bool
    -gem_has_vebox (int fd);
    -

    Feature test macro to query whether the vebox ring is available. This is simply -a specific version of gem_has_enable_ring() for the vebox ring.

    -

    Note that recent Bspec calls this the VECS ring for Video Enhancement Command -Submission.

    +

    gem_gtt_type ()

    +
    int
    +gem_gtt_type (int fd);
    +

    Feature test macro to check what type of gtt is being used by the kernel: +0 - global gtt +1 - aliasing ppgtt +2 - full ppgtt, limited to 32bit address space +3 - full ppgtt, 64bit address space

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -1634,21 +1950,20 @@
    -

    Returns

    -

    Whether the vebox ring is available or not.

    +

    Returns

    +

    Type of gtt being used.


    -

    gem_has_bsd2 ()

    +

    gem_uses_ppgtt ()

    bool
    -gem_has_bsd2 (int fd);
    -

    Feature test macro to query whether the BSD2 ring is available. This is simply -a specific version of gem_has_enable_ring() for the BSD2 ring.

    -

    Note that recent Bspec calls this the VCS ring for Video Command Submission.

    +gem_uses_ppgtt (int fd); +

    Feature test macro to check whether the kernel internally uses ppgtt to +execute batches. Note that this is also true when we're using full ppgtt.

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -1662,23 +1977,21 @@
    -

    Returns

    -

    Whether the BSD ring is avaible or not.

    +

    Returns

    +

    Whether batches are run through ppgtt.


    -

    gem_uses_aliasing_ppgtt ()

    +

    gem_uses_full_ppgtt ()

    bool
    -gem_uses_aliasing_ppgtt (int fd);
    -

    Feature test macro to check whether the kernel internally uses ppgtt to -execute batches. The /aliasing/ in the function name is a bit a misnomer, -this driver parameter is also true when full ppgtt address spaces are -available since for batchbuffer construction only ppgtt or global gtt is -relevant.

    +gem_uses_full_ppgtt (int fd); +

    Feature test macro to check whether the kernel internally uses full +per-process gtt to execute batches. Note that this is also true when we're +using full 64b ppgtt.

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -1692,8 +2005,8 @@
    -

    Returns

    -

    Whether batches are run through ppgtt.

    +

    Returns

    +

    Whether batches are run through full ppgtt.


    @@ -1704,8 +2017,8 @@

    Feature test macro to query the kernel for the number of available fences usable in a batchbuffer. Only relevant for pre-gen4.

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -1719,7 +2032,7 @@
    -

    Returns

    +

    Returns

    The number of available fences.

    @@ -1731,8 +2044,8 @@

    Feature test macro to query the kernel for the available gpu aperture size usable in a batchbuffer.

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -1746,7 +2059,7 @@
    -

    Returns

    +

    Returns

    The available gtt address space size.

    @@ -1757,8 +2070,8 @@ gem_aperture_size (int fd);

    Feature test macro to query the kernel for the total gpu aperture size.

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -1772,32 +2085,71 @@
    -

    Returns

    +

    Returns

    The total gtt address space size.


    +

    gem_global_aperture_size ()

    +
    uint64_t
    +gem_global_aperture_size (int fd);
    +

    Feature test macro to query the kernel for the global gpu aperture size. +This is the area available for the kernel to perform address translations.

    +
    +

    Returns

    +

    The mappable gtt address space size.

    +
    +
    +
    +

    gem_mappable_aperture_size ()

    uint64_t
     gem_mappable_aperture_size (void);

    Feature test macro to query the kernel for the mappable gpu aperture size. This is the area available for GTT memory mappings.

    -

    Returns

    +

    Returns

    The mappable gtt address space size.


    +

    gem_has_softpin ()

    +
    bool
    +gem_has_softpin (int fd);
    +

    Feature test macro to query whether the softpinning functionality is +supported.

    +
    +

    Parameters

    +
    +++++ + + + + + +

    fd

    open i915 drm file descriptor

     
    +
    +
    +

    Returns

    +

    Whether softpin support is available

    +
    +
    +
    +

    gem_require_caching ()

    void
     gem_require_caching (int fd);

    Feature test macro to query whether buffer object caching control is available. Automatically skips through igt_require() if not.

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -1813,16 +2165,23 @@
    +

    gem_has_ring ()

    +
    bool
    +gem_has_ring (int fd,
    +              unsigned  ring);
    +
    +
    +

    gem_require_ring ()

    void
     gem_require_ring (int fd,
    -                  int ring_id);
    + unsigned ring);

    Feature test macro to query whether a specific ring is available. -In contrast to gem_has_enable_ring() this automagically skips if the ring -isn't available by calling igt_require().

    +This automagically skips if the ring isn't available by +calling igt_require().

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -1835,7 +2194,7 @@ - + @@ -1845,6 +2204,52 @@
    +

    gem_has_mocs_registers ()

    +
    bool
    +gem_has_mocs_registers (int fd);
    +

    Feature test macro to query whether the device has MOCS registers. +These exist gen 9+.

    +
    +

    Parameters

    +
     

    ring_id

    ring

    ring flag bit as used in gem_execbuf()

     
    +++++ + + + + + +

    fd

    open i915 drm file descriptor

     
    +
    +
    +
    +
    +

    gem_require_mocs_registers ()

    +
    void
    +gem_require_mocs_registers (int fd);
    +

    Feature test macro to query whether the device has MOCS registers. +These exist gen 9+.

    +
    +

    Parameters

    +
    +++++ + + + + + +

    fd

    open i915 drm file descriptor

     
    +
    +
    +
    +

    prime_handle_to_fd ()

    int
     prime_handle_to_fd (int fd,
    @@ -1853,8 +2258,8 @@
     object into a global (i.e. potentially cross-device) dma-buf file-descriptor
     handle.

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -1875,12 +2280,47 @@
    -

    Returns

    +

    Returns

    The created dma-buf fd handle.


    +

    prime_handle_to_fd_for_mmap ()

    +
    int
    +prime_handle_to_fd_for_mmap (int fd,
    +                             uint32_t handle);
    +

    Same as prime_handle_to_fd above but with DRM_RDWR capabilities, which can +be useful for writing into the mmap'ed dma-buf file-descriptor.

    +
    +

    Parameters

    +
    +++++ + + + + + + + + + + + + +

    fd

    open i915 drm file descriptor

     

    handle

    file-private gem buffer object handle

     
    +
    +
    +

    Returns

    +

    The created dma-buf fd handle or -1 if the ioctl fails.

    +
    +
    +
    +

    prime_fd_to_handle ()

    uint32_t
     prime_fd_to_handle (int fd,
    @@ -1888,8 +2328,8 @@
     

    This wraps the PRIME_FD_TO_HANDLE ioctl, which is used to import a dma-buf file-descriptor into a gem buffer object.

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -1910,7 +2350,7 @@
    -

    Returns

    +

    Returns

    The created gem buffer object handle.

    @@ -1923,8 +2363,8 @@ dma-buf. Not all kernels support this, which is check with igt_require() and so will result in automagic test skipping.

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -1938,12 +2378,56 @@
    -

    Returns

    +

    Returns

    The lifetime-invariant size of the dma-buf object.


    +

    prime_sync_start ()

    +
    void
    +prime_sync_start (int dma_buf_fd,
    +                  bool write);
    +
    +

    Parameters

    +
    +++++ + + + + + +

    dma_buf_fd

    dma-buf fd handle

     
    +
    +
    +
    +
    +

    prime_sync_end ()

    +
    void
    +prime_sync_end (int dma_buf_fd,
    +                bool write);
    +
    +

    Parameters

    +
    +++++ + + + + + +

    dma_buf_fd

    dma-buf fd handle

     
    +
    +
    +
    +

    local_fourcc_mod_code()

    #define             local_fourcc_mod_code(vendor, val)
    @@ -1954,8 +2438,8 @@ igt_require_fb_modifiers (int fd);

    Requires presence of DRM_CAP_ADDFB2_MODIFIERS.

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -1987,6 +2471,92 @@
    +

    LOCAL_I915_GEM_USERPTR

    +
    #define LOCAL_I915_GEM_USERPTR       0x33
    +
    +
    +
    +
    +

    LOCAL_IOCTL_I915_GEM_USERPTR

    +
    #define LOCAL_IOCTL_I915_GEM_USERPTR DRM_IOWR (DRM_COMMAND_BASE + LOCAL_I915_GEM_USERPTR, struct local_i915_gem_userptr)
    +
    +
    +
    +
    +

    struct local_i915_gem_userptr

    +
    struct local_i915_gem_userptr {
    +	uint64_t user_ptr;
    +	uint64_t user_size;
    +	uint32_t flags;
    +#define LOCAL_I915_USERPTR_READ_ONLY (1<<0)
    +#define LOCAL_I915_USERPTR_UNSYNCHRONIZED (1<<31)
    +	uint32_t handle;
    +};
    +
    +
    +
    +
    +

    struct local_dma_buf_sync

    +
    struct local_dma_buf_sync {
    +	uint64_t flags;
    +};
    +
    +
    +
    +
    +

    LOCAL_DMA_BUF_SYNC_READ

    +
    #define LOCAL_DMA_BUF_SYNC_READ      (1 << 0)
    +
    +
    +
    +
    +

    LOCAL_DMA_BUF_SYNC_WRITE

    +
    #define LOCAL_DMA_BUF_SYNC_WRITE     (2 << 0)
    +
    +
    +
    +
    +

    LOCAL_DMA_BUF_SYNC_RW

    +
    #define LOCAL_DMA_BUF_SYNC_RW        (LOCAL_DMA_BUF_SYNC_READ | LOCAL_DMA_BUF_SYNC_WRITE)
    +
    +
    +
    +
    +

    LOCAL_DMA_BUF_SYNC_START

    +
    #define LOCAL_DMA_BUF_SYNC_START     (0 << 2)
    +
    +
    +
    +
    +

    LOCAL_DMA_BUF_SYNC_END

    +
    #define LOCAL_DMA_BUF_SYNC_END       (1 << 2)
    +
    +
    +
    +
    +

    LOCAL_DMA_BUF_SYNC_VALID_FLAGS_MASK

    +
    #define             LOCAL_DMA_BUF_SYNC_VALID_FLAGS_MASK
    +
    +
    +
    +

    LOCAL_DMA_BUF_BASE

    +
    #define LOCAL_DMA_BUF_BASE 'b'
    +
    +
    +
    +
    +

    LOCAL_DMA_BUF_IOCTL_SYNC

    +
    #define LOCAL_DMA_BUF_IOCTL_SYNC _IOW(LOCAL_DMA_BUF_BASE, 0, struct local_dma_buf_sync)
    +
    +
    +
    +
    +

    DRM_RDWR

    +
    #define DRM_RDWR O_RDWR
    +
    +
    +
    +

    struct local_drm_mode_fb_cmd2

    struct local_drm_mode_fb_cmd2 {
     	uint32_t fb_id;
    @@ -2050,6 +2620,6 @@
     
    +
    Generated by GTK-Doc V1.25.1 \ No newline at end of file diff -Nru intel-gpu-tools-1.13/docs/reference/intel-gpu-tools/html/intel-gpu-tools-IO.html intel-gpu-tools-1.15/docs/reference/intel-gpu-tools/html/intel-gpu-tools-IO.html --- intel-gpu-tools-1.13/docs/reference/intel-gpu-tools/html/intel-gpu-tools-IO.html 2015-12-02 16:48:05.000000000 +0000 +++ intel-gpu-tools-1.15/docs/reference/intel-gpu-tools/html/intel-gpu-tools-IO.html 2016-05-31 17:09:21.000000000 +0000 @@ -3,12 +3,12 @@ I/O: intel-gpu-tools Reference Manual - + - + @@ -33,7 +33,7 @@

    Functions

    -
    +
    @@ -228,7 +228,7 @@

    Types and Values

    -
    +
    @@ -264,8 +264,8 @@

    pci_dev can be obtained from intel_get_pci_device().

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -289,8 +289,8 @@ the same code to get reused for dumping and decoding from running hardware as from register dumps.

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -317,8 +317,8 @@

    pci_dev can be obtained from intel_get_pci_device().

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -358,8 +358,8 @@

    Compared to INREG() it can do optional checking with the register access white lists.

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -373,7 +373,7 @@
    -

    Returns

    +

    Returns

    The value read from the register.

    @@ -389,8 +389,8 @@

    Compared to OUTREG() it can do optional checking with the register access white lists.

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -417,7 +417,7 @@
    int
     intel_register_access_needs_fakewake (void);
    -

    Returns

    +

    Returns

    Non-zero when forcewake initialization failed.

    @@ -431,8 +431,8 @@ new register access helper is initialized with intel_register_access_init().

    This function directly accesses the igt_global_mmio without safety checks.

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -446,7 +446,7 @@
    -

    Returns

    +

    Returns

    The value read from the register.

    @@ -460,8 +460,8 @@ new register access helper is initialized with intel_register_access_init().

    This function directly accesses the igt_global_mmio without safety checks.

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -475,7 +475,7 @@
    -

    Returns

    +

    Returns

    The value read from the register.

    @@ -489,8 +489,8 @@ new register access helper is initialized with intel_register_access_init().

    This function directly accesses the igt_global_mmio without safety checks.

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -504,7 +504,7 @@
    -

    Returns

    +

    Returns

    The value read from the register.

    @@ -521,8 +521,8 @@ intel_register_access_init().

    This function directly accesses the igt_global_mmio without safety checks.

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -556,8 +556,8 @@ intel_register_access_init().

    This function directly accesses the igt_global_mmio without safety checks.

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -591,8 +591,8 @@ intel_register_access_init().

    This function directly accesses the igt_global_mmio without safety checks.

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -622,8 +622,8 @@

    32-bit read of the register at offset through the DPIO sideband port.

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -644,7 +644,7 @@
    -

    Returns

    +

    Returns

    The value read from the register.

    @@ -658,8 +658,8 @@

    32-bit write of the register at offset through the DPIO sideband port.

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -722,8 +722,8 @@

    32-bit read of the register at offset through the P-Unit sideband port.

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -744,7 +744,7 @@
    -

    Returns

    +

    Returns

    0 when the register access succeeded, negative errno code on failure.

    @@ -757,8 +757,8 @@

    32-bit write of the register at offset through the P-Unit sideband port.

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -779,7 +779,7 @@
    -

    Returns

    +

    Returns

    0 when the register access succeeded, negative errno code on failure.

    @@ -792,8 +792,8 @@

    32-bit read of the register at offset through the NC sideband port.

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -814,7 +814,7 @@
    -

    Returns

    +

    Returns

    0 when the register access succeeded, negative errno code on failure.

    @@ -827,8 +827,8 @@

    32-bit write of the register at offset through the NC sideband port.

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -849,7 +849,7 @@
    -

    Returns

    +

    Returns

    0 when the register access succeeded, negative errno code on failure.

    @@ -866,6 +866,6 @@ +
    Generated by GTK-Doc V1.25.1 \ No newline at end of file diff -Nru intel-gpu-tools-1.13/docs/reference/intel-gpu-tools/html/intel-gpu-tools-KMS.html intel-gpu-tools-1.15/docs/reference/intel-gpu-tools/html/intel-gpu-tools-KMS.html --- intel-gpu-tools-1.13/docs/reference/intel-gpu-tools/html/intel-gpu-tools-KMS.html 2015-12-02 16:48:05.000000000 +0000 +++ intel-gpu-tools-1.15/docs/reference/intel-gpu-tools/html/intel-gpu-tools-KMS.html 2016-05-31 17:09:21.000000000 +0000 @@ -3,12 +3,12 @@ KMS: intel-gpu-tools Reference Manual - + - + @@ -33,7 +33,7 @@

    Functions

    -
    +
    @@ -154,6 +154,14 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -384,12 +474,19 @@ igt_kms_get_base_edid () + + + +
    +bool + +kmstest_probe_connector_config () +
    void @@ -186,6 +194,38 @@
    +int + +kmstest_get_crtc_idx () +
    +uint32_t + +kmstest_find_crtc_for_connector () +
    +uint32_t + +kmstest_dumb_create () +
    +void * + +kmstest_dumb_map_buffer () +
    void @@ -273,6 +313,38 @@
    +bool + +igt_pipe_get_property () +
    +void + +igt_pipe_set_degamma_lut () +
    +void + +igt_pipe_set_ctm_matrix () +
    +void + +igt_pipe_set_gamma_lut () +
    void @@ -362,6 +434,24 @@
    #define +igt_atomic_populate_plane_req() +
    #define +igt_atomic_populate_crtc_req() +
    #define +igt_atomic_populate_connector_req() +
    void
    const unsigned char * + +igt_kms_get_alt_edid () +

    Types and Values

    -
    +
    @@ -408,6 +505,14 @@ + + + + + + + + @@ -420,6 +525,10 @@ + + + + @@ -485,8 +594,8 @@
    const char *
     kmstest_pipe_name (enum pipe pipe);
    -

    Parameters

    -
    port
    enumigt_atomic_crtc_properties
    enumigt_atomic_connector_properties
    struct kmstest_connector_config
    igt_commit_style
    enumigt_atomic_plane_properties
    typedef igt_display_t
    +

    Parameters

    +
    @@ -500,7 +609,7 @@
    -

    Returns

    +

    Returns

    String represnting pipe , e.g. "A".

    @@ -511,8 +620,8 @@
    const char *
     kmstest_plane_name (enum igt_plane plane);
    -

    Parameters

    -
    +

    Parameters

    +
    @@ -526,7 +635,7 @@
    -

    Returns

    +

    Returns

    String represnting pipe , e.g. "plane1".

    @@ -537,8 +646,8 @@
    #define kmstest_port_name(port) ((port) + 'A')
     
    -

    Parameters

    -
    +

    Parameters

    +
    @@ -552,7 +661,7 @@
    -

    Returns

    +

    Returns

    String representing port , e.g. "A".

    @@ -563,8 +672,8 @@
    const char *
     kmstest_encoder_type_str (int type);
    -

    Parameters

    -
    +

    Parameters

    +
    @@ -578,7 +687,7 @@
    -

    Returns

    +

    Returns

    A string representing the drm encoder type .

    @@ -589,8 +698,8 @@
    const char *
     kmstest_connector_status_str (int status);
    -

    Parameters

    -
    +

    Parameters

    +
    @@ -604,7 +713,7 @@
    -

    Returns

    +

    Returns

    A string representing the drm connector status status .

    @@ -615,8 +724,8 @@
    const char *
     kmstest_connector_type_str (int type);
    -

    Parameters

    -
    +

    Parameters

    +
    @@ -630,7 +739,7 @@
    -

    Returns

    +

    Returns

    A string representing the drm connector type .

    @@ -643,8 +752,8 @@

    Prints mode to stdout in a huma-readable form.

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -665,8 +774,8 @@ kmstest_get_pipe_from_crtc_id (int fd, int crtc_id);
    -

    Parameters

    -
    +

    Parameters

    +
    @@ -687,10 +796,12 @@
    -

    Returns

    -

    The pipe number for the given DRM CRTC crtc_id -. This maps directly -to an enum pipe value used in other helper functions.

    +

    Returns

    +

    The crtc index for the given DRM CRTC ID crtc_id +. The crtc index +is the equivalent of the pipe id. This value maps directly to an enum pipe +value used in other helper functions. Returns 0 if the index could not be +determined.


    @@ -720,8 +831,8 @@ enum kmstest_force_connector_state state);

    Force the specified state on the specified connector.

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -748,7 +859,7 @@
    -

    Returns

    +

    Returns

    true on success

    @@ -763,8 +874,8 @@

    Makes a copy of an existing edid block and adds an extension indicating stereo 3D capabilities.

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -810,8 +921,8 @@

    If length is zero, the forced EDID will be removed.

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -855,8 +966,8 @@ and stores it in mode .

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -882,7 +993,7 @@
    -

    Returns

    +

    Returns

    true on success, false on failure

    @@ -898,8 +1009,53 @@ constraint and fills it into config .

    -

    Parameters

    -
    +

    Parameters

    +
    +++++ + + + + + + + + + + + + + + + + + + + + + + +

    drm_fd

    DRM fd

     

    connector_id

    DRM connector id

     

    crtc_idx_mask

    mask of allowed DRM CRTC indices

     

    config

    structure filled with the possible configuration

     
    +
    + +
    +
    +

    kmstest_probe_connector_config ()

    +
    bool
    +kmstest_probe_connector_config (int drm_fd,
    +                                uint32_t connector_id,
    +                                unsigned long  crtc_idx_mask,
    +                                struct kmstest_connector_config *config);
    +

    This tries to find a suitable configuration for the given connector and CRTC +constraint and fills it into config +, fully probing the connector in the +process.

    +
    +

    Parameters

    +
    @@ -938,8 +1094,8 @@

    Free any resources in config allocated in kmstest_get_connector_config().

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -964,8 +1120,8 @@ to mode .

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -1004,8 +1160,8 @@ drmModePropertyPtr *prop);

    Finds a property with the given name on the given object.

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -1052,7 +1208,7 @@
    -

    Returns

    +

    Returns

    true in case we found something.

    @@ -1064,8 +1220,8 @@ drmModeResPtr resources);

    Disables all the screens.

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -1088,6 +1244,142 @@
    +

    kmstest_get_crtc_idx ()

    +
    int
    +kmstest_get_crtc_idx (drmModeRes *res,
    +                      uint32_t crtc_id);
    +

    Get the CRTC index based on its ID. This is useful since a few places of +libdrm deal with CRTC masks.

    +
    +

    Parameters

    +
    +++++ + + + + + + + + + + + + +

    res

    the libdrm resources

     

    crtc_id

    the CRTC id

     
    +
    + +
    +
    +

    kmstest_find_crtc_for_connector ()

    +
    uint32_t
    +kmstest_find_crtc_for_connector (int fd,
    +                                 drmModeRes *res,
    +                                 drmModeConnector *connector,
    +                                 uint32_t crtc_blacklist_idx_mask);
    +
    +

    Parameters

    +
    +++++ + + + + + + + + + + + + + + + + + + + + + + +

    fd

    DRM fd

     

    res

    libdrm resources pointer

     

    connector

    libdrm connector pointer

     

    crtc_blacklist_idx_mask

    a mask of CRTC indexes that we can't return

     
    +
    +
    +

    Returns

    +

    the CRTC ID for a CRTC that fits the connector, otherwise it asserts +false and never returns. The blacklist mask can be used in case you have +CRTCs that are already in use by other connectors.

    +
    +
    +
    +
    +

    kmstest_dumb_create ()

    +
    uint32_t
    +kmstest_dumb_create (int fd,
    +                     int width,
    +                     int height,
    +                     int bpp,
    +                     unsigned *stride,
    +                     unsigned *size);
    +

    This wraps the CREATE_DUMB ioctl, which allocates a new dumb buffer object +for the specified dimensions.

    +
    +

    Parameters

    +
    +++++ + + + + + + + + + + + + + + + + + + + + + + +

    fd

    open drm file descriptor

     

    width

    width of the buffer in pixels

     

    height

    height of the buffer in pixels

     

    bpp

    bytes per pixel of the buffer

     
    +
    +
    +

    Returns

    +

    The file-private handle of the created buffer object

    +
    +
    +
    +
    +

    kmstest_dumb_map_buffer ()

    +
    void *
    +kmstest_dumb_map_buffer (int fd,
    +                         uint32_t handle,
    +                         uint64_t size,
    +                         unsigned  prot);
    +
    +
    +

    igt_display_init ()

    void
     igt_display_init (igt_display_t *display,
    @@ -1096,8 +1388,8 @@
      and allocate the various resources required. Use
     igt_display_fini to release the resources when they are no longer required.

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -1128,8 +1420,8 @@ itself.

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -1159,8 +1451,8 @@ igt_try_display_commit2 instead.

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -1181,7 +1473,7 @@
    -

    Returns

    +

    Returns

    0 upon success. This function will never return upon failure since igt_fail() at lower levels will longjmp out of it.

    @@ -1194,8 +1486,8 @@

    Commits framebuffer and positioning changes to all planes of each display pipe.

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -1209,7 +1501,7 @@
    -

    Returns

    +

    Returns

    0 upon success. This function will never return upon failure since igt_fail() at lower levels will longjmp out of it.

    @@ -1231,8 +1523,8 @@ errors returned by this function should take care to restore the display to a sane state after a failure is detected.

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -1253,7 +1545,7 @@
    -

    Returns

    +

    Returns

    0 upon success, otherwise the error code of the first error encountered.

    @@ -1287,8 +1579,8 @@ mode obtained with get connectors. Note that the mode is used without checking if the output supports it, so this might lead to unexpected results.

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -1325,6 +1617,40 @@
    +

    igt_pipe_get_property ()

    +
    bool
    +igt_pipe_get_property (igt_pipe_t *pipe,
    +                       const char *name,
    +                       uint32_t *prop_id,
    +                       uint64_t *value,
    +                       drmModePropertyPtr *prop);
    +
    +
    +
    +

    igt_pipe_set_degamma_lut ()

    +
    void
    +igt_pipe_set_degamma_lut (igt_pipe_t *pipe,
    +                          void *ptr,
    +                          size_t length);
    +
    +
    +
    +

    igt_pipe_set_ctm_matrix ()

    +
    void
    +igt_pipe_set_ctm_matrix (igt_pipe_t *pipe,
    +                         void *ptr,
    +                         size_t length);
    +
    +
    +
    +

    igt_pipe_set_gamma_lut ()

    +
    void
    +igt_pipe_set_gamma_lut (igt_pipe_t *pipe,
    +                        void *ptr,
    +                        size_t length);
    +
    +
    +

    igt_plane_set_fb ()

    void
     igt_plane_set_fb (igt_plane_t *plane,
    @@ -1349,8 +1675,8 @@
     New size will be committed at plane commit time via
     drmModeSetPlane().

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -1402,8 +1728,8 @@ property. For example to get red as background, set background = 0x00000000FFFF.

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -1435,8 +1761,8 @@

    This function sets position for requested framebuffer as src to plane. New position will be committed at plane commit time via drmModeSetPlane().

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -1479,8 +1805,8 @@ to plane. New size will be committed at plane commit time via drmModeSetPlane().

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -1536,6 +1862,117 @@
    +

    igt_atomic_populate_plane_req()

    +
    #define             igt_atomic_populate_plane_req(req, plane, prop, value)
    +
    +

    Parameters

    +
    +++++ + + + + + + + + + + + + + + + + + + + + + + +

    req

    A pointer to drmModeAtomicReq

     

    plane

    A pointer igt_plane_t

     

    prop

    one of igt_atomic_plane_properties

     

    value

    the value to add

     
    +
    +
    +
    +
    +

    igt_atomic_populate_crtc_req()

    +
    #define             igt_atomic_populate_crtc_req(req, output, prop, value)
    +
    +

    Parameters

    +
    +++++ + + + + + + + + + + + + + + + + + + + + + + +

    req

    A pointer to drmModeAtomicReq

     

    output

    A pointer igt_output_t

     

    prop

    one of igt_atomic_crtc_properties

     

    value

    the value to add

     
    +
    +
    +
    +
    +

    igt_atomic_populate_connector_req()

    +
    #define             igt_atomic_populate_connector_req(req, output, prop, value)
    +
    +

    Parameters

    +
    +++++ + + + + + + + + + + + + + + + + + + + + + + +

    req

    A pointer to drmModeAtomicReq

     

    output

    A pointer igt_output_t

     

    prop

    one of igt_atomic_connector_properties

     

    value

    the value to add

     
    +
    +
    +
    +

    igt_enable_connectors ()

    void
     igt_enable_connectors (void);
    @@ -1567,18 +2004,39 @@

    This can be extended with further features using functions such as kmstest_edid_add_3d.

    -

    Returns

    +

    Returns

    a basic edid block

    +
    +
    +

    igt_kms_get_alt_edid ()

    +
    const unsigned char *
    +igt_kms_get_alt_edid (void);
    +

    Get an alternate edid block, which includes the following modes:

    +
      +
    • 1400x1050 60Hz

    • +
    • 1920x1080 60Hz

    • +
    • 1280x720 60Hz

    • +
    • 1024x768 60Hz

    • +
    • 800x600 60Hz

    • +
    • 640x480 60Hz

    • +
    +

    This can be extended with further features using functions such as +kmstest_edid_add_3d.

    +
    +

    Returns

    +

    an alternate edid block

    +
    +

    Types and Values

    enum pipe

    -

    Members

    -
    +

    Members

    +
    @@ -1618,8 +2076,8 @@

    enum igt_plane

    -

    Members

    -
    +

    Members

    +
    @@ -1651,6 +2109,11 @@ + + + + +
       

    IGT_MAX_PLANES

      
    @@ -1659,8 +2122,8 @@

    enum port

    -

    Members

    -
    +

    Members

    +
    @@ -1703,12 +2166,90 @@
    +

    enum igt_atomic_crtc_properties

    +
    +

    Members

    +
    +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    IGT_CRTC_BACKGROUND

      

    IGT_CRTC_CTM

      

    IGT_CRTC_DEGAMMA_LUT

      

    IGT_CRTC_GAMMA_LUT

      

    IGT_NUM_CRTC_PROPS

      
    +
    +
    +
    +
    +

    enum igt_atomic_connector_properties

    +
    +

    Members

    +
    +++++ + + + + + + + + + + + + + + + + + +

    IGT_CONNECTOR_SCALING_MODE

      

    IGT_CONNECTOR_DPMS

      

    IGT_NUM_CONNECTOR_PROPS

      
    +
    +
    +
    +

    struct kmstest_connector_config

    struct kmstest_connector_config {
     	drmModeCrtc *crtc;
     	drmModeConnector *connector;
     	drmModeEncoder *encoder;
     	drmModeModeInfo default_mode;
    +	uint64_t connector_scaling_mode;
    +	bool connector_scaling_mode_changed;
    +	uint64_t connector_dpms;
    +	bool connector_dpms_changed;
    +	uint32_t atomic_props_crtc[IGT_NUM_CRTC_PROPS];
    +	uint32_t atomic_props_connector[IGT_NUM_CONNECTOR_PROPS];
     	int crtc_idx;
     	int pipe;
     };
    @@ -1718,8 +2259,8 @@
     

    enum kmstest_force_connector_state

    -

    Members

    -
    +

    Members

    +
    @@ -1762,8 +2303,8 @@

    enum igt_commit_style

    -

    Members

    -
    +

    Members

    +
    @@ -1780,6 +2321,92 @@ + + + + + + +
       

    COMMIT_ATOMIC

      
    +
    +
    +
    +
    +

    enum igt_atomic_plane_properties

    +
    +

    Members

    +
    +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    IGT_PLANE_SRC_X

      

    IGT_PLANE_SRC_Y

      

    IGT_PLANE_SRC_W

      

    IGT_PLANE_SRC_H

      

    IGT_PLANE_CRTC_X

      

    IGT_PLANE_CRTC_Y

      

    IGT_PLANE_CRTC_W

      

    IGT_PLANE_CRTC_H

      

    IGT_PLANE_FB_ID

      

    IGT_PLANE_CRTC_ID

      

    IGT_PLANE_TYPE

      

    IGT_PLANE_ROTATION

      

    IGT_NUM_PLANE_PROPS

      
    @@ -1806,8 +2433,8 @@

    enum igt_rotation_t

    -

    Members

    -
    +

    Members

    +
    @@ -1852,12 +2479,21 @@ igt_display_t *display; enum pipe pipe; bool enabled; -#define IGT_MAX_PLANES 4 int n_planes; igt_plane_t planes[IGT_MAX_PLANES]; uint64_t background; /* Background color MSB BGR 16bpc LSB */ uint32_t background_changed : 1; uint32_t background_property; + + uint64_t degamma_blob; + uint32_t degamma_property; + uint64_t ctm_blob; + uint32_t ctm_property; + uint64_t gamma_blob; + uint32_t gamma_property; + uint32_t color_mgmt_changed : 1; + + uint32_t crtc_id; }; @@ -1880,6 +2516,7 @@ igt_output_t *outputs; igt_pipe_t pipes[I915_MAX_PIPES]; bool has_universal_planes; + bool is_atomic; }; @@ -1892,6 +2529,6 @@ +
    Generated by GTK-Doc V1.25.1 \ No newline at end of file diff -Nru intel-gpu-tools-1.13/docs/reference/intel-gpu-tools/html/intel-gpu-tools-Power-Management.html intel-gpu-tools-1.15/docs/reference/intel-gpu-tools/html/intel-gpu-tools-Power-Management.html --- intel-gpu-tools-1.13/docs/reference/intel-gpu-tools/html/intel-gpu-tools-Power-Management.html 1970-01-01 00:00:00.000000000 +0000 +++ intel-gpu-tools-1.15/docs/reference/intel-gpu-tools/html/intel-gpu-tools-Power-Management.html 2016-05-31 17:09:21.000000000 +0000 @@ -0,0 +1,148 @@ + + + + +Power Management: intel-gpu-tools Reference Manual + + + + + + + + + +
    + + + + + + +
    +
    +
    + + +
    +

    Power Management

    +

    Power Management — Power Management related helpers

    +
    +
    +

    Functions

    +
    ++++ + + + + + + + + + + + + + + +
    +void + +igt_pm_enable_audio_runtime_pm () +
    +int8_t * + +igt_pm_enable_sata_link_power_management () +
    +void + +igt_pm_restore_sata_link_power_management () +
    +
    +
    +

    Includes

    +
    #include <igt.h>
    +
    +
    +
    +

    Description

    +

    This library provides various helpers to enable power management for, +and in some cases subsequently allow restoring the old behaviour of, +various external components that by default are set up in a way +that interferes with the testing of our power management functionality.

    +
    +
    +

    Functions

    +
    +

    igt_pm_enable_audio_runtime_pm ()

    +
    void
    +igt_pm_enable_audio_runtime_pm (void);
    +

    We know that if we don't enable audio runtime PM, snd_hda_intel will never +release its power well refcount, and we'll never reach the LPSP state. +There's no guarantee that it will release the power well if we enable +runtime PM, but at least we can try.

    +

    We don't have any assertions on open since the user may not even have +snd_hda_intel loaded, which is not a problem.

    +
    +
    +
    +

    igt_pm_enable_sata_link_power_management ()

    +
    int8_t *
    +igt_pm_enable_sata_link_power_management
    +                               (void);
    +

    Enable the min_power policy for SATA link power management. +Without this we cannot reach deep runtime power states.

    +

    We don't have any assertions on open since the system might not have +a SATA host.

    +
    +

    Returns

    +

    An opaque pointer to the data needed to restore the default values +after the test has terminated, or NULL if SATA link power management +is not supported. This pointer should be freed when no longer used +(typically after having called restore_sata_link_power_management()).

    +
    +
    +
    +
    +

    igt_pm_restore_sata_link_power_management ()

    +
    void
    +igt_pm_restore_sata_link_power_management
    +                               (int8_t *pm_data);
    +

    Restore the link power management policies to the values +prior to enabling min_power.

    +

    Caveat: If the system supports hotplugging and hotplugging takes + place during our testing so that the hosts change numbers + we might restore the settings to the wrong hosts.

    +
    +

    Parameters

    +
    +++++ + + + + + +

    pm_data

    An opaque pointer with saved link PM policies; +If NULL is passed we force enable the "max_performance" policy.

     
    +
    +
    +
    +
    +

    Types and Values

    +
    +
    + + + \ No newline at end of file diff -Nru intel-gpu-tools-1.13/docs/reference/intel-gpu-tools/html/intel-gpu-tools-Stats.html intel-gpu-tools-1.15/docs/reference/intel-gpu-tools/html/intel-gpu-tools-Stats.html --- intel-gpu-tools-1.13/docs/reference/intel-gpu-tools/html/intel-gpu-tools-Stats.html 2015-12-02 16:48:05.000000000 +0000 +++ intel-gpu-tools-1.15/docs/reference/intel-gpu-tools/html/intel-gpu-tools-Stats.html 2016-05-31 17:09:21.000000000 +0000 @@ -3,12 +3,12 @@ Stats: intel-gpu-tools Reference Manual - + - + @@ -33,7 +33,7 @@

    Functions

    -
    +
    @@ -196,15 +196,25 @@

    Types and Values

    -
    +
    - + + - + + + + + + + + + +
      igt_stats_t
    structigt_mean
    double delta
    @@ -238,22 +248,22 @@ 14 15 16
    igt_stats_t stats;
    +        
    igt_stats_t stats;
     
    -igt_stats_init(&stats, 8);
    +igt_stats_init(&stats, 8);
     
    -igt_stats_push(&stats, 2);
    -igt_stats_push(&stats, 4);
    -igt_stats_push(&stats, 4);
    -igt_stats_push(&stats, 4);
    -igt_stats_push(&stats, 5);
    -igt_stats_push(&stats, 5);
    -igt_stats_push(&stats, 7);
    -igt_stats_push(&stats, 9);
    +igt_stats_push(&stats, 2);
    +igt_stats_push(&stats, 4);
    +igt_stats_push(&stats, 4);
    +igt_stats_push(&stats, 4);
    +igt_stats_push(&stats, 5);
    +igt_stats_push(&stats, 5);
    +igt_stats_push(&stats, 7);
    +igt_stats_push(&stats, 9);
     
    -printf("Mean: %lf\n", igt_stats_get_mean(&stats));
    +printf("Mean: %lf\n", igt_stats_get_mean(&stats));
     
    -igt_stats_fini(&stats);
    @@ -271,8 +281,8 @@ finished with stats .

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -299,8 +309,8 @@

    igt_stats_fini() must be called once finished with stats .

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -329,8 +339,8 @@ igt_stats_fini (igt_stats_t *stats);

    Frees resources allocated in igt_stats_init().

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -350,8 +360,8 @@
    bool
     igt_stats_is_population (igt_stats_t *stats);
    -

    Parameters

    -
    +

    Parameters

    +
    @@ -365,7 +375,7 @@
    -

    Returns

    +

    Returns

    true if stats represents a population, false if only a sample.

    See igt_stats_set_population() for more details.

    @@ -395,8 +405,8 @@

    When newly created, stats defaults to holding sample data.

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -428,8 +438,8 @@ dataset and converts the igt_stats from an integer collection to a floating point one.

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -467,8 +477,8 @@

    Adds an array of values to the stats dataset.

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -502,8 +512,8 @@

    Retrieves the minimal value in stats

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -525,8 +535,8 @@

    Retrieves the maximum value in stats

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -552,8 +562,8 @@ can be extreme minimal and maximum values that are just anomalies. Prefer the interquatile range (see igt_stats_get_iqr()) or an histogram.

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -579,8 +589,8 @@ stats dataset.

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -621,8 +631,8 @@ (IQR) of the stats dataset.

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -650,8 +660,8 @@ and calculates the mean value of the remaining central values.

    It's useful to hide outliers in measurements (due to cold cache etc).

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -673,8 +683,8 @@

    Retrieves the mean of the stats dataset.

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -699,8 +709,8 @@

    The trimean is a the most efficient 3-point L-estimator, even more robust than the median at estimating the average of a sample population.

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -722,8 +732,8 @@

    Retrieves the median of the stats dataset.

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -745,8 +755,8 @@

    Retrieves the variance of the stats dataset.

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -768,8 +778,8 @@

    Retrieves the standard deviation of the stats dataset.

    -

    Parameters

    -
    +

    Parameters

    +
    @@ -798,8 +808,8 @@ } igt_stats_t;
    -

    Members

    -
    +

    Members

    +
    @@ -820,9 +830,24 @@
    +
    +
    +

    struct igt_mean

    +
    struct igt_mean {
    +	double mean, sq, min, max;
    +	unsigned long count;
    +};
    +
    +
    +
    +
    +

    delta

    +
    	double delta = v - m->mean;
    +
    +
    +
    Generated by GTK-Doc V1.25.1 \ No newline at end of file diff -Nru intel-gpu-tools-1.13/docs/reference/intel-gpu-tools/html/test-programs.html intel-gpu-tools-1.15/docs/reference/intel-gpu-tools/html/test-programs.html --- intel-gpu-tools-1.13/docs/reference/intel-gpu-tools/html/test-programs.html 2015-12-02 16:48:05.000000000 +0000 +++ intel-gpu-tools-1.15/docs/reference/intel-gpu-tools/html/test-programs.html 2016-05-31 17:09:21.000000000 +0000 @@ -3,12 +3,12 @@ Test Programs: intel-gpu-tools Reference Manual - + - + @@ -129,6 +129,6 @@ +
    Generated by GTK-Doc V1.25.1 \ No newline at end of file diff -Nru intel-gpu-tools-1.13/docs/reference/intel-gpu-tools/intel-gpu-tools-docs.xml intel-gpu-tools-1.15/docs/reference/intel-gpu-tools/intel-gpu-tools-docs.xml --- intel-gpu-tools-1.13/docs/reference/intel-gpu-tools/intel-gpu-tools-docs.xml 2015-11-12 17:30:48.000000000 +0000 +++ intel-gpu-tools-1.15/docs/reference/intel-gpu-tools/intel-gpu-tools-docs.xml 2016-05-23 10:51:28.000000000 +0000 @@ -24,6 +24,7 @@ + diff -Nru intel-gpu-tools-1.13/docs/reference/intel-gpu-tools/Makefile.am intel-gpu-tools-1.15/docs/reference/intel-gpu-tools/Makefile.am --- intel-gpu-tools-1.13/docs/reference/intel-gpu-tools/Makefile.am 2015-12-02 15:13:14.000000000 +0000 +++ intel-gpu-tools-1.15/docs/reference/intel-gpu-tools/Makefile.am 2016-05-23 10:51:28.000000000 +0000 @@ -126,9 +126,9 @@ # e.g. IGNORE_HFILES=gtkdebug.h gtkintl.h private_code IGNORE_HFILES=gen6_render.h gen7_media.h gen7_render.h gen8_media.h \ gen8_render.h gpgpu_fill.h i830_reg.h i915_3d.h i915_pciids.h \ - i915_reg.h intel_reg.h debug.h instdone.h media_fill.h \ - rendercopy.h media_spin.h media_fill_gen9.h gen9_render.h \ - version.h + i915_reg.h igt_edid_template.h intel_reg.h debug.h instdone.h \ + media_fill.h rendercopy.h media_spin.h media_fill_gen9.h \ + gen9_render.h version.h # Images to copy into HTML directory. # e.g. HTML_IMAGES=$(top_srcdir)/gtk/stock-icons/stock_about_24.png diff -Nru intel-gpu-tools-1.13/docs/reference/intel-gpu-tools/Makefile.in intel-gpu-tools-1.15/docs/reference/intel-gpu-tools/Makefile.in --- intel-gpu-tools-1.13/docs/reference/intel-gpu-tools/Makefile.in 2015-12-02 16:47:58.000000000 +0000 +++ intel-gpu-tools-1.15/docs/reference/intel-gpu-tools/Makefile.in 2016-05-31 17:03:32.000000000 +0000 @@ -93,6 +93,7 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ +target_triplet = @target@ subdir = docs/reference/intel-gpu-tools ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/as-compiler-flag.m4 \ @@ -164,6 +165,8 @@ DRM_LIBS = @DRM_LIBS@ DRM_NOUVEAU_CFLAGS = @DRM_NOUVEAU_CFLAGS@ DRM_NOUVEAU_LIBS = @DRM_NOUVEAU_LIBS@ +DRM_VC4_CFLAGS = @DRM_VC4_CFLAGS@ +DRM_VC4_LIBS = @DRM_VC4_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -208,6 +211,7 @@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MAN_SUBSTS = @MAN_SUBSTS@ @@ -252,6 +256,7 @@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ THREAD_CFLAGS = @THREAD_CFLAGS@ +TIMER_LIBS = @TIMER_LIBS@ VERSION = @VERSION@ XORG_MAN_PAGE = @XORG_MAN_PAGE@ XRANDR_CFLAGS = @XRANDR_CFLAGS@ @@ -306,11 +311,16 @@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ +target = @target@ target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ @@ -376,9 +386,9 @@ # e.g. IGNORE_HFILES=gtkdebug.h gtkintl.h private_code IGNORE_HFILES = gen6_render.h gen7_media.h gen7_render.h gen8_media.h \ gen8_render.h gpgpu_fill.h i830_reg.h i915_3d.h i915_pciids.h \ - i915_reg.h intel_reg.h debug.h instdone.h media_fill.h \ - rendercopy.h media_spin.h media_fill_gen9.h gen9_render.h \ - version.h + i915_reg.h igt_edid_template.h intel_reg.h debug.h instdone.h \ + media_fill.h rendercopy.h media_spin.h media_fill_gen9.h \ + gen9_render.h version.h # Images to copy into HTML directory. diff -Nru intel-gpu-tools-1.13/docs/reference/Makefile.in intel-gpu-tools-1.15/docs/reference/Makefile.in --- intel-gpu-tools-1.13/docs/reference/Makefile.in 2015-12-02 16:47:58.000000000 +0000 +++ intel-gpu-tools-1.15/docs/reference/Makefile.in 2016-05-31 17:03:32.000000000 +0000 @@ -87,6 +87,7 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ +target_triplet = @target@ subdir = docs/reference ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/as-compiler-flag.m4 \ @@ -217,6 +218,8 @@ DRM_LIBS = @DRM_LIBS@ DRM_NOUVEAU_CFLAGS = @DRM_NOUVEAU_CFLAGS@ DRM_NOUVEAU_LIBS = @DRM_NOUVEAU_LIBS@ +DRM_VC4_CFLAGS = @DRM_VC4_CFLAGS@ +DRM_VC4_LIBS = @DRM_VC4_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -261,6 +264,7 @@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MAN_SUBSTS = @MAN_SUBSTS@ @@ -305,6 +309,7 @@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ THREAD_CFLAGS = @THREAD_CFLAGS@ +TIMER_LIBS = @TIMER_LIBS@ VERSION = @VERSION@ XORG_MAN_PAGE = @XORG_MAN_PAGE@ XRANDR_CFLAGS = @XRANDR_CFLAGS@ @@ -359,11 +364,16 @@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ +target = @target@ target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ diff -Nru intel-gpu-tools-1.13/lib/drmtest.c intel-gpu-tools-1.15/lib/drmtest.c --- intel-gpu-tools-1.13/lib/drmtest.c 2015-12-02 15:13:13.000000000 +0000 +++ intel-gpu-tools-1.15/lib/drmtest.c 2016-05-23 10:51:28.000000000 +0000 @@ -90,7 +90,7 @@ return -1; } -static bool is_i915_device(int fd) +bool is_i915_device(int fd) { int ret; char name[5] = ""; @@ -100,7 +100,17 @@ return !ret && strcmp("i915", name) == 0; } -static bool is_intel(int fd) +static bool is_vc4_device(int fd) +{ + int ret; + char name[5] = ""; + + ret = __get_drm_device_name(fd, name); + + return !ret && strcmp("vc4", name) == 0; +} + +static bool has_known_intel_chipset(int fd) { struct drm_i915_getparam gp; int devid = 0; @@ -119,18 +129,6 @@ return true; } -static void check_stop_rings(void) -{ - enum stop_ring_flags flags; - flags = igt_get_stop_rings(); - igt_warn_on_f(flags != 0, - "i915_ring_stop flags on exit 0x%x, can't quiescent gpu cleanly\n", - flags); - - if (flags) - igt_set_stop_rings(STOP_RING_NONE); -} - #define LOCAL_I915_EXEC_VEBOX (4 << 0) /** * gem_quiescent_gpu: @@ -146,41 +144,33 @@ */ void gem_quiescent_gpu(int fd) { - uint32_t batch[2] = {MI_BATCH_BUFFER_END, 0}; + uint32_t bbe = MI_BATCH_BUFFER_END; struct drm_i915_gem_execbuffer2 execbuf; - struct drm_i915_gem_exec_object2 gem_exec[1]; - - check_stop_rings(); + struct drm_i915_gem_exec_object2 obj; + unsigned ring; - memset(gem_exec, 0, sizeof(gem_exec)); - gem_exec[0].handle = gem_create(fd, 4096); - gem_write(fd, gem_exec[0].handle, 0, batch, sizeof(batch)); + memset(&obj, 0, sizeof(obj)); + obj.handle = gem_create(fd, 4096); + gem_write(fd, obj.handle, 0, &bbe, sizeof(&bbe)); memset(&execbuf, 0, sizeof(execbuf)); - execbuf.buffers_ptr = (uintptr_t)gem_exec; + execbuf.buffers_ptr = (uintptr_t)&obj; execbuf.buffer_count = 1; - execbuf.flags = I915_EXEC_RENDER; - gem_execbuf(fd, &execbuf); - - if (gem_has_blt(fd)) { - execbuf.flags = I915_EXEC_BLT; - gem_execbuf(fd, &execbuf); + for (ring = 0; ring < 1<<6; ring++) { + execbuf.flags = ring; + __gem_execbuf(fd, &execbuf); } - if (gem_has_bsd(fd)) { - execbuf.flags = I915_EXEC_BSD; - gem_execbuf(fd, &execbuf); + if (gem_has_bsd2(fd)) { + execbuf.flags = I915_EXEC_BSD | (2 << 13); + __gem_execbuf(fd, &execbuf); } - if (gem_has_vebox(fd)) { - execbuf.flags = LOCAL_I915_EXEC_VEBOX; - gem_execbuf(fd, &execbuf); - } + gem_sync(fd, obj.handle); + gem_close(fd, obj.handle); - gem_sync(fd, gem_exec[0].handle); igt_drop_caches_set(DROP_RETIRE); - gem_close(fd, gem_exec[0].handle); } /** @@ -209,7 +199,7 @@ if (fd == -1) continue; - if (!is_i915_device(fd) || !is_intel(fd)) { + if (!is_i915_device(fd) || !has_known_intel_chipset(fd)) { close(fd); continue; } @@ -237,16 +227,20 @@ for (int i = 0; i < 16; i++) { char name[80]; int fd; - bool found_intel; + bool found_intel, found_vc4; sprintf(name, "/dev/dri/card%u", i); fd = open(name, O_RDWR); if (fd == -1) continue; - found_intel = is_i915_device(fd) && is_intel(fd) && (chipset & DRIVER_INTEL); + found_intel = is_i915_device(fd) && + has_known_intel_chipset(fd) && + (chipset & DRIVER_INTEL); - if ((chipset & DRIVER_ANY) || found_intel) + found_vc4 = is_vc4_device(fd) && (chipset & DRIVER_VC4); + + if ((chipset & DRIVER_ANY) || found_intel || found_vc4) return fd; close(fd); @@ -273,7 +267,7 @@ if (fd == -1) continue; - if (!is_i915_device(fd) || !is_intel(fd)) { + if (!is_i915_device(fd) || !has_known_intel_chipset(fd)) { close(fd); fd = -1; continue; @@ -293,7 +287,6 @@ if (at_exit_drm_fd < 0) return; - check_stop_rings(); gem_quiescent_gpu(at_exit_drm_fd); close(at_exit_drm_fd); at_exit_drm_fd = -1; @@ -304,7 +297,6 @@ if (at_exit_drm_render_fd < 0) return; - check_stop_rings(); gem_quiescent_gpu(at_exit_drm_render_fd); close(at_exit_drm_render_fd); at_exit_drm_render_fd = -1; @@ -329,7 +321,7 @@ if (__sync_fetch_and_add(&open_count, 1)) return fd; - if(chipset & DRIVER_INTEL){ + if(chipset & DRIVER_INTEL){ gem_quiescent_gpu(fd); igt_install_exit_handler(quiescent_gpu_at_exit); } @@ -387,3 +379,8 @@ return fd; } + +void igt_require_intel(int fd) +{ + igt_require(is_i915_device(fd) && has_known_intel_chipset(fd)); +} diff -Nru intel-gpu-tools-1.13/lib/drmtest.h intel-gpu-tools-1.15/lib/drmtest.h --- intel-gpu-tools-1.13/lib/drmtest.h 2015-12-01 17:16:53.000000000 +0000 +++ intel-gpu-tools-1.15/lib/drmtest.h 2016-05-23 10:51:28.000000000 +0000 @@ -40,6 +40,7 @@ #define DRIVER_ANY 0x1 #define DRIVER_INTEL (0x1 << 1) +#define DRIVER_VC4 (0x1 << 2) #ifdef ANDROID #if (!(defined HAVE_MMAP64)) && (!(defined __x86_64__)) @@ -81,6 +82,10 @@ void gem_quiescent_gpu(int fd); +void igt_require_intel(int fd); + +bool is_i915_device(int fd); + /** * do_or_die: * @x: command @@ -101,7 +106,7 @@ * successfully executed. */ #define do_ioctl(fd, ioc, ioc_data) do { \ - igt_assert_eq(drmIoctl((fd), (ioc), (ioc_data)), 0); \ + igt_assert_eq(igt_ioctl((fd), (ioc), (ioc_data)), 0); \ errno = 0; \ } while (0) @@ -116,7 +121,7 @@ * returning a particular value in errno. */ #define do_ioctl_err(fd, ioc, ioc_data, err) do { \ - igt_assert_eq(drmIoctl((fd), (ioc), (ioc_data)), -1); \ + igt_assert_eq(igt_ioctl((fd), (ioc), (ioc_data)), -1); \ igt_assert_eq(errno, err); \ errno = 0; \ } while (0) diff -Nru intel-gpu-tools-1.13/lib/igt_aux.c intel-gpu-tools-1.15/lib/igt_aux.c --- intel-gpu-tools-1.13/lib/igt_aux.c 2015-11-30 16:15:31.000000000 +0000 +++ intel-gpu-tools-1.15/lib/igt_aux.c 2016-05-23 10:51:28.000000000 +0000 @@ -40,7 +40,9 @@ #include #include #include +#include #include +#include #include #include #include @@ -59,6 +61,7 @@ #include "intel_reg.h" #include "ioctl_wrappers.h" #include "igt_kms.h" +#include "igt_pm.h" /** * SECTION:igt_aux @@ -72,6 +75,205 @@ /* signal interrupt helpers */ + +#define MSEC_PER_SEC (1000) +#define USEC_PER_SEC (1000*MSEC_PER_SEC) +#define NSEC_PER_SEC (1000*USEC_PER_SEC) + +/* signal interrupt helpers */ +#define gettid() syscall(__NR_gettid) +#define sigev_notify_thread_id _sigev_un._tid + +static struct __igt_sigiter_global { + pid_t tid; + timer_t timer; + struct timespec offset; + struct { + long hit, miss; + long ioctls, signals; + } stat; +} __igt_sigiter; + +static void sigiter(int sig, siginfo_t *info, void *arg) +{ + __igt_sigiter.stat.signals++; +} + +#if 0 +#define SIG_ASSERT(expr) igt_assert(expr) +#else +#define SIG_ASSERT(expr) +#endif + +static int +sig_ioctl(int fd, unsigned long request, void *arg) +{ + struct itimerspec its; + int ret; + + SIG_ASSERT(__igt_sigiter.timer); + SIG_ASSERT(__igt_sigiter.tid == gettid()); + + memset(&its, 0, sizeof(its)); + if (timer_settime(__igt_sigiter.timer, 0, &its, NULL)) { + /* oops, we didn't undo the interrupter (i.e. !unwound abort) */ + igt_ioctl = drmIoctl; + return drmIoctl(fd, request, arg); + } + + its.it_value = __igt_sigiter.offset; + do { + long serial; + + __igt_sigiter.stat.ioctls++; + + ret = 0; + serial = __igt_sigiter.stat.signals; + igt_assert(timer_settime(__igt_sigiter.timer, 0, &its, NULL) == 0); + if (ioctl(fd, request, arg)) + ret = errno; + if (__igt_sigiter.stat.signals == serial) + __igt_sigiter.stat.miss++; + if (ret == 0) + break; + + if (ret == EINTR) { + __igt_sigiter.stat.hit++; + + its.it_value.tv_sec *= 2; + its.it_value.tv_nsec *= 2; + while (its.it_value.tv_nsec >= NSEC_PER_SEC) { + its.it_value.tv_nsec -= NSEC_PER_SEC; + its.it_value.tv_sec += 1; + } + + SIG_ASSERT(its.it_value.tv_nsec >= 0); + SIG_ASSERT(its.it_value.tv_sec >= 0); + } + } while (ret == EAGAIN || ret == EINTR); + + memset(&its, 0, sizeof(its)); + timer_settime(__igt_sigiter.timer, 0, &its, NULL); + + errno = ret; + return ret ? -1 : 0; +} + +static bool igt_sigiter_start(struct __igt_sigiter *iter, bool enable) +{ + /* Note that until we can automatically clean up on failed/skipped + * tests, we cannot assume the state of the igt_ioctl indirection. + */ + SIG_ASSERT(igt_ioctl == drmIoctl); + igt_ioctl = drmIoctl; + + if (enable) { + struct timespec start, end; + struct sigevent sev; + struct sigaction act; + struct itimerspec its; + + igt_ioctl = sig_ioctl; + __igt_sigiter.tid = gettid(); + + memset(&sev, 0, sizeof(sev)); + sev.sigev_notify = SIGEV_SIGNAL | SIGEV_THREAD_ID; + sev.sigev_notify_thread_id = __igt_sigiter.tid; + sev.sigev_signo = SIGRTMIN; + igt_assert(timer_create(CLOCK_MONOTONIC, &sev, &__igt_sigiter.timer) == 0); + + memset(&its, 0, sizeof(its)); + igt_assert(timer_settime(__igt_sigiter.timer, 0, &its, NULL) == 0); + + memset(&act, 0, sizeof(act)); + act.sa_sigaction = sigiter; + act.sa_flags = SA_SIGINFO; + igt_assert(sigaction(SIGRTMIN, &act, NULL) == 0); + + /* Try to find the approximate delay required to skip over + * the timer_setttime and into the following ioctl() to try + * and avoid the timer firing before we enter the drmIoctl. + */ + igt_assert(clock_gettime(CLOCK_MONOTONIC, &start) == 0); + igt_assert(timer_settime(__igt_sigiter.timer, 0, &its, NULL) == 0); + igt_assert(clock_gettime(CLOCK_MONOTONIC, &end) == 0); + + __igt_sigiter.offset.tv_sec = end.tv_sec - start.tv_sec; + __igt_sigiter.offset.tv_nsec = end.tv_nsec - start.tv_nsec; + if (__igt_sigiter.offset.tv_nsec < 0) { + __igt_sigiter.offset.tv_nsec += NSEC_PER_SEC; + __igt_sigiter.offset.tv_sec -= 1; + } + if (__igt_sigiter.offset.tv_sec < 0) { + __igt_sigiter.offset.tv_nsec = 0; + __igt_sigiter.offset.tv_sec = 0; + } + igt_assert(__igt_sigiter.offset.tv_sec == 0); + + igt_debug("Initial delay for interruption: %ld.%09lds\n", + __igt_sigiter.offset.tv_sec, + __igt_sigiter.offset.tv_nsec); + } + + return true; +} + +static bool igt_sigiter_stop(struct __igt_sigiter *iter, bool enable) +{ + if (enable) { + struct sigaction act; + + SIG_ASSERT(igt_ioctl == sig_ioctl); + SIG_ASSERT(__igt_sigiter.tid == gettid()); + igt_ioctl = drmIoctl; + + timer_delete(__igt_sigiter.timer); + + memset(&act, 0, sizeof(act)); + act.sa_handler = SIG_IGN; + sigaction(SIGRTMIN, &act, NULL); + + memset(&__igt_sigiter, 0, sizeof(__igt_sigiter)); + } + + memset(iter, 0, sizeof(*iter)); + return false; +} + +bool __igt_sigiter_continue(struct __igt_sigiter *iter, bool enable) +{ + if (iter->pass++ == 0) + return igt_sigiter_start(iter, enable); + + /* If nothing reported SIGINT, nothing will on the next pass, so + * give up! Also give up if everything is now executing faster + * than current sigtimer. + */ + if (__igt_sigiter.stat.hit == 0 || + __igt_sigiter.stat.miss == __igt_sigiter.stat.ioctls) + return igt_sigiter_stop(iter, enable); + + igt_debug("%s: pass %d, missed %ld/%ld\n", + __func__, iter->pass - 1, + __igt_sigiter.stat.miss, + __igt_sigiter.stat.ioctls); + + SIG_ASSERT(igt_ioctl == sig_ioctl); + SIG_ASSERT(__igt_sigiter.timer); + + __igt_sigiter.offset.tv_sec *= 2; + __igt_sigiter.offset.tv_nsec *= 2; + while (__igt_sigiter.offset.tv_nsec >= NSEC_PER_SEC) { + __igt_sigiter.offset.tv_nsec -= NSEC_PER_SEC; + __igt_sigiter.offset.tv_sec += 1; + } + SIG_ASSERT(__igt_sigiter.offset.tv_nsec >= 0); + SIG_ASSERT(__igt_sigiter.offset.tv_sec >= 0); + + memset(&__igt_sigiter.stat, 0, sizeof(__igt_sigiter.stat)); + return true; +} + static struct igt_helper_process signal_helper; long long int sig_stat; static void __attribute__((noreturn)) signal_helper_process(pid_t pid) @@ -79,7 +281,7 @@ /* 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. */ + if (kill(pid, SIGCONT)) /* Parent has died, so must we. */ exit(0); } } @@ -93,7 +295,7 @@ * igt_fork_signal_helper: * * Fork a child process using #igt_fork_helper to interrupt the parent process - * with a SIGUSR1 signal at regular quick intervals. The corresponding dummy + * with a SIGCONT signal at regular quick intervals. The corresponding dummy * signal handler is installed in the parent process. * * This is useful to exercise ioctl error paths, at least where those can be @@ -102,16 +304,33 @@ * * In tests with subtests this function can be called outside of failure * catching code blocks like #igt_fixture or #igt_subtest. + * + * Note that this just spews signals at the current process unconditionally and + * hence incurs quite a bit of overhead. For a more focused approach, with less + * overhead, look at the #igt_while_interruptible code block macro. */ void igt_fork_signal_helper(void) { if (igt_only_list_subtests()) return; - signal(SIGUSR1, sig_handler); + /* We pick SIGCONT as it is a "safe" signal - if we send SIGCONT to + * an unexpecting process it spuriously wakes up and does nothing. + * Most other signals (e.g. SIGUSR1) cause the process to die if they + * are not handled. This is an issue in case the sighandler is not + * inherited correctly (or if there is a race in the inheritance + * and we send the signal at exactly the wrong time). + */ + signal(SIGCONT, sig_handler); + setpgrp(); /* define a new process group for the tests */ igt_fork_helper(&signal_helper) { - signal_helper_process(getppid()); + setpgrp(); /* Escape from the test process group */ + + /* Pass along the test process group identifier, + * negative pid => send signal to everyone in the group. + */ + signal_helper_process(-getppid()); } } @@ -133,6 +352,86 @@ sig_stat = 0; } +#if HAVE_UDEV +#include + +static struct igt_helper_process hang_detector; +static void __attribute__((noreturn)) +hang_detector_process(pid_t pid, dev_t rdev) +{ + struct udev_monitor *mon = + udev_monitor_new_from_netlink(udev_new(), "kernel"); + struct pollfd pfd; + + udev_monitor_filter_add_match_subsystem_devtype(mon, "drm", NULL); + udev_monitor_enable_receiving(mon); + + pfd.fd = udev_monitor_get_fd(mon); + pfd.events = POLLIN; + + while (poll(&pfd, 1, -1) > 0) { + struct udev_device *dev = udev_monitor_receive_device(mon); + dev_t devnum; + + if (dev == NULL) + continue; + + devnum = udev_device_get_devnum(dev); + if (memcmp(&rdev, &devnum, sizeof(dev_t)) == 0) { + const char *str; + + str = udev_device_get_property_value(dev, "ERROR"); + if (str && atoi(str) == 1) + kill(pid, SIGRTMAX); + } + + udev_device_unref(dev); + if (kill(pid, 0)) /* Parent has died, so must we. */ + break; + } + + exit(0); +} + +static void sig_abort(int sig) +{ + errno = 0; /* inside a signal, last errno reporting is confusing */ + igt_assert(!"GPU hung"); +} + +void igt_fork_hang_detector(int fd) +{ + struct stat st; + + if (igt_only_list_subtests()) + return; + + igt_assert(fstat(fd, &st) == 0); + + signal(SIGRTMAX, sig_abort); + igt_fork_helper(&hang_detector) + hang_detector_process(getppid(), st.st_rdev); +} + +void igt_stop_hang_detector(void) +{ + if (igt_only_list_subtests()) + return; + + igt_stop_helper(&hang_detector); +} +#else +void igt_fork_hang_detector(int fd) +{ + if (igt_only_list_subtests()) + return; +} + +void igt_stop_hang_detector(void) +{ +} +#endif + /** * igt_check_boolean_env_var: * @env_var: environment variable name @@ -340,6 +639,8 @@ free(trash_bos); } +#define SQUELCH ">/dev/null 2>&1" + /** * igt_system_suspend_autoresume: * @@ -350,18 +651,15 @@ */ void igt_system_suspend_autoresume(void) { - int ret; - /* FIXME: Simulation doesn't like suspend/resume, and not even a lighter * approach using /sys/power/pm_test to just test our driver's callbacks * seems to fare better. We need to investigate what's going on. */ igt_skip_on_simulation(); /* skip if system doesn't support suspend-to-mem */ - igt_skip_on(system("rtcwake -n -s 30 -m mem") != 0); + igt_require(system("rtcwake -n -s 15 -m mem" SQUELCH) == 0); - ret = system("rtcwake -s 30 -m mem"); - igt_assert_f(ret == 0, + igt_assert_f(system("rtcwake -s 15 -m mem") == 0, "This failure means that something is wrong with the " "rtcwake tool or how your distro is set up. This is not " "a i915.ko or i-g-t bug.\n"); @@ -377,8 +675,6 @@ */ void igt_system_hibernate_autoresume(void) { - int ret; - /* FIXME: I'm guessing simulation behaves the same way as with * suspend/resume, but it might be prudent to make sure */ @@ -388,13 +684,12 @@ igt_skip_on_simulation(); /* skip if system doesn't support suspend-to-disk */ - igt_skip_on(system("rtcwake -n -s 90 -m disk") != 0); + igt_require(system("rtcwake -n -s 30 -m disk" SQUELCH) == 0); /* The timeout might need to be adjusted if hibernation takes too long * or if we have to wait excessively long before resume */ - ret = system("rtcwake -s 90 -m disk"); - igt_assert_f(ret == 0, + igt_assert_f(system("rtcwake -s 30 -m disk") == 0, "This failure means that something is wrong with the " "rtcwake tool or how your distro is set up. This is not " "a i915.ko or i-g-t bug.\n"); @@ -531,19 +826,7 @@ if (pm_status_fd >= 0) return true; - /* The Audio driver can get runtime PM references, so we need to make - * sure its runtime PM is enabled, so it can release the refs and - * actually enable us to runtime suspend. */ - fd = open("/sys/module/snd_hda_intel/parameters/power_save", O_WRONLY); - if (fd >= 0) { - igt_assert(write(fd, "1\n", 2) == 2); - close(fd); - } - fd = open("/sys/bus/pci/devices/0000:00:03.0/power/control", O_WRONLY); - if (fd >= 0) { - igt_assert(write(fd, "auto\n", 5) == 5); - close(fd); - } + igt_pm_enable_audio_runtime_pm(); /* Our implementation uses autosuspend. Try to set it to 0ms so the test * suite goes faster and we have a higher probability of triggering race @@ -637,35 +920,58 @@ const char *name; }; -#define type_name_fn(res) \ -const char * kmstest_##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)"; \ +static const char *find_type_name(const struct type_name *names, int type) +{ + for (; names->name; names++) { + if (names->type == type) + return names->name; + } + + return "(invalid)"; } -struct type_name encoder_type_names[] = { +static const 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" }, + { DRM_MODE_ENCODER_VIRTUAL, "Virtual" }, + { DRM_MODE_ENCODER_DSI, "DSI" }, + { DRM_MODE_ENCODER_DPMST, "DP MST" }, + {} }; -type_name_fn(encoder_type) +/** + * kmstest_encoder_type_str: + * @type: DRM_MODE_ENCODER_* enumeration value + * + * Returns: A string representing the drm encoder @type. + */ +const char *kmstest_encoder_type_str(int type) +{ + return find_type_name(encoder_type_names, type); +} -struct type_name connector_status_names[] = { +static const struct type_name connector_status_names[] = { { DRM_MODE_CONNECTED, "connected" }, { DRM_MODE_DISCONNECTED, "disconnected" }, { DRM_MODE_UNKNOWNCONNECTION, "unknown" }, + {} }; -type_name_fn(connector_status) +/** + * kmstest_connector_status_str: + * @status: DRM_MODE_* connector status value + * + * Returns: A string representing the drm connector status @status. + */ +const char *kmstest_connector_status_str(int status) +{ + return find_type_name(connector_status_names, status); +} -struct type_name connector_type_names[] = { +static const struct type_name connector_type_names[] = { { DRM_MODE_CONNECTOR_Unknown, "unknown" }, { DRM_MODE_CONNECTOR_VGA, "VGA" }, { DRM_MODE_CONNECTOR_DVII, "DVI-I" }, @@ -681,10 +987,21 @@ { DRM_MODE_CONNECTOR_HDMIB, "HDMI-B" }, { DRM_MODE_CONNECTOR_TV, "TV" }, { DRM_MODE_CONNECTOR_eDP, "eDP" }, + { DRM_MODE_CONNECTOR_VIRTUAL, "Virtual" }, + { DRM_MODE_CONNECTOR_DSI, "DSI" }, + {} }; -type_name_fn(connector_type) - +/** + * kmstest_connector_type_str: + * @type: DRM_MODE_CONNECTOR_* enumeration value + * + * Returns: A string representing the drm connector @type. + */ +const char *kmstest_connector_type_str(int type) +{ + return find_type_name(connector_type_names, type); +} /** * igt_lock_mem: diff -Nru intel-gpu-tools-1.13/lib/igt_aux.h intel-gpu-tools-1.15/lib/igt_aux.h --- intel-gpu-tools-1.13/lib/igt_aux.h 2015-11-30 16:15:31.000000000 +0000 +++ intel-gpu-tools-1.15/lib/igt_aux.h 2016-05-23 10:51:28.000000000 +0000 @@ -40,6 +40,51 @@ void igt_fork_signal_helper(void); void igt_stop_signal_helper(void); +void igt_fork_hang_detector(int fd); +void igt_stop_hang_detector(void); + +struct __igt_sigiter { + unsigned pass; +}; + +bool __igt_sigiter_continue(struct __igt_sigiter *iter, bool interrupt); + +/** + * igt_while_interruptible: + * @enable: enable igt_ioctl interrupting or not + * + * Provides control flow such that all drmIoctl() (strictly igt_ioctl()) + * within the loop are forcibly injected with signals (SIGRTMIN). + * + * This is useful to exercise ioctl error paths, at least where those can be + * exercises by interrupting blocking waits, like stalling for the gpu. + * + * The code block attached to this macro is run in a loop with doubling the + * interrupt timeout on each ioctl for every run, until no ioctl gets + * interrupted any more. The starting timeout is taken to be the signal delivery + * latency, measured at runtime. This way the any ioctls called from this code + * block should be exhaustively tested for all signal interruption paths. + * + * Note that since this overloads the igt_ioctl(), this method is not useful + * for widespread signal injection, for example providing coverage of + * pagefaults. To interrupt everything, see igt_fork_signal_helper(). + */ +#define igt_while_interruptible(enable) \ + for (struct __igt_sigiter iter__={}; __igt_sigiter_continue(&iter__, (enable)); ) + +/** + * igt_until_timeout: + * @timeout: timeout in seconds + * + * Convenience macro loop to run the provided code block in a loop until the + * timeout has expired. Of course when an individual execution takes too long, + * the actual execution time could be a lot longer. + * + * The code block will be executed at least once. + */ +#define igt_until_timeout(timeout) \ + for (struct timespec t__={}; igt_seconds_elapsed(&t__) < (timeout); ) + void igt_exchange_int(void *array, unsigned i, unsigned j); void igt_permute_array(void *array, unsigned size, void (*exchange_func)(void *array, @@ -86,7 +131,10 @@ uint64_t intel_get_total_ram_mb(void); uint64_t intel_get_total_swap_mb(void); -void intel_require_memory(uint32_t count, uint64_t size, unsigned mode); +int __intel_check_memory(uint64_t count, uint64_t size, unsigned mode, + uint64_t *out_required, uint64_t *out_total); +void intel_require_memory(uint64_t count, uint64_t size, unsigned mode); +void intel_require_files(uint64_t count); #define CHECK_RAM 0x1 #define CHECK_SWAP 0x2 diff -Nru intel-gpu-tools-1.13/lib/igt_core.c intel-gpu-tools-1.15/lib/igt_core.c --- intel-gpu-tools-1.13/lib/igt_core.c 2015-11-30 16:15:31.000000000 +0000 +++ intel-gpu-tools-1.15/lib/igt_core.c 2016-05-27 09:40:31.000000000 +0000 @@ -56,7 +56,7 @@ #include #include #include -#include +#include #include "drmtest.h" #include "intel_chipset.h" @@ -97,7 +97,9 @@ * * To allow this i-g-t provides #igt_fixture code blocks for setup code outside * of subtests and automatically skips the subtest code blocks themselves. For - * special cases igt_only_list_subtests() is also provided. + * special cases igt_only_list_subtests() is also provided. For setup code only + * shared by a group of subtest encapsulate the #igt_fixture block and all the + * subtestest in a #igt_subtest_group block. * * # Magic Control Blocks * @@ -209,6 +211,19 @@ * intel gpu to be present). Then individual subtests can be run with * "--run-subtest". Usage help for tests with subtests can be obtained with the * "--help" command line option. + * + * A wildcard expression can be given to --run-subtest to specify a subset of + * subtests to run. See https://tools.ietf.org/html/rfc3977#section-4 for a + * description of allowed wildcard expressions. + * Some examples of allowed wildcard expressions are: + * + * - '*basic*' match any subtest containing basic + * - 'basic-???' match any subtest named basic- with 3 characters after - + * - 'basic-[0-9]' match any subtest named basic- with a single number after - + * - 'basic-[^0-9]' match any subtest named basic- with a single non numerical character after - + * - 'basic*,advanced*' match any subtest starting basic or advanced + * - '*,!basic*' match any subtest not starting basic + * - 'basic*,!basic-render*' match any subtest starting basic but not starting basic-render */ static unsigned int exit_handler_count; @@ -383,6 +398,23 @@ return -errno; } +#define MSEC_PER_SEC (1000) +#define USEC_PER_SEC (1000*MSEC_PER_SEC) +#define NSEC_PER_SEC (1000*USEC_PER_SEC) +uint64_t igt_nsec_elapsed(struct timespec *start) +{ + struct timespec now; + + gettime(&now); + if ((start->tv_sec | start->tv_nsec) == 0) { + *start = now; + return 0; + } + + return ((now.tv_nsec - start->tv_nsec) + + (uint64_t)NSEC_PER_SEC*(now.tv_sec - start->tv_sec)); +} + bool __igt_fixture(void) { assert(!in_fixture); @@ -540,7 +572,7 @@ static int common_init(int *argc, char **argv, const char *extra_short_opts, - struct option *extra_long_opts, + const struct option *extra_long_opts, const char *help_str, igt_opt_handler_t extra_opt_handler, void *handler_data) @@ -746,7 +778,7 @@ */ int igt_subtest_init_parse_opts(int *argc, char **argv, const char *extra_short_opts, - struct option *extra_long_opts, + const struct option *extra_long_opts, const char *help_str, igt_opt_handler_t extra_opt_handler, void *handler_data) @@ -777,7 +809,7 @@ */ void igt_simple_init_parse_opts(int *argc, char **argv, const char *extra_short_opts, - struct option *extra_long_opts, + const struct option *extra_long_opts, const char *help_str, igt_opt_handler_t extra_opt_handler, void *handler_data) @@ -814,7 +846,7 @@ } if (run_single_subtest) { - if (fnmatch(run_single_subtest, subtest_name, 0) != 0) + if (uwildmat(subtest_name, run_single_subtest) == 0) return false; else run_single_subtest_found = true; @@ -859,6 +891,16 @@ return list_subtests; } +void __igt_subtest_group_save(int *save) +{ + *save = skip_subtests_henceforth; +} + +void __igt_subtest_group_restore(int save) +{ + skip_subtests_henceforth = save; +} + static bool skipped_one = false; static bool succeeded_one = false; static bool failed_one = false; @@ -1111,13 +1153,28 @@ exit(IGT_EXIT_INVALID); } - if (igt_only_list_subtests()) exit(IGT_EXIT_SUCCESS); + /* Calling this without calling one of the above is a failure */ + assert(!test_with_subtests || + skipped_one || + succeeded_one || + failed_one); + + if (test_with_subtests && !failed_one) { + if (succeeded_one) + igt_exitcode = IGT_EXIT_SUCCESS; + else + igt_exitcode = IGT_EXIT_SKIP; + } + kmsg(KERN_INFO "%s: exiting, ret=%d\n", command_str, igt_exitcode); igt_debug("Exiting with status code %d\n", igt_exitcode); + for (int c = 0; c < num_test_children; c++) + kill(test_children[c], SIGKILL); + if (!test_with_subtests) { struct timespec now; const char *result; @@ -1138,19 +1195,11 @@ result = "FAIL"; } - printf("%s (%.3fs)\n", result, time_elapsed(&subtest_time, &now)); - exit(igt_exitcode); + printf("%s (%.3fs)\n", + result, time_elapsed(&subtest_time, &now)); } - /* Calling this without calling one of the above is a failure */ - assert(skipped_one || succeeded_one || failed_one); - - if (failed_one) - exit(igt_exitcode); - else if (succeeded_one) - exit(IGT_EXIT_SUCCESS); - else - exit(IGT_EXIT_SKIP); + exit(igt_exitcode); } /* fork support code */ @@ -1260,6 +1309,13 @@ return status; } +static bool helper_was_alive(struct igt_helper_process *proc, + int status) +{ + return (WIFSIGNALED(status) && + WTERMSIG(status) == (proc->use_SIGKILL ? SIGKILL : SIGTERM)); +} + /** * igt_stop_helper: * @proc: #igt_helper_process structure @@ -1275,8 +1331,9 @@ kill(proc->pid, proc->use_SIGKILL ? SIGKILL : SIGTERM); status = igt_wait_helper(proc); - assert(WIFSIGNALED(status) && - WTERMSIG(status) == (proc->use_SIGKILL ? SIGKILL : SIGTERM)); + if (!helper_was_alive(proc, status)) + igt_debug("Helper died too early with status=%d\n", status); + assert(helper_was_alive(proc, status)); } static void children_exit_handler(int sig) @@ -1388,6 +1445,22 @@ igt_fail(err); } +/** + * igt_waitchildren_timeout: + * @seconds: timeout in seconds to wait + * @reason: debug string explaining what timedout + * + * Wait for all children forked with igt_fork, for a maximum of @seconds. + * + * Wraps igt_waitchildren() and igt_set_timeout() + */ +void igt_waitchildren_timeout(int seconds, const char *reason) +{ + igt_set_timeout(seconds, reason); + igt_waitchildren(); + igt_reset_timeout(); +} + /* exit handler code */ #define MAX_SIGNALS 32 #define MAX_EXIT_HANDLERS 10 @@ -1403,7 +1476,6 @@ static igt_exit_handler_t exit_handler_fn[MAX_EXIT_HANDLERS]; static bool exit_handler_disabled; -static sigset_t saved_sig_mask; #define SIGDEF(x) { x, #x, sizeof(#x) - 1 } #define SILENT(x) { x, NULL, 0 } static const struct { int number; const char *name; size_t name_len; } handled_signals[] = @@ -1577,51 +1649,6 @@ igt_assert_f(0, "failed to install the signal handler\n"); } -/** - * igt_disable_exit_handler: - * - * Temporarily disable all exit handlers. Useful for library code doing tricky - * things. - */ -void igt_disable_exit_handler(void) -{ - sigset_t set; - int i; - - if (exit_handler_disabled) - return; - - sigemptyset(&set); - for (i = 0; i < ARRAY_SIZE(handled_signals); i++) - sigaddset(&set, handled_signals[i].number); - - if (sigprocmask(SIG_BLOCK, &set, &saved_sig_mask)) { - perror("sigprocmask"); - return; - } - - exit_handler_disabled = true; -} - -/** - * igt_enable_exit_handler: - * - * Re-enable all exit handlers temporarily disabled with - * igt_disable_exit_handler(). - */ -void igt_enable_exit_handler(void) -{ - if (!exit_handler_disabled) - return; - - if (sigprocmask(SIG_SETMASK, &saved_sig_mask, NULL)) { - perror("sigprocmask"); - return; - } - - exit_handler_disabled = false; -} - /* simulation enviroment support */ /** @@ -1748,7 +1775,7 @@ goto out; } - line_continuation = line[strlen(line)] != '\n'; + line_continuation = line[strlen(line) - 1] != '\n'; /* append log buffer */ _igt_log_buffer_append(formatted_line); @@ -1855,6 +1882,10 @@ snprintf(path, sizeof(path), "%s/%s", igt_srcdir, filename); fp = fopen(path, "r"); } + if (!fp) { + snprintf(path, sizeof(path), "./%s", filename); + fp = fopen(path, "r"); + } if (!fp) igt_critical("Could not open data file \"%s\": %s", filename, diff -Nru intel-gpu-tools-1.13/lib/igt_core.h intel-gpu-tools-1.15/lib/igt_core.h --- intel-gpu-tools-1.13/lib/igt_core.h 2015-11-30 16:15:31.000000000 +0000 +++ intel-gpu-tools-1.15/lib/igt_core.h 2016-05-27 09:40:31.000000000 +0000 @@ -32,6 +32,7 @@ #include #include +#include #include #include #include @@ -106,7 +107,7 @@ * enumeration (e.g. when enumerating on systems without an intel gpu) such * blocks should be annotated with igt_fixture. */ -#define igt_fixture for (int igt_tokencat(__tmpint,__LINE__) = 0; \ +#define igt_fixture for (volatile int igt_tokencat(__tmpint,__LINE__) = 0; \ igt_tokencat(__tmpint,__LINE__) < 1 && \ __igt_fixture() && \ (sigsetjmp(igt_subtest_jmpbuf, 1) == 0); \ @@ -121,7 +122,7 @@ #endif int igt_subtest_init_parse_opts(int *argc, char **argv, const char *extra_short_opts, - struct option *extra_long_opts, + const struct option *extra_long_opts, const char *help_str, igt_opt_handler_t extra_opt_handler, void *handler_data); @@ -196,6 +197,30 @@ const char *igt_subtest_name(void); bool igt_only_list_subtests(void); +void __igt_subtest_group_save(int *); +void __igt_subtest_group_restore(int); +/** + * igt_subtest_group: + * + * Group a set of subtests together with their common setup code + * + * Testcase with subtests often need to set up a bunch of shared state as the + * common test fixture. But if there are multiple with different requirements + * the commont setup code can't be extracted, since a test condition failure in + * e.g. igt_require() would result in all subsequent tests skipping. Even those + * from a different group. + * + * This macro allows to group together a set of #igt_fixture and #igt_subtest + * clauses. If any common setup in a fixture fails, only the subtests in this + * group will fail or skip. Subtest groups can be arbitrarily nested. + */ +#define igt_subtest_group for (int igt_tokencat(__tmpint,__LINE__) = 0, \ + igt_tokencat(__save,__LINE__) = 0; \ + igt_tokencat(__tmpint,__LINE__) < 1 && \ + (__igt_subtest_group_save(& igt_tokencat(__save,__LINE__) ), true); \ + igt_tokencat(__tmpint,__LINE__) ++, \ + __igt_subtest_group_restore(igt_tokencat(__save,__LINE__) )) + /** * igt_main: * @@ -217,7 +242,7 @@ const char *igt_test_name(void); void igt_simple_init_parse_opts(int *argc, char **argv, const char *extra_short_opts, - struct option *extra_long_opts, + const struct option *extra_long_opts, const char *help_str, igt_opt_handler_t extra_opt_handler, void *handler_data); @@ -610,6 +635,7 @@ for (int child = 0; child < (num_children); child++) \ for (; __igt_fork(); exit(0)) void igt_waitchildren(void); +void igt_waitchildren_timeout(int seconds, const char *reason); /** * igt_helper_process: @@ -666,8 +692,6 @@ /* reliable atexit helpers, also work when killed by a signal (if possible) */ void igt_install_exit_handler(igt_exit_handler_t fn); -void igt_enable_exit_handler(void); -void igt_disable_exit_handler(void); /* helpers to automatically reduce test runtime in simulation */ bool igt_run_in_simulation(void); @@ -776,6 +800,40 @@ void igt_set_timeout(unsigned int seconds, const char *op); +/** + * igt_nsec_elapsed: + * @start: measure from this point in time + * + * Reports the difference in the monotonic clock from the start time + * in nanoseconds. On the first invocation, start should be zeroed and will + * be set by the call. + * + * Typical use would be: + * + * igt_subtest("test") { + * struct timespec start = {}; + * while (igt_nsec_elapsed(&start) < test_timeout_ns) + * do_test(); + * } + * + * A handy approximation is to use nsec >> 30 to convert to seconds, + * nsec >> 20 to convert to milliseconds - the error is about 8%, acceptable + * for test run times. + */ +uint64_t igt_nsec_elapsed(struct timespec *start); + +/** + * igt_seconds_elapsed: + * @start: measure from this point in time + * + * A wrapper around igt_nsec_elapsed that reports the approximate (8% error) + * number of seconds since the start point. + */ +static inline uint32_t igt_seconds_elapsed(struct timespec *start) +{ + return igt_nsec_elapsed(start) >> 30; +} + void igt_reset_timeout(void); FILE *__igt_fopen_data(const char* igt_srcdir, const char* igt_datadir, @@ -784,8 +842,8 @@ * igt_fopen_data: * @filename: filename to open. * - * Open a datafile for test, first try from installation directory - * then from build directory. + * Open a datafile for test, first try from installation directory, + * then from build directory, and finally from current directory. */ #define igt_fopen_data(filename) \ __igt_fopen_data(IGT_SRCDIR, IGT_DATADIR, filename) diff -Nru intel-gpu-tools-1.13/lib/igt_debugfs.c intel-gpu-tools-1.15/lib/igt_debugfs.c --- intel-gpu-tools-1.13/lib/igt_debugfs.c 2015-11-30 16:15:31.000000000 +0000 +++ intel-gpu-tools-1.15/lib/igt_debugfs.c 2016-05-24 14:46:19.000000000 +0000 @@ -252,6 +252,23 @@ * @a: first pipe CRC value * @b: second pipe CRC value * + * Compares two CRC values. + */ +bool igt_crc_equal(igt_crc_t *a, igt_crc_t *b) +{ + int i; + + for (i = 0; i < a->n_words; i++) + if (a->crc[i] != b->crc[i]) + return false; + return true; +} + +/** + * igt_assert_crc_equal: + * @a: first pipe CRC value + * @b: second pipe CRC value + * * Compares two CRC values and fails the testcase if they don't match with * igt_fail(). Note that due to CRC collisions CRC based testcase can only * assert that CRCs match, never that they are different. Otherwise there might @@ -280,11 +297,10 @@ { char buf[128]; - if (crc->n_words == 5) - sprintf(buf, "%08x %08x %08x %08x %08x", crc->crc[0], - crc->crc[1], crc->crc[2], crc->crc[3], crc->crc[4]); - else - igt_assert(0); + igt_assert_eq(crc->n_words, 5); + + sprintf(buf, "%08x %08x %08x %08x %08x", crc->crc[0], + crc->crc[1], crc->crc[2], crc->crc[3], crc->crc[4]); return strdup(buf); } @@ -299,6 +315,7 @@ int crc_fd; int line_len; int buffer_len; + int flags; enum pipe pipe; enum intel_pipe_crc_source source; @@ -390,19 +407,8 @@ fclose(ctl); } -/** - * igt_pipe_crc_new: - * @pipe: display pipe to use as source - * @source: CRC tap point to use as source - * - * This sets up a new pipe CRC capture object for the given @pipe and @source. - * - * Returns: A pipe CRC object if the given @pipe and @source. The library - * assumes that the source is always available since recent kernels support at - * least INTEL_PIPE_CRC_SOURCE_AUTO everywhere. - */ -igt_pipe_crc_t * -igt_pipe_crc_new(enum pipe pipe, enum intel_pipe_crc_source source) +static igt_pipe_crc_t * +pipe_crc_new(enum pipe pipe, enum intel_pipe_crc_source source, int flags) { igt_pipe_crc_t *pipe_crc; char buf[128]; @@ -415,18 +421,55 @@ igt_assert(pipe_crc->ctl_fd != -1); sprintf(buf, "i915_pipe_%s_crc", kmstest_pipe_name(pipe)); - pipe_crc->crc_fd = igt_debugfs_open(buf, O_RDONLY); + pipe_crc->crc_fd = igt_debugfs_open(buf, flags); igt_assert(pipe_crc->crc_fd != -1); pipe_crc->line_len = PIPE_CRC_LINE_LEN; pipe_crc->buffer_len = PIPE_CRC_BUFFER_LEN; pipe_crc->pipe = pipe; pipe_crc->source = source; + pipe_crc->flags = flags; return pipe_crc; } /** + * igt_pipe_crc_new: + * @pipe: display pipe to use as source + * @source: CRC tap point to use as source + * + * This sets up a new pipe CRC capture object for the given @pipe and @source + * in blocking mode. + * + * Returns: A pipe CRC object for the given @pipe and @source. The library + * assumes that the source is always available since recent kernels support at + * least INTEL_PIPE_CRC_SOURCE_AUTO everywhere. + */ +igt_pipe_crc_t * +igt_pipe_crc_new(enum pipe pipe, enum intel_pipe_crc_source source) +{ + return pipe_crc_new(pipe, source, O_RDONLY); +} + +/** + * igt_pipe_crc_new_nonblock: + * @pipe: display pipe to use as source + * @source: CRC tap point to use as source + * + * This sets up a new pipe CRC capture object for the given @pipe and @source + * in nonblocking mode. + * + * Returns: A pipe CRC object for the given @pipe and @source. The library + * assumes that the source is always available since recent kernels support at + * least INTEL_PIPE_CRC_SOURCE_AUTO everywhere. + */ +igt_pipe_crc_t * +igt_pipe_crc_new_nonblock(enum pipe pipe, enum intel_pipe_crc_source source) +{ + return pipe_crc_new(pipe, source, O_RDONLY | O_NONBLOCK); +} + +/** * igt_pipe_crc_free: * @pipe_crc: pipe CRC object * @@ -442,6 +485,45 @@ free(pipe_crc); } +static bool pipe_crc_init_from_string(igt_crc_t *crc, const char *line) +{ + int n; + + crc->n_words = 5; + n = sscanf(line, "%8u %8x %8x %8x %8x %8x", &crc->frame, &crc->crc[0], + &crc->crc[1], &crc->crc[2], &crc->crc[3], &crc->crc[4]); + return n == 6; +} + +static int read_crc(igt_pipe_crc_t *pipe_crc, igt_crc_t *out) +{ + ssize_t bytes_read; + char buf[pipe_crc->buffer_len]; + + igt_set_timeout(5, "CRC reading"); + bytes_read = read(pipe_crc->crc_fd, &buf, pipe_crc->line_len); + igt_reset_timeout(); + + if (bytes_read < 0 && errno == EAGAIN) { + igt_assert(pipe_crc->flags & O_NONBLOCK); + bytes_read = 0; + } else { + igt_assert_eq(bytes_read, pipe_crc->line_len); + } + buf[bytes_read] = '\0'; + + if (bytes_read && !pipe_crc_init_from_string(out, buf)) + return -EINVAL; + + return bytes_read; +} + +static void read_one_crc(igt_pipe_crc_t *pipe_crc, igt_crc_t *out) +{ + while (read_crc(pipe_crc, out) == 0) + usleep(1000); +} + /** * igt_pipe_crc_start: * @pipe_crc: pipe CRC object @@ -450,7 +532,7 @@ */ void igt_pipe_crc_start(igt_pipe_crc_t *pipe_crc) { - igt_crc_t *crcs = NULL; + igt_crc_t crc; igt_assert(igt_pipe_crc_do_start(pipe_crc)); @@ -461,8 +543,8 @@ * On CHV sometimes the second CRC is bonkers as well, so don't trust * that one either. */ - igt_pipe_crc_get_crcs(pipe_crc, 2, &crcs); - free(crcs); + read_one_crc(pipe_crc, &crc); + read_one_crc(pipe_crc, &crc); } /** @@ -479,48 +561,27 @@ igt_assert_eq(write(pipe_crc->ctl_fd, buf, strlen(buf)), strlen(buf)); } -static bool pipe_crc_init_from_string(igt_crc_t *crc, const char *line) -{ - int n; - - crc->n_words = 5; - n = sscanf(line, "%8u %8x %8x %8x %8x %8x", &crc->frame, &crc->crc[0], - &crc->crc[1], &crc->crc[2], &crc->crc[3], &crc->crc[4]); - return n == 6; -} - -static bool read_one_crc(igt_pipe_crc_t *pipe_crc, igt_crc_t *out) -{ - ssize_t bytes_read; - char buf[pipe_crc->buffer_len]; - - igt_set_timeout(5, "CRC reading"); - bytes_read = read(pipe_crc->crc_fd, &buf, pipe_crc->line_len); - igt_reset_timeout(); - - igt_assert_eq(bytes_read, pipe_crc->line_len); - buf[bytes_read] = '\0'; - - if (!pipe_crc_init_from_string(out, buf)) - return false; - - return true; -} - /** * igt_pipe_crc_get_crcs: * @pipe_crc: pipe CRC object * @n_crcs: number of CRCs to capture * @out_crcs: buffer pointer for the captured CRC values * - * Read @n_crcs from @pipe_crc. This function blocks until @n_crcs are - * retrieved. @out_crcs is alloced by this function and must be released with - * free() by the caller. + * Read up to @n_crcs from @pipe_crc. This function does not block, and will + * return early if not enough CRCs can be captured, if @pipe_crc has been + * opened using igt_pipe_crc_new_nonblock(). It will block until @n_crcs are + * retrieved if @pipe_crc has been opened using igt_pipe_crc_new(). @out_crcs is + * alloced by this function and must be released with free() by the caller. * * Callers must start and stop the capturing themselves by calling - * igt_pipe_crc_start() and igt_pipe_crc_stop(). + * igt_pipe_crc_start() and igt_pipe_crc_stop(). For one-shot CRC collecting + * look at igt_pipe_crc_collect_crc(). + * + * Returns: + * The number of CRCs captured. Should be equal to @n_crcs in blocking mode, but + * can be less (even zero) in non-blocking mode. */ -void +int igt_pipe_crc_get_crcs(igt_pipe_crc_t *pipe_crc, int n_crcs, igt_crc_t **out_crcs) { @@ -531,14 +592,19 @@ do { igt_crc_t *crc = &crcs[n]; + int ret; - if (!read_one_crc(pipe_crc, crc)) + ret = read_crc(pipe_crc, crc); + if (ret < 0) continue; + if (ret == 0) + break; n++; } while (n < n_crcs); *out_crcs = crcs; + return n; } static void crc_sanity_checks(igt_crc_t *crc) @@ -564,13 +630,18 @@ * @out_crc: buffer for the captured CRC values * * Read a single CRC from @pipe_crc. This function blocks until the CRC is - * retrieved. @out_crc must be allocated by the caller. + * retrieved, irrespective of whether @pipe_crc has been opened with + * igt_pipe_crc_new() or igt_pipe_crc_new_nonblock(). @out_crc must be + * allocated by the caller. * * This function takes care of the pipe_crc book-keeping, it will start/stop * the collection of the CRC. * * This function also calls the interactive debug with the "crc" domain, so you * can make use of this feature to actually see the screen that is being CRC'd. + * + * For continuous CRC collection look at igt_pipe_crc_start(), + * igt_pipe_crc_get_crcs() and igt_pipe_crc_stop(). */ void igt_pipe_crc_collect_crc(igt_pipe_crc_t *pipe_crc, igt_crc_t *out_crc) { @@ -667,3 +738,61 @@ { igt_prefault_control(true); } + +static int get_object_count(void) +{ + FILE *file; + int ret, scanned; + + igt_drop_caches_set(DROP_RETIRE | DROP_ACTIVE); + + file = igt_debugfs_fopen("i915_gem_objects", "r"); + + scanned = fscanf(file, "%i objects", &ret); + igt_assert_eq(scanned, 1); + + return ret; +} + +/** + * igt_get_stable_obj_count: + * @driver: fd to drm/i915 GEM driver + * + * This puts the driver into a stable (quiescent) state and then returns the + * current number of gem buffer objects as reported in the i915_gem_objects + * debugFS interface. + */ +int igt_get_stable_obj_count(int driver) +{ + int obj_count; + gem_quiescent_gpu(driver); + obj_count = get_object_count(); + /* The test relies on the system being in the same state before and + * after the test so any difference in the object count is a result of + * leaks during the test. gem_quiescent_gpu() mostly achieves this but + * on android occasionally obj_count can still change briefly. + * The loop ensures obj_count has remained stable over several checks + */ +#ifdef ANDROID + { + int loop_count = 0; + int prev_obj_count = obj_count; + while (loop_count < 4) { + usleep(200000); + gem_quiescent_gpu(driver); + obj_count = get_object_count(); + if (obj_count == prev_obj_count) { + loop_count++; + } else { + igt_debug("loop_count=%d, obj_count=%d, prev_obj_count=%d\n", + loop_count, obj_count, prev_obj_count); + loop_count = 0; + prev_obj_count = obj_count; + } + + } + } +#endif + return obj_count; +} + diff -Nru intel-gpu-tools-1.13/lib/igt_debugfs.h intel-gpu-tools-1.15/lib/igt_debugfs.h --- intel-gpu-tools-1.13/lib/igt_debugfs.h 2015-12-02 15:13:14.000000000 +0000 +++ intel-gpu-tools-1.15/lib/igt_debugfs.h 2016-05-23 10:51:28.000000000 +0000 @@ -115,12 +115,16 @@ void igt_require_pipe_crc(void); igt_pipe_crc_t * igt_pipe_crc_new(enum pipe pipe, enum intel_pipe_crc_source source); +igt_pipe_crc_t * +igt_pipe_crc_new_nonblock(enum pipe pipe, enum intel_pipe_crc_source source); void igt_pipe_crc_free(igt_pipe_crc_t *pipe_crc); void igt_pipe_crc_start(igt_pipe_crc_t *pipe_crc); void igt_pipe_crc_stop(igt_pipe_crc_t *pipe_crc); -void igt_pipe_crc_get_crcs(igt_pipe_crc_t *pipe_crc, int n_crcs, - igt_crc_t **out_crcs); +__attribute__((warn_unused_result)) +int igt_pipe_crc_get_crcs(igt_pipe_crc_t *pipe_crc, int n_crcs, + igt_crc_t **out_crcs); void igt_pipe_crc_collect_crc(igt_pipe_crc_t *pipe_crc, igt_crc_t *out_crc); +bool igt_crc_equal(igt_crc_t *a, igt_crc_t *b); /* * Drop caches @@ -165,4 +169,10 @@ void igt_disable_prefault(void); void igt_enable_prefault(void); +/* + * Put the driver into a stable (quiescent) state and get the current number of + * gem buffer objects + */ +int igt_get_stable_obj_count(int driver); + #endif /* __IGT_DEBUGFS_H__ */ diff -Nru intel-gpu-tools-1.13/lib/igt_draw.c intel-gpu-tools-1.15/lib/igt_draw.c --- intel-gpu-tools-1.13/lib/igt_draw.c 2015-11-30 16:15:31.000000000 +0000 +++ intel-gpu-tools-1.15/lib/igt_draw.c 2016-05-23 10:51:28.000000000 +0000 @@ -594,20 +594,6 @@ } } -static int get_format_bpp(uint32_t drm_format) -{ - switch (drm_format) { - case DRM_FORMAT_RGB565: - return 16; - case DRM_FORMAT_XRGB8888: - case DRM_FORMAT_ARGB8888: - case DRM_FORMAT_XRGB2101010: - return 32; - default: - igt_assert(false); - } -} - /** * igt_draw_rect_fb: * @fd: the DRM file descriptor @@ -632,7 +618,7 @@ { igt_draw_rect(fd, bufmgr, context, fb->gem_handle, fb->size, fb->stride, method, rect_x, rect_y, rect_w, rect_h, color, - get_format_bpp(fb->drm_format)); + igt_drm_format_to_bpp(fb->drm_format)); } /** diff -Nru intel-gpu-tools-1.13/lib/igt_edid_template.h intel-gpu-tools-1.15/lib/igt_edid_template.h --- intel-gpu-tools-1.13/lib/igt_edid_template.h 1970-01-01 00:00:00.000000000 +0000 +++ intel-gpu-tools-1.15/lib/igt_edid_template.h 2016-05-23 10:51:28.000000000 +0000 @@ -0,0 +1,74 @@ +#define GAMMA(x) (((x) * 100) - 100) + +#define MANUFACTURER_ID(a, b, c) (a - '@') << 2 | (b - '@') >> 3, \ + (b - '@') << 5 | (c - '@') + + +#define ab(x, y) ((x) & 0xff), ((y) & 0xff), (((x) & 0xf00) >> 4) | (((y) & 0xf00) >> 8) +#define op(ho, hp, vo, vp) ((ho) & 0xff), ((hp) & 0xff), \ + (((vo) & 0xf) << 4) | ((vp) & 0xf), \ + (((ho) & 0x300) >> 2) | (((hp) & 0x300) >> 4) \ + | (((vo) & 0x30) >> 2) | ((vp) & 0x30 >> 4) + +static unsigned char EDID_NAME[EDID_LENGTH] = { + 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, /* header */ + MANUFACTURER_ID('I', 'G', 'T'), + /* product code, serial number, week and year of manufacture */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x01, 0x03, /* edid version (1.3) */ + /* basic display parameters */ + /* digital display, maximum horizontal image size, maximum vertical + * image size, gamma, features: RGB 4:4:4, native pixel format and + * refresh rate in descriptor 1 */ + 0x80, HSIZE, VSIZE, GAMMA(2.20), 0x02, + /* chromaticity coordinates */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + /* established timings: 640x480 60Hz, 800x600 60Hz, 1024x768 60Hz */ + 0x21, 0x08, 0x00, + /* standard timings */ + 0xd1, 0xc0, /* 1920x1080 60Hz */ + 0x81, 0xc0, /* 1280x720 60Hz */ + 0x61, 0x40, /* 1024x768 60Hz */ + 0x45, 0x40, /* 800x600 60Hz */ + 0x31, 0x40, /* 640x480 60Hz */ + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + /* descriptor 1 (preferred timing) */ + (CLOCK / 10) & 0x00ff, ((CLOCK / 10) & 0xff00) >> 8, + ab(HACTIVE, HBLANK), ab(VACTIVE, VBLANK), + op(HOFFSET, HPULSE, VOFFSET, VPULSE), + ab(HSIZE * 10, VSIZE * 10), + 0x00, 0x00, 0x00, + /* descriptor 2 (monitor range limits) */ + 0x00, 0x00, 0x00, 0xfd, 0x00, + VFREQ - 1, VFREQ + 1, /* minimum, maximum vertical field rate */ + (CLOCK / (HACTIVE + HBLANK)) - 1, /* minimum horizontal line rate */ + (CLOCK / (HACTIVE + HBLANK)) + 1, /* maximum horizontal line rate */ + (CLOCK / 10000) + 1, /* maximum pixel clock rate */ + 0x00, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + /* descriptor 3 (name descriptor) */ + 0x00, 0x00, 0x00, 0xfc, 0x00, 'I', 'G', 'T', 0x0a, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + /* descriptor 4 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + /* extensions, checksum */ + 0x00, 0x00 +}; + +#undef EDID_NAME +#undef VFREQ +#undef CLOCK +#undef HACTIVE +#undef HBLANK +#undef VACTIVE +#undef VBLANK +#undef HOFFSET +#undef HPULSE +#undef VOFFSET +#undef VPULSE +#undef HSIZE +#undef VSIZE +#undef GAMMA +#undef MANUFACTURER_ID +#undef ab +#undef op diff -Nru intel-gpu-tools-1.13/lib/igt_fb.c intel-gpu-tools-1.15/lib/igt_fb.c --- intel-gpu-tools-1.13/lib/igt_fb.c 2015-11-30 16:15:31.000000000 +0000 +++ intel-gpu-tools-1.15/lib/igt_fb.c 2016-05-31 16:52:17.000000000 +0000 @@ -31,7 +31,9 @@ #include "drmtest.h" #include "igt_fb.h" +#include "igt_kms.h" #include "ioctl_wrappers.h" +#include "intel_chipset.h" /** * SECTION:igt_fb @@ -72,26 +74,94 @@ #define for_each_format(f) \ for (f = format_desc; f - format_desc < ARRAY_SIZE(format_desc); f++) +static void igt_get_fb_tile_size(int fd, uint64_t tiling, int fb_bpp, + unsigned *width_ret, unsigned *height_ret) +{ + switch (tiling) { + case LOCAL_DRM_FORMAT_MOD_NONE: + *width_ret = 64; + *height_ret = 1; + break; + case LOCAL_I915_FORMAT_MOD_X_TILED: + igt_require_intel(fd); + if (intel_gen(intel_get_drm_devid(fd)) == 2) { + *width_ret = 128; + *height_ret = 16; + } else { + *width_ret = 512; + *height_ret = 8; + } + break; + case LOCAL_I915_FORMAT_MOD_Y_TILED: + igt_require_intel(fd); + if (intel_gen(intel_get_drm_devid(fd)) == 2) { + *width_ret = 128; + *height_ret = 16; + } else if (IS_915(intel_get_drm_devid(fd))) { + *width_ret = 512; + *height_ret = 8; + } else { + *width_ret = 128; + *height_ret = 32; + } + break; + case LOCAL_I915_FORMAT_MOD_Yf_TILED: + igt_require_intel(fd); + switch (fb_bpp) { + case 8: + *width_ret = 64; + *height_ret = 64; + break; + case 16: + case 32: + *width_ret = 128; + *height_ret = 32; + break; + case 64: + case 128: + *width_ret = 256; + *height_ret = 16; + break; + default: + igt_assert(false); + } + break; + default: + igt_assert(false); + } +} -/* helpers to create nice-looking framebuffers */ -static int create_bo_for_fb(int fd, int width, int height, int bpp, - uint64_t tiling, unsigned bo_size, - unsigned bo_stride, uint32_t *gem_handle_ret, - unsigned *size_ret, unsigned *stride_ret) -{ - uint32_t gem_handle; - int size, ret = 0; - unsigned stride; +/** + * igt_calc_fb_size: + * @fd: the DRM file descriptor + * @width: width of the framebuffer in pixels + * @height: height of the framebuffer in pixels + * @bpp: bytes per pixel of the framebuffer + * @tiling: tiling layout of the framebuffer (as framebuffer modifier) + * @size_ret: returned size for the framebuffer + * @stride_ret: returned stride for the framebuffer + * + * This function returns valid stride and size values for a framebuffer with the + * specified parameters. + */ +void igt_calc_fb_size(int fd, int width, int height, int bpp, uint64_t tiling, + unsigned *size_ret, unsigned *stride_ret) +{ + unsigned int tile_width, tile_height, stride, size; + int byte_width = width * (bpp / 8); - if (tiling != LOCAL_DRM_FORMAT_MOD_NONE) { + igt_get_fb_tile_size(fd, tiling, bpp, &tile_width, &tile_height); + + if (tiling != LOCAL_DRM_FORMAT_MOD_NONE && + intel_gen(intel_get_drm_devid(fd)) <= 3) { 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. + /* 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. + * This can still fail if the framebuffer is too large to be + * tiled. But then that failure is expected. */ v = width * bpp / 8; @@ -102,27 +172,88 @@ for (size = 1024*1024; size < v; size *= 2) ; } else { - /* Scan-out has a 64 byte alignment restriction */ - stride = ALIGN(width * (bpp / 8), 64); - size = stride * height; + stride = ALIGN(byte_width, tile_width); + size = stride * ALIGN(height, tile_height); } - if (bo_size == 0) - bo_size = size; - if (bo_stride == 0) - bo_stride = stride; - - gem_handle = gem_create(fd, bo_size); - - if (tiling == LOCAL_I915_FORMAT_MOD_X_TILED) - ret = __gem_set_tiling(fd, gem_handle, I915_TILING_X, - bo_stride); - - *stride_ret = bo_stride; - *size_ret = bo_size; - *gem_handle_ret = gem_handle; + *stride_ret = stride; + *size_ret = size; +} - return ret; +/* helpers to create nice-looking framebuffers */ +static int create_bo_for_fb(int fd, int width, int height, uint32_t format, + uint64_t tiling, unsigned size, unsigned stride, + unsigned *size_ret, unsigned *stride_ret, + bool *is_dumb) +{ + int bpp = igt_drm_format_to_bpp(format); + int bo; + + if (tiling || size || stride) { + unsigned calculated_size, calculated_stride; + + igt_calc_fb_size(fd, width, height, bpp, tiling, + &calculated_size, &calculated_stride); + if (stride == 0) + stride = calculated_stride; + if (size == 0) + size = calculated_size; + + if (is_dumb) + *is_dumb = false; + + if (is_i915_device(fd)) { + + bo = gem_create(fd, size); + gem_set_tiling(fd, bo, tiling, stride); + + if (size_ret) + *size_ret = size; + + if (stride_ret) + *stride_ret = stride; + + return bo; + } else { + bool driver_has_gem_api = false; + + igt_require(driver_has_gem_api); + return -EINVAL; + } + } else { + if (is_dumb) + *is_dumb = true; + + return kmstest_dumb_create(fd, width, height, bpp, stride_ret, + size_ret); + } +} + +/** + * igt_create_bo_with_dimensions: + * @fd: open drm file descriptor + * @width: width of the buffer object in pixels + * @height: height of the buffer object in pixels + * @format: drm fourcc pixel format code + * @modifier: modifier corresponding to the tiling layout of the buffer object + * @stride: stride of the buffer object in bytes (0 for automatic stride) + * @size_ret: size of the buffer object as created by the kernel + * @stride_ret: stride of the buffer object as created by the kernel + * @is_dumb: whether the created buffer object is a dumb buffer or not + * + * This function allocates a gem buffer object matching the requested + * properties. + * + * Returns: + * The kms id of the created buffer object. + */ +int igt_create_bo_with_dimensions(int fd, int width, int height, + uint32_t format, uint64_t modifier, + unsigned stride, unsigned *size_ret, + unsigned *stride_ret, bool *is_dumb) +{ + return create_bo_for_fb(fd, width, height, format, modifier, 0, stride, + size_ret, stride_ret, is_dumb); } /** @@ -200,6 +331,40 @@ cairo_pattern_destroy(pat); } +/** + * igt_paint_color_gradient_range: + * @cr: cairo drawing context + * @x: pixel x-coordination of the fill rectangle + * @y: pixel y-coordination of the fill rectangle + * @w: width of the fill rectangle + * @h: height of the fill rectangle + * @sr: red value to use as start gradient color + * @sg: green value to use as start gradient color + * @sb: blue value to use as start gradient color + * @er: red value to use as end gradient color + * @eg: green value to use as end gradient color + * @eb: blue value to use as end gradient color + * + * This functions draws a gradient into the rectangle which fades in + * from one color to the other using the drawing context @cr. + */ +void +igt_paint_color_gradient_range(cairo_t *cr, int x, int y, int w, int h, + double sr, double sg, double sb, + double er, double eg, double eb) +{ + cairo_pattern_t *pat; + + pat = cairo_pattern_create_linear(x, y, x + w, y + h); + cairo_pattern_add_color_stop_rgba(pat, 1, sr, sg, sb, 1); + cairo_pattern_add_color_stop_rgba(pat, 0, er, eg, eb, 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) { @@ -423,17 +588,15 @@ unsigned bo_stride) { uint32_t fb_id; - int bpp; memset(fb, 0, sizeof(*fb)); - bpp = igt_drm_format_to_bpp(format); - - igt_debug("%s(width=%d, height=%d, format=0x%x [bpp=%d], tiling=0x%"PRIx64", size=%d)\n", - __func__, width, height, format, bpp, tiling, bo_size); - do_or_die(create_bo_for_fb(fd, width, height, bpp, tiling, bo_size, - bo_stride, &fb->gem_handle, &fb->size, - &fb->stride)); + igt_debug("%s(width=%d, height=%d, format=0x%x, tiling=0x%"PRIx64", size=%d)\n", + __func__, width, height, format, tiling, bo_size); + fb->gem_handle = create_bo_for_fb(fd, width, height, format, tiling, + bo_size, bo_stride, &fb->size, + &fb->stride, &fb->is_dumb); + igt_assert(fb->gem_handle > 0); igt_debug("%s(handle=%d, pitch=%d)\n", __func__, fb->gem_handle, fb->stride); @@ -465,6 +628,7 @@ fb->tiling = tiling; fb->drm_format = format; fb->fb_id = fb_id; + fb->fd = fd; return fb_id; } @@ -503,7 +667,7 @@ * @format: drm fourcc pixel format code * @tiling: tiling layout of the framebuffer * @r: red value to use as fill color - * @g: gree value to use as fill color + * @g: green value to use as fill color * @b: blue value to use as fill color * @fb: pointer to an #igt_fb structure * @@ -537,6 +701,132 @@ return fb_id; } +/** + * igt_create_pattern_fb: + * @fd: open i915 drm file descriptor + * @width: width of the framebuffer in pixel + * @height: height of the framebuffer in pixel + * @format: drm fourcc pixel format code + * @tiling: tiling layout of the framebuffer + * @fb: pointer to an #igt_fb structure + * + * This function allocates a gem buffer object suitable to back a framebuffer + * with the requested properties and then wraps it up in a drm framebuffer + * object. All metadata is stored in @fb. + * + * Compared to igt_create_fb() this function also draws the standard test pattern + * into the framebuffer. + * + * Returns: + * The kms id of the created framebuffer on success or a negative error code on + * failure. + */ +unsigned int igt_create_pattern_fb(int fd, int width, int height, + uint32_t format, uint64_t tiling, + struct igt_fb *fb /* out */) +{ + unsigned int fb_id; + cairo_t *cr; + + fb_id = igt_create_fb(fd, width, height, format, tiling, fb); + igt_assert(fb_id); + + cr = igt_get_cairo_ctx(fd, fb); + igt_paint_test_pattern(cr, width, height); + igt_assert(cairo_status(cr) == 0); + cairo_destroy(cr); + + return fb_id; +} + +/** + * igt_create_color_pattern_fb: + * @fd: open i915 drm file descriptor + * @width: width of the framebuffer in pixel + * @height: height of the framebuffer in pixel + * @format: drm fourcc pixel format code + * @tiling: tiling layout of the framebuffer + * @r: red value to use as fill color + * @g: green value to use as fill color + * @b: blue value to use as fill color + * @fb: pointer to an #igt_fb structure + * + * This function allocates a gem buffer object suitable to back a framebuffer + * with the requested properties and then wraps it up in a drm framebuffer + * object. All metadata is stored in @fb. + * + * Compared to igt_create_fb() this function also fills the entire framebuffer + * with the given color, and then draws the standard test pattern into the + * framebuffer. + * + * Returns: + * The kms id of the created framebuffer on success or a negative error code on + * failure. + */ +unsigned int igt_create_color_pattern_fb(int fd, int width, int height, + uint32_t format, uint64_t tiling, + double r, double g, double b, + struct igt_fb *fb /* out */) +{ + unsigned int fb_id; + cairo_t *cr; + + fb_id = igt_create_fb(fd, width, height, format, tiling, fb); + igt_assert(fb_id); + + cr = igt_get_cairo_ctx(fd, fb); + igt_paint_color(cr, 0, 0, width, height, r, g, b); + igt_paint_test_pattern(cr, width, height); + igt_assert(cairo_status(cr) == 0); + cairo_destroy(cr); + + return fb_id; +} + +/** + * igt_create_image_fb: + * @drm_fd: open i915 drm file descriptor + * @width: width of the framebuffer in pixel or 0 + * @height: height of the framebuffer in pixel or 0 + * @format: drm fourcc pixel format code + * @tiling: tiling layout of the framebuffer + * @filename: filename of the png image to draw + * @fb: pointer to an #igt_fb structure + * + * Create a framebuffer with the specified image. If @width is zero the + * image width will be used. If @height is zero the image height will be used. + * + * Returns: + * The kms id of the created framebuffer on success or a negative error code on + * failure. + */ +unsigned int igt_create_image_fb(int fd, int width, int height, + uint32_t format, uint64_t tiling, + const char *filename, + struct igt_fb *fb /* out */) +{ + cairo_surface_t *image; + uint32_t fb_id; + cairo_t *cr; + + image = cairo_image_surface_create_from_png(filename); + igt_assert(cairo_surface_status(image) == CAIRO_STATUS_SUCCESS); + if (width == 0) + width = cairo_image_surface_get_width(image); + if (height == 0) + height = cairo_image_surface_get_height(image); + cairo_surface_destroy(image); + + fb_id = igt_create_fb(fd, width, height, format, tiling, fb); + + cr = igt_get_cairo_ctx(fd, fb); + igt_paint_image(cr, filename, 0, 0, width, height); + igt_assert(cairo_status(cr) == 0); + cairo_destroy(cr); + + return fb_id; +} + struct box { int x, y, width, height; }; @@ -656,6 +946,7 @@ uint32_t handle; unsigned size, stride; uint8_t *map; + bool is_dumb; } linear; }; @@ -709,7 +1000,6 @@ struct fb_blit_upload *blit; cairo_format_t cairo_format; unsigned int obj_tiling = fb_mod_to_obj_tiling(fb->tiling); - int bpp, ret; blit = malloc(sizeof(*blit)); igt_assert(blit); @@ -719,14 +1009,14 @@ * cairo). This linear bo will be then blitted to its final * destination, tiling it at the same time. */ - bpp = igt_drm_format_to_bpp(fb->drm_format); - ret = create_bo_for_fb(fd, fb->width, fb->height, bpp, - LOCAL_DRM_FORMAT_MOD_NONE, 0, 0, - &blit->linear.handle, - &blit->linear.size, - &blit->linear.stride); + blit->linear.handle = create_bo_for_fb(fd, fb->width, fb->height, + fb->drm_format, + LOCAL_DRM_FORMAT_MOD_NONE, 0, + 0, &blit->linear.size, + &blit->linear.stride, + &blit->linear.is_dumb); - igt_assert(ret == 0); + igt_assert(blit->linear.handle > 0); blit->fd = fd; blit->fb = fb; @@ -764,28 +1054,54 @@ cairo_format, fb->width, fb->height, blit->linear.stride); + fb->domain = I915_GEM_DOMAIN_GTT; cairo_surface_set_user_data(fb->cairo_surface, (cairo_user_data_key_t *)create_cairo_surface__blit, blit, destroy_cairo_surface__blit); } +/** + * igt_dirty_fb: + * @fd: open drm file descriptor + * @fb: pointer to an #igt_fb structure + * + * Flushes out the whole framebuffer. + * + * Returns: 0 upon success. + */ +int igt_dirty_fb(int fd, struct igt_fb *fb) +{ + return drmModeDirtyFB(fb->fd, fb->fb_id, NULL, 0); +} + static void destroy_cairo_surface__gtt(void *arg) { struct igt_fb *fb = arg; munmap(cairo_image_surface_get_data(fb->cairo_surface), fb->size); fb->cairo_surface = NULL; + + if (fb->is_dumb) + igt_dirty_fb(fb->fd, fb); } static void create_cairo_surface__gtt(int fd, struct igt_fb *fb) { - void *ptr = gem_mmap__gtt(fd, fb->gem_handle, fb->size, PROT_READ | PROT_WRITE); + void *ptr; + + if (fb->is_dumb) + ptr = kmstest_dumb_map_buffer(fd, fb->gem_handle, fb->size, + PROT_READ | PROT_WRITE); + else + ptr = gem_mmap__gtt(fd, fb->gem_handle, fb->size, + PROT_READ | PROT_WRITE); fb->cairo_surface = cairo_image_surface_create_for_data(ptr, drm_format_to_cairo(fb->drm_format), fb->width, fb->height, fb->stride); + fb->domain = I915_GEM_DOMAIN_GTT; cairo_surface_set_user_data(fb->cairo_surface, (cairo_user_data_key_t *)create_cairo_surface__gtt, @@ -802,8 +1118,9 @@ create_cairo_surface__gtt(fd, fb); } - gem_set_domain(fd, fb->gem_handle, - I915_GEM_DOMAIN_CPU, I915_GEM_DOMAIN_CPU); + if (!fb->is_dumb) + gem_set_domain(fd, fb->gem_handle, I915_GEM_DOMAIN_CPU, + I915_GEM_DOMAIN_CPU); igt_assert(cairo_surface_status(fb->cairo_surface) == CAIRO_STATUS_SUCCESS); return fb->cairo_surface; @@ -938,28 +1255,34 @@ } /** - * igt_get_all_formats: + * igt_get_all_cairo_formats: * @formats: pointer to pointer to store the allocated formats array * @format_count: pointer to integer to store the size of the allocated array * - * This functions returns an array of all the drm fourcc codes supported by this - * library. The caller must free the allocated array again with free(). + * This functions returns an array of all the drm fourcc codes supported by + * cairo and this library. */ -void igt_get_all_formats(const uint32_t **formats, int *format_count) +void igt_get_all_cairo_formats(const uint32_t **formats, int *format_count) { static uint32_t *drm_formats; + static int n_formats; if (!drm_formats) { struct format_desc_struct *f; uint32_t *format; - drm_formats = calloc(ARRAY_SIZE(format_desc), - sizeof(*drm_formats)); + n_formats = 0; + for_each_format(f) + if (f->cairo_id != CAIRO_FORMAT_INVALID) + n_formats++; + + drm_formats = calloc(n_formats, sizeof(*drm_formats)); format = &drm_formats[0]; for_each_format(f) - *format++ = f->drm_id; + if (f->cairo_id != CAIRO_FORMAT_INVALID) + *format++ = f->drm_id; } *formats = drm_formats; - *format_count = ARRAY_SIZE(format_desc); + *format_count = n_formats; } diff -Nru intel-gpu-tools-1.13/lib/igt_fb.h intel-gpu-tools-1.15/lib/igt_fb.h --- intel-gpu-tools-1.13/lib/igt_fb.h 2015-11-30 16:15:31.000000000 +0000 +++ intel-gpu-tools-1.15/lib/igt_fb.h 2016-05-23 10:51:28.000000000 +0000 @@ -46,7 +46,9 @@ /* helpers to create nice-looking framebuffers */ struct igt_fb { uint32_t fb_id; + int fd; uint32_t gem_handle; + bool is_dumb; uint32_t drm_format; int width; int height; @@ -54,10 +56,7 @@ uint64_t tiling; unsigned size; cairo_surface_t *cairo_surface; - uint32_t src_x; - uint32_t src_y; - uint32_t src_w; - uint32_t src_h; + unsigned domain; }; enum igt_text_align { @@ -69,6 +68,8 @@ align_hcenter = 0x08, }; +void igt_calc_fb_size(int fd, int width, int height, int bpp, uint64_t tiling, + unsigned *size_ret, unsigned *stride_ret); unsigned int igt_create_fb_with_bo_size(int fd, int width, int height, uint32_t format, uint64_t tiling, @@ -80,9 +81,26 @@ uint32_t format, uint64_t tiling, double r, double g, double b, struct igt_fb *fb /* out */); +unsigned int igt_create_pattern_fb(int fd, int width, int height, + uint32_t format, uint64_t tiling, + struct igt_fb *fb /* out */); +unsigned int igt_create_color_pattern_fb(int fd, int width, int height, + uint32_t format, uint64_t tiling, + double r, double g, double b, + struct igt_fb *fb /* out */); +unsigned int igt_create_image_fb(int drm_fd, int width, int height, + uint32_t format, uint64_t tiling, + const char *filename, + struct igt_fb *fb /* out */); unsigned int igt_create_stereo_fb(int drm_fd, drmModeModeInfo *mode, uint32_t format, uint64_t tiling); void igt_remove_fb(int fd, struct igt_fb *fb); +int igt_dirty_fb(int fd, struct igt_fb *fb); + +int igt_create_bo_with_dimensions(int fd, int width, int height, uint32_t format, + uint64_t modifier, unsigned stride, + unsigned *stride_out, unsigned *size_out, + bool *is_dumb); /* cairo-based painting */ cairo_t *igt_get_cairo_ctx(int fd, struct igt_fb *fb); @@ -92,6 +110,9 @@ double r, double g, double b, double a); void igt_paint_color_gradient(cairo_t *cr, int x, int y, int w, int h, int r, int g, int b); +void igt_paint_color_gradient_range(cairo_t *cr, int x, int y, int w, int h, + double sr, double sg, double sb, + double er, double eg, double eb); void igt_paint_test_pattern(cairo_t *cr, int width, int height); void igt_paint_image(cairo_t *cr, const char *filename, int dst_x, int dst_y, int dst_width, int dst_height); @@ -104,7 +125,7 @@ uint32_t igt_bpp_depth_to_drm_format(int bpp, int depth); uint32_t igt_drm_format_to_bpp(uint32_t drm_format); const char *igt_format_str(uint32_t drm_format); -void igt_get_all_formats(const uint32_t **formats, int *format_count); +void igt_get_all_cairo_formats(const uint32_t **formats, int *format_count); #endif /* __IGT_FB_H__ */ diff -Nru intel-gpu-tools-1.13/lib/igt_gt.c intel-gpu-tools-1.15/lib/igt_gt.c --- intel-gpu-tools-1.13/lib/igt_gt.c 2015-11-30 16:26:22.000000000 +0000 +++ intel-gpu-tools-1.15/lib/igt_gt.c 2016-05-23 10:51:28.000000000 +0000 @@ -30,6 +30,7 @@ #include #include "drmtest.h" +#include "igt_aux.h" #include "igt_core.h" #include "igt_gt.h" #include "igt_debugfs.h" @@ -37,6 +38,10 @@ #include "intel_reg.h" #include "intel_chipset.h" +#if NEW_CONTEXT_PARAM_NO_ERROR_CAPTURE_API +#define LOCAL_CONTEXT_PARAM_NO_ERROR_CAPTURE 0x4 +#endif + /** * SECTION:igt_gt * @short_description: GT support library @@ -50,17 +55,21 @@ static bool has_gpu_reset(int fd) { - struct drm_i915_getparam gp; - int val = 0; - - memset(&gp, 0, sizeof(gp)); - gp.param = 35; /* HAS_GPU_RESET */ - gp.value = &val; - - if (ioctl(fd, DRM_IOCTL_I915_GETPARAM, &gp)) - return intel_gen(intel_get_drm_devid(fd)) >= 5; - - return val > 0; + static int once = -1; + if (once < 0) { + struct drm_i915_getparam gp; + int val = 0; + + memset(&gp, 0, sizeof(gp)); + gp.param = 35; /* HAS_GPU_RESET */ + gp.value = &val; + + if (ioctl(fd, DRM_IOCTL_I915_GETPARAM, &gp)) + once = intel_gen(intel_get_drm_devid(fd)) >= 5; + else + once = val > 0; + } + return once; } /** @@ -71,44 +80,97 @@ * Convenience helper to check whether advanced hang injection is supported by * the kernel. Uses igt_skip to automatically skip the test/subtest if this * isn't the case. + * + * Note that we can't simply just call this from igt_hang_ring since some + * tests want to exercise gpu wedging behavior. For which we intentionally + * disable gpu reset support, but still want to inject a hang, see for example + * tests/gem_eio.c Instead, we expect that the first invocation of + * igt_require_hand_ring be from a vanilla context and use the has_gpu_reset() + * determined then for all later instances. This allows us the convenience + * of double checking when injecting hangs, whilst pushing the complexity + * to the tests that are deliberating trying to break the box. + * + * This function is also controlled by the environment variables: + * + * IGT_HANG (boolean) - if false, skip all tests that try to inject a hang. + * Default: true + * + * IGT_HANG_WITHOUT_RESET (boolean) - if true, allow the hang even if the + * kernel does not support GPU recovery. The machine will be wedged afterwards + * (and so require a reboot between testing), but it does allow limited testing + * to be done under hang injection. + * Default: false */ void igt_require_hang_ring(int fd, int ring) { + if (!igt_check_boolean_env_var("IGT_HANG", true)) + igt_skip("hang injection disabled by user"); + + gem_require_ring(fd, ring); gem_context_require_ban_period(fd); - igt_require(has_gpu_reset(fd)); + if (!igt_check_boolean_env_var("IGT_HANG_WITHOUT_RESET", false)) + igt_require(has_gpu_reset(fd)); } /** - * igt_hang_ring: + * igt_hang_ring_ctx: * @fd: open i915 drm file descriptor + * @ctx: the contxt specifier * @ring: execbuf ring flag + * @flags: set of flags to control execution * - * This helper function injects a hanging batch into @ring. It returns a - * #igt_hang_ring_t structure which must be passed to igt_post_hang_ring() for - * hang post-processing (after the gpu hang interaction has been tested. + * This helper function injects a hanging batch associated with @ctx into @ring. + * It returns a #igt_hang_ring_t structure which must be passed to + * igt_post_hang_ring() for hang post-processing (after the gpu hang + * interaction has been tested. * * Returns: * Structure with helper internal state for igt_post_hang_ring(). */ -igt_hang_ring_t igt_hang_ring(int fd, int ring) +igt_hang_ring_t igt_hang_ctx(int fd, + uint32_t ctx, + int ring, + unsigned flags, + uint64_t *offset) { struct drm_i915_gem_relocation_entry reloc; struct drm_i915_gem_execbuffer2 execbuf; struct drm_i915_gem_exec_object2 exec; struct local_i915_gem_context_param param; - uint32_t b[8]; + uint32_t b[16]; unsigned ban; unsigned len; - param.context = 0; + igt_require_hang_ring(fd, ring); + + /* One day the kernel ABI will be fixed! */ + igt_require(ctx == 0 || ring == I915_EXEC_RENDER); + + param.context = ctx; param.size = 0; + + if ((flags & HANG_ALLOW_CAPTURE) == 0) { +#if NEW_CONTEXT_PARAM_NO_ERROR_CAPTURE_API + param.param = LOCAL_CONTEXT_PARAM_NO_ERROR_CAPTURE; + param.value = 1; + /* Older kernels may not have NO_ERROR_CAPTURE, in which case + * we just eat the error state in post-hang (and hope we eat + * the right one). + */ + __gem_context_set_param(fd, ¶m); +#endif + } + param.param = LOCAL_CONTEXT_PARAM_BAN_PERIOD; param.value = 0; gem_context_get_param(fd, ¶m); ban = param.value; - param.value = 0; - gem_context_set_param(fd, ¶m); + if ((flags & HANG_ALLOW_BAN) == 0) { + param.param = LOCAL_CONTEXT_PARAM_BAN_PERIOD; + param.value = 0; + gem_context_set_param(fd, ¶m); + } memset(&reloc, 0, sizeof(reloc)); memset(&exec, 0, sizeof(exec)); @@ -118,25 +180,60 @@ exec.relocation_count = 1; exec.relocs_ptr = (uintptr_t)&reloc; + memset(b, 0xc5, sizeof(b)); + b[0] = 0xffffffff; len = 2; if (intel_gen(intel_get_drm_devid(fd)) >= 8) len++; - b[0] = MI_BATCH_BUFFER_START | (len - 2); - b[len] = MI_BATCH_BUFFER_END; - b[len+1] = MI_NOOP; + b[1] = MI_BATCH_BUFFER_START | (len - 2); + b[1+len] = MI_BATCH_BUFFER_END; + b[2+len] = MI_NOOP; gem_write(fd, exec.handle, 0, b, sizeof(b)); - reloc.offset = 4; + reloc.offset = 8; reloc.target_handle = exec.handle; reloc.read_domains = I915_GEM_DOMAIN_COMMAND; execbuf.buffers_ptr = (uintptr_t)&exec; execbuf.buffer_count = 1; - execbuf.batch_len = sizeof(b); execbuf.flags = ring; + i915_execbuffer2_set_context_id(execbuf, ctx); gem_execbuf(fd, &execbuf); - return (struct igt_hang_ring){ exec.handle, ban }; + if (offset) + *offset = exec.offset; + + return (struct igt_hang_ring){ exec.handle, ctx, ban, flags }; +} + +/** + * igt_hang_ring: + * @fd: open i915 drm file descriptor + * @ring: execbuf ring flag + * + * This helper function injects a hanging batch into @ring. It returns a + * #igt_hang_ring_t structure which must be passed to igt_post_hang_ring() for + * hang post-processing (after the gpu hang interaction has been tested. + * + * Returns: + * Structure with helper internal state for igt_post_hang_ring(). + */ +igt_hang_ring_t igt_hang_ring(int fd, int ring) +{ + return igt_hang_ctx(fd, 0, ring, 0, NULL); +} + +static void eat_error_state(void) +{ + int fd, ret; + + fd = igt_debugfs_open("i915_error_state", O_WRONLY); + do { + ret = write(fd, "", 1); + if (ret < 0) + ret = -errno; + } while (ret == -EINTR || ret == -EAGAIN); + close(fd); } /** @@ -158,11 +255,45 @@ I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT); gem_close(fd, arg.handle); - param.context = 0; + param.context = arg.ctx; param.size = 0; param.param = LOCAL_CONTEXT_PARAM_BAN_PERIOD; param.value = arg.ban; gem_context_set_param(fd, ¶m); + + if ((arg.flags & HANG_ALLOW_CAPTURE) == 0) { +#if NEW_CONTEXT_PARAM_NO_ERROR_CAPTURE_API + param.param = LOCAL_CONTEXT_PARAM_NO_ERROR_CAPTURE; + param.value = 0; + if (__gem_context_set_param(fd, ¶m)) + eat_error_state(); +#else + eat_error_state(); +#endif + } +} + +/** + * igt_force_gpu_reset: + * + * forces a gpu reset using the i915_wedged debugfs interface. To be used to + * recover from situations where the hangcheck didn't trigger and/or the gpu is + * stuck, either because the test manually disabled gpu resets or because the + * test hit an hangcheck bug + */ +void igt_force_gpu_reset(void) +{ + int fd, ret; + + igt_debug("Triggering GPU reset\n"); + + fd = igt_debugfs_open("i915_wedged", O_RDWR); + igt_require(fd >= 0); + + ret = write(fd, "-1\n", 3); + close(fd); + + igt_assert_eq(ret, 3); } /* GPU abusers */ @@ -190,31 +321,22 @@ * This is useful to exercise slow running code (such as aperture placement) * which needs to be robust against a GPU reset. * - * In tests with subtests this function can be called outside of failure - * catching code blocks like #igt_fixture or #igt_subtest. + * This function automatically skips when test requirements aren't met using + * igt_skip(). */ -int igt_fork_hang_helper(void) +void igt_fork_hang_helper(void) { int fd, gen; - if (igt_only_list_subtests()) - return 1; - fd = drm_open_driver(DRIVER_INTEL); - if (fd == -1) - return 0; gen = intel_gen(intel_get_drm_devid(fd)); - if (gen < 5) { - close(fd); - return 0; - } + igt_skip_on(gen < 5); igt_fork_helper(&hang_helper) hang_helper_process(getppid(), fd); close(fd); - return 1; } /** @@ -227,10 +349,8 @@ */ void igt_stop_hang_helper(void) { - if (igt_only_list_subtests()) - return; - - igt_stop_helper(&hang_helper); + if (hang_helper.running) + igt_stop_helper(&hang_helper); } /** @@ -248,109 +368,114 @@ return -1; return igt_debugfs_open("i915_forcewake_user", O_WRONLY); } +static unsigned int clflush_size; -/** - * igt_to_stop_ring_flag: - * @ring: the specified ring flag from execbuf ioctl (I915_EXEC_*) - * - * This converts the specified ring to a ring flag to be used - * with igt_get_stop_rings() and igt_set_stop_rings(). - * - * Returns: - * Ring flag for the given ring. - */ -enum stop_ring_flags igt_to_stop_ring_flag(int ring) { - if (ring == I915_EXEC_DEFAULT) - return STOP_RING_RENDER; +#if defined(__x86_64__) || defined(__i386__) +int igt_setup_clflush(void) +{ + FILE *file; + char *line = NULL; + size_t size = 0; + int first_stanza = 1; + int has_clflush = 0; - igt_assert(ring && ((ring & ~I915_EXEC_RING_MASK) == 0)); - return 1 << (ring - 1); -} + if (clflush_size) + return 1; -static void stop_rings_write(uint32_t mask) -{ - int fd; - char buf[80]; + file = fopen("/proc/cpuinfo", "r"); + if (file == NULL) + return 0; - igt_assert(snprintf(buf, sizeof(buf), "0x%08x", mask) == 10); - fd = igt_debugfs_open("i915_ring_stop", O_WRONLY); - igt_assert(fd >= 0); + while (getline(&line, &size, file) != -1) { + if (strncmp(line, "processor", 9) == 0) { + if (!first_stanza) + break; + first_stanza = 0; + } + + if (strncmp(line, "flags", 5) == 0) { + if (strstr(line, "clflush")) + has_clflush = 1; + } + + if (strncmp(line, "clflush size", 12) == 0) { + char *colon = strchr(line, ':'); + if (colon) + clflush_size = atoi(colon + 1); + } + } + free(line); + fclose(file); - igt_assert(write(fd, buf, strlen(buf)) == strlen(buf)); - close(fd); + return has_clflush && clflush_size; } -/** - * igt_get_stop_rings: - * - * Read current ring flags from 'i915_ring_stop' debugfs entry. - * - * Returns: - * Current ring flags. - */ -enum stop_ring_flags igt_get_stop_rings(void) +__attribute__((target("sse2"))) +void igt_clflush_range(void *addr, int size) { - int fd; - char buf[80]; - int l; - unsigned long long ring_mask; - - fd = igt_debugfs_open("i915_ring_stop", O_RDONLY); - igt_assert(fd >= 0); - l = read(fd, buf, sizeof(buf)-1); - igt_assert(l > 0); - igt_assert(l < sizeof(buf)); + char *p, *end; - buf[l] = '\0'; + end = (char *)addr + size; + p = (char *)((uintptr_t)addr & ~((uintptr_t)clflush_size - 1)); - close(fd); + __builtin_ia32_mfence(); + for (; p < end; p += clflush_size) + __builtin_ia32_clflush(p); + __builtin_ia32_clflush(end - 1); /* magic serialisation for byt+ */ + __builtin_ia32_mfence(); +} +#else +int igt_setup_clflush(void) +{ + /* requires mfence + clflush, both SSE2 instructions */ + return 0; +} - errno = 0; - ring_mask = strtoull(buf, NULL, 0); - igt_assert(errno == 0); - return ring_mask; +void igt_clflush_range(void *addr, int size) +{ + fprintf(stderr, "igt_clflush_range() unsupported\n"); } +#endif /** - * igt_set_stop_rings: - * @flags: Ring flags to write + * intel_detect_and_clear_missed_irq: + * @fd: open i915 drm file descriptor, used to quiesce the gpu * - * This writes @flags to 'i915_ring_stop' debugfs entry. Driver will - * prevent the CPU from writing tail pointer for the ring that @flags - * specify. Note that the ring is not stopped right away. Instead any - * further command emissions won't be executed after the flag is set. - * - * This is the least invasive way to make the GPU stuck. Hence you must - * set this after a batch submission with it's own invalid or endless - * looping instructions. In this case it is merely for giving notification - * for the driver that this was simulated hang, as the batch would have - * caused hang in any case. On the other hand if you use a valid or noop - * batch and want to hang the ring (GPU), you must set corresponding flag - * before submitting the batch. - * - * Driver checks periodically if a ring is making any progress, and if - * it is not, it will declare the ring to be hung and will reset the GPU. - * After reset, the driver will clear flags in 'i915_ring_stop' - * - * Note: Always when hanging the GPU, use igt_set_stop_rings() to - * notify the driver. Driver controls hang log messaging based on - * these flags and thus prevents false positives on logs. + * This functions idles the GPU and then queries whether there has + * been a missed interrupt reported by the driver. Afterwards it + * clears the missed interrupt flag, in order to disable the timer + * fallback for the next test. */ -void igt_set_stop_rings(enum stop_ring_flags flags) +unsigned intel_detect_and_clear_missed_interrupts(int fd) { - enum stop_ring_flags current; + unsigned missed = 0; + FILE *file; - igt_assert((flags & ~(STOP_RING_ALL | - STOP_RING_ALLOW_BAN | - STOP_RING_ALLOW_ERRORS)) == 0); - - current = igt_get_stop_rings(); - igt_assert_f(flags == 0 || current == 0, - "previous i915_ring_stop is still 0x%x\n", current); - - stop_rings_write(flags); - current = igt_get_stop_rings(); - igt_warn_on_f(current != flags, - "i915_ring_stop readback mismatch 0x%x vs 0x%x\n", - flags, current); + gem_quiescent_gpu(fd); + + file = igt_debugfs_fopen("i915_ring_missed_irq", "r"); + if (file) { + igt_assert(fscanf(file, "%x", &missed) == 1); + fclose(file); + } + if (missed) { + file = igt_debugfs_fopen("i915_ring_missed_irq", "w"); + if (file) { + fwrite("0\n", 1, 2, file); + fclose(file); + } + } + + return missed; } + +const struct intel_execution_engine intel_execution_engines[] = { + { "default", NULL, 0, 0 }, + { "render", "render ring", I915_EXEC_RENDER, 0 }, + { "bsd", "bsd ring", I915_EXEC_BSD, 0 }, + { "bsd1", "bsd ring", I915_EXEC_BSD, 1<<13 /*I915_EXEC_BSD_RING1*/ }, + { "bsd2", "bsd2 ring", I915_EXEC_BSD, 2<<13 /*I915_EXEC_BSD_RING2*/ }, + { "blt", "blitter ring", I915_EXEC_BLT, 0 }, + { "vebox", "video enhancement ring", I915_EXEC_VEBOX, 0 }, + { NULL, 0, 0 } +}; diff -Nru intel-gpu-tools-1.13/lib/igt_gt.h intel-gpu-tools-1.15/lib/igt_gt.h --- intel-gpu-tools-1.13/lib/igt_gt.h 2015-11-30 16:15:31.000000000 +0000 +++ intel-gpu-tools-1.15/lib/igt_gt.h 2016-05-23 10:51:28.000000000 +0000 @@ -30,48 +30,50 @@ typedef struct igt_hang_ring { unsigned handle; + unsigned ctx; unsigned ban; + unsigned flags; } igt_hang_ring_t; +#define HANG_POISON 0xc5c5c5c5 + +struct igt_hang_ring igt_hang_ctx(int fd, + uint32_t ctx, + int ring, + unsigned flags, + uint64_t *offset); +#define HANG_ALLOW_BAN 1 +#define HANG_ALLOW_CAPTURE 2 + struct igt_hang_ring igt_hang_ring(int fd, int ring); void igt_post_hang_ring(int fd, struct igt_hang_ring arg); -int igt_fork_hang_helper(void); +void igt_force_gpu_reset(void); + +void igt_fork_hang_helper(void); void igt_stop_hang_helper(void); int igt_open_forcewake_handle(void); -/** - * stop_ring_flags: - * @STOP_RING_NONE: Can be used to clear the pending stop (warning: hang might - * be declared already). Returned by igt_get_stop_rings() if there is - * no currently stopped rings. - * @STOP_RING_RENDER: Render ring - * @STOP_RING_BSD: Video encoding/decoding ring - * @STOP_RING_BLT: Blitter ring - * @STOP_RING_VEBOX: Video enhancement ring - * @STOP_RING_ALL: All rings - * @STOP_RING_ALLOW_ERRORS: Driver will not omit expected DRM_ERRORS - * @STOP_RING_ALLOW_BAN: Driver will use context ban policy - * @STOP_RING_DEFAULTS: STOP_RING_ALL | STOP_RING_ALLOW_ERRORS - * - * Enumeration of all supported flags for igt_set_stop_rings(). - * - */ -enum stop_ring_flags { - STOP_RING_NONE = 0x00, - STOP_RING_RENDER = (1 << 0), - STOP_RING_BSD = (1 << 1), - STOP_RING_BLT = (1 << 2), - STOP_RING_VEBOX = (1 << 3), - STOP_RING_ALL = 0xff, - STOP_RING_ALLOW_ERRORS = (1 << 30), - STOP_RING_ALLOW_BAN = (1 << 31), - STOP_RING_DEFAULTS = STOP_RING_ALL | STOP_RING_ALLOW_ERRORS, -}; - -enum stop_ring_flags igt_to_stop_ring_flag(int ring); -void igt_set_stop_rings(enum stop_ring_flags flags); -enum stop_ring_flags igt_get_stop_rings(void); +int igt_setup_clflush(void); +void igt_clflush_range(void *addr, int size); + +unsigned intel_detect_and_clear_missed_interrupts(int fd); + +extern const struct intel_execution_engine { + const char *name; + const char *full_name; + unsigned exec_id; + unsigned flags; +} intel_execution_engines[]; + +#define for_if(expr__) if (!(expr__)) {} else + +#define for_each_engine(fd__, flags__) \ + for (const struct intel_execution_engine *e__ = intel_execution_engines;\ + e__->name; \ + e__++) \ + for_if (gem_has_ring(fd, flags__ = e__->exec_id | e__->flags)) + #endif /* IGT_GT_H */ diff -Nru intel-gpu-tools-1.13/lib/igt.h intel-gpu-tools-1.15/lib/igt.h --- intel-gpu-tools-1.13/lib/igt.h 2015-11-30 16:15:31.000000000 +0000 +++ intel-gpu-tools-1.15/lib/igt.h 2016-05-23 10:51:28.000000000 +0000 @@ -35,6 +35,7 @@ #include "igt_fb.h" #include "igt_gt.h" #include "igt_kms.h" +#include "igt_pm.h" #include "igt_stats.h" #include "instdone.h" #include "intel_batchbuffer.h" diff -Nru intel-gpu-tools-1.13/lib/igt_kms.c intel-gpu-tools-1.15/lib/igt_kms.c --- intel-gpu-tools-1.13/lib/igt_kms.c 2015-11-30 16:26:22.000000000 +0000 +++ intel-gpu-tools-1.15/lib/igt_kms.c 2016-05-23 10:51:28.000000000 +0000 @@ -53,6 +53,23 @@ #define MAX_CONNECTORS 32 static char *forced_connectors[MAX_CONNECTORS + 1]; +static void update_edid_csum(unsigned char *edid) +{ + int i, sum = 0; + struct tm *tm; + time_t t; + + /* year of manufacture */ + t = time(NULL); + tm = localtime(&t); + edid[17] = tm->tm_year - 90; + + /* calculate checksum */ + for (i = 0; i < 127; i++) { + sum = sum + edid[i]; + } + edid[127] = 256 - sum; +} #define VFREQ 60 #define CLOCK 148500 @@ -68,62 +85,8 @@ #define HSIZE 52 #define VSIZE 30 -#define GAMMA(x) (x * 100) - 100 - -#define MANUFACTURER_ID(a, b, c) (a - '@') << 2 | (b - '@') >> 3, \ - (b - '@') << 5 | (c - '@') - - -#define ab(x, y) (x & 0xff), (y & 0xff), ((x & 0xf00) >> 4) | ((y & 0xf00) >> 8) -#define op(ho, hp, vo, vp) (ho & 0xff), (hp & 0xff), \ - ((vo & 0xf) << 4) | (vp & 0xf), \ - ((ho & 0x300) >> 2) | ((hp & 0x300) >> 4) \ - | ((vo & 0x30) >> 2) | (vp & 0x30 >> 4) - -static unsigned char base_edid[EDID_LENGTH] = { - 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, /* header */ - MANUFACTURER_ID('I', 'G', 'T'), - /* product code, serial number, week and year of manufacture */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x01, 0x03, /* edid version (1.3) */ - /* basic display parameters */ - /* digital display, maximum horizontal image size, maximum vertical - * image size, gamma, features: RGB 4:4:4, native pixel format and - * refresh rate in descriptor 1 */ - 0x80, HSIZE, VSIZE, GAMMA(2.20), 0x02, - /* chromaticity coordinates */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - /* established timings: 640x480 60Hz, 800x600 60Hz, 1024x768 60Hz */ - 0x21, 0x08, 0x00, - /* standard timings */ - 0xd1, 0xc0, /* 1920x1080 60Hz */ - 0x81, 0xc0, /* 1280x720 60Hz */ - 0x61, 0x40, /* 1024x768 60Hz */ - 0x45, 0x40, /* 800x600 60Hz */ - 0x31, 0x40, /* 640x480 60Hz */ - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - /* descriptor 1 (preferred timing) */ - (CLOCK / 10) & 0x00ff, ((CLOCK / 10) & 0xff00) >> 8, - ab(HACTIVE, HBLANK), ab(VACTIVE, VBLANK), - op(HOFFSET, HPULSE, VOFFSET, VPULSE), - ab(HSIZE * 10, VSIZE * 10), - 0x00, 0x00, 0x00, - /* descriptor 2 (monitor range limits) */ - 0x00, 0x00, 0x00, 0xfd, 0x00, - VFREQ - 1, VFREQ + 1, /* minimum, maximum vertical field rate */ - (CLOCK / (HACTIVE + HBLANK)) - 1, /* minimum horizontal line rate */ - (CLOCK / (HACTIVE + HBLANK)) + 1, /* maximum horizontal line rate */ - (CLOCK / 10000) + 1, /* maximum pixel clock rate */ - 0x00, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - /* descriptor 3 (name descriptor) */ - 0x00, 0x00, 0x00, 0xfc, 0x00, 'I', 'G', 'T', 0x0a, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - /* descriptor 4 */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - /* extensions, checksum */ - 0x00, 0x00 -}; +#define EDID_NAME base_edid +#include "igt_edid_template.h" /** * igt_kms_get_base_edid: @@ -143,24 +106,168 @@ */ const unsigned char* igt_kms_get_base_edid(void) { - int i, sum = 0; - struct tm *tm; - time_t t; + update_edid_csum(base_edid); - /* year of manufacture */ - t = time(NULL); - tm = localtime(&t); - base_edid[17] = tm->tm_year - 90; + return base_edid; +} - /* calculate checksum */ - for (i = 0; i < 127; i++) { - sum = sum + base_edid[i]; +#define VFREQ 60 +#define CLOCK 101000 +#define HACTIVE 1400 +#define HBLANK 160 +#define VACTIVE 1050 +#define VBLANK 30 +#define HOFFSET 48 +#define HPULSE 32 +#define VOFFSET 3 +#define VPULSE 4 + +#define HSIZE 52 +#define VSIZE 30 + +#define EDID_NAME alt_edid +#include "igt_edid_template.h" + +/** + * igt_kms_get_alt_edid: + * + * Get an alternate edid block, which includes the following modes: + * + * - 1400x1050 60Hz + * - 1920x1080 60Hz + * - 1280x720 60Hz + * - 1024x768 60Hz + * - 800x600 60Hz + * - 640x480 60Hz + * + * This can be extended with further features using functions such as + * #kmstest_edid_add_3d. + * + * Returns: an alternate edid block + */ +static const char *igt_plane_prop_names[IGT_NUM_PLANE_PROPS] = { + "SRC_X", + "SRC_Y", + "SRC_W", + "SRC_H", + "CRTC_X", + "CRTC_Y", + "CRTC_W", + "CRTC_H", + "FB_ID", + "CRTC_ID", + "type", + "rotation" +}; + +static const char *igt_crtc_prop_names[IGT_NUM_CRTC_PROPS] = { + "background_color", + "DEGAMMA_LUT", + "CTM", + "GAMMA_LUT", +}; + +static const char *igt_connector_prop_names[IGT_NUM_CONNECTOR_PROPS] = { + "scaling mode", + "DPMS" +}; + +/* + * Retrieve all the properies specified in props_name and store them into + * plane->atomic_props_plane. + */ +static void +igt_atomic_fill_plane_props(igt_display_t *display, igt_plane_t *plane, + int num_props, const char **prop_names) +{ + drmModeObjectPropertiesPtr props; + int i, j, fd; + + fd = display->drm_fd; + + props = drmModeObjectGetProperties(fd, plane->drm_plane->plane_id, DRM_MODE_OBJECT_PLANE); + igt_assert(props); + + for (i = 0; i < props->count_props; i++) { + drmModePropertyPtr prop = + drmModeGetProperty(fd, props->props[i]); + + for (j = 0; j < num_props; j++) { + if (strcmp(prop->name, prop_names[j]) != 0) + continue; + + plane->atomic_props_plane[j] = props->props[i]; + break; + } + + drmModeFreeProperty(prop); } - base_edid[127] = 256 - sum; - return base_edid; + drmModeFreeObjectProperties(props); } +/* + * Retrieve all the properies specified in props_name and store them into + * config->atomic_props_crtc and config->atomic_props_connector. + */ +static void +igt_atomic_fill_props(igt_display_t *display, igt_output_t *output, + int num_crtc_props, const char **crtc_prop_names, + int num_connector_props, const char **conn_prop_names) +{ + drmModeObjectPropertiesPtr props; + int i, j, fd; + + fd = display->drm_fd; + + props = drmModeObjectGetProperties(fd, output->config.crtc->crtc_id, DRM_MODE_OBJECT_CRTC); + igt_assert(props); + + for (i = 0; i < props->count_props; i++) { + drmModePropertyPtr prop = + drmModeGetProperty(fd, props->props[i]); + + for (j = 0; j < num_crtc_props; j++) { + if (strcmp(prop->name, crtc_prop_names[j]) != 0) + continue; + + output->config.atomic_props_crtc[j] = props->props[i]; + break; + } + + drmModeFreeProperty(prop); + } + + drmModeFreeObjectProperties(props); + props = NULL; + props = drmModeObjectGetProperties(fd, output->config.connector->connector_id, DRM_MODE_OBJECT_CONNECTOR); + igt_assert(props); + + for (i = 0; i < props->count_props; i++) { + drmModePropertyPtr prop = + drmModeGetProperty(fd, props->props[i]); + + for (j = 0; j < num_connector_props; j++) { + if (strcmp(prop->name, conn_prop_names[j]) != 0) + continue; + + output->config.atomic_props_connector[j] = props->props[i]; + break; + } + + drmModeFreeProperty(prop); + } + + drmModeFreeObjectProperties(props); + +} + +const unsigned char* igt_kms_get_alt_edid(void) +{ + update_edid_csum(alt_edid); + + return alt_edid; +} /** * SECTION:igt_kms @@ -271,20 +378,119 @@ * @fd: DRM fd * @crtc_id: DRM CRTC id * - * Returns: The pipe number for the given DRM CRTC @crtc_id. This maps directly - * to an enum pipe value used in other helper functions. + * Returns: The crtc index for the given DRM CRTC ID @crtc_id. The crtc index + * is the equivalent of the pipe id. This value maps directly to an enum pipe + * value used in other helper functions. Returns 0 if the index could not be + * determined. */ + int kmstest_get_pipe_from_crtc_id(int fd, int crtc_id) { - struct drm_i915_get_pipe_from_crtc_id pfci; - int ret; + drmModeRes *res; + drmModeCrtc *crtc; + int i, cur_id; - memset(&pfci, 0, sizeof(pfci)); - pfci.crtc_id = crtc_id; - ret = drmIoctl(fd, DRM_IOCTL_I915_GET_PIPE_FROM_CRTC_ID, &pfci); - igt_assert(ret == 0); + res = drmModeGetResources(fd); + igt_assert(res); - return pfci.pipe; + for (i = 0; i < res->count_crtcs; i++) { + crtc = drmModeGetCrtc(fd, res->crtcs[i]); + igt_assert(crtc); + cur_id = crtc->crtc_id; + drmModeFreeCrtc(crtc); + if (cur_id == crtc_id) + break; + } + + igt_assert(i < res->count_crtcs); + + drmModeFreeResources(res); + + return i; +} + +/** + * kmstest_find_crtc_for_connector: + * @fd: DRM fd + * @res: libdrm resources pointer + * @connector: libdrm connector pointer + * @crtc_blacklist_idx_mask: a mask of CRTC indexes that we can't return + * + * Returns: the CRTC ID for a CRTC that fits the connector, otherwise it asserts + * false and never returns. The blacklist mask can be used in case you have + * CRTCs that are already in use by other connectors. + */ +uint32_t kmstest_find_crtc_for_connector(int fd, drmModeRes *res, + drmModeConnector *connector, + uint32_t crtc_blacklist_idx_mask) +{ + drmModeEncoder *e; + uint32_t possible_crtcs; + int i, j; + + for (i = 0; i < connector->count_encoders; i++) { + e = drmModeGetEncoder(fd, connector->encoders[i]); + possible_crtcs = e->possible_crtcs & ~crtc_blacklist_idx_mask; + drmModeFreeEncoder(e); + + for (j = 0; possible_crtcs >> j; j++) + if (possible_crtcs & (1 << j)) + return res->crtcs[j]; + } + + igt_assert(false); +} + +/** + * kmstest_dumb_create: + * @fd: open drm file descriptor + * @width: width of the buffer in pixels + * @height: height of the buffer in pixels + * @bpp: bytes per pixel of the buffer + * + * This wraps the CREATE_DUMB ioctl, which allocates a new dumb buffer object + * for the specified dimensions. + * + * Returns: The file-private handle of the created buffer object + */ +uint32_t kmstest_dumb_create(int fd, int width, int height, int bpp, + unsigned *stride, unsigned *size) +{ + struct drm_mode_create_dumb create; + + memset(&create, 0, sizeof(create)); + create.width = width; + create.height = height; + create.bpp = bpp; + + create.handle = 0; + do_ioctl(fd, DRM_IOCTL_MODE_CREATE_DUMB, &create); + igt_assert(create.handle); + igt_assert(create.size >= width * height * bpp / 8); + + if (stride) + *stride = create.pitch; + + if (size) + *size = create.size; + + return create.handle; +} + +void *kmstest_dumb_map_buffer(int fd, uint32_t handle, uint64_t size, + unsigned prot) +{ + struct drm_mode_map_dumb arg = {}; + void *ptr; + + arg.handle = handle; + + do_ioctl(fd, DRM_IOCTL_MODE_MAP_DUMB, &arg); + + ptr = mmap(NULL, size, prot, MAP_SHARED, fd, arg.offset); + igt_assert(ptr != MAP_FAILED); + + return ptr; } /* @@ -361,9 +567,7 @@ igt_install_exit_handler((igt_exit_handler_t) kmstest_restore_vt_mode); - igt_disable_exit_handler(); ret = set_vt_mode(KD_GRAPHICS); - igt_enable_exit_handler(); igt_assert(ret >= 0); orig_vt_mode = ret; @@ -393,6 +597,7 @@ char *path, **tmp; const char *value; int debugfs_fd, ret, len; + drmModeConnector *temp; uint32_t devid; devid = intel_get_drm_devid(drm_fd); @@ -459,6 +664,11 @@ igt_install_exit_handler(reset_connectors_at_exit); + /* To allow callers to always use GetConnectorCurrent we need to force a + * redetection here. */ + temp = drmModeGetConnector(drm_fd, connector->connector_id); + drmModeFreeConnector(temp); + igt_assert(ret != -1); return (ret == -1) ? false : true; } @@ -480,6 +690,7 @@ { char *path; int debugfs_fd, ret; + drmModeConnector *temp; igt_assert_neq(asprintf(&path, "%s-%d/edid_override", kmstest_connector_type_str(connector->connector_type), connector->connector_type_id), -1); @@ -494,6 +705,11 @@ ret = write(debugfs_fd, edid, length); close(debugfs_fd); + /* To allow callers to always use GetConnectorCurrent we need to force a + * redetection here. */ + temp = drmModeGetConnector(drm_fd, connector->connector_id); + drmModeFreeConnector(temp); + igt_assert(ret != -1); } @@ -531,18 +747,20 @@ } /** - * kmstest_get_connector_config: + * _kmstest_connector_config: * @drm_fd: DRM fd * @connector_id: DRM connector id * @crtc_idx_mask: mask of allowed DRM CRTC indices * @config: structure filled with the possible configuration + * @probe: whether to fully re-probe mode list or not * * This tries to find a suitable configuration for the given connector and CRTC * constraint and fills it into @config. */ -bool kmstest_get_connector_config(int drm_fd, uint32_t connector_id, - unsigned long crtc_idx_mask, - struct kmstest_connector_config *config) +static bool _kmstest_connector_config(int drm_fd, uint32_t connector_id, + unsigned long crtc_idx_mask, + struct kmstest_connector_config *config, + bool probe) { drmModeRes *resources; drmModeConnector *connector; @@ -556,7 +774,11 @@ } /* First, find the connector & mode */ - connector = drmModeGetConnector(drm_fd, connector_id); + if (probe) + connector = drmModeGetConnector(drm_fd, connector_id); + else + connector = drmModeGetConnectorCurrent(drm_fd, connector_id); + if (!connector) goto err2; @@ -632,6 +854,43 @@ } /** + * kmstest_get_connector_config: + * @drm_fd: DRM fd + * @connector_id: DRM connector id + * @crtc_idx_mask: mask of allowed DRM CRTC indices + * @config: structure filled with the possible configuration + * + * This tries to find a suitable configuration for the given connector and CRTC + * constraint and fills it into @config. + */ +bool kmstest_get_connector_config(int drm_fd, uint32_t connector_id, + unsigned long crtc_idx_mask, + struct kmstest_connector_config *config) +{ + return _kmstest_connector_config(drm_fd, connector_id, crtc_idx_mask, + config, 0); +} + +/** + * kmstest_probe_connector_config: + * @drm_fd: DRM fd + * @connector_id: DRM connector id + * @crtc_idx_mask: mask of allowed DRM CRTC indices + * @config: structure filled with the possible configuration + * + * This tries to find a suitable configuration for the given connector and CRTC + * constraint and fills it into @config, fully probing the connector in the + * process. + */ +bool kmstest_probe_connector_config(int drm_fd, uint32_t connector_id, + unsigned long crtc_idx_mask, + struct kmstest_connector_config *config) +{ + return _kmstest_connector_config(drm_fd, connector_id, crtc_idx_mask, + config, 1); +} + +/** * kmstest_free_connector_config: * @config: connector configuration structure * @@ -830,6 +1089,25 @@ } } +/** + * kmstest_get_crtc_idx: + * @res: the libdrm resources + * @crtc_id: the CRTC id + * + * Get the CRTC index based on its ID. This is useful since a few places of + * libdrm deal with CRTC masks. + */ +int kmstest_get_crtc_idx(drmModeRes *res, uint32_t crtc_id) +{ + int i; + + for (i = 0; i < res->count_crtcs; i++) + if (res->crtcs[i] == crtc_id) + return i; + + igt_assert(false); +} + /* * A small modeset API */ @@ -907,6 +1185,8 @@ kmstest_pipe_name(output->config.pipe)); display->pipes_in_use |= 1 << output->config.pipe; + igt_atomic_fill_props(display, output, IGT_NUM_CRTC_PROPS, igt_crtc_prop_names, + IGT_NUM_CONNECTOR_PROPS, igt_connector_prop_names); } static bool @@ -976,6 +1256,7 @@ drmModeRes *resources; drmModePlaneRes *plane_resources; int i; + int is_atomic = 0; memset(display, 0, sizeof(igt_display_t)); @@ -993,6 +1274,7 @@ display->n_pipes = resources->count_crtcs; drmSetClientCap(drm_fd, DRM_CLIENT_CAP_UNIVERSAL_PLANES, 1); + is_atomic = drmSetClientCap(drm_fd, DRM_CLIENT_CAP_ATOMIC, 1); plane_resources = drmModeGetPlaneResources(display->drm_fd); igt_assert(plane_resources); @@ -1002,6 +1284,7 @@ int p = IGT_PLANE_2; int j, type; + pipe->crtc_id = resources->crtcs[i]; pipe->display = display; pipe->pipe = i; @@ -1049,6 +1332,10 @@ plane->pipe = pipe; plane->drm_plane = drm_plane; + if (is_atomic == 0) { + display->is_atomic = 1; + igt_atomic_fill_plane_props(display, plane, IGT_NUM_PLANE_PROPS, igt_plane_prop_names); + } get_plane_property(display->drm_fd, drm_plane->plane_id, "rotation", @@ -1126,6 +1413,7 @@ for (j = 0; j < display->n_pipes; j++) { uint64_t prop_value; igt_pipe_t *pipe = &display->pipes[j]; + if (output->config.crtc) { get_crtc_property(display->drm_fd, output->config.crtc->crtc_id, "background_color", @@ -1133,6 +1421,21 @@ &prop_value, NULL); pipe->background = (uint32_t)prop_value; + get_crtc_property(display->drm_fd, output->config.crtc->crtc_id, + "DEGAMMA_LUT", + &pipe->degamma_property, + NULL, + NULL); + get_crtc_property(display->drm_fd, output->config.crtc->crtc_id, + "CTM", + &pipe->ctm_property, + NULL, + NULL); + get_crtc_property(display->drm_fd, output->config.crtc->crtc_id, + "GAMMA_LUT", + &pipe->gamma_property, + NULL, + NULL); } } } @@ -1282,6 +1585,16 @@ return &pipe->planes[idx]; } +bool igt_pipe_get_property(igt_pipe_t *pipe, const char *name, + uint32_t *prop_id, uint64_t *value, + drmModePropertyPtr *prop) +{ + return get_crtc_property(pipe->display->drm_fd, + pipe->crtc_id, + name, + prop_id, value, prop); +} + static uint32_t igt_plane_get_fb_id(igt_plane_t *plane) { if (plane->fb) @@ -1304,6 +1617,80 @@ igt_assert(r == 0); \ } + + + +/* + * Add position and fb changes of a plane to the atomic property set + */ +static void +igt_atomic_prepare_plane_commit(igt_plane_t *plane, igt_output_t *output, + drmModeAtomicReq *req) +{ + + igt_display_t *display = output->display; + uint32_t fb_id, crtc_id; + + igt_assert(plane->drm_plane); + + /* it's an error to try an unsupported feature */ + igt_assert(igt_plane_supports_rotation(plane) || + !plane->rotation_changed); + + fb_id = igt_plane_get_fb_id(plane); + crtc_id = output->config.crtc->crtc_id; + + LOG(display, + "%s: populating plane data: %s.%d, fb %u\n", + igt_output_name(output), + kmstest_pipe_name(output->config.pipe), + plane->index, + fb_id); + + if (plane->fb_changed) { + igt_atomic_populate_plane_req(req, plane, IGT_PLANE_CRTC_ID, fb_id ? crtc_id : 0); + igt_atomic_populate_plane_req(req, plane, IGT_PLANE_FB_ID, fb_id); + } + + if (plane->position_changed || plane->size_changed) { + uint32_t src_x = IGT_FIXED(plane->src_x, 0); /* src_x */ + uint32_t src_y = IGT_FIXED(plane->src_y, 0); /* src_y */ + uint32_t src_w = IGT_FIXED(plane->src_w, 0); /* src_w */ + uint32_t src_h = IGT_FIXED(plane->src_h, 0); /* src_h */ + int32_t crtc_x = plane->crtc_x; + int32_t crtc_y = plane->crtc_y; + uint32_t crtc_w = plane->crtc_w; + uint32_t crtc_h = plane->crtc_h; + + LOG(display, + "src = (%d, %d) %u x %u " + "dst = (%d, %d) %u x %u\n", + src_x >> 16, src_y >> 16, src_w >> 16, src_h >> 16, + crtc_x, crtc_y, crtc_w, crtc_h); + + igt_atomic_populate_plane_req(req, plane, IGT_PLANE_SRC_X, src_x); + igt_atomic_populate_plane_req(req, plane, IGT_PLANE_SRC_Y, src_y); + igt_atomic_populate_plane_req(req, plane, IGT_PLANE_SRC_W, src_w); + igt_atomic_populate_plane_req(req, plane, IGT_PLANE_SRC_H, src_h); + + igt_atomic_populate_plane_req(req, plane, IGT_PLANE_CRTC_X, crtc_x); + igt_atomic_populate_plane_req(req, plane, IGT_PLANE_CRTC_Y, crtc_y); + igt_atomic_populate_plane_req(req, plane, IGT_PLANE_CRTC_W, crtc_w); + igt_atomic_populate_plane_req(req, plane, IGT_PLANE_CRTC_H, crtc_h); + } + + if (plane->rotation_changed) + igt_atomic_populate_plane_req(req, plane, + IGT_PLANE_ROTATION, plane->rotation); + + plane->fb_changed = false; + plane->position_changed = false; + plane->size_changed = false; + plane->rotation_changed = false; +} + + + /* * Commit position and fb changes to a DRM plane via the SetPlane ioctl; if the * DRM call to program the plane fails, we'll either fail immediately (for @@ -1357,10 +1744,10 @@ CHECK_RETURN(ret, fail_on_error); } else if (plane->fb_changed || plane->position_changed || plane->size_changed) { - src_x = IGT_FIXED(plane->fb->src_x,0); /* src_x */ - src_y = IGT_FIXED(plane->fb->src_y,0); /* src_y */ - src_w = IGT_FIXED(plane->fb->src_w,0); /* src_w */ - src_h = IGT_FIXED(plane->fb->src_h,0); /* src_h */ + src_x = IGT_FIXED(plane->src_x,0); /* src_x */ + src_y = IGT_FIXED(plane->src_y,0); /* src_y */ + src_w = IGT_FIXED(plane->src_w,0); /* src_w */ + src_h = IGT_FIXED(plane->src_h,0); /* src_h */ crtc_x = plane->crtc_x; crtc_y = plane->crtc_y; crtc_w = plane->crtc_w; @@ -1556,7 +1943,7 @@ return igt_primary_plane_commit_legacy(plane, output, fail_on_error); } else { - return igt_drm_plane_commit(plane, output, fail_on_error); + return igt_drm_plane_commit(plane, output, fail_on_error); } } @@ -1589,6 +1976,17 @@ pipe->background_changed = false; } + if (pipe->color_mgmt_changed) { + igt_crtc_set_property(output, pipe->degamma_property, + pipe->degamma_blob); + igt_crtc_set_property(output, pipe->ctm_property, + pipe->ctm_blob); + igt_crtc_set_property(output, pipe->gamma_property, + pipe->gamma_blob); + + pipe->color_mgmt_changed = false; + } + for (i = 0; i < pipe->n_planes; i++) { igt_plane_t *plane = &pipe->planes[i]; @@ -1610,6 +2008,94 @@ return 0; } + +/* + * Add crtc property changes to the atomic property set + */ +static void igt_atomic_prepare_crtc_commit(igt_output_t *output, drmModeAtomicReq *req) +{ + + igt_pipe_t *pipe_obj = igt_output_get_driving_pipe(output); + + if (pipe_obj->background_changed) + igt_atomic_populate_crtc_req(req, output, IGT_CRTC_BACKGROUND, pipe_obj->background); + + if (pipe_obj->color_mgmt_changed) { + igt_atomic_populate_crtc_req(req, output, IGT_CRTC_DEGAMMA_LUT, pipe_obj->degamma_blob); + igt_atomic_populate_crtc_req(req, output, IGT_CRTC_CTM, pipe_obj->ctm_blob); + igt_atomic_populate_crtc_req(req, output, IGT_CRTC_GAMMA_LUT, pipe_obj->gamma_blob); + } + + /* + * TODO: Add all crtc level properties here + */ +} + +/* + * Add connector property changes to the atomic property set + */ +static void igt_atomic_prepare_connector_commit(igt_output_t *output, drmModeAtomicReq *req) +{ + + struct kmstest_connector_config *config = &output->config; + + if (config->connector_scaling_mode_changed) + igt_atomic_populate_connector_req(req, output, IGT_CONNECTOR_SCALING_MODE, config->connector_scaling_mode); + + if (config->connector_dpms_changed) + igt_atomic_populate_connector_req(req, output, IGT_CONNECTOR_DPMS, config->connector_dpms); + /* + * TODO: Add all other connector level properties here + */ + +} + +/* + * Commit all the changes of all the planes,crtcs, connectors + * atomically using drmModeAtomicCommit() + */ +static int igt_atomic_commit(igt_display_t *display) +{ + + int ret = 0; + drmModeAtomicReq *req; + igt_output_t *output; + if (display->is_atomic != 1) + return -1; + req = drmModeAtomicAlloc(); + drmModeAtomicSetCursor(req, 0); + + for_each_connected_output(display, output) { + igt_pipe_t *pipe_obj; + igt_plane_t *plane; + enum pipe pipe; + + /* + * Add CRTC Properties to the property set + */ + igt_atomic_prepare_crtc_commit(output, req); + + /* + * Add Connector Properties to the property set + */ + igt_atomic_prepare_connector_commit(output, req); + + + pipe_obj = igt_output_get_driving_pipe(output); + + pipe = pipe_obj->pipe; + + for_each_plane_on_pipe(display, pipe, plane) { + igt_atomic_prepare_plane_commit(plane, output, req); + } + + } + + ret = drmModeAtomicCommit(display->drm_fd, req, 0, NULL); + drmModeAtomicFree(req); + return ret; + +} /* * Commit all plane changes across all outputs of the display. * @@ -1624,23 +2110,36 @@ bool fail_on_error) { int i, ret; + int valid_outs = 0; LOG_INDENT(display, "commit"); igt_display_refresh(display); + if (s == COMMIT_ATOMIC) { + + ret = igt_atomic_commit(display); + CHECK_RETURN(ret, fail_on_error); + return 0; + + } + for (i = 0; i < display->n_outputs; i++) { igt_output_t *output = &display->outputs[i]; if (!output->valid) continue; + valid_outs++; ret = igt_output_commit(output, s, fail_on_error); CHECK_RETURN(ret, fail_on_error); } LOG_UNINDENT(display); + if (valid_outs == 0) + return -1; + igt_debug_wait_for_keypress("modeset"); return 0; @@ -1774,10 +2273,10 @@ plane->crtc_h = fb->height; /* set default src pos/size as fb size */ - fb->src_x = 0; - fb->src_y = 0; - fb->src_w = fb->width; - fb->src_h = fb->height; + plane->src_x = 0; + plane->src_y = 0; + plane->src_w = fb->width; + plane->src_h = fb->height; } else { plane->crtc_w = 0; plane->crtc_h = 0; @@ -1844,8 +2343,8 @@ LOG(display, "%s.%d: fb_set_position(%d,%d)\n", kmstest_pipe_name(pipe->pipe), plane->index, x, y); - fb->src_x = x; - fb->src_y = y; + plane->src_x = x; + plane->src_y = y; plane->fb_changed = true; } @@ -1867,11 +2366,11 @@ igt_pipe_t *pipe = plane->pipe; igt_display_t *display = pipe->display; - LOG(display, "%s.%d: fb_set_position(%dx%d)\n", + LOG(display, "%s.%d: fb_set_size(%dx%d)\n", kmstest_pipe_name(pipe->pipe), plane->index, w, h); - fb->src_w = w; - fb->src_h = h; + plane->src_w = w; + plane->src_h = h; plane->fb_changed = true; } @@ -1921,6 +2420,44 @@ plane->rotation_changed = true; } +static void +igt_pipe_replace_blob(igt_pipe_t *pipe, uint64_t *blob, void *ptr, size_t length) +{ + igt_display_t *display = pipe->display; + uint32_t blob_id = 0; + + if (*blob != 0) + igt_assert(drmModeDestroyPropertyBlob(display->drm_fd, + *blob) == 0); + + if (length > 0) + igt_assert(drmModeCreatePropertyBlob(display->drm_fd, + ptr, length, &blob_id) == 0); + + *blob = blob_id; +} + +void +igt_pipe_set_degamma_lut(igt_pipe_t *pipe, void *ptr, size_t length) +{ + igt_pipe_replace_blob(pipe, &pipe->degamma_blob, ptr, length); + pipe->color_mgmt_changed = 1; +} + +void +igt_pipe_set_ctm_matrix(igt_pipe_t *pipe, void *ptr, size_t length) +{ + igt_pipe_replace_blob(pipe, &pipe->ctm_blob, ptr, length); + pipe->color_mgmt_changed = 1; +} + +void +igt_pipe_set_gamma_lut(igt_pipe_t *pipe, void *ptr, size_t length) +{ + igt_pipe_replace_blob(pipe, &pipe->gamma_blob, ptr, length); + pipe->color_mgmt_changed = 1; +} + /** * igt_crtc_set_background: * @pipe: pipe pointer to which background color to be set @@ -1935,7 +2472,7 @@ { igt_display_t *display = pipe->display; - LOG(display, "%s.%d: crtc_set_background(%lu)\n", + LOG(display, "%s.%d: crtc_set_background(%"PRIx64")\n", kmstest_pipe_name(pipe->pipe), pipe->pipe, background); @@ -1973,13 +2510,13 @@ drmModeConnector *c; int drm_fd; - drm_fd = drm_open_driver(DRIVER_INTEL); + drm_fd = drm_open_driver(DRIVER_ANY); res = drmModeGetResources(drm_fd); for (int i = 0; i < res->count_connectors; i++) { - c = drmModeGetConnector(drm_fd, res->connectors[i]); + c = drmModeGetConnectorCurrent(drm_fd, res->connectors[i]); /* don't attempt to force connectors that are already connected */ diff -Nru intel-gpu-tools-1.13/lib/igt_kms.h intel-gpu-tools-1.15/lib/igt_kms.h --- intel-gpu-tools-1.13/lib/igt_kms.h 2015-11-30 16:15:31.000000000 +0000 +++ intel-gpu-tools-1.15/lib/igt_kms.h 2016-05-23 10:51:28.000000000 +0000 @@ -50,11 +50,12 @@ /* We namespace this enum to not conflict with the Android i915_drm.h */ enum igt_plane { - IGT_PLANE_1 = 0, - IGT_PLANE_PRIMARY = IGT_PLANE_1, - IGT_PLANE_2, - IGT_PLANE_3, - IGT_PLANE_CURSOR, + IGT_PLANE_1 = 0, + IGT_PLANE_PRIMARY = IGT_PLANE_1, + IGT_PLANE_2, + IGT_PLANE_3, + IGT_PLANE_CURSOR, + IGT_MAX_PLANES, }; const char *kmstest_plane_name(enum igt_plane plane); @@ -76,28 +77,8 @@ */ #define kmstest_port_name(port) ((port) + 'A') -/** - * kmstest_encoder_type_str: - * @type: DRM_MODE_ENCODER_* enumeration value - * - * Returns: A string representing the drm encoder @type. - */ const char *kmstest_encoder_type_str(int type); - -/** - * kmstest_connector_status_str: - * @status: DRM_MODE_* connector status value - * - * Returns: A string representing the drm connector status @status. - */ const char *kmstest_connector_status_str(int status); - -/** - * kmstest_connector_type_str: - * @type: DRM_MODE_CONNECTOR_* enumeration value - * - * Returns: A string representing the drm connector @type. - */ const char *kmstest_connector_type_str(int type); void kmstest_dump_mode(drmModeModeInfo *mode); @@ -106,11 +87,31 @@ void kmstest_set_vt_graphics_mode(void); void kmstest_restore_vt_mode(void); +enum igt_atomic_crtc_properties { + IGT_CRTC_BACKGROUND = 0, + IGT_CRTC_CTM, + IGT_CRTC_DEGAMMA_LUT, + IGT_CRTC_GAMMA_LUT, + IGT_NUM_CRTC_PROPS +}; + +enum igt_atomic_connector_properties { + IGT_CONNECTOR_SCALING_MODE = 0, + IGT_CONNECTOR_DPMS, + IGT_NUM_CONNECTOR_PROPS +}; + struct kmstest_connector_config { drmModeCrtc *crtc; drmModeConnector *connector; drmModeEncoder *encoder; drmModeModeInfo default_mode; + uint64_t connector_scaling_mode; + bool connector_scaling_mode_changed; + uint64_t connector_dpms; + bool connector_dpms_changed; + uint32_t atomic_props_crtc[IGT_NUM_CRTC_PROPS]; + uint32_t atomic_props_connector[IGT_NUM_CONNECTOR_PROPS]; int crtc_idx; int pipe; }; @@ -140,6 +141,9 @@ bool kmstest_get_connector_config(int drm_fd, uint32_t connector_id, unsigned long crtc_idx_mask, struct kmstest_connector_config *config); +bool kmstest_probe_connector_config(int drm_fd, uint32_t connector_id, + unsigned long crtc_idx_mask, + struct kmstest_connector_config *config); void kmstest_free_connector_config(struct kmstest_connector_config *config); void kmstest_set_connector_dpms(int fd, drmModeConnector *connector, int mode); @@ -147,6 +151,16 @@ const char *name, uint32_t *prop_id, uint64_t *value, drmModePropertyPtr *prop); void kmstest_unset_all_crtcs(int drm_fd, drmModeResPtr resources); +int kmstest_get_crtc_idx(drmModeRes *res, uint32_t crtc_id); +uint32_t kmstest_find_crtc_for_connector(int fd, drmModeRes *res, + drmModeConnector *connector, + uint32_t crtc_blacklist_idx_mask); + +uint32_t kmstest_dumb_create(int fd, int width, int height, int bpp, + unsigned *stride, unsigned *size); + +void *kmstest_dumb_map_buffer(int fd, uint32_t handle, uint64_t size, + unsigned prot); /* * A small modeset API @@ -156,9 +170,28 @@ enum igt_commit_style { COMMIT_LEGACY = 0, COMMIT_UNIVERSAL, - /* We'll add atomic here eventually. */ + COMMIT_ATOMIC, }; +enum igt_atomic_plane_properties { + IGT_PLANE_SRC_X = 0, + IGT_PLANE_SRC_Y, + IGT_PLANE_SRC_W, + IGT_PLANE_SRC_H, + + IGT_PLANE_CRTC_X, + IGT_PLANE_CRTC_Y, + IGT_PLANE_CRTC_W, + IGT_PLANE_CRTC_H, + + IGT_PLANE_FB_ID, + IGT_PLANE_CRTC_ID, + IGT_PLANE_TYPE, + IGT_PLANE_ROTATION, + IGT_NUM_PLANE_PROPS +}; + + typedef struct igt_display igt_display_t; typedef struct igt_pipe igt_pipe_t; typedef uint32_t igt_fixed_t; /* 16.16 fixed point */ @@ -197,21 +230,39 @@ int crtc_x, crtc_y; /* size within pipe_src_w x pipe_src_h */ int crtc_w, crtc_h; + + /* position within the framebuffer */ + uint32_t src_x; + uint32_t src_y; + /* size within the framebuffer*/ + uint32_t src_w; + uint32_t src_h; + /* panning offset within the fb */ unsigned int pan_x, pan_y; igt_rotation_t rotation; + uint32_t atomic_props_plane[IGT_NUM_PLANE_PROPS]; } igt_plane_t; struct igt_pipe { igt_display_t *display; enum pipe pipe; bool enabled; -#define IGT_MAX_PLANES 4 int n_planes; igt_plane_t planes[IGT_MAX_PLANES]; uint64_t background; /* Background color MSB BGR 16bpc LSB */ uint32_t background_changed : 1; uint32_t background_property; + + uint64_t degamma_blob; + uint32_t degamma_property; + uint64_t ctm_blob; + uint32_t ctm_property; + uint64_t gamma_blob; + uint32_t gamma_property; + uint32_t color_mgmt_changed : 1; + + uint32_t crtc_id; }; typedef struct { @@ -235,6 +286,7 @@ igt_output_t *outputs; igt_pipe_t pipes[I915_MAX_PIPES]; bool has_universal_planes; + bool is_atomic; }; void igt_display_init(igt_display_t *display, int drm_fd); @@ -249,12 +301,19 @@ void igt_output_override_mode(igt_output_t *output, drmModeModeInfo *mode); void igt_output_set_pipe(igt_output_t *output, enum pipe pipe); igt_plane_t *igt_output_get_plane(igt_output_t *output, enum igt_plane plane); +bool igt_pipe_get_property(igt_pipe_t *pipe, const char *name, + uint32_t *prop_id, uint64_t *value, + drmModePropertyPtr *prop); static inline bool igt_plane_supports_rotation(igt_plane_t *plane) { return plane->rotation_property != 0; } +void igt_pipe_set_degamma_lut(igt_pipe_t *pipe, void *ptr, size_t length); +void igt_pipe_set_ctm_matrix(igt_pipe_t *pipe, void *ptr, size_t length); +void igt_pipe_set_gamma_lut(igt_pipe_t *pipe, void *ptr, size_t length); + void igt_plane_set_fb(igt_plane_t *plane, struct igt_fb *fb); void igt_plane_set_position(igt_plane_t *plane, int x, int y); void igt_plane_set_size(igt_plane_t *plane, int w, int h); @@ -276,17 +335,49 @@ for (pipe = 0; pipe < igt_display_get_n_pipes(display); pipe++) \ #define for_each_plane_on_pipe(display, pipe, plane) \ - for (int i__ = 0; (plane) = &(display)->pipes[(pipe)].planes[i__], \ - i__ < (display)->pipes[(pipe)].n_planes; i__++) + for (int j__ = 0; (plane) = &(display)->pipes[(pipe)].planes[j__], \ + j__ < (display)->pipes[(pipe)].n_planes; j__++) #define IGT_FIXED(i,f) ((i) << 16 | (f)) +/** + * igt_atomic_populate_plane_req: + * @req: A pointer to drmModeAtomicReq + * @plane: A pointer igt_plane_t + * @prop: one of igt_atomic_plane_properties + * @value: the value to add + */ +#define igt_atomic_populate_plane_req(req, plane, prop, value) \ + igt_assert_lt(0, drmModeAtomicAddProperty(req, plane->drm_plane->plane_id,\ + plane->atomic_props_plane[prop], value)) + +/** + * igt_atomic_populate_crtc_req: + * @req: A pointer to drmModeAtomicReq + * @output: A pointer igt_output_t + * @prop: one of igt_atomic_crtc_properties + * @value: the value to add + */ +#define igt_atomic_populate_crtc_req(req, output, prop, value) \ + igt_assert_lt(0, drmModeAtomicAddProperty(req, output->config.crtc->crtc_id,\ + output->config.atomic_props_crtc[prop], value)) +/** + * igt_atomic_populate_connector_req: + * @req: A pointer to drmModeAtomicReq + * @output: A pointer igt_output_t + * @prop: one of igt_atomic_connector_properties + * @value: the value to add + */ +#define igt_atomic_populate_connector_req(req, output, prop, value) \ + igt_assert_lt(0, drmModeAtomicAddProperty(req, output->config.connector->connector_id,\ + output->config.atomic_props_connector[prop], value)) + void igt_enable_connectors(void); void igt_reset_connectors(void); #define EDID_LENGTH 128 const unsigned char* igt_kms_get_base_edid(void); +const unsigned char* igt_kms_get_alt_edid(void); #endif /* __IGT_KMS_H__ */ - diff -Nru intel-gpu-tools-1.13/lib/igt_pm.c intel-gpu-tools-1.15/lib/igt_pm.c --- intel-gpu-tools-1.13/lib/igt_pm.c 1970-01-01 00:00:00.000000000 +0000 +++ intel-gpu-tools-1.15/lib/igt_pm.c 2016-05-23 10:51:28.000000000 +0000 @@ -0,0 +1,233 @@ +/* + * Copyright © 2013, 2015 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 + * David Weinehall + * + */ +#include +#include +#include +#include +#include +#include +#include +#include + +#include "drmtest.h" +#include "igt_pm.h" + +enum { + POLICY_UNKNOWN = -1, + POLICY_MAX_PERFORMANCE = 0, + POLICY_MEDIUM_POWER = 1, + POLICY_MIN_POWER = 2 +}; + +#define MAX_PERFORMANCE_STR "max_performance\n" +#define MEDIUM_POWER_STR "medium_power\n" +#define MIN_POWER_STR "min_power\n" +/* Remember to fix this if adding longer strings */ +#define MAX_POLICY_STRLEN strlen(MAX_PERFORMANCE_STR) + +/** + * SECTION:igt_pm + * @short_description: Power Management related helpers + * @title: Power Management + * @include: igt.h + * + * This library provides various helpers to enable power management for, + * and in some cases subsequently allow restoring the old behaviour of, + * various external components that by default are set up in a way + * that interferes with the testing of our power management functionality. + */ +/** + * igt_pm_enable_audio_runtime_pm: + * + * We know that if we don't enable audio runtime PM, snd_hda_intel will never + * release its power well refcount, and we'll never reach the LPSP state. + * There's no guarantee that it will release the power well if we enable + * runtime PM, but at least we can try. + * + * We don't have any assertions on open since the user may not even have + * snd_hda_intel loaded, which is not a problem. + */ +void igt_pm_enable_audio_runtime_pm(void) +{ + int fd; + + fd = open("/sys/module/snd_hda_intel/parameters/power_save", O_WRONLY); + if (fd >= 0) { + igt_assert_eq(write(fd, "1\n", 2), 2); + close(fd); + } + fd = open("/sys/bus/pci/devices/0000:00:03.0/power/control", O_WRONLY); + if (fd >= 0) { + igt_assert_eq(write(fd, "auto\n", 5), 5); + close(fd); + } + /* Give some time for it to react. */ + sleep(1); +} + +/** + * igt_pm_enable_sata_link_power_management: + * + * Enable the min_power policy for SATA link power management. + * Without this we cannot reach deep runtime power states. + * + * We don't have any assertions on open since the system might not have + * a SATA host. + * + * Returns: + * An opaque pointer to the data needed to restore the default values + * after the test has terminated, or NULL if SATA link power management + * is not supported. This pointer should be freed when no longer used + * (typically after having called restore_sata_link_power_management()). + */ +int8_t *igt_pm_enable_sata_link_power_management(void) +{ + int fd, i; + ssize_t len; + char *buf; + char *file_name; + int8_t *link_pm_policies = NULL; + + file_name = malloc(PATH_MAX); + buf = malloc(MAX_POLICY_STRLEN + 1); + + for (i = 0; ; i++) { + int8_t policy; + + snprintf(file_name, PATH_MAX, + "/sys/class/scsi_host/host%d/link_power_management_policy", + i); + + fd = open(file_name, O_RDWR); + if (fd < 0) + break; + + len = read(fd, buf, MAX_POLICY_STRLEN); + buf[len] = '\0'; + + if (!strncmp(MAX_PERFORMANCE_STR, buf, + strlen(MAX_PERFORMANCE_STR))) + policy = POLICY_MAX_PERFORMANCE; + else if (!strncmp(MEDIUM_POWER_STR, buf, + strlen(MEDIUM_POWER_STR))) + policy = POLICY_MEDIUM_POWER; + else if (!strncmp(MIN_POWER_STR, buf, + strlen(MIN_POWER_STR))) + policy = POLICY_MIN_POWER; + else + policy = POLICY_UNKNOWN; + + if (!(i % 256)) + link_pm_policies = realloc(link_pm_policies, + (i / 256 + 1) * 256 + 1); + + link_pm_policies[i] = policy; + link_pm_policies[i + 1] = 0; + + /* If the policy is something we don't know about, + * don't touch it, since we might potentially break things. + * And we obviously don't need to touch anything if the + * setting is already correct... + */ + if (policy != POLICY_UNKNOWN && + policy != POLICY_MIN_POWER) { + lseek(fd, 0, SEEK_SET); + igt_assert_eq(write(fd, MIN_POWER_STR, + strlen(MIN_POWER_STR)), + strlen(MIN_POWER_STR)); + } + close(fd); + } + free(buf); + free(file_name); + + return link_pm_policies; +} + +/** + * igt_pm_restore_sata_link_power_management: + * @pm_data: An opaque pointer with saved link PM policies; + * If NULL is passed we force enable the "max_performance" policy. + * + * Restore the link power management policies to the values + * prior to enabling min_power. + * + * Caveat: If the system supports hotplugging and hotplugging takes + * place during our testing so that the hosts change numbers + * we might restore the settings to the wrong hosts. + */ +void igt_pm_restore_sata_link_power_management(int8_t *pm_data) +{ + int fd, i; + char *file_name; + + /* Disk runtime PM policies. */ + file_name = malloc(PATH_MAX); + for (i = 0; ; i++) { + int8_t policy; + + if (!pm_data) + policy = POLICY_MAX_PERFORMANCE; + else if (pm_data[i] == POLICY_UNKNOWN) + continue; + else + policy = pm_data[i]; + + snprintf(file_name, PATH_MAX, + "/sys/class/scsi_host/host%d/link_power_management_policy", + i); + + fd = open(file_name, O_WRONLY); + if (fd < 0) + break; + + switch (policy) { + default: + case POLICY_MAX_PERFORMANCE: + igt_assert_eq(write(fd, MAX_PERFORMANCE_STR, + strlen(MAX_PERFORMANCE_STR)), + strlen(MAX_PERFORMANCE_STR)); + break; + + case POLICY_MEDIUM_POWER: + igt_assert_eq(write(fd, MEDIUM_POWER_STR, + strlen(MEDIUM_POWER_STR)), + strlen(MEDIUM_POWER_STR)); + break; + + case POLICY_MIN_POWER: + igt_assert_eq(write(fd, MIN_POWER_STR, + strlen(MIN_POWER_STR)), + strlen(MIN_POWER_STR)); + break; + } + + close(fd); + } + free(file_name); +} diff -Nru intel-gpu-tools-1.13/lib/igt_pm.h intel-gpu-tools-1.15/lib/igt_pm.h --- intel-gpu-tools-1.13/lib/igt_pm.h 1970-01-01 00:00:00.000000000 +0000 +++ intel-gpu-tools-1.15/lib/igt_pm.h 2016-05-23 10:51:28.000000000 +0000 @@ -0,0 +1,31 @@ +/* + * Copyright © 2015 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. + */ + +#ifndef IGT_PM_H +#define IGT_PM_H + +void igt_pm_enable_audio_runtime_pm(void); +int8_t *igt_pm_enable_sata_link_power_management(void); +void igt_pm_restore_sata_link_power_management(int8_t *pm_data); + +#endif /* IGT_PM_H */ diff -Nru intel-gpu-tools-1.13/lib/igt_stats.h intel-gpu-tools-1.15/lib/igt_stats.h --- intel-gpu-tools-1.13/lib/igt_stats.h 2015-12-01 17:03:26.000000000 +0000 +++ intel-gpu-tools-1.15/lib/igt_stats.h 2016-05-23 10:51:28.000000000 +0000 @@ -27,6 +27,7 @@ #include #include +#include /** * igt_stats_t: @@ -80,4 +81,37 @@ double igt_stats_get_variance(igt_stats_t *stats); double igt_stats_get_std_deviation(igt_stats_t *stats); +struct igt_mean { + double mean, sq, min, max; + unsigned long count; +}; + +static inline void igt_mean_init(struct igt_mean *m) +{ + memset(m, 0, sizeof(*m)); + m->max = -HUGE_VAL; + m->min = HUGE_VAL; +} + +static inline void igt_mean_add(struct igt_mean *m, double v) +{ + double delta = v - m->mean; + m->mean += delta / ++m->count; + m->sq += delta * (v - m->mean); + if (v < m->min) + m->min = v; + if (v > m->max) + m->max = v; +} + +static inline double igt_mean_get(struct igt_mean *m) +{ + return m->mean; +} + +static inline double igt_mean_get_variance(struct igt_mean *m) +{ + return m->sq / m->count; +} + #endif /* __IGT_STATS_H__ */ diff -Nru intel-gpu-tools-1.13/lib/igt_vc4.c intel-gpu-tools-1.15/lib/igt_vc4.c --- intel-gpu-tools-1.13/lib/igt_vc4.c 1970-01-01 00:00:00.000000000 +0000 +++ intel-gpu-tools-1.15/lib/igt_vc4.c 2016-05-23 10:51:28.000000000 +0000 @@ -0,0 +1,129 @@ +/* + * Copyright © 2016 Broadcom + * + * 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 +#include +#include + +#include "drmtest.h" +#include "igt_aux.h" +#include "igt_core.h" +#include "igt_vc4.h" +#include "ioctl_wrappers.h" +#include "intel_reg.h" +#include "intel_chipset.h" +#include "vc4_drm.h" +#include "vc4_packet.h" + +#if NEW_CONTEXT_PARAM_NO_ERROR_CAPTURE_API +#define LOCAL_CONTEXT_PARAM_NO_ERROR_CAPTURE 0x4 +#endif + +/** + * SECTION:igt_vc4 + * @short_description: VC4 support library + * @title: VC4 + * @include: igt.h + * + * This library provides various auxiliary helper functions for writing VC4 + * tests. + */ + +/** + * igt_vc4_get_cleared_bo: + * @size: size of the BO in bytes + * @clearval: u32 value that the buffer should be completely cleared with + * + * This helper returns a new BO with the given size, which has just been + * cleared using the render engine. + */ +uint32_t igt_vc4_get_cleared_bo(int fd, size_t size, uint32_t clearval) +{ + /* A single row will be a page. */ + uint32_t width = 1024; + uint32_t height = size / (width * 4); + uint32_t handle = igt_vc4_create_bo(fd, size); + struct drm_vc4_submit_cl submit = { + .color_write = { + .hindex = 0, + .bits = VC4_SET_FIELD(VC4_RENDER_CONFIG_FORMAT_RGBA8888, + VC4_RENDER_CONFIG_FORMAT), + }, + + .color_read = { .hindex = ~0 }, + .zs_read = { .hindex = ~0 }, + .zs_write = { .hindex = ~0 }, + .msaa_color_write = { .hindex = ~0 }, + .msaa_zs_write = { .hindex = ~0 }, + + .bo_handles = (uint64_t)(uintptr_t)&handle, + .bo_handle_count = 1, + .width = width, + .height = height, + .max_x_tile = ALIGN(width, 64) / 64 - 1, + .max_y_tile = ALIGN(height, 64) / 64 - 1, + .clear_color = { clearval, clearval }, + .flags = VC4_SUBMIT_CL_USE_CLEAR_COLOR, + }; + + igt_assert_eq_u32(width * height * 4, size); + + do_ioctl(fd, DRM_IOCTL_VC4_SUBMIT_CL, &submit); + + return handle; +} + +int +igt_vc4_create_bo(int fd, size_t size) +{ + struct drm_vc4_create_bo create = { + .size = size, + }; + + do_ioctl(fd, DRM_IOCTL_VC4_CREATE_BO, &create); + + return create.handle; +} + +void * +igt_vc4_mmap_bo(int fd, uint32_t handle, uint32_t size, unsigned prot) +{ + struct drm_vc4_mmap_bo mmap_bo = { + .handle = handle, + }; + void *ptr; + + do_ioctl(fd, DRM_IOCTL_VC4_MMAP_BO, &mmap_bo); + + ptr = mmap(0, size, prot, MAP_SHARED, fd, mmap_bo.offset); + if (ptr == MAP_FAILED) + return NULL; + else + return ptr; +} diff -Nru intel-gpu-tools-1.13/lib/igt_vc4.h intel-gpu-tools-1.15/lib/igt_vc4.h --- intel-gpu-tools-1.13/lib/igt_vc4.h 1970-01-01 00:00:00.000000000 +0000 +++ intel-gpu-tools-1.15/lib/igt_vc4.h 2016-05-23 10:51:28.000000000 +0000 @@ -0,0 +1,31 @@ +/* + * Copyright © 2016 Broadcom + * + * 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. + */ + +#ifndef IGT_VC4_H +#define IGT_VC4_H + +uint32_t igt_vc4_get_cleared_bo(int fd, size_t size, uint32_t clearval); +int igt_vc4_create_bo(int fd, size_t size); +void *igt_vc4_mmap_bo(int fd, uint32_t handle, uint32_t size, unsigned prot); + +#endif /* IGT_VC4_H */ diff -Nru intel-gpu-tools-1.13/lib/intel_chipset.c intel-gpu-tools-1.15/lib/intel_chipset.c --- intel-gpu-tools-1.13/lib/intel_chipset.c 2015-11-30 16:15:31.000000000 +0000 +++ intel-gpu-tools-1.15/lib/intel_chipset.c 2016-05-23 10:51:28.000000000 +0000 @@ -38,6 +38,7 @@ #include #include "i915_drm.h" +#include "drmtest.h" #include "intel_chipset.h" #include "igt_core.h" @@ -129,6 +130,7 @@ { const char *override; + igt_assert(is_i915_device(fd)); igt_assert(__drm_device_id); override = getenv("INTEL_DEVID_OVERRIDE"); diff -Nru intel-gpu-tools-1.13/lib/intel_chipset.h intel-gpu-tools-1.15/lib/intel_chipset.h --- intel-gpu-tools-1.13/lib/intel_chipset.h 2015-11-30 16:15:31.000000000 +0000 +++ intel-gpu-tools-1.15/lib/intel_chipset.h 2016-05-23 10:51:28.000000000 +0000 @@ -236,6 +236,8 @@ #define PCI_CHIP_BROXTON_0 0x0A84 #define PCI_CHIP_BROXTON_1 0x1A84 #define PCI_CHIP_BROXTON_2 0x5A84 +#define PCI_CHIP_BROXTON_3 0x1A85 +#define PCI_CHIP_BROXTON_4 0x5A85 #endif /* __GTK_DOC_IGNORE__ */ @@ -460,7 +462,9 @@ #define IS_BROXTON(devid) ((devid) == PCI_CHIP_BROXTON_0 || \ (devid) == PCI_CHIP_BROXTON_1 || \ - (devid) == PCI_CHIP_BROXTON_2) + (devid) == PCI_CHIP_BROXTON_2 || \ + (devid) == PCI_CHIP_BROXTON_3 || \ + (devid) == PCI_CHIP_BROXTON_4) #define IS_GEN9(devid) (IS_KABYLAKE(devid) || \ IS_SKYLAKE(devid) || \ @@ -470,14 +474,6 @@ IS_GEN5(devid) || \ IS_GEN6(devid) || \ IS_GEN7(devid) || \ - IS_GEN8(devid) || \ - IS_GEN9(devid)) - -#define IS_9XX(devid) (IS_GEN3(devid) || \ - IS_GEN4(devid) || \ - IS_GEN5(devid) || \ - IS_GEN6(devid) || \ - IS_GEN7(devid) || \ IS_GEN8(devid) || \ IS_GEN9(devid)) diff -Nru intel-gpu-tools-1.13/lib/intel_os.c intel-gpu-tools-1.15/lib/intel_os.c --- intel-gpu-tools-1.13/lib/intel_os.c 2015-11-30 16:15:31.000000000 +0000 +++ intel-gpu-tools-1.15/lib/intel_os.c 2016-05-23 10:51:28.000000000 +0000 @@ -46,6 +46,7 @@ #elif defined(HAVE_SWAPCTL) /* Solaris */ #include #endif +#include #include "intel_io.h" #include "drmtest.h" @@ -64,11 +65,8 @@ #ifdef HAVE_STRUCT_SYSINFO_TOTALRAM /* Linux */ struct sysinfo sysinf; - int ret; - - ret = sysinfo(&sysinf); - igt_assert(ret == 0); + igt_assert(sysinfo(&sysinf) == 0); retval = sysinf.totalram; retval *= sysinf.mem_unit; #elif defined(_SC_PAGESIZE) && defined(_SC_PHYS_PAGES) /* Solaris */ @@ -98,18 +96,10 @@ #ifdef HAVE_STRUCT_SYSINFO_TOTALRAM /* Linux */ struct sysinfo sysinf; - int fd, ret; - - fd = open("/proc/sys/vm/drop_caches", O_RDWR); - if (fd != -1) { - ret = write(fd, "3\n", 2); - close(fd); - (void)ret; - } - ret = sysinfo(&sysinf); - igt_assert(ret == 0); + intel_purge_vm_caches(); + igt_assert(sysinfo(&sysinf) == 0); retval = sysinf.freeram; retval *= sysinf.mem_unit; #elif defined(_SC_PAGESIZE) && defined(_SC_AVPHYS_PAGES) /* Solaris */ @@ -139,11 +129,8 @@ #ifdef HAVE_STRUCT_SYSINFO_TOTALRAM /* Linux */ struct sysinfo sysinf; - int ret; - - ret = sysinfo(&sysinf); - igt_assert(ret == 0); + igt_assert(sysinfo(&sysinf) == 0); retval = sysinf.freeswap; retval *= sysinf.mem_unit; #elif defined(HAVE_SWAPCTL) /* Solaris */ @@ -192,6 +179,78 @@ return retval / (1024*1024); } +static uint64_t vfs_file_max(void) +{ + static long long unsigned max; + if (max == 0) { + FILE *file = fopen("/proc/sys/fs/file-max", "r"); + max = 80000; + if (file) { + igt_assert(fscanf(file, "%llu", &max) == 1); + fclose(file); + } + } + return max; +} + +static unsigned max_open_files(void) +{ + struct rlimit rlim; + + if (getrlimit(RLIMIT_NOFILE, &rlim)) + rlim.rlim_cur = 64 << 10; + + return rlim.rlim_cur; +} + +/** + * intel_require_files: + * @count: number of files that will be created + * + * Does the system support enough file descriptors for the test? + */ +void intel_require_files(uint64_t count) +{ + igt_require_f(count < max_open_files(), + "Estimated that we need %'llu files, but the process maximum is only %'llu\n", + (long long)count, (long long)max_open_files()); +} + +int __intel_check_memory(uint64_t count, uint64_t size, unsigned mode, + uint64_t *out_required, uint64_t *out_total) +{ +/* rough estimate of how many bytes the kernel requires to track each object */ +#define KERNEL_BO_OVERHEAD 512 + uint64_t required, total; + + required = count; + required *= size + KERNEL_BO_OVERHEAD; + required = ALIGN(required, 4096); + + igt_debug("Checking %'llu surfaces of size %'llu bytes (total %'llu) against %s%s\n", + (long long)count, (long long)size, (long long)required, + mode & (CHECK_RAM | CHECK_SWAP) ? "RAM" : "", + mode & CHECK_SWAP ? " + swap": ""); + + total = 0; + if (mode & (CHECK_RAM | CHECK_SWAP)) + total += intel_get_avail_ram_mb(); + if (mode & CHECK_SWAP) + total += intel_get_total_swap_mb(); + total *= 1024 * 1024; + + if (out_required) + *out_required = required; + + if (out_total) + *out_total = total; + + if (count > vfs_file_max()) + return false; + + return required < total; +} + /** * intel_require_memory: * @count: number of surfaces that will be created @@ -215,33 +274,19 @@ * assumption that any test that needs to check for memory requirements is a * thrashing test unsuitable for slow simulated systems. */ -void intel_require_memory(uint32_t count, uint64_t size, unsigned mode) +void intel_require_memory(uint64_t count, uint64_t size, unsigned mode) { -/* rough estimate of how many bytes the kernel requires to track each object */ -#define KERNEL_BO_OVERHEAD 512 uint64_t required, total; - required = count; - required *= size + KERNEL_BO_OVERHEAD; - required = ALIGN(required, 4096); - - igt_debug("Checking %'u surfaces of size %'llu bytes (total %'llu) against %s%s\n", - count, (long long)size, (long long)required, - mode & (CHECK_RAM | CHECK_SWAP) ? "RAM" : "", - mode & CHECK_SWAP ? " + swap": ""); - - total = 0; - if (mode & (CHECK_RAM | CHECK_SWAP)) - total += intel_get_avail_ram_mb(); - if (mode & CHECK_SWAP) - total += intel_get_total_swap_mb(); - total *= 1024 * 1024; - - igt_skip_on_f(total <= required, - "Estimated that we need %'llu bytes for the test, but only have %'llu bytes available (%s%s)\n", - (long long)required, (long long)total, + igt_require_f(__intel_check_memory(count, size, mode, + &required, &total), + "Estimated that we need %'llu objects and %'llu MiB for the test, but only have %'llu MiB available (%s%s) and a maximum of %'llu objects\n", + (long long)count, + (long long)((required + ((1<<20) - 1)) >> 20), + (long long)(total >> 20), mode & (CHECK_RAM | CHECK_SWAP) ? "RAM" : "", - mode & CHECK_SWAP ? " + swap": ""); + mode & CHECK_SWAP ? " + swap": "", + (long long)vfs_file_max()); igt_skip_on_simulation(); } @@ -249,13 +294,18 @@ void intel_purge_vm_caches(void) { + static int once; int fd; fd = open("/proc/sys/vm/drop_caches", O_RDWR); if (fd < 0) return; - igt_assert_eq(write(fd, "3\n", 2), 2); + if (!once) { + igt_assert_eq(write(fd, "4\n", 2), 2); /* Be quiet! */ + once = 1; + } + igt_assert_eq(write(fd, "3\n", 2), 2); /* Drop page/slab caches */ close(fd); } diff -Nru intel-gpu-tools-1.13/lib/ioctl_wrappers.c intel-gpu-tools-1.15/lib/ioctl_wrappers.c --- intel-gpu-tools-1.13/lib/ioctl_wrappers.c 2015-12-01 14:33:33.000000000 +0000 +++ intel-gpu-tools-1.15/lib/ioctl_wrappers.c 2016-05-23 10:51:28.000000000 +0000 @@ -77,6 +77,9 @@ * distinguish them. */ +int (*igt_ioctl)(int fd, unsigned long request, void *arg) = drmIoctl; + + /** * gem_handle_to_libdrm_bo: * @bufmgr: libdrm buffer manager instance @@ -126,7 +129,7 @@ memset(&get_tiling, 0, sizeof(get_tiling)); get_tiling.handle = handle; - ret = drmIoctl(fd, DRM_IOCTL_I915_GEM_GET_TILING, &get_tiling); + ret = igt_ioctl(fd, DRM_IOCTL_I915_GEM_GET_TILING, &get_tiling); igt_assert(ret == 0); *tiling = get_tiling.tiling_mode; @@ -138,6 +141,8 @@ struct drm_i915_gem_set_tiling st; int ret; + igt_require_intel(fd); + memset(&st, 0, sizeof(st)); do { st.handle = handle; @@ -180,6 +185,23 @@ #define LOCAL_DRM_IOCTL_I915_GEM_GET_CACHEING \ DRM_IOWR(DRM_COMMAND_BASE + LOCAL_DRM_I915_GEM_GET_CACHEING, struct local_drm_i915_gem_caching) +static int __gem_set_caching(int fd, uint32_t handle, uint32_t caching) +{ + struct local_drm_i915_gem_caching arg; + int err; + + memset(&arg, 0, sizeof(arg)); + arg.handle = handle; + arg.caching = caching; + + err = 0; + if (igt_ioctl(fd, LOCAL_DRM_IOCTL_I915_GEM_SET_CACHEING, &arg)) { + err = -errno; + igt_assert(errno == ENOTTY || errno == EINVAL); + } + return err; +} + /** * gem_set_caching: * @fd: open i915 drm file descriptor @@ -193,17 +215,7 @@ */ void gem_set_caching(int fd, uint32_t handle, uint32_t caching) { - struct local_drm_i915_gem_caching arg; - int ret; - - memset(&arg, 0, sizeof(arg)); - arg.handle = handle; - arg.caching = caching; - - ret = drmIoctl(fd, LOCAL_DRM_IOCTL_I915_GEM_SET_CACHEING, &arg); - igt_assert(ret == 0 || (errno == ENOTTY || errno == EINVAL)); - - igt_require(ret == 0); + igt_require(__gem_set_caching(fd, handle, caching) == 0); errno = 0; } @@ -221,8 +233,8 @@ struct local_drm_i915_gem_caching arg; int ret; + memset(&arg, 0, sizeof(arg)); arg.handle = handle; - arg.caching = 0; ret = ioctl(fd, LOCAL_DRM_IOCTL_I915_GEM_GET_CACHEING, &arg); igt_assert(ret == 0); errno = 0; @@ -291,11 +303,30 @@ { struct drm_gem_close close_bo; + igt_assert_neq(handle, 0); + memset(&close_bo, 0, sizeof(close_bo)); close_bo.handle = handle; do_ioctl(fd, DRM_IOCTL_GEM_CLOSE, &close_bo); } +static int __gem_write(int fd, uint32_t handle, uint64_t offset, const void *buf, uint64_t length) +{ + struct drm_i915_gem_pwrite gem_pwrite; + int err; + + memset(&gem_pwrite, 0, sizeof(gem_pwrite)); + gem_pwrite.handle = handle; + gem_pwrite.offset = offset; + gem_pwrite.size = length; + gem_pwrite.data_ptr = (uintptr_t)buf; + + err = 0; + if (drmIoctl(fd, DRM_IOCTL_I915_GEM_PWRITE, &gem_pwrite)) + err = -errno; + return err; +} + /** * gem_write: * @fd: open i915 drm file descriptor @@ -309,16 +340,25 @@ */ void gem_write(int fd, uint32_t handle, uint64_t offset, const void *buf, uint64_t length) { - struct drm_i915_gem_pwrite gem_pwrite; - - memset(&gem_pwrite, 0, sizeof(gem_pwrite)); - gem_pwrite.handle = handle; - gem_pwrite.offset = offset; - gem_pwrite.size = length; - gem_pwrite.data_ptr = (uintptr_t)buf; - do_ioctl(fd, DRM_IOCTL_I915_GEM_PWRITE, &gem_pwrite); + igt_assert_eq(__gem_write(fd, handle, offset, buf, length), 0); } +static int __gem_read(int fd, uint32_t handle, uint64_t offset, void *buf, uint64_t length) +{ + struct drm_i915_gem_pread gem_pread; + int err; + + memset(&gem_pread, 0, sizeof(gem_pread)); + gem_pread.handle = handle; + gem_pread.offset = offset; + gem_pread.size = length; + gem_pread.data_ptr = (uintptr_t)buf; + + err = 0; + if (drmIoctl(fd, DRM_IOCTL_I915_GEM_PREAD, &gem_pread)) + err = -errno; + return err; +} /** * gem_read: * @fd: open i915 drm file descriptor @@ -332,14 +372,7 @@ */ void gem_read(int fd, uint32_t handle, uint64_t offset, void *buf, uint64_t length) { - struct drm_i915_gem_pread gem_pread; - - memset(&gem_pread, 0, sizeof(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); + igt_assert_eq(__gem_read(fd, handle, offset, buf, length), 0); } /** @@ -368,28 +401,124 @@ } /** - * gem_sync: + * __gem_wait: * @fd: open i915 drm file descriptor * @handle: gem buffer object handle + * @timeout_ns: [in] time to wait, [out] remaining time (in nanoseconds) * - * This functions waits for outstanding rendering to complete. + * This functions waits for outstanding rendering to complete, upto + * the timeout_ns. If no timeout_ns is provided, the wait is indefinite and + * only returns upon an error or when the rendering is complete. */ -void gem_sync(int fd, uint32_t handle) +int gem_wait(int fd, uint32_t handle, int64_t *timeout_ns) { struct drm_i915_gem_wait wait; + int ret; memset(&wait, 0, sizeof(wait)); wait.bo_handle = handle; - wait.timeout_ns =-1; - if (drmIoctl(fd, DRM_IOCTL_I915_GEM_WAIT, &wait) == 0) { - errno = 0; - return; + wait.timeout_ns = timeout_ns ? *timeout_ns : -1; + wait.flags = 0; + + ret = 0; + if (igt_ioctl(fd, DRM_IOCTL_I915_GEM_WAIT, &wait)) + ret = -errno; + + if (timeout_ns) + *timeout_ns = wait.timeout_ns; + + return ret; +} + +/** + * gem_sync: + * @fd: open i915 drm file descriptor + * @handle: gem buffer object handle + * + * This functions waits for outstanding rendering to complete. + */ +void gem_sync(int fd, uint32_t handle) +{ + if (gem_wait(fd, handle, NULL)) + gem_set_domain(fd, handle, + I915_GEM_DOMAIN_GTT, + I915_GEM_DOMAIN_GTT); + errno = 0; +} + + +bool gem_create__has_stolen_support(int fd) +{ + static int has_stolen_support = -1; + struct drm_i915_getparam gp; + int val = -1; + + if (has_stolen_support < 0) { + memset(&gp, 0, sizeof(gp)); + gp.param = 36; /* CREATE_VERSION */ + gp.value = &val; + + /* Do we have the extended gem_create_ioctl? */ + ioctl(fd, DRM_IOCTL_I915_GETPARAM, &gp); + has_stolen_support = val >= 2; } - gem_set_domain(fd, handle, - I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT); + return has_stolen_support; +} + +struct local_i915_gem_create_v2 { + uint64_t size; + uint32_t handle; + uint32_t pad; +#define I915_CREATE_PLACEMENT_STOLEN (1<<0) + uint32_t flags; +}; + +#define LOCAL_IOCTL_I915_GEM_CREATE DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_CREATE, struct local_i915_gem_create_v2) +uint32_t __gem_create_stolen(int fd, uint64_t size) +{ + struct local_i915_gem_create_v2 create; + int ret; + + memset(&create, 0, sizeof(create)); + create.handle = 0; + create.size = size; + create.flags = I915_CREATE_PLACEMENT_STOLEN; + ret = igt_ioctl(fd, LOCAL_IOCTL_I915_GEM_CREATE, &create); + + if (ret < 0) + return 0; + + errno = 0; + return create.handle; +} + +/** + * gem_create_stolen: + * @fd: open i915 drm file descriptor + * @size: desired size of the buffer + * + * This wraps the new GEM_CREATE ioctl, which allocates a new gem buffer + * object of @size and placement in stolen memory region. + * + * Returns: The file-private handle of the created buffer object + */ + +uint32_t gem_create_stolen(int fd, uint64_t size) +{ + struct local_i915_gem_create_v2 create; + + memset(&create, 0, sizeof(create)); + create.handle = 0; + create.size = size; + create.flags = I915_CREATE_PLACEMENT_STOLEN; + do_ioctl(fd, LOCAL_IOCTL_I915_GEM_CREATE, &create); + igt_assert(create.handle); + + return create.handle; } + uint32_t __gem_create(int fd, int size) { struct drm_i915_gem_create create; @@ -398,7 +527,7 @@ memset(&create, 0, sizeof(create)); create.handle = 0; create.size = size; - ret = drmIoctl(fd, DRM_IOCTL_I915_GEM_CREATE, &create); + ret = igt_ioctl(fd, DRM_IOCTL_I915_GEM_CREATE, &create); if (ret < 0) return 0; @@ -431,6 +560,23 @@ } /** + * __gem_execbuf: + * @fd: open i915 drm file descriptor + * @execbuf: execbuffer data structure + * + * This wraps the EXECBUFFER2 ioctl, which submits a batchbuffer for the gpu to + * run. This is allowed to fail, with -errno returned. + */ +int __gem_execbuf(int fd, struct drm_i915_gem_execbuffer2 *execbuf) +{ + int err = 0; + if (igt_ioctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, execbuf)) + err = -errno; + errno = 0; + return err; +} + +/** * gem_execbuf: * @fd: open i915 drm file descriptor * @execbuf: execbuffer data structure @@ -440,11 +586,7 @@ */ void gem_execbuf(int fd, struct drm_i915_gem_execbuffer2 *execbuf) { - int result; - - result = drmIoctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, execbuf); - igt_assert(result == 0); - errno = 0; + igt_assert_eq(__gem_execbuf(fd, execbuf), 0); } /** @@ -466,7 +608,7 @@ memset(&mmap_arg, 0, sizeof(mmap_arg)); mmap_arg.handle = handle; - if (drmIoctl(fd, DRM_IOCTL_I915_GEM_MMAP_GTT, &mmap_arg)) + if (igt_ioctl(fd, DRM_IOCTL_I915_GEM_MMAP_GTT, &mmap_arg)) return NULL; ptr = mmap64(0, size, prot, MAP_SHARED, fd, mmap_arg.offset); @@ -532,7 +674,7 @@ arg.offset = 0; arg.size = 4096; arg.flags = I915_MMAP_WC; - has_wc = drmIoctl(fd, LOCAL_IOCTL_I915_GEM_MMAP_v2, &arg) == 0; + has_wc = igt_ioctl(fd, LOCAL_IOCTL_I915_GEM_MMAP_v2, &arg) == 0; gem_close(fd, arg.handle); } errno = 0; @@ -570,7 +712,7 @@ arg.offset = offset; arg.size = size; arg.flags = I915_MMAP_WC; - if (drmIoctl(fd, LOCAL_IOCTL_I915_GEM_MMAP_v2, &arg)) + if (igt_ioctl(fd, LOCAL_IOCTL_I915_GEM_MMAP_v2, &arg)) return NULL; errno = 0; @@ -617,7 +759,7 @@ mmap_arg.handle = handle; mmap_arg.offset = offset; mmap_arg.size = size; - if (drmIoctl(fd, DRM_IOCTL_I915_GEM_MMAP, &mmap_arg)) + if (igt_ioctl(fd, DRM_IOCTL_I915_GEM_MMAP, &mmap_arg)) return NULL; errno = 0; @@ -684,12 +826,14 @@ uint32_t gem_context_create(int fd) { struct drm_i915_gem_context_create create; - int ret; memset(&create, 0, sizeof(create)); - ret = drmIoctl(fd, DRM_IOCTL_I915_GEM_CONTEXT_CREATE, &create); - igt_require(ret == 0 || (errno != ENODEV && errno != EINVAL)); - igt_assert(ret == 0); + if (igt_ioctl(fd, DRM_IOCTL_I915_GEM_CONTEXT_CREATE, &create)) { + int err = -errno; + igt_skip_on(err == -ENODEV || errno == -EINVAL); + igt_assert_eq(err, 0); + } + igt_assert(create.ctx_id != 0); errno = 0; return create.ctx_id; @@ -703,7 +847,7 @@ memset(&destroy, 0, sizeof(destroy)); destroy.ctx_id = ctx_id; - ret = drmIoctl(fd, DRM_IOCTL_I915_GEM_CONTEXT_DESTROY, &destroy); + ret = igt_ioctl(fd, DRM_IOCTL_I915_GEM_CONTEXT_DESTROY, &destroy); if (ret) return -errno; return 0; @@ -744,6 +888,16 @@ do_ioctl(fd, LOCAL_IOCTL_I915_GEM_CONTEXT_GETPARAM, p); } +int __gem_context_set_param(int fd, struct local_i915_gem_context_param *p) +{ +#define LOCAL_I915_GEM_CONTEXT_SETPARAM 0x35 +#define LOCAL_IOCTL_I915_GEM_CONTEXT_SETPARAM DRM_IOWR (DRM_COMMAND_BASE + LOCAL_I915_GEM_CONTEXT_SETPARAM, struct local_i915_gem_context_param) + if (igt_ioctl(fd, LOCAL_IOCTL_I915_GEM_CONTEXT_SETPARAM, p)) + return -errno; + + errno = 0; + return 0; +} /** * gem_context_set_param: * @fd: open i915 drm file descriptor @@ -756,9 +910,7 @@ */ void gem_context_set_param(int fd, struct local_i915_gem_context_param *p) { -#define LOCAL_I915_GEM_CONTEXT_SETPARAM 0x35 -#define LOCAL_IOCTL_I915_GEM_CONTEXT_SETPARAM DRM_IOWR (DRM_COMMAND_BASE + LOCAL_I915_GEM_CONTEXT_SETPARAM, struct local_i915_gem_context_param) - do_ioctl(fd, LOCAL_IOCTL_I915_GEM_CONTEXT_SETPARAM, p); + igt_assert(__gem_context_set_param(fd, p) == 0); } /** @@ -778,7 +930,7 @@ p.value = 0; p.size = 0; - igt_require(drmIoctl(fd, LOCAL_IOCTL_I915_GEM_CONTEXT_GETPARAM, &p) == 0); + igt_require(igt_ioctl(fd, LOCAL_IOCTL_I915_GEM_CONTEXT_GETPARAM, &p) == 0); } void gem_context_require_ban_period(int fd) @@ -793,12 +945,53 @@ p.value = 0; p.size = 0; - has_ban_period = drmIoctl(fd, LOCAL_IOCTL_I915_GEM_CONTEXT_GETPARAM, &p) == 0; + has_ban_period = igt_ioctl(fd, LOCAL_IOCTL_I915_GEM_CONTEXT_GETPARAM, &p) == 0; } igt_require(has_ban_period); } +int __gem_userptr(int fd, void *ptr, int size, int read_only, uint32_t flags, uint32_t *handle) +{ + struct local_i915_gem_userptr userptr; + int ret; + + memset(&userptr, 0, sizeof(userptr)); + userptr.user_ptr = (uintptr_t)ptr; + userptr.user_size = size; + userptr.flags = flags; + if (read_only) + userptr.flags |= LOCAL_I915_USERPTR_READ_ONLY; + + ret = igt_ioctl(fd, LOCAL_IOCTL_I915_GEM_USERPTR, &userptr); + if (ret) + ret = errno; + igt_skip_on_f(ret == ENODEV && + (flags & LOCAL_I915_USERPTR_UNSYNCHRONIZED) == 0 && + !read_only, + "Skipping, synchronized mappings with no kernel CONFIG_MMU_NOTIFIER?"); + if (ret == 0) + *handle = userptr.handle; + + return ret; +} + +/** + * gem_userptr: + * @fd: open i915 drm file descriptor + * @ptr: userptr pointer to be passed + * @size: desired size of the buffer + * @read_only: specify whether userptr is opened read only + * @flags: other userptr flags + * @handle: returned handle for the object + * + * Returns userptr handle for the GEM object. + */ +void gem_userptr(int fd, void *ptr, int size, int read_only, uint32_t flags, uint32_t *handle) +{ + igt_assert_eq(__gem_userptr(fd, ptr, size, read_only, flags, handle), 0); +} + /** * gem_sw_finish: * @fd: open i915 drm file descriptor @@ -844,18 +1037,18 @@ /* feature test helpers */ /** - * gem_uses_aliasing_ppgtt: + * gem_gtt_type: * @fd: open i915 drm file descriptor * - * Feature test macro to check whether the kernel internally uses ppgtt to - * execute batches. The /aliasing/ in the function name is a bit a misnomer, - * this driver parameter is also true when full ppgtt address spaces are - * available since for batchbuffer construction only ppgtt or global gtt is - * relevant. + * Feature test macro to check what type of gtt is being used by the kernel: + * 0 - global gtt + * 1 - aliasing ppgtt + * 2 - full ppgtt, limited to 32bit address space + * 3 - full ppgtt, 64bit address space * - * Returns: Whether batches are run through ppgtt. + * Returns: Type of gtt being used. */ -bool gem_uses_aliasing_ppgtt(int fd) +int gem_gtt_type(int fd) { struct drm_i915_getparam gp; int val = 0; @@ -872,6 +1065,35 @@ } /** + * gem_uses_ppgtt: + * @fd: open i915 drm file descriptor + * + * Feature test macro to check whether the kernel internally uses ppgtt to + * execute batches. Note that this is also true when we're using full ppgtt. + * + * Returns: Whether batches are run through ppgtt. + */ +bool gem_uses_ppgtt(int fd) +{ + return gem_gtt_type(fd) > 0; +} + +/** + * gem_uses_full_ppgtt: + * @fd: open i915 drm file descriptor + * + * Feature test macro to check whether the kernel internally uses full + * per-process gtt to execute batches. Note that this is also true when we're + * using full 64b ppgtt. + * + * Returns: Whether batches are run through full ppgtt. + */ +bool gem_uses_full_ppgtt(int fd) +{ + return gem_gtt_type(fd) > 1; +} + +/** * gem_available_fences: * @fd: open i915 drm file descriptor * @@ -918,54 +1140,7 @@ return has_llc; } -/** - * gem_get_num_rings: - * @fd: open i915 drm file descriptor - * - * Feature test macro to query the number of available rings. This is useful in - * test loops which need to step through all rings and similar logic. - * - * For more explicit tests of ring availability see gem_has_enable_ring() and - * the ring specific versions like gem_has_bsd(). - * - * Returns: The number of available rings. - */ -int gem_get_num_rings(int fd) -{ - static int num_rings = -1; - - if (num_rings < 0) { - num_rings = 1; /* render ring is always available */ - - if (gem_has_bsd(fd)) - num_rings++; - else - goto skip; - - if (gem_has_blt(fd)) - num_rings++; - else - goto skip; - - if (gem_has_vebox(fd)) - num_rings++; - else - goto skip; - } -skip: - return num_rings; -} - -/** - * gem_has_enable_ring: - * @fd: open i915 drm file descriptor - * @param: ring flag bit as used in gem_execbuf() - * - * Feature test macro to query whether a specific ring is available. - * - * Returns: Whether the ring is available or not. - */ -bool gem_has_enable_ring(int fd,int param) +static bool has_param(int fd, int param) { drm_i915_getparam_t gp; int tmp = 0; @@ -974,7 +1149,7 @@ gp.value = &tmp; gp.param = param; - if (drmIoctl(fd, DRM_IOCTL_I915_GETPARAM, &gp)) + if (igt_ioctl(fd, DRM_IOCTL_I915_GETPARAM, &gp)) return false; errno = 0; @@ -985,8 +1160,7 @@ * gem_has_bsd: * @fd: open i915 drm file descriptor * - * Feature test macro to query whether the BSD ring is available. This is simply - * a specific version of gem_has_enable_ring() for the BSD ring. + * Feature test macro to query whether the BSD ring is available. * * Note that recent Bspec calls this the VCS ring for Video Command Submission. * @@ -996,7 +1170,7 @@ { static int has_bsd = -1; if (has_bsd < 0) - has_bsd = gem_has_enable_ring(fd,I915_PARAM_HAS_BSD); + has_bsd = has_param(fd, I915_PARAM_HAS_BSD); return has_bsd; } @@ -1004,8 +1178,7 @@ * gem_has_blt: * @fd: open i915 drm file descriptor * - * Feature test macro to query whether the blitter ring is available. This is simply - * a specific version of gem_has_enable_ring() for the blitter ring. + * Feature test macro to query whether the blitter ring is available. * * Note that recent Bspec calls this the BCS ring for Blitter Command Submission. * @@ -1015,7 +1188,7 @@ { static int has_blt = -1; if (has_blt < 0) - has_blt = gem_has_enable_ring(fd,I915_PARAM_HAS_BLT); + has_blt = has_param(fd, I915_PARAM_HAS_BLT); return has_blt; } @@ -1024,8 +1197,7 @@ * gem_has_vebox: * @fd: open i915 drm file descriptor * - * Feature test macro to query whether the vebox ring is available. This is simply - * a specific version of gem_has_enable_ring() for the vebox ring. + * Feature test macro to query whether the vebox ring is available. * * Note that recent Bspec calls this the VECS ring for Video Enhancement Command * Submission. @@ -1036,7 +1208,7 @@ { static int has_vebox = -1; if (has_vebox < 0) - has_vebox = gem_has_enable_ring(fd,LOCAL_I915_PARAM_HAS_VEBOX); + has_vebox = has_param(fd, LOCAL_I915_PARAM_HAS_VEBOX); return has_vebox; } @@ -1045,8 +1217,7 @@ * gem_has_bsd2: * @fd: open i915 drm file descriptor * - * Feature test macro to query whether the BSD2 ring is available. This is simply - * a specific version of gem_has_enable_ring() for the BSD2 ring. + * Feature test macro to query whether the BSD2 ring is available. * * Note that recent Bspec calls this the VCS ring for Video Command Submission. * @@ -1056,7 +1227,7 @@ { static int has_bsd2 = -1; if (has_bsd2 < 0) - has_bsd2 = gem_has_enable_ring(fd,LOCAL_I915_PARAM_HAS_BSD2); + has_bsd2 = has_param(fd, LOCAL_I915_PARAM_HAS_BSD2); return has_bsd2; } /** @@ -1134,6 +1305,54 @@ } /** + * gem_global_aperture_size: + * + * Feature test macro to query the kernel for the global gpu aperture size. + * This is the area available for the kernel to perform address translations. + * + * Returns: The mappable gtt address space size. + */ +uint64_t gem_global_aperture_size(int fd) +{ + struct drm_i915_gem_get_aperture aperture; + + memset(&aperture, 0, sizeof(aperture)); + aperture.aper_size = 256*1024*1024; + do_ioctl(fd, DRM_IOCTL_I915_GEM_GET_APERTURE, &aperture); + + return aperture.aper_size; +} + +#define LOCAL_I915_PARAM_HAS_EXEC_SOFTPIN 37 +/** + * gem_has_softpin: + * @fd: open i915 drm file descriptor + * + * Feature test macro to query whether the softpinning functionality is + * supported. + * + * Returns: Whether softpin support is available + */ +bool gem_has_softpin(int fd) +{ + static int has_softpin = -1; + + if (has_softpin < 0) { + struct drm_i915_getparam gp; + + memset(&gp, 0, sizeof(gp)); + gp.param = LOCAL_I915_PARAM_HAS_EXEC_SOFTPIN; + gp.value = &has_softpin; + + has_softpin = 0; + ioctl(fd, DRM_IOCTL_I915_GETPARAM, &gp, sizeof(gp)); + errno = 0; + } + + return has_softpin; +} + +/** * gem_require_caching: * @fd: open i915 drm file descriptor * @@ -1142,50 +1361,70 @@ */ void gem_require_caching(int fd) { - struct local_drm_i915_gem_caching arg; - int ret; - - memset(&arg, 0, sizeof(arg)); - arg.handle = gem_create(fd, 4096); - igt_assert(arg.handle != 0); + uint32_t handle; - arg.caching = 0; - ret = ioctl(fd, LOCAL_DRM_IOCTL_I915_GEM_SET_CACHEING, &arg); - gem_close(fd, arg.handle); + handle = gem_create(fd, 4096); + gem_set_caching(fd, handle, 0); + gem_close(fd, handle); - igt_require(ret == 0); errno = 0; } +bool gem_has_ring(int fd, unsigned ring) +{ + struct drm_i915_gem_execbuffer2 execbuf; + struct drm_i915_gem_exec_object2 exec; + + /* silly ABI, the kernel thinks everyone who has BSD also has BSD2 */ + if ((ring & ~(3<<13)) == I915_EXEC_BSD) { + if (ring & (3 << 13) && !gem_has_bsd2(fd)) + return false; + } + + memset(&exec, 0, sizeof(exec)); + memset(&execbuf, 0, sizeof(execbuf)); + execbuf.buffers_ptr = (uintptr_t)&exec; + execbuf.buffer_count = 1; + execbuf.flags = ring; + return __gem_execbuf(fd, &execbuf) == -ENOENT; +} + /** * gem_require_ring: * @fd: open i915 drm file descriptor - * @ring_id: ring flag bit as used in gem_execbuf() + * @ring: ring flag bit as used in gem_execbuf() * * Feature test macro to query whether a specific ring is available. - * In contrast to gem_has_enable_ring() this automagically skips if the ring - * isn't available by calling igt_require(). + * This automagically skips if the ring isn't available by + * calling igt_require(). */ -void gem_require_ring(int fd, int ring_id) +void gem_require_ring(int fd, unsigned ring) { - switch (ring_id) { - case I915_EXEC_RENDER: - return; - case I915_EXEC_BLT: - igt_require(gem_has_blt(fd)); - return; - case I915_EXEC_BSD: - igt_require(gem_has_bsd(fd)); - return; -#ifdef I915_EXEC_VEBOX - case I915_EXEC_VEBOX: - igt_require(gem_has_vebox(fd)); - return; -#endif - default: - igt_assert(0); - return; - } + igt_require(gem_has_ring(fd, ring)); +} + +/** + * gem_has_mocs_registers: + * @fd: open i915 drm file descriptor + * + * Feature test macro to query whether the device has MOCS registers. + * These exist gen 9+. + */ +bool gem_has_mocs_registers(int fd) +{ + return intel_gen(intel_get_drm_devid(fd)) >= 9; +} + +/** + * gem_require_mocs_registers: + * @fd: open i915 drm file descriptor + * + * Feature test macro to query whether the device has MOCS registers. + * These exist gen 9+. + */ +void gem_require_mocs_registers(int fd) +{ + igt_require(gem_has_mocs_registers(fd)); } /* prime */ @@ -1216,6 +1455,31 @@ } /** + * prime_handle_to_fd_for_mmap: + * @fd: open i915 drm file descriptor + * @handle: file-private gem buffer object handle + * + * Same as prime_handle_to_fd above but with DRM_RDWR capabilities, which can + * be useful for writing into the mmap'ed dma-buf file-descriptor. + * + * Returns: The created dma-buf fd handle or -1 if the ioctl fails. + */ +int prime_handle_to_fd_for_mmap(int fd, uint32_t handle) +{ + struct drm_prime_handle args; + + memset(&args, 0, sizeof(args)); + args.handle = handle; + args.flags = DRM_CLOEXEC | DRM_RDWR; + args.fd = -1; + + if (igt_ioctl(fd, DRM_IOCTL_PRIME_HANDLE_TO_FD, &args) != 0) + return -1; + + return args.fd; +} + +/** * prime_fd_to_handle: * @fd: open i915 drm file descriptor * @dma_buf_fd: dma-buf fd handle @@ -1262,6 +1526,38 @@ } /** + * prime_sync_start + * @dma_buf_fd: dma-buf fd handle + */ +void prime_sync_start(int dma_buf_fd, bool write) +{ + struct local_dma_buf_sync sync_start; + + memset(&sync_start, 0, sizeof(sync_start)); + sync_start.flags = LOCAL_DMA_BUF_SYNC_START; + sync_start.flags |= LOCAL_DMA_BUF_SYNC_READ; + if (write) + sync_start.flags |= LOCAL_DMA_BUF_SYNC_WRITE; + do_ioctl(dma_buf_fd, LOCAL_DMA_BUF_IOCTL_SYNC, &sync_start); +} + +/** + * prime_sync_end + * @dma_buf_fd: dma-buf fd handle + */ +void prime_sync_end(int dma_buf_fd, bool write) +{ + struct local_dma_buf_sync sync_end; + + memset(&sync_end, 0, sizeof(sync_end)); + sync_end.flags = LOCAL_DMA_BUF_SYNC_END; + sync_end.flags |= LOCAL_DMA_BUF_SYNC_READ; + if (write) + sync_end.flags |= LOCAL_DMA_BUF_SYNC_WRITE; + do_ioctl(dma_buf_fd, LOCAL_DMA_BUF_IOCTL_SYNC, &sync_end); +} + +/** * igt_require_fb_modifiers: * @fd: Open DRM file descriptor. * @@ -1303,7 +1599,7 @@ f.pitches[0] = stride; f.modifier[0] = modifier; - ret = drmIoctl(fd, LOCAL_DRM_IOCTL_MODE_ADDFB2, &f); + ret = igt_ioctl(fd, LOCAL_DRM_IOCTL_MODE_ADDFB2, &f); *buf_id = f.fb_id; diff -Nru intel-gpu-tools-1.13/lib/ioctl_wrappers.h intel-gpu-tools-1.15/lib/ioctl_wrappers.h --- intel-gpu-tools-1.13/lib/ioctl_wrappers.h 2015-11-30 16:15:31.000000000 +0000 +++ intel-gpu-tools-1.15/lib/ioctl_wrappers.h 2016-05-23 10:51:28.000000000 +0000 @@ -35,6 +35,17 @@ #include #include +/** + * igt_ioctl: + * @fd: file descriptor + * @request: IOCTL request number + * @arg: argument pointer + * + * This is a wrapper around drmIoctl(), which can be augmented with special code + * blocks like #igt_while_interruptible. + */ +extern int (*igt_ioctl)(int fd, unsigned long request, void *arg); + /* libdrm interfacing */ drm_intel_bo * gem_handle_to_libdrm_bo(drm_intel_bufmgr *bufmgr, int fd, const char *name, uint32_t handle); @@ -55,10 +66,15 @@ void gem_read(int fd, uint32_t handle, uint64_t offset, void *buf, uint64_t length); void gem_set_domain(int fd, uint32_t handle, uint32_t read_domains, uint32_t write_domain); +int gem_wait(int fd, uint32_t handle, int64_t *timeout_ns); void gem_sync(int fd, uint32_t handle); +bool gem_create__has_stolen_support(int fd); +uint32_t __gem_create_stolen(int fd, uint64_t size); +uint32_t gem_create_stolen(int fd, uint64_t size); uint32_t __gem_create(int fd, int size); uint32_t gem_create(int fd, uint64_t size); void gem_execbuf(int fd, struct drm_i915_gem_execbuffer2 *execbuf); +int __gem_execbuf(int fd, struct drm_i915_gem_execbuffer2 *execbuf); void *gem_mmap__gtt(int fd, uint32_t handle, uint64_t size, unsigned prot); void *gem_mmap__cpu(int fd, uint32_t handle, uint64_t offset, uint64_t size, unsigned prot); @@ -71,6 +87,16 @@ void *__gem_mmap__wc(int fd, uint32_t handle, uint64_t offset, uint64_t size, unsigned prot); /** + * gem_require_stolen_support: + * @fd: open i915 drm file descriptor + * + * Test macro to query whether support for allocating objects from stolen + * memory is available. Automatically skips through igt_require() if not. + */ +#define gem_require_stolen_support(fd) \ + igt_require(gem_create__has_stolen_support(fd)) + +/** * gem_require_mmap_wc: * @fd: open i915 drm file descriptor * @@ -98,6 +124,20 @@ void gem_context_require_param(int fd, uint64_t param); void gem_context_get_param(int fd, struct local_i915_gem_context_param *p); void gem_context_set_param(int fd, struct local_i915_gem_context_param *p); +int __gem_context_set_param(int fd, struct local_i915_gem_context_param *p); + +#define LOCAL_I915_GEM_USERPTR 0x33 +#define LOCAL_IOCTL_I915_GEM_USERPTR DRM_IOWR (DRM_COMMAND_BASE + LOCAL_I915_GEM_USERPTR, struct local_i915_gem_userptr) +struct local_i915_gem_userptr { + uint64_t user_ptr; + uint64_t user_size; + uint32_t flags; +#define LOCAL_I915_USERPTR_READ_ONLY (1<<0) +#define LOCAL_I915_USERPTR_UNSYNCHRONIZED (1<<31) + uint32_t handle; +}; +void gem_userptr(int fd, void *ptr, int size, int read_only, uint32_t flags, uint32_t *handle); +int __gem_userptr(int fd, void *ptr, int size, int read_only, uint32_t flags, uint32_t *handle); void gem_sw_finish(int fd, uint32_t handle); @@ -105,26 +145,52 @@ /* feature test helpers */ bool gem_has_llc(int fd); -int gem_get_num_rings(int fd); -bool gem_has_enable_ring(int fd,int param); bool gem_has_bsd(int fd); bool gem_has_blt(int fd); bool gem_has_vebox(int fd); bool gem_has_bsd2(int fd); -bool gem_uses_aliasing_ppgtt(int fd); +int gem_gtt_type(int fd); +bool gem_uses_ppgtt(int fd); +bool gem_uses_full_ppgtt(int fd); int gem_available_fences(int fd); uint64_t gem_available_aperture_size(int fd); uint64_t gem_aperture_size(int fd); +uint64_t gem_global_aperture_size(int fd); uint64_t gem_mappable_aperture_size(void); +bool gem_has_softpin(int fd); /* check functions which auto-skip tests by calling igt_skip() */ void gem_require_caching(int fd); -void gem_require_ring(int fd, int ring_id); +bool gem_has_ring(int fd, unsigned ring); +void gem_require_ring(int fd, unsigned ring); +bool gem_has_mocs_registers(int fd); +void gem_require_mocs_registers(int fd); /* prime */ +struct local_dma_buf_sync { + uint64_t flags; +}; + +#define LOCAL_DMA_BUF_SYNC_READ (1 << 0) +#define LOCAL_DMA_BUF_SYNC_WRITE (2 << 0) +#define LOCAL_DMA_BUF_SYNC_RW (LOCAL_DMA_BUF_SYNC_READ | LOCAL_DMA_BUF_SYNC_WRITE) +#define LOCAL_DMA_BUF_SYNC_START (0 << 2) +#define LOCAL_DMA_BUF_SYNC_END (1 << 2) +#define LOCAL_DMA_BUF_SYNC_VALID_FLAGS_MASK \ + (LOCAL_DMA_BUF_SYNC_RW | LOCAL_DMA_BUF_SYNC_END) + +#define LOCAL_DMA_BUF_BASE 'b' +#define LOCAL_DMA_BUF_IOCTL_SYNC _IOW(LOCAL_DMA_BUF_BASE, 0, struct local_dma_buf_sync) + int prime_handle_to_fd(int fd, uint32_t handle); +#ifndef DRM_RDWR +#define DRM_RDWR O_RDWR +#endif +int prime_handle_to_fd_for_mmap(int fd, uint32_t handle); uint32_t prime_fd_to_handle(int fd, int dma_buf_fd); off_t prime_get_size(int dma_buf_fd); +void prime_sync_start(int dma_buf_fd, bool write); +void prime_sync_end(int dma_buf_fd, bool write); /* addfb2 fb modifiers */ struct local_drm_mode_fb_cmd2 { diff -Nru intel-gpu-tools-1.13/lib/Makefile.am intel-gpu-tools-1.15/lib/Makefile.am --- intel-gpu-tools-1.13/lib/Makefile.am 2015-11-12 17:30:48.000000000 +0000 +++ intel-gpu-tools-1.15/lib/Makefile.am 2016-05-23 10:51:28.000000000 +0000 @@ -8,13 +8,27 @@ noinst_LTLIBRARIES = libintel_tools.la noinst_HEADERS = check-ndebug.h +if HAVE_VC4 + libintel_tools_la_SOURCES += \ + igt_vc4.c \ + igt_vc4.h +endif + AM_CPPFLAGS = -I$(top_srcdir) -AM_CFLAGS = $(DRM_CFLAGS) $(CWARNFLAGS) $(LIBUNWIND_CFLAGS) $(DEBUG_CFLAGS) \ +AM_CFLAGS = $(CWARNFLAGS) $(DRM_CFLAGS) $(PCIACCESS_CFLAGS) $(LIBUNWIND_CFLAGS) $(DEBUG_CFLAGS) \ -DIGT_SRCDIR=\""$(abs_top_srcdir)/tests"\" \ -DIGT_DATADIR=\""$(pkgdatadir)"\" \ -DIGT_LOG_DOMAIN=\""$(subst _,-,$*)"\" \ -pthread -LDADD = $(CAIRO_LIBS) $(LIBUNWIND_LIBS) -lm AM_CFLAGS += $(CAIRO_CFLAGS) +libintel_tools_la_LIBADD = \ + $(DRM_LIBS) \ + $(PCIACCESS_LIBS) \ + $(CAIRO_LIBS) \ + $(LIBUDEV_LIBS) \ + $(LIBUNWIND_LIBS) \ + $(TIMER_LIBS) \ + -lm + diff -Nru intel-gpu-tools-1.13/lib/Makefile.in intel-gpu-tools-1.15/lib/Makefile.in --- intel-gpu-tools-1.13/lib/Makefile.in 2015-12-02 16:47:58.000000000 +0000 +++ intel-gpu-tools-1.15/lib/Makefile.in 2016-05-31 17:03:32.000000000 +0000 @@ -89,6 +89,11 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ +target_triplet = @target@ +@HAVE_VC4_TRUE@am__append_1 = \ +@HAVE_VC4_TRUE@ igt_vc4.c \ +@HAVE_VC4_TRUE@ igt_vc4.h + subdir = lib ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/as-compiler-flag.m4 \ @@ -105,7 +110,30 @@ CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) -libintel_tools_la_LIBADD = +am__DEPENDENCIES_1 = +libintel_tools_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +am__libintel_tools_la_SOURCES_DIST = debug.h drmtest.c drmtest.h \ + i830_reg.h i915_3d.h i915_reg.h i915_pciids.h igt.h \ + igt_debugfs.c igt_debugfs.h igt_aux.c igt_aux.h \ + igt_edid_template.h igt_gt.c igt_gt.h igt_stats.c igt_stats.h \ + instdone.c instdone.h intel_batchbuffer.c intel_batchbuffer.h \ + intel_chipset.h intel_os.c intel_io.h intel_mmio.c \ + intel_chipset.c intel_reg.h ioctl_wrappers.c ioctl_wrappers.h \ + media_fill.h media_fill_gen7.c media_fill_gen8.c \ + media_fill_gen8lp.c media_fill_gen9.c media_spin.h \ + media_spin.c gpgpu_fill.h gpgpu_fill.c gen7_media.h \ + gen8_media.h rendercopy_i915.c rendercopy_i830.c gen6_render.h \ + gen7_render.h gen8_render.h gen9_render.h rendercopy_gen6.c \ + rendercopy_gen7.c rendercopy_gen8.c rendercopy_gen9.c \ + rendercopy.h intel_reg_map.c intel_iosf.c igt_kms.c igt_kms.h \ + igt_fb.c igt_fb.h igt_core.c igt_core.h igt_draw.c igt_draw.h \ + igt_pm.c igt_pm.h uwildmat/uwildmat.h uwildmat/uwildmat.c \ + igt_vc4.c igt_vc4.h +am__dirstamp = $(am__leading_dot)dirstamp +@HAVE_VC4_TRUE@am__objects_1 = igt_vc4.lo am_libintel_tools_la_OBJECTS = drmtest.lo igt_debugfs.lo igt_aux.lo \ igt_gt.lo igt_stats.lo instdone.lo intel_batchbuffer.lo \ intel_os.lo intel_mmio.lo intel_chipset.lo ioctl_wrappers.lo \ @@ -114,7 +142,8 @@ rendercopy_i915.lo rendercopy_i830.lo rendercopy_gen6.lo \ rendercopy_gen7.lo rendercopy_gen8.lo rendercopy_gen9.lo \ intel_reg_map.lo intel_iosf.lo igt_kms.lo igt_fb.lo \ - igt_core.lo igt_draw.lo + igt_core.lo igt_draw.lo igt_pm.lo uwildmat/uwildmat.lo \ + $(am__objects_1) 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@) @@ -155,7 +184,7 @@ am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libintel_tools_la_SOURCES) -DIST_SOURCES = $(libintel_tools_la_SOURCES) +DIST_SOURCES = $(am__libintel_tools_la_SOURCES_DIST) RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ @@ -260,6 +289,8 @@ DRM_LIBS = @DRM_LIBS@ DRM_NOUVEAU_CFLAGS = @DRM_NOUVEAU_CFLAGS@ DRM_NOUVEAU_LIBS = @DRM_NOUVEAU_LIBS@ +DRM_VC4_CFLAGS = @DRM_VC4_CFLAGS@ +DRM_VC4_LIBS = @DRM_VC4_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -304,6 +335,7 @@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MAN_SUBSTS = @MAN_SUBSTS@ @@ -348,6 +380,7 @@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ THREAD_CFLAGS = @THREAD_CFLAGS@ +TIMER_LIBS = @TIMER_LIBS@ VERSION = @VERSION@ XORG_MAN_PAGE = @XORG_MAN_PAGE@ XRANDR_CFLAGS = @XRANDR_CFLAGS@ @@ -402,90 +435,58 @@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ +target = @target@ target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ IGT_LIB_PATH := $(builddir) GPU_TOOLS_PATH := $(top_srcdir) SUBDIRS = . tests -libintel_tools_la_SOURCES = \ - debug.h \ - drmtest.c \ - drmtest.h \ - i830_reg.h \ - i915_3d.h \ - i915_reg.h \ - i915_pciids.h \ - igt.h \ - igt_debugfs.c \ - igt_debugfs.h \ - igt_aux.c \ - igt_aux.h \ - igt_gt.c \ - igt_gt.h \ - igt_stats.c \ - igt_stats.h \ - instdone.c \ - instdone.h \ - intel_batchbuffer.c \ - intel_batchbuffer.h \ - intel_chipset.h \ - intel_os.c \ - intel_io.h \ - intel_mmio.c \ - intel_chipset.c \ - intel_reg.h \ - ioctl_wrappers.c \ - ioctl_wrappers.h \ - media_fill.h \ - media_fill_gen7.c \ - media_fill_gen8.c \ - media_fill_gen8lp.c \ - media_fill_gen9.c \ - media_spin.h \ - media_spin.c \ - gpgpu_fill.h \ - gpgpu_fill.c \ - gen7_media.h \ - gen8_media.h \ - rendercopy_i915.c \ - rendercopy_i830.c \ - gen6_render.h \ - gen7_render.h \ - gen8_render.h \ - gen9_render.h \ - rendercopy_gen6.c \ - rendercopy_gen7.c \ - rendercopy_gen8.c \ - rendercopy_gen9.c \ - rendercopy.h \ - intel_reg_map.c \ - intel_iosf.c \ - igt_kms.c \ - igt_kms.h \ - igt_fb.c \ - igt_fb.h \ - igt_core.c \ - igt_core.h \ - igt_draw.c \ - igt_draw.h \ - $(NULL) - +libintel_tools_la_SOURCES = debug.h drmtest.c drmtest.h i830_reg.h \ + i915_3d.h i915_reg.h i915_pciids.h igt.h igt_debugfs.c \ + igt_debugfs.h igt_aux.c igt_aux.h igt_edid_template.h igt_gt.c \ + igt_gt.h igt_stats.c igt_stats.h instdone.c instdone.h \ + intel_batchbuffer.c intel_batchbuffer.h intel_chipset.h \ + intel_os.c intel_io.h intel_mmio.c intel_chipset.c intel_reg.h \ + ioctl_wrappers.c ioctl_wrappers.h media_fill.h \ + media_fill_gen7.c media_fill_gen8.c media_fill_gen8lp.c \ + media_fill_gen9.c media_spin.h media_spin.c gpgpu_fill.h \ + gpgpu_fill.c gen7_media.h gen8_media.h rendercopy_i915.c \ + rendercopy_i830.c gen6_render.h gen7_render.h gen8_render.h \ + gen9_render.h rendercopy_gen6.c rendercopy_gen7.c \ + rendercopy_gen8.c rendercopy_gen9.c rendercopy.h \ + intel_reg_map.c intel_iosf.c igt_kms.c igt_kms.h igt_fb.c \ + igt_fb.h igt_core.c igt_core.h igt_draw.c igt_draw.h igt_pm.c \ + igt_pm.h uwildmat/uwildmat.h uwildmat/uwildmat.c $(NULL) \ + $(am__append_1) BUILT_SOURCES = $(IGT_LIB_PATH)/version.h CLEANFILES = $(IGT_LIB_PATH)/version.h $(IGT_LIB_PATH)/version.h.tmp noinst_LTLIBRARIES = libintel_tools.la noinst_HEADERS = check-ndebug.h AM_CPPFLAGS = -I$(top_srcdir) -AM_CFLAGS = $(DRM_CFLAGS) $(CWARNFLAGS) $(LIBUNWIND_CFLAGS) \ - $(DEBUG_CFLAGS) -DIGT_SRCDIR=\""$(abs_top_srcdir)/tests"\" \ +AM_CFLAGS = $(CWARNFLAGS) $(DRM_CFLAGS) $(PCIACCESS_CFLAGS) \ + $(LIBUNWIND_CFLAGS) $(DEBUG_CFLAGS) \ + -DIGT_SRCDIR=\""$(abs_top_srcdir)/tests"\" \ -DIGT_DATADIR=\""$(pkgdatadir)"\" -DIGT_LOG_DOMAIN=\""$(subst \ _,-,$*)"\" -pthread $(CAIRO_CFLAGS) -LDADD = $(CAIRO_LIBS) $(LIBUNWIND_LIBS) -lm +libintel_tools_la_LIBADD = \ + $(DRM_LIBS) \ + $(PCIACCESS_LIBS) \ + $(CAIRO_LIBS) \ + $(LIBUDEV_LIBS) \ + $(LIBUNWIND_LIBS) \ + $(TIMER_LIBS) \ + -lm + all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-recursive @@ -532,12 +533,22 @@ echo rm -f $${locs}; \ rm -f $${locs}; \ } +uwildmat/$(am__dirstamp): + @$(MKDIR_P) uwildmat + @: > uwildmat/$(am__dirstamp) +uwildmat/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) uwildmat/$(DEPDIR) + @: > uwildmat/$(DEPDIR)/$(am__dirstamp) +uwildmat/uwildmat.lo: uwildmat/$(am__dirstamp) \ + uwildmat/$(DEPDIR)/$(am__dirstamp) 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) + -rm -f uwildmat/*.$(OBJEXT) + -rm -f uwildmat/*.lo distclean-compile: -rm -f *.tab.c @@ -551,7 +562,9 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/igt_fb.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/igt_gt.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/igt_kms.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/igt_pm.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/igt_stats.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/igt_vc4.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_chipset.Plo@am__quote@ @@ -571,6 +584,7 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rendercopy_gen9.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@ +@AMDEP_TRUE@@am__include@ @am__quote@uwildmat/$(DEPDIR)/uwildmat.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @@ -601,6 +615,7 @@ clean-libtool: -rm -rf .libs _libs + -rm -rf uwildmat/.libs uwildmat/_libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. @@ -790,6 +805,8 @@ 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) + -rm -f uwildmat/$(DEPDIR)/$(am__dirstamp) + -rm -f uwildmat/$(am__dirstamp) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @@ -801,7 +818,7 @@ mostlyclean-am distclean: distclean-recursive - -rm -rf ./$(DEPDIR) + -rm -rf ./$(DEPDIR) uwildmat/$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags @@ -847,7 +864,7 @@ installcheck-am: maintainer-clean: maintainer-clean-recursive - -rm -rf ./$(DEPDIR) + -rm -rf ./$(DEPDIR) uwildmat/$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic diff -Nru intel-gpu-tools-1.13/lib/Makefile.sources intel-gpu-tools-1.15/lib/Makefile.sources --- intel-gpu-tools-1.13/lib/Makefile.sources 2015-11-12 17:30:48.000000000 +0000 +++ intel-gpu-tools-1.15/lib/Makefile.sources 2016-05-23 10:51:28.000000000 +0000 @@ -11,6 +11,7 @@ igt_debugfs.h \ igt_aux.c \ igt_aux.h \ + igt_edid_template.h \ igt_gt.c \ igt_gt.h \ igt_stats.c \ @@ -59,6 +60,10 @@ igt_core.h \ igt_draw.c \ igt_draw.h \ + igt_pm.c \ + igt_pm.h \ + uwildmat/uwildmat.h \ + uwildmat/uwildmat.c \ $(NULL) .PHONY: version.h.tmp diff -Nru intel-gpu-tools-1.13/lib/tests/igt_exit_handler.c intel-gpu-tools-1.15/lib/tests/igt_exit_handler.c --- intel-gpu-tools-1.13/lib/tests/igt_exit_handler.c 1970-01-01 00:00:00.000000000 +0000 +++ intel-gpu-tools-1.15/lib/tests/igt_exit_handler.c 2016-05-23 10:51:28.000000000 +0000 @@ -0,0 +1,128 @@ +/* + * Copyright © 2016 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. + */ + +#define _GNU_SOURCE +#include +#include +#include +#include +#include +#include "igt_core.h" + +int test; +int pipes[2]; + +static void exit_handler1(int sig) +{ + assert(test == 1); + test++; +} + +static void exit_handler2(int sig) +{ + char tmp = 1; + + /* ensure exit handlers are called in reverse */ + assert(test == 0); + test++; + + /* we need to get a side effect to the parent to make sure exit handlers + * actually run. */ + assert(write(pipes[1], &tmp, 1) == 1); +} + +enum test_type { + SUC, + NORMAL, + FAIL, + SKIP, + SIG +}; + +static int testfunc(enum test_type test_type) +{ + char prog[] = "igt_no_exit"; + char *fake_argv[] = {prog}; + int fake_argc = 1; + pid_t pid; + int status; + char tmp = 0; + + assert(pipe2(pipes, O_NONBLOCK) == 0); + + pid = fork(); + + if (pid == 0) { + igt_subtest_init(fake_argc, fake_argv); + + igt_fixture { + /* register twice, should only be called once */ + igt_install_exit_handler(exit_handler1); + igt_install_exit_handler(exit_handler1); + + igt_install_exit_handler(exit_handler2); + } + + igt_subtest("subtest") { + switch (test_type) { + case SUC: + igt_success(); + case FAIL: + igt_fail(1); + case SKIP: + igt_skip("skip"); + case NORMAL: + break; + case SIG: + raise(SIGTERM); + } + } + + igt_exit(); + } + + assert(waitpid(pid, &status, 0) != -1); + + assert(read(pipes[0], &tmp, 1) == 1); + assert(tmp == 1); + + return status; +} + +int main(int argc, char **argv) +{ + int status; + + assert(testfunc(SUC) == 0); + + assert(testfunc(NORMAL) == 0); + + status = testfunc(FAIL); + assert(WIFEXITED(status) && WEXITSTATUS(status) == 1); + + status = testfunc(SKIP); + assert(WIFEXITED(status) && WEXITSTATUS(status) == IGT_EXIT_SKIP); + + status = testfunc(SIG); + assert(WIFSIGNALED(status) && WTERMSIG(status) == SIGTERM); +} diff -Nru intel-gpu-tools-1.13/lib/tests/igt_subtest_group.c intel-gpu-tools-1.15/lib/tests/igt_subtest_group.c --- intel-gpu-tools-1.13/lib/tests/igt_subtest_group.c 1970-01-01 00:00:00.000000000 +0000 +++ intel-gpu-tools-1.15/lib/tests/igt_subtest_group.c 2016-05-23 10:51:28.000000000 +0000 @@ -0,0 +1,83 @@ +/* + * Copyright © 2016 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 "igt_core.h" + +igt_main +{ + bool t1 = false; + int t2 = 0; + + igt_subtest_group { + igt_fixture { + igt_require(true); + } + + igt_subtest_group { + igt_fixture { + igt_require(false); + } + + igt_subtest("not-run") { + assert(0); + } + + igt_subtest_group { + /* need to make sure we don't accidentally + * restore to "run testcases" when an outer + * group is already in SKIP state. */ + igt_subtest("still-not-run") { + assert(0); + } + } + } + + igt_subtest("run") { + t1 = true; + assert(1); + } + } + + igt_subtest_group { + igt_fixture { + assert(t2 == 0); + t2 = 1; + } + + igt_subtest("run-again") { + assert(t2 == 1); + t2 = 2; + } + + igt_fixture { + assert(t2 == 2); + t2 = 3; + + } + } + + assert(t1); + assert(t2 == 3); +} diff -Nru intel-gpu-tools-1.13/lib/tests/Makefile.am intel-gpu-tools-1.15/lib/tests/Makefile.am --- intel-gpu-tools-1.13/lib/tests/Makefile.am 2015-11-12 17:30:48.000000000 +0000 +++ intel-gpu-tools-1.15/lib/tests/Makefile.am 2016-05-23 10:51:28.000000000 +0000 @@ -13,7 +13,7 @@ -DIGT_DATADIR=\""$(abs_srcdir)"\" \ $(NULL) -LDADD = ../libintel_tools.la $(PCIACCESS_LIBS) $(DRM_LIBS) $(LIBUNWIND_LIBS) +LDADD = ../libintel_tools.la $(PCIACCESS_LIBS) $(DRM_LIBS) $(LIBUNWIND_LIBS) $(TIMER_LIBS) LDADD += $(CAIRO_LIBS) $(LIBUDEV_LIBS) $(GLIB_LIBS) -lm AM_CFLAGS += $(CAIRO_CFLAGS) $(LIBUDEV_CFLAGS) $(GLIB_CFLAGS) diff -Nru intel-gpu-tools-1.13/lib/tests/Makefile.in intel-gpu-tools-1.15/lib/tests/Makefile.in --- intel-gpu-tools-1.13/lib/tests/Makefile.in 2015-12-02 16:47:58.000000000 +0000 +++ intel-gpu-tools-1.15/lib/tests/Makefile.in 2016-05-31 17:03:32.000000000 +0000 @@ -87,12 +87,14 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ +target_triplet = @target@ check_PROGRAMS = igt_no_exit$(EXEEXT) igt_no_exit_list_only$(EXEEXT) \ igt_fork_helper$(EXEEXT) igt_list_only$(EXEEXT) \ igt_no_subtest$(EXEEXT) igt_simulation$(EXEEXT) \ igt_simple_test_subtests$(EXEEXT) igt_stats$(EXEEXT) \ igt_timeout$(EXEEXT) igt_invalid_subtest_name$(EXEEXT) \ - igt_segfault$(EXEEXT) igt_assert$(EXEEXT) + igt_segfault$(EXEEXT) igt_subtest_group$(EXEEXT) \ + igt_assert$(EXEEXT) igt_exit_handler$(EXEEXT) TESTS = $(check_PROGRAMS) $(am__EXEEXT_1) XFAIL_TESTS = igt_no_exit$(EXEEXT) igt_no_exit_list_only$(EXEEXT) \ igt_no_subtest$(EXEEXT) igt_simple_test_subtests$(EXEEXT) \ @@ -118,80 +120,103 @@ igt_assert_DEPENDENCIES = ../libintel_tools.la $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(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 am__v_lt_1 = +igt_exit_handler_SOURCES = igt_exit_handler.c +igt_exit_handler_OBJECTS = igt_exit_handler.$(OBJEXT) +igt_exit_handler_LDADD = $(LDADD) +igt_exit_handler_DEPENDENCIES = ../libintel_tools.la \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) igt_fork_helper_SOURCES = igt_fork_helper.c igt_fork_helper_OBJECTS = igt_fork_helper.$(OBJEXT) igt_fork_helper_LDADD = $(LDADD) igt_fork_helper_DEPENDENCIES = ../libintel_tools.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) igt_invalid_subtest_name_SOURCES = igt_invalid_subtest_name.c igt_invalid_subtest_name_OBJECTS = igt_invalid_subtest_name.$(OBJEXT) igt_invalid_subtest_name_LDADD = $(LDADD) igt_invalid_subtest_name_DEPENDENCIES = ../libintel_tools.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) igt_list_only_SOURCES = igt_list_only.c igt_list_only_OBJECTS = igt_list_only.$(OBJEXT) igt_list_only_LDADD = $(LDADD) igt_list_only_DEPENDENCIES = ../libintel_tools.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) igt_no_exit_SOURCES = igt_no_exit.c igt_no_exit_OBJECTS = igt_no_exit.$(OBJEXT) igt_no_exit_LDADD = $(LDADD) igt_no_exit_DEPENDENCIES = ../libintel_tools.la $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) igt_no_exit_list_only_SOURCES = igt_no_exit_list_only.c igt_no_exit_list_only_OBJECTS = igt_no_exit_list_only.$(OBJEXT) igt_no_exit_list_only_LDADD = $(LDADD) igt_no_exit_list_only_DEPENDENCIES = ../libintel_tools.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) igt_no_subtest_SOURCES = igt_no_subtest.c igt_no_subtest_OBJECTS = igt_no_subtest.$(OBJEXT) igt_no_subtest_LDADD = $(LDADD) igt_no_subtest_DEPENDENCIES = ../libintel_tools.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) igt_segfault_SOURCES = igt_segfault.c igt_segfault_OBJECTS = igt_segfault.$(OBJEXT) igt_segfault_LDADD = $(LDADD) igt_segfault_DEPENDENCIES = ../libintel_tools.la $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) igt_simple_test_subtests_SOURCES = igt_simple_test_subtests.c igt_simple_test_subtests_OBJECTS = igt_simple_test_subtests.$(OBJEXT) igt_simple_test_subtests_LDADD = $(LDADD) igt_simple_test_subtests_DEPENDENCIES = ../libintel_tools.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) igt_simulation_SOURCES = igt_simulation.c igt_simulation_OBJECTS = igt_simulation.$(OBJEXT) igt_simulation_LDADD = $(LDADD) igt_simulation_DEPENDENCIES = ../libintel_tools.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) igt_stats_SOURCES = igt_stats.c igt_stats_OBJECTS = igt_stats.$(OBJEXT) igt_stats_LDADD = $(LDADD) igt_stats_DEPENDENCIES = ../libintel_tools.la $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +igt_subtest_group_SOURCES = igt_subtest_group.c +igt_subtest_group_OBJECTS = igt_subtest_group.$(OBJEXT) +igt_subtest_group_LDADD = $(LDADD) +igt_subtest_group_DEPENDENCIES = ../libintel_tools.la \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) igt_timeout_SOURCES = igt_timeout.c igt_timeout_OBJECTS = igt_timeout.$(OBJEXT) @@ -199,7 +224,7 @@ igt_timeout_DEPENDENCIES = ../libintel_tools.la $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false @@ -234,15 +259,16 @@ am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = -SOURCES = igt_assert.c igt_fork_helper.c igt_invalid_subtest_name.c \ - igt_list_only.c igt_no_exit.c igt_no_exit_list_only.c \ - igt_no_subtest.c igt_segfault.c igt_simple_test_subtests.c \ - igt_simulation.c igt_stats.c igt_timeout.c -DIST_SOURCES = igt_assert.c igt_fork_helper.c \ +SOURCES = igt_assert.c igt_exit_handler.c igt_fork_helper.c \ igt_invalid_subtest_name.c igt_list_only.c igt_no_exit.c \ igt_no_exit_list_only.c igt_no_subtest.c igt_segfault.c \ igt_simple_test_subtests.c igt_simulation.c igt_stats.c \ - igt_timeout.c + igt_subtest_group.c igt_timeout.c +DIST_SOURCES = igt_assert.c igt_exit_handler.c igt_fork_helper.c \ + igt_invalid_subtest_name.c igt_list_only.c igt_no_exit.c \ + igt_no_exit_list_only.c igt_no_subtest.c igt_segfault.c \ + igt_simple_test_subtests.c igt_simulation.c igt_stats.c \ + igt_subtest_group.c igt_timeout.c am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ @@ -510,6 +536,8 @@ DRM_LIBS = @DRM_LIBS@ DRM_NOUVEAU_CFLAGS = @DRM_NOUVEAU_CFLAGS@ DRM_NOUVEAU_LIBS = @DRM_NOUVEAU_LIBS@ +DRM_VC4_CFLAGS = @DRM_VC4_CFLAGS@ +DRM_VC4_LIBS = @DRM_VC4_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -554,6 +582,7 @@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MAN_SUBSTS = @MAN_SUBSTS@ @@ -598,6 +627,7 @@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ THREAD_CFLAGS = @THREAD_CFLAGS@ +TIMER_LIBS = @TIMER_LIBS@ VERSION = @VERSION@ XORG_MAN_PAGE = @XORG_MAN_PAGE@ XRANDR_CFLAGS = @XRANDR_CFLAGS@ @@ -652,11 +682,16 @@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ +target = @target@ target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ @@ -679,8 +714,8 @@ -DIGT_DATADIR=\""$(abs_srcdir)"\" $(NULL) $(CAIRO_CFLAGS) \ $(LIBUDEV_CFLAGS) $(GLIB_CFLAGS) LDADD = ../libintel_tools.la $(PCIACCESS_LIBS) $(DRM_LIBS) \ - $(LIBUNWIND_LIBS) $(CAIRO_LIBS) $(LIBUDEV_LIBS) $(GLIB_LIBS) \ - -lm + $(LIBUNWIND_LIBS) $(TIMER_LIBS) $(CAIRO_LIBS) $(LIBUDEV_LIBS) \ + $(GLIB_LIBS) -lm all: all-am .SUFFIXES: @@ -729,6 +764,10 @@ @rm -f igt_assert$(EXEEXT) $(AM_V_CCLD)$(LINK) $(igt_assert_OBJECTS) $(igt_assert_LDADD) $(LIBS) +igt_exit_handler$(EXEEXT): $(igt_exit_handler_OBJECTS) $(igt_exit_handler_DEPENDENCIES) $(EXTRA_igt_exit_handler_DEPENDENCIES) + @rm -f igt_exit_handler$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(igt_exit_handler_OBJECTS) $(igt_exit_handler_LDADD) $(LIBS) + igt_fork_helper$(EXEEXT): $(igt_fork_helper_OBJECTS) $(igt_fork_helper_DEPENDENCIES) $(EXTRA_igt_fork_helper_DEPENDENCIES) @rm -f igt_fork_helper$(EXEEXT) $(AM_V_CCLD)$(LINK) $(igt_fork_helper_OBJECTS) $(igt_fork_helper_LDADD) $(LIBS) @@ -769,6 +808,10 @@ @rm -f igt_stats$(EXEEXT) $(AM_V_CCLD)$(LINK) $(igt_stats_OBJECTS) $(igt_stats_LDADD) $(LIBS) +igt_subtest_group$(EXEEXT): $(igt_subtest_group_OBJECTS) $(igt_subtest_group_DEPENDENCIES) $(EXTRA_igt_subtest_group_DEPENDENCIES) + @rm -f igt_subtest_group$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(igt_subtest_group_OBJECTS) $(igt_subtest_group_LDADD) $(LIBS) + igt_timeout$(EXEEXT): $(igt_timeout_OBJECTS) $(igt_timeout_DEPENDENCIES) $(EXTRA_igt_timeout_DEPENDENCIES) @rm -f igt_timeout$(EXEEXT) $(AM_V_CCLD)$(LINK) $(igt_timeout_OBJECTS) $(igt_timeout_LDADD) $(LIBS) @@ -780,6 +823,7 @@ -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/igt_assert.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/igt_exit_handler.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/igt_fork_helper.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/igt_invalid_subtest_name.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/igt_list_only.Po@am__quote@ @@ -790,6 +834,7 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/igt_simple_test_subtests.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/igt_simulation.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/igt_stats.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/igt_subtest_group.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/igt_timeout.Po@am__quote@ .c.o: @@ -1092,12 +1137,26 @@ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) +igt_subtest_group.log: igt_subtest_group$(EXEEXT) + @p='igt_subtest_group$(EXEEXT)'; \ + b='igt_subtest_group'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) igt_assert.log: igt_assert$(EXEEXT) @p='igt_assert$(EXEEXT)'; \ b='igt_assert'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +igt_exit_handler.log: igt_exit_handler$(EXEEXT) + @p='igt_exit_handler$(EXEEXT)'; \ + b='igt_exit_handler'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) igt_command_line.sh.log: igt_command_line.sh @p='igt_command_line.sh'; \ diff -Nru intel-gpu-tools-1.13/lib/tests/Makefile.sources intel-gpu-tools-1.15/lib/tests/Makefile.sources --- intel-gpu-tools-1.13/lib/tests/Makefile.sources 2015-11-12 17:30:48.000000000 +0000 +++ intel-gpu-tools-1.15/lib/tests/Makefile.sources 2016-05-23 10:51:28.000000000 +0000 @@ -10,7 +10,9 @@ igt_timeout \ igt_invalid_subtest_name \ igt_segfault \ + igt_subtest_group \ igt_assert \ + igt_exit_handler \ $(NULL) check_SCRIPTS = \ diff -Nru intel-gpu-tools-1.13/lib/uwildmat/uwildmat.c intel-gpu-tools-1.15/lib/uwildmat/uwildmat.c --- intel-gpu-tools-1.13/lib/uwildmat/uwildmat.c 1970-01-01 00:00:00.000000000 +0000 +++ intel-gpu-tools-1.15/lib/uwildmat/uwildmat.c 2016-05-23 10:51:28.000000000 +0000 @@ -0,0 +1,475 @@ +/* uwildmat.c is reused from libinn - https://launchpad.net/ubuntu/+source/inn2/2.5.4-1 + + This provides wild card matching originally used in InterNetNews and is + described in https://tools.ietf.org/html/rfc3977#section-4 + + INN licence: + INN as a whole and all code contained in it not otherwise marked with + different licenses and/or copyrights is covered by the following copyright + and license: + + Copyright (c) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, + 2013, 2014 by Internet Systems Consortium, Inc. ("ISC") + Copyright (c) 1991, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, + 2002, 2003 by The Internet Software Consortium and Rich Salz + + This code is derived from software contributed to the Internet Software + Consortium by Rich Salz. + + Permission to use, copy, modify, and distribute this software for any + purpose with or without fee is hereby granted, provided that the above + copyright notice and this permission notice appear in all copies. + + THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH + REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY + SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +*/ + +/* $Id: uwildmat.c 8918 2010-01-22 23:28:28Z iulius $ + ** + ** wildmat pattern matching with Unicode UTF-8 extensions. + ** + ** Do shell-style pattern matching for ?, \, [], and * characters. Might not + ** be robust in face of malformed patterns; e.g., "foo[a-" could cause a + ** segmentation violation. It is 8-bit clean. (Robustness hopefully fixed + ** July 2000; all malformed patterns should now just fail to match anything.) + ** + ** Original by Rich $alz, mirror!rs, Wed Nov 26 19:03:17 EST 1986. + ** Rich $alz is now . + ** + ** April, 1991: Replaced mutually-recursive calls with in-line code for the + ** star character. + ** + ** Special thanks to Lars Mathiesen for the ABORT code. + ** This can greatly speed up failing wildcard patterns. For example: + ** + ** pattern: -*-*-*-*-*-*-12-*-*-*-m-*-*-* + ** text 1: -adobe-courier-bold-o-normal--12-120-75-75-m-70-iso8859-1 + ** text 2: -adobe-courier-bold-o-normal--12-120-75-75-X-70-iso8859-1 + ** + ** Text 1 matches with 51 calls, while text 2 fails with 54 calls. Without + ** the ABORT code, it takes 22310 calls to fail. Ugh. The following + ** explanation is from Lars: + ** + ** The precondition that must be fulfilled is that DoMatch will consume at + ** least one character in text. This is true if *p is neither '*' nor '\0'.) + ** The last return has ABORT instead of false to avoid quadratic behaviour in + ** cases like pattern "*a*b*c*d" with text "abcxxxxx". With false, each + ** star-loop has to run to the end of the text; with ABORT only the last one + ** does. + ** + ** Once the control of one instance of DoMatch enters the star-loop, that + ** instance will return either true or ABORT, and any calling instance will + ** therefore return immediately after (without calling recursively again). + ** In effect, only one star-loop is ever active. It would be possible to + ** modify the code to maintain this context explicitly, eliminating all + ** recursive calls at the cost of some complication and loss of clarity (and + ** the ABORT stuff seems to be unclear enough by itself). I think it would + ** be unwise to try to get this into a released version unless you have a + ** good test data base to try it out on. + ** + ** June, 1991: Robert Elz added minus and close bracket + ** handling for character sets. + ** + ** July, 2000: Largely rewritten by Russ Allbery to add + ** support for ',', '!', and optionally '@' to the core wildmat routine. + ** Broke the character class matching into a separate function for clarity + ** since it's infrequently used in practice, and added some simple lookahead + ** to significantly decrease the recursive calls in the '*' matching code. + ** Added support for UTF-8 as the default character set for any high-bit + ** characters. + ** + ** For more information on UTF-8, see RFC 3629. + ** + ** Please note that this file is intentionally written so that conditionally + ** executed expressions are on separate lines from the condition to + ** facilitate analysis of the coverage of the test suite using purecov. + ** Please preserve this. As of March 11, 2001, purecov reports that the + ** accompanying test suite achieves 100% coverage of this file. + */ + +#include +#include +#include "uwildmat.h" + +#define ABORT -1 + +/* Whether or not an octet looks like the start of a UTF-8 character. */ +#define ISUTF8(c) (((c) & 0xc0) == 0xc0) + + +/* + ** Determine the length of a non-ASCII character in octets (for advancing + ** pointers when skipping over characters). Takes a pointer to the start of + ** the character and to the last octet of the string. If end is NULL, expect + ** the string pointed to by start to be nul-terminated. If the character is + ** malformed UTF-8, return 1 to treat it like an eight-bit local character. + */ +static int +utf8_length(const unsigned char *start, const unsigned char *end) +{ + unsigned char mask = 0x80; + const unsigned char *p; + int length = 0; + int left; + + for (; mask > 0 && (*start & mask) == mask; mask >>= 1) + length++; + if (length < 2 || length > 6) + return 1; + if (end != NULL && (end - start + 1) < length) + return 1; + left = length - 1; + for (p = start + 1; left > 0 && (*p & 0xc0) == 0x80; p++) + left--; + return (left == 0) ? length : 1; +} + + +/* + ** Check whether a string contains only valid UTF-8 characters. + */ +bool +is_valid_utf8(const char *text) +{ + unsigned char mask; + const unsigned char *p; + int length; + int left; + + for (p = (const unsigned char *)text; *p != '\0';) { + mask = 0x80; + length = 0; + + /* Find out the expected length of the character. */ + for (; mask > 0 && (*p & mask) == mask; mask >>= 1) + length++; + + p++; + + /* Valid ASCII. */ + if (length == 0) + continue; + + /* Invalid length. */ + if (length < 2 || length > 6) + return false; + + /* Check that each byte looks like 10xxxxxx, except for the first. */ + left = length - 1; + for (; left > 0 && (*p & 0xc0) == 0x80; p++) + left--; + + if (left > 0) + return false; + } + + return true; +} + + +/* + ** Convert a UTF-8 character to UCS-4. Takes a pointer to the start of the + ** character and to the last octet of the string, and to a uint32_t into + ** which to put the decoded UCS-4 value. If end is NULL, expect the string + ** pointed to by start to be nul-terminated. Returns the number of octets in + ** the UTF-8 encoding. If the UTF-8 character is malformed, set result to + ** the decimal value of the first octet; this is wrong, but it will generally + ** cause the rest of the wildmat matching to do the right thing for non-UTF-8 + ** input. + */ +static int +utf8_decode(const unsigned char *start, const unsigned char *end, + uint32_t *result) +{ + uint32_t value = 0; + int length, i; + const unsigned char *p = start; + unsigned char mask; + + length = utf8_length(start, end); + if (length < 2) { + *result = *start; + return 1; + } + mask = (1 << (7 - length)) - 1; + value = *p & mask; + p++; + for (i = length - 1; i > 0; i--) { + value = (value << 6) | (*p & 0x3f); + p++; + } + *result = value; + return length; +} + + +/* + ** Match a character class against text, a UCS-4 character. start is a + ** pointer to the first character of the character class, end a pointer to + ** the last. Returns whether the class matches that character. + */ +static bool +match_class(uint32_t text, const unsigned char *start, + const unsigned char *end) +{ + bool reversed, allowrange; + const unsigned char *p = start; + uint32_t first = 0; + uint32_t last; + + /* Check for an inverted character class (starting with ^). If the + character matches the character class, we return !reversed; that way, + we return true if it's a regular character class and false if it's a + reversed one. If the character doesn't match, we return reversed. */ + reversed = (*p == '^'); + if (reversed) + p++; + + /* Walk through the character class until we reach the end or find a + match, handling character ranges as we go. Only permit a range to + start when allowrange is true; this allows - to be treated like a + normal character as the first character of the class and catches + malformed ranges like a-e-n. We treat the character at the beginning + of a range as both a regular member of the class and the beginning of + the range; this is harmless (although it means that malformed ranges + like m-a will match m and nothing else). */ + allowrange = false; + while (p <= end) { + if (allowrange && *p == '-' && p < end) { + p++; + p += utf8_decode(p, end, &last); + if (text >= first && text <= last) + return !reversed; + allowrange = false; + } else { + p += utf8_decode(p, end, &first); + if (text == first) + return !reversed; + allowrange = true; + } + } + return reversed; +} + + +/* + ** Match the text against the pattern between start and end. This is a + ** single pattern; a leading ! or @ must already be taken care of, and + ** commas must be dealt with outside of this routine. + */ +static int +match_pattern(const unsigned char *text, const unsigned char *start, + const unsigned char *end) +{ + const unsigned char *q, *endclass; + const unsigned char *p = start; + bool ismeta; + int matched, width; + uint32_t c; + + for (; p <= end; p++) { + if (!*text && *p != '*') + return ABORT; + + switch (*p) { + case '\\': + if (!*++p) + return ABORT; + /* Fall through. */ + + default: + if (*text++ != *p) + return false; + break; + + case '?': + text += ISUTF8(*text) ? utf8_length(text, NULL) : 1; + break; + + case '*': + /* Consecutive stars are equivalent to one. Advance pattern to + the character after the star. */ + for (++p; *p == '*'; p++) + ; + + /* A trailing star will match anything. */ + if (p > end) + return true; + + /* Basic algorithm: Recurse at each point where the * could + possibly match. If the match succeeds or aborts, return + immediately; otherwise, try the next position. + +Optimization: If the character after the * in the pattern +isn't a metacharacter (the common case), then the * has to +consume characters at least up to the next occurrence of that +character in the text. Scan forward for those points rather +than recursing at every possible point to save the extra +function call overhead. */ + ismeta = (*p == '[' || *p == '?' || *p == '\\'); + while (*text) { + width = ISUTF8(*text) ? utf8_length(text, NULL) : 1; + if (ismeta) { + matched = match_pattern(text, p, end); + text += width; + } else { + while (*text && *text != *p) { + text += width; + width = ISUTF8(*text) ? utf8_length(text, NULL) : 1; + } + if (!*text) + return ABORT; + matched = match_pattern(++text, p + 1, end); + } + if (matched != false) + return matched; + } + return ABORT; + + case '[': + /* Find the end of the character class, making sure not to pick + up a close bracket at the beginning of the class. */ + p++; + q = p + (*p == '^') + 1; + if (q > end) + return ABORT; + endclass = memchr(q, ']', (size_t) (end - q + 1)); + if (!endclass) + return ABORT; + + /* Do the heavy lifting in another function for clarity, since + character classes are an uncommon case. */ + text += utf8_decode(text, NULL, &c); + if (!match_class(c, p, endclass - 1)) + return false; + p = endclass; + break; + } + } + + return (*text == '\0'); +} + + +/* + ** Takes text and a wildmat expression; a wildmat expression is a + ** comma-separated list of wildmat patterns, optionally preceded by ! to + ** invert the sense of the expression. Returns UWILDMAT_MATCH if that + ** expression matches the text, UWILDMAT_FAIL otherwise. If allowpoison is + ** set, allow @ to introduce a poison expression (the same as !, but if it + ** triggers the failed match the routine returns UWILDMAT_POISON instead). + */ +static enum uwildmat +match_expression(const unsigned char *text, const unsigned char *start, + bool allowpoison) +{ + const unsigned char *end, *split; + const unsigned char *p = start; + bool reverse, escaped; + bool match = false; + bool poison = false; + bool poisoned = false; + + /* Handle the empty expression separately, since otherwise end will be + set to an invalid pointer. */ + if (!*p) + return !*text ? UWILDMAT_MATCH : UWILDMAT_FAIL; + end = start + strlen((const char *) start) - 1; + + /* Main match loop. Find each comma that separates patterns, and attempt + to match the text with each pattern in order. The last matching + pattern determines whether the whole expression matches. */ + for (; p <= end + 1; p = split + 1) { + if (allowpoison) + poison = (*p == '@'); + reverse = (*p == '!') || poison; + if (reverse) + p++; + + /* Find the first unescaped comma, if any. If there is none, split + will be one greater than end and point at the nul at the end of + the string. */ + for (escaped = false, split = p; split <= end; split++) { + if (*split == '[') { + split++; + if (*split == ']') + split++; + while (split <= end && *split != ']') + split++; + } + if (*split == ',' && !escaped) + break; + escaped = (*split == '\\') ? !escaped : false; + } + + /* Optimization: If match == !reverse and poison == poisoned, this + pattern can't change the result, so don't do any work. */ + if (match == !reverse && poison == poisoned) + continue; + if (match_pattern(text, p, split - 1) == true) { + poisoned = poison; + match = !reverse; + } + } + if (poisoned) + return UWILDMAT_POISON; + return match ? UWILDMAT_MATCH : UWILDMAT_FAIL; +} + + +/* + ** User-level routine used for wildmats where @ should be treated as a + ** regular character. + */ +bool +uwildmat(const char *text, const char *pat) +{ + const unsigned char *utext = (const unsigned char *) text; + const unsigned char *upat = (const unsigned char *) pat; + + if (upat[0] == '*' && upat[1] == '\0') + return true; + else + return (match_expression(utext, upat, false) == UWILDMAT_MATCH); +} + + +/* + ** User-level routine used for wildmats that support poison matches. + */ +enum uwildmat +uwildmat_poison(const char *text, const char *pat) +{ + const unsigned char *utext = (const unsigned char *) text; + const unsigned char *upat = (const unsigned char *) pat; + + if (upat[0] == '*' && upat[1] == '\0') + return UWILDMAT_MATCH; + else + return match_expression(utext, upat, true); +} + + +/* + ** User-level routine for simple expressions (neither , nor ! are special). + */ +bool +uwildmat_simple(const char *text, const char *pat) +{ + const unsigned char *utext = (const unsigned char *) text; + const unsigned char *upat = (const unsigned char *) pat; + size_t length; + + if (upat[0] == '*' && upat[1] == '\0') + return true; + else { + length = strlen(pat); + return (match_pattern(utext, upat, upat + length - 1) == true); + } +} diff -Nru intel-gpu-tools-1.13/lib/uwildmat/uwildmat.h intel-gpu-tools-1.15/lib/uwildmat/uwildmat.h --- intel-gpu-tools-1.13/lib/uwildmat/uwildmat.h 1970-01-01 00:00:00.000000000 +0000 +++ intel-gpu-tools-1.15/lib/uwildmat/uwildmat.h 2016-05-23 10:51:28.000000000 +0000 @@ -0,0 +1,24 @@ + +#ifndef UWILDMAT_H +#define UWILDMAT_H 1 + +#include +#include +#include + +/* +** WILDMAT MATCHING +*/ +enum uwildmat { + UWILDMAT_FAIL = 0, + UWILDMAT_MATCH = 1, + UWILDMAT_POISON +}; + +extern bool is_valid_utf8(const char *start); +extern bool uwildmat(const char *text, const char *pat); +extern bool uwildmat_simple(const char *text, const char *pat); +extern enum uwildmat uwildmat_poison(const char *text, const char *pat); + + +#endif /* UWILDMAT_H */ diff -Nru intel-gpu-tools-1.13/m4/libtool.m4 intel-gpu-tools-1.15/m4/libtool.m4 --- intel-gpu-tools-1.13/m4/libtool.m4 2015-09-11 15:13:09.000000000 +0000 +++ intel-gpu-tools-1.15/m4/libtool.m4 2016-05-31 17:03:08.000000000 +0000 @@ -1,8 +1,6 @@ # 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. +# Copyright (C) 1996-2001, 2003-2015 Free Software Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is free software; the Free Software Foundation gives @@ -10,36 +8,30 @@ # 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. +# Copyright (C) 2014 Free Software Foundation, Inc. +# This is free software; see the source for copying conditions. There is NO +# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +# GNU Libtool is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of of the License, or +# (at your option) any later version. # -# As a special exception to the GNU General Public License, -# if you distribute this file as part of a program or library that -# is built using GNU Libtool, you may include this file under the -# same distribution terms that you use for the rest of that program. +# 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 +# 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. +# along with this program. If not, see . ]) -# serial 57 LT_INIT +# serial 58 LT_INIT # LT_PREREQ(VERSION) @@ -67,7 +59,7 @@ # LT_INIT([OPTIONS]) # ------------------ AC_DEFUN([LT_INIT], -[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT +[AC_PREREQ([2.62])dnl We use AC_PATH_PROGS_FEATURE_CHECK AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl @@ -91,7 +83,7 @@ _LT_SET_OPTIONS([$0], [$1]) # This can be used to rebuild libtool when needed -LIBTOOL_DEPS="$ltmain" +LIBTOOL_DEPS=$ltmain # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' @@ -111,26 +103,43 @@ dnl AC_DEFUN([AM_PROG_LIBTOOL], []) +# _LT_PREPARE_CC_BASENAME +# ----------------------- +m4_defun([_LT_PREPARE_CC_BASENAME], [ +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +func_cc_basename () +{ + for cc_temp in @S|@*""; do + case $cc_temp in + compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; + distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; + \-*) ;; + *) break;; + esac + done + func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +} +])# _LT_PREPARE_CC_BASENAME + + # _LT_CC_BASENAME(CC) # ------------------- -# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +# It would be clearer to call AC_REQUIREs from _LT_PREPARE_CC_BASENAME, +# but that macro is also expanded into generated libtool script, which +# arranges for $SED and $ECHO to be set by different means. m4_defun([_LT_CC_BASENAME], -[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-%%"` +[m4_require([_LT_PREPARE_CC_BASENAME])dnl +AC_REQUIRE([_LT_DECL_SED])dnl +AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl +func_cc_basename $1 +cc_basename=$func_cc_basename_result ]) # _LT_FILEUTILS_DEFAULTS # ---------------------- # It is okay to use these file commands and assume they have been set -# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. +# sensibly after 'm4_require([_LT_FILEUTILS_DEFAULTS])'. m4_defun([_LT_FILEUTILS_DEFAULTS], [: ${CP="cp -f"} : ${MV="mv -f"} @@ -177,15 +186,16 @@ m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_WITH_SYSROOT])dnl +m4_require([_LT_CMD_TRUNCATE])dnl _LT_CONFIG_LIBTOOL_INIT([ -# See if we are running on zsh, and set the options which allow our +# See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes INIT. -if test -n "\${ZSH_VERSION+set}" ; then +if test -n "\${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi ]) -if test -n "${ZSH_VERSION+set}" ; then +if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi @@ -198,7 +208,7 @@ # 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 + if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi @@ -209,14 +219,14 @@ ofile=libtool can_build_shared=yes -# All known linkers require a `.a' archive for static linking (except MSVC, +# 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" +with_gnu_ld=$lt_cv_prog_gnu_ld -old_CC="$CC" -old_CFLAGS="$CFLAGS" +old_CC=$CC +old_CFLAGS=$CFLAGS # Set sane defaults for various variables test -z "$CC" && CC=cc @@ -269,14 +279,14 @@ # _LT_PROG_LTMAIN # --------------- -# Note that this code is called both from `configure', and `config.status' +# 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, +# '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" +ltmain=$ac_aux_dir/ltmain.sh ])# _LT_PROG_LTMAIN @@ -286,7 +296,7 @@ # 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' +# in macros and then make a single call at the end using the 'libtool' # label. @@ -421,8 +431,8 @@ # _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 +# 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"`']) @@ -446,7 +456,7 @@ # 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 +available_tags='_LT_TAGS'dnl ]) @@ -474,7 +484,7 @@ # _LT_LIBTOOL_CONFIG_VARS # ----------------------- # Produce commented declarations of non-tagged libtool config variables -# suitable for insertion in the LIBTOOL CONFIG section of the `libtool' +# 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], @@ -500,8 +510,8 @@ # 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 +# 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], @@ -547,7 +557,7 @@ ]], lt_decl_quote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" @@ -560,7 +570,7 @@ ]], 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=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" @@ -576,7 +586,7 @@ # 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 +# '#!' 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). @@ -598,7 +608,7 @@ _AS_PREPARE exec AS_MESSAGE_FD>&1 _ASEOF -test $lt_write_fail = 0 && chmod +x $1[]dnl +test 0 = "$lt_write_fail" && chmod +x $1[]dnl m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT # LT_OUTPUT @@ -621,7 +631,7 @@ } >&AS_MESSAGE_LOG_FD lt_cl_help="\ -\`$as_me' creates a local libtool stub from the current configuration, +'$as_me' creates a local libtool stub from the current configuration, for use in further configure time tests before the real libtool is generated. @@ -643,7 +653,7 @@ This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." -while test $[#] != 0 +while test 0 != $[#] do case $[1] in --version | --v* | -V ) @@ -656,10 +666,10 @@ lt_cl_silent=: ;; -*) AC_MSG_ERROR([unrecognized option: $[1] -Try \`$[0] --help' for more information.]) ;; +Try '$[0] --help' for more information.]) ;; *) AC_MSG_ERROR([unrecognized argument: $[1] -Try \`$[0] --help' for more information.]) ;; +Try '$[0] --help' for more information.]) ;; esac shift done @@ -685,7 +695,7 @@ # 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 && +test yes = "$silent" && lt_config_lt_args="$lt_config_lt_args --quiet" exec AS_MESSAGE_LOG_FD>/dev/null $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false @@ -705,27 +715,31 @@ _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 + # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes. - if test -n "${ZSH_VERSION+set}" ; then + if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi - cfgfile="${ofile}T" + 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 +# Generated automatically by $as_me ($PACKAGE) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. -# + +# Provide generalized library-building support services. +# Written by Gordon Matzigkeit, 1996 + _LT_COPYING _LT_LIBTOOL_TAGS +# Configured defaults for sys_lib_dlsearch_path munging. +: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} + # ### BEGIN LIBTOOL CONFIG _LT_LIBTOOL_CONFIG_VARS _LT_LIBTOOL_TAG_VARS @@ -733,13 +747,24 @@ _LT_EOF + cat <<'_LT_EOF' >> "$cfgfile" + +# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE + +_LT_PREPARE_MUNGE_PATH_LIST +_LT_PREPARE_CC_BASENAME + +# ### END FUNCTIONS SHARED WITH CONFIGURE + +_LT_EOF + case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. -if test "X${COLLECT_NAMES+set}" != Xset; then +if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi @@ -756,8 +781,6 @@ 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" @@ -775,7 +798,6 @@ [m4_if([$1], [], [ PACKAGE='$PACKAGE' VERSION='$VERSION' - TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile'], []) ])dnl /_LT_CONFIG_SAVE_COMMANDS @@ -974,7 +996,7 @@ 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 + 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 @@ -992,7 +1014,7 @@ 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 + elif test -f libconftest.dylib && test 0 = "$_lt_result"; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&AS_MESSAGE_LOG_FD @@ -1010,7 +1032,7 @@ AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [lt_cv_ld_exported_symbols_list=yes], [lt_cv_ld_exported_symbols_list=no]) - LDFLAGS="$save_LDFLAGS" + LDFLAGS=$save_LDFLAGS ]) AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], @@ -1032,7 +1054,7 @@ _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 + elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then lt_cv_ld_force_load=yes else cat conftest.err >&AS_MESSAGE_LOG_FD @@ -1042,32 +1064,32 @@ ]) case $host_os in rhapsody* | darwin1.[[012]]) - _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; + _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; darwin1.*) - _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + _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' ;; + _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' ;; + _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; esac ;; esac - if test "$lt_cv_apple_cc_single_mod" = "yes"; then + if test yes = "$lt_cv_apple_cc_single_mod"; 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' + if test yes = "$lt_cv_ld_exported_symbols_list"; then + _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' else - _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' + _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib' fi - if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then + if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= @@ -1087,29 +1109,29 @@ _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\"`' + if test yes = "$lt_cv_ld_force_load"; then + _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) else _LT_TAGVAR(whole_archive_flag_spec, $1)='' fi _LT_TAGVAR(link_all_deplibs, $1)=yes - _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" + _LT_TAGVAR(allow_undefined_flag, $1)=$_lt_dar_allow_undefined case $cc_basename in - ifort*) _lt_dar_can_shared=yes ;; + ifort*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac - if test "$_lt_dar_can_shared" = "yes"; then + if test yes = "$_lt_dar_can_shared"; then output_verbose_link_cmd=func_echo_all - _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" - _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" - _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" - _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" + _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}" +[ if test yes != "$lt_cv_apple_cc_single_mod"; then + _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil" + _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" fi ],[]) else @@ -1129,7 +1151,7 @@ # 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 +if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], @@ -1147,7 +1169,7 @@ _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" + _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=/usr/lib:/lib fi ]) aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) @@ -1167,8 +1189,8 @@ # ----------------------- # 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). +# of the generated configure script that will find a shell with a builtin +# printf (that we can use as an echo command). m4_defun([_LT_PROG_ECHO_BACKSLASH], [ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO @@ -1196,10 +1218,10 @@ # Invoke $ECHO with all args, space-separated. func_echo_all () { - $ECHO "$*" + $ECHO "$*" } -case "$ECHO" in +case $ECHO in printf*) AC_MSG_RESULT([printf]) ;; print*) AC_MSG_RESULT([print -r]) ;; *) AC_MSG_RESULT([cat]) ;; @@ -1225,16 +1247,17 @@ 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).], +[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@], + [Search for dependent libraries within DIR (or the compiler's sysroot + if not specified).])], [], [with_sysroot=no]) dnl lt_sysroot will always be passed unquoted. We quote it here dnl in case the user passed a directory name. lt_sysroot= -case ${with_sysroot} in #( +case $with_sysroot in #( yes) - if test "$GCC" = yes; then + if test yes = "$GCC"; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( @@ -1244,14 +1267,14 @@ no|'') ;; #( *) - AC_MSG_RESULT([${with_sysroot}]) + 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.])]) +[dependent libraries, and where our libraries should be installed.])]) # _LT_ENABLE_LOCK # --------------- @@ -1259,31 +1282,33 @@ [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 +test no = "$enable_libtool_lock" || enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) - # Find out which ABI we are using. + # Find out what ABI is being produced by ac_compile, and set mode + # options accordingly. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) - HPUX_IA64_MODE="32" + HPUX_IA64_MODE=32 ;; *ELF-64*) - HPUX_IA64_MODE="64" + HPUX_IA64_MODE=64 ;; esac fi rm -rf conftest* ;; *-*-irix6*) - # Find out which ABI we are using. + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then - if test "$lt_cv_prog_gnu_ld" = yes; then + if test yes = "$lt_cv_prog_gnu_ld"; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" @@ -1312,9 +1337,46 @@ rm -rf conftest* ;; +mips64*-*linux*) + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. + echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + emul=elf + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + emul="${emul}32" + ;; + *64-bit*) + emul="${emul}64" + ;; + esac + case `/usr/bin/file conftest.$ac_objext` in + *MSB*) + emul="${emul}btsmip" + ;; + *LSB*) + emul="${emul}ltsmip" + ;; + esac + case `/usr/bin/file conftest.$ac_objext` in + *N32*) + emul="${emul}n32" + ;; + esac + LD="${LD-ld} -m $emul" + fi + rm -rf conftest* + ;; + x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) - # Find out which ABI we are using. + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. Note that the listed cases only cover the + # situations where additional linker options are needed (such as when + # doing 32-bit compilation for a host where ld defaults to 64-bit, or + # vice versa); the common cases where no linker options are needed do + # not appear in the list. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in @@ -1324,7 +1386,14 @@ LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) - LD="${LD-ld} -m elf_i386" + case `/usr/bin/file conftest.o` in + *x86-64*) + LD="${LD-ld} -m elf32_x86_64" + ;; + *) + LD="${LD-ld} -m elf_i386" + ;; + esac ;; powerpc64le-*linux*) LD="${LD-ld} -m elf32lppclinux" @@ -1369,19 +1438,20 @@ *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. - SAVE_CFLAGS="$CFLAGS" + 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 + if test yes != "$lt_cv_cc_needs_belf"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf - CFLAGS="$SAVE_CFLAGS" + CFLAGS=$SAVE_CFLAGS fi ;; *-*solaris*) - # Find out which ABI we are using. + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in @@ -1389,7 +1459,7 @@ case $lt_cv_prog_gnu_ld in yes*) case $host in - i?86-*-solaris*) + i?86-*-solaris*|x86_64-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) @@ -1398,7 +1468,7 @@ 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" + LD=${LD-ld}_sol2 fi ;; *) @@ -1414,7 +1484,7 @@ ;; esac -need_locks="$enable_libtool_lock" +need_locks=$enable_libtool_lock ])# _LT_ENABLE_LOCK @@ -1433,11 +1503,11 @@ [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 + if test 0 -eq "$ac_status"; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a AC_TRY_EVAL([lt_ar_try]) - if test "$ac_status" -ne 0; then + if test 0 -ne "$ac_status"; then lt_cv_ar_at_file=@ fi fi @@ -1445,7 +1515,7 @@ ]) ]) -if test "x$lt_cv_ar_at_file" = xno; then +if test no = "$lt_cv_ar_at_file"; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file @@ -1476,7 +1546,7 @@ if test -n "$RANLIB"; then case $host_os in - openbsd*) + bitrig* | openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) @@ -1512,7 +1582,7 @@ [$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" + lt_compiler_flag="$3" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins @@ -1539,7 +1609,7 @@ $RM conftest* ]) -if test x"[$]$2" = xyes; then +if test yes = "[$]$2"; then m4_if([$5], , :, [$5]) else m4_if([$6], , :, [$6]) @@ -1561,7 +1631,7 @@ m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no - save_LDFLAGS="$LDFLAGS" + 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 @@ -1580,10 +1650,10 @@ fi fi $RM -r conftest* - LDFLAGS="$save_LDFLAGS" + LDFLAGS=$save_LDFLAGS ]) -if test x"[$]$2" = xyes; then +if test yes = "[$]$2"; then m4_if([$4], , :, [$4]) else m4_if([$5], , :, [$5]) @@ -1604,7 +1674,7 @@ AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 - teststring="ABCD" + teststring=ABCD case $build_os in msdosdjgpp*) @@ -1644,7 +1714,7 @@ lt_cv_sys_max_cmd_len=8192; ;; - netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) + bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` @@ -1694,22 +1764,23 @@ ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` - if test -n "$lt_cv_sys_max_cmd_len"; then + if test -n "$lt_cv_sys_max_cmd_len" && \ + test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. - for i in 1 2 3 4 5 6 7 8 ; do + 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` \ + 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 + test 17 != "$i" # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring @@ -1725,7 +1796,7 @@ ;; esac ]) -if test -n $lt_cv_sys_max_cmd_len ; then +if test -n "$lt_cv_sys_max_cmd_len"; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) @@ -1753,7 +1824,7 @@ # ---------------------------------------------------------------- m4_defun([_LT_TRY_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl -if test "$cross_compiling" = yes; then : +if test yes = "$cross_compiling"; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 @@ -1800,9 +1871,9 @@ # endif #endif -/* When -fvisbility=hidden is used, assume the code has been annotated +/* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ -#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif @@ -1828,7 +1899,7 @@ return status; }] _LT_EOF - if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then + 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 @@ -1849,7 +1920,7 @@ # ------------------ AC_DEFUN([LT_SYS_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl -if test "x$enable_dlopen" != xyes; then +if test yes != "$enable_dlopen"; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown @@ -1859,44 +1930,52 @@ case $host_os in beos*) - lt_cv_dlopen="load_add_on" + 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=LoadLibrary lt_cv_dlopen_libs= ;; cygwin*) - lt_cv_dlopen="dlopen" + lt_cv_dlopen=dlopen lt_cv_dlopen_libs= ;; darwin*) - # if libdl is installed we need to link against it + # 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=dlopen lt_cv_dlopen_libs=-ldl],[ + lt_cv_dlopen=dyld lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; + tpf*) + # Don't try to run any link tests for TPF. We know it's impossible + # because TPF is a cross-compiler, and we know how we open DSOs. + lt_cv_dlopen=dlopen + lt_cv_dlopen_libs= + lt_cv_dlopen_self=no + ;; + *) AC_CHECK_FUNC([shl_load], - [lt_cv_dlopen="shl_load"], + [lt_cv_dlopen=shl_load], [AC_CHECK_LIB([dld], [shl_load], - [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], + [lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld], [AC_CHECK_FUNC([dlopen], - [lt_cv_dlopen="dlopen"], + [lt_cv_dlopen=dlopen], [AC_CHECK_LIB([dl], [dlopen], - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], + [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl], [AC_CHECK_LIB([svld], [dlopen], - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], + [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"]) + [lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld]) ]) ]) ]) @@ -1905,21 +1984,21 @@ ;; esac - if test "x$lt_cv_dlopen" != xno; then - enable_dlopen=yes - else + if test no = "$lt_cv_dlopen"; then enable_dlopen=no + else + enable_dlopen=yes fi case $lt_cv_dlopen in dlopen) - save_CPPFLAGS="$CPPFLAGS" - test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + save_CPPFLAGS=$CPPFLAGS + test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" - save_LDFLAGS="$LDFLAGS" + save_LDFLAGS=$LDFLAGS wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" - save_LIBS="$LIBS" + save_LIBS=$LIBS LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], @@ -1929,7 +2008,7 @@ lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) - if test "x$lt_cv_dlopen_self" = xyes; then + if test yes = "$lt_cv_dlopen_self"; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl @@ -1939,9 +2018,9 @@ ]) fi - CPPFLAGS="$save_CPPFLAGS" - LDFLAGS="$save_LDFLAGS" - LIBS="$save_LIBS" + CPPFLAGS=$save_CPPFLAGS + LDFLAGS=$save_LDFLAGS + LIBS=$save_LIBS ;; esac @@ -2033,8 +2112,8 @@ 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 +hard_links=nottested +if test no = "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" && test no != "$need_locks"; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes @@ -2044,8 +2123,8 @@ 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]) + if test no = "$hard_links"; then + AC_MSG_WARN(['$CC' does not support '-c -o', so 'make -j' may be unsafe]) need_locks=warn fi else @@ -2072,8 +2151,8 @@ _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.]) +AC_DEFINE_UNQUOTED([LT_OBJDIR], "$lt_cv_objdir/", + [Define to the sub-directory where libtool stores uninstalled libraries.]) ])# _LT_CHECK_OBJDIR @@ -2085,15 +2164,15 @@ _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 + test yes = "$_LT_TAGVAR(hardcode_automatic, $1)"; then # We can hardcode non-existent directories. - if test "$_LT_TAGVAR(hardcode_direct, $1)" != no && + if test no != "$_LT_TAGVAR(hardcode_direct, $1)" && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one - ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no && - test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then + ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" && + test no != "$_LT_TAGVAR(hardcode_minus_L, $1)"; then # Linking always hardcodes the temporary library directory. _LT_TAGVAR(hardcode_action, $1)=relink else @@ -2107,12 +2186,12 @@ 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 +if test relink = "$_LT_TAGVAR(hardcode_action, $1)" || + test yes = "$_LT_TAGVAR(inherit_rpath, $1)"; then # Fast installation is not supported enable_fast_install=no -elif test "$shlibpath_overrides_runpath" = yes || - test "$enable_shared" = no; then +elif test yes = "$shlibpath_overrides_runpath" || + test no = "$enable_shared"; then # Fast installation is not necessary enable_fast_install=needless fi @@ -2136,7 +2215,7 @@ # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) - if test -n "$STRIP" ; then + if test -n "$STRIP"; then striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) @@ -2154,6 +2233,47 @@ ])# _LT_CMD_STRIPLIB +# _LT_PREPARE_MUNGE_PATH_LIST +# --------------------------- +# Make sure func_munge_path_list() is defined correctly. +m4_defun([_LT_PREPARE_MUNGE_PATH_LIST], +[[# func_munge_path_list VARIABLE PATH +# ----------------------------------- +# VARIABLE is name of variable containing _space_ separated list of +# directories to be munged by the contents of PATH, which is string +# having a format: +# "DIR[:DIR]:" +# string "DIR[ DIR]" will be prepended to VARIABLE +# ":DIR[:DIR]" +# string "DIR[ DIR]" will be appended to VARIABLE +# "DIRP[:DIRP]::[DIRA:]DIRA" +# string "DIRP[ DIRP]" will be prepended to VARIABLE and string +# "DIRA[ DIRA]" will be appended to VARIABLE +# "DIR[:DIR]" +# VARIABLE will be replaced by "DIR[ DIR]" +func_munge_path_list () +{ + case x@S|@2 in + x) + ;; + *:) + eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\" + ;; + x:*) + eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\" + ;; + *::*) + eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" + eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \@S|@@S|@1\" + ;; + *) + eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'`\" + ;; + esac +} +]])# _LT_PREPARE_PATH_LIST + + # _LT_SYS_DYNAMIC_LINKER([TAG]) # ----------------------------- # PORTME Fill in your ld.so characteristics @@ -2164,17 +2284,18 @@ m4_require([_LT_DECL_OBJDUMP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl +m4_require([_LT_PREPARE_MUNGE_PATH_LIST])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ -if test "$GCC" = yes; then +if test yes = "$GCC"; then case $host_os in - darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; - *) lt_awk_arg="/^libraries:/" ;; + 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" ;; + 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 @@ -2190,28 +2311,35 @@ ;; esac # Ok, now we have the path, separated by spaces, we can step through it - # and add multilib dir if necessary. + # 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` + lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + # ...but if some path component already ends with the multilib dir we assume + # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). + case "$lt_multi_os_dir; $lt_search_path_spec " in + "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) + lt_multi_os_dir= + ;; + esac for lt_sys_path in $lt_search_path_spec; do - if test -d "$lt_sys_path/$lt_multi_os_dir"; then - lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" - else + if test -d "$lt_sys_path$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir" + elif test -n "$lt_multi_os_dir"; then test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' -BEGIN {RS=" "; FS="/|\n";} { - lt_foo=""; - lt_count=0; +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; + lt_foo = "/" $lt_i lt_foo; } else { lt_count--; } @@ -2225,7 +2353,7 @@ # 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'` ;; + $SED 's|/\([[A-Za-z]]:\)|\1|g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else @@ -2234,7 +2362,7 @@ library_names_spec= libname_spec='lib$name' soname_spec= -shrext_cmds=".so" +shrext_cmds=.so postinstall_cmds= postuninstall_cmds= finish_cmds= @@ -2251,14 +2379,17 @@ # flags to be left without arguments need_version=unknown +AC_ARG_VAR([LT_SYS_LIBRARY_PATH], +[User-defined run-time library search path.]) + case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + 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' + soname_spec='$libname$release$shared_ext$major' ;; aix[[4-9]]*) @@ -2266,41 +2397,91 @@ need_lib_prefix=no need_version=no hardcode_into_libs=yes - if test "$host_cpu" = ia64; then + if test ia64 = "$host_cpu"; then # AIX 5 supports IA64 - library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + 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 + # 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 + 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 + # Using Import Files as archive members, it is possible to support + # filename-based versioning of shared library archives on AIX. While + # this would work for both with and without runtime linking, it will + # prevent static linking of such archives. So we do filename-based + # shared library versioning with .so extension only, which is used + # when both runtime linking and shared linking is enabled. + # Unfortunately, runtime linking may impact performance, so we do + # not want this to be the default eventually. Also, we use the + # versioned .so libs for executables only if there is the -brtl + # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. + # To allow for filename-based versioning support, we need to create + # libNAME.so.V as an archive file, containing: + # *) an Import File, referring to the versioned filename of the + # archive as well as the shared archive member, telling the + # bitwidth (32 or 64) of that shared object, and providing the + # list of exported symbols of that shared object, eventually + # decorated with the 'weak' keyword + # *) the shared object with the F_LOADONLY flag set, to really avoid + # it being seen by the linker. + # At run time we better use the real file rather than another symlink, + # but for link time we create the symlink libNAME.so -> libNAME.so.V + + case $with_aix_soname,$aix_use_runtimelinking in + # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. - if test "$aix_use_runtimelinking" = yes; then + aix,yes) # traditional libtool + dynamic_linker='AIX unversionable lib.so' # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - else + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + ;; + aix,no) # traditional AIX only + dynamic_linker='AIX lib.a[(]lib.so.V[)]' # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. - library_names_spec='${libname}${release}.a $libname.a' - soname_spec='${libname}${release}${shared_ext}$major' - fi + library_names_spec='$libname$release.a $libname.a' + soname_spec='$libname$release$shared_ext$major' + ;; + svr4,*) # full svr4 only + dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)]" + library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' + # We do not specify a path in Import Files, so LIBPATH fires. + shlibpath_overrides_runpath=yes + ;; + *,yes) # both, prefer svr4 + dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)], lib.a[(]lib.so.V[)]" + library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' + # unpreferred sharedlib libNAME.a needs extra handling + postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' + postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' + # We do not specify a path in Import Files, so LIBPATH fires. + shlibpath_overrides_runpath=yes + ;; + *,no) # both, prefer aix + dynamic_linker="AIX lib.a[(]lib.so.V[)], lib.so.V[(]$shared_archive_member_spec.o[)]" + library_names_spec='$libname$release.a $libname.a' + soname_spec='$libname$release$shared_ext$major' + # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling + postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' + postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' + ;; + esac shlibpath_var=LIBPATH fi ;; @@ -2310,18 +2491,18 @@ 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}' + 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' + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) - library_names_spec='${libname}${shared_ext}' + library_names_spec='$libname$shared_ext' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; @@ -2329,8 +2510,8 @@ 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' + 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" @@ -2342,7 +2523,7 @@ cygwin* | mingw* | pw32* | cegcc*) version_type=windows - shrext_cmds=".dll" + shrext_cmds=.dll need_version=no need_lib_prefix=no @@ -2351,8 +2532,8 @@ # 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'\''`~ + 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~ @@ -2368,17 +2549,17 @@ 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}' + 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}' + 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}' + 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' @@ -2387,8 +2568,8 @@ *,cl*) # Native MSVC libname_spec='$name' - soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' - library_names_spec='${libname}.dll.lib' + soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' + library_names_spec='$libname.dll.lib' case $build_os in mingw*) @@ -2415,7 +2596,7 @@ 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" + 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'` @@ -2428,8 +2609,8 @@ 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'\''`~ + 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' @@ -2442,7 +2623,7 @@ *) # Assume MSVC wrapper - library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' + library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac @@ -2455,8 +2636,8 @@ 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' + 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`' @@ -2469,8 +2650,8 @@ 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' + 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 ;; @@ -2488,12 +2669,13 @@ 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}' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' need_version=no need_lib_prefix=no ;; freebsd-*) - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' need_version=yes ;; esac @@ -2518,26 +2700,15 @@ esac ;; -gnu*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + 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 + shlibpath_overrides_runpath=no sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; @@ -2555,14 +2726,15 @@ 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 + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + if test 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' @@ -2570,8 +2742,8 @@ 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' + 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 ;; @@ -2580,8 +2752,8 @@ 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' + 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, ... @@ -2594,8 +2766,8 @@ 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' + 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 @@ -2606,7 +2778,7 @@ case $host_os in nonstopux*) version_type=nonstopux ;; *) - if test "$lt_cv_prog_gnu_ld" = yes; then + if test yes = "$lt_cv_prog_gnu_ld"; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix @@ -2614,8 +2786,8 @@ 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}' + 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= @@ -2634,8 +2806,8 @@ 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}" + 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 ;; @@ -2644,13 +2816,33 @@ dynamic_linker=no ;; +linux*android*) + version_type=none # Android doesn't support versioned libraries. + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext' + soname_spec='$libname$release$shared_ext' + finish_cmds= + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + dynamic_linker='Android linker' + # Don't embed -rpath directories since the linker doesn't support them. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + ;; + # This must be glibc/ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) +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' + 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 @@ -2675,14 +2867,15 @@ # before this can be enabled. hardcode_into_libs=yes - # Add ABI-specific directories to the system library path. - sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" - - # Append ld.so.conf contents to the search path + # Ideally, we could use ldconfig to report *all* directores which are + # searched for libraries, however this is still not possible. Aside from not + # being certain /sbin/ldconfig is available, command + # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, + # even though it is searched at run-time. Try to do the best guess by + # appending ld.so.conf contents (and includes) to the search path. if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` - sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" - + 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 @@ -2694,17 +2887,29 @@ 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' + 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' + 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 @@ -2714,7 +2919,7 @@ 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}' + 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 ;; @@ -2723,58 +2928,68 @@ 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' + 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*) +openbsd* | bitrig*) version_type=sunos - sys_lib_dlsearch_path_spec="/usr/lib" + 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 + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then + need_version=no else - shlibpath_overrides_runpath=yes + need_version=yes fi + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes ;; os2*) libname_spec='$name' - shrext_cmds=".dll" + version_type=windows + shrext_cmds=.dll + need_version=no need_lib_prefix=no - library_names_spec='$libname${shared_ext} $libname.a' + # OS/2 can only load a DLL with a base name of 8 characters or less. + soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; + v=$($ECHO $release$versuffix | tr -d .-); + n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); + $ECHO $n$v`$shared_ext' + library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' - shlibpath_var=LIBPATH + shlibpath_var=BEGINLIBPATH + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + 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" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; rdos*) @@ -2785,8 +3000,8 @@ 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' + 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 @@ -2796,11 +3011,11 @@ sunos4*) version_type=sunos - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + 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 + if test yes = "$with_gnu_ld"; then need_lib_prefix=no fi need_version=yes @@ -2808,8 +3023,8 @@ 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' + 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) @@ -2830,24 +3045,24 @@ ;; sysv4*MP*) - if test -d /usr/nec ;then + 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' + 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 + version_type=sco need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + 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 + if test yes = "$with_gnu_ld"; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' @@ -2865,7 +3080,7 @@ 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}' + 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 @@ -2873,8 +3088,8 @@ 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' + 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 ;; @@ -2883,20 +3098,30 @@ ;; esac AC_MSG_RESULT([$dynamic_linker]) -test "$dynamic_linker" = no && can_build_shared=no +test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -if test "$GCC" = yes; then +if test yes = "$GCC"; 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" +if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then + sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi -if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then - sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" + +if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then + sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi +# remember unaugmented sys_lib_dlsearch_path content for libtool script decls... +configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec + +# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code +func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" + +# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool +configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH + _LT_DECL([], [variables_saved_for_relink], [1], [Variables whose values should be saved in libtool wrapper scripts and restored at link time]) @@ -2929,39 +3154,41 @@ [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_DECL([sys_lib_dlsearch_path_spec], [configure_time_dlsearch_path], [2], + [Detected run-time system search path for libraries]) +_LT_DECL([], [configure_time_lt_sys_library_path], [2], + [Explicit LT_SYS_LIBRARY_PATH set during ./configure time]) ])# _LT_SYS_DYNAMIC_LINKER # _LT_PATH_TOOL_PREFIX(TOOL) # -------------------------- -# find a file program which can recognize shared library +# find a file program that can recognize shared library AC_DEFUN([_LT_PATH_TOOL_PREFIX], [m4_require([_LT_DECL_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + lt_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 + 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" + 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 -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" + 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 : @@ -2984,11 +3211,11 @@ break fi done - IFS="$lt_save_ifs" - MAGIC_CMD="$lt_save_MAGIC_CMD" + IFS=$lt_save_ifs + MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac]) -MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else @@ -3006,7 +3233,7 @@ # _LT_PATH_MAGIC # -------------- -# find a file program which can recognize a shared library +# find a file program that can recognize a shared library m4_defun([_LT_PATH_MAGIC], [_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then @@ -3033,16 +3260,16 @@ 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], + [test no = "$withval" || with_gnu_ld=yes], [with_gnu_ld=no])dnl ac_prog=ld -if test "$GCC" = yes; then +if test yes = "$GCC"; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) - # gcc leaves a trailing carriage return which upsets mingw + # 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` ;; @@ -3056,7 +3283,7 @@ 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" + test -z "$LD" && LD=$ac_prog ;; "") # If it fails, then pretend we aren't using GCC. @@ -3067,37 +3294,37 @@ with_gnu_ld=unknown ;; esac -elif test "$with_gnu_ld" = yes; then +elif test yes = "$with_gnu_ld"; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do - IFS="$lt_save_ifs" + 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" + 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 conftest.i +cat conftest.i conftest.i >conftest2.i +: ${lt_DD:=$DD} +AC_PATH_PROGS_FEATURE_CHECK([lt_DD], [dd], +[if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then + cmp -s conftest.i conftest.out \ + && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: +fi]) +rm -f conftest.i conftest2.i conftest.out]) +])# _LT_PATH_DD + + +# _LT_CMD_TRUNCATE +# ---------------- +# find command to truncate a binary pipe +m4_defun([_LT_CMD_TRUNCATE], +[m4_require([_LT_PATH_DD]) +AC_CACHE_CHECK([how to truncate binary pipes], [lt_cv_truncate_bin], +[printf 0123456789abcdef0123456789abcdef >conftest.i +cat conftest.i conftest.i >conftest2.i +lt_cv_truncate_bin= +if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then + cmp -s conftest.i conftest.out \ + && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" +fi +rm -f conftest.i conftest2.i conftest.out +test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"]) +_LT_DECL([lt_truncate_bin], [lt_cv_truncate_bin], [1], + [Command to truncate a binary pipe]) +])# _LT_CMD_TRUNCATE + + # _LT_CHECK_MAGIC_METHOD # ---------------------- # how to check for library dependencies @@ -3183,13 +3447,13 @@ # 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. +# '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. +# that responds to the $file_magic_cmd with a given extended regex. +# If you have 'file' or equivalent on your system and you're not sure +# whether 'pass_all' will *always* work, you probably want this one. case $host_os in aix[[4-9]]*) @@ -3216,8 +3480,7 @@ # 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 + if ( file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else @@ -3253,10 +3516,6 @@ fi ;; -gnu*) - lt_cv_deplibs_check_method=pass_all - ;; - haiku*) lt_cv_deplibs_check_method=pass_all ;; @@ -3295,11 +3554,11 @@ ;; # This must be glibc/ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; -netbsd*) +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 @@ -3317,8 +3576,8 @@ 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 +openbsd* | bitrig*) + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' @@ -3371,6 +3630,9 @@ tpf*) lt_cv_deplibs_check_method=pass_all ;; +os2*) + lt_cv_deplibs_check_method=pass_all + ;; esac ]) @@ -3411,33 +3673,38 @@ 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" + lt_cv_path_NM=$NM else - lt_nm_to_check="${ac_tool_prefix}nm" + 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 + 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" + 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 + 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: + # 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'*) + # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty + case $build_os in + mingw*) lt_bad_file=conftest.nm/nofile ;; + *) lt_bad_file=/dev/null ;; + esac + case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in + *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" - break + break 2 ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" - break + break 2 ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but @@ -3448,21 +3715,21 @@ esac fi done - IFS="$lt_save_ifs" + IFS=$lt_save_ifs done : ${lt_cv_path_NM=no} fi]) -if test "$lt_cv_path_NM" != "no"; then - NM="$lt_cv_path_NM" +if test no != "$lt_cv_path_NM"; then + NM=$lt_cv_path_NM else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) - case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in + case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in *COFF*) - DUMPBIN="$DUMPBIN -symbols" + DUMPBIN="$DUMPBIN -symbols -headers" ;; *) DUMPBIN=: @@ -3470,8 +3737,8 @@ esac fi AC_SUBST([DUMPBIN]) - if test "$DUMPBIN" != ":"; then - NM="$DUMPBIN" + if test : != "$DUMPBIN"; then + NM=$DUMPBIN fi fi test -z "$NM" && NM=nm @@ -3517,8 +3784,8 @@ 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 + # two different shell functions defined in ltmain.sh; + # decide which one to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib @@ -3530,7 +3797,7 @@ ;; *) # fallback: assume linklib IS sharedlib - lt_cv_sharedlib_from_linklib_cmd="$ECHO" + lt_cv_sharedlib_from_linklib_cmd=$ECHO ;; esac ]) @@ -3557,13 +3824,28 @@ lt_cv_path_mainfest_tool=yes fi rm -f conftest*]) -if test "x$lt_cv_path_mainfest_tool" != xyes; then +if test yes != "$lt_cv_path_mainfest_tool"; then MANIFEST_TOOL=: fi _LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl ])# _LT_PATH_MANIFEST_TOOL +# _LT_DLL_DEF_P([FILE]) +# --------------------- +# True iff FILE is a Windows DLL '.def' file. +# Keep in sync with func_dll_def_p in the libtool script +AC_DEFUN([_LT_DLL_DEF_P], +[dnl + test DEF = "`$SED -n dnl + -e '\''s/^[[ ]]*//'\'' dnl Strip leading whitespace + -e '\''/^\(;.*\)*$/d'\'' dnl Delete empty lines and comments + -e '\''s/^\(EXPORTS\|LIBRARY\)\([[ ]].*\)*$/DEF/p'\'' dnl + -e q dnl Only consider the first "real" line + $1`" dnl +])# _LT_DLL_DEF_P + + # LT_LIB_M # -------- # check for math library @@ -3575,11 +3857,11 @@ # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) - AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") + AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM=-lmw) AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) - AC_CHECK_LIB(m, cos, LIBM="-lm") + AC_CHECK_LIB(m, cos, LIBM=-lm) ;; esac AC_SUBST([LIBM]) @@ -3598,7 +3880,7 @@ _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= -if test "$GCC" = yes; then +if test yes = "$GCC"; then case $cc_basename in nvcc*) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; @@ -3650,7 +3932,7 @@ symcode='[[ABCDGISTW]]' ;; hpux*) - if test "$host_cpu" = ia64; then + if test ia64 = "$host_cpu"; then symcode='[[ABCDEGRST]]' fi ;; @@ -3683,14 +3965,44 @@ symcode='[[ABCDGIRSTW]]' ;; esac +if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Gets list of data symbols to import. + lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" + # Adjust the below global symbol transforms to fixup imported variables. + lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" + lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" + lt_c_name_lib_hook="\ + -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ + -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" +else + # Disable hooks by default. + lt_cv_sys_global_symbol_to_import= + lt_cdecl_hook= + lt_c_name_hook= + lt_c_name_lib_hook= +fi + # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. -lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" +lt_cv_sys_global_symbol_to_cdecl="sed -n"\ +$lt_cdecl_hook\ +" -e 's/^T .* \(.*\)$/extern int \1();/p'"\ +" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n -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'" +lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ +$lt_c_name_hook\ +" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ +" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" + +# Transform an extracted symbol line into symbol name with lib prefix and +# symbol address. +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ +$lt_c_name_lib_hook\ +" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ +" -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ +" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" # Handle CRLF in mingw tool chain opt_cr= @@ -3708,21 +4020,24 @@ # 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. + # Fake it for dumpbin and say T for any non-static function, + # D for any global variable and I for any imported variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ +" /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ +" /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ +" /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ -" {f=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))}"\ +" {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ +" {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ +" s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ +" s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx]" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" @@ -3762,11 +4077,11 @@ 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 +#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE +/* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT@&t@_DLSYM_CONST -#elif defined(__osf__) +#elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT@&t@_DLSYM_CONST #else @@ -3792,7 +4107,7 @@ { { "@PROGRAM@", (void *) 0 }, _LT_EOF - $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext + $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; @@ -3812,9 +4127,9 @@ mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS - LIBS="conftstm.$ac_objext" + 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 + if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS @@ -3835,7 +4150,7 @@ rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. - if test "$pipe_works" = yes; then + if test yes = "$pipe_works"; then break else lt_cv_sys_global_symbol_pipe= @@ -3862,12 +4177,16 @@ [Take the output of nm and produce a listing of raw symbols and C names]) _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], [Transform the output of nm in a proper C declaration]) +_LT_DECL([global_symbol_to_import], [lt_cv_sys_global_symbol_to_import], [1], + [Transform the output of nm into a list of symbols to manually relocate]) _LT_DECL([global_symbol_to_c_name_address], [lt_cv_sys_global_symbol_to_c_name_address], [1], [Transform the output of nm in a C name address pair]) _LT_DECL([global_symbol_to_c_name_address_lib_prefix], [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], [Transform the output of nm in a C name address pair when lib prefix is needed]) +_LT_DECL([nm_interface], [lt_cv_nm_interface], [1], + [The name lister interface]) _LT_DECL([], [nm_file_list_spec], [1], [Specify filename containing input files for $NM]) ]) # _LT_CMD_GLOBAL_SYMBOLS @@ -3883,17 +4202,18 @@ m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. - if test "$GXX" = yes; then + if test yes = "$GXX"; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. - if test "$host_cpu" = ia64; then + if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; amigaos*) @@ -3904,8 +4224,8 @@ ;; 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'. + # 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 @@ -3921,6 +4241,11 @@ # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + case $host_os in + os2*) + _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' + ;; + esac ;; darwin* | rhapsody*) # PIC is the default on this platform @@ -3970,7 +4295,7 @@ case $host_os in aix[[4-9]]*) # All AIX code is PIC. - if test "$host_cpu" = ia64; then + if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else @@ -4011,14 +4336,14 @@ 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_static, $1)='$wl-a ${wl}archive' + if test ia64 != "$host_cpu"; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default @@ -4047,7 +4372,7 @@ ;; esac ;; - linux* | k*bsd*-gnu | kopensolaris*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # KAI C++ Compiler @@ -4055,7 +4380,7 @@ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; ecpc* ) - # old Intel C++ for x86_64 which still supported -KPIC. + # 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' @@ -4111,7 +4436,7 @@ ;; esac ;; - netbsd*) + netbsd* | netbsdelf*-gnu) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise @@ -4200,17 +4525,18 @@ fi ], [ - if test "$GCC" = yes; then + if test yes = "$GCC"; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. - if test "$host_cpu" = ia64; then + if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; amigaos*) @@ -4221,8 +4547,8 @@ ;; 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'. + # 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 @@ -4239,6 +4565,11 @@ # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + case $host_os in + os2*) + _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' + ;; + esac ;; darwin* | rhapsody*) @@ -4309,7 +4640,7 @@ case $host_os in aix*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - if test "$host_cpu" = ia64; then + if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else @@ -4317,11 +4648,30 @@ fi ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + case $cc_basename in + nagfor*) + # NAG Fortran compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + esac + ;; + mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + case $host_os in + os2*) + _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' + ;; + esac ;; hpux9* | hpux10* | hpux11*) @@ -4337,7 +4687,7 @@ ;; 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' + _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) @@ -4346,9 +4696,9 @@ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; - linux* | k*bsd*-gnu | kopensolaris*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in - # old Intel for x86_64 which still supported -KPIC. + # 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' @@ -4373,6 +4723,12 @@ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; + tcc*) + # Fabrice Bellard et al's Tiny C Compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) @@ -4470,7 +4826,7 @@ ;; sysv4*MP*) - if test -d /usr/nec ;then + if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi @@ -4499,7 +4855,7 @@ fi ]) case $host_os in - # For platforms which do not support PIC, -DPIC is meaningless: + # For platforms that do not support PIC, -DPIC is meaningless: *djgpp*) _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; @@ -4565,17 +4921,21 @@ 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". + # -C means demangle to GNU nm, but means don't demangle to AIX nm. + # Without the "-l" option, or with the "-B" option, AIX nm treats + # weak defined symbols like other global defined symbols, whereas + # GNU nm marks them as "W". + # While the 'weak' keyword is ignored in the Export File, we need + # it in the Import File for the 'aix-soname' feature, so we have + # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else - _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi ;; pw32*) - _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" + _LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds ;; cygwin* | mingw* | cegcc*) case $cc_basename in @@ -4588,6 +4948,9 @@ ;; 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' ;; @@ -4621,9 +4984,9 @@ # 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'. + # 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 @@ -4639,7 +5002,7 @@ # 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 + if test yes != "$GCC"; then with_gnu_ld=no fi ;; @@ -4647,9 +5010,12 @@ # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; - openbsd*) + openbsd* | bitrig*) with_gnu_ld=no ;; + linux* | k*bsd*-gnu | gnu*) + _LT_TAGVAR(link_all_deplibs, $1)=no + ;; esac _LT_TAGVAR(ld_shlibs, $1)=yes @@ -4657,7 +5023,7 @@ # 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 + if test yes = "$with_gnu_ld"; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility @@ -4679,24 +5045,24 @@ esac fi - if test "$lt_use_gnu_ld_interface" = yes; then + if test yes = "$lt_use_gnu_ld_interface"; then # If archive_cmds runs LD, not CC, wlarc should be empty - wlarc='${wl}' + 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' + _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' + _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 + case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... @@ -4709,7 +5075,7 @@ case $host_os in aix[[3-9]]*) # On AIX/PPC, the GNU linker is very broken - if test "$host_cpu" != ia64; then + if test ia64 != "$host_cpu"; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 @@ -4728,7 +5094,7 @@ 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_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) @@ -4744,7 +5110,7 @@ _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' + _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 @@ -4754,7 +5120,7 @@ # _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(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 @@ -4762,61 +5128,89 @@ _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' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file, use it as + # is; otherwise, prepend EXPORTS... + _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; haiku*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; + os2*) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + shrext_cmds=.dll + _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + prefix_cmds="$SED"~ + if test EXPORTS = "`$SED 1q $export_symbols`"; then + prefix_cmds="$prefix_cmds -e 1d"; + fi~ + prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ + cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + ;; + interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _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' + _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 + if test linux-dietlibc = "$host_os"; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ - && test "$tmp_diet" = no + && test no = "$tmp_diet" then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + _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' + _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' ;; @@ -4827,42 +5221,47 @@ lf95*) # Lahey Fortran 8.1 _LT_TAGVAR(whole_archive_flag_spec, $1)= tmp_sharedflag='--shared' ;; + nagfor*) # NAGFOR 5.3 + tmp_sharedflag='-Wl,-shared' ;; xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(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(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' + _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 + if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi case $cc_basename in + tcc*) + _LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic' + ;; xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(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 + if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + 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 @@ -4871,13 +5270,13 @@ fi ;; - netbsd*) + 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' + _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 ;; @@ -4895,8 +5294,8 @@ _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' + _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 @@ -4908,7 +5307,7 @@ _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 +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify @@ -4923,9 +5322,9 @@ # 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' + _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 @@ -4942,15 +5341,15 @@ *) 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' + _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 + if test no = "$_LT_TAGVAR(ld_shlibs, $1)"; then runpath_var= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= @@ -4966,7 +5365,7 @@ # 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 + if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_TAGVAR(hardcode_direct, $1)=unsupported @@ -4974,34 +5373,57 @@ ;; aix[[4-9]]*) - if test "$host_cpu" = ia64; then + if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' - no_entry_flag="" + 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". + # -C means demangle to GNU nm, but means don't demangle to AIX nm. + # Without the "-l" option, or with the "-B" option, AIX nm treats + # weak defined symbols like other global defined symbols, whereas + # GNU nm marks them as "W". + # While the 'weak' keyword is ignored in the Export File, we need + # it in the Import File for the 'aix-soname' feature, so we have + # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else - _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. + # have runtime linking enabled, and use it for executables. + # For shared libraries, we enable/disable runtime linking + # depending on the kind of the shared library created - + # when "with_aix_soname,aix_use_runtimelinking" is: + # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables + # "aix,yes" lib.so shared, rtl:yes, for executables + # lib.a static archive + # "both,no" lib.so.V(shr.o) shared, rtl:yes + # lib.a(lib.so.V) shared, rtl:no, for executables + # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a(lib.so.V) shared, rtl:no + # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a static archive case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do - if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then aix_use_runtimelinking=yes break fi done + if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then + # With aix-soname=svr4, we create the lib.so.V shared archives only, + # so we don't have lib.a shared libs to link our executables. + # We have to force runtime linking in this case. + aix_use_runtimelinking=yes + LDFLAGS="$LDFLAGS -Wl,-brtl" + fi ;; esac @@ -5020,13 +5442,21 @@ _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,' + _LT_TAGVAR(file_list_spec, $1)='$wl-f,' + case $with_aix_soname,$aix_use_runtimelinking in + aix,*) ;; # traditional, no import file + svr4,* | *,yes) # use import file + # The Import File defines what to hardcode. + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=no + ;; + esac - if test "$GCC" = yes; then + if test yes = "$GCC"; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` + collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then @@ -5045,61 +5475,80 @@ ;; esac shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' + if test yes = "$aix_use_runtimelinking"; then + shared_flag="$shared_flag "'$wl-G' fi + # Need to ensure runtime linking is disabled for the traditional + # shared library, or the linker may eventually find shared libraries + # /with/ Import File - we do not want to mix them. + shared_flag_aix='-shared' + shared_flag_svr4='-shared $wl-G' else # not using gcc - if test "$host_cpu" = ia64; then + if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else - if test "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' + if test yes = "$aix_use_runtimelinking"; then + shared_flag='$wl-G' else - shared_flag='${wl}-bM:SRE' + shared_flag='$wl-bM:SRE' fi + shared_flag_aix='$wl-bM:SRE' + shared_flag_svr4='$wl-G' fi fi - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' + _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 + if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else - if test "$host_cpu" = ia64; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + if test ia64 = "$host_cpu"; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" - _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + _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" + _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 + _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok' + _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok' + if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + _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' + _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' + # -brtl affects multiple linker settings, -berok does not and is overridden later + compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`' + if test svr4 != "$with_aix_soname"; then + # This is similar to how AIX traditionally builds its shared libraries. + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' + fi + if test aix != "$with_aix_soname"; then + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' + else + # used by -dlpreopen to get the symbols + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir' + fi + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d' fi fi ;; @@ -5108,7 +5557,7 @@ 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_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) @@ -5138,16 +5587,17 @@ # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" + 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=' + _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' + _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then + cp "$export_symbols" "$output_objdir/$soname.def"; + echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; + else + $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes @@ -5156,18 +5606,18 @@ # 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' + 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 @@ -5176,7 +5626,7 @@ # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" + 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. @@ -5226,33 +5676,33 @@ ;; 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' + if test yes = "$GCC"; then + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' fi - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_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' + _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' + if test yes,no = "$GCC,$with_gnu_ld"; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi - if test "$with_gnu_ld" = no; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + if test no = "$with_gnu_ld"; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _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 @@ -5260,25 +5710,25 @@ ;; hpux11*) - if test "$GCC" = yes && test "$with_gnu_ld" = no; then + if test yes,no = "$GCC,$with_gnu_ld"; then case $host_cpu in hppa*64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + _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+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' + _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' + _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' + _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) m4_if($1, [], [ @@ -5286,14 +5736,14 @@ # (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)='$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']) + [_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' + if test no = "$with_gnu_ld"; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in @@ -5304,7 +5754,7 @@ *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _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. @@ -5315,16 +5765,16 @@ ;; 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' + if test yes = "$GCC"; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], [lt_cv_irix_exported_symbol], - [save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" + [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; }]], @@ -5337,22 +5787,33 @@ 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' + LDFLAGS=$save_LDFLAGS]) + if test yes = "$lt_cv_irix_exported_symbol"; then + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' fi + _LT_TAGVAR(link_all_deplibs, $1)=no 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' + _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_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*) + linux*) + case $cc_basename in + tcc*) + # Fabrice Bellard et al's Tiny C Compiler + _LT_TAGVAR(ld_shlibs, $1)=yes + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + netbsd* | 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 @@ -5366,7 +5827,7 @@ 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_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; @@ -5374,27 +5835,19 @@ *nto* | *qnx*) ;; - openbsd*) + openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _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 + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' fi else _LT_TAGVAR(ld_shlibs, $1)=no @@ -5405,33 +5858,53 @@ _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' + shrext_cmds=.dll + _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + prefix_cmds="$SED"~ + if test EXPORTS = "`$SED 1q $export_symbols`"; then + prefix_cmds="$prefix_cmds -e 1d"; + fi~ + prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ + cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; osf3*) - if test "$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' + if test yes = "$GCC"; then + _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _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_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' + if test yes = "$GCC"; then + _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_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' + $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' @@ -5442,24 +5915,24 @@ 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' + if test yes = "$GCC"; then + wlarc='$wl' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + $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_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' + $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' + 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' + $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi @@ -5469,11 +5942,11 @@ 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 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' + if test yes = "$GCC"; then + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' else _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' fi @@ -5483,10 +5956,10 @@ ;; sunos4*) - if test "x$host_vendor" = xsequent; then + if test sequent = "$host_vendor"; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. - _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + _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 @@ -5535,43 +6008,43 @@ ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) - _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _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' + if test yes = "$GCC"; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else - _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _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 + # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. - _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' - _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' + _LT_TAGVAR(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_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' + _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' + if test yes = "$GCC"; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else - _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _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 ;; @@ -5586,17 +6059,17 @@ ;; esac - if test x$host_vendor = xsni; then + if test sni = "$host_vendor"; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym' + _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 +test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld @@ -5613,7 +6086,7 @@ # Assume -lc should be added _LT_TAGVAR(archive_cmds_need_lc, $1)=yes - if test "$enable_shared" = yes && test "$GCC" = yes; then + if test yes,yes = "$GCC,$enable_shared"; then case $_LT_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. @@ -5693,12 +6166,12 @@ _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 + [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 + [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 + "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 @@ -5739,10 +6212,10 @@ # ------------------------ # 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'. +# the compiler configuration to 'libtool'. m4_defun([_LT_LANG_C_CONFIG], [m4_require([_LT_DECL_EGREP])dnl -lt_save_CC="$CC" +lt_save_CC=$CC AC_LANG_PUSH(C) # Source file extension for C test sources. @@ -5782,18 +6255,18 @@ LT_SYS_DLOPEN_SELF _LT_CMD_STRIPLIB - # Report which library types will actually be built + # Report what library types will actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) - test "$can_build_shared" = "no" && enable_shared=no + test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) - test "$enable_shared" = yes && enable_static=no + test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' @@ -5801,8 +6274,12 @@ ;; aix[[4-9]]*) - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then - test "$enable_shared" = yes && enable_static=no + if test ia64 != "$host_cpu"; then + case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in + yes,aix,yes) ;; # shared object as lib.so file only + yes,svr4,*) ;; # shared object as lib.so archive member only + yes,*) enable_static=no ;; # shared object in lib.a archive as well + esac fi ;; esac @@ -5810,13 +6287,13 @@ 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 + test yes = "$enable_shared" || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_CONFIG($1) fi AC_LANG_POP -CC="$lt_save_CC" +CC=$lt_save_CC ])# _LT_LANG_C_CONFIG @@ -5824,14 +6301,14 @@ # -------------------------- # 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'. +# 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 +if test -n "$CXX" && ( test no != "$CXX" && + ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) || + (test g++ != "$CXX"))); then AC_PROG_CXXCPP else _lt_caught_CXX_error=yes @@ -5873,7 +6350,7 @@ # 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 +if test yes != "$_lt_caught_CXX_error"; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" @@ -5915,35 +6392,35 @@ 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 + if test yes = "$GXX"; then _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi - if test "$GXX" = yes; then + if test yes = "$GXX"; then # Set up default GNU C++ configuration LT_PATH_LD # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. - if test "$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' + if test yes = "$with_gnu_ld"; then + _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _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}' + 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' + _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi @@ -5979,18 +6456,30 @@ _LT_TAGVAR(ld_shlibs, $1)=no ;; aix[[4-9]]*) - if test "$host_cpu" = ia64; then + if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' - no_entry_flag="" + 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. + # have runtime linking enabled, and use it for executables. + # For shared libraries, we enable/disable runtime linking + # depending on the kind of the shared library created - + # when "with_aix_soname,aix_use_runtimelinking" is: + # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables + # "aix,yes" lib.so shared, rtl:yes, for executables + # lib.a static archive + # "both,no" lib.so.V(shr.o) shared, rtl:yes + # lib.a(lib.so.V) shared, rtl:no, for executables + # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a(lib.so.V) shared, rtl:no + # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a static archive case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do case $ld_flag in @@ -6000,6 +6489,13 @@ ;; esac done + if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then + # With aix-soname=svr4, we create the lib.so.V shared archives only, + # so we don't have lib.a shared libs to link our executables. + # We have to force runtime linking in this case. + aix_use_runtimelinking=yes + LDFLAGS="$LDFLAGS -Wl,-brtl" + fi ;; esac @@ -6018,13 +6514,21 @@ _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,' + _LT_TAGVAR(file_list_spec, $1)='$wl-f,' + case $with_aix_soname,$aix_use_runtimelinking in + aix,*) ;; # no import file + svr4,* | *,yes) # use import file + # The Import File defines what to hardcode. + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=no + ;; + esac - if test "$GXX" = yes; then + if test yes = "$GXX"; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` + collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then @@ -6042,64 +6546,84 @@ fi esac shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' + if test yes = "$aix_use_runtimelinking"; then + shared_flag=$shared_flag' $wl-G' fi + # Need to ensure runtime linking is disabled for the traditional + # shared library, or the linker may eventually find shared libraries + # /with/ Import File - we do not want to mix them. + shared_flag_aix='-shared' + shared_flag_svr4='-shared $wl-G' else # not using gcc - if test "$host_cpu" = ia64; then + if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else - if test "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' + if test yes = "$aix_use_runtimelinking"; then + shared_flag='$wl-G' else - shared_flag='${wl}-bM:SRE' + shared_flag='$wl-bM:SRE' fi + shared_flag_aix='$wl-bM:SRE' + shared_flag_svr4='$wl-G' fi fi - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' + _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 + if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. - _LT_TAGVAR(allow_undefined_flag, $1)='-berok' + # The "-G" linker flag allows undefined symbols. + _LT_TAGVAR(no_undefined_flag, $1)='-bernotok' # Determine the default libpath from the value encoded in an empty # executable. _LT_SYS_MODULE_PATH_AIX([$1]) - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + _LT_TAGVAR(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" + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else - if test "$host_cpu" = ia64; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + if test ia64 = "$host_cpu"; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" - _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + _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" + _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 + _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok' + _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok' + if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + _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' + _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' + # -brtl affects multiple linker settings, -berok does not and is overridden later + compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`' + if test svr4 != "$with_aix_soname"; then + # This is similar to how AIX traditionally builds its shared + # libraries. Need -bnortl late, we may have -brtl in LDFLAGS. + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' + fi + if test aix != "$with_aix_soname"; then + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' + else + # used by -dlpreopen to get the symbols + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir' + fi + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d' fi fi ;; @@ -6109,7 +6633,7 @@ _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' + _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 @@ -6137,57 +6661,58 @@ # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" + 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=' + _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' + _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then + cp "$export_symbols" "$output_objdir/$soname.def"; + echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; + else + $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ - lt_tool_outputfile="@TOOL_OUTPUT@"~ - case $lt_outputfile in - *.exe|*.EXE) ;; - *) - lt_outputfile="$lt_outputfile.exe" - lt_tool_outputfile="$lt_tool_outputfile.exe" - ;; - esac~ - func_to_tool_file "$lt_outputfile"~ - if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then - $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; - $RM "$lt_outputfile.manifest"; - fi' + 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(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' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file, use it as + # is; otherwise, prepend EXPORTS... + _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi @@ -6198,6 +6723,34 @@ _LT_DARWIN_LINKER_FEATURES($1) ;; + os2*) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + shrext_cmds=.dll + _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + prefix_cmds="$SED"~ + if test EXPORTS = "`$SED 1q $export_symbols`"; then + prefix_cmds="$prefix_cmds -e 1d"; + fi~ + prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ + cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + ;; + dgux*) case $cc_basename in ec++*) @@ -6232,18 +6785,15 @@ _LT_TAGVAR(ld_shlibs, $1)=yes ;; - gnu*) - ;; - haiku*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(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_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _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 @@ -6255,7 +6805,7 @@ _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' + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. @@ -6264,11 +6814,11 @@ # 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"' + 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' + if test yes = "$GXX"; then + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no @@ -6278,15 +6828,15 @@ ;; hpux10*|hpux11*) - if test $with_gnu_ld = no; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + if test no = "$with_gnu_ld"; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) ;; *) - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' ;; esac fi @@ -6312,13 +6862,13 @@ 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' + _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+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' + _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 @@ -6329,20 +6879,20 @@ # 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"' + 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 + if test yes = "$GXX"; then + if test no = "$with_gnu_ld"; then case $host_cpu in hppa*64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _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+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' + _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 @@ -6357,22 +6907,22 @@ 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' + _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' + _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' + _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 @@ -6381,22 +6931,22 @@ _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' + if test yes = "$GXX"; then + if test no = "$with_gnu_ld"; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' + _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_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) + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler @@ -6404,8 +6954,8 @@ # 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' + _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. @@ -6414,10 +6964,10 @@ # 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"' + 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' + _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. @@ -6431,59 +6981,59 @@ # 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' + _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' + _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' + _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`"' + 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' + 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' + 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' + 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' + _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' + _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' + _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' @@ -6497,18 +7047,18 @@ # 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' + 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(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' + _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + 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 ;; *) @@ -6516,10 +7066,10 @@ *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(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(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 @@ -6577,22 +7127,17 @@ _LT_TAGVAR(ld_shlibs, $1)=yes ;; - openbsd2*) - # C++ shared libraries are fairly broken - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - - openbsd*) + openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || 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' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' + _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else @@ -6608,9 +7153,9 @@ # 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_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_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using @@ -6628,17 +7173,17 @@ 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)=' $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_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' + 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 @@ -6653,21 +7198,21 @@ # 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"' + 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}\*' + if test yes,no = "$GXX,$with_gnu_ld"; then + _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' case $host in osf3*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -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' + _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_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists @@ -6713,9 +7258,9 @@ # 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_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' + $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 @@ -6723,7 +7268,7 @@ solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, - # but understands `-z linker_flag'. + # 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' ;; @@ -6740,30 +7285,30 @@ ;; 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' + _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 test yes,no = "$GXX,$with_gnu_ld"; then + _LT_TAGVAR(no_undefined_flag, $1)=' $wl-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else - # g++ 2.7 appears to require `-G' NOT `-shared' on this + # 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_cmds, $1)='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when @@ -6771,11 +7316,11 @@ 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' + _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' + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' ;; esac fi @@ -6784,52 +7329,52 @@ ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) - _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _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 -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' + _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 + # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. - _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' - _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' + _LT_TAGVAR(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_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' + _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(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(old_archive_cmds, $1)" _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ - '"$_LT_TAGVAR(reload_cmds, $1)" + '"$_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' + _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 ;; @@ -6860,10 +7405,10 @@ esac AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) - test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no + test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no - _LT_TAGVAR(GCC, $1)="$GXX" - _LT_TAGVAR(LD, $1)="$LD" + _LT_TAGVAR(GCC, $1)=$GXX + _LT_TAGVAR(LD, $1)=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change @@ -6890,7 +7435,7 @@ 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 +fi # test yes != "$_lt_caught_CXX_error" AC_LANG_POP ])# _LT_LANG_CXX_CONFIG @@ -6912,13 +7457,14 @@ 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}\$%%"`;; + case @S|@2 in + .*) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%\\\\@S|@2\$%%"`;; + *) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%@S|@2\$%%"`;; esac } # func_stripname_cnf ])# _LT_FUNC_STRIPNAME_CNF + # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) # --------------------------------- # Figure out "hidden" library dependencies from verbose @@ -7002,13 +7548,13 @@ pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do - case ${prev}${p} in + 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 + if test x-L = "$p" || + test x-R = "$p"; then prev=$p continue fi @@ -7024,16 +7570,16 @@ 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 + if test no = "$pre_test_object_deps_done"; then + case $prev in -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then - _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" + _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}" + _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 @@ -7041,9 +7587,9 @@ esac else if test -z "$_LT_TAGVAR(postdeps, $1)"; then - _LT_TAGVAR(postdeps, $1)="${prev}${p}" + _LT_TAGVAR(postdeps, $1)=$prev$p else - _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" + _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} $prev$p" fi fi prev= @@ -7058,15 +7604,15 @@ continue fi - if test "$pre_test_object_deps_done" = no; then + if test no = "$pre_test_object_deps_done"; then if test -z "$_LT_TAGVAR(predep_objects, $1)"; then - _LT_TAGVAR(predep_objects, $1)="$p" + _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" + _LT_TAGVAR(postdep_objects, $1)=$p else _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" fi @@ -7097,51 +7643,6 @@ _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 ]) @@ -7150,7 +7651,7 @@ 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!^ !!'` + _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]) @@ -7170,10 +7671,10 @@ # -------------------------- # 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'. +# 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 +if test -z "$F77" || test no = "$F77"; then _lt_disable_F77=yes fi @@ -7210,7 +7711,7 @@ # 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 +if test yes != "$_lt_disable_F77"; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t @@ -7232,7 +7733,7 @@ _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. - lt_save_CC="$CC" + lt_save_CC=$CC lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${F77-"f77"} @@ -7246,21 +7747,25 @@ AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) - test "$can_build_shared" = "no" && enable_shared=no + test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) - test "$enable_shared" = yes && enable_static=no + test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then - test "$enable_shared" = yes && enable_static=no + if test ia64 != "$host_cpu"; then + case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in + yes,aix,yes) ;; # shared object as lib.so file only + yes,svr4,*) ;; # shared object as lib.so archive member only + yes,*) enable_static=no ;; # shared object in lib.a archive as well + esac fi ;; esac @@ -7268,11 +7773,11 @@ 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 + test yes = "$enable_shared" || enable_static=yes AC_MSG_RESULT([$enable_static]) - _LT_TAGVAR(GCC, $1)="$G77" - _LT_TAGVAR(LD, $1)="$LD" + _LT_TAGVAR(GCC, $1)=$G77 + _LT_TAGVAR(LD, $1)=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change @@ -7289,9 +7794,9 @@ fi # test -n "$compiler" GCC=$lt_save_GCC - CC="$lt_save_CC" - CFLAGS="$lt_save_CFLAGS" -fi # test "$_lt_disable_F77" != yes + CC=$lt_save_CC + CFLAGS=$lt_save_CFLAGS +fi # test yes != "$_lt_disable_F77" AC_LANG_POP ])# _LT_LANG_F77_CONFIG @@ -7301,11 +7806,11 @@ # ------------------------- # 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'. +# 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 +if test -z "$FC" || test no = "$FC"; then _lt_disable_FC=yes fi @@ -7342,7 +7847,7 @@ # 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 +if test yes != "$_lt_disable_FC"; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t @@ -7364,7 +7869,7 @@ _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. - lt_save_CC="$CC" + lt_save_CC=$CC lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${FC-"f95"} @@ -7380,21 +7885,25 @@ AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) - test "$can_build_shared" = "no" && enable_shared=no + test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) - test "$enable_shared" = yes && enable_static=no + test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then - test "$enable_shared" = yes && enable_static=no + if test ia64 != "$host_cpu"; then + case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in + yes,aix,yes) ;; # shared object as lib.so file only + yes,svr4,*) ;; # shared object as lib.so archive member only + yes,*) enable_static=no ;; # shared object in lib.a archive as well + esac fi ;; esac @@ -7402,11 +7911,11 @@ 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 + test yes = "$enable_shared" || enable_static=yes AC_MSG_RESULT([$enable_static]) - _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu" - _LT_TAGVAR(LD, $1)="$LD" + _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 @@ -7426,7 +7935,7 @@ GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS -fi # test "$_lt_disable_FC" != yes +fi # test yes != "$_lt_disable_FC" AC_LANG_POP ])# _LT_LANG_FC_CONFIG @@ -7436,7 +7945,7 @@ # -------------------------- # 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'. +# to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_GCJ_CONFIG], [AC_REQUIRE([LT_PROG_GCJ])dnl AC_LANG_SAVE @@ -7470,7 +7979,7 @@ CFLAGS=$GCJFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC -_LT_TAGVAR(LD, $1)="$LD" +_LT_TAGVAR(LD, $1)=$LD _LT_CC_BASENAME([$compiler]) # GCJ did not exist at the time GCC didn't implicitly link libc in. @@ -7507,7 +8016,7 @@ # -------------------------- # 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'. +# to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_GO_CONFIG], [AC_REQUIRE([LT_PROG_GO])dnl AC_LANG_SAVE @@ -7541,7 +8050,7 @@ CFLAGS=$GOFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC -_LT_TAGVAR(LD, $1)="$LD" +_LT_TAGVAR(LD, $1)=$LD _LT_CC_BASENAME([$compiler]) # Go did not exist at the time GCC didn't implicitly link libc in. @@ -7578,7 +8087,7 @@ # ------------------------- # 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'. +# to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_RC_CONFIG], [AC_REQUIRE([LT_PROG_RC])dnl AC_LANG_SAVE @@ -7594,7 +8103,7 @@ 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" +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 @@ -7604,7 +8113,7 @@ _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. -lt_save_CC="$CC" +lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC= @@ -7633,7 +8142,7 @@ [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" + test set = "${GCJFLAGS+set}" || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS)])])[]dnl ]) @@ -7744,7 +8253,7 @@ # 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 + test ! -f "$lt_ac_sed" && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in @@ -7761,9 +8270,9 @@ $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 + test 10 -lt "$lt_ac_count" && break lt_ac_count=`expr $lt_ac_count + 1` - if test $lt_ac_count -gt $lt_ac_max; then + if test "$lt_ac_count" -gt "$lt_ac_max"; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi @@ -7787,27 +8296,7 @@ # 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 +[if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false @@ -7831,102 +8320,9 @@ ])# _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 +# Determine what file name conversion functions should be used by # func_to_host_file (and, implicitly, by func_to_host_path). These are needed # for certain cross-compile configurations and native mingw. m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], diff -Nru intel-gpu-tools-1.13/m4/lt~obsolete.m4 intel-gpu-tools-1.15/m4/lt~obsolete.m4 --- intel-gpu-tools-1.13/m4/lt~obsolete.m4 2015-09-11 15:13:10.000000000 +0000 +++ intel-gpu-tools-1.15/m4/lt~obsolete.m4 2016-05-31 17:03:08.000000000 +0000 @@ -1,6 +1,7 @@ # lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # -# Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc. +# Copyright (C) 2004-2005, 2007, 2009, 2011-2015 Free Software +# Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file is free software; the Free Software Foundation gives @@ -11,7 +12,7 @@ # These exist entirely to fool aclocal when bootstrapping libtool. # -# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) +# 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. # @@ -25,7 +26,7 @@ # 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. +# 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 diff -Nru intel-gpu-tools-1.13/m4/ltoptions.m4 intel-gpu-tools-1.15/m4/ltoptions.m4 --- intel-gpu-tools-1.13/m4/ltoptions.m4 2015-09-11 15:13:10.000000000 +0000 +++ intel-gpu-tools-1.15/m4/ltoptions.m4 2016-05-31 17:03:08.000000000 +0000 @@ -1,14 +1,14 @@ # Helper functions for option handling. -*- Autoconf -*- # -# Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# Copyright (C) 2004-2005, 2007-2009, 2011-2015 Free Software +# Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. -# serial 7 ltoptions.m4 +# serial 8 ltoptions.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) @@ -29,7 +29,7 @@ [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 + [m4_warning([Unknown $1 option '$2'])])[]dnl ]) @@ -75,13 +75,15 @@ 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 '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_ENABLE_FAST_INSTALL]) + _LT_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4], + [_LT_WITH_AIX_SONAME([aix])]) ]) ])# _LT_SET_OPTIONS @@ -112,7 +114,7 @@ [_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.]) +put the 'dlopen' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: @@ -148,7 +150,7 @@ _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.]) +put the 'win32-dll' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: @@ -157,9 +159,9 @@ # _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'. +# 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], @@ -172,14 +174,14 @@ *) enable_shared=no # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do - IFS="$lt_save_ifs" + IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_shared=yes fi done - IFS="$lt_save_ifs" + IFS=$lt_save_ifs ;; esac], [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) @@ -211,9 +213,9 @@ # _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'. +# 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], @@ -226,14 +228,14 @@ *) enable_static=no # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do - IFS="$lt_save_ifs" + IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_static=yes fi done - IFS="$lt_save_ifs" + IFS=$lt_save_ifs ;; esac], [enable_static=]_LT_ENABLE_STATIC_DEFAULT) @@ -265,9 +267,9 @@ # _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'. +# 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], @@ -280,14 +282,14 @@ *) 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," + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do - IFS="$lt_save_ifs" + IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done - IFS="$lt_save_ifs" + IFS=$lt_save_ifs ;; esac], [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) @@ -304,14 +306,14 @@ [_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.]) +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.]) +the 'disable-fast-install' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: @@ -319,11 +321,64 @@ dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) +# _LT_WITH_AIX_SONAME([DEFAULT]) +# ---------------------------------- +# implement the --with-aix-soname flag, and support the `aix-soname=aix' +# and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT +# is either `aix', `both' or `svr4'. If omitted, it defaults to `aix'. +m4_define([_LT_WITH_AIX_SONAME], +[m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl +shared_archive_member_spec= +case $host,$enable_shared in +power*-*-aix[[5-9]]*,yes) + AC_MSG_CHECKING([which variant of shared library versioning to provide]) + AC_ARG_WITH([aix-soname], + [AS_HELP_STRING([--with-aix-soname=aix|svr4|both], + [shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])], + [case $withval in + aix|svr4|both) + ;; + *) + AC_MSG_ERROR([Unknown argument to --with-aix-soname]) + ;; + esac + lt_cv_with_aix_soname=$with_aix_soname], + [AC_CACHE_VAL([lt_cv_with_aix_soname], + [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT) + with_aix_soname=$lt_cv_with_aix_soname]) + AC_MSG_RESULT([$with_aix_soname]) + if test aix != "$with_aix_soname"; then + # For the AIX way of multilib, we name the shared archive member + # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', + # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. + # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, + # the AIX toolchain works better with OBJECT_MODE set (default 32). + if test 64 = "${OBJECT_MODE-32}"; then + shared_archive_member_spec=shr_64 + else + shared_archive_member_spec=shr + fi + fi + ;; +*) + with_aix_soname=aix + ;; +esac + +_LT_DECL([], [shared_archive_member_spec], [0], + [Shared archive member basename, for filename based shared library versioning on AIX])dnl +])# _LT_WITH_AIX_SONAME + +LT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])]) +LT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])]) +LT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])]) + + # _LT_WITH_PIC([MODE]) # -------------------- -# implement the --with-pic flag, and support the `pic-only' and `no-pic' +# 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'. +# 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@:>@], @@ -334,19 +389,17 @@ *) pic_mode=default # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for lt_pkg in $withval; do - IFS="$lt_save_ifs" + IFS=$lt_save_ifs if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done - IFS="$lt_save_ifs" + IFS=$lt_save_ifs ;; esac], - [pic_mode=default]) - -test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) + [pic_mode=m4_default([$1], [default])]) _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl ])# _LT_WITH_PIC @@ -359,7 +412,7 @@ [_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.]) +put the 'pic-only' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: diff -Nru intel-gpu-tools-1.13/m4/ltsugar.m4 intel-gpu-tools-1.15/m4/ltsugar.m4 --- intel-gpu-tools-1.13/m4/ltsugar.m4 2015-09-11 15:13:10.000000000 +0000 +++ intel-gpu-tools-1.15/m4/ltsugar.m4 2016-05-31 17:03:08.000000000 +0000 @@ -1,6 +1,7 @@ # ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # -# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. +# Copyright (C) 2004-2005, 2007-2008, 2011-2015 Free Software +# Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives @@ -33,7 +34,7 @@ # ------------ # Manipulate m4 lists. # These macros are necessary as long as will still need to support -# Autoconf-2.59 which quotes differently. +# 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])], @@ -44,7 +45,7 @@ # lt_append(MACRO-NAME, STRING, [SEPARATOR]) # ------------------------------------------ -# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. +# 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 diff -Nru intel-gpu-tools-1.13/m4/ltversion.m4 intel-gpu-tools-1.15/m4/ltversion.m4 --- intel-gpu-tools-1.13/m4/ltversion.m4 2015-09-11 15:13:10.000000000 +0000 +++ intel-gpu-tools-1.15/m4/ltversion.m4 2016-05-31 17:03:08.000000000 +0000 @@ -1,6 +1,6 @@ # ltversion.m4 -- version numbers -*- Autoconf -*- # -# Copyright (C) 2004 Free Software Foundation, Inc. +# Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004 # # This file is free software; the Free Software Foundation gives @@ -9,15 +9,15 @@ # @configure_input@ -# serial 3337 ltversion.m4 +# serial 4179 ltversion.m4 # This file is part of GNU Libtool -m4_define([LT_PACKAGE_VERSION], [2.4.2]) -m4_define([LT_PACKAGE_REVISION], [1.3337]) +m4_define([LT_PACKAGE_VERSION], [2.4.6]) +m4_define([LT_PACKAGE_REVISION], [2.4.6]) AC_DEFUN([LTVERSION_VERSION], -[macro_version='2.4.2' -macro_revision='1.3337' +[macro_version='2.4.6' +macro_revision='2.4.6' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) diff -Nru intel-gpu-tools-1.13/Makefile.am intel-gpu-tools-1.15/Makefile.am --- intel-gpu-tools-1.13/Makefile.am 2015-08-17 15:40:31.000000000 +0000 +++ intel-gpu-tools-1.15/Makefile.am 2016-05-23 10:51:28.000000000 +0000 @@ -21,8 +21,13 @@ ACLOCAL_AMFLAGS = ${ACLOCAL_FLAGS} -I m4 -SUBDIRS = lib man tools scripts benchmarks demos overlay +SUBDIRS = lib man tools scripts benchmarks +if BUILD_TESTS +SUBDIRS += tests +endif + +if BUILD_X86 if BUILD_ASSEMBLER SUBDIRS += assembler endif @@ -31,8 +36,7 @@ SUBDIRS += debugger endif -if BUILD_TESTS -SUBDIRS += tests +SUBDIRS += overlay demos benchmarks endif SUBDIRS += docs diff -Nru intel-gpu-tools-1.13/Makefile.in intel-gpu-tools-1.15/Makefile.in --- intel-gpu-tools-1.13/Makefile.in 2015-12-02 16:47:58.000000000 +0000 +++ intel-gpu-tools-1.15/Makefile.in 2016-05-31 17:03:32.000000000 +0000 @@ -108,9 +108,11 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -@BUILD_ASSEMBLER_TRUE@am__append_1 = assembler -@BUILD_SHADER_DEBUGGER_TRUE@am__append_2 = debugger -@BUILD_TESTS_TRUE@am__append_3 = tests +target_triplet = @target@ +@BUILD_TESTS_TRUE@am__append_1 = tests +@BUILD_ASSEMBLER_TRUE@@BUILD_X86_TRUE@am__append_2 = assembler +@BUILD_SHADER_DEBUGGER_TRUE@@BUILD_X86_TRUE@am__append_3 = debugger +@BUILD_X86_TRUE@am__append_4 = overlay demos benchmarks subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/as-compiler-flag.m4 \ @@ -184,8 +186,8 @@ ETAGS = etags CTAGS = ctags CSCOPE = cscope -DIST_SUBDIRS = lib man tools scripts benchmarks demos overlay \ - assembler debugger tests docs +DIST_SUBDIRS = lib man tools scripts benchmarks tests assembler \ + debugger overlay demos docs am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \ $(top_srcdir)/build-aux/compile \ $(top_srcdir)/build-aux/config.guess \ @@ -273,6 +275,8 @@ DRM_LIBS = @DRM_LIBS@ DRM_NOUVEAU_CFLAGS = @DRM_NOUVEAU_CFLAGS@ DRM_NOUVEAU_LIBS = @DRM_NOUVEAU_LIBS@ +DRM_VC4_CFLAGS = @DRM_VC4_CFLAGS@ +DRM_VC4_LIBS = @DRM_VC4_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -317,6 +321,7 @@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MAN_SUBSTS = @MAN_SUBSTS@ @@ -361,6 +366,7 @@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ THREAD_CFLAGS = @THREAD_CFLAGS@ +TIMER_LIBS = @TIMER_LIBS@ VERSION = @VERSION@ XORG_MAN_PAGE = @XORG_MAN_PAGE@ XRANDR_CFLAGS = @XRANDR_CFLAGS@ @@ -415,17 +421,22 @@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ +target = @target@ target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ ACLOCAL_AMFLAGS = ${ACLOCAL_FLAGS} -I m4 -SUBDIRS = lib man tools scripts benchmarks demos overlay \ - $(am__append_1) $(am__append_2) $(am__append_3) docs +SUBDIRS = lib man tools scripts benchmarks $(am__append_1) \ + $(am__append_2) $(am__append_3) $(am__append_4) docs MAINTAINERCLEANFILES = ChangeLog INSTALL all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive diff -Nru intel-gpu-tools-1.13/man/intel_aubdump.man intel-gpu-tools-1.15/man/intel_aubdump.man --- intel-gpu-tools-1.13/man/intel_aubdump.man 2015-11-12 17:30:48.000000000 +0000 +++ intel-gpu-tools-1.15/man/intel_aubdump.man 1970-01-01 00:00:00.000000000 +0000 @@ -1,38 +0,0 @@ -.\" shorthand for double quote that works everywhere. -.ds q \N'34' -.TH intel_aubdump __appmansuffix__ __xorgversion__ -.SH NAME -intel_aubdump \- Launch an application and capture rendering to an AUB file -.SH SYNOPSIS -.B intel_aubdump [\fIOPTION\fR]... \fI--\fR \fICOMMAND\fR [\fIARGUMENTS\fR] -.SH DESCRIPTION -.PP -Run -.IR COMMAND -with -.IR ARGUMENTS -and dump an AUB file that captures buffer -contents and execution of the i915 GEM application. -.TP -.B \-v -Enable verbose mode. -.TP -.B \-\^\-help -Output a usage message and exit. -.TP -.BI \-o " FILE" "\fR,\fP \-\^\-output=" FILE -Write the trace output to the file -.IR FILE . -Default is -.IR COMMAND .aub. -.TP -.BI \-\^\-device= ID -Override the PCI ID of the drm device. This is useful for getting an -aub dump for a different generation of GPU. In this mode intel_aubdump -will intercept but not forward the execbuffer2 ioctl, as that would -typically cause a GPU hang. -.SH EXAMPLES -.TP -intel_aubdump -v --output=stuff.aub -- glxgears -geometry 500x500 -Launches glxgears with its -geometry option and enables aub dumping -with the -v and --output=stuff.aub options. diff -Nru intel-gpu-tools-1.13/man/intel_aubdump.rst intel-gpu-tools-1.15/man/intel_aubdump.rst --- intel-gpu-tools-1.13/man/intel_aubdump.rst 1970-01-01 00:00:00.000000000 +0000 +++ intel-gpu-tools-1.15/man/intel_aubdump.rst 2016-05-23 10:51:28.000000000 +0000 @@ -0,0 +1,55 @@ +============= +intel_aubdump +============= + +----------------------------------------------------- +Launch an application and capture rendering to an AUB +----------------------------------------------------- +.. include:: defs.rst +:Author: Intel Graphics for Linux +:Date: 2016-03-01 +:Version: |PACKAGE_STRING| +:Copyright: 2015-2016 Intel Corporation +:Manual section: |MANUAL_SECTION| +:Manual group: |MANUAL_GROUP| + +SYNOPSIS +======== + +**intel_aubdump** [*OPTIONS*] -- *COMMAND* [*ARGUMENTS*] + +DESCRIPTION +=========== + +Run COMMAND with ARGUMENTS and dump an AUB file that captures buffer contents +and execution of the i915 GEM application. + +OPTIONS +======= + +-v + Enable verbose mode. + +--help + Output a usage message and exit. + +-o FILE, --output=FILE + Write the trace output to the file FILE. Default is COMMAND.aub. + +--device=ID + Override the PCI ID of the drm device. This is useful for getting an aub + dump for a different generation of GPU. In this mode **intel_aubdump** will + intercept but not forward the execbuffer2 ioctl, as that would typically + cause a GPU hang. + +EXAMPLES +======== + +intel_aubdump -v --output=stuff.aub -- glxgears -geometry 500x500 + Launches glxgears with its -geometry option and enables aub dumping with + the -v and --output=stuff.aub options. + +REPORTING BUGS +============== + +Report bugs to https://bugs.freedesktop.org. diff -Nru intel-gpu-tools-1.13/man/intel_audio_dump.man intel-gpu-tools-1.15/man/intel_audio_dump.man --- intel-gpu-tools-1.13/man/intel_audio_dump.man 2015-08-06 15:22:11.000000000 +0000 +++ intel-gpu-tools-1.15/man/intel_audio_dump.man 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ -.\" 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. diff -Nru intel-gpu-tools-1.13/man/intel_audio_dump.rst intel-gpu-tools-1.15/man/intel_audio_dump.rst --- intel-gpu-tools-1.13/man/intel_audio_dump.rst 1970-01-01 00:00:00.000000000 +0000 +++ intel-gpu-tools-1.15/man/intel_audio_dump.rst 2016-05-23 10:51:28.000000000 +0000 @@ -0,0 +1,30 @@ +================ +intel_audio_dump +================ + +------------------------------------------------- +Dump the Intel GPU registers for HDMI audio setup +------------------------------------------------- +.. include:: defs.rst +:Author: Intel Graphics for Linux +:Date: 2016-03-01 +:Version: |PACKAGE_STRING| +:Copyright: 2010,2012,2016 Intel Corporation +:Manual section: |MANUAL_SECTION| +:Manual group: |MANUAL_GROUP| + +SYNOPSIS +======== + +**intel_audio_dump** + +DESCRIPTION +=========== + +**intel_audio_dump** dumps and decodes registers containing the configuration of +HDMI audio handling on Intel GPUs. + +REPORTING BUGS +============== + +Report bugs to https://bugs.freedesktop.org. diff -Nru intel-gpu-tools-1.13/man/intel_bios_dumper.man intel-gpu-tools-1.15/man/intel_bios_dumper.man --- intel-gpu-tools-1.13/man/intel_bios_dumper.man 2015-08-06 15:22:11.000000000 +0000 +++ intel-gpu-tools-1.15/man/intel_bios_dumper.man 1970-01-01 00:00:00.000000000 +0000 @@ -1,14 +0,0 @@ -.\" 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) diff -Nru intel-gpu-tools-1.13/man/intel_bios_dumper.rst intel-gpu-tools-1.15/man/intel_bios_dumper.rst --- intel-gpu-tools-1.13/man/intel_bios_dumper.rst 1970-01-01 00:00:00.000000000 +0000 +++ intel-gpu-tools-1.15/man/intel_bios_dumper.rst 2016-05-23 10:51:28.000000000 +0000 @@ -0,0 +1,36 @@ +================= +intel_bios_dumper +================= + +-------------------------------------------- +Save the Intel video BIOS contents to a file +-------------------------------------------- +.. include:: defs.rst +:Author: Intel Graphics for Linux +:Date: 2016-03-01 +:Version: |PACKAGE_STRING| +:Copyright: 2010,2012,2016 Intel Corporation +:Manual section: |MANUAL_SECTION| +:Manual group: |MANUAL_GROUP| + +SYNOPSIS +======== + +**intel_bios_dumper** *FILENAME* + +DESCRIPTION +=========== + +**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. + +REPORTING BUGS +============== + +Report bugs to https://bugs.freedesktop.org. + +SEE ALSO +======== + +**intel_bios_reader(1)** diff -Nru intel-gpu-tools-1.13/man/intel_bios_reader.man intel-gpu-tools-1.15/man/intel_bios_reader.man --- intel-gpu-tools-1.13/man/intel_bios_reader.man 2015-08-06 15:22:11.000000000 +0000 +++ intel-gpu-tools-1.15/man/intel_bios_reader.man 1970-01-01 00:00:00.000000000 +0000 @@ -1,15 +0,0 @@ -.\" 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) diff -Nru intel-gpu-tools-1.13/man/intel_bios_reader.rst intel-gpu-tools-1.15/man/intel_bios_reader.rst --- intel-gpu-tools-1.13/man/intel_bios_reader.rst 1970-01-01 00:00:00.000000000 +0000 +++ intel-gpu-tools-1.15/man/intel_bios_reader.rst 2016-05-23 10:51:28.000000000 +0000 @@ -0,0 +1,69 @@ +================= +intel_bios_reader +================= + +----------------------------- +Intel Video BIOS Table parser +----------------------------- +.. include:: defs.rst +:Author: Intel Graphics for Linux +:Date: 2016-03-01 +:Version: |PACKAGE_STRING| +:Copyright: 2010,2012,2016 Intel Corporation +:Manual section: |MANUAL_SECTION| +:Manual group: |MANUAL_GROUP| + +SYNOPSIS +======== + +**intel_bios_reader** [*OPTIONS*] + +DESCRIPTION +=========== + +**intel_bios_reader** is a tool to parse the Intel Video BIOS Tables (VBT) and +present the information in a human readable format. + +The preferred ways of getting the binary VBT to parse are: + +1) /sys/kernel/debug/dri/0/i915_vbt (since kernel version 4.5) + +2) /sys/kernel/debug/dri/0/i915_opregion + +3) Using the **intel_bios_dumper(1)** tool. + +The VBT consists of a VBT header, a BIOS Data Block (BDB) header, and a number +of BIOS Data Blocks. + +OPTIONS +======= + +--file=FILE + Parse Video BIOS Tables from FILE. + +--devid=DEVID + Pretend to be PCI ID DEVID. Some details can be parsed more accurately if + the platform is known. + +--panel-type=N + Parse the details for flat panel N. Usually this is retrieved from the Video + BIOS Tables, but this can be used to override. + +--all-panels + Parse the details for all flat panels present in the Video BIOS Tables. + +--hexdump + Hex dump the blocks. + +--block=N + Dump only the BIOS Data Block number N. + +REPORTING BUGS +============== + +Report bugs to https://bugs.freedesktop.org. + +SEE ALSO +======== + +**intel_bios_dumper(1)** diff -Nru intel-gpu-tools-1.13/man/intel_error_decode.man intel-gpu-tools-1.15/man/intel_error_decode.man --- intel-gpu-tools-1.13/man/intel_error_decode.man 2015-08-06 15:22:11.000000000 +0000 +++ intel-gpu-tools-1.15/man/intel_error_decode.man 1970-01-01 00:00:00.000000000 +0000 @@ -1,20 +0,0 @@ -.\" 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. diff -Nru intel-gpu-tools-1.13/man/intel_error_decode.rst intel-gpu-tools-1.15/man/intel_error_decode.rst --- intel-gpu-tools-1.13/man/intel_error_decode.rst 1970-01-01 00:00:00.000000000 +0000 +++ intel-gpu-tools-1.15/man/intel_error_decode.rst 2016-05-23 10:51:28.000000000 +0000 @@ -0,0 +1,38 @@ +================== +intel_error_decode +================== + +------------------------------------------------------------------------------------- +Decode an Intel GPU dump automatically captured by the kernel at the time of an error +------------------------------------------------------------------------------------- +.. include:: defs.rst +:Author: Intel Graphics for Linux +:Date: 2016-03-01 +:Version: |PACKAGE_STRING| +:Copyright: 2010,2012,2016 Intel Corporation +:Manual section: |MANUAL_SECTION| +:Manual group: |MANUAL_GROUP| + +SYNOPSIS +======== + +**intel_error_decode** [*FILENAME*] + +DESCRIPTION +=========== + +**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. + +ARGUMENTS +========= + +FILENAME + Decodes a previously saved error. + +REPORTING BUGS +============== + +Report bugs to https://bugs.freedesktop.org. diff -Nru intel-gpu-tools-1.13/man/intel_gpu_frequency.man intel-gpu-tools-1.15/man/intel_gpu_frequency.man --- intel-gpu-tools-1.13/man/intel_gpu_frequency.man 2015-11-12 17:30:48.000000000 +0000 +++ intel-gpu-tools-1.15/man/intel_gpu_frequency.man 1970-01-01 00:00:00.000000000 +0000 @@ -1,58 +0,0 @@ -.TH INTEL_FREQUENCY: "1" "January 2015" "intel_gpu_frequency" "User Commands" -.SH NAME -intel_gpu_frequency: \- manual page for intel_gpu_frequency -.SH SYNOPSIS -.B intel_gpu_frequency -[\fI\,-e\/\fR] [\fI\,--min | --max\/\fR] [\fI\,-g\/\fR] [\fI\,-s frequency_mhz\/\fR] -.SH DESCRIPTION -\&A program to manipulate Intel GPU frequencies. Intel GPUs -will automatically throttle the frequencies based on system demands, up when -needed, down when not. This tool should only be used for debugging performance -problems, or trying to get a stable frequency while benchmarking. - -Intel GPUs only accept specific frequencies. The tool may, or may not attempt to -adjust requests to the proper frequency if they aren't correct. This may lead to -non-obvious failures when setting frequency. Multiples of 50MHz is usually a -safe bet. -.SH OPTIONS -.TP -\fB\-e\fR -Lock frequency to the most efficient frequency -.TP -\fB\-g\fR, \fB\-\-get\fR -Get all the current frequency settings -.TP -\fB\-s\fR, \fB\-\-set\fR -Lock frequency to an absolute value (MHz) -.TP -\fB\-c\fR, \fB\-\-custom\fR -Set a min, or max frequency "min=X | max=Y" -.TP -\fB\-m\fR \fB\-\-max\fR -Lock frequency to max frequency -.TP -\fB\-i\fR \fB\-\-min\fR -Lock frequency to min (never a good idea, DEBUG ONLY) -.TP -\fB\-d\fR \fB\-\-defaults\fR -Return the system to hardware defaults -.TP -\fB\-h\fR \fB\-\-help\fR -Returns this -.HP -\fB\-v\fR \fB\-\-version\fR Version -.SH EXAMPLES -.TP -\fbintel_gpu_frequency \-gmin,cur\fR -Get the current and minimum frequency -.TP -\fbintel_gpu_frequency \-s 400\fR -Lock frequency to 400Mhz -.TP -\fbintel_gpu_frequency \-c max=750\fR -Set the max frequency to 750MHz -.PP -.SH "REPORTING BUGS" -Report bugs to https://bugs.freedesktop.org -.SH COPYRIGHT -Copyright (C) 2015 Intel Corporation diff -Nru intel-gpu-tools-1.13/man/intel_gpu_frequency.rst intel-gpu-tools-1.15/man/intel_gpu_frequency.rst --- intel-gpu-tools-1.13/man/intel_gpu_frequency.rst 1970-01-01 00:00:00.000000000 +0000 +++ intel-gpu-tools-1.15/man/intel_gpu_frequency.rst 2016-05-23 10:51:28.000000000 +0000 @@ -0,0 +1,79 @@ +=================== +intel_gpu_frequency +=================== + +-------------------------------- +Manipulate Intel GPU frequencies +-------------------------------- +.. include:: defs.rst +:Author: Intel Graphics for Linux +:Date: 2016-03-01 +:Version: |PACKAGE_STRING| +:Copyright: 2015-2016 Intel Corporation +:Manual section: |MANUAL_SECTION| +:Manual group: |MANUAL_GROUP| + +SYNOPSIS +======== + +**intel_gpu_frequency** [*OPTIONS*] + +DESCRIPTION +=========== + +A program to manipulate Intel GPU frequencies. Intel GPUs will automatically +throttle the frequencies based on system demands, up when needed, down when +not. This tool should only be used for debugging performance problems, or trying +to get a stable frequency while benchmarking. + +Intel GPUs only accept specific frequencies. The tool may, or may not attempt to +adjust requests to the proper frequency if they aren't correct. This may lead to +non-obvious failures when setting frequency. Multiples of 50MHz is usually a +safe bet. + +OPTIONS +======= + +-e + Lock frequency to the most efficient frequency. + +-g, --get + Get all the current frequency settings. + +-s FREQUENCY, --set=FREQUENCY + Lock frequency to an absolute value (MHz). + +-c, --custom + Set a min, or max frequency "min=X | max=Y". + +-m, --max + Lock frequency to max frequency. + +-i, --min + Lock frequency to min (never a good idea, DEBUG ONLY). + +-d, --defaults + Return the system to hardware defaults. + +-h, --help + Show help. + +-v, --version + Show version. + +EXAMPLES +======== + +intel_gpu_frequency -gmin,cur + Get the current and minimum frequency. + +intel_gpu_frequency -s 400 + Lock frequency to 400Mhz. + +intel_gpu_frequency -c max=750 + Set the max frequency to 750MHz + +REPORTING BUGS +============== + +Report bugs to https://bugs.freedesktop.org. diff -Nru intel-gpu-tools-1.13/man/intel_gpu_top.man intel-gpu-tools-1.15/man/intel_gpu_top.man --- intel-gpu-tools-1.13/man/intel_gpu_top.man 2015-08-06 15:22:11.000000000 +0000 +++ intel-gpu-tools-1.15/man/intel_gpu_top.man 1970-01-01 00:00:00.000000000 +0000 @@ -1,41 +0,0 @@ -.\" 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. diff -Nru intel-gpu-tools-1.13/man/intel_gpu_top.rst intel-gpu-tools-1.15/man/intel_gpu_top.rst --- intel-gpu-tools-1.13/man/intel_gpu_top.rst 1970-01-01 00:00:00.000000000 +0000 +++ intel-gpu-tools-1.15/man/intel_gpu_top.rst 2016-05-23 10:51:28.000000000 +0000 @@ -0,0 +1,64 @@ +============= +intel_gpu_top +============= + +--------------------------------------------- +Display a top-like summary of Intel GPU usage +--------------------------------------------- +.. include:: defs.rst +:Author: Intel Graphics for Linux +:Date: 2016-03-01 +:Version: |PACKAGE_STRING| +:Copyright: 2009,2011,2012,2016 Intel Corporation +:Manual section: |MANUAL_SECTION| +:Manual group: |MANUAL_GROUP| + +SYNOPSIS +======== + +**intel_gpu_top** [*OPTIONS*] + +DESCRIPTION +=========== + +**intel_gpu_top** is a tool to display usage information of an Intel GPU. It +requires root privilege to map the graphics device. + +OPTIONS +======= + +-s SAMPLES + Number of samples to acquire per second. + +-o FILE + Collect usage statistics to FILE. If file is "-", run non-interactively + and output statistics to stdout. + +-e COMMAND + Execute COMMAND to profile, and leave when it is finished. Note that the + entire command with all parameters should be included as one parameter. + +-h + Show usage notes. + +EXAMPLES +======== + +intel_gpu_top -o "cairo-trace-gvim.log" -s 100 -e "cairo-perf-trace /tmp/gvim" + 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. + +Note that idle units are not displayed, so an entirely idle GPU will only +display the ring status and header. + +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. + +REPORTING BUGS +============== + +Report bugs to https://bugs.freedesktop.org. diff -Nru intel-gpu-tools-1.13/man/intel_gtt.man intel-gpu-tools-1.15/man/intel_gtt.man --- intel-gpu-tools-1.13/man/intel_gtt.man 2015-08-06 15:22:11.000000000 +0000 +++ intel-gpu-tools-1.15/man/intel_gtt.man 1970-01-01 00:00:00.000000000 +0000 @@ -1,14 +0,0 @@ -.\" 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. diff -Nru intel-gpu-tools-1.13/man/intel_gtt.rst intel-gpu-tools-1.15/man/intel_gtt.rst --- intel-gpu-tools-1.13/man/intel_gtt.rst 1970-01-01 00:00:00.000000000 +0000 +++ intel-gpu-tools-1.15/man/intel_gtt.rst 2016-05-23 10:51:28.000000000 +0000 @@ -0,0 +1,32 @@ +========= +intel_gtt +========= + +--------------------------------------- +Dump the contents of an Intel GPU's GTT +--------------------------------------- +.. include:: defs.rst +:Author: Intel Graphics for Linux +:Date: 2016-03-01 +:Version: |PACKAGE_STRING| +:Copyright: 2010,2012,2016 Intel Corporation +:Manual section: |MANUAL_SECTION| +:Manual group: |MANUAL_GROUP| + +SYNOPSIS +======== + +**intel_gtt** + +DESCRIPTION +=========== + +**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. + +REPORTING BUGS +============== + +Report bugs to https://bugs.freedesktop.org. diff -Nru intel-gpu-tools-1.13/man/intel_infoframes.man intel-gpu-tools-1.15/man/intel_infoframes.man --- intel-gpu-tools-1.13/man/intel_infoframes.man 2015-08-06 15:22:11.000000000 +0000 +++ intel-gpu-tools-1.15/man/intel_infoframes.man 1970-01-01 00:00:00.000000000 +0000 @@ -1,26 +0,0 @@ -.\" 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. diff -Nru intel-gpu-tools-1.13/man/intel_infoframes.rst intel-gpu-tools-1.15/man/intel_infoframes.rst --- intel-gpu-tools-1.13/man/intel_infoframes.rst 1970-01-01 00:00:00.000000000 +0000 +++ intel-gpu-tools-1.15/man/intel_infoframes.rst 2016-05-23 10:51:28.000000000 +0000 @@ -0,0 +1,51 @@ +================ +intel_infoframes +================ + +------------------------------- +View and change HDMI InfoFrames +------------------------------- +.. include:: defs.rst +:Author: Intel Graphics for Linux +:Date: 2016-03-01 +:Version: |PACKAGE_STRING| +:Copyright: 2012,2016 Intel Corporation +:Manual section: |MANUAL_SECTION| +:Manual group: |MANUAL_GROUP| + +SYNOPSIS +======== + +**intel_infoframes** [*OPTIONS*] + +DESCRIPTION +=========== + +**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. + +OPTIONS +======= + +-h, --help + Display comprehensive help on the tool. + +LIMITATIONS +=========== + +Not all HDMI monitors respect the InfoFrames sent to them. Only GEN 4 or newer +hardware is supported yet. + +REPORTING BUGS +============== + +Report bugs to https://bugs.freedesktop.org. + +SEE ALSO +======== + +HDMI specification, CEA-861 specification. diff -Nru intel-gpu-tools-1.13/man/intel_lid.man intel-gpu-tools-1.15/man/intel_lid.man --- intel-gpu-tools-1.13/man/intel_lid.man 2015-08-06 15:22:11.000000000 +0000 +++ intel-gpu-tools-1.15/man/intel_lid.man 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -.\" shorthand for double quote that works everywhere. -.ds q \N'34' -.TH intel_lid __appmansuffix__ __xorgversion__ -.SH NAME -intel_lid \- 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. diff -Nru intel-gpu-tools-1.13/man/intel_lid.rst intel-gpu-tools-1.15/man/intel_lid.rst --- intel-gpu-tools-1.13/man/intel_lid.rst 1970-01-01 00:00:00.000000000 +0000 +++ intel-gpu-tools-1.15/man/intel_lid.rst 2016-05-23 10:51:28.000000000 +0000 @@ -0,0 +1,31 @@ +========= +intel_lid +========= + +----------------------------------------------------------- +Poll the values of different reports about laptop lid state +----------------------------------------------------------- +.. include:: defs.rst +:Author: Intel Graphics for Linux +:Date: 2016-03-01 +:Version: |PACKAGE_STRING| +:Copyright: 2010,2012-2013,2016 Intel Corporation +:Manual section: |MANUAL_SECTION| +:Manual group: |MANUAL_GROUP| + +SYNOPSIS +======== + +**intel_lid** + +DESCRIPTION +=========== + +**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. + +REPORTING BUGS +============== + +Report bugs to https://bugs.freedesktop.org. diff -Nru intel-gpu-tools-1.13/man/intel_panel_fitter.man intel-gpu-tools-1.15/man/intel_panel_fitter.man --- intel-gpu-tools-1.13/man/intel_panel_fitter.man 2015-08-06 15:22:11.000000000 +0000 +++ intel-gpu-tools-1.15/man/intel_panel_fitter.man 1970-01-01 00:00:00.000000000 +0000 @@ -1,50 +0,0 @@ -.\" 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. diff -Nru intel-gpu-tools-1.13/man/intel_panel_fitter.rst intel-gpu-tools-1.15/man/intel_panel_fitter.rst --- intel-gpu-tools-1.13/man/intel_panel_fitter.rst 1970-01-01 00:00:00.000000000 +0000 +++ intel-gpu-tools-1.15/man/intel_panel_fitter.rst 2016-05-23 10:51:28.000000000 +0000 @@ -0,0 +1,77 @@ +================== +intel_panel_fitter +================== + +-------------------------------- +Change the panel fitter settings +-------------------------------- +.. include:: defs.rst +:Author: Intel Graphics for Linux +:Date: 2016-03-01 +:Version: |PACKAGE_STRING| +:Copyright: 2012,2016 Intel Corporation +:Manual section: |MANUAL_SECTION| +:Manual group: |MANUAL_GROUP| + +SYNOPSIS +======== + +**intel_panel_fitter** [*OPTIONS*] + +DESCRIPTION +=========== + +**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. + +OPTIONS +======= + +-p PIPE + Pipe to be used (A, B or C, but C is only present on Ivy Bridge and newer). + +-x WIDTH + Final screen width size in pixels (needs -p option). + +-y HEIGHT + Final screen height size in pixels (needs -p option). + +-d + Disable panel fitter (needs -p option, ignores -x and -y options). + +-l + List current state of each pipe. + +-h + Print the help message. + +EXAMPLES +======== + +intel_panel_fitter -l + List the current status of each pipe, so you can decide what to do. + +intel_panel_fitter -p A -x 1850 -y 1040 + Change the pipe A size to 1850x1040 pixels. + +intel_panel_fitter -p A -d + Disable the panel fitter for pipe A. + +NOTES +===== + +In the future, there will be support for this feature inside the Linux Kernel. + +LIMITATIONS +=========== + +Machines older than Ironlake are still not supported, but support may be +possible to implement. + +REPORTING BUGS +============== + +Report bugs to https://bugs.freedesktop.org. diff -Nru intel-gpu-tools-1.13/man/intel_reg.rst intel-gpu-tools-1.15/man/intel_reg.rst --- intel-gpu-tools-1.13/man/intel_reg.rst 2015-11-12 17:30:48.000000000 +0000 +++ intel-gpu-tools-1.15/man/intel_reg.rst 2016-05-23 10:51:28.000000000 +0000 @@ -5,18 +5,18 @@ --------------------------------- Intel graphics register multitool --------------------------------- - +.. include:: defs.rst :Author: Jani Nikula -:Date: 2015-04-14 -:Version: intel-gpu-tools -:Copyright: 2015 Intel Corporation -:Manual section: 1 -:Manual group: General Commands Manual +:Date: 2016-03-01 +:Version: |PACKAGE_STRING| +:Copyright: 2015-2016 Intel Corporation +:Manual section: |MANUAL_SECTION| +:Manual group: |MANUAL_GROUP| SYNOPSIS ======== -**intel_reg** [*option* ...] *command* +**intel_reg** [*OPTIONS*] *COMMAND* DESCRIPTION =========== @@ -30,50 +30,33 @@ Some options are global, and some specific to commands. --verbose ---------- - -Increase verbosity. + Increase verbosity. --quiet -------- - -Decrease verbosity. + Decrease verbosity. --count=N ---------- - -Read N registers. + Read N registers. --binary --------- - -Output binary values. + Output binary values. --all ------ - -Decode registers for all known platforms. + Decode registers for all known platforms. --mmio=FILE ------------ - -Use MMIO bar from FILE. + Use MMIO bar from FILE. --devid=DEVID -------------- - -Pretend to be PCI ID DEVID. Useful with MMIO bar snapshots from other machines. + Pretend to be PCI ID DEVID. Useful with MMIO bar snapshots from other + machines. --spec=PATH ------------ - -Read register spec from directory or file specified by PATH; see REGISTER SPEC -DEFINITIONS below for details. + Read register spec from directory or file specified by PATH; see REGISTER + SPEC DEFINITIONS below for details. --help ------- - -Show brief help. + Show brief help. COMMANDS ======== @@ -123,52 +106,42 @@ Registers are defined as [(PORTNAME|PORTNUM|MMIO-OFFSET):](REGNAME|REGADDR). PORTNAME --------- - -The register access method, most often MMIO, which is the default. The methods -supported on all platforms are "mmio", "portio-vga", and "mmio-vga". + The register access method, most often MMIO, which is the default. The + methods supported on all platforms are "mmio", "portio-vga", and "mmio-vga". -On BYT and CHV, the sideband ports "bunit", "punit", "nc", "dpio", "gpio-nc", -"cck", "ccu", "dpio2", and "flisdsi" are also supported. + On BYT and CHV, the sideband ports "bunit", "punit", "nc", "dpio", + "gpio-nc", "cck", "ccu", "dpio2", and "flisdsi" are also supported. PORTNUM -------- + Port number for the sideband ports supported on BYT and CHV. Only numbers + mapped to the supported ports are allowed, arbitrary numbers are not + accepted. -Port number for the sideband ports supported on BYT and CHV. Only numbers mapped -to the supported ports are allowed, arbitrary numbers are not accepted. - -Numbers above 0xff are automatically interpreted as MMIO offsets, not port -numbers. + Numbers above 0xff are automatically interpreted as MMIO offsets, not port + numbers. MMIO-OFFSET ------------ - -Use MMIO, and add this offset to the register address. + Use MMIO, and add this offset to the register address. -Numbers equal to or below 0xff are automatically interpreted as port numbers, -not MMIO offsets. + Numbers equal to or below 0xff are automatically interpreted as port + numbers, not MMIO offsets. REGNAME -------- + Name of the register as defined in the register spec. -Name of the register as defined in the register spec. - -If MMIO offset is not specified, it is picked up from the register -spec. However, ports are not; the port is a namespace for the register names. + If MMIO offset is not specified, it is picked up from the register + spec. However, ports are not; the port is a namespace for the register + names. REGADDR -------- - -Register address. The corresponding register name need not be specified in the -register spec. + Register address. The corresponding register name need not be specified in + the register spec. ENVIRONMENT =========== INTEL_REG_SPEC --------------- - -Path to a directory or a file containing register spec definitions. + Path to a directory or a file containing register spec definitions. REGISTER SPEC DEFINITIONS ========================= @@ -226,3 +199,8 @@ ==== Reading some registers may hang the GPU or the machine. + +REPORTING BUGS +============== + +Report bugs to https://bugs.freedesktop.org. diff -Nru intel-gpu-tools-1.13/man/intel_stepping.man intel-gpu-tools-1.15/man/intel_stepping.man --- intel-gpu-tools-1.13/man/intel_stepping.man 2015-08-06 15:22:11.000000000 +0000 +++ intel-gpu-tools-1.15/man/intel_stepping.man 1970-01-01 00:00:00.000000000 +0000 @@ -1,15 +0,0 @@ -.\" 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. diff -Nru intel-gpu-tools-1.13/man/intel_stepping.rst intel-gpu-tools-1.15/man/intel_stepping.rst --- intel-gpu-tools-1.13/man/intel_stepping.rst 1970-01-01 00:00:00.000000000 +0000 +++ intel-gpu-tools-1.15/man/intel_stepping.rst 2016-05-23 10:51:28.000000000 +0000 @@ -0,0 +1,37 @@ +============== +intel_stepping +============== + +------------------------------------------------- +Display the stepping information for an Intel GPU +------------------------------------------------- +.. include:: defs.rst +:Author: Intel Graphics for Linux +:Date: 2016-03-01 +:Version: |PACKAGE_STRING| +:Copyright: 2009,2012,2016 Intel Corporation +:Manual section: |MANUAL_SECTION| +:Manual group: |MANUAL_GROUP| + +SYNOPSIS +======== + +**intel_stepping** + +DESCRIPTION +=========== + +**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. + +BUGS +==== + +Not all the known stepping IDs or chipsets are included, so the output on some +devices may not be as specific as possible. + +REPORTING BUGS +============== + +Report bugs to https://bugs.freedesktop.org. diff -Nru intel-gpu-tools-1.13/man/intel_upload_blit_large_gtt.man intel-gpu-tools-1.15/man/intel_upload_blit_large_gtt.man --- intel-gpu-tools-1.13/man/intel_upload_blit_large_gtt.man 2015-08-06 15:22:11.000000000 +0000 +++ intel-gpu-tools-1.15/man/intel_upload_blit_large_gtt.man 1970-01-01 00:00:00.000000000 +0000 @@ -1,18 +0,0 @@ -.\" 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. diff -Nru intel-gpu-tools-1.13/man/intel_upload_blit_large_gtt.rst intel-gpu-tools-1.15/man/intel_upload_blit_large_gtt.rst --- intel-gpu-tools-1.13/man/intel_upload_blit_large_gtt.rst 1970-01-01 00:00:00.000000000 +0000 +++ intel-gpu-tools-1.15/man/intel_upload_blit_large_gtt.rst 2016-05-23 10:51:28.000000000 +0000 @@ -0,0 +1,34 @@ +=========================== +intel_upload_blit_large_gtt +=========================== + +--------------------------------------- +Microbenchmark of Intel GPU performance +--------------------------------------- +.. include:: defs.rst +:Author: Intel Graphics for Linux +:Date: 2016-03-01 +:Version: |PACKAGE_STRING| +:Copyright: 2009,2012,2016 Intel Corporation +:Manual section: |MANUAL_SECTION| +:Manual group: |MANUAL_GROUP| + +SYNOPSIS +======== + +**intel_upload_blit_large_gtt** + +DESCRIPTION +=========== + +**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. + +Given that it is a microbenchmark, its utility is largely for regression testing +of the kernel, and not for general conclusions on graphics performance. + +REPORTING BUGS +============== + +Report bugs to https://bugs.freedesktop.org. diff -Nru intel-gpu-tools-1.13/man/intel_upload_blit_large.man intel-gpu-tools-1.15/man/intel_upload_blit_large.man --- intel-gpu-tools-1.13/man/intel_upload_blit_large.man 2015-08-06 15:22:11.000000000 +0000 +++ intel-gpu-tools-1.15/man/intel_upload_blit_large.man 1970-01-01 00:00:00.000000000 +0000 @@ -1,18 +0,0 @@ -.\" 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. diff -Nru intel-gpu-tools-1.13/man/intel_upload_blit_large_map.man intel-gpu-tools-1.15/man/intel_upload_blit_large_map.man --- intel-gpu-tools-1.13/man/intel_upload_blit_large_map.man 2015-08-06 15:22:11.000000000 +0000 +++ intel-gpu-tools-1.15/man/intel_upload_blit_large_map.man 1970-01-01 00:00:00.000000000 +0000 @@ -1,18 +0,0 @@ -.\" 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. diff -Nru intel-gpu-tools-1.13/man/intel_upload_blit_large_map.rst intel-gpu-tools-1.15/man/intel_upload_blit_large_map.rst --- intel-gpu-tools-1.13/man/intel_upload_blit_large_map.rst 1970-01-01 00:00:00.000000000 +0000 +++ intel-gpu-tools-1.15/man/intel_upload_blit_large_map.rst 2016-05-23 10:51:28.000000000 +0000 @@ -0,0 +1,34 @@ +=========================== +intel_upload_blit_large_map +=========================== + +--------------------------------------- +Microbenchmark of Intel GPU performance +--------------------------------------- +.. include:: defs.rst +:Author: Intel Graphics for Linux +:Date: 2016-03-01 +:Version: |PACKAGE_STRING| +:Copyright: 2009,2012,2016 Intel Corporation +:Manual section: |MANUAL_SECTION| +:Manual group: |MANUAL_GROUP| + +SYNOPSIS +======== + +**intel_upload_blit_large_map** + +DESCRIPTION +=========== + +**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. + +Given that it is a microbenchmark, its utility is largely for regression testing +of the kernel, and not for general conclusions on graphics performance. + +REPORTING BUGS +============== + +Report bugs to https://bugs.freedesktop.org. diff -Nru intel-gpu-tools-1.13/man/intel_upload_blit_large.rst intel-gpu-tools-1.15/man/intel_upload_blit_large.rst --- intel-gpu-tools-1.13/man/intel_upload_blit_large.rst 1970-01-01 00:00:00.000000000 +0000 +++ intel-gpu-tools-1.15/man/intel_upload_blit_large.rst 2016-05-23 10:51:28.000000000 +0000 @@ -0,0 +1,34 @@ +======================= +intel_upload_blit_large +======================= + +--------------------------------------- +Microbenchmark of Intel GPU performance +--------------------------------------- +.. include:: defs.rst +:Author: Intel Graphics for Linux +:Date: 2016-03-01 +:Version: |PACKAGE_STRING| +:Copyright: 2009,2012,2016 Intel Corporation +:Manual section: |MANUAL_SECTION| +:Manual group: |MANUAL_GROUP| + +SYNOPSIS +======== + +**intel_upload_blit_large** + +DESCRIPTION +=========== + +**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. + +Given that it is a microbenchmark, its utility is largely for regression testing +of the kernel, and not for general conclusions on graphics performance. + +REPORTING BUGS +============== + +Report bugs to https://bugs.freedesktop.org. diff -Nru intel-gpu-tools-1.13/man/intel_upload_blit_small.man intel-gpu-tools-1.15/man/intel_upload_blit_small.man --- intel-gpu-tools-1.13/man/intel_upload_blit_small.man 2015-08-06 15:22:11.000000000 +0000 +++ intel-gpu-tools-1.15/man/intel_upload_blit_small.man 1970-01-01 00:00:00.000000000 +0000 @@ -1,18 +0,0 @@ -.\" 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. diff -Nru intel-gpu-tools-1.13/man/intel_upload_blit_small.rst intel-gpu-tools-1.15/man/intel_upload_blit_small.rst --- intel-gpu-tools-1.13/man/intel_upload_blit_small.rst 1970-01-01 00:00:00.000000000 +0000 +++ intel-gpu-tools-1.15/man/intel_upload_blit_small.rst 2016-05-23 10:51:28.000000000 +0000 @@ -0,0 +1,34 @@ +======================= +intel_upload_blit_small +======================= + +--------------------------------------- +Microbenchmark of Intel GPU performance +--------------------------------------- +.. include:: defs.rst +:Author: Intel Graphics for Linux +:Date: 2016-03-01 +:Version: |PACKAGE_STRING| +:Copyright: 2009,2012,2016 Intel Corporation +:Manual section: |MANUAL_SECTION| +:Manual group: |MANUAL_GROUP| + +SYNOPSIS +======== + +**intel_upload_blit_small** + +DESCRIPTION +=========== + +**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. + +Given that it is a microbenchmark, its utility is largely for regression testing +of the kernel, and not for general conclusions on graphics performance. + +REPORTING BUGS +============== + +Report bugs to https://bugs.freedesktop.org. diff -Nru intel-gpu-tools-1.13/man/Makefile.am intel-gpu-tools-1.15/man/Makefile.am --- intel-gpu-tools-1.13/man/Makefile.am 2015-11-12 17:30:48.000000000 +0000 +++ intel-gpu-tools-1.15/man/Makefile.am 2016-05-23 10:51:28.000000000 +0000 @@ -1,41 +1,39 @@ appmandir = $(APP_MAN_DIR) -appman_PRE = \ - intel_aubdump.man \ - intel_audio_dump.man \ - intel_bios_dumper.man \ - intel_bios_reader.man \ - intel_error_decode.man \ - intel_gpu_frequency.man \ - intel_gpu_top.man \ - intel_gtt.man \ - intel_infoframes.man \ - intel_lid.man \ - intel_panel_fitter.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)) - -# man pages in rst, only used if we have rst2man -appman_RST = \ - intel_reg.rst +appman_RST = \ + intel_aubdump.rst \ + intel_audio_dump.rst \ + intel_bios_dumper.rst \ + intel_bios_reader.rst \ + intel_error_decode.rst \ + intel_gpu_frequency.rst \ + intel_gpu_top.rst \ + intel_gtt.rst \ + intel_infoframes.rst \ + intel_lid.rst \ + intel_panel_fitter.rst \ + intel_reg.rst \ + intel_stepping.rst \ + intel_upload_blit_large.rst \ + intel_upload_blit_large_gtt.rst \ + intel_upload_blit_large_map.rst \ + intel_upload_blit_small.rst if HAVE_RST2MAN -appman_DATA += $(appman_RST:rst=$(APP_MAN_SUFFIX)) +appman_DATA = $(appman_RST:rst=$(APP_MAN_SUFFIX)) endif -EXTRA_DIST = $(appman_PRE) $(appman_RST) -CLEANFILES = $(appman_DATA) +EXTRA_DIST = $(appman_RST) +CLEANFILES = $(appman_DATA) defs.rst -# String replacements in MAN_SUBSTS now come from xorg-macros.m4 via configure -SUFFIXES = .$(APP_MAN_SUFFIX) .man +SUFFIXES = .$(APP_MAN_SUFFIX) -.man.$(APP_MAN_SUFFIX): - $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@ +# create some definitions useful in the man page rst sources +defs.rst: + $(AM_V_GEN)echo ".. |PACKAGE_NAME| replace:: $(PACKAGE_NAME)" > $@ + $(AM_V_GEN)echo ".. |PACKAGE_VERSION| replace:: $(PACKAGE_VERSION)" >> $@ + $(AM_V_GEN)echo ".. |PACKAGE_STRING| replace:: $(PACKAGE_STRING)" >> $@ + $(AM_V_GEN)echo ".. |MANUAL_SECTION| replace:: 1" >> $@ + $(AM_V_GEN)echo ".. |MANUAL_GROUP| replace:: General Commands Manual" >> $@ -# FIXME: handle MAN_SUBST in rst -.rst.$(APP_MAN_SUFFIX): +%.$(APP_MAN_SUFFIX): %.rst defs.rst $(AM_V_GEN)rst2man < $< > $@ diff -Nru intel-gpu-tools-1.13/man/Makefile.in intel-gpu-tools-1.15/man/Makefile.in --- intel-gpu-tools-1.13/man/Makefile.in 2015-12-02 16:47:59.000000000 +0000 +++ intel-gpu-tools-1.15/man/Makefile.in 2016-05-31 17:03:32.000000000 +0000 @@ -88,7 +88,7 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -@HAVE_RST2MAN_TRUE@am__append_1 = $(appman_RST:rst=$(APP_MAN_SUFFIX)) +target_triplet = @target@ subdir = man ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/as-compiler-flag.m4 \ @@ -188,6 +188,8 @@ DRM_LIBS = @DRM_LIBS@ DRM_NOUVEAU_CFLAGS = @DRM_NOUVEAU_CFLAGS@ DRM_NOUVEAU_LIBS = @DRM_NOUVEAU_LIBS@ +DRM_VC4_CFLAGS = @DRM_VC4_CFLAGS@ +DRM_VC4_LIBS = @DRM_VC4_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -232,6 +234,7 @@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MAN_SUBSTS = @MAN_SUBSTS@ @@ -276,6 +279,7 @@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ THREAD_CFLAGS = @THREAD_CFLAGS@ +TIMER_LIBS = @TIMER_LIBS@ VERSION = @VERSION@ XORG_MAN_PAGE = @XORG_MAN_PAGE@ XRANDR_CFLAGS = @XRANDR_CFLAGS@ @@ -330,48 +334,47 @@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ +target = @target@ target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ appmandir = $(APP_MAN_DIR) -appman_PRE = \ - intel_aubdump.man \ - intel_audio_dump.man \ - intel_bios_dumper.man \ - intel_bios_reader.man \ - intel_error_decode.man \ - intel_gpu_frequency.man \ - intel_gpu_top.man \ - intel_gtt.man \ - intel_infoframes.man \ - intel_lid.man \ - intel_panel_fitter.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)) $(am__append_1) - -# man pages in rst, only used if we have rst2man appman_RST = \ - intel_reg.rst - -EXTRA_DIST = $(appman_PRE) $(appman_RST) -CLEANFILES = $(appman_DATA) - -# String replacements in MAN_SUBSTS now come from xorg-macros.m4 via configure -SUFFIXES = .$(APP_MAN_SUFFIX) .man + intel_aubdump.rst \ + intel_audio_dump.rst \ + intel_bios_dumper.rst \ + intel_bios_reader.rst \ + intel_error_decode.rst \ + intel_gpu_frequency.rst \ + intel_gpu_top.rst \ + intel_gtt.rst \ + intel_infoframes.rst \ + intel_lid.rst \ + intel_panel_fitter.rst \ + intel_reg.rst \ + intel_stepping.rst \ + intel_upload_blit_large.rst \ + intel_upload_blit_large_gtt.rst \ + intel_upload_blit_large_map.rst \ + intel_upload_blit_small.rst + +@HAVE_RST2MAN_TRUE@appman_DATA = $(appman_RST:rst=$(APP_MAN_SUFFIX)) +EXTRA_DIST = $(appman_RST) +CLEANFILES = $(appman_DATA) defs.rst +SUFFIXES = .$(APP_MAN_SUFFIX) all: all-am .SUFFIXES: -.SUFFIXES: .$(APP_MAN_SUFFIX) .man .rst +.SUFFIXES: .$(APP_MAN_SUFFIX) $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ @@ -587,11 +590,15 @@ .PRECIOUS: Makefile -.man.$(APP_MAN_SUFFIX): - $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@ +# create some definitions useful in the man page rst sources +defs.rst: + $(AM_V_GEN)echo ".. |PACKAGE_NAME| replace:: $(PACKAGE_NAME)" > $@ + $(AM_V_GEN)echo ".. |PACKAGE_VERSION| replace:: $(PACKAGE_VERSION)" >> $@ + $(AM_V_GEN)echo ".. |PACKAGE_STRING| replace:: $(PACKAGE_STRING)" >> $@ + $(AM_V_GEN)echo ".. |MANUAL_SECTION| replace:: 1" >> $@ + $(AM_V_GEN)echo ".. |MANUAL_GROUP| replace:: General Commands Manual" >> $@ -# FIXME: handle MAN_SUBST in rst -.rst.$(APP_MAN_SUFFIX): +%.$(APP_MAN_SUFFIX): %.rst defs.rst $(AM_V_GEN)rst2man < $< > $@ # Tell versions [3.59,3.63) of GNU make to not export all variables. diff -Nru intel-gpu-tools-1.13/NEWS intel-gpu-tools-1.15/NEWS --- intel-gpu-tools-1.13/NEWS 2015-12-02 16:46:18.000000000 +0000 +++ intel-gpu-tools-1.15/NEWS 2016-05-31 16:53:51.000000000 +0000 @@ -1,3 +1,124 @@ +Release 1.15 (2016-05-31) +------------------------- + +- New KMS test: tests/kms_cursor_legacy (Stress legacy cursor ioctl) +(Chris Wilson) + +- Several GEM tests have been removed from BAT: tests/gem_exec_whisper, +tests/gem_sync (dropped individual engines), test/gem_cs_prefetch (replaced +by test/gem_exec_gttfill), tests/gem_ctx_param_basic (got relabeled +to tests/gem_ctx_param) (Chris Wilson) + +- build: Skip configure step if is NOCONFIGURE set (Tomeu Vizoso) + +- tools/intel_bios_reader: Added options for dumping individual panels, specific +section, hex format and other various fixes (Jani Nikula) + +- build: Add optional --enable-werror +(hard-fail in case of compiler warnings) (Marius Vlad) + +- New KMS test: tests/prime_mmap_kms (show case dma-buf new API +and processes restrictions) (Tiago Vignatti) + +- Several tests have gained to ability to be run on different platforms +than Intel: tests/testdisplay (Tomeu Vizoso), tests/kms_panel_fitting +(Robert Foss), tests/kms_flip_event_leak, tests/kms_flip (Tomeu Vizoso). + +- compute exitcode first: In the case of running multiple subtests which all +happen to be skipped, igt_exitcode is 0, but the final exit code will be 77. +(Chris Wilson) + +- Shorten tests/kms_flip test (Tvrtko Ursulin) + +- Half the timeout for suspend to RAM and a third for suspend to disk +(Marius Vlad) + +- lib: Pass format instead of bpp to create_bo_for_fb (Ville Syrjälä) + +- Removed from tests/test-list.txt, tests/gem_concurrent_all and added +tests/test-list-full.txt that contains all the tests. This will speed +up considerably piglit when starting tests. (Gabriel Feceoru) + +- piglit changed its behaviour to prevent overwriting the results. A fairly new +version of piglit is required to run i-g-t tests. (Gabriel Feceoru) + +- lib: Replace drmIoctl() with a layer of indirection (Chris Wilson) + +- Adding missing Broxton PCI IDs (Rodrigo Vivi) + +- Added COMMIT_ATOMIC (lib/igt_kms, w/ tests/kms_rotation_crc). +Requires nuclear_pageflip parameter turned on in the i915 driver. +(Mayuresh Gharpure, Pratik Vishwakarma) + +- man/: rewrite manual pages in reStructuredText (Jani Nikula) + +- tests/drv_module_reload_basic: perform fault injection (Chris Wilson) +with various improvements (Imre Deak) + +- Removed tests/gem_multi_bsd_sync_loop which was superseded by +tests/gem_ring_sync_loop and tests/gem_dummy_reloc_loop by +tests/gem_exec_reloc (Chris Wilson) + +- New GEM tests: tests/gem_exec_whisper, tests/gem_exec_store, +test/gem_exec_gttfill, tests/gem_exec_suspend, tests/gem_exec_flush +(Chris Wilson) + +- New benchmarks: benchmarks/gem_syslatency, benchmarks/gem_exec_fault +(Chris Wilson) + +- tests/gem_exec_nop included in BAT (Chris Wilson) + +- tests/pm_rpm: Fix crash on machines that lack LLC (David Weinehall) + +- lib/igt_fb: Fix domain tracking for GTT cairo surfaces (Chris Wilson) + +- Add igt_subtest_group to allow igt_fixture for only a subset of subtests +without skipping/failing all subsequent subtests. (Daniel Vetter) + +- Many more fixes and improvements. + +Release 1.14 (2016-03-01) +------------------------- + +- New test: gem_create validate parameters for GEM_CREATE ioctl +(Ankitprasad Sharma) + +- New test: gem_softpin exercise the userptr ioctl to create shared +buffers between CPU and GPU (Vinay Belgaumkar) + +- New tests: prime_mmap_coherency/kms_mmap_write_crc cache coherency +tests (Tiago Vignatti) + +- New test: prime_mmap mmap() on dma-buf fds (Rob Bradford) + +- New test: gem_exec_reloc sanity check of execbuf-ioctl relocations (Chris +Wilson) + +- New test: gem_exec_basic sanity check of execbuf-ioctl rings (Chris Wilson) + +- improved igt_hang_ring() infrastructure for generic hang injection support in +the core library (Chris Wilson) + +- new igt_pm library to collect power management testing helpers (David +Weinehall) + +- lig/igt_vc4: VC4 support library (Eric Anholt) + +- kms_frontbuffer_tracking: included in BAT (Paulo Zanoni) + +- kms_psr_sink_crc: Add BAT test for PSR active (Rodrigo Vivi) + +- gem_wait: test superseded by gem_latency in benchmarks (Chris Wilson) + +- igt_core: Fix logging to display extended line (Derek Morton) + +- igt_core: Expand --run-subtest functionality (Derek Morton) + +- kms_force_connector_basic: various fixes and included in BAT set (Daniel +Vetter) + +- Many other improvements and bug fixes. + Release 1.13 (2015-12-02) ------------------------- diff -Nru intel-gpu-tools-1.13/overlay/Makefile.am intel-gpu-tools-1.15/overlay/Makefile.am --- intel-gpu-tools-1.13/overlay/Makefile.am 2015-08-17 15:40:31.000000000 +0000 +++ intel-gpu-tools-1.15/overlay/Makefile.am 2016-05-23 10:51:28.000000000 +0000 @@ -3,7 +3,8 @@ endif AM_CPPFLAGS = -I. -AM_CFLAGS = $(DRM_CFLAGS) $(PCIACCESS_CFLAGS) $(CWARNFLAGS) $(CAIRO_CFLAGS) $(OVERLAY_CFLAGS) +AM_CFLAGS = $(DRM_CFLAGS) $(PCIACCESS_CFLAGS) $(CWARNFLAGS) \ + $(CAIRO_CFLAGS) $(OVERLAY_CFLAGS) $(WERROR_CLFAGS) LDADD = $(DRM_LIBS) $(PCIACCESS_LIBS) $(CAIRO_LIBS) $(OVERLAY_LIBS) intel_gpu_overlay_SOURCES = \ diff -Nru intel-gpu-tools-1.13/overlay/Makefile.in intel-gpu-tools-1.15/overlay/Makefile.in --- intel-gpu-tools-1.13/overlay/Makefile.in 2015-12-02 16:47:59.000000000 +0000 +++ intel-gpu-tools-1.15/overlay/Makefile.in 2016-05-31 17:03:32.000000000 +0000 @@ -88,6 +88,7 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ +target_triplet = @target@ @BUILD_OVERLAY_TRUE@bin_PROGRAMS = intel-gpu-overlay$(EXEEXT) @BUILD_OVERLAY_XLIB_TRUE@am__append_1 = $(OVERLAY_XLIB_CFLAGS) $(XRANDR_CFLAGS) @BUILD_OVERLAY_XLIB_TRUE@am__append_2 = $(OVERLAY_XLIB_LIBS) $(XRANDR_LIBS) @@ -253,6 +254,8 @@ DRM_LIBS = @DRM_LIBS@ DRM_NOUVEAU_CFLAGS = @DRM_NOUVEAU_CFLAGS@ DRM_NOUVEAU_LIBS = @DRM_NOUVEAU_LIBS@ +DRM_VC4_CFLAGS = @DRM_VC4_CFLAGS@ +DRM_VC4_LIBS = @DRM_VC4_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -297,6 +300,7 @@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MAN_SUBSTS = @MAN_SUBSTS@ @@ -341,6 +345,7 @@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ THREAD_CFLAGS = @THREAD_CFLAGS@ +TIMER_LIBS = @TIMER_LIBS@ VERSION = @VERSION@ XORG_MAN_PAGE = @XORG_MAN_PAGE@ XRANDR_CFLAGS = @XRANDR_CFLAGS@ @@ -395,18 +400,23 @@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ +target = @target@ target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CPPFLAGS = -I. AM_CFLAGS = $(DRM_CFLAGS) $(PCIACCESS_CFLAGS) $(CWARNFLAGS) \ - $(CAIRO_CFLAGS) $(OVERLAY_CFLAGS) $(am__append_1) \ - $(am__append_4) + $(CAIRO_CFLAGS) $(OVERLAY_CFLAGS) $(WERROR_CLFAGS) \ + $(am__append_1) $(am__append_4) LDADD = $(DRM_LIBS) $(PCIACCESS_LIBS) $(CAIRO_LIBS) $(OVERLAY_LIBS) \ $(am__append_2) $(am__append_5) intel_gpu_overlay_SOURCES = i915_pciids.h chart.h chart.c config.c \ diff -Nru intel-gpu-tools-1.13/README intel-gpu-tools-1.15/README --- intel-gpu-tools-1.13/README 2015-12-02 16:42:16.000000000 +0000 +++ intel-gpu-tools-1.15/README 2016-05-23 10:51:28.000000000 +0000 @@ -141,3 +141,10 @@ python-docutils x11proto-dri2-dev xutils-dev + +Releases for maintainers +------------------------ + +(1.14) + +http://www.x.org/wiki/Development/Documentation/ReleaseHOWTO/ diff -Nru intel-gpu-tools-1.13/scripts/intel-gfx-trybot intel-gpu-tools-1.15/scripts/intel-gfx-trybot --- intel-gpu-tools-1.13/scripts/intel-gfx-trybot 1970-01-01 00:00:00.000000000 +0000 +++ intel-gpu-tools-1.15/scripts/intel-gfx-trybot 2016-05-23 10:51:28.000000000 +0000 @@ -0,0 +1,13 @@ +#!/bin/sh + +COMMIT=$1 +INTEL=intel +DIN=${INTEL}/drm-intel-nightly + +git fetch ${INTEL} +git merge-base --is-ancestor ${DIN} ${COMMIT} || { + echo Tree is out of date + exit 1 +} + +git send-email --to intel-gfx-trybot@lists.freedesktop.org --suppress-cc=all ${DIN}..${COMMIT} diff -Nru intel-gpu-tools-1.13/scripts/Makefile.am intel-gpu-tools-1.15/scripts/Makefile.am --- intel-gpu-tools-1.13/scripts/Makefile.am 2015-08-17 15:40:31.000000000 +0000 +++ intel-gpu-tools-1.15/scripts/Makefile.am 2016-05-23 10:51:28.000000000 +0000 @@ -1,3 +1,2 @@ - -dist_noinst_SCRIPTS = who.sh run-tests.sh +dist_noinst_SCRIPTS = intel-gfx-trybot who.sh run-tests.sh noinst_PYTHON = throttle.py diff -Nru intel-gpu-tools-1.13/scripts/Makefile.in intel-gpu-tools-1.15/scripts/Makefile.in --- intel-gpu-tools-1.13/scripts/Makefile.in 2015-12-02 16:47:59.000000000 +0000 +++ intel-gpu-tools-1.15/scripts/Makefile.in 2016-05-31 17:03:32.000000000 +0000 @@ -88,6 +88,7 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ +target_triplet = @target@ subdir = scripts ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/as-compiler-flag.m4 \ @@ -163,6 +164,8 @@ DRM_LIBS = @DRM_LIBS@ DRM_NOUVEAU_CFLAGS = @DRM_NOUVEAU_CFLAGS@ DRM_NOUVEAU_LIBS = @DRM_NOUVEAU_LIBS@ +DRM_VC4_CFLAGS = @DRM_VC4_CFLAGS@ +DRM_VC4_LIBS = @DRM_VC4_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -207,6 +210,7 @@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MAN_SUBSTS = @MAN_SUBSTS@ @@ -251,6 +255,7 @@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ THREAD_CFLAGS = @THREAD_CFLAGS@ +TIMER_LIBS = @TIMER_LIBS@ VERSION = @VERSION@ XORG_MAN_PAGE = @XORG_MAN_PAGE@ XRANDR_CFLAGS = @XRANDR_CFLAGS@ @@ -305,15 +310,20 @@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ +target = @target@ target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -dist_noinst_SCRIPTS = who.sh run-tests.sh +dist_noinst_SCRIPTS = intel-gfx-trybot who.sh run-tests.sh noinst_PYTHON = throttle.py all: all-am diff -Nru intel-gpu-tools-1.13/scripts/run-tests.sh intel-gpu-tools-1.15/scripts/run-tests.sh --- intel-gpu-tools-1.13/scripts/run-tests.sh 2015-12-02 16:42:16.000000000 +0000 +++ intel-gpu-tools-1.15/scripts/run-tests.sh 2016-05-23 10:51:28.000000000 +0000 @@ -125,7 +125,7 @@ sudo IGT_TEST_ROOT="$IGT_TEST_ROOT" "$PIGLIT" resume "$RESULTS" $NORETRY else mkdir -p "$RESULTS" - sudo IGT_TEST_ROOT="$IGT_TEST_ROOT" "$PIGLIT" run igt "$RESULTS" -s $VERBOSE $EXCLUDE $FILTER + sudo IGT_TEST_ROOT="$IGT_TEST_ROOT" "$PIGLIT" run igt -o "$RESULTS" -s $VERBOSE $EXCLUDE $FILTER fi if [ "$SUMMARY" == "html" ]; then diff -Nru intel-gpu-tools-1.13/tests/check_drm_clients intel-gpu-tools-1.15/tests/check_drm_clients --- intel-gpu-tools-1.13/tests/check_drm_clients 2015-08-06 15:22:11.000000000 +0000 +++ intel-gpu-tools-1.15/tests/check_drm_clients 2016-05-23 10:51:28.000000000 +0000 @@ -3,4 +3,4 @@ SOURCE_DIR="$( dirname "${BASH_SOURCE[0]}" )" . $SOURCE_DIR/drm_lib.sh -exit 0 +exit $IGT_EXIT_SUCCESS diff -Nru intel-gpu-tools-1.13/tests/core_getversion.c intel-gpu-tools-1.15/tests/core_getversion.c --- intel-gpu-tools-1.13/tests/core_getversion.c 2015-11-30 16:26:22.000000000 +0000 +++ intel-gpu-tools-1.15/tests/core_getversion.c 2016-05-23 10:51:28.000000000 +0000 @@ -39,10 +39,12 @@ fd = drm_open_driver(DRIVER_ANY); v = drmGetVersion(fd); - igt_assert(strlen(v->name) != 0); - igt_assert(strlen(v->date) != 0); - igt_assert(strlen(v->desc) != 0); - igt_assert(v->version_major >= 1); + igt_assert_neq(strlen(v->name), 0); + igt_assert_neq(strlen(v->date), 0); + igt_assert_neq(strlen(v->desc), 0); + if (is_i915_device(fd)) + igt_assert_lte(1, v->version_major); + drmFree(v); close(fd); } diff -Nru intel-gpu-tools-1.13/tests/debugfs_emon_crash intel-gpu-tools-1.15/tests/debugfs_emon_crash --- intel-gpu-tools-1.13/tests/debugfs_emon_crash 2015-08-06 15:22:11.000000000 +0000 +++ intel-gpu-tools-1.15/tests/debugfs_emon_crash 2016-05-23 10:51:28.000000000 +0000 @@ -13,4 +13,4 @@ # If we got here, we haven't crashed -exit 0 +exit $IGT_EXIT_SUCCESS diff -Nru intel-gpu-tools-1.13/tests/drm_lib.sh intel-gpu-tools-1.15/tests/drm_lib.sh --- intel-gpu-tools-1.13/tests/drm_lib.sh 2015-08-06 15:22:11.000000000 +0000 +++ intel-gpu-tools-1.15/tests/drm_lib.sh 2016-05-23 10:51:28.000000000 +0000 @@ -1,20 +1,26 @@ #!/bin/sh +IGT_EXIT_TIMEOUT=78 +IGT_EXIT_SKIP=77 +IGT_EXIT_SUCCESS=0 +IGT_EXIT_INVALID=79 +IGT_EXIT_FAILURE=99 + # hacked-up long option parsing for arg in $@ ; do case $arg in --list-subtests) - exit 79 + exit $IGT_EXIT_INVALID ;; --run-subtest) - exit 79 + exit $IGT_EXIT_INVALID ;; --debug) IGT_LOG_LEVEL=debug ;; --help-description) echo $IGT_TEST_DESCRIPTION - exit 0 + exit $IGT_EXIT_SUCCESS ;; --help) echo "Usage: `basename $0` [OPTIONS]" @@ -23,18 +29,23 @@ echo " --debug" echo " --help-description" echo " --help" - exit 0 + exit $IGT_EXIT_SUCCESS ;; esac done +skip() { + echo "$@" + exit $IGT_EXIT_SKIP +} + die() { echo "$@" - exit 1 + exit $IGT_EXIT_FAILURE } do_or_die() { - $@ > /dev/null 2>&1 || (echo "FAIL: $@ ($?)" && exit -1) + $@ > /dev/null 2>&1 || (echo "FAIL: $@ ($?)" && exit $IGT_EXIT_FAILURE) } if [ -d /debug/dri ] ; then @@ -54,7 +65,7 @@ done if [ $i915_dfs_path = "x" ] ; then - die " i915 debugfs path not found." + skip " i915 debugfs path not found." fi # read everything we can @@ -63,7 +74,7 @@ die "ERROR: other drm clients running" fi -whoami | grep -q root || ( echo ERROR: not running as root; exit 1 ) +whoami | grep -q root || ( echo ERROR: not running as root; exit $IGT_EXIT_FAILURE ) i915_sfs_path= if [ -d /sys/class/drm ] ; then @@ -76,7 +87,7 @@ function drmtest_skip_on_simulation() { - [ -n "$INTEL_SIMULATION" ] && exit 77 + [ -n "$INTEL_SIMULATION" ] && exit $IGT_EXIT_SKIP } drmtest_skip_on_simulation diff -Nru intel-gpu-tools-1.13/tests/drm_read.c intel-gpu-tools-1.15/tests/drm_read.c --- intel-gpu-tools-1.13/tests/drm_read.c 2015-11-30 16:26:22.000000000 +0000 +++ intel-gpu-tools-1.15/tests/drm_read.c 2016-05-23 10:51:28.000000000 +0000 @@ -120,20 +120,6 @@ teardown(fd); } -static uint32_t dumb_create(int fd) -{ - struct drm_mode_create_dumb arg; - - arg.bpp = 32; - arg.width = 32; - arg.height = 32; - - do_ioctl(fd, DRM_IOCTL_MODE_CREATE_DUMB, &arg); - igt_assert(arg.size >= 4096); - - return arg.handle; -} - static void test_fault_buffer(int in) { int fd = setup(in, 0); @@ -141,7 +127,7 @@ char *buf; memset(&arg, 0, sizeof(arg)); - arg.handle = dumb_create(fd); + arg.handle = kmstest_dumb_create(fd, 32, 32, 32, NULL, NULL); do_ioctl(fd, DRM_IOCTL_MODE_MAP_DUMB, &arg); @@ -189,46 +175,12 @@ teardown(fd); } -static int pipe0_enabled(int fd) +static bool crtc0_active(int fd) { - struct drm_mode_card_res res; - uint32_t crtcs[32]; - int i; - - /* We assume we can generate events on pipe 0. So we have better - * make sure that is running! - */ - - memset(&res, 0, sizeof(res)); - res.count_crtcs = 32; - res.crtc_id_ptr = (uintptr_t)crtcs; - - if (drmIoctl(fd, DRM_IOCTL_MODE_GETRESOURCES, &res)) - return 0; - - if (res.count_crtcs > 32) - return 0; - - for (i = 0; i < res.count_crtcs; i++) { - struct drm_i915_get_pipe_from_crtc_id get_pipe; - struct drm_mode_crtc mode; - - memset(&get_pipe, 0, sizeof(get_pipe)); - memset(&mode, 0, sizeof(mode)); - - mode.crtc_id = crtcs[i]; - - get_pipe.pipe = -1; - get_pipe.crtc_id = mode.crtc_id; - drmIoctl(fd, DRM_IOCTL_I915_GET_PIPE_FROM_CRTC_ID, &get_pipe); - if (get_pipe.pipe) - continue; - - drmIoctl(fd, DRM_IOCTL_MODE_GETCRTC, &mode); - return mode.mode_valid && mode.mode.clock; - } + union drm_wait_vblank vbl = {}; - return 0; + vbl.request.type = DRM_VBLANK_RELATIVE; + return drmIoctl(fd, DRM_IOCTL_WAIT_VBLANK, &vbl) == 0; } igt_main @@ -239,8 +191,8 @@ siginterrupt(SIGALRM, 1); igt_fixture { - fd = drm_open_driver_master(DRIVER_INTEL); - igt_require(pipe0_enabled(fd)); + fd = drm_open_driver_master(DRIVER_ANY); + igt_require(crtc0_active(fd)); } igt_subtest("invalid-buffer") diff -Nru intel-gpu-tools-1.13/tests/drv_debugfs_reader intel-gpu-tools-1.15/tests/drv_debugfs_reader --- intel-gpu-tools-1.13/tests/drv_debugfs_reader 2015-08-06 15:22:11.000000000 +0000 +++ intel-gpu-tools-1.15/tests/drv_debugfs_reader 2016-05-23 10:51:28.000000000 +0000 @@ -6,4 +6,4 @@ # read everything we can cat $i915_dfs_path/* > /dev/null 2>&1 -exit 0 +exit $IGT_EXIT_SUCCESS diff -Nru intel-gpu-tools-1.13/tests/drv_hangman.c intel-gpu-tools-1.15/tests/drv_hangman.c --- intel-gpu-tools-1.13/tests/drv_hangman.c 2015-11-30 16:26:22.000000000 +0000 +++ intel-gpu-tools-1.15/tests/drv_hangman.c 2016-05-23 10:51:28.000000000 +0000 @@ -32,11 +32,12 @@ #include #include - #ifndef I915_PARAM_CMD_PARSER_VERSION #define I915_PARAM_CMD_PARSER_VERSION 28 #endif +static char read_buffer[1024]; + static int _read_sysfs(void *dst, int maxlen, const char* path, const char *fname) @@ -73,9 +74,7 @@ static void test_sysfs_error_exists(void) { - char tmp[1024]; - - igt_assert_lt(0, read_sysfs(tmp, sizeof(tmp), "error")); + igt_assert_lt(0, read_sysfs(read_buffer, sizeof(read_buffer), "error")); } static void test_debugfs_error_state_exists(void) @@ -88,15 +87,6 @@ close (fd); } -static void test_debugfs_ring_stop_exists(void) -{ - int fd; - - igt_assert_lte(0, (fd = igt_debugfs_open("i915_ring_stop", O_RDONLY))); - - close(fd); -} - static void read_dfs(const char *fname, char *d, int maxlen) { int fd; @@ -112,29 +102,26 @@ igt_debug("dfs entry %s read '%s'\n", fname, d); } -static void _assert_dfs_entry(const char *fname, const char *s, bool inverse) +static int compare_dfs_entry(const char *fname, const char *s) { - char tmp[1024]; - const int l = min(strlen(s), sizeof(tmp)); + const int l = min(strlen(s), sizeof(read_buffer)); - read_dfs(fname, tmp, l + 1); - if (!inverse) { - igt_fail_on_f(strncmp(tmp, s, l) != 0, - "contents of %s: '%s' (expected '%s')\n", fname, tmp, s); - } else { - igt_fail_on_f(strncmp(tmp, s, l) == 0, - "contents of %s: '%s' (expected not '%s'\n", fname, tmp, s); - } + read_dfs(fname, read_buffer, l + 1); + return strncmp(read_buffer, s, l); } static void assert_dfs_entry(const char *fname, const char *s) { - _assert_dfs_entry(fname, s, false); + igt_fail_on_f(compare_dfs_entry(fname, s) != 0, + "contents of %s: '%s' (expected '%s')\n", + fname, read_buffer, s); } static void assert_dfs_entry_not(const char *fname, const char *s) { - _assert_dfs_entry(fname, s, true); + igt_fail_on_f(compare_dfs_entry(fname, s) == 0, + "contents of %s: '%s' (expected not '%s'\n", + fname, read_buffer, s); } static void assert_error_state_clear(void) @@ -147,59 +134,21 @@ assert_dfs_entry_not("i915_error_state", "no error state collected"); } -#define MAGIC_NUMBER 0x10001 -const uint32_t batch[] = { MI_NOOP, - MI_BATCH_BUFFER_END, - MAGIC_NUMBER, - MAGIC_NUMBER }; +const uint32_t *batch; -static uint64_t submit_batch(int fd, unsigned ring_id, bool stop_ring) +static uint64_t submit_hang(int fd, unsigned ring_id) { - struct drm_i915_gem_execbuffer2 execbuf; - struct drm_i915_gem_exec_object2 exec; - uint64_t presumed_offset; - - gem_require_ring(fd, ring_id); - - exec.handle = gem_create(fd, 4096); - gem_write(fd, exec.handle, 0, batch, sizeof(batch)); - exec.relocation_count = 0; - exec.relocs_ptr = 0; - exec.alignment = 0; - exec.offset = 0; - exec.flags = 0; - exec.rsvd1 = 0; - exec.rsvd2 = 0; - - execbuf.buffers_ptr = (uintptr_t)&exec; - execbuf.buffer_count = 1; - execbuf.batch_start_offset = 0; - execbuf.batch_len = sizeof(batch); - execbuf.cliprects_ptr = 0; - execbuf.num_cliprects = 0; - execbuf.DR1 = 0; - execbuf.DR4 = 0; - execbuf.flags = ring_id; - i915_execbuffer2_set_context_id(execbuf, 0); - execbuf.rsvd2 = 0; - - gem_execbuf(fd, &execbuf); - gem_sync(fd, exec.handle); - presumed_offset = exec.offset; - - if (stop_ring) { - igt_set_stop_rings(igt_to_stop_ring_flag(ring_id)); + uint64_t offset; + igt_hang_ring_t hang; - gem_execbuf(fd, &execbuf); - gem_sync(fd, exec.handle); + hang = igt_hang_ctx(fd, 0, ring_id, HANG_ALLOW_CAPTURE, &offset); - igt_assert(igt_get_stop_rings() == STOP_RING_NONE); - igt_assert(presumed_offset == exec.offset); - } + batch = gem_mmap__cpu(fd, hang.handle, 0, 4096, PROT_READ); + gem_set_domain(fd, hang.handle, I915_GEM_DOMAIN_CPU, 0); - gem_close(fd, exec.handle); + igt_post_hang_ring(fd, hang); - return exec.offset; + return offset; } static void clear_error_state(void) @@ -217,11 +166,12 @@ { int fd; + fd = drm_open_driver(DRIVER_INTEL); + clear_error_state(); assert_error_state_clear(); - fd = drm_open_driver(DRIVER_INTEL); - submit_batch(fd, I915_EXEC_RENDER, true); + submit_hang(fd, I915_EXEC_RENDER); close(fd); assert_error_state_collected(); @@ -235,114 +185,53 @@ uint64_t expected_offset) { FILE *file; - int debug_fd; char *line = NULL; size_t line_size = 0; - char *ring_name = NULL; - bool bb_ok = false, req_ok = false, ringbuf_ok = false; - debug_fd = igt_debugfs_open("i915_error_state", O_RDONLY); - igt_assert_lte(0, debug_fd); - file = fdopen(debug_fd, "r"); + file = igt_debugfs_fopen("i915_error_state", "r"); + igt_require(file); while (getline(&line, &line_size, file) > 0) { - char *dashes = NULL; - int bb_matched = 0; + char *dashes; uint32_t gtt_offset_upper, gtt_offset_lower; - uint64_t gtt_offset; - int req_matched = 0; - int requests; - uint32_t tail; - int ringbuf_matched = 0; - int i, items; + int matched; dashes = strstr(line, "---"); if (!dashes) continue; - ring_name = realloc(ring_name, dashes - line); - strncpy(ring_name, line, dashes - line); - ring_name[dashes - line - 1] = '\0'; - - bb_matched = sscanf(dashes, "--- gtt_offset = 0x%08x %08x\n", + matched = sscanf(dashes, "--- gtt_offset = 0x%08x %08x\n", >t_offset_upper, >t_offset_lower); - gtt_offset = ((uint64_t)gtt_offset_upper << 32) | gtt_offset_lower; - - if (bb_matched == 2) { - char expected_line[32]; - - igt_assert(strstr(ring_name, expected_ring_name)); + if (matched) { + char expected_line[64]; + uint64_t gtt_offset; + int i; + + strncpy(expected_line, line, dashes - line); + expected_line[dashes - line - 1] = '\0'; + igt_assert(strstr(expected_line, expected_ring_name)); + + gtt_offset = gtt_offset_upper; + if (matched == 2) { + gtt_offset <<= 32; + gtt_offset |= gtt_offset_lower; + } if (!uses_cmd_parser) - igt_assert(gtt_offset == expected_offset); + igt_assert_eq_u64(gtt_offset, expected_offset); - for (i = 0; i < sizeof(batch) / 4; i++) { + for (i = 0; i < 1024; i++) { igt_assert(getline(&line, &line_size, file) > 0); - snprintf(expected_line, sizeof(expected_line), "%08x : %08x", + snprintf(expected_line, sizeof(expected_line), + "%08x : %08x", 4*i, batch[i]); igt_assert(strstr(line, expected_line)); } - bb_ok = true; - continue; - } - - req_matched = sscanf(dashes, "--- %d requests\n", &requests); - if (req_matched == 1) { - igt_assert(strstr(ring_name, expected_ring_name)); - igt_assert_lt(0, requests); - - for (i = 0; i < requests; i++) { - uint32_t seqno; - long jiffies; - - igt_assert(getline(&line, &line_size, file) > 0); - items = sscanf(line, " seqno 0x%08x, emitted %ld, tail 0x%08x\n", - &seqno, &jiffies, &tail); - igt_assert_eq(items, 3); - } - req_ok = true; - continue; - } - - ringbuf_matched = sscanf(dashes, "--- ringbuffer = 0x%08x\n", - >t_offset_lower); - if (ringbuf_matched == 1) { - unsigned int offset, command, expected_addr = 0; - - if (!strstr(ring_name, expected_ring_name)) - continue; - igt_assert(req_ok); - - for (i = 0; i < tail / 4; i++) { - igt_assert(getline(&line, &line_size, file) > 0); - items = sscanf(line, "%08x : %08x\n", - &offset, &command); - igt_assert_eq(items, 2); - if ((command & 0x1F800000) == MI_BATCH_BUFFER_START) { - igt_assert(getline(&line, &line_size, file) > 0); - items = sscanf(line, "%08x : %08x\n", - &offset, &expected_addr); - igt_assert_eq(items, 2); - i++; - } - } - if (!uses_cmd_parser) { - if (gen >= 4) - igt_assert(expected_addr == expected_offset); - else - igt_assert((expected_addr & ~0x1) == expected_offset); - } - ringbuf_ok = true; - continue; - } - - if (bb_ok && req_ok && ringbuf_ok) break; + } } - igt_assert(bb_ok && req_ok && ringbuf_ok); free(line); - free(ring_name); - close(debug_fd); + fclose(file); } static bool uses_cmd_parser(int fd, int gen) @@ -357,7 +246,7 @@ if (rc || parser_version == 0) return false; - if (!gem_uses_aliasing_ppgtt(fd)) + if (!gem_uses_ppgtt(fd)) return false; if (gen != 7) @@ -373,31 +262,63 @@ uint64_t offset; bool cmd_parser; + fd = drm_open_driver(DRIVER_INTEL); + clear_error_state(); - fd = drm_open_driver(DRIVER_INTEL); gen = intel_gen(intel_get_drm_devid(fd)); cmd_parser = uses_cmd_parser(fd, gen); - offset = submit_batch(fd, ring_id, true); + offset = submit_hang(fd, ring_id); close(fd); check_error_state(gen, cmd_parser, ring_name, offset); } -static const struct target_ring { - const int id; - const char *short_name; - const char *full_name; -} rings[] = { - { I915_EXEC_RENDER, "render", "render ring" }, - { I915_EXEC_BSD, "bsd", "bsd ring" }, - { I915_EXEC_BLT, "blt", "blitter ring" }, - { I915_EXEC_VEBOX, "vebox", "video enhancement ring" }, -}; + +/* This test covers the case where we end up in an uninitialised area of the + * ppgtt and keep executing through it. This is particularly relevant if 48b + * ppgtt is enabled because the ppgtt is massively bigger compared to the 32b + * case and it takes a lot more time to wrap, so the acthd can potentially keep + * increasing for a long time + */ +#define NSEC_PER_SEC 1000000000LL +static void hangcheck_unterminated(void) +{ + int fd; + /* timeout needs to be greater than ~5*hangcheck */ + int64_t timeout_ns = 100 * NSEC_PER_SEC; /* 100 seconds */ + struct drm_i915_gem_execbuffer2 execbuf; + struct drm_i915_gem_exec_object2 gem_exec; + uint32_t handle; + + fd = drm_open_driver(DRIVER_INTEL); + igt_require(gem_uses_full_ppgtt(fd)); + igt_require_hang_ring(fd, 0); + + handle = gem_create(fd, 4096); + + memset(&gem_exec, 0, sizeof(gem_exec)); + gem_exec.handle = handle; + + memset(&execbuf, 0, sizeof(execbuf)); + execbuf.buffers_ptr = (uintptr_t)&gem_exec; + execbuf.buffer_count = 1; + + gem_execbuf(fd, &execbuf); + if (gem_wait(fd, handle, &timeout_ns) != 0) { + /* need to manually trigger an hang to clean before failing */ + igt_force_gpu_reset(); + igt_assert_f(0, "unterminated batch did not trigger an hang!"); + } + + close(fd); +} igt_main { + const struct intel_execution_engine *e; + igt_skip_on_simulation(); igt_subtest("error-state-debugfs-entry") @@ -406,14 +327,18 @@ igt_subtest("error-state-sysfs-entry") test_sysfs_error_exists(); - igt_subtest("ring-stop-sysfs-entry") - test_debugfs_ring_stop_exists(); - igt_subtest("error-state-basic") test_error_state_basic(); - for (int i = 0; i < sizeof(rings)/sizeof(rings[0]); i++) { - igt_subtest_f("error-state-capture-%s", rings[i].short_name) - test_error_state_capture(rings[i].id, rings[i].full_name); + for (e = intel_execution_engines; e->name; e++) { + if (e->exec_id == 0) + continue; + + igt_subtest_f("error-state-capture-%s", e->name) + test_error_state_capture(e->exec_id | e->flags, + e->full_name); } + + igt_subtest("hangcheck-unterminated") + hangcheck_unterminated(); } diff -Nru intel-gpu-tools-1.13/tests/drv_missed_irq_hang intel-gpu-tools-1.15/tests/drv_missed_irq_hang --- intel-gpu-tools-1.13/tests/drv_missed_irq_hang 2015-08-06 15:22:11.000000000 +0000 +++ intel-gpu-tools-1.15/tests/drv_missed_irq_hang 2016-05-23 10:51:28.000000000 +0000 @@ -11,53 +11,53 @@ cd $i915_dfs_path function blt_wait { - (cd $oldpath; $SOURCE_DIR/gem_exec_blt 16384) > /dev/null - (cd $oldpath; $SOURCE_DIR/gem_exec_blt 65536) > /dev/null - (cd $oldpath; $SOURCE_DIR/gem_exec_blt 262144) > /dev/null + $oldpath/$SOURCE_DIR/../benchmarks/gem_blt -r 1 -b 64 -t 1 -S > /dev/null } function check_for_missed_irq { - if test `cat i915_ring_missed_irq` = 0x00000000; then - echo "missed interrupts undetected" - exit 1 - fi + test `cat i915_ring_missed_irq` != 0x00000000 } function check_for_hang { if cat i915_error_state | grep -v "no error state collected" > /dev/null ; then echo "gpu hang reported" - exit 2 + exit $IGT_EXIT_FAILURE fi } if [ ! -f i915_ring_missed_irq ] ; then echo "kernel doesn't support interrupt masking" - exit 77 + exit $IGT_EXIT_SKIP fi # clear error state first echo > i915_error_state +blt_wait +if check_for_missed_irq; then + echo "missed interrupts detected before starting test" + exit $IGT_EXIT_SKOP +fi check_for_hang echo 0xf > i915_ring_test_irq echo "Interrupts masked" if test `cat i915_ring_test_irq` != 0x0000000f; then echo "Failed to set interrupt mask" - exit 3 + exit $IGT_EXIT_FAILURE fi blt_wait -check_for_missed_irq -check_for_hang - -blt_wait +if ! check_for_missed_irq; then + echo "missed interrupts undetected" + exit $IGT_EXIT_FAILURE +fi check_for_hang echo 0 > i915_ring_test_irq echo "Interrupts unmasked" if test `cat i915_ring_test_irq` != 0x00000000; then echo "Failed to clear interrupt mask" - exit 3 + exit $IGT_EXIT_FAILURE fi blt_wait @@ -67,7 +67,14 @@ echo "Cleared missed interrupts" if test `cat i915_ring_missed_irq` != 0x00000000; then echo "Failed to clear missed interrupts" - exit 3 + exit $IGT_EXIT_FAILURE fi -exit 0 +blt_wait +if check_for_missed_irq; then + echo "missed interrupts detected afterwards" + exit $IGT_EXIT_FAILURE +fi +check_for_hang + +exit $IGT_EXIT_SUCCESS diff -Nru intel-gpu-tools-1.13/tests/drv_module_reload_basic intel-gpu-tools-1.15/tests/drv_module_reload_basic --- intel-gpu-tools-1.13/tests/drv_module_reload_basic 2015-11-12 17:30:48.000000000 +0000 +++ intel-gpu-tools-1.15/tests/drv_module_reload_basic 2016-05-23 10:51:28.000000000 +0000 @@ -10,51 +10,76 @@ # no other drm service should be running, so we can just unbind -# we must kick away fbcon (but only fbcon) -for vtcon in /sys/class/vtconsole/vtcon*/ ; do - if grep "frame buffer device" $vtcon/name > /dev/null ; then - echo unbinding $vtcon: `cat $vtcon/name` - echo 0 > $vtcon/bind +function reload() { + local snd_hda_intel_unloaded + + echo Reloading i915.ko with $* + + # we must kick away fbcon (but only fbcon) + for vtcon in /sys/class/vtconsole/vtcon*/ ; do + if grep "frame buffer device" $vtcon/name > /dev/null ; then + echo unbinding $vtcon: `cat $vtcon/name` + echo 0 > $vtcon/bind + fi + done + + # The sound driver uses our power well + pkill alsactl + snd_hda_intel_unloaded=0 + rmmod snd_hda_intel &> /dev/null && snd_hda_intel_unloaded=1 + + #ignore errors in ips - gen5 only + rmmod intel_ips &> /dev/null + rmmod i915 || return $IGT_EXIT_SKIP + #ignore errors in intel-gtt, often built-in + rmmod intel-gtt &> /dev/null + # drm may be used by other devices (nouveau, radeon, udl, etc) + rmmod drm_kms_helper &> /dev/null + rmmod drm &> /dev/null + + if lsmod | grep i915 &> /dev/null ; then + echo WARNING: i915.ko still loaded! + return $IGT_EXIT_FAILURE + else + echo module successfully unloaded fi + + modprobe i915 $* + + if [ -f /sys/class/vtconsole/vtcon1/bind ]; then + echo 1 > /sys/class/vtconsole/vtcon1/bind + fi + + modprobe -q snd_hda_intel || return $snd_hda_intel_unloaded +} + +function finish_load() { + # does the device exist? + if $SOURCE_DIR/gem_alive > /dev/null ; then + echo "module successfully loaded again" + else + echo "failed to reload module successfully" + return $IGT_EXIT_FAILURE + fi + + # then try to run something + if ! $SOURCE_DIR/gem_exec_store > /dev/null ; then + echo "failed to execute a simple batch after reload" + return $IGT_EXIT_FAILURE + fi + + return $IGT_EXIT_SUCCESS +} + +reload || exit $? +finish_load || exit $? + +# Repeat the module reload trying to to generate faults +for i in $(seq 1 4); do + reload inject_load_failure=$i done -# The sound driver uses our power well -pkill alsactl -rmmod snd_hda_intel &> /dev/null - -#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 -# drm may be used by other devices (nouveau, radeon, udl, etc) -rmmod drm_kms_helper &> /dev/null -rmmod drm &> /dev/null - -if lsmod | grep i915 &> /dev/null ; then - echo WARNING: i915.ko still loaded! - exit 1 -else - echo module successfully unloaded -fi - -modprobe i915 -echo 1 > /sys/class/vtconsole/vtcon1/bind - -modprobe snd_hda_intel - -# does the device exist? -if $SOURCE_DIR/gem_alive > /dev/null ; then - echo "module successfully loaded again" -else - echo "failed to reload module successfully" - exit 2 -fi - -# then try to run something -if ! $SOURCE_DIR/gem_linear_blits --run-subtest basic > /dev/null ; then - echo "failed to execute a simple batch after reload" - exit 3 -fi +reload || exit $? +finish_load -exit 0 +exit $? diff -Nru intel-gpu-tools-1.13/tests/eviction_common.c intel-gpu-tools-1.15/tests/eviction_common.c --- intel-gpu-tools-1.13/tests/eviction_common.c 2015-11-30 16:26:22.000000000 +0000 +++ intel-gpu-tools-1.15/tests/eviction_common.c 2016-05-23 10:51:28.000000000 +0000 @@ -31,14 +31,13 @@ #include -struct igt_eviction_test_ops -{ +struct igt_eviction_test_ops { uint32_t (*create)(int fd, uint64_t size); void (*flink)(uint32_t old_handle, uint32_t new_handle); void (*close)(int fd, uint32_t bo); int (*copy)(int fd, uint32_t dst, uint32_t src, uint32_t *all_bo, int nr_bos); - void (*clear)(int fd, uint32_t bo, int size); + void (*clear)(int fd, uint32_t bo, uint64_t size); }; #define FORKING_EVICTIONS_INTERRUPTIBLE (1 << 0) @@ -58,11 +57,12 @@ } static int minor_evictions(int fd, struct igt_eviction_test_ops *ops, - int surface_size, int nr_surfaces) + uint64_t surface_size, + uint64_t nr_surfaces) { uint32_t *bo, *sel; - int n, m, pass, fail; - int total_surfaces; + uint64_t n, m, total_surfaces; + int pass, fail; /* Make sure nr_surfaces is not divisible by seven * to avoid duplicates in the selection loop below. @@ -102,11 +102,11 @@ } static int major_evictions(int fd, struct igt_eviction_test_ops *ops, - int surface_size, int nr_surfaces) + uint64_t surface_size, uint64_t nr_surfaces) { - int n, m, loop; + uint64_t n, m; uint32_t *bo; - int ret; + int ret, loop; intel_require_memory(nr_surfaces, surface_size, CHECK_RAM); @@ -130,10 +130,10 @@ } static void mlocked_evictions(int fd, struct igt_eviction_test_ops *ops, - int surface_size, - int surface_count) + uint64_t surface_size, + uint64_t surface_count) { - size_t sz, pin; + uint64_t sz, pin; void *locked; intel_require_memory(surface_count, surface_size, CHECK_RAM); @@ -142,10 +142,11 @@ pin = intel_get_avail_ram_mb(); pin *= 1024 * 1024; igt_require(pin > sz); - pin -= 3*sz/2; + pin -= sz; - igt_debug("Pinning [%ld, %ld] MiB\n", - (long)pin/(1024*1024), (long)(pin + sz)/(1024*1024)); + igt_debug("Pinning [%'lld, %'lld] MiB\n", + (long long)pin/(1024*1024), + (long long)(pin + sz)/(1024*1024)); locked = malloc(pin + sz); if (locked != NULL && mlock(locked, pin + sz)) { @@ -159,7 +160,8 @@ igt_fork(child, 1) { uint32_t *bo; - int n, ret; + uint64_t n; + int ret; bo = malloc(surface_count*sizeof(*bo)); igt_assert(bo); @@ -184,7 +186,7 @@ locked = malloc(surface_size); if (locked == NULL || mlock(locked, surface_size)) - exit(ENOSPC); + free(locked); } for (n = 0; n < surface_count; n++) @@ -195,12 +197,13 @@ } static int swapping_evictions(int fd, struct igt_eviction_test_ops *ops, - int surface_size, - int working_surfaces, - int trash_surfaces) + uint64_t surface_size, + uint64_t working_surfaces, + uint64_t trash_surfaces) { uint32_t *bo; - int i, n, pass, ret; + uint64_t i, n; + int pass, ret; intel_require_memory(working_surfaces, surface_size, CHECK_RAM); @@ -232,13 +235,15 @@ } static int forking_evictions(int fd, struct igt_eviction_test_ops *ops, - int surface_size, int working_surfaces, - int trash_surfaces, unsigned flags) + uint64_t surface_size, + uint64_t working_surfaces, + uint64_t trash_surfaces, + unsigned flags) { + const int num_threads = sysconf(_SC_NPROCESSORS_ONLN); + uint64_t bo_count, n, l; uint32_t *bo; - int n, pass, l, ret; - int num_threads = sysconf(_SC_NPROCESSORS_ONLN); - int bo_count; + int pass, ret; intel_require_memory(working_surfaces, surface_size, CHECK_RAM); diff -Nru intel-gpu-tools-1.13/tests/gem_bad_reloc.c intel-gpu-tools-1.15/tests/gem_bad_reloc.c --- intel-gpu-tools-1.13/tests/gem_bad_reloc.c 2015-11-30 16:26:22.000000000 +0000 +++ intel-gpu-tools-1.15/tests/gem_bad_reloc.c 2016-05-23 10:51:28.000000000 +0000 @@ -43,132 +43,95 @@ " for STATE_BASE_ADDRESS command packets."); #define USE_LUT (1 << 12) - -static uint64_t get_page_table_size(int fd) -{ - struct drm_i915_getparam gp; - int val = 0; - - memset(&gp, 0, sizeof(gp)); - gp.param = 18; /* HAS_ALIASING_PPGTT */ - gp.value = &val; - - if (drmIoctl(fd, DRM_IOCTL_I915_GETPARAM, &gp)) - return 0; - errno = 0; - - switch (val) { - case 0: - case 1: - return gem_aperture_size(fd); - case 2: - return 1ULL << 32; - case 3: - return 1ULL << 48; - } - - return 0; -} +#define BIAS (256*1024) /* Simulates SNA behaviour using negative self-relocations for * STATE_BASE_ADDRESS command packets. If they wrap around (to values greater * than the total size of the GTT), the GPU will hang. * See https://bugs.freedesktop.org/show_bug.cgi?id=78533 */ -static int negative_reloc(int fd, unsigned flags) +static void negative_reloc(int fd, unsigned engine, unsigned flags) { struct drm_i915_gem_execbuffer2 execbuf; - struct drm_i915_gem_exec_object2 gem_exec[2]; - struct drm_i915_gem_relocation_entry gem_reloc[1000]; - uint64_t gtt_max = get_page_table_size(fd); - uint32_t buf[1024] = {MI_BATCH_BUFFER_END}; + struct drm_i915_gem_exec_object2 obj; + struct drm_i915_gem_relocation_entry reloc[1000]; + uint64_t gtt_max = gem_aperture_size(fd); + uint32_t bbe = MI_BATCH_BUFFER_END; + uint64_t *offsets; int i; -#define BIAS (256*1024) - + gem_require_ring(fd, engine); igt_require(intel_gen(intel_get_drm_devid(fd)) >= 7); - memset(gem_exec, 0, sizeof(gem_exec)); - gem_exec[0].handle = gem_create(fd, 4096); - gem_write(fd, gem_exec[0].handle, 0, buf, 8); - - gem_reloc[0].offset = 1024; - gem_reloc[0].delta = 0; - gem_reloc[0].target_handle = gem_exec[0].handle; - gem_reloc[0].read_domains = I915_GEM_DOMAIN_COMMAND; - - gem_exec[1].handle = gem_create(fd, 4096); - gem_write(fd, gem_exec[1].handle, 0, buf, 8); - gem_exec[1].relocation_count = 1; - gem_exec[1].relocs_ptr = (uintptr_t)gem_reloc; + memset(&obj, 0, sizeof(obj)); + obj.handle = gem_create(fd, 8192); + gem_write(fd, obj.handle, 0, &bbe, sizeof(bbe)); memset(&execbuf, 0, sizeof(execbuf)); - execbuf.buffers_ptr = (uintptr_t)gem_exec; - execbuf.buffer_count = 2; - execbuf.batch_len = 8; - - do_ioctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, &execbuf); - gem_close(fd, gem_exec[1].handle); + execbuf.buffers_ptr = (uintptr_t)&obj; + execbuf.buffer_count = 1; + execbuf.flags = engine | (flags & USE_LUT); + igt_require(__gem_execbuf(fd, &execbuf) == 0); - igt_info("Found offset %lld for 4k batch\n", (long long)gem_exec[0].offset); + igt_info("Found offset %lld for 4k batch\n", (long long)obj.offset); /* * Ideally we'd like to be able to control where the kernel is going to * place the buffer. We don't SKIP here because it causes the test * to "randomly" flip-flop between the SKIP and PASS states. */ - if (gem_exec[0].offset < BIAS) { + if (obj.offset < BIAS) { igt_info("Offset is below BIAS, not testing anything\n"); - return 0; - } - - memset(gem_reloc, 0, sizeof(gem_reloc)); - for (i = 0; i < sizeof(gem_reloc)/sizeof(gem_reloc[0]); i++) { - gem_reloc[i].offset = 8 + 4*i; - gem_reloc[i].delta = -BIAS*i/1024; - gem_reloc[i].target_handle = flags & USE_LUT ? 0 : gem_exec[0].handle; - gem_reloc[i].read_domains = I915_GEM_DOMAIN_COMMAND; + return; } - gem_exec[0].relocation_count = sizeof(gem_reloc)/sizeof(gem_reloc[0]); - gem_exec[0].relocs_ptr = (uintptr_t)gem_reloc; - - execbuf.buffer_count = 1; - execbuf.flags = flags & USE_LUT; - do_ioctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, &execbuf); - - igt_info("Batch is now at offset %lld\n", (long long)gem_exec[0].offset); - - gem_read(fd, gem_exec[0].handle, 0, buf, sizeof(buf)); - gem_close(fd, gem_exec[0].handle); - - for (i = 0; i < sizeof(gem_reloc)/sizeof(gem_reloc[0]); i++) - igt_assert(buf[2 + i] < gtt_max); - - return 0; + memset(reloc, 0, sizeof(reloc)); + for (i = 0; i < ARRAY_SIZE(reloc); i++) { + reloc[i].offset = 8 + 8*i; + reloc[i].delta = -BIAS*i/1024; + reloc[i].presumed_offset = -1; + reloc[i].target_handle = flags & USE_LUT ? 0 : obj.handle; + reloc[i].read_domains = I915_GEM_DOMAIN_COMMAND; + } + obj.relocation_count = i; + obj.relocs_ptr = (uintptr_t)reloc; + gem_execbuf(fd, &execbuf); + + igt_info("Batch is now at offset %#llx, max GTT %#llx\n", + (long long)obj.offset, (long long)gtt_max); + + offsets = gem_mmap__cpu(fd, obj.handle, 0, 8192, PROT_READ); + gem_set_domain(fd, obj.handle, I915_GEM_DOMAIN_CPU, 0); + gem_close(fd, obj.handle); + + for (i = 0; i < ARRAY_SIZE(reloc); i++) + igt_assert_f(offsets[1 + i] < gtt_max, + "Offset[%d]=%#llx, expected less than %#llx\n", + i, (long long)offsets[i+i], (long long)gtt_max); + munmap(offsets, 8192); } -static int negative_reloc_blt(int fd) +static void negative_reloc_blt(int fd) { const int gen = intel_gen(intel_get_drm_devid(fd)); struct drm_i915_gem_execbuffer2 execbuf; - struct drm_i915_gem_exec_object2 gem_exec[1024][2]; - struct drm_i915_gem_relocation_entry gem_reloc; + struct drm_i915_gem_exec_object2 obj[1024][2]; + struct drm_i915_gem_relocation_entry reloc; uint32_t buf[1024], *b; int i; - memset(&gem_reloc, 0, sizeof(gem_reloc)); - gem_reloc.offset = 4 * sizeof(uint32_t); - gem_reloc.presumed_offset = ~0ULL; - gem_reloc.delta = -4096; - gem_reloc.target_handle = 0; - gem_reloc.read_domains = I915_GEM_DOMAIN_RENDER; - gem_reloc.write_domain = I915_GEM_DOMAIN_RENDER; + memset(&reloc, 0, sizeof(reloc)); + reloc.offset = 4 * sizeof(uint32_t); + reloc.presumed_offset = ~0ULL; + reloc.delta = -4096; + reloc.target_handle = 0; + reloc.read_domains = I915_GEM_DOMAIN_RENDER; + reloc.write_domain = I915_GEM_DOMAIN_RENDER; for (i = 0; i < 1024; i++) { - memset(gem_exec[i], 0, sizeof(gem_exec[i])); + memset(obj[i], 0, sizeof(obj[i])); - gem_exec[i][0].handle = gem_create(fd, 4096); - gem_exec[i][0].flags = EXEC_OBJECT_NEEDS_FENCE; + obj[i][0].handle = gem_create(fd, 4096); + obj[i][0].flags = EXEC_OBJECT_NEEDS_FENCE; b = buf; *b++ = XY_COLOR_BLT_CMD_NOLEN | @@ -185,10 +148,10 @@ if ((b - buf) & 1) *b++ = 0; - gem_exec[i][1].handle = gem_create(fd, 4096); - gem_write(fd, gem_exec[i][1].handle, 0, buf, (b - buf) * sizeof(uint32_t)); - gem_exec[i][1].relocation_count = 1; - gem_exec[i][1].relocs_ptr = (uintptr_t)&gem_reloc; + obj[i][1].handle = gem_create(fd, 4096); + gem_write(fd, obj[i][1].handle, 0, buf, (b - buf) * sizeof(uint32_t)); + obj[i][1].relocation_count = 1; + obj[i][1].relocs_ptr = (uintptr_t)&reloc; } memset(&execbuf, 0, sizeof(execbuf)); @@ -199,15 +162,15 @@ execbuf.flags |= I915_EXEC_BLT; for (i = 0; i < 1024; i++) { - execbuf.buffers_ptr = (uintptr_t)gem_exec[i]; + execbuf.buffers_ptr = (uintptr_t)obj[i]; gem_execbuf(fd, &execbuf); } for (i = 1024; i--;) { - gem_read(fd, gem_exec[i][0].handle, + gem_read(fd, obj[i][0].handle, i*sizeof(uint32_t), buf + i, sizeof(uint32_t)); - gem_close(fd, gem_exec[i][0].handle); - gem_close(fd, gem_exec[i][1].handle); + gem_close(fd, obj[i][0].handle); + gem_close(fd, obj[i][1].handle); } if (0) { @@ -218,28 +181,27 @@ } for (i = 0; i < 1024; i++) igt_assert_eq(buf[i], 0xc0ffee ^ i); - - return 0; } -int fd; - igt_main { - igt_fixture { + const struct intel_execution_engine *e; + int fd = -1; + + igt_fixture fd = drm_open_driver(DRIVER_INTEL); - } - igt_subtest("negative-reloc") - negative_reloc(fd, 0); + for (e = intel_execution_engines; e->name; e++) { + igt_subtest_f("negative-reloc-%s", e->name) + negative_reloc(fd, e->exec_id | e->flags, 0); - igt_subtest("negative-reloc-lut") - negative_reloc(fd, USE_LUT); + igt_subtest_f("negative-reloc-lut-%s", e->name) + negative_reloc(fd, e->exec_id | e->flags, USE_LUT); + } - igt_subtest("negative-reloc-blt") + igt_subtest("negative-reloc-bltcopy") negative_reloc_blt(fd); - igt_fixture { + igt_fixture close(fd); - } } diff -Nru intel-gpu-tools-1.13/tests/gem_busy.c intel-gpu-tools-1.15/tests/gem_busy.c --- intel-gpu-tools-1.13/tests/gem_busy.c 1970-01-01 00:00:00.000000000 +0000 +++ intel-gpu-tools-1.15/tests/gem_busy.c 2016-05-23 10:51:28.000000000 +0000 @@ -0,0 +1,437 @@ +/* + * Copyright © 2016 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 "igt.h" + +#define LOCAL_EXEC_NO_RELOC (1<<11) + +/* Exercise the busy-ioctl, ensuring the ABI is never broken */ +IGT_TEST_DESCRIPTION("Basic check of busy-ioctl ABI."); + +enum { TEST = 0, BUSY, BATCH }; + +static bool gem_busy(int fd, uint32_t handle) +{ + struct drm_i915_gem_busy busy; + + memset(&busy, 0, sizeof(busy)); + busy.handle = handle; + + do_ioctl(fd, DRM_IOCTL_I915_GEM_BUSY, &busy); + + return busy.busy != 0; +} + +static void __gem_busy(int fd, + uint32_t handle, + uint32_t *read, + uint32_t *write) +{ + struct drm_i915_gem_busy busy; + + memset(&busy, 0, sizeof(busy)); + busy.handle = handle; + + do_ioctl(fd, DRM_IOCTL_I915_GEM_BUSY, &busy); + + *write = busy.busy & 0xffff; + *read = busy.busy >> 16; +} + +static uint32_t busy_blt(int fd) +{ + const int gen = intel_gen(intel_get_drm_devid(fd)); + const int has_64bit_reloc = gen >= 8; + struct drm_i915_gem_execbuffer2 execbuf; + struct drm_i915_gem_exec_object2 object[2]; + struct drm_i915_gem_relocation_entry reloc[200], *r; + uint32_t read, write; + uint32_t *map; + int factor = 100; + int i = 0; + + memset(object, 0, sizeof(object)); + object[0].handle = gem_create(fd, 1024*1024); + object[1].handle = gem_create(fd, 4096); + + r = memset(reloc, 0, sizeof(reloc)); + map = gem_mmap__cpu(fd, object[1].handle, 0, 4096, PROT_WRITE); + gem_set_domain(fd, object[1].handle, + I915_GEM_DOMAIN_CPU, I915_GEM_DOMAIN_CPU); + +#define COPY_BLT_CMD (2<<29|0x53<<22|0x6) +#define BLT_WRITE_ALPHA (1<<21) +#define BLT_WRITE_RGB (1<<20) + while (factor--) { + /* XY_SRC_COPY */ + map[i++] = COPY_BLT_CMD | BLT_WRITE_ALPHA | BLT_WRITE_RGB; + if (has_64bit_reloc) + map[i-1] += 2; + map[i++] = 0xcc << 16 | 1 << 25 | 1 << 24 | (4*1024); + map[i++] = 0; + map[i++] = 256 << 16 | 1024; + + r->offset = i * sizeof(uint32_t); + r->target_handle = object[0].handle; + r->read_domains = I915_GEM_DOMAIN_RENDER; + r->write_domain = I915_GEM_DOMAIN_RENDER; + r++; + map[i++] = 0; + if (has_64bit_reloc) + map[i++] = 0; + + map[i++] = 0; + map[i++] = 4096; + + r->offset = i * sizeof(uint32_t); + r->target_handle = object[0].handle; + r->read_domains = I915_GEM_DOMAIN_RENDER; + r->write_domain = 0; + r++; + map[i++] = 0; + if (has_64bit_reloc) + map[i++] = 0; + } + map[i++] = MI_BATCH_BUFFER_END; + igt_assert(i <= 4096/sizeof(uint32_t)); + igt_assert(r - reloc <= ARRAY_SIZE(reloc)); + munmap(map, 4096); + + object[1].relocs_ptr = (uintptr_t)reloc; + object[1].relocation_count = r - reloc; + + memset(&execbuf, 0, sizeof(execbuf)); + execbuf.buffers_ptr = (unsigned long)object; + execbuf.buffer_count = 2; + if (gen >= 6) + execbuf.flags = I915_EXEC_BLT; + gem_execbuf(fd, &execbuf); + + __gem_busy(fd, object[0].handle, &read, &write); + igt_assert_eq(read, 1 << write); + igt_assert_eq(write, gen >= 6 ? I915_EXEC_BLT : I915_EXEC_RENDER); + + igt_debug("Created busy handle %d\n", object[0].handle); + gem_close(fd, object[1].handle); + return object[0].handle; +} + +static bool exec_noop(int fd, + uint32_t *handles, + unsigned ring, + bool write) +{ + struct drm_i915_gem_execbuffer2 execbuf; + struct drm_i915_gem_exec_object2 exec[3]; + + memset(exec, 0, sizeof(exec)); + exec[0].handle = handles[BUSY]; + exec[1].handle = handles[TEST]; + if (write) + exec[1].flags |= EXEC_OBJECT_WRITE; + exec[2].handle = handles[BATCH]; + + memset(&execbuf, 0, sizeof(execbuf)); + execbuf.buffers_ptr = (uintptr_t)exec; + execbuf.buffer_count = 3; + execbuf.flags = ring; + igt_debug("Queuing handle for %s on ring %d\n", + write ? "writing" : "reading", ring & 0x7); + return __gem_execbuf(fd, &execbuf) == 0; +} + +static bool still_busy(int fd, uint32_t handle) +{ + uint32_t read, write; + __gem_busy(fd, handle, &read, &write); + return write; +} + +static void semaphore(int fd, unsigned ring, uint32_t flags) +{ + uint32_t bbe = MI_BATCH_BUFFER_END; + uint32_t handle[3]; + uint32_t read, write; + uint32_t active; + unsigned i; + + gem_require_ring(fd, ring | flags); + + handle[TEST] = gem_create(fd, 4096); + handle[BATCH] = gem_create(fd, 4096); + gem_write(fd, handle[BATCH], 0, &bbe, sizeof(bbe)); + + /* Create a long running batch which we can use to hog the GPU */ + handle[BUSY] = busy_blt(fd); + + /* Queue a batch after the busy, it should block and remain "busy" */ + igt_assert(exec_noop(fd, handle, ring | flags, false)); + igt_assert(still_busy(fd, handle[BUSY])); + __gem_busy(fd, handle[TEST], &read, &write); + igt_assert_eq(read, 1 << ring); + igt_assert_eq(write, 0); + + /* Requeue with a write */ + igt_assert(exec_noop(fd, handle, ring | flags, true)); + igt_assert(still_busy(fd, handle[BUSY])); + __gem_busy(fd, handle[TEST], &read, &write); + igt_assert_eq(read, 1 << ring); + igt_assert_eq(write, ring); + + /* Now queue it for a read across all available rings */ + active = 0; + for (i = I915_EXEC_RENDER; i <= I915_EXEC_VEBOX; i++) { + if (exec_noop(fd, handle, i | flags, false)) + active |= 1 << i; + } + igt_assert(still_busy(fd, handle[BUSY])); + __gem_busy(fd, handle[TEST], &read, &write); + igt_assert_eq(read, active); + igt_assert_eq(write, ring); /* from the earlier write */ + + /* Check that our long batch was long enough */ + igt_assert(still_busy(fd, handle[BUSY])); + + /* And make sure it becomes idle again */ + gem_sync(fd, handle[TEST]); + __gem_busy(fd, handle[TEST], &read, &write); + igt_assert_eq(read, 0); + igt_assert_eq(write, 0); + + for (i = TEST; i <= BATCH; i++) + gem_close(fd, handle[i]); +} + +#define PARALLEL 1 +static void one(int fd, unsigned ring, uint32_t flags, unsigned test_flags) +{ + const int gen = intel_gen(intel_get_drm_devid(fd)); + struct drm_i915_gem_exec_object2 obj[2]; +#define SCRATCH 0 +#define BATCH 1 + struct drm_i915_gem_relocation_entry store[1024+1]; + struct drm_i915_gem_execbuffer2 execbuf; + unsigned size = ALIGN(ARRAY_SIZE(store)*16 + 4, 4096); + uint32_t read[2], write[2]; + struct timespec tv; + uint32_t *batch, *bbe; + int i, count; + + memset(&execbuf, 0, sizeof(execbuf)); + execbuf.buffers_ptr = (uintptr_t)obj; + execbuf.buffer_count = 2; + execbuf.flags = ring | flags; + if (gen < 6) + execbuf.flags |= I915_EXEC_SECURE; + + memset(obj, 0, sizeof(obj)); + obj[SCRATCH].handle = gem_create(fd, 4096); + + obj[BATCH].handle = gem_create(fd, size); + obj[BATCH].relocs_ptr = (uintptr_t)store; + obj[BATCH].relocation_count = ARRAY_SIZE(store); + memset(store, 0, sizeof(store)); + + batch = gem_mmap__wc(fd, obj[BATCH].handle, 0, size, PROT_WRITE); + gem_set_domain(fd, obj[BATCH].handle, + I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT); + + i = 0; + for (count = 0; count < 1024; count++) { + store[count].target_handle = obj[SCRATCH].handle; + store[count].presumed_offset = -1; + store[count].offset = sizeof(uint32_t) * (i + 1); + store[count].delta = sizeof(uint32_t) * count; + store[count].read_domains = I915_GEM_DOMAIN_INSTRUCTION; + store[count].write_domain = I915_GEM_DOMAIN_INSTRUCTION; + batch[i] = MI_STORE_DWORD_IMM | (gen < 6 ? 1 << 22 : 0); + if (gen >= 8) { + batch[++i] = 0; + batch[++i] = 0; + } else if (gen >= 4) { + batch[++i] = 0; + batch[++i] = 0; + store[count].offset += sizeof(uint32_t); + } else { + batch[i]--; + batch[++i] = 0; + } + batch[++i] = count; + i++; + } + + bbe = &batch[i]; + store[count].target_handle = obj[BATCH].handle; /* recurse */ + store[count].presumed_offset = 0; + store[count].offset = sizeof(uint32_t) * (i + 1); + store[count].delta = 0; + store[count].read_domains = I915_GEM_DOMAIN_COMMAND; + store[count].write_domain = 0; + batch[i] = MI_BATCH_BUFFER_START; + if (gen >= 8) { + batch[i] |= 1 << 8 | 1; + batch[++i] = 0; + batch[++i] = 0; + } else if (gen >= 6) { + batch[i] |= 1 << 8; + batch[++i] = 0; + } else { + batch[i] |= 2 << 6; + batch[++i] = 0; + if (gen < 4) { + batch[i] |= 1; + store[count].delta = 1; + } + } + i++; + + igt_assert(i < size/sizeof(*batch)); + igt_require(__gem_execbuf(fd, &execbuf) == 0); + + __gem_busy(fd, obj[SCRATCH].handle, &read[SCRATCH], &write[SCRATCH]); + __gem_busy(fd, obj[BATCH].handle, &read[BATCH], &write[BATCH]); + + if (test_flags & PARALLEL) { + const struct intel_execution_engine *e; + + for (e = intel_execution_engines; e->name; e++) { + if (e->exec_id == 0 || e->exec_id == ring) + continue; + + if (e->exec_id == I915_EXEC_BSD && gen == 6) + continue; + + if (!gem_has_ring(fd, e->exec_id | e->flags)) + continue; + + igt_debug("Testing %s in parallel\n", e->name); + one(fd, e->exec_id, e->flags, 0); + } + } + + *bbe = MI_BATCH_BUFFER_END; + __sync_synchronize(); + + igt_assert_eq(write[SCRATCH], ring); + igt_assert_eq_u32(read[SCRATCH], 1 << ring); + + igt_assert_eq(write[BATCH], 0); + igt_assert_eq_u32(read[BATCH], 1 << ring); + + /* Calling busy in a loop should be enough to flush the rendering */ + memset(&tv, 0, sizeof(tv)); + while (gem_busy(fd, obj[BATCH].handle)) + igt_assert(igt_seconds_elapsed(&tv) < 10); + igt_assert(!gem_busy(fd, obj[SCRATCH].handle)); + + munmap(batch, size); + batch = gem_mmap__wc(fd, obj[SCRATCH].handle, 0, 4096, PROT_READ); + for (i = 0; i < 1024; i++) + igt_assert_eq_u32(batch[i], i); + munmap(batch, 4096); + + gem_close(fd, obj[BATCH].handle); + gem_close(fd, obj[SCRATCH].handle); +} + +static bool has_semaphores(int fd) +{ + struct drm_i915_getparam gp; + int val = -1; + + memset(&gp, 0, sizeof(gp)); + gp.param = I915_PARAM_HAS_SEMAPHORES; + gp.value = &val; + + drmIoctl(fd, DRM_IOCTL_I915_GETPARAM, &gp); + errno = 0; + + return val > 0; +} + +igt_main +{ + const struct intel_execution_engine *e; + int fd = -1; + + igt_skip_on_simulation(); + + igt_fixture + fd = drm_open_driver_master(DRIVER_INTEL); + + igt_subtest_group { + int gen = 0; + + igt_fixture { + gem_require_mmap_wc(fd); + gen = intel_gen(intel_get_drm_devid(fd)); + } + + for (e = intel_execution_engines; e->name; e++) { + /* default exec-id is purely symbolic */ + if (e->exec_id == 0) + continue; + + igt_subtest_f("basic-%s", e->name) { + gem_require_ring(fd, e->exec_id | e->flags); + igt_skip_on_f(gen == 6 && + e->exec_id == I915_EXEC_BSD, + "MI_STORE_DATA broken on gen6 bsd\n"); + gem_quiescent_gpu(fd); + one(fd, e->exec_id, e->flags, 0); + } + } + + for (e = intel_execution_engines; e->name; e++) { + /* default exec-id is purely symbolic */ + if (e->exec_id == 0) + continue; + + igt_subtest_f("basic-parallel-%s", e->name) { + gem_require_ring(fd, e->exec_id | e->flags); + igt_skip_on_f(gen == 6 && + e->exec_id == I915_EXEC_BSD, + "MI_STORE_DATA broken on gen6 bsd\n"); + gem_quiescent_gpu(fd); + one(fd, e->exec_id, e->flags, PARALLEL); + } + } + } + + igt_subtest_group { + igt_fixture + igt_require(has_semaphores(fd)); + + for (e = intel_execution_engines; e->name; e++) { + /* default exec-id is purely symbolic */ + if (e->exec_id == 0) + continue; + + igt_subtest_f("semaphore-%s", e->name) + semaphore(fd, e->exec_id, e->flags); + } + } + + igt_fixture + close(fd); +} diff -Nru intel-gpu-tools-1.13/tests/gem_close_race.c intel-gpu-tools-1.15/tests/gem_close_race.c --- intel-gpu-tools-1.13/tests/gem_close_race.c 2015-11-30 16:15:31.000000000 +0000 +++ intel-gpu-tools-1.15/tests/gem_close_race.c 2016-05-23 10:51:28.000000000 +0000 @@ -28,6 +28,7 @@ #include "igt.h" #include #include +#include #include #include #include @@ -38,6 +39,7 @@ #include #include #include +#include #include "drm.h" #define OBJECT_SIZE (256 * 1024) @@ -50,6 +52,9 @@ static uint32_t devid; static bool has_64bit_relocations; +#define gettid() syscall(__NR_gettid) +#define sigev_notify_thread_id _sigev_un._tid + static void selfcopy(int fd, uint32_t handle, int loops) { struct drm_i915_gem_relocation_entry reloc[2]; @@ -57,11 +62,9 @@ struct drm_i915_gem_execbuffer2 execbuf; struct drm_i915_gem_pwrite gem_pwrite; struct drm_i915_gem_create create; - uint32_t buf[12], *b = buf; + uint32_t buf[16], *b = buf; memset(reloc, 0, sizeof(reloc)); - memset(gem_exec, 0, sizeof(gem_exec)); - memset(&execbuf, 0, sizeof(execbuf)); *b = COPY_BLT_CMD | BLT_WRITE_ALPHA | BLT_WRITE_RGB; if (has_64bit_relocations) @@ -93,8 +96,10 @@ *b++ = MI_BATCH_BUFFER_END; *b++ = 0; + memset(gem_exec, 0, sizeof(gem_exec)); gem_exec[0].handle = handle; + memset(&create, 0, sizeof(create)); create.handle = 0; create.size = 4096; drmIoctl(fd, DRM_IOCTL_I915_GEM_CREATE, &create); @@ -102,19 +107,22 @@ gem_exec[1].relocation_count = 2; gem_exec[1].relocs_ptr = (uintptr_t)reloc; + memset(&execbuf, 0, sizeof(execbuf)); execbuf.buffers_ptr = (uintptr_t)gem_exec; execbuf.buffer_count = 2; execbuf.batch_len = (b - buf) * sizeof(*b); if (HAS_BLT_RING(devid)) execbuf.flags |= I915_EXEC_BLT; - gem_pwrite.handle = gem_exec[1].handle; + memset(&gem_pwrite, 0, sizeof(gem_pwrite)); + gem_pwrite.handle = create.handle; gem_pwrite.offset = 0; - gem_pwrite.size = execbuf.batch_len; + gem_pwrite.size = sizeof(buf); gem_pwrite.data_ptr = (uintptr_t)buf; if (drmIoctl(fd, DRM_IOCTL_I915_GEM_PWRITE, &gem_pwrite) == 0) { - while (loops--) - drmIoctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, &execbuf); + while (loops-- && + drmIoctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, &execbuf) == 0) + ; } drmIoctl(fd, DRM_IOCTL_GEM_CLOSE, &create.handle); @@ -132,7 +140,7 @@ return handle; } -static void run(int child) +static void process(int child) { uint32_t handle; int fd; @@ -145,79 +153,58 @@ gem_read(fd, handle, 0, &handle, sizeof(handle)); } -#define NUM_FD 768 - -struct thread { - pthread_mutex_t mutex; - int device; - int fds[NUM_FD]; - int done; -}; +struct crashme { + int fd; +} crashme; -static void *thread_run(void *_data) +static void crashme_now(int sig) { - struct thread *t = _data; - uint32_t handle = gem_create(t->device, OBJECT_SIZE); - struct drm_gem_open arg = { gem_flink(t->device, handle) }; - - pthread_mutex_lock(&t->mutex); - while (!t->done) { - pthread_mutex_unlock(&t->mutex); - - for (int n = 0; n < NUM_FD; n++) { - int fd = t->fds[n]; - - arg.handle = 0; - drmIoctl(fd, DRM_IOCTL_GEM_OPEN, &arg); - if (arg.handle == 0) - continue; - - selfcopy(fd, arg.handle, 100); - - drmIoctl(fd, DRM_IOCTL_GEM_CLOSE, &arg.handle); - } - - pthread_mutex_lock(&t->mutex); - } - pthread_mutex_unlock(&t->mutex); - - gem_close(t->device, handle); - return 0; + close(crashme.fd); } -static void *thread_busy(void *_data) -{ - struct thread *t = _data; - uint32_t handle = gem_create(t->device, OBJECT_SIZE); - struct drm_gem_open arg = { gem_flink(t->device, handle) }; - - pthread_mutex_lock(&t->mutex); - while (!t->done) { - struct drm_i915_gem_busy busy; - int fd = t->fds[rand() % NUM_FD]; +#define usec(x) (1000*(x)) +#define msec(x) usec(1000*(x)) - pthread_mutex_unlock(&t->mutex); +static void threads(int timeout) +{ + struct sigevent sev; + struct sigaction act; + struct drm_gem_open name; + struct itimerspec its; + timer_t timer; + int fd; - arg.handle = 0; - drmIoctl(fd, DRM_IOCTL_GEM_OPEN, &arg); - if (arg.handle == 0) - continue; + memset(&act, 0, sizeof(act)); + act.sa_handler = crashme_now; + igt_assert(sigaction(SIGRTMIN, &act, NULL) == 0); + + memset(&sev, 0, sizeof(sev)); + sev.sigev_notify = SIGEV_SIGNAL | SIGEV_THREAD_ID; + sev.sigev_notify_thread_id = gettid(); + sev.sigev_signo = SIGRTMIN; + igt_assert(timer_create(CLOCK_MONOTONIC, &sev, &timer) == 0); - selfcopy(fd, arg.handle, 10); + fd = open(device, O_RDWR); + name.name = gem_flink(fd, gem_create(fd, OBJECT_SIZE)); - busy.handle = arg.handle; - drmIoctl(fd, DRM_IOCTL_I915_GEM_BUSY, &busy); + igt_until_timeout(timeout) { + crashme.fd = open(device, O_RDWR); - drmIoctl(fd, DRM_IOCTL_GEM_CLOSE, &arg.handle); + memset(&its, 0, sizeof(its)); + its.it_value.tv_nsec = msec(1) + (rand() % msec(10)); + igt_assert(timer_settime(timer, 0, &its, NULL) == 0); - usleep(10*1000); + do { + if (drmIoctl(crashme.fd, DRM_IOCTL_GEM_OPEN, &name)) + break; - pthread_mutex_lock(&t->mutex); + selfcopy(crashme.fd, name.handle, 100); + drmIoctl(crashme.fd, DRM_IOCTL_GEM_CLOSE, &name.handle); + } while (1); } - pthread_mutex_unlock(&t->mutex); - gem_close(t->device, handle); - return 0; + timer_delete(timer); + close(fd); } igt_main @@ -233,50 +220,29 @@ igt_assert(fd != -1); devid = intel_get_drm_devid(fd); has_64bit_relocations = intel_gen(devid) >= 8; + + igt_fork_hang_detector(fd); close(fd); } - igt_subtest("process-exit") { - igt_fork(child, NUM_FD) - run(child); + igt_subtest("basic-process") { + igt_fork(child, 1) + process(child); igt_waitchildren(); } - igt_subtest("gem-close-race") { - pthread_t thread[2]; - struct thread *data = calloc(1, sizeof(struct thread)); - int n; - - igt_assert(data); - - pthread_mutex_init(&data->mutex, NULL); - data->device = open(device, O_RDWR); - for (n = 0; n < NUM_FD; n++) - data->fds[n] = open(device, O_RDWR); - - pthread_create(&thread[0], NULL, thread_run, data); - pthread_create(&thread[1], NULL, thread_busy, data); - - for (n = 0; n < 1000*NUM_FD; n++) { - int i = rand() % NUM_FD; - if (data->fds[i] == -1) { - data->fds[i] = open(device, O_RDWR); - } else{ - close(data->fds[i]); - data->fds[i] = -1; - } - } - - pthread_mutex_lock(&data->mutex); - data->done = 1; - pthread_mutex_unlock(&data->mutex); - - pthread_join(thread[1], NULL); - pthread_join(thread[0], NULL); - - for (n = 0; n < NUM_FD; n++) - close(data->fds[n]); - close(data->device); - free(data); + igt_subtest("basic-threads") + threads(10); + + igt_subtest("process-exit") { + igt_fork(child, 768) + process(child); + igt_waitchildren(); } + + igt_subtest("gem-close-race") + threads(150); + + igt_fixture + igt_stop_hang_detector(); } diff -Nru intel-gpu-tools-1.13/tests/gem_concurrent_all.c intel-gpu-tools-1.15/tests/gem_concurrent_all.c --- intel-gpu-tools-1.13/tests/gem_concurrent_all.c 2015-11-30 16:26:22.000000000 +0000 +++ intel-gpu-tools-1.15/tests/gem_concurrent_all.c 2016-05-23 10:51:28.000000000 +0000 @@ -42,6 +42,7 @@ #include #include #include +#include #include #include #include @@ -54,8 +55,37 @@ " buffers."); int fd, devid, gen; -struct intel_batchbuffer *batch; int all; +int pass; + +struct create { + const char *name; + void (*require)(const struct create *, unsigned); + drm_intel_bo *(*create)(drm_intel_bufmgr *, uint64_t size); +}; + +struct size { + const char *name; + int width, height; +}; + +struct buffers { + const char *name; + const struct create *create; + const struct access_mode *mode; + const struct size *size; + drm_intel_bufmgr *bufmgr; + struct intel_batchbuffer *batch; + drm_intel_bo **src, **dst; + drm_intel_bo *snoop, *spare; + uint32_t *tmp; + int width, height, npixels; + int count, num_buffers; +}; + +#define MIN_BUFFERS 3 + +static void blt_copy_bo(struct buffers *b, drm_intel_bo *dst, drm_intel_bo *src); static void nop_release_bo(drm_intel_bo *bo) @@ -64,67 +94,340 @@ } static void -prw_set_bo(drm_intel_bo *bo, uint32_t val, int width, int height) +prw_set_bo(struct buffers *b, drm_intel_bo *bo, uint32_t val) { - int size = width * height, i; - uint32_t *tmp; - - tmp = malloc(4*size); - if (tmp) { - for (i = 0; i < size; i++) - tmp[i] = val; - drm_intel_bo_subdata(bo, 0, 4*size, tmp); - free(tmp); - } else { - for (i = 0; i < size; i++) - drm_intel_bo_subdata(bo, 4*i, 4, &val); - } + for (int i = 0; i < b->npixels; i++) + b->tmp[i] = val; + drm_intel_bo_subdata(bo, 0, 4*b->npixels, b->tmp); } static void -prw_cmp_bo(drm_intel_bo *bo, uint32_t val, int width, int height, drm_intel_bo *tmp) +prw_cmp_bo(struct buffers *b, drm_intel_bo *bo, uint32_t val) { - int size = width * height, i; uint32_t *vaddr; - do_or_die(drm_intel_bo_map(tmp, true)); - do_or_die(drm_intel_bo_get_subdata(bo, 0, 4*size, tmp->virtual)); - vaddr = tmp->virtual; - for (i = 0; i < size; i++) + vaddr = b->tmp; + do_or_die(drm_intel_bo_get_subdata(bo, 0, 4*b->npixels, vaddr)); + for (int i = 0; i < b->npixels; i++) igt_assert_eq_u32(vaddr[i], val); - drm_intel_bo_unmap(tmp); +} + +#define pixel(y, width) ((y)*(width) + (((y) + pass)%(width))) + +static void +partial_set_bo(struct buffers *b, drm_intel_bo *bo, uint32_t val) +{ + for (int y = 0; y < b->height; y++) + do_or_die(drm_intel_bo_subdata(bo, 4*pixel(y, b->width), 4, &val)); +} + +static void +partial_cmp_bo(struct buffers *b, drm_intel_bo *bo, uint32_t val) +{ + for (int y = 0; y < b->height; y++) { + uint32_t buf; + do_or_die(drm_intel_bo_get_subdata(bo, 4*pixel(y, b->width), 4, &buf)); + igt_assert_eq_u32(buf, val); + } } static drm_intel_bo * -unmapped_create_bo(drm_intel_bufmgr *bufmgr, int width, int height) +create_normal_bo(drm_intel_bufmgr *bufmgr, uint64_t size) { drm_intel_bo *bo; - bo = drm_intel_bo_alloc(bufmgr, "bo", 4*width*height, 0); + bo = drm_intel_bo_alloc(bufmgr, "bo", size, 0); igt_assert(bo); return bo; } +static void can_create_normal(const struct create *create, unsigned count) +{ +} + +#if HAVE_CREATE_PRIVATE +static drm_intel_bo * +create_private_bo(drm_intel_bufmgr *bufmgr, uint64_t size) +{ + drm_intel_bo *bo; + uint32_t handle; + + /* XXX gem_create_with_flags(fd, size, I915_CREATE_PRIVATE); */ + + handle = gem_create(fd, size); + bo = gem_handle_to_libdrm_bo(bufmgr, fd, "stolen", handle); + gem_close(fd, handle); + + return bo; +} + +static void can_create_private(const struct create *create, unsigned count) +{ + igt_require(0); +} +#endif + +#if HAVE_CREATE_STOLEN static drm_intel_bo * -snoop_create_bo(drm_intel_bufmgr *bufmgr, int width, int height) +create_stolen_bo(drm_intel_bufmgr *bufmgr, uint64_t size) { drm_intel_bo *bo; + uint32_t handle; - igt_skip_on(gem_has_llc(fd)); + /* XXX gem_create_with_flags(fd, size, I915_CREATE_STOLEN); */ - bo = unmapped_create_bo(bufmgr, width, height); + handle = gem_create(fd, size); + bo = gem_handle_to_libdrm_bo(bufmgr, fd, "stolen", handle); + gem_close(fd, handle); + + return bo; +} + +static void can_create_stolen(const struct create *create, unsigned count) +{ + /* XXX check num_buffers against available stolen */ + igt_require(0); +} +#endif + +static void create_cpu_require(const struct create *create, unsigned count) +{ +#if HAVE_CREATE_STOLEN + igt_require(create->create != create_stolen_bo); +#endif +} + +static drm_intel_bo * +unmapped_create_bo(const struct buffers *b) +{ + return b->create->create(b->bufmgr, 4*b->npixels); +} + +static void create_snoop_require(const struct create *create, unsigned count) +{ + create_cpu_require(create, count); + igt_require(!gem_has_llc(fd)); +} + +static drm_intel_bo * +snoop_create_bo(const struct buffers *b) +{ + drm_intel_bo *bo; + + bo = unmapped_create_bo(b); gem_set_caching(fd, bo->handle, I915_CACHING_CACHED); drm_intel_bo_disable_reuse(bo); return bo; } +static void create_userptr_require(const struct create *create, unsigned count) +{ + static int has_userptr = -1; + if (has_userptr < 0) { + struct drm_i915_gem_userptr arg; + + has_userptr = 0; + + memset(&arg, 0, sizeof(arg)); + arg.user_ptr = -4096ULL; + arg.user_size = 8192; + errno = 0; + drmIoctl(fd, LOCAL_IOCTL_I915_GEM_USERPTR, &arg); + if (errno == EFAULT) { + igt_assert(posix_memalign((void **)&arg.user_ptr, + 4096, arg.user_size) == 0); + has_userptr = drmIoctl(fd, + LOCAL_IOCTL_I915_GEM_USERPTR, + &arg) == 0; + free((void *)(uintptr_t)arg.user_ptr); + } + + } + igt_require(has_userptr); +} + +static drm_intel_bo * +userptr_create_bo(const struct buffers *b) +{ + struct local_i915_gem_userptr userptr; + drm_intel_bo *bo; + void *ptr; + + memset(&userptr, 0, sizeof(userptr)); + userptr.user_size = b->npixels * 4; + userptr.user_size = (userptr.user_size + 4095) & -4096; + + ptr = mmap(NULL, userptr.user_size, + PROT_READ | PROT_WRITE, MAP_ANON | MAP_SHARED, -1, 0); + igt_assert(ptr != (void *)-1); + userptr.user_ptr = (uintptr_t)ptr; + +#if 0 + do_or_die(drmIoctl(fd, LOCAL_IOCTL_I915_GEM_USERPTR, &userptr)); + bo = gem_handle_to_libdrm_bo(b->bufmgr, fd, "userptr", userptr.handle); + gem_close(fd, userptr.handle); +#else + bo = drm_intel_bo_alloc_userptr(b->bufmgr, "name", + ptr, I915_TILING_NONE, 0, + userptr.user_size, 0); + igt_assert(bo); +#endif + bo->virtual = (void *)(uintptr_t)userptr.user_ptr; + + return bo; +} + static void -gtt_set_bo(drm_intel_bo *bo, uint32_t val, int width, int height) +userptr_set_bo(struct buffers *b, drm_intel_bo *bo, uint32_t val) { + int size = b->npixels; uint32_t *vaddr = bo->virtual; - int size = width * height; + + gem_set_domain(fd, bo->handle, + I915_GEM_DOMAIN_CPU, I915_GEM_DOMAIN_CPU); + while (size--) + *vaddr++ = val; +} + +static void +userptr_cmp_bo(struct buffers *b, drm_intel_bo *bo, uint32_t val) +{ + int size = b->npixels; + uint32_t *vaddr = bo->virtual; + + gem_set_domain(fd, bo->handle, + I915_GEM_DOMAIN_CPU, 0); + while (size--) + igt_assert_eq_u32(*vaddr++, val); +} + +static void +userptr_release_bo(drm_intel_bo *bo) +{ + igt_assert(bo->virtual); + + munmap(bo->virtual, bo->size); + bo->virtual = NULL; + + drm_intel_bo_unreference(bo); +} + +static void create_dmabuf_require(const struct create *create, unsigned count) +{ + static int has_dmabuf = -1; + if (has_dmabuf < 0) { + struct drm_prime_handle args; + void *ptr; + + memset(&args, 0, sizeof(args)); + args.handle = gem_create(fd, 4096); + args.flags = DRM_RDWR; + args.fd = -1; + + drmIoctl(fd, DRM_IOCTL_PRIME_HANDLE_TO_FD, &args); + gem_close(fd, args.handle); + + has_dmabuf = 0; + ptr = mmap(NULL, 4096, PROT_READ, MAP_SHARED, args.fd, 0); + if (ptr != MAP_FAILED) { + has_dmabuf = 1; + munmap(ptr, 4096); + } + + close(args.fd); + } + igt_require(has_dmabuf); + intel_require_files(2*count); +} + +struct dmabuf { + int fd; + void *map; +}; + +static drm_intel_bo * +dmabuf_create_bo(const struct buffers *b) +{ + struct drm_prime_handle args; + drm_intel_bo *bo; + struct dmabuf *dmabuf; + int size; + + size = 4*b->npixels; + size = (size + 4095) & -4096; + + memset(&args, 0, sizeof(args)); + args.handle = gem_create(fd, size); + args.flags = DRM_RDWR; + args.fd = -1; + + do_ioctl(fd, DRM_IOCTL_PRIME_HANDLE_TO_FD, &args); + gem_close(fd, args.handle); + + bo = drm_intel_bo_gem_create_from_prime(b->bufmgr, args.fd, size); + igt_assert(bo); + + dmabuf = malloc(sizeof(*dmabuf)); + igt_assert(dmabuf); + + dmabuf->fd = args.fd; + dmabuf->map = mmap(NULL, size, + PROT_READ | PROT_WRITE, MAP_SHARED, + dmabuf->fd, 0); + igt_assert(dmabuf->map != (void *)-1); + + bo->virtual = dmabuf; + + return bo; +} + +static void +dmabuf_set_bo(struct buffers *b, drm_intel_bo *bo, uint32_t val) +{ + struct dmabuf *dmabuf = bo->virtual; + uint32_t *v; + int size; + + prime_sync_start(dmabuf->fd, true); + for (v = dmabuf->map, size = b->npixels; size--; v++) + *v = val; + prime_sync_end(dmabuf->fd, true); +} + +static void +dmabuf_cmp_bo(struct buffers *b, drm_intel_bo *bo, uint32_t val) +{ + struct dmabuf *dmabuf = bo->virtual; + uint32_t *v; + int size; + + prime_sync_start(dmabuf->fd, false); + for (v = dmabuf->map, size = b->npixels; size--; v++) + igt_assert_eq_u32(*v, val); + prime_sync_end(dmabuf->fd, false); +} + +static void +dmabuf_release_bo(drm_intel_bo *bo) +{ + struct dmabuf *dmabuf = bo->virtual; + igt_assert(dmabuf); + + munmap(dmabuf->map, bo->size); + close(dmabuf->fd); + free(dmabuf); + + bo->virtual = NULL; + drm_intel_bo_unreference(bo); +} + +static void +gtt_set_bo(struct buffers *b, drm_intel_bo *bo, uint32_t val) +{ + uint32_t *vaddr = bo->virtual; + int size = b->npixels; drm_intel_gem_bo_start_gtt_access(bo, true); while (size--) @@ -132,15 +435,14 @@ } static void -gtt_cmp_bo(drm_intel_bo *bo, uint32_t val, int width, int height, drm_intel_bo *tmp) +gtt_cmp_bo(struct buffers *b, drm_intel_bo *bo, uint32_t val) { uint32_t *vaddr = bo->virtual; - int y; /* GTT access is slow. So we just compare a few points */ drm_intel_gem_bo_start_gtt_access(bo, false); - for (y = 0; y < height; y++) - igt_assert_eq_u32(vaddr[y*width+y], val); + for (int y = 0; y < b->height; y++) + igt_assert_eq_u32(vaddr[pixel(y, b->width)], val); } static drm_intel_bo * @@ -166,32 +468,64 @@ } static drm_intel_bo * -gtt_create_bo(drm_intel_bufmgr *bufmgr, int width, int height) +gtt_create_bo(const struct buffers *b) { - return map_bo(unmapped_create_bo(bufmgr, width, height)); + return map_bo(unmapped_create_bo(b)); } static drm_intel_bo * -gttX_create_bo(drm_intel_bufmgr *bufmgr, int width, int height) +gttX_create_bo(const struct buffers *b) { - return tile_bo(gtt_create_bo(bufmgr, width, height), width); + return tile_bo(gtt_create_bo(b), b->width); } -static drm_intel_bo * -wc_create_bo(drm_intel_bufmgr *bufmgr, int width, int height) +static void bit17_require(void) { - drm_intel_bo *bo; + static struct drm_i915_gem_get_tiling2 { + uint32_t handle; + uint32_t tiling_mode; + uint32_t swizzle_mode; + uint32_t phys_swizzle_mode; + } arg; +#define DRM_IOCTL_I915_GEM_GET_TILING2 DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_GET_TILING, struct drm_i915_gem_get_tiling2) + + if (arg.handle == 0) { + arg.handle = gem_create(fd, 4096); + gem_set_tiling(fd, arg.handle, I915_TILING_X, 512); + do_ioctl(fd, DRM_IOCTL_I915_GEM_GET_TILING2, &arg); + gem_close(fd, arg.handle); + } + igt_require(arg.phys_swizzle_mode == arg.swizzle_mode); +} + +static void wc_require(void) +{ + bit17_require(); gem_require_mmap_wc(fd); +} + +static void +wc_create_require(const struct create *create, unsigned count) +{ + wc_require(); +} + +static drm_intel_bo * +wc_create_bo(const struct buffers *b) +{ + drm_intel_bo *bo; - bo = unmapped_create_bo(bufmgr, width, height); - bo->virtual = __gem_mmap__wc(fd, bo->handle, 0, bo->size, PROT_READ | PROT_WRITE); + bo = unmapped_create_bo(b); + bo->virtual = gem_mmap__wc(fd, bo->handle, 0, bo->size, PROT_READ | PROT_WRITE); return bo; } static void wc_release_bo(drm_intel_bo *bo) { + igt_assert(bo->virtual); + munmap(bo->virtual, bo->size); bo->virtual = NULL; @@ -199,22 +533,21 @@ } static drm_intel_bo * -gpu_create_bo(drm_intel_bufmgr *bufmgr, int width, int height) +gpu_create_bo(const struct buffers *b) { - return unmapped_create_bo(bufmgr, width, height); + return unmapped_create_bo(b); } - static drm_intel_bo * -gpuX_create_bo(drm_intel_bufmgr *bufmgr, int width, int height) +gpuX_create_bo(const struct buffers *b) { - return tile_bo(gpu_create_bo(bufmgr, width, height), width); + return tile_bo(gpu_create_bo(b), b->width); } static void -cpu_set_bo(drm_intel_bo *bo, uint32_t val, int width, int height) +cpu_set_bo(struct buffers *b, drm_intel_bo *bo, uint32_t val) { - int size = width * height; + int size = b->npixels; uint32_t *vaddr; do_or_die(drm_intel_bo_map(bo, true)); @@ -225,9 +558,9 @@ } static void -cpu_cmp_bo(drm_intel_bo *bo, uint32_t val, int width, int height, drm_intel_bo *tmp) +cpu_cmp_bo(struct buffers *b, drm_intel_bo *bo, uint32_t val) { - int size = width * height; + int size = b->npixels; uint32_t *vaddr; do_or_die(drm_intel_bo_map(bo, false)); @@ -238,13 +571,11 @@ } static void -gpu_set_bo(drm_intel_bo *bo, uint32_t val, int width, int height) +gpu_set_bo(struct buffers *buffers, drm_intel_bo *bo, uint32_t val) { struct drm_i915_gem_relocation_entry reloc[1]; struct drm_i915_gem_exec_object2 gem_exec[2]; struct drm_i915_gem_execbuffer2 execbuf; - struct drm_i915_gem_pwrite gem_pwrite; - struct drm_i915_gem_create create; uint32_t buf[10], *b; uint32_t tiling, swizzle; @@ -260,12 +591,12 @@ COLOR_BLT_WRITE_ALPHA | XY_COLOR_BLT_WRITE_RGB; if (gen >= 4 && tiling) { b[-1] |= XY_COLOR_BLT_TILED; - *b = width; + *b = buffers->width; } else - *b = width << 2; + *b = buffers->width << 2; *b++ |= 0xf0 << 16 | 1 << 25 | 1 << 24; *b++ = 0; - *b++ = height << 16 | width; + *b++ = buffers->height << 16 | buffers->width; reloc[0].offset = (b - buf) * sizeof(uint32_t); reloc[0].target_handle = bo->handle; reloc[0].read_domains = I915_GEM_DOMAIN_RENDER; @@ -281,10 +612,7 @@ gem_exec[0].handle = bo->handle; gem_exec[0].flags = EXEC_OBJECT_NEEDS_FENCE; - create.handle = 0; - create.size = 4096; - drmIoctl(fd, DRM_IOCTL_I915_GEM_CREATE, &create); - gem_exec[1].handle = create.handle; + gem_exec[1].handle = gem_create(fd, 4096); gem_exec[1].relocation_count = 1; gem_exec[1].relocs_ptr = (uintptr_t)reloc; @@ -294,200 +622,217 @@ if (gen >= 6) execbuf.flags = I915_EXEC_BLT; - gem_pwrite.handle = gem_exec[1].handle; - gem_pwrite.offset = 0; - gem_pwrite.size = execbuf.batch_len; - gem_pwrite.data_ptr = (uintptr_t)buf; - do_ioctl(fd, DRM_IOCTL_I915_GEM_PWRITE, &gem_pwrite); - do_ioctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, &execbuf); + gem_write(fd, gem_exec[1].handle, 0, buf, execbuf.batch_len); + gem_execbuf(fd, &execbuf); - drmIoctl(fd, DRM_IOCTL_GEM_CLOSE, &create.handle); + gem_close(fd, gem_exec[1].handle); } static void -gpu_cmp_bo(drm_intel_bo *bo, uint32_t val, int width, int height, drm_intel_bo *tmp) +gpu_cmp_bo(struct buffers *b, drm_intel_bo *bo, uint32_t val) { - intel_blt_copy(batch, - bo, 0, 0, 4*width, - tmp, 0, 0, 4*width, - width, height, 32); - cpu_cmp_bo(tmp, val, width, height, NULL); + blt_copy_bo(b, b->snoop, bo); + cpu_cmp_bo(b, b->snoop, val); } -const struct access_mode { +struct access_mode { const char *name; - void (*set_bo)(drm_intel_bo *bo, uint32_t val, int w, int h); - void (*cmp_bo)(drm_intel_bo *bo, uint32_t val, int w, int h, drm_intel_bo *tmp); - drm_intel_bo *(*create_bo)(drm_intel_bufmgr *bufmgr, int width, int height); + void (*require)(const struct create *, unsigned); + drm_intel_bo *(*create_bo)(const struct buffers *b); + void (*set_bo)(struct buffers *b, drm_intel_bo *bo, uint32_t val); + void (*cmp_bo)(struct buffers *b, drm_intel_bo *bo, uint32_t val); void (*release_bo)(drm_intel_bo *bo); -} access_modes[] = { - { - .name = "prw", - .set_bo = prw_set_bo, - .cmp_bo = prw_cmp_bo, - .create_bo = unmapped_create_bo, - .release_bo = nop_release_bo, - }, - { - .name = "cpu", - .set_bo = cpu_set_bo, - .cmp_bo = cpu_cmp_bo, - .create_bo = unmapped_create_bo, - .release_bo = nop_release_bo, - }, - { - .name = "snoop", - .set_bo = cpu_set_bo, - .cmp_bo = cpu_cmp_bo, - .create_bo = snoop_create_bo, - .release_bo = nop_release_bo, - }, - { - .name = "gtt", - .set_bo = gtt_set_bo, - .cmp_bo = gtt_cmp_bo, - .create_bo = gtt_create_bo, - .release_bo = nop_release_bo, - }, - { - .name = "gttX", - .set_bo = gtt_set_bo, - .cmp_bo = gtt_cmp_bo, - .create_bo = gttX_create_bo, - .release_bo = nop_release_bo, - }, - { - .name = "wc", - .set_bo = gtt_set_bo, - .cmp_bo = gtt_cmp_bo, - .create_bo = wc_create_bo, - .release_bo = wc_release_bo, - }, - { - .name = "gpu", - .set_bo = gpu_set_bo, - .cmp_bo = gpu_cmp_bo, - .create_bo = gpu_create_bo, - .release_bo = nop_release_bo, - }, - { - .name = "gpuX", - .set_bo = gpu_set_bo, - .cmp_bo = gpu_cmp_bo, - .create_bo = gpuX_create_bo, - .release_bo = nop_release_bo, - }, }; - -#define MAX_NUM_BUFFERS 1024 -int num_buffers = MAX_NUM_BUFFERS; -const int width = 512, height = 512; igt_render_copyfunc_t rendercopy; -struct buffers { - const struct access_mode *mode; - drm_intel_bufmgr *bufmgr; - drm_intel_bo *src[MAX_NUM_BUFFERS], *dst[MAX_NUM_BUFFERS]; - drm_intel_bo *dummy, *spare; - int count; -}; +static int read_sysctl(const char *path) +{ + FILE *file = fopen(path, "r"); + int max = 0; + if (file) { + if (fscanf(file, "%d", &max) != 1) + max = 0; /* silence! */ + fclose(file); + } + return max; +} -static void *buffers_init(struct buffers *data, - const struct access_mode *mode, - int _fd) +static int write_sysctl(const char *path, int value) { - data->mode = mode; - data->count = 0; + FILE *file = fopen(path, "w"); + if (file) { + fprintf(file, "%d", value); + fclose(file); + } + return read_sysctl(path); +} + +static bool set_max_map_count(int num_buffers) +{ + int max = read_sysctl("/proc/sys/vm/max_map_count"); + if (max < num_buffers + 1024) + max = write_sysctl("/proc/sys/vm/max_map_count", + num_buffers + 1024); + return max > num_buffers; +} + +static void buffers_init(struct buffers *b, + const char *name, + const struct create *create, + const struct access_mode *mode, + const struct size *size, + int num_buffers, + int _fd, int enable_reuse) +{ + memset(b, 0, sizeof(*b)); + b->name = name; + b->create = create; + b->mode = mode; + b->size = size; + b->num_buffers = num_buffers; + b->count = 0; + + b->width = size->width; + b->height = size->height; + b->npixels = size->width * size->height; + b->tmp = malloc(4*b->npixels); + igt_assert(b->tmp); + + b->bufmgr = drm_intel_bufmgr_gem_init(_fd, 4096); + igt_assert(b->bufmgr); - data->bufmgr = drm_intel_bufmgr_gem_init(_fd, 4096); - igt_assert(data->bufmgr); + b->src = malloc(2*sizeof(drm_intel_bo *)*num_buffers); + igt_assert(b->src); + b->dst = b->src + num_buffers; - drm_intel_bufmgr_gem_enable_reuse(data->bufmgr); - return intel_batchbuffer_alloc(data->bufmgr, devid); + if (enable_reuse) + drm_intel_bufmgr_gem_enable_reuse(b->bufmgr); + b->batch = intel_batchbuffer_alloc(b->bufmgr, devid); + igt_assert(b->batch); } -static void buffers_destroy(struct buffers *data) +static void buffers_destroy(struct buffers *b) { - if (data->count == 0) + int count = b->count; + if (count == 0) return; - for (int i = 0; i < data->count; i++) { - data->mode->release_bo(data->src[i]); - data->mode->release_bo(data->dst[i]); + /* Be safe so that we can clean up a partial creation */ + b->count = 0; + for (int i = 0; i < count; i++) { + if (b->src[i]) { + b->mode->release_bo(b->src[i]); + b->src[i] = NULL; + } else + break; + + if (b->dst[i]) { + b->mode->release_bo(b->dst[i]); + b->dst[i] = NULL; + } + } + if (b->snoop) { + nop_release_bo(b->snoop); + b->snoop = NULL; + } + if (b->spare) { + b->mode->release_bo(b->spare); + b->spare = NULL; } - data->mode->release_bo(data->dummy); - data->mode->release_bo(data->spare); - data->count = 0; } -static void buffers_create(struct buffers *data, - int count) +static void buffers_create(struct buffers *b) { - igt_assert(data->bufmgr); + int count = b->num_buffers; + igt_assert(b->bufmgr); - buffers_destroy(data); + buffers_destroy(b); + igt_assert(b->count == 0); + b->count = count; for (int i = 0; i < count; i++) { - data->src[i] = - data->mode->create_bo(data->bufmgr, width, height); - data->dst[i] = - data->mode->create_bo(data->bufmgr, width, height); + b->src[i] = b->mode->create_bo(b); + b->dst[i] = b->mode->create_bo(b); } - data->dummy = data->mode->create_bo(data->bufmgr, width, height); - data->spare = data->mode->create_bo(data->bufmgr, width, height); - data->count = count; + b->spare = b->mode->create_bo(b); + b->snoop = snoop_create_bo(b); } -static void buffers_fini(struct buffers *data) +static void buffers_reset(struct buffers *b, bool enable_reuse) { - if (data->bufmgr == NULL) + buffers_destroy(b); + + igt_assert(b->count == 0); + igt_assert(b->tmp); + igt_assert(b->src); + igt_assert(b->dst); + + intel_batchbuffer_free(b->batch); + drm_intel_bufmgr_destroy(b->bufmgr); + + b->bufmgr = drm_intel_bufmgr_gem_init(fd, 4096); + igt_assert(b->bufmgr); + + if (enable_reuse) + drm_intel_bufmgr_gem_enable_reuse(b->bufmgr); + b->batch = intel_batchbuffer_alloc(b->bufmgr, devid); + igt_assert(b->batch); +} + +static void buffers_fini(struct buffers *b) +{ + if (b->bufmgr == NULL) return; - buffers_destroy(data); + buffers_destroy(b); + + free(b->tmp); + free(b->src); + + intel_batchbuffer_free(b->batch); + drm_intel_bufmgr_destroy(b->bufmgr); - intel_batchbuffer_free(batch); - drm_intel_bufmgr_destroy(data->bufmgr); - data->bufmgr = NULL; + memset(b, 0, sizeof(*b)); } -typedef void (*do_copy)(drm_intel_bo *dst, drm_intel_bo *src); +typedef void (*do_copy)(struct buffers *b, drm_intel_bo *dst, drm_intel_bo *src); typedef struct igt_hang_ring (*do_hang)(void); -static void render_copy_bo(drm_intel_bo *dst, drm_intel_bo *src) +static void render_copy_bo(struct buffers *b, drm_intel_bo *dst, drm_intel_bo *src) { struct igt_buf d = { .bo = dst, - .size = width * height * 4, - .num_tiles = width * height * 4, - .stride = width * 4, + .size = b->npixels * 4, + .num_tiles = b->npixels * 4, + .stride = b->width * 4, }, s = { .bo = src, - .size = width * height * 4, - .num_tiles = width * height * 4, - .stride = width * 4, + .size = b->npixels * 4, + .num_tiles = b->npixels * 4, + .stride = b->width * 4, }; uint32_t swizzle; drm_intel_bo_get_tiling(dst, &d.tiling, &swizzle); drm_intel_bo_get_tiling(src, &s.tiling, &swizzle); - rendercopy(batch, NULL, + rendercopy(b->batch, NULL, &s, 0, 0, - width, height, + b->width, b->height, &d, 0, 0); } -static void blt_copy_bo(drm_intel_bo *dst, drm_intel_bo *src) +static void blt_copy_bo(struct buffers *b, drm_intel_bo *dst, drm_intel_bo *src) { - intel_blt_copy(batch, - src, 0, 0, 4*width, - dst, 0, 0, 4*width, - width, height, 32); + intel_blt_copy(b->batch, + src, 0, 0, 4*b->width, + dst, 0, 0, 4*b->width, + b->width, b->height, 32); } -static void cpu_copy_bo(drm_intel_bo *dst, drm_intel_bo *src) +static void cpu_copy_bo(struct buffers *b, drm_intel_bo *dst, drm_intel_bo *src) { - const int size = width * height * sizeof(uint32_t); + const int size = b->npixels * sizeof(uint32_t); void *d, *s; gem_set_domain(fd, src->handle, I915_GEM_DOMAIN_CPU, 0); @@ -501,9 +846,9 @@ munmap(s, size); } -static void gtt_copy_bo(drm_intel_bo *dst, drm_intel_bo *src) +static void gtt_copy_bo(struct buffers *b, drm_intel_bo *dst, drm_intel_bo *src) { - const int size = width * height * sizeof(uint32_t); + const int size = b->npixels * sizeof(uint32_t); void *d, *s; gem_set_domain(fd, src->handle, I915_GEM_DOMAIN_GTT, 0); @@ -518,9 +863,9 @@ munmap(s, size); } -static void wc_copy_bo(drm_intel_bo *dst, drm_intel_bo *src) +static void wc_copy_bo(struct buffers *b, drm_intel_bo *dst, drm_intel_bo *src) { - const int size = width * height * sizeof(uint32_t); + const int size = b->width * sizeof(uint32_t); void *d, *s; gem_set_domain(fd, src->handle, I915_GEM_DOMAIN_GTT, 0); @@ -550,9 +895,96 @@ return igt_hang_ring(fd, I915_EXEC_RENDER); } -static void hang_require(void) +static struct igt_hang_ring all_hang(void) +{ + uint32_t bbe = MI_BATCH_BUFFER_END; + struct drm_i915_gem_execbuffer2 execbuf; + struct drm_i915_gem_exec_object2 obj; + struct igt_hang_ring hang; + unsigned engine; + + memset(&obj, 0, sizeof(obj)); + obj.handle = gem_create(fd, 4096); + gem_write(fd, obj.handle, 0, &bbe, sizeof(&bbe)); + + memset(&execbuf, 0, sizeof(execbuf)); + execbuf.buffers_ptr = (uintptr_t)&obj; + execbuf.buffer_count = 1; + + for_each_engine(fd, engine) { + hang = igt_hang_ring(fd, engine); + + execbuf.flags = engine; + __gem_execbuf(fd, &execbuf); + + gem_close(fd, hang.handle); + } + + hang.handle = obj.handle; + return hang; +} + +static void do_basic0(struct buffers *buffers, + do_copy do_copy_func, + do_hang do_hang_func) +{ + gem_quiescent_gpu(fd); + + buffers->mode->set_bo(buffers, buffers->src[0], 0xdeadbeef); + for (int i = 0; i < buffers->count; i++) { + struct igt_hang_ring hang = do_hang_func(); + + do_copy_func(buffers, buffers->dst[i], buffers->src[0]); + buffers->mode->cmp_bo(buffers, buffers->dst[i], 0xdeadbeef); + + igt_post_hang_ring(fd, hang); + } +} + +static void do_basic1(struct buffers *buffers, + do_copy do_copy_func, + do_hang do_hang_func) { - igt_require_hang_ring(fd, -1); + gem_quiescent_gpu(fd); + + for (int i = 0; i < buffers->count; i++) { + struct igt_hang_ring hang = do_hang_func(); + + buffers->mode->set_bo(buffers, buffers->src[i], i); + buffers->mode->set_bo(buffers, buffers->dst[i], ~i); + + do_copy_func(buffers, buffers->dst[i], buffers->src[i]); + usleep(0); /* let someone else claim the mutex */ + buffers->mode->cmp_bo(buffers, buffers->dst[i], i); + + igt_post_hang_ring(fd, hang); + } +} + +static void do_basicN(struct buffers *buffers, + do_copy do_copy_func, + do_hang do_hang_func) +{ + struct igt_hang_ring hang; + + gem_quiescent_gpu(fd); + + for (int i = 0; i < buffers->count; i++) { + buffers->mode->set_bo(buffers, buffers->src[i], i); + buffers->mode->set_bo(buffers, buffers->dst[i], ~i); + } + + hang = do_hang_func(); + + for (int i = 0; i < buffers->count; i++) { + do_copy_func(buffers, buffers->dst[i], buffers->src[i]); + usleep(0); /* let someone else claim the mutex */ + } + + for (int i = 0; i < buffers->count; i++) + buffers->mode->cmp_bo(buffers, buffers->dst[i], i); + + igt_post_hang_ring(fd, hang); } static void do_overwrite_source(struct buffers *buffers, @@ -564,16 +996,16 @@ gem_quiescent_gpu(fd); for (i = 0; i < buffers->count; i++) { - buffers->mode->set_bo(buffers->src[i], i, width, height); - buffers->mode->set_bo(buffers->dst[i], ~i, width, height); + buffers->mode->set_bo(buffers, buffers->src[i], i); + buffers->mode->set_bo(buffers, buffers->dst[i], ~i); } for (i = 0; i < buffers->count; i++) - do_copy_func(buffers->dst[i], buffers->src[i]); + do_copy_func(buffers, buffers->dst[i], buffers->src[i]); hang = do_hang_func(); for (i = buffers->count; i--; ) - buffers->mode->set_bo(buffers->src[i], 0xdeadbeef, width, height); + buffers->mode->set_bo(buffers, buffers->src[i], 0xdeadbeef); for (i = 0; i < buffers->count; i++) - buffers->mode->cmp_bo(buffers->dst[i], i, width, height, buffers->dummy); + buffers->mode->cmp_bo(buffers, buffers->dst[i], i); igt_post_hang_ring(fd, hang); } @@ -588,23 +1020,23 @@ gem_quiescent_gpu(fd); for (i = 0; i < half; i++) { - buffers->mode->set_bo(buffers->src[i], i, width, height); - buffers->mode->set_bo(buffers->dst[i], ~i, width, height); - buffers->mode->set_bo(buffers->dst[i+half], ~i, width, height); + buffers->mode->set_bo(buffers, buffers->src[i], i); + buffers->mode->set_bo(buffers, buffers->dst[i], ~i); + buffers->mode->set_bo(buffers, buffers->dst[i+half], ~i); } for (i = 0; i < half; i++) { - do_copy_func(buffers->dst[i], buffers->src[i]); + do_copy_func(buffers, buffers->dst[i], buffers->src[i]); if (do_rcs) - render_copy_bo(buffers->dst[i+half], buffers->src[i]); + render_copy_bo(buffers, buffers->dst[i+half], buffers->src[i]); else - blt_copy_bo(buffers->dst[i+half], buffers->src[i]); + blt_copy_bo(buffers, buffers->dst[i+half], buffers->src[i]); } hang = do_hang_func(); for (i = half; i--; ) - buffers->mode->set_bo(buffers->src[i], 0xdeadbeef, width, height); + buffers->mode->set_bo(buffers, buffers->src[i], 0xdeadbeef); for (i = 0; i < half; i++) { - buffers->mode->cmp_bo(buffers->dst[i], i, width, height, buffers->dummy); - buffers->mode->cmp_bo(buffers->dst[i+half], i, width, height, buffers->dummy); + buffers->mode->cmp_bo(buffers, buffers->dst[i], i); + buffers->mode->cmp_bo(buffers, buffers->dst[i+half], i); } igt_post_hang_ring(fd, hang); } @@ -632,16 +1064,16 @@ gem_quiescent_gpu(fd); for (i = 0; i < buffers->count; i++) { - buffers->mode->set_bo(buffers->src[i], i, width, height); - buffers->mode->set_bo(buffers->dst[i], ~i, width, height); + buffers->mode->set_bo(buffers, buffers->src[i], i); + buffers->mode->set_bo(buffers, buffers->dst[i], ~i); } for (i = 0; i < buffers->count; i++) - do_copy_func(buffers->dst[i], buffers->src[i]); + do_copy_func(buffers, buffers->dst[i], buffers->src[i]); hang = do_hang_func(); for (i = 0; i < buffers->count; i++) - buffers->mode->set_bo(buffers->src[i], 0xdeadbeef, width, height); + buffers->mode->set_bo(buffers, buffers->src[i], 0xdeadbeef); for (i = buffers->count; i--; ) - buffers->mode->cmp_bo(buffers->dst[i], i, width, height, buffers->dummy); + buffers->mode->cmp_bo(buffers, buffers->dst[i], i); igt_post_hang_ring(fd, hang); } @@ -652,12 +1084,12 @@ struct igt_hang_ring hang; gem_quiescent_gpu(fd); - buffers->mode->set_bo(buffers->src[0], 0, width, height); - buffers->mode->set_bo(buffers->dst[0], ~0, width, height); - do_copy_func(buffers->dst[0], buffers->src[0]); + buffers->mode->set_bo(buffers, buffers->src[0], 0); + buffers->mode->set_bo(buffers, buffers->dst[0], ~0); + do_copy_func(buffers, buffers->dst[0], buffers->src[0]); hang = do_hang_func(); - buffers->mode->set_bo(buffers->src[0], 0xdeadbeef, width, height); - buffers->mode->cmp_bo(buffers->dst[0], 0, width, height, buffers->dummy); + buffers->mode->set_bo(buffers, buffers->src[0], 0xdeadbeef); + buffers->mode->cmp_bo(buffers, buffers->dst[0], 0); igt_post_hang_ring(fd, hang); } @@ -672,27 +1104,27 @@ gem_quiescent_gpu(fd); for (i = 0; i < buffers->count; i++) { - buffers->mode->set_bo(buffers->src[i], 0xdeadbeef^~i, width, height); - buffers->mode->set_bo(buffers->dst[i], i, width, height); + buffers->mode->set_bo(buffers, buffers->src[i], 0xdeadbeef^~i); + buffers->mode->set_bo(buffers, buffers->dst[i], i); } for (i = 0; i < half; i++) { if (do_rcs == 1 || (do_rcs == -1 && i & 1)) - render_copy_bo(buffers->dst[i], buffers->src[i]); + render_copy_bo(buffers, buffers->dst[i], buffers->src[i]); else - blt_copy_bo(buffers->dst[i], buffers->src[i]); + blt_copy_bo(buffers, buffers->dst[i], buffers->src[i]); - do_copy_func(buffers->dst[i+half], buffers->src[i]); + do_copy_func(buffers, buffers->dst[i+half], buffers->src[i]); if (do_rcs == 1 || (do_rcs == -1 && (i & 1) == 0)) - render_copy_bo(buffers->dst[i], buffers->dst[i+half]); + render_copy_bo(buffers, buffers->dst[i], buffers->dst[i+half]); else - blt_copy_bo(buffers->dst[i], buffers->dst[i+half]); + blt_copy_bo(buffers, buffers->dst[i], buffers->dst[i+half]); - do_copy_func(buffers->dst[i+half], buffers->src[i+half]); + do_copy_func(buffers, buffers->dst[i+half], buffers->src[i+half]); } hang = do_hang_func(); for (i = 0; i < 2*half; i++) - buffers->mode->cmp_bo(buffers->dst[i], 0xdeadbeef^~i, width, height, buffers->dummy); + buffers->mode->cmp_bo(buffers, buffers->dst[i], 0xdeadbeef^~i); igt_post_hang_ring(fd, hang); } @@ -726,12 +1158,12 @@ gem_quiescent_gpu(fd); for (i = buffers->count; i--; ) - buffers->mode->set_bo(buffers->src[i], 0xdeadbeef, width, height); + buffers->mode->set_bo(buffers, buffers->src[i], 0xdeadbeef); for (i = 0; i < buffers->count; i++) - do_copy_func(buffers->dst[i], buffers->src[i]); + do_copy_func(buffers, buffers->dst[i], buffers->src[i]); hang = do_hang_func(); for (i = buffers->count; i--; ) - buffers->mode->cmp_bo(buffers->dst[i], 0xdeadbeef, width, height, buffers->dummy); + buffers->mode->cmp_bo(buffers, buffers->dst[i], 0xdeadbeef); igt_post_hang_ring(fd, hang); } @@ -744,15 +1176,15 @@ gem_quiescent_gpu(fd); for (i = buffers->count; i--; ) - buffers->mode->set_bo(buffers->src[i], 0xdeadbeef ^ i, width, height); + buffers->mode->set_bo(buffers, buffers->src[i], 0xdeadbeef ^ i); for (i = 0; i < buffers->count; i++) { - do_copy_func(buffers->dst[i], buffers->src[i]); - blt_copy_bo(buffers->spare, buffers->src[i]); + do_copy_func(buffers, buffers->dst[i], buffers->src[i]); + blt_copy_bo(buffers, buffers->spare, buffers->src[i]); } - cpu_cmp_bo(buffers->spare, 0xdeadbeef^(buffers->count-1), width, height, NULL); + buffers->mode->cmp_bo(buffers, buffers->spare, 0xdeadbeef^(buffers->count-1)); hang = do_hang_func(); for (i = buffers->count; i--; ) - buffers->mode->cmp_bo(buffers->dst[i], 0xdeadbeef ^ i, width, height, buffers->dummy); + buffers->mode->cmp_bo(buffers, buffers->dst[i], 0xdeadbeef ^ i); igt_post_hang_ring(fd, hang); } @@ -765,14 +1197,14 @@ gem_quiescent_gpu(fd); for (i = buffers->count; i--; ) - buffers->mode->set_bo(buffers->src[i], 0xdeadbeef ^ i, width, height); + buffers->mode->set_bo(buffers, buffers->src[i], 0xdeadbeef ^ i); for (i = 0; i < buffers->count; i++) { - blt_copy_bo(buffers->spare, buffers->src[i]); - do_copy_func(buffers->dst[i], buffers->spare); + blt_copy_bo(buffers, buffers->spare, buffers->src[i]); + do_copy_func(buffers, buffers->dst[i], buffers->spare); } hang = do_hang_func(); for (i = buffers->count; i--; ) - buffers->mode->cmp_bo(buffers->dst[i], 0xdeadbeef ^ i, width, height, buffers->dummy); + buffers->mode->cmp_bo(buffers, buffers->dst[i], 0xdeadbeef ^ i); igt_post_hang_ring(fd, hang); } @@ -785,15 +1217,15 @@ gem_quiescent_gpu(fd); for (i = buffers->count; i--; ) - buffers->mode->set_bo(buffers->src[i], 0xdeadbeef ^ i, width, height); + buffers->mode->set_bo(buffers, buffers->src[i], 0xdeadbeef ^ i); for (i = 0; i < buffers->count; i++) { - do_copy_func(buffers->dst[i], buffers->src[i]); - render_copy_bo(buffers->spare, buffers->src[i]); + do_copy_func(buffers, buffers->dst[i], buffers->src[i]); + render_copy_bo(buffers, buffers->spare, buffers->src[i]); } - cpu_cmp_bo(buffers->spare, 0xdeadbeef^(buffers->count-1), width, height, NULL); + buffers->mode->cmp_bo(buffers, buffers->spare, 0xdeadbeef^(buffers->count-1)); hang = do_hang_func(); for (i = buffers->count; i--; ) - buffers->mode->cmp_bo(buffers->dst[i], 0xdeadbeef ^ i, width, height, buffers->dummy); + buffers->mode->cmp_bo(buffers, buffers->dst[i], 0xdeadbeef ^ i); igt_post_hang_ring(fd, hang); } @@ -806,14 +1238,14 @@ gem_quiescent_gpu(fd); for (i = buffers->count; i--; ) - buffers->mode->set_bo(buffers->src[i], 0xdeadbeef ^ i, width, height); + buffers->mode->set_bo(buffers, buffers->src[i], 0xdeadbeef ^ i); for (i = 0; i < buffers->count; i++) { - render_copy_bo(buffers->spare, buffers->src[i]); - do_copy_func(buffers->dst[i], buffers->spare); + render_copy_bo(buffers, buffers->spare, buffers->src[i]); + do_copy_func(buffers, buffers->dst[i], buffers->spare); } hang = do_hang_func(); for (i = buffers->count; i--; ) - buffers->mode->cmp_bo(buffers->dst[i], 0xdeadbeef ^ i, width, height, buffers->dummy); + buffers->mode->cmp_bo(buffers, buffers->dst[i], 0xdeadbeef ^ i); igt_post_hang_ring(fd, hang); } @@ -826,14 +1258,14 @@ gem_quiescent_gpu(fd); for (i = buffers->count; i--; ) - buffers->mode->set_bo(buffers->src[i], 0xabcdabcd, width, height); + buffers->mode->set_bo(buffers, buffers->src[i], 0xabcdabcd); for (i = 0; i < buffers->count; i++) - do_copy_func(buffers->dst[i], buffers->src[i]); + do_copy_func(buffers, buffers->dst[i], buffers->src[i]); for (i = buffers->count; i--; ) - do_copy_func(buffers->dummy, buffers->dst[i]); + do_copy_func(buffers, buffers->spare, buffers->dst[i]); hang = do_hang_func(); for (i = buffers->count; i--; ) - buffers->mode->cmp_bo(buffers->dst[i], 0xabcdabcd, width, height, buffers->dummy); + buffers->mode->cmp_bo(buffers, buffers->dst[i], 0xabcdabcd); igt_post_hang_ring(fd, hang); } @@ -851,7 +1283,9 @@ do_copy do_copy_func, do_hang do_hang_func) { + pass = 0; do_test_func(buffers, do_copy_func, do_hang_func); + igt_assert_eq(intel_detect_and_clear_missed_interrupts(fd), 0); } static void run_interruptible(struct buffers *buffers, @@ -859,58 +1293,82 @@ do_copy do_copy_func, do_hang do_hang_func) { - int loop; + pass = 0; + igt_while_interruptible(true) + do_test_func(buffers, do_copy_func, do_hang_func); + igt_assert_eq(intel_detect_and_clear_missed_interrupts(fd), 0); +} + +static void run_child(struct buffers *buffers, + do_test do_test_func, + do_copy do_copy_func, + do_hang do_hang_func) - for (loop = 0; loop < 10; loop++) +{ + /* We inherit the buffers from the parent, but the bufmgr/batch + * needs to be local as the cache of reusable itself will be COWed, + * leading to the child closing an object without the parent knowing. + */ + pass = 0; + igt_fork(child, 1) do_test_func(buffers, do_copy_func, do_hang_func); + igt_waitchildren(); + igt_assert_eq(intel_detect_and_clear_missed_interrupts(fd), 0); } -static void run_forked(struct buffers *buffers, - do_test do_test_func, - do_copy do_copy_func, - do_hang do_hang_func) +static void __run_forked(struct buffers *buffers, + int num_children, int loops, bool interrupt, + do_test do_test_func, + do_copy do_copy_func, + do_hang do_hang_func) + { - const int old_num_buffers = num_buffers; + /* purge the libdrm caches before cloing the process */ + buffers_reset(buffers, true); - num_buffers /= 16; - num_buffers += 2; + igt_fork(child, num_children) { + int num_buffers; - igt_fork(child, 16) { /* recreate process local variables */ - buffers->count = 0; fd = drm_open_driver(DRIVER_INTEL); - batch = buffers_init(buffers, buffers->mode, fd); - - buffers_create(buffers, num_buffers); - for (int loop = 0; loop < 10; loop++) - do_test_func(buffers, do_copy_func, do_hang_func); - - buffers_fini(buffers); + num_buffers = buffers->num_buffers / num_children; + num_buffers += MIN_BUFFERS; + if (num_buffers < buffers->num_buffers) + buffers->num_buffers = num_buffers; + + buffers_reset(buffers, true); + buffers_create(buffers); + + igt_while_interruptible(interrupt) { + for (pass = 0; pass < loops; pass++) + do_test_func(buffers, + do_copy_func, + do_hang_func); + } } - igt_waitchildren(); - - num_buffers = old_num_buffers; + igt_assert_eq(intel_detect_and_clear_missed_interrupts(fd), 0); } -static void bit17_require(void) +static void run_forked(struct buffers *buffers, + do_test do_test_func, + do_copy do_copy_func, + do_hang do_hang_func) { - struct drm_i915_gem_get_tiling2 { - uint32_t handle; - uint32_t tiling_mode; - uint32_t swizzle_mode; - uint32_t phys_swizzle_mode; - } arg; -#define DRM_IOCTL_I915_GEM_GET_TILING2 DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_GET_TILING, struct drm_i915_gem_get_tiling2) - - memset(&arg, 0, sizeof(arg)); - arg.handle = gem_create(fd, 4096); - gem_set_tiling(fd, arg.handle, I915_TILING_X, 512); + const int ncpus = sysconf(_SC_NPROCESSORS_ONLN); + __run_forked(buffers, ncpus, ncpus, false, + do_test_func, do_copy_func, do_hang_func); +} - do_ioctl(fd, DRM_IOCTL_I915_GEM_GET_TILING2, &arg); - gem_close(fd, arg.handle); - igt_require(arg.phys_swizzle_mode == arg.swizzle_mode); +static void run_bomb(struct buffers *buffers, + do_test do_test_func, + do_copy do_copy_func, + do_hang do_hang_func) +{ + const int ncpus = sysconf(_SC_NPROCESSORS_ONLN); + __run_forked(buffers, 8*ncpus, 2, true, + do_test_func, do_copy_func, do_hang_func); } static void cpu_require(void) @@ -922,12 +1380,6 @@ { } -static void wc_require(void) -{ - bit17_require(); - gem_require_mmap_wc(fd); -} - static void bcs_require(void) { } @@ -937,14 +1389,14 @@ igt_require(rendercopy); } -static void no_require(void) -{ -} - static void -run_basic_modes(const struct access_mode *mode, - const char *suffix, - run_wrap run_wrap_func) +run_mode(const char *prefix, + const struct create *create, + const struct access_mode *mode, + const struct size *size, + const int num_buffers, + const char *suffix, + run_wrap run_wrap_func) { const struct { const char *prefix; @@ -961,184 +1413,351 @@ const struct { const char *suffix; do_hang hang; - void (*require)(void); } hangs[] = { - { "", no_hang, no_require }, - { "-hang-blt", bcs_hang, hang_require }, - { "-hang-render", rcs_hang, hang_require }, + { "", no_hang }, + { "-hang-blt", bcs_hang }, + { "-hang-render", rcs_hang }, + { "-hang-all", all_hang }, { NULL, NULL }, }, *h; struct buffers buffers; + igt_fixture + buffers_init(&buffers, prefix, create, mode, + size, num_buffers, + fd, run_wrap_func != run_child); + for (h = hangs; h->suffix; h++) { if (!all && *h->suffix) continue; + if (!*h->suffix) + igt_fork_hang_detector(fd); + for (p = all ? pipelines : pskip; p->prefix; p++) { - igt_fixture { - batch = buffers_init(&buffers, mode, fd); + igt_fixture p->require(); + + igt_subtest_f("%s-%s-%s-sanitycheck0%s%s", prefix, mode->name, p->prefix, suffix, h->suffix) { + buffers_create(&buffers); + run_wrap_func(&buffers, do_basic0, + p->copy, h->hang); + } + + igt_subtest_f("%s-%s-%s-sanitycheck1%s%s", prefix, mode->name, p->prefix, suffix, h->suffix) { + buffers_create(&buffers); + run_wrap_func(&buffers, do_basic1, + p->copy, h->hang); + } + + igt_subtest_f("%s-%s-%s-sanitycheckN%s%s", prefix, mode->name, p->prefix, suffix, h->suffix) { + buffers_create(&buffers); + run_wrap_func(&buffers, do_basicN, + p->copy, h->hang); } /* try to overwrite the source values */ - igt_subtest_f("%s-%s-overwrite-source-one%s%s", mode->name, p->prefix, suffix, h->suffix) { - h->require(); - p->require(); - buffers_create(&buffers, num_buffers); + igt_subtest_f("%s-%s-%s-overwrite-source-one%s%s", prefix, mode->name, p->prefix, suffix, h->suffix) { + buffers_create(&buffers); run_wrap_func(&buffers, do_overwrite_source__one, p->copy, h->hang); } - igt_subtest_f("%s-%s-overwrite-source%s%s", mode->name, p->prefix, suffix, h->suffix) { - h->require(); - p->require(); - buffers_create(&buffers, num_buffers); + igt_subtest_f("%s-%s-%s-overwrite-source%s%s", prefix, mode->name, p->prefix, suffix, h->suffix) { + buffers_create(&buffers); run_wrap_func(&buffers, do_overwrite_source, p->copy, h->hang); } - igt_subtest_f("%s-%s-overwrite-source-read-bcs%s%s", mode->name, p->prefix, suffix, h->suffix) { - h->require(); - p->require(); - buffers_create(&buffers, num_buffers); + igt_subtest_f("%s-%s-%s-overwrite-source-read-bcs%s%s", prefix, mode->name, p->prefix, suffix, h->suffix) { + buffers_create(&buffers); run_wrap_func(&buffers, do_overwrite_source_read_bcs, p->copy, h->hang); } - igt_subtest_f("%s-%s-overwrite-source-read-rcs%s%s", mode->name, p->prefix, suffix, h->suffix) { - h->require(); - p->require(); + igt_subtest_f("%s-%s-%s-overwrite-source-read-rcs%s%s", prefix, mode->name, p->prefix, suffix, h->suffix) { igt_require(rendercopy); - buffers_create(&buffers, num_buffers); + buffers_create(&buffers); run_wrap_func(&buffers, do_overwrite_source_read_rcs, p->copy, h->hang); } - igt_subtest_f("%s-%s-overwrite-source-rev%s%s", mode->name, p->prefix, suffix, h->suffix) { - h->require(); - p->require(); - buffers_create(&buffers, num_buffers); + igt_subtest_f("%s-%s-%s-overwrite-source-rev%s%s", prefix, mode->name, p->prefix, suffix, h->suffix) { + buffers_create(&buffers); run_wrap_func(&buffers, do_overwrite_source__rev, p->copy, h->hang); } /* try to intermix copies with GPU copies*/ - igt_subtest_f("%s-%s-intermix-rcs%s%s", mode->name, p->prefix, suffix, h->suffix) { - h->require(); - p->require(); + igt_subtest_f("%s-%s-%s-intermix-rcs%s%s", prefix, mode->name, p->prefix, suffix, h->suffix) { igt_require(rendercopy); - buffers_create(&buffers, num_buffers); + buffers_create(&buffers); run_wrap_func(&buffers, do_intermix_rcs, p->copy, h->hang); } - igt_subtest_f("%s-%s-intermix-bcs%s%s", mode->name, p->prefix, suffix, h->suffix) { - h->require(); - p->require(); + igt_subtest_f("%s-%s-%s-intermix-bcs%s%s", prefix, mode->name, p->prefix, suffix, h->suffix) { igt_require(rendercopy); - buffers_create(&buffers, num_buffers); + buffers_create(&buffers); run_wrap_func(&buffers, do_intermix_bcs, p->copy, h->hang); } - igt_subtest_f("%s-%s-intermix-both%s%s", mode->name, p->prefix, suffix, h->suffix) { - h->require(); - p->require(); + igt_subtest_f("%s-%s-%s-intermix-both%s%s", prefix, mode->name, p->prefix, suffix, h->suffix) { igt_require(rendercopy); - buffers_create(&buffers, num_buffers); + buffers_create(&buffers); run_wrap_func(&buffers, do_intermix_both, p->copy, h->hang); } /* try to read the results before the copy completes */ - igt_subtest_f("%s-%s-early-read%s%s", mode->name, p->prefix, suffix, h->suffix) { - h->require(); - p->require(); - buffers_create(&buffers, num_buffers); + igt_subtest_f("%s-%s-%s-early-read%s%s", prefix, mode->name, p->prefix, suffix, h->suffix) { + buffers_create(&buffers); run_wrap_func(&buffers, do_early_read, p->copy, h->hang); } /* concurrent reads */ - igt_subtest_f("%s-%s-read-read-bcs%s%s", mode->name, p->prefix, suffix, h->suffix) { - h->require(); - p->require(); - buffers_create(&buffers, num_buffers); + igt_subtest_f("%s-%s-%s-read-read-bcs%s%s", prefix, mode->name, p->prefix, suffix, h->suffix) { + buffers_create(&buffers); run_wrap_func(&buffers, do_read_read_bcs, p->copy, h->hang); } - igt_subtest_f("%s-%s-read-read-rcs%s%s", mode->name, p->prefix, suffix, h->suffix) { - h->require(); - p->require(); + igt_subtest_f("%s-%s-%s-read-read-rcs%s%s", prefix, mode->name, p->prefix, suffix, h->suffix) { igt_require(rendercopy); - buffers_create(&buffers, num_buffers); + buffers_create(&buffers); run_wrap_func(&buffers, do_read_read_rcs, p->copy, h->hang); } /* split copying between rings */ - igt_subtest_f("%s-%s-write-read-bcs%s%s", mode->name, p->prefix, suffix, h->suffix) { - h->require(); - p->require(); - buffers_create(&buffers, num_buffers); + igt_subtest_f("%s-%s-%s-write-read-bcs%s%s", prefix, mode->name, p->prefix, suffix, h->suffix) { + buffers_create(&buffers); run_wrap_func(&buffers, do_write_read_bcs, p->copy, h->hang); } - igt_subtest_f("%s-%s-write-read-rcs%s%s", mode->name, p->prefix, suffix, h->suffix) { - h->require(); - p->require(); + igt_subtest_f("%s-%s-%s-write-read-rcs%s%s", prefix, mode->name, p->prefix, suffix, h->suffix) { igt_require(rendercopy); - buffers_create(&buffers, num_buffers); + buffers_create(&buffers); run_wrap_func(&buffers, do_write_read_rcs, p->copy, h->hang); } /* and finally try to trick the kernel into loosing the pending write */ - igt_subtest_f("%s-%s-gpu-read-after-write%s%s", mode->name, p->prefix, suffix, h->suffix) { - h->require(); - p->require(); - buffers_create(&buffers, num_buffers); + igt_subtest_f("%s-%s-%s-gpu-read-after-write%s%s", prefix, mode->name, p->prefix, suffix, h->suffix) { + buffers_create(&buffers); run_wrap_func(&buffers, do_gpu_read_after_write, p->copy, h->hang); } + } + + if (!*h->suffix) + igt_stop_hang_detector(); + } + igt_fixture + buffers_fini(&buffers); +} + +static void +run_modes(const char *style, + const struct create *create, + const struct access_mode *mode, + const struct size *size, + const int num) +{ + const struct wrap { + const char *suffix; + run_wrap func; + } wrappers[] = { + { "", run_single }, + { "-child", run_child }, + { "-forked", run_forked }, + { "-interruptible", run_interruptible }, + { "-bomb", run_bomb }, + { NULL }, + }; + + while (mode->name) { + igt_subtest_group { igt_fixture { - buffers_fini(&buffers); + if (mode->require) + mode->require(create, num); + } + + for (const struct wrap *w = wrappers; w->suffix; w++) { + run_mode(style, create, mode, size, num, + w->suffix, w->func); } } + + mode++; } } -static void -run_modes(const struct access_mode *mode) +static unsigned +num_buffers(uint64_t max, + const struct size *s, + const struct create *c, + unsigned allow_mem) +{ + unsigned size = 4*s->width*s->height; + uint64_t n; + + igt_assert(size); + n = max / (2*size); + n += MIN_BUFFERS; + + igt_require(n < INT32_MAX); + igt_require(set_max_map_count(2*n)); + + if (c->require) + c->require(c, n); + + intel_require_memory(2*n, size, allow_mem); + + return n; +} + +static bool allow_unlimited_files(void) { - if (all) { - run_basic_modes(mode, "", run_single); + struct rlimit rlim; + unsigned nofile_rlim = 1024*1024; - igt_fork_signal_helper(); - run_basic_modes(mode, "-interruptible", run_interruptible); - igt_stop_signal_helper(); + FILE *file = fopen("/proc/sys/fs/file-max", "r"); + if (file) { + igt_assert(fscanf(file, "%u", &nofile_rlim) == 1); + igt_info("System limit for open files is %u\n", nofile_rlim); + fclose(file); } - igt_fork_signal_helper(); - run_basic_modes(mode, "-forked", run_forked); - igt_stop_signal_helper(); + if (getrlimit(RLIMIT_NOFILE, &rlim)) + return false; + + rlim.rlim_cur = nofile_rlim; + rlim.rlim_max = nofile_rlim; + return setrlimit(RLIMIT_NOFILE, &rlim) == 0; } igt_main { - int max, i; + const struct access_mode modes[] = { + { + .name = "prw", + .create_bo = unmapped_create_bo, + .set_bo = prw_set_bo, + .cmp_bo = prw_cmp_bo, + .release_bo = nop_release_bo, + }, + { + .name = "partial", + .create_bo = unmapped_create_bo, + .set_bo = partial_set_bo, + .cmp_bo = partial_cmp_bo, + .release_bo = nop_release_bo, + }, + { + .name = "cpu", + .create_bo = unmapped_create_bo, + .require = create_cpu_require, + .set_bo = cpu_set_bo, + .cmp_bo = cpu_cmp_bo, + .release_bo = nop_release_bo, + }, + { + .name = "snoop", + .create_bo = snoop_create_bo, + .require = create_snoop_require, + .set_bo = cpu_set_bo, + .cmp_bo = cpu_cmp_bo, + .release_bo = nop_release_bo, + }, + { + .name = "userptr", + .create_bo = userptr_create_bo, + .require = create_userptr_require, + .set_bo = userptr_set_bo, + .cmp_bo = userptr_cmp_bo, + .release_bo = userptr_release_bo, + }, + { + .name = "dmabuf", + .create_bo = dmabuf_create_bo, + .require = create_dmabuf_require, + .set_bo = dmabuf_set_bo, + .cmp_bo = dmabuf_cmp_bo, + .release_bo = dmabuf_release_bo, + }, + { + .name = "gtt", + .create_bo = gtt_create_bo, + .set_bo = gtt_set_bo, + .cmp_bo = gtt_cmp_bo, + .release_bo = nop_release_bo, + }, + { + .name = "gttX", + .create_bo = gttX_create_bo, + .set_bo = gtt_set_bo, + .cmp_bo = gtt_cmp_bo, + .release_bo = nop_release_bo, + }, + { + .name = "wc", + .require = wc_create_require, + .create_bo = wc_create_bo, + .set_bo = gtt_set_bo, + .cmp_bo = gtt_cmp_bo, + .release_bo = wc_release_bo, + }, + { + .name = "gpu", + .create_bo = gpu_create_bo, + .set_bo = gpu_set_bo, + .cmp_bo = gpu_cmp_bo, + .release_bo = nop_release_bo, + }, + { + .name = "gpuX", + .create_bo = gpuX_create_bo, + .set_bo = gpu_set_bo, + .cmp_bo = gpu_cmp_bo, + .release_bo = nop_release_bo, + }, + { NULL }, + }; + const struct create create[] = { + { "", can_create_normal, create_normal_bo}, +#if HAVE_CREATE_PRIVATE + { "private-", can_create_private, create_private_bo}, +#endif +#if HAVE_CREATE_STOLEN + { "stolen-", can_create_stolen, create_stolen_bo}, +#endif + { NULL, NULL } + }; + const struct size sizes[] = { + { "4KiB", 128, 8 }, + { "256KiB", 128, 128 }, + { "1MiB", 512, 512 }, + { "16MiB", 2048, 2048 }, + { NULL} + }; + uint64_t pin_sz = 0; + void *pinned = NULL; + char name[80]; + int count = 0; igt_skip_on_simulation(); @@ -1146,22 +1765,104 @@ all = true; igt_fixture { + allow_unlimited_files(); + fd = drm_open_driver(DRIVER_INTEL); + intel_detect_and_clear_missed_interrupts(fd); devid = intel_get_drm_devid(fd); gen = intel_gen(devid); rendercopy = igt_get_render_copyfunc(devid); - - max = gem_aperture_size (fd) / (1024 * 1024) / 2; - if (num_buffers > max) - num_buffers = max; - - max = intel_get_total_ram_mb() * 3 / 4; - if (num_buffers > max) - num_buffers = max; - num_buffers /= 2; - igt_info("using 2x%d buffers, each 1MiB\n", num_buffers); } - for (i = 0; i < ARRAY_SIZE(access_modes); i++) - run_modes(&access_modes[i]); + for (const struct create *c = create; c->name; c++) { + for (const struct size *s = sizes; s->name; s++) { + /* Minimum test set */ + snprintf(name, sizeof(name), "%s%s-%s", + c->name, s->name, "tiny"); + igt_subtest_group { + igt_fixture { + count = num_buffers(0, s, c, CHECK_RAM); + } + run_modes(name, c, modes, s, count); + } + + /* "Average" test set */ + snprintf(name, sizeof(name), "%s%s-%s", + c->name, s->name, "small"); + igt_subtest_group { + igt_fixture { + count = num_buffers(gem_mappable_aperture_size()/4, + s, c, CHECK_RAM); + } + run_modes(name, c, modes, s, count); + } + + /* Use the entire mappable aperture */ + snprintf(name, sizeof(name), "%s%s-%s", + c->name, s->name, "thrash"); + igt_subtest_group { + igt_fixture { + count = num_buffers(gem_mappable_aperture_size(), + s, c, CHECK_RAM); + } + run_modes(name, c, modes, s, count); + } + + /* Use the entire global GTT */ + snprintf(name, sizeof(name), "%s%s-%s", + c->name, s->name, "global"); + igt_subtest_group { + igt_fixture { + count = num_buffers(gem_global_aperture_size(fd), + s, c, CHECK_RAM); + } + run_modes(name, c, modes, s, count); + } + + /* Use the entire per-process GTT */ + snprintf(name, sizeof(name), "%s%s-%s", + c->name, s->name, "full"); + igt_subtest_group { + igt_fixture { + count = num_buffers(gem_aperture_size(fd), + s, c, CHECK_RAM); + } + run_modes(name, c, modes, s, count); + } + + /* Use the entire mappable aperture, force swapping */ + snprintf(name, sizeof(name), "%s%s-%s", + c->name, s->name, "swap"); + igt_subtest_group { + igt_fixture { + if (intel_get_avail_ram_mb() > gem_mappable_aperture_size()/(1024*1024)) { + pin_sz = intel_get_avail_ram_mb() - gem_mappable_aperture_size()/(1024*1024); + + igt_debug("Pinning %lld MiB\n", (long long)pin_sz); + pin_sz *= 1024 * 1024; + + if (posix_memalign(&pinned, 4096, pin_sz) || + mlock(pinned, pin_sz) || + madvise(pinned, pin_sz, MADV_DONTFORK)) { + free(pinned); + pinned = NULL; + } + igt_require(pinned); + } + + count = num_buffers(gem_mappable_aperture_size(), + s, c, CHECK_RAM | CHECK_SWAP); + } + run_modes(name, c, modes, s, count); + + igt_fixture { + if (pinned) { + munlock(pinned, pin_sz); + free(pinned); + pinned = NULL; + } + } + } + } + } } diff -Nru intel-gpu-tools-1.13/tests/gem_create.c intel-gpu-tools-1.15/tests/gem_create.c --- intel-gpu-tools-1.13/tests/gem_create.c 1970-01-01 00:00:00.000000000 +0000 +++ intel-gpu-tools-1.15/tests/gem_create.c 2016-05-23 10:51:28.000000000 +0000 @@ -0,0 +1,166 @@ +/* + * Copyright © 2015 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: + * Ankitprasad Sharma + * + */ + +/** @file gem_create.c + * + * This is a test for the extended and old gem_create ioctl, that + * includes allocation of object from stolen memory and shmem. + * + * The goal is to simply ensure that basics work and invalid input + * combinations are rejected. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "ioctl_wrappers.h" +#include "intel_bufmgr.h" +#include "intel_batchbuffer.h" +#include "intel_io.h" +#include "intel_chipset.h" +#include "igt_aux.h" +#include "drmtest.h" +#include "drm.h" +#include "i915_drm.h" + +IGT_TEST_DESCRIPTION("This is a test for the extended & old gem_create ioctl," + " that includes allocation of object from stolen memory" + " and shmem."); + +#define CLEAR(s) memset(&s, 0, sizeof(s)) +#define PAGE_SIZE 4096 + +struct local_i915_gem_create_v2 { + uint64_t size; + uint32_t handle; + uint32_t pad; +#define I915_CREATE_PLACEMENT_STOLEN (1<<0) + uint32_t flags; +} create; + +#define LOCAL_IOCTL_I915_GEM_CREATE DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_CREATE, struct local_i915_gem_create_v2) + +static void invalid_flag_test(int fd) +{ + int ret; + + gem_require_stolen_support(fd); + + create.handle = 0; + create.size = PAGE_SIZE; + create.flags = ~I915_CREATE_PLACEMENT_STOLEN; + ret = drmIoctl(fd, LOCAL_IOCTL_I915_GEM_CREATE, &create); + + igt_assert(ret <= 0); + + create.flags = ~0; + ret = drmIoctl(fd, LOCAL_IOCTL_I915_GEM_CREATE, &create); + + igt_assert(ret <= 0); +} + +static void invalid_size_test(int fd) +{ + int handle; + + handle = __gem_create(fd, 0); + igt_assert(!handle); +} + +/* + * Creating an object with non-aligned size and trying to access it with an + * offset, which is greater than the requested size but smaller than the + * object's last page boundary. pwrite here must be successful. + */ +static void valid_nonaligned_size(int fd) +{ + int handle; + char buf[PAGE_SIZE]; + + handle = gem_create(fd, PAGE_SIZE / 2); + + gem_write(fd, handle, PAGE_SIZE / 2, buf, PAGE_SIZE / 2); + + gem_close(fd, handle); +} + +/* + * Creating an object with non-aligned size and trying to access it with an + * offset, which is greater than the requested size and larger than the + * object's last page boundary. pwrite here must fail. + */ +static void invalid_nonaligned_size(int fd) +{ + int handle; + char buf[PAGE_SIZE]; + struct drm_i915_gem_pwrite gem_pwrite; + + handle = gem_create(fd, PAGE_SIZE / 2); + + CLEAR(gem_pwrite); + gem_pwrite.handle = handle; + gem_pwrite.offset = PAGE_SIZE / 2; + gem_pwrite.size = PAGE_SIZE; + gem_pwrite.data_ptr = (uintptr_t)buf; + /* This should fail. Hence cannot use gem_write. */ + igt_assert(drmIoctl(fd, DRM_IOCTL_I915_GEM_PWRITE, &gem_pwrite)); + + gem_close(fd, handle); +} + +igt_main +{ + int fd = -1; + + igt_skip_on_simulation(); + + igt_fixture { + fd = drm_open_driver(DRIVER_INTEL); + } + + igt_subtest("stolen-invalid-flag") + invalid_flag_test(fd); + + igt_subtest("create-invalid-size") + invalid_size_test(fd); + + igt_subtest("create-valid-nonaligned") + valid_nonaligned_size(fd); + + igt_subtest("create-invalid-nonaligned") + invalid_nonaligned_size(fd); +} diff -Nru intel-gpu-tools-1.13/tests/gem_cs_prefetch.c intel-gpu-tools-1.15/tests/gem_cs_prefetch.c --- intel-gpu-tools-1.13/tests/gem_cs_prefetch.c 2015-11-30 16:26:22.000000000 +0000 +++ intel-gpu-tools-1.15/tests/gem_cs_prefetch.c 2016-05-23 10:51:28.000000000 +0000 @@ -36,107 +36,121 @@ * very last gtt pte. */ #include "igt.h" -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include "intel_bufmgr.h" IGT_TEST_DESCRIPTION("Test the CS prefetch behaviour on batches."); -static drm_intel_bufmgr *bufmgr; -struct intel_batchbuffer *batch; +#define BATCH_SIZE 4096 + +struct shadow { + uint32_t handle; + struct drm_i915_gem_relocation_entry reloc; +}; -static void exec(int fd, uint32_t handle) +static void gem_require_store_dword(int fd, unsigned ring) { - struct drm_i915_gem_execbuffer2 execbuf; - struct drm_i915_gem_exec_object2 gem_exec[1]; + int gen = intel_gen(intel_get_drm_devid(fd)); + ring &= ~(3 << 13); + igt_skip_on_f(gen == 6 && ring == I915_EXEC_BSD, + "MI_STORE_DATA broken on gen6 bsd\n"); +} - memset(gem_exec, 0, sizeof(gem_exec)); - gem_exec[0].handle = handle; +static void setup(int fd, int gen, struct shadow *shadow) +{ + uint32_t buf[16]; + int i; - memset(&execbuf, 0, sizeof(execbuf)); - execbuf.buffers_ptr = (uintptr_t)gem_exec; - execbuf.buffer_count = 1; - execbuf.batch_start_offset = 0; - execbuf.batch_len = 4096; + shadow->handle = gem_create(fd, 4096); - gem_execbuf(fd, &execbuf); - gem_sync(fd, handle); + i = 0; + buf[i++] = MI_STORE_DWORD_IMM | (gen < 6 ? 1 << 22 : 0); + if (gen >= 8) { + buf[i++] = BATCH_SIZE - sizeof(uint32_t); + buf[i++] = 0; + } else if (gen >= 4) { + buf[i++] = 0; + buf[i++] = BATCH_SIZE - sizeof(uint32_t); + } else { + buf[i-1]--; + buf[i++] = BATCH_SIZE - sizeof(uint32_t); + } + buf[i++] = MI_BATCH_BUFFER_END; + buf[i++] = MI_BATCH_BUFFER_END; + gem_write(fd, shadow->handle, 0, buf, sizeof(buf)); + + memset(&shadow->reloc, 0, sizeof(shadow->reloc)); + if (gen >= 8 || gen < 4) + shadow->reloc.offset = sizeof(uint32_t); + else + shadow->reloc.offset = 2*sizeof(uint32_t); + shadow->reloc.delta = BATCH_SIZE - sizeof(uint32_t); + shadow->reloc.read_domains = I915_GEM_DOMAIN_INSTRUCTION; + shadow->reloc.write_domain = I915_GEM_DOMAIN_INSTRUCTION; } -igt_simple_main +static void can_test_ring(unsigned ring) { - uint32_t batch_end[4] = {MI_BATCH_BUFFER_END, 0, 0, 0}; - int fd, i, ret; - int count; - drm_intel_bo *sample_batch_bo; - - igt_skip_on_simulation(); + int master = drm_open_driver_master(DRIVER_INTEL); + int fd = drm_open_driver(DRIVER_INTEL); - fd = drm_open_driver(DRIVER_INTEL); + /* Dance to avoid dying with master open */ + close(master); + gem_require_ring(fd, ring); + gem_require_store_dword(fd, ring); + close(fd); +} - bufmgr = drm_intel_bufmgr_gem_init(fd, 4096); - igt_assert(bufmgr); +static void test_ring(unsigned ring) +{ + struct drm_i915_gem_execbuffer2 execbuf; + struct drm_i915_gem_exec_object2 obj[2]; + struct shadow shadow; + uint64_t i, count; + int fd, gen; + + can_test_ring(ring); + + fd = drm_open_driver_master(DRIVER_INTEL); + gen = intel_gen(intel_get_drm_devid(fd)); + setup(fd, gen, &shadow); + + count = gem_aperture_size(fd) / BATCH_SIZE; + intel_require_memory(count, BATCH_SIZE, CHECK_RAM); + /* Fill the entire gart with batches and run them. */ + memset(obj, 0, sizeof(obj)); + obj[1].handle = shadow.handle; + obj[1].relocs_ptr = (uintptr_t)&shadow.reloc; + obj[1].relocation_count = 1; - drm_intel_bufmgr_gem_enable_reuse(bufmgr); - - count = gem_aperture_size(fd) / 4096; - intel_require_memory(count, 4096, CHECK_RAM); - - batch = intel_batchbuffer_alloc(bufmgr, intel_get_drm_devid(fd)); - igt_assert(batch); - - sample_batch_bo = drm_intel_bo_alloc(bufmgr, "", 4096, 4096); - igt_assert(sample_batch_bo); - ret = drm_intel_bo_subdata(sample_batch_bo, 4096-sizeof(batch_end), - sizeof(batch_end), batch_end); - igt_assert(ret == 0); + memset(&execbuf, 0, sizeof(execbuf)); + execbuf.buffers_ptr = (uintptr_t)obj; + execbuf.flags = ring; + if (gen < 6) + execbuf.flags |= I915_EXEC_SECURE; - /* fill the entire gart with batches and run them */ for (i = 0; i < count; i++) { - drm_intel_bo *batch_bo; + /* Create the new batch using the GPU */ + obj[0].handle = gem_create(fd, BATCH_SIZE); + shadow.reloc.target_handle = obj[0].handle; + execbuf.buffer_count = 2; + gem_execbuf(fd, &execbuf); + + /* ...then execute the new batch */ + execbuf.buffer_count = 1; + gem_execbuf(fd, &execbuf); - batch_bo = drm_intel_bo_alloc(bufmgr, "", 4096, 4096); - igt_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. */ - BLIT_COPY_BATCH_START(0); - OUT_BATCH((3 << 24) | /* 32 bits */ - (0xcc << 16) | /* copy ROP */ - 4096); - OUT_BATCH(0); /* dst y1,x1 */ - OUT_BATCH((1 << 16) | 1024); - OUT_RELOC_FENCED(batch_bo, I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER, 0); - OUT_BATCH((0 << 16) | 0); /* src x1, y1 */ - OUT_BATCH(4096); - OUT_RELOC_FENCED(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); - igt_progress("gem_cs_prefetch: ", i, count); + /* ...and leak the handle to consume the GTT */ } - igt_info("Test suceeded, cleanup up - this might take a while.\n"); - drm_intel_bufmgr_destroy(bufmgr); - close(fd); } + +igt_main +{ + const struct intel_execution_engine *e; + + igt_skip_on_simulation(); + + for (e = intel_execution_engines; e->name; e++) + igt_subtest_f("%s", e->name) + test_ring(e->exec_id | e->flags); +} diff -Nru intel-gpu-tools-1.13/tests/gem_cs_tlb.c intel-gpu-tools-1.15/tests/gem_cs_tlb.c --- intel-gpu-tools-1.13/tests/gem_cs_tlb.c 2015-11-30 16:26:22.000000000 +0000 +++ intel-gpu-tools-1.15/tests/gem_cs_tlb.c 2016-05-23 10:51:28.000000000 +0000 @@ -50,129 +50,107 @@ #include - IGT_TEST_DESCRIPTION("Check whether we correctly invalidate the cs tlb."); -#define LOCAL_I915_EXEC_VEBOX (4<<0) +#define LOCAL_I915_EXEC_VEBOX (4<<0) +#define EXEC_OBJECT_PINNED (1<<4) #define BATCH_SIZE (1024*1024) -static int exec(int fd, uint32_t handle, int split, - uint64_t *gtt_ofs, unsigned ring_id) +static bool has_softpin(int fd) { - struct drm_i915_gem_execbuffer2 execbuf; - struct drm_i915_gem_exec_object2 gem_exec[1]; - int ret = 0; + struct drm_i915_getparam gp; + int val = 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 = 0x00100000; - gem_exec[0].flags = 0; - gem_exec[0].rsvd1 = 0; - gem_exec[0].rsvd2 = 0; + memset(&gp, 0, sizeof(gp)); + gp.param = 37; /* I915_PARAM_HAS_EXEC_SOFTPIN */ + gp.value = &val; - execbuf.buffers_ptr = (uintptr_t)gem_exec; - execbuf.buffer_count = 1; - execbuf.batch_start_offset = 0; - execbuf.batch_len = 8*(split+1); - execbuf.cliprects_ptr = 0; - execbuf.num_cliprects = 0; - execbuf.DR1 = 0; - execbuf.DR4 = 0; - execbuf.flags = ring_id; - i915_execbuffer2_set_context_id(execbuf, 0); - execbuf.rsvd2 = 0; + if (drmIoctl(fd, DRM_IOCTL_I915_GETPARAM, &gp)) + return 0; + + errno = 0; + return (val == 1); +} - ret = drmIoctl(fd, - DRM_IOCTL_I915_GEM_EXECBUFFER2, - &execbuf); +static void * +mmap_coherent(int fd, uint32_t handle, int size) +{ + int domain; + void *ptr; - *gtt_ofs = gem_exec[0].offset; + if (gem_has_llc(fd) || !gem_mmap__has_wc(fd)) { + domain = I915_GEM_DOMAIN_CPU; + ptr = gem_mmap__cpu(fd, handle, 0, size, PROT_WRITE); + } else { + domain = I915_GEM_DOMAIN_GTT; + ptr = gem_mmap__wc(fd, handle, 0, size, PROT_WRITE); + } - return ret; + gem_set_domain(fd, handle, domain, domain); + return ptr; } static void run_on_ring(int fd, unsigned ring_id, const char *ring_name) { - uint32_t handle, handle_new; - uint64_t gtt_offset, gtt_offset_new; - uint32_t *batch_ptr, *batch_ptr_old; - unsigned split; + struct drm_i915_gem_execbuffer2 execbuf; + struct drm_i915_gem_exec_object2 execobj; + struct { + uint32_t handle; + uint32_t *batch; + } obj[2]; + unsigned i; char buf[100]; - int i; gem_require_ring(fd, ring_id); + igt_require(has_softpin(fd)); - sprintf(buf, "testing %s cs tlb coherency: ", ring_name); + for (i = 0; i < 2; i++) { + obj[i].handle = gem_create(fd, BATCH_SIZE); + obj[i].batch = mmap_coherent(fd, obj[i].handle, BATCH_SIZE); + memset(obj[i].batch, 0xff, BATCH_SIZE); + } + + memset(&execobj, 0, sizeof(execobj)); + execobj.handle = obj[0].handle; + obj[0].batch[0] = MI_BATCH_BUFFER_END; - /* Shut up gcc, too stupid. */ - batch_ptr_old = NULL; - handle = 0; - gtt_offset = 0; - - for (split = 0; split < BATCH_SIZE/8 - 1; split += 2) { - igt_progress(buf, split, BATCH_SIZE/8 - 1); - - handle_new = gem_create(fd, BATCH_SIZE); - batch_ptr = gem_mmap__cpu(fd, handle_new, 0, BATCH_SIZE, - PROT_READ | PROT_WRITE); - batch_ptr[split*2] = MI_BATCH_BUFFER_END; - - for (i = split*2 + 2; i < BATCH_SIZE/8; i++) - batch_ptr[i] = 0xffffffff; - - if (split > 0) { - gem_sync(fd, handle); - gem_close(fd, handle); - } - - igt_assert_eq(exec(fd, handle_new, split, >t_offset_new, ring_id), - 0); - - if (split > 0) { - /* Check that we've managed to collide in the tlb. */ - igt_assert(gtt_offset == gtt_offset_new); - - /* We hang onto the storage of the old batch by keeping - * the cpu mmap around. */ - munmap(batch_ptr_old, BATCH_SIZE); - } - - handle = handle_new; - gtt_offset = gtt_offset_new; - batch_ptr_old = batch_ptr; + memset(&execbuf, 0, sizeof(execbuf)); + execbuf.buffers_ptr = (uintptr_t)&execobj; + execbuf.buffer_count = 1; + execbuf.flags = ring_id; + + /* Execute once to allocate a gtt-offset */ + gem_execbuf(fd, &execbuf); + execobj.flags = EXEC_OBJECT_PINNED; + + sprintf(buf, "Testing %s cs tlb coherency: ", ring_name); + for (i = 0; i < BATCH_SIZE/64; i++) { + execobj.handle = obj[i&1].handle; + obj[i&1].batch[i*64/4] = MI_BATCH_BUFFER_END; + execbuf.batch_start_offset = i*64; + + gem_execbuf(fd, &execbuf); } + for (i = 0; i < 2; i++) { + gem_close(fd, obj[i].handle); + munmap(obj[i].batch, BATCH_SIZE); + } } -int fd; - igt_main { + const struct intel_execution_engine *e; + int fd = -1; igt_skip_on_simulation(); - igt_fixture { + igt_fixture fd = drm_open_driver(DRIVER_INTEL); - /* This test is very sensitive to residual gtt_mm noise from previous - * tests. Try to quiet thing down first. */ - gem_quiescent_gpu(fd); - sleep(5); /* needs more serious ducttape */ - } - - igt_subtest("render") - run_on_ring(fd, I915_EXEC_RENDER, "render"); - - igt_subtest("bsd") - run_on_ring(fd, I915_EXEC_BSD, "bsd"); - - igt_subtest("blt") - run_on_ring(fd, I915_EXEC_BLT, "blt"); - - igt_subtest("vebox") - run_on_ring(fd, LOCAL_I915_EXEC_VEBOX, "vebox"); + for (e = intel_execution_engines; e->name; e++) + igt_subtest_f("%s%s", e->exec_id ? "" : "basic-", e->name) + run_on_ring(fd, e->exec_id | e->flags, e->name); igt_fixture close(fd); diff -Nru intel-gpu-tools-1.13/tests/gem_ctx_create.c intel-gpu-tools-1.15/tests/gem_ctx_create.c --- intel-gpu-tools-1.13/tests/gem_ctx_create.c 2015-11-30 16:26:22.000000000 +0000 +++ intel-gpu-tools-1.15/tests/gem_ctx_create.c 2016-05-23 10:51:28.000000000 +0000 @@ -29,42 +29,172 @@ #include #include #include +#include +#define LOCAL_I915_EXEC_BSD_SHIFT (13) +#define LOCAL_I915_EXEC_BSD_MASK (3 << LOCAL_I915_EXEC_BSD_SHIFT) -int ret, fd; -struct drm_i915_gem_context_create create; +#define ENGINE_FLAGS (I915_EXEC_RING_MASK | LOCAL_I915_EXEC_BSD_MASK) + +static unsigned ppgtt_engines[16]; +static unsigned ppgtt_nengine; + +static int __gem_context_create(int fd, struct drm_i915_gem_context_create *arg) +{ + int ret = 0; + if (drmIoctl(fd, DRM_IOCTL_I915_GEM_CONTEXT_CREATE, arg)) + ret = -errno; + return ret; +} + +static double elapsed(const struct timespec *start, + const struct timespec *end) +{ + return (end->tv_sec - start->tv_sec) + 1e-9*(end->tv_nsec - start->tv_nsec); +} + +static void files(int core, int timeout, const int ncpus) +{ + const uint32_t bbe = MI_BATCH_BUFFER_END; + struct drm_i915_gem_execbuffer2 execbuf; + struct drm_i915_gem_exec_object2 obj; + uint32_t batch, name; + + batch = gem_create(core, 4096); + gem_write(core, batch, 0, &bbe, sizeof(bbe)); + name = gem_flink(core, batch); + + memset(&obj, 0, sizeof(obj)); + memset(&execbuf, 0, sizeof(execbuf)); + execbuf.buffers_ptr = (uintptr_t)&obj; + execbuf.buffer_count = 1; + + igt_fork(child, ncpus) { + struct timespec start, end; + unsigned count = 0; + + clock_gettime(CLOCK_MONOTONIC, &start); + do { + do { + int fd = drm_open_driver(DRIVER_INTEL); + obj.handle = gem_open(fd, name); + execbuf.flags &= ~ENGINE_FLAGS; + execbuf.flags |= ppgtt_engines[count % ppgtt_nengine]; + gem_execbuf(fd, &execbuf); + close(fd); + } while (++count & 1023); + clock_gettime(CLOCK_MONOTONIC, &end); + } while (elapsed(&start, &end) < timeout); + + gem_sync(core, batch); + clock_gettime(CLOCK_MONOTONIC, &end); + igt_info("[%d] File creation + execution: %.3f us\n", + child, elapsed(&start, &end) / count *1e6); + } + igt_waitchildren(); + + gem_close(core, batch); +} + +static void active(int fd, unsigned engine, int timeout, const int ncpus) +{ + const uint32_t bbe = MI_BATCH_BUFFER_END; + struct drm_i915_gem_execbuffer2 execbuf; + struct drm_i915_gem_exec_object2 obj; + + gem_require_ring(fd, engine); + + memset(&obj, 0, sizeof(obj)); + obj.handle = gem_create(fd, 4096); + gem_write(fd, obj.handle, 0, &bbe, sizeof(bbe)); + + memset(&execbuf, 0, sizeof(execbuf)); + execbuf.buffers_ptr = (uintptr_t)&obj; + execbuf.buffer_count = 1; + execbuf.flags = engine; + + igt_fork(child, ncpus) { + struct timespec start, end; + unsigned count = 0; + + clock_gettime(CLOCK_MONOTONIC, &start); + do { + do { + execbuf.rsvd1 = gem_context_create(fd); + gem_execbuf(fd, &execbuf); + gem_context_destroy(fd, execbuf.rsvd1); + } while (++count & 1023); + clock_gettime(CLOCK_MONOTONIC, &end); + } while (elapsed(&start, &end) < timeout); + + gem_sync(fd, obj.handle); + clock_gettime(CLOCK_MONOTONIC, &end); + igt_info("[%d] Context creation + execution: %.3f us\n", + child, elapsed(&start, &end) / count *1e6); + } + igt_waitchildren(); + + gem_close(fd, obj.handle); +} igt_main { - igt_fixture - fd = drm_open_driver_render(DRIVER_INTEL); + const int ncpus = sysconf(_SC_NPROCESSORS_ONLN); + struct drm_i915_gem_context_create create; + int fd = -1; + + igt_fixture { + fd = drm_open_driver(DRIVER_INTEL); + + memset(&create, 0, sizeof(create)); + igt_require(__gem_context_create(fd, &create) == 0); + gem_context_destroy(fd, create.ctx_id); + + if (gem_uses_full_ppgtt(fd)) { + unsigned engine; + + for_each_engine(fd, engine) { + if (engine == 0) + continue; + ppgtt_engines[ppgtt_nengine++] = engine; + } + } else + ppgtt_engines[ppgtt_nengine++] = 0; + } + + igt_fork_hang_detector(fd); igt_subtest("basic") { + memset(&create, 0, sizeof(create)); create.ctx_id = rand(); create.pad = 0; - - - ret = drmIoctl(fd, DRM_IOCTL_I915_GEM_CONTEXT_CREATE, &create); - igt_skip_on(ret != 0 && (errno == ENODEV || errno == EINVAL)); - igt_assert(ret == 0); + igt_assert_eq(__gem_context_create(fd, &create), 0); igt_assert(create.ctx_id != 0); + gem_context_destroy(fd, create.ctx_id); } igt_subtest("invalid-pad") { + memset(&create, 0, sizeof(create)); create.ctx_id = rand(); - create.pad = 0; - - ret = drmIoctl(fd, DRM_IOCTL_I915_GEM_CONTEXT_CREATE, &create); - igt_skip_on(ret != 0 && (errno == ENODEV || errno == EINVAL)); - igt_assert(ret == 0); - igt_assert(create.ctx_id != 0); - create.pad = 1; + igt_assert_eq(__gem_context_create(fd, &create), -EINVAL); + } - igt_assert(drmIoctl(fd, DRM_IOCTL_I915_GEM_CONTEXT_CREATE, &create) < 0 && - errno == EINVAL); + igt_subtest("basic-files") + files(fd, 20, 1); + igt_subtest("forked-files") + files(fd, 20, ncpus); + + for (const struct intel_execution_engine *e = intel_execution_engines; + e->name; e++) { + igt_subtest_f("active-%s", e->name) + active(fd, e->exec_id | e->flags, 20, 1); + igt_subtest_f("forked-active-%s", e->name) + active(fd, e->exec_id | e->flags, 20, ncpus); } + igt_stop_hang_detector(); + igt_fixture close(fd); } diff -Nru intel-gpu-tools-1.13/tests/gem_ctx_exec.c intel-gpu-tools-1.15/tests/gem_ctx_exec.c --- intel-gpu-tools-1.13/tests/gem_ctx_exec.c 2015-11-30 16:26:22.000000000 +0000 +++ intel-gpu-tools-1.15/tests/gem_ctx_exec.c 2016-05-23 10:51:28.000000000 +0000 @@ -86,7 +86,7 @@ struct drm_i915_gem_execbuffer2 execbuf; struct drm_i915_gem_exec_object2 *gem_exec; uint32_t ctx_id1, ctx_id2; - int num_buffers = gem_available_aperture_size(fd) / 4096; + int num_buffers = gem_global_aperture_size(fd) / 4096; int i; /* Make sure we only fill half of RAM with gem objects. */ @@ -201,10 +201,10 @@ * the last context is leaked at every reset. */ for (i = 0; i < 20; i++) { - igt_set_stop_rings(igt_to_stop_ring_flag(I915_EXEC_RENDER)); + igt_hang_ring_t hang = igt_hang_ring(fd, I915_EXEC_RENDER); igt_assert(exec(fd, handle, I915_EXEC_RENDER, 0) == 0); igt_assert(exec(fd, handle, I915_EXEC_RENDER, ctx_id) == 0); - gem_sync(fd, handle); + igt_post_hang_ring(fd, hang); } gem_context_destroy(fd, ctx_id); diff -Nru intel-gpu-tools-1.13/tests/gem_ctx_param_basic.c intel-gpu-tools-1.15/tests/gem_ctx_param_basic.c --- intel-gpu-tools-1.13/tests/gem_ctx_param_basic.c 2015-11-30 16:26:22.000000000 +0000 +++ intel-gpu-tools-1.15/tests/gem_ctx_param_basic.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,167 +0,0 @@ -/* - * Copyright © 2015 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 "igt.h" -#include -#include -#include - -IGT_TEST_DESCRIPTION("Basic test for context set/get param input validation."); - -int fd; -int32_t ctx; - -#define LOCAL_I915_GEM_CONTEXT_GETPARAM 0x34 -#define LOCAL_I915_GEM_CONTEXT_SETPARAM 0x35 -#define LOCAL_IOCTL_I915_GEM_CONTEXT_GETPARAM DRM_IOWR (DRM_COMMAND_BASE + LOCAL_I915_GEM_CONTEXT_GETPARAM, struct local_i915_gem_context_param) -#define LOCAL_IOCTL_I915_GEM_CONTEXT_SETPARAM DRM_IOWR (DRM_COMMAND_BASE + LOCAL_I915_GEM_CONTEXT_SETPARAM, struct local_i915_gem_context_param) - -#define TEST_SUCCESS(ioc) \ - do_ioctl(fd, (ioc), &ctx_param); -#define TEST_FAIL(ioc, exp_errno) \ - do_ioctl_err(fd, (ioc), &ctx_param, exp_errno); - -igt_main -{ - struct local_i915_gem_context_param ctx_param; - - memset(&ctx_param, 0, sizeof(ctx_param)); - - igt_fixture { - fd = drm_open_driver_render(DRIVER_INTEL); - ctx = gem_context_create(fd); - } - - ctx_param.param = LOCAL_CONTEXT_PARAM_BAN_PERIOD; - - igt_subtest("basic") { - ctx_param.context = ctx; - TEST_SUCCESS(LOCAL_IOCTL_I915_GEM_CONTEXT_GETPARAM); - TEST_SUCCESS(LOCAL_IOCTL_I915_GEM_CONTEXT_SETPARAM); - } - - igt_subtest("basic-default") { - ctx_param.context = 0; - TEST_SUCCESS(LOCAL_IOCTL_I915_GEM_CONTEXT_GETPARAM); - TEST_SUCCESS(LOCAL_IOCTL_I915_GEM_CONTEXT_SETPARAM); - } - - igt_subtest("invalid-ctx-get") { - ctx_param.context = 2; - TEST_FAIL(LOCAL_IOCTL_I915_GEM_CONTEXT_GETPARAM, ENOENT); - } - - igt_subtest("invalid-ctx-set") { - ctx_param.context = ctx; - TEST_SUCCESS(LOCAL_IOCTL_I915_GEM_CONTEXT_GETPARAM); - ctx_param.context = 2; - TEST_FAIL(LOCAL_IOCTL_I915_GEM_CONTEXT_SETPARAM, ENOENT); - } - - igt_subtest("invalid-size-get") { - ctx_param.context = ctx; - ctx_param.size = 8; - TEST_SUCCESS(LOCAL_IOCTL_I915_GEM_CONTEXT_GETPARAM); - igt_assert(ctx_param.size == 0); - } - - igt_subtest("invalid-size-set") { - ctx_param.context = ctx; - TEST_SUCCESS(LOCAL_IOCTL_I915_GEM_CONTEXT_GETPARAM); - ctx_param.size = 8; - TEST_FAIL(LOCAL_IOCTL_I915_GEM_CONTEXT_SETPARAM, EINVAL); - ctx_param.size = 0; - } - - ctx_param.param = LOCAL_CONTEXT_PARAM_BAN_PERIOD; - - igt_subtest("non-root-set") { - igt_fork(child, 1) { - igt_drop_root(); - - ctx_param.context = ctx; - TEST_SUCCESS(LOCAL_IOCTL_I915_GEM_CONTEXT_GETPARAM); - ctx_param.value--; - TEST_FAIL(LOCAL_IOCTL_I915_GEM_CONTEXT_SETPARAM, EPERM); - } - - igt_waitchildren(); - } - - igt_subtest("root-set") { - ctx_param.context = ctx; - TEST_SUCCESS(LOCAL_IOCTL_I915_GEM_CONTEXT_GETPARAM); - ctx_param.value--; - TEST_SUCCESS(LOCAL_IOCTL_I915_GEM_CONTEXT_SETPARAM); - } - - ctx_param.param = LOCAL_CONTEXT_PARAM_NO_ZEROMAP; - - igt_subtest("non-root-set-no-zeromap") { - igt_fork(child, 1) { - igt_drop_root(); - - ctx_param.context = ctx; - TEST_SUCCESS(LOCAL_IOCTL_I915_GEM_CONTEXT_GETPARAM); - ctx_param.value--; - TEST_SUCCESS(LOCAL_IOCTL_I915_GEM_CONTEXT_SETPARAM); - } - - igt_waitchildren(); - } - - igt_subtest("root-set-no-zeromap-enabled") { - ctx_param.context = ctx; - TEST_SUCCESS(LOCAL_IOCTL_I915_GEM_CONTEXT_GETPARAM); - ctx_param.value = 1; - TEST_SUCCESS(LOCAL_IOCTL_I915_GEM_CONTEXT_SETPARAM); - } - - igt_subtest("root-set-no-zeromap-disabled") { - ctx_param.context = ctx; - TEST_SUCCESS(LOCAL_IOCTL_I915_GEM_CONTEXT_GETPARAM); - ctx_param.value = 0; - TEST_SUCCESS(LOCAL_IOCTL_I915_GEM_CONTEXT_SETPARAM); - } - - /* NOTE: This testcase intentionally tests for the next free parameter - * to catch ABI extensions. Don't "fix" this testcase without adding all - * the tests for the new param first. */ - ctx_param.param = LOCAL_CONTEXT_PARAM_GTT_SIZE + 1; - - igt_subtest("invalid-param-get") { - ctx_param.context = ctx; - TEST_FAIL(LOCAL_IOCTL_I915_GEM_CONTEXT_GETPARAM, EINVAL); - } - - igt_subtest("invalid-param-set") { - ctx_param.context = ctx; - TEST_FAIL(LOCAL_IOCTL_I915_GEM_CONTEXT_SETPARAM, EINVAL); - } - - igt_fixture - close(fd); -} diff -Nru intel-gpu-tools-1.13/tests/gem_ctx_param.c intel-gpu-tools-1.15/tests/gem_ctx_param.c --- intel-gpu-tools-1.13/tests/gem_ctx_param.c 1970-01-01 00:00:00.000000000 +0000 +++ intel-gpu-tools-1.15/tests/gem_ctx_param.c 2016-05-23 10:51:28.000000000 +0000 @@ -0,0 +1,167 @@ +/* + * Copyright © 2015 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 "igt.h" +#include +#include +#include + +IGT_TEST_DESCRIPTION("Basic test for context set/get param input validation."); + +int fd; +int32_t ctx; + +#define LOCAL_I915_GEM_CONTEXT_GETPARAM 0x34 +#define LOCAL_I915_GEM_CONTEXT_SETPARAM 0x35 +#define LOCAL_IOCTL_I915_GEM_CONTEXT_GETPARAM DRM_IOWR (DRM_COMMAND_BASE + LOCAL_I915_GEM_CONTEXT_GETPARAM, struct local_i915_gem_context_param) +#define LOCAL_IOCTL_I915_GEM_CONTEXT_SETPARAM DRM_IOWR (DRM_COMMAND_BASE + LOCAL_I915_GEM_CONTEXT_SETPARAM, struct local_i915_gem_context_param) + +#define TEST_SUCCESS(ioc) \ + do_ioctl(fd, (ioc), &ctx_param); +#define TEST_FAIL(ioc, exp_errno) \ + do_ioctl_err(fd, (ioc), &ctx_param, exp_errno); + +igt_main +{ + struct local_i915_gem_context_param ctx_param; + + memset(&ctx_param, 0, sizeof(ctx_param)); + + igt_fixture { + fd = drm_open_driver_render(DRIVER_INTEL); + ctx = gem_context_create(fd); + } + + ctx_param.param = LOCAL_CONTEXT_PARAM_BAN_PERIOD; + + igt_subtest("basic") { + ctx_param.context = ctx; + TEST_SUCCESS(LOCAL_IOCTL_I915_GEM_CONTEXT_GETPARAM); + TEST_SUCCESS(LOCAL_IOCTL_I915_GEM_CONTEXT_SETPARAM); + } + + igt_subtest("basic-default") { + ctx_param.context = 0; + TEST_SUCCESS(LOCAL_IOCTL_I915_GEM_CONTEXT_GETPARAM); + TEST_SUCCESS(LOCAL_IOCTL_I915_GEM_CONTEXT_SETPARAM); + } + + igt_subtest("invalid-ctx-get") { + ctx_param.context = 2; + TEST_FAIL(LOCAL_IOCTL_I915_GEM_CONTEXT_GETPARAM, ENOENT); + } + + igt_subtest("invalid-ctx-set") { + ctx_param.context = ctx; + TEST_SUCCESS(LOCAL_IOCTL_I915_GEM_CONTEXT_GETPARAM); + ctx_param.context = 2; + TEST_FAIL(LOCAL_IOCTL_I915_GEM_CONTEXT_SETPARAM, ENOENT); + } + + igt_subtest("invalid-size-get") { + ctx_param.context = ctx; + ctx_param.size = 8; + TEST_SUCCESS(LOCAL_IOCTL_I915_GEM_CONTEXT_GETPARAM); + igt_assert(ctx_param.size == 0); + } + + igt_subtest("invalid-size-set") { + ctx_param.context = ctx; + TEST_SUCCESS(LOCAL_IOCTL_I915_GEM_CONTEXT_GETPARAM); + ctx_param.size = 8; + TEST_FAIL(LOCAL_IOCTL_I915_GEM_CONTEXT_SETPARAM, EINVAL); + ctx_param.size = 0; + } + + ctx_param.param = LOCAL_CONTEXT_PARAM_BAN_PERIOD; + + igt_subtest("non-root-set") { + igt_fork(child, 1) { + igt_drop_root(); + + ctx_param.context = ctx; + TEST_SUCCESS(LOCAL_IOCTL_I915_GEM_CONTEXT_GETPARAM); + ctx_param.value--; + TEST_FAIL(LOCAL_IOCTL_I915_GEM_CONTEXT_SETPARAM, EPERM); + } + + igt_waitchildren(); + } + + igt_subtest("root-set") { + ctx_param.context = ctx; + TEST_SUCCESS(LOCAL_IOCTL_I915_GEM_CONTEXT_GETPARAM); + ctx_param.value--; + TEST_SUCCESS(LOCAL_IOCTL_I915_GEM_CONTEXT_SETPARAM); + } + + ctx_param.param = LOCAL_CONTEXT_PARAM_NO_ZEROMAP; + + igt_subtest("non-root-set-no-zeromap") { + igt_fork(child, 1) { + igt_drop_root(); + + ctx_param.context = ctx; + TEST_SUCCESS(LOCAL_IOCTL_I915_GEM_CONTEXT_GETPARAM); + ctx_param.value--; + TEST_SUCCESS(LOCAL_IOCTL_I915_GEM_CONTEXT_SETPARAM); + } + + igt_waitchildren(); + } + + igt_subtest("root-set-no-zeromap-enabled") { + ctx_param.context = ctx; + TEST_SUCCESS(LOCAL_IOCTL_I915_GEM_CONTEXT_GETPARAM); + ctx_param.value = 1; + TEST_SUCCESS(LOCAL_IOCTL_I915_GEM_CONTEXT_SETPARAM); + } + + igt_subtest("root-set-no-zeromap-disabled") { + ctx_param.context = ctx; + TEST_SUCCESS(LOCAL_IOCTL_I915_GEM_CONTEXT_GETPARAM); + ctx_param.value = 0; + TEST_SUCCESS(LOCAL_IOCTL_I915_GEM_CONTEXT_SETPARAM); + } + + /* NOTE: This testcase intentionally tests for the next free parameter + * to catch ABI extensions. Don't "fix" this testcase without adding all + * the tests for the new param first. */ + ctx_param.param = LOCAL_CONTEXT_PARAM_GTT_SIZE + 1; + + igt_subtest("invalid-param-get") { + ctx_param.context = ctx; + TEST_FAIL(LOCAL_IOCTL_I915_GEM_CONTEXT_GETPARAM, EINVAL); + } + + igt_subtest("invalid-param-set") { + ctx_param.context = ctx; + TEST_FAIL(LOCAL_IOCTL_I915_GEM_CONTEXT_SETPARAM, EINVAL); + } + + igt_fixture + close(fd); +} diff -Nru intel-gpu-tools-1.13/tests/gem_ctx_switch.c intel-gpu-tools-1.15/tests/gem_ctx_switch.c --- intel-gpu-tools-1.13/tests/gem_ctx_switch.c 1970-01-01 00:00:00.000000000 +0000 +++ intel-gpu-tools-1.15/tests/gem_ctx_switch.c 2016-05-23 10:51:28.000000000 +0000 @@ -0,0 +1,176 @@ +/* + * 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 "igt.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "drm.h" + +#define LOCAL_I915_EXEC_NO_RELOC (1<<11) +#define LOCAL_I915_EXEC_HANDLE_LUT (1<<12) + +#define INTERRUPTIBLE 1 + +static int __gem_context_create(int fd, uint32_t *ctx_id) +{ + struct drm_i915_gem_context_create arg; + int ret = 0; + + memset(&arg, 0, sizeof(arg)); + if (drmIoctl(fd, DRM_IOCTL_I915_GEM_CONTEXT_CREATE, &arg)) + ret = -errno; + + *ctx_id = arg.ctx_id; + return ret; +} + +static double elapsed(const struct timespec *start, const struct timespec *end) +{ + return ((end->tv_sec - start->tv_sec) + + (end->tv_nsec - start->tv_nsec)*1e-9); +} + +static void single(int fd, uint32_t handle, + const struct intel_execution_engine *e, + unsigned flags, + const int ncpus) +{ + struct drm_i915_gem_execbuffer2 execbuf; + struct drm_i915_gem_exec_object2 obj; + struct drm_i915_gem_relocation_entry reloc; + uint32_t contexts[64]; + int n; + + gem_require_ring(fd, e->exec_id | e->flags); + + igt_require(__gem_context_create(fd, &contexts[0]) == 0); + for (n = 1; n < 64; n++) + contexts[n] = gem_context_create(fd); + + memset(&obj, 0, sizeof(obj)); + obj.handle = handle; + + if (flags & INTERRUPTIBLE) { + /* Be tricksy and force a relocation every batch so that + * we don't emit the batch but just do MI_SET_CONTEXT + */ + memset(&reloc, 0, sizeof(reloc)); + reloc.offset = 1024; + reloc.read_domains = I915_GEM_DOMAIN_INSTRUCTION; + obj.relocs_ptr = (uintptr_t)&reloc; + obj.relocation_count = 1; + } + + memset(&execbuf, 0, sizeof(execbuf)); + execbuf.buffers_ptr = (uintptr_t)&obj; + execbuf.buffer_count = 1; + execbuf.rsvd1 = contexts[0]; + execbuf.flags = e->exec_id | e->flags; + execbuf.flags |= LOCAL_I915_EXEC_HANDLE_LUT; + execbuf.flags |= LOCAL_I915_EXEC_NO_RELOC; + igt_require(__gem_execbuf(fd, &execbuf) == 0); + if (__gem_execbuf(fd, &execbuf)) { + execbuf.flags = e->exec_id | e->flags; + reloc.target_handle = obj.handle; + gem_execbuf(fd, &execbuf); + } + gem_sync(fd, handle); + + igt_fork(child, ncpus) { + struct timespec start, now; + unsigned int count = 0; + + clock_gettime(CLOCK_MONOTONIC, &start); + do { + igt_while_interruptible(flags & INTERRUPTIBLE) { + for (int loop = 0; loop < 1024; loop++) { + execbuf.rsvd1 = contexts[loop % 64]; + reloc.presumed_offset = 0; + gem_execbuf(fd, &execbuf); + } + count += 1024; + } + clock_gettime(CLOCK_MONOTONIC, &now); + } while (elapsed(&start, &now) < 20.); + gem_sync(fd, handle); + clock_gettime(CLOCK_MONOTONIC, &now); + + igt_info("[%d] %s: %'u cycles: %.3fus%s\n", + child, e->name, count, elapsed(&start, &now)*1e6 / count, + flags & INTERRUPTIBLE ? " (interruptible)" : ""); + } + igt_waitchildren(); + + for (n = 0; n < 64; n++) + gem_context_destroy(fd, contexts[n]); +} + +igt_main +{ + const int ncpus = sysconf(_SC_NPROCESSORS_ONLN); + const struct intel_execution_engine *e; + uint32_t handle = 0; + int fd = -1; + + igt_fixture { + const uint32_t bbe = MI_BATCH_BUFFER_END; + + fd = drm_open_driver(DRIVER_INTEL); + handle = gem_create(fd, 4096); + gem_write(fd, handle, 0, &bbe, sizeof(bbe)); + } + + igt_fork_hang_detector(fd); + + for (e = intel_execution_engines; e->name; e++) { + igt_subtest_f("%s%s", e->exec_id == 0 ? "basic-" : "", e->name) + single(fd, handle, e, 0, 1); + igt_subtest_f("%s-interruptible", e->name) + single(fd, handle, e, INTERRUPTIBLE, 1); + igt_subtest_f("forked-%s", e->name) + single(fd, handle, e, 0, ncpus); + igt_subtest_f("forked-%s-interruptible", e->name) + single(fd, handle, e, INTERRUPTIBLE, ncpus); + } + + igt_stop_hang_detector(); + + igt_fixture { + gem_close(fd, handle); + close(fd); + } +} diff -Nru intel-gpu-tools-1.13/tests/gem_ctx_thrash.c intel-gpu-tools-1.15/tests/gem_ctx_thrash.c --- intel-gpu-tools-1.13/tests/gem_ctx_thrash.c 2015-11-30 16:26:22.000000000 +0000 +++ intel-gpu-tools-1.15/tests/gem_ctx_thrash.c 2016-05-23 10:51:28.000000000 +0000 @@ -31,29 +31,9 @@ #include #include - IGT_TEST_DESCRIPTION("Fill the Gobal GTT with context objects and VMs\n"); -#define OBJECT_SIZE (1024 * 1024) -#define NUM_THREADS 8 - -static int fd; -static unsigned devid; -static igt_render_copyfunc_t render_copy; - -static dri_bo **all_bo; -static int num_bo; -static int bo_per_ctx; - -static drm_intel_context **all_ctx; -static int num_ctx; -static int ctx_per_thread; - -static void xchg_ptr(void *array, unsigned i, unsigned j) -{ - void **A = array; - igt_swap(A[i], A[j]); -} +#define NUM_THREADS (2*sysconf(_SC_NPROCESSORS_ONLN)) static void xchg_int(void *array, unsigned i, unsigned j) { @@ -61,109 +41,203 @@ igt_swap(A[i], A[j]); } -static int reopen(int _fd) +static unsigned get_num_contexts(int fd) { - struct stat st; - char name[128]; + uint64_t ggtt_size; + unsigned size; + unsigned count; + + /* Compute the number of contexts we can allocate to fill the GGTT */ + ggtt_size = gem_global_aperture_size(fd); + size = 64 << 10; /* Most gen require at least 64k for ctx */ + + count = 3 * (ggtt_size / size) / 2; + igt_info("Creating %lld contexts (assuming of size %lld)\n", + (long long)count, (long long)size); - igt_assert(fstat(_fd, &st) == 0); - - sprintf(name, "/dev/dri/card%u", (unsigned)(st.st_rdev & 0x7f)); - return open(name, O_RDWR); + intel_require_memory(count, size, CHECK_RAM | CHECK_SWAP); + return count; } -static void *thread(void *bufmgr) +static int has_engine(int fd, const struct intel_execution_engine *e, uint32_t ctx) { - struct intel_batchbuffer *batch; - dri_bo **bo; - drm_intel_context **ctx; - int c, b; - - batch = intel_batchbuffer_alloc(bufmgr, devid); - - bo = malloc(num_bo * sizeof(dri_bo *)); - igt_assert(bo); - memcpy(bo, all_bo, num_bo * sizeof(dri_bo *)); - - ctx = malloc(num_ctx * sizeof(drm_intel_context *)); - igt_assert(ctx); - memcpy(ctx, all_ctx, num_ctx * sizeof(drm_intel_context *)); - igt_permute_array(ctx, num_ctx, xchg_ptr); + uint32_t bbe = MI_BATCH_BUFFER_END; + struct drm_i915_gem_execbuffer2 execbuf; + struct drm_i915_gem_exec_object2 exec; + int ret; + + memset(&exec, 0, sizeof(exec)); + exec.handle = gem_create(fd, 4096); + gem_write(fd, exec.handle, 0, &bbe, sizeof(bbe)); + + memset(&execbuf, 0, sizeof(execbuf)); + execbuf.buffers_ptr = (uintptr_t)&exec; + execbuf.buffer_count = 1; + execbuf.flags = e->exec_id | e->flags; + execbuf.rsvd1 = ctx; + ret = __gem_execbuf(fd, &execbuf); + gem_close(fd, exec.handle); - for (c = 0; c < ctx_per_thread; c++) { - igt_permute_array(bo, num_bo, xchg_ptr); - for (b = 0; b < bo_per_ctx; b++) { - struct igt_buf src, dst; - - src.bo = bo[b % num_bo]; - src.stride = 64; - src.size = OBJECT_SIZE; - src.tiling = I915_TILING_NONE; - - dst.bo = bo[(b+1) % num_bo]; - dst.stride = 64; - dst.size = OBJECT_SIZE; - dst.tiling = I915_TILING_NONE; + return ret; +} - render_copy(batch, ctx[c % num_ctx], - &src, 0, 0, 16, 16, &dst, 0, 0); +static void single(const char *name, bool all_engines) +{ + struct drm_i915_gem_exec_object2 *obj; + struct drm_i915_gem_relocation_entry *reloc; + const struct intel_execution_engine *e; + unsigned engines[16]; + uint64_t size; + uint32_t *ctx, *map, scratch; + unsigned num_ctx; + int fd, gen, num_engines; +#define MAX_LOOP 16 + + fd = drm_open_driver_master(DRIVER_INTEL); + gen = intel_gen(intel_get_drm_devid(fd)); + num_ctx = get_num_contexts(fd); + + num_engines = 0; + if (all_engines) { + for (e = intel_execution_engines; e->name; e++) { + if (e->exec_id == 0) + continue; + + if (has_engine(fd, e, 0)) + continue; + + if (e->exec_id == I915_EXEC_BSD) { + int is_bsd2 = e->flags != 0; + if (gem_has_bsd2(fd) != is_bsd2) + continue; + } + + igt_require(has_engine(fd, e, 1) == -ENOENT); + + engines[num_engines++] = e->exec_id | e->flags; + if (num_engines == ARRAY_SIZE(engines)) + break; } - } + } else + engines[num_engines++] = 0; - free(ctx); - free(bo); - intel_batchbuffer_free(batch); + size = ALIGN(num_ctx * sizeof(uint32_t), 4096); + scratch = gem_create(fd, ALIGN(num_ctx * sizeof(uint32_t), 4096)); + gem_set_caching(fd, scratch, I915_CACHING_CACHED); + obj = calloc(num_ctx, 2 * sizeof(*obj)); + reloc = calloc(num_ctx, sizeof(*reloc)); - return NULL; -} + ctx = malloc(num_ctx * sizeof(uint32_t)); + igt_assert(ctx); + for (unsigned n = 0; n < num_ctx; n++) { + ctx[n] = gem_context_create(fd); + obj[2*n + 0].handle = scratch; + + reloc[n].target_handle = scratch; + reloc[n].presumed_offset = 0; + reloc[n].offset = sizeof(uint32_t); + reloc[n].delta = n * sizeof(uint32_t); + reloc[n].read_domains = I915_GEM_DOMAIN_INSTRUCTION; + reloc[n].write_domain = 0; /* lies! */ + if (gen >= 4 && gen < 8) + reloc[n].offset += sizeof(uint32_t); -static int uses_ppgtt(int _fd) -{ - struct drm_i915_getparam gp; - int val = 0; + obj[2*n + 1].relocs_ptr = (uintptr_t)&reloc[n]; + obj[2*n + 1].relocation_count = 1; + } - memset(&gp, 0, sizeof(gp)); - gp.param = 18; /* HAS_ALIASING_PPGTT */ - gp.value = &val; + map = gem_mmap__cpu(fd, scratch, 0, size, PROT_WRITE); + for (unsigned loop = 1; loop <= MAX_LOOP; loop <<= 1) { + unsigned count = loop * num_ctx; + uint32_t *all; + + all = malloc(count * sizeof(uint32_t)); + for (unsigned n = 0; n < count; n++) + all[n] = ctx[n % num_ctx]; + igt_permute_array(all, count, xchg_int); + for (unsigned n = 0; n < count; n++) { + struct drm_i915_gem_execbuffer2 execbuf; + unsigned r = n % num_ctx; + uint64_t offset = reloc[r].presumed_offset + reloc[r].delta; + uint32_t handle = gem_create(fd, 4096); + uint32_t buf[16]; + int i; + + buf[i = 0] = MI_STORE_DWORD_IMM; + if (gen >= 8) { + buf[++i] = offset; + buf[++i] = offset >> 32; + } else if (gen >= 4) { + if (gen < 6) + buf[i] |= 1 << 22; + buf[++i] = 0; + buf[++i] = offset; + } else { + buf[i]--; + buf[++i] = offset; + } + buf[++i] = all[n]; + buf[++i] = MI_BATCH_BUFFER_END; + gem_write(fd, handle, 0, buf, sizeof(buf)); + obj[2*r + 1].handle = handle; + + memset(&execbuf, 0, sizeof(execbuf)); + execbuf.buffers_ptr = (uintptr_t)&obj[2*r]; + execbuf.buffer_count = 2; + execbuf.flags = engines[n % num_engines]; + execbuf.rsvd1 = all[n]; + gem_execbuf(fd, &execbuf); + gem_close(fd, handle); + } - if (drmIoctl(_fd, DRM_IOCTL_I915_GETPARAM, &gp)) - return 0; + /* Note we lied about the write-domain when writing from the + * GPU (in order to avoid inter-ring synchronisation), so now + * we have to force the synchronisation here. + */ + gem_set_domain(fd, scratch, + I915_GEM_DOMAIN_CPU, I915_GEM_DOMAIN_CPU); + for (unsigned n = count - num_ctx; n < count; n++) + igt_assert_eq(map[n % num_ctx], all[n]); + free(all); + igt_progress(name, loop, MAX_LOOP); + } + munmap(map, size); - errno = 0; - return val; + free(ctx); + close(fd); } -static void -processes(void) +static void processes(void) { - int *all_fds; - uint64_t aperture; + const struct intel_execution_engine *e; + unsigned engines[16]; + int num_engines; struct rlimit rlim; - int ppgtt_mode; - int ctx_size; - int obj_size; - int n; - - igt_skip_on_simulation(); + unsigned num_ctx; + uint32_t name; + int fd, *fds; + + fd = drm_open_driver(DRIVER_INTEL); + num_ctx = get_num_contexts(fd); + + num_engines = 0; + for (e = intel_execution_engines; e->name; e++) { + if (e->exec_id == 0) + continue; + + if (has_engine(fd, e, 0)) + continue; + + if (e->exec_id == I915_EXEC_BSD) { + int is_bsd2 = e->flags != 0; + if (gem_has_bsd2(fd) != is_bsd2) + continue; + } - fd = drm_open_driver_render(DRIVER_INTEL); - devid = intel_get_drm_devid(fd); - aperture = gem_aperture_size(fd); - - ppgtt_mode = uses_ppgtt(fd); - igt_require(ppgtt_mode); - - render_copy = igt_get_render_copyfunc(devid); - igt_require_f(render_copy, "no render-copy function\n"); - - if (ppgtt_mode > 1) - ctx_size = aperture >> 10; /* Assume full-ppgtt of maximum size */ - else - ctx_size = 64 << 10; /* Most gen require at least 64k for ctx */ - num_ctx = 3 * (aperture / ctx_size) / 2; - igt_info("Creating %d contexts (assuming of size %d)\n", - num_ctx, ctx_size); - intel_require_memory(num_ctx, ctx_size, CHECK_RAM | CHECK_SWAP); + engines[num_engines++] = e->exec_id | e->flags; + if (num_engines == ARRAY_SIZE(engines)) + break; + } /* tweak rlimits to allow us to create this many files */ igt_assert(getrlimit(RLIMIT_NOFILE, &rlim) == 0); @@ -174,134 +248,121 @@ igt_assert(setrlimit(RLIMIT_NOFILE, &rlim) == 0); } - all_fds = malloc(num_ctx * sizeof(int)); - igt_assert(all_fds); - for (n = 0; n < num_ctx; n++) { - all_fds[n] = reopen(fd); - if (all_fds[n] == -1) { + fds = malloc(num_ctx * sizeof(int)); + igt_assert(fds); + for (unsigned n = 0; n < num_ctx; n++) { + fds[n] = drm_open_driver(DRIVER_INTEL); + if (fds[n] == -1) { int err = errno; - for (int i = n; i--; ) - close(all_fds[i]); - free(all_fds); + for (unsigned i = n; i--; ) + close(fds[i]); + free(fds); errno = err; - igt_assert_f(0, "failed to create context %d/%d\n", n, num_ctx); + igt_assert_f(0, "failed to create context %lld/%lld\n", (long long)n, (long long)num_ctx); } } - num_bo = 2 * num_ctx; - obj_size = (2 * aperture / num_bo + 4095) & -4096; - igt_info("Creating %d surfaces (of size %d)\n", num_bo, obj_size); - intel_require_memory(num_bo, obj_size, CHECK_RAM); + if (1) { + uint32_t bbe = MI_BATCH_BUFFER_END; + name = gem_create(fd, 4096); + gem_write(fd, name, 0, &bbe, sizeof(bbe)); + name = gem_flink(fd, name); + } igt_fork(child, NUM_THREADS) { - drm_intel_bufmgr *bufmgr; - struct intel_batchbuffer *batch; - int c; - - igt_permute_array(all_fds, num_ctx, xchg_int); - - for (c = 0; c < num_ctx; c++) { - struct igt_buf src, dst; - - bufmgr = drm_intel_bufmgr_gem_init(all_fds[c], 4096); - igt_assert(bufmgr); - batch = intel_batchbuffer_alloc(bufmgr, devid); - - src.bo = drm_intel_bo_alloc(bufmgr, "", obj_size, 0); - igt_assert(src.bo); - src.stride = 64; - src.size = obj_size; - src.tiling = I915_TILING_NONE; - - dst.bo = drm_intel_bo_alloc(bufmgr, "", obj_size, 0); - igt_assert(dst.bo); - dst.stride = 64; - dst.size = obj_size; - dst.tiling = I915_TILING_NONE; - - render_copy(batch, NULL, - &src, 0, 0, 16, 16, &dst, 0, 0); - - intel_batchbuffer_free(batch); - drm_intel_bo_unreference(src.bo); - drm_intel_bo_unreference(dst.bo); - drm_intel_bufmgr_destroy(bufmgr); + struct drm_i915_gem_execbuffer2 execbuf; + struct drm_i915_gem_exec_object2 obj; + + memset(&obj, 0, sizeof(obj)); + memset(&execbuf, 0, sizeof(execbuf)); + execbuf.buffers_ptr = (uintptr_t)&obj; + execbuf.buffer_count = 1; + + igt_permute_array(fds, num_ctx, xchg_int); + for (unsigned n = 0; n < num_ctx; n++) { + obj.handle = gem_open(fds[n], name); + execbuf.flags = engines[n % num_engines]; + gem_execbuf(fds[n], &execbuf); + gem_close(fds[n], obj.handle); } } igt_waitchildren(); - for (n = 0; n < num_ctx; n++) - close(all_fds[n]); - free(all_fds); + for (unsigned n = 0; n < num_ctx; n++) + close(fds[n]); + free(fds); close(fd); } -static void -threads(void) +struct thread { + int fd; + uint32_t *all_ctx; + unsigned num_ctx; + uint32_t batch; +}; + +static void *thread(void *data) { - pthread_t threads[NUM_THREADS]; - drm_intel_bufmgr *bufmgr; - uint64_t aperture; - int ppgtt_mode; - int ctx_size; - int n; + struct thread *t = data; + struct drm_i915_gem_execbuffer2 execbuf; + struct drm_i915_gem_exec_object2 obj; + uint32_t *ctx; + + memset(&obj, 0, sizeof(obj)); + obj.handle = t->batch; + + memset(&execbuf, 0, sizeof(execbuf)); + execbuf.buffers_ptr = (uintptr_t)&obj; + execbuf.buffer_count = 1; - igt_skip_on_simulation(); + ctx = malloc(t->num_ctx * sizeof(uint32_t)); + igt_assert(ctx); + memcpy(ctx, t->all_ctx, t->num_ctx * sizeof(uint32_t)); + igt_permute_array(ctx, t->num_ctx, xchg_int); - fd = drm_open_driver_render(DRIVER_INTEL); - devid = intel_get_drm_devid(fd); - aperture = gem_aperture_size(fd); - - ppgtt_mode = uses_ppgtt(fd); - igt_require(ppgtt_mode); - - render_copy = igt_get_render_copyfunc(devid); - igt_require_f(render_copy, "no render-copy function\n"); - - bufmgr = drm_intel_bufmgr_gem_init(fd, 4096); - igt_assert(bufmgr); - drm_intel_bufmgr_gem_enable_reuse(bufmgr); - - if (ppgtt_mode > 1) - ctx_size = aperture >> 10; /* Assume full-ppgtt of maximum size */ - else - ctx_size = 64 << 10; /* Most gen require at least 64k for ctx */ - num_ctx = 3 * (aperture / ctx_size) / 2; - igt_info("Creating %d contexts (assuming of size %d)\n", - num_ctx, ctx_size); - intel_require_memory(num_ctx, ctx_size, CHECK_RAM | CHECK_SWAP); - all_ctx = malloc(num_ctx * sizeof(drm_intel_context *)); - igt_assert(all_ctx); - for (n = 0; n < num_ctx; n++) { - all_ctx[n] = drm_intel_gem_context_create(bufmgr); - igt_assert(all_ctx[n]); + for (unsigned n = 0; n < t->num_ctx; n++) { + execbuf.rsvd1 = ctx[n]; + gem_execbuf(t->fd, &execbuf); } - num_bo = 3 * (aperture / OBJECT_SIZE) / 2; - igt_info("Creating %d surfaces (of size %d)\n", num_bo, OBJECT_SIZE); - intel_require_memory(num_bo, OBJECT_SIZE, CHECK_RAM); - all_bo = malloc(num_bo * sizeof(dri_bo *)); - igt_assert(all_bo); - for (n = 0; n < num_bo; n++) { - all_bo[n] = drm_intel_bo_alloc(bufmgr, "", OBJECT_SIZE, 0); - igt_assert(all_bo[n]); - } + free(ctx); + + return NULL; +} - ctx_per_thread = 3 * num_ctx / NUM_THREADS / 2; - bo_per_ctx = 3 * num_bo / NUM_THREADS / 2; +static void threads(void) +{ + uint32_t bbe = MI_BATCH_BUFFER_END; + pthread_t threads[NUM_THREADS]; + struct thread data; - for (n = 0; n < NUM_THREADS; n++) - pthread_create(&threads[n], NULL, thread, bufmgr); + data.fd = drm_open_driver_render(DRIVER_INTEL); + data.num_ctx = get_num_contexts(data.fd); + data.all_ctx = malloc(data.num_ctx * sizeof(uint32_t)); + igt_assert(data.all_ctx); + for (unsigned n = 0; n < data.num_ctx; n++) + data.all_ctx[n] = gem_context_create(data.fd); + data.batch = gem_create(data.fd, 4096); + gem_write(data.fd, data.batch, 0, &bbe, sizeof(bbe)); - for (n = 0; n < NUM_THREADS; n++) + for (int n = 0; n < NUM_THREADS; n++) + pthread_create(&threads[n], NULL, thread, &data); + + for (int n = 0; n < NUM_THREADS; n++) pthread_join(threads[n], NULL); - drm_intel_bufmgr_destroy(bufmgr); - close(fd); + close(data.fd); } igt_main { + igt_skip_on_simulation(); + + igt_subtest("single") + single("single", false); + igt_subtest("engines") + single("engines", true); + igt_subtest("processes") processes(); diff -Nru intel-gpu-tools-1.13/tests/gem_dummy_reloc_loop.c intel-gpu-tools-1.15/tests/gem_dummy_reloc_loop.c --- intel-gpu-tools-1.13/tests/gem_dummy_reloc_loop.c 2015-11-30 16:26:22.000000000 +0000 +++ intel-gpu-tools-1.15/tests/gem_dummy_reloc_loop.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,312 +0,0 @@ -/* - * 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 "igt.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include "drm.h" -#include "intel_bufmgr.h" -#include "i830_reg.h" - -#define LOCAL_I915_EXEC_VEBOX (4<<0) -#define LOCAL_I915_EXEC_BSD_RING1 (1<<13) -#define LOCAL_I915_EXEC_BSD_RING2 (2<<13) - -static drm_intel_bufmgr *bufmgr; -struct intel_batchbuffer *batch; -static drm_intel_bo *target_buffer; - -#define NUM_FD 50 - -static int mfd[NUM_FD]; -static drm_intel_bufmgr *mbufmgr[NUM_FD]; -static struct intel_batchbuffer *mbatch[NUM_FD]; -static drm_intel_bo *mbuffer[NUM_FD]; - -/* - * 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. - */ - -IGT_TEST_DESCRIPTION("Check ring<->cpu sync using a dummy reloc."); - -#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++) { - BEGIN_BATCH(4, 1); - if (ring == I915_EXEC_RENDER) { - 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); - } else { - 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(int num_rings) -{ - int i; - - srandom(0xdeadbeef); - - for (i = 0; i < 0x100000; i++) { - int ring = random() % num_rings + 1; - - BEGIN_BATCH(4, 1); - if (ring == I915_EXEC_RENDER) { - 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); - } else { - 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); - } -} - -static void -dummy_reloc_loop_random_ring_multi_fd(int num_rings) -{ - int i; - struct intel_batchbuffer *saved_batch; - - saved_batch = batch; - - srandom(0xdeadbeef); - - for (i = 0; i < 0x100000; i++) { - int mindex; - int ring = random() % num_rings + 1; - - mindex = random() % NUM_FD; - batch = mbatch[mindex]; - - BEGIN_BATCH(4, 1); - if (ring == I915_EXEC_RENDER) { - OUT_BATCH(MI_COND_BATCH_BUFFER_END | MI_DO_COMPARE); - OUT_BATCH(0xffffffff); /* compare dword */ - OUT_RELOC(mbuffer[mindex], I915_GEM_DOMAIN_RENDER, - I915_GEM_DOMAIN_RENDER, 0); - OUT_BATCH(MI_NOOP); - } else { - OUT_BATCH(MI_FLUSH_DW | 1); - OUT_BATCH(0); /* reserved */ - OUT_RELOC(mbuffer[mindex], 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); - } - - batch = saved_batch; -} - -int fd; -int devid; -int num_rings; - -igt_main -{ - igt_skip_on_simulation(); - - igt_fixture { - int i; - fd = drm_open_driver(DRIVER_INTEL); - devid = intel_get_drm_devid(fd); - num_rings = gem_get_num_rings(fd); - /* Not yet implemented on pre-snb. */ - igt_require(HAS_BLT_RING(devid)); - - bufmgr = drm_intel_bufmgr_gem_init(fd, 4096); - igt_assert(bufmgr); - drm_intel_bufmgr_gem_enable_reuse(bufmgr); - - batch = intel_batchbuffer_alloc(bufmgr, devid); - igt_assert(batch); - - target_buffer = drm_intel_bo_alloc(bufmgr, "target bo", 4096, 4096); - igt_assert(target_buffer); - - /* Create multi drm_fd and map one gem object to multi gem_contexts */ - { - unsigned int target_flink; - char buffer_name[32]; - igt_assert(dri_bo_flink(target_buffer, &target_flink) == 0); - - for (i = 0; i < NUM_FD; i++) { - sprintf(buffer_name, "Target buffer %d\n", i); - mfd[i] = drm_open_driver(DRIVER_INTEL); - mbufmgr[i] = drm_intel_bufmgr_gem_init(mfd[i], 4096); - igt_assert_f(mbufmgr[i], - "fail to initialize buf manager " - "for drm_fd %d\n", - mfd[i]); - drm_intel_bufmgr_gem_enable_reuse(mbufmgr[i]); - mbatch[i] = intel_batchbuffer_alloc(mbufmgr[i], devid); - igt_assert_f(mbatch[i], - "fail to create batchbuffer " - "for drm_fd %d\n", - mfd[i]); - mbuffer[i] = intel_bo_gem_create_from_name( - mbufmgr[i], - buffer_name, - target_flink); - igt_assert_f(mbuffer[i], - "fail to create gem bo from global " - "gem_handle %d for drm_fd %d\n", - target_flink, mfd[i]); - } - } - } - - igt_subtest("render") { - igt_info("running dummy loop on render\n"); - dummy_reloc_loop(I915_EXEC_RENDER); - igt_info("dummy loop run on render completed\n"); - } - - igt_subtest("bsd") { - gem_require_ring(fd, I915_EXEC_BSD); - sleep(2); - igt_info("running dummy loop on bsd\n"); - dummy_reloc_loop(I915_EXEC_BSD); - igt_info("dummy loop run on bsd completed\n"); - } - - igt_subtest("blt") { - gem_require_ring(fd, I915_EXEC_BLT); - sleep(2); - igt_info("running dummy loop on blt\n"); - dummy_reloc_loop(I915_EXEC_BLT); - igt_info("dummy loop run on blt completed\n"); - } - -#ifdef I915_EXEC_VEBOX - igt_subtest("vebox") { - gem_require_ring(fd, I915_EXEC_VEBOX); - sleep(2); - igt_info("running dummy loop on vebox\n"); - dummy_reloc_loop(LOCAL_I915_EXEC_VEBOX); - igt_info("dummy loop run on vebox completed\n"); - } -#endif - - igt_subtest("bsd-ring1") { - igt_require(gem_has_bsd2(fd)); - sleep(2); - igt_info("running dummy loop on bsd-ring1\n"); - dummy_reloc_loop(I915_EXEC_BSD|LOCAL_I915_EXEC_BSD_RING1); - igt_info("dummy loop run on bsd-ring1 completed\n"); - } - - igt_subtest("bsd-ring2") { - igt_require(gem_has_bsd2(fd)); - sleep(2); - igt_info("running dummy loop on bsd-ring2\n"); - dummy_reloc_loop(I915_EXEC_BSD|LOCAL_I915_EXEC_BSD_RING2); - igt_info("dummy loop run on bsd-ring2 completed\n"); - } - - igt_subtest("mixed") { - if (num_rings > 1) { - sleep(2); - igt_info("running dummy loop on random rings\n"); - dummy_reloc_loop_random_ring(num_rings); - igt_info("dummy loop run on random rings completed\n"); - } - } - igt_subtest("mixed_multi_fd") { - if (num_rings > 1) { - sleep(2); - igt_info("running dummy loop on random rings based on " - "multi drm_fd\n"); - dummy_reloc_loop_random_ring_multi_fd(num_rings); - igt_info("dummy loop run on random rings based on " - "multi drm_fd completed\n"); - } - } - igt_fixture { - int i; - /* Free the buffer/batchbuffer/buffer mgr for multi-fd */ - { - for (i = 0; i < NUM_FD; i++) { - dri_bo_unreference(mbuffer[i]); - intel_batchbuffer_free(mbatch[i]); - drm_intel_bufmgr_destroy(mbufmgr[i]); - close(mfd[i]); - } - } - drm_intel_bo_unreference(target_buffer); - intel_batchbuffer_free(batch); - drm_intel_bufmgr_destroy(bufmgr); - - close(fd); - } -} diff -Nru intel-gpu-tools-1.13/tests/gem_eio.c intel-gpu-tools-1.15/tests/gem_eio.c --- intel-gpu-tools-1.13/tests/gem_eio.c 2015-11-30 16:26:22.000000000 +0000 +++ intel-gpu-tools-1.15/tests/gem_eio.c 2016-05-23 10:51:28.000000000 +0000 @@ -58,24 +58,9 @@ return ret; } -static bool i915_wedged_set(void) -{ - int fd, ret; - - igt_debug("Triggering GPU reset\n"); - - fd = igt_debugfs_open("i915_wedged", O_RDWR); - igt_require(fd >= 0); - - ret = write(fd, "1\n", 2) == 2; - close(fd); - - return ret; -} - static void trigger_reset(int fd) { - igt_assert(i915_wedged_set()); + igt_force_gpu_reset(); /* And just check the gpu is indeed running again */ igt_debug("Checking that the GPU recovered\n"); @@ -112,14 +97,6 @@ trigger_reset(fd); } -static int __gem_execbuf(int fd, struct drm_i915_gem_execbuffer2 *eb) -{ - int err = 0; - if (drmIoctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, eb)) - err = -errno; - return err; -} - static void test_execbuf(int fd) { struct drm_i915_gem_execbuffer2 execbuf; @@ -161,9 +138,21 @@ { igt_hang_ring_t hang; + /* If the request we wait on completes due to a hang (even for + * that request), the user expects the return value to 0 (success). + */ + hang = igt_hang_ring(fd, I915_EXEC_DEFAULT); + igt_assert_eq(__gem_wait(fd, hang.handle, -1), 0); + igt_post_hang_ring(fd, hang); + + /* If the GPU is wedged during the wait, again we expect the return + * value to be 0 (success). + */ + igt_require(i915_reset_control(false)); hang = igt_hang_ring(fd, I915_EXEC_DEFAULT); - igt_assert_eq(__gem_wait(fd, hang.handle, -1), -EIO); + igt_assert_eq(__gem_wait(fd, hang.handle, -1), 0); igt_post_hang_ring(fd, hang); + igt_require(i915_reset_control(true)); trigger_reset(fd); } @@ -176,7 +165,7 @@ igt_fixture { fd = drm_open_driver(DRIVER_INTEL); - igt_require_hang_ring(fd, -1); + igt_require_hang_ring(fd, I915_EXEC_DEFAULT); } igt_subtest("throttle") diff -Nru intel-gpu-tools-1.13/tests/gem_evict_alignment.c intel-gpu-tools-1.15/tests/gem_evict_alignment.c --- intel-gpu-tools-1.13/tests/gem_evict_alignment.c 2015-11-30 16:26:22.000000000 +0000 +++ intel-gpu-tools-1.15/tests/gem_evict_alignment.c 2016-05-23 10:51:28.000000000 +0000 @@ -53,7 +53,8 @@ #define WIDTH 1024 static void -copy(int fd, uint32_t dst, uint32_t src, uint32_t *all_bo, int n_bo, int alignment, int error) +copy(int fd, uint32_t dst, uint32_t src, uint32_t *all_bo, + uint64_t n_bo, uint64_t alignment, int error) { uint32_t batch[12]; struct drm_i915_gem_relocation_entry reloc[2]; @@ -129,10 +130,11 @@ free(obj); } -static void minor_evictions(int fd, int size, int count) +static void minor_evictions(int fd, uint64_t size, uint64_t count) { uint32_t *bo, *sel; - int n, m, alignment, pass, fail; + uint64_t n, m, alignment; + int pass, fail; intel_require_memory(2 * count, size, CHECK_RAM); @@ -159,9 +161,10 @@ free(bo); } -static void major_evictions(int fd, int size, int count) +static void major_evictions(int fd, uint64_t size, uint64_t count) { - int n, m, loop, alignment, max; + uint64_t n, m, alignment, max; + int loop; uint32_t *bo; intel_require_memory(count, size, CHECK_RAM); @@ -185,11 +188,10 @@ free(bo); } -int fd; - igt_main { - int size, count; + uint64_t size, count; + int fd = -1; igt_fixture { fd = drm_open_driver(DRIVER_INTEL); @@ -220,22 +222,22 @@ major_evictions(fd, size, count); } - if (igt_fork_hang_helper()) { - igt_subtest("minor-hang") { - size = 1024 * 1024; - count = 3*gem_aperture_size(fd) / size / 4; - minor_evictions(fd, size, count); - } + igt_subtest("minor-hang") { + igt_fork_hang_helper(); + size = 1024 * 1024; + count = 3*gem_aperture_size(fd) / size / 4; + minor_evictions(fd, size, count); + } - igt_subtest("major-hang") { - size = 3*gem_aperture_size(fd) / 4; - count = 4; - major_evictions(fd, size, count); - } - igt_stop_hang_helper(); + igt_subtest("major-hang") { + size = 3*gem_aperture_size(fd) / 4; + count = 4; + major_evictions(fd, size, count); } igt_stop_signal_helper(); - igt_fixture + igt_fixture { + igt_stop_hang_helper(); close(fd); + } } diff -Nru intel-gpu-tools-1.13/tests/gem_evict_everything.c intel-gpu-tools-1.15/tests/gem_evict_everything.c --- intel-gpu-tools-1.13/tests/gem_evict_everything.c 2015-11-30 16:26:22.000000000 +0000 +++ intel-gpu-tools-1.15/tests/gem_evict_everything.c 2016-05-23 10:51:28.000000000 +0000 @@ -130,10 +130,9 @@ return ret; } -static void clear(int fd, uint32_t handle, int size) +static void clear(int fd, uint32_t handle, uint64_t size) { - void *base = gem_mmap__cpu(fd, handle, 0, size, PROT_READ | PROT_WRITE); - + void *base = gem_mmap__cpu(fd, handle, 0, size, PROT_WRITE); memset(base, 0, size); munmap(base, size); } @@ -145,10 +144,10 @@ .clear = clear, }; -static void test_forking_evictions(int fd, int size, int count, - unsigned flags) +static void test_forking_evictions(int fd, uint64_t size, uint64_t count, + unsigned flags) { - int trash_count; + uint64_t trash_count; trash_count = intel_get_total_ram_mb() * 11 / 10; intel_require_memory(trash_count, size, CHECK_RAM | CHECK_SWAP); @@ -156,12 +155,12 @@ forking_evictions(fd, &fault_ops, size, count, trash_count, flags); } -static void test_mlocked_evictions(int fd, int size, int count) +static void test_mlocked_evictions(int fd, uint64_t size, uint64_t count) { mlocked_evictions(fd, &fault_ops, size, count); } -static void test_swapping_evictions(int fd, int size, int count) +static void test_swapping_evictions(int fd, uint64_t size, uint64_t count) { int trash_count; @@ -171,19 +170,21 @@ swapping_evictions(fd, &fault_ops, size, count, trash_count); } -static void test_minor_evictions(int fd, int size, int count) +static void test_minor_evictions(int fd, uint64_t size, uint64_t count) { minor_evictions(fd, &fault_ops, size, count); } -static void test_major_evictions(int fd, int size, int count) +static void test_major_evictions(int fd, uint64_t size, uint64_t count) { major_evictions(fd, &fault_ops, size, count); } igt_main { - int size, count, fd; + uint64_t size, count; + int fd; + size = count = 0; fd = -1; @@ -243,32 +244,32 @@ test_major_evictions(fd, size, count); } - if (igt_fork_hang_helper()) { - igt_fixture { - size = 1024 * 1024; - count = 3*gem_aperture_size(fd) / size / 4; - } + igt_fixture { + igt_fork_hang_helper(); - igt_subtest("mlocked-hang") - test_mlocked_evictions(fd, size, count); + size = 1024 * 1024; + count = 3*gem_aperture_size(fd) / size / 4; + } - igt_subtest("swapping-hang") - test_swapping_evictions(fd, size, count); + igt_subtest("mlocked-hang") + test_mlocked_evictions(fd, size, count); - igt_subtest("minor-hang") - test_minor_evictions(fd, size, count); + igt_subtest("swapping-hang") + test_swapping_evictions(fd, size, count); - igt_subtest("major-hang") { - size = 3*gem_aperture_size(fd) / 4; - count = 4; - test_major_evictions(fd, size, count); - } + igt_subtest("minor-hang") + test_minor_evictions(fd, size, count); - igt_stop_hang_helper(); + igt_subtest("major-hang") { + size = 3*gem_aperture_size(fd) / 4; + count = 4; + test_major_evictions(fd, size, count); } - igt_stop_signal_helper(); + + igt_stop_hang_helper(); igt_fixture { + igt_stop_signal_helper(); close(fd); } } diff -Nru intel-gpu-tools-1.13/tests/gem_exec_alignment.c intel-gpu-tools-1.15/tests/gem_exec_alignment.c --- intel-gpu-tools-1.13/tests/gem_exec_alignment.c 2015-11-30 16:26:22.000000000 +0000 +++ intel-gpu-tools-1.15/tests/gem_exec_alignment.c 2016-05-23 10:51:28.000000000 +0000 @@ -40,33 +40,128 @@ IGT_TEST_DESCRIPTION("Exercises the basic execbuffer using object alignments"); -static int __gem_execbuf(int fd, struct drm_i915_gem_execbuffer2 *eb) +static uint32_t find_last_bit(uint64_t x) { - return drmIoctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, eb); + uint32_t i = 0; + while (x) { + x >>= 1; + i++; + } + return i; +} + +static uint32_t file_max(void) +{ + static uint32_t max; + if (max == 0) { + FILE *file = fopen("/proc/sys/fs/file-max", "r"); + max = 80000; + if (file) { + igt_assert(fscanf(file, "%d", &max) == 1); + fclose(file); + } + max /= 2; + } + return max; } -igt_simple_main +static void many(int fd) +{ + uint32_t bbe = MI_BATCH_BUFFER_END; + struct drm_i915_gem_exec_object2 *execobj; + struct drm_i915_gem_execbuffer2 execbuf; + uint64_t gtt_size, ram_size; + uint64_t alignment, max_alignment, count, i; + + gtt_size = gem_aperture_size(fd); + if (!gem_uses_full_ppgtt(fd)) + gtt_size /= 2; /* We have to *share* our GTT! */ + ram_size = intel_get_total_ram_mb(); + ram_size *= 1024 * 1024; + count = ram_size / 4096; + if (count > file_max()) /* vfs cap */ + count = file_max(); + max_alignment = find_last_bit(gtt_size / count); + if (max_alignment <= 13) + max_alignment = 4096; + else + max_alignment = 1ull << (max_alignment - 1); + count = gtt_size / max_alignment / 2; + + igt_info("gtt_size=%lld MiB, max-alignment=%lld, count=%lld\n", + (long long)gtt_size/1024/1024, + (long long)max_alignment, + (long long)count); + intel_require_memory(count, 4096, CHECK_RAM); + + execobj = calloc(sizeof(*execobj), count + 1); + igt_assert(execobj); + + for (i = 0; i < count; i++) { + execobj[i].handle = gem_create(fd, 4096); + if ((gtt_size-1) >> 32) + execobj[i].flags = 1<<3; /* EXEC_OBJECT_SUPPORTS_48B_ADDRESS */ + } + execobj[i].handle = gem_create(fd, 4096); + if ((gtt_size-1) >> 32) + execobj[i].flags = 1<<3; /* EXEC_OBJECT_SUPPORTS_48B_ADDRESS */ + gem_write(fd, execobj[i].handle, 0, &bbe, sizeof(bbe)); + + memset(&execbuf, 0, sizeof(execbuf)); + execbuf.buffers_ptr = (uintptr_t)execobj; + execbuf.buffer_count = count + 1; + igt_require(__gem_execbuf(fd, &execbuf) == 0); + + for (alignment = 4096; alignment < gtt_size; alignment <<= 1) { + for (i = 0; i < count; i++) + execobj[i].alignment = alignment; + if (alignment > max_alignment) { + uint64_t factor = alignment / max_alignment; + execbuf.buffer_count = 2*count / factor; + execbuf.buffers_ptr = + (uintptr_t)(execobj + count - execbuf.buffer_count + 1); + } + + igt_debug("testing %lld x alignment=%#llx [%db]\n", + (long long)execbuf.buffer_count - 1, + (long long)alignment, + find_last_bit(alignment)-1); + gem_execbuf(fd, &execbuf); + for(i = count - execbuf.buffer_count + 1; i < count; i++) { + igt_assert_eq_u64(execobj[i].alignment, alignment); + igt_assert_eq_u64(execobj[i].offset % alignment, 0); + } + } + + for (i = 0; i < count; i++) + gem_close(fd, execobj[i].handle); + gem_close(fd, execobj[i].handle); + free(execobj); +} + +static void single(int fd) { struct drm_i915_gem_exec_object2 execobj; struct drm_i915_gem_execbuffer2 execbuf; uint32_t batch = MI_BATCH_BUFFER_END; + uint64_t gtt_size; int non_pot; - int fd; - - igt_skip_on_simulation(); - - fd = drm_open_driver(DRIVER_INTEL); memset(&execobj, 0, sizeof(execobj)); - memset(&execbuf, 0, sizeof(execbuf)); - execobj.handle = gem_create(fd, 4096); + execobj.flags = 1<<3; /* EXEC_OBJECT_SUPPORTS_48B_ADDRESS */ gem_write(fd, execobj.handle, 0, &batch, sizeof(batch)); + memset(&execbuf, 0, sizeof(execbuf)); execbuf.buffers_ptr = (uintptr_t)&execobj; execbuf.buffer_count = 1; - gem_execbuf(fd, &execbuf); + gtt_size = gem_aperture_size(fd); + if (__gem_execbuf(fd, &execbuf)) { + execobj.flags = 0; + gtt_size = 1ull << 32; + gem_execbuf(fd, &execbuf); + } execobj.alignment = 3*4096; non_pot = __gem_execbuf(fd, &execbuf) == 0; @@ -79,7 +174,37 @@ if (!non_pot && execobj.alignment & -execobj.alignment) continue; + igt_debug("starting offset: %#llx, next alignment: %#llx\n", + (long long)execobj.offset, + (long long)execobj.alignment); gem_execbuf(fd, &execbuf); - igt_assert_eq(execobj.offset % execobj.alignment, 0); + igt_assert_eq_u64(execobj.offset % execobj.alignment, 0); } + + for (execobj.alignment = 4096; + execobj.alignment < gtt_size; + execobj.alignment <<= 1) { + igt_debug("starting offset: %#llx, next alignment: %#llx [%db]\n", + (long long)execobj.offset, + (long long)execobj.alignment, + find_last_bit(execobj.alignment)-1); + gem_execbuf(fd, &execbuf); + igt_assert_eq_u64(execobj.offset % execobj.alignment, 0); + } + + gem_close(fd, execobj.handle); +} + +igt_main +{ + int fd = -1; + + igt_fixture + fd = drm_open_driver(DRIVER_INTEL); + + igt_subtest("single") /* basic! */ + single(fd); + igt_subtest("many") + many(fd); + } diff -Nru intel-gpu-tools-1.13/tests/gem_exec_basic.c intel-gpu-tools-1.15/tests/gem_exec_basic.c --- intel-gpu-tools-1.13/tests/gem_exec_basic.c 1970-01-01 00:00:00.000000000 +0000 +++ intel-gpu-tools-1.15/tests/gem_exec_basic.c 2016-05-23 10:51:28.000000000 +0000 @@ -0,0 +1,125 @@ +/* + * Copyright © 2016 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 "igt.h" + +IGT_TEST_DESCRIPTION("Basic sanity check of execbuf-ioctl rings."); + +static void noop(int fd, unsigned ring) +{ + uint32_t bbe = MI_BATCH_BUFFER_END; + struct drm_i915_gem_execbuffer2 execbuf; + struct drm_i915_gem_exec_object2 exec; + + gem_require_ring(fd, ring); + + memset(&exec, 0, sizeof(exec)); + exec.handle = gem_create(fd, 4096); + gem_write(fd, exec.handle, 0, &bbe, sizeof(bbe)); + + memset(&execbuf, 0, sizeof(execbuf)); + execbuf.buffers_ptr = (uintptr_t)&exec; + execbuf.buffer_count = 1; + execbuf.flags = ring; + gem_execbuf(fd, &execbuf); + gem_close(fd, exec.handle); +} + +static void readonly(int fd, unsigned ring) +{ + uint32_t bbe = MI_BATCH_BUFFER_END; + struct drm_i915_gem_execbuffer2 *execbuf; + struct drm_i915_gem_exec_object2 exec; + + gem_require_ring(fd, ring); + + memset(&exec, 0, sizeof(exec)); + exec.handle = gem_create(fd, 4096); + gem_write(fd, exec.handle, 0, &bbe, sizeof(bbe)); + + execbuf = mmap(NULL, 4096, PROT_WRITE, MAP_ANON | MAP_PRIVATE, -1, 0); + igt_assert(execbuf != NULL); + + execbuf->buffers_ptr = (uintptr_t)&exec; + execbuf->buffer_count = 1; + execbuf->flags = ring; + igt_assert(mprotect(execbuf, 4096, PROT_READ) == 0); + + gem_execbuf(fd, execbuf); + munmap(execbuf, 4096); + gem_close(fd, exec.handle); +} + +static void gtt(int fd, unsigned ring) +{ + uint32_t bbe = MI_BATCH_BUFFER_END; + struct drm_i915_gem_execbuffer2 *execbuf; + struct drm_i915_gem_exec_object2 *exec; + uint32_t handle; + + gem_require_ring(fd, ring); + + handle = gem_create(fd, 4096); + + gem_set_domain(fd, handle, I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT); + execbuf = gem_mmap__gtt(fd, handle, 4096, PROT_WRITE); + exec = (struct drm_i915_gem_exec_object2 *)(execbuf + 1); + gem_close(fd, handle); + + exec->handle = gem_create(fd, 4096); + gem_write(fd, exec->handle, 0, &bbe, sizeof(bbe)); + + execbuf->buffers_ptr = (uintptr_t)exec; + execbuf->buffer_count = 1; + execbuf->flags = ring; + + gem_execbuf(fd, execbuf); + gem_close(fd, exec->handle); + + munmap(execbuf, 4096); +} + +igt_main +{ + const struct intel_execution_engine *e; + int fd = -1; + + igt_fixture + fd = drm_open_driver(DRIVER_INTEL); + + igt_fork_hang_detector(fd); + + for (e = intel_execution_engines; e->name; e++) { + igt_subtest_f("basic-%s", e->name) + noop(fd, e->exec_id | e->flags); + igt_subtest_f("readonly-%s", e->name) + readonly(fd, e->exec_id | e->flags); + igt_subtest_f("gtt-%s", e->name) + gtt(fd, e->exec_id | e->flags); + } + + igt_stop_hang_detector(); + + igt_fixture + close(fd); +} diff -Nru intel-gpu-tools-1.13/tests/gem_exec_blt.c intel-gpu-tools-1.15/tests/gem_exec_blt.c --- intel-gpu-tools-1.13/tests/gem_exec_blt.c 2015-11-30 16:26:22.000000000 +0000 +++ intel-gpu-tools-1.15/tests/gem_exec_blt.c 2016-05-23 10:51:28.000000000 +0000 @@ -170,22 +170,6 @@ return buf; } -static uint32_t dumb_create(int fd) -{ - struct drm_mode_create_dumb arg; - int ret; - - arg.bpp = 32; - arg.width = 32; - arg.height = 32; - - ret = drmIoctl(fd, DRM_IOCTL_MODE_CREATE_DUMB, &arg); - igt_assert_eq(ret, 0); - igt_assert(arg.size >= 4096); - - return arg.handle; -} - static int dcmp(const void *A, const void *B) { const double *a = A, *b = B; @@ -209,7 +193,7 @@ fd = drm_open_driver(DRIVER_INTEL); if (dumb) - handle = dumb_create(fd); + handle = kmstest_dumb_create(fd, 32, 32, 32, NULL, NULL); else handle = gem_create(fd, 4096); diff -Nru intel-gpu-tools-1.13/tests/gem_exec_create.c intel-gpu-tools-1.15/tests/gem_exec_create.c --- intel-gpu-tools-1.13/tests/gem_exec_create.c 1970-01-01 00:00:00.000000000 +0000 +++ intel-gpu-tools-1.15/tests/gem_exec_create.c 2016-05-23 10:51:28.000000000 +0000 @@ -0,0 +1,168 @@ +/* + * 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 "igt.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "drm.h" + +#define LOCAL_I915_EXEC_NO_RELOC (1<<11) +#define LOCAL_I915_EXEC_HANDLE_LUT (1<<12) + +#define LOCAL_I915_EXEC_BSD_SHIFT (13) +#define LOCAL_I915_EXEC_BSD_MASK (3 << LOCAL_I915_EXEC_BSD_SHIFT) + +#define ENGINE_FLAGS (I915_EXEC_RING_MASK | LOCAL_I915_EXEC_BSD_MASK) + +static double elapsed(const struct timespec *start, const struct timespec *end) +{ + return ((end->tv_sec - start->tv_sec) + + (end->tv_nsec - start->tv_nsec)*1e-9); +} + +static bool ignore_engine(int fd, unsigned engine) +{ + if (engine == 0) + return true; + + if (gem_has_bsd2(fd) && engine == I915_EXEC_BSD) + return true; + + return false; +} + +#define LEAK 0x1 + +static void all(int fd, unsigned flags, int timeout, int ncpus) +{ + const uint32_t bbe = MI_BATCH_BUFFER_END; + struct drm_i915_gem_execbuffer2 execbuf; + struct drm_i915_gem_exec_object2 obj; + unsigned engines[16]; + unsigned nengine; + unsigned engine; + + nengine = 0; + for_each_engine(fd, engine) { + if (ignore_engine(fd, engine)) + continue; + + engines[nengine++] = engine; + } + igt_require(nengine); + + memset(&obj, 0, sizeof(obj)); + obj.handle = gem_create(fd, 4096); + gem_write(fd, obj.handle, 0, &bbe, sizeof(bbe)); + + memset(&execbuf, 0, sizeof(execbuf)); + execbuf.buffers_ptr = (uintptr_t)&obj; + execbuf.buffer_count = 1; + execbuf.flags |= LOCAL_I915_EXEC_HANDLE_LUT; + execbuf.flags |= LOCAL_I915_EXEC_NO_RELOC; + if (__gem_execbuf(fd, &execbuf)) { + execbuf.flags = 0; + gem_execbuf(fd, &execbuf); + } + gem_sync(fd, obj.handle); + gem_close(fd, obj.handle); + + igt_fork(child, ncpus) { + struct timespec start, now; + unsigned long count; + double time; + + count = 0; + clock_gettime(CLOCK_MONOTONIC, &start); + do { + for (int loop = 0; loop < 1024; loop++) { + for (int n = 0; n < nengine; n++) { + obj.handle = gem_create(fd, 4096); + gem_write(fd, obj.handle, 0, &bbe, sizeof(bbe)); + execbuf.flags &= ~ENGINE_FLAGS; + execbuf.flags |= engines[n]; + gem_execbuf(fd, &execbuf); + if (flags & LEAK) + gem_madvise(fd, obj.handle, I915_MADV_DONTNEED); + else + gem_close(fd, obj.handle); + } + } + count += nengine * 1024; + clock_gettime(CLOCK_MONOTONIC, &now); + } while (elapsed(&start, &now) < timeout); /* Hang detection ~120s */ + obj.handle = gem_create(fd, 4096); + gem_write(fd, obj.handle, 0, &bbe, sizeof(bbe)); + for (int n = 0; n < nengine; n++) { + execbuf.flags &= ~ENGINE_FLAGS; + execbuf.flags |= engines[n]; + gem_execbuf(fd, &execbuf); + } + gem_sync(fd, obj.handle); + gem_close(fd, obj.handle); + clock_gettime(CLOCK_MONOTONIC, &now); + + time = elapsed(&start, &now) / count; + igt_info("[%d] All (%d engines): %'lu cycles, average %.3fus per cycle\n", + child, nengine, count, 1e6*time); + } + igt_waitchildren(); +} + +igt_main +{ + const int ncpus = sysconf(_SC_NPROCESSORS_ONLN); + int device = -1; + + igt_fixture + device = drm_open_driver(DRIVER_INTEL); + + igt_fork_hang_detector(device); + + igt_subtest("basic") + all(device, 0, 20, 1); + igt_subtest("forked") + all(device, 0, 20, ncpus); + + igt_subtest("madvise") + all(device, LEAK, 20, 1); + + igt_stop_hang_detector(); + + igt_fixture + close(device); +} diff -Nru intel-gpu-tools-1.13/tests/gem_exec_flush.c intel-gpu-tools-1.15/tests/gem_exec_flush.c --- intel-gpu-tools-1.13/tests/gem_exec_flush.c 1970-01-01 00:00:00.000000000 +0000 +++ intel-gpu-tools-1.15/tests/gem_exec_flush.c 2016-05-23 10:51:28.000000000 +0000 @@ -0,0 +1,598 @@ +/* + * Copyright © 2016 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 "igt.h" + +IGT_TEST_DESCRIPTION("Basic check of flushing after batches"); + +#define UNCACHED 0 +#define COHERENT 1 +#define WC 2 +#define WRITE 4 +#define KERNEL 8 +#define SET_DOMAIN 16 +#define BEFORE 32 +#define INTERRUPTIBLE 64 +#define CMDPARSER 128 +#define BASIC 256 + +static void run(int fd, unsigned ring, int nchild, int timeout, + unsigned flags) +{ + const int gen = intel_gen(intel_get_drm_devid(fd)); + + /* The crux of this testing is whether writes by the GPU are coherent + * from the CPU. + * + * For example, using plain clflush (the simplest and most visible + * in terms of function calls / syscalls) we have two tests which + * perform: + * + * USER (0): + * execbuf(map[i] = i); + * sync(); + * clflush(&map[i]); + * assert(map[i] == i); + * + * execbuf(map[i] = i ^ ~0); + * sync(); + * clflush(&map[i]); + * assert(map[i] == i ^ ~0); + * + * BEFORE: + * clflush(&map[i]); + * execbuf(map[i] = i); + * sync(); + * assert(map[i] == i); + * + * clflush(&map[i]); + * execbuf(map[i] = i ^ ~0); + * sync(); + * assert(map[i] == i ^ ~0); + * + * The assertion here is that the cacheline invalidations are precise + * and we have no speculative prefetch that can see the future map[i] + * access and bring it ahead of the execution, or accidental cache + * pollution by the kernel. + */ + + igt_fork(child, nchild) { + const uint32_t bbe = MI_BATCH_BUFFER_END; + struct drm_i915_gem_exec_object2 obj[3]; + struct drm_i915_gem_relocation_entry reloc0[1024]; + struct drm_i915_gem_relocation_entry reloc1[1024]; + struct drm_i915_gem_execbuffer2 execbuf; + unsigned long cycles = 0; + uint32_t *ptr; + uint32_t *map; + int i; + + memset(obj, 0, sizeof(obj)); + obj[0].handle = gem_create(fd, 4096); + obj[0].flags |= EXEC_OBJECT_WRITE; + + if (flags & WC) { + igt_assert(flags & COHERENT); + map = gem_mmap__wc(fd, obj[0].handle, 0, 4096, PROT_WRITE); + gem_set_domain(fd, obj[0].handle, + I915_GEM_DOMAIN_GTT, + I915_GEM_DOMAIN_GTT); + } else { + gem_set_caching(fd, obj[0].handle, !!(flags & COHERENT)); + map = gem_mmap__cpu(fd, obj[0].handle, 0, 4096, PROT_WRITE); + gem_set_domain(fd, obj[0].handle, + I915_GEM_DOMAIN_CPU, + I915_GEM_DOMAIN_CPU); + } + + for (i = 0; i < 1024; i++) + map[i] = 0xabcdabcd; + + gem_set_domain(fd, obj[0].handle, + I915_GEM_DOMAIN_GTT, + I915_GEM_DOMAIN_GTT); + + memset(&execbuf, 0, sizeof(execbuf)); + execbuf.buffers_ptr = (uintptr_t)obj; + execbuf.buffer_count = 3; + execbuf.flags = ring | (1 << 11) | (1<<12); + if (gen < 6) + execbuf.flags |= I915_EXEC_SECURE; + + obj[1].handle = gem_create(fd, 1024*64); + obj[2].handle = gem_create(fd, 1024*64); + gem_write(fd, obj[2].handle, 0, &bbe, sizeof(bbe)); + igt_require(__gem_execbuf(fd, &execbuf) == 0); + + obj[1].relocation_count = 1; + obj[2].relocation_count = 1; + + ptr = gem_mmap__wc(fd, obj[1].handle, 0, 64*1024, + PROT_WRITE | PROT_READ); + gem_set_domain(fd, obj[1].handle, + I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT); + + memset(reloc0, 0, sizeof(reloc0)); + for (i = 0; i < 1024; i++) { + uint64_t offset; + uint32_t *b = &ptr[16 * i]; + + reloc0[i].presumed_offset = obj[0].offset; + reloc0[i].offset = (b - ptr + 1) * sizeof(*ptr); + reloc0[i].delta = i * sizeof(uint32_t); + reloc0[i].read_domains = I915_GEM_DOMAIN_INSTRUCTION; + reloc0[i].write_domain = I915_GEM_DOMAIN_INSTRUCTION; + + offset = obj[0].offset + reloc0[i].delta; + *b++ = MI_STORE_DWORD_IMM | (gen < 6 ? 1 << 22 : 0); + if (gen >= 8) { + *b++ = offset; + *b++ = offset >> 32; + } else if (gen >= 4) { + *b++ = 0; + *b++ = offset; + reloc0[i].offset += sizeof(*ptr); + } else { + b[-1] -= 1; + *b++ = offset; + } + *b++ = i; + *b++ = MI_BATCH_BUFFER_END; + } + munmap(ptr, 64*1024); + + ptr = gem_mmap__wc(fd, obj[2].handle, 0, 64*1024, + PROT_WRITE | PROT_READ); + gem_set_domain(fd, obj[2].handle, + I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT); + + memset(reloc1, 0, sizeof(reloc1)); + for (i = 0; i < 1024; i++) { + uint64_t offset; + uint32_t *b = &ptr[16 * i]; + + reloc1[i].presumed_offset = obj[0].offset; + reloc1[i].offset = (b - ptr + 1) * sizeof(*ptr); + reloc1[i].delta = i * sizeof(uint32_t); + reloc1[i].read_domains = I915_GEM_DOMAIN_INSTRUCTION; + reloc1[i].write_domain = I915_GEM_DOMAIN_INSTRUCTION; + + offset = obj[0].offset + reloc1[i].delta; + *b++ = MI_STORE_DWORD_IMM | (gen < 6 ? 1 << 22 : 0); + if (gen >= 8) { + *b++ = offset; + *b++ = offset >> 32; + } else if (gen >= 4) { + *b++ = 0; + *b++ = offset; + reloc1[i].offset += sizeof(*ptr); + } else { + b[-1] -= 1; + *b++ = offset; + } + *b++ = i ^ 0xffffffff; + *b++ = MI_BATCH_BUFFER_END; + } + munmap(ptr, 64*1024); + + igt_until_timeout(timeout) { + bool xor = false; + int idx = cycles++ % 1024; + + /* Inspect a different cacheline each iteration */ + i = 16 * (idx % 64) + (idx / 64); + obj[1].relocs_ptr = (uintptr_t)&reloc0[i]; + obj[2].relocs_ptr = (uintptr_t)&reloc1[i]; + execbuf.batch_start_offset = 64*i; + +overwrite: + if ((flags & BEFORE) && + !((flags & COHERENT) || gem_has_llc(fd))) + igt_clflush_range(&map[i], sizeof(map[i])); + + execbuf.buffer_count = 2 + xor; + gem_execbuf(fd, &execbuf); + + if (flags & SET_DOMAIN) { + unsigned domain = flags & WC ? I915_GEM_DOMAIN_GTT : I915_GEM_DOMAIN_CPU; + igt_while_interruptible(flags & INTERRUPTIBLE) + gem_set_domain(fd, obj[0].handle, + domain, (flags & WRITE) ? domain : 0); + + if (xor) + igt_assert_eq_u32(map[i], i ^ 0xffffffff); + else + igt_assert_eq_u32(map[i], i); + + if (flags & WRITE) + map[i] = 0xdeadbeef; + } else if (flags & KERNEL) { + uint32_t val; + + igt_while_interruptible(flags & INTERRUPTIBLE) + gem_read(fd, obj[0].handle, + i*sizeof(uint32_t), + &val, sizeof(val)); + + if (xor) + igt_assert_eq_u32(val, i ^ 0xffffffff); + else + igt_assert_eq_u32(val, i); + + if (flags & WRITE) { + val = 0xdeadbeef; + igt_while_interruptible(flags & INTERRUPTIBLE) + gem_write(fd, obj[0].handle, + i*sizeof(uint32_t), + &val, sizeof(val)); + } + } else { + igt_while_interruptible(flags & INTERRUPTIBLE) + gem_sync(fd, obj[0].handle); + + if (!(flags & (BEFORE | COHERENT)) && + !gem_has_llc(fd)) + igt_clflush_range(&map[i], sizeof(map[i])); + + if (xor) + igt_assert_eq_u32(map[i], i ^ 0xffffffff); + else + igt_assert_eq_u32(map[i], i); + + if (flags & WRITE) { + map[i] = 0xdeadbeef; + if (!(flags & (COHERENT | BEFORE))) + igt_clflush_range(&map[i], sizeof(map[i])); + } + } + + if (!xor) { + xor= true; + goto overwrite; + } + } + igt_info("Child[%d]: %lu cycles\n", child, cycles); + + gem_close(fd, obj[2].handle); + gem_close(fd, obj[1].handle); + + munmap(map, 4096); + gem_close(fd, obj[0].handle); + } + igt_waitchildren(); +} + +enum batch_mode { + BATCH_KERNEL, + BATCH_USER, + BATCH_CPU, + BATCH_GTT, + BATCH_WC, +}; +static void batch(int fd, unsigned ring, int nchild, int timeout, + enum batch_mode mode, unsigned flags) +{ + const int gen = intel_gen(intel_get_drm_devid(fd)); + + if (flags & CMDPARSER) { + int cmdparser = -1; + drm_i915_getparam_t gp; + + gp.param = I915_PARAM_CMD_PARSER_VERSION; + gp.value = &cmdparser; + drmIoctl(fd, DRM_IOCTL_I915_GETPARAM, &gp); + igt_require(cmdparser > 0); + } + + igt_fork(child, nchild) { + const uint32_t bbe = MI_BATCH_BUFFER_END; + struct drm_i915_gem_exec_object2 obj[2]; + struct drm_i915_gem_relocation_entry reloc; + struct drm_i915_gem_execbuffer2 execbuf; + unsigned long cycles = 0; + uint32_t *ptr; + uint32_t *map; + int i; + + memset(obj, 0, sizeof(obj)); + obj[0].handle = gem_create(fd, 4096); + obj[0].flags |= EXEC_OBJECT_WRITE; + + gem_set_caching(fd, obj[0].handle, !!(flags & COHERENT)); + map = gem_mmap__cpu(fd, obj[0].handle, 0, 4096, PROT_WRITE); + + gem_set_domain(fd, obj[0].handle, + I915_GEM_DOMAIN_CPU, + I915_GEM_DOMAIN_CPU); + for (i = 0; i < 1024; i++) + map[i] = 0xabcdabcd; + + memset(&execbuf, 0, sizeof(execbuf)); + execbuf.buffers_ptr = (uintptr_t)obj; + execbuf.buffer_count = 2; + execbuf.flags = ring | (1 << 11) | (1<<12); + if (gen < 6) + execbuf.flags |= I915_EXEC_SECURE; + + obj[1].handle = gem_create(fd, 64<<10); + gem_write(fd, obj[1].handle, 0, &bbe, sizeof(bbe)); + igt_require(__gem_execbuf(fd, &execbuf) == 0); + + obj[1].relocation_count = 1; + obj[1].relocs_ptr = (uintptr_t)&reloc; + + switch (mode) { + case BATCH_CPU: + case BATCH_USER: + ptr = gem_mmap__cpu(fd, obj[1].handle, 0, 64<<10, + PROT_WRITE); + break; + + case BATCH_WC: + ptr = gem_mmap__wc(fd, obj[1].handle, 0, 64<<10, + PROT_WRITE); + break; + + case BATCH_GTT: + ptr = gem_mmap__gtt(fd, obj[1].handle, 64<<10, + PROT_WRITE); + break; + + case BATCH_KERNEL: + ptr = mmap(0, 64<<10, PROT_WRITE, + MAP_PRIVATE | MAP_ANON, -1, 0); + break; + } + + memset(&reloc, 0, sizeof(reloc)); + reloc.read_domains = I915_GEM_DOMAIN_INSTRUCTION; + reloc.write_domain = I915_GEM_DOMAIN_INSTRUCTION; + + igt_until_timeout(timeout) { + execbuf.batch_start_offset = 0; + reloc.offset = sizeof(uint32_t); + if (gen >= 4 && gen < 8) + reloc.offset += sizeof(uint32_t); + + for (i = 0; i < 1024; i++) { + uint64_t offset; + uint32_t *start = &ptr[execbuf.batch_start_offset/sizeof(*start)]; + uint32_t *b = start; + + switch (mode) { + case BATCH_CPU: + gem_set_domain(fd, obj[1].handle, + I915_GEM_DOMAIN_CPU, I915_GEM_DOMAIN_CPU); + break; + + case BATCH_WC: + case BATCH_GTT: + gem_set_domain(fd, obj[1].handle, + I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT); + break; + + case BATCH_USER: + case BATCH_KERNEL: + break; + } + + reloc.presumed_offset = obj[0].offset; + reloc.delta = i * sizeof(uint32_t); + + offset = reloc.presumed_offset + reloc.delta; + *b++ = MI_STORE_DWORD_IMM | (gen < 6 ? 1 << 22 : 0); + if (gen >= 8) { + *b++ = offset; + *b++ = offset >> 32; + } else if (gen >= 4) { + *b++ = 0; + *b++ = offset; + } else { + b[-1] -= 1; + *b++ = offset; + } + *b++ = cycles + i; + *b++ = MI_BATCH_BUFFER_END; + + if (flags & CMDPARSER) { + execbuf.batch_len = + (b - start) * sizeof(uint32_t); + if (execbuf.batch_len & 4) + execbuf.batch_len += 4; + } + + switch (mode) { + case BATCH_KERNEL: + gem_write(fd, obj[1].handle, + execbuf.batch_start_offset, + start, (b - start) * sizeof(uint32_t)); + break; + + case BATCH_USER: + if (!gem_has_llc(fd)) + igt_clflush_range(start, + (b - start) * sizeof(uint32_t)); + break; + + case BATCH_CPU: + case BATCH_GTT: + case BATCH_WC: + break; + } + gem_execbuf(fd, &execbuf); + + execbuf.batch_start_offset += 64; + reloc.offset += 64; + } + + if (!(flags & COHERENT)) { + gem_set_domain(fd, obj[0].handle, + I915_GEM_DOMAIN_CPU, + I915_GEM_DOMAIN_CPU); + } else + gem_sync(fd, obj[0].handle); + for (i = 0; i < 1024; i++) { + igt_assert_eq_u32(map[i], cycles + i); + map[i] = 0xabcdabcd ^ cycles; + } + cycles += 1024; + + if (mode == BATCH_USER) + gem_sync(fd, obj[1].handle); + } + igt_info("Child[%d]: %lu cycles\n", child, cycles); + + munmap(ptr, 64<<10); + gem_close(fd, obj[1].handle); + + munmap(map, 4096); + gem_close(fd, obj[0].handle); + } + igt_waitchildren(); +} + +static const char *yesno(bool x) +{ + return x ? "yes" : "no"; +} + +igt_main +{ + const struct intel_execution_engine *e; + const int ncpus = sysconf(_SC_NPROCESSORS_ONLN); + const struct batch { + const char *name; + unsigned mode; + } batches[] = { + { "kernel", BATCH_KERNEL }, + { "user", BATCH_USER }, + { "cpu", BATCH_CPU }, + { "gtt", BATCH_GTT }, + { "wc", BATCH_WC }, + { NULL } + }; + const struct mode { + const char *name; + unsigned flags; + } modes[] = { + { "ro", BASIC }, + { "rw", BASIC | WRITE }, + { "ro-before", BEFORE }, + { "rw-before", BEFORE | WRITE }, + { "pro", BASIC | KERNEL }, + { "prw", BASIC | KERNEL | WRITE }, + { "set", BASIC | SET_DOMAIN | WRITE }, + { NULL } + }; + int gen = -1; + int fd = -1; + + igt_skip_on_simulation(); + + igt_fixture { + igt_require(igt_setup_clflush()); + fd = drm_open_driver(DRIVER_INTEL); + gem_require_mmap_wc(fd); + gen = intel_gen(intel_get_drm_devid(fd)); + igt_info("Has LLC? %s\n", yesno(gem_has_llc(fd))); + } + + igt_fork_hang_detector(fd); + + for (e = intel_execution_engines; e->name; e++) igt_subtest_group { + unsigned ring = e->exec_id | e->flags; + unsigned timeout = 5 + 120*!!e->exec_id; + + igt_fixture { + gem_require_ring(fd, ring); + igt_skip_on_f(gen == 6 && e->exec_id == I915_EXEC_BSD, + "MI_STORE_DATA broken on gen6 bsd\n"); + } + + for (const struct batch *b = batches; b->name; b++) { + igt_subtest_f("%sbatch-%s-%s-uc", + b == batches && e->exec_id == 0 ? "basic-" : "", + b->name, + e->name) + batch(fd, ring, ncpus, timeout, b->mode, 0); + igt_subtest_f("%sbatch-%s-%s-wb", + b == batches && e->exec_id == 0 ? "basic-" : "", + b->name, + e->name) + batch(fd, ring, ncpus, timeout, b->mode, COHERENT); + igt_subtest_f("%sbatch-%s-%s-cmd", + b == batches && e->exec_id == 0 ? "basic-" : "", + b->name, + e->name) + batch(fd, ring, ncpus, timeout, b->mode, + COHERENT | CMDPARSER); + } + + for (const struct mode *m = modes; m->name; m++) { + igt_subtest_f("%suc-%s-%s", + (m->flags & BASIC && e->exec_id == 0) ? "basic-" : "", + m->name, + e->name) + run(fd, ring, ncpus, timeout, + UNCACHED | m->flags); + + igt_subtest_f("uc-%s-%s-interruptible", + m->name, + e->name) + run(fd, ring, ncpus, timeout, + UNCACHED | m->flags | INTERRUPTIBLE); + + igt_subtest_f("%swb-%s-%s", + e->exec_id == 0 ? "basic-" : "", + m->name, + e->name) + run(fd, ring, ncpus, timeout, + COHERENT | m->flags); + + igt_subtest_f("wb-%s-%s-interruptible", + m->name, + e->name) + run(fd, ring, ncpus, timeout, + COHERENT | m->flags | INTERRUPTIBLE); + + igt_subtest_f("wc-%s-%s", + m->name, + e->name) + run(fd, ring, ncpus, timeout, + COHERENT | WC | m->flags); + + igt_subtest_f("wc-%s-%s-interruptible", + m->name, + e->name) + run(fd, ring, ncpus, timeout, + COHERENT | WC | m->flags | INTERRUPTIBLE); + } + } + + igt_stop_hang_detector(); + + igt_fixture + close(fd); +} diff -Nru intel-gpu-tools-1.13/tests/gem_exec_gttfill.c intel-gpu-tools-1.15/tests/gem_exec_gttfill.c --- intel-gpu-tools-1.13/tests/gem_exec_gttfill.c 1970-01-01 00:00:00.000000000 +0000 +++ intel-gpu-tools-1.15/tests/gem_exec_gttfill.c 2016-05-23 10:51:28.000000000 +0000 @@ -0,0 +1,218 @@ +/* + * Copyright © 2016 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 "igt.h" + +IGT_TEST_DESCRIPTION("Fill the GTT with batches."); + +#define BATCH_SIZE (4096<<10) + +static void gem_require_store_dword(int fd, unsigned ring) +{ + int gen = intel_gen(intel_get_drm_devid(fd)); + ring &= ~(3 << 13); + igt_skip_on_f(gen == 6 && ring == I915_EXEC_BSD, + "MI_STORE_DATA broken on gen6 bsd\n"); +} + +static bool ignore_engine(int fd, unsigned engine) +{ + if (engine == 0) + return true; + + if (gem_has_bsd2(fd) && engine == I915_EXEC_BSD) + return true; + + return false; +} + +static void xchg_u32(void *array, unsigned i, unsigned j) +{ + uint32_t *u32 = array; + uint32_t tmp = u32[i]; + u32[i] = u32[j]; + u32[j] = tmp; +} + +static void submit(int fd, int gen, + struct drm_i915_gem_execbuffer2 *eb, + struct drm_i915_gem_relocation_entry *reloc, + uint32_t *handles, unsigned count) +{ + struct drm_i915_gem_exec_object2 obj; + + eb->buffers_ptr = (uintptr_t)&obj; + for (unsigned i = 0; i < count; i++) { + uint32_t batch[16]; + unsigned n; + + memset(&obj, 0, sizeof(obj)); + obj.handle = handles[i]; + obj.relocs_ptr = (uintptr_t)reloc; + obj.relocation_count = 2; + + memset(reloc, 0, 2*sizeof(*reloc)); + reloc[0].target_handle = obj.handle; + reloc[0].offset = eb->batch_start_offset; + reloc[0].offset += sizeof(uint32_t); + reloc[0].delta = BATCH_SIZE - eb->batch_start_offset - 8; + reloc[0].read_domains = I915_GEM_DOMAIN_INSTRUCTION; + reloc[1].target_handle = obj.handle; + reloc[1].offset = eb->batch_start_offset; + reloc[1].offset += 3*sizeof(uint32_t); + reloc[1].read_domains = I915_GEM_DOMAIN_INSTRUCTION; + + n = 0; + batch[n] = MI_STORE_DWORD_IMM | (gen < 6 ? 1 << 22 : 0); + if (gen >= 8) { + batch[n] |= 1 << 21; + batch[n]++; + batch[++n] = reloc[0].delta;/* lower_32_bits(address) */ + batch[++n] = 0; /* upper_32_bits(address) */ + } else if (gen >= 4) { + batch[++n] = 0; + batch[++n] = reloc[0].delta;/* lower_32_bits(address) */ + reloc[0].offset += sizeof(uint32_t); + } else { + batch[n]--; + batch[++n] = reloc[0].delta;/* lower_32_bits(address) */ + reloc[1].offset -= sizeof(uint32_t); + } + batch[++n] = 0; /* lower_32_bits(value) */ + batch[++n] = 0; /* upper_32_bits(value) / nop */ + batch[++n] = MI_BATCH_BUFFER_END; + gem_write(fd, obj.handle, eb->batch_start_offset, + batch, sizeof(batch)); + + gem_execbuf(fd, eb); + } +} + +static void fillgtt(int fd, unsigned ring, int timeout) +{ + const int gen = intel_gen(intel_get_drm_devid(fd)); + struct drm_i915_gem_execbuffer2 execbuf; + struct drm_i915_gem_relocation_entry reloc[2]; + unsigned *handles; + unsigned engines[16]; + unsigned nengine; + unsigned engine; + uint64_t size; + unsigned count; + + nengine = 0; + if (ring == 0) { + for_each_engine(fd, engine) { + if (ignore_engine(fd, engine)) + continue; + + if (gen == 6 && e__->exec_id == I915_EXEC_BSD) + continue; + + engines[nengine++] = engine; + } + } else { + gem_require_ring(fd, ring); + gem_require_store_dword(fd, ring); + + engines[nengine++] = ring; + } + igt_require(nengine); + + size = gem_aperture_size(fd); + if (size > 1ull<<32) /* Limit to 4GiB as we do not use allow-48b */ + size = 1ull << 32; + igt_require(size < (1ull<<32) * BATCH_SIZE); + + count = size / BATCH_SIZE + 1; + igt_debug("Using %'d batches to fill %'llu aperture on %d engines\n", + count, (long long)size, nengine); + intel_require_memory(count, BATCH_SIZE, CHECK_RAM); + intel_detect_and_clear_missed_interrupts(fd); + + memset(&execbuf, 0, sizeof(execbuf)); + execbuf.buffer_count = 1; + if (gen < 6) + execbuf.flags |= I915_EXEC_SECURE; + + handles = calloc(count, sizeof(handles)); + igt_assert(handles); + for (unsigned i = 0; i < count; i++) + handles[i] = gem_create(fd, BATCH_SIZE); + + /* Flush all memory before we start the timer */ + submit(fd, gen, &execbuf, reloc, handles, count); + + igt_fork(child, nengine) { + igt_permute_array(handles, count, xchg_u32); + execbuf.batch_start_offset = child*64; + execbuf.flags |= engines[child]; + igt_until_timeout(timeout) { + submit(fd, gen, &execbuf, reloc, handles, count); + for (unsigned i = 0; i < count; i++) { + uint32_t handle = handles[i]; + uint64_t buf[2]; + + gem_read(fd, handle, reloc[1].offset, &buf[0], sizeof(buf[0])); + gem_read(fd, handle, reloc[0].delta, &buf[1], sizeof(buf[1])); + igt_assert_eq_u64(buf[0], buf[1]); + } + } + } + igt_waitchildren(); + + for (unsigned i = 0; i < count; i++) + gem_close(fd, handles[i]); + + igt_assert_eq(intel_detect_and_clear_missed_interrupts(fd), 0); +} + +igt_main +{ + const struct intel_execution_engine *e; + int device = -1; + + igt_skip_on_simulation(); + + igt_fixture { + device = drm_open_driver(DRIVER_INTEL); + } + + igt_fork_hang_detector(device); + + igt_subtest("basic") + fillgtt(device, 0, 1); /* just enough to run a single pass */ + + for (e = intel_execution_engines; e->name; e++) + igt_subtest_f("%s", e->name) + fillgtt(device, e->exec_id | e->flags, 20); + + igt_subtest("all") + fillgtt(device, 0, 150); + + igt_stop_hang_detector(); + + igt_fixture { + close(device); + } +} diff -Nru intel-gpu-tools-1.13/tests/gem_exec_lut_handle.c intel-gpu-tools-1.15/tests/gem_exec_lut_handle.c --- intel-gpu-tools-1.13/tests/gem_exec_lut_handle.c 2015-11-30 16:26:22.000000000 +0000 +++ intel-gpu-tools-1.15/tests/gem_exec_lut_handle.c 2016-05-23 10:51:28.000000000 +0000 @@ -165,7 +165,7 @@ for (j = 0; j < m; j++) { target[j] = hars_petruska_f54_1_random() % n; reloc[j].target_handle = target[j]; - reloc[j].presumed_offset = 0; + reloc[j].presumed_offset = -1; } gem_execbuf(fd,&execbuf); @@ -173,7 +173,7 @@ for (count = 0; count < 1000; count++) { if ((p->flags & SKIP_RELOC) == 0) { for (j = 0; j < m; j++) - reloc[j].presumed_offset = 0; + reloc[j].presumed_offset = -1; if (p->flags & CYCLE_BATCH) { c = (c + 1) % 16; gem_exec[MAX_NUM_EXEC].handle = cycle[c]; @@ -203,7 +203,7 @@ for (count = 0; count < 1000; count++) { if ((p->flags & SKIP_RELOC) == 0) { for (j = 0; j < m; j++) - reloc[j].presumed_offset = 0; + reloc[j].presumed_offset = -1; if (p->flags & CYCLE_BATCH) { c = (c + 1) % 16; gem_exec[MAX_NUM_EXEC].handle = cycle[c]; diff -Nru intel-gpu-tools-1.13/tests/gem_exec_nop.c intel-gpu-tools-1.15/tests/gem_exec_nop.c --- intel-gpu-tools-1.13/tests/gem_exec_nop.c 2015-11-30 16:26:22.000000000 +0000 +++ intel-gpu-tools-1.15/tests/gem_exec_nop.c 2016-05-23 10:51:28.000000000 +0000 @@ -43,209 +43,189 @@ #define LOCAL_I915_EXEC_NO_RELOC (1<<11) #define LOCAL_I915_EXEC_HANDLE_LUT (1<<12) -#define LOCAL_I915_EXEC_VEBOX (4<<0) +#define LOCAL_I915_EXEC_BSD_SHIFT (13) +#define LOCAL_I915_EXEC_BSD_MASK (3 << LOCAL_I915_EXEC_BSD_SHIFT) -const uint32_t batch[2] = {MI_BATCH_BUFFER_END}; -int device; +#define ENGINE_FLAGS (I915_EXEC_RING_MASK | LOCAL_I915_EXEC_BSD_MASK) -static int sysfs_read(const char *name) +static double elapsed(const struct timespec *start, const struct timespec *end) { - char buf[4096]; - struct stat st; - int sysfd; - int len; + return ((end->tv_sec - start->tv_sec) + + (end->tv_nsec - start->tv_nsec)*1e-9); +} - if (fstat(device, &st)) - return -1; +static double nop_on_ring(int fd, uint32_t handle, unsigned ring_id, + int timeout, unsigned long *out) +{ + struct drm_i915_gem_execbuffer2 execbuf; + struct drm_i915_gem_exec_object2 obj; + struct timespec start, now; + unsigned long count; - sprintf(buf, "/sys/class/drm/card%d/%s", - (int)(st.st_rdev & 0x7f), name); - sysfd = open(buf, O_RDONLY); - if (sysfd < 0) - return -1; + memset(&obj, 0, sizeof(obj)); + obj.handle = handle; + + memset(&execbuf, 0, sizeof(execbuf)); + execbuf.buffers_ptr = (uintptr_t)&obj; + execbuf.buffer_count = 1; + execbuf.flags = ring_id; + execbuf.flags |= LOCAL_I915_EXEC_HANDLE_LUT; + execbuf.flags |= LOCAL_I915_EXEC_NO_RELOC; + if (__gem_execbuf(fd, &execbuf)) { + execbuf.flags = ring_id; + gem_execbuf(fd, &execbuf); + } + gem_sync(fd, handle); + intel_detect_and_clear_missed_interrupts(fd); - len = read(sysfd, buf, sizeof(buf)-1); - close(sysfd); - if (len < 0) - return -1; + count = 0; + clock_gettime(CLOCK_MONOTONIC, &start); + do { + for (int loop = 0; loop < 1024; loop++) + gem_execbuf(fd, &execbuf); + + count += 1024; + clock_gettime(CLOCK_MONOTONIC, &now); + } while (elapsed(&start, &now) < timeout); + gem_sync(fd, handle); + clock_gettime(CLOCK_MONOTONIC, &now); + igt_assert_eq(intel_detect_and_clear_missed_interrupts(fd), 0); - buf[len] = '\0'; - return atoi(buf); + *out = count; + return elapsed(&start, &now); } -static int sysfs_write(const char *name, int value) +static void single(int fd, uint32_t handle, + unsigned ring_id, const char *ring_name) { - char buf[4096]; - struct stat st; - int sysfd; - int len; - - if (fstat(device, &st)) - return -1; + double time; + unsigned long count; - sprintf(buf, "/sys/class/drm/card%d/%s", - (int)(st.st_rdev & 0x7f), name); - sysfd = open(buf, O_WRONLY); - if (sysfd < 0) - return -1; - - len = sprintf(buf, "%d", value); - len = write(sysfd, buf, len); - close(sysfd); - - if (len < 0) - return len; + gem_require_ring(fd, ring_id); - return 0; + time = nop_on_ring(fd, handle, ring_id, 20, &count); + igt_info("%s: %'lu cycles: %.3fus\n", + ring_name, count, time*1e6 / count); } -static uint64_t elapsed(const struct timespec *start, - const struct timespec *end, - int loop) +static bool ignore_engine(int fd, unsigned engine) { - return (1000000000ULL*(end->tv_sec - start->tv_sec) + (end->tv_nsec - start->tv_nsec))/loop; + if (engine == 0) + return true; + + if (gem_has_bsd2(fd) && engine == I915_EXEC_BSD) + return true; + + return false; } -static void loop(int fd, uint32_t handle, unsigned ring_id, const char *ring_name) +static void all(int fd, uint32_t handle, int timeout) { struct drm_i915_gem_execbuffer2 execbuf; - struct drm_i915_gem_exec_object2 gem_exec[1]; - int count; - - gem_require_ring(fd, ring_id); - igt_debug("RPS frequency range [%d, %d]\n", - sysfs_read("gt_min_freq_mhz"), - sysfs_read("gt_max_freq_mhz")); + struct drm_i915_gem_exec_object2 obj; + struct timespec start, now; + unsigned engines[16]; + unsigned nengine; + unsigned engine; + unsigned long count; + double time, max = 0, min = HUGE_VAL, sum = 0; + const char *name; + + nengine = 0; + for_each_engine(fd, engine) { + if (ignore_engine(fd, engine)) + continue; + + time = nop_on_ring(fd, handle, engine, 1, &count) / count; + if (time > max) { + name = e__->name; + max = time; + } + if (time < min) + min = time; + sum += time; + engines[nengine++] = engine; + } + igt_require(nengine); + igt_info("Maximum execution latency on %s, %.3fus, total %.3fus per cycle\n", + name, max*1e6, sum*1e6); - memset(&gem_exec, 0, sizeof(gem_exec)); - gem_exec[0].handle = handle; + memset(&obj, 0, sizeof(obj)); + obj.handle = handle; memset(&execbuf, 0, sizeof(execbuf)); - execbuf.buffers_ptr = (uintptr_t)gem_exec; + execbuf.buffers_ptr = (uintptr_t)&obj; execbuf.buffer_count = 1; - execbuf.flags = ring_id; execbuf.flags |= LOCAL_I915_EXEC_HANDLE_LUT; execbuf.flags |= LOCAL_I915_EXEC_NO_RELOC; - if (drmIoctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, &execbuf)) { - execbuf.flags = ring_id; - do_ioctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, &execbuf); + if (__gem_execbuf(fd, &execbuf)) { + execbuf.flags = 0; + gem_execbuf(fd, &execbuf); } gem_sync(fd, handle); + intel_detect_and_clear_missed_interrupts(fd); - for (count = 1; count <= SLOW_QUICK(1<<17, 1<<4); count <<= 1) { - const int reps = 7; - igt_stats_t stats; - int n; - - igt_stats_init_with_size(&stats, reps); - - for (n = 0; n < reps; n++) { - struct timespec start, end; - int loops = count; - usleep(200000); /* wait 200ms for the hw to go back to sleep */ - clock_gettime(CLOCK_MONOTONIC, &start); - while (loops--) - do_ioctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, &execbuf); - gem_sync(fd, handle); - clock_gettime(CLOCK_MONOTONIC, &end); - igt_stats_push(&stats, elapsed(&start, &end, count)); + count = 0; + clock_gettime(CLOCK_MONOTONIC, &start); + do { + for (int loop = 0; loop < 1024; loop++) { + for (int n = 0; n < nengine; n++) { + execbuf.flags &= ~ENGINE_FLAGS; + execbuf.flags |= engines[n]; + gem_execbuf(fd, &execbuf); + } } + count += nengine * 1024; + clock_gettime(CLOCK_MONOTONIC, &now); + } while (elapsed(&start, &now) < timeout); /* Hang detection ~120s */ + gem_sync(fd, handle); + clock_gettime(CLOCK_MONOTONIC, &now); + igt_assert_eq(intel_detect_and_clear_missed_interrupts(fd), 0); - igt_info("Time to exec x %d: %7.3fµs (ring=%s)\n", - count, igt_stats_get_trimean(&stats)/1000, ring_name); - fflush(stdout); - - igt_stats_fini(&stats); - } -} - -static void set_auto_freq(void) -{ - int min = sysfs_read("gt_RPn_freq_mhz"); - int max = sysfs_read("gt_RP0_freq_mhz"); - if (max <= min) - return; - - igt_debug("Setting min to %dMHz, and max to %dMHz\n", min, max); - sysfs_write("gt_min_freq_mhz", min); - sysfs_write("gt_max_freq_mhz", max); -} - -static void set_min_freq(void) -{ - int min = sysfs_read("gt_RPn_freq_mhz"); - igt_require(min > 0); - igt_debug("Setting min/max to %dMHz\n", min); - (void)sysfs_write("gt_idle_freq_mhz", min); - (void)sysfs_write("gt_boost_freq_mhz", min); - igt_require(sysfs_write("gt_min_freq_mhz", min) == 0 && - sysfs_write("gt_max_freq_mhz", min) == 0); -} - -static void set_max_freq(void) -{ - int max = sysfs_read("gt_RP0_freq_mhz"); - igt_require(max > 0); - igt_debug("Setting min/max to %dMHz\n", max); - (void)sysfs_write("gt_idle_freq_mhz", max); - (void)sysfs_write("gt_boost_freq_mhz", max); - igt_require(sysfs_write("gt_max_freq_mhz", max) == 0 && - sysfs_write("gt_min_freq_mhz", max) == 0); + time = elapsed(&start, &now) / count; + igt_info("All (%d engines): %'lu cycles, average %.3fus per cycle\n", + nengine, count, 1e6*time); + + /* The rate limiting step is how fast the slowest engine can + * its queue of requests, if we wait upon a full ring all dispatch + * is frozen. So in general we cannot go faster than the slowest + * engine, but we should equally not go any slower. + */ + igt_assert_f(time < max + 10*min/9, /* ensure parallel execution */ + "Average time (%.3fus) exceeds expecation for parallel execution (min %.3fus, max %.3fus; limit set at %.3fus)\n", + 1e6*time, 1e6*min, 1e6*max, 1e6*(max + 10*min/9)); } igt_main { - const struct { - const char *suffix; - void (*func)(void); - } rps[] = { - { "", set_auto_freq }, - { "-min", set_min_freq }, - { "-max", set_max_freq }, - { NULL, NULL }, - }, *r; - int min = -1, max = -1, boost = -1, idle = -1; + const struct intel_execution_engine *e; uint32_t handle = 0; + int device = -1; igt_fixture { - device = drm_open_driver(DRIVER_INTEL); - - min = sysfs_read("gt_min_freq_mhz"); - max = sysfs_read("gt_max_freq_mhz"); - boost = sysfs_read("gt_boost_freq_mhz"); - idle = sysfs_read("gt_idle_freq_mhz"); + const uint32_t bbe = MI_BATCH_BUFFER_END; + device = drm_open_driver(DRIVER_INTEL); handle = gem_create(device, 4096); - gem_write(device, handle, 0, batch, sizeof(batch)); + gem_write(device, handle, 0, &bbe, sizeof(bbe)); } - for (r = rps; r->suffix; r++) { - igt_fixture r->func(); + igt_fork_hang_detector(device); - igt_subtest_f("render%s", r->suffix) - loop(device, handle, I915_EXEC_RENDER, "render"); + igt_subtest("basic") + all(device, handle, 10); - igt_subtest_f("bsd%s", r->suffix) - loop(device, handle, I915_EXEC_BSD, "bsd"); + for (e = intel_execution_engines; e->name; e++) + igt_subtest_f("%s", e->name) + single(device, handle, e->exec_id | e->flags, e->name); - igt_subtest_f("blt%s", r->suffix) - loop(device, handle, I915_EXEC_BLT, "blt"); + igt_subtest("all") + all(device, handle, 150); - igt_subtest_f("vebox%s", r->suffix) - loop(device, handle, LOCAL_I915_EXEC_VEBOX, "vebox"); - } + igt_stop_hang_detector(); igt_fixture { gem_close(device, handle); - - if (min > 0) - sysfs_write("gt_min_freq_mhz", min); - if (max > 0) - sysfs_write("gt_max_freq_mhz", max); - if (boost > 0) - sysfs_write("gt_boost_freq_mhz", boost); - if (idle > 0) - sysfs_write("gt_idle_freq_mhz", idle); close(device); } } diff -Nru intel-gpu-tools-1.13/tests/gem_exec_parallel.c intel-gpu-tools-1.15/tests/gem_exec_parallel.c --- intel-gpu-tools-1.13/tests/gem_exec_parallel.c 1970-01-01 00:00:00.000000000 +0000 +++ intel-gpu-tools-1.15/tests/gem_exec_parallel.c 2016-05-23 10:51:28.000000000 +0000 @@ -0,0 +1,291 @@ +/* + * 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. + * + */ + +/** @file gem_exec_parallel.c + * + * Exercise using many, many writers into a buffer. + */ + +#include + +#include "igt.h" +#include "igt_gt.h" + +#define LOCAL_I915_EXEC_NO_RELOC (1<<11) +#define LOCAL_I915_EXEC_HANDLE_LUT (1<<12) + +#define LOCAL_I915_EXEC_BSD_SHIFT (13) +#define LOCAL_I915_EXEC_BSD_MASK (3 << LOCAL_I915_EXEC_BSD_SHIFT) + +#define ENGINE_MASK (I915_EXEC_RING_MASK | LOCAL_I915_EXEC_BSD_MASK) + +#define VERIFY 0 + +static void check_bo(int fd, uint32_t handle, int pass) +{ + uint32_t *map; + int i; + + igt_debug("Verifying result (pass=%d, handle=%d)\n", pass, handle); + map = gem_mmap__cpu(fd, handle, 0, 4096, PROT_READ); + gem_set_domain(fd, handle, I915_GEM_DOMAIN_CPU, 0); + for (i = 0; i < 1024; i++) + igt_assert_eq(map[i], i); + munmap(map, 4096); +} + +static uint32_t __gem_context_create(int fd) +{ + struct drm_i915_gem_context_create arg; + + memset(&arg, 0, sizeof(arg)); + if (drmIoctl(fd, DRM_IOCTL_I915_GEM_CONTEXT_CREATE, &arg) == 0) + gem_context_destroy(fd, arg.ctx_id); + + return arg.ctx_id; +} + +static void gem_require_context(int fd) +{ + igt_require(__gem_context_create(fd)); +} + +static bool can_mi_store_dword(int gen, unsigned engine) +{ + return !(gen == 6 && (engine & ~(3<<13)) == I915_EXEC_BSD); +} + +static bool ignore_engine(int gen, unsigned engine) +{ + if (engine == 0) + return true; + + if (!can_mi_store_dword(gen, engine)) + return true; + + return false; +} + +#define CONTEXTS 0x1 +#define FDS 0x2 + +struct thread { + pthread_t thread; + pthread_mutex_t *mutex; + pthread_cond_t *cond; + unsigned flags; + uint32_t *scratch; + unsigned id; + unsigned engine; + int fd, gen, *go; +}; + +static void *thread(void *data) +{ + struct thread *t = data; + struct drm_i915_gem_exec_object2 obj[2]; + struct drm_i915_gem_relocation_entry reloc; + struct drm_i915_gem_execbuffer2 execbuf; + uint32_t batch[16]; + int fd, i; + + pthread_mutex_lock(t->mutex); + while (*t->go == 0) + pthread_cond_wait(t->cond, t->mutex); + pthread_mutex_unlock(t->mutex); + + if (t->flags & FDS) + fd = drm_open_driver(DRIVER_INTEL); + else + fd = t->fd; + + i = 0; + batch[i] = MI_STORE_DWORD_IMM | (t->gen < 6 ? 1 << 22 : 0); + if (t->gen >= 8) { + batch[++i] = 4*t->id; + batch[++i] = 0; + } else if (t->gen >= 4) { + batch[++i] = 0; + batch[++i] = 4*t->id; + } else { + batch[i]--; + batch[++i] = 4*t->id; + } + batch[++i] = t->id; + batch[++i] = MI_BATCH_BUFFER_END; + + memset(obj, 0, sizeof(obj)); + obj[0].flags = EXEC_OBJECT_WRITE; + + memset(&reloc, 0, sizeof(reloc)); + reloc.offset = sizeof(uint32_t); + if (t->gen < 8 && t->gen >= 4) + reloc.offset += sizeof(uint32_t); + reloc.read_domains = I915_GEM_DOMAIN_INSTRUCTION; + reloc.write_domain = I915_GEM_DOMAIN_INSTRUCTION; + reloc.delta = 4*t->id; + obj[1].handle = gem_create(fd, 4096); + obj[1].relocs_ptr = (uintptr_t)&reloc; + obj[1].relocation_count = 1; + gem_write(fd, obj[1].handle, 0, batch, sizeof(batch)); + + memset(&execbuf, 0, sizeof(execbuf)); + execbuf.buffers_ptr = (uintptr_t)obj; + execbuf.buffer_count = 2; + execbuf.flags = t->engine; + execbuf.flags |= LOCAL_I915_EXEC_HANDLE_LUT; + execbuf.flags |= LOCAL_I915_EXEC_NO_RELOC; + if (t->gen < 6) + execbuf.flags |= I915_EXEC_SECURE; + if (t->flags & CONTEXTS) + execbuf.rsvd1 = gem_context_create(fd); + + for (i = 0; i < 16; i++) { + obj[0].handle = t->scratch[i]; + if (t->flags & FDS) + obj[0].handle = gem_open(fd, obj[0].handle); + + gem_execbuf(fd, &execbuf); + + if (t->flags & FDS) + gem_close(fd, obj[0].handle); + } + + if (t->flags & CONTEXTS) + gem_context_destroy(fd, execbuf.rsvd1); + gem_close(fd, obj[1].handle); + if (t->flags & FDS) + close(fd); + + return NULL; +} + +static void all(int fd, unsigned engine, unsigned flags) +{ + const int gen = intel_gen(intel_get_drm_devid(fd)); + pthread_mutex_t mutex; + pthread_cond_t cond; + struct thread *threads; + unsigned engines[16]; + unsigned nengine; + uint32_t scratch[16], handle[16]; + int go; + int i; + + if (flags & CONTEXTS) + gem_require_context(fd); + + nengine = 0; + if (engine == -1) { + for_each_engine(fd, engine) { + if (!ignore_engine(gen, engine)) + engines[nengine++] = engine; + } + } else { + igt_require(gem_has_ring(fd, engine)); + igt_require(can_mi_store_dword(gen, engine)); + engines[nengine++] = engine; + } + igt_require(nengine); + + for (i = 0; i < 16; i++) { + scratch[i] = handle[i] = gem_create(fd, 4096); + if (flags & FDS) + scratch[i] = gem_flink(fd, handle[i]); + } + + threads = calloc(1024, sizeof(struct thread)); + igt_assert(threads); + + pthread_mutex_init(&mutex, 0); + pthread_cond_init(&cond, 0); + go = 0; + + for (i = 0; i < 1024; i++) { + threads[i].id = i; + threads[i].fd = fd; + threads[i].gen = gen; + threads[i].engine = engines[i % nengine]; + threads[i].flags = flags; + threads[i].scratch = scratch; + threads[i].mutex = &mutex; + threads[i].cond = &cond; + threads[i].go = &go; + + pthread_create(&threads[i].thread, 0, thread, &threads[i]); + } + + pthread_mutex_lock(&mutex); + go = 1024; + pthread_cond_broadcast(&cond); + pthread_mutex_unlock(&mutex); + + for (i = 0; i < 1024; i++) + pthread_join(threads[i].thread, NULL); + + for (i = 0; i < 16; i++) { + check_bo(fd, handle[i], i); + gem_close(fd, handle[i]); + } + + free(threads); +} + +igt_main +{ + const struct mode { + const char *name; + unsigned flags; + } modes[] = { + { "", 0 }, + { "contexts", CONTEXTS }, + { "fds", FDS }, + { NULL } + }; + int fd; + + igt_fixture + fd = drm_open_driver_master(DRIVER_INTEL); + + igt_fork_hang_detector(fd); + + for (const struct mode *m = modes; m->name; m++) + igt_subtest_f("%s", *m->name ? m->name : "basic") + all(fd, -1, m->flags); + + for (const struct intel_execution_engine *e = intel_execution_engines; + e->name; e++) { + for (const struct mode *m = modes; m->name; m++) + igt_subtest_f("%s%s%s", + e->name, + *m->name ? "-" : "", + m->name) + all(fd, e->exec_id | e->flags, m->flags); + } + + igt_stop_hang_detector(); + + igt_fixture + close(fd); +} diff -Nru intel-gpu-tools-1.13/tests/gem_exec_params.c intel-gpu-tools-1.15/tests/gem_exec_params.c --- intel-gpu-tools-1.13/tests/gem_exec_params.c 2015-11-30 16:26:22.000000000 +0000 +++ intel-gpu-tools-1.15/tests/gem_exec_params.c 2016-05-23 10:51:28.000000000 +0000 @@ -46,6 +46,30 @@ #define LOCAL_I915_EXEC_BSD_RING2 (2<<13) #define LOCAL_I915_EXEC_RESOURCE_STREAMER (1<<15) +static bool has_ring(int fd, unsigned ring_exec_flags) +{ + switch (ring_exec_flags & I915_EXEC_RING_MASK) { + case 0: + case I915_EXEC_RENDER: + return true; + + case I915_EXEC_BSD: + if (ring_exec_flags & LOCAL_I915_EXEC_BSD_MASK) + return gem_has_bsd2(fd); + else + return gem_has_bsd(fd); + + case I915_EXEC_BLT: + return gem_has_blt(fd); + + case I915_EXEC_VEBOX: + return gem_has_vebox(fd); + } + + igt_assert_f(0, "invalid exec flag 0x%x\n", ring_exec_flags); + return false; +} + struct drm_i915_gem_execbuffer2 execbuf; struct drm_i915_gem_exec_object2 gem_exec[1]; uint32_t batch[2] = {MI_BATCH_BUFFER_END}; @@ -54,6 +78,8 @@ igt_main { + const struct intel_execution_engine *e; + igt_fixture { fd = drm_open_driver(DRIVER_INTEL); @@ -85,13 +111,12 @@ } igt_subtest("control") { - igt_assert(drmIoctl(fd, - DRM_IOCTL_I915_GEM_EXECBUFFER2, - &execbuf) == 0); - execbuf.flags = I915_EXEC_RENDER; - igt_assert(drmIoctl(fd, - DRM_IOCTL_I915_GEM_EXECBUFFER2, - &execbuf) == 0); + for (e = intel_execution_engines; e->name; e++) { + if (has_ring(fd, e->exec_id | e->flags)) { + execbuf.flags = e->exec_id | e->flags; + gem_execbuf(fd, &execbuf); + } + } } #define RUN_FAIL(expected_errno) do { \ diff -Nru intel-gpu-tools-1.13/tests/gem_exec_parse.c intel-gpu-tools-1.15/tests/gem_exec_parse.c --- intel-gpu-tools-1.13/tests/gem_exec_parse.c 2015-11-30 16:26:22.000000000 +0000 +++ intel-gpu-tools-1.15/tests/gem_exec_parse.c 2016-05-23 10:51:28.000000000 +0000 @@ -30,17 +30,122 @@ #include - #ifndef I915_PARAM_CMD_PARSER_VERSION #define I915_PARAM_CMD_PARSER_VERSION 28 #endif -static int __gem_execbuf(int fd, struct drm_i915_gem_execbuffer2 *execbuf) +#define OACONTROL 0x2360 +#define DERRMR 0x44050 + +static int command_parser_version(int fd) { - if (drmIoctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, execbuf)) - return -errno; + int version = -1; + drm_i915_getparam_t gp; + + gp.param = I915_PARAM_CMD_PARSER_VERSION; + gp.value = &version; - return 0; + if (drmIoctl(fd, DRM_IOCTL_I915_GETPARAM, &gp) == 0) + return version; + + return -1; +} + +#define HSW_CS_GPR(n) (0x2600 + 8*(n)) +#define HSW_CS_GPR0 HSW_CS_GPR(0) +#define HSW_CS_GPR1 HSW_CS_GPR(1) + +#define MI_LOAD_REGISTER_REG (0x2a << 23) +#define MI_STORE_REGISTER_MEM (0x24 << 23) +static void hsw_load_register_reg(void) +{ + uint32_t buf[16] = { + MI_LOAD_REGISTER_IMM | (5 - 2), + HSW_CS_GPR0, + 0xabcdabcd, + HSW_CS_GPR1, + 0xdeadbeef, + + MI_STORE_REGISTER_MEM | (3 - 2), + HSW_CS_GPR1, + 0, /* address0 */ + + MI_LOAD_REGISTER_REG | (3 - 2), + HSW_CS_GPR0, + HSW_CS_GPR1, + + MI_STORE_REGISTER_MEM | (3 - 2), + HSW_CS_GPR1, + 4, /* address1 */ + + MI_BATCH_BUFFER_END, + }; + struct drm_i915_gem_execbuffer2 execbuf; + struct drm_i915_gem_exec_object2 obj[2]; + struct drm_i915_gem_relocation_entry reloc[2]; + int fd; + + /* Open again to get a non-master file descriptor */ + fd = drm_open_driver(DRIVER_INTEL); + + igt_require(IS_HASWELL(intel_get_drm_devid(fd))); + igt_require(command_parser_version(fd) >= 7); + + memset(obj, 0, sizeof(obj)); + obj[0].handle = gem_create(fd, 4096); + obj[1].handle = gem_create(fd, 4096); + gem_write(fd, obj[1].handle, 0, buf, sizeof(buf)); + + memset(reloc, 0, sizeof(reloc)); + reloc[0].offset = 7*sizeof(uint32_t); + reloc[0].target_handle = obj[0].handle; + reloc[0].delta = 0; + reloc[0].read_domains = I915_GEM_DOMAIN_INSTRUCTION; + reloc[0].write_domain = I915_GEM_DOMAIN_INSTRUCTION; + reloc[1].offset = 13*sizeof(uint32_t); + reloc[1].target_handle = obj[0].handle; + reloc[1].delta = sizeof(uint32_t); + reloc[1].read_domains = I915_GEM_DOMAIN_INSTRUCTION; + reloc[1].write_domain = I915_GEM_DOMAIN_INSTRUCTION; + obj[1].relocs_ptr = (uintptr_t)&reloc; + obj[1].relocation_count = 2; + + memset(&execbuf, 0, sizeof(execbuf)); + execbuf.buffers_ptr = (uintptr_t)obj; + execbuf.buffer_count = 2; + execbuf.batch_len = sizeof(buf); + execbuf.flags = I915_EXEC_RENDER; + gem_execbuf(fd, &execbuf); + gem_close(fd, obj[1].handle); + + gem_read(fd, obj[0].handle, 0, buf, 2*sizeof(buf[0])); + igt_assert_eq_u32(buf[0], 0xdeadbeef); /* before copy */ + igt_assert_eq_u32(buf[1], 0xabcdabcd); /* after copy */ + + /* Now a couple of negative tests that should be filtered */ + execbuf.buffer_count = 1; + execbuf.batch_len = 4*sizeof(buf[0]); + + buf[0] = MI_LOAD_REGISTER_REG | (3 - 2); + buf[1] = HSW_CS_GPR0; + buf[2] = 0; + buf[3] = MI_BATCH_BUFFER_END; + gem_write(fd, obj[0].handle, 0, buf, execbuf.batch_len); + igt_assert_eq(__gem_execbuf(fd, &execbuf), -EINVAL); + + buf[2] = OACONTROL; /* filtered */ + gem_write(fd, obj[0].handle, 0, buf, execbuf.batch_len); + igt_assert_eq(__gem_execbuf(fd, &execbuf), -EINVAL); + + buf[2] = DERRMR; /* master only */ + gem_write(fd, obj[0].handle, 0, buf, execbuf.batch_len); + igt_assert_eq(__gem_execbuf(fd, &execbuf), -EINVAL); + + buf[2] = 0x2038; /* RING_START: invalid */ + gem_write(fd, obj[0].handle, 0, buf, execbuf.batch_len); + igt_assert_eq(__gem_execbuf(fd, &execbuf), -EINVAL); + + close(fd); } static void exec_batch_patched(int fd, uint32_t cmd_bo, uint32_t *cmds, @@ -290,8 +395,6 @@ #define PIPE_CONTROL_QW_WRITE (1<<14) #define PIPE_CONTROL_LRI_POST_OP (1<<23) -#define OACONTROL 0x2360 - igt_main { igt_fixture { @@ -306,7 +409,7 @@ rc = drmIoctl(fd, DRM_IOCTL_I915_GETPARAM, &gp); igt_require(!rc && parser_version > 0); - igt_require(gem_uses_aliasing_ppgtt(fd)); + igt_require(gem_uses_ppgtt(fd)); handle = gem_create(fd, 4096); @@ -478,6 +581,9 @@ 0x12000000); } + igt_subtest("load-register-reg") + hsw_load_register_reg(); + igt_fixture { gem_close(fd, handle); diff -Nru intel-gpu-tools-1.13/tests/gem_exec_reloc.c intel-gpu-tools-1.15/tests/gem_exec_reloc.c --- intel-gpu-tools-1.13/tests/gem_exec_reloc.c 1970-01-01 00:00:00.000000000 +0000 +++ intel-gpu-tools-1.15/tests/gem_exec_reloc.c 2016-05-23 10:51:28.000000000 +0000 @@ -0,0 +1,356 @@ +/* + * Copyright © 2016 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 "igt.h" + +IGT_TEST_DESCRIPTION("Basic sanity check of execbuf-ioctl relocations."); + +#define LOCAL_I915_EXEC_BSD_SHIFT (13) +#define LOCAL_I915_EXEC_BSD_MASK (3 << LOCAL_I915_EXEC_BSD_SHIFT) + +#define ENGINE_MASK (I915_EXEC_RING_MASK | LOCAL_I915_EXEC_BSD_MASK) + +static uint32_t find_last_set(uint64_t x) +{ + uint32_t i = 0; + while (x) { + x >>= 1; + i++; + } + return i; +} + +static void write_dword(int fd, + uint32_t target_handle, + uint64_t target_offset, + uint32_t value) +{ + int gen = intel_gen(intel_get_drm_devid(fd)); + struct drm_i915_gem_execbuffer2 execbuf; + struct drm_i915_gem_exec_object2 obj[2]; + struct drm_i915_gem_relocation_entry reloc; + uint32_t buf[16]; + int i; + + memset(obj, 0, sizeof(obj)); + obj[0].handle = target_handle; + obj[1].handle = gem_create(fd, 4096); + + i = 0; + buf[i++] = MI_STORE_DWORD_IMM | (gen < 6 ? 1<<22 : 0); + if (gen >= 8) { + buf[i++] = target_offset; + buf[i++] = target_offset >> 32; + } else if (gen >= 4) { + buf[i++] = 0; + buf[i++] = target_offset; + } else { + buf[i-1]--; + buf[i++] = target_offset; + } + buf[i++] = value; + buf[i++] = MI_BATCH_BUFFER_END; + gem_write(fd, obj[1].handle, 0, buf, sizeof(buf)); + + memset(&reloc, 0, sizeof(reloc)); + if (gen >= 8 || gen < 4) + reloc.offset = sizeof(uint32_t); + else + reloc.offset = 2*sizeof(uint32_t); + reloc.target_handle = target_handle; + reloc.delta = target_offset; + reloc.read_domains = I915_GEM_DOMAIN_INSTRUCTION; + reloc.write_domain = I915_GEM_DOMAIN_INSTRUCTION; + + obj[1].relocation_count = 1; + obj[1].relocs_ptr = (uintptr_t)&reloc; + + memset(&execbuf, 0, sizeof(execbuf)); + execbuf.buffers_ptr = (uintptr_t)obj; + execbuf.buffer_count = 2; + execbuf.flags = I915_EXEC_SECURE; + gem_execbuf(fd, &execbuf); + gem_close(fd, obj[1].handle); +} + +enum mode { MEM, CPU, WC, GTT }; +#define RO 0x100 +static void from_mmap(int fd, uint64_t size, enum mode mode) +{ + uint32_t bbe = MI_BATCH_BUFFER_END; + struct drm_i915_gem_execbuffer2 execbuf; + struct drm_i915_gem_exec_object2 obj; + struct drm_i915_gem_relocation_entry *relocs; + uint32_t reloc_handle; + uint64_t value; + uint64_t max, i; + int retry = 2; + + intel_require_memory(1, size, CHECK_RAM); + + memset(&obj, 0, sizeof(obj)); + obj.handle = gem_create(fd, 4096); + gem_write(fd, obj.handle, 0, &bbe, sizeof(bbe)); + + max = size / sizeof(*relocs); + switch (mode & ~RO) { + case MEM: + relocs = mmap(0, size, + PROT_WRITE, MAP_PRIVATE | MAP_ANON, + -1, 0); + igt_assert(relocs != (void *)-1); + break; + case GTT: + reloc_handle = gem_create(fd, size); + relocs = gem_mmap__gtt(fd, reloc_handle, size, PROT_WRITE); + gem_set_domain(fd, reloc_handle, + I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT); + gem_close(fd, reloc_handle); + break; + case CPU: + reloc_handle = gem_create(fd, size); + relocs = gem_mmap__cpu(fd, reloc_handle, 0, size, PROT_WRITE); + gem_set_domain(fd, reloc_handle, + I915_GEM_DOMAIN_CPU, I915_GEM_DOMAIN_CPU); + gem_close(fd, reloc_handle); + break; + case WC: + reloc_handle = gem_create(fd, size); + relocs = gem_mmap__wc(fd, reloc_handle, 0, size, PROT_WRITE); + gem_set_domain(fd, reloc_handle, + I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT); + gem_close(fd, reloc_handle); + break; + } + + for (i = 0; i < max; i++) { + relocs[i].target_handle = obj.handle; + relocs[i].presumed_offset = ~0ull; + relocs[i].offset = 1024; + relocs[i].delta = i; + relocs[i].read_domains = I915_GEM_DOMAIN_INSTRUCTION; + relocs[i].write_domain = 0; + } + obj.relocation_count = max; + obj.relocs_ptr = (uintptr_t)relocs; + + if (mode & RO) + mprotect(relocs, size, PROT_READ); + + memset(&execbuf, 0, sizeof(execbuf)); + execbuf.buffers_ptr = (uintptr_t)&obj; + execbuf.buffer_count = 1; + while (relocs[0].presumed_offset == ~0ull && retry--) + gem_execbuf(fd, &execbuf); + gem_read(fd, obj.handle, 1024, &value, sizeof(value)); + gem_close(fd, obj.handle); + + igt_assert_eq_u64(value, obj.offset + max - 1); + if (relocs[0].presumed_offset != ~0ull) { + for (i = 0; i < max; i++) + igt_assert_eq_u64(relocs[i].presumed_offset, + obj.offset); + } + munmap(relocs, size); +} + +static void from_gpu(int fd) +{ + uint32_t bbe = MI_BATCH_BUFFER_END; + struct drm_i915_gem_execbuffer2 execbuf; + struct drm_i915_gem_exec_object2 obj; + struct drm_i915_gem_relocation_entry *relocs; + uint32_t reloc_handle; + uint64_t value; + + memset(&obj, 0, sizeof(obj)); + obj.handle = gem_create(fd, 4096); + gem_write(fd, obj.handle, 0, &bbe, sizeof(bbe)); + + reloc_handle = gem_create(fd, 4096); + write_dword(fd, + reloc_handle, + offsetof(struct drm_i915_gem_relocation_entry, + target_handle), + obj.handle); + write_dword(fd, + reloc_handle, + offsetof(struct drm_i915_gem_relocation_entry, + offset), + 1024); + write_dword(fd, + reloc_handle, + offsetof(struct drm_i915_gem_relocation_entry, + read_domains), + I915_GEM_DOMAIN_INSTRUCTION); + + relocs = gem_mmap__cpu(fd, reloc_handle, 0, 4096, PROT_READ); + gem_set_domain(fd, reloc_handle, + I915_GEM_DOMAIN_CPU, I915_GEM_DOMAIN_CPU); + gem_close(fd, reloc_handle); + + obj.relocation_count = 1; + obj.relocs_ptr = (uintptr_t)relocs; + + memset(&execbuf, 0, sizeof(execbuf)); + execbuf.buffers_ptr = (uintptr_t)&obj; + execbuf.buffer_count = 1; + gem_execbuf(fd, &execbuf); + gem_read(fd, obj.handle, 1024, &value, sizeof(value)); + gem_close(fd, obj.handle); + + igt_assert_eq_u64(value, obj.offset); + igt_assert_eq_u64(relocs->presumed_offset, obj.offset); + munmap(relocs, 4096); +} + +static bool ignore_engine(int gen, unsigned engine) +{ + return gen == 6 && (engine & ~(3<<13)) == I915_EXEC_BSD; +} + +static void check_bo(int fd, uint32_t handle) +{ + uint32_t *map; + int i; + + igt_debug("Verifying result\n"); + map = gem_mmap__cpu(fd, handle, 0, 4096, PROT_READ); + gem_set_domain(fd, handle, I915_GEM_DOMAIN_CPU, 0); + for (i = 0; i < 1024; i++) + igt_assert_eq(map[i], i); + munmap(map, 4096); +} + +static void active(int fd, unsigned engine) +{ + const int gen = intel_gen(intel_get_drm_devid(fd)); + struct drm_i915_gem_relocation_entry reloc; + struct drm_i915_gem_exec_object2 obj[2]; + struct drm_i915_gem_execbuffer2 execbuf; + unsigned engines[16]; + unsigned nengine; + int pass; + + nengine = 0; + if (engine == -1) { + for_each_engine(fd, engine) { + if (!ignore_engine(gen, engine)) + engines[nengine++] = engine; + } + } else { + igt_require(gem_has_ring(fd, engine)); + igt_require(!ignore_engine(gen, engine)); + engines[nengine++] = engine; + } + igt_require(nengine); + + memset(obj, 0, sizeof(obj)); + obj[0].handle = gem_create(fd, 4096); + obj[1].handle = gem_create(fd, 64*1024); + obj[1].relocs_ptr = (uintptr_t)&reloc; + obj[1].relocation_count = 1; + + memset(&reloc, 0, sizeof(reloc)); + reloc.offset = sizeof(uint32_t); + reloc.target_handle = obj[0].handle; + if (gen < 8 && gen >= 4) + reloc.offset += sizeof(uint32_t); + reloc.read_domains = I915_GEM_DOMAIN_INSTRUCTION; + reloc.write_domain = I915_GEM_DOMAIN_INSTRUCTION; + + memset(&execbuf, 0, sizeof(execbuf)); + execbuf.buffers_ptr = (uintptr_t)obj; + execbuf.buffer_count = 2; + if (gen < 6) + execbuf.flags |= I915_EXEC_SECURE; + + for (pass = 0; pass < 1024; pass++) { + uint32_t batch[16]; + int i = 0; + batch[i] = MI_STORE_DWORD_IMM | (gen < 6 ? 1 << 22 : 0); + if (gen >= 8) { + batch[++i] = 0; + batch[++i] = 0; + } else if (gen >= 4) { + batch[++i] = 0; + batch[++i] = 0; + } else { + batch[i]--; + batch[++i] = 0; + } + batch[++i] = pass; + batch[++i] = MI_BATCH_BUFFER_END; + gem_write(fd, obj[1].handle, pass*sizeof(batch), + batch, sizeof(batch)); + } + + for (pass = 0; pass < 1024; pass++) { + reloc.delta = 4*pass; + reloc.presumed_offset = -1; + execbuf.flags &= ~ENGINE_MASK; + execbuf.flags |= engines[rand() % nengine]; + gem_execbuf(fd, &execbuf); + execbuf.batch_start_offset += 64; + reloc.offset += 64; + } + gem_close(fd, obj[1].handle); + + check_bo(fd, obj[0].handle); + gem_close(fd, obj[0].handle); +} + +igt_main +{ + uint64_t size; + int fd = -1; + + igt_fixture + fd = drm_open_driver_master(DRIVER_INTEL); + + for (size = 4096; size <= 4ull*1024*1024*1024; size <<= 1) { + igt_subtest_f("mmap-%u", find_last_set(size) - 1) + from_mmap(fd, size, MEM); + igt_subtest_f("readonly-%u", find_last_set(size) - 1) + from_mmap(fd, size, MEM | RO); + igt_subtest_f("cpu-%u", find_last_set(size) - 1) + from_mmap(fd, size, CPU); + igt_subtest_f("wc-%u", find_last_set(size) - 1) + from_mmap(fd, size, WC); + igt_subtest_f("gtt-%u", find_last_set(size) - 1) + from_mmap(fd, size, GTT); + } + + igt_subtest("gpu") + from_gpu(fd); + + igt_subtest("active") + active(fd, -1); + for (const struct intel_execution_engine *e = intel_execution_engines; + e->name; e++) { + igt_subtest_f("active-%s", e->name) + active(fd, e->exec_id | e->flags); + } + igt_fixture + close(fd); +} diff -Nru intel-gpu-tools-1.13/tests/gem_exec_store.c intel-gpu-tools-1.15/tests/gem_exec_store.c --- intel-gpu-tools-1.13/tests/gem_exec_store.c 1970-01-01 00:00:00.000000000 +0000 +++ intel-gpu-tools-1.15/tests/gem_exec_store.c 2016-05-23 10:51:28.000000000 +0000 @@ -0,0 +1,228 @@ +/* + * 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. + * + */ + +/** @file gem_exec_store.c + * + * Simplest non-NOOP only batch with verification. + */ + +#include "igt.h" +#include "igt_gt.h" + +#define LOCAL_I915_EXEC_BSD_SHIFT (13) +#define LOCAL_I915_EXEC_BSD_MASK (3 << LOCAL_I915_EXEC_BSD_SHIFT) + +#define ENGINE_MASK (I915_EXEC_RING_MASK | LOCAL_I915_EXEC_BSD_MASK) + +static void store_dword(int fd, unsigned ring) +{ + const int gen = intel_gen(intel_get_drm_devid(fd)); + struct drm_i915_gem_exec_object2 obj[2]; + struct drm_i915_gem_relocation_entry reloc; + struct drm_i915_gem_execbuffer2 execbuf; + uint32_t batch[16]; + int i; + + gem_require_ring(fd, ring); + igt_skip_on_f(gen == 6 && (ring & ~(3<<13)) == I915_EXEC_BSD, + "MI_STORE_DATA broken on gen6 bsd\n"); + + memset(&execbuf, 0, sizeof(execbuf)); + execbuf.buffers_ptr = (uintptr_t)obj; + execbuf.buffer_count = 2; + execbuf.flags = ring; + if (gen < 6) + execbuf.flags |= I915_EXEC_SECURE; + + memset(obj, 0, sizeof(obj)); + obj[0].handle = gem_create(fd, 4096); + obj[1].handle = gem_create(fd, 4096); + + memset(&reloc, 0, sizeof(reloc)); + reloc.target_handle = obj[0].handle; + reloc.presumed_offset = 0; + reloc.offset = sizeof(uint32_t); + reloc.delta = 0; + reloc.read_domains = I915_GEM_DOMAIN_INSTRUCTION; + reloc.write_domain = I915_GEM_DOMAIN_INSTRUCTION; + obj[1].relocs_ptr = (uintptr_t)&reloc; + obj[1].relocation_count = 1; + + i = 0; + batch[i] = MI_STORE_DWORD_IMM | (gen < 6 ? 1 << 22 : 0); + if (gen >= 8) { + batch[++i] = 0; + batch[++i] = 0; + } else if (gen >= 4) { + batch[++i] = 0; + batch[++i] = 0; + reloc.offset += sizeof(uint32_t); + } else { + batch[i]--; + batch[++i] = 0; + } + batch[++i] = 0xc0ffee; + batch[++i] = MI_BATCH_BUFFER_END; + gem_write(fd, obj[1].handle, 0, batch, sizeof(batch)); + gem_execbuf(fd, &execbuf); + gem_close(fd, obj[1].handle); + + gem_read(fd, obj[0].handle, 0, batch, sizeof(batch)); + gem_close(fd, obj[0].handle); + igt_assert_eq(*batch, 0xc0ffee); +} + +static void store_all(int fd) +{ + const int gen = intel_gen(intel_get_drm_devid(fd)); + struct drm_i915_gem_exec_object2 obj[2]; + struct drm_i915_gem_relocation_entry reloc[32]; + struct drm_i915_gem_execbuffer2 execbuf; + unsigned engines[16], permuted[16]; + uint32_t batch[16]; + uint64_t offset; + unsigned engine, nengine; + int value; + int i, j; + + memset(&execbuf, 0, sizeof(execbuf)); + execbuf.buffers_ptr = (uintptr_t)obj; + execbuf.buffer_count = 2; + if (gen < 6) + execbuf.flags |= I915_EXEC_SECURE; + + memset(reloc, 0, sizeof(reloc)); + memset(obj, 0, sizeof(obj)); + obj[0].handle = gem_create(fd, 4096); + obj[1].handle = gem_create(fd, 4096); + obj[1].relocation_count = 1; + + offset = sizeof(uint32_t); + i = 0; + batch[i] = MI_STORE_DWORD_IMM | (gen < 6 ? 1 << 22 : 0); + if (gen >= 8) { + batch[++i] = 0; + batch[++i] = 0; + } else if (gen >= 4) { + batch[++i] = 0; + batch[++i] = 0; + offset += sizeof(uint32_t); + } else { + batch[i]--; + batch[++i] = 0; + } + batch[value = ++i] = 0xc0ffee; + batch[++i] = MI_BATCH_BUFFER_END; + + nengine = 0; + for_each_engine(fd, engine) { + if (gen == 6 && (engine & ~(3<<13)) == I915_EXEC_BSD) + continue; + + igt_assert(2*(nengine+1)*sizeof(batch) <= 4096); + + execbuf.flags &= ~ENGINE_MASK; + execbuf.flags |= engine; + + j = 2*nengine; + reloc[j].target_handle = obj[0].handle; + reloc[j].presumed_offset = ~0; + reloc[j].offset = j*sizeof(batch) + offset; + reloc[j].delta = nengine*sizeof(uint32_t); + reloc[j].read_domains = I915_GEM_DOMAIN_INSTRUCTION; + reloc[j].write_domain = I915_GEM_DOMAIN_INSTRUCTION; + obj[1].relocs_ptr = (uintptr_t)&reloc[j]; + + batch[value] = 0xdeadbeef; + gem_write(fd, obj[1].handle, j*sizeof(batch), + batch, sizeof(batch)); + execbuf.batch_start_offset = j*sizeof(batch); + gem_execbuf(fd, &execbuf); + + j = 2*nengine + 1; + reloc[j].target_handle = obj[0].handle; + reloc[j].presumed_offset = ~0; + reloc[j].offset = j*sizeof(batch) + offset; + reloc[j].delta = nengine*sizeof(uint32_t); + reloc[j].read_domains = I915_GEM_DOMAIN_INSTRUCTION; + reloc[j].write_domain = I915_GEM_DOMAIN_INSTRUCTION; + obj[1].relocs_ptr = (uintptr_t)&reloc[j]; + + batch[value] = nengine; + gem_write(fd, obj[1].handle, j*sizeof(batch), + batch, sizeof(batch)); + execbuf.batch_start_offset = j*sizeof(batch); + gem_execbuf(fd, &execbuf); + + engines[nengine++] = engine; + } + gem_sync(fd, obj[1].handle); + + for (i = 0; i < nengine; i++) { + obj[1].relocs_ptr = (uintptr_t)&reloc[2*i]; + execbuf.batch_start_offset = 2*i*sizeof(batch); + memcpy(permuted, engines, nengine*sizeof(engines[0])); + igt_permute_array(permuted, nengine, igt_exchange_int); + for (j = 0; j < nengine; j++) { + execbuf.flags &= ~ENGINE_MASK; + execbuf.flags |= permuted[j]; + gem_execbuf(fd, &execbuf); + } + obj[1].relocs_ptr = (uintptr_t)&reloc[2*i+1]; + execbuf.batch_start_offset = (2*i+1)*sizeof(batch); + execbuf.flags &= ~ENGINE_MASK; + execbuf.flags |= engines[i]; + gem_execbuf(fd, &execbuf); + } + gem_close(fd, obj[1].handle); + + gem_read(fd, obj[0].handle, 0, engines, sizeof(engines)); + gem_close(fd, obj[0].handle); + + for (i = 0; i < nengine; i++) + igt_assert_eq_u32(engines[i], i); +} + +igt_main +{ + const struct intel_execution_engine *e; + int fd; + + igt_fixture + fd = drm_open_driver_master(DRIVER_INTEL); + + igt_fork_hang_detector(fd); + + for (e = intel_execution_engines; e->name; e++) + igt_subtest_f("basic-%s", e->name) + store_dword(fd, e->exec_id | e->flags); + + igt_subtest("basic-all") + store_all(fd); + + igt_stop_hang_detector(); + + igt_fixture + close(fd); +} diff -Nru intel-gpu-tools-1.13/tests/gem_exec_suspend.c intel-gpu-tools-1.15/tests/gem_exec_suspend.c --- intel-gpu-tools-1.13/tests/gem_exec_suspend.c 1970-01-01 00:00:00.000000000 +0000 +++ intel-gpu-tools-1.15/tests/gem_exec_suspend.c 2016-05-23 10:51:28.000000000 +0000 @@ -0,0 +1,268 @@ +/* + * Copyright © 2016 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. + * + */ + +/** @file gem_exec_suspend.c + * + * Exercise executing batches across suspend before checking the results. + */ + +#include "igt.h" +#include "igt_gt.h" + +#define NOSLEEP 0 +#define SUSPEND 1 +#define HIBERNATE 2 +#define mode(x) ((x) & 0xff) + +#define LOCAL_I915_EXEC_BSD_SHIFT (13) +#define LOCAL_I915_EXEC_BSD_MASK (3 << LOCAL_I915_EXEC_BSD_SHIFT) + +#define ENGINE_MASK (I915_EXEC_RING_MASK | LOCAL_I915_EXEC_BSD_MASK) + +#define UNCACHED (0<<8) +#define CACHED (1<<8) + +static void run_test(int fd, unsigned ring, unsigned flags); + +static void check_bo(int fd, uint32_t handle) +{ + uint32_t *map; + int i; + + igt_debug("Verifying result\n"); + map = gem_mmap__cpu(fd, handle, 0, 4096, PROT_READ); + gem_set_domain(fd, handle, I915_GEM_DOMAIN_CPU, 0); + for (i = 0; i < 1024; i++) + igt_assert_eq(map[i], i); + munmap(map, 4096); +} + +static bool can_mi_store_dword(int gen, unsigned engine) +{ + return !(gen == 6 && (engine & ~(3<<13)) == I915_EXEC_BSD); +} + +static bool ignore_engine(int gen, unsigned engine) +{ + if (engine == 0) + return true; + + if (!can_mi_store_dword(gen, engine)) + return true; + + return false; +} + +static void test_all(int fd, unsigned flags) +{ + const int gen = intel_gen(intel_get_drm_devid(fd)); + unsigned engine; + + for_each_engine(fd, engine) { + if (!ignore_engine(gen, engine)) + run_test(fd, engine, flags & ~0xff); + } +} + +static bool has_semaphores(int fd) +{ + struct drm_i915_getparam gp; + int val = -1; + + memset(&gp, 0, sizeof(gp)); + gp.param = I915_PARAM_HAS_SEMAPHORES; + gp.value = &val; + + drmIoctl(fd, DRM_IOCTL_I915_GETPARAM, &gp); + errno = 0; + + return val > 0; +} + +static void run_test(int fd, unsigned engine, unsigned flags) +{ + const int gen = intel_gen(intel_get_drm_devid(fd)); + const uint32_t bbe = MI_BATCH_BUFFER_END; + struct drm_i915_gem_exec_object2 obj[2]; + struct drm_i915_gem_relocation_entry reloc; + struct drm_i915_gem_execbuffer2 execbuf; + unsigned engines[16]; + unsigned nengine; + + nengine = 0; + if (engine == -1) { + /* If we don't have semaphores, then every ring switch + * will result in a CPU stall until the previous write + * has finished. This is likely to hide any issue with + * the GPU being active across the suspend (because the + * GPU is then unlikely to be active!) + */ + if (has_semaphores(fd)) { + for_each_engine(fd, engine) { + if (!ignore_engine(gen, engine)) + engines[nengine++] = engine; + } + } else { + igt_require(gem_has_ring(fd, 0)); + igt_require(can_mi_store_dword(gen, 0)); + engines[nengine++] = 0; + } + } else { + igt_require(gem_has_ring(fd, engine)); + igt_require(can_mi_store_dword(gen, engine)); + engines[nengine++] = engine; + } + igt_require(nengine); + + /* Before suspending, check normal operation */ + if (mode(flags) != NOSLEEP) + test_all(fd, flags); + + gem_quiescent_gpu(fd); + + memset(&execbuf, 0, sizeof(execbuf)); + execbuf.buffers_ptr = (uintptr_t)obj; + execbuf.buffer_count = 2; + execbuf.flags = 1 << 11; + if (gen < 6) + execbuf.flags |= I915_EXEC_SECURE; + + memset(obj, 0, sizeof(obj)); + obj[0].handle = gem_create(fd, 4096); + gem_set_caching(fd, obj[0].handle, !!(flags & CACHED)); + obj[0].flags |= EXEC_OBJECT_WRITE; + obj[1].handle = gem_create(fd, 4096); + gem_write(fd, obj[1].handle, 0, &bbe, sizeof(bbe)); + igt_require(__gem_execbuf(fd, &execbuf) == 0); + gem_close(fd, obj[1].handle); + + memset(&reloc, 0, sizeof(reloc)); + reloc.target_handle = obj[0].handle; + reloc.presumed_offset = obj[0].offset; + reloc.offset = sizeof(uint32_t); + if (gen >= 4 && gen < 8) + reloc.offset += sizeof(uint32_t); + reloc.read_domains = I915_GEM_DOMAIN_INSTRUCTION; + reloc.write_domain = I915_GEM_DOMAIN_INSTRUCTION; + + obj[1].relocs_ptr = (uintptr_t)&reloc; + obj[1].relocation_count = 1; + + for (int i = 0; i < 1024; i++) { + uint64_t offset; + uint32_t buf[16]; + int b; + + obj[1].handle = gem_create(fd, 4096); + + reloc.delta = i * sizeof(uint32_t); + offset = reloc.presumed_offset + reloc.delta; + + b = 0; + buf[b] = MI_STORE_DWORD_IMM | (gen < 6 ? 1 << 22 : 0); + if (gen >= 8) { + buf[++b] = offset; + buf[++b] = offset >> 32; + } else if (gen >= 4) { + buf[++b] = 0; + buf[++b] = offset; + } else { + buf[b] -= 1; + buf[++b] = offset; + } + buf[++b] = i; + buf[++b] = MI_BATCH_BUFFER_END; + gem_write(fd, obj[1].handle, + 4096-sizeof(buf), buf, sizeof(buf)); + execbuf.flags &= ~ENGINE_MASK; + execbuf.flags |= engines[rand() % nengine]; + gem_execbuf(fd, &execbuf); + gem_close(fd, obj[1].handle); + } + + switch (mode(flags)) { + case NOSLEEP: + break; + + case SUSPEND: + igt_system_suspend_autoresume(); + break; + + case HIBERNATE: + igt_system_hibernate_autoresume(); + break; + } + + check_bo(fd, obj[0].handle); + gem_close(fd, obj[0].handle); + + gem_quiescent_gpu(fd); + + /* After resume, make sure it still works */ + if (mode(flags) != NOSLEEP) + test_all(fd, flags); +} + +igt_main +{ + const struct { + const char *suffix; + unsigned mode; + } modes[] = { + { "", NOSLEEP }, + { "-S3", SUSPEND }, + { "-S4", HIBERNATE }, + { NULL, 0 } + }, *m; + const struct intel_execution_engine *e; + int fd; + + igt_fixture + fd = drm_open_driver_master(DRIVER_INTEL); + + igt_fork_hang_detector(fd); + + igt_subtest("basic") + run_test(fd, -1, NOSLEEP); + igt_subtest("basic-S3") + run_test(fd, -1, SUSPEND); + igt_subtest("basic-S4") + run_test(fd, -1, HIBERNATE); + + for (e = intel_execution_engines; e->name; e++) { + for (m = modes; m->suffix; m++) { + igt_subtest_f("%s-uncached%s", e->name, m->suffix) + run_test(fd, e->exec_id | e->flags, + m->mode | UNCACHED); + igt_subtest_f("%s-cached%s", e->name, m->suffix) + run_test(fd, e->exec_id | e->flags, + m->mode | CACHED); + } + } + + igt_stop_hang_detector(); + + igt_fixture + close(fd); +} diff -Nru intel-gpu-tools-1.13/tests/gem_exec_whisper.c intel-gpu-tools-1.15/tests/gem_exec_whisper.c --- intel-gpu-tools-1.13/tests/gem_exec_whisper.c 1970-01-01 00:00:00.000000000 +0000 +++ intel-gpu-tools-1.15/tests/gem_exec_whisper.c 2016-05-23 10:51:28.000000000 +0000 @@ -0,0 +1,400 @@ +/* + * 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. + * + */ + +/** @file gem_exec_whisper.c + * + * Pass around a value to write into a scratch buffer between lots of batches + */ + +#include "igt.h" +#include "igt_gt.h" + +#define LOCAL_I915_EXEC_NO_RELOC (1<<11) +#define LOCAL_I915_EXEC_HANDLE_LUT (1<<12) + +#define LOCAL_I915_EXEC_BSD_SHIFT (13) +#define LOCAL_I915_EXEC_BSD_MASK (3 << LOCAL_I915_EXEC_BSD_SHIFT) + +#define ENGINE_MASK (I915_EXEC_RING_MASK | LOCAL_I915_EXEC_BSD_MASK) + +#define VERIFY 0 + +static void write_seqno(unsigned offset) +{ + uint32_t seqno = UINT32_MAX - offset; + FILE *file; + + file = igt_debugfs_fopen("i915_next_seqno", "w"); + igt_assert(file); + + igt_assert(fprintf(file, "0x%x", seqno) > 0); + fclose(file); + + igt_debug("next seqno set to: 0x%x\n", seqno); +} + +static void check_bo(int fd, uint32_t handle) +{ + uint32_t *map; + int i; + + igt_debug("Verifying result\n"); + map = gem_mmap__cpu(fd, handle, 0, 4096, PROT_READ); + gem_set_domain(fd, handle, I915_GEM_DOMAIN_CPU, 0); + for (i = 0; i < 1024; i++) + igt_assert_eq(map[i], i); + munmap(map, 4096); +} + +static void verify_reloc(int fd, uint32_t handle, + const struct drm_i915_gem_relocation_entry *reloc) +{ + if (VERIFY) { + uint64_t target = 0; + if (intel_gen(intel_get_drm_devid(fd)) >= 8) + gem_read(fd, handle, reloc->offset, &target, 8); + else + gem_read(fd, handle, reloc->offset, &target, 4); + igt_assert_eq_u64(target, + reloc->presumed_offset + reloc->delta); + } +} + +static int __gem_context_create(int fd, uint32_t *ctx_id) +{ + struct drm_i915_gem_context_create arg; + int ret = 0; + + memset(&arg, 0, sizeof(arg)); + if (drmIoctl(fd, DRM_IOCTL_I915_GEM_CONTEXT_CREATE, &arg)) + ret = -errno; + + *ctx_id = arg.ctx_id; + return ret; +} + +static bool can_mi_store_dword(int gen, unsigned engine) +{ + return !(gen == 6 && (engine & ~(3<<13)) == I915_EXEC_BSD); +} + +static bool ignore_engine(int gen, unsigned engine) +{ + if (engine == 0) + return true; + + if (!can_mi_store_dword(gen, engine)) + return true; + + return false; +} + +#define CONTEXTS 0x1 +#define FDS 0x2 +#define INTERRUPTIBLE 0x4 + +static void whisper(int fd, unsigned engine, unsigned flags) +{ + const int gen = intel_gen(intel_get_drm_devid(fd)); + struct drm_i915_gem_exec_object2 batches[1024]; + struct drm_i915_gem_relocation_entry inter[1024]; + struct drm_i915_gem_relocation_entry reloc; + struct drm_i915_gem_exec_object2 store, scratch; + struct drm_i915_gem_exec_object2 tmp[2]; + struct drm_i915_gem_execbuffer2 execbuf; + int fds[64]; + uint32_t contexts[64]; + unsigned engines[16]; + unsigned nengine; + uint32_t batch[16]; + int i, n, pass, loc; + unsigned int relocations = 0; + unsigned int reloc_migrations = 0; + unsigned int reloc_interruptions = 0; + unsigned int eb_migrations = 0; + uint64_t old_offset; + + nengine = 0; + if (engine == -1) { + for_each_engine(fd, engine) { + if (!ignore_engine(gen, engine)) + engines[nengine++] = engine; + } + } else { + igt_require(gem_has_ring(fd, engine)); + igt_require(can_mi_store_dword(gen, engine)); + engines[nengine++] = engine; + } + igt_require(nengine); + + memset(&scratch, 0, sizeof(scratch)); + scratch.handle = gem_create(fd, 4096); + scratch.flags = EXEC_OBJECT_WRITE; + + memset(&store, 0, sizeof(store)); + store.handle = gem_create(fd, 4096); + store.relocs_ptr = (uintptr_t)&reloc; + store.relocation_count = 1; + + memset(&reloc, 0, sizeof(reloc)); + reloc.offset = sizeof(uint32_t); + if (gen < 8 && gen >= 4) + reloc.offset += sizeof(uint32_t); + loc = 8; + if (gen >= 4) + loc += 4; + reloc.read_domains = I915_GEM_DOMAIN_INSTRUCTION; + reloc.write_domain = I915_GEM_DOMAIN_INSTRUCTION; + + { + uint32_t bbe = MI_BATCH_BUFFER_END; + + tmp[0] = scratch; + tmp[1] = store; + gem_write(fd, store.handle, 0, &bbe, sizeof(bbe)); + + memset(&execbuf, 0, sizeof(execbuf)); + execbuf.buffers_ptr = (uintptr_t)tmp; + execbuf.buffer_count = 2; + execbuf.flags = LOCAL_I915_EXEC_HANDLE_LUT; + execbuf.flags |= LOCAL_I915_EXEC_NO_RELOC; + if (gen < 6) + execbuf.flags |= I915_EXEC_SECURE; + igt_require(__gem_execbuf(fd, &execbuf) == 0); + scratch = tmp[0]; + store = tmp[1]; + } + + i = 0; + batch[i] = MI_STORE_DWORD_IMM | (gen < 6 ? 1 << 22 : 0); + if (gen >= 8) { + batch[++i] = store.offset + loc; + batch[++i] = (store.offset + loc) >> 32; + } else if (gen >= 4) { + batch[++i] = 0; + batch[++i] = store.offset + loc; + } else { + batch[i]--; + batch[++i] = store.offset + loc; + } + batch[++i] = 0xc0ffee; + igt_assert(loc == sizeof(uint32_t) * i); + batch[++i] = MI_BATCH_BUFFER_END; + + if (flags & CONTEXTS) { + igt_require(__gem_context_create(fd, &contexts[0]) == 0); + for (n = 1; n < 64; n++) + contexts[n] = gem_context_create(fd); + } + if (flags & FDS) { + igt_require(gen >= 6); + for (n = 0; n < 64; n++) + fds[n] = drm_open_driver(DRIVER_INTEL); + } + + memset(batches, 0, sizeof(batches)); + for (n = 0; n < 1024; n++) { + batches[n].handle = gem_create(fd, 4096); + batches[n].offset = store.offset; + inter[n] = reloc; + inter[n].presumed_offset = store.offset; + inter[n].delta = loc; + batches[n].relocs_ptr = (uintptr_t)&inter[n]; + batches[n].relocation_count = 1; + gem_write(fd, batches[n].handle, 0, batch, sizeof(batch)); + } + + igt_while_interruptible(flags & INTERRUPTIBLE) { + for (pass = 0; pass < 1024; pass++) { + uint64_t offset; + + write_seqno(pass); + + reloc.presumed_offset = scratch.offset; + reloc.delta = 4*pass; + offset = reloc.presumed_offset + reloc.delta; + + i = 0; + if (gen >= 8) { + batch[++i] = offset; + batch[++i] = offset >> 32; + } else if (gen >= 4) { + batch[++i] = 0; + batch[++i] = offset; + } else { + batch[++i] = offset; + } + batch[++i] = ~pass; + gem_write(fd, store.handle, 0, batch, sizeof(batch)); + + tmp[0] = scratch; + igt_assert(tmp[0].flags & EXEC_OBJECT_WRITE); + tmp[1] = store; + verify_reloc(fd, store.handle, &reloc); + execbuf.buffers_ptr = (uintptr_t)tmp; + gem_execbuf(fd, &execbuf); + igt_assert_eq_u64(reloc.presumed_offset, tmp[0].offset); + scratch = tmp[0]; + + gem_write(fd, batches[1023].handle, loc, &pass, sizeof(pass)); + for (n = 1024; --n >= 1; ) { + int this_fd = fd; + uint32_t handle[2]; + + execbuf.buffers_ptr = (uintptr_t)&batches[n-1]; + reloc_migrations += batches[n-1].offset != inter[n].presumed_offset; + batches[n-1].offset = inter[n].presumed_offset; + old_offset = inter[n].presumed_offset; + batches[n-1].relocation_count = 0; + batches[n-1].flags |= EXEC_OBJECT_WRITE; + verify_reloc(fd, batches[n].handle, &inter[n]); + + if (flags & FDS) { + this_fd = fds[rand() % 64]; + handle[0] = batches[n-1].handle; + handle[1] = batches[n].handle; + batches[n-1].handle = + gem_open(this_fd, + gem_flink(fd, handle[0])); + batches[n].handle = + gem_open(this_fd, + gem_flink(fd, handle[1])); + } + + execbuf.flags &= ~ENGINE_MASK; + execbuf.flags |= engines[rand() % nengine]; + if (flags & CONTEXTS) + execbuf.rsvd1 = contexts[rand() % 64]; + gem_execbuf(this_fd, &execbuf); + if (inter[n].presumed_offset == -1) { + reloc_interruptions++; + inter[n].presumed_offset = batches[n-1].offset; + } + igt_assert_eq_u64(inter[n].presumed_offset, batches[n-1].offset); + relocations += inter[n].presumed_offset != old_offset; + + batches[n-1].relocation_count = 1; + batches[n-1].flags &= ~EXEC_OBJECT_WRITE; + + if (this_fd != fd) { + gem_close(this_fd, batches[n-1].handle); + batches[n-1].handle = handle[0]; + + gem_close(this_fd, batches[n].handle); + batches[n].handle = handle[1]; + } + } + execbuf.flags &= ~ENGINE_MASK; + execbuf.rsvd1 = 0; + execbuf.buffers_ptr = (uintptr_t)&tmp; + + tmp[0] = tmp[1]; + tmp[0].relocation_count = 0; + tmp[0].flags = EXEC_OBJECT_WRITE; + reloc_migrations += tmp[0].offset != inter[0].presumed_offset; + tmp[0].offset = inter[0].presumed_offset; + old_offset = tmp[0].offset; + tmp[1] = batches[0]; + verify_reloc(fd, batches[0].handle, &inter[0]); + gem_execbuf(fd, &execbuf); + if (inter[0].presumed_offset == -1) { + reloc_interruptions++; + inter[0].presumed_offset = tmp[0].offset; + } + igt_assert_eq_u64(inter[0].presumed_offset, tmp[0].offset); + relocations += inter[0].presumed_offset != old_offset; + batches[0] = tmp[1]; + + tmp[1] = tmp[0]; + tmp[0] = scratch; + igt_assert(tmp[0].flags & EXEC_OBJECT_WRITE); + igt_assert_eq_u64(reloc.presumed_offset, tmp[0].offset); + igt_assert(tmp[1].relocs_ptr == (uintptr_t)&reloc); + tmp[1].relocation_count = 1; + tmp[1].flags &= ~EXEC_OBJECT_WRITE; + verify_reloc(fd, store.handle, &reloc); + gem_execbuf(fd, &execbuf); + eb_migrations += tmp[0].offset != scratch.offset; + eb_migrations += tmp[1].offset != store.offset; + igt_assert_eq_u64(reloc.presumed_offset, tmp[0].offset); + store = tmp[1]; + scratch = tmp[0]; + } + } + igt_info("Number of migrations for execbuf: %d\n", eb_migrations); + igt_info("Number of migrations for reloc: %d, interrupted %d, patched %d\n", reloc_migrations, reloc_interruptions, relocations); + + check_bo(fd, scratch.handle); + gem_close(fd, scratch.handle); + gem_close(fd, store.handle); + + if (flags & FDS) { + for (n = 0; n < 64; n++) + close(fds[n]); + } + if (flags & CONTEXTS) { + for (n = 0; n < 64; n++) + gem_context_destroy(fd, contexts[n]); + } + for (n = 0; n < 1024; n++) + gem_close(fd, batches[n].handle); +} + +igt_main +{ + const struct mode { + const char *name; + unsigned flags; + } modes[] = { + { "normal", 0 }, + { "interruptible", INTERRUPTIBLE }, + { "contexts", CONTEXTS }, + { "contexts-interruptible", CONTEXTS | INTERRUPTIBLE}, + { "fds", FDS }, + { "fds-interruptible", FDS | INTERRUPTIBLE}, + { NULL } + }; + int fd; + + igt_fixture + fd = drm_open_driver_master(DRIVER_INTEL); + + igt_fork_hang_detector(fd); + + for (const struct mode *m = modes; m->name; m++) + igt_subtest_f("%s", m->name) + whisper(fd, -1, m->flags); + + for (const struct intel_execution_engine *e = intel_execution_engines; + e->name; e++) { + for (const struct mode *m = modes; m->name; m++) + igt_subtest_f("%s-%s", e->name, m->name) + whisper(fd, e->exec_id | e->flags, m->flags); + } + + igt_stop_hang_detector(); + + igt_fixture + close(fd); +} diff -Nru intel-gpu-tools-1.13/tests/gem_fenced_exec_thrash.c intel-gpu-tools-1.15/tests/gem_fenced_exec_thrash.c --- intel-gpu-tools-1.13/tests/gem_fenced_exec_thrash.c 2015-11-30 16:26:22.000000000 +0000 +++ intel-gpu-tools-1.15/tests/gem_fenced_exec_thrash.c 2016-05-23 10:51:28.000000000 +0000 @@ -141,14 +141,6 @@ reloc->write_domain = 0; } -static int __gem_execbuf(int fd, struct drm_i915_gem_execbuffer2 *eb) -{ - int err = 0; - if (drmIoctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, eb)) - err = errno; - return err; -} - #define BUSY_LOAD (1 << 0) #define INTERRUPTIBLE (1 << 1) @@ -200,8 +192,8 @@ if (flags & BUSY_LOAD) emit_dummy_load(); - igt_assert_eq(__gem_execbuf(fd, &execbuf[0]), expected_errno); - igt_assert_eq(__gem_execbuf(fd, &execbuf[1]), expected_errno); + igt_assert_eq(__gem_execbuf(fd, &execbuf[0]), -expected_errno); + igt_assert_eq(__gem_execbuf(fd, &execbuf[1]), -expected_errno); } while (--loop); if (flags & INTERRUPTIBLE) diff -Nru intel-gpu-tools-1.13/tests/gem_flink_race.c intel-gpu-tools-1.15/tests/gem_flink_race.c --- intel-gpu-tools-1.13/tests/gem_flink_race.c 2015-11-30 16:26:22.000000000 +0000 +++ intel-gpu-tools-1.15/tests/gem_flink_race.c 2016-05-23 10:51:28.000000000 +0000 @@ -44,28 +44,11 @@ * in the flink name and corresponding reference getting leaked. */ -/* We want lockless and I'm to lazy to dig out an atomic libarary. On x86 this +/* We want lockless and I'm to lazy to dig out an atomic library. On x86 this * works, too. */ volatile int pls_die = 0; int fd; -static int get_object_count(void) -{ - FILE *file; - int scanned, ret; - - igt_drop_caches_set(DROP_RETIRE | DROP_ACTIVE); - - file = igt_debugfs_fopen("i915_gem_objects", "r"); - - scanned = fscanf(file, "%i objects", &ret); - igt_assert_eq(scanned, 1); - igt_debug("Reports %d objects\n", ret); - - return ret; -} - - static void *thread_fn_flink_name(void *p) { struct drm_gem_open open_struct; @@ -164,8 +147,7 @@ * up the counts */ fake = drm_open_driver(DRIVER_INTEL); - gem_quiescent_gpu(fake); - obj_count = get_object_count(); + obj_count = igt_get_stable_obj_count(fake); num_threads = sysconf(_SC_NPROCESSORS_ONLN); @@ -190,8 +172,7 @@ close(fd); - gem_quiescent_gpu(fake); - obj_count = get_object_count() - obj_count; + obj_count = igt_get_stable_obj_count(fake) - obj_count; igt_info("leaked %i objects\n", obj_count); diff -Nru intel-gpu-tools-1.13/tests/gem_gtt_hog.c intel-gpu-tools-1.15/tests/gem_gtt_hog.c --- intel-gpu-tools-1.13/tests/gem_gtt_hog.c 2015-11-30 16:26:22.000000000 +0000 +++ intel-gpu-tools-1.15/tests/gem_gtt_hog.c 2016-05-23 10:51:28.000000000 +0000 @@ -174,6 +174,6 @@ igt_waitchildren(); gettimeofday(&end, NULL); - igt_info("Time to execute %lu children: %7.3fms\n", + igt_info("Time to execute %zu children: %7.3fms\n", ARRAY_SIZE(children), elapsed(&start, &end) / 1000); } diff -Nru intel-gpu-tools-1.13/tests/gem_mmap_gtt.c intel-gpu-tools-1.15/tests/gem_mmap_gtt.c --- intel-gpu-tools-1.13/tests/gem_mmap_gtt.c 2015-11-30 16:26:22.000000000 +0000 +++ intel-gpu-tools-1.15/tests/gem_mmap_gtt.c 2016-05-23 10:51:28.000000000 +0000 @@ -254,6 +254,45 @@ } static void +test_coherency(int fd) +{ + uint32_t handle; + uint32_t *gtt, *cpu; + int i; + + igt_require(igt_setup_clflush()); + + handle = gem_create(fd, OBJECT_SIZE); + + gtt = gem_mmap__gtt(fd, handle, OBJECT_SIZE, PROT_READ | PROT_WRITE); + cpu = gem_mmap__cpu(fd, handle, 0, OBJECT_SIZE, PROT_READ | PROT_WRITE); + set_domain_gtt(fd, handle); + + for (i = 0; i < OBJECT_SIZE / 64; i++) { + int x = 16*i + (i%16); + gtt[x] = i; + igt_clflush_range(&cpu[x], sizeof(cpu[x])); + igt_assert_eq(cpu[x], i); + } + + munmap(cpu, OBJECT_SIZE); + munmap(gtt, OBJECT_SIZE); + gem_close(fd, handle); +} + +static int tile_width(uint32_t devid, int tiling) +{ + if (intel_gen(devid) == 2) + return 128; + else if (tiling == I915_TILING_X) + return 512; + else if (IS_915(devid)) + return 512; + else + return 128; +} + +static void test_huge_bo(int fd, int huge, int tiling) { uint32_t bo; @@ -261,18 +300,31 @@ char *tiled_pattern; char *linear_pattern; uint64_t size, last_offset; - int pitch = tiling == I915_TILING_Y ? 128 : 512; + uint32_t devid = intel_get_drm_devid(fd); + int pitch = tile_width(devid, tiling); int i; switch (huge) { case -1: size = gem_mappable_aperture_size() / 2; + + /* Power of two fence size, natural fence + * alignment, and the guard page at the end + * gtt means that if the entire gtt is + * mappable, we can't usually fit in a tiled + * object half the size of the gtt. Let's use + * a quarter size one instead. + */ + if (tiling && + intel_gen(intel_get_drm_devid(fd)) < 4 && + size >= gem_global_aperture_size(fd) / 2) + size /= 2; break; case 0: size = gem_mappable_aperture_size() + PAGE_SIZE; break; default: - size = gem_aperture_size(fd) + PAGE_SIZE; + size = gem_global_aperture_size(fd) + PAGE_SIZE; break; } intel_require_memory(1, size, CHECK_RAM); @@ -327,6 +379,7 @@ static void test_huge_copy(int fd, int huge, int tiling_a, int tiling_b) { + uint32_t devid = intel_get_drm_devid(fd); uint64_t huge_object_size, i; uint32_t bo, *pattern_a, *pattern_b; char *a, *b; @@ -342,7 +395,7 @@ huge_object_size = gem_mappable_aperture_size() + PAGE_SIZE; break; default: - huge_object_size = gem_aperture_size(fd) + PAGE_SIZE; + huge_object_size = gem_global_aperture_size(fd) + PAGE_SIZE; break; } intel_require_memory(2, huge_object_size, CHECK_RAM); @@ -357,29 +410,34 @@ bo = gem_create(fd, huge_object_size); if (tiling_a) - igt_require(__gem_set_tiling(fd, bo, tiling_a, tiling_a == I915_TILING_Y ? 128 : 512) == 0); + igt_require(__gem_set_tiling(fd, bo, tiling_a, tile_width(devid, tiling_a)) == 0); a = __gem_mmap__gtt(fd, bo, huge_object_size, PROT_READ | PROT_WRITE); igt_require(a); gem_close(fd, bo); - for (i = 0; i < huge_object_size / PAGE_SIZE; i++) + for (i = 0; i < huge_object_size / PAGE_SIZE; i++) { memcpy(a + PAGE_SIZE*i, pattern_a, PAGE_SIZE); + igt_progress("Writing a ", i, huge_object_size / PAGE_SIZE); + } bo = gem_create(fd, huge_object_size); if (tiling_b) - igt_require(__gem_set_tiling(fd, bo, tiling_b, tiling_b == I915_TILING_Y ? 128 : 512) == 0); + igt_require(__gem_set_tiling(fd, bo, tiling_b, tile_width(devid, tiling_b)) == 0); b = __gem_mmap__gtt(fd, bo, huge_object_size, PROT_READ | PROT_WRITE); igt_require(b); gem_close(fd, bo); - for (i = 0; i < huge_object_size / PAGE_SIZE; i++) + for (i = 0; i < huge_object_size / PAGE_SIZE; i++) { memcpy(b + PAGE_SIZE*i, pattern_b, PAGE_SIZE); + igt_progress("Writing b ", i, huge_object_size / PAGE_SIZE); + } for (i = 0; i < huge_object_size / PAGE_SIZE; i++) { if (i & 1) memcpy(a + i *PAGE_SIZE, b + i*PAGE_SIZE, PAGE_SIZE); else memcpy(b + i *PAGE_SIZE, a + i*PAGE_SIZE, PAGE_SIZE); + igt_progress("Copying a<->b ", i, huge_object_size / PAGE_SIZE); } for (i = 0; i < huge_object_size / PAGE_SIZE; i++) { @@ -387,6 +445,7 @@ igt_assert(memcmp(pattern_b, a + PAGE_SIZE*i, PAGE_SIZE) == 0); else igt_assert(memcmp(pattern_a, a + PAGE_SIZE*i, PAGE_SIZE) == 0); + igt_progress("Checking a ", i, huge_object_size / PAGE_SIZE); } munmap(a, huge_object_size); @@ -395,6 +454,7 @@ igt_assert(memcmp(pattern_b, b + PAGE_SIZE*i, PAGE_SIZE) == 0); else igt_assert(memcmp(pattern_a, b + PAGE_SIZE*i, PAGE_SIZE) == 0); + igt_progress("Checking b ", i, huge_object_size / PAGE_SIZE); } munmap(b, huge_object_size); @@ -520,6 +580,8 @@ test_write(fd); igt_subtest("basic-write-gtt") test_write_gtt(fd); + igt_subtest("coherency") + test_coherency(fd); igt_subtest("basic-read-write") test_read_write(fd, READ_BEFORE_WRITE); igt_subtest("basic-write-read") diff -Nru intel-gpu-tools-1.13/tests/gem_mmap_wc.c intel-gpu-tools-1.15/tests/gem_mmap_wc.c --- intel-gpu-tools-1.13/tests/gem_mmap_wc.c 2015-11-30 16:26:22.000000000 +0000 +++ intel-gpu-tools-1.15/tests/gem_mmap_wc.c 2016-05-23 10:51:28.000000000 +0000 @@ -218,6 +218,33 @@ } static void +test_coherency(int fd) +{ + uint32_t handle; + uint32_t *wc, *cpu; + int i; + + igt_require(igt_setup_clflush()); + + handle = gem_create(fd, OBJECT_SIZE); + + wc = gem_mmap__wc(fd, handle, 0, OBJECT_SIZE, PROT_READ | PROT_WRITE); + cpu = gem_mmap__cpu(fd, handle, 0, OBJECT_SIZE, PROT_READ | PROT_WRITE); + gem_set_domain(fd, handle, I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT); + + for (i = 0; i < OBJECT_SIZE / 64; i++) { + int x = 16*i + (i%16); + wc[x] = i; + igt_clflush_range(&cpu[x], sizeof(cpu[x])); + igt_assert_eq(cpu[x], i); + } + + munmap(cpu, OBJECT_SIZE); + munmap(wc, OBJECT_SIZE); + gem_close(fd, handle); +} + +static void test_write_gtt(int fd) { uint32_t dst; @@ -446,6 +473,8 @@ test_read(fd); igt_subtest("write") test_write(fd); + igt_subtest("coherency") + test_coherency(fd); igt_subtest("write-gtt") test_write_gtt(fd); igt_subtest("read-write") diff -Nru intel-gpu-tools-1.13/tests/gem_mocs_settings.c intel-gpu-tools-1.15/tests/gem_mocs_settings.c --- intel-gpu-tools-1.13/tests/gem_mocs_settings.c 1970-01-01 00:00:00.000000000 +0000 +++ intel-gpu-tools-1.15/tests/gem_mocs_settings.c 2016-05-23 10:51:28.000000000 +0000 @@ -0,0 +1,612 @@ +/* + * Copyright © 2016 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. + * + */ + +/** @file gem_mocs_settings.c + * + * Check that the MOCs cache settings are valid. + */ + +#include "igt.h" +#include "igt_gt.h" + +#define MAX_NUMBER_MOCS_REGISTERS (64) + +enum { + NONE, + RESET, + SUSPEND, + HIBERNATE +}; + +#define GEN9_LNCFCMOCS0 (0xB020) /* L3 Cache Control base */ +#define GEN9_GFX_MOCS_0 (0xc800) /* Graphics MOCS base register*/ +#define GEN9_MFX0_MOCS_0 (0xc900) /* Media 0 MOCS base register*/ +#define GEN9_MFX1_MOCS_0 (0xcA00) /* Media 1 MOCS base register*/ +#define GEN9_VEBOX_MOCS_0 (0xcB00) /* Video MOCS base register*/ +#define GEN9_BLT_MOCS_0 (0xcc00) /* Blitter MOCS base register*/ + +struct mocs_entry { + uint32_t control_value; + uint16_t l3cc_value; +}; + +struct mocs_table { + uint32_t size; + const struct mocs_entry *table; +}; + +/* The first entries in the MOCS tables are defined by uABI */ +static const struct mocs_entry skylake_mocs_table[] = { + { 0x00000009, 0x0010 }, + { 0x00000038, 0x0030 }, + { 0x0000003b, 0x0030 }, +}; + +static const struct mocs_entry dirty_skylake_mocs_table[] = { + { 0x00003FFF, 0x003F }, /* no snoop bit */ + { 0x00003FFF, 0x003F }, + { 0x00003FFF, 0x003F }, +}; + +static const struct mocs_entry broxton_mocs_table[] = { + { 0x00000009, 0x0010 }, + { 0x00000038, 0x0030 }, + { 0x0000003b, 0x0030 }, +}; + +static const struct mocs_entry dirty_broxton_mocs_table[] = { + { 0x00007FFF, 0x003F }, + { 0x00007FFF, 0x003F }, + { 0x00007FFF, 0x003F }, +}; + +static const uint32_t write_values[] = { + 0xFFFFFFFF, + 0xFFFFFFFF, + 0xFFFFFFFF, + 0xFFFFFFFF +}; + +static bool get_mocs_settings(int fd, struct mocs_table *table, bool dirty) +{ + uint32_t devid = intel_get_drm_devid(fd); + bool result = false; + + if (IS_SKYLAKE(devid) || IS_KABYLAKE(devid)) { + if (dirty) { + table->size = ARRAY_SIZE(dirty_skylake_mocs_table); + table->table = dirty_skylake_mocs_table; + } else { + table->size = ARRAY_SIZE(skylake_mocs_table); + table->table = skylake_mocs_table; + } + result = true; + } else if (IS_BROXTON(devid)) { + if (dirty) { + table->size = ARRAY_SIZE(dirty_broxton_mocs_table); + table->table = dirty_broxton_mocs_table; + } else { + table->size = ARRAY_SIZE(broxton_mocs_table); + table->table = broxton_mocs_table; + } + result = true; + } + + return result; +} + +static uint32_t get_engine_base(uint32_t engine) +{ + /* Note we cannot test BSD1 or BSD2 due to limitations of current ANI */ + switch (engine) { + case I915_EXEC_BSD: return GEN9_MFX0_MOCS_0; +/* + case I915_EXEC_BSD1: return GEN9_MFX0_MOCS_0; + case I915_EXEC_BSD2: return GEN9_MFX1_MOCS_0; +*/ + case I915_EXEC_RENDER: return GEN9_GFX_MOCS_0; + case I915_EXEC_BLT: return GEN9_BLT_MOCS_0; + case I915_EXEC_VEBOX: return GEN9_VEBOX_MOCS_0; + default: return 0; + } +} + +static uint32_t get_mocs_register_value(int fd, uint64_t offset, uint32_t index) +{ + igt_assert(index < MAX_NUMBER_MOCS_REGISTERS); + return intel_register_read(offset + index * 4); +} + +static void test_mocs_control_values(int fd, uint32_t engine) +{ + const uint32_t engine_base = get_engine_base(engine); + struct mocs_table table; + int local_fd; + int i; + + local_fd = fd; + if (local_fd == -1) + local_fd = drm_open_driver_master(DRIVER_INTEL); + + igt_assert(get_mocs_settings(local_fd, &table, false)); + + for (i = 0; i < table.size; i++) + igt_assert_eq_u32(get_mocs_register_value(local_fd, + engine_base, i), + table.table[i].control_value); + + if (local_fd != fd) + close(local_fd); +} + +static void test_mocs_l3cc_values(int fd) +{ + uint32_t reg_values[MAX_NUMBER_MOCS_REGISTERS/2]; + struct mocs_table table; + int local_fd; + int i; + + local_fd = fd; + if (local_fd == -1) + local_fd = drm_open_driver_master(DRIVER_INTEL); + + for (i = 0; i < MAX_NUMBER_MOCS_REGISTERS / 2; i++) + reg_values[i] = intel_register_read(GEN9_LNCFCMOCS0 + (i * 4)); + + igt_assert(get_mocs_settings(local_fd, &table, false)); + + for (i = 0; i < table.size / 2; i++) { + igt_assert_eq_u32((reg_values[i] & 0xffff), + table.table[i * 2].l3cc_value); + igt_assert_eq_u32((reg_values[i] >> 16), + table.table[i * 2 + 1].l3cc_value); + } + + if (table.size & 1) + igt_assert_eq_u32((reg_values[i] & 0xffff), + table.table[i * 2].l3cc_value); + + if (local_fd != fd) + close(local_fd); +} + +#define MI_STORE_REGISTER_MEM_64_BIT_ADDR ((0x24 << 23) | 2) + +static int create_read_batch(struct drm_i915_gem_relocation_entry *reloc, + uint32_t *batch, + uint32_t dst_handle, + uint32_t size, + uint32_t reg_base) +{ + unsigned int offset = 0; + + for (uint32_t index = 0; index < size; index++, offset += 4) { + batch[offset] = MI_STORE_REGISTER_MEM_64_BIT_ADDR; + batch[offset+1] = reg_base + (index * sizeof(uint32_t)); + batch[offset+2] = index * sizeof(uint32_t); /* reloc */ + batch[offset+3] = 0; + + reloc[index].offset = (offset + 2) * sizeof(uint32_t); + reloc[index].delta = index * sizeof(uint32_t); + reloc[index].target_handle = dst_handle; + reloc[index].write_domain = I915_GEM_DOMAIN_RENDER; + reloc[index].read_domains = I915_GEM_DOMAIN_RENDER; + } + + batch[offset++] = MI_BATCH_BUFFER_END; + batch[offset++] = 0; + + return offset * sizeof(uint32_t); +} + +static void do_read_registers(int fd, + uint32_t ctx_id, + uint32_t dst_handle, + uint32_t reg_base, + uint32_t size, + uint32_t engine_id) +{ + struct drm_i915_gem_execbuffer2 execbuf; + struct drm_i915_gem_exec_object2 obj[2]; + struct drm_i915_gem_relocation_entry reloc[size]; + uint32_t batch[size * 4 + 4]; + uint32_t handle = gem_create(fd, 4096); + + memset(reloc, 0, sizeof(reloc)); + memset(obj, 0, sizeof(obj)); + memset(&execbuf, 0, sizeof(execbuf)); + + obj[0].handle = dst_handle; + + obj[1].handle = handle; + obj[1].relocation_count = size; + obj[1].relocs_ptr = (uintptr_t) reloc; + + execbuf.buffers_ptr = (uintptr_t)obj; + execbuf.buffer_count = 2; + execbuf.batch_len = + create_read_batch(reloc, batch, dst_handle, size, reg_base); + i915_execbuffer2_set_context_id(execbuf, ctx_id); + execbuf.flags = I915_EXEC_SECURE | engine_id; + + gem_write(fd, handle, 0, batch, execbuf.batch_len); + gem_execbuf(fd, &execbuf); + gem_close(fd, handle); +} + +#define LOCAL_MI_LOAD_REGISTER_IMM (0x22 << 23) + +static int create_write_batch(uint32_t *batch, + const uint32_t *values, + uint32_t size, + uint32_t reg_base) +{ + unsigned int i; + unsigned int offset = 0; + + batch[offset++] = LOCAL_MI_LOAD_REGISTER_IMM | (size * 2 - 1); + + for (i = 0; i < size; i++) { + batch[offset++] = reg_base + (i * 4); + batch[offset++] = values[i]; + } + + batch[offset++] = MI_BATCH_BUFFER_END; + + return offset * sizeof(uint32_t); +} + +static void write_registers(int fd, + uint32_t ctx_id, + uint32_t reg_base, + const uint32_t *values, + uint32_t size, + uint32_t engine_id) +{ + struct drm_i915_gem_exec_object2 obj; + struct drm_i915_gem_execbuffer2 execbuf; + uint32_t batch[size * 4 + 2]; + uint32_t handle = gem_create(fd, 4096); + + memset(&obj, 0, sizeof(obj)); + memset(&execbuf, 0, sizeof(execbuf)); + + obj.handle = handle; + + execbuf.buffers_ptr = (uintptr_t)&obj; + execbuf.buffer_count = 1; + execbuf.batch_len = create_write_batch(batch, values, size, reg_base); + i915_execbuffer2_set_context_id(execbuf, ctx_id); + execbuf.flags = I915_EXEC_SECURE | engine_id; + + gem_write(fd, handle, 0, batch, execbuf.batch_len); + gem_execbuf(fd, &execbuf); + gem_close(fd, handle); +} + +static void check_control_registers(int fd, + unsigned engine, + uint32_t ctx_id, + bool dirty) +{ + const uint32_t reg_base = get_engine_base(engine); + uint32_t dst_handle = gem_create(fd, 4096); + uint32_t *read_regs; + struct mocs_table table; + + igt_assert(get_mocs_settings(fd, &table, dirty)); + + do_read_registers(fd, + ctx_id, + dst_handle, + reg_base, + table.size, + engine); + + read_regs = gem_mmap__cpu(fd, dst_handle, 0, 4096, PROT_READ); + + gem_set_domain(fd, dst_handle, I915_GEM_DOMAIN_CPU, 0); + for (int index = 0; index < table.size; index++) + igt_assert_eq_u32(read_regs[index], + table.table[index].control_value); + + munmap(read_regs, 4096); + gem_close(fd, dst_handle); +} + +static void check_l3cc_registers(int fd, + unsigned engine, + uint32_t ctx_id, + bool dirty) +{ + struct mocs_table table; + uint32_t dst_handle = gem_create(fd, 4096); + uint32_t *read_regs; + int index; + + igt_assert(get_mocs_settings(fd, &table, dirty)); + + do_read_registers(fd, + ctx_id, + dst_handle, + GEN9_LNCFCMOCS0, + (table.size + 1) / 2, + engine); + + read_regs = gem_mmap__cpu(fd, dst_handle, 0, 4096, PROT_READ); + + gem_set_domain(fd, dst_handle, I915_GEM_DOMAIN_CPU, 0); + for (index = 0; index < table.size / 2; index++) { + igt_assert_eq_u32(read_regs[index] & 0xffff, + table.table[index * 2].l3cc_value); + igt_assert_eq_u32(read_regs[index] >> 16, + table.table[index * 2 + 1].l3cc_value); + } + + if (table.size & 1) + igt_assert_eq_u32(read_regs[index] & 0xffff, + table.table[index * 2].l3cc_value); + + munmap(read_regs, 4096); + gem_close(fd, dst_handle); +} + +static void test_context_mocs_values(int fd, unsigned engine) +{ + int local_fd; + uint32_t ctx_id = 0; + + local_fd = fd; + if (local_fd == -1) + local_fd = drm_open_driver_master(DRIVER_INTEL); + + check_control_registers(local_fd, engine, ctx_id, false); + check_l3cc_registers(local_fd, engine, ctx_id, false); + + if (engine == I915_EXEC_RENDER) { + ctx_id = gem_context_create(local_fd); + + check_control_registers(local_fd, engine, ctx_id, false); + check_l3cc_registers(local_fd, engine, ctx_id, false); + + gem_context_destroy(local_fd, ctx_id); + } + + if (local_fd != fd) + close(local_fd); +} + +static bool local_has_ring(int fd, unsigned engine) +{ + bool has_ring; + int local_fd; + + if (get_engine_base(engine) == 0) + return false; + + if (fd == -1) + local_fd = drm_open_driver_master(DRIVER_INTEL); + else + local_fd = fd; + + has_ring = gem_has_ring(local_fd, engine); + if (local_fd != fd) + close(local_fd); + + return has_ring; +} + +static void test_mocs_values(int fd) +{ + const struct intel_execution_engine *e; + + for (e = intel_execution_engines; e->name; e++) { + unsigned engine = e->exec_id | e->flags; + + if (!local_has_ring(fd, engine)) + continue; + + igt_debug("Testing %s\n", e->name); + test_mocs_control_values(fd, engine); + test_context_mocs_values(fd, engine); + } + + test_mocs_l3cc_values(fd); +} + +static void default_context_tests(unsigned mode) +{ + int fd = drm_open_driver_master(DRIVER_INTEL); + + igt_debug("Testing Non/Default Context Engines\n"); + test_mocs_values(fd); + + switch (mode) { + case NONE: break; + case RESET: igt_force_gpu_reset(); break; + case SUSPEND: igt_system_suspend_autoresume(); break; + case HIBERNATE: igt_system_hibernate_autoresume(); break; + } + + test_mocs_values(fd); + close(fd); + + igt_debug("Testing Pristine Defaults\n"); + test_mocs_values(-1); +} + +static void default_dirty_tests(unsigned mode) +{ + const struct intel_execution_engine *e; + int fd = drm_open_driver_master(DRIVER_INTEL); + + igt_debug("Testing Dirty Default Context Engines\n"); + test_mocs_values(fd); + + for (e = intel_execution_engines; e->name; e++) { + unsigned engine = e->exec_id | e->flags; + + if (!local_has_ring(fd, engine)) + continue; + + write_registers(fd, 0, + GEN9_GFX_MOCS_0, + write_values, ARRAY_SIZE(write_values), + engine); + + write_registers(fd, 0, + GEN9_LNCFCMOCS0, + write_values, ARRAY_SIZE(write_values), + engine); + } + + switch (mode) { + case NONE: break; + case RESET: igt_force_gpu_reset(); break; + case SUSPEND: igt_system_suspend_autoresume(); break; + case HIBERNATE: igt_system_hibernate_autoresume(); break; + } + + close(fd); + + igt_debug("Testing Pristine after Dirty Defaults\n"); + test_mocs_values(-1); +} + +static void context_save_restore_test(unsigned mode) +{ + int fd = drm_open_driver_master(DRIVER_INTEL); + uint32_t ctx_id = gem_context_create(fd); + + igt_debug("Testing Save Restore\n"); + + check_control_registers(fd, I915_EXEC_RENDER, ctx_id, false); + check_l3cc_registers(fd, I915_EXEC_RENDER, ctx_id, false); + + switch (mode) { + case NONE: break; + case RESET: igt_force_gpu_reset(); break; + case SUSPEND: igt_system_suspend_autoresume(); break; + case HIBERNATE: igt_system_hibernate_autoresume(); break; + } + + check_control_registers(fd, I915_EXEC_RENDER, ctx_id, false); + check_l3cc_registers(fd, I915_EXEC_RENDER, ctx_id, false); + + close(fd); +} + +static void context_dirty_test(unsigned mode) +{ + int fd = drm_open_driver_master(DRIVER_INTEL); + uint32_t ctx_id = gem_context_create(fd); + + igt_debug("Testing Dirty Context\n"); + test_mocs_values(fd); + + check_control_registers(fd, I915_EXEC_RENDER, ctx_id, false); + check_l3cc_registers(fd, I915_EXEC_RENDER, ctx_id, false); + + /* XXX !RCS as well */ + + write_registers(fd, + ctx_id, + GEN9_GFX_MOCS_0, + write_values, + ARRAY_SIZE(write_values), + I915_EXEC_RENDER); + + write_registers(fd, + ctx_id, + GEN9_LNCFCMOCS0, + write_values, + ARRAY_SIZE(write_values), + I915_EXEC_RENDER); + + check_control_registers(fd, I915_EXEC_RENDER, ctx_id, true); + check_l3cc_registers(fd, I915_EXEC_RENDER, ctx_id, true); + + switch (mode) { + case NONE: break; + case RESET: igt_force_gpu_reset(); break; + case SUSPEND: igt_system_suspend_autoresume(); break; + case HIBERNATE: igt_system_hibernate_autoresume(); break; + } + + check_control_registers(fd, I915_EXEC_RENDER, ctx_id, true); + check_l3cc_registers(fd, I915_EXEC_RENDER, ctx_id, true); + + close(fd); + + /* Check that unmodified contexts are pristine */ + igt_debug("Testing Prestine Context (after dirty)\n"); + test_mocs_values(-1); +} + +static void run_tests(unsigned mode) +{ + default_context_tests(mode); + default_dirty_tests(mode); + context_save_restore_test(mode); + context_dirty_test(mode); +} + +static void test_requirements(void) +{ + int fd = drm_open_driver_master(DRIVER_INTEL); + struct mocs_table table; + + gem_require_mocs_registers(fd); + igt_require(get_mocs_settings(fd, &table, false)); + close(fd); +} + +igt_main +{ + struct pci_device *pci_dev; + + igt_fixture { + test_requirements(); + + pci_dev = intel_get_pci_device(); + igt_require(pci_dev); + intel_register_access_init(pci_dev, 0); + } + + igt_subtest("mocs-settings") + run_tests(NONE); + + igt_subtest("mocs-reset") + run_tests(RESET); + + igt_subtest("mocs-suspend") + run_tests(SUSPEND); + + igt_subtest("mocs-hibernate") + run_tests(HIBERNATE); + + igt_fixture { + intel_register_access_fini(); + } +} diff -Nru intel-gpu-tools-1.13/tests/gem_multi_bsd_sync_loop.c intel-gpu-tools-1.15/tests/gem_multi_bsd_sync_loop.c --- intel-gpu-tools-1.13/tests/gem_multi_bsd_sync_loop.c 2015-11-30 16:26:22.000000000 +0000 +++ intel-gpu-tools-1.15/tests/gem_multi_bsd_sync_loop.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,162 +0,0 @@ -/* - * Copyright © 2014 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_ring_sync_loop_*.c) - * Zhao Yakui - * - */ - -#include "igt.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include "drm.h" -#include "intel_bufmgr.h" -#include "i830_reg.h" - -IGT_TEST_DESCRIPTION("Basic check of ring<->ring sync using a dummy reloc."); - -static drm_intel_bufmgr *bufmgr; -struct intel_batchbuffer *batch; -static drm_intel_bo *target_buffer; - -#define NUM_FD 50 - -static int mfd[NUM_FD]; -static drm_intel_bufmgr *mbufmgr[NUM_FD]; -static struct intel_batchbuffer *mbatch[NUM_FD]; -static drm_intel_bo *mbuffer[NUM_FD]; - - -/* - * 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(int fd) -{ - int i; - int num_rings = gem_get_num_rings(fd); - - srandom(0xdeadbeef); - - for (i = 0; i < SLOW_QUICK(0x100000, 10); i++) { - int ring, mindex; - ring = random() % num_rings + 1; - mindex = random() % NUM_FD; - batch = mbatch[mindex]; - if (ring == I915_EXEC_RENDER) { - BEGIN_BATCH(4, 1); - OUT_BATCH(MI_COND_BATCH_BUFFER_END | MI_DO_COMPARE); - OUT_BATCH(0xffffffff); /* compare dword */ - OUT_RELOC(mbuffer[mindex], I915_GEM_DOMAIN_RENDER, - I915_GEM_DOMAIN_RENDER, 0); - OUT_BATCH(MI_NOOP); - ADVANCE_BATCH(); - } else { - BEGIN_BATCH(4, 1); - OUT_BATCH(MI_FLUSH_DW | 1); - OUT_BATCH(0); /* reserved */ - OUT_RELOC(mbuffer[mindex], 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); -} - -igt_simple_main -{ - int fd; - int devid; - int i; - - fd = drm_open_driver(DRIVER_INTEL); - devid = intel_get_drm_devid(fd); - gem_require_ring(fd, I915_EXEC_BLT); - - - bufmgr = drm_intel_bufmgr_gem_init(fd, 4096); - igt_assert_f(bufmgr, "fail to initialize the buf manager\n"); - drm_intel_bufmgr_gem_enable_reuse(bufmgr); - - - target_buffer = drm_intel_bo_alloc(bufmgr, "target bo", 4096, 4096); - igt_assert_f(target_buffer, "fail to create the gem bo\n"); - - /* Create multiple drm_fd and map one gem_object among multi drm_fd */ - { - unsigned int target_flink; - char buffer_name[32]; - igt_assert(dri_bo_flink(target_buffer, &target_flink) == 0); - - for (i = 0; i < NUM_FD; i++) { - sprintf(buffer_name, "Target buffer %d\n", i); - mfd[i] = drm_open_driver(DRIVER_INTEL); - mbufmgr[i] = drm_intel_bufmgr_gem_init(mfd[i], 4096); - igt_assert_f(mbufmgr[i], - "fail to initialize buf manager for drm_fd %d\n", - mfd[i]); - drm_intel_bufmgr_gem_enable_reuse(mbufmgr[i]); - mbatch[i] = intel_batchbuffer_alloc(mbufmgr[i], devid); - igt_assert_f(mbatch[i], - "fail to create batchbuffer for drm_fd %d\n", - mfd[i]); - mbuffer[i] = intel_bo_gem_create_from_name(mbufmgr[i], buffer_name, target_flink); - igt_assert_f(mbuffer[i], - "fail to create buffer bo from global " - "gem handle %d for drm_fd %d\n", - target_flink, mfd[i]); - } - } - - store_dword_loop(fd); - - { - for (i = 0; i < NUM_FD; i++) { - dri_bo_unreference(mbuffer[i]); - intel_batchbuffer_free(mbatch[i]); - drm_intel_bufmgr_destroy(mbufmgr[i]); - close(mfd[i]); - } - } - drm_intel_bo_unreference(target_buffer); - drm_intel_bufmgr_destroy(bufmgr); - - close(fd); -} diff -Nru intel-gpu-tools-1.13/tests/gem_partial_pwrite_pread.c intel-gpu-tools-1.15/tests/gem_partial_pwrite_pread.c --- intel-gpu-tools-1.13/tests/gem_partial_pwrite_pread.c 2015-11-30 16:26:22.000000000 +0000 +++ intel-gpu-tools-1.15/tests/gem_partial_pwrite_pread.c 2016-05-23 10:51:28.000000000 +0000 @@ -78,12 +78,12 @@ } static void -blt_bo_fill(drm_intel_bo *tmp_bo, drm_intel_bo *bo, int val) +blt_bo_fill(drm_intel_bo *tmp_bo, drm_intel_bo *bo, uint8_t val) { uint8_t *gtt_ptr; int i; - drm_intel_gem_bo_map_gtt(tmp_bo); + do_or_die(drm_intel_gem_bo_map_gtt(tmp_bo)); gtt_ptr = tmp_bo->virtual; for (i = 0; i < BO_SIZE; i++) @@ -102,30 +102,33 @@ #define ROUNDS 1000 uint8_t tmp[BO_SIZE]; +static void get_range(int *start, int *len) +{ + *start = random() % (BO_SIZE - 1); + *len = random() % (BO_SIZE - *start - 1) + 1; +} + static void test_partial_reads(void) { int i, j; igt_info("checking partial reads\n"); for (i = 0; i < ROUNDS; i++) { + uint8_t val = 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; + blt_bo_fill(staging_bo, scratch_bo, val); - drm_intel_bo_get_subdata(scratch_bo, start, len, tmp); + get_range(&start, &len); + do_or_die(drm_intel_bo_get_subdata(scratch_bo, start, len, tmp)); for (j = 0; j < len; j++) { igt_assert_f(tmp[j] == val, - "mismatch at %i, got: %i, expected: %i\n", - j, tmp[j], val); + "mismatch at %i [%i + %i], got: %i, expected: %i\n", + j, start, len, tmp[j], val); } igt_progress("partial reads test: ", i, ROUNDS); } - } static void test_partial_writes(void) @@ -135,16 +138,14 @@ igt_info("checking partial writes\n"); for (i = 0; i < ROUNDS; i++) { + uint8_t val = 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; + blt_bo_fill(staging_bo, scratch_bo, val); memset(tmp, i + 63, BO_SIZE); + get_range(&start, &len); drm_intel_bo_subdata(scratch_bo, start, len, tmp); copy_bo(scratch_bo, staging_bo); @@ -153,24 +154,23 @@ for (j = 0; j < start; j++) { igt_assert_f(gtt_ptr[j] == val, - "mismatch at %i, got: %i, expected: %i\n", - j, tmp[j], val); + "mismatch at %i (start=%i), got: %i, expected: %i\n", + j, start, tmp[j], val); } for (; j < start + len; j++) { igt_assert_f(gtt_ptr[j] == tmp[0], - "mismatch at %i, got: %i, expected: %i\n", - j, tmp[j], i); + "mismatch at %i (%i/%i), got: %i, expected: %i\n", + j, j-start, len, tmp[j], i); } for (; j < BO_SIZE; j++) { igt_assert_f(gtt_ptr[j] == val, - "mismatch at %i, got: %i, expected: %i\n", - j, tmp[j], val); + "mismatch at %i (end=%i), got: %i, expected: %i\n", + j, start+len, tmp[j], val); } drm_intel_gem_bo_unmap_gtt(staging_bo); igt_progress("partial writes test: ", i, ROUNDS); } - } static void test_partial_read_writes(void) @@ -180,53 +180,49 @@ igt_info("checking partial writes after partial reads\n"); for (i = 0; i < ROUNDS; i++) { + uint8_t val = i; int start, len; - int val = i % 256; - blt_bo_fill(staging_bo, scratch_bo, i); + blt_bo_fill(staging_bo, scratch_bo, val); /* partial read */ - start = random() % BO_SIZE; - len = random() % (BO_SIZE-start) + 1; - + get_range(&start, &len); drm_intel_bo_get_subdata(scratch_bo, start, len, tmp); for (j = 0; j < len; j++) { igt_assert_f(tmp[j] == val, - "mismatch in read at %i, got: %i, expected: %i\n", - j, tmp[j], val); + "mismatch in read at %i [%i + %i], got: %i, expected: %i\n", + j, start, len, tmp[j], val); } /* Change contents through gtt to make the pread cachelines * stale. */ - val = (i + 17) % 256; + val += 17; 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); + get_range(&start, &len); drm_intel_bo_subdata(scratch_bo, start, len, tmp); copy_bo(scratch_bo, staging_bo); - drm_intel_gem_bo_map_gtt(staging_bo); + do_or_die(drm_intel_gem_bo_map_gtt(staging_bo)); gtt_ptr = staging_bo->virtual; for (j = 0; j < start; j++) { igt_assert_f(gtt_ptr[j] == val, - "mismatch at %i, got: %i, expected: %i\n", - j, tmp[j], val); + "mismatch at %i (start=%i), got: %i, expected: %i\n", + j, start, tmp[j], val); } for (; j < start + len; j++) { igt_assert_f(gtt_ptr[j] == tmp[0], - "mismatch at %i, got: %i, expected: %i\n", - j, tmp[j], tmp[0]); + "mismatch at %i (%i/%i), got: %i, expected: %i\n", + j, j - start, len, tmp[j], tmp[0]); } for (; j < BO_SIZE; j++) { igt_assert_f(gtt_ptr[j] == val, - "mismatch at %i, got: %i, expected: %i\n", - j, tmp[j], val); + "mismatch at %i (end=%i), got: %i, expected: %i\n", + j, start + len, tmp[j], val); } drm_intel_gem_bo_unmap_gtt(staging_bo); diff -Nru intel-gpu-tools-1.13/tests/gem_ppgtt.c intel-gpu-tools-1.15/tests/gem_ppgtt.c --- intel-gpu-tools-1.13/tests/gem_ppgtt.c 2015-11-30 16:26:22.000000000 +0000 +++ intel-gpu-tools-1.15/tests/gem_ppgtt.c 2016-05-24 14:46:19.000000000 +0000 @@ -44,22 +44,6 @@ #define HEIGHT 512 #define SIZE (HEIGHT*STRIDE) -static bool uses_full_ppgtt(int fd) -{ - struct drm_i915_getparam gp; - int val = 0; - - memset(&gp, 0, sizeof(gp)); - gp.param = 18; /* HAS_ALIASING_PPGTT */ - gp.value = &val; - - if (drmIoctl(fd, DRM_IOCTL_I915_GETPARAM, &gp)) - return 0; - - errno = 0; - return val > 1; -} - static drm_intel_bo *create_bo(drm_intel_bufmgr *bufmgr, uint32_t pixel) { @@ -90,11 +74,11 @@ static void scratch_buf_fini(struct igt_buf *buf) { - dri_bo_unreference(buf->bo); + drm_intel_bo_unreference(buf->bo); memset(buf, 0, sizeof(*buf)); } -static void fork_rcs_copy(int target, dri_bo **dst, int count, unsigned flags) +static void fork_rcs_copy(int target, drm_intel_bo **dst, int count, unsigned flags) #define CREATE_CONTEXT 0x1 { igt_render_copyfunc_t render_copy; @@ -159,7 +143,7 @@ } } -static void fork_bcs_copy(int target, dri_bo **dst, int count) +static void fork_bcs_copy(int target, drm_intel_bo **dst, int count) { int devid; @@ -183,7 +167,7 @@ igt_assert(batch); for (int i = 0; i <= target; i++) { - dri_bo *src[2]; + drm_intel_bo *src[2]; src[0] = create_bo(dst[child]->bufmgr, ~0); @@ -193,13 +177,13 @@ intel_copy_bo(batch, src[0], src[1], SIZE); intel_copy_bo(batch, dst[child], src[0], SIZE); - dri_bo_unreference(src[1]); - dri_bo_unreference(src[0]); + drm_intel_bo_unreference(src[1]); + drm_intel_bo_unreference(src[0]); } } } -static void surfaces_check(dri_bo **bo, int count, uint32_t expected) +static void surfaces_check(drm_intel_bo **bo, int count, uint32_t expected) { for (int child = 0; child < count; child++) { uint32_t *ptr; @@ -240,7 +224,7 @@ uint64_t offset, offset_new; fd = drm_open_driver(DRIVER_INTEL); - igt_require(uses_full_ppgtt(fd)); + igt_require(gem_uses_full_ppgtt(fd)); bo = gem_create(fd, 4096); name = gem_flink(fd, bo); @@ -268,8 +252,8 @@ static void flink_and_exit(void) { - uint32_t fd, fd2; - uint32_t bo, flinked_bo, name; + uint32_t fd, fd2, fd3; + uint32_t bo, bo2, flinked_bo, name; char match[100]; int to_match; bool matched; @@ -277,7 +261,7 @@ const int retries = 50; fd = drm_open_driver(DRIVER_INTEL); - igt_require(uses_full_ppgtt(fd)); + igt_require(gem_uses_full_ppgtt(fd)); bo = gem_create(fd, 4096); name = gem_flink(fd, bo); @@ -286,12 +270,19 @@ igt_assert(to_match < sizeof(match)); fd2 = drm_open_driver(DRIVER_INTEL); - flinked_bo = gem_open(fd2, name); + + fd3 = drm_open_driver(DRIVER_INTEL); + bo2 = gem_create(fd3, 4096); + + /* Verify VMA is not there yet. */ + matched = igt_debugfs_search("i915_gem_gtt", match); + igt_assert_eq(matched, false); + exec_and_get_offset(fd2, flinked_bo); gem_sync(fd2, flinked_bo); - /* Verify looking for string works OK. */ + /* Verify VMA has been created. */ matched = igt_debugfs_search("i915_gem_gtt", match); igt_assert_eq(matched, true); @@ -300,6 +291,11 @@ /* Close the context. */ close(fd2); + /* Execute a different and unrelated (wrt object sharing) context to + * ensure engine drops its last context reference. + */ + exec_and_get_offset(fd3, bo2); + retry: /* Give cleanup some time to run. */ usleep(100000); @@ -313,6 +309,9 @@ igt_assert_eq(matched, false); + gem_close(fd3, bo2); + close(fd3); + gem_close(fd, bo); close(fd); } @@ -323,7 +322,7 @@ igt_subtest_init(argc, argv); igt_subtest("blt-vs-render-ctx0") { - dri_bo *bcs[1], *rcs[N_CHILD]; + drm_intel_bo *bcs[1], *rcs[N_CHILD]; fork_bcs_copy(0x4000, bcs, 1); fork_rcs_copy(0x8000 / N_CHILD, rcs, N_CHILD, 0); @@ -335,7 +334,7 @@ } igt_subtest("blt-vs-render-ctxN") { - dri_bo *bcs[1], *rcs[N_CHILD]; + drm_intel_bo *bcs[1], *rcs[N_CHILD]; fork_rcs_copy(0x8000 / N_CHILD, rcs, N_CHILD, CREATE_CONTEXT); fork_bcs_copy(0x4000, bcs, 1); diff -Nru intel-gpu-tools-1.13/tests/gem_pread_after_blit.c intel-gpu-tools-1.15/tests/gem_pread_after_blit.c --- intel-gpu-tools-1.13/tests/gem_pread_after_blit.c 2015-11-30 16:26:22.000000000 +0000 +++ intel-gpu-tools-1.15/tests/gem_pread_after_blit.c 2016-05-23 10:51:28.000000000 +0000 @@ -233,10 +233,8 @@ do_test(fd, t->cache, src, start, dst, 100, no_hang); igt_stop_signal_helper(); - igt_subtest_f("%s-hang", t->name) { - igt_require_hang_ring(fd, -1); + igt_subtest_f("%s-hang", t->name) do_test(fd, t->cache, src, start, dst, 1, bcs_hang); - } } igt_fixture { diff -Nru intel-gpu-tools-1.13/tests/gem_pread.c intel-gpu-tools-1.15/tests/gem_pread.c --- intel-gpu-tools-1.13/tests/gem_pread.c 2015-11-30 16:26:22.000000000 +0000 +++ intel-gpu-tools-1.15/tests/gem_pread.c 2016-05-23 10:51:28.000000000 +0000 @@ -40,6 +40,10 @@ #include "drm.h" #define OBJECT_SIZE 16384 +#define LARGE_OBJECT_SIZE 1024 * 1024 +#define KGRN "\x1B[32m" +#define KRED "\x1B[31m" +#define KNRM "\x1B[0m" static void do_gem_read(int fd, uint32_t handle, void *buf, int len, int loops) { @@ -75,12 +79,16 @@ uint32_t *src, dst; +uint32_t *dst_user, src_stolen, large_stolen; +uint32_t *stolen_pf_user, *stolen_nopf_user; int fd, count; int main(int argc, char **argv) { int object_size = 0; - uint32_t buf[20]; + double usecs; + char buf[100]; + const char* bps; const struct { int level; const char *name; @@ -105,6 +113,8 @@ dst = gem_create(fd, object_size); src = malloc(object_size); + src_stolen = gem_create_stolen(fd, object_size); + dst_user = malloc(object_size); } igt_subtest("basic") { @@ -114,10 +124,10 @@ gettimeofday(&start, NULL); do_gem_read(fd, dst, src, object_size, count); gettimeofday(&end, NULL); + usecs = elapsed(&start, &end, count); + bps = bytes_per_sec(buf, object_size/usecs*1e6); igt_info("Time to pread %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)); + object_size, count, usecs, bps); fflush(stdout); } } @@ -132,18 +142,102 @@ gettimeofday(&start, NULL); do_gem_read(fd, dst, src, object_size, count); gettimeofday(&end, NULL); + usecs = elapsed(&start, &end, count); + bps = bytes_per_sec(buf, object_size/usecs*1e6); igt_info("Time to %s pread %d bytes x %6d: %7.3fµs, %s\n", - c->name, object_size, count, - elapsed(&start, &end, count), - bytes_per_sec((char *)buf, object_size/elapsed(&start, &end, count)*1e6)); + c->name, object_size, count, usecs, bps); fflush(stdout); } } } + igt_subtest("stolen-normal") { + for (count = 1; count <= 1<<17; count <<= 1) { + struct timeval start, end; + + gettimeofday(&start, NULL); + do_gem_read(fd, src_stolen, dst_user, object_size, count); + gettimeofday(&end, NULL); + usecs = elapsed(&start, &end, count); + bps = bytes_per_sec(buf, object_size/usecs*1e6); + igt_info("Time to pread %d bytes x %6d: %7.3fµs, %s\n", + object_size, count, usecs, bps); + fflush(stdout); + } + } + for (c = cache; c->level != -1; c++) { + igt_subtest_f("stolen-%s", c->name) { + gem_set_caching(fd, src_stolen, c->level); + + for (count = 1; count <= 1<<17; count <<= 1) { + struct timeval start, end; + + gettimeofday(&start, NULL); + do_gem_read(fd, src_stolen, dst_user, + object_size, count); + gettimeofday(&end, NULL); + usecs = elapsed(&start, &end, count); + bps = bytes_per_sec(buf, object_size/usecs*1e6); + igt_info("Time to stolen-%s pread %d bytes x %6d: %7.3fµs, %s\n", + c->name, object_size, count, usecs, bps); + fflush(stdout); + } + } + } + + /* List the time taken in pread operation for stolen objects, with + * and without the overhead of page fault handling on accessing the + * user space buffer + */ + igt_subtest("pagefault-pread") { + large_stolen = gem_create_stolen(fd, LARGE_OBJECT_SIZE); + stolen_nopf_user = (uint32_t *) mmap(NULL, LARGE_OBJECT_SIZE, + PROT_WRITE, + MAP_ANONYMOUS|MAP_PRIVATE, + -1, 0); + igt_assert(stolen_nopf_user); + + for (count = 1; count <= 10; count ++) { + struct timeval start, end; + double t_elapsed = 0; + + gettimeofday(&start, NULL); + do_gem_read(fd, large_stolen, stolen_nopf_user, + LARGE_OBJECT_SIZE, 1); + gettimeofday(&end, NULL); + t_elapsed = elapsed(&start, &end, count); + bps = bytes_per_sec(buf, object_size/t_elapsed*1e6); + igt_info("Pagefault-N - Time to pread %d bytes: %7.3fµs, %s\n", + LARGE_OBJECT_SIZE, t_elapsed, bps); + + stolen_pf_user = (uint32_t *) mmap(NULL, LARGE_OBJECT_SIZE, + PROT_WRITE, + MAP_ANONYMOUS|MAP_PRIVATE, + -1, 0); + igt_assert(stolen_pf_user); + + gettimeofday(&start, NULL); + do_gem_read(fd, large_stolen, stolen_pf_user, + LARGE_OBJECT_SIZE, 1); + gettimeofday(&end, NULL); + usecs = elapsed(&start, &end, count); + bps = bytes_per_sec(buf, object_size/usecs*1e6); + igt_info("Pagefault-Y - Time to pread %d bytes: %7.3fµs, %s%s%s\n", + LARGE_OBJECT_SIZE, usecs, + t_elapsed < usecs ? KGRN : KRED, bps, KNRM); + fflush(stdout); + munmap(stolen_pf_user, LARGE_OBJECT_SIZE); + } + munmap(stolen_nopf_user, LARGE_OBJECT_SIZE); + gem_close(fd, large_stolen); + } + + igt_fixture { free(src); gem_close(fd, dst); + free(dst_user); + gem_close(fd, src_stolen); close(fd); } diff -Nru intel-gpu-tools-1.13/tests/gem_pwrite.c intel-gpu-tools-1.15/tests/gem_pwrite.c --- intel-gpu-tools-1.13/tests/gem_pwrite.c 2015-11-30 16:26:22.000000000 +0000 +++ intel-gpu-tools-1.15/tests/gem_pwrite.c 2016-05-23 10:51:28.000000000 +0000 @@ -79,52 +79,126 @@ return buf; } -static void test_big_cpu(int fd, int scale) +#define FORWARD 0x1 +#define BACKWARD 0x2 +#define RANDOM 0x4 +static void test_big_cpu(int fd, int scale, unsigned flags) { uint64_t offset, size; uint32_t handle; - size = scale * gem_aperture_size(fd) >> 2; + switch (scale) { + case 0: + size = gem_mappable_aperture_size() + 4096; + break; + case 1: + size = gem_global_aperture_size(fd) + 4096; + break; + case 2: + size = gem_aperture_size(fd) + 4096; + break; + } intel_require_memory(1, size, CHECK_RAM); - igt_require(gem_mmap__has_wc(fd)); - handle = gem_create(fd, size); gem_set_domain(fd, handle, I915_GEM_DOMAIN_CPU, I915_GEM_DOMAIN_CPU); - for (offset = 0; offset < size; offset += 4096) { - int suboffset = (offset >> 12) % (4096 - sizeof(offset)); - uint64_t tmp; - - gem_write(fd, handle, offset + suboffset , &offset, sizeof(offset)); - gem_read(fd, handle, offset + suboffset, &tmp, sizeof(tmp)); - igt_assert_eq(offset, tmp); + if (flags & FORWARD) { + igt_debug("Forwards\n"); + for (offset = 0; offset < size; offset += 4096) { + int suboffset = (offset >> 12) % (4096 - sizeof(offset)); + uint64_t tmp; + + gem_write(fd, handle, offset + suboffset, &offset, sizeof(offset)); + gem_read(fd, handle, offset + suboffset, &tmp, sizeof(tmp)); + igt_assert_eq_u64(offset, tmp); + } + } + + if (flags & BACKWARD) { + igt_debug("Backwards\n"); + for (offset = size >> 12; offset--; ) { + int suboffset = 4096 - (offset % (4096 - sizeof(offset))); + uint64_t tmp; + + gem_write(fd, handle, (offset<<12) + suboffset, &offset, sizeof(offset)); + gem_read(fd, handle, (offset<<12) + suboffset, &tmp, sizeof(tmp)); + igt_assert_eq_u64(offset, tmp); + } + } + + if (flags & RANDOM) { + igt_debug("Random\n"); + for (offset = 0; offset < size >> 12; offset++) { + uint64_t tmp = rand() % (size >> 12); + int suboffset = tmp % (4096 - sizeof(offset)); + + gem_write(fd, handle, (tmp << 12) + suboffset, &offset, sizeof(offset)); + gem_read(fd, handle, (tmp << 12) + suboffset, &tmp, sizeof(tmp)); + igt_assert_eq_u64(offset, tmp); + } } gem_close(fd, handle); } -static void test_big_gtt(int fd, int scale) +static void test_big_gtt(int fd, int scale, unsigned flags) { uint64_t offset, size; uint64_t *ptr; uint32_t handle; - size = scale * gem_aperture_size(fd) >> 2; - intel_require_memory(1, size, CHECK_RAM); - igt_require(gem_mmap__has_wc(fd)); + switch (scale) { + case 0: + size = gem_mappable_aperture_size() + 4096; + break; + case 1: + size = gem_global_aperture_size(fd) + 4096; + break; + case 2: + size = gem_aperture_size(fd) + 4096; + break; + } + intel_require_memory(1, size, CHECK_RAM); handle = gem_create(fd, size); gem_set_domain(fd, handle, I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT); ptr = gem_mmap__wc(fd, handle, 0, size, PROT_READ); - for (offset = 0; offset < size; offset += 4096) { - int suboffset = (offset >> 12) % (4096 / sizeof(offset) - 1) * sizeof(offset); + if (flags & FORWARD) { + igt_debug("Forwards\n"); + for (offset = 0; offset < size; offset += 4096) { + int suboffset = (offset >> 12) % (4096 / sizeof(offset) - 1) * sizeof(offset); + + gem_write(fd, handle, offset + suboffset, &offset, sizeof(offset)); + gem_set_domain(fd, handle, I915_GEM_DOMAIN_GTT, 0); + igt_assert_eq_u64(ptr[(offset + suboffset)/sizeof(offset)], offset); + } + } - gem_write(fd, handle, offset + suboffset, &offset, sizeof(offset)); - igt_assert_eq(ptr[(offset + suboffset)/sizeof(offset)], offset); + if (flags & BACKWARD) { + igt_debug("Backwards\n"); + for (offset = size >> 12; offset--; ) { + int suboffset = (4096 - (offset % (4096 - sizeof(offset)))) & -sizeof(offset); + gem_write(fd, handle, (offset<<12) + suboffset, &offset, sizeof(offset)); + gem_set_domain(fd, handle, I915_GEM_DOMAIN_GTT, 0); + igt_assert_eq_u64(ptr[((offset<<12) + suboffset)/sizeof(offset)], offset); + } + } + + if (flags & RANDOM) { + igt_debug("Random\n"); + for (offset = 0; offset < size >> 12; offset++) { + uint64_t tmp = rand() % (size >> 12); + int suboffset = (tmp % 4096) & -sizeof(offset); + + tmp = (tmp << 12) + suboffset; + gem_write(fd, handle, tmp, &offset, sizeof(offset)); + gem_set_domain(fd, handle, I915_GEM_DOMAIN_GTT, 0); + igt_assert_eq_u64(ptr[tmp/sizeof(offset)], offset); + } } munmap(ptr, size); @@ -132,12 +206,15 @@ } uint32_t *src, dst; +uint32_t *src_user, dst_stolen; int fd; int main(int argc, char **argv) { int object_size = 0; - uint32_t buf[20]; + double usecs; + const char* bps; + char buf[100]; int count; const struct { int level; @@ -164,6 +241,8 @@ dst = gem_create(fd, object_size); src = malloc(object_size); + dst_stolen = gem_create_stolen(fd, object_size); + src_user = malloc(object_size); } igt_subtest("basic") { @@ -173,10 +252,10 @@ gettimeofday(&start, NULL); do_gem_write(fd, dst, src, object_size, count); gettimeofday(&end, NULL); + usecs = elapsed(&start, &end, count); + bps = bytes_per_sec(buf, object_size/usecs*1e6); igt_info("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)); + object_size, count, usecs, bps); fflush(stdout); } } @@ -191,10 +270,46 @@ gettimeofday(&start, NULL); do_gem_write(fd, dst, src, object_size, count); gettimeofday(&end, NULL); + usecs = elapsed(&start, &end, count); + bps = bytes_per_sec(buf, object_size/usecs*1e6); igt_info("Time to %s pwrite %d bytes x %6d: %7.3fµs, %s\n", + c->name, object_size, count, usecs, bps); + fflush(stdout); + } + } + } + + igt_subtest("stolen-normal") { + for (count = 1; count <= 1<<17; count <<= 1) { + struct timeval start, end; + + gettimeofday(&start, NULL); + do_gem_write(fd, dst_stolen, src_user, + object_size, count); + gettimeofday(&end, NULL); + usecs = elapsed(&start, &end, count); + bps = bytes_per_sec(buf, object_size/usecs*1e6); + igt_info("Time to pwrite %d bytes x %6d: %7.3fµs, %s\n", + object_size, count, usecs, bps); + fflush(stdout); + } + } + + for (c = cache; c->level != -1; c++) { + igt_subtest_f("stolen-%s", c->name) { + gem_set_caching(fd, dst, c->level); + for (count = 1; count <= 1<<17; count <<= 1) { + struct timeval start, end; + + gettimeofday(&start, NULL); + do_gem_write(fd, dst_stolen, src_user, + object_size, count); + gettimeofday(&end, NULL); + bps = bytes_per_sec(buf, + object_size/usecs*1e6); + igt_info("Time to stolen-%s pwrite %d bytes x %6d: %7.3fµs, %s\n", c->name, object_size, count, - elapsed(&start, &end, count), - bytes_per_sec((char *)buf, object_size/elapsed(&start, &end, count)*1e6)); + usecs, bps); fflush(stdout); } } @@ -203,17 +318,38 @@ igt_fixture { free(src); gem_close(fd, dst); + free(src_user); + gem_close(fd, dst_stolen); } - igt_subtest("big-cpu") - test_big_cpu(fd, 3); - igt_subtest("big-gtt") - test_big_gtt(fd, 3); - - igt_subtest("huge-cpu") - test_big_cpu(fd, 6); - igt_subtest("huge-gtt") - test_big_gtt(fd, 6); + { + const struct mode { + const char *name; + unsigned flags; + } modes[] = { + { "forwards", FORWARD }, + { "backwards", BACKWARD }, + { "random", RANDOM }, + { "fbr", FORWARD | BACKWARD | RANDOM }, + { NULL }, + }, *m; + for (m = modes; m->name; m++) { + igt_subtest_f("small-cpu-%s", m->name) + test_big_cpu(fd, 0, m->flags); + igt_subtest_f("small-gtt-%s", m->name) + test_big_gtt(fd, 0, m->flags); + + igt_subtest_f("big-cpu-%s", m->name) + test_big_cpu(fd, 1, m->flags); + igt_subtest_f("big-gtt-%s", m->name) + test_big_gtt(fd, 1, m->flags); + + igt_subtest_f("huge-cpu-%s", m->name) + test_big_cpu(fd, 2, m->flags); + igt_subtest_f("huge-gtt-%s", m->name) + test_big_gtt(fd, 2, m->flags); + } + } igt_fixture close(fd); diff -Nru intel-gpu-tools-1.13/tests/gem_read_read_speed.c intel-gpu-tools-1.15/tests/gem_read_read_speed.c --- intel-gpu-tools-1.13/tests/gem_read_read_speed.c 2015-11-30 16:26:22.000000000 +0000 +++ intel-gpu-tools-1.15/tests/gem_read_read_speed.c 2016-05-23 10:51:28.000000000 +0000 @@ -154,7 +154,8 @@ &tiling_mode, &pitch, 0); } -static void run(drm_intel_bufmgr *bufmgr, int _width, int _height) +static void run(drm_intel_bufmgr *bufmgr, int _width, int _height, + bool write_bcs, bool write_rcs) { drm_intel_bo *src = NULL, *bcs = NULL, *rcs = NULL; drm_intel_bo *bcs_batch, *rcs_batch; @@ -170,8 +171,16 @@ set_bo(src, 0xdeadbeef); - rcs_batch = rcs_copy_bo(rcs, src); - bcs_batch = bcs_copy_bo(bcs, src); + if (write_bcs) { + bcs_batch = bcs_copy_bo(src, bcs); + } else { + bcs_batch = bcs_copy_bo(bcs, src); + } + if (write_rcs) { + rcs_batch = rcs_copy_bo(src, rcs); + } else { + rcs_batch = rcs_copy_bo(rcs, src); + } drm_intel_bo_unreference(rcs); drm_intel_bo_unreference(bcs); @@ -185,7 +194,9 @@ drm_intel_gem_bo_start_gtt_access(src, true); clock_gettime(CLOCK_MONOTONIC, &end); - igt_info("Time to read-read %dx%d [%dk]: %7.3fµs\n", + igt_info("Time to %s-%s %dx%d [%dk]: %7.3fµs\n", + write_bcs ? "write" : "read", + write_rcs ? "write" : "read", width, height, 4*width*height/1024, elapsed(&start, &end, loops)); @@ -222,7 +233,14 @@ igt_info("Semaphores: %d\n", semaphores_enabled(fd)); } - for (i = 0; sizes[i] != 0; i++) + for (i = 0; sizes[i] != 0; i++) { igt_subtest_f("read-read-%dx%d", sizes[i], sizes[i]) - run(bufmgr, sizes[i], sizes[i]); + run(bufmgr, sizes[i], sizes[i], false, false); + igt_subtest_f("read-write-%dx%d", sizes[i], sizes[i]) + run(bufmgr, sizes[i], sizes[i], false, true); + igt_subtest_f("write-read-%dx%d", sizes[i], sizes[i]) + run(bufmgr, sizes[i], sizes[i], true, false); + igt_subtest_f("write-write-%dx%d", sizes[i], sizes[i]) + run(bufmgr, sizes[i], sizes[i], true, true); + } } diff -Nru intel-gpu-tools-1.13/tests/gem_reloc_overflow.c intel-gpu-tools-1.15/tests/gem_reloc_overflow.c --- intel-gpu-tools-1.13/tests/gem_reloc_overflow.c 2015-11-30 16:26:22.000000000 +0000 +++ intel-gpu-tools-1.15/tests/gem_reloc_overflow.c 2016-05-23 10:51:28.000000000 +0000 @@ -52,19 +52,18 @@ */ int fd, entries, num; -size_t reloc_size; -uint32_t *handles; -struct drm_i915_gem_exec_object2 *execobjs; -struct drm_i915_gem_execbuffer2 execbuf = { 0 }; +struct drm_i915_gem_exec_object2 *obj; +struct drm_i915_gem_execbuffer2 execbuf; struct drm_i915_gem_relocation_entry *reloc; -uint32_t handle; -uint32_t batch_handle; +static uint32_t target_handle(void) +{ + return execbuf.flags & I915_EXEC_HANDLE_LUT ? 0 : obj[0].handle; +} static void source_offset_tests(int devid, bool reloc_gtt) { struct drm_i915_gem_relocation_entry single_reloc; - void *dst_gtt; const char *relocation_type; if (reloc_gtt) @@ -73,25 +72,18 @@ relocation_type = "reloc-cpu"; igt_fixture { - handle = gem_create(fd, 8192); + obj[1].relocation_count = 0; + obj[1].relocs_ptr = 0; - execobjs[1].handle = batch_handle; - execobjs[1].relocation_count = 0; - execobjs[1].relocs_ptr = 0; - - execobjs[0].handle = handle; - execobjs[0].relocation_count = 1; - execobjs[0].relocs_ptr = (uintptr_t) &single_reloc; + obj[0].relocation_count = 1; + obj[0].relocs_ptr = (uintptr_t) &single_reloc; execbuf.buffer_count = 2; if (reloc_gtt) { - dst_gtt = __gem_mmap__gtt(fd, handle, 8192, PROT_READ | PROT_WRITE); - igt_assert(dst_gtt != MAP_FAILED); - gem_set_domain(fd, handle, I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT); - memset(dst_gtt, 0, 8192); - munmap(dst_gtt, 8192); + gem_set_domain(fd, obj[0].handle, I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT); relocation_type = "reloc-gtt"; } else { + gem_set_domain(fd, obj[0].handle, I915_GEM_DOMAIN_CPU, I915_GEM_DOMAIN_CPU); relocation_type = "reloc-cpu"; } } @@ -101,39 +93,36 @@ igt_require(intel_gen(devid) >= 8); single_reloc.offset = 4096 - 4; single_reloc.delta = 0; - single_reloc.target_handle = handle; + single_reloc.target_handle = target_handle(); single_reloc.read_domains = I915_GEM_DOMAIN_RENDER; single_reloc.write_domain = I915_GEM_DOMAIN_RENDER; single_reloc.presumed_offset = 0; + gem_execbuf(fd, &execbuf); - igt_assert(ioctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, &execbuf) == 0); single_reloc.delta = 1024; - igt_assert(ioctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, &execbuf) == 0); + gem_execbuf(fd, &execbuf); } igt_subtest_f("source-offset-end-gen8-%s", relocation_type) { igt_require(intel_gen(devid) >= 8); single_reloc.offset = 8192 - 8; single_reloc.delta = 0; - single_reloc.target_handle = handle; + single_reloc.target_handle = target_handle(); single_reloc.read_domains = I915_GEM_DOMAIN_RENDER; single_reloc.write_domain = I915_GEM_DOMAIN_RENDER; single_reloc.presumed_offset = 0; - - igt_assert(ioctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, &execbuf) == 0); + gem_execbuf(fd, &execbuf); } igt_subtest_f("source-offset-overflow-gen8-%s", relocation_type) { igt_require(intel_gen(devid) >= 8); single_reloc.offset = 8192 - 4; single_reloc.delta = 0; - single_reloc.target_handle = handle; + single_reloc.target_handle = target_handle(); single_reloc.read_domains = I915_GEM_DOMAIN_RENDER; single_reloc.write_domain = I915_GEM_DOMAIN_RENDER; single_reloc.presumed_offset = 0; - - igt_assert(ioctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, &execbuf) != 0); - igt_assert(errno == EINVAL); + igt_assert_eq(__gem_execbuf(fd, &execbuf), -EINVAL); } /* Tests for old 4byte relocs on pre-gen8. */ @@ -141,140 +130,209 @@ igt_require(intel_gen(devid) < 8); single_reloc.offset = 8192 - 4; single_reloc.delta = 0; - single_reloc.target_handle = handle; + single_reloc.target_handle = target_handle(); single_reloc.read_domains = I915_GEM_DOMAIN_RENDER; single_reloc.write_domain = I915_GEM_DOMAIN_RENDER; single_reloc.presumed_offset = 0; - - igt_assert(ioctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, &execbuf) == 0); + gem_execbuf(fd, &execbuf); } igt_subtest_f("source-offset-big-%s", relocation_type) { single_reloc.offset = 8192; single_reloc.delta = 0; - single_reloc.target_handle = handle; + single_reloc.target_handle = target_handle(); single_reloc.read_domains = I915_GEM_DOMAIN_RENDER; single_reloc.write_domain = I915_GEM_DOMAIN_RENDER; single_reloc.presumed_offset = 0; - - igt_assert(ioctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, &execbuf) != 0); - igt_assert(errno == EINVAL); + igt_assert_eq(__gem_execbuf(fd, &execbuf), -EINVAL); } igt_subtest_f("source-offset-negative-%s", relocation_type) { single_reloc.offset = (int64_t) -4; single_reloc.delta = 0; - single_reloc.target_handle = handle; + single_reloc.target_handle = target_handle(); single_reloc.read_domains = I915_GEM_DOMAIN_RENDER; single_reloc.write_domain = I915_GEM_DOMAIN_RENDER; single_reloc.presumed_offset = 0; - - igt_assert(ioctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, &execbuf) != 0); - igt_assert(errno == EINVAL); + igt_assert_eq(__gem_execbuf(fd, &execbuf), -EINVAL); } igt_subtest_f("source-offset-unaligned-%s", relocation_type) { single_reloc.offset = 1; single_reloc.delta = 0; - single_reloc.target_handle = handle; + single_reloc.target_handle = target_handle(); single_reloc.read_domains = I915_GEM_DOMAIN_RENDER; single_reloc.write_domain = I915_GEM_DOMAIN_RENDER; single_reloc.presumed_offset = 0; - - igt_assert(ioctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, &execbuf) != 0); - igt_assert(errno == EINVAL); - } - - igt_fixture { - gem_close(fd, handle); + igt_assert_eq(__gem_execbuf(fd, &execbuf), -EINVAL); } } -static void reloc_tests(void) +static void reloc_tests(const char *suffix) { + uint64_t max_relocations; int i; - unsigned int total_unsigned = 0; - igt_subtest("invalid-address") { + max_relocations = min(ULONG_MAX, SIZE_MAX); + max_relocations /= sizeof(struct drm_i915_gem_relocation_entry); + igt_debug("Maximum allocable relocations: %'llu\n", + (long long)max_relocations); + + igt_subtest_f("invalid-address%s", suffix) { /* Attempt unmapped single entry. */ - execobjs[0].relocation_count = 1; - execobjs[0].relocs_ptr = 0; + obj[0].relocation_count = 1; + obj[0].relocs_ptr = 0; execbuf.buffer_count = 1; - errno = 0; - ioctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, &execbuf); - igt_assert(errno == EFAULT); + igt_assert_eq(__gem_execbuf(fd, &execbuf), -EFAULT); } - igt_subtest("single-overflow") { - /* Attempt single overflowed entry. */ - execobjs[0].relocation_count = (1 << 31); - execobjs[0].relocs_ptr = (uintptr_t)reloc; + igt_subtest_f("single-fault%s", suffix) { + obj[0].relocation_count = entries + 1; execbuf.buffer_count = 1; - errno = 0; - ioctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, &execbuf); - igt_assert(errno == EINVAL); + /* out-of-bounds after */ + obj[0].relocs_ptr = (uintptr_t)reloc; + igt_assert_eq(__gem_execbuf(fd, &execbuf), -EFAULT); + + /* out-of-bounds before */ + obj[0].relocs_ptr = (uintptr_t)(reloc - 1); + igt_assert_eq(__gem_execbuf(fd, &execbuf), -EFAULT); } igt_fixture { - execobjs[0].handle = batch_handle; - execobjs[0].relocation_count = 0; - execobjs[0].relocs_ptr = 0; + obj[0].relocation_count = 0; + obj[0].relocs_ptr = 0; execbuf.buffer_count = 1; /* Make sure the batch would succeed except for the thing we're * testing. */ - execbuf.batch_start_offset = 0; - execbuf.batch_len = 8; - igt_assert(ioctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, &execbuf) == 0); + igt_require(__gem_execbuf(fd, &execbuf) == 0); } - igt_subtest("batch-start-unaligned") { + igt_subtest_f("batch-start-unaligned%s", suffix) { execbuf.batch_start_offset = 1; execbuf.batch_len = 8; - - igt_assert(ioctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, &execbuf) != 0); - igt_assert(errno == EINVAL); + igt_assert_eq(__gem_execbuf(fd, &execbuf), -EINVAL); } - igt_subtest("batch-end-unaligned") { + igt_subtest_f("batch-end-unaligned%s", suffix) { execbuf.batch_start_offset = 0; execbuf.batch_len = 7; + igt_assert_eq(__gem_execbuf(fd, &execbuf), -EINVAL); + } - igt_assert(ioctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, &execbuf) != 0); - igt_assert(errno == EINVAL); + igt_subtest_f("batch-both-unaligned%s", suffix) { + execbuf.batch_start_offset = 1; + execbuf.batch_len = 7; + igt_assert_eq(__gem_execbuf(fd, &execbuf), -EINVAL); } igt_fixture { /* Undo damage for next tests. */ execbuf.batch_start_offset = 0; - execbuf.batch_len = 8; + execbuf.batch_len = 0; + igt_require(__gem_execbuf(fd, &execbuf) == 0); } - igt_subtest("wrapped-overflow") { - /* Attempt wrapped overflow entries. */ + igt_subtest_f("single-overflow%s", suffix) { + if (*suffix) { + igt_require_f(intel_get_avail_ram_mb() > + sizeof(struct drm_i915_gem_relocation_entry) * entries / (1024*1024), + "Test requires at least %'llu MiB, but only %'llu MiB of RAM available\n", + (long long)sizeof(struct drm_i915_gem_relocation_entry) * entries / (1024*1024), + (long long)intel_get_avail_ram_mb()); + } + + obj[0].relocs_ptr = (uintptr_t)reloc; + obj[0].relocation_count = entries; + execbuf.buffer_count = 1; + gem_execbuf(fd, &execbuf); + + /* Attempt single overflowed entry. */ + obj[0].relocation_count = -1; + igt_debug("relocation_count=%u\n", + obj[0].relocation_count); + if (max_relocations <= obj[0].relocation_count) + igt_assert_eq(__gem_execbuf(fd, &execbuf), -EINVAL); + else + igt_assert_eq(__gem_execbuf(fd, &execbuf), -EFAULT); + + if (max_relocations + 1 < obj[0].relocation_count) { + obj[0].relocation_count = max_relocations + 1; + igt_debug("relocation_count=%u\n", + obj[0].relocation_count); + igt_assert_eq(__gem_execbuf(fd, &execbuf), -EINVAL); + + obj[0].relocation_count = max_relocations - 1; + igt_debug("relocation_count=%u\n", + obj[0].relocation_count); + igt_assert_eq(__gem_execbuf(fd, &execbuf), -EFAULT); + } + } + + igt_subtest_f("wrapped-overflow%s", suffix) { + if (*suffix) { + igt_require_f(intel_get_avail_ram_mb() > + sizeof(struct drm_i915_gem_relocation_entry) * entries * num / (1024*1024), + "Test requires at least %'llu MiB, but only %'llu MiB of RAM available\n", + (long long)sizeof(struct drm_i915_gem_relocation_entry) * entries * num / (1024*1024), + (long long)intel_get_avail_ram_mb()); + } + for (i = 0; i < num; i++) { - struct drm_i915_gem_exec_object2 *obj = &execobjs[i]; - obj->handle = handles[i]; + struct drm_i915_gem_exec_object2 *o = &obj[i]; - if (i == num - 1) { - /* Wraps to 1 on last count. */ - obj->relocation_count = 1 - total_unsigned; - obj->relocs_ptr = (uintptr_t)reloc; - } else { - obj->relocation_count = entries; - obj->relocs_ptr = (uintptr_t)reloc; - } + o->relocs_ptr = (uintptr_t)reloc; + o->relocation_count = entries; + } + execbuf.buffer_count = i; + gem_execbuf(fd, &execbuf); - total_unsigned += obj->relocation_count; + obj[i-1].relocation_count = -1; + igt_debug("relocation_count[%d]=%u\n", + i-1, obj[i-1].relocation_count); + if (max_relocations <= obj[i-1].relocation_count) + igt_assert_eq(__gem_execbuf(fd, &execbuf), -EINVAL); + else + igt_assert_eq(__gem_execbuf(fd, &execbuf), -EFAULT); + + if (max_relocations < obj[i-1].relocation_count) { + obj[i-1].relocation_count = max_relocations; + igt_debug("relocation_count[%d]=%u\n", + i-1, obj[i-1].relocation_count); + /* Whether the kernel reports the EFAULT for the + * invalid relocation array or EINVAL for the overflow + * in array size depends upon the order of the + * individual tests. From a consistency perspective + * EFAULT is preferred (i.e. using that relocation + * array by itself would cause EFAULT not EINVAL). + */ + igt_assert_eq(__gem_execbuf(fd, &execbuf), -EFAULT); + + obj[i-1].relocation_count = max_relocations - 1; + igt_debug("relocation_count[%d]=%u\n", + i-1, obj[i-1].relocation_count); + igt_assert_eq(__gem_execbuf(fd, &execbuf), -EFAULT); } - execbuf.buffer_count = num; - errno = 0; - ioctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, &execbuf); - igt_assert(errno == EINVAL); + obj[i-1].relocation_count = entries + 1; + igt_debug("relocation_count[%d]=%u\n", + i-1, obj[i-1].relocation_count); + igt_assert_eq(__gem_execbuf(fd, &execbuf), -EFAULT); + + obj[0].relocation_count = -1; + if (max_relocations < obj[0].relocation_count) { + execbuf.buffer_count = 1; + gem_execbuf(fd, &execbuf); + + /* As outlined above, this is why EFAULT is preferred */ + obj[0].relocation_count = max_relocations; + igt_debug("relocation_count[0]=%u\n", + obj[0].relocation_count); + igt_assert_eq(__gem_execbuf(fd, &execbuf), -EFAULT); + } } } @@ -282,39 +340,25 @@ { igt_subtest("buffercount-overflow") { for (int i = 0; i < num; i++) { - execobjs[i].relocation_count = 0; - execobjs[i].relocs_ptr = 0; - execobjs[i].handle = handles[i]; + obj[i].relocation_count = 0; + obj[i].relocs_ptr = 0; } - execobjs[0].relocation_count = 0; - execobjs[0].relocs_ptr = 0; /* We only have num buffers actually, but the overflow will make * sure we blow up the kernel before we blow up userspace. */ execbuf.buffer_count = num; - /* Put a real batch at the end. */ - execobjs[num - 1].handle = batch_handle; - /* Make sure the basic thing would work first ... */ - errno = 0; - ioctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, &execbuf); - igt_assert(errno == 0); + gem_execbuf(fd, &execbuf); /* ... then be evil: Overflow of the pointer table (which has a * bit of lead datastructures, so no + 1 needed to overflow). */ execbuf.buffer_count = INT_MAX / sizeof(void *); - - errno = 0; - ioctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, &execbuf); - igt_assert(errno == EINVAL); + igt_assert_eq(__gem_execbuf(fd, &execbuf), -EINVAL); /* ... then be evil: Copying/allocating the array. */ - execbuf.buffer_count = UINT_MAX / sizeof(execobjs[0]) + 1; - - errno = 0; - ioctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, &execbuf); - igt_assert(errno == EINVAL); + execbuf.buffer_count = UINT_MAX / sizeof(obj[0]) + 1; + igt_assert_eq(__gem_execbuf(fd, &execbuf), -EINVAL); } } @@ -323,58 +367,67 @@ int devid = 0; igt_fixture { - int ring; - uint32_t batch_data [2] = { MI_NOOP, MI_BATCH_BUFFER_END }; + uint32_t bbe = MI_BATCH_BUFFER_END; + size_t reloc_size; fd = drm_open_driver(DRIVER_INTEL); - devid = intel_get_drm_devid(fd); /* Create giant reloc buffer area. */ num = 257; entries = ((1ULL << 32) / (num - 1)); reloc_size = entries * sizeof(struct drm_i915_gem_relocation_entry); - reloc = mmap(NULL, reloc_size, PROT_READ | PROT_WRITE, + igt_assert((reloc_size & 4095) == 0); + reloc = mmap(NULL, reloc_size + 2*4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0); igt_assert(reloc != MAP_FAILED); + igt_require_f(mlock(reloc, reloc_size) == 0, + "Tests require at least %'llu MiB of available memory\n", + (long long unsigned)reloc_size / (1024*1024)); + + /* disable access before + after */ + mprotect(reloc, 4096, 0); + reloc = (struct drm_i915_gem_relocation_entry *)((char *)reloc + 4096); + mprotect(reloc + entries, 4096, 0); /* Allocate the handles we'll need to wrap. */ - handles = calloc(num, sizeof(*handles)); - for (int i = 0; i < num; i++) - handles[i] = gem_create(fd, 4096); - - if (intel_gen(devid) >= 6) - ring = I915_EXEC_BLT; - else - ring = 0; + intel_require_memory(num+1, 4096, CHECK_RAM); + obj = calloc(num, sizeof(*obj)); + igt_assert(obj); + + /* First object is used for page crossing tests */ + obj[0].handle = gem_create(fd, 8192); + gem_write(fd, obj[0].handle, 0, &bbe, sizeof(bbe)); + for (int i = 1; i < num; i++) { + obj[i].handle = gem_create(fd, 4096); + gem_write(fd, obj[i].handle, 0, &bbe, sizeof(bbe)); + } /* Create relocation objects. */ - execobjs = calloc(num, sizeof(*execobjs)); - execbuf.buffers_ptr = (uintptr_t)execobjs; - 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, 0); - execbuf.rsvd2 = 0; - - batch_handle = gem_create(fd, 4096); - - gem_write(fd, batch_handle, 0, batch_data, sizeof(batch_data)); + memset(&execbuf, 0, sizeof(execbuf)); + execbuf.buffers_ptr = (uintptr_t)obj; + execbuf.buffer_count = 1; + execbuf.flags = I915_EXEC_HANDLE_LUT; + if (__gem_execbuf(fd, &execbuf)) + execbuf.flags = 0; + + for (int i = 0; i < entries; i++) { + reloc[i].target_handle = target_handle(); + reloc[i].offset = 1024; + reloc[i].read_domains = I915_GEM_DOMAIN_INSTRUCTION; + reloc[i].write_domain = 0; + } } - reloc_tests(); + reloc_tests(""); + igt_fixture + igt_disable_prefault(); + reloc_tests("-noprefault"); + igt_fixture + igt_enable_prefault(); source_offset_tests(devid, false); source_offset_tests(devid, true); buffer_count_tests(); - - igt_fixture { - gem_close(fd, batch_handle); - close(fd); - } } diff -Nru intel-gpu-tools-1.13/tests/gem_reloc_vs_gpu.c intel-gpu-tools-1.15/tests/gem_reloc_vs_gpu.c --- intel-gpu-tools-1.13/tests/gem_reloc_vs_gpu.c 2015-11-30 16:26:22.000000000 +0000 +++ intel-gpu-tools-1.15/tests/gem_reloc_vs_gpu.c 2016-05-23 10:51:28.000000000 +0000 @@ -318,18 +318,14 @@ igt_subtest("interruptible") do_test(fd, false, no_hang); - igt_subtest("interruptible-hang") { - igt_require_hang_ring(fd, I915_EXEC_BLT); + igt_subtest("interruptible-hang") do_test(fd, false, bcs_hang); - } igt_subtest("faulting-reloc-interruptible") do_test(fd, true, no_hang); - igt_subtest("faulting-reloc-interruptible-hang") { - igt_require_hang_ring(fd, I915_EXEC_BLT); + igt_subtest("faulting-reloc-interruptible-hang") do_test(fd, true, bcs_hang); - } igt_stop_signal_helper(); for (unsigned flags = 0; flags <= ALL_FLAGS; flags++) { diff -Nru intel-gpu-tools-1.13/tests/gem_render_tiled_blits.c intel-gpu-tools-1.15/tests/gem_render_tiled_blits.c --- intel-gpu-tools-1.13/tests/gem_render_tiled_blits.c 2015-11-30 16:26:22.000000000 +0000 +++ intel-gpu-tools-1.15/tests/gem_render_tiled_blits.c 2016-05-24 14:46:19.000000000 +0000 @@ -72,7 +72,7 @@ render_copy(batch, NULL, buf, 0, 0, WIDTH, HEIGHT, &tmp, 0, 0); if (snoop) { - do_or_die(dri_bo_map(linear, 0)); + do_or_die(drm_intel_bo_map(linear, 0)); ptr = linear->virtual; } else { do_or_die(drm_intel_bo_get_subdata(linear, 0, sizeof(data), data)); @@ -86,7 +86,7 @@ val++; } if (ptr != data) - dri_bo_unmap(linear); + drm_intel_bo_unmap(linear); } static void run_test (int fd, int count) diff -Nru intel-gpu-tools-1.13/tests/gem_reset_stats.c intel-gpu-tools-1.15/tests/gem_reset_stats.c --- intel-gpu-tools-1.13/tests/gem_reset_stats.c 2015-11-30 16:26:22.000000000 +0000 +++ intel-gpu-tools-1.15/tests/gem_reset_stats.c 2016-05-23 10:51:28.000000000 +0000 @@ -47,6 +47,7 @@ #define RS_BATCH_PENDING (1 << 1) #define RS_UNKNOWN (1 << 2) + static uint32_t devid; struct local_drm_i915_reset_stats { @@ -64,65 +65,76 @@ #define LOCAL_I915_EXEC_VEBOX (4 << 0) -struct target_ring; - -static bool gem_has_render(int fd) +static void sync_gpu(void) { - return true; + int fd = drm_open_driver(DRIVER_INTEL); + gem_quiescent_gpu(fd); + close(fd); } -static const struct target_ring { - uint32_t exec; - bool (*present)(int fd); - const char *name; -} rings[] = { - { I915_EXEC_RENDER, gem_has_render, "render" }, - { I915_EXEC_BLT, gem_has_blt, "blt" }, - { I915_EXEC_BSD, gem_has_bsd, "bsd" }, - { LOCAL_I915_EXEC_VEBOX, gem_has_vebox, "vebox" }, -}; - -static void check_context(const struct target_ring *ring) +static int noop(int fd, uint32_t ctx, const struct intel_execution_engine *e) { - int fd = drm_open_driver(DRIVER_INTEL); + const uint32_t bbe = MI_BATCH_BUFFER_END; + struct drm_i915_gem_execbuffer2 eb; + struct drm_i915_gem_exec_object2 exec; + int ret; - gem_context_destroy(fd, - gem_context_create(fd)); - close(fd); + memset(&exec, 0, sizeof(exec)); + exec.handle = gem_create(fd, 4096); + igt_assert((int)exec.handle > 0); + gem_write(fd, exec.handle, 0, &bbe, sizeof(bbe)); + + memset(&eb, 0, sizeof(eb)); + eb.buffers_ptr = (uintptr_t)&exec; + eb.buffer_count = 1; + eb.flags = e->exec_id | e->flags; + i915_execbuffer2_set_context_id(eb, ctx); + + ret = __gem_execbuf(fd, &eb); + if (ret < 0) { + gem_close(fd, exec.handle); + return ret; + } - igt_require(ring->exec == I915_EXEC_RENDER); + return exec.handle; } -#define NUM_RINGS (sizeof(rings)/sizeof(struct target_ring)) +static int has_engine(int fd, + uint32_t ctx, + const struct intel_execution_engine *e) +{ + int handle = noop(fd, ctx, e); + if (handle < 0) + return 0; + gem_close(fd, handle); + return 1; +} -static const struct target_ring *current_ring; +static void check_context(const struct intel_execution_engine *e) +{ + int fd = drm_open_driver(DRIVER_INTEL); + igt_require(has_engine(fd, gem_context_create(fd), e)); + close(fd); +} static int gem_reset_stats(int fd, int ctx_id, struct local_drm_i915_reset_stats *rs) { - int ret; - + memset(rs, 0, sizeof(*rs)); rs->ctx_id = ctx_id; - rs->flags = 0; - rs->reset_count = rand(); - rs->batch_active = rand(); - rs->batch_pending = rand(); - rs->pad = 0; - - do { - ret = ioctl(fd, GET_RESET_STATS_IOCTL, rs); - } while (ret == -1 && (errno == EINTR || errno == EAGAIN)); + rs->reset_count = -1; - if (ret < 0) + if (drmIoctl(fd, GET_RESET_STATS_IOCTL, rs)) return -errno; + igt_assert(rs->reset_count != -1); return 0; } static int gem_reset_status(int fd, int ctx_id) { - int ret; struct local_drm_i915_reset_stats rs; + int ret; ret = gem_reset_stats(fd, ctx_id, &rs); if (ret) @@ -136,191 +148,47 @@ return RS_NO_ERROR; } -static int gem_exec(int fd, struct drm_i915_gem_execbuffer2 *execbuf) +#define BAN HANG_ALLOW_BAN +#define ASYNC 2 +static void inject_hang(int fd, uint32_t ctx, + const struct intel_execution_engine *e, + unsigned flags) { - int ret; - - ret = ioctl(fd, - DRM_IOCTL_I915_GEM_EXECBUFFER2, - execbuf); + igt_hang_ring_t hang; - if (ret < 0) - return -errno; - - return 0; + hang = igt_hang_ctx(fd, ctx, e->exec_id | e->flags, flags & BAN, NULL); + if ((flags & ASYNC) == 0) + igt_post_hang_ring(fd, hang); } -static int exec_valid_ring(int fd, int ctx, int ring) +static const char *status_to_string(int x) { - struct drm_i915_gem_execbuffer2 execbuf; - struct drm_i915_gem_exec_object2 exec; - int ret; - - uint32_t buf[2] = { MI_BATCH_BUFFER_END, 0 }; - - exec.handle = gem_create(fd, 4096); - gem_write(fd, exec.handle, 0, buf, sizeof(buf)); - exec.relocation_count = 0; - exec.relocs_ptr = 0; - exec.alignment = 0; - exec.offset = 0; - exec.flags = 0; - exec.rsvd1 = 0; - exec.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 = ring; - i915_execbuffer2_set_context_id(execbuf, ctx); - execbuf.rsvd2 = 0; - - ret = gem_exec(fd, &execbuf); - if (ret < 0) - return ret; - - return exec.handle; + const char *strings[] = { + "No error", + "Guilty", + "Pending", + }; + if (x >= ARRAY_SIZE(strings)) + return "Unknown"; + return strings[x]; } -static int exec_valid(int fd, int ctx) -{ - return exec_valid_ring(fd, ctx, current_ring->exec); -} - -#define BUFSIZE (4 * 1024) -#define ITEMS (BUFSIZE >> 2) - -static int inject_hang_ring(int fd, int ctx, int ring, bool ignore_ban_error) -{ - struct drm_i915_gem_execbuffer2 execbuf; - struct drm_i915_gem_exec_object2 exec; - uint64_t gtt_off; - uint32_t *buf; - int roff, i; - unsigned cmd_len = 2; - enum stop_ring_flags flags; - - srandom(time(NULL)); - - if (intel_gen(devid) >= 8) - cmd_len = 3; - - buf = malloc(BUFSIZE); - igt_assert(buf != NULL); - - buf[0] = MI_BATCH_BUFFER_END; - buf[1] = MI_NOOP; - - exec.handle = gem_create(fd, BUFSIZE); - gem_write(fd, exec.handle, 0, buf, BUFSIZE); - exec.relocation_count = 0; - exec.relocs_ptr = 0; - exec.alignment = 0; - exec.offset = 0; - exec.flags = 0; - exec.rsvd1 = 0; - exec.rsvd2 = 0; - - execbuf.buffers_ptr = (uintptr_t)&exec; - execbuf.buffer_count = 1; - execbuf.batch_start_offset = 0; - execbuf.batch_len = BUFSIZE; - execbuf.cliprects_ptr = 0; - execbuf.num_cliprects = 0; - execbuf.DR1 = 0; - execbuf.DR4 = 0; - execbuf.flags = ring; - i915_execbuffer2_set_context_id(execbuf, ctx); - execbuf.rsvd2 = 0; - - igt_assert_eq(gem_exec(fd, &execbuf), 0); - - gtt_off = exec.offset; - - for (i = 0; i < ITEMS; i++) - buf[i] = MI_NOOP; - - roff = random() % (ITEMS - cmd_len - 1); - buf[roff] = MI_BATCH_BUFFER_START | (cmd_len - 2); - buf[roff + 1] = (gtt_off & 0xfffffffc) + (roff << 2); - if (cmd_len == 3) - buf[roff + 2] = (gtt_off & 0xffffffff00000000ull) >> 32; - - buf[roff + cmd_len] = MI_BATCH_BUFFER_END; - - igt_debug("loop injected at 0x%lx (off 0x%x, bo_start 0x%lx, bo_end 0x%lx)\n", - (long unsigned int)((roff << 2) + gtt_off), - roff << 2, (long unsigned int)gtt_off, - (long unsigned int)(gtt_off + BUFSIZE - 1)); - gem_write(fd, exec.handle, 0, buf, BUFSIZE); - - exec.relocation_count = 0; - exec.relocs_ptr = 0; - exec.alignment = 0; - exec.offset = 0; - exec.flags = 0; - exec.rsvd1 = 0; - exec.rsvd2 = 0; - - execbuf.buffers_ptr = (uintptr_t)&exec; - execbuf.buffer_count = 1; - execbuf.batch_start_offset = 0; - execbuf.batch_len = BUFSIZE; - execbuf.cliprects_ptr = 0; - execbuf.num_cliprects = 0; - execbuf.DR1 = 0; - execbuf.DR4 = 0; - execbuf.flags = ring; - i915_execbuffer2_set_context_id(execbuf, ctx); - execbuf.rsvd2 = 0; - - igt_assert_eq(gem_exec(fd, &execbuf), 0); - - igt_assert(gtt_off == exec.offset); - - free(buf); - - flags = igt_to_stop_ring_flag(ring); - - flags |= STOP_RING_ALLOW_BAN; - - if (!ignore_ban_error) - flags |= STOP_RING_ALLOW_ERRORS; - - igt_set_stop_rings(flags); - - return exec.handle; -} - -static int inject_hang(int fd, int ctx) -{ - return inject_hang_ring(fd, ctx, current_ring->exec, false); -} - -static int inject_hang_no_ban_error(int fd, int ctx) -{ - return inject_hang_ring(fd, ctx, current_ring->exec, true); -} - -static int _assert_reset_status(int fd, int ctx, int status) +static int _assert_reset_status(int idx, int fd, int ctx, int status) { int rs; rs = gem_reset_status(fd, ctx); if (rs < 0) { igt_info("reset status for %d ctx %d returned %d\n", - fd, ctx, rs); + idx, ctx, rs); return rs; } if (rs != status) { - igt_info("%d:%d reset status %d differs from assumed %d\n", - fd, ctx, rs, status); + igt_info("%d:%d expected '%s' [%d], found '%s' [%d]\n", + idx, ctx, + status_to_string(status), status, + status_to_string(rs), rs); return 1; } @@ -328,62 +196,59 @@ return 0; } -#define assert_reset_status(fd, ctx, status) \ - igt_assert(_assert_reset_status(fd, ctx, status) == 0) +#define assert_reset_status(idx, fd, ctx, status) \ + igt_assert(_assert_reset_status(idx, fd, ctx, status) == 0) -static void test_rs(int num_fds, int hang_index, int rs_assumed_no_hang) +static void test_rs(const struct intel_execution_engine *e, + int num_fds, int hang_index, int rs_assumed_no_hang) { - int i; int fd[MAX_FD]; - int h[MAX_FD]; + int i; igt_assert_lte(num_fds, MAX_FD); igt_assert_lt(hang_index, MAX_FD); + igt_debug("num fds=%d, hang index=%d\n", num_fds, hang_index); + for (i = 0; i < num_fds; i++) { fd[i] = drm_open_driver(DRIVER_INTEL); - igt_assert(fd[i]); + assert_reset_status(i, fd[i], 0, RS_NO_ERROR); } - for (i = 0; i < num_fds; i++) - assert_reset_status(fd[i], 0, RS_NO_ERROR); - + sync_gpu(); for (i = 0; i < num_fds; i++) { if (i == hang_index) - h[i] = inject_hang(fd[i], 0); + inject_hang(fd[i], 0, e, ASYNC); else - h[i] = exec_valid(fd[i], 0); + igt_assert(noop(fd[i], 0, e) > 0); } - - gem_sync(fd[num_fds - 1], h[num_fds - 1]); + sync_gpu(); for (i = 0; i < num_fds; i++) { if (hang_index < 0) { - assert_reset_status(fd[i], 0, rs_assumed_no_hang); + assert_reset_status(i, fd[i], 0, rs_assumed_no_hang); continue; } if (i < hang_index) - assert_reset_status(fd[i], 0, RS_NO_ERROR); + assert_reset_status(i, fd[i], 0, RS_NO_ERROR); if (i == hang_index) - assert_reset_status(fd[i], 0, RS_BATCH_ACTIVE); + assert_reset_status(i, fd[i], 0, RS_BATCH_ACTIVE); if (i > hang_index) - assert_reset_status(fd[i], 0, RS_BATCH_PENDING); + assert_reset_status(i, fd[i], 0, RS_BATCH_PENDING); } - for (i = 0; i < num_fds; i++) { - gem_close(fd[i], h[i]); + for (i = 0; i < num_fds; i++) close(fd[i]); - } } #define MAX_CTX 100 -static void test_rs_ctx(int num_fds, int num_ctx, int hang_index, +static void test_rs_ctx(const struct intel_execution_engine *e, + int num_fds, int num_ctx, int hang_index, int hang_context) { int i, j; int fd[MAX_FD]; - int h[MAX_FD][MAX_CTX]; int ctx[MAX_FD][MAX_CTX]; igt_assert_lte(num_fds, MAX_FD); @@ -392,287 +257,210 @@ igt_assert_lte(num_ctx, MAX_CTX); igt_assert_lt(hang_context, MAX_CTX); - test_rs(num_fds, -1, RS_NO_ERROR); + test_rs(e, num_fds, -1, RS_NO_ERROR); for (i = 0; i < num_fds; i++) { fd[i] = drm_open_driver(DRIVER_INTEL); igt_assert(fd[i]); - assert_reset_status(fd[i], 0, RS_NO_ERROR); + assert_reset_status(i, fd[i], 0, RS_NO_ERROR); for (j = 0; j < num_ctx; j++) { ctx[i][j] = gem_context_create(fd[i]); - } - assert_reset_status(fd[i], 0, RS_NO_ERROR); + assert_reset_status(i, fd[i], 0, RS_NO_ERROR); } for (i = 0; i < num_fds; i++) { - - assert_reset_status(fd[i], 0, RS_NO_ERROR); + assert_reset_status(i, fd[i], 0, RS_NO_ERROR); for (j = 0; j < num_ctx; j++) - assert_reset_status(fd[i], ctx[i][j], RS_NO_ERROR); + assert_reset_status(i, fd[i], ctx[i][j], RS_NO_ERROR); - assert_reset_status(fd[i], 0, RS_NO_ERROR); + assert_reset_status(i, fd[i], 0, RS_NO_ERROR); } for (i = 0; i < num_fds; i++) { for (j = 0; j < num_ctx; j++) { if (i == hang_index && j == hang_context) - h[i][j] = inject_hang(fd[i], ctx[i][j]); + inject_hang(fd[i], ctx[i][j], e, ASYNC); else - h[i][j] = exec_valid(fd[i], ctx[i][j]); + igt_assert(noop(fd[i], ctx[i][j], e) > 0); } } - - gem_sync(fd[num_fds - 1], ctx[num_fds - 1][num_ctx - 1]); + sync_gpu(); for (i = 0; i < num_fds; i++) - assert_reset_status(fd[i], 0, RS_NO_ERROR); + assert_reset_status(i, fd[i], 0, RS_NO_ERROR); for (i = 0; i < num_fds; i++) { for (j = 0; j < num_ctx; j++) { if (i < hang_index) - assert_reset_status(fd[i], ctx[i][j], RS_NO_ERROR); + assert_reset_status(i, fd[i], ctx[i][j], RS_NO_ERROR); if (i == hang_index && j < hang_context) - assert_reset_status(fd[i], ctx[i][j], RS_NO_ERROR); + assert_reset_status(i, fd[i], ctx[i][j], RS_NO_ERROR); if (i == hang_index && j == hang_context) - assert_reset_status(fd[i], ctx[i][j], + assert_reset_status(i, fd[i], ctx[i][j], RS_BATCH_ACTIVE); if (i == hang_index && j > hang_context) - assert_reset_status(fd[i], ctx[i][j], + assert_reset_status(i, fd[i], ctx[i][j], RS_BATCH_PENDING); if (i > hang_index) - assert_reset_status(fd[i], ctx[i][j], + assert_reset_status(i, fd[i], ctx[i][j], RS_BATCH_PENDING); } } for (i = 0; i < num_fds; i++) { - for (j = 0; j < num_ctx; j++) { - gem_close(fd[i], h[i][j]); - gem_context_destroy(fd[i], ctx[i][j]); - } - - assert_reset_status(fd[i], 0, RS_NO_ERROR); - + assert_reset_status(i, fd[i], 0, RS_NO_ERROR); close(fd[i]); } } -static void test_ban(void) +static void test_ban(const struct intel_execution_engine *e) { - int h1,h2,h3,h4,h5,h6,h7; + struct local_drm_i915_reset_stats rs_bad, rs_good; int fd_bad, fd_good; - int retry = 10; + int ban, retry = 10; int active_count = 0, pending_count = 0; - struct local_drm_i915_reset_stats rs_bad, rs_good; fd_bad = drm_open_driver(DRIVER_INTEL); - fd_good = drm_open_driver(DRIVER_INTEL); - assert_reset_status(fd_bad, 0, RS_NO_ERROR); - assert_reset_status(fd_good, 0, RS_NO_ERROR); + assert_reset_status(fd_bad, fd_bad, 0, RS_NO_ERROR); + assert_reset_status(fd_good, fd_good, 0, RS_NO_ERROR); - h1 = exec_valid(fd_bad, 0); - igt_assert_lte(0, h1); - h5 = exec_valid(fd_good, 0); - igt_assert_lte(0, h5); + noop(fd_bad, 0, e); + noop(fd_good, 0, e); - assert_reset_status(fd_bad, 0, RS_NO_ERROR); - assert_reset_status(fd_good, 0, RS_NO_ERROR); + assert_reset_status(fd_bad, fd_bad, 0, RS_NO_ERROR); + assert_reset_status(fd_good, fd_good, 0, RS_NO_ERROR); - h2 = inject_hang_no_ban_error(fd_bad, 0); - igt_assert_lte(0, h2); + inject_hang(fd_bad, 0, e, BAN | ASYNC); active_count++; - /* Second hang will be pending for this */ - pending_count++; - h6 = exec_valid(fd_good, 0); - h7 = exec_valid(fd_good, 0); + noop(fd_good, 0, e); + noop(fd_good, 0, e); - while (retry--) { - h3 = inject_hang_no_ban_error(fd_bad, 0); - igt_assert_lte(0, h3); - gem_sync(fd_bad, h3); + /* The second hang will count as pending and be discarded */ + active_count--; + pending_count += 1; /* inject hang does 1 real exec + 1 dummy */ + while (retry--) { + inject_hang(fd_bad, 0, e, BAN); active_count++; - /* This second hand will count as pending */ - assert_reset_status(fd_bad, 0, RS_BATCH_ACTIVE); - h4 = exec_valid(fd_bad, 0); - if (h4 == -EIO) { - gem_close(fd_bad, h3); - break; - } - - /* Should not happen often but sometimes hang is declared too slow - * due to our way of faking hang using loop */ - - igt_assert_lte(0, h4); - gem_close(fd_bad, h3); - gem_close(fd_bad, h4); - - igt_info("retrying for ban (%d)\n", retry); - } + ban = noop(fd_bad, 0, e); + if (ban == -EIO) + break; - igt_assert_eq(h4, -EIO); - assert_reset_status(fd_bad, 0, RS_BATCH_ACTIVE); + /* Should not happen often but sometimes hang is declared too + * slow due to our way of faking hang using loop */ + gem_close(fd_bad, ban); - gem_sync(fd_good, h7); - assert_reset_status(fd_good, 0, RS_BATCH_PENDING); + igt_info("retrying for ban (%d)\n", retry); + } + igt_assert_eq(ban, -EIO); + igt_assert_lt(0, noop(fd_good, 0, e)); - igt_assert_eq(gem_reset_stats(fd_good, 0, &rs_good), 0); + assert_reset_status(fd_bad, fd_bad, 0, RS_BATCH_ACTIVE); igt_assert_eq(gem_reset_stats(fd_bad, 0, &rs_bad), 0); + igt_assert_eq(rs_bad.batch_active, active_count); + igt_assert_eq(rs_bad.batch_pending, pending_count); - igt_assert(rs_bad.batch_active == active_count); - igt_assert(rs_bad.batch_pending == pending_count); - igt_assert(rs_good.batch_active == 0); - igt_assert(rs_good.batch_pending == 2); - - gem_close(fd_bad, h1); - gem_close(fd_bad, h2); - gem_close(fd_good, h6); - gem_close(fd_good, h7); - - h1 = exec_valid(fd_good, 0); - igt_assert_lte(0, h1); - gem_close(fd_good, h1); + assert_reset_status(fd_good, fd_good, 0, RS_BATCH_PENDING); + igt_assert_eq(gem_reset_stats(fd_good, 0, &rs_good), 0); + igt_assert_eq(rs_good.batch_active, 0); + igt_assert_eq(rs_good.batch_pending, 2); close(fd_bad); close(fd_good); - - igt_assert_lt(gem_reset_status(fd_bad, 0), 0); - igt_assert_lt(gem_reset_status(fd_good, 0), 0); } -static void test_ban_ctx(void) +static void test_ban_ctx(const struct intel_execution_engine *e) { - int h1,h2,h3,h4,h5,h6,h7; - int ctx_good, ctx_bad; - int fd; - int retry = 10; - int active_count = 0, pending_count = 0; struct local_drm_i915_reset_stats rs_bad, rs_good; + int fd, ban, retry = 10; + uint32_t ctx_good, ctx_bad; + int active_count = 0, pending_count = 0; fd = drm_open_driver(DRIVER_INTEL); - assert_reset_status(fd, 0, RS_NO_ERROR); + assert_reset_status(fd, fd, 0, RS_NO_ERROR); ctx_good = gem_context_create(fd); ctx_bad = gem_context_create(fd); - assert_reset_status(fd, 0, RS_NO_ERROR); - assert_reset_status(fd, ctx_good, RS_NO_ERROR); - assert_reset_status(fd, ctx_bad, RS_NO_ERROR); - - h1 = exec_valid(fd, ctx_bad); - igt_assert_lte(0, h1); - h5 = exec_valid(fd, ctx_good); - igt_assert_lte(0, h5); + assert_reset_status(fd, fd, 0, RS_NO_ERROR); + assert_reset_status(fd, fd, ctx_good, RS_NO_ERROR); + assert_reset_status(fd, fd, ctx_bad, RS_NO_ERROR); + + noop(fd, ctx_bad, e); + noop(fd, ctx_good, e); - assert_reset_status(fd, ctx_good, RS_NO_ERROR); - assert_reset_status(fd, ctx_bad, RS_NO_ERROR); + assert_reset_status(fd, fd, ctx_good, RS_NO_ERROR); + assert_reset_status(fd, fd, ctx_bad, RS_NO_ERROR); - h2 = inject_hang_no_ban_error(fd, ctx_bad); - igt_assert_lte(0, h2); + inject_hang(fd, ctx_bad, e, BAN | ASYNC); active_count++; - /* Second hang will be pending for this */ - pending_count++; - h6 = exec_valid(fd, ctx_good); - h7 = exec_valid(fd, ctx_good); + noop(fd, ctx_good, e); + noop(fd, ctx_good, e); - while (retry--) { - h3 = inject_hang_no_ban_error(fd, ctx_bad); - igt_assert_lte(0, h3); - gem_sync(fd, h3); + /* This second hang will count as pending and be discarded */ + active_count--; + pending_count++; + while (retry--) { + inject_hang(fd, ctx_bad, e, BAN); active_count++; - /* This second hand will count as pending */ - assert_reset_status(fd, ctx_bad, RS_BATCH_ACTIVE); - - h4 = exec_valid(fd, ctx_bad); - if (h4 == -EIO) { - gem_close(fd, h3); - break; - } - - /* Should not happen often but sometimes hang is declared too slow - * due to our way of faking hang using loop */ - - igt_assert_lte(0, h4); - gem_close(fd, h3); - gem_close(fd, h4); - igt_info("retrying for ban (%d)\n", retry); - } + ban = noop(fd, ctx_bad, e); + if (ban == -EIO) + break; - igt_assert_eq(h4, -EIO); - assert_reset_status(fd, ctx_bad, RS_BATCH_ACTIVE); + /* Should not happen often but sometimes hang is declared too + * slow due to our way of faking hang using loop */ + gem_close(fd, ban); - gem_sync(fd, h7); - assert_reset_status(fd, ctx_good, RS_BATCH_PENDING); + igt_info("retrying for ban (%d)\n", retry); + } + igt_assert_eq(ban, -EIO); + igt_assert_lt(0, noop(fd, ctx_good, e)); - igt_assert_eq(gem_reset_stats(fd, ctx_good, &rs_good), 0); + assert_reset_status(fd, fd, ctx_bad, RS_BATCH_ACTIVE); igt_assert_eq(gem_reset_stats(fd, ctx_bad, &rs_bad), 0); + igt_assert_eq(rs_bad.batch_active, active_count); + igt_assert_eq(rs_bad.batch_pending, pending_count); - igt_assert(rs_bad.batch_active == active_count); - igt_assert(rs_bad.batch_pending == pending_count); - igt_assert(rs_good.batch_active == 0); - igt_assert(rs_good.batch_pending == 2); - - gem_close(fd, h1); - gem_close(fd, h2); - gem_close(fd, h6); - gem_close(fd, h7); - - h1 = exec_valid(fd, ctx_good); - igt_assert_lte(0, h1); - gem_close(fd, h1); - - gem_context_destroy(fd, ctx_good); - gem_context_destroy(fd, ctx_bad); - igt_assert_lt(gem_reset_status(fd, ctx_good), 0); - igt_assert_lt(gem_reset_status(fd, ctx_bad), 0); - igt_assert_lt(exec_valid(fd, ctx_good), 0); - igt_assert_lt(exec_valid(fd, ctx_bad), 0); + assert_reset_status(fd, fd, ctx_good, RS_BATCH_PENDING); + igt_assert_eq(gem_reset_stats(fd, ctx_good, &rs_good), 0); + igt_assert_eq(rs_good.batch_active, 0); + igt_assert_eq(rs_good.batch_pending, 2); close(fd); } -static void test_unrelated_ctx(void) +static void test_unrelated_ctx(const struct intel_execution_engine *e) { - int h1,h2; int fd1,fd2; int ctx_guilty, ctx_unrelated; fd1 = drm_open_driver(DRIVER_INTEL); fd2 = drm_open_driver(DRIVER_INTEL); - assert_reset_status(fd1, 0, RS_NO_ERROR); - assert_reset_status(fd2, 0, RS_NO_ERROR); + assert_reset_status(0, fd1, 0, RS_NO_ERROR); + assert_reset_status(1, fd2, 0, RS_NO_ERROR); ctx_guilty = gem_context_create(fd1); ctx_unrelated = gem_context_create(fd2); - assert_reset_status(fd1, ctx_guilty, RS_NO_ERROR); - assert_reset_status(fd2, ctx_unrelated, RS_NO_ERROR); - - h1 = inject_hang(fd1, ctx_guilty); - igt_assert_lte(0, h1); - gem_sync(fd1, h1); - assert_reset_status(fd1, ctx_guilty, RS_BATCH_ACTIVE); - assert_reset_status(fd2, ctx_unrelated, RS_NO_ERROR); - - h2 = exec_valid(fd2, ctx_unrelated); - igt_assert_lte(0, h2); - gem_sync(fd2, h2); - assert_reset_status(fd1, ctx_guilty, RS_BATCH_ACTIVE); - assert_reset_status(fd2, ctx_unrelated, RS_NO_ERROR); - gem_close(fd1, h1); - gem_close(fd2, h2); + assert_reset_status(0, fd1, ctx_guilty, RS_NO_ERROR); + assert_reset_status(1, fd2, ctx_unrelated, RS_NO_ERROR); - gem_context_destroy(fd1, ctx_guilty); - gem_context_destroy(fd2, ctx_unrelated); + inject_hang(fd1, ctx_guilty, e, 0); + assert_reset_status(0, fd1, ctx_guilty, RS_BATCH_ACTIVE); + assert_reset_status(1, fd2, ctx_unrelated, RS_NO_ERROR); + + gem_sync(fd2, noop(fd2, ctx_unrelated, e)); + assert_reset_status(0, fd1, ctx_guilty, RS_BATCH_ACTIVE); + assert_reset_status(1, fd2, ctx_unrelated, RS_NO_ERROR); close(fd1); close(fd2); @@ -690,98 +478,73 @@ return rs.reset_count; } -static void test_close_pending_ctx(void) +static void test_close_pending_ctx(const struct intel_execution_engine *e) { - int fd, h; - uint32_t ctx; - - fd = drm_open_driver(DRIVER_INTEL); - ctx = gem_context_create(fd); + int fd = drm_open_driver(DRIVER_INTEL); + uint32_t ctx = gem_context_create(fd); - assert_reset_status(fd, ctx, RS_NO_ERROR); + assert_reset_status(fd, fd, ctx, RS_NO_ERROR); - h = inject_hang(fd, ctx); - igt_assert_lte(0, h); + inject_hang(fd, ctx, e, 0); gem_context_destroy(fd, ctx); - igt_assert(__gem_context_destroy(fd, ctx) == -ENOENT); + igt_assert_eq(__gem_context_destroy(fd, ctx), -ENOENT); - gem_close(fd, h); close(fd); } -static void test_close_pending(void) +static void test_close_pending(const struct intel_execution_engine *e) { - int fd, h; - - fd = drm_open_driver(DRIVER_INTEL); - - assert_reset_status(fd, 0, RS_NO_ERROR); + int fd = drm_open_driver(DRIVER_INTEL); - h = inject_hang(fd, 0); - igt_assert_lte(0, h); + assert_reset_status(fd, fd, 0, RS_NO_ERROR); - gem_close(fd, h); + inject_hang(fd, 0, e, 0); close(fd); } -static void exec_noop_on_each_ring(int fd, const bool reverse) +static void noop_on_each_ring(int fd, const bool reverse) { - uint32_t batch[2] = {MI_BATCH_BUFFER_END, 0}; - uint32_t handle; - struct drm_i915_gem_execbuffer2 execbuf; - struct drm_i915_gem_exec_object2 exec[1]; - - handle = gem_create(fd, 4096); - gem_write(fd, handle, 0, batch, sizeof(batch)); - - exec[0].handle = handle; - 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 = 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; - - for (unsigned i = 0; i < NUM_RINGS; i++) { - const struct target_ring *ring; - - ring = reverse ? &rings[NUM_RINGS - 1 - i] : &rings[i]; - - if (ring->present(fd)) { - execbuf.flags = ring->exec; - do_ioctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, &execbuf); + const uint32_t bbe = MI_BATCH_BUFFER_END; + struct drm_i915_gem_execbuffer2 eb; + struct drm_i915_gem_exec_object2 obj; + const struct intel_execution_engine *e; + + memset(&obj, 0, sizeof(obj)); + obj.handle = gem_create(fd, 4096); + gem_write(fd, obj.handle, 0, &bbe, sizeof(bbe)); + + memset(&eb, 0, sizeof(eb)); + eb.buffers_ptr = (uintptr_t)&obj; + eb.buffer_count = 1; + + if (reverse) { + for (e = intel_execution_engines; e->name; e++) + ; + while (--e >= intel_execution_engines) { + eb.flags = e->exec_id | e->flags; + __gem_execbuf(fd, &eb); + } + } else { + for (e = intel_execution_engines; e->name; e++) { + eb.flags = e->exec_id | e->flags; + __gem_execbuf(fd, &eb); } } - gem_sync(fd, handle); - gem_close(fd, handle); + gem_sync(fd, obj.handle); + gem_close(fd, obj.handle); } -static void test_close_pending_fork(const bool reverse) +static void test_close_pending_fork(const struct intel_execution_engine *e, + const bool reverse) { + int fd = drm_open_driver(DRIVER_INTEL); + igt_hang_ring_t hang; int pid; - int fd, h; - - fd = drm_open_driver(DRIVER_INTEL); - assert_reset_status(fd, 0, RS_NO_ERROR); - - h = inject_hang(fd, 0); - igt_assert_lte(0, h); + assert_reset_status(fd, fd, 0, RS_NO_ERROR); + hang = igt_hang_ctx(fd, 0, e->exec_id | e->flags, 0, NULL); sleep(1); /* Avoid helpers as we need to kill the child @@ -797,10 +560,10 @@ * on each ring. This exercises batch_obj reference counting, * when gpu is reset and ring lists are cleared. */ - exec_noop_on_each_ring(fd2, reverse); - + noop_on_each_ring(fd2, reverse); close(fd2); - return; + pause(); + exit(0); } else { igt_assert_lt(0, pid); sleep(1); @@ -810,41 +573,30 @@ kill(pid, SIGKILL); } - gem_close(fd, h); - close(fd); - - /* Then we just wait on hang to happen */ - fd = drm_open_driver(DRIVER_INTEL); - - h = exec_valid(fd, 0); - igt_assert_lte(0, h); - - gem_sync(fd, h); - gem_close(fd, h); + igt_post_hang_ring(fd, hang); close(fd); } -static void test_reset_count(const bool create_ctx) +static void test_reset_count(const struct intel_execution_engine *e, + const bool create_ctx) { - int fd, h, ctx; + int fd = drm_open_driver(DRIVER_INTEL); + int ctx; long c1, c2; - fd = drm_open_driver(DRIVER_INTEL); if (create_ctx) ctx = gem_context_create(fd); else ctx = 0; - assert_reset_status(fd, ctx, RS_NO_ERROR); + assert_reset_status(fd, fd, ctx, RS_NO_ERROR); c1 = get_reset_count(fd, ctx); igt_assert(c1 >= 0); - h = inject_hang(fd, ctx); - igt_assert_lte(0, h); - gem_sync(fd, h); + inject_hang(fd, ctx, e, 0); - assert_reset_status(fd, ctx, RS_BATCH_ACTIVE); + assert_reset_status(fd, fd, ctx, RS_BATCH_ACTIVE); c2 = get_reset_count(fd, ctx); igt_assert(c2 >= 0); igt_assert(c2 == (c1 + 1)); @@ -862,8 +614,6 @@ igt_waitchildren(); - gem_close(fd, h); - if (create_ctx) gem_context_destroy(fd, ctx); @@ -873,8 +623,8 @@ static int _test_params(int fd, int ctx, uint32_t flags, uint32_t pad) { struct local_drm_i915_reset_stats rs; - int ret; + memset(&rs, 0, sizeof(rs)); rs.ctx_id = ctx; rs.flags = flags; rs.reset_count = rand(); @@ -882,11 +632,7 @@ rs.batch_pending = rand(); rs.pad = pad; - do { - ret = ioctl(fd, GET_RESET_STATS_IOCTL, &rs); - } while (ret == -1 && (errno == EINTR || errno == EAGAIN)); - - if (ret < 0) + if (drmIoctl(fd, GET_RESET_STATS_IOCTL, &rs)) return -errno; return 0; @@ -937,13 +683,10 @@ static void test_params_ctx(void) { - int fd, ctx; + int fd; fd = drm_open_driver(DRIVER_INTEL); - ctx = gem_context_create(fd); - - _test_param(fd, ctx); - + _test_param(fd, gem_context_create(fd)); close(fd); } @@ -952,36 +695,41 @@ int fd; fd = drm_open_driver(DRIVER_INTEL); - _test_param(fd, 0); - close(fd); +} +static const struct intel_execution_engine * +next_engine(int fd, const struct intel_execution_engine *e) +{ + do { + e++; + if (e->name == NULL) + e = intel_execution_engines; + if (e->exec_id == 0) + e++; + } while (!has_engine(fd, 0, e)); + + return e; } -static void defer_hangcheck(int ring_num) +static void defer_hangcheck(const struct intel_execution_engine *engine) { + const struct intel_execution_engine *next; int fd, count_start, count_end; int seconds = 30; - const struct target_ring *next_ring; - fd = drm_open_driver(DRIVER_INTEL); - - do { - next_ring = &rings[(++ring_num) % NUM_RINGS]; - if (next_ring->present(fd)) - break; - - } while(next_ring != current_ring); + fd = drm_open_driver(DRIVER_INTEL); - igt_skip_on(next_ring == current_ring); + next = next_engine(fd, engine); + igt_skip_on(next == engine); count_start = get_reset_count(fd, 0); igt_assert_lte(0, count_start); - igt_assert(inject_hang_ring(fd, 0, current_ring->exec, true)); + inject_hang(fd, 0, engine, 0); while (--seconds) { - igt_assert(exec_valid_ring(fd, 0, next_ring->exec)); + noop(fd, 0, next); count_end = get_reset_count(fd, 0); igt_assert_lte(0, count_end); @@ -1019,41 +767,12 @@ return false; } -static void check_gpu_ok(void) -{ - int retry_count = 30; - enum stop_ring_flags flags; - int fd; - - igt_debug("checking gpu state\n"); - - while (retry_count--) { - flags = igt_get_stop_rings() & STOP_RING_ALL; - if (flags == 0) - break; - - igt_debug("waiting previous hang to clear\n"); - sleep(1); - } - - igt_assert(flags == 0); - - /* - * Clear the _ALLOW_ERRORS and _ALLOW_BAN flags; - * these are not cleared by individual ring reset. - */ - igt_set_stop_rings(0); - - fd = drm_open_driver(DRIVER_INTEL); - gem_quiescent_gpu(fd); - close(fd); -} - -#define RUN_TEST(...) do { check_gpu_ok(); __VA_ARGS__; check_gpu_ok(); } while (0) -#define RUN_CTX_TEST(...) do { check_context(current_ring); RUN_TEST(__VA_ARGS__); } while (0) +#define RUN_TEST(...) do { sync_gpu(); __VA_ARGS__; sync_gpu(); } while (0) +#define RUN_CTX_TEST(...) do { check_context(e); RUN_TEST(__VA_ARGS__); } while (0) igt_main { + const struct intel_execution_engine *e; igt_skip_on_simulation(); igt_fixture { @@ -1074,60 +793,44 @@ igt_subtest("params") test_params(); - for (int i = 0; i < NUM_RINGS; i++) { - const char *name; - - current_ring = &rings[i]; - name = current_ring->name; - - igt_fixture { - int fd = drm_open_driver(DRIVER_INTEL); - gem_require_ring(fd, current_ring->exec); - close(fd); - } - - igt_fixture - igt_require_f(intel_gen(devid) >= 4, - "gen %d doesn't support reset\n", intel_gen(devid)); - - igt_subtest_f("params-ctx-%s", name) - RUN_CTX_TEST(test_params_ctx()); - - igt_subtest_f("reset-stats-%s", name) - RUN_TEST(test_rs(4, 1, 0)); + igt_subtest_f("params-ctx") + RUN_TEST(test_params_ctx()); - igt_subtest_f("reset-stats-ctx-%s", name) - RUN_CTX_TEST(test_rs_ctx(4, 4, 1, 2)); + for (e = intel_execution_engines; e->name; e++) { + igt_subtest_f("reset-stats-%s", e->name) + RUN_TEST(test_rs(e, 4, 1, 0)); - igt_subtest_f("ban-%s", name) - RUN_TEST(test_ban()); + igt_subtest_f("reset-stats-ctx-%s", e->name) + RUN_CTX_TEST(test_rs_ctx(e, 4, 4, 1, 2)); - igt_subtest_f("ban-ctx-%s", name) - RUN_CTX_TEST(test_ban_ctx()); + igt_subtest_f("ban-%s", e->name) + RUN_TEST(test_ban(e)); - igt_subtest_f("reset-count-%s", name) - RUN_TEST(test_reset_count(false)); + igt_subtest_f("ban-ctx-%s", e->name) + RUN_CTX_TEST(test_ban_ctx(e)); - igt_subtest_f("reset-count-ctx-%s", name) - RUN_CTX_TEST(test_reset_count(true)); + igt_subtest_f("reset-count-%s", e->name) + RUN_TEST(test_reset_count(e, false)); - igt_subtest_f("unrelated-ctx-%s", name) - RUN_CTX_TEST(test_unrelated_ctx()); + igt_subtest_f("reset-count-ctx-%s", e->name) + RUN_CTX_TEST(test_reset_count(e, true)); - igt_subtest_f("close-pending-%s", name) - RUN_TEST(test_close_pending()); + igt_subtest_f("unrelated-ctx-%s", e->name) + RUN_CTX_TEST(test_unrelated_ctx(e)); - igt_subtest_f("close-pending-ctx-%s", name) - RUN_CTX_TEST(test_close_pending_ctx()); + igt_subtest_f("close-pending-%s", e->name) + RUN_TEST(test_close_pending(e)); - igt_subtest_f("close-pending-fork-%s", name) - RUN_TEST(test_close_pending_fork(false)); + igt_subtest_f("close-pending-ctx-%s", e->name) + RUN_CTX_TEST(test_close_pending_ctx(e)); - igt_subtest_f("close-pending-fork-reverse-%s", name) - RUN_TEST(test_close_pending_fork(true)); + igt_subtest_f("close-pending-fork-%s", e->name) + RUN_TEST(test_close_pending_fork(e, false)); - igt_subtest_f("defer-hangcheck-%s", name) - RUN_TEST(defer_hangcheck(i)); + igt_subtest_f("close-pending-fork-reverse-%s", e->name) + RUN_TEST(test_close_pending_fork(e, true)); + igt_subtest_f("defer-hangcheck-%s", e->name) + RUN_TEST(defer_hangcheck(e)); } } diff -Nru intel-gpu-tools-1.13/tests/gem_ringfill.c intel-gpu-tools-1.15/tests/gem_ringfill.c --- intel-gpu-tools-1.13/tests/gem_ringfill.c 2015-11-30 16:26:22.000000000 +0000 +++ intel-gpu-tools-1.15/tests/gem_ringfill.c 2016-05-23 10:51:28.000000000 +0000 @@ -32,109 +32,33 @@ */ #include "igt.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - - -struct bo { - const char *ring; - drm_intel_bo *src, *dst, *tmp; -}; - -static const int width = 512, height = 512; -int fd; - -static void create_bo(drm_intel_bufmgr *bufmgr, - struct bo *b, - const char *ring) -{ - int size = 4 * width * height, i; - uint32_t *map; +#include "igt_gt.h" - 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); -} +#define INTERRUPTIBLE 0x1 +#define HANG 0x2 +#define CHILD 0x8 +#define FORKED 0x8 +#define BOMB 0x10 +#define SUSPEND 0x20 +#define HIBERNATE 0x40 -static int check_bo(struct bo *b) +static void check_bo(int fd, uint32_t handle) { - const uint32_t *map; - int i, fails = 0; - - igt_debug("verifying\n"); - - do_or_die(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; - - igt_info("%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; -} + uint32_t *map; + int i; -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); + igt_debug("Verifying result\n"); + map = gem_mmap__cpu(fd, handle, 0, 4096, PROT_READ); + gem_set_domain(fd, handle, I915_GEM_DOMAIN_CPU, 0); + for (i = 0; i < 1024; i++) + igt_assert_eq(map[i], i); + munmap(map, 4096); } -static void fill_ring(drm_intel_bufmgr *bufmgr, - const char *ring, - igt_render_copyfunc_t copy) +static void fill_ring(int fd, + struct drm_i915_gem_execbuffer2 *execbuf, + unsigned flags) { - struct intel_batchbuffer *batch; - struct igt_buf src, tmp, dst; - struct bo bo; - int i; - - batch = intel_batchbuffer_alloc(bufmgr, intel_get_drm_devid(fd)); - igt_assert(batch); - - create_bo(bufmgr, &bo, ring); - - src.stride = 4 * width; - src.tiling = 0; - 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: * @@ -150,120 +74,163 @@ * 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; - - igt_assert_lt(y, height); - - /* Dummy load to fill the ring */ - copy(batch, NULL, &src, 0, 0, width, height, &tmp, 0, 0); - /* And copy the src into dst, pixel by pixel */ - copy(batch, NULL, &src, x, y, 1, 1, &dst, x, y); + igt_debug("Executing execbuf %d times\n", 128*1024/(8*4)); + igt_while_interruptible(flags & INTERRUPTIBLE) { + for (int i = 0; i < 128*1024 / (8 * 4); i++) + gem_execbuf(fd, execbuf); } - - /* verify */ - igt_assert_eq(check_bo(&bo), 0); - destroy_bo(&bo); - intel_batchbuffer_free(batch); } -static void blt_copy(struct intel_batchbuffer *batch, - drm_intel_context *context, - struct igt_buf *src, unsigned src_x, unsigned src_y, - unsigned w, unsigned h, - struct igt_buf *dst, unsigned dst_x, unsigned dst_y) -{ - BLIT_COPY_BATCH_START(0); - 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_FENCED(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_FENCED(src->bo, I915_GEM_DOMAIN_RENDER, 0, 0); - ADVANCE_BATCH(); - - intel_batchbuffer_flush(batch); -} +static void run_test(int fd, unsigned ring, unsigned flags) +{ + const int gen = intel_gen(intel_get_drm_devid(fd)); + const uint32_t bbe = MI_BATCH_BUFFER_END; + struct drm_i915_gem_exec_object2 obj[2]; + struct drm_i915_gem_relocation_entry reloc[1024]; + struct drm_i915_gem_execbuffer2 execbuf; + struct igt_hang_ring hang; + uint32_t *batch, *b; + int i; -static void run_test(int ring, bool interruptible, int nchild) { - drm_intel_bufmgr *bufmgr; - igt_render_copyfunc_t copy; - const char* ring_name; - - bufmgr = drm_intel_bufmgr_gem_init(fd, 4096); - igt_assert(bufmgr); - drm_intel_bufmgr_gem_enable_reuse(bufmgr); - - if (ring == I915_EXEC_RENDER) { - copy = igt_get_render_copyfunc(intel_get_drm_devid(fd)); - ring_name = "render"; - } else if (ring == I915_EXEC_BLT) { - copy = blt_copy; - ring_name = "blt"; - } else { - igt_fail_on_f(true, "Unsupported ring."); + gem_require_ring(fd, ring); + igt_skip_on_f(gen == 6 && (ring & ~(3<<13)) == I915_EXEC_BSD, + "MI_STORE_DATA broken on gen6 bsd\n"); + + if (flags & (SUSPEND | HIBERNATE)) + run_test(fd, ring, 0); + + gem_quiescent_gpu(fd); + + memset(&execbuf, 0, sizeof(execbuf)); + execbuf.buffers_ptr = (uintptr_t)obj; + execbuf.flags = ring | (1 << 11) | (1 << 12); + if (gen < 6) + execbuf.flags |= I915_EXEC_SECURE; + + memset(obj, 0, sizeof(obj)); + obj[0].handle = gem_create(fd, 4096); + gem_write(fd, obj[0].handle, 0, &bbe, sizeof(bbe)); + execbuf.buffer_count = 1; + igt_require(__gem_execbuf(fd, &execbuf) == 0); + + obj[0].flags |= EXEC_OBJECT_WRITE; + obj[1].handle = gem_create(fd, 1024*16 + 4096); + + obj[1].relocs_ptr = (uintptr_t)reloc; + obj[1].relocation_count = 1024; + + batch = gem_mmap__cpu(fd, obj[1].handle, 0, 16*1024 + 4096, + PROT_WRITE | PROT_READ); + gem_set_domain(fd, obj[1].handle, + I915_GEM_DOMAIN_CPU, I915_GEM_DOMAIN_CPU); + + memset(reloc, 0, sizeof(reloc)); + b = batch; + for (i = 0; i < 1024; i++) { + uint64_t offset; + + reloc[i].presumed_offset = obj[0].offset; + reloc[i].offset = (b - batch + 1) * sizeof(*batch); + reloc[i].delta = i * sizeof(uint32_t); + reloc[i].read_domains = I915_GEM_DOMAIN_INSTRUCTION; + reloc[i].write_domain = I915_GEM_DOMAIN_INSTRUCTION; + + offset = obj[0].offset + reloc[i].delta; + *b++ = MI_STORE_DWORD_IMM | (gen < 6 ? 1 << 22 : 0); + if (gen >= 8) { + *b++ = offset; + *b++ = offset >> 32; + } else if (gen >= 4) { + *b++ = 0; + *b++ = offset; + reloc[i].offset += sizeof(*batch); + } else { + b[-1] -= 1; + *b++ = offset; + } + *b++ = i; } + *b++ = MI_BATCH_BUFFER_END; + munmap(batch, 16*1024+4096); + execbuf.buffer_count = 2; + gem_execbuf(fd, &execbuf); + check_bo(fd, obj[0].handle); + + memset(&hang, 0, sizeof(hang)); + if (flags & HANG) + hang = igt_hang_ring(fd, ring & ~(3<<13)); + + if (flags & (CHILD | FORKED | BOMB)) { + int nchild; + + if (flags & FORKED) + nchild = sysconf(_SC_NPROCESSORS_ONLN); + else if (flags & BOMB) + nchild = 8*sysconf(_SC_NPROCESSORS_ONLN); + else + nchild = 1; + + igt_debug("Forking %d children\n", nchild); + igt_fork(child, nchild) + fill_ring(fd, &execbuf, flags); - /* Not all platforms have dedicated render ring. */ - igt_require(copy); + if (flags & SUSPEND) + igt_system_suspend_autoresume(); - if (interruptible) { - igt_fork_signal_helper(); - } + if (flags & HIBERNATE) + igt_system_hibernate_autoresume(); - if (nchild) { - igt_fork(child, nchild) { - fill_ring(bufmgr, ring_name, copy); - } igt_waitchildren(); - } else { - fill_ring(bufmgr, ring_name, copy); - } + } else + fill_ring(fd, &execbuf, flags); - if (interruptible) { - igt_stop_signal_helper(); - } + if (flags & HANG) + igt_post_hang_ring(fd, hang); + else + check_bo(fd, obj[0].handle); + + gem_close(fd, obj[1].handle); + gem_close(fd, obj[0].handle); - drm_intel_bufmgr_destroy(bufmgr); + gem_quiescent_gpu(fd); + + if (flags & (SUSPEND | HIBERNATE)) + run_test(fd, ring, 0); } igt_main { - igt_skip_on_simulation(); - - igt_fixture { - fd = drm_open_driver(DRIVER_INTEL); + const struct { + const char *suffix; + unsigned flags; + bool basic; + } modes[] = { + { "", 0, true}, + { "-interruptible", INTERRUPTIBLE, true }, + { "-hang", HANG, true }, + { "-child", CHILD }, + { "-forked", FORKED, true }, + { "-bomb", BOMB | INTERRUPTIBLE }, + { "-S3", BOMB | SUSPEND }, + { "-S4", BOMB | HIBERNATE }, + { NULL } + }, *m; + const struct intel_execution_engine *e; + int fd; + + igt_fixture + fd = drm_open_driver_master(DRIVER_INTEL); + + for (m = modes; m->suffix; m++) { + for (e = intel_execution_engines; e->name; e++) { + igt_subtest_f("%s%s%s", + m->basic && !e->exec_id ? "basic-" : "", + e->name, + m->suffix) + run_test(fd, e->exec_id | e->flags, m->flags); + } } - igt_subtest("blitter") - run_test(I915_EXEC_BLT, false, 0); - - igt_subtest("render") - run_test(I915_EXEC_RENDER, false, 0); - - igt_subtest("blitter-interruptible") - run_test(I915_EXEC_BLT, true, 0); - - igt_subtest("render-interruptible") - run_test(I915_EXEC_RENDER, true, 0); - - igt_subtest("blitter-forked-1") - run_test(I915_EXEC_BLT, false, 1); - - igt_subtest("render-forked-1") - run_test(I915_EXEC_RENDER, false, 1); - - igt_subtest("blitter-forked-4") - run_test(I915_EXEC_BLT, false, 4); - - igt_subtest("render-forked-4") - run_test(I915_EXEC_RENDER, false, 4); - - igt_fixture { + igt_fixture close(fd); - } } diff -Nru intel-gpu-tools-1.13/tests/gem_ring_sync_loop.c intel-gpu-tools-1.15/tests/gem_ring_sync_loop.c --- intel-gpu-tools-1.13/tests/gem_ring_sync_loop.c 2015-11-30 16:26:22.000000000 +0000 +++ intel-gpu-tools-1.15/tests/gem_ring_sync_loop.c 2016-05-23 10:51:28.000000000 +0000 @@ -26,23 +26,8 @@ */ #include "igt.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include "drm.h" -#include "intel_bufmgr.h" -#include "i830_reg.h" - -IGT_TEST_DESCRIPTION("Basic check of ring<->ring sync using a dummy reloc."); - -static drm_intel_bufmgr *bufmgr; -struct intel_batchbuffer *batch; -static drm_intel_bo *target_buffer; + +IGT_TEST_DESCRIPTION("Basic check of ring<->ring write synchronisation."); /* * Testcase: Basic check of ring<->ring sync using a dummy reloc @@ -50,70 +35,70 @@ * 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(int fd) +sync_loop(int fd) { + const uint32_t bbe = MI_BATCH_BUFFER_END; + struct drm_i915_gem_execbuffer2 execbuf; + struct drm_i915_gem_exec_object2 object[2]; + struct drm_i915_gem_relocation_entry reloc[1]; + unsigned engines[16]; + unsigned nengine; + unsigned engine; int i; - int num_rings = gem_get_num_rings(fd); + + nengine = 0; + for_each_engine(fd, engine) + engines[nengine++] = engine; + igt_require(nengine); + + memset(object, 0, sizeof(object)); + object[0].handle = gem_create(fd, 4096); + object[0].flags = EXEC_OBJECT_WRITE; + object[1].handle = gem_create(fd, 4096); + gem_write(fd, object[1].handle, 0, &bbe, sizeof(bbe)); + + memset(&execbuf, 0, sizeof(execbuf)); + execbuf.buffers_ptr = (uintptr_t)object; + execbuf.buffer_count = 2; + + /* Check if we have no-reloc support first */ + if (__gem_execbuf(fd, &execbuf)) { + object[0].flags = 0; + object[1].relocs_ptr = (uintptr_t)reloc; + object[1].relocation_count = 1; + + /* Add a dummy relocation to mark the object as writing */ + memset(reloc, 0, sizeof(reloc)); + reloc->offset = 1000; + reloc->target_handle = object[0].handle; + reloc->read_domains = I915_GEM_DOMAIN_RENDER; + reloc->write_domain = I915_GEM_DOMAIN_RENDER; + + gem_execbuf(fd, &execbuf); + } srandom(0xdeadbeef); for (i = 0; i < SLOW_QUICK(0x100000, 10); i++) { - int ring = random() % num_rings + 1; - - if (ring == I915_EXEC_RENDER) { - BEGIN_BATCH(4, 1); - 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, 1); - 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); + execbuf.flags = engines[rand() % nengine]; + gem_execbuf(fd, &execbuf); } - drm_intel_bo_map(target_buffer, 0); - // map to force waiting on rendering - drm_intel_bo_unmap(target_buffer); + gem_sync(fd, object[1].handle); + gem_close(fd, object[1].handle); + gem_close(fd, object[0].handle); } igt_simple_main { int fd; - int devid; fd = drm_open_driver(DRIVER_INTEL); - devid = intel_get_drm_devid(fd); - gem_require_ring(fd, I915_EXEC_BLT); - - - bufmgr = drm_intel_bufmgr_gem_init(fd, 4096); - igt_assert(bufmgr); - drm_intel_bufmgr_gem_enable_reuse(bufmgr); - - batch = intel_batchbuffer_alloc(bufmgr, devid); - igt_assert(batch); - - target_buffer = drm_intel_bo_alloc(bufmgr, "target bo", 4096, 4096); - igt_assert(target_buffer); - - store_dword_loop(fd); + intel_detect_and_clear_missed_interrupts(fd); - drm_intel_bo_unreference(target_buffer); - intel_batchbuffer_free(batch); - drm_intel_bufmgr_destroy(bufmgr); + sync_loop(fd); + igt_assert_eq(intel_detect_and_clear_missed_interrupts(fd), 0); close(fd); } diff -Nru intel-gpu-tools-1.13/tests/gem_shrink.c intel-gpu-tools-1.15/tests/gem_shrink.c --- intel-gpu-tools-1.13/tests/gem_shrink.c 1970-01-01 00:00:00.000000000 +0000 +++ intel-gpu-tools-1.15/tests/gem_shrink.c 2016-05-23 10:51:28.000000000 +0000 @@ -0,0 +1,325 @@ +/* + * Copyright © 2016 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. + * + */ + +/** @file gem_shrink.c + * + * Exercise the shrinker by overallocating GEM objects + */ + +#include "igt.h" +#include "igt_gt.h" + +#ifndef MADV_FREE +#define MADV_FREE 8 +#endif + +static void get_pages(int fd, uint64_t alloc) +{ + uint32_t handle = gem_create(fd, alloc); + gem_set_domain(fd, handle, I915_GEM_DOMAIN_GTT, 0); + gem_madvise(fd, handle, I915_MADV_DONTNEED); +} + +static void pwrite_(int fd, uint64_t alloc) +{ + uint32_t tmp; + uint32_t handle = gem_create(fd, alloc); + for (int page = 0; page < alloc>>12; page++) + gem_write(fd, handle, (page + page % 4095) & ~3, &tmp, 4); + gem_madvise(fd, handle, I915_MADV_DONTNEED); +} + +static void pread_(int fd, uint64_t alloc) +{ + uint32_t tmp; + uint32_t handle = gem_create(fd, alloc); + for (int page = 0; page < alloc>>12; page++) + gem_read(fd, handle, (page + page % 4095) & ~3, &tmp, 4); + gem_madvise(fd, handle, I915_MADV_DONTNEED); +} + +static void mmap_gtt(int fd, uint64_t alloc) +{ + uint32_t handle = gem_create(fd, alloc); + uint32_t *ptr = gem_mmap__gtt(fd, handle, alloc, PROT_WRITE); + for (int page = 0; page < alloc>>12; page++) + ptr[page<<10] = 0; + munmap(ptr, alloc); + gem_madvise(fd, handle, I915_MADV_DONTNEED); +} + +static void mmap_cpu(int fd, uint64_t alloc) +{ + uint32_t handle = gem_create(fd, alloc); + uint32_t *ptr = gem_mmap__cpu(fd, handle, 0, alloc, PROT_WRITE); + for (int page = 0; page < alloc>>12; page++) + ptr[page<<10] = 0; + munmap(ptr, alloc); + gem_madvise(fd, handle, I915_MADV_DONTNEED); +} + +static void execbuf1(int fd, uint64_t alloc) +{ + const uint32_t bbe = MI_BATCH_BUFFER_END; + struct drm_i915_gem_exec_object2 obj; + struct drm_i915_gem_execbuffer2 execbuf; + + memset(&obj, 0, sizeof(obj)); + memset(&execbuf, 0, sizeof(execbuf)); + execbuf.buffers_ptr = (uintptr_t)&obj; + execbuf.buffer_count = 1; + + obj.handle = gem_create(fd, alloc); + gem_write(fd, obj.handle, 0, &bbe, sizeof(bbe)); + gem_execbuf(fd, &execbuf); + gem_madvise(fd, obj.handle, I915_MADV_DONTNEED); +} + +static void execbufN(int fd, uint64_t alloc) +{ + const uint32_t bbe = MI_BATCH_BUFFER_END; + struct drm_i915_gem_exec_object2 *obj; + struct drm_i915_gem_execbuffer2 execbuf; + int count = alloc >> 20; + + obj = calloc(alloc + 1, sizeof(*obj)); + memset(&execbuf, 0, sizeof(execbuf)); + + obj[count].handle = gem_create(fd, 4096); + gem_write(fd, obj[count].handle, 0, &bbe, sizeof(bbe)); + + for (int i = 1; i <= count; i++) { + int j = count - i; + + obj[j].handle = gem_create(fd, 1 << 20); + execbuf.buffers_ptr = (uintptr_t)&obj[j]; + execbuf.buffer_count = i + 1; + gem_execbuf(fd, &execbuf); + } + + for (int i = 0; i <= count; i++) + gem_madvise(fd, obj[i].handle, I915_MADV_DONTNEED); + free(obj); +} + +static void hang(int fd, uint64_t alloc) +{ + const uint32_t bbe = MI_BATCH_BUFFER_END; + struct drm_i915_gem_exec_object2 *obj; + struct drm_i915_gem_execbuffer2 execbuf; + int count = alloc >> 20; + + obj = calloc(alloc + 1, sizeof(*obj)); + memset(&execbuf, 0, sizeof(execbuf)); + + obj[count].handle = gem_create(fd, 4096); + gem_write(fd, obj[count].handle, 0, &bbe, sizeof(bbe)); + + for (int i = 1; i <= count; i++) { + int j = count - i; + + obj[j].handle = gem_create(fd, 1 << 20); + execbuf.buffers_ptr = (uintptr_t)&obj[j]; + execbuf.buffer_count = i + 1; + gem_execbuf(fd, &execbuf); + } + + gem_close(fd, igt_hang_ring(fd, 0).handle); + for (int i = 0; i <= count; i++) + gem_madvise(fd, obj[i].handle, I915_MADV_DONTNEED); + free(obj); +} + +static void userptr(int fd, uint64_t alloc) +{ + struct local_i915_gem_userptr userptr; + void *ptr; + + igt_assert((alloc & 4095) == 0); + + ptr = mmap(NULL, alloc, + PROT_READ | PROT_WRITE, MAP_ANON | MAP_PRIVATE, + -1, 0); + igt_assert(ptr != (void *)-1); + + memset(&userptr, 0, sizeof(userptr)); + userptr.user_size = alloc; + userptr.user_ptr = (uintptr_t)ptr; + do_ioctl(fd, LOCAL_IOCTL_I915_GEM_USERPTR, &userptr); + + gem_set_domain(fd, userptr.handle, I915_GEM_DOMAIN_GTT, 0); + + madvise(ptr, alloc, MADV_FREE); +} + +static bool has_userptr(void) +{ + struct local_i915_gem_userptr userptr; + int fd = drm_open_driver(DRIVER_INTEL); + int err; + + memset(&userptr, 0, sizeof(userptr)); + userptr.user_size = 8192; + userptr.user_ptr = -4096; + + err = 0; + if (drmIoctl(fd, LOCAL_IOCTL_I915_GEM_USERPTR, &userptr)) + err = errno; + + close(fd); + + return err == EFAULT; +} + +static void leak(int fd, uint64_t alloc) +{ + char *ptr; + + ptr = mmap(NULL, alloc, PROT_READ | PROT_WRITE, + MAP_ANON | MAP_PRIVATE | MAP_POPULATE, + -1, 0); + if (ptr != (char *)-1) + return; + + while (alloc) { + alloc -= 4096; + ptr[alloc] = 0; + } +} + +#define SOLO 1 +#define USERPTR 2 +#define OOM 4 + +static void run_test(int nchildren, uint64_t alloc, + void (*func)(int, uint64_t), unsigned flags) +{ + const int timeout = flags & SOLO ? 1 : 20; + + /* Each pass consumes alloc bytes and doesn't drop + * its reference to object (i.e. calls + * gem_madvise(DONTNEED) instead of gem_close()). + * After nchildren passes we expect each process + * to have enough objects to consume all of memory + * if left unchecked. + */ + + if (flags & SOLO) + nchildren = 1; + + /* Background load */ + if (flags & OOM) { + igt_fork(child, nchildren) { + igt_until_timeout(timeout) { + int fd = drm_open_driver(DRIVER_INTEL); + for (int pass = 0; pass < nchildren; pass++) + leak(fd, alloc); + close(fd); + } + } + } + + if (flags & USERPTR) { + igt_require(has_userptr()); + igt_fork(child, (nchildren + 1)/2) { + igt_until_timeout(timeout) { + int fd = drm_open_driver(DRIVER_INTEL); + for (int pass = 0; pass < nchildren; pass++) + userptr(fd, alloc); + close(fd); + } + } + nchildren = (nchildren + 1)/2; + } + + /* Exercise major ioctls */ + igt_fork(child, nchildren) { + igt_until_timeout(timeout) { + int fd = drm_open_driver(DRIVER_INTEL); + for (int pass = 0; pass < nchildren; pass++) + func(fd, alloc); + close(fd); + } + } + igt_waitchildren(); +} + +igt_main +{ + const struct test { + const char *name; + void (*func)(int, uint64_t); + } tests[] = { + { "get-pages", get_pages }, + { "pwrite", pwrite_ }, + { "pread", pread_ }, + { "mmap-gtt", mmap_gtt }, + { "mmap-cpu", mmap_cpu }, + { "execbuf1", execbuf1 }, + { "execbufN", execbufN }, + { "hang", hang }, + { NULL }, + }; + const struct mode { + const char *suffix; + unsigned flags; + } modes[] = { + { "-sanitycheck", SOLO }, + { "", 0 }, + { "-userptr", USERPTR }, + { "-oom", USERPTR | OOM }, + { NULL }, + }; + uint64_t alloc_size = 0; + int num_processes = 0; + + igt_skip_on_simulation(); + + igt_fixture { + uint64_t mem_size = intel_get_total_ram_mb(); + + /* Spawn enough processes to use all memory, but each only + * uses half the available mappable aperture ~128MiB. + * Individually the processes would be ok, but en masse + * we expect the shrinker to start purging objects, + * and possibly fail. + */ + alloc_size = gem_mappable_aperture_size() / 2; + num_processes = 1 + (mem_size / (alloc_size >> 20)); + + igt_info("Using %d processes and %'lluMiB per process\n", + num_processes, (long long)(alloc_size >> 20)); + + intel_require_memory(num_processes, alloc_size, + CHECK_SWAP | CHECK_RAM); + } + + for(const struct test *t = tests; t->name; t++) { + for(const struct mode *m = modes; m->suffix; m++) { + igt_subtest_f("%s%s", t->name, m->suffix) + run_test(num_processes, alloc_size, + t->func, m->flags); + } + } +} diff -Nru intel-gpu-tools-1.13/tests/gem_softpin.c intel-gpu-tools-1.15/tests/gem_softpin.c --- intel-gpu-tools-1.13/tests/gem_softpin.c 1970-01-01 00:00:00.000000000 +0000 +++ intel-gpu-tools-1.15/tests/gem_softpin.c 2016-05-23 10:51:28.000000000 +0000 @@ -0,0 +1,512 @@ +/* + * Copyright © 2015 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: + * Vinay Belgaumkar + * Thomas Daniel + * + */ + +#include "igt.h" + +#define EXEC_OBJECT_PINNED (1<<4) +#define EXEC_OBJECT_SUPPORTS_48B_ADDRESS (1<<3) + +/* gen8_canonical_addr + * Used to convert any address into canonical form, i.e. [63:48] == [47]. + * Based on kernel's sign_extend64 implementation. + * @address - a virtual address +*/ +#define GEN8_HIGH_ADDRESS_BIT 47 +static uint64_t gen8_canonical_addr(uint64_t address) +{ + __u8 shift = 63 - GEN8_HIGH_ADDRESS_BIT; + return (__s64)(address << shift) >> shift; +} + +static void test_invalid(int fd) +{ + const uint32_t bbe = MI_BATCH_BUFFER_END; + struct drm_i915_gem_execbuffer2 execbuf; + struct drm_i915_gem_exec_object2 object; + + memset(&execbuf, 0, sizeof(execbuf)); + execbuf.buffers_ptr = (uintptr_t)&object; + execbuf.buffer_count = 1; + + memset(&object, 0, sizeof(object)); + object.handle = gem_create(fd, 2*4096); + object.flags = EXEC_OBJECT_SUPPORTS_48B_ADDRESS | EXEC_OBJECT_PINNED; + gem_write(fd, object.handle, 0, &bbe, sizeof(bbe)); + + /* Check invalid alignment */ + object.offset = 4096; + object.alignment = 64*1024; + igt_assert_eq(__gem_execbuf(fd, &execbuf), -EINVAL); + object.alignment = 0; + + /* Check wraparound */ + object.offset = -4096ULL; + igt_assert_eq(__gem_execbuf(fd, &execbuf), -EINVAL); + + /* Check beyond bounds of aperture */ + object.offset = gem_aperture_size(fd) - 4096; + object.offset = gen8_canonical_addr(object.offset); + igt_assert_eq(__gem_execbuf(fd, &execbuf), -EINVAL); + + /* Check gen8 canonical addressing */ + if (gem_aperture_size(fd) > 1ull< 1ull<<32) { + object.flags = EXEC_OBJECT_PINNED; + object.offset = 1ull<<32; + igt_assert_eq(__gem_execbuf(fd, &execbuf), -EINVAL); + + object.offset = gen8_canonical_addr(object.offset); + object.flags |= EXEC_OBJECT_SUPPORTS_48B_ADDRESS; + igt_assert_eq(__gem_execbuf(fd, &execbuf), 0); + } +} + +static void test_softpin(int fd) +{ + const uint32_t size = 1024 * 1024; + const uint32_t bbe = MI_BATCH_BUFFER_END; + struct drm_i915_gem_execbuffer2 execbuf; + struct drm_i915_gem_exec_object2 object; + uint64_t offset, end; + uint32_t last_handle; + int loop; + + last_handle = gem_create(fd, size); + + memset(&execbuf, 0, sizeof(execbuf)); + execbuf.buffers_ptr = (uintptr_t)&object; + execbuf.buffer_count = 1; + for (loop = 0; loop < 1024; loop++) { + memset(&object, 0, sizeof(object)); + object.handle = gem_create(fd, 2*size); + gem_write(fd, object.handle, 0, &bbe, sizeof(bbe)); + + /* Find a hole */ + gem_execbuf(fd, &execbuf); + gem_close(fd, object.handle); + gem_close(fd, last_handle); + + igt_debug("Made a 2 MiB hole: %08llx\n", + object.offset); + + object.handle = gem_create(fd, size); + gem_write(fd, object.handle, 0, &bbe, sizeof(bbe)); + object.flags |= EXEC_OBJECT_PINNED; + + end = object.offset + size; + for (offset = object.offset; offset <= end; offset += 4096) { + object.offset = offset; + gem_execbuf(fd, &execbuf); + igt_assert_eq_u64(object.offset, offset); + } + + last_handle = object.handle; + } +} + +static void test_overlap(int fd) +{ + const uint32_t size = 1024 * 1024; + const uint32_t bbe = MI_BATCH_BUFFER_END; + struct drm_i915_gem_execbuffer2 execbuf; + struct drm_i915_gem_exec_object2 object[2]; + uint64_t offset; + uint32_t handle; + + handle = gem_create(fd, 3*size); + gem_write(fd, handle, 0, &bbe, sizeof(bbe)); + + memset(object, 0, sizeof(object)); + object[0].handle = handle; + + /* Find a hole */ + memset(&execbuf, 0, sizeof(execbuf)); + execbuf.buffers_ptr = (uintptr_t)object; + execbuf.buffer_count = 1; + gem_execbuf(fd, &execbuf); + + igt_debug("Made a 3x1 MiB hole: %08llx\n", + object[0].offset); + + object[0].handle = gem_create(fd, size); + object[0].offset += size; + object[0].flags |= EXEC_OBJECT_PINNED; + object[1].handle = gem_create(fd, size); + object[1].flags |= EXEC_OBJECT_PINNED; + gem_write(fd, object[1].handle, 0, &bbe, sizeof(bbe)); + execbuf.buffer_count = 2; + + /* Check that we fit into our hole */ + object[1].offset = object[0].offset - size; + gem_execbuf(fd, &execbuf); + igt_assert_eq_u64(object[1].offset + size, object[0].offset); + + object[1].offset = object[0].offset + size; + gem_execbuf(fd, &execbuf); + igt_assert_eq_u64(object[1].offset - size, object[0].offset); + + /* Try all possible page-aligned overlaps */ + for (offset = object[0].offset - size + 4096; + offset < object[0].offset + size; + offset += 4096) { + object[1].offset = offset; + igt_debug("[0]=[%08llx - %08llx] [1]=[%08llx - %08llx]\n", + (long long)object[0].offset, + (long long)object[0].offset + size, + (long long)object[1].offset, + (long long)object[1].offset + size); + igt_assert_eq(__gem_execbuf(fd, &execbuf), -EINVAL); + igt_assert_eq_u64(object[1].offset, offset); + } + + gem_close(fd, object[1].handle); + gem_close(fd, object[0].handle); + gem_close(fd, handle); +} + +static uint64_t busy_batch(int fd) +{ + const int gen = intel_gen(intel_get_drm_devid(fd)); + const int has_64bit_reloc = gen >= 8; + struct drm_i915_gem_execbuffer2 execbuf; + struct drm_i915_gem_exec_object2 object[2]; + uint32_t *map; + int factor = 10; + int i = 0; + + memset(object, 0, sizeof(object)); + object[0].handle = gem_create(fd, 1024*1024); + object[1].handle = gem_create(fd, 4096); + map = gem_mmap__cpu(fd, object[1].handle, 0, 4096, PROT_WRITE); + gem_set_domain(fd, object[1].handle, + I915_GEM_DOMAIN_CPU, I915_GEM_DOMAIN_CPU); + + *map = MI_BATCH_BUFFER_END; + + memset(&execbuf, 0, sizeof(execbuf)); + execbuf.buffers_ptr = (uintptr_t)object; + execbuf.buffer_count = 2; + if (gen >= 6) + execbuf.flags = I915_EXEC_BLT; + gem_execbuf(fd, &execbuf); + + igt_debug("Active offsets = [%08llx, %08llx]\n", + object[0].offset, object[1].offset); + +#define COPY_BLT_CMD (2<<29|0x53<<22|0x6) +#define BLT_WRITE_ALPHA (1<<21) +#define BLT_WRITE_RGB (1<<20) + gem_set_domain(fd, object[1].handle, + I915_GEM_DOMAIN_CPU, I915_GEM_DOMAIN_CPU); + while (factor--) { + /* XY_SRC_COPY */ + map[i++] = COPY_BLT_CMD | BLT_WRITE_ALPHA | BLT_WRITE_RGB; + if (has_64bit_reloc) + map[i-1] += 2; + map[i++] = 0xcc << 16 | 1 << 25 | 1 << 24 | (4*1024); + map[i++] = 0; + map[i++] = 256 << 16 | 1024; + map[i++] = object[0].offset; + if (has_64bit_reloc) + map[i++] = object[0].offset >> 32; + map[i++] = 0; + map[i++] = 4096; + map[i++] = object[0].offset; + if (has_64bit_reloc) + map[i++] = object[0].offset >> 32; + } + map[i++] = MI_BATCH_BUFFER_END; + munmap(map, 4096); + + object[0].flags = EXEC_OBJECT_PINNED | EXEC_OBJECT_WRITE; + object[1].flags = EXEC_OBJECT_PINNED; + gem_execbuf(fd, &execbuf); + gem_close(fd, object[0].handle); + gem_close(fd, object[1].handle); + + return object[1].offset; +} + +static void test_evict_active(int fd) +{ + const uint32_t bbe = MI_BATCH_BUFFER_END; + struct drm_i915_gem_execbuffer2 execbuf; + struct drm_i915_gem_exec_object2 object; + uint64_t expected; + + memset(&object, 0, sizeof(object)); + object.handle = gem_create(fd, 4096); + gem_write(fd, object.handle, 0, &bbe, sizeof(bbe)); + + memset(&execbuf, 0, sizeof(execbuf)); + execbuf.buffers_ptr = (uintptr_t)&object; + execbuf.buffer_count = 1; + + expected = busy_batch(fd); + object.offset = expected; + object.flags = EXEC_OBJECT_PINNED; + + /* Replace the active batch with ourselves, forcing an eviction */ + gem_execbuf(fd, &execbuf); + igt_assert_eq_u64(object.offset, expected); + + gem_close(fd, object.handle); +} + +static void test_evict_snoop(int fd) +{ + const uint32_t bbe = MI_BATCH_BUFFER_END; + struct drm_i915_gem_execbuffer2 execbuf; + struct drm_i915_gem_exec_object2 object[2]; + uint64_t hole; + + igt_require(!gem_has_llc(fd)); + igt_require(!gem_uses_ppgtt(fd)); + + memset(&execbuf, 0, sizeof(execbuf)); + execbuf.buffers_ptr = (uintptr_t)object; + execbuf.buffer_count = 1; + + /* Find a hole */ + memset(object, 0, sizeof(object)); + object[0].handle = gem_create(fd, 3*4096); + gem_write(fd, object[0].handle, 0, &bbe, sizeof(bbe)); + gem_execbuf(fd, &execbuf); + gem_close(fd, object[0].handle); + hole = object[0].offset; + + /* Create a snoop + uncached pair */ + object[0].handle = gem_create(fd, 4096); + object[0].flags = EXEC_OBJECT_PINNED; + gem_set_caching(fd, object[0].handle, 1); + object[1].handle = gem_create(fd, 4096); + object[1].flags = EXEC_OBJECT_PINNED; + gem_write(fd, object[1].handle, 4096-sizeof(bbe), &bbe, sizeof(bbe)); + execbuf.buffer_count = 2; + + /* snoop abutting before uncached -> error */ + object[0].offset = hole; + object[1].offset = hole + 4096; + igt_assert_eq(__gem_execbuf(fd, &execbuf), -EINVAL); + + /* snoop abutting after uncached -> error */ + object[0].offset = hole + 4096; + object[1].offset = hole; + igt_assert_eq(__gem_execbuf(fd, &execbuf), -EINVAL); + + /* with gap -> okay */ + object[0].offset = hole + 2*4096; + object[1].offset = hole; + igt_assert_eq(__gem_execbuf(fd, &execbuf), 0); + + /* And we should force the snoop away (or the GPU may hang) */ + object[0].flags = 0; + object[1].offset = hole + 4096; + igt_assert_eq(__gem_execbuf(fd, &execbuf), 0); + igt_assert(object[0].offset != hole); + igt_assert(object[0].offset != hole + 2*4096); + + gem_close(fd, object[0].handle); + gem_close(fd, object[1].handle); +} + +static void test_evict_hang(int fd) +{ + const uint32_t bbe = MI_BATCH_BUFFER_END; + struct drm_i915_gem_execbuffer2 execbuf; + struct drm_i915_gem_exec_object2 object; + igt_hang_ring_t hang; + uint64_t expected; + + memset(&object, 0, sizeof(object)); + object.handle = gem_create(fd, 4096); + gem_write(fd, object.handle, 0, &bbe, sizeof(bbe)); + + memset(&execbuf, 0, sizeof(execbuf)); + execbuf.buffers_ptr = (uintptr_t)&object; + execbuf.buffer_count = 1; + + hang = igt_hang_ctx(fd, 0, 0, 0, (uint64_t *)&expected); + object.offset = expected; + object.flags = EXEC_OBJECT_PINNED; + + /* Replace the hung batch with ourselves, forcing an eviction */ + gem_execbuf(fd, &execbuf); + igt_assert_eq_u64(object.offset, expected); + + igt_post_hang_ring(fd, hang); + gem_close(fd, object.handle); +} + +static void xchg_offset(void *array, unsigned i, unsigned j) +{ + struct drm_i915_gem_exec_object2 *object = array; + uint64_t tmp = object[i].offset; + object[i].offset = object[j].offset; + object[j].offset = tmp; +} + +enum sleep { NOSLEEP, SUSPEND, HIBERNATE }; +static void test_noreloc(int fd, enum sleep sleep) +{ + const int gen = intel_gen(intel_get_drm_devid(fd)); + const uint32_t size = 4096; + const uint32_t bbe = MI_BATCH_BUFFER_END; + struct drm_i915_gem_execbuffer2 execbuf; + struct drm_i915_gem_exec_object2 object[257]; + uint64_t offset; + uint32_t handle; + uint32_t *batch, *b; + int i, loop; + + handle = gem_create(fd, (ARRAY_SIZE(object)+1)*size); + gem_write(fd, handle, 0, &bbe, sizeof(bbe)); + + memset(object, 0, sizeof(object)); + object[0].handle = handle; + + /* Find a hole */ + memset(&execbuf, 0, sizeof(execbuf)); + execbuf.buffers_ptr = (uintptr_t)object; + execbuf.buffer_count = 1; + if (gen < 6) + execbuf.flags |= I915_EXEC_SECURE; + gem_execbuf(fd, &execbuf); + gem_close(fd, object[0].handle); + + igt_debug("Made a %dx%d KiB hole: %08llx\n", + (int)ARRAY_SIZE(object), size/1024, object[0].offset); + + offset = object[0].offset; + for (i = 0; i < ARRAY_SIZE(object) - 1; i++) { + object[i].handle = gem_create(fd, size); + object[i].offset = offset + i*size; + object[i].flags = EXEC_OBJECT_PINNED | EXEC_OBJECT_WRITE; + } + object[i].handle = gem_create(fd, 2*size); + object[i].offset = offset + i*size; + object[i].flags = EXEC_OBJECT_PINNED; + + b = batch = gem_mmap__cpu(fd, object[i].handle, 0, 2*size, PROT_WRITE); + gem_set_domain(fd, object[i].handle, + I915_GEM_DOMAIN_CPU, I915_GEM_DOMAIN_CPU); + for (i = 0; i < ARRAY_SIZE(object) - 1; i++) { + *b++ = MI_STORE_DWORD_IMM | (gen < 6 ? 1 << 22 : 0); + if (gen >= 8) { + *b++ = object[i].offset; + *b++ = object[i].offset >> 32; + } else if (gen >= 4) { + *b++ = 0; + *b++ = object[i].offset; + } else { + b[-1]--; + *b++ = object[i].offset; + } + *b++ = i; + } + *b++ = MI_BATCH_BUFFER_END; + igt_assert(b - batch <= 2*size/sizeof(uint32_t)); + munmap(batch, size); + + execbuf.buffer_count = ARRAY_SIZE(object); + for (loop = 0; loop < 1024; loop++) { + igt_permute_array(object, ARRAY_SIZE(object)-1, xchg_offset); + gem_execbuf(fd, &execbuf); + + if ((loop & 127) == 0) { + switch (sleep) { + case NOSLEEP: + break; + case SUSPEND: + igt_system_suspend_autoresume(); + break; + case HIBERNATE: + igt_system_hibernate_autoresume(); + break; + } + } + + for (i = 0; i < ARRAY_SIZE(object) - 1; i++) { + uint32_t val; + + gem_read(fd, object[i].handle, 0, &val, sizeof(val)); + igt_assert_eq(val, (object[i].offset - offset)/size); + } + } + + for (i = 0; i < ARRAY_SIZE(object); i++) + gem_close(fd, object[i].handle); +} + +igt_main +{ + int fd = -1; + + igt_skip_on_simulation(); + + igt_fixture { + fd = drm_open_driver_master(DRIVER_INTEL); + igt_require(gem_has_softpin(fd)); + } + + igt_subtest("invalid") + test_invalid(fd); + igt_subtest("softpin") + test_softpin(fd); + igt_subtest("overlap") + test_overlap(fd); + + igt_subtest("noreloc") + test_noreloc(fd, NOSLEEP); + igt_subtest("noreloc-interruptible") + igt_while_interruptible(true) test_noreloc(fd, NOSLEEP); + igt_subtest("noreloc-S3") + test_noreloc(fd, SUSPEND); + igt_subtest("noreloc-S4") + test_noreloc(fd, HIBERNATE); + + for (int signal = 0; signal <= 1; signal++) { + igt_subtest_f("evict-active%s", signal ? "-interruptible" : "") + igt_while_interruptible(signal) test_evict_active(fd); + igt_subtest_f("evict-snoop%s", signal ? "-interruptible" : "") + igt_while_interruptible(signal) test_evict_snoop(fd); + } + igt_subtest("evict-hang") + test_evict_hang(fd); + + igt_fixture + close(fd); +} diff -Nru intel-gpu-tools-1.13/tests/gem_stolen.c intel-gpu-tools-1.15/tests/gem_stolen.c --- intel-gpu-tools-1.13/tests/gem_stolen.c 1970-01-01 00:00:00.000000000 +0000 +++ intel-gpu-tools-1.15/tests/gem_stolen.c 2016-05-23 10:51:28.000000000 +0000 @@ -0,0 +1,360 @@ +/* + * Copyright © 2015 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: + * Ankitprasad Sharma + * + */ + +/** @file gem_create_stolen.c + * + * This is a test for the extended gem_create ioctl, that includes allocation + * of object from stolen memory. + * + * The goal is to simply ensure the basics work, and invalid input combinations + * are rejected. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "ioctl_wrappers.h" +#include "intel_bufmgr.h" +#include "intel_batchbuffer.h" +#include "intel_io.h" +#include "intel_chipset.h" +#include "igt_aux.h" +#include "drmtest.h" +#include "drm.h" +#include "i915_drm.h" + +IGT_TEST_DESCRIPTION("This test verifies the exetended gem_create ioctl," + " that includes allocation of obj from stolen region"); +#define CLEAR(s) memset(&s, 0, sizeof(s)) +#define SIZE 1024*1024 +#define DWORD_SIZE 4 +#define DATA 0xdead +#define LARGE_SIZE 0xffffffff +#define MAX_OBJECTS 100 + +static drm_intel_bufmgr *bufmgr; +static struct intel_batchbuffer *batch; + +static void verify_copy_op(drm_intel_bo *src, drm_intel_bo *dest) +{ + uint32_t *virt, i, ret; + /* Fill the src BO with dwords */ + ret = drm_intel_gem_bo_map_gtt(src); + igt_assert(!ret); + + virt = src->virtual; + for (i = 0; i < SIZE/DWORD_SIZE; i++) + virt[i] = i; + + intel_copy_bo(batch, dest, src, SIZE); + + ret = drm_intel_gem_bo_map_gtt(dest); + igt_assert(!ret); + + virt = dest->virtual; + /* verify */ + for (i = 0; i < SIZE/DWORD_SIZE; i++) + igt_assert_eq(virt[i], i); + + drm_intel_bo_unmap(src); + drm_intel_bo_unmap(dest); +} + +static void stolen_pwrite(int fd) +{ + drm_intel_bo *bo; + uint32_t buf[SIZE/DWORD_SIZE]; + uint32_t handle = 0; + uint32_t *virt; + int i, ret = 0; + + for (i = 0; i < SIZE/DWORD_SIZE; i++) + buf[i] = DATA; + + gem_require_stolen_support(fd); + + handle = gem_create_stolen(fd, SIZE); + + gem_write(fd, handle, 0, buf, SIZE); + bo = gem_handle_to_libdrm_bo(bufmgr, fd, "bo", handle); + + ret = drm_intel_gem_bo_map_gtt(bo); + igt_assert(!ret); + + virt = bo->virtual; + + for (i = 0; i < SIZE/DWORD_SIZE; i++) + igt_assert_eq(virt[i], DATA); + + drm_intel_bo_unmap(bo); + drm_intel_bo_unreference(bo); + gem_close(fd, handle); +} + +static void stolen_pread(int fd) +{ + drm_intel_bo *bo; + uint32_t buf[SIZE/DWORD_SIZE]; + uint32_t handle = 0; + uint32_t *virt; + int i, ret = 0; + + CLEAR(buf); + + gem_require_stolen_support(fd); + + handle = gem_create_stolen(fd, SIZE); + + bo = gem_handle_to_libdrm_bo(bufmgr, fd, "bo", handle); + + ret = drm_intel_gem_bo_map_gtt(bo); + igt_assert(!ret); + + virt = bo->virtual; + + for (i = 0; i < SIZE/DWORD_SIZE; i++) + virt[i] = DATA; + + drm_intel_bo_unmap(bo); + drm_intel_bo_unreference(bo); + + gem_read(fd, handle, 0, buf, SIZE); + + for (i = 0; i < SIZE/DWORD_SIZE; i++) + igt_assert_eq(buf[i], DATA); + + gem_close(fd, handle); +} + +static void copy_test(int fd) +{ + drm_intel_bo *src, *dest; + uint32_t src_handle = 0, dest_handle = 0; + + gem_require_stolen_support(fd); + + src_handle = gem_create_stolen(fd, SIZE); + dest_handle = gem_create_stolen(fd, SIZE); + + src = gem_handle_to_libdrm_bo(bufmgr, fd, "src_bo", src_handle); + dest = gem_handle_to_libdrm_bo(bufmgr, fd, "dst_bo", dest_handle); + + igt_assert(src != NULL); + igt_assert(dest != NULL); + + verify_copy_op(src, dest); + + drm_intel_bo_unreference(src); + drm_intel_bo_unreference(dest); + gem_close(fd, src_handle); + gem_close(fd, dest_handle); +} + +static void verify_object_clear(int fd) +{ + drm_intel_bo *bo; + uint32_t handle = 0; + uint32_t *virt; + int i, ret; + + gem_require_stolen_support(fd); + + handle = gem_create_stolen(fd, SIZE); + + bo = gem_handle_to_libdrm_bo(bufmgr, fd, "verify_bo", handle); + igt_assert(bo != NULL); + + ret = drm_intel_gem_bo_map_gtt(bo); + igt_assert(!ret); + + /* Verify if the BO is zeroed */ + virt = bo->virtual; + for (i = 0; i < SIZE / DWORD_SIZE; i++) + igt_assert(!virt[i]); + + drm_intel_bo_unmap(bo); + drm_intel_bo_unreference(bo); + gem_close(fd, handle); +} + +static void stolen_large_obj_alloc(int fd) +{ + uint32_t handle = 0; + + gem_require_stolen_support(fd); + handle = __gem_create_stolen(fd, (unsigned long long) LARGE_SIZE + 4096); + igt_assert(!handle); +} + +static void stolen_fill_purge_test(int fd) +{ + drm_intel_bo *bo; + int obj_count = 0, i = 0; + int _ret = 0, j = 0; + uint32_t handle[MAX_OBJECTS]; + uint32_t new_handle; + uint32_t *virt; + int retained; + + gem_require_stolen_support(fd); + + /* Exhaust Stolen space */ + do { + handle[i] = __gem_create_stolen(fd, SIZE); + if (handle[i] != 0) { + bo = gem_handle_to_libdrm_bo(bufmgr, fd, + "verify_bo", handle[i]); + igt_assert(bo != NULL); + + _ret = drm_intel_gem_bo_map_gtt(bo); + igt_assert(!_ret); + + virt = bo->virtual; + for (j = 0; j < SIZE/DWORD_SIZE; j++) + virt[j] = DATA; + + drm_intel_bo_unmap(bo); + drm_intel_bo_unreference(bo); + + obj_count++; + } + + i++; + } while (handle[i-1] && i < MAX_OBJECTS); + + igt_assert(obj_count > 0); + + /* Mark all stolen objects purgeable */ + for (i = 0; i < obj_count; i++) + retained = gem_madvise(fd, handle[i], I915_MADV_DONTNEED); + + /* Try to allocate one more object */ + new_handle = gem_create_stolen(fd, SIZE); + + /* Check if the retained object's memory contents are intact */ + for (i = 0; i < obj_count; i++) { + retained = gem_madvise(fd, handle[i], I915_MADV_WILLNEED); + if (retained) { + bo = gem_handle_to_libdrm_bo(bufmgr, fd, + "verify_bo", handle[i]); + igt_assert(bo != NULL); + + _ret = drm_intel_gem_bo_map_gtt(bo); + igt_assert(!_ret); + + virt = bo->virtual; + for (j = 0; j < SIZE/DWORD_SIZE; j++) + igt_assert_eq(virt[j], DATA); + + drm_intel_bo_unmap(bo); + drm_intel_bo_unreference(bo); + } + } + + gem_close(fd, new_handle); + for (i = 0; i < obj_count; i++) + gem_close(fd, handle[i]); +} + +static void +stolen_no_mmap(int fd) +{ + void *addr; + uint32_t handle = 0; + + gem_require_stolen_support(fd); + + handle = gem_create_stolen(fd, SIZE); + + addr = gem_mmap__cpu(fd, handle, 0, SIZE, PROT_READ | PROT_WRITE); + igt_assert(addr == NULL); + + gem_close(fd, handle); +} + +igt_main +{ + int fd; + uint32_t devid; + + igt_skip_on_simulation(); + + igt_fixture { + fd = drm_open_driver(DRIVER_INTEL); + devid = intel_get_drm_devid(fd); + + bufmgr = drm_intel_bufmgr_gem_init(fd, 4096); + batch = intel_batchbuffer_alloc(bufmgr, devid); + } + + igt_subtest("stolen-clear") + verify_object_clear(fd); + + /* + * stolen mem special cases - checking for non cpu mappable + */ + igt_subtest("stolen-no-mmap") + stolen_no_mmap(fd); + + /* checking for pread/pwrite interfaces */ + igt_subtest("stolen-pwrite") + stolen_pwrite(fd); + + igt_subtest("stolen-pread") + stolen_pread(fd); + + /* Functional Test - blt copy */ + igt_subtest("stolen-copy") + copy_test(fd); + + igt_subtest("large-object-alloc") + stolen_large_obj_alloc(fd); + + /* Filling stolen completely and marking all the objects + * purgeable. Then trying to add one more object, to verify + * the purging logic. + * Again marking all objects WILLNEED and verifying the + * contents of the retained objects. + */ + igt_subtest("stolen-fill-purge") + stolen_fill_purge_test(fd); + + igt_fixture { + intel_batchbuffer_free(batch); + drm_intel_bufmgr_destroy(bufmgr); + } +} diff -Nru intel-gpu-tools-1.13/tests/gem_storedw_batches_loop.c intel-gpu-tools-1.15/tests/gem_storedw_batches_loop.c --- intel-gpu-tools-1.13/tests/gem_storedw_batches_loop.c 2015-11-30 16:26:22.000000000 +0000 +++ intel-gpu-tools-1.15/tests/gem_storedw_batches_loop.c 2016-05-23 10:51:28.000000000 +0000 @@ -136,7 +136,7 @@ fd = drm_open_driver(DRIVER_INTEL); devid = intel_get_drm_devid(fd); - has_ppgtt = gem_uses_aliasing_ppgtt(fd); + has_ppgtt = gem_uses_ppgtt(fd); /* storedw needs gtt address on gen4+/g33 and snoopable memory. * Strictly speaking we could implement this now ... */ diff -Nru intel-gpu-tools-1.13/tests/gem_storedw_loop.c intel-gpu-tools-1.15/tests/gem_storedw_loop.c --- intel-gpu-tools-1.13/tests/gem_storedw_loop.c 2015-11-30 16:26:22.000000000 +0000 +++ intel-gpu-tools-1.15/tests/gem_storedw_loop.c 2016-05-23 10:51:28.000000000 +0000 @@ -36,110 +36,129 @@ #include #include #include "drm.h" -#include "intel_bufmgr.h" IGT_TEST_DESCRIPTION("Basic CS check using MI_STORE_DATA_IMM."); #define LOCAL_I915_EXEC_VEBOX (4<<0) -static drm_intel_bufmgr *bufmgr; -struct intel_batchbuffer *batch; -static drm_intel_bo *target_buffer; static int devid; /* * Testcase: Basic bsd MI check using MI_STORE_DATA_IMM */ -static void -emit_store_dword_imm(drm_intel_bo *dest, uint32_t val) -{ - int cmd; - cmd = MI_STORE_DWORD_IMM; +static unsigned coherent_domain; - BEGIN_BATCH(4, 0); - OUT_BATCH(cmd); - if (batch->gen >= 8) { - OUT_RELOC(dest, I915_GEM_DOMAIN_INSTRUCTION, - I915_GEM_DOMAIN_INSTRUCTION, 0); - OUT_BATCH(val); - } else { - OUT_BATCH(0); /* reserved */ - OUT_RELOC(dest, I915_GEM_DOMAIN_INSTRUCTION, - I915_GEM_DOMAIN_INSTRUCTION, 0); - OUT_BATCH(val); +static void * +mmap_coherent(int fd, uint32_t handle, int size) +{ + if (gem_has_llc(fd)) { + coherent_domain = I915_GEM_DOMAIN_CPU; + return gem_mmap__cpu(fd, handle, 0, size, PROT_WRITE); } - ADVANCE_BATCH(); + + coherent_domain = I915_GEM_DOMAIN_GTT; + if (gem_mmap__has_wc(fd)) + return gem_mmap__wc(fd, handle, 0, size, PROT_WRITE); + else + return gem_mmap__gtt(fd, handle, size, PROT_WRITE); } static void -store_dword_loop(int ring, int count, int divider) +store_dword_loop(int fd, int ring, int count, int divider) { int i, val = 0; - uint32_t *buf; + struct drm_i915_gem_execbuffer2 execbuf; + struct drm_i915_gem_exec_object2 obj[2]; + struct drm_i915_gem_relocation_entry reloc[divider]; + uint32_t handle[divider]; + uint32_t *batch[divider]; + uint32_t *target; + int gen = intel_gen(devid); + + memset(obj, 0, sizeof(obj)); + obj[0].handle = gem_create(fd, 4096); + target = mmap_coherent(fd, obj[0].handle, 4096); + + memset(reloc, 0, sizeof(reloc)); + for (i = 0; i < divider; i++) { + uint32_t *b; + + handle[i] = gem_create(fd, 4096); + batch[i] = mmap_coherent(fd, handle[i], 4096); + gem_set_domain(fd, handle[i], coherent_domain, coherent_domain); + + b = batch[i]; + *b++ = MI_STORE_DWORD_IMM; + *b++ = 0; + *b++ = 0; + *b++ = 0; + *b++ = MI_BATCH_BUFFER_END; + + reloc[i].target_handle = obj[0].handle; + reloc[i].offset = 4; + if (gen < 8) + reloc[i].offset += 4; + reloc[i].read_domains = I915_GEM_DOMAIN_INSTRUCTION; + reloc[i].write_domain = I915_GEM_DOMAIN_INSTRUCTION; + obj[1].relocation_count = 1; + } + + memset(&execbuf, 0, sizeof(execbuf)); + execbuf.buffers_ptr = (uintptr_t)obj; + execbuf.buffer_count = 2; + execbuf.flags = ring; igt_info("running storedw loop on render with stall every %i batch\n", divider); for (i = 0; i < SLOW_QUICK(0x2000, 0x10); i++) { - emit_store_dword_imm(target_buffer, val); - intel_batchbuffer_flush_on_ring(batch, ring); - - if (i % divider != 0) - goto cont; + int j = i % divider; - drm_intel_bo_map(target_buffer, 0); - - buf = target_buffer->virtual; - igt_assert_f(buf[0] == val, - "value mismatch: cur 0x%08x, stored 0x%08x\n", - buf[0], val); - - drm_intel_bo_unmap(target_buffer); + gem_set_domain(fd, handle[j], coherent_domain, coherent_domain); + batch[j][3] = val; + obj[1].handle = handle[j]; + obj[1].relocs_ptr = (uintptr_t)&reloc[j]; + gem_execbuf(fd, &execbuf); + + if (j == 0) { + gem_set_domain(fd, obj[0].handle, coherent_domain, 0); + igt_assert_f(*target == val, + "%d: value mismatch: stored 0x%08x, expected 0x%08x\n", + i, *target, val); + } -cont: val++; } - drm_intel_bo_map(target_buffer, 0); - buf = target_buffer->virtual; - - igt_info("completed %d writes successfully, current value: 0x%08x\n", i, - buf[0]); - drm_intel_bo_unmap(target_buffer); + gem_set_domain(fd, obj[0].handle, coherent_domain, 0); + igt_info("completed %d writes successfully, current value: 0x%08x\n", + i, target[0]); + + munmap(target, 4096); + gem_close(fd, obj[0].handle); + for (i = 0; i < divider; ++i) { + munmap(batch[i], 4096); + gem_close(fd, handle[i]); + } } static void -store_test(int ring, int count) +store_test(int fd, int ring, int count) { - drm_intel_bufmgr_gem_enable_reuse(bufmgr); - - batch = intel_batchbuffer_alloc(bufmgr, devid); - igt_assert(batch); - - target_buffer = drm_intel_bo_alloc(bufmgr, "target bo", 4096, 4096); - igt_assert(target_buffer); - - store_dword_loop(ring, count, 1); - store_dword_loop(ring, count, 2); + gem_require_ring(fd, ring); + store_dword_loop(fd, ring, count, 1); + store_dword_loop(fd, ring, count, 2); if (!igt_run_in_simulation()) { - store_dword_loop(ring, count, 3); - store_dword_loop(ring, count, 5); + store_dword_loop(fd, ring, count, 3); + store_dword_loop(fd, ring, count, 5); + store_dword_loop(fd, ring, count, 7); + store_dword_loop(fd, ring, count, 11); + store_dword_loop(fd, ring, count, 13); + store_dword_loop(fd, ring, count, 17); + store_dword_loop(fd, ring, count, 19); } - - drm_intel_bo_unreference(target_buffer); - intel_batchbuffer_free(batch); } -struct ring { - const char *name; - int id; -} rings[] = { - { "bsd", I915_EXEC_BSD }, - { "render", I915_EXEC_RENDER }, - { "blt", I915_EXEC_BLT }, - { "vebox", I915_EXEC_VEBOX }, -}; - static void check_test_requirements(int fd, int ringid) { @@ -150,38 +169,34 @@ igt_main { - int fd, i; + const struct intel_execution_engine *e; + int fd; igt_fixture { fd = drm_open_driver(DRIVER_INTEL); devid = intel_get_drm_devid(fd); - bufmgr = drm_intel_bufmgr_gem_init(fd, 4096); - igt_assert(bufmgr); - igt_skip_on_f(intel_gen(devid) < 6, "MI_STORE_DATA can only use GTT address on gen4+/g33 and " "needs snoopable mem on pre-gen6\n"); /* This only works with ppgtt */ - igt_require(gem_uses_aliasing_ppgtt(fd)); + igt_require(gem_uses_ppgtt(fd)); } - for (i = 0; i < ARRAY_SIZE(rings); i++) { - - igt_subtest_f("basic-%s", rings[i].name) { - check_test_requirements(fd, rings[i].id); - store_test(rings[i].id, 16*1024); + for (e = intel_execution_engines; e->name; e++) { + igt_subtest_f("basic-%s", e->name) { + check_test_requirements(fd, e->exec_id); + store_test(fd, e->exec_id | e->flags, 16*1024); } - igt_subtest_f("long-%s", rings[i].name) { - check_test_requirements(fd, rings[i].id); - store_test(rings[i].id, 1024*1024); + igt_subtest_f("long-%s", e->name) { + check_test_requirements(fd, e->exec_id); + store_test(fd, e->exec_id | e->flags, 1024*1024); } } igt_fixture { - drm_intel_bufmgr_destroy(bufmgr); close(fd); } } diff -Nru intel-gpu-tools-1.13/tests/gem_streaming_writes.c intel-gpu-tools-1.15/tests/gem_streaming_writes.c --- intel-gpu-tools-1.13/tests/gem_streaming_writes.c 2015-11-30 16:26:22.000000000 +0000 +++ intel-gpu-tools-1.15/tests/gem_streaming_writes.c 2016-05-23 10:51:28.000000000 +0000 @@ -51,11 +51,6 @@ IGT_TEST_DESCRIPTION("Test of streaming writes into active GPU sources"); -static bool __gem_execbuf(int fd, struct drm_i915_gem_execbuffer2 *eb) -{ - return drmIoctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, eb) == 0; -} - #define SRC 0 #define DST 1 #define BATCH 2 @@ -109,9 +104,9 @@ execbuf.buffers_ptr = (uintptr_t)exec; execbuf.buffer_count = 2; execbuf.flags = LOCAL_I915_EXEC_HANDLE_LUT; - if (!__gem_execbuf(fd, &execbuf)) { + if (__gem_execbuf(fd, &execbuf)) { execbuf.flags = 0; - igt_require(__gem_execbuf(fd, &execbuf)); + igt_require(__gem_execbuf(fd, &execbuf) == 0); } /* We assume that the active objects are fixed to avoid relocations */ __src_offset = src_offset; @@ -135,7 +130,7 @@ reloc[2*i+1].read_domains = I915_GEM_DOMAIN_RENDER; reloc[2*i+1].write_domain = 0; } - igt_assert(__gem_execbuf(fd, &execbuf)); + gem_execbuf(fd, &execbuf); igt_assert_eq_u64(__src_offset, src_offset); igt_assert_eq_u64(__dst_offset, dst_offset); @@ -154,6 +149,8 @@ batch[i].offset = 0; base = gem_mmap__cpu(fd, batch[i].handle, 0, 4096, PROT_WRITE); + gem_set_domain(fd, batch[i].handle, + I915_GEM_DOMAIN_CPU, I915_GEM_DOMAIN_CPU); for (int j = 0; j < 64; j++) { unsigned x = (n * CHUNK_SIZE) % 4096 >> 2; @@ -243,6 +240,7 @@ struct drm_i915_gem_relocation_entry reloc[2]; uint32_t tmp[] = { MI_BATCH_BUFFER_END }; uint64_t __src_offset, __dst_offset; + bool need_64b_start_offset = true; uint64_t batch_size; uint32_t *s, *d; uint32_t *base; @@ -302,7 +300,7 @@ execbuf.flags = LOCAL_I915_EXEC_HANDLE_LUT; if (gem_has_blt(fd)) execbuf.flags |= I915_EXEC_BLT; - if (!__gem_execbuf(fd, &execbuf)) { + if (__gem_execbuf(fd, &execbuf)) { execbuf.flags &= ~LOCAL_I915_EXEC_HANDLE_LUT; gem_execbuf(fd, &execbuf); } @@ -327,7 +325,8 @@ int k; execbuf.batch_start_offset = 128 * offset; - execbuf.batch_start_offset += 8 * (pass & 7); + if (!need_64b_start_offset) + execbuf.batch_start_offset += 8 * (pass & 7); igt_assert(execbuf.batch_start_offset <= batch_size - 64); if (reverse) execbuf.batch_start_offset = batch_size - execbuf.batch_start_offset - 64; diff -Nru intel-gpu-tools-1.13/tests/gem_sync.c intel-gpu-tools-1.15/tests/gem_sync.c --- intel-gpu-tools-1.13/tests/gem_sync.c 1970-01-01 00:00:00.000000000 +0000 +++ intel-gpu-tools-1.15/tests/gem_sync.c 2016-05-23 10:51:28.000000000 +0000 @@ -0,0 +1,238 @@ +/* + * Copyright © 2016 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 "igt.h" + +IGT_TEST_DESCRIPTION("Basic check of ring<->ring write synchronisation."); + +/* + * Testcase: Basic check of sync + * + * Extremely efficient at catching missed irqs + */ + +static double gettime(void) +{ + static clockid_t clock = -1; + struct timespec ts; + + /* Stay on the same clock for consistency. */ + if (clock != (clockid_t)-1) { + if (clock_gettime(clock, &ts)) + goto error; + goto out; + } + +#ifdef CLOCK_MONOTONIC_RAW + if (!clock_gettime(clock = CLOCK_MONOTONIC_RAW, &ts)) + goto out; +#endif +#ifdef CLOCK_MONOTONIC_COARSE + if (!clock_gettime(clock = CLOCK_MONOTONIC_COARSE, &ts)) + goto out; +#endif + if (!clock_gettime(clock = CLOCK_MONOTONIC, &ts)) + goto out; +error: + igt_warn("Could not read monotonic time: %s\n", + strerror(errno)); + igt_assert(0); + return 0; + +out: + return ts.tv_sec + 1e-9*ts.tv_nsec; +} + +static void +sync_ring(int fd, unsigned ring, int num_children) +{ + unsigned engines[16]; + const char *names[16]; + int num_engines = 0; + + if (ring == ~0u) { + const struct intel_execution_engine *e; + + for (e = intel_execution_engines; e->name; e++) { + if (e->exec_id == 0) + continue; + + if (!gem_has_ring(fd, e->exec_id | e->flags)) + continue; + + if (e->exec_id == I915_EXEC_BSD) { + int is_bsd2 = e->flags != 0; + if (gem_has_bsd2(fd) != is_bsd2) + continue; + } + + names[num_engines] = e->name; + engines[num_engines++] = e->exec_id | e->flags; + if (num_engines == ARRAY_SIZE(engines)) + break; + } + + num_children *= num_engines; + } else { + gem_require_ring(fd, ring); + names[num_engines] = NULL; + engines[num_engines++] = ring; + } + + intel_detect_and_clear_missed_interrupts(fd); + igt_fork(child, num_children) { + const uint32_t bbe = MI_BATCH_BUFFER_END; + struct drm_i915_gem_exec_object2 object; + struct drm_i915_gem_execbuffer2 execbuf; + double start, elapsed; + unsigned long cycles; + + memset(&object, 0, sizeof(object)); + object.handle = gem_create(fd, 4096); + gem_write(fd, object.handle, 0, &bbe, sizeof(bbe)); + + memset(&execbuf, 0, sizeof(execbuf)); + execbuf.buffers_ptr = (uintptr_t)&object; + execbuf.buffer_count = 1; + execbuf.flags = engines[child % num_engines]; + gem_execbuf(fd, &execbuf); + + start = gettime(); + cycles = 0; + do { + do { + gem_execbuf(fd, &execbuf); + gem_sync(fd, object.handle); + } while (++cycles & 1023); + } while ((elapsed = gettime() - start) < SLOW_QUICK(10, 1)); + igt_info("%s%sompleted %ld cycles: %.3f us\n", + names[child % num_engines] ?: "", + names[child % num_engines] ? " c" : "C", + cycles, elapsed*1e6/cycles); + + gem_close(fd, object.handle); + } + igt_waitchildren_timeout(20, NULL); + igt_assert_eq(intel_detect_and_clear_missed_interrupts(fd), 0); +} + +static void +sync_all(int fd, int num_children) +{ + const struct intel_execution_engine *e; + unsigned engines[16]; + int num_engines = 0; + + for (e = intel_execution_engines; e->name; e++) { + if (e->exec_id == 0) + continue; + + if (!gem_has_ring(fd, e->exec_id | e->flags)) + continue; + + if (e->exec_id == I915_EXEC_BSD) { + int is_bsd2 = e->flags != 0; + if (gem_has_bsd2(fd) != is_bsd2) + continue; + } + + engines[num_engines++] = e->exec_id | e->flags; + if (num_engines == ARRAY_SIZE(engines)) + break; + } + igt_require(num_engines); + + intel_detect_and_clear_missed_interrupts(fd); + igt_fork(child, num_children) { + const uint32_t bbe = MI_BATCH_BUFFER_END; + struct drm_i915_gem_exec_object2 object; + struct drm_i915_gem_execbuffer2 execbuf; + double start, elapsed; + unsigned long cycles; + + memset(&object, 0, sizeof(object)); + object.handle = gem_create(fd, 4096); + gem_write(fd, object.handle, 0, &bbe, sizeof(bbe)); + + memset(&execbuf, 0, sizeof(execbuf)); + execbuf.buffers_ptr = (uintptr_t)&object; + execbuf.buffer_count = 1; + gem_execbuf(fd, &execbuf); + + start = gettime(); + cycles = 0; + do { + do { + for (int n = 0; n < num_engines; n++) { + execbuf.flags = engines[n]; + gem_execbuf(fd, &execbuf); + } + gem_sync(fd, object.handle); + } while (++cycles & 1023); + } while ((elapsed = gettime() - start) < SLOW_QUICK(10, 1)); + igt_info("Completed %ld cycles: %.3f us\n", + cycles, elapsed*1e6/cycles); + + gem_close(fd, object.handle); + } + igt_waitchildren_timeout(20, NULL); + igt_assert_eq(intel_detect_and_clear_missed_interrupts(fd), 0); +} + +igt_main +{ + const struct intel_execution_engine *e; + const int ncpus = sysconf(_SC_NPROCESSORS_ONLN); + int fd = -1; + + igt_skip_on_simulation(); + + igt_fixture + fd = drm_open_driver(DRIVER_INTEL); + + igt_fork_hang_detector(fd); + + for (e = intel_execution_engines; e->name; e++) { + igt_subtest_f("%s", e->name) + sync_ring(fd, e->exec_id | e->flags, 1); + igt_subtest_f("forked-%s", e->name) + sync_ring(fd, e->exec_id | e->flags, ncpus); + } + + igt_subtest("basic-each") + sync_ring(fd, ~0u, 1); + igt_subtest("forked-each") + sync_ring(fd, ~0u, ncpus); + + igt_subtest("basic-all") + sync_all(fd, 1); + igt_subtest("forked-all") + sync_all(fd, ncpus); + + igt_stop_hang_detector(); + + igt_fixture + close(fd); +} diff -Nru intel-gpu-tools-1.13/tests/gem_userptr_blits.c intel-gpu-tools-1.15/tests/gem_userptr_blits.c --- intel-gpu-tools-1.13/tests/gem_userptr_blits.c 2015-11-30 16:26:23.000000000 +0000 +++ intel-gpu-tools-1.15/tests/gem_userptr_blits.c 2016-05-23 10:51:28.000000000 +0000 @@ -61,17 +61,6 @@ #define PAGE_SIZE 4096 #endif -#define LOCAL_I915_GEM_USERPTR 0x33 -#define LOCAL_IOCTL_I915_GEM_USERPTR DRM_IOWR (DRM_COMMAND_BASE + LOCAL_I915_GEM_USERPTR, struct local_i915_gem_userptr) -struct local_i915_gem_userptr { - uint64_t user_ptr; - uint64_t user_size; - uint32_t flags; -#define LOCAL_I915_USERPTR_READ_ONLY (1<<0) -#define LOCAL_I915_USERPTR_UNSYNCHRONIZED (1<<31) - uint32_t handle; -}; - static uint32_t userptr_flags = LOCAL_I915_USERPTR_UNSYNCHRONIZED; #define WIDTH 512 @@ -89,32 +78,6 @@ userptr_flags = 0; } -static int gem_userptr(int fd, void *ptr, int size, int read_only, uint32_t *handle) -{ - struct local_i915_gem_userptr userptr; - int ret; - - memset(&userptr, 0, sizeof(userptr)); - userptr.user_ptr = (uintptr_t)ptr; - userptr.user_size = size; - userptr.flags = userptr_flags; - if (read_only) - userptr.flags |= LOCAL_I915_USERPTR_READ_ONLY; - - ret = drmIoctl(fd, LOCAL_IOCTL_I915_GEM_USERPTR, &userptr); - if (ret) - ret = errno; - igt_skip_on_f(ret == ENODEV && - (userptr_flags & LOCAL_I915_USERPTR_UNSYNCHRONIZED) == 0 && - !read_only, - "Skipping, synchronized mappings with no kernel CONFIG_MMU_NOTIFIER?"); - if (ret == 0) - *handle = userptr.handle; - - return ret; -} - - static void gem_userptr_sync(int fd, uint32_t handle) { gem_set_domain(fd, handle, I915_GEM_DOMAIN_CPU, I915_GEM_DOMAIN_CPU); @@ -173,8 +136,8 @@ reloc[1].read_domains = I915_GEM_DOMAIN_RENDER; reloc[1].write_domain = 0; + memset(&exec, 0, sizeof(exec)); memset(obj, 0, sizeof(obj)); - exec.buffer_count = 0; obj[exec.buffer_count++].handle = dst; if (src != dst) obj[exec.buffer_count++].handle = src; @@ -183,26 +146,15 @@ obj[exec.buffer_count].relocs_ptr = (uintptr_t)reloc; exec.buffer_count++; exec.buffers_ptr = (uintptr_t)obj; - - exec.batch_start_offset = 0; - exec.batch_len = i * 4; - 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); - if (ret) - ret = errno; + ret = __gem_execbuf(fd, &exec); + gem_close(fd, handle); if (error == ~0) igt_assert_neq(ret, 0); else - igt_assert(ret == error); - - gem_close(fd, handle); + igt_assert_eq(ret, -error); } static int @@ -257,6 +209,7 @@ reloc[1].read_domains = I915_GEM_DOMAIN_RENDER; reloc[1].write_domain = 0; + memset(&exec, 0, sizeof(exec)); obj = calloc(n_bo + 1, sizeof(*obj)); for (n = 0; n < n_bo; n++) obj[n].handle = all_bo[n]; @@ -266,19 +219,9 @@ exec.buffers_ptr = (uintptr_t)obj; exec.buffer_count = n_bo + 1; - exec.batch_start_offset = 0; - exec.batch_len = i * 4; - 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); - if (ret) - ret = errno; + ret = __gem_execbuf(fd, &exec); gem_close(fd, handle); free(obj); @@ -289,10 +232,9 @@ create_userptr(int fd, uint32_t val, uint32_t *ptr) { uint32_t handle; - int i, ret; + int i; - ret = gem_userptr(fd, ptr, sizeof(linear), 0, &handle); - igt_assert_eq(ret, 0); + gem_userptr(fd, ptr, sizeof(linear), 0, userptr_flags, &handle); igt_assert(handle != 0); /* Fill the BO with dwords starting at val */ @@ -363,7 +305,6 @@ { void *ptr; uint32_t handle; - int ret; ptr = mmap(NULL, size, PROT_READ | PROT_WRITE, @@ -371,8 +312,7 @@ -1, 0); igt_assert(ptr != MAP_FAILED); - ret = gem_userptr(fd, (uint32_t *)ptr, size, 0, &handle); - igt_assert_eq(ret, 0); + gem_userptr(fd, (uint32_t *)ptr, size, 0, userptr_flags, &handle); add_handle_ptr(handle, ptr, size); return handle; @@ -388,7 +328,7 @@ handle_size_map[old_handle]); } -static void clear(int fd, uint32_t handle, int size) +static void clear(int fd, uint32_t handle, uint64_t size) { void *ptr = get_handle_ptr(handle); @@ -450,7 +390,7 @@ igt_assert(posix_memalign(&ptr, PAGE_SIZE, PAGE_SIZE) == 0); oldflags = userptr_flags; gem_userptr_test_unsynchronized(); - ret = gem_userptr(fd, ptr, PAGE_SIZE, 0, &handle); + ret = __gem_userptr(fd, ptr, PAGE_SIZE, 0, userptr_flags, &handle); userptr_flags = oldflags; if (ret != 0) { free(ptr); @@ -509,7 +449,7 @@ igt_assert(posix_memalign(&ptr, PAGE_SIZE, PAGE_SIZE) == 0); - ret = gem_userptr(fd, ptr, PAGE_SIZE, 0, &handle); + ret = __gem_userptr(fd, ptr, PAGE_SIZE, 0, userptr_flags, &handle); if (ret == 0) gem_close(fd, handle); free(ptr); @@ -524,11 +464,9 @@ static int test_invalid_null_pointer(int fd) { uint32_t handle; - int ret; /* NULL pointer. */ - ret = gem_userptr(fd, NULL, PAGE_SIZE, 0, &handle); - igt_assert_eq(ret, 0); + gem_userptr(fd, NULL, PAGE_SIZE, 0, userptr_flags, &handle); copy(fd, handle, handle, ~0); /* QQQ Precise errno? */ gem_close(fd, handle); @@ -540,7 +478,6 @@ { uint32_t handle, handle2; void *ptr; - int ret; /* GTT mapping */ handle = create_bo(fd, 0); @@ -550,8 +487,7 @@ igt_assert(((unsigned long)ptr & (PAGE_SIZE - 1)) == 0); igt_assert((sizeof(linear) & (PAGE_SIZE - 1)) == 0); - ret = gem_userptr(fd, ptr, sizeof(linear), 0, &handle2); - igt_assert_eq(ret, 0); + gem_userptr(fd, ptr, sizeof(linear), 0, userptr_flags, &handle2); copy(fd, handle2, handle2, ~0); /* QQQ Precise errno? */ gem_close(fd, handle2); @@ -594,8 +530,7 @@ #ifdef MADV_DONTFORK ret |= madvise(ptr1, sizeof(linear), MADV_DONTFORK); #endif - ret |= gem_userptr(fd, ptr1, sizeof(linear), 0, &handle1); - igt_assert_eq(ret, 0); + gem_userptr(fd, ptr1, sizeof(linear), 0, userptr_flags, &handle1); igt_assert(ptr1); igt_assert(handle1); @@ -603,8 +538,7 @@ #ifdef MADV_DONTFORK ret |= madvise(ptr2, sizeof(linear), MADV_DONTFORK); #endif - ret |= gem_userptr(fd, ptr2, sizeof(linear), 0, &handle2); - igt_assert_eq(ret, 0); + gem_userptr(fd, ptr2, sizeof(linear), 0, userptr_flags, &handle2); igt_assert(ptr2); igt_assert(handle2); @@ -651,8 +585,7 @@ igt_assert(posix_memalign(&ptr, PAGE_SIZE, PAGE_SIZE) == 0); - ret = gem_userptr(fd, ptr, PAGE_SIZE, 0, &handle); - igt_assert_eq(ret, 0); + gem_userptr(fd, ptr, PAGE_SIZE, 0, userptr_flags, &handle); /* pread/pwrite are not always forbidden, but when they * are they should fail with EINVAL. @@ -677,6 +610,45 @@ return 0; } +static void test_relocations(int fd) +{ + struct drm_i915_gem_relocation_entry *reloc; + struct drm_i915_gem_exec_object2 obj; + struct drm_i915_gem_execbuffer2 exec; + unsigned size; + void *ptr; + int i; + + size = PAGE_SIZE + ALIGN(sizeof(*reloc)*256, PAGE_SIZE); + + memset(&obj, 0, sizeof(obj)); + igt_assert(posix_memalign(&ptr, PAGE_SIZE, size) == 0); + gem_userptr(fd, ptr, size, 0, userptr_flags, &obj.handle); + if (!gem_has_llc(fd)) + gem_set_caching(fd, obj.handle, 0); + *(uint32_t *)ptr = MI_BATCH_BUFFER_END; + + reloc = (typeof(reloc))((char *)ptr + PAGE_SIZE); + obj.relocs_ptr = (uintptr_t)reloc; + obj.relocation_count = 256; + + memset(reloc, 0, 256*sizeof(*reloc)); + for (i = 0; i < 256; i++) { + reloc[i].offset = 2048 - 4*i; + reloc[i].target_handle = obj.handle; + reloc[i].read_domains = I915_GEM_DOMAIN_INSTRUCTION; + } + + memset(&exec, 0, sizeof(exec)); + exec.buffers_ptr = (uintptr_t)&obj; + exec.buffer_count = 1; + gem_execbuf(fd, &exec); + + gem_sync(fd, obj.handle); + gem_close(fd, obj.handle); + free(ptr); +} + static unsigned char counter; static void (* volatile orig_sigbus)(int sig, siginfo_t *info, void *param); @@ -839,19 +811,19 @@ igt_assert(posix_memalign(&ptr, PAGE_SIZE, PAGE_SIZE * 2) == 0); /* Address not aligned. */ - ret = gem_userptr(fd, (char *)ptr + 1, PAGE_SIZE, 0, &handle); + ret = __gem_userptr(fd, (char *)ptr + 1, PAGE_SIZE, 0, userptr_flags, &handle); igt_assert_neq(ret, 0); /* Size not rounded to page size. */ - ret = gem_userptr(fd, ptr, PAGE_SIZE - 1, 0, &handle); + ret = __gem_userptr(fd, ptr, PAGE_SIZE - 1, 0, userptr_flags, &handle); igt_assert_neq(ret, 0); /* Both wrong. */ - ret = gem_userptr(fd, (char *)ptr + 1, PAGE_SIZE - 1, 0, &handle); + ret = __gem_userptr(fd, (char *)ptr + 1, PAGE_SIZE - 1, 0, userptr_flags, &handle); igt_assert_neq(ret, 0); /* Read-only not supported. */ - ret = gem_userptr(fd, (char *)ptr, PAGE_SIZE, 1, &handle); + ret = __gem_userptr(fd, (char *)ptr, PAGE_SIZE, 1, userptr_flags, &handle); igt_assert_neq(ret, 0); free(ptr); @@ -873,7 +845,7 @@ for (n = 0; n < 1000; n++) { igt_assert(posix_memalign(&ptr, PAGE_SIZE, PAGE_SIZE) == 0); - do_or_die(gem_userptr(fd, ptr, PAGE_SIZE, 0, &handle)); + do_or_die(__gem_userptr(fd, ptr, PAGE_SIZE, 0, userptr_flags, &handle)); gem_close(fd, handle); free(ptr); @@ -1028,6 +1000,7 @@ static void test_mlocked_evictions(int fd, int size, int count) { + count = min(256, count/2); mlocked_evictions(fd, &fault_ops, size, count); reset_handle_ptr(); } @@ -1065,41 +1038,40 @@ igt_assert(posix_memalign((void *)&ptr, PAGE_SIZE, PAGE_SIZE * 3) == 0); - ret = gem_userptr(fd, ptr + PAGE_SIZE, PAGE_SIZE, 0, &handle); - igt_assert_eq(ret, 0); + gem_userptr(fd, ptr + PAGE_SIZE, PAGE_SIZE, 0, userptr_flags, &handle); /* before, no overlap */ - ret = gem_userptr(fd, ptr, PAGE_SIZE, 0, &handle2); + ret = __gem_userptr(fd, ptr, PAGE_SIZE, 0, userptr_flags, &handle2); if (ret == 0) gem_close(fd, handle2); igt_assert_eq(ret, 0); /* after, no overlap */ - ret = gem_userptr(fd, ptr + PAGE_SIZE * 2, PAGE_SIZE, 0, &handle2); + ret = __gem_userptr(fd, ptr + PAGE_SIZE * 2, PAGE_SIZE, 0, userptr_flags, &handle2); if (ret == 0) gem_close(fd, handle2); igt_assert_eq(ret, 0); /* exactly overlapping */ - ret = gem_userptr(fd, ptr + PAGE_SIZE, PAGE_SIZE, 0, &handle2); + ret = __gem_userptr(fd, ptr + PAGE_SIZE, PAGE_SIZE, 0, userptr_flags, &handle2); if (ret == 0) gem_close(fd, handle2); igt_assert(ret == 0 || ret == expected); /* start overlaps */ - ret = gem_userptr(fd, ptr, PAGE_SIZE * 2, 0, &handle2); + ret = __gem_userptr(fd, ptr, PAGE_SIZE * 2, 0, userptr_flags, &handle2); if (ret == 0) gem_close(fd, handle2); igt_assert(ret == 0 || ret == expected); /* end overlaps */ - ret = gem_userptr(fd, ptr + PAGE_SIZE, PAGE_SIZE * 2, 0, &handle2); + ret = __gem_userptr(fd, ptr + PAGE_SIZE, PAGE_SIZE * 2, 0, userptr_flags, &handle2); if (ret == 0) gem_close(fd, handle2); igt_assert(ret == 0 || ret == expected); /* subsumes */ - ret = gem_userptr(fd, ptr, PAGE_SIZE * 3, 0, &handle2); + ret = __gem_userptr(fd, ptr, PAGE_SIZE * 3, 0, userptr_flags, &handle2); if (ret == 0) gem_close(fd, handle2); igt_assert(ret == 0 || ret == expected); @@ -1124,8 +1096,7 @@ bo_ptr = (char *)ALIGN((unsigned long)ptr, PAGE_SIZE); for (i = 0; i < num_obj; i++, bo_ptr += sizeof(linear)) { - ret = gem_userptr(fd, bo_ptr, sizeof(linear), 0, &bo[i]); - igt_assert_eq(ret, 0); + gem_userptr(fd, bo_ptr, sizeof(linear), 0, userptr_flags, &bo[i]); } bo[num_obj] = create_bo(fd, 0); @@ -1159,8 +1130,7 @@ bo_ptr = (char *)ALIGN((unsigned long)ptr, PAGE_SIZE); for (i = 0; i < num_obj; i++, bo_ptr += sizeof(linear)) { - ret = gem_userptr(fd, bo_ptr, sizeof(linear), 0, &bo[i]); - igt_assert_eq(ret, 0); + gem_userptr(fd, bo_ptr, sizeof(linear), 0, userptr_flags, &bo[i]); } bo[num_obj] = create_bo(fd, 0); @@ -1230,8 +1200,7 @@ igt_assert_eq(ret, 0); while (loops--) { - ret = gem_userptr(fd, ptr, PAGE_SIZE, 0, &handle); - igt_assert_eq(ret, 0); + gem_userptr(fd, ptr, PAGE_SIZE, 0, userptr_flags, &handle); gem_close(fd, handle); } @@ -1265,8 +1234,7 @@ while (!t->stop) { pthread_mutex_unlock(&t->mutex); for (int i = 0; i < num_handles; i++) - igt_assert_eq(gem_userptr(t->fd, t->ptr, PAGE_SIZE, 0, &handle[i]), - 0); + gem_userptr(t->fd, t->ptr, PAGE_SIZE, 0, userptr_flags, &handle[i]); for (int i = 0; i < num_handles; i++) gem_close(t->fd, handle[i]); pthread_mutex_lock(&t->mutex); @@ -1305,7 +1273,7 @@ free(t_data.ptr); } -unsigned int total_ram; +uint64_t total_ram; uint64_t aperture_size; int fd, count; @@ -1337,7 +1305,7 @@ count = 2 * aperture_size / (1024*1024) / 3; total_ram = intel_get_total_ram_mb(); - igt_info("Total RAM is %u MiB\n", total_ram); + igt_info("Total RAM is %'llu MiB\n", (long long)total_ram); if (count > total_ram * 3 / 4) { count = intel_get_total_ram_mb() * 3 / 4; @@ -1363,6 +1331,9 @@ igt_subtest("forbidden-operations") test_forbidden_ops(fd); + igt_subtest("relocations") + test_relocations(fd); + igt_info("Testing unsynchronized mappings...\n"); gem_userptr_test_unsynchronized(); diff -Nru intel-gpu-tools-1.13/tests/gem_wait.c intel-gpu-tools-1.15/tests/gem_wait.c --- intel-gpu-tools-1.13/tests/gem_wait.c 2015-11-30 16:26:23.000000000 +0000 +++ intel-gpu-tools-1.15/tests/gem_wait.c 2016-05-23 10:51:28.000000000 +0000 @@ -64,23 +64,6 @@ return ret; } -static int -gem_bo_wait_timeout(int fd, uint32_t handle, int64_t *timeout_ns) -{ - struct drm_i915_gem_wait wait; - int ret; - - igt_assert(timeout_ns); - - wait.bo_handle = handle; - wait.timeout_ns = *timeout_ns; - wait.flags = 0; - ret = drmIoctl(fd, DRM_IOCTL_I915_GEM_WAIT, &wait); - *timeout_ns = wait.timeout_ns; - - return ret ? -errno : 0; -} - static void blt_color_fill(struct intel_batchbuffer *batch, drm_intel_bo *buf, const unsigned int pages) @@ -122,7 +105,7 @@ dst = drm_intel_bo_alloc(bufmgr, "dst", BUF_SIZE, 4096); dst2 = drm_intel_bo_alloc(bufmgr, "dst2", BUF_SIZE, 4096); - igt_skip_on_f(gem_bo_wait_timeout(fd, dst->handle, &timeout) == -EINVAL, + igt_skip_on_f(gem_wait(fd, dst->handle, &timeout) == -EINVAL, "kernel doesn't support wait_timeout, skipping test\n"); timeout = ENOUGH_WORK_IN_SECONDS * NSEC_PER_SEC; @@ -155,7 +138,7 @@ igt_assert_lt(iter, 1000000); - igt_info("%d iters is enough work\n", iter); + igt_debug("%d iters is enough work\n", iter); gem_quiescent_gpu(fd); if (do_signals) igt_fork_signal_helper(); @@ -169,18 +152,17 @@ intel_batchbuffer_flush(batch); igt_assert(gem_bo_busy(fd, dst2->handle) == true); - igt_assert_eq(gem_bo_wait_timeout(fd, dst2->handle, &timeout), 0); + igt_assert_eq(gem_wait(fd, dst2->handle, &timeout), 0); igt_assert(gem_bo_busy(fd, dst2->handle) == false); igt_assert_neq(timeout, 0); if (timeout == (ENOUGH_WORK_IN_SECONDS * NSEC_PER_SEC)) igt_info("Buffer was already done!\n"); - else { - igt_info("Finished with %" PRIu64 " time remaining\n", timeout); - } + else + igt_info("Finished with %fs remaining\n", timeout*1e-9); /* check that polling with timeout=0 works. */ timeout = 0; - igt_assert_eq(gem_bo_wait_timeout(fd, dst2->handle, &timeout), 0); + igt_assert_eq(gem_wait(fd, dst2->handle, &timeout), 0); igt_assert_eq(timeout, 0); /* Now check that we correctly time out, twice the auto-tune load should @@ -191,14 +173,14 @@ intel_batchbuffer_flush(batch); - ret = gem_bo_wait_timeout(fd, dst2->handle, &timeout); + ret = gem_wait(fd, dst2->handle, &timeout); igt_assert_eq(ret, -ETIME); igt_assert_eq(timeout, 0); igt_assert(gem_bo_busy(fd, dst2->handle) == true); /* check that polling with timeout=0 works. */ timeout = 0; - igt_assert_eq(gem_bo_wait_timeout(fd, dst2->handle, &timeout), -ETIME); + igt_assert_eq(gem_wait(fd, dst2->handle, &timeout), -ETIME); igt_assert_eq(timeout, 0); @@ -209,7 +191,7 @@ intel_batchbuffer_flush(batch); - igt_assert_eq(gem_bo_wait_timeout(fd, dst2->handle, &negative_timeout), 0); + igt_assert_eq(gem_wait(fd, dst2->handle, &negative_timeout), 0); igt_assert_eq(negative_timeout, -1); /* infinity always remains */ igt_assert(gem_bo_busy(fd, dst2->handle) == false); diff -Nru intel-gpu-tools-1.13/tests/gem_workarounds.c intel-gpu-tools-1.15/tests/gem_workarounds.c --- intel-gpu-tools-1.13/tests/gem_workarounds.c 2015-11-30 16:26:23.000000000 +0000 +++ intel-gpu-tools-1.15/tests/gem_workarounds.c 2016-05-23 10:51:28.000000000 +0000 @@ -27,25 +27,11 @@ #define _GNU_SOURCE #include "igt.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - enum operation { - GPU_RESET = 0x01, - SUSPEND_RESUME = 0x02, - SIMPLE_READ = 0x03, + GPU_RESET, + SUSPEND_RESUME, + SIMPLE_READ, }; struct intel_wa_reg { @@ -54,57 +40,21 @@ uint32_t mask; }; -static int drm_fd; -static uint32_t devid; -static drm_intel_bufmgr *bufmgr; -struct intel_batchbuffer *batch; -static int num_wa_regs; - static struct intel_wa_reg *wa_regs; +static int num_wa_regs; static void wait_gpu(void) { - struct drm_i915_gem_execbuffer2 execbuf; - struct drm_i915_gem_exec_object2 gem_exec; - uint32_t b[2] = {MI_BATCH_BUFFER_END}; - - memset(&gem_exec, 0, sizeof(gem_exec)); - gem_exec.handle = gem_create(drm_fd, 4096); - gem_write(drm_fd, gem_exec.handle, 0, b, sizeof(b)); - - memset(&execbuf, 0, sizeof(execbuf)); - execbuf.buffers_ptr = (uintptr_t)&gem_exec; - execbuf.buffer_count = 1; - execbuf.batch_len = sizeof(b); - - drmIoctl(drm_fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, &execbuf); - - gem_sync(drm_fd, gem_exec.handle); - - gem_close(drm_fd, gem_exec.handle); + int fd = drm_open_driver(DRIVER_INTEL); + gem_quiescent_gpu(fd); + close(fd); } static void test_hang_gpu(void) { - int retry_count = 30; - enum stop_ring_flags flags; - - igt_assert(retry_count); - igt_set_stop_rings(STOP_RING_DEFAULTS); - - wait_gpu(); - - while(retry_count--) { - flags = igt_get_stop_rings(); - if (flags == 0) - break; - igt_info("gpu hang not yet cleared, retries left %d\n", retry_count); - sleep(1); - } - - flags = igt_get_stop_rings(); - if (flags) - igt_set_stop_rings(STOP_RING_NONE); + int fd = drm_open_driver(DRIVER_INTEL); + igt_post_hang_ring(fd, igt_hang_ring(fd, I915_EXEC_DEFAULT)); + close(fd); } static void test_suspend_resume(void) @@ -117,8 +67,6 @@ { int i, fail_count = 0; - intel_register_access_init(intel_get_pci_device(), 0); - /* There is a small delay after coming ot of rc6 to the correct render context values will get loaded by hardware (bdw,chv). This here ensures that we have the correct context loaded before @@ -145,8 +93,6 @@ } } - intel_register_access_fini(); - return fail_count; } @@ -176,48 +122,44 @@ igt_main { igt_fixture { - int i; - int fd; - int ret; + struct pci_device *pci_dev; FILE *file; char *line = NULL; size_t line_size; + int i; - drm_fd = drm_open_driver(DRIVER_INTEL); - - bufmgr = drm_intel_bufmgr_gem_init(drm_fd, 4096); - devid = intel_get_drm_devid(drm_fd); - batch = intel_batchbuffer_alloc(bufmgr, devid); - - fd = igt_debugfs_open("i915_wa_registers", O_RDONLY); - igt_assert(fd >= 0); + pci_dev = intel_get_pci_device(); + igt_require(pci_dev); - file = fdopen(fd, "r"); - igt_assert(file > 0); + intel_register_access_init(pci_dev, 0); - ret = getline(&line, &line_size, file); - igt_assert(ret > 0); + file = igt_debugfs_fopen("i915_wa_registers", "r"); + igt_assert(getline(&line, &line_size, file) > 0); + igt_debug("i915_wa_registers: %s", line); sscanf(line, "Workarounds applied: %d", &num_wa_regs); - if (IS_BROADWELL(devid) || - IS_CHERRYVIEW(devid)) + if (IS_BROADWELL(pci_dev->device_id) || + IS_CHERRYVIEW(pci_dev->device_id)) igt_assert(num_wa_regs > 0); else igt_assert(num_wa_regs >= 0); wa_regs = malloc(num_wa_regs * sizeof(*wa_regs)); + igt_assert(wa_regs); i = 0; - while(getline(&line, &line_size, file) > 0) { - sscanf(line, "0x%X: 0x%08X, mask: 0x%08X", - &wa_regs[i].addr, &wa_regs[i].value, - &wa_regs[i].mask); - ++i; + while (getline(&line, &line_size, file) > 0) { + igt_debug("%s", line); + igt_assert(i < num_wa_regs); + if (sscanf(line, "0x%X: 0x%08X, mask: 0x%08X", + &wa_regs[i].addr, + &wa_regs[i].value, + &wa_regs[i].mask) == 3) + i++; } free(line); fclose(file); - close(fd); } igt_subtest("read") @@ -231,6 +173,7 @@ igt_fixture { free(wa_regs); - close(drm_fd); + intel_register_access_fini(); } + } diff -Nru intel-gpu-tools-1.13/tests/kms_3d.c intel-gpu-tools-1.15/tests/kms_3d.c --- intel-gpu-tools-1.13/tests/kms_3d.c 2015-11-30 16:26:23.000000000 +0000 +++ intel-gpu-tools-1.15/tests/kms_3d.c 2016-05-23 10:51:28.000000000 +0000 @@ -43,7 +43,7 @@ /* find an hdmi connector */ for (int i = 0; i < res->count_connectors; i++) { - connector = drmModeGetConnector(drm_fd, res->connectors[i]); + connector = drmModeGetConnectorCurrent(drm_fd, res->connectors[i]); if (connector->connector_type == DRM_MODE_CONNECTOR_HDMIA && connector->connection == DRM_MODE_DISCONNECTED) @@ -66,7 +66,7 @@ /* check for 3D modes */ mode_count = 0; - connector = drmModeGetConnector(drm_fd, connector_id); + connector = drmModeGetConnectorCurrent(drm_fd, connector_id); for (int i = 0; i < connector->count_modes; i++) { if (connector->modes[i].flags & DRM_MODE_FLAG_3D_MASK) mode_count++; diff -Nru intel-gpu-tools-1.13/tests/kms_addfb_basic.c intel-gpu-tools-1.15/tests/kms_addfb_basic.c --- intel-gpu-tools-1.13/tests/kms_addfb_basic.c 2015-11-30 16:26:23.000000000 +0000 +++ intel-gpu-tools-1.15/tests/kms_addfb_basic.c 2016-05-23 10:51:28.000000000 +0000 @@ -51,9 +51,11 @@ f.pitches[0] = 512*4; igt_fixture { - gem_bo = gem_create(fd, 1024*1024*4); + gem_bo = igt_create_bo_with_dimensions(fd, 1024, 1024, + DRM_FORMAT_XRGB8888, 0, 0, NULL, NULL, NULL); igt_assert(gem_bo); - gem_bo_small = gem_create(fd, 1024*1024*4 - 4096); + gem_bo_small = igt_create_bo_with_dimensions(fd, 1024, 1023, + DRM_FORMAT_XRGB8888, 0, 0, NULL, NULL, NULL); igt_assert(gem_bo_small); f.handles[0] = gem_bo; @@ -129,7 +131,8 @@ f.pitches[0] = 1024*4; igt_fixture { - gem_bo = gem_create(fd, 1024*1024*4); + gem_bo = igt_create_bo_with_dimensions(fd, 1024, 1024, + DRM_FORMAT_XRGB8888, 0, 0, NULL, NULL, NULL); igt_assert(gem_bo); } @@ -154,39 +157,78 @@ } igt_fixture - gem_set_tiling(fd, gem_bo, I915_TILING_X, 1024*4); + gem_close(fd, gem_bo); +} + +static void tiling_tests(int fd) +{ + struct drm_mode_fb_cmd2 f = {}; + uint32_t tiled_x_bo = 0; + uint32_t tiled_y_bo = 0; + + f.width = 512; + f.height = 512; + f.pixel_format = DRM_FORMAT_XRGB8888; f.pitches[0] = 1024*4; - igt_subtest("basic-X-tiled") { - igt_assert(drmIoctl(fd, DRM_IOCTL_MODE_ADDFB2, &f) == 0); - igt_assert(drmIoctl(fd, DRM_IOCTL_MODE_RMFB, &f.fb_id) == 0); - f.fb_id = 0; - } + igt_subtest_group { + igt_fixture { + tiled_x_bo = igt_create_bo_with_dimensions(fd, 1024, 1024, + DRM_FORMAT_XRGB8888, LOCAL_I915_FORMAT_MOD_X_TILED, + 1024*4, NULL, NULL, NULL); + igt_assert(tiled_x_bo); + + tiled_y_bo = igt_create_bo_with_dimensions(fd, 1024, 1024, + DRM_FORMAT_XRGB8888, LOCAL_I915_FORMAT_MOD_Y_TILED, + 1024*4, NULL, NULL, NULL); + igt_assert(tiled_y_bo); + + gem_bo = igt_create_bo_with_dimensions(fd, 1024, 1024, + DRM_FORMAT_XRGB8888, 0, 0, NULL, NULL, NULL); + igt_assert(gem_bo); + } - igt_subtest("framebuffer-vs-set-tiling") { - igt_assert(drmIoctl(fd, DRM_IOCTL_MODE_ADDFB2, &f) == 0); - igt_assert(__gem_set_tiling(fd, gem_bo, I915_TILING_X, 512*4) == -EBUSY); - igt_assert(__gem_set_tiling(fd, gem_bo, I915_TILING_X, 1024*4) == -EBUSY); - igt_assert(drmIoctl(fd, DRM_IOCTL_MODE_RMFB, &f.fb_id) == 0); - f.fb_id = 0; - } + f.pitches[0] = 1024*4; + igt_subtest("basic-X-tiled") { + f.handles[0] = tiled_x_bo; - f.pitches[0] = 512*4; - igt_subtest("tile-pitch-mismatch") { - igt_assert(drmIoctl(fd, DRM_IOCTL_MODE_ADDFB2, &f) == -1 && - errno == EINVAL); - } + igt_assert(drmIoctl(fd, DRM_IOCTL_MODE_ADDFB2, &f) == 0); + igt_assert(drmIoctl(fd, DRM_IOCTL_MODE_RMFB, &f.fb_id) == 0); + f.fb_id = 0; + } - igt_fixture - gem_set_tiling(fd, gem_bo, I915_TILING_Y, 1024*4); - f.pitches[0] = 1024*4; - igt_subtest("basic-Y-tiled") { - igt_assert(drmIoctl(fd, DRM_IOCTL_MODE_ADDFB2, &f) == -1 && - errno == EINVAL); - } + igt_subtest("framebuffer-vs-set-tiling") { + f.handles[0] = gem_bo; - igt_fixture - gem_close(fd, gem_bo); + gem_set_tiling(fd, gem_bo, I915_TILING_X, 1024*4); + igt_assert(drmIoctl(fd, DRM_IOCTL_MODE_ADDFB2, &f) == 0); + igt_assert(__gem_set_tiling(fd, gem_bo, I915_TILING_X, 512*4) == -EBUSY); + igt_assert(__gem_set_tiling(fd, gem_bo, I915_TILING_X, 1024*4) == -EBUSY); + igt_assert(drmIoctl(fd, DRM_IOCTL_MODE_RMFB, &f.fb_id) == 0); + f.fb_id = 0; + } + + f.pitches[0] = 512*4; + igt_subtest("tile-pitch-mismatch") { + f.handles[0] = tiled_x_bo; + + igt_assert(drmIoctl(fd, DRM_IOCTL_MODE_ADDFB2, &f) == -1 && + errno == EINVAL); + } + + f.pitches[0] = 1024*4; + igt_subtest("basic-Y-tiled") { + f.handles[0] = tiled_y_bo; + + igt_assert(drmIoctl(fd, DRM_IOCTL_MODE_ADDFB2, &f) == -1 && + errno == EINVAL); + } + + igt_fixture { + gem_close(fd, tiled_x_bo); + gem_close(fd, tiled_y_bo); + } + } } static void size_tests(int fd) @@ -211,9 +253,11 @@ f_8.pitches[0] = 1024*2; igt_fixture { - gem_bo = gem_create(fd, 1024*1024*4); + gem_bo = igt_create_bo_with_dimensions(fd, 1024, 1024, + DRM_FORMAT_XRGB8888, 0, 0, NULL, NULL, NULL); igt_assert(gem_bo); - gem_bo_small = gem_create(fd, 1024*1024*4 - 4096); + gem_bo_small = igt_create_bo_with_dimensions(fd, 1024, 1023, + DRM_FORMAT_XRGB8888, 0, 0, NULL, NULL, NULL); igt_assert(gem_bo_small); } @@ -273,10 +317,8 @@ f.fb_id = 0; } - igt_fixture - gem_set_tiling(fd, gem_bo_small, I915_TILING_X, 1024*4); - igt_subtest("bo-too-small-due-to-tiling") { + gem_set_tiling(fd, gem_bo_small, I915_TILING_X, 1024*4); igt_assert(drmIoctl(fd, DRM_IOCTL_MODE_ADDFB2, &f) == -1 && errno == EINVAL); } @@ -293,7 +335,8 @@ struct local_drm_mode_fb_cmd2 f = {}; igt_fixture { - gem_bo = gem_create(fd, 1024*1024*4); + gem_bo = igt_create_bo_with_dimensions(fd, 1024, 1024, + DRM_FORMAT_XRGB8888, 0, 0, NULL, NULL, NULL); igt_assert(gem_bo); memset(&f, 0, sizeof(f)); @@ -324,53 +367,61 @@ igt_assert(drmIoctl(fd, LOCAL_DRM_IOCTL_MODE_ADDFB2, &f) < 0 && errno == EINVAL); } - igt_fixture - gem_set_tiling(fd, gem_bo, I915_TILING_X, 1024*4); - - igt_subtest("addfb25-X-tiled-mismatch") { - igt_require_fb_modifiers(fd); + igt_subtest_group { + igt_fixture { + gem_set_tiling(fd, gem_bo, I915_TILING_X, 1024*4); + igt_require_fb_modifiers(fd); + } - f.modifier[0] = LOCAL_DRM_FORMAT_MOD_NONE; - igt_assert(drmIoctl(fd, LOCAL_DRM_IOCTL_MODE_ADDFB2, &f) < 0 && errno == EINVAL); - } + igt_subtest("addfb25-X-tiled-mismatch") { + f.modifier[0] = LOCAL_DRM_FORMAT_MOD_NONE; + igt_assert(drmIoctl(fd, LOCAL_DRM_IOCTL_MODE_ADDFB2, &f) < 0 && errno == EINVAL); + } - igt_subtest("addfb25-X-tiled") { - igt_require_fb_modifiers(fd); + igt_subtest("addfb25-X-tiled") { + f.modifier[0] = LOCAL_I915_FORMAT_MOD_X_TILED; + igt_assert(drmIoctl(fd, LOCAL_DRM_IOCTL_MODE_ADDFB2, &f) == 0); + igt_assert(drmIoctl(fd, DRM_IOCTL_MODE_RMFB, &f.fb_id) == 0); + f.fb_id = 0; + } - f.modifier[0] = LOCAL_I915_FORMAT_MOD_X_TILED; - igt_assert(drmIoctl(fd, LOCAL_DRM_IOCTL_MODE_ADDFB2, &f) == 0); - igt_assert(drmIoctl(fd, DRM_IOCTL_MODE_RMFB, &f.fb_id) == 0); - f.fb_id = 0; + igt_subtest("addfb25-framebuffer-vs-set-tiling") { + f.modifier[0] = LOCAL_I915_FORMAT_MOD_X_TILED; + igt_assert(drmIoctl(fd, LOCAL_DRM_IOCTL_MODE_ADDFB2, &f) == 0); + igt_assert(__gem_set_tiling(fd, gem_bo, I915_TILING_X, 512*4) == -EBUSY); + igt_assert(__gem_set_tiling(fd, gem_bo, I915_TILING_X, 1024*4) == -EBUSY); + igt_assert(drmIoctl(fd, DRM_IOCTL_MODE_RMFB, &f.fb_id) == 0); + f.fb_id = 0; + } } + igt_fixture + gem_close(fd, gem_bo); +} - igt_subtest("addfb25-framebuffer-vs-set-tiling") { - igt_require_fb_modifiers(fd); +static int addfb_expected_ret(int fd) +{ + int gen; - f.modifier[0] = LOCAL_I915_FORMAT_MOD_X_TILED; - igt_assert(drmIoctl(fd, LOCAL_DRM_IOCTL_MODE_ADDFB2, &f) == 0); - igt_assert(__gem_set_tiling(fd, gem_bo, I915_TILING_X, 512*4) == -EBUSY); - igt_assert(__gem_set_tiling(fd, gem_bo, I915_TILING_X, 1024*4) == -EBUSY); - igt_assert(drmIoctl(fd, DRM_IOCTL_MODE_RMFB, &f.fb_id) == 0); - f.fb_id = 0; - } + if (!is_i915_device(fd)) + return 0; - igt_fixture - gem_close(fd, gem_bo); + gen = intel_gen(intel_get_drm_devid(fd)); + return gen >= 9 ? 0 : -1; } -static void addfb25_ytile(int fd, int gen) +static void addfb25_ytile(int fd) { struct local_drm_mode_fb_cmd2 f = {}; - int shouldret; + int gen; igt_fixture { - gem_bo = gem_create(fd, 1024*1024*4); + gem_bo = igt_create_bo_with_dimensions(fd, 1024, 1024, + DRM_FORMAT_XRGB8888, 0, 0, NULL, NULL, NULL); igt_assert(gem_bo); - gem_bo_small = gem_create(fd, 1024*1023*4); + gem_bo_small = igt_create_bo_with_dimensions(fd, 1024, 1023, + DRM_FORMAT_XRGB8888, 0, 0, NULL, NULL, NULL); igt_assert(gem_bo_small); - shouldret = gen >= 9 ? 0 : -1; - memset(&f, 0, sizeof(f)); f.width = 1024; @@ -387,8 +438,9 @@ igt_require_fb_modifiers(fd); f.modifier[0] = LOCAL_I915_FORMAT_MOD_Y_TILED; - igt_assert(drmIoctl(fd, LOCAL_DRM_IOCTL_MODE_ADDFB2, &f) == shouldret); - if (!shouldret) + igt_assert(drmIoctl(fd, LOCAL_DRM_IOCTL_MODE_ADDFB2, &f) == + addfb_expected_ret(fd)); + if (!addfb_expected_ret(fd)) igt_assert(drmIoctl(fd, DRM_IOCTL_MODE_RMFB, &f.fb_id) == 0); f.fb_id = 0; } @@ -397,14 +449,17 @@ igt_require_fb_modifiers(fd); f.modifier[0] = LOCAL_I915_FORMAT_MOD_Yf_TILED; - igt_assert(drmIoctl(fd, LOCAL_DRM_IOCTL_MODE_ADDFB2, &f) == shouldret); - if (!shouldret) + igt_assert(drmIoctl(fd, LOCAL_DRM_IOCTL_MODE_ADDFB2, &f) == + addfb_expected_ret(fd)); + if (!addfb_expected_ret(fd)) igt_assert(drmIoctl(fd, DRM_IOCTL_MODE_RMFB, &f.fb_id) == 0); f.fb_id = 0; } igt_subtest("addfb25-Y-tiled-small") { igt_require_fb_modifiers(fd); + + gen = intel_gen(intel_get_drm_devid(fd)); igt_require(gen >= 9); f.modifier[0] = LOCAL_I915_FORMAT_MOD_Y_TILED; @@ -421,14 +476,11 @@ } int fd; -int gen; igt_main { - igt_fixture { - fd = drm_open_driver_master(DRIVER_INTEL); - gen = intel_gen(intel_get_drm_devid(fd)); - } + igt_fixture + fd = drm_open_driver_master(DRIVER_ANY); invalid_tests(fd); @@ -438,7 +490,9 @@ addfb25_tests(fd); - addfb25_ytile(fd, gen); + addfb25_ytile(fd); + + tiling_tests(fd); igt_fixture close(fd); diff -Nru intel-gpu-tools-1.13/tests/kms_atomic.c intel-gpu-tools-1.15/tests/kms_atomic.c --- intel-gpu-tools-1.13/tests/kms_atomic.c 2015-11-30 16:26:23.000000000 +0000 +++ intel-gpu-tools-1.15/tests/kms_atomic.c 2016-05-23 10:51:28.000000000 +0000 @@ -720,10 +720,10 @@ drmModePlaneResPtr res_plane; int i; - desc->fd = drm_open_driver_master(DRIVER_INTEL); + desc->fd = drm_open_driver_master(DRIVER_ANY); igt_assert_fd(desc->fd); - do_or_die(drmSetClientCap(desc->fd, DRM_CLIENT_CAP_ATOMIC, 1)); + igt_skip_on(drmSetClientCap(desc->fd, DRM_CLIENT_CAP_ATOMIC, 1)); res = drmModeGetResources(desc->fd); res_plane = drmModeGetPlaneResources(desc->fd); @@ -843,7 +843,7 @@ plane_kms = drmModeGetPlane(plane->state->desc->fd, plane->obj); igt_assert(plane_kms); - igt_get_all_formats(&igt_formats, &num_igt_formats); + igt_get_all_cairo_formats(&igt_formats, &num_igt_formats); for (i = 0; i < num_igt_formats; i++) { int j; @@ -867,7 +867,6 @@ uint32_t format = plane_get_igt_format(&plane); drmModeAtomicReq *req = drmModeAtomicAlloc(); struct igt_fb fb; - cairo_t *cr; igt_require(req); igt_require(format != 0); @@ -881,12 +880,9 @@ plane.crtc_w = mode->hdisplay / 2; plane.crtc_h = mode->vdisplay / 2; plane.crtc_id = crtc->obj; - plane.fb_id = igt_create_fb(plane.state->desc->fd, - plane.crtc_w, plane.crtc_h, - format, I915_TILING_NONE, &fb); - - cr = igt_get_cairo_ctx(plane.state->desc->fd, &fb); - igt_paint_test_pattern(cr, plane.crtc_w, plane.crtc_h); + plane.fb_id = igt_create_pattern_fb(plane.state->desc->fd, + plane.crtc_w, plane.crtc_h, + format, I915_TILING_NONE, &fb); /* Enable the overlay plane using the atomic API, and double-check * state is what we think it should be. */ @@ -913,20 +909,7 @@ struct kms_atomic_plane_state plane = *plane_old; uint32_t format = plane_get_igt_format(&plane); drmModeAtomicReq *req = drmModeAtomicAlloc(); - uint32_t *connectors; - int num_connectors; struct igt_fb fb; - cairo_t *cr; - int i; - - connectors = calloc(crtc->state->num_connectors, sizeof(*connectors)); - igt_assert(connectors); - - for (i = 0; i < crtc->state->num_connectors; i++) { - if (crtc->state->connectors[i].crtc_id == crtc->obj) - connectors[num_connectors++] = - crtc->state->connectors[i].obj; - } igt_require(format != 0); @@ -939,12 +922,9 @@ plane.crtc_w = mode->hdisplay; plane.crtc_h = mode->vdisplay; plane.crtc_id = crtc->obj; - plane.fb_id = igt_create_fb(plane.state->desc->fd, - plane.crtc_w, plane.crtc_h, - format, I915_TILING_NONE, &fb); - - cr = igt_get_cairo_ctx(plane.state->desc->fd, &fb); - igt_paint_test_pattern(cr, plane.crtc_w, plane.crtc_h); + plane.fb_id = igt_create_pattern_fb(plane.state->desc->fd, + plane.crtc_w, plane.crtc_h, + format, I915_TILING_NONE, &fb); /* Flip the primary plane using the atomic API, and double-check * state is what we think it should be. */ @@ -1044,7 +1024,6 @@ uint32_t format = plane_get_igt_format(&plane); drmModeAtomicReq *req = drmModeAtomicAlloc(); struct igt_fb fb; - cairo_t *cr; /* Pass a series of invalid object IDs for the FB ID. */ plane.fb_id = plane.obj; @@ -1098,12 +1077,9 @@ plane.crtc_w = mode->hdisplay; plane.crtc_h = mode->vdisplay; plane.crtc_id = crtc->obj; - plane.fb_id = igt_create_fb(plane.state->desc->fd, - plane.crtc_w - 1, plane.crtc_h - 1, - format, I915_TILING_NONE, &fb); - - cr = igt_get_cairo_ctx(plane.state->desc->fd, &fb); - igt_paint_test_pattern(cr, plane.crtc_w - 1, plane.crtc_h - 1); + plane.fb_id = igt_create_pattern_fb(plane.state->desc->fd, + plane.crtc_w - 1, plane.crtc_h - 1, + format, I915_TILING_NONE, &fb); plane_commit_atomic_err(&plane, plane_old, req, ATOMIC_RELAX_NONE, ENOSPC); @@ -1385,7 +1361,7 @@ igt_subtest("atomic_invalid_params") { struct kms_atomic_state *scratch = atomic_state_dup(current); - struct kms_atomic_crtc_state *crtc = &scratch->crtcs[0]; + struct kms_atomic_crtc_state *crtc = find_crtc(scratch, true); struct kms_atomic_plane_state *plane = find_plane(scratch, NUM_PLANE_TYPE_PROPS, crtc); struct kms_atomic_connector_state *conn = diff -Nru intel-gpu-tools-1.13/tests/kms_chv_cursor_fail.c intel-gpu-tools-1.15/tests/kms_chv_cursor_fail.c --- intel-gpu-tools-1.13/tests/kms_chv_cursor_fail.c 1970-01-01 00:00:00.000000000 +0000 +++ intel-gpu-tools-1.15/tests/kms_chv_cursor_fail.c 2016-05-23 10:51:28.000000000 +0000 @@ -0,0 +1,429 @@ +/* + * Copyright © 2015 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 "igt.h" +#include +#include +#include +#include +#include + +IGT_TEST_DESCRIPTION("Exercise CHV pipe C cursor fail"); + +#ifndef DRM_CAP_CURSOR_WIDTH +#define DRM_CAP_CURSOR_WIDTH 0x8 +#endif +#ifndef DRM_CAP_CURSOR_HEIGHT +#define DRM_CAP_CURSOR_HEIGHT 0x9 +#endif + +typedef struct { + int drm_fd; + igt_display_t display; + struct igt_fb primary_fb; + struct igt_fb fb; + igt_output_t *output; + enum pipe pipe; + igt_crc_t ref_crc; + int curw, curh; /* cursor size */ + igt_pipe_crc_t *pipe_crc; + uint32_t devid; + bool colored, jump, disable; + int jump_x, jump_y; +} data_t; + +enum { + EDGE_LEFT = 0x1, + EDGE_RIGHT = 0x2, + EDGE_TOP = 0x4, + EDGE_BOTTOM = 0x8, +}; + +static void cursor_disable(data_t *data) +{ + igt_output_t *output = data->output; + igt_plane_t *cursor; + + cursor = igt_output_get_plane(output, IGT_PLANE_CURSOR); + igt_plane_set_fb(cursor, NULL); +} + +static void create_cursor_fb(data_t *data, int cur_w, int cur_h) +{ + cairo_t *cr; + uint32_t fb_id; + + fb_id = igt_create_fb(data->drm_fd, cur_w, cur_h, + DRM_FORMAT_ARGB8888, + LOCAL_DRM_FORMAT_MOD_NONE, + &data->fb); + igt_assert(fb_id); + + cr = igt_get_cairo_ctx(data->drm_fd, &data->fb); + if (data->colored) + igt_paint_color_alpha(cr, 0, 0, data->fb.width, data->fb.height, + 1.0, 0.0, 0.0, 1.0); + else + igt_paint_color_alpha(cr, 0, 0, data->fb.width, data->fb.height, + 0.0, 0.0, 0.0, 0.0); + igt_assert(cairo_status(cr) == 0); + cairo_destroy(cr); +} + +static void cursor_move(data_t *data, int x, int y, int i) +{ + int crtc_id = data->output->config.crtc->crtc_id; + + igt_debug("[%d] x=%d, y=%d\n", i, x, y); + + /* + * The "fixed" kernel will refuse the ioctl when pipe C cursor + * would straddle the left screen edge (which is when the hw + * fails). So let's accept a failure from the ioctl in that case. + */ + igt_assert(drmModeMoveCursor(data->drm_fd, crtc_id, x, y) == 0 || + (IS_CHERRYVIEW(data->devid) && data->pipe == PIPE_C && + x < 0 && x > -data->curw)); + igt_wait_for_vblank(data->drm_fd, data->pipe); +} + +#define XSTEP 8 +#define YSTEP 32 +#define XOFF 0 +#define NCRC 128 + +static void test_edge_pos(data_t *data, int sx, int ex, int y, bool swap_axis) +{ + igt_crc_t *crc = NULL; + int i, n, x, xdir; + + if (sx > ex) + xdir = -1; + else + xdir = 1; + + igt_pipe_crc_start(data->pipe_crc); + + i = 0; + for (x = sx + XOFF; xdir * (x - ex - XOFF) <= 0; x += xdir * XSTEP) { + int xx, yy; + + if (swap_axis) { + xx = y; + yy = x; + } else { + xx = x; + yy = y; + } + + if (data->jump) { + cursor_move(data, data->jump_x, data->jump_y, i++); + } + if (data->disable) { + cursor_move(data, -data->curw, -data->curh, i++); + } + cursor_move(data, xx, yy, i++); + if (data->jump) { + cursor_move(data, data->jump_x, data->jump_y, i++); + } + if (data->disable) { + cursor_move(data, -data->curw, -data->curh, i++); + } + } + + n = igt_pipe_crc_get_crcs(data->pipe_crc, NCRC, &crc); + igt_pipe_crc_stop(data->pipe_crc); + + if (!data->colored) { + igt_debug("Checking CRCs: "); + for (i = 0; i < n; i++) { + igt_debug("[%d] ", i); + igt_assert_crc_equal(&data->ref_crc, &crc[i]); + } + igt_debug("\n"); + } + + + igt_pipe_crc_start(data->pipe_crc); +} + +static void test_edge(data_t *data, int sy, int ey, int sx, int ex, bool swap_axis) +{ + int crtc_id = data->output->config.crtc->crtc_id; + int y, ydir; + + if (sy > ey) + ydir = -1; + else + ydir = 1; + + igt_assert_eq(drmModeMoveCursor(data->drm_fd, crtc_id, -data->curw, -data->curh), 0); + igt_assert_eq(drmModeSetCursor(data->drm_fd, crtc_id, data->fb.gem_handle, data->curw, data->curh), 0); + + for (y = sy; ydir * (y - ey) <= 0; ) { + test_edge_pos(data, sx, ex, y, swap_axis); + y += ydir * YSTEP; + test_edge_pos(data, ex, sx, y, swap_axis); + y += ydir * YSTEP; + } + + igt_assert_eq(drmModeMoveCursor(data->drm_fd, crtc_id, -data->curw, -data->curh), 0); + igt_assert_eq(drmModeSetCursor(data->drm_fd, crtc_id, 0, data->curw, data->curh), 0); +} + +static void test_edges(data_t *data, unsigned int edges) +{ + drmModeModeInfo *mode = igt_output_get_mode(data->output); + + if (edges & EDGE_LEFT) { + test_edge(data, mode->vdisplay, -data->curh, + -data->curw, 0, false); + test_edge(data, -data->curh, mode->vdisplay, + -data->curw, 0, false); + } + + if (edges & EDGE_RIGHT) { + test_edge(data, mode->vdisplay, -data->curh, + mode->hdisplay - data->curw, mode->hdisplay, false); + test_edge(data, -data->curh, mode->vdisplay, + mode->hdisplay - data->curw, mode->hdisplay, false); + } + + if (edges & EDGE_TOP) { + test_edge(data, mode->hdisplay, -data->curw, + -data->curh, 0, true); + test_edge(data, -data->curw, mode->hdisplay, + -data->curh, 0, true); + } + + if (edges & EDGE_BOTTOM) { + test_edge(data, mode->hdisplay, -data->curw, + mode->vdisplay - data->curh, mode->vdisplay, true); + test_edge(data, -data->curw, mode->hdisplay, + mode->vdisplay - data->curh, mode->vdisplay, true); + } +} + +static bool prepare_crtc(data_t *data) +{ + drmModeModeInfo *mode; + igt_display_t *display = &data->display; + igt_plane_t *primary; + + /* select the pipe we want to use */ + igt_output_set_pipe(data->output, data->pipe); + cursor_disable(data); + igt_display_commit(display); + + if (!data->output->valid) { + igt_output_set_pipe(data->output, PIPE_ANY); + igt_display_commit(display); + return false; + } + + mode = igt_output_get_mode(data->output); + igt_create_pattern_fb(data->drm_fd, mode->hdisplay, mode->vdisplay, + DRM_FORMAT_XRGB8888, + LOCAL_DRM_FORMAT_MOD_NONE, + &data->primary_fb); + + primary = igt_output_get_plane(data->output, IGT_PLANE_PRIMARY); + igt_plane_set_fb(primary, &data->primary_fb); + + igt_display_commit(display); + + data->jump_x = (mode->hdisplay - data->curw) / 2; + data->jump_y = (mode->vdisplay - data->curh) / 2; + + /* create the pipe_crc object for this pipe */ + if (data->pipe_crc) + igt_pipe_crc_free(data->pipe_crc); + + data->pipe_crc = igt_pipe_crc_new_nonblock(data->pipe, + INTEL_PIPE_CRC_SOURCE_AUTO); + + /* make sure cursor is disabled */ + cursor_disable(data); + igt_wait_for_vblank(data->drm_fd, data->pipe); + + /* get reference crc w/o cursor */ + igt_pipe_crc_collect_crc(data->pipe_crc, &data->ref_crc); + igt_pipe_crc_collect_crc(data->pipe_crc, &data->ref_crc); + igt_pipe_crc_collect_crc(data->pipe_crc, &data->ref_crc); + + return true; +} + +static void cleanup_crtc(data_t *data) +{ + igt_display_t *display = &data->display; + igt_plane_t *primary; + + igt_pipe_crc_free(data->pipe_crc); + data->pipe_crc = NULL; + + igt_remove_fb(data->drm_fd, &data->primary_fb); + + primary = igt_output_get_plane(data->output, IGT_PLANE_PRIMARY); + igt_plane_set_fb(primary, NULL); + + igt_output_set_pipe(data->output, PIPE_ANY); + igt_display_commit(display); +} + +static void test_crtc(data_t *data, unsigned int edges) +{ + igt_display_t *display = &data->display; + int valid_tests = 0; + + create_cursor_fb(data, data->curw, data->curh); + + for_each_connected_output(display, data->output) { + if (!prepare_crtc(data)) + continue; + + valid_tests++; + + igt_info("Beginning %s on pipe %s, connector %s\n", + igt_subtest_name(), + kmstest_pipe_name(data->pipe), + igt_output_name(data->output)); + + test_edges(data, edges); + + igt_info("\n%s on pipe %s, connector %s: PASSED\n\n", + igt_subtest_name(), + kmstest_pipe_name(data->pipe), + igt_output_name(data->output)); + + /* cleanup what prepare_crtc() has done */ + cleanup_crtc(data); + } + + igt_remove_fb(data->drm_fd, &data->fb); + + igt_require_f(valid_tests, "no valid crtc/connector combinations found\n"); +} + +static int opt_handler(int opt, int opt_index, void *_data) +{ + data_t *data = _data; + + switch (opt) { + case 'c': + data->colored = true; + break; + case 'd': + data->disable = true; + break; + case 'j': + data->jump = true; + break; + default: + break; + } + + return 0; +} + +static data_t data; +static uint64_t max_curw = 64, max_curh = 64; + +int main(int argc, char **argv) +{ + static const struct option long_opts[] = { + { .name = "colored", .val = 'c' }, + { .name = "disable", .val = 'd'}, + { .name = "jump", .val = 'j' }, + {} + }; + static const char *help_str = + " --colored\t\tUse a colored cursor (disables CRC checks)\n" + " --disable\t\tDisable the cursor between each step\n" + " --jump\t\tJump the cursor to middle of the screen between each step)\n"; + + igt_subtest_init_parse_opts(&argc, argv, "", long_opts, help_str, + opt_handler, &data); + + igt_skip_on_simulation(); + + igt_fixture { + int ret; + + data.drm_fd = drm_open_driver_master(DRIVER_INTEL); + + data.devid = intel_get_drm_devid(data.drm_fd); + + ret = drmGetCap(data.drm_fd, DRM_CAP_CURSOR_WIDTH, &max_curw); + igt_assert(ret == 0 || errno == EINVAL); + /* Not making use of cursor_height since it is same as width, still reading */ + ret = drmGetCap(data.drm_fd, DRM_CAP_CURSOR_HEIGHT, &max_curh); + igt_assert(ret == 0 || errno == EINVAL); + + kmstest_set_vt_graphics_mode(); + + igt_require_pipe_crc(); + + igt_display_init(&data.display, data.drm_fd); + } + + for (data.curw = 64; data.curw <= 256; data.curw *= 2) { + data.curh = data.curw; + for (data.pipe = PIPE_A; data.pipe <= PIPE_C; data.pipe++) { + igt_subtest_f("pipe-%s-%dx%d-left-edge", + kmstest_pipe_name(data.pipe), + data.curw, data.curh) { + igt_require(data.pipe < data.display.n_pipes); + igt_require(data.curw <= max_curw && data.curh <= max_curh); + test_crtc(&data, EDGE_LEFT); + } + igt_subtest_f("pipe-%s-%dx%d-right-edge", + kmstest_pipe_name(data.pipe), + data.curw, data.curh) { + igt_require(data.pipe < data.display.n_pipes); + igt_require(data.curw <= max_curw && data.curh <= max_curh); + test_crtc(&data, EDGE_RIGHT); + } + igt_subtest_f("pipe-%s-%dx%d-top-edge", + kmstest_pipe_name(data.pipe), + data.curw, data.curh) { + igt_require(data.pipe < data.display.n_pipes); + igt_require(data.curw <= max_curw && data.curh <= max_curh); + test_crtc(&data, EDGE_TOP); + } + igt_subtest_f("pipe-%s-%dx%d-bottom-edge", + kmstest_pipe_name(data.pipe), + data.curw, data.curh) { + igt_require(data.pipe < data.display.n_pipes); + igt_require(data.curw <= max_curw && data.curh <= max_curh); + test_crtc(&data, EDGE_BOTTOM); + } + } + } + + igt_fixture + igt_display_fini(&data.display); + + igt_exit(); +} diff -Nru intel-gpu-tools-1.13/tests/kms_cursor_legacy.c intel-gpu-tools-1.15/tests/kms_cursor_legacy.c --- intel-gpu-tools-1.13/tests/kms_cursor_legacy.c 1970-01-01 00:00:00.000000000 +0000 +++ intel-gpu-tools-1.15/tests/kms_cursor_legacy.c 2016-05-27 09:40:13.000000000 +0000 @@ -0,0 +1,176 @@ +/* + * Copyright © 2013 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. + * + */ + +#define _GNU_SOURCE +#include + +#include "igt.h" +#include "igt_stats.h" + +IGT_TEST_DESCRIPTION("Stress legacy cursor ioctl"); + +struct data { + int fd; + drmModeRes *resources; +}; + +static uint32_t state = 0x12345678; + +static uint32_t +hars_petruska_f54_1_random (void) +{ +#define rol(x,k) ((x << k) | (x >> (32-k))) + return state = (state ^ rol (state, 5) ^ rol (state, 24)) + 0x37798849; +#undef rol +} + +static void stress(struct data *data, + uint32_t *crtc_id, unsigned num_crtcs, + int num_children, unsigned mode, + int timeout) +{ + struct drm_mode_cursor arg; + uint64_t *results; + int n; + + results = mmap(NULL, 4096, PROT_WRITE, MAP_SHARED | MAP_ANON, -1, 0); + igt_assert(results != MAP_FAILED); + + memset(&arg, 0, sizeof(arg)); + arg.flags = DRM_MODE_CURSOR_BO; + arg.crtc_id = 0; + arg.width = 64; + arg.height = 64; + arg.handle = gem_create(data->fd, 4*64*64); + + for (n = 0; n < num_crtcs; n++) { + arg.crtc_id = crtc_id[n]; + drmIoctl(data->fd, DRM_IOCTL_MODE_CURSOR, &arg); + } + + arg.flags = mode; + igt_fork(child, num_children) { + struct sched_param rt = {.sched_priority = 99 }; + cpu_set_t allowed; + unsigned long count = 0; + + sched_setscheduler(getpid(), SCHED_RR, &rt); + + CPU_ZERO(&allowed); + CPU_SET(child, &allowed); + sched_setaffinity(getpid(), sizeof(cpu_set_t), &allowed); + + state ^= child; + igt_until_timeout(timeout) { + arg.crtc_id = crtc_id[hars_petruska_f54_1_random() % num_crtcs]; + do_ioctl(data->fd, DRM_IOCTL_MODE_CURSOR, &arg); + count++; + } + + igt_debug("[%d] count=%lu\n", child, count); + results[child] = count; + } + igt_waitchildren(); + + if (num_children > 1) { + igt_stats_t stats; + + igt_stats_init_with_size(&stats, num_children); + results[num_children] = 0; + for (int child = 0; child < num_children; child++) { + igt_stats_push(&stats, results[child]); + results[num_children] += results[child]; + } + igt_info("Total updates %llu (median of %d processes is %.2f)\n", + (long long)results[num_children], + num_children, + igt_stats_get_median(&stats)); + igt_stats_fini(&stats); + } else { + igt_info("Total updates %llu\n", (long long)results[0]); + } + + gem_close(data->fd, arg.handle); + munmap(results, 4096); +} + +igt_main +{ + const int ncpus = sysconf(_SC_NPROCESSORS_ONLN); + struct data data = { .fd = -1 }; + + igt_skip_on_simulation(); + + igt_fixture { + data.fd = drm_open_driver_master(DRIVER_INTEL); + kmstest_set_vt_graphics_mode(); + + data.resources = drmModeGetResources(data.fd); + igt_assert(data.resources); + } + + igt_subtest_group { + for (int n = 0; n < 26; n++) { + uint32_t *crtcs = NULL; + + errno = 0; + igt_fixture { + igt_skip_on(n >= data.resources->count_crtcs); + crtcs = &data.resources->crtcs[n]; + } + + igt_subtest_f("single-%c-bo", 'A' + n) + stress(&data, crtcs, 1, 1, DRM_MODE_CURSOR_BO, 20); + igt_subtest_f("single-%c-move", 'A' + n) + stress(&data, crtcs, 1, 1, DRM_MODE_CURSOR_MOVE, 20); + + igt_subtest_f("forked-%c-bo", 'A' + n) + stress(&data, crtcs, 1, ncpus, DRM_MODE_CURSOR_BO, 20); + igt_subtest_f("forked-%c-move", 'A' + n) + stress(&data, crtcs, 1, ncpus, DRM_MODE_CURSOR_MOVE, 20); + } + } + + igt_subtest("single-all-bo") + stress(&data, + data.resources->crtcs, data.resources->count_crtcs, + 1, DRM_MODE_CURSOR_BO, 20); + igt_subtest("single-all-move") + stress(&data, + data.resources->crtcs, data.resources->count_crtcs, + 1, DRM_MODE_CURSOR_MOVE, 20); + + igt_subtest("forked-all-bo") + stress(&data, + data.resources->crtcs, data.resources->count_crtcs, + ncpus, DRM_MODE_CURSOR_BO, 20); + igt_subtest("forked-all-move") + stress(&data, + data.resources->crtcs, data.resources->count_crtcs, + ncpus, DRM_MODE_CURSOR_MOVE, 20); + + igt_fixture { + drmModeFreeResources(data.resources); + } +} diff -Nru intel-gpu-tools-1.13/tests/kms_draw_crc.c intel-gpu-tools-1.15/tests/kms_draw_crc.c --- intel-gpu-tools-1.13/tests/kms_draw_crc.c 2015-11-30 16:26:23.000000000 +0000 +++ intel-gpu-tools-1.15/tests/kms_draw_crc.c 2016-05-23 10:51:28.000000000 +0000 @@ -58,25 +58,26 @@ static void find_modeset_params(void) { int i; - uint32_t connector_id = 0, crtc_id; + uint32_t crtc_id; + drmModeConnectorPtr connector = NULL; drmModeModeInfoPtr mode = NULL; for (i = 0; i < drm_res->count_connectors; i++) { drmModeConnectorPtr c = drm_connectors[i]; if (c->count_modes) { - connector_id = c->connector_id; + connector = c; mode = &c->modes[0]; break; } } - igt_require(connector_id); + igt_require(connector); - crtc_id = drm_res->crtcs[0]; - igt_assert(crtc_id); + crtc_id = kmstest_find_crtc_for_connector(drm_fd, drm_res, connector, + 0); igt_assert(mode); - ms.connector_id = connector_id; + ms.connector_id = connector->connector_id; ms.crtc_id = crtc_id; ms.mode = mode; @@ -153,8 +154,6 @@ kmstest_unset_all_crtcs(drm_fd, drm_res); - find_modeset_params(); - /* Use IGT_DRAW_MMAP_GTT on an untiled buffer as the parameter for * comparison. Cache the value so we don't recompute it for every single * subtest. */ @@ -197,8 +196,6 @@ kmstest_unset_all_crtcs(drm_fd, drm_res); - find_modeset_params(); - igt_create_fb(drm_fd, ms.mode->hdisplay, ms.mode->vdisplay, DRM_FORMAT_XRGB8888, LOCAL_DRM_FORMAT_MOD_NONE, &fb); @@ -232,8 +229,8 @@ igt_assert(drm_res->count_connectors <= MAX_CONNECTORS); for (i = 0; i < drm_res->count_connectors; i++) - drm_connectors[i] = drmModeGetConnector(drm_fd, - drm_res->connectors[i]); + drm_connectors[i] = drmModeGetConnectorCurrent(drm_fd, + drm_res->connectors[i]); kmstest_set_vt_graphics_mode(); @@ -241,7 +238,9 @@ igt_assert(bufmgr); drm_intel_bufmgr_gem_enable_reuse(bufmgr); - pipe_crc = igt_pipe_crc_new(0, INTEL_PIPE_CRC_SOURCE_AUTO); + find_modeset_params(); + pipe_crc = igt_pipe_crc_new(kmstest_get_crtc_idx(drm_res, ms.crtc_id), + INTEL_PIPE_CRC_SOURCE_AUTO); } static void teardown_environment(void) diff -Nru intel-gpu-tools-1.13/tests/kms_fbcon_fbt.c intel-gpu-tools-1.15/tests/kms_fbcon_fbt.c --- intel-gpu-tools-1.13/tests/kms_fbcon_fbt.c 2015-11-30 16:26:23.000000000 +0000 +++ intel-gpu-tools-1.15/tests/kms_fbcon_fbt.c 2016-05-23 10:51:28.000000000 +0000 @@ -63,7 +63,7 @@ igt_assert(drm->res->count_connectors <= MAX_CONNECTORS); for (i = 0; i < drm->res->count_connectors; i++) - drm->connectors[i] = drmModeGetConnector(drm->fd, + drm->connectors[i] = drmModeGetConnectorCurrent(drm->fd, drm->res->connectors[i]); kmstest_set_vt_graphics_mode(); @@ -114,7 +114,7 @@ connector_possible_fn connector_possible) { int i, rc; - uint32_t connector_id = 0, crtc_id; + uint32_t crtc_id; drmModeModeInfoPtr mode; uint32_t buffer_id; drmModeConnectorPtr c = NULL; @@ -124,14 +124,14 @@ if (c->connection == DRM_MODE_CONNECTED && c->count_modes && connector_possible(c)) { - connector_id = c->connector_id; mode = &c->modes[0]; break; } } - igt_require_f(connector_id, "No connector available\n"); + igt_require_f(i < drm->res->count_connectors, + "No connector available\n"); - crtc_id = drm->res->crtcs[0]; + crtc_id = kmstest_find_crtc_for_connector(drm->fd, drm->res, c, 0); buffer_id = igt_create_fb(drm->fd, mode->hdisplay, mode->vdisplay, DRM_FORMAT_XRGB8888, @@ -142,8 +142,8 @@ mode->hdisplay, mode->vdisplay, kmstest_connector_type_str(c->connector_type)); - rc = drmModeSetCrtc(drm->fd, crtc_id, buffer_id, 0, 0, &connector_id, 1, - mode); + rc = drmModeSetCrtc(drm->fd, crtc_id, buffer_id, 0, 0, + &c->connector_id, 1, mode); igt_assert_eq(rc, 0); } diff -Nru intel-gpu-tools-1.13/tests/kms_flip.c intel-gpu-tools-1.15/tests/kms_flip.c --- intel-gpu-tools-1.13/tests/kms_flip.c 2015-11-30 16:26:23.000000000 +0000 +++ intel-gpu-tools-1.15/tests/kms_flip.c 2016-05-23 10:51:28.000000000 +0000 @@ -132,11 +132,11 @@ static void dump_event_state(const struct event_state *es) { igt_debug("name = %s\n" - "last_ts = %lu.%lu usec\n" - "last_received_ts = %lu.%lu usec\n" + "last_ts = %ld.%ld usec\n" + "last_received_ts = %ld.%ld usec\n" "last_seq = %u\n" - "current_ts = %lu.%lu usec\n" - "current_received_ts = %lu.%lu usec\n" + "current_ts = %ld.%ld usec\n" + "current_received_ts = %ld.%ld usec\n" "current_seq = %u\n" "count = %u\n" "seq_step = %d\n", @@ -246,6 +246,8 @@ drm_intel_bo *src_bo, *dst_bo, *fb_bo; struct igt_fb *fb_info = &o->fb_info[o->current_fb_id]; + igt_require(bufmgr); + src_bo = drm_intel_bo_alloc(bufmgr, "dummy_bo", 2048*2048*4, 4096); igt_assert(src_bo); @@ -298,6 +300,8 @@ drm_intel_bo **bo; int i; + igt_require(bufmgr); + bo = calloc(sizeof(*bo), num_fences); exec = calloc(sizeof(*exec), num_fences+1); for (i = 0; i < num_fences - 1; i++) { @@ -337,6 +341,8 @@ struct igt_buf sb[3], *src, *dst, *fb; int i, ret = 0; + igt_require(bufmgr); + copyfunc = igt_get_render_copyfunc(devid); if (copyfunc == NULL) return _emit_dummy_load__bcs(o, limit, timeout); @@ -418,7 +424,7 @@ goto next; } - connector = drmModeGetConnector(drm_fd, connector_id); + connector = drmModeGetConnectorCurrent(drm_fd, connector_id); kmstest_set_connector_dpms(drm_fd, connector, DRM_MODE_DPMS_ON); kmstest_set_connector_dpms(drm_fd, connector, DRM_MODE_DPMS_OFF); @@ -644,8 +650,8 @@ timersub(&es->current_ts, &es->current_received_ts, &diff); if (!analog_tv_connector(o)) { igt_assert_f(diff.tv_sec < 0 || (diff.tv_sec == 0 && diff.tv_usec <= 2000), - "%s ts delayed for too long: %is, %iusec\n", - es->name, (int)diff.tv_sec, (int)diff.tv_usec); + "%s ts delayed for too long: %lds, %ldusec\n", + es->name, diff.tv_sec, diff.tv_usec); } @@ -655,9 +661,9 @@ timersub(&es->current_ts, &es->last_received_ts, &diff); igt_assert_f(timercmp(&es->last_received_ts, &es->current_ts, <), "%s ts before the %s was issued!\n" - "timerdiff %is, %ius\n", + "timerdiff %lds, %ldusec\n", es->name, es->name, - (int) diff.tv_sec, (int) diff.tv_usec); + diff.tv_sec, diff.tv_usec); /* check only valid if no modeset happens in between, that increments by * (1 << 23) on each step. This bounding matches the one in @@ -674,9 +680,9 @@ igt_assert_f(es->current_seq - es->last_seq >= 0, "unexpected %s seq %u, should be >= %u\n", es->name, es->current_seq, es->last_seq); - igt_assert_f(es->current_seq - es->last_seq <= 100, + igt_assert_f(es->current_seq - es->last_seq <= 150, "unexpected %s seq %u, should be < %u\n", - es->name, es->current_seq, es->last_seq + 100); + es->name, es->current_seq, es->last_seq + 150); igt_debug("testing ts continuity: Current frame %u, old frame %u\n", es->current_seq, es->last_seq); @@ -688,8 +694,8 @@ igt_assert_f(fabs((((double) diff.tv_usec) - usec_interflip) / usec_interflip) <= 0.005, - "inter-%s ts jitter: %is, %ius\n", - es->name, (int) diff.tv_sec, (int) diff.tv_usec); + "inter-%s ts jitter: %lds, %ldusec\n", + es->name, diff.tv_sec, diff.tv_usec); igt_assert_f(es->current_seq == es->last_seq + o->seq_step, "unexpected %s seq %u, expected %u\n", @@ -776,72 +782,17 @@ drmFree(r); } -static void stop_rings(bool stop) +static igt_hang_ring_t hang_gpu(int fd) { - if (stop) - igt_set_stop_rings(STOP_RING_DEFAULTS); - else - igt_set_stop_rings(STOP_RING_NONE); + return igt_hang_ring(fd, I915_EXEC_DEFAULT); } -static void eat_error_state(void) +static void unhang_gpu(int fd, igt_hang_ring_t hang) { - static const char dfs_entry_error[] = "i915_error_state"; - static const char data[] = ""; - int fd; - - fd = igt_debugfs_open(dfs_entry_error, O_WRONLY); - igt_assert_lte(0, fd); - - igt_assert(write(fd, data, sizeof(data)) == sizeof(data)); - close(fd); - - /* and check whether stop_rings is not reset, i.e. the hang has indeed - * happened */ - igt_assert_f(igt_get_stop_rings() == STOP_RING_NONE, - "no gpu hang detected, stop_rings is still 0x%x\n", - igt_get_stop_rings()); - - close(fd); -} - -static void unhang_gpu(int fd, uint32_t handle) -{ - gem_sync(drm_fd, handle); - gem_close(drm_fd, handle); - eat_error_state(); - stop_rings(false); + igt_post_hang_ring(fd, hang); } -static uint32_t hang_gpu(int fd) -{ - struct drm_i915_gem_execbuffer2 execbuf; - struct drm_i915_gem_exec_object2 gem_exec; - uint32_t b[2] = {MI_BATCH_BUFFER_END}; - - stop_rings(true); - - memset(&gem_exec, 0, sizeof(gem_exec)); - gem_exec.handle = gem_create(fd, 4096); - gem_write(fd, gem_exec.handle, 0, b, sizeof(b)); - - memset(&execbuf, 0, sizeof(execbuf)); - execbuf.buffers_ptr = (uintptr_t)&gem_exec; - execbuf.buffer_count = 1; - execbuf.batch_len = sizeof(b); - - if (drmIoctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, &execbuf)) { - igt_assert_f(errno == EIO, - "failed to exercise page flip hang recovery\n"); - - unhang_gpu(fd, gem_exec.handle); - gem_exec.handle = 0; - } - - return gem_exec.handle; -} - -static bool is_hung(int fd) +static bool is_wedged(int fd) { if (drmIoctl(fd, DRM_IOCTL_I915_GEM_THROTTLE, 0) == 0) return false; @@ -883,7 +834,7 @@ bool do_vblank; struct vblank_reply vbl_reply; unsigned int target_seq; - uint32_t hang = 0; /* Suppress GCC warning */ + igt_hang_ring_t hang; target_seq = o->vblank_state.seq_step; /* Absolute waits only works once we have a frame counter. */ @@ -989,10 +940,9 @@ igt_print_activity(); - if (do_flip && (o->flags & TEST_HANG)) { + memset(&hang, 0, sizeof(hang)); + if (do_flip && (o->flags & TEST_HANG)) hang = hang_gpu(drm_fd); - igt_assert_f(hang, "failed to exercise page flip hang recovery\n"); - } /* try to make sure we can issue two flips during the same frame */ if (do_flip && (o->flags & TEST_EBUSY)) { @@ -1064,8 +1014,7 @@ if (do_flip && (o->flags & TEST_EINVAL) && !(o->flags & TEST_FB_BAD_TILING)) igt_assert(do_page_flip(o, new_fb_id, true) == expected_einval); - if (hang) - unhang_gpu(drm_fd, hang); + unhang_gpu(drm_fd, hang); return completed_events; } @@ -1233,13 +1182,13 @@ /* Verify we drop no frames, but only if it's not a TV encoder, since * those use some funny fake timings behind userspace's back. */ if (o->flags & TEST_CHECK_TS && !analog_tv_connector(o)) { - int expected; + double expected; int count = es->count; count *= o->seq_step; - expected = elapsed / frame_time(o); - igt_assert_f(count >= expected * 99/100 && count <= expected * 101/100, - "dropped frames, expected %d, counted %d, encoder type %d\n", + expected = (double)elapsed / frame_time(o); + igt_assert_f(fabs((double)count - expected)/expected <= 0.01, + "dropped frames, expected %f, counted %d, encoder type %d\n", expected, count, o->kencoder[0]->encoder_type); } } @@ -1295,13 +1244,12 @@ static unsigned event_loop(struct test_output *o, unsigned duration_ms) { unsigned long start, end; - uint32_t hang = 0; /* Suppress GCC warning */ + igt_hang_ring_t hang; int count = 0; - if (o->flags & TEST_HANG_ONCE) { + memset(&hang, 0, sizeof(hang)); + if (o->flags & TEST_HANG_ONCE) hang = hang_gpu(drm_fd); - igt_assert_f(hang, "failed to exercise page flip hang recovery\n"); - } start = gettime_us(); @@ -1322,8 +1270,7 @@ end = gettime_us(); - if (hang) - unhang_gpu(drm_fd, hang); + unhang_gpu(drm_fd, hang); /* Flush any remaining events */ if (o->pending_events) @@ -1405,13 +1352,16 @@ o->fb_ids[1] = igt_create_fb_with_bo_size(drm_fd, o->fb_width, o->fb_height, igt_bpp_depth_to_drm_format(o->bpp, o->depth), tiling, &o->fb_info[1], bo_size, 0); - o->fb_ids[2] = igt_create_fb(drm_fd, o->fb_width, o->fb_height, - igt_bpp_depth_to_drm_format(o->bpp, o->depth), - LOCAL_I915_FORMAT_MOD_X_TILED, &o->fb_info[2]); + igt_assert(o->fb_ids[0]); igt_assert(o->fb_ids[1]); - if (o->flags & TEST_FB_BAD_TILING) + + if (o->flags & TEST_FB_BAD_TILING) { + o->fb_ids[2] = igt_create_fb(drm_fd, o->fb_width, o->fb_height, + igt_bpp_depth_to_drm_format(o->bpp, o->depth), + LOCAL_I915_FORMAT_MOD_X_TILED, &o->fb_info[2]); igt_require(o->fb_ids[2]); + } paint_flip_mode(&o->fb_info[0], false); if (!(o->flags & TEST_BO_TOOBIG)) @@ -1488,7 +1438,7 @@ struct test_output o; int i, n, modes = 0; - igt_require((flags & TEST_HANG) == 0 || !is_hung(drm_fd)); + igt_require((flags & TEST_HANG) == 0 || !is_wedged(drm_fd)); if (flags & TEST_RPM) igt_require(igt_setup_runtime_pm()); @@ -1548,7 +1498,7 @@ struct test_output o; int i, j, m, n, modes = 0; - igt_require((flags & TEST_HANG) == 0 || !is_hung(drm_fd)); + igt_require((flags & TEST_HANG) == 0 || !is_wedged(drm_fd)); resources = drmModeGetResources(drm_fd); igt_assert(resources); @@ -1685,20 +1635,20 @@ "blt-wf_vblank-vs-modeset" }, { 60, TEST_VBLANK | TEST_MODESET | TEST_WITH_DUMMY_RCS, "rcs-wf_vblank-vs-modeset" }, - { 30, TEST_FLIP | TEST_BASIC, "plain-flip" }, + { 10, TEST_FLIP | TEST_BASIC, "plain-flip" }, { 30, TEST_FLIP | TEST_EBUSY , "busy-flip" }, { 30, TEST_FLIP | TEST_FENCE_STRESS , "flip-vs-fences" }, { 30, TEST_FLIP | TEST_CHECK_TS, "plain-flip-ts-check" }, { 30, TEST_FLIP | TEST_CHECK_TS | TEST_FB_RECREATE, "plain-flip-fb-recreate" }, { 30, TEST_FLIP | TEST_RMFB | TEST_MODESET , "flip-vs-rmfb" }, - { 60, TEST_FLIP | TEST_DPMS | TEST_EINVAL | TEST_BASIC, "flip-vs-dpms" }, + { 20, TEST_FLIP | TEST_DPMS | TEST_EINVAL | TEST_BASIC, "flip-vs-dpms" }, { 60, TEST_FLIP | TEST_DPMS | TEST_WITH_DUMMY_BCS, "blt-flip-vs-dpms" }, { 60, TEST_FLIP | TEST_DPMS | TEST_WITH_DUMMY_RCS, "render-flip-vs-dpms" }, { 30, TEST_FLIP | TEST_PAN, "flip-vs-panning" }, { 60, TEST_FLIP | TEST_PAN | TEST_WITH_DUMMY_BCS, "blt-flip-vs-panning" }, { 60, TEST_FLIP | TEST_PAN | TEST_WITH_DUMMY_RCS, "render-flip-vs-panning" }, - { 60, TEST_FLIP | TEST_MODESET | TEST_EINVAL | TEST_BASIC, "flip-vs-modeset" }, + { 20, TEST_FLIP | TEST_MODESET | TEST_EINVAL | TEST_BASIC, "flip-vs-modeset" }, { 60, TEST_FLIP | TEST_MODESET | TEST_WITH_DUMMY_BCS, "blt-flip-vs-modeset" }, { 60, TEST_FLIP | TEST_MODESET | TEST_WITH_DUMMY_RCS, "render-flip-vs-modeset" }, { 30, TEST_FLIP | TEST_VBLANK_EXPIRED_SEQ, @@ -1706,7 +1656,7 @@ { 30, TEST_FLIP | TEST_VBLANK | TEST_VBLANK_ABSOLUTE | TEST_CHECK_TS, "flip-vs-absolute-wf_vblank" }, - { 30, TEST_FLIP | TEST_VBLANK | TEST_CHECK_TS | TEST_BASIC, + { 10, TEST_FLIP | TEST_VBLANK | TEST_CHECK_TS | TEST_BASIC, "flip-vs-wf_vblank" }, { 30, TEST_FLIP | TEST_VBLANK | TEST_VBLANK_BLOCK | TEST_CHECK_TS, "flip-vs-blocking-wf-vblank" }, @@ -1736,7 +1686,7 @@ igt_skip_on_simulation(); igt_fixture { - drm_fd = drm_open_driver_master(DRIVER_INTEL); + drm_fd = drm_open_driver_master(DRIVER_ANY); igt_enable_connectors(); @@ -1745,8 +1695,10 @@ get_timestamp_format(); bufmgr = drm_intel_bufmgr_gem_init(drm_fd, 4096); - devid = intel_get_drm_devid(drm_fd); - batch = intel_batchbuffer_alloc(bufmgr, devid); + if (bufmgr) { + devid = intel_get_drm_devid(drm_fd); + batch = intel_batchbuffer_alloc(bufmgr, devid); + } } igt_subtest("nonblocking-read") diff -Nru intel-gpu-tools-1.13/tests/kms_flip_event_leak.c intel-gpu-tools-1.15/tests/kms_flip_event_leak.c --- intel-gpu-tools-1.13/tests/kms_flip_event_leak.c 2015-11-30 16:26:23.000000000 +0000 +++ intel-gpu-tools-1.15/tests/kms_flip_event_leak.c 2016-05-23 10:51:28.000000000 +0000 @@ -62,13 +62,13 @@ igt_create_color_fb(data->drm_fd, mode->hdisplay, mode->vdisplay, DRM_FORMAT_XRGB8888, - LOCAL_I915_FORMAT_MOD_X_TILED, + LOCAL_DRM_FORMAT_MOD_NONE, 0.0, 0.0, 0.0, &fb[0]); igt_plane_set_fb(primary, &fb[0]); igt_display_commit2(&data->display, COMMIT_LEGACY); - fd = drm_open_driver(DRIVER_INTEL); + fd = drm_open_driver(DRIVER_ANY); ret = drmDropMaster(data->drm_fd); igt_assert_eq(ret, 0); @@ -78,7 +78,7 @@ igt_create_color_fb(fd, mode->hdisplay, mode->vdisplay, DRM_FORMAT_XRGB8888, - LOCAL_I915_FORMAT_MOD_X_TILED, + LOCAL_DRM_FORMAT_MOD_NONE, 0.0, 0.0, 0.0, &fb[1]); ret = drmModePageFlip(fd, output->config.crtc->crtc_id, fb[1].fb_id, DRM_MODE_PAGE_FLIP_EVENT, @@ -109,7 +109,7 @@ igt_skip_on_simulation(); - data.drm_fd = drm_open_driver_master(DRIVER_INTEL); + data.drm_fd = drm_open_driver_master(DRIVER_ANY); kmstest_set_vt_graphics_mode(); igt_display_init(&data.display, data.drm_fd); diff -Nru intel-gpu-tools-1.13/tests/kms_flip_tiling.c intel-gpu-tools-1.15/tests/kms_flip_tiling.c --- intel-gpu-tools-1.13/tests/kms_flip_tiling.c 2015-11-30 16:26:23.000000000 +0000 +++ intel-gpu-tools-1.15/tests/kms_flip_tiling.c 2016-05-23 10:51:28.000000000 +0000 @@ -39,16 +39,6 @@ int gen; } data_t; -static void -fill_fb(struct igt_fb *fb, data_t *data, drmModeModeInfo *mode) -{ - cairo_t *cr; - - cr = igt_get_cairo_ctx(data->drm_fd, fb); - igt_paint_test_pattern(cr, mode->hdisplay, mode->vdisplay); - cairo_destroy(cr); -} - static igt_pipe_crc_t *_pipe_crc; static igt_pipe_crc_t *pipe_crc_new(int pipe) @@ -75,7 +65,7 @@ static void wait_for_pageflip(int fd) { drmEventContext evctx = { .version = DRM_EVENT_CONTEXT_VERSION }; - struct timeval timeout = { .tv_sec = 0, .tv_usec = 32000 }; + struct timeval timeout = { .tv_sec = 0, .tv_usec = 50000 }; fd_set fds; int ret; @@ -121,20 +111,17 @@ width *= 2; } - fb_id = igt_create_fb(data->drm_fd, width, mode->vdisplay, - DRM_FORMAT_XRGB8888, tiling[0], - &fb[0]); + fb_id = igt_create_pattern_fb(data->drm_fd, width, mode->vdisplay, + DRM_FORMAT_XRGB8888, tiling[0], + &fb[0]); igt_assert(fb_id); /* Second fb has different background so CRC does not match. */ - fb_id = igt_create_color_fb(data->drm_fd, width, mode->vdisplay, - DRM_FORMAT_XRGB8888, tiling[1], - 0.5, 0.5, 0.5, &fb[1]); + fb_id = igt_create_color_pattern_fb(data->drm_fd, width, mode->vdisplay, + DRM_FORMAT_XRGB8888, tiling[1], + 0.5, 0.5, 0.5, &fb[1]); igt_assert(fb_id); - fill_fb(&fb[0], data, mode); - fill_fb(&fb[1], data, mode); - /* Set the crtc and generate a reference CRC. */ igt_plane_set_fb(primary, &fb[1]); igt_display_commit(&data->display); diff -Nru intel-gpu-tools-1.13/tests/kms_force_connector_basic.c intel-gpu-tools-1.15/tests/kms_force_connector_basic.c --- intel-gpu-tools-1.13/tests/kms_force_connector_basic.c 1970-01-01 00:00:00.000000000 +0000 +++ intel-gpu-tools-1.15/tests/kms_force_connector_basic.c 2016-05-23 10:51:28.000000000 +0000 @@ -0,0 +1,254 @@ +/* + * Copyright © 2014 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 "igt.h" + +IGT_TEST_DESCRIPTION("Check the debugfs force connector/edid features work" + " correctly."); + +#define CHECK_MODE(m, h, w, r) \ + igt_assert_eq(m.hdisplay, h); igt_assert_eq(m.vdisplay, w); \ + igt_assert_eq(m.vrefresh, r); + +static void reset_connectors(void) +{ + int drm_fd = 0; + drmModeRes *res; + drmModeConnector *connector = NULL; + + drm_fd = drm_open_driver_master(DRIVER_INTEL); + res = drmModeGetResources(drm_fd); + + for (int i = 0; i < res->count_connectors; i++) { + + connector = drmModeGetConnectorCurrent(drm_fd, + res->connectors[i]); + + kmstest_force_connector(drm_fd, connector, + FORCE_CONNECTOR_UNSPECIFIED); + + kmstest_force_edid(drm_fd, connector, NULL, 0); + + drmModeFreeConnector(connector); + } + + igt_set_module_param_int("load_detect_test", 0); +} + +static int opt_handler(int opt, int opt_index, void *data) +{ + switch (opt) { + case 'r': + reset_connectors(); + exit(0); + break; + } + + return 0; +} + +int main(int argc, char **argv) +{ + /* force the VGA output and test that it worked */ + int drm_fd = 0; + drmModeRes *res; + drmModeConnector *vga_connector = NULL, *temp; + int start_n_modes, start_connection; + struct option long_opts[] = { + {"reset", 0, 0, 'r'}, + {0, 0, 0, 0} + }; + const char *help_str = + " --reset\t\tReset all connector force states and edid.\n"; + + igt_subtest_init_parse_opts(&argc, argv, "", long_opts, help_str, + opt_handler, NULL); + + igt_fixture { + drm_fd = drm_open_driver_master(DRIVER_INTEL); + res = drmModeGetResources(drm_fd); + igt_assert(res); + + /* find the vga connector */ + for (int i = 0; i < res->count_connectors; i++) { + + vga_connector = drmModeGetConnectorCurrent(drm_fd, + res->connectors[i]); + + if (vga_connector->connector_type == DRM_MODE_CONNECTOR_VGA) { + start_n_modes = vga_connector->count_modes; + start_connection = vga_connector->connection; + break; + } + + drmModeFreeConnector(vga_connector); + + vga_connector = NULL; + } + + igt_require(vga_connector); + igt_skip_on(vga_connector->connection == DRM_MODE_CONNECTED); + } + + igt_subtest("force-load-detect") { + /* + * disable all outputs to make sure we have a + * free crtc available for load detect + */ + kmstest_set_vt_graphics_mode(); + kmstest_unset_all_crtcs(drm_fd, res); + + igt_set_module_param_int("load_detect_test", 1); + + /* This can't use drmModeGetConnectorCurrent + * because connector probing is the point of this test. + */ + temp = drmModeGetConnector(drm_fd, vga_connector->connector_id); + + igt_set_module_param_int("load_detect_test", 0); + + igt_assert(temp->connection != DRM_MODE_UNKNOWNCONNECTION); + + drmModeFreeConnector(temp); + } + + igt_subtest("force-connector-state") { + igt_display_t display; + + /* force the connector on and check the reported values */ + kmstest_force_connector(drm_fd, vga_connector, FORCE_CONNECTOR_ON); + temp = drmModeGetConnectorCurrent(drm_fd, + vga_connector->connector_id); + igt_assert_eq(temp->connection, DRM_MODE_CONNECTED); + igt_assert_lt(0, temp->count_modes); + drmModeFreeConnector(temp); + + /* attempt to use the display */ + kmstest_set_vt_graphics_mode(); + igt_display_init(&display, drm_fd); + igt_display_commit(&display); + igt_display_fini(&display); + + + /* force the connector off */ + kmstest_force_connector(drm_fd, vga_connector, + FORCE_CONNECTOR_OFF); + temp = drmModeGetConnectorCurrent(drm_fd, + vga_connector->connector_id); + igt_assert_eq(temp->connection, DRM_MODE_DISCONNECTED); + igt_assert_eq(0, temp->count_modes); + drmModeFreeConnector(temp); + + /* check that the previous state is restored */ + kmstest_force_connector(drm_fd, vga_connector, + FORCE_CONNECTOR_UNSPECIFIED); + temp = drmModeGetConnectorCurrent(drm_fd, + vga_connector->connector_id); + igt_assert_eq(temp->connection, start_connection); + drmModeFreeConnector(temp); + } + + igt_subtest("force-edid") { + kmstest_force_connector(drm_fd, vga_connector, + FORCE_CONNECTOR_ON); + temp = drmModeGetConnectorCurrent(drm_fd, + vga_connector->connector_id); + drmModeFreeConnector(temp); + + /* test edid forcing */ + kmstest_force_edid(drm_fd, vga_connector, + igt_kms_get_base_edid(), EDID_LENGTH); + temp = drmModeGetConnectorCurrent(drm_fd, + vga_connector->connector_id); + + igt_debug("num_conn %i\n", temp->count_modes); + + CHECK_MODE(temp->modes[0], 1920, 1080, 60); + /* Don't check non-preferred modes to avoid to tight coupling + * with the in-kernel EDID parser. */ + + drmModeFreeConnector(temp); + + /* remove edid */ + kmstest_force_edid(drm_fd, vga_connector, NULL, 0); + kmstest_force_connector(drm_fd, vga_connector, + FORCE_CONNECTOR_UNSPECIFIED); + temp = drmModeGetConnectorCurrent(drm_fd, + vga_connector->connector_id); + /* the connector should now have the same number of modes that + * it started with */ + igt_assert_eq(temp->count_modes, start_n_modes); + drmModeFreeConnector(temp); + + } + + igt_subtest("prune-stale-modes") { + int i; + + kmstest_force_connector(drm_fd, vga_connector, + FORCE_CONNECTOR_ON); + + /* test pruning of stale modes */ + kmstest_force_edid(drm_fd, vga_connector, + igt_kms_get_alt_edid(), EDID_LENGTH); + temp = drmModeGetConnectorCurrent(drm_fd, + vga_connector->connector_id); + + for (i = 0; i < temp->count_modes; i++) { + if (temp->modes[i].hdisplay == 1400 && + temp->modes[i].vdisplay == 1050) + break; + } + igt_assert_f(i != temp->count_modes, "1400x1050 not on mode list\n"); + + drmModeFreeConnector(temp); + + kmstest_force_edid(drm_fd, vga_connector, + igt_kms_get_base_edid(), EDID_LENGTH); + temp = drmModeGetConnectorCurrent(drm_fd, + vga_connector->connector_id); + + for (i = 0; i < temp->count_modes; i++) { + if (temp->modes[i].hdisplay == 1400 && + temp->modes[i].vdisplay == 1050) + break; + } + igt_assert_f(i == temp->count_modes, "1400x1050 not pruned from mode list\n"); + + drmModeFreeConnector(temp); + + kmstest_force_edid(drm_fd, vga_connector, NULL, 0); + kmstest_force_connector(drm_fd, vga_connector, + FORCE_CONNECTOR_UNSPECIFIED); + } + + igt_fixture { + drmModeFreeConnector(vga_connector); + close(drm_fd); + + reset_connectors(); + } + + igt_exit(); +} diff -Nru intel-gpu-tools-1.13/tests/kms_force_connector.c intel-gpu-tools-1.15/tests/kms_force_connector.c --- intel-gpu-tools-1.13/tests/kms_force_connector.c 2015-11-30 16:26:23.000000000 +0000 +++ intel-gpu-tools-1.15/tests/kms_force_connector.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,180 +0,0 @@ -/* - * Copyright © 2014 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 "igt.h" - -IGT_TEST_DESCRIPTION("Check the debugfs force connector/edid features work" - " correctly."); - -#define CHECK_MODE(m, h, w, r) \ - igt_assert_eq(m.hdisplay, h); igt_assert_eq(m.vdisplay, w); \ - igt_assert_eq(m.vrefresh, r); - -static void reset_connectors(void) -{ - int drm_fd = 0; - drmModeRes *res; - drmModeConnector *connector = NULL; - - drm_fd = drm_open_driver_master(DRIVER_INTEL); - res = drmModeGetResources(drm_fd); - - for (int i = 0; i < res->count_connectors; i++) { - - connector = drmModeGetConnector(drm_fd, res->connectors[i]); - - kmstest_force_connector(drm_fd, connector, - FORCE_CONNECTOR_UNSPECIFIED); - - kmstest_force_edid(drm_fd, connector, NULL, 0); - - drmModeFreeConnector(connector); - } -} - -static int opt_handler(int opt, int opt_index, void *data) -{ - switch (opt) { - case 'r': - reset_connectors(); - exit(0); - break; - } - - return 0; -} - -int main(int argc, char **argv) -{ - /* force the VGA output and test that it worked */ - int drm_fd = 0; - drmModeRes *res; - drmModeConnector *vga_connector = NULL, *temp; - int start_n_modes; - struct option long_opts[] = { - {"reset", 0, 0, 'r'}, - {0, 0, 0, 0} - }; - const char *help_str = - " --reset\t\tReset all connector force states and edid.\n"; - - igt_subtest_init_parse_opts(&argc, argv, "", long_opts, help_str, - opt_handler, NULL); - - igt_fixture { - drm_fd = drm_open_driver_master(DRIVER_INTEL); - res = drmModeGetResources(drm_fd); - - /* find the vga connector */ - for (int i = 0; i < res->count_connectors; i++) { - - vga_connector = drmModeGetConnector(drm_fd, res->connectors[i]); - - if (vga_connector->connector_type == DRM_MODE_CONNECTOR_VGA) - break; - - drmModeFreeConnector(vga_connector); - - vga_connector = NULL; - } - - igt_require(vga_connector); - igt_skip_on(vga_connector->connection == DRM_MODE_CONNECTED); - } - - igt_subtest("force-connector-state") { - igt_display_t display; - - /* force the connector on and check the reported values */ - kmstest_force_connector(drm_fd, vga_connector, FORCE_CONNECTOR_ON); - temp = drmModeGetConnector(drm_fd, vga_connector->connector_id); - igt_assert_eq(temp->connection, DRM_MODE_CONNECTED); - igt_assert_lt(0, temp->count_modes); - drmModeFreeConnector(temp); - - /* attempt to use the display */ - kmstest_set_vt_graphics_mode(); - igt_display_init(&display, drm_fd); - igt_display_commit(&display); - igt_display_fini(&display); - - - /* force the connector off */ - kmstest_force_connector(drm_fd, vga_connector, - FORCE_CONNECTOR_OFF); - temp = drmModeGetConnector(drm_fd, vga_connector->connector_id); - igt_assert_eq(temp->connection, DRM_MODE_DISCONNECTED); - igt_assert_eq(0, temp->count_modes); - drmModeFreeConnector(temp); - - /* check that the previous state is restored */ - kmstest_force_connector(drm_fd, vga_connector, - FORCE_CONNECTOR_UNSPECIFIED); - temp = drmModeGetConnector(drm_fd, vga_connector->connector_id); - igt_assert_eq(temp->connection, vga_connector->connection); - drmModeFreeConnector(temp); - } - - igt_subtest("force-edid") { - kmstest_force_connector(drm_fd, vga_connector, - FORCE_CONNECTOR_ON); - temp = drmModeGetConnector(drm_fd, vga_connector->connector_id); - start_n_modes = temp->count_modes; - drmModeFreeConnector(temp); - - /* test edid forcing */ - kmstest_force_edid(drm_fd, vga_connector, - igt_kms_get_base_edid(), EDID_LENGTH); - temp = drmModeGetConnector(drm_fd, - vga_connector->connector_id); - - CHECK_MODE(temp->modes[0], 1920, 1080, 60); - CHECK_MODE(temp->modes[1], 1280, 720, 60); - CHECK_MODE(temp->modes[2], 1024, 768, 60); - CHECK_MODE(temp->modes[3], 800, 600, 60); - CHECK_MODE(temp->modes[4], 640, 480, 60); - - drmModeFreeConnector(temp); - - /* remove edid */ - kmstest_force_edid(drm_fd, vga_connector, NULL, 0); - temp = drmModeGetConnector(drm_fd, vga_connector->connector_id); - /* the connector should now have the same number of modes that - * it started with */ - igt_assert_eq(temp->count_modes, start_n_modes); - drmModeFreeConnector(temp); - - kmstest_force_connector(drm_fd, vga_connector, - FORCE_CONNECTOR_UNSPECIFIED); - } - - igt_fixture { - drmModeFreeConnector(vga_connector); - close(drm_fd); - - reset_connectors(); - } - - igt_exit(); -} diff -Nru intel-gpu-tools-1.13/tests/kms_frontbuffer_tracking.c intel-gpu-tools-1.15/tests/kms_frontbuffer_tracking.c --- intel-gpu-tools-1.13/tests/kms_frontbuffer_tracking.c 2015-11-30 16:26:23.000000000 +0000 +++ intel-gpu-tools-1.15/tests/kms_frontbuffer_tracking.c 2016-05-23 10:51:28.000000000 +0000 @@ -97,12 +97,15 @@ FBS_COUNT, } fbs; - /* Which features are we going to test now? This is a mask! */ + /* Which features are we going to test now? This is a mask! + * FEATURE_DEFAULT is a special value which instruct the test to just + * keep what's already enabled by default in the Kernel. */ enum { FEATURE_NONE = 0, FEATURE_FBC = 1, FEATURE_PSR = 2, FEATURE_COUNT = 4, + FEATURE_DEFAULT = 4, } feature; /* Possible pixel formats. We just use FORMAT_DEFAULT for most tests and @@ -149,10 +152,12 @@ #define MAX_CONNECTORS 32 #define MAX_PLANES 32 +#define MAX_ENCODERS 32 struct { int fd; drmModeResPtr res; drmModeConnectorPtr connectors[MAX_CONNECTORS]; + drmModeEncoderPtr encoders[MAX_ENCODERS]; drmModePlaneResPtr plane_res; drmModePlanePtr planes[MAX_PLANES]; uint64_t plane_types[MAX_PLANES]; @@ -354,32 +359,45 @@ igt_assert(false); } +static drmModeEncoderPtr get_encoder(uint32_t id) +{ + int i; + + for (i = 0; i < drm.res->count_encoders; i++) + if (drm.res->encoders[i] == id) + return drm.encoders[i]; + + igt_assert(false); +} + static void print_mode_info(const char *screen, struct modeset_params *params) { drmModeConnectorPtr c = get_connector(params->connector_id); - igt_info("%s screen: %s %s\n", + igt_info("%s screen: %s %s, crtc %d\n", screen, kmstest_connector_type_str(c->connector_type), - params->mode->name); + params->mode->name, + params->crtc_id); } static void init_mode_params(struct modeset_params *params, uint32_t crtc_id, - int crtc_index, uint32_t connector_id, + drmModeConnectorPtr connector, drmModeModeInfoPtr mode) { uint32_t plane_id = 0; + int crtc_idx = kmstest_get_crtc_idx(drm.res, crtc_id); int i; for (i = 0; i < drm.plane_res->count_planes && plane_id == 0; i++) - if ((drm.planes[i]->possible_crtcs & (1 << crtc_index)) && + if ((drm.planes[i]->possible_crtcs & (1 << crtc_idx)) && drm.plane_types[i] == DRM_PLANE_TYPE_OVERLAY) plane_id = drm.planes[i]->plane_id; igt_assert(plane_id); params->crtc_id = crtc_id; - params->connector_id = connector_id; + params->connector_id = connector->connector_id; params->mode = mode; params->sprite_id = plane_id; @@ -424,56 +442,90 @@ return true; } -static bool init_modeset_cached_params(void) +static bool connector_supports_pipe_a(drmModeConnectorPtr connector) { int i; - uint32_t prim_connector_id = 0, scnd_connector_id = 0; - drmModeModeInfoPtr prim_mode = NULL, scnd_mode = NULL; - drmModeModeInfoPtr tmp_mode; - /* First, try to find an eDP monitor since it's the only possible type - * for PSR. */ - for (i = 0; i < drm.res->count_connectors; i++) { - if (drm.connectors[i]->connector_type != DRM_MODE_CONNECTOR_eDP) - continue; + for (i = 0; i < connector->count_encoders; i++) + if (get_encoder(connector->encoders[i])->possible_crtcs & 1) + return true; + + return false; +} + +static bool find_connector(bool edp_only, bool pipe_a, uint32_t forbidden_id, + drmModeConnectorPtr *ret_connector, + drmModeModeInfoPtr *ret_mode) +{ + drmModeConnectorPtr c = NULL; + drmModeModeInfoPtr mode = NULL; + int i; - if (connector_get_mode(drm.connectors[i], &tmp_mode)) { - prim_connector_id = drm.res->connectors[i]; - prim_mode = tmp_mode; - } - } for (i = 0; i < drm.res->count_connectors; i++) { - /* Don't pick again what we just selected on the above loop. */ - if (drm.res->connectors[i] == prim_connector_id) + c = drm.connectors[i]; + + if (edp_only && c->connector_type != DRM_MODE_CONNECTOR_eDP) + continue; + if (pipe_a && !connector_supports_pipe_a(c)) + continue; + if (c->connector_id == forbidden_id) + continue; + if (!connector_get_mode(c, &mode)) continue; - if (connector_get_mode(drm.connectors[i], &tmp_mode)) { - if (!prim_connector_id) { - prim_connector_id = drm.res->connectors[i]; - prim_mode = tmp_mode; - } else if (!scnd_connector_id) { - scnd_connector_id = drm.res->connectors[i]; - scnd_mode = tmp_mode; - break; - } - } + *ret_connector = c; + *ret_mode = mode; + return true; } - if (!prim_connector_id) + return false; +} + +static bool init_modeset_cached_params(void) +{ + drmModeConnectorPtr prim_connector = NULL, scnd_connector = NULL; + drmModeModeInfoPtr prim_mode = NULL, scnd_mode = NULL; + uint32_t prim_crtc_id, scnd_crtc_id; + + /* + * We have this problem where PSR is only present on eDP monitors and + * FBC is only present on pipe A for some platforms. So we search first + * for the ideal case of eDP supporting pipe A, and try the less optimal + * configs later, sacrificing one of the features. + * TODO: refactor the code in a way that allows us to have different + * sets of prim/scnd structs for different features. + */ + find_connector(true, true, 0, &prim_connector, &prim_mode); + if (!prim_connector) + find_connector(true, false, 0, &prim_connector, &prim_mode); + if (!prim_connector) + find_connector(false, true, 0, &prim_connector, &prim_mode); + if (!prim_connector) + find_connector(false, false, 0, &prim_connector, &prim_mode); + + if (!prim_connector) return false; - init_mode_params(&prim_mode_params, drm.res->crtcs[0], 0, - prim_connector_id, prim_mode); + find_connector(false, false, prim_connector->connector_id, + &scnd_connector, &scnd_mode); + + prim_crtc_id = kmstest_find_crtc_for_connector(drm.fd, drm.res, + prim_connector, 0); + init_mode_params(&prim_mode_params, prim_crtc_id, + prim_connector, prim_mode); print_mode_info("Primary", &prim_mode_params); - if (!scnd_connector_id) { + if (!scnd_connector) { scnd_mode_params.connector_id = 0; return true; } igt_assert(drm.res->count_crtcs >= 2); - init_mode_params(&scnd_mode_params, drm.res->crtcs[1], 1, - scnd_connector_id, scnd_mode); + scnd_crtc_id = kmstest_find_crtc_for_connector(drm.fd, drm.res, + scnd_connector, + 1 << kmstest_get_crtc_idx(drm.res, prim_crtc_id)); + init_mode_params(&scnd_mode_params, scnd_crtc_id, + scnd_connector, scnd_mode); print_mode_info("Secondary", &scnd_mode_params); return true; @@ -483,6 +535,9 @@ uint64_t tiling, int plane, struct igt_fb *fb) { uint32_t format; + unsigned int size, stride; + int bpp; + uint64_t tiling_for_size; switch (pformat) { case FORMAT_RGB888: @@ -512,7 +567,21 @@ igt_assert(false); } - igt_create_fb(drm.fd, width, height, format, tiling, fb); + /* We want all frontbuffers with the same width/height/format to have + * the same size regardless of tiling since we want to properly exercise + * the Kernel's specific tiling-checking code paths without accidentally + * hitting size-checking ones first. */ + bpp = igt_drm_format_to_bpp(format); + if (plane == PLANE_CUR) + tiling_for_size = LOCAL_DRM_FORMAT_MOD_NONE; + else + tiling_for_size = LOCAL_I915_FORMAT_MOD_X_TILED; + + igt_calc_fb_size(drm.fd, width, height, bpp, tiling_for_size, &size, + &stride); + + igt_create_fb_with_bo_size(drm.fd, width, height, format, tiling, fb, + size, stride); } static uint32_t pick_color(struct igt_fb *fb, enum color ecolor) @@ -851,7 +920,7 @@ static bool psr_wait_until_enabled(void) { - return igt_wait(psr_is_enabled(), 2000, 1); + return igt_wait(psr_is_enabled(), 5000, 1); } #define fbc_enable() igt_set_module_param_int("enable_fbc", 1) @@ -859,12 +928,22 @@ #define psr_enable() igt_set_module_param_int("enable_psr", 1) #define psr_disable() igt_set_module_param_int("enable_psr", 0) -static void get_sink_crc(sink_crc_t *crc) +static void get_sink_crc(sink_crc_t *crc, bool mandatory) { + int rc, errno_; + lseek(sink_crc.fd, 0, SEEK_SET); - igt_assert(read(sink_crc.fd, crc->data, SINK_CRC_SIZE) == - SINK_CRC_SIZE); + rc = read(sink_crc.fd, crc->data, SINK_CRC_SIZE); + errno_ = errno; + + if (rc == -1 && errno_ == ETIMEDOUT) { + if (mandatory) + igt_skip("Sink CRC is unreliable on this machine. Try running this test again individually\n"); + else + igt_info("Sink CRC is unreliable on this machine. Try running this test again individually\n"); + } + igt_assert(rc == SINK_CRC_SIZE); } static bool sink_crc_equal(sink_crc_t *a, sink_crc_t *b) @@ -1074,8 +1153,11 @@ } } -static void disable_features(void) +static void disable_features(const struct test_mode *t) { + if (t->feature == FEATURE_DEFAULT) + return; + fbc_disable(); psr_disable(); } @@ -1092,21 +1174,6 @@ pthread_exit(0); } -static int fb_get_bpp(struct igt_fb *fb) -{ - switch (fb->drm_format) { - case DRM_FORMAT_RGB565: - return 16; - case DRM_FORMAT_XRGB8888: - case DRM_FORMAT_ARGB8888: - case DRM_FORMAT_ARGB2101010: - case DRM_FORMAT_XRGB2101010: - return 32; - default: - igt_assert(false); - } -} - static void start_busy_thread(struct igt_fb *fb) { int rc; @@ -1119,7 +1186,7 @@ busy_thread.width = fb->width; busy_thread.height = fb->height; busy_thread.color = pick_color(fb, COLOR_PRIM_BG); - busy_thread.bpp = fb_get_bpp(fb); + busy_thread.bpp = igt_drm_format_to_bpp(fb->drm_format); rc = pthread_create(&busy_thread.thread, NULL, busy_thread_func, NULL); igt_assert_eq(rc, 0); @@ -1148,17 +1215,17 @@ free(pipe_str); } -static void collect_crcs(struct both_crcs *crcs) +static void collect_crcs(struct both_crcs *crcs, bool mandatory_sink_crc) { igt_pipe_crc_collect_crc(pipe_crc, &crcs->pipe); if (sink_crc.supported) - get_sink_crc(&crcs->sink); + get_sink_crc(&crcs->sink, mandatory_sink_crc); else memcpy(&crcs->sink, "unsupported!", SINK_CRC_SIZE); } -static void init_blue_crc(enum pixel_format format) +static void init_blue_crc(enum pixel_format format, bool mandatory_sink_crc) { struct igt_fb blue; int rc; @@ -1176,7 +1243,7 @@ blue.fb_id, 0, 0, &prim_mode_params.connector_id, 1, prim_mode_params.mode); igt_assert_eq(rc, 0); - collect_crcs(&blue_crcs[format].crc); + collect_crcs(&blue_crcs[format].crc, mandatory_sink_crc); print_crc("Blue CRC: ", &blue_crcs[format].crc); @@ -1188,7 +1255,8 @@ } static void init_crcs(enum pixel_format format, - struct draw_pattern_info *pattern) + struct draw_pattern_info *pattern, + bool mandatory_sink_crc) { int r, r_, rc; struct igt_fb tmp_fbs[pattern->n_rects]; @@ -1224,7 +1292,7 @@ &prim_mode_params.connector_id, 1, prim_mode_params.mode); igt_assert_eq(rc, 0); - collect_crcs(&pattern->crcs[format][r]); + collect_crcs(&pattern->crcs[format][r], mandatory_sink_crc); } for (r = 0; r < pattern->n_rects; r++) { @@ -1264,10 +1332,14 @@ drm.res = drmModeGetResources(drm.fd); igt_assert(drm.res->count_connectors <= MAX_CONNECTORS); + igt_assert(drm.res->count_encoders <= MAX_ENCODERS); for (i = 0; i < drm.res->count_connectors; i++) - drm.connectors[i] = drmModeGetConnector(drm.fd, + drm.connectors[i] = drmModeGetConnectorCurrent(drm.fd, drm.res->connectors[i]); + for (i = 0; i < drm.res->count_encoders; i++) + drm.encoders[i] = drmModeGetEncoder(drm.fd, + drm.res->encoders[i]); rc = drmSetClientCap(drm.fd, DRM_CLIENT_CAP_UNIVERSAL_PLANES, 1); igt_require(rc == 0); @@ -1295,6 +1367,8 @@ drmModeFreePlane(drm.planes[i]); drmModeFreePlaneResources(drm.plane_res); + for (i = 0; i < drm.res->count_encoders; i++) + drmModeFreeEncoder(drm.encoders[i]); for (i = 0; i < drm.res->count_connectors; i++) drmModeFreeConnector(drm.connectors[i]); @@ -1345,18 +1419,21 @@ errno_ = errno; if (rc == -1 && errno_ == ENOTTY) igt_info("Sink CRC not supported: panel doesn't support it\n"); + if (rc == -1 && errno_ == ETIMEDOUT) + igt_info("Sink CRC not reliable on this panel: skipping it\n"); else if (rc == SINK_CRC_SIZE) sink_crc.supported = true; else - igt_info("Unexpected sink CRC error, rc=:%ld errno:%d %s\n", + igt_info("Unexpected sink CRC error, rc=:%zd errno:%d %s\n", rc, errno_, strerror(errno_)); } static void setup_crcs(void) { enum pixel_format f; + int crtc_idx = kmstest_get_crtc_idx(drm.res, prim_mode_params.crtc_id); - pipe_crc = igt_pipe_crc_new(0, INTEL_PIPE_CRC_SOURCE_AUTO); + pipe_crc = igt_pipe_crc_new(crtc_idx, INTEL_PIPE_CRC_SOURCE_AUTO); setup_sink_crc(); @@ -1427,10 +1504,23 @@ static void setup_fbc(void) { + drmModeConnectorPtr c = get_connector(prim_mode_params.connector_id); + if (!fbc_supported_on_chipset()) { igt_info("Can't test FBC: not supported on this chipset\n"); return; } + + /* + * While some platforms do allow FBC on pipes B/C, this test suite + * is not prepared for that yet. + * TODO: solve this. + */ + if (!connector_supports_pipe_a(c)) { + igt_info("Can't test FBC: primary connector doesn't support " + "pipe A\n"); + return; + } fbc.can_test = true; fbc_setup_last_action(); @@ -1570,19 +1660,23 @@ return flags; } -#define do_crc_assertions(flags) do { \ +#define do_crc_assertions(flags, mandatory_sink_crc) do { \ int flags__ = (flags); \ struct both_crcs crc_; \ \ if (!opt.check_crc || (flags__ & DONT_ASSERT_CRC)) \ break; \ \ - collect_crcs(&crc_); \ + collect_crcs(&crc_, mandatory_sink_crc); \ print_crc("Calculated CRC:", &crc_); \ \ igt_assert(wanted_crc); \ igt_assert_crc_equal(&crc_.pipe, &wanted_crc->pipe); \ - assert_sink_crc_equal(&crc_.sink, &wanted_crc->sink); \ + if (mandatory_sink_crc) \ + assert_sink_crc_equal(&crc_.sink, &wanted_crc->sink); \ + else \ + if (!sink_crc_equal(&crc_.sink, &wanted_crc->sink)) \ + igt_info("Sink CRC differ, but not required\n"); \ } while (0) #define do_status_assertions(flags_) do { \ @@ -1618,12 +1712,13 @@ #define do_assertions(flags) do { \ int flags_ = adjust_assertion_flags(t, (flags)); \ + bool mandatory_sink_crc = t->feature & FEATURE_PSR; \ \ wait_user(2, "Paused before assertions."); \ \ /* Check the CRC to make sure the drawing operations work \ * immediately, independently of the features being enabled. */ \ - do_crc_assertions(flags_); \ + do_crc_assertions(flags_, mandatory_sink_crc); \ \ /* Now we can flush things to make the test faster. */ \ do_flush(t); \ @@ -1636,7 +1731,7 @@ * would only delay the test suite while adding no value to the \ * test suite. */ \ if (t->screen == SCREEN_PRIM) \ - do_crc_assertions(flags_); \ + do_crc_assertions(flags_, mandatory_sink_crc); \ \ if (fbc.supports_last_action && opt.fbc_check_last_action) { \ if (flags_ & ASSERT_LAST_ACTION_CHANGED) \ @@ -1705,6 +1800,9 @@ static void enable_features_for_test(const struct test_mode *t) { + if (t->feature == FEATURE_DEFAULT) + return; + if (t->feature & FEATURE_FBC) fbc_enable(); if (t->feature & FEATURE_PSR) @@ -1784,7 +1882,7 @@ stop_busy_thread(); - disable_features(); + disable_features(t); set_crtc_fbs(t); if (t->screen == SCREEN_OFFSCREEN) @@ -1792,9 +1890,9 @@ unset_all_crtcs(); - init_blue_crc(t->format); + init_blue_crc(t->format, t->feature & FEATURE_PSR); if (pattern) - init_crcs(t->format, pattern); + init_crcs(t->format, pattern, t->feature & FEATURE_PSR); enable_features_for_test(t); } @@ -2183,16 +2281,12 @@ static void set_prim_plane_for_params(struct modeset_params *params) { - int rc, i, crtc_index = -1; + int rc, i; + int crtc_idx = kmstest_get_crtc_idx(drm.res, params->crtc_id); uint32_t plane_id = 0; - for (i = 0; i < drm.res->count_crtcs; i++) - if (drm.res->crtcs[i] == params->crtc_id) - crtc_index = i; - igt_assert(crtc_index >= 0); - for (i = 0; i < drm.plane_res->count_planes; i++) - if ((drm.planes[i]->possible_crtcs & (1 << crtc_index)) && + if ((drm.planes[i]->possible_crtcs & (1 << crtc_idx)) && drm.plane_types[i] == DRM_PLANE_TYPE_PRIMARY) plane_id = drm.planes[i]->plane_id; igt_assert(plane_id); @@ -2489,10 +2583,10 @@ { int i, rc; bool disabled, found = false; + int crtc_idx = kmstest_get_crtc_idx(drm.res, prim_mode_params.crtc_id); for (i = 0; i < drm.plane_res->count_planes; i++) { - /* We just pick the first CRTC for the primary plane. */ - if ((drm.planes[i]->possible_crtcs & 0x1) && + if ((drm.planes[i]->possible_crtcs & (1 << crtc_idx)) && drm.plane_types[i] == DRM_PLANE_TYPE_PRIMARY) { found = true; disabled = (drm.planes[i]->crtc_id == 0); @@ -2600,6 +2694,8 @@ struct modeset_params *params = pick_params(t); int i, rc; uint32_t plane_id; + int prim_crtc_idx = kmstest_get_crtc_idx(drm.res, + prim_mode_params.crtc_id); igt_require_f(intel_gen(intel_get_drm_devid(drm.fd)) >= 9, "Can't test primary plane scaling before gen 9\n"); @@ -2629,7 +2725,7 @@ pick_color(&new_fb, COLOR_MAGENTA)); for (i = 0; i < drm.plane_res->count_planes; i++) - if ((drm.planes[i]->possible_crtcs & 1) && + if ((drm.planes[i]->possible_crtcs & (1 << prim_crtc_idx)) && drm.plane_types[i] == DRM_PLANE_TYPE_PRIMARY) plane_id = drm.planes[i]->plane_id; @@ -2800,9 +2896,10 @@ struct modeset_params *params = pick_params(t); struct draw_pattern_info *pattern = &pattern1; struct fb_region *target; - int max_height; + int max_height, assertions = 0; + int gen = intel_gen(intel_get_drm_devid(drm.fd)); - switch (intel_gen(intel_get_drm_devid(drm.fd))) { + switch (gen) { case 2: max_height = 2048; break; @@ -2814,6 +2911,11 @@ break; } + /* Gen 9 doesn't do the same dspaddr_offset magic as the older + * gens, so FBC may not be enabled there. */ + if (gen >= 9) + assertions |= DONT_ASSERT_FEATURE_STATUS; + prepare_subtest(t, pattern); target = pick_target(t, params); @@ -2826,13 +2928,14 @@ params->fb.x = 0; params->fb.y = max_height - params->mode->vdisplay; set_mode_for_params(params); - do_assertions(0); + do_assertions(assertions); for (r = 0; r < pattern->n_rects; r++) { draw_rect(pattern, target, t->method, r); update_wanted_crc(t, &pattern->crcs[t->format][r]); + /* GTT draws disable PSR. */ - do_assertions(ASSERT_PSR_DISABLED); + do_assertions(assertions | ASSERT_PSR_DISABLED); } igt_remove_fb(drm.fd, &tall_fb); @@ -3032,6 +3135,68 @@ page_flip_for_params(params, flip_type); do_assertions(0); } + + igt_remove_fb(drm.fd, &new_fb); +} + +/* + * basic - do some basic operations regardless of which features are enabled + * + * METHOD + * This subtest does page flips and draw operations and checks the CRCs of the + * results. The big difference between this and the others is that here we + * don't enable/disable any features such as FBC or PSR: we go with whatever + * the Kernel has enabled by default for us. This subtest only does things + * that are exercised by the other subtests and in a less exhaustive way: it's + * completely redundant. On the other hand, it is very quick and was created + * with the CI system in mind: it's a quick way to detect regressions, so if + * it fails, then we can run the other subtests to find out why. + * + * EXPECTED RESULTS + * Passed CRC assertions. + * + * FAILURES + * If you get a failure here, you should run the more specific draw and flip + * subtests of each feature in order to discover what exactly is failing and + * why. + * + * TODO: do sink CRC assertions in case sink_crc.supported. Only do this after + * our sink CRC code gets 100% reliable, in order to avoid CI false negatives. + */ +static void basic_subtest(const struct test_mode *t) +{ + struct draw_pattern_info *pattern = &pattern1; + struct modeset_params *params = pick_params(t); + enum igt_draw_method method; + struct igt_fb *fb1, fb2; + int r; + int assertions = DONT_ASSERT_FEATURE_STATUS; + + prepare_subtest(t, pattern); + + create_fb(t->format, params->fb.fb->width, params->fb.fb->height, + LOCAL_I915_FORMAT_MOD_X_TILED, t->plane, &fb2); + fb1 = params->fb.fb; + + for (r = 0, method = 0; method < IGT_DRAW_METHOD_COUNT; method++, r++) { + if (r == pattern->n_rects) { + params->fb.fb = (params->fb.fb == fb1) ? &fb2 : fb1; + + fill_fb_region(¶ms->fb, COLOR_PRIM_BG); + update_wanted_crc(t, &blue_crcs[t->format].crc); + + page_flip_for_params(params, t->flip); + do_assertions(assertions); + + r = 0; + } + + draw_rect(pattern, ¶ms->fb, method, r); + update_wanted_crc(t, &pattern->crcs[t->format][r]); + do_assertions(assertions); + } + + igt_remove_fb(drm.fd, &fb2); } static int opt_handler(int option, int option_index, void *data) @@ -3436,6 +3601,16 @@ suspend_subtest(&t); TEST_MODE_ITER_END + t.pipes = PIPE_SINGLE; + t.screen = SCREEN_PRIM; + t.plane = PLANE_PRI; + t.fbs = FBS_INDIVIDUAL; + t.feature = FEATURE_DEFAULT; + t.format = FORMAT_DEFAULT; + t.flip = FLIP_PAGEFLIP; + igt_subtest("basic") + basic_subtest(&t); + igt_fixture teardown_environment(); diff -Nru intel-gpu-tools-1.13/tests/kms_mmap_write_crc.c intel-gpu-tools-1.15/tests/kms_mmap_write_crc.c --- intel-gpu-tools-1.13/tests/kms_mmap_write_crc.c 1970-01-01 00:00:00.000000000 +0000 +++ intel-gpu-tools-1.15/tests/kms_mmap_write_crc.c 2016-05-23 10:51:28.000000000 +0000 @@ -0,0 +1,312 @@ +/* + * Copyright © 2015 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: + * Tiago Vignatti + */ + +#include +#include +#include +#include +#include + +#include "drmtest.h" +#include "igt_debugfs.h" +#include "igt_kms.h" +#include "intel_chipset.h" +#include "ioctl_wrappers.h" +#include "igt_aux.h" + +IGT_TEST_DESCRIPTION( + "Use the display CRC support to validate mmap write to an already uncached future scanout buffer."); + +#define ROUNDS 10 + +typedef struct { + int drm_fd; + igt_display_t display; + struct igt_fb fb[2]; + igt_output_t *output; + igt_plane_t *primary; + enum pipe pipe; + igt_crc_t ref_crc; + igt_pipe_crc_t *pipe_crc; + uint32_t devid; +} data_t; + +static int ioctl_sync = true; +int dma_buf_fd; + +static char *dmabuf_mmap_framebuffer(int drm_fd, struct igt_fb *fb) +{ + char *ptr = NULL; + + dma_buf_fd = prime_handle_to_fd_for_mmap(drm_fd, fb->gem_handle); + igt_skip_on(dma_buf_fd == -1 && errno == EINVAL); + + ptr = mmap(NULL, fb->size, PROT_READ | PROT_WRITE, MAP_SHARED, dma_buf_fd, 0); + igt_assert(ptr != MAP_FAILED); + + return ptr; +} + +static void test(data_t *data) +{ + igt_display_t *display = &data->display; + igt_output_t *output = data->output; + struct igt_fb *fb = &data->fb[1]; + drmModeModeInfo *mode; + cairo_t *cr; + char *ptr; + uint32_t caching; + void *buf; + igt_crc_t crc; + + mode = igt_output_get_mode(output); + + /* create a non-white fb where we can write later */ + igt_create_fb(data->drm_fd, mode->hdisplay, mode->vdisplay, + DRM_FORMAT_XRGB8888, LOCAL_DRM_FORMAT_MOD_NONE, fb); + + ptr = dmabuf_mmap_framebuffer(data->drm_fd, fb); + + cr = igt_get_cairo_ctx(data->drm_fd, fb); + igt_paint_test_pattern(cr, fb->width, fb->height); + cairo_destroy(cr); + + /* flip to it to make it UC/WC and fully flushed */ + igt_plane_set_fb(data->primary, fb); + igt_display_commit(display); + + /* flip back the original white buffer */ + igt_plane_set_fb(data->primary, &data->fb[0]); + igt_display_commit(display); + + /* make sure caching mode has become UC/WT */ + caching = gem_get_caching(data->drm_fd, fb->gem_handle); + igt_assert(caching == I915_CACHING_NONE || caching == I915_CACHING_DISPLAY); + + /* + * firstly demonstrate the need for DMA_BUF_SYNC_START ("begin_cpu_access") + */ + if (ioctl_sync) + prime_sync_start(dma_buf_fd, true); + + /* use dmabuf pointer to make the other fb all white too */ + buf = malloc(fb->size); + igt_assert(buf != NULL); + memset(buf, 0xff, fb->size); + memcpy(ptr, buf, fb->size); + free(buf); + + /* and flip to it */ + igt_plane_set_fb(data->primary, fb); + igt_display_commit(display); + + /* check that the crc is as expected, which requires that caches got flushed */ + igt_pipe_crc_collect_crc(data->pipe_crc, &crc); + igt_assert_crc_equal(&crc, &data->ref_crc); + + /* + * now demonstrates the need for DMA_BUF_SYNC_END ("end_cpu_access") + */ + + /* start over, writing non-white to the fb again and flip to it to make it + * fully flushed */ + cr = igt_get_cairo_ctx(data->drm_fd, fb); + igt_paint_test_pattern(cr, fb->width, fb->height); + cairo_destroy(cr); + + igt_plane_set_fb(data->primary, fb); + igt_display_commit(display); + + /* sync start, to move to CPU domain */ + if (ioctl_sync) + prime_sync_start(dma_buf_fd, true); + + /* use dmabuf pointer in the same fb to make it all white */ + buf = malloc(fb->size); + igt_assert(buf != NULL); + memset(buf, 0xff, fb->size); + memcpy(ptr, buf, fb->size); + free(buf); + + /* if we don't change to the GTT domain again, the whites won't get flushed + * and therefore we demonstrates the need for sync end here */ + if (ioctl_sync) + prime_sync_end(dma_buf_fd, true); + + /* check that the crc is as expected, which requires that caches got flushed */ + igt_pipe_crc_collect_crc(data->pipe_crc, &crc); + igt_assert_crc_equal(&crc, &data->ref_crc); +} + +static bool prepare_crtc(data_t *data) +{ + igt_display_t *display = &data->display; + igt_output_t *output = data->output; + drmModeModeInfo *mode; + + /* select the pipe we want to use */ + igt_output_set_pipe(output, data->pipe); + igt_display_commit(display); + + if (!output->valid) { + igt_output_set_pipe(output, PIPE_ANY); + igt_display_commit(display); + return false; + } + + mode = igt_output_get_mode(output); + + /* create a white reference fb and flip to it */ + igt_create_color_fb(data->drm_fd, mode->hdisplay, mode->vdisplay, + DRM_FORMAT_XRGB8888, LOCAL_DRM_FORMAT_MOD_NONE, + 1.0, 1.0, 1.0, &data->fb[0]); + + data->primary = igt_output_get_plane(output, IGT_PLANE_PRIMARY); + + igt_plane_set_fb(data->primary, &data->fb[0]); + igt_display_commit(display); + + if (data->pipe_crc) + igt_pipe_crc_free(data->pipe_crc); + + data->pipe_crc = igt_pipe_crc_new(data->pipe, + INTEL_PIPE_CRC_SOURCE_AUTO); + + /* get reference crc for the white fb */ + igt_pipe_crc_collect_crc(data->pipe_crc, &data->ref_crc); + + return true; +} + +static void cleanup_crtc(data_t *data) +{ + igt_display_t *display = &data->display; + igt_output_t *output = data->output; + + igt_pipe_crc_free(data->pipe_crc); + data->pipe_crc = NULL; + + igt_plane_set_fb(data->primary, NULL); + + igt_output_set_pipe(output, PIPE_ANY); + igt_display_commit(display); + + igt_remove_fb(data->drm_fd, &data->fb[0]); + igt_remove_fb(data->drm_fd, &data->fb[1]); +} + +static void run_test(data_t *data) +{ + igt_display_t *display = &data->display; + igt_output_t *output; + enum pipe pipe; + + for_each_connected_output(display, output) { + data->output = output; + for_each_pipe(display, pipe) { + data->pipe = pipe; + + if (!prepare_crtc(data)) + continue; + + test(data); + cleanup_crtc(data); + + /* once is enough */ + return; + } + } + + igt_skip("no valid crtc/connector combinations found\n"); +} + +struct igt_helper_process hog; + +/** + * fork_cpuhog_helper: + * + * Fork a child process that loops indefinitely to consume CPU. This is used to + * fill the CPU caches with random information so they can get stalled, + * provoking incoherency with the GPU most likely. + */ +static void fork_cpuhog_helper(void) +{ + igt_fork_helper(&hog) { + while (1) { + usleep(10); /* quite ramdom really. */ + + if ((int)getppid() == 1) /* Parent has died, so must we. */ + exit(0); + } + } +} + +static int opt_handler(int opt, int opt_index, void *data) +{ + if (opt == 'n') { + ioctl_sync = false; + igt_info("set via cmd line to not use sync ioctls\n"); + } + + return 0; +} + +static data_t data; + +int main(int argc, char **argv) +{ + int i; + igt_simple_init_parse_opts(&argc, argv, "n", NULL, NULL, opt_handler, NULL); + + igt_skip_on_simulation(); + + igt_fixture { + data.drm_fd = drm_open_driver_master(DRIVER_INTEL); + + data.devid = intel_get_drm_devid(data.drm_fd); + + kmstest_set_vt_graphics_mode(); + + igt_require_pipe_crc(); + + igt_display_init(&data.display, data.drm_fd); + + fork_cpuhog_helper(); + } + + igt_info("Using %d rounds for the test\n", ROUNDS); + + for (i = 0; i < ROUNDS; i++) + run_test(&data); + + igt_fixture { + igt_display_fini(&data.display); + + igt_stop_helper(&hog); + } + + igt_exit(); +} diff -Nru intel-gpu-tools-1.13/tests/kms_panel_fitting.c intel-gpu-tools-1.15/tests/kms_panel_fitting.c --- intel-gpu-tools-1.13/tests/kms_panel_fitting.c 2015-11-30 16:26:23.000000000 +0000 +++ intel-gpu-tools-1.15/tests/kms_panel_fitting.c 2016-05-23 10:51:28.000000000 +0000 @@ -29,11 +29,8 @@ IGT_TEST_DESCRIPTION("Test display panel fitting"); typedef struct { - uint32_t devid; int drm_fd; igt_display_t display; - igt_crc_t ref_crc; - igt_pipe_crc_t *pipe_crc; int image_w; int image_h; @@ -53,26 +50,6 @@ #define FILE_NAME "1080p-left.png" -static void -paint_color(data_t *d, struct igt_fb *fb, uint16_t w, uint16_t h) -{ - cairo_t *cr; - - cr = igt_get_cairo_ctx(d->drm_fd, fb); - igt_paint_test_pattern(cr, w, h); - cairo_destroy(cr); -} - -static void -paint_image(data_t *d, struct igt_fb *fb, uint16_t w, uint16_t h) -{ - cairo_t *cr; - - cr = igt_get_cairo_ctx(d->drm_fd, fb); - igt_paint_image(cr, FILE_NAME, 0, 0, w, h); - cairo_destroy(cr); -} - static void prepare_crtc(data_t *data, igt_output_t *output, enum pipe pipe, igt_plane_t *plane, drmModeModeInfo *mode, enum igt_commit_style s) { @@ -80,10 +57,6 @@ igt_output_set_pipe(output, pipe); - /* create the pipe_crc object for this pipe */ - igt_pipe_crc_free(data->pipe_crc); - data->pipe_crc = igt_pipe_crc_new(pipe, INTEL_PIPE_CRC_SOURCE_AUTO); - /* before allocating, free if any older fb */ if (data->fb_id1) { igt_remove_fb(data->drm_fd, &data->fb1); @@ -91,15 +64,13 @@ } /* allocate fb for plane 1 */ - data->fb_id1 = igt_create_fb(data->drm_fd, - mode->hdisplay, mode->vdisplay, - DRM_FORMAT_XRGB8888, - LOCAL_I915_FORMAT_MOD_X_TILED, /* tiled */ - &data->fb1); + data->fb_id1 = igt_create_pattern_fb(data->drm_fd, + mode->hdisplay, mode->vdisplay, + DRM_FORMAT_XRGB8888, + LOCAL_DRM_FORMAT_MOD_NONE, + &data->fb1); igt_assert(data->fb_id1); - paint_color(data, &data->fb1, mode->hdisplay, mode->vdisplay); - /* * We always set the primary plane to actually enable the pipe as * there's no way (that works) to light up a pipe with only a sprite @@ -132,9 +103,6 @@ { igt_display_t *display = &data->display; - igt_pipe_crc_free(data->pipe_crc); - data->pipe_crc = NULL; - if (data->fb_id1) { igt_remove_fb(data->drm_fd, &data->fb1); data->fb_id1 = 0; @@ -171,9 +139,19 @@ for_each_connected_output(display, output) { drmModeModeInfo *mode, native_mode; + bool scaling_mode_set; - igt_require(output->config.connector->connector_type == - DRM_MODE_CONNECTOR_eDP); + scaling_mode_set = kmstest_get_property(d->drm_fd, + output->config.connector->connector_id, + DRM_MODE_OBJECT_CONNECTOR, + "scaling mode", + NULL, + NULL, + NULL); + + /* Check that the "scaling mode" property has been set. */ + if (!scaling_mode_set) + continue; pipe = output->config.pipe; igt_output_set_pipe(output, pipe); @@ -188,13 +166,11 @@ d->image_h = cairo_image_surface_get_height(image); cairo_surface_destroy(image); - d->fb_id2 = igt_create_fb(d->drm_fd, - d->image_w, d->image_h, - DRM_FORMAT_XRGB8888, - LOCAL_I915_FORMAT_MOD_X_TILED, /* tiled */ - &d->fb2); + d->fb_id2 = igt_create_image_fb(d->drm_fd, 0, 0, + DRM_FORMAT_XRGB8888, + LOCAL_DRM_FORMAT_MOD_NONE, + FILE_NAME, &d->fb2); igt_assert(d->fb_id2); - paint_image(d, &d->fb2, d->fb2.width, d->fb2.height); /* Set up display to enable panel fitting */ mode->hdisplay = 640; @@ -245,10 +221,8 @@ igt_skip_on_simulation(); - data.drm_fd = drm_open_driver(DRIVER_INTEL); - igt_require_pipe_crc(); + data.drm_fd = drm_open_driver(DRIVER_ANY); igt_display_init(&data.display, data.drm_fd); - data.devid = intel_get_drm_devid(data.drm_fd); test_panel_fitting(&data); diff -Nru intel-gpu-tools-1.13/tests/kms_pipe_color.c intel-gpu-tools-1.15/tests/kms_pipe_color.c --- intel-gpu-tools-1.13/tests/kms_pipe_color.c 1970-01-01 00:00:00.000000000 +0000 +++ intel-gpu-tools-1.15/tests/kms_pipe_color.c 2016-05-23 10:51:28.000000000 +0000 @@ -0,0 +1,1184 @@ +/* + * Copyright © 2015 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 "drm.h" +#include "drmtest.h" +#include "igt.h" + +IGT_TEST_DESCRIPTION("Test Color Features at Pipe level"); + +/* Data structures for gamma/degamma ramps & ctm matrix. */ +struct _drm_color_ctm { + /* Transformation matrix in S31.32 format. */ + __s64 matrix[9]; +}; + +struct _drm_color_lut { + /* + * Data is U0.16 fixed point format. + */ + __u16 red; + __u16 green; + __u16 blue; + __u16 reserved; +}; + +/* Internal */ +typedef struct { + double r, g, b; +} color_t; + +typedef struct { + int drm_fd; + uint32_t devid; + igt_display_t display; + igt_pipe_crc_t *pipe_crc; + + uint32_t color_depth; + uint64_t degamma_lut_size; + uint64_t gamma_lut_size; +} data_t; + + +static void paint_gradient_rectangles(data_t *data, + drmModeModeInfo *mode, + color_t *colors, + struct igt_fb *fb) +{ + cairo_t *cr = igt_get_cairo_ctx(data->drm_fd, fb); + int i, l = mode->hdisplay / 3; + + /* Paint 3 gradient rectangles with red/green/blue between 1.0 and + * 0.5. We want to avoid 0 so each max LUTs only affect their own + * rectangle. + */ + for (i = 0 ; i < 3; i++) { + igt_paint_color_gradient_range(cr, i * l, 0, l, mode->vdisplay, + colors[i].r != 0 ? 0.2 : 0, + colors[i].g != 0 ? 0.2 : 0, + colors[i].b != 0 ? 0.2 : 0, + colors[i].r, + colors[i].g, + colors[i].b); + } + + cairo_destroy(cr); +} + +static void paint_rectangles(data_t *data, + drmModeModeInfo *mode, + color_t *colors, + struct igt_fb *fb) +{ + cairo_t *cr = igt_get_cairo_ctx(data->drm_fd, fb); + int i, l = mode->hdisplay / 3; + + /* Paint 3 solid rectangles. */ + for (i = 0 ; i < 3; i++) { + igt_paint_color(cr, i * l, 0, l, mode->vdisplay, + colors[i].r, colors[i].g, colors[i].b); + } + + cairo_destroy(cr); +} + +static double *generate_table(uint32_t lut_size, double exp) +{ + double *coeffs = malloc(sizeof(double) * lut_size); + uint32_t i; + + for (i = 0; i < lut_size; i++) + coeffs[i] = powf((double) i * 1.0 / (double) (lut_size - 1), exp); + + return coeffs; +} + +static double *generate_table_max(uint32_t lut_size) +{ + double *coeffs = malloc(sizeof(double) * lut_size); + uint32_t i; + + coeffs[0] = 0.0; + for (i = 1; i < lut_size; i++) + coeffs[i] = 1.0; + + return coeffs; +} + +static double *generate_table_zero(uint32_t lut_size) +{ + double *coeffs = malloc(sizeof(double) * lut_size); + uint32_t i; + + for (i = 0; i < lut_size; i++) + coeffs[i] = 0.0; + + return coeffs; +} + +static struct _drm_color_lut *coeffs_to_lut(data_t *data, + const double *coefficients, + uint32_t lut_size, + uint32_t color_depth, + int off) +{ + struct _drm_color_lut *lut; + uint32_t i; + uint32_t max_value = (1 << 16) - 1; + uint32_t mask = ((1 << color_depth) - 1) << 8; + + lut = malloc(sizeof(struct _drm_color_lut) * lut_size); + + if (IS_CHERRYVIEW(data->devid)) + lut_size -= 1; + for (i = 0; i < lut_size; i++) { + uint32_t v = (coefficients[i] * max_value); + + /* + * Hardware might encode colors on a different number of bits + * than what is in our framebuffer (10 or 12bits for example). + * Mask the lower bits not provided by the framebuffer so we + * can do CRC comparisons. + */ + v &= mask; + + lut[i].red = v; + lut[i].green = v; + lut[i].blue = v; + } + + if (IS_CHERRYVIEW(data->devid)) + lut[lut_size].red = + lut[lut_size].green = + lut[lut_size].blue = lut[lut_size - 1].red; + + return lut; +} + +static void set_degamma(data_t *data, + igt_pipe_t *pipe, + const double *coefficients) +{ + size_t size = sizeof(struct _drm_color_lut) * data->degamma_lut_size; + struct _drm_color_lut *lut = coeffs_to_lut(data, + coefficients, + data->degamma_lut_size, + data->color_depth, 0); + + igt_pipe_set_degamma_lut(pipe, lut, size); + + free(lut); +} + +static void set_gamma(data_t *data, + igt_pipe_t *pipe, + const double *coefficients) +{ + size_t size = sizeof(struct _drm_color_lut) * data->gamma_lut_size; + struct _drm_color_lut *lut = coeffs_to_lut(data, + coefficients, + data->gamma_lut_size, + data->color_depth, 0); + + igt_pipe_set_gamma_lut(pipe, lut, size); + + free(lut); +} + +static void set_ctm(igt_pipe_t *pipe, const double *coefficients) +{ + struct _drm_color_ctm ctm; + int i; + + for (i = 0; i < ARRAY_SIZE(ctm.matrix); i++) { + if (coefficients[i] < 0) { + ctm.matrix[i] = + (int64_t) (-coefficients[i] * ((int64_t) 1L << 32)); + ctm.matrix[i] |= 1ULL << 63; + } else + ctm.matrix[i] = + (int64_t) (coefficients[i] * ((int64_t) 1L << 32)); + } + + igt_pipe_set_ctm_matrix(pipe, &ctm, sizeof(ctm)); +} + +#define disable_degamma(pipe) igt_pipe_set_degamma_lut(pipe, NULL, 0) +#define disable_gamma(pipe) igt_pipe_set_gamma_lut(pipe, NULL, 0) +#define disable_ctm(pipe) igt_pipe_set_ctm_matrix(pipe, NULL, 0) + +static void output_set_property_enum(igt_output_t *output, + const char *property, + const char *enum_value) +{ + int i; + int32_t value = -1; + uint32_t prop_id; + drmModePropertyPtr prop; + + if (!kmstest_get_property(output->display->drm_fd, + output->id, + DRM_MODE_OBJECT_CONNECTOR, + property, + &prop_id, NULL, &prop)) + return; + + igt_assert(prop->flags & DRM_MODE_PROP_ENUM); + + for (i = 0; i < prop->count_enums; i++) { + if (!strcmp(prop->enums[i].name, enum_value)) { + value = prop->enums[i].value; + break; + } + } + igt_assert_neq(value, -1); + + igt_assert_eq(drmModeObjectSetProperty(output->display->drm_fd, + output->id, + DRM_MODE_OBJECT_CONNECTOR, + prop_id, value), 0); + + + drmModeFreeProperty(prop); +} + +/* + * Draw 3 gradient rectangles in red, green and blue, with a maxed out + * degamma LUT and verify we have the same CRC as drawing solid color + * rectangles with linear degamma LUT. + */ +static void test_pipe_degamma(data_t *data, + igt_plane_t *primary) +{ + igt_output_t *output; + double *degamma_linear, *degamma_full; + double *gamma_linear; + color_t red_green_blue[] = { + { 1.0, 0.0, 0.0 }, + { 0.0, 1.0, 0.0 }, + { 0.0, 0.0, 1.0 } + }; + + degamma_linear = generate_table(data->degamma_lut_size, 1.0); + degamma_full = generate_table_max(data->degamma_lut_size); + + gamma_linear = generate_table(data->gamma_lut_size, 1.0); + + for_each_connected_output(&data->display, output) { + drmModeModeInfo *mode; + struct igt_fb fb_modeset, fb; + igt_crc_t crc_fullgamma, crc_fullcolors; + int fb_id, fb_modeset_id; + + igt_output_set_pipe(output, primary->pipe->pipe); + mode = igt_output_get_mode(output); + + /* Create a framebuffer at the size of the output. */ + fb_id = igt_create_fb(data->drm_fd, + mode->hdisplay, + mode->vdisplay, + DRM_FORMAT_XRGB8888, + LOCAL_DRM_FORMAT_MOD_NONE, + &fb); + igt_assert(fb_id); + + fb_modeset_id = igt_create_fb(data->drm_fd, + mode->hdisplay, + mode->vdisplay, + DRM_FORMAT_XRGB8888, + LOCAL_DRM_FORMAT_MOD_NONE, + &fb_modeset); + igt_assert(fb_modeset_id); + + igt_plane_set_fb(primary, &fb_modeset); + disable_ctm(primary->pipe); + disable_degamma(primary->pipe); + set_gamma(data, primary->pipe, gamma_linear); + igt_display_commit(&data->display); + + /* Draw solid colors with no degamma transformation. */ + paint_rectangles(data, mode, red_green_blue, &fb); + igt_plane_set_fb(primary, &fb); + igt_display_commit(&data->display); + igt_wait_for_vblank(data->drm_fd, primary->pipe->pipe); + igt_pipe_crc_collect_crc(data->pipe_crc, &crc_fullcolors); + + /* Draw a gradient with degamma LUT to remap all + * values to max red/green/blue. + */ + paint_gradient_rectangles(data, mode, red_green_blue, &fb); + igt_plane_set_fb(primary, &fb); + set_degamma(data, primary->pipe, degamma_full); + igt_display_commit(&data->display); + igt_wait_for_vblank(data->drm_fd, primary->pipe->pipe); + igt_pipe_crc_collect_crc(data->pipe_crc, &crc_fullgamma); + + /* Verify that the CRC of the software computed output is + * equal to the CRC of the degamma LUT transformation output. + */ + igt_assert_crc_equal(&crc_fullgamma, &crc_fullcolors); + + igt_output_set_pipe(output, PIPE_ANY); + } + + free(degamma_linear); + free(degamma_full); + free(gamma_linear); +} + +/* + * Draw 3 gradient rectangles in red, green and blue, with a maxed out gamma + * LUT and verify we have the same CRC as drawing solid color rectangles. + */ +static void test_pipe_gamma(data_t *data, + igt_plane_t *primary) +{ + igt_output_t *output; + double *gamma_full; + color_t red_green_blue[] = { + { 1.0, 0.0, 0.0 }, + { 0.0, 1.0, 0.0 }, + { 0.0, 0.0, 1.0 } + }; + + gamma_full = generate_table_max(data->gamma_lut_size); + + for_each_connected_output(&data->display, output) { + drmModeModeInfo *mode; + struct igt_fb fb_modeset, fb; + igt_crc_t crc_fullgamma, crc_fullcolors; + int fb_id, fb_modeset_id; + + igt_output_set_pipe(output, primary->pipe->pipe); + mode = igt_output_get_mode(output); + + /* Create a framebuffer at the size of the output. */ + fb_id = igt_create_fb(data->drm_fd, + mode->hdisplay, + mode->vdisplay, + DRM_FORMAT_XRGB8888, + LOCAL_DRM_FORMAT_MOD_NONE, + &fb); + igt_assert(fb_id); + + fb_modeset_id = igt_create_fb(data->drm_fd, + mode->hdisplay, + mode->vdisplay, + DRM_FORMAT_XRGB8888, + LOCAL_DRM_FORMAT_MOD_NONE, + &fb_modeset); + igt_assert(fb_modeset_id); + + igt_plane_set_fb(primary, &fb_modeset); + disable_ctm(primary->pipe); + disable_degamma(primary->pipe); + set_gamma(data, primary->pipe, gamma_full); + igt_display_commit(&data->display); + + /* Draw solid colors with no gamma transformation. */ + paint_rectangles(data, mode, red_green_blue, &fb); + igt_plane_set_fb(primary, &fb); + igt_display_commit(&data->display); + igt_wait_for_vblank(data->drm_fd, primary->pipe->pipe); + igt_pipe_crc_collect_crc(data->pipe_crc, &crc_fullcolors); + + /* Draw a gradient with gamma LUT to remap all values + * to max red/green/blue. + */ + paint_gradient_rectangles(data, mode, red_green_blue, &fb); + igt_plane_set_fb(primary, &fb); + igt_display_commit(&data->display); + igt_wait_for_vblank(data->drm_fd, primary->pipe->pipe); + igt_pipe_crc_collect_crc(data->pipe_crc, &crc_fullgamma); + + /* Verify that the CRC of the software computed output is + * equal to the CRC of the gamma LUT transformation output. + */ + igt_assert_crc_equal(&crc_fullgamma, &crc_fullcolors); + + igt_output_set_pipe(output, PIPE_ANY); + } + + free(gamma_full); +} + +/* + * Draw 3 gradient rectangles in red, green and blue, with a maxed out legacy + * gamma LUT and verify we have the same CRC as drawing solid color rectangles + * with linear legacy gamma LUT. + */ +static void test_pipe_legacy_gamma(data_t *data, + igt_plane_t *primary) +{ + igt_output_t *output; + color_t red_green_blue[] = { + { 1.0, 0.0, 0.0 }, + { 0.0, 1.0, 0.0 }, + { 0.0, 0.0, 1.0 } + }; + drmModeCrtc *kms_crtc; + uint32_t i, legacy_lut_size; + uint16_t *red_lut, *green_lut, *blue_lut; + + kms_crtc = drmModeGetCrtc(data->drm_fd, primary->pipe->crtc_id); + legacy_lut_size = kms_crtc->gamma_size; + drmModeFreeCrtc(kms_crtc); + + red_lut = malloc(sizeof(uint16_t) * legacy_lut_size); + green_lut = malloc(sizeof(uint16_t) * legacy_lut_size); + blue_lut = malloc(sizeof(uint16_t) * legacy_lut_size); + + for_each_connected_output(&data->display, output) { + drmModeModeInfo *mode; + struct igt_fb fb_modeset, fb; + igt_crc_t crc_fullgamma, crc_fullcolors; + int fb_id, fb_modeset_id; + + igt_output_set_pipe(output, primary->pipe->pipe); + mode = igt_output_get_mode(output); + + /* Create a framebuffer at the size of the output. */ + fb_id = igt_create_fb(data->drm_fd, + mode->hdisplay, + mode->vdisplay, + DRM_FORMAT_XRGB8888, + LOCAL_DRM_FORMAT_MOD_NONE, + &fb); + igt_assert(fb_id); + + fb_modeset_id = igt_create_fb(data->drm_fd, + mode->hdisplay, + mode->vdisplay, + DRM_FORMAT_XRGB8888, + LOCAL_DRM_FORMAT_MOD_NONE, + &fb_modeset); + igt_assert(fb_modeset_id); + + igt_plane_set_fb(primary, &fb_modeset); + disable_degamma(primary->pipe); + disable_gamma(primary->pipe); + disable_ctm(primary->pipe); + igt_display_commit(&data->display); + + /* Draw solid colors with no gamma transformation. */ + paint_rectangles(data, mode, red_green_blue, &fb); + igt_plane_set_fb(primary, &fb); + igt_display_commit(&data->display); + igt_wait_for_vblank(data->drm_fd, primary->pipe->pipe); + igt_pipe_crc_collect_crc(data->pipe_crc, &crc_fullcolors); + + /* Draw a gradient with gamma LUT to remap all values + * to max red/green/blue. + */ + paint_gradient_rectangles(data, mode, red_green_blue, &fb); + igt_plane_set_fb(primary, &fb); + + red_lut[0] = green_lut[0] = blue_lut[0] = 0; + for (i = 1; i < legacy_lut_size; i++) + red_lut[i] = green_lut[i] = blue_lut[i] = 0xffff; + igt_assert_eq(drmModeCrtcSetGamma(data->drm_fd, primary->pipe->crtc_id, + legacy_lut_size, red_lut, green_lut, blue_lut), 0); + igt_display_commit(&data->display); + igt_wait_for_vblank(data->drm_fd, primary->pipe->pipe); + igt_pipe_crc_collect_crc(data->pipe_crc, &crc_fullgamma); + + /* Verify that the CRC of the software computed output is + * equal to the CRC of the gamma LUT transformation output. + */ + igt_assert_crc_equal(&crc_fullgamma, &crc_fullcolors); + + /* Reset output. */ + for (i = 1; i < legacy_lut_size; i++) + red_lut[i] = green_lut[i] = blue_lut[i] = i << 8; + + igt_assert_eq(drmModeCrtcSetGamma(data->drm_fd, primary->pipe->crtc_id, + legacy_lut_size, red_lut, green_lut, blue_lut), 0); + igt_display_commit(&data->display); + + igt_output_set_pipe(output, PIPE_ANY); + } + + free(red_lut); + free(green_lut); + free(blue_lut); +} + +static drmModePropertyBlobPtr +get_blob(data_t *data, igt_pipe_t *pipe, const char *property_name) +{ + uint64_t prop_value; + drmModePropertyPtr prop; + drmModePropertyBlobPtr blob; + + igt_assert(igt_pipe_get_property(pipe, property_name, + NULL, &prop_value, &prop)); + + if (prop_value == 0) + return NULL; + + igt_assert(prop->flags & DRM_MODE_PROP_BLOB); + blob = drmModeGetPropertyBlob(data->drm_fd, prop_value); + drmModeFreeProperty(prop); + + return blob; +} + +/* + * Verify that setting the legacy gamma LUT resets the gamma LUT set + * through the GAMMA_LUT property. + */ +static void test_pipe_legacy_gamma_reset(data_t *data, + igt_plane_t *primary) +{ + const double ctm_identity[] = { + 1.0, 0.0, 0.0, + 0.0, 1.0, 0.0, + 0.0, 0.0, 1.0 + }; + drmModeCrtc *kms_crtc; + double *degamma_linear, *gamma_zero; + uint32_t i, legacy_lut_size; + uint16_t *red_lut, *green_lut, *blue_lut; + struct _drm_color_lut *lut; + drmModePropertyBlobPtr blob; + igt_output_t *output; + + degamma_linear = generate_table(data->degamma_lut_size, 1.0); + gamma_zero = generate_table_zero(data->gamma_lut_size); + + for_each_connected_output(&data->display, output) { + igt_output_set_pipe(output, primary->pipe->pipe); + + /* Ensure we have a clean state to start with. */ + disable_degamma(primary->pipe); + disable_ctm(primary->pipe); + disable_gamma(primary->pipe); + igt_display_commit(&data->display); + + /* Set a degama & gamma LUT and a CTM using the + * properties and verify the content of the + * properties. */ + set_degamma(data, primary->pipe, degamma_linear); + set_ctm(primary->pipe, ctm_identity); + set_gamma(data, primary->pipe, gamma_zero); + igt_display_commit(&data->display); + + blob = get_blob(data, primary->pipe, "DEGAMMA_LUT"); + igt_assert(blob && + blob->length == (sizeof(struct _drm_color_lut) * + data->degamma_lut_size)); + drmModeFreePropertyBlob(blob); + + blob = get_blob(data, primary->pipe, "CTM"); + igt_assert(blob && + blob->length == sizeof(struct _drm_color_ctm)); + drmModeFreePropertyBlob(blob); + + blob = get_blob(data, primary->pipe, "GAMMA_LUT"); + igt_assert(blob && + blob->length == (sizeof(struct _drm_color_lut) * + data->gamma_lut_size)); + lut = (struct _drm_color_lut *) blob->data; + for (i = 0; i < data->gamma_lut_size; i++) + igt_assert(lut[i].red == 0 && + lut[i].green == 0 && + lut[i].blue == 0); + drmModeFreePropertyBlob(blob); + + /* Set a gamma LUT using the legacy ioctl and verify + * the content of the GAMMA_LUT property is changed + * and that CTM and DEGAMMA_LUT are empty. */ + kms_crtc = drmModeGetCrtc(data->drm_fd, primary->pipe->crtc_id); + legacy_lut_size = kms_crtc->gamma_size; + drmModeFreeCrtc(kms_crtc); + + red_lut = malloc(sizeof(uint16_t) * legacy_lut_size); + green_lut = malloc(sizeof(uint16_t) * legacy_lut_size); + blue_lut = malloc(sizeof(uint16_t) * legacy_lut_size); + + for (i = 0; i < legacy_lut_size; i++) + red_lut[i] = green_lut[i] = blue_lut[i] = 0xffff; + + igt_assert_eq(drmModeCrtcSetGamma(data->drm_fd, + primary->pipe->crtc_id, + legacy_lut_size, + red_lut, green_lut, blue_lut), + 0); + igt_display_commit(&data->display); + + igt_assert(get_blob(data, primary->pipe, + "DEGAMMA_LUT") == NULL); + igt_assert(get_blob(data, primary->pipe, "CTM") == NULL); + + blob = get_blob(data, primary->pipe, "GAMMA_LUT"); + igt_assert(blob && + blob->length == (sizeof(struct _drm_color_lut) * + legacy_lut_size)); + lut = (struct _drm_color_lut *) blob->data; + for (i = 0; i < legacy_lut_size; i++) + igt_assert(lut[i].red == 0xffff && + lut[i].green == 0xffff && + lut[i].blue == 0xffff); + drmModeFreePropertyBlob(blob); + + igt_output_set_pipe(output, PIPE_ANY); + } + + free(degamma_linear); + free(gamma_zero); +} + +/* + * Draw 3 rectangles using before colors with the ctm matrix apply and verify + * the CRC is equal to using after colors with an identify ctm matrix. + */ +static bool test_pipe_ctm(data_t *data, + igt_plane_t *primary, + color_t *before, + color_t *after, + double *ctm_matrix) +{ + const double ctm_identity[] = { + 1.0, 0.0, 0.0, + 0.0, 1.0, 0.0, + 0.0, 0.0, 1.0 + }; + double *degamma_linear, *gamma_linear; + igt_output_t *output; + bool ret = true; + + degamma_linear = generate_table(data->degamma_lut_size, 1.0); + gamma_linear = generate_table(data->gamma_lut_size, 1.0); + + for_each_connected_output(&data->display, output) { + drmModeModeInfo *mode; + struct igt_fb fb_modeset, fb; + igt_crc_t crc_software, crc_hardware; + int fb_id, fb_modeset_id; + + igt_output_set_pipe(output, primary->pipe->pipe); + mode = igt_output_get_mode(output); + + /* Create a framebuffer at the size of the output. */ + fb_id = igt_create_fb(data->drm_fd, + mode->hdisplay, + mode->vdisplay, + DRM_FORMAT_XRGB8888, + LOCAL_DRM_FORMAT_MOD_NONE, + &fb); + igt_assert(fb_id); + + fb_modeset_id = igt_create_fb(data->drm_fd, + mode->hdisplay, + mode->vdisplay, + DRM_FORMAT_XRGB8888, + LOCAL_DRM_FORMAT_MOD_NONE, + &fb_modeset); + igt_assert(fb_modeset_id); + igt_plane_set_fb(primary, &fb_modeset); + + set_degamma(data, primary->pipe, degamma_linear); + set_gamma(data, primary->pipe, gamma_linear); + disable_ctm(primary->pipe); + igt_display_commit(&data->display); + + paint_rectangles(data, mode, after, &fb); + igt_plane_set_fb(primary, &fb); + set_ctm(primary->pipe, ctm_identity); + igt_display_commit(&data->display); + igt_wait_for_vblank(data->drm_fd, primary->pipe->pipe); + igt_pipe_crc_collect_crc(data->pipe_crc, &crc_software); + + /* With CTM transformation. */ + paint_rectangles(data, mode, before, &fb); + igt_plane_set_fb(primary, &fb); + set_ctm(primary->pipe, ctm_matrix); + igt_display_commit(&data->display); + igt_wait_for_vblank(data->drm_fd, primary->pipe->pipe); + igt_pipe_crc_collect_crc(data->pipe_crc, &crc_hardware); + + /* Verify that the CRC of the software computed output is + * equal to the CRC of the CTM matrix transformation output. + */ + ret &= igt_crc_equal(&crc_software, &crc_hardware); + + igt_output_set_pipe(output, PIPE_ANY); + } + + free(degamma_linear); + free(gamma_linear); + + return ret; +} + +/* + * Hardware computes CRC based on the number of bits it is working with (8, + * 10, 12, 16 bits), meaning with a framebuffer of 8bits per color will + * usually leave the remaining lower bits at 0. + * + * We're programming the gamma LUT in order to get rid of those lower bits so + * we can compare the CRC of a framebuffer without any transformation to a CRC + * with transformation applied and verify the CRCs match. + * + * This test is currently disabled as the CRC computed on Intel hardware seems + * to include data on the lower bits, this is preventing us to CRC checks. + */ +#if 0 +static void test_pipe_limited_range_ctm(data_t *data, + igt_plane_t *primary) +{ + double limited_result = 235.0 / 255.0; + color_t red_green_blue_limited[] = { + { limited_result, 0.0, 0.0 }, + { 0.0, limited_result, 0.0 }, + { 0.0, 0.0, limited_result } + }; + color_t red_green_blue_full[] = { + { 0.5, 0.0, 0.0 }, + { 0.0, 0.5, 0.0 }, + { 0.0, 0.0, 0.5 } + }; + double ctm[] = { 1.0, 0.0, 0.0, + 0.0, 1.0, 0.0, + 0.0, 0.0, 1.0 }; + double *degamma_linear, *gamma_linear; + igt_output_t *output; + + degamma_linear = generate_table(data->degamma_lut_size, 1.0); + gamma_linear = generate_table(data->gamma_lut_size, 1.0); + + for_each_connected_output(&data->display, output) { + drmModeModeInfo *mode; + struct igt_fb fb_modeset, fb; + igt_crc_t crc_full, crc_limited; + int fb_id, fb_modeset_id; + + igt_output_set_pipe(output, primary->pipe->pipe); + mode = igt_output_get_mode(output); + + /* Create a framebuffer at the size of the output. */ + fb_id = igt_create_fb(data->drm_fd, + mode->hdisplay, + mode->vdisplay, + DRM_FORMAT_XRGB8888, + LOCAL_DRM_FORMAT_MOD_NONE, + &fb); + igt_assert(fb_id); + + fb_modeset_id = igt_create_fb(data->drm_fd, + mode->hdisplay, + mode->vdisplay, + DRM_FORMAT_XRGB8888, + LOCAL_DRM_FORMAT_MOD_NONE, + &fb_modeset); + igt_assert(fb_modeset_id); + igt_plane_set_fb(primary, &fb_modeset); + + set_degamma(data, primary->pipe, degamma_linear); + set_gamma(data, primary->pipe, gamma_linear); + set_ctm(primary->pipe, ctm); + + output_set_property_enum(output, "Broadcast RGB", "Full"); + paint_rectangles(data, mode, red_green_blue_limited, &fb); + igt_plane_set_fb(primary, &fb); + igt_display_commit(&data->display); + igt_wait_for_vblank(data->drm_fd, primary->pipe->pipe); + igt_pipe_crc_collect_crc(data->pipe_crc, &crc_full); + + /* Set the output into limited range. */ + output_set_property_enum(output, "Broadcast RGB", "Limited 16:235"); + paint_rectangles(data, mode, red_green_blue_full, &fb); + igt_plane_set_fb(primary, &fb); + igt_display_commit(&data->display); + igt_wait_for_vblank(data->drm_fd, primary->pipe->pipe); + igt_pipe_crc_collect_crc(data->pipe_crc, &crc_limited); + + /* Verify that the CRC of the software computed output is + * equal to the CRC of the CTM matrix transformation output. + */ + igt_assert_crc_equal(&crc_full, &crc_limited); + + igt_output_set_pipe(output, PIPE_ANY); + } + + free(gamma_linear); + free(degamma_linear); +} +#endif + +static void +run_tests_for_pipe(data_t *data, enum pipe p) +{ + igt_output_t *output; + igt_pipe_t *pipe; + igt_plane_t *primary; + double delta; + int i; + color_t red_green_blue[] = { + { 1.0, 0.0, 0.0 }, + { 0.0, 1.0, 0.0 }, + { 0.0, 0.0, 1.0 } + }; + + igt_fixture { + igt_require_pipe_crc(); + + if (p >= data->display.n_pipes) + return; + + pipe = &data->display.pipes[p]; + if (pipe->n_planes < IGT_PLANE_PRIMARY) + return; + + primary = &pipe->planes[IGT_PLANE_PRIMARY]; + + data->pipe_crc = igt_pipe_crc_new(primary->pipe->pipe, + INTEL_PIPE_CRC_SOURCE_AUTO); + + igt_require(igt_pipe_get_property(&data->display.pipes[p], + "DEGAMMA_LUT_SIZE", + NULL, + &data->degamma_lut_size, + NULL)); + igt_require(igt_pipe_get_property(&data->display.pipes[p], + "GAMMA_LUT_SIZE", + NULL, + &data->gamma_lut_size, + NULL)); + + for_each_connected_output(&data->display, output) + output_set_property_enum(output, "Broadcast RGB", "Full"); + } + + /* We assume an 8bits depth per color for degamma/gamma LUTs + * for CRC checks with framebuffer references. */ + data->color_depth = 8; + delta = 1.0 / (1 << data->color_depth); + + igt_subtest_f("ctm-red-to-blue-pipe%d", p) { + color_t blue_green_blue[] = { + { 0.0, 0.0, 1.0 }, + { 0.0, 1.0, 0.0 }, + { 0.0, 0.0, 1.0 } + }; + double ctm[] = { 0.0, 0.0, 0.0, + 0.0, 1.0, 0.0, + 1.0, 0.0, 1.0 }; + igt_assert(test_pipe_ctm(data, primary, red_green_blue, + blue_green_blue, ctm)); + } + + igt_subtest_f("ctm-green-to-red-pipe%d", p) { + color_t red_red_blue[] = { + { 1.0, 0.0, 0.0 }, + { 1.0, 0.0, 0.0 }, + { 0.0, 0.0, 1.0 } + }; + double ctm[] = { 1.0, 1.0, 0.0, + 0.0, 0.0, 0.0, + 0.0, 0.0, 1.0 }; + igt_assert(test_pipe_ctm(data, primary, red_green_blue, + red_red_blue, ctm)); + } + + igt_subtest_f("ctm-blue-to-red-pipe%d", p) { + color_t red_green_red[] = { + { 1.0, 0.0, 0.0 }, + { 0.0, 1.0, 0.0 }, + { 1.0, 0.0, 0.0 } + }; + double ctm[] = { 1.0, 0.0, 1.0, + 0.0, 1.0, 0.0, + 0.0, 0.0, 0.0 }; + igt_assert(test_pipe_ctm(data, primary, red_green_blue, + red_green_red, ctm)); + } + + /* We tests a few values around the expected result because + * the it depends on the hardware we're dealing with, we can + * either get clamped or rounded values and we also need to + * account for odd number of items in the LUTs. */ + igt_subtest_f("ctm-0-25-pipe%d", p) { + color_t expected_colors[] = { + { 0.0, }, { 0.0, }, { 0.0, } + }; + double ctm[] = { 0.25, 0.0, 0.0, + 0.0, 0.25, 0.0, + 0.0, 0.0, 0.25 }; + bool success = false; + + for (i = 0; i < 5; i++) { + expected_colors[0].r = + expected_colors[1].g = + expected_colors[2].b = + 0.25 + delta * (i - 2); + success |= test_pipe_ctm(data, primary, + red_green_blue, + expected_colors, ctm); + } + igt_assert(success); + } + + igt_subtest_f("ctm-0-5-pipe%d", p) { + color_t expected_colors[] = { + { 0.0, }, { 0.0, }, { 0.0, } + }; + double ctm[] = { 0.5, 0.0, 0.0, + 0.0, 0.5, 0.0, + 0.0, 0.0, 0.5 }; + bool success = false; + + for (i = 0; i < 5; i++) { + expected_colors[0].r = + expected_colors[1].g = + expected_colors[2].b = + 0.5 + delta * (i - 2); + success |= test_pipe_ctm(data, primary, + red_green_blue, + expected_colors, ctm); + } + igt_assert(success); + } + + igt_subtest_f("ctm-0-75-pipe%d", p) { + color_t expected_colors[] = { + { 0.0, }, { 0.0, }, { 0.0, } + }; + double ctm[] = { 0.75, 0.0, 0.0, + 0.0, 0.75, 0.0, + 0.0, 0.0, 0.75 }; + bool success = false; + + for (i = 0; i < 7; i++) { + expected_colors[0].r = + expected_colors[1].g = + expected_colors[2].b = + 0.75 + delta * (i - 3); + success |= test_pipe_ctm(data, primary, + red_green_blue, + expected_colors, ctm); + } + igt_assert(success); + } + + igt_subtest_f("ctm-max-pipe%d", p) { + color_t full_rgb[] = { + { 1.0, 0.0, 0.0 }, + { 0.0, 1.0, 0.0 }, + { 0.0, 0.0, 1.0 } + }; + double ctm[] = { 100.0, 0.0, 0.0, + 0.0, 100.0, 0.0, + 0.0, 0.0, 100.0 }; + + /* CherryView generates values on 10bits that we + * produce with an 8 bits per color framebuffer. */ + igt_require(!IS_CHERRYVIEW(data->devid)); + + igt_assert(test_pipe_ctm(data, primary, red_green_blue, + full_rgb, ctm)); + } + + igt_subtest_f("ctm-negative-pipe%d", p) { + color_t all_black[] = { + { 0.0, 0.0, 0.0 }, + { 0.0, 0.0, 0.0 }, + { 0.0, 0.0, 0.0 } + }; + double ctm[] = { -1.0, 0.0, 0.0, + 0.0, -1.0, 0.0, + 0.0, 0.0, -1.0 }; + igt_assert(test_pipe_ctm(data, primary, red_green_blue, + all_black, ctm)); + } + +#if 0 + igt_subtest_f("ctm-limited-range-pipe%d", p) + test_pipe_limited_range_ctm(data, primary); +#endif + + igt_subtest_f("degamma-pipe%d", p) + test_pipe_degamma(data, primary); + + igt_subtest_f("gamma-pipe%d", p) + test_pipe_gamma(data, primary); + + igt_subtest_f("legacy-gamma-pipe%d", p) + test_pipe_legacy_gamma(data, primary); + + igt_subtest_f("legacy-gamma-reset-pipe%d", p) + test_pipe_legacy_gamma_reset(data, primary); + + igt_fixture { + for_each_connected_output(&data->display, output) + output_set_property_enum(output, "Broadcast RGB", "Full"); + + disable_degamma(primary->pipe); + disable_gamma(primary->pipe); + disable_ctm(primary->pipe); + igt_display_commit(&data->display); + + igt_pipe_crc_free(data->pipe_crc); + data->pipe_crc = NULL; + } +} + +static int +pipe_set_property_blob_id(igt_pipe_t *pipe, const char *property, uint32_t blob_id) +{ + uint32_t prop_id; + + igt_assert(kmstest_get_property(pipe->display->drm_fd, + pipe->crtc_id, + DRM_MODE_OBJECT_CRTC, + property, + &prop_id, NULL, NULL)); + + return drmModeObjectSetProperty(pipe->display->drm_fd, + pipe->crtc_id, + DRM_MODE_OBJECT_CRTC, + prop_id, blob_id); +} + +static int +pipe_set_property_blob(igt_pipe_t *pipe, const char *property, void *ptr, size_t length) +{ + int ret = 0; + uint32_t blob_id = 0; + + if (length > 0) + igt_assert_eq(drmModeCreatePropertyBlob(pipe->display->drm_fd, + ptr, length, + &blob_id), 0); + + ret = pipe_set_property_blob_id(pipe, property, blob_id); + + if (blob_id != 0) + igt_assert_eq(drmModeDestroyPropertyBlob(pipe->display->drm_fd, blob_id), 0); + + return ret; +} + +static void +invalid_lut_sizes(data_t *data) +{ + igt_pipe_t *pipe = &data->display.pipes[0]; + size_t degamma_lut_size = data->degamma_lut_size * sizeof(struct _drm_color_lut); + size_t gamma_lut_size = data->gamma_lut_size * sizeof(struct _drm_color_lut); + + struct _drm_color_lut *degamma_lut = malloc(data->degamma_lut_size * sizeof(struct _drm_color_lut) * 2); + struct _drm_color_lut *gamma_lut = malloc(data->gamma_lut_size * sizeof(struct _drm_color_lut) * 2); + + igt_assert_eq(pipe_set_property_blob(pipe, "DEGAMMA_LUT", + degamma_lut, 1), -EINVAL); + igt_assert_eq(pipe_set_property_blob(pipe, "DEGAMMA_LUT", + degamma_lut, degamma_lut_size + 1), + -EINVAL); + igt_assert_eq(pipe_set_property_blob(pipe, "DEGAMMA_LUT", + degamma_lut, degamma_lut_size - 1), + -EINVAL); + igt_assert_eq(pipe_set_property_blob(pipe, "DEGAMMA_LUT", + degamma_lut, degamma_lut_size + sizeof(struct _drm_color_lut)), + -EINVAL); + igt_assert_eq(pipe_set_property_blob_id(pipe, "DEGAMMA_LUT", pipe->crtc_id), + -EINVAL); + igt_assert_eq(pipe_set_property_blob_id(pipe, "DEGAMMA_LUT", 4096 * 4096), + -EINVAL); + + igt_assert_eq(pipe_set_property_blob(pipe, "GAMMA_LUT", + gamma_lut, 1), + -EINVAL); + igt_assert_eq(pipe_set_property_blob(pipe, "GAMMA_LUT", + gamma_lut, gamma_lut_size + 1), + -EINVAL); + igt_assert_eq(pipe_set_property_blob(pipe, "GAMMA_LUT", + gamma_lut, gamma_lut_size - 1), + -EINVAL); + igt_assert_eq(pipe_set_property_blob(pipe, "GAMMA_LUT", + gamma_lut, gamma_lut_size + sizeof(struct _drm_color_lut)), + -EINVAL); + igt_assert_eq(pipe_set_property_blob_id(pipe, "GAMMA_LUT", pipe->crtc_id), + -EINVAL); + igt_assert_eq(pipe_set_property_blob_id(pipe, "GAMMA_LUT", 4096 * 4096), + -EINVAL); + + free(degamma_lut); + free(gamma_lut); +} + +static void +invalid_ctm_matrix_sizes(data_t *data) +{ + igt_pipe_t *pipe = &data->display.pipes[0]; + void *ptr = malloc(sizeof(struct _drm_color_ctm) * 4); + + igt_assert_eq(pipe_set_property_blob(pipe, "CTM", ptr, 1), + -EINVAL); + igt_assert_eq(pipe_set_property_blob(pipe, "CTM", ptr, + sizeof(struct _drm_color_ctm) + 1), + -EINVAL); + igt_assert_eq(pipe_set_property_blob(pipe, "CTM", ptr, + sizeof(struct _drm_color_ctm) - 1), + -EINVAL); + igt_assert_eq(pipe_set_property_blob(pipe, "CTM", ptr, + sizeof(struct _drm_color_ctm) * 2), + -EINVAL); + igt_assert_eq(pipe_set_property_blob_id(pipe, "CTM", pipe->crtc_id), + -EINVAL); + igt_assert_eq(pipe_set_property_blob_id(pipe, "CTM", 4096 * 4096), + -EINVAL); + + free(ptr); +} + +igt_main +{ + data_t data = {}; + + igt_skip_on_simulation(); + + igt_fixture { + data.drm_fd = drm_open_driver_master(DRIVER_INTEL); + data.devid = intel_get_drm_devid(data.drm_fd); + kmstest_set_vt_graphics_mode(); + + igt_display_init(&data.display, data.drm_fd); + } + + for (int pipe = 0; pipe < I915_MAX_PIPES; pipe++) + run_tests_for_pipe(&data, pipe); + + igt_subtest_f("invalid-lut-sizes") + invalid_lut_sizes(&data); + + igt_subtest_f("invalid-ctm-matrix-sizes") + invalid_ctm_matrix_sizes(&data); + + igt_fixture { + igt_display_fini(&data.display); + } +} diff -Nru intel-gpu-tools-1.13/tests/kms_pipe_crc_basic.c intel-gpu-tools-1.15/tests/kms_pipe_crc_basic.c --- intel-gpu-tools-1.13/tests/kms_pipe_crc_basic.c 2015-11-30 16:26:23.000000000 +0000 +++ intel-gpu-tools-1.15/tests/kms_pipe_crc_basic.c 2016-05-23 10:51:28.000000000 +0000 @@ -43,55 +43,6 @@ { .r = 0.0, .g = 1.0, .b = 1.0 }, }; -static uint64_t submit_batch(int fd, unsigned ring_id) -{ - const uint32_t batch[] = { MI_NOOP, - MI_BATCH_BUFFER_END }; - struct drm_i915_gem_execbuffer2 execbuf; - struct drm_i915_gem_exec_object2 exec; - uint64_t presumed_offset; - - gem_require_ring(fd, ring_id); - - exec.handle = gem_create(fd, 4096); - gem_write(fd, exec.handle, 0, batch, sizeof(batch)); - exec.relocation_count = 0; - exec.relocs_ptr = 0; - exec.alignment = 0; - exec.offset = 0; - exec.flags = 0; - exec.rsvd1 = 0; - exec.rsvd2 = 0; - - execbuf.buffers_ptr = (uintptr_t)&exec; - execbuf.buffer_count = 1; - execbuf.batch_start_offset = 0; - execbuf.batch_len = sizeof(batch); - execbuf.cliprects_ptr = 0; - execbuf.num_cliprects = 0; - execbuf.DR1 = 0; - execbuf.DR4 = 0; - execbuf.flags = ring_id; - i915_execbuffer2_set_context_id(execbuf, 0); - execbuf.rsvd2 = 0; - - gem_execbuf(fd, &execbuf); - gem_sync(fd, exec.handle); - presumed_offset = exec.offset; - - igt_set_stop_rings(igt_to_stop_ring_flag(ring_id)); - - gem_execbuf(fd, &execbuf); - gem_sync(fd, exec.handle); - - igt_assert(igt_get_stop_rings() == STOP_RING_NONE); - igt_assert(presumed_offset == exec.offset); - - gem_close(fd, exec.handle); - - return exec.offset; -} - static void test_bad_command(data_t *data, const char *cmd) { FILE *ctl; @@ -110,6 +61,7 @@ #define N_CRCS 3 #define TEST_SEQUENCE (1<<0) +#define TEST_NONBLOCK (1<<1) static int test_read_crc_for_output(data_t *data, int pipe, igt_output_t *output, @@ -124,6 +76,7 @@ for (c = 0; c < ARRAY_SIZE(colors); c++) { char *crc_str; + int n_crcs; igt_output_set_pipe(output, pipe); igt_display_commit(display); @@ -151,12 +104,28 @@ igt_display_commit(display); - pipe_crc = igt_pipe_crc_new(pipe, INTEL_PIPE_CRC_SOURCE_AUTO); + if (flags & TEST_NONBLOCK) + pipe_crc = igt_pipe_crc_new_nonblock(pipe, INTEL_PIPE_CRC_SOURCE_AUTO); + else + pipe_crc = igt_pipe_crc_new(pipe, INTEL_PIPE_CRC_SOURCE_AUTO); igt_pipe_crc_start(pipe_crc); /* wait for N_CRCS vblanks and the corresponding N_CRCS CRCs */ - igt_pipe_crc_get_crcs(pipe_crc, N_CRCS, &crcs); + if (flags & TEST_NONBLOCK) { + int i; + + for (i = 0; i < N_CRCS; i++) + igt_wait_for_vblank(data->drm_fd, pipe); + + n_crcs = igt_pipe_crc_get_crcs(pipe_crc, N_CRCS * 3, &crcs); + /* allow a one frame difference */ + igt_assert_lte(n_crcs, N_CRCS + 1); + igt_assert_lte(N_CRCS, n_crcs + 1); + } else { + n_crcs = igt_pipe_crc_get_crcs(pipe_crc, N_CRCS, &crcs); + igt_assert_eq(n_crcs, N_CRCS); + } igt_pipe_crc_stop(pipe_crc); @@ -171,12 +140,12 @@ free(crc_str); /* and ensure that they'are all equal, we haven't changed the fb */ - for (j = 0; j < (N_CRCS - 1); j++) + for (j = 0; j < (n_crcs - 1); j++) igt_assert_crc_equal(&crcs[j], &crcs[j + 1]); if (flags & TEST_SEQUENCE) - for (j = 0; j < (N_CRCS - 1); j++) - igt_assert(crcs[j].frame + 1 == crcs[j + 1].frame); + for (j = 0; j < (n_crcs - 1); j++) + igt_assert_eq(crcs[j].frame + 1, crcs[j + 1].frame); free(crcs); igt_pipe_crc_free(pipe_crc); @@ -246,15 +215,24 @@ igt_subtest_f("read-crc-pipe-%c-frame-sequence", 'A'+i) test_read_crc(&data, i, TEST_SEQUENCE); + igt_subtest_f("nonblocking-crc-pipe-%c", 'A'+i) + test_read_crc(&data, i, TEST_NONBLOCK); + + igt_subtest_f("nonblocking-crc-pipe-%c-frame-sequence", 'A'+i) + test_read_crc(&data, i, TEST_SEQUENCE | TEST_NONBLOCK); + igt_subtest_f("suspend-read-crc-pipe-%c", 'A'+i) { + igt_skip_on(i >= data.display.n_pipes); igt_system_suspend_autoresume(); test_read_crc(&data, i, 0); } igt_subtest_f("hang-read-crc-pipe-%c", 'A'+i) { - submit_batch(data.drm_fd, I915_EXEC_RENDER); - + igt_hang_ring_t hang = + igt_hang_ring(data.drm_fd, I915_EXEC_RENDER); + test_read_crc(&data, i, 0); + igt_post_hang_ring(data.drm_fd, hang); test_read_crc(&data, i, 0); } } diff -Nru intel-gpu-tools-1.13/tests/kms_plane.c intel-gpu-tools-1.15/tests/kms_plane.c --- intel-gpu-tools-1.13/tests/kms_plane.c 2015-11-30 16:26:23.000000000 +0000 +++ intel-gpu-tools-1.15/tests/kms_plane.c 2016-05-23 10:51:28.000000000 +0000 @@ -68,6 +68,7 @@ drmModeModeInfo *mode; igt_plane_t *primary; char *crc_str; + int ret; igt_output_set_pipe(output, pipe); @@ -81,7 +82,8 @@ &fb); igt_plane_set_fb(primary, &fb); - igt_display_commit(&data->display); + ret = igt_display_try_commit2(&data->display, COMMIT_LEGACY); + igt_skip_on(ret != 0); igt_pipe_crc_collect_crc(data->pipe_crc, crc); @@ -224,13 +226,18 @@ unsigned int flags) { igt_output_t *output; + int connected_outs = 0; igt_skip_on(pipe >= data->display.n_pipes); igt_skip_on(plane >= data->display.pipes[pipe].n_planes); - for_each_connected_output(&data->display, output) + for_each_connected_output(&data->display, output) { test_plane_position_with_output(data, pipe, plane, output, flags); + connected_outs++; + } + + igt_skip_on(connected_outs == 0); } /* @@ -346,13 +353,18 @@ unsigned int flags) { igt_output_t *output; + int connected_outs = 0; igt_skip_on(pipe >= data->display.n_pipes); igt_skip_on(plane >= data->display.pipes[pipe].n_planes); - for_each_connected_output(&data->display, output) + for_each_connected_output(&data->display, output) { test_plane_panning_with_output(data, pipe, plane, output, flags); + connected_outs++; + } + + igt_skip_on(connected_outs == 0); } static void diff -Nru intel-gpu-tools-1.13/tests/kms_plane_scaling.c intel-gpu-tools-1.15/tests/kms_plane_scaling.c --- intel-gpu-tools-1.13/tests/kms_plane_scaling.c 2015-11-30 16:26:23.000000000 +0000 +++ intel-gpu-tools-1.15/tests/kms_plane_scaling.c 2016-05-23 10:51:28.000000000 +0000 @@ -55,26 +55,6 @@ #define FILE_NAME "1080p-left.png" -static void -paint_color(data_t *d, struct igt_fb *fb, uint16_t w, uint16_t h) -{ - cairo_t *cr; - - cr = igt_get_cairo_ctx(d->drm_fd, fb); - igt_paint_test_pattern(cr, w, h); - cairo_destroy(cr); -} - -static void -paint_image(data_t *d, struct igt_fb *fb, uint16_t w, uint16_t h) -{ - cairo_t *cr; - - cr = igt_get_cairo_ctx(d->drm_fd, fb); - igt_paint_image(cr, FILE_NAME, 0, 0, w, h); - cairo_destroy(cr); -} - static void prepare_crtc(data_t *data, igt_output_t *output, enum pipe pipe, igt_plane_t *plane, drmModeModeInfo *mode, enum igt_commit_style s) { @@ -93,15 +73,13 @@ } /* allocate fb for plane 1 */ - data->fb_id1 = igt_create_fb(data->drm_fd, - mode->hdisplay, mode->vdisplay, - DRM_FORMAT_XRGB8888, - LOCAL_I915_FORMAT_MOD_X_TILED, /* tiled */ - &data->fb1); + data->fb_id1 = igt_create_pattern_fb(data->drm_fd, + mode->hdisplay, mode->vdisplay, + DRM_FORMAT_XRGB8888, + LOCAL_I915_FORMAT_MOD_X_TILED, /* tiled */ + &data->fb1); igt_assert(data->fb_id1); - paint_color(data, &data->fb1, mode->hdisplay, mode->vdisplay); - /* * We always set the primary plane to actually enable the pipe as * there's no way (that works) to light up a pipe with only a sprite @@ -201,7 +179,6 @@ { igt_display_t *display = &d->display; igt_output_t *output; - cairo_surface_t *image; enum pipe pipe; int valid_tests = 0; int primary_plane_scaling = 0; /* For now */ @@ -218,27 +195,18 @@ mode = igt_output_get_mode(output); /* allocate fb2 with image size */ - image = cairo_image_surface_create_from_png(FILE_NAME); - igt_assert(cairo_surface_status(image) == CAIRO_STATUS_SUCCESS); - d->image_w = cairo_image_surface_get_width(image); - d->image_h = cairo_image_surface_get_height(image); - cairo_surface_destroy(image); - - d->fb_id2 = igt_create_fb(d->drm_fd, - d->image_w, d->image_h, - DRM_FORMAT_XRGB8888, - LOCAL_I915_FORMAT_MOD_X_TILED, /* tiled */ - &d->fb2); + d->fb_id2 = igt_create_image_fb(d->drm_fd, 0, 0, + DRM_FORMAT_XRGB8888, + LOCAL_I915_FORMAT_MOD_X_TILED, /* tiled */ + FILE_NAME, &d->fb2); igt_assert(d->fb_id2); - paint_image(d, &d->fb2, d->fb2.width, d->fb2.height); - d->fb_id3 = igt_create_fb(d->drm_fd, - mode->hdisplay, mode->vdisplay, - DRM_FORMAT_XRGB8888, - LOCAL_I915_FORMAT_MOD_X_TILED, /* tiled */ - &d->fb3); + d->fb_id3 = igt_create_pattern_fb(d->drm_fd, + mode->hdisplay, mode->vdisplay, + DRM_FORMAT_XRGB8888, + LOCAL_I915_FORMAT_MOD_X_TILED, /* tiled */ + &d->fb3); igt_assert(d->fb_id3); - paint_color(d, &d->fb3, mode->hdisplay, mode->vdisplay); /* Set up display with plane 1 */ d->plane1 = igt_output_get_plane(output, IGT_PLANE_PRIMARY); diff -Nru intel-gpu-tools-1.13/tests/kms_psr_sink_crc.c intel-gpu-tools-1.15/tests/kms_psr_sink_crc.c --- intel-gpu-tools-1.13/tests/kms_psr_sink_crc.c 2015-11-30 16:26:23.000000000 +0000 +++ intel-gpu-tools-1.15/tests/kms_psr_sink_crc.c 2016-05-23 10:51:28.000000000 +0000 @@ -199,68 +199,27 @@ static bool psr_possible(data_t *data) { - FILE *file; - char buf[4096]; - int ret; + char buf[512]; - if (running_with_psr_disabled) - return true; + igt_debugfs_read("i915_edp_psr_status", buf); - file = igt_debugfs_fopen("i915_edp_psr_status", "r"); - igt_require(file); - - /* First dump the entire file into the debug log for later analysis - * if required. - */ - ret = fread(buf, 1, 4095, file); - igt_require(ret > 0); - buf[ret] = '\0'; - igt_debug("i915_edp_psr_status:\n%s", buf); - fseek(file, 0, SEEK_SET); - - /* Now check that we have all the preconditions required for PSR */ - ret = fscanf(file, "Sink_Support: %s\n", buf); - igt_require_f(ret == 1 && strcmp(buf, "yes") == 0, - "Sink_Support: %s\n", buf); - - fclose(file); - return true; + return running_with_psr_disabled || + strstr(buf, "Sink_Support: yes\n"); } static bool psr_active(data_t *data) { - int ret; - FILE *file; - char str[4]; - - if (running_with_psr_disabled) - return true; + char buf[512]; - file = igt_debugfs_fopen("i915_edp_psr_status", "r"); - igt_require(file); + igt_debugfs_read("i915_edp_psr_status", buf); - ret = fscanf(file, "Sink_Support: %s\n", str); - igt_assert_neq(ret, 0); - ret = fscanf(file, "Source_OK: %s\n", str); - igt_assert_neq(ret, 0); - ret = fscanf(file, "Enabled: %s\n", str); - igt_assert_neq(ret, 0); - ret = fscanf(file, "Active: %s\n", str); - igt_assert_neq(ret, 0); - ret = fscanf(file, "Busy frontbuffer bits: %s\n", str); - igt_assert_neq(ret, 0); - ret = fscanf(file, "Re-enable work scheduled: %s\n", str); - igt_assert_neq(ret, 0); - ret = fscanf(file, "HW Enabled & Active bit: %s\n", str); - igt_assert_neq(ret, 0); - - fclose(file); - return strcmp(str, "yes") == 0; + return running_with_psr_disabled || + strstr(buf, "HW Enabled & Active bit: yes\n"); } static bool wait_psr_entry(data_t *data) { - int timeout = 10; + int timeout = 5; while (timeout--) { if (psr_active(data)) return true; @@ -557,7 +516,8 @@ kmstest_set_vt_graphics_mode(); data.devid = intel_get_drm_devid(data.drm_fd); - igt_set_module_param_int("enable_psr", 1); + igt_set_module_param_int("enable_psr", running_with_psr_disabled ? + 0 : 1); igt_skip_on(!psr_possible(&data)); @@ -568,6 +528,11 @@ display_init(&data); } + igt_subtest("psr_basic") { + setup_test_plane(&data); + igt_assert(wait_psr_entry(&data)); + } + for (op = PAGE_FLIP; op <= RENDER; op++) { igt_subtest_f("primary_%s", op_str(op)) { data.test_plane = PRIMARY; @@ -622,6 +587,30 @@ igt_assert(wait_psr_entry(&data)); run_test(&data); + test_cleanup(&data); + } + + igt_subtest_f("suspend_psr_active") { + data.test_plane = PRIMARY; + data.op = PAGE_FLIP; + setup_test_plane(&data); + igt_assert(wait_psr_entry(&data)); + + igt_system_suspend_autoresume(); + + run_test(&data); + test_cleanup(&data); + } + + igt_subtest_f("suspend_psr_exit") { + data.test_plane = CURSOR; + data.op = PLANE_ONOFF; + setup_test_plane(&data); + + igt_system_suspend_autoresume(); + + igt_assert(wait_psr_entry(&data)); + run_test(&data); test_cleanup(&data); } diff -Nru intel-gpu-tools-1.13/tests/kms_pwrite_crc.c intel-gpu-tools-1.15/tests/kms_pwrite_crc.c --- intel-gpu-tools-1.13/tests/kms_pwrite_crc.c 2015-11-30 16:26:23.000000000 +0000 +++ intel-gpu-tools-1.15/tests/kms_pwrite_crc.c 2016-05-23 10:51:28.000000000 +0000 @@ -50,7 +50,6 @@ igt_output_t *output = data->output; struct igt_fb *fb = &data->fb[1]; drmModeModeInfo *mode; - cairo_t *cr; uint32_t caching; void *buf; igt_crc_t crc; @@ -58,12 +57,8 @@ mode = igt_output_get_mode(output); /* create a non-white fb where we can pwrite later */ - igt_create_fb(data->drm_fd, mode->hdisplay, mode->vdisplay, - DRM_FORMAT_XRGB8888, LOCAL_DRM_FORMAT_MOD_NONE, fb); - - cr = igt_get_cairo_ctx(data->drm_fd, fb); - igt_paint_test_pattern(cr, fb->width, fb->height); - cairo_destroy(cr); + igt_create_pattern_fb(data->drm_fd, mode->hdisplay, mode->vdisplay, + DRM_FORMAT_XRGB8888, LOCAL_DRM_FORMAT_MOD_NONE, fb); /* flip to it to make it UC/WC and fully flushed */ drmModeSetPlane(data->drm_fd, diff -Nru intel-gpu-tools-1.13/tests/kms_render.c intel-gpu-tools-1.15/tests/kms_render.c --- intel-gpu-tools-1.13/tests/kms_render.c 2015-11-30 16:26:23.000000000 +0000 +++ intel-gpu-tools-1.15/tests/kms_render.c 2016-05-23 10:51:28.000000000 +0000 @@ -35,9 +35,6 @@ drmModeRes *resources; int drm_fd; -static drm_intel_bufmgr *bufmgr; -struct intel_batchbuffer *batch; -uint32_t devid; enum test_flags { TEST_DIRECT_RENDER = 0x01, @@ -70,6 +67,15 @@ drm_intel_bo *dst_bo; drm_intel_bo *src_bo; int bpp; + static drm_intel_bufmgr *bufmgr; + struct intel_batchbuffer *batch; + uint32_t devid; + + igt_require_intel(drm_fd); + + bufmgr = drm_intel_bufmgr_gem_init(drm_fd, 4096); + devid = intel_get_drm_devid(drm_fd); + batch = intel_batchbuffer_alloc(bufmgr, devid); igt_assert(dst_fb->drm_format == src_fb->drm_format); igt_assert(src_fb->drm_format == DRM_FORMAT_RGB565 || @@ -173,9 +179,10 @@ int format_count; int i; - igt_get_all_formats(&formats, &format_count); + igt_get_all_cairo_formats(&formats, &format_count); for (i = 0; i < format_count; i++) { - if (intel_gen(intel_get_drm_devid(drm_fd)) < 4 + if (is_i915_device(drm_fd) + && intel_gen(intel_get_drm_devid(drm_fd)) < 4 && formats[i] == DRM_FORMAT_XRGB2101010) { igt_info("gen2/3 don't support 10bpc, skipping\n"); continue; @@ -232,11 +239,7 @@ igt_skip_on_simulation(); igt_fixture { - drm_fd = drm_open_driver_master(DRIVER_INTEL); - - bufmgr = drm_intel_bufmgr_gem_init(drm_fd, 4096); - devid = intel_get_drm_devid(drm_fd); - batch = intel_batchbuffer_alloc(bufmgr, devid); + drm_fd = drm_open_driver_master(DRIVER_ANY); kmstest_set_vt_graphics_mode(); } diff -Nru intel-gpu-tools-1.13/tests/kms_rotation_crc.c intel-gpu-tools-1.15/tests/kms_rotation_crc.c --- intel-gpu-tools-1.13/tests/kms_rotation_crc.c 2015-11-30 16:26:23.000000000 +0000 +++ intel-gpu-tools-1.15/tests/kms_rotation_crc.c 2016-05-23 10:51:28.000000000 +0000 @@ -111,6 +111,9 @@ commit = COMMIT_UNIVERSAL; } + if (data->display.is_atomic) + commit = COMMIT_ATOMIC; + igt_display_commit2(display, commit); } @@ -220,7 +223,7 @@ static void wait_for_pageflip(int fd) { drmEventContext evctx = { .version = DRM_EVENT_CONTEXT_VERSION }; - struct timeval timeout = { .tv_sec = 0, .tv_usec = 32000 }; + struct timeval timeout = { .tv_sec = 0, .tv_usec = 50000 }; fd_set fds; int ret; @@ -250,6 +253,9 @@ commit = COMMIT_UNIVERSAL; } + if (data->display.is_atomic) + commit = COMMIT_ATOMIC; + for_each_connected_output(display, output) { for_each_pipe(display, pipe) { igt_plane_t *plane; @@ -340,6 +346,9 @@ commit = COMMIT_UNIVERSAL; } + if (data->display.is_atomic) + commit = COMMIT_ATOMIC; + mode = igt_output_get_mode(output); w = mode->hdisplay; h = mode->vdisplay; @@ -404,6 +413,9 @@ commit = COMMIT_UNIVERSAL; } + if (data->display.is_atomic) + commit = COMMIT_ATOMIC; + mode = igt_output_get_mode(output); w = mode->hdisplay; h = mode->vdisplay; diff -Nru intel-gpu-tools-1.13/tests/kms_setmode.c intel-gpu-tools-1.15/tests/kms_setmode.c --- intel-gpu-tools-1.13/tests/kms_setmode.c 2015-11-30 16:26:23.000000000 +0000 +++ intel-gpu-tools-1.15/tests/kms_setmode.c 2016-05-23 10:51:28.000000000 +0000 @@ -70,6 +70,7 @@ TEST_CLONE = 0x02, TEST_SINGLE_CRTC_CLONE = 0x04, TEST_EXCLUSIVE_CRTC_CLONE = 0x08, + TEST_STEALING = 0x10, }; struct test_config { @@ -146,8 +147,6 @@ cr = igt_get_cairo_ctx(drm_fd, fb); - igt_paint_test_pattern(cr, fb->width, fb->height); - cairo_move_to(cr, fb->width / 2, fb->height / 2); cairo_set_font_size(cr, 24); igt_cairo_printf_line(cr, align_hcenter, 40, "%s", test_name); @@ -180,10 +179,11 @@ bpp = 32; depth = 24; - fb_id = igt_create_fb(drm_fd, crtc->mode.hdisplay, - crtc->mode.vdisplay, - igt_bpp_depth_to_drm_format(bpp, depth), - LOCAL_DRM_FORMAT_MOD_NONE, fb_info); + fb_id = igt_create_pattern_fb(drm_fd, crtc->mode.hdisplay, + crtc->mode.vdisplay, + igt_bpp_depth_to_drm_format(bpp, depth), + LOCAL_DRM_FORMAT_MOD_NONE, + fb_info); igt_assert_lt(0, fb_id); } @@ -381,6 +381,34 @@ return ids; } +static int test_stealing(int fd, struct crtc_config *crtc, uint32_t *ids) +{ + int i, ret = 0; + + if (!crtc->connector_count) + return drmModeSetCrtc(fd, crtc->crtc_id, + crtc->fb_info.fb_id, 0, 0, + ids, crtc->connector_count, &crtc->mode); + + for (i = 0; i < crtc->connector_count; ++i) { + ret = drmModeSetCrtc(fd, crtc->crtc_id, + crtc->fb_info.fb_id, 0, 0, + &ids[i], 1, &crtc->mode); + + igt_assert_eq(ret, 0); + + ret = drmModeSetCrtc(fd, crtc->crtc_id, + crtc->fb_info.fb_id, 0, 0, + ids, crtc->connector_count, &crtc->mode); + + /* This should fail with -EINVAL */ + if (!ret) + return 0; + } + + return ret; +} + static void test_crtc_config(const struct test_config *tconf, struct crtc_config *crtcs, int crtc_count) { @@ -423,9 +451,13 @@ paint_fb(&crtc->fb_info, tconf->name, crtc_strs, crtc_count, i); ids = get_connector_ids(crtc); - ret = drmModeSetCrtc(drm_fd, crtc->crtc_id, - crtc->fb_info.fb_id, 0, 0, ids, - crtc->connector_count, &crtc->mode); + if (tconf->flags & TEST_STEALING) + ret = test_stealing(drm_fd, crtc, ids); + else + ret = drmModeSetCrtc(drm_fd, crtc->crtc_id, + crtc->fb_info.fb_id, 0, 0, ids, + crtc->connector_count, &crtc->mode); + free(ids); if (ret < 0) { @@ -504,7 +536,7 @@ drmModeConnector *connector; drmModeModeInfo mode; - connector = drmModeGetConnector(drm_fd, connector_id); + connector = drmModeGetConnectorCurrent(drm_fd, connector_id); igt_assert(connector); cconf->connector = connector; @@ -624,6 +656,9 @@ struct connector_config *cconfs; int i; + if (connector_count > 2 && (tconf->flags & TEST_STEALING)) + return; + get_combinations(tconf->resources->count_connectors, connector_count, false, &connector_combs); get_combinations(tconf->resources->count_crtcs, connector_count, @@ -701,6 +736,8 @@ "invalid-clone-exclusive-crtc" }, { TEST_CLONE | TEST_EXCLUSIVE_CRTC_CLONE, "clone-exclusive-crtc" }, + { TEST_INVALID | TEST_CLONE | TEST_SINGLE_CRTC_CLONE | TEST_STEALING, + "invalid-clone-single-crtc-stealing" } }; const char *help_str = " -d\t\tDon't run any test, only print what would be done. (still needs DRM access)\n" @@ -719,7 +756,7 @@ "only one of -d and -t is accepted\n"); igt_fixture { - drm_fd = drm_open_driver_master(DRIVER_INTEL); + drm_fd = drm_open_driver_master(DRIVER_ANY); if (!dry_run) kmstest_set_vt_graphics_mode(); diff -Nru intel-gpu-tools-1.13/tests/kms_sink_crc_basic.c intel-gpu-tools-1.15/tests/kms_sink_crc_basic.c --- intel-gpu-tools-1.13/tests/kms_sink_crc_basic.c 2015-11-30 16:26:23.000000000 +0000 +++ intel-gpu-tools-1.15/tests/kms_sink_crc_basic.c 2016-05-23 10:51:28.000000000 +0000 @@ -62,40 +62,24 @@ igt_assert(strcmp(crc, CRC_BLACK) != 0); } -static void assert_color(char *crc, enum color color) +static void assert_color(const char *crc, enum color color) { - char color_mask[5] = "FFFF\0"; - char rs[5], gs[5], bs[5]; - unsigned int rh, gh, bh, mask; + unsigned int r, g, b; int ret; - sscanf(color_mask, "%4x", &mask); - - memcpy(rs, &crc[0], 4); - rs[4] = '\0'; - ret = sscanf(rs, "%4x", &rh); - igt_require(ret > 0); - - memcpy(gs, &crc[4], 4); - gs[4] = '\0'; - ret = sscanf(gs, "%4x", &gh); - igt_require(ret > 0); - - memcpy(bs, &crc[8], 4); - bs[4] = '\0'; - ret = sscanf(bs, "%4x", &bh); - igt_require(ret > 0); + ret = sscanf(crc, "%4x%4x%4x", &r, &g, &b); + igt_assert_eq(ret, 3); switch (color) { case RED: - igt_assert((rh & mask) != 0 && - (gh & mask) == 0 && - (bh & mask) == 0); + igt_assert_lt(0, r); + igt_assert_eq(0, g); + igt_assert_eq(0, b); break; case GREEN: - igt_assert((rh & mask) == 0 && - (gh & mask) != 0 && - (bh & mask) == 0); + igt_assert_eq(0, r); + igt_assert_lt(0, g); + igt_assert_eq(0, b); break; default: igt_fail(IGT_EXIT_FAILURE); diff -Nru intel-gpu-tools-1.13/tests/kms_sysfs_edid_timing intel-gpu-tools-1.15/tests/kms_sysfs_edid_timing --- intel-gpu-tools-1.13/tests/kms_sysfs_edid_timing 2015-08-06 15:22:11.000000000 +0000 +++ intel-gpu-tools-1.15/tests/kms_sysfs_edid_timing 2016-05-23 10:51:28.000000000 +0000 @@ -19,7 +19,7 @@ if [ $RES -gt 600 ]; then echo "Talking to outputs took ${RES}ms, something is wrong" - exit 1 + exit $IGT_EXIT_FAILURE fi -exit 0 +exit $IGT_EXIT_SUCCESS diff -Nru intel-gpu-tools-1.13/tests/kms_vblank.c intel-gpu-tools-1.15/tests/kms_vblank.c --- intel-gpu-tools-1.13/tests/kms_vblank.c 2015-11-30 16:26:23.000000000 +0000 +++ intel-gpu-tools-1.15/tests/kms_vblank.c 2016-05-23 10:51:28.000000000 +0000 @@ -177,7 +177,7 @@ igt_skip_on_simulation(); igt_fixture { - fd = drm_open_driver(DRIVER_INTEL); + fd = drm_open_driver(DRIVER_ANY); igt_require(crtc0_active(fd)); } diff -Nru intel-gpu-tools-1.13/tests/Makefile.am intel-gpu-tools-1.15/tests/Makefile.am --- intel-gpu-tools-1.13/tests/Makefile.am 2015-11-12 17:30:48.000000000 +0000 +++ intel-gpu-tools-1.15/tests/Makefile.am 2016-05-23 10:51:28.000000000 +0000 @@ -4,12 +4,22 @@ TESTS_progs_M += $(NOUVEAU_TESTS_M) endif +if HAVE_VC4 + TESTS_progs_M += $(VC4_TESTS_M) +endif + if BUILD_TESTS test-list.txt: Makefile.sources @echo TESTLIST > $@ @echo ${single_kernel_tests} ${multi_kernel_tests} >> $@ @echo END TESTLIST >> $@ +test-list-full.txt: Makefile.sources + @echo TESTLIST > $@ + @echo ${single_kernel_tests} ${multi_kernel_tests} ${extra_multi_kernel_tests} >> $@ + @echo END TESTLIST >> $@ + + noinst_PROGRAMS = \ $(HANG) \ $(TESTS_testsuite) \ @@ -20,6 +30,7 @@ gem_stress \ $(TESTS_progs) \ $(TESTS_progs_M) \ + $(TESTS_progs_XM) \ $(NULL) dist_pkglibexec_SCRIPTS = \ @@ -32,12 +43,16 @@ $(IMAGES) \ $(NULL) -pkgdata_DATA = test-list.txt +all-local: .gitignore +.gitignore: Makefile.sources + @echo "$(pkglibexec_PROGRAMS) $(HANG) test-list.txt test-list-full.txt .gitignore" | sed 's/\s\+/\n/g' | sort > $@ + +pkgdata_DATA = test-list.txt test-list-full.txt EXTRA_PROGRAMS = $(HANG) EXTRA_DIST = $(common_files) -CLEANFILES = $(EXTRA_PROGRAMS) test-list.txt +CLEANFILES = $(EXTRA_PROGRAMS) test-list.txt test-list-full.txt .gitignore AM_CFLAGS = $(DRM_CFLAGS) $(CWARNFLAGS) $(DEBUG_CFLAGS)\ -I$(srcdir)/.. \ @@ -45,12 +60,11 @@ -include "$(srcdir)/../lib/check-ndebug.h" \ -DIGT_SRCDIR=\""$(abs_srcdir)"\" \ -DIGT_DATADIR=\""$(pkgdatadir)"\" \ - $(LIBUNWIND_CFLAGS) \ + $(LIBUNWIND_CFLAGS) $(WERROR_CFLAGS) \ $(NULL) -LDADD = ../lib/libintel_tools.la $(PCIACCESS_LIBS) $(DRM_LIBS) $(LIBUNWIND_LIBS) +LDADD = ../lib/libintel_tools.la $(GLIB_LIBS) -LDADD += $(CAIRO_LIBS) $(LIBUDEV_LIBS) $(GLIB_LIBS) -lm AM_CFLAGS += $(CAIRO_CFLAGS) $(LIBUDEV_CFLAGS) $(GLIB_CFLAGS) AM_LDFLAGS = -Wl,--as-needed @@ -62,6 +76,8 @@ gem_ctx_basic_LDADD = $(LDADD) -lpthread gem_ctx_thrash_CFLAGS = $(AM_CFLAGS) $(THREAD_CFLAGS) gem_ctx_thrash_LDADD = $(LDADD) -lpthread +gem_exec_parallel_CFLAGS = $(AM_CFLAGS) $(THREAD_CFLAGS) +gem_exec_parallel_LDADD = $(LDADD) -lpthread gem_fence_thrash_CFLAGS = $(AM_CFLAGS) $(THREAD_CFLAGS) gem_fence_thrash_LDADD = $(LDADD) -lpthread gem_fence_upload_CFLAGS = $(AM_CFLAGS) $(THREAD_CFLAGS) @@ -93,5 +109,11 @@ 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) +vc4_create_bo_CFLAGS = $(AM_CFLAGS) $(DRM_VC4_CFLAGS) +vc4_create_bo_LDADD = $(LDADD) $(DRM_VC4_LIBS) +vc4_wait_bo_CFLAGS = $(AM_CFLAGS) $(DRM_VC4_CFLAGS) +vc4_wait_bo_LDADD = $(LDADD) $(DRM_VC4_LIBS) +vc4_wait_seqno_CFLAGS = $(AM_CFLAGS) $(DRM_VC4_CFLAGS) +vc4_wait_seqno_LDADD = $(LDADD) $(DRM_VC4_LIBS) endif diff -Nru intel-gpu-tools-1.13/tests/Makefile.in intel-gpu-tools-1.15/tests/Makefile.in --- intel-gpu-tools-1.13/tests/Makefile.in 2015-12-02 16:47:59.000000000 +0000 +++ intel-gpu-tools-1.15/tests/Makefile.in 2016-05-31 17:03:32.000000000 +0000 @@ -90,11 +90,13 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ +target_triplet = @target@ @HAVE_NOUVEAU_TRUE@am__append_1 = $(NOUVEAU_TESTS_M) +@HAVE_VC4_TRUE@am__append_2 = $(VC4_TESTS_M) @BUILD_TESTS_TRUE@noinst_PROGRAMS = $(am__EXEEXT_1) @BUILD_TESTS_TRUE@pkglibexec_PROGRAMS = gem_alive$(EXEEXT) \ @BUILD_TESTS_TRUE@ gem_stress$(EXEEXT) $(am__EXEEXT_2) \ -@BUILD_TESTS_TRUE@ $(am__EXEEXT_5) +@BUILD_TESTS_TRUE@ $(am__EXEEXT_7) $(am__EXEEXT_8) @BUILD_TESTS_TRUE@EXTRA_PROGRAMS = $(am__EXEEXT_1) subdir = tests ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 @@ -124,20 +126,21 @@ gem_bad_length$(EXEEXT) gem_cpu_reloc$(EXEEXT) \ gem_cs_prefetch$(EXEEXT) gem_ctx_bad_destroy$(EXEEXT) \ gem_ctx_basic$(EXEEXT) gem_ctx_create$(EXEEXT) \ - gem_ctx_thrash$(EXEEXT) gem_double_irq_loop$(EXEEXT) \ - gem_exec_big$(EXEEXT) gem_exec_blt$(EXEEXT) \ - gem_exec_lut_handle$(EXEEXT) gem_fd_exhaustion$(EXEEXT) \ - gem_gtt_cpu_tlb$(EXEEXT) gem_gtt_hog$(EXEEXT) \ - gem_gtt_speed$(EXEEXT) gem_hangcheck_forcewake$(EXEEXT) \ - gem_largeobject$(EXEEXT) gem_lut_handle$(EXEEXT) \ - gem_mmap_offset_exhaustion$(EXEEXT) gem_media_fill$(EXEEXT) \ + gem_ctx_switch$(EXEEXT) gem_ctx_thrash$(EXEEXT) \ + gem_double_irq_loop$(EXEEXT) gem_exec_big$(EXEEXT) \ + gem_exec_blt$(EXEEXT) gem_exec_lut_handle$(EXEEXT) \ + gem_fd_exhaustion$(EXEEXT) gem_gtt_cpu_tlb$(EXEEXT) \ + gem_gtt_hog$(EXEEXT) gem_gtt_speed$(EXEEXT) \ + gem_hangcheck_forcewake$(EXEEXT) gem_largeobject$(EXEEXT) \ + gem_lut_handle$(EXEEXT) gem_mmap_offset_exhaustion$(EXEEXT) \ + gem_media_fill$(EXEEXT) gem_mocs_settings$(EXEEXT) \ gem_gpgpu_fill$(EXEEXT) gem_pin$(EXEEXT) gem_reg_read$(EXEEXT) \ gem_render_copy$(EXEEXT) gem_render_linear_blits$(EXEEXT) \ gem_render_tiled_blits$(EXEEXT) gem_ring_sync_copy$(EXEEXT) \ - gem_ring_sync_loop$(EXEEXT) gem_multi_bsd_sync_loop$(EXEEXT) \ - gem_seqno_wrap$(EXEEXT) gem_set_tiling_vs_gtt$(EXEEXT) \ + gem_ring_sync_loop$(EXEEXT) gem_seqno_wrap$(EXEEXT) \ + gem_set_tiling_vs_gtt$(EXEEXT) \ gem_set_tiling_vs_pwrite$(EXEEXT) gem_storedw_loop$(EXEEXT) \ - gem_threaded_access_tiled$(EXEEXT) \ + gem_sync$(EXEEXT) gem_threaded_access_tiled$(EXEEXT) \ gem_tiled_fence_blits$(EXEEXT) gem_tiled_pread_basic$(EXEEXT) \ gem_tiled_pread_pwrite$(EXEEXT) gem_tiled_swapping$(EXEEXT) \ gem_tiled_wb$(EXEEXT) gem_tiled_wc$(EXEEXT) \ @@ -150,29 +153,36 @@ gen3_render_tiledx_blits$(EXEEXT) \ gen3_render_tiledy_blits$(EXEEXT) gen7_forcewake_mt$(EXEEXT) \ kms_3d$(EXEEXT) kms_fence_pin_leak$(EXEEXT) \ - kms_force_connector$(EXEEXT) kms_pwrite_crc$(EXEEXT) \ - kms_sink_crc_basic$(EXEEXT) prime_udl$(EXEEXT) \ - testdisplay$(EXEEXT) + kms_force_connector_basic$(EXEEXT) kms_mmap_write_crc$(EXEEXT) \ + kms_pwrite_crc$(EXEEXT) kms_sink_crc_basic$(EXEEXT) \ + prime_udl$(EXEEXT) testdisplay$(EXEEXT) am__EXEEXT_3 = prime_nv_api$(EXEEXT) prime_nv_pcopy$(EXEEXT) \ prime_nv_test$(EXEEXT) @HAVE_NOUVEAU_TRUE@am__EXEEXT_4 = $(am__EXEEXT_3) -am__EXEEXT_5 = core_get_client_auth$(EXEEXT) \ +am__EXEEXT_5 = vc4_create_bo$(EXEEXT) vc4_wait_bo$(EXEEXT) \ + vc4_wait_seqno$(EXEEXT) +@HAVE_VC4_TRUE@am__EXEEXT_6 = $(am__EXEEXT_5) +am__EXEEXT_7 = core_get_client_auth$(EXEEXT) \ drv_getparams_basic$(EXEEXT) drv_suspend$(EXEEXT) \ drv_hangman$(EXEEXT) gem_bad_reloc$(EXEEXT) gem_basic$(EXEEXT) \ - gem_caching$(EXEEXT) gem_close_race$(EXEEXT) \ - gem_concurrent_blit$(EXEEXT) gem_concurrent_all$(EXEEXT) \ - gem_cs_tlb$(EXEEXT) gem_ctx_param_basic$(EXEEXT) \ - gem_ctx_bad_exec$(EXEEXT) gem_ctx_exec$(EXEEXT) \ - gem_dummy_reloc_loop$(EXEEXT) gem_eio$(EXEEXT) \ + gem_busy$(EXEEXT) gem_caching$(EXEEXT) gem_close_race$(EXEEXT) \ + gem_concurrent_blit$(EXEEXT) gem_create$(EXEEXT) \ + gem_cs_tlb$(EXEEXT) gem_ctx_bad_exec$(EXEEXT) \ + gem_ctx_exec$(EXEEXT) gem_ctx_param$(EXEEXT) gem_eio$(EXEEXT) \ gem_evict_alignment$(EXEEXT) gem_evict_everything$(EXEEXT) \ gem_exec_alignment$(EXEEXT) gem_exec_bad_domains$(EXEEXT) \ - gem_exec_faulting_reloc$(EXEEXT) gem_exec_nop$(EXEEXT) \ - gem_exec_params$(EXEEXT) gem_exec_parse$(EXEEXT) \ - gem_fenced_exec_thrash$(EXEEXT) gem_fence_thrash$(EXEEXT) \ - gem_fence_upload$(EXEEXT) gem_flink_basic$(EXEEXT) \ - gem_flink_race$(EXEEXT) gem_linear_blits$(EXEEXT) \ - gem_madvise$(EXEEXT) gem_mmap$(EXEEXT) gem_mmap_gtt$(EXEEXT) \ - gem_mmap_wc$(EXEEXT) gem_partial_pwrite_pread$(EXEEXT) \ + gem_exec_basic$(EXEEXT) gem_exec_create$(EXEEXT) \ + gem_exec_faulting_reloc$(EXEEXT) gem_exec_flush$(EXEEXT) \ + gem_exec_gttfill$(EXEEXT) gem_exec_nop$(EXEEXT) \ + gem_exec_parallel$(EXEEXT) gem_exec_params$(EXEEXT) \ + gem_exec_parse$(EXEEXT) gem_exec_store$(EXEEXT) \ + gem_exec_suspend$(EXEEXT) gem_exec_reloc$(EXEEXT) \ + gem_exec_whisper$(EXEEXT) gem_fenced_exec_thrash$(EXEEXT) \ + gem_fence_thrash$(EXEEXT) gem_fence_upload$(EXEEXT) \ + gem_flink_basic$(EXEEXT) gem_flink_race$(EXEEXT) \ + gem_linear_blits$(EXEEXT) gem_madvise$(EXEEXT) \ + gem_mmap$(EXEEXT) gem_mmap_gtt$(EXEEXT) gem_mmap_wc$(EXEEXT) \ + gem_partial_pwrite_pread$(EXEEXT) \ gem_persistent_relocs$(EXEEXT) \ gem_pipe_control_store_loop$(EXEEXT) gem_ppgtt$(EXEEXT) \ gem_pread$(EXEEXT) gem_pread_after_blit$(EXEEXT) \ @@ -182,25 +192,30 @@ gem_reloc_vs_gpu$(EXEEXT) gem_render_copy_redux$(EXEEXT) \ gem_request_retire$(EXEEXT) gem_reset_stats$(EXEEXT) \ gem_ringfill$(EXEEXT) gem_set_tiling_vs_blt$(EXEEXT) \ + gem_shrink$(EXEEXT) gem_softpin$(EXEEXT) gem_stolen$(EXEEXT) \ gem_storedw_batches_loop$(EXEEXT) \ gem_streaming_writes$(EXEEXT) gem_tiled_blits$(EXEEXT) \ gem_tiled_partial_pwrite_pread$(EXEEXT) \ gem_userptr_blits$(EXEEXT) gem_write_read_ring_switch$(EXEEXT) \ kms_addfb_basic$(EXEEXT) kms_atomic$(EXEEXT) \ - kms_cursor_crc$(EXEEXT) kms_draw_crc$(EXEEXT) \ + kms_chv_cursor_fail$(EXEEXT) kms_cursor_crc$(EXEEXT) \ + kms_cursor_legacy$(EXEEXT) kms_draw_crc$(EXEEXT) \ kms_fbc_crc$(EXEEXT) kms_fbcon_fbt$(EXEEXT) kms_flip$(EXEEXT) \ kms_flip_event_leak$(EXEEXT) kms_flip_tiling$(EXEEXT) \ kms_frontbuffer_tracking$(EXEEXT) kms_legacy_colorkey$(EXEEXT) \ kms_mmio_vs_cs_flip$(EXEEXT) kms_pipe_b_c_ivb$(EXEEXT) \ - kms_pipe_crc_basic$(EXEEXT) kms_plane$(EXEEXT) \ - kms_psr_sink_crc$(EXEEXT) kms_render$(EXEEXT) \ - kms_rotation_crc$(EXEEXT) kms_setmode$(EXEEXT) \ - kms_universal_plane$(EXEEXT) kms_vblank$(EXEEXT) \ - kms_crtc_background_color$(EXEEXT) kms_plane_scaling$(EXEEXT) \ - kms_panel_fitting$(EXEEXT) pm_backlight$(EXEEXT) \ - pm_lpsp$(EXEEXT) pm_rpm$(EXEEXT) pm_rps$(EXEEXT) \ - pm_rc6_residency$(EXEEXT) pm_sseu$(EXEEXT) \ - prime_self_import$(EXEEXT) template$(EXEEXT) $(am__EXEEXT_4) + kms_pipe_color$(EXEEXT) kms_pipe_crc_basic$(EXEEXT) \ + kms_plane$(EXEEXT) kms_psr_sink_crc$(EXEEXT) \ + kms_render$(EXEEXT) kms_rotation_crc$(EXEEXT) \ + kms_setmode$(EXEEXT) kms_universal_plane$(EXEEXT) \ + kms_vblank$(EXEEXT) kms_crtc_background_color$(EXEEXT) \ + kms_plane_scaling$(EXEEXT) kms_panel_fitting$(EXEEXT) \ + pm_backlight$(EXEEXT) pm_lpsp$(EXEEXT) pm_rpm$(EXEEXT) \ + pm_rps$(EXEEXT) pm_rc6_residency$(EXEEXT) pm_sseu$(EXEEXT) \ + prime_mmap$(EXEEXT) prime_mmap_coherency$(EXEEXT) \ + prime_mmap_kms$(EXEEXT) prime_self_import$(EXEEXT) \ + template$(EXEEXT) $(am__EXEEXT_4) $(am__EXEEXT_6) +am__EXEEXT_8 = gem_concurrent_all$(EXEEXT) am__installdirs = "$(DESTDIR)$(pkglibexecdir)" \ "$(DESTDIR)$(pkglibexecdir)" "$(DESTDIR)$(pkgdatadir)" \ "$(DESTDIR)$(pkgdatadir)" @@ -210,9 +225,7 @@ core_auth_LDADD = $(LDADD) am__DEPENDENCIES_1 = @BUILD_TESTS_TRUE@core_auth_DEPENDENCIES = ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(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 @@ -222,56 +235,42 @@ core_get_client_auth_LDADD = $(LDADD) @BUILD_TESTS_TRUE@core_get_client_auth_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) core_getclient_SOURCES = core_getclient.c core_getclient_OBJECTS = core_getclient.$(OBJEXT) core_getclient_LDADD = $(LDADD) @BUILD_TESTS_TRUE@core_getclient_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) core_getstats_SOURCES = core_getstats.c core_getstats_OBJECTS = core_getstats.$(OBJEXT) core_getstats_LDADD = $(LDADD) @BUILD_TESTS_TRUE@core_getstats_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) core_getversion_SOURCES = core_getversion.c core_getversion_OBJECTS = core_getversion.$(OBJEXT) core_getversion_LDADD = $(LDADD) @BUILD_TESTS_TRUE@core_getversion_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) core_prop_blob_SOURCES = core_prop_blob.c core_prop_blob_OBJECTS = core_prop_blob.$(OBJEXT) core_prop_blob_LDADD = $(LDADD) @BUILD_TESTS_TRUE@core_prop_blob_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) core_setmaster_vs_auth_SOURCES = core_setmaster_vs_auth.c core_setmaster_vs_auth_OBJECTS = core_setmaster_vs_auth.$(OBJEXT) core_setmaster_vs_auth_LDADD = $(LDADD) @BUILD_TESTS_TRUE@core_setmaster_vs_auth_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) drm_import_export_SOURCES = drm_import_export.c drm_import_export_OBJECTS = \ drm_import_export-drm_import_export.$(OBJEXT) @BUILD_TESTS_TRUE@am__DEPENDENCIES_2 = ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) @BUILD_TESTS_TRUE@drm_import_export_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_2) drm_import_export_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ @@ -282,124 +281,97 @@ drm_read_OBJECTS = drm_read.$(OBJEXT) drm_read_LDADD = $(LDADD) @BUILD_TESTS_TRUE@drm_read_DEPENDENCIES = ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) drm_vma_limiter_SOURCES = drm_vma_limiter.c drm_vma_limiter_OBJECTS = drm_vma_limiter.$(OBJEXT) drm_vma_limiter_LDADD = $(LDADD) @BUILD_TESTS_TRUE@drm_vma_limiter_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) 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) @BUILD_TESTS_TRUE@drm_vma_limiter_cached_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(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) @BUILD_TESTS_TRUE@drm_vma_limiter_cpu_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(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) @BUILD_TESTS_TRUE@drm_vma_limiter_gtt_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) drv_getparams_basic_SOURCES = drv_getparams_basic.c drv_getparams_basic_OBJECTS = drv_getparams_basic.$(OBJEXT) drv_getparams_basic_LDADD = $(LDADD) @BUILD_TESTS_TRUE@drv_getparams_basic_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) drv_hangman_SOURCES = drv_hangman.c drv_hangman_OBJECTS = drv_hangman.$(OBJEXT) drv_hangman_LDADD = $(LDADD) @BUILD_TESTS_TRUE@drv_hangman_DEPENDENCIES = ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) drv_suspend_SOURCES = drv_suspend.c drv_suspend_OBJECTS = drv_suspend.$(OBJEXT) drv_suspend_LDADD = $(LDADD) @BUILD_TESTS_TRUE@drv_suspend_DEPENDENCIES = ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) gem_alive_SOURCES = gem_alive.c gem_alive_OBJECTS = gem_alive.$(OBJEXT) gem_alive_LDADD = $(LDADD) @BUILD_TESTS_TRUE@gem_alive_DEPENDENCIES = ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) gem_bad_address_SOURCES = gem_bad_address.c gem_bad_address_OBJECTS = gem_bad_address.$(OBJEXT) gem_bad_address_LDADD = $(LDADD) @BUILD_TESTS_TRUE@gem_bad_address_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) gem_bad_batch_SOURCES = gem_bad_batch.c gem_bad_batch_OBJECTS = gem_bad_batch.$(OBJEXT) gem_bad_batch_LDADD = $(LDADD) @BUILD_TESTS_TRUE@gem_bad_batch_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) gem_bad_blit_SOURCES = gem_bad_blit.c gem_bad_blit_OBJECTS = gem_bad_blit.$(OBJEXT) gem_bad_blit_LDADD = $(LDADD) @BUILD_TESTS_TRUE@gem_bad_blit_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) gem_bad_length_SOURCES = gem_bad_length.c gem_bad_length_OBJECTS = gem_bad_length.$(OBJEXT) gem_bad_length_LDADD = $(LDADD) @BUILD_TESTS_TRUE@gem_bad_length_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) gem_bad_reloc_SOURCES = gem_bad_reloc.c gem_bad_reloc_OBJECTS = gem_bad_reloc.$(OBJEXT) gem_bad_reloc_LDADD = $(LDADD) @BUILD_TESTS_TRUE@gem_bad_reloc_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) gem_basic_SOURCES = gem_basic.c gem_basic_OBJECTS = gem_basic.$(OBJEXT) gem_basic_LDADD = $(LDADD) @BUILD_TESTS_TRUE@gem_basic_DEPENDENCIES = ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) +gem_busy_SOURCES = gem_busy.c +gem_busy_OBJECTS = gem_busy.$(OBJEXT) +gem_busy_LDADD = $(LDADD) +@BUILD_TESTS_TRUE@gem_busy_DEPENDENCIES = ../lib/libintel_tools.la \ +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) gem_caching_SOURCES = gem_caching.c gem_caching_OBJECTS = gem_caching.$(OBJEXT) gem_caching_LDADD = $(LDADD) @BUILD_TESTS_TRUE@gem_caching_DEPENDENCIES = ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) gem_close_race_SOURCES = gem_close_race.c gem_close_race_OBJECTS = gem_close_race-gem_close_race.$(OBJEXT) @BUILD_TESTS_TRUE@gem_close_race_DEPENDENCIES = $(am__DEPENDENCIES_2) @@ -412,56 +384,47 @@ gem_concurrent_all_LDADD = $(LDADD) @BUILD_TESTS_TRUE@gem_concurrent_all_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) gem_concurrent_blit_SOURCES = gem_concurrent_blit.c gem_concurrent_blit_OBJECTS = gem_concurrent_blit.$(OBJEXT) gem_concurrent_blit_LDADD = $(LDADD) @BUILD_TESTS_TRUE@gem_concurrent_blit_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) gem_cpu_reloc_SOURCES = gem_cpu_reloc.c gem_cpu_reloc_OBJECTS = gem_cpu_reloc.$(OBJEXT) gem_cpu_reloc_LDADD = $(LDADD) @BUILD_TESTS_TRUE@gem_cpu_reloc_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) +gem_create_SOURCES = gem_create.c +gem_create_OBJECTS = gem_create.$(OBJEXT) +gem_create_LDADD = $(LDADD) +@BUILD_TESTS_TRUE@gem_create_DEPENDENCIES = ../lib/libintel_tools.la \ +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) gem_cs_prefetch_SOURCES = gem_cs_prefetch.c gem_cs_prefetch_OBJECTS = gem_cs_prefetch.$(OBJEXT) gem_cs_prefetch_LDADD = $(LDADD) @BUILD_TESTS_TRUE@gem_cs_prefetch_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) gem_cs_tlb_SOURCES = gem_cs_tlb.c gem_cs_tlb_OBJECTS = gem_cs_tlb.$(OBJEXT) gem_cs_tlb_LDADD = $(LDADD) @BUILD_TESTS_TRUE@gem_cs_tlb_DEPENDENCIES = ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(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) @BUILD_TESTS_TRUE@gem_ctx_bad_destroy_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(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) @BUILD_TESTS_TRUE@gem_ctx_bad_exec_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) gem_ctx_basic_SOURCES = gem_ctx_basic.c gem_ctx_basic_OBJECTS = gem_ctx_basic-gem_ctx_basic.$(OBJEXT) @BUILD_TESTS_TRUE@gem_ctx_basic_DEPENDENCIES = $(am__DEPENDENCIES_2) @@ -473,25 +436,25 @@ gem_ctx_create_LDADD = $(LDADD) @BUILD_TESTS_TRUE@gem_ctx_create_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) gem_ctx_exec_SOURCES = gem_ctx_exec.c gem_ctx_exec_OBJECTS = gem_ctx_exec.$(OBJEXT) gem_ctx_exec_LDADD = $(LDADD) @BUILD_TESTS_TRUE@gem_ctx_exec_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) -gem_ctx_param_basic_SOURCES = gem_ctx_param_basic.c -gem_ctx_param_basic_OBJECTS = gem_ctx_param_basic.$(OBJEXT) -gem_ctx_param_basic_LDADD = $(LDADD) -@BUILD_TESTS_TRUE@gem_ctx_param_basic_DEPENDENCIES = \ -@BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) +gem_ctx_param_SOURCES = gem_ctx_param.c +gem_ctx_param_OBJECTS = gem_ctx_param.$(OBJEXT) +gem_ctx_param_LDADD = $(LDADD) +@BUILD_TESTS_TRUE@gem_ctx_param_DEPENDENCIES = \ +@BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) +gem_ctx_switch_SOURCES = gem_ctx_switch.c +gem_ctx_switch_OBJECTS = gem_ctx_switch.$(OBJEXT) +gem_ctx_switch_LDADD = $(LDADD) +@BUILD_TESTS_TRUE@gem_ctx_switch_DEPENDENCIES = \ +@BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) gem_ctx_thrash_SOURCES = gem_ctx_thrash.c gem_ctx_thrash_OBJECTS = gem_ctx_thrash-gem_ctx_thrash.$(OBJEXT) @BUILD_TESTS_TRUE@gem_ctx_thrash_DEPENDENCIES = $(am__DEPENDENCIES_2) @@ -504,120 +467,141 @@ gem_double_irq_loop_LDADD = $(LDADD) @BUILD_TESTS_TRUE@gem_double_irq_loop_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(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) -@BUILD_TESTS_TRUE@gem_dummy_reloc_loop_DEPENDENCIES = \ -@BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) gem_eio_SOURCES = gem_eio.c gem_eio_OBJECTS = gem_eio.$(OBJEXT) gem_eio_LDADD = $(LDADD) @BUILD_TESTS_TRUE@gem_eio_DEPENDENCIES = ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) gem_evict_alignment_SOURCES = gem_evict_alignment.c gem_evict_alignment_OBJECTS = gem_evict_alignment.$(OBJEXT) gem_evict_alignment_LDADD = $(LDADD) @BUILD_TESTS_TRUE@gem_evict_alignment_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) gem_evict_everything_SOURCES = gem_evict_everything.c gem_evict_everything_OBJECTS = gem_evict_everything.$(OBJEXT) gem_evict_everything_LDADD = $(LDADD) @BUILD_TESTS_TRUE@gem_evict_everything_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) gem_exec_alignment_SOURCES = gem_exec_alignment.c gem_exec_alignment_OBJECTS = gem_exec_alignment.$(OBJEXT) gem_exec_alignment_LDADD = $(LDADD) @BUILD_TESTS_TRUE@gem_exec_alignment_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(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) @BUILD_TESTS_TRUE@gem_exec_bad_domains_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) +gem_exec_basic_SOURCES = gem_exec_basic.c +gem_exec_basic_OBJECTS = gem_exec_basic.$(OBJEXT) +gem_exec_basic_LDADD = $(LDADD) +@BUILD_TESTS_TRUE@gem_exec_basic_DEPENDENCIES = \ +@BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) gem_exec_big_SOURCES = gem_exec_big.c gem_exec_big_OBJECTS = gem_exec_big.$(OBJEXT) gem_exec_big_LDADD = $(LDADD) @BUILD_TESTS_TRUE@gem_exec_big_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) gem_exec_blt_SOURCES = gem_exec_blt.c gem_exec_blt_OBJECTS = gem_exec_blt.$(OBJEXT) gem_exec_blt_LDADD = $(LDADD) @BUILD_TESTS_TRUE@gem_exec_blt_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) +gem_exec_create_SOURCES = gem_exec_create.c +gem_exec_create_OBJECTS = gem_exec_create.$(OBJEXT) +gem_exec_create_LDADD = $(LDADD) +@BUILD_TESTS_TRUE@gem_exec_create_DEPENDENCIES = \ +@BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ +@BUILD_TESTS_TRUE@ $(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) @BUILD_TESTS_TRUE@gem_exec_faulting_reloc_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) +gem_exec_flush_SOURCES = gem_exec_flush.c +gem_exec_flush_OBJECTS = gem_exec_flush.$(OBJEXT) +gem_exec_flush_LDADD = $(LDADD) +@BUILD_TESTS_TRUE@gem_exec_flush_DEPENDENCIES = \ +@BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) +gem_exec_gttfill_SOURCES = gem_exec_gttfill.c +gem_exec_gttfill_OBJECTS = gem_exec_gttfill.$(OBJEXT) +gem_exec_gttfill_LDADD = $(LDADD) +@BUILD_TESTS_TRUE@gem_exec_gttfill_DEPENDENCIES = \ +@BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) gem_exec_lut_handle_SOURCES = gem_exec_lut_handle.c gem_exec_lut_handle_OBJECTS = gem_exec_lut_handle.$(OBJEXT) gem_exec_lut_handle_LDADD = $(LDADD) @BUILD_TESTS_TRUE@gem_exec_lut_handle_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) gem_exec_nop_SOURCES = gem_exec_nop.c gem_exec_nop_OBJECTS = gem_exec_nop.$(OBJEXT) gem_exec_nop_LDADD = $(LDADD) @BUILD_TESTS_TRUE@gem_exec_nop_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) +gem_exec_parallel_SOURCES = gem_exec_parallel.c +gem_exec_parallel_OBJECTS = \ + gem_exec_parallel-gem_exec_parallel.$(OBJEXT) +@BUILD_TESTS_TRUE@gem_exec_parallel_DEPENDENCIES = \ +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_2) +gem_exec_parallel_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(gem_exec_parallel_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ + -o $@ gem_exec_params_SOURCES = gem_exec_params.c gem_exec_params_OBJECTS = gem_exec_params.$(OBJEXT) gem_exec_params_LDADD = $(LDADD) @BUILD_TESTS_TRUE@gem_exec_params_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) gem_exec_parse_SOURCES = gem_exec_parse.c gem_exec_parse_OBJECTS = gem_exec_parse.$(OBJEXT) gem_exec_parse_LDADD = $(LDADD) @BUILD_TESTS_TRUE@gem_exec_parse_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) +gem_exec_reloc_SOURCES = gem_exec_reloc.c +gem_exec_reloc_OBJECTS = gem_exec_reloc.$(OBJEXT) +gem_exec_reloc_LDADD = $(LDADD) +@BUILD_TESTS_TRUE@gem_exec_reloc_DEPENDENCIES = \ +@BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) +gem_exec_store_SOURCES = gem_exec_store.c +gem_exec_store_OBJECTS = gem_exec_store.$(OBJEXT) +gem_exec_store_LDADD = $(LDADD) +@BUILD_TESTS_TRUE@gem_exec_store_DEPENDENCIES = \ +@BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) +gem_exec_suspend_SOURCES = gem_exec_suspend.c +gem_exec_suspend_OBJECTS = gem_exec_suspend.$(OBJEXT) +gem_exec_suspend_LDADD = $(LDADD) +@BUILD_TESTS_TRUE@gem_exec_suspend_DEPENDENCIES = \ +@BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) +gem_exec_whisper_SOURCES = gem_exec_whisper.c +gem_exec_whisper_OBJECTS = gem_exec_whisper.$(OBJEXT) +gem_exec_whisper_LDADD = $(LDADD) +@BUILD_TESTS_TRUE@gem_exec_whisper_DEPENDENCIES = \ +@BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) gem_fd_exhaustion_SOURCES = gem_fd_exhaustion.c gem_fd_exhaustion_OBJECTS = gem_fd_exhaustion.$(OBJEXT) gem_fd_exhaustion_LDADD = $(LDADD) @BUILD_TESTS_TRUE@gem_fd_exhaustion_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) gem_fence_thrash_SOURCES = gem_fence_thrash.c gem_fence_thrash_OBJECTS = \ gem_fence_thrash-gem_fence_thrash.$(OBJEXT) @@ -641,17 +625,13 @@ gem_fenced_exec_thrash_LDADD = $(LDADD) @BUILD_TESTS_TRUE@gem_fenced_exec_thrash_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) gem_flink_basic_SOURCES = gem_flink_basic.c gem_flink_basic_OBJECTS = gem_flink_basic.$(OBJEXT) gem_flink_basic_LDADD = $(LDADD) @BUILD_TESTS_TRUE@gem_flink_basic_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) gem_flink_race_SOURCES = gem_flink_race.c gem_flink_race_OBJECTS = gem_flink_race-gem_flink_race.$(OBJEXT) @BUILD_TESTS_TRUE@gem_flink_race_DEPENDENCIES = $(am__DEPENDENCIES_2) @@ -664,93 +644,69 @@ gem_gpgpu_fill_LDADD = $(LDADD) @BUILD_TESTS_TRUE@gem_gpgpu_fill_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(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) @BUILD_TESTS_TRUE@gem_gtt_cpu_tlb_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) gem_gtt_hog_SOURCES = gem_gtt_hog.c gem_gtt_hog_OBJECTS = gem_gtt_hog.$(OBJEXT) gem_gtt_hog_LDADD = $(LDADD) @BUILD_TESTS_TRUE@gem_gtt_hog_DEPENDENCIES = ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) gem_gtt_speed_SOURCES = gem_gtt_speed.c gem_gtt_speed_OBJECTS = gem_gtt_speed.$(OBJEXT) gem_gtt_speed_LDADD = $(LDADD) @BUILD_TESTS_TRUE@gem_gtt_speed_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) gem_hang_SOURCES = gem_hang.c gem_hang_OBJECTS = gem_hang.$(OBJEXT) gem_hang_LDADD = $(LDADD) @BUILD_TESTS_TRUE@gem_hang_DEPENDENCIES = ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) gem_hangcheck_forcewake_SOURCES = gem_hangcheck_forcewake.c gem_hangcheck_forcewake_OBJECTS = gem_hangcheck_forcewake.$(OBJEXT) gem_hangcheck_forcewake_LDADD = $(LDADD) @BUILD_TESTS_TRUE@gem_hangcheck_forcewake_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) gem_largeobject_SOURCES = gem_largeobject.c gem_largeobject_OBJECTS = gem_largeobject.$(OBJEXT) gem_largeobject_LDADD = $(LDADD) @BUILD_TESTS_TRUE@gem_largeobject_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) gem_linear_blits_SOURCES = gem_linear_blits.c gem_linear_blits_OBJECTS = gem_linear_blits.$(OBJEXT) gem_linear_blits_LDADD = $(LDADD) @BUILD_TESTS_TRUE@gem_linear_blits_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) gem_lut_handle_SOURCES = gem_lut_handle.c gem_lut_handle_OBJECTS = gem_lut_handle.$(OBJEXT) gem_lut_handle_LDADD = $(LDADD) @BUILD_TESTS_TRUE@gem_lut_handle_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) gem_madvise_SOURCES = gem_madvise.c gem_madvise_OBJECTS = gem_madvise.$(OBJEXT) gem_madvise_LDADD = $(LDADD) @BUILD_TESTS_TRUE@gem_madvise_DEPENDENCIES = ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) gem_media_fill_SOURCES = gem_media_fill.c gem_media_fill_OBJECTS = gem_media_fill.$(OBJEXT) gem_media_fill_LDADD = $(LDADD) @BUILD_TESTS_TRUE@gem_media_fill_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) gem_mmap_SOURCES = gem_mmap.c gem_mmap_OBJECTS = gem_mmap.$(OBJEXT) gem_mmap_LDADD = $(LDADD) @BUILD_TESTS_TRUE@gem_mmap_DEPENDENCIES = ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) gem_mmap_gtt_SOURCES = gem_mmap_gtt.c gem_mmap_gtt_OBJECTS = gem_mmap_gtt-gem_mmap_gtt.$(OBJEXT) @BUILD_TESTS_TRUE@gem_mmap_gtt_DEPENDENCIES = $(am__DEPENDENCIES_2) @@ -763,283 +719,233 @@ gem_mmap_offset_exhaustion_LDADD = $(LDADD) @BUILD_TESTS_TRUE@gem_mmap_offset_exhaustion_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) gem_mmap_wc_SOURCES = gem_mmap_wc.c gem_mmap_wc_OBJECTS = gem_mmap_wc-gem_mmap_wc.$(OBJEXT) @BUILD_TESTS_TRUE@gem_mmap_wc_DEPENDENCIES = $(am__DEPENDENCIES_2) gem_mmap_wc_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(gem_mmap_wc_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -gem_multi_bsd_sync_loop_SOURCES = gem_multi_bsd_sync_loop.c -gem_multi_bsd_sync_loop_OBJECTS = gem_multi_bsd_sync_loop.$(OBJEXT) -gem_multi_bsd_sync_loop_LDADD = $(LDADD) -@BUILD_TESTS_TRUE@gem_multi_bsd_sync_loop_DEPENDENCIES = \ -@BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +gem_mocs_settings_SOURCES = gem_mocs_settings.c +gem_mocs_settings_OBJECTS = gem_mocs_settings.$(OBJEXT) +gem_mocs_settings_LDADD = $(LDADD) +@BUILD_TESTS_TRUE@gem_mocs_settings_DEPENDENCIES = \ +@BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) gem_non_secure_batch_SOURCES = gem_non_secure_batch.c gem_non_secure_batch_OBJECTS = gem_non_secure_batch.$(OBJEXT) gem_non_secure_batch_LDADD = $(LDADD) @BUILD_TESTS_TRUE@gem_non_secure_batch_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(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) @BUILD_TESTS_TRUE@gem_partial_pwrite_pread_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) gem_persistent_relocs_SOURCES = gem_persistent_relocs.c gem_persistent_relocs_OBJECTS = gem_persistent_relocs.$(OBJEXT) gem_persistent_relocs_LDADD = $(LDADD) @BUILD_TESTS_TRUE@gem_persistent_relocs_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) gem_pin_SOURCES = gem_pin.c gem_pin_OBJECTS = gem_pin.$(OBJEXT) gem_pin_LDADD = $(LDADD) @BUILD_TESTS_TRUE@gem_pin_DEPENDENCIES = ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(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) @BUILD_TESTS_TRUE@gem_pipe_control_store_loop_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) gem_ppgtt_SOURCES = gem_ppgtt.c gem_ppgtt_OBJECTS = gem_ppgtt.$(OBJEXT) gem_ppgtt_LDADD = $(LDADD) @BUILD_TESTS_TRUE@gem_ppgtt_DEPENDENCIES = ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) gem_pread_SOURCES = gem_pread.c gem_pread_OBJECTS = gem_pread.$(OBJEXT) gem_pread_LDADD = $(LDADD) @BUILD_TESTS_TRUE@gem_pread_DEPENDENCIES = ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(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) @BUILD_TESTS_TRUE@gem_pread_after_blit_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) gem_pwrite_SOURCES = gem_pwrite.c gem_pwrite_OBJECTS = gem_pwrite.$(OBJEXT) gem_pwrite_LDADD = $(LDADD) @BUILD_TESTS_TRUE@gem_pwrite_DEPENDENCIES = ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) gem_pwrite_pread_SOURCES = gem_pwrite_pread.c gem_pwrite_pread_OBJECTS = gem_pwrite_pread.$(OBJEXT) gem_pwrite_pread_LDADD = $(LDADD) @BUILD_TESTS_TRUE@gem_pwrite_pread_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) gem_pwrite_snooped_SOURCES = gem_pwrite_snooped.c gem_pwrite_snooped_OBJECTS = gem_pwrite_snooped.$(OBJEXT) gem_pwrite_snooped_LDADD = $(LDADD) @BUILD_TESTS_TRUE@gem_pwrite_snooped_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) gem_read_read_speed_SOURCES = gem_read_read_speed.c gem_read_read_speed_OBJECTS = gem_read_read_speed.$(OBJEXT) gem_read_read_speed_LDADD = $(LDADD) @BUILD_TESTS_TRUE@gem_read_read_speed_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) gem_readwrite_SOURCES = gem_readwrite.c gem_readwrite_OBJECTS = gem_readwrite.$(OBJEXT) gem_readwrite_LDADD = $(LDADD) @BUILD_TESTS_TRUE@gem_readwrite_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) gem_reg_read_SOURCES = gem_reg_read.c gem_reg_read_OBJECTS = gem_reg_read.$(OBJEXT) gem_reg_read_LDADD = $(LDADD) @BUILD_TESTS_TRUE@gem_reg_read_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) gem_reloc_overflow_SOURCES = gem_reloc_overflow.c gem_reloc_overflow_OBJECTS = gem_reloc_overflow.$(OBJEXT) gem_reloc_overflow_LDADD = $(LDADD) @BUILD_TESTS_TRUE@gem_reloc_overflow_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(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) @BUILD_TESTS_TRUE@gem_reloc_vs_gpu_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) gem_render_copy_SOURCES = gem_render_copy.c gem_render_copy_OBJECTS = gem_render_copy.$(OBJEXT) gem_render_copy_LDADD = $(LDADD) @BUILD_TESTS_TRUE@gem_render_copy_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) gem_render_copy_redux_SOURCES = gem_render_copy_redux.c gem_render_copy_redux_OBJECTS = gem_render_copy_redux.$(OBJEXT) gem_render_copy_redux_LDADD = $(LDADD) @BUILD_TESTS_TRUE@gem_render_copy_redux_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) gem_render_linear_blits_SOURCES = gem_render_linear_blits.c gem_render_linear_blits_OBJECTS = gem_render_linear_blits.$(OBJEXT) gem_render_linear_blits_LDADD = $(LDADD) @BUILD_TESTS_TRUE@gem_render_linear_blits_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) gem_render_tiled_blits_SOURCES = gem_render_tiled_blits.c gem_render_tiled_blits_OBJECTS = gem_render_tiled_blits.$(OBJEXT) gem_render_tiled_blits_LDADD = $(LDADD) @BUILD_TESTS_TRUE@gem_render_tiled_blits_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) gem_request_retire_SOURCES = gem_request_retire.c gem_request_retire_OBJECTS = gem_request_retire.$(OBJEXT) gem_request_retire_LDADD = $(LDADD) @BUILD_TESTS_TRUE@gem_request_retire_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) gem_reset_stats_SOURCES = gem_reset_stats.c gem_reset_stats_OBJECTS = gem_reset_stats.$(OBJEXT) gem_reset_stats_LDADD = $(LDADD) @BUILD_TESTS_TRUE@gem_reset_stats_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) gem_ring_sync_copy_SOURCES = gem_ring_sync_copy.c gem_ring_sync_copy_OBJECTS = gem_ring_sync_copy.$(OBJEXT) gem_ring_sync_copy_LDADD = $(LDADD) @BUILD_TESTS_TRUE@gem_ring_sync_copy_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(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) @BUILD_TESTS_TRUE@gem_ring_sync_loop_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) gem_ringfill_SOURCES = gem_ringfill.c gem_ringfill_OBJECTS = gem_ringfill.$(OBJEXT) gem_ringfill_LDADD = $(LDADD) @BUILD_TESTS_TRUE@gem_ringfill_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) gem_seqno_wrap_SOURCES = gem_seqno_wrap.c gem_seqno_wrap_OBJECTS = gem_seqno_wrap.$(OBJEXT) gem_seqno_wrap_LDADD = $(LDADD) @BUILD_TESTS_TRUE@gem_seqno_wrap_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(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) @BUILD_TESTS_TRUE@gem_set_tiling_vs_blt_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(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) @BUILD_TESTS_TRUE@gem_set_tiling_vs_gtt_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(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) @BUILD_TESTS_TRUE@gem_set_tiling_vs_pwrite_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) +gem_shrink_SOURCES = gem_shrink.c +gem_shrink_OBJECTS = gem_shrink.$(OBJEXT) +gem_shrink_LDADD = $(LDADD) +@BUILD_TESTS_TRUE@gem_shrink_DEPENDENCIES = ../lib/libintel_tools.la \ +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) +gem_softpin_SOURCES = gem_softpin.c +gem_softpin_OBJECTS = gem_softpin.$(OBJEXT) +gem_softpin_LDADD = $(LDADD) +@BUILD_TESTS_TRUE@gem_softpin_DEPENDENCIES = ../lib/libintel_tools.la \ +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) +gem_stolen_SOURCES = gem_stolen.c +gem_stolen_OBJECTS = gem_stolen.$(OBJEXT) +gem_stolen_LDADD = $(LDADD) +@BUILD_TESTS_TRUE@gem_stolen_DEPENDENCIES = ../lib/libintel_tools.la \ +@BUILD_TESTS_TRUE@ $(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) @BUILD_TESTS_TRUE@gem_storedw_batches_loop_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) gem_storedw_loop_SOURCES = gem_storedw_loop.c gem_storedw_loop_OBJECTS = gem_storedw_loop.$(OBJEXT) gem_storedw_loop_LDADD = $(LDADD) @BUILD_TESTS_TRUE@gem_storedw_loop_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) gem_streaming_writes_SOURCES = gem_streaming_writes.c gem_streaming_writes_OBJECTS = gem_streaming_writes.$(OBJEXT) gem_streaming_writes_LDADD = $(LDADD) @BUILD_TESTS_TRUE@gem_streaming_writes_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) gem_stress_SOURCES = gem_stress.c gem_stress_OBJECTS = gem_stress.$(OBJEXT) gem_stress_LDADD = $(LDADD) @BUILD_TESTS_TRUE@gem_stress_DEPENDENCIES = ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) +gem_sync_SOURCES = gem_sync.c +gem_sync_OBJECTS = gem_sync.$(OBJEXT) +gem_sync_LDADD = $(LDADD) +@BUILD_TESTS_TRUE@gem_sync_DEPENDENCIES = ../lib/libintel_tools.la \ +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) gem_threaded_access_tiled_SOURCES = gem_threaded_access_tiled.c gem_threaded_access_tiled_OBJECTS = \ gem_threaded_access_tiled-gem_threaded_access_tiled.$(OBJEXT) @@ -1054,17 +960,13 @@ gem_tiled_blits_LDADD = $(LDADD) @BUILD_TESTS_TRUE@gem_tiled_blits_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(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) @BUILD_TESTS_TRUE@gem_tiled_fence_blits_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) gem_tiled_partial_pwrite_pread_SOURCES = \ gem_tiled_partial_pwrite_pread.c gem_tiled_partial_pwrite_pread_OBJECTS = \ @@ -1072,25 +974,19 @@ gem_tiled_partial_pwrite_pread_LDADD = $(LDADD) @BUILD_TESTS_TRUE@gem_tiled_partial_pwrite_pread_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) gem_tiled_pread_basic_SOURCES = gem_tiled_pread_basic.c gem_tiled_pread_basic_OBJECTS = gem_tiled_pread_basic.$(OBJEXT) gem_tiled_pread_basic_LDADD = $(LDADD) @BUILD_TESTS_TRUE@gem_tiled_pread_basic_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(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) @BUILD_TESTS_TRUE@gem_tiled_pread_pwrite_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) gem_tiled_swapping_SOURCES = gem_tiled_swapping.c gem_tiled_swapping_OBJECTS = \ gem_tiled_swapping-gem_tiled_swapping.$(OBJEXT) @@ -1105,42 +1001,32 @@ gem_tiled_wb_LDADD = $(LDADD) @BUILD_TESTS_TRUE@gem_tiled_wb_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) gem_tiled_wc_SOURCES = gem_tiled_wc.c gem_tiled_wc_OBJECTS = gem_tiled_wc.$(OBJEXT) gem_tiled_wc_LDADD = $(LDADD) @BUILD_TESTS_TRUE@gem_tiled_wc_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) gem_tiling_max_stride_SOURCES = gem_tiling_max_stride.c gem_tiling_max_stride_OBJECTS = gem_tiling_max_stride.$(OBJEXT) gem_tiling_max_stride_LDADD = $(LDADD) @BUILD_TESTS_TRUE@gem_tiling_max_stride_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(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) @BUILD_TESTS_TRUE@gem_unfence_active_buffers_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(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) @BUILD_TESTS_TRUE@gem_unref_active_buffers_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) gem_userptr_blits_SOURCES = gem_userptr_blits.c gem_userptr_blits_OBJECTS = \ gem_userptr_blits-gem_userptr_blits.$(OBJEXT) @@ -1158,58 +1044,44 @@ gem_workarounds_LDADD = $(LDADD) @BUILD_TESTS_TRUE@gem_workarounds_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) gem_write_read_ring_switch_SOURCES = gem_write_read_ring_switch.c gem_write_read_ring_switch_OBJECTS = \ gem_write_read_ring_switch.$(OBJEXT) gem_write_read_ring_switch_LDADD = $(LDADD) @BUILD_TESTS_TRUE@gem_write_read_ring_switch_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) gen3_mixed_blits_SOURCES = gen3_mixed_blits.c gen3_mixed_blits_OBJECTS = gen3_mixed_blits.$(OBJEXT) gen3_mixed_blits_LDADD = $(LDADD) @BUILD_TESTS_TRUE@gen3_mixed_blits_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(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) @BUILD_TESTS_TRUE@gen3_render_linear_blits_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(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) @BUILD_TESTS_TRUE@gen3_render_mixed_blits_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(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) @BUILD_TESTS_TRUE@gen3_render_tiledx_blits_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(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) @BUILD_TESTS_TRUE@gen3_render_tiledy_blits_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) gen7_forcewake_mt_SOURCES = gen7_forcewake_mt.c gen7_forcewake_mt_OBJECTS = \ gen7_forcewake_mt-gen7_forcewake_mt.$(OBJEXT) @@ -1223,72 +1095,66 @@ kms_3d_OBJECTS = kms_3d.$(OBJEXT) kms_3d_LDADD = $(LDADD) @BUILD_TESTS_TRUE@kms_3d_DEPENDENCIES = ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) kms_addfb_basic_SOURCES = kms_addfb_basic.c kms_addfb_basic_OBJECTS = kms_addfb_basic.$(OBJEXT) kms_addfb_basic_LDADD = $(LDADD) @BUILD_TESTS_TRUE@kms_addfb_basic_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) kms_atomic_SOURCES = kms_atomic.c kms_atomic_OBJECTS = kms_atomic.$(OBJEXT) kms_atomic_LDADD = $(LDADD) @BUILD_TESTS_TRUE@kms_atomic_DEPENDENCIES = ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) +kms_chv_cursor_fail_SOURCES = kms_chv_cursor_fail.c +kms_chv_cursor_fail_OBJECTS = kms_chv_cursor_fail.$(OBJEXT) +kms_chv_cursor_fail_LDADD = $(LDADD) +@BUILD_TESTS_TRUE@kms_chv_cursor_fail_DEPENDENCIES = \ +@BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) kms_crtc_background_color_SOURCES = kms_crtc_background_color.c kms_crtc_background_color_OBJECTS = \ kms_crtc_background_color.$(OBJEXT) kms_crtc_background_color_LDADD = $(LDADD) @BUILD_TESTS_TRUE@kms_crtc_background_color_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) kms_cursor_crc_SOURCES = kms_cursor_crc.c kms_cursor_crc_OBJECTS = kms_cursor_crc.$(OBJEXT) kms_cursor_crc_LDADD = $(LDADD) @BUILD_TESTS_TRUE@kms_cursor_crc_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) +kms_cursor_legacy_SOURCES = kms_cursor_legacy.c +kms_cursor_legacy_OBJECTS = kms_cursor_legacy.$(OBJEXT) +kms_cursor_legacy_LDADD = $(LDADD) +@BUILD_TESTS_TRUE@kms_cursor_legacy_DEPENDENCIES = \ +@BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) kms_draw_crc_SOURCES = kms_draw_crc.c kms_draw_crc_OBJECTS = kms_draw_crc.$(OBJEXT) kms_draw_crc_LDADD = $(LDADD) @BUILD_TESTS_TRUE@kms_draw_crc_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) kms_fbc_crc_SOURCES = kms_fbc_crc.c kms_fbc_crc_OBJECTS = kms_fbc_crc.$(OBJEXT) kms_fbc_crc_LDADD = $(LDADD) @BUILD_TESTS_TRUE@kms_fbc_crc_DEPENDENCIES = ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) kms_fbcon_fbt_SOURCES = kms_fbcon_fbt.c kms_fbcon_fbt_OBJECTS = kms_fbcon_fbt.$(OBJEXT) kms_fbcon_fbt_LDADD = $(LDADD) @BUILD_TESTS_TRUE@kms_fbcon_fbt_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) kms_fence_pin_leak_SOURCES = kms_fence_pin_leak.c kms_fence_pin_leak_OBJECTS = kms_fence_pin_leak.$(OBJEXT) kms_fence_pin_leak_LDADD = $(LDADD) @BUILD_TESTS_TRUE@kms_fence_pin_leak_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) kms_flip_SOURCES = kms_flip.c kms_flip_OBJECTS = kms_flip.$(OBJEXT) @BUILD_TESTS_TRUE@kms_flip_DEPENDENCIES = $(am__DEPENDENCIES_2) @@ -1297,164 +1163,135 @@ kms_flip_event_leak_LDADD = $(LDADD) @BUILD_TESTS_TRUE@kms_flip_event_leak_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) kms_flip_tiling_SOURCES = kms_flip_tiling.c kms_flip_tiling_OBJECTS = kms_flip_tiling.$(OBJEXT) kms_flip_tiling_LDADD = $(LDADD) @BUILD_TESTS_TRUE@kms_flip_tiling_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) -kms_force_connector_SOURCES = kms_force_connector.c -kms_force_connector_OBJECTS = kms_force_connector.$(OBJEXT) -kms_force_connector_LDADD = $(LDADD) -@BUILD_TESTS_TRUE@kms_force_connector_DEPENDENCIES = \ -@BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) +kms_force_connector_basic_SOURCES = kms_force_connector_basic.c +kms_force_connector_basic_OBJECTS = \ + kms_force_connector_basic.$(OBJEXT) +kms_force_connector_basic_LDADD = $(LDADD) +@BUILD_TESTS_TRUE@kms_force_connector_basic_DEPENDENCIES = \ +@BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) kms_frontbuffer_tracking_SOURCES = kms_frontbuffer_tracking.c kms_frontbuffer_tracking_OBJECTS = kms_frontbuffer_tracking.$(OBJEXT) kms_frontbuffer_tracking_LDADD = $(LDADD) @BUILD_TESTS_TRUE@kms_frontbuffer_tracking_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) kms_legacy_colorkey_SOURCES = kms_legacy_colorkey.c kms_legacy_colorkey_OBJECTS = kms_legacy_colorkey.$(OBJEXT) kms_legacy_colorkey_LDADD = $(LDADD) @BUILD_TESTS_TRUE@kms_legacy_colorkey_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) +kms_mmap_write_crc_SOURCES = kms_mmap_write_crc.c +kms_mmap_write_crc_OBJECTS = kms_mmap_write_crc.$(OBJEXT) +kms_mmap_write_crc_LDADD = $(LDADD) +@BUILD_TESTS_TRUE@kms_mmap_write_crc_DEPENDENCIES = \ +@BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) kms_mmio_vs_cs_flip_SOURCES = kms_mmio_vs_cs_flip.c kms_mmio_vs_cs_flip_OBJECTS = kms_mmio_vs_cs_flip.$(OBJEXT) kms_mmio_vs_cs_flip_LDADD = $(LDADD) @BUILD_TESTS_TRUE@kms_mmio_vs_cs_flip_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) kms_panel_fitting_SOURCES = kms_panel_fitting.c kms_panel_fitting_OBJECTS = kms_panel_fitting.$(OBJEXT) kms_panel_fitting_LDADD = $(LDADD) @BUILD_TESTS_TRUE@kms_panel_fitting_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) kms_pipe_b_c_ivb_SOURCES = kms_pipe_b_c_ivb.c kms_pipe_b_c_ivb_OBJECTS = kms_pipe_b_c_ivb.$(OBJEXT) kms_pipe_b_c_ivb_LDADD = $(LDADD) @BUILD_TESTS_TRUE@kms_pipe_b_c_ivb_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) +kms_pipe_color_SOURCES = kms_pipe_color.c +kms_pipe_color_OBJECTS = kms_pipe_color.$(OBJEXT) +kms_pipe_color_LDADD = $(LDADD) +@BUILD_TESTS_TRUE@kms_pipe_color_DEPENDENCIES = \ +@BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) kms_pipe_crc_basic_SOURCES = kms_pipe_crc_basic.c kms_pipe_crc_basic_OBJECTS = kms_pipe_crc_basic.$(OBJEXT) kms_pipe_crc_basic_LDADD = $(LDADD) @BUILD_TESTS_TRUE@kms_pipe_crc_basic_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) kms_plane_SOURCES = kms_plane.c kms_plane_OBJECTS = kms_plane.$(OBJEXT) kms_plane_LDADD = $(LDADD) @BUILD_TESTS_TRUE@kms_plane_DEPENDENCIES = ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) kms_plane_scaling_SOURCES = kms_plane_scaling.c kms_plane_scaling_OBJECTS = kms_plane_scaling.$(OBJEXT) kms_plane_scaling_LDADD = $(LDADD) @BUILD_TESTS_TRUE@kms_plane_scaling_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) kms_psr_sink_crc_SOURCES = kms_psr_sink_crc.c kms_psr_sink_crc_OBJECTS = kms_psr_sink_crc.$(OBJEXT) kms_psr_sink_crc_LDADD = $(LDADD) @BUILD_TESTS_TRUE@kms_psr_sink_crc_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) kms_pwrite_crc_SOURCES = kms_pwrite_crc.c kms_pwrite_crc_OBJECTS = kms_pwrite_crc.$(OBJEXT) kms_pwrite_crc_LDADD = $(LDADD) @BUILD_TESTS_TRUE@kms_pwrite_crc_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) kms_render_SOURCES = kms_render.c kms_render_OBJECTS = kms_render.$(OBJEXT) kms_render_LDADD = $(LDADD) @BUILD_TESTS_TRUE@kms_render_DEPENDENCIES = ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) kms_rotation_crc_SOURCES = kms_rotation_crc.c kms_rotation_crc_OBJECTS = kms_rotation_crc.$(OBJEXT) kms_rotation_crc_LDADD = $(LDADD) @BUILD_TESTS_TRUE@kms_rotation_crc_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) kms_setmode_SOURCES = kms_setmode.c kms_setmode_OBJECTS = kms_setmode.$(OBJEXT) kms_setmode_LDADD = $(LDADD) @BUILD_TESTS_TRUE@kms_setmode_DEPENDENCIES = ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) kms_sink_crc_basic_SOURCES = kms_sink_crc_basic.c kms_sink_crc_basic_OBJECTS = kms_sink_crc_basic.$(OBJEXT) kms_sink_crc_basic_LDADD = $(LDADD) @BUILD_TESTS_TRUE@kms_sink_crc_basic_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) kms_universal_plane_SOURCES = kms_universal_plane.c kms_universal_plane_OBJECTS = kms_universal_plane.$(OBJEXT) kms_universal_plane_LDADD = $(LDADD) @BUILD_TESTS_TRUE@kms_universal_plane_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) kms_vblank_SOURCES = kms_vblank.c kms_vblank_OBJECTS = kms_vblank.$(OBJEXT) kms_vblank_LDADD = $(LDADD) @BUILD_TESTS_TRUE@kms_vblank_DEPENDENCIES = ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) pm_backlight_SOURCES = pm_backlight.c pm_backlight_OBJECTS = pm_backlight.$(OBJEXT) pm_backlight_LDADD = $(LDADD) @BUILD_TESTS_TRUE@pm_backlight_DEPENDENCIES = \ @BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) pm_lpsp_SOURCES = pm_lpsp.c pm_lpsp_OBJECTS = pm_lpsp.$(OBJEXT) pm_lpsp_LDADD = $(LDADD) @BUILD_TESTS_TRUE@pm_lpsp_DEPENDENCIES = ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) pm_rc6_residency_SOURCES = pm_rc6_residency.c pm_rc6_residency_OBJECTS = pm_rc6_residency.$(OBJEXT) @BUILD_TESTS_TRUE@pm_rc6_residency_DEPENDENCIES = \ @@ -1463,23 +1300,34 @@ pm_rpm_OBJECTS = pm_rpm.$(OBJEXT) pm_rpm_LDADD = $(LDADD) @BUILD_TESTS_TRUE@pm_rpm_DEPENDENCIES = ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) pm_rps_SOURCES = pm_rps.c pm_rps_OBJECTS = pm_rps.$(OBJEXT) pm_rps_LDADD = $(LDADD) @BUILD_TESTS_TRUE@pm_rps_DEPENDENCIES = ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) pm_sseu_SOURCES = pm_sseu.c pm_sseu_OBJECTS = pm_sseu.$(OBJEXT) pm_sseu_LDADD = $(LDADD) @BUILD_TESTS_TRUE@pm_sseu_DEPENDENCIES = ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) +prime_mmap_SOURCES = prime_mmap.c +prime_mmap_OBJECTS = prime_mmap.$(OBJEXT) +prime_mmap_LDADD = $(LDADD) +@BUILD_TESTS_TRUE@prime_mmap_DEPENDENCIES = ../lib/libintel_tools.la \ +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) +prime_mmap_coherency_SOURCES = prime_mmap_coherency.c +prime_mmap_coherency_OBJECTS = prime_mmap_coherency.$(OBJEXT) +prime_mmap_coherency_LDADD = $(LDADD) +@BUILD_TESTS_TRUE@prime_mmap_coherency_DEPENDENCIES = \ +@BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) +prime_mmap_kms_SOURCES = prime_mmap_kms.c +prime_mmap_kms_OBJECTS = prime_mmap_kms.$(OBJEXT) +prime_mmap_kms_LDADD = $(LDADD) +@BUILD_TESTS_TRUE@prime_mmap_kms_DEPENDENCIES = \ +@BUILD_TESTS_TRUE@ ../lib/libintel_tools.la \ +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) prime_nv_api_SOURCES = prime_nv_api.c prime_nv_api_OBJECTS = prime_nv_api-prime_nv_api.$(OBJEXT) @BUILD_TESTS_TRUE@prime_nv_api_DEPENDENCIES = $(am__DEPENDENCIES_2) \ @@ -1515,24 +1363,40 @@ prime_udl_OBJECTS = prime_udl.$(OBJEXT) prime_udl_LDADD = $(LDADD) @BUILD_TESTS_TRUE@prime_udl_DEPENDENCIES = ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) template_SOURCES = template.c template_OBJECTS = template.$(OBJEXT) template_LDADD = $(LDADD) @BUILD_TESTS_TRUE@template_DEPENDENCIES = ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) am_testdisplay_OBJECTS = testdisplay.$(OBJEXT) \ testdisplay_hotplug.$(OBJEXT) testdisplay_OBJECTS = $(am_testdisplay_OBJECTS) testdisplay_LDADD = $(LDADD) @BUILD_TESTS_TRUE@testdisplay_DEPENDENCIES = ../lib/libintel_tools.la \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) +vc4_create_bo_SOURCES = vc4_create_bo.c +vc4_create_bo_OBJECTS = vc4_create_bo-vc4_create_bo.$(OBJEXT) +@BUILD_TESTS_TRUE@vc4_create_bo_DEPENDENCIES = $(am__DEPENDENCIES_2) \ +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) +vc4_create_bo_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(vc4_create_bo_CFLAGS) \ + $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +vc4_wait_bo_SOURCES = vc4_wait_bo.c +vc4_wait_bo_OBJECTS = vc4_wait_bo-vc4_wait_bo.$(OBJEXT) +@BUILD_TESTS_TRUE@vc4_wait_bo_DEPENDENCIES = $(am__DEPENDENCIES_2) \ +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) +vc4_wait_bo_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(vc4_wait_bo_CFLAGS) \ + $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +vc4_wait_seqno_SOURCES = vc4_wait_seqno.c +vc4_wait_seqno_OBJECTS = vc4_wait_seqno-vc4_wait_seqno.$(OBJEXT) +@BUILD_TESTS_TRUE@vc4_wait_seqno_DEPENDENCIES = $(am__DEPENDENCIES_2) \ +@BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_1) +vc4_wait_seqno_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(vc4_wait_seqno_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o \ + $@ am__dist_pkglibexec_SCRIPTS_DIST = debugfs_emon_crash \ drv_debugfs_reader drv_missed_irq_hang drv_module_reload_basic \ kms_sysfs_edid_timing sysfs_l3_parity test_rte_check \ @@ -1607,25 +1471,29 @@ drm_vma_limiter_cpu.c drm_vma_limiter_gtt.c \ drv_getparams_basic.c drv_hangman.c drv_suspend.c gem_alive.c \ gem_bad_address.c gem_bad_batch.c gem_bad_blit.c \ - gem_bad_length.c gem_bad_reloc.c gem_basic.c gem_caching.c \ - gem_close_race.c gem_concurrent_all.c gem_concurrent_blit.c \ - gem_cpu_reloc.c gem_cs_prefetch.c gem_cs_tlb.c \ - gem_ctx_bad_destroy.c gem_ctx_bad_exec.c gem_ctx_basic.c \ - gem_ctx_create.c gem_ctx_exec.c gem_ctx_param_basic.c \ - gem_ctx_thrash.c gem_double_irq_loop.c gem_dummy_reloc_loop.c \ - gem_eio.c gem_evict_alignment.c gem_evict_everything.c \ - gem_exec_alignment.c gem_exec_bad_domains.c gem_exec_big.c \ - gem_exec_blt.c gem_exec_faulting_reloc.c gem_exec_lut_handle.c \ - gem_exec_nop.c gem_exec_params.c gem_exec_parse.c \ + gem_bad_length.c gem_bad_reloc.c gem_basic.c gem_busy.c \ + gem_caching.c gem_close_race.c gem_concurrent_all.c \ + gem_concurrent_blit.c gem_cpu_reloc.c gem_create.c \ + gem_cs_prefetch.c gem_cs_tlb.c gem_ctx_bad_destroy.c \ + gem_ctx_bad_exec.c gem_ctx_basic.c gem_ctx_create.c \ + gem_ctx_exec.c gem_ctx_param.c gem_ctx_switch.c \ + gem_ctx_thrash.c gem_double_irq_loop.c gem_eio.c \ + gem_evict_alignment.c gem_evict_everything.c \ + gem_exec_alignment.c gem_exec_bad_domains.c gem_exec_basic.c \ + gem_exec_big.c gem_exec_blt.c gem_exec_create.c \ + gem_exec_faulting_reloc.c gem_exec_flush.c gem_exec_gttfill.c \ + gem_exec_lut_handle.c gem_exec_nop.c gem_exec_parallel.c \ + gem_exec_params.c gem_exec_parse.c gem_exec_reloc.c \ + gem_exec_store.c gem_exec_suspend.c gem_exec_whisper.c \ gem_fd_exhaustion.c gem_fence_thrash.c gem_fence_upload.c \ gem_fenced_exec_thrash.c gem_flink_basic.c gem_flink_race.c \ gem_gpgpu_fill.c gem_gtt_cpu_tlb.c gem_gtt_hog.c \ gem_gtt_speed.c gem_hang.c gem_hangcheck_forcewake.c \ gem_largeobject.c gem_linear_blits.c gem_lut_handle.c \ gem_madvise.c gem_media_fill.c gem_mmap.c gem_mmap_gtt.c \ - gem_mmap_offset_exhaustion.c gem_mmap_wc.c \ - gem_multi_bsd_sync_loop.c gem_non_secure_batch.c \ - gem_partial_pwrite_pread.c gem_persistent_relocs.c gem_pin.c \ + gem_mmap_offset_exhaustion.c gem_mmap_wc.c gem_mocs_settings.c \ + gem_non_secure_batch.c gem_partial_pwrite_pread.c \ + gem_persistent_relocs.c gem_pin.c \ gem_pipe_control_store_loop.c gem_ppgtt.c gem_pread.c \ gem_pread_after_blit.c gem_pwrite.c gem_pwrite_pread.c \ gem_pwrite_snooped.c gem_read_read_speed.c gem_readwrite.c \ @@ -1635,8 +1503,9 @@ gem_request_retire.c gem_reset_stats.c gem_ring_sync_copy.c \ gem_ring_sync_loop.c gem_ringfill.c gem_seqno_wrap.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.c gem_streaming_writes.c gem_stress.c \ + gem_set_tiling_vs_pwrite.c gem_shrink.c gem_softpin.c \ + gem_stolen.c gem_storedw_batches_loop.c gem_storedw_loop.c \ + gem_streaming_writes.c gem_stress.c gem_sync.c \ gem_threaded_access_tiled.c gem_tiled_blits.c \ gem_tiled_fence_blits.c gem_tiled_partial_pwrite_pread.c \ gem_tiled_pread_basic.c gem_tiled_pread_pwrite.c \ @@ -1647,19 +1516,24 @@ gen3_mixed_blits.c gen3_render_linear_blits.c \ gen3_render_mixed_blits.c gen3_render_tiledx_blits.c \ gen3_render_tiledy_blits.c gen7_forcewake_mt.c kms_3d.c \ - kms_addfb_basic.c kms_atomic.c kms_crtc_background_color.c \ - kms_cursor_crc.c kms_draw_crc.c kms_fbc_crc.c kms_fbcon_fbt.c \ - kms_fence_pin_leak.c kms_flip.c kms_flip_event_leak.c \ - kms_flip_tiling.c kms_force_connector.c \ - kms_frontbuffer_tracking.c kms_legacy_colorkey.c \ + kms_addfb_basic.c kms_atomic.c kms_chv_cursor_fail.c \ + kms_crtc_background_color.c kms_cursor_crc.c \ + kms_cursor_legacy.c kms_draw_crc.c kms_fbc_crc.c \ + kms_fbcon_fbt.c kms_fence_pin_leak.c kms_flip.c \ + kms_flip_event_leak.c kms_flip_tiling.c \ + kms_force_connector_basic.c kms_frontbuffer_tracking.c \ + kms_legacy_colorkey.c kms_mmap_write_crc.c \ kms_mmio_vs_cs_flip.c kms_panel_fitting.c kms_pipe_b_c_ivb.c \ - kms_pipe_crc_basic.c kms_plane.c kms_plane_scaling.c \ - kms_psr_sink_crc.c kms_pwrite_crc.c kms_render.c \ - kms_rotation_crc.c kms_setmode.c kms_sink_crc_basic.c \ - kms_universal_plane.c kms_vblank.c pm_backlight.c pm_lpsp.c \ - pm_rc6_residency.c pm_rpm.c pm_rps.c pm_sseu.c prime_nv_api.c \ - prime_nv_pcopy.c prime_nv_test.c prime_self_import.c \ - prime_udl.c template.c $(testdisplay_SOURCES) + kms_pipe_color.c kms_pipe_crc_basic.c kms_plane.c \ + kms_plane_scaling.c kms_psr_sink_crc.c kms_pwrite_crc.c \ + kms_render.c kms_rotation_crc.c kms_setmode.c \ + kms_sink_crc_basic.c kms_universal_plane.c kms_vblank.c \ + pm_backlight.c pm_lpsp.c pm_rc6_residency.c pm_rpm.c pm_rps.c \ + pm_sseu.c prime_mmap.c prime_mmap_coherency.c prime_mmap_kms.c \ + prime_nv_api.c prime_nv_pcopy.c prime_nv_test.c \ + prime_self_import.c prime_udl.c template.c \ + $(testdisplay_SOURCES) vc4_create_bo.c vc4_wait_bo.c \ + vc4_wait_seqno.c DIST_SOURCES = core_auth.c core_get_client_auth.c core_getclient.c \ core_getstats.c core_getversion.c core_prop_blob.c \ core_setmaster_vs_auth.c drm_import_export.c drm_read.c \ @@ -1667,25 +1541,29 @@ drm_vma_limiter_cpu.c drm_vma_limiter_gtt.c \ drv_getparams_basic.c drv_hangman.c drv_suspend.c gem_alive.c \ gem_bad_address.c gem_bad_batch.c gem_bad_blit.c \ - gem_bad_length.c gem_bad_reloc.c gem_basic.c gem_caching.c \ - gem_close_race.c gem_concurrent_all.c gem_concurrent_blit.c \ - gem_cpu_reloc.c gem_cs_prefetch.c gem_cs_tlb.c \ - gem_ctx_bad_destroy.c gem_ctx_bad_exec.c gem_ctx_basic.c \ - gem_ctx_create.c gem_ctx_exec.c gem_ctx_param_basic.c \ - gem_ctx_thrash.c gem_double_irq_loop.c gem_dummy_reloc_loop.c \ - gem_eio.c gem_evict_alignment.c gem_evict_everything.c \ - gem_exec_alignment.c gem_exec_bad_domains.c gem_exec_big.c \ - gem_exec_blt.c gem_exec_faulting_reloc.c gem_exec_lut_handle.c \ - gem_exec_nop.c gem_exec_params.c gem_exec_parse.c \ + gem_bad_length.c gem_bad_reloc.c gem_basic.c gem_busy.c \ + gem_caching.c gem_close_race.c gem_concurrent_all.c \ + gem_concurrent_blit.c gem_cpu_reloc.c gem_create.c \ + gem_cs_prefetch.c gem_cs_tlb.c gem_ctx_bad_destroy.c \ + gem_ctx_bad_exec.c gem_ctx_basic.c gem_ctx_create.c \ + gem_ctx_exec.c gem_ctx_param.c gem_ctx_switch.c \ + gem_ctx_thrash.c gem_double_irq_loop.c gem_eio.c \ + gem_evict_alignment.c gem_evict_everything.c \ + gem_exec_alignment.c gem_exec_bad_domains.c gem_exec_basic.c \ + gem_exec_big.c gem_exec_blt.c gem_exec_create.c \ + gem_exec_faulting_reloc.c gem_exec_flush.c gem_exec_gttfill.c \ + gem_exec_lut_handle.c gem_exec_nop.c gem_exec_parallel.c \ + gem_exec_params.c gem_exec_parse.c gem_exec_reloc.c \ + gem_exec_store.c gem_exec_suspend.c gem_exec_whisper.c \ gem_fd_exhaustion.c gem_fence_thrash.c gem_fence_upload.c \ gem_fenced_exec_thrash.c gem_flink_basic.c gem_flink_race.c \ gem_gpgpu_fill.c gem_gtt_cpu_tlb.c gem_gtt_hog.c \ gem_gtt_speed.c gem_hang.c gem_hangcheck_forcewake.c \ gem_largeobject.c gem_linear_blits.c gem_lut_handle.c \ gem_madvise.c gem_media_fill.c gem_mmap.c gem_mmap_gtt.c \ - gem_mmap_offset_exhaustion.c gem_mmap_wc.c \ - gem_multi_bsd_sync_loop.c gem_non_secure_batch.c \ - gem_partial_pwrite_pread.c gem_persistent_relocs.c gem_pin.c \ + gem_mmap_offset_exhaustion.c gem_mmap_wc.c gem_mocs_settings.c \ + gem_non_secure_batch.c gem_partial_pwrite_pread.c \ + gem_persistent_relocs.c gem_pin.c \ gem_pipe_control_store_loop.c gem_ppgtt.c gem_pread.c \ gem_pread_after_blit.c gem_pwrite.c gem_pwrite_pread.c \ gem_pwrite_snooped.c gem_read_read_speed.c gem_readwrite.c \ @@ -1695,8 +1573,9 @@ gem_request_retire.c gem_reset_stats.c gem_ring_sync_copy.c \ gem_ring_sync_loop.c gem_ringfill.c gem_seqno_wrap.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.c gem_streaming_writes.c gem_stress.c \ + gem_set_tiling_vs_pwrite.c gem_shrink.c gem_softpin.c \ + gem_stolen.c gem_storedw_batches_loop.c gem_storedw_loop.c \ + gem_streaming_writes.c gem_stress.c gem_sync.c \ gem_threaded_access_tiled.c gem_tiled_blits.c \ gem_tiled_fence_blits.c gem_tiled_partial_pwrite_pread.c \ gem_tiled_pread_basic.c gem_tiled_pread_pwrite.c \ @@ -1707,19 +1586,24 @@ gen3_mixed_blits.c gen3_render_linear_blits.c \ gen3_render_mixed_blits.c gen3_render_tiledx_blits.c \ gen3_render_tiledy_blits.c gen7_forcewake_mt.c kms_3d.c \ - kms_addfb_basic.c kms_atomic.c kms_crtc_background_color.c \ - kms_cursor_crc.c kms_draw_crc.c kms_fbc_crc.c kms_fbcon_fbt.c \ - kms_fence_pin_leak.c kms_flip.c kms_flip_event_leak.c \ - kms_flip_tiling.c kms_force_connector.c \ - kms_frontbuffer_tracking.c kms_legacy_colorkey.c \ + kms_addfb_basic.c kms_atomic.c kms_chv_cursor_fail.c \ + kms_crtc_background_color.c kms_cursor_crc.c \ + kms_cursor_legacy.c kms_draw_crc.c kms_fbc_crc.c \ + kms_fbcon_fbt.c kms_fence_pin_leak.c kms_flip.c \ + kms_flip_event_leak.c kms_flip_tiling.c \ + kms_force_connector_basic.c kms_frontbuffer_tracking.c \ + kms_legacy_colorkey.c kms_mmap_write_crc.c \ kms_mmio_vs_cs_flip.c kms_panel_fitting.c kms_pipe_b_c_ivb.c \ - kms_pipe_crc_basic.c kms_plane.c kms_plane_scaling.c \ - kms_psr_sink_crc.c kms_pwrite_crc.c kms_render.c \ - kms_rotation_crc.c kms_setmode.c kms_sink_crc_basic.c \ - kms_universal_plane.c kms_vblank.c pm_backlight.c pm_lpsp.c \ - pm_rc6_residency.c pm_rpm.c pm_rps.c pm_sseu.c prime_nv_api.c \ - prime_nv_pcopy.c prime_nv_test.c prime_self_import.c \ - prime_udl.c template.c $(testdisplay_SOURCES) + kms_pipe_color.c kms_pipe_crc_basic.c kms_plane.c \ + kms_plane_scaling.c kms_psr_sink_crc.c kms_pwrite_crc.c \ + kms_render.c kms_rotation_crc.c kms_setmode.c \ + kms_sink_crc_basic.c kms_universal_plane.c kms_vblank.c \ + pm_backlight.c pm_lpsp.c pm_rc6_residency.c pm_rpm.c pm_rps.c \ + pm_sseu.c prime_mmap.c prime_mmap_coherency.c prime_mmap_kms.c \ + prime_nv_api.c prime_nv_pcopy.c prime_nv_test.c \ + prime_self_import.c prime_udl.c template.c \ + $(testdisplay_SOURCES) vc4_create_bo.c vc4_wait_bo.c \ + vc4_wait_seqno.c am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ @@ -1783,6 +1667,8 @@ DRM_LIBS = @DRM_LIBS@ DRM_NOUVEAU_CFLAGS = @DRM_NOUVEAU_CFLAGS@ DRM_NOUVEAU_LIBS = @DRM_NOUVEAU_LIBS@ +DRM_VC4_CFLAGS = @DRM_VC4_CFLAGS@ +DRM_VC4_LIBS = @DRM_VC4_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -1827,6 +1713,7 @@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MAN_SUBSTS = @MAN_SUBSTS@ @@ -1871,6 +1758,7 @@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ THREAD_CFLAGS = @THREAD_CFLAGS@ +TIMER_LIBS = @TIMER_LIBS@ VERSION = @VERSION@ XORG_MAN_PAGE = @XORG_MAN_PAGE@ XRANDR_CFLAGS = @XRANDR_CFLAGS@ @@ -1925,11 +1813,16 @@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ +target = @target@ target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ @@ -1939,14 +1832,22 @@ prime_nv_test \ $(NULL) +VC4_TESTS_M = \ + vc4_create_bo \ + vc4_wait_bo \ + vc4_wait_seqno \ + $(NULL) + TESTS_progs_M = core_get_client_auth drv_getparams_basic drv_suspend \ - drv_hangman gem_bad_reloc gem_basic gem_caching gem_close_race \ - gem_concurrent_blit gem_concurrent_all gem_cs_tlb \ - gem_ctx_param_basic gem_ctx_bad_exec gem_ctx_exec \ - gem_dummy_reloc_loop gem_eio gem_evict_alignment \ - gem_evict_everything gem_exec_alignment gem_exec_bad_domains \ - gem_exec_faulting_reloc gem_exec_nop gem_exec_params \ - gem_exec_parse gem_fenced_exec_thrash gem_fence_thrash \ + drv_hangman gem_bad_reloc gem_basic gem_busy gem_caching \ + gem_close_race gem_concurrent_blit gem_create gem_cs_tlb \ + gem_ctx_bad_exec gem_ctx_exec gem_ctx_param gem_eio \ + gem_evict_alignment gem_evict_everything gem_exec_alignment \ + gem_exec_bad_domains gem_exec_basic gem_exec_create \ + gem_exec_faulting_reloc gem_exec_flush gem_exec_gttfill \ + gem_exec_nop gem_exec_parallel gem_exec_params gem_exec_parse \ + gem_exec_store gem_exec_suspend gem_exec_reloc \ + gem_exec_whisper gem_fenced_exec_thrash gem_fence_thrash \ gem_fence_upload gem_flink_basic gem_flink_race \ gem_linear_blits gem_madvise gem_mmap gem_mmap_gtt gem_mmap_wc \ gem_partial_pwrite_pread gem_persistent_relocs \ @@ -1955,33 +1856,40 @@ gem_pwrite_snooped gem_readwrite gem_read_read_speed \ gem_reloc_overflow gem_reloc_vs_gpu gem_render_copy_redux \ gem_request_retire gem_reset_stats gem_ringfill \ - gem_set_tiling_vs_blt gem_storedw_batches_loop \ - gem_streaming_writes gem_tiled_blits \ + gem_set_tiling_vs_blt gem_shrink gem_softpin gem_stolen \ + gem_storedw_batches_loop gem_streaming_writes gem_tiled_blits \ gem_tiled_partial_pwrite_pread gem_userptr_blits \ gem_write_read_ring_switch kms_addfb_basic kms_atomic \ - kms_cursor_crc kms_draw_crc kms_fbc_crc kms_fbcon_fbt kms_flip \ + kms_chv_cursor_fail kms_cursor_crc kms_cursor_legacy \ + kms_draw_crc kms_fbc_crc kms_fbcon_fbt kms_flip \ kms_flip_event_leak kms_flip_tiling kms_frontbuffer_tracking \ kms_legacy_colorkey kms_mmio_vs_cs_flip kms_pipe_b_c_ivb \ - kms_pipe_crc_basic kms_plane kms_psr_sink_crc kms_render \ - kms_rotation_crc kms_setmode kms_universal_plane kms_vblank \ - kms_crtc_background_color kms_plane_scaling kms_panel_fitting \ - pm_backlight pm_lpsp pm_rpm pm_rps pm_rc6_residency pm_sseu \ - prime_self_import template $(NULL) $(am__append_1) + kms_pipe_color kms_pipe_crc_basic kms_plane kms_psr_sink_crc \ + kms_render kms_rotation_crc kms_setmode kms_universal_plane \ + kms_vblank kms_crtc_background_color kms_plane_scaling \ + kms_panel_fitting pm_backlight pm_lpsp pm_rpm pm_rps \ + pm_rc6_residency pm_sseu prime_mmap prime_mmap_coherency \ + prime_mmap_kms prime_self_import template $(NULL) \ + $(am__append_1) $(am__append_2) +TESTS_progs_XM = \ + gem_concurrent_all \ + $(NULL) + TESTS_progs = core_auth core_getclient core_getstats core_getversion \ core_prop_blob core_setmaster_vs_auth drm_import_export \ drm_read drm_vma_limiter drm_vma_limiter_cached \ drm_vma_limiter_cpu drm_vma_limiter_gtt gem_bad_length \ gem_cpu_reloc gem_cs_prefetch gem_ctx_bad_destroy \ - gem_ctx_basic gem_ctx_create gem_ctx_thrash \ + gem_ctx_basic gem_ctx_create gem_ctx_switch gem_ctx_thrash \ gem_double_irq_loop gem_exec_big gem_exec_blt \ gem_exec_lut_handle gem_fd_exhaustion gem_gtt_cpu_tlb \ gem_gtt_hog gem_gtt_speed gem_hangcheck_forcewake \ gem_largeobject gem_lut_handle gem_mmap_offset_exhaustion \ - gem_media_fill gem_gpgpu_fill gem_pin gem_reg_read \ - gem_render_copy gem_render_linear_blits gem_render_tiled_blits \ - gem_ring_sync_copy gem_ring_sync_loop gem_multi_bsd_sync_loop \ + gem_media_fill gem_mocs_settings gem_gpgpu_fill gem_pin \ + gem_reg_read gem_render_copy gem_render_linear_blits \ + gem_render_tiled_blits gem_ring_sync_copy gem_ring_sync_loop \ gem_seqno_wrap gem_set_tiling_vs_gtt gem_set_tiling_vs_pwrite \ - gem_storedw_loop gem_threaded_access_tiled \ + gem_storedw_loop gem_sync gem_threaded_access_tiled \ gem_tiled_fence_blits gem_tiled_pread_basic \ gem_tiled_pread_pwrite gem_tiled_swapping gem_tiled_wb \ gem_tiled_wc gem_tiling_max_stride gem_unfence_active_buffers \ @@ -1989,8 +1897,9 @@ gen3_mixed_blits gen3_render_linear_blits \ gen3_render_mixed_blits gen3_render_tiledx_blits \ gen3_render_tiledy_blits gen7_forcewake_mt kms_3d \ - kms_fence_pin_leak kms_force_connector kms_pwrite_crc \ - kms_sink_crc_basic prime_udl $(NULL) testdisplay + kms_fence_pin_leak kms_force_connector_basic \ + kms_mmap_write_crc kms_pwrite_crc kms_sink_crc_basic prime_udl \ + $(NULL) testdisplay # IMPORTANT: The ZZ_ tests need to be run last! # ... and make can't deal with inlined comments ... @@ -2021,6 +1930,14 @@ $(NULL) +# This target contains testcases with lots of subtests. +# It was split from multi_kernel_tests because of the overhead of listing all +# the subtests in piglit +extra_multi_kernel_tests = \ + $(TESTS_progs_XM) \ + $(NULL) + + # This target is for simple testcase which don't expose any subtest. # # Your testcase should probably use igt_simple_main, but none of the other magic @@ -2035,6 +1952,12 @@ $(multi_kernel_tests) \ $(NULL) +kernel_tests_full = \ + $(single_kernel_tests) \ + $(multi_kernel_tests) \ + $(extra_multi_kernel_tests) \ + $(NULL) + # Test that exercise specific asserts in the test framework library and are # hence expected to fail. @@ -2083,20 +2006,19 @@ @BUILD_TESTS_TRUE@ $(IMAGES) \ @BUILD_TESTS_TRUE@ $(NULL) -@BUILD_TESTS_TRUE@pkgdata_DATA = test-list.txt +@BUILD_TESTS_TRUE@pkgdata_DATA = test-list.txt test-list-full.txt @BUILD_TESTS_TRUE@EXTRA_DIST = $(common_files) -@BUILD_TESTS_TRUE@CLEANFILES = $(EXTRA_PROGRAMS) test-list.txt +@BUILD_TESTS_TRUE@CLEANFILES = $(EXTRA_PROGRAMS) test-list.txt test-list-full.txt .gitignore @BUILD_TESTS_TRUE@AM_CFLAGS = $(DRM_CFLAGS) $(CWARNFLAGS) \ @BUILD_TESTS_TRUE@ $(DEBUG_CFLAGS) -I$(srcdir)/.. \ @BUILD_TESTS_TRUE@ -I$(srcdir)/../lib -include \ @BUILD_TESTS_TRUE@ "$(srcdir)/../lib/check-ndebug.h" \ @BUILD_TESTS_TRUE@ -DIGT_SRCDIR=\""$(abs_srcdir)"\" \ @BUILD_TESTS_TRUE@ -DIGT_DATADIR=\""$(pkgdatadir)"\" \ -@BUILD_TESTS_TRUE@ $(LIBUNWIND_CFLAGS) $(NULL) $(CAIRO_CFLAGS) \ -@BUILD_TESTS_TRUE@ $(LIBUDEV_CFLAGS) $(GLIB_CFLAGS) -@BUILD_TESTS_TRUE@LDADD = ../lib/libintel_tools.la $(PCIACCESS_LIBS) \ -@BUILD_TESTS_TRUE@ $(DRM_LIBS) $(LIBUNWIND_LIBS) $(CAIRO_LIBS) \ -@BUILD_TESTS_TRUE@ $(LIBUDEV_LIBS) $(GLIB_LIBS) -lm +@BUILD_TESTS_TRUE@ $(LIBUNWIND_CFLAGS) $(WERROR_CFLAGS) $(NULL) \ +@BUILD_TESTS_TRUE@ $(CAIRO_CFLAGS) $(LIBUDEV_CFLAGS) \ +@BUILD_TESTS_TRUE@ $(GLIB_CFLAGS) +@BUILD_TESTS_TRUE@LDADD = ../lib/libintel_tools.la $(GLIB_LIBS) @BUILD_TESTS_TRUE@AM_LDFLAGS = -Wl,--as-needed @BUILD_TESTS_TRUE@drm_import_export_CFLAGS = $(AM_CFLAGS) $(THREAD_CFLAGS) @BUILD_TESTS_TRUE@drm_import_export_LDADD = $(LDADD) -lpthread @@ -2106,6 +2028,8 @@ @BUILD_TESTS_TRUE@gem_ctx_basic_LDADD = $(LDADD) -lpthread @BUILD_TESTS_TRUE@gem_ctx_thrash_CFLAGS = $(AM_CFLAGS) $(THREAD_CFLAGS) @BUILD_TESTS_TRUE@gem_ctx_thrash_LDADD = $(LDADD) -lpthread +@BUILD_TESTS_TRUE@gem_exec_parallel_CFLAGS = $(AM_CFLAGS) $(THREAD_CFLAGS) +@BUILD_TESTS_TRUE@gem_exec_parallel_LDADD = $(LDADD) -lpthread @BUILD_TESTS_TRUE@gem_fence_thrash_CFLAGS = $(AM_CFLAGS) $(THREAD_CFLAGS) @BUILD_TESTS_TRUE@gem_fence_thrash_LDADD = $(LDADD) -lpthread @BUILD_TESTS_TRUE@gem_fence_upload_CFLAGS = $(AM_CFLAGS) $(THREAD_CFLAGS) @@ -2135,6 +2059,12 @@ @BUILD_TESTS_TRUE@prime_nv_api_LDADD = $(LDADD) $(DRM_NOUVEAU_LIBS) @BUILD_TESTS_TRUE@prime_nv_pcopy_CFLAGS = $(AM_CFLAGS) $(DRM_NOUVEAU_CFLAGS) @BUILD_TESTS_TRUE@prime_nv_pcopy_LDADD = $(LDADD) $(DRM_NOUVEAU_LIBS) +@BUILD_TESTS_TRUE@vc4_create_bo_CFLAGS = $(AM_CFLAGS) $(DRM_VC4_CFLAGS) +@BUILD_TESTS_TRUE@vc4_create_bo_LDADD = $(LDADD) $(DRM_VC4_LIBS) +@BUILD_TESTS_TRUE@vc4_wait_bo_CFLAGS = $(AM_CFLAGS) $(DRM_VC4_CFLAGS) +@BUILD_TESTS_TRUE@vc4_wait_bo_LDADD = $(LDADD) $(DRM_VC4_LIBS) +@BUILD_TESTS_TRUE@vc4_wait_seqno_CFLAGS = $(AM_CFLAGS) $(DRM_VC4_CFLAGS) +@BUILD_TESTS_TRUE@vc4_wait_seqno_LDADD = $(LDADD) $(DRM_VC4_LIBS) all: all-am .SUFFIXES: @@ -2320,6 +2250,10 @@ @rm -f gem_basic$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gem_basic_OBJECTS) $(gem_basic_LDADD) $(LIBS) +gem_busy$(EXEEXT): $(gem_busy_OBJECTS) $(gem_busy_DEPENDENCIES) $(EXTRA_gem_busy_DEPENDENCIES) + @rm -f gem_busy$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(gem_busy_OBJECTS) $(gem_busy_LDADD) $(LIBS) + gem_caching$(EXEEXT): $(gem_caching_OBJECTS) $(gem_caching_DEPENDENCIES) $(EXTRA_gem_caching_DEPENDENCIES) @rm -f gem_caching$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gem_caching_OBJECTS) $(gem_caching_LDADD) $(LIBS) @@ -2340,6 +2274,10 @@ @rm -f gem_cpu_reloc$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gem_cpu_reloc_OBJECTS) $(gem_cpu_reloc_LDADD) $(LIBS) +gem_create$(EXEEXT): $(gem_create_OBJECTS) $(gem_create_DEPENDENCIES) $(EXTRA_gem_create_DEPENDENCIES) + @rm -f gem_create$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(gem_create_OBJECTS) $(gem_create_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) @@ -2368,9 +2306,13 @@ @rm -f gem_ctx_exec$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gem_ctx_exec_OBJECTS) $(gem_ctx_exec_LDADD) $(LIBS) -gem_ctx_param_basic$(EXEEXT): $(gem_ctx_param_basic_OBJECTS) $(gem_ctx_param_basic_DEPENDENCIES) $(EXTRA_gem_ctx_param_basic_DEPENDENCIES) - @rm -f gem_ctx_param_basic$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(gem_ctx_param_basic_OBJECTS) $(gem_ctx_param_basic_LDADD) $(LIBS) +gem_ctx_param$(EXEEXT): $(gem_ctx_param_OBJECTS) $(gem_ctx_param_DEPENDENCIES) $(EXTRA_gem_ctx_param_DEPENDENCIES) + @rm -f gem_ctx_param$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(gem_ctx_param_OBJECTS) $(gem_ctx_param_LDADD) $(LIBS) + +gem_ctx_switch$(EXEEXT): $(gem_ctx_switch_OBJECTS) $(gem_ctx_switch_DEPENDENCIES) $(EXTRA_gem_ctx_switch_DEPENDENCIES) + @rm -f gem_ctx_switch$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(gem_ctx_switch_OBJECTS) $(gem_ctx_switch_LDADD) $(LIBS) gem_ctx_thrash$(EXEEXT): $(gem_ctx_thrash_OBJECTS) $(gem_ctx_thrash_DEPENDENCIES) $(EXTRA_gem_ctx_thrash_DEPENDENCIES) @rm -f gem_ctx_thrash$(EXEEXT) @@ -2380,10 +2322,6 @@ @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_eio$(EXEEXT): $(gem_eio_OBJECTS) $(gem_eio_DEPENDENCIES) $(EXTRA_gem_eio_DEPENDENCIES) @rm -f gem_eio$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gem_eio_OBJECTS) $(gem_eio_LDADD) $(LIBS) @@ -2404,6 +2342,10 @@ @rm -f gem_exec_bad_domains$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gem_exec_bad_domains_OBJECTS) $(gem_exec_bad_domains_LDADD) $(LIBS) +gem_exec_basic$(EXEEXT): $(gem_exec_basic_OBJECTS) $(gem_exec_basic_DEPENDENCIES) $(EXTRA_gem_exec_basic_DEPENDENCIES) + @rm -f gem_exec_basic$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(gem_exec_basic_OBJECTS) $(gem_exec_basic_LDADD) $(LIBS) + gem_exec_big$(EXEEXT): $(gem_exec_big_OBJECTS) $(gem_exec_big_DEPENDENCIES) $(EXTRA_gem_exec_big_DEPENDENCIES) @rm -f gem_exec_big$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gem_exec_big_OBJECTS) $(gem_exec_big_LDADD) $(LIBS) @@ -2412,10 +2354,22 @@ @rm -f gem_exec_blt$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gem_exec_blt_OBJECTS) $(gem_exec_blt_LDADD) $(LIBS) +gem_exec_create$(EXEEXT): $(gem_exec_create_OBJECTS) $(gem_exec_create_DEPENDENCIES) $(EXTRA_gem_exec_create_DEPENDENCIES) + @rm -f gem_exec_create$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(gem_exec_create_OBJECTS) $(gem_exec_create_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_flush$(EXEEXT): $(gem_exec_flush_OBJECTS) $(gem_exec_flush_DEPENDENCIES) $(EXTRA_gem_exec_flush_DEPENDENCIES) + @rm -f gem_exec_flush$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(gem_exec_flush_OBJECTS) $(gem_exec_flush_LDADD) $(LIBS) + +gem_exec_gttfill$(EXEEXT): $(gem_exec_gttfill_OBJECTS) $(gem_exec_gttfill_DEPENDENCIES) $(EXTRA_gem_exec_gttfill_DEPENDENCIES) + @rm -f gem_exec_gttfill$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(gem_exec_gttfill_OBJECTS) $(gem_exec_gttfill_LDADD) $(LIBS) + gem_exec_lut_handle$(EXEEXT): $(gem_exec_lut_handle_OBJECTS) $(gem_exec_lut_handle_DEPENDENCIES) $(EXTRA_gem_exec_lut_handle_DEPENDENCIES) @rm -f gem_exec_lut_handle$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gem_exec_lut_handle_OBJECTS) $(gem_exec_lut_handle_LDADD) $(LIBS) @@ -2424,6 +2378,10 @@ @rm -f gem_exec_nop$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gem_exec_nop_OBJECTS) $(gem_exec_nop_LDADD) $(LIBS) +gem_exec_parallel$(EXEEXT): $(gem_exec_parallel_OBJECTS) $(gem_exec_parallel_DEPENDENCIES) $(EXTRA_gem_exec_parallel_DEPENDENCIES) + @rm -f gem_exec_parallel$(EXEEXT) + $(AM_V_CCLD)$(gem_exec_parallel_LINK) $(gem_exec_parallel_OBJECTS) $(gem_exec_parallel_LDADD) $(LIBS) + gem_exec_params$(EXEEXT): $(gem_exec_params_OBJECTS) $(gem_exec_params_DEPENDENCIES) $(EXTRA_gem_exec_params_DEPENDENCIES) @rm -f gem_exec_params$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gem_exec_params_OBJECTS) $(gem_exec_params_LDADD) $(LIBS) @@ -2432,6 +2390,22 @@ @rm -f gem_exec_parse$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gem_exec_parse_OBJECTS) $(gem_exec_parse_LDADD) $(LIBS) +gem_exec_reloc$(EXEEXT): $(gem_exec_reloc_OBJECTS) $(gem_exec_reloc_DEPENDENCIES) $(EXTRA_gem_exec_reloc_DEPENDENCIES) + @rm -f gem_exec_reloc$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(gem_exec_reloc_OBJECTS) $(gem_exec_reloc_LDADD) $(LIBS) + +gem_exec_store$(EXEEXT): $(gem_exec_store_OBJECTS) $(gem_exec_store_DEPENDENCIES) $(EXTRA_gem_exec_store_DEPENDENCIES) + @rm -f gem_exec_store$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(gem_exec_store_OBJECTS) $(gem_exec_store_LDADD) $(LIBS) + +gem_exec_suspend$(EXEEXT): $(gem_exec_suspend_OBJECTS) $(gem_exec_suspend_DEPENDENCIES) $(EXTRA_gem_exec_suspend_DEPENDENCIES) + @rm -f gem_exec_suspend$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(gem_exec_suspend_OBJECTS) $(gem_exec_suspend_LDADD) $(LIBS) + +gem_exec_whisper$(EXEEXT): $(gem_exec_whisper_OBJECTS) $(gem_exec_whisper_DEPENDENCIES) $(EXTRA_gem_exec_whisper_DEPENDENCIES) + @rm -f gem_exec_whisper$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(gem_exec_whisper_OBJECTS) $(gem_exec_whisper_LDADD) $(LIBS) + gem_fd_exhaustion$(EXEEXT): $(gem_fd_exhaustion_OBJECTS) $(gem_fd_exhaustion_DEPENDENCIES) $(EXTRA_gem_fd_exhaustion_DEPENDENCIES) @rm -f gem_fd_exhaustion$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gem_fd_exhaustion_OBJECTS) $(gem_fd_exhaustion_LDADD) $(LIBS) @@ -2516,9 +2490,9 @@ @rm -f gem_mmap_wc$(EXEEXT) $(AM_V_CCLD)$(gem_mmap_wc_LINK) $(gem_mmap_wc_OBJECTS) $(gem_mmap_wc_LDADD) $(LIBS) -gem_multi_bsd_sync_loop$(EXEEXT): $(gem_multi_bsd_sync_loop_OBJECTS) $(gem_multi_bsd_sync_loop_DEPENDENCIES) $(EXTRA_gem_multi_bsd_sync_loop_DEPENDENCIES) - @rm -f gem_multi_bsd_sync_loop$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(gem_multi_bsd_sync_loop_OBJECTS) $(gem_multi_bsd_sync_loop_LDADD) $(LIBS) +gem_mocs_settings$(EXEEXT): $(gem_mocs_settings_OBJECTS) $(gem_mocs_settings_DEPENDENCIES) $(EXTRA_gem_mocs_settings_DEPENDENCIES) + @rm -f gem_mocs_settings$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(gem_mocs_settings_OBJECTS) $(gem_mocs_settings_LDADD) $(LIBS) gem_non_secure_batch$(EXEEXT): $(gem_non_secure_batch_OBJECTS) $(gem_non_secure_batch_DEPENDENCIES) $(EXTRA_gem_non_secure_batch_DEPENDENCIES) @rm -f gem_non_secure_batch$(EXEEXT) @@ -2636,6 +2610,18 @@ @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_shrink$(EXEEXT): $(gem_shrink_OBJECTS) $(gem_shrink_DEPENDENCIES) $(EXTRA_gem_shrink_DEPENDENCIES) + @rm -f gem_shrink$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(gem_shrink_OBJECTS) $(gem_shrink_LDADD) $(LIBS) + +gem_softpin$(EXEEXT): $(gem_softpin_OBJECTS) $(gem_softpin_DEPENDENCIES) $(EXTRA_gem_softpin_DEPENDENCIES) + @rm -f gem_softpin$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(gem_softpin_OBJECTS) $(gem_softpin_LDADD) $(LIBS) + +gem_stolen$(EXEEXT): $(gem_stolen_OBJECTS) $(gem_stolen_DEPENDENCIES) $(EXTRA_gem_stolen_DEPENDENCIES) + @rm -f gem_stolen$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(gem_stolen_OBJECTS) $(gem_stolen_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) @@ -2652,6 +2638,10 @@ @rm -f gem_stress$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gem_stress_OBJECTS) $(gem_stress_LDADD) $(LIBS) +gem_sync$(EXEEXT): $(gem_sync_OBJECTS) $(gem_sync_DEPENDENCIES) $(EXTRA_gem_sync_DEPENDENCIES) + @rm -f gem_sync$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(gem_sync_OBJECTS) $(gem_sync_LDADD) $(LIBS) + gem_threaded_access_tiled$(EXEEXT): $(gem_threaded_access_tiled_OBJECTS) $(gem_threaded_access_tiled_DEPENDENCIES) $(EXTRA_gem_threaded_access_tiled_DEPENDENCIES) @rm -f gem_threaded_access_tiled$(EXEEXT) $(AM_V_CCLD)$(gem_threaded_access_tiled_LINK) $(gem_threaded_access_tiled_OBJECTS) $(gem_threaded_access_tiled_LDADD) $(LIBS) @@ -2752,6 +2742,10 @@ @rm -f kms_atomic$(EXEEXT) $(AM_V_CCLD)$(LINK) $(kms_atomic_OBJECTS) $(kms_atomic_LDADD) $(LIBS) +kms_chv_cursor_fail$(EXEEXT): $(kms_chv_cursor_fail_OBJECTS) $(kms_chv_cursor_fail_DEPENDENCIES) $(EXTRA_kms_chv_cursor_fail_DEPENDENCIES) + @rm -f kms_chv_cursor_fail$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(kms_chv_cursor_fail_OBJECTS) $(kms_chv_cursor_fail_LDADD) $(LIBS) + kms_crtc_background_color$(EXEEXT): $(kms_crtc_background_color_OBJECTS) $(kms_crtc_background_color_DEPENDENCIES) $(EXTRA_kms_crtc_background_color_DEPENDENCIES) @rm -f kms_crtc_background_color$(EXEEXT) $(AM_V_CCLD)$(LINK) $(kms_crtc_background_color_OBJECTS) $(kms_crtc_background_color_LDADD) $(LIBS) @@ -2760,6 +2754,10 @@ @rm -f kms_cursor_crc$(EXEEXT) $(AM_V_CCLD)$(LINK) $(kms_cursor_crc_OBJECTS) $(kms_cursor_crc_LDADD) $(LIBS) +kms_cursor_legacy$(EXEEXT): $(kms_cursor_legacy_OBJECTS) $(kms_cursor_legacy_DEPENDENCIES) $(EXTRA_kms_cursor_legacy_DEPENDENCIES) + @rm -f kms_cursor_legacy$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(kms_cursor_legacy_OBJECTS) $(kms_cursor_legacy_LDADD) $(LIBS) + kms_draw_crc$(EXEEXT): $(kms_draw_crc_OBJECTS) $(kms_draw_crc_DEPENDENCIES) $(EXTRA_kms_draw_crc_DEPENDENCIES) @rm -f kms_draw_crc$(EXEEXT) $(AM_V_CCLD)$(LINK) $(kms_draw_crc_OBJECTS) $(kms_draw_crc_LDADD) $(LIBS) @@ -2788,9 +2786,9 @@ @rm -f kms_flip_tiling$(EXEEXT) $(AM_V_CCLD)$(LINK) $(kms_flip_tiling_OBJECTS) $(kms_flip_tiling_LDADD) $(LIBS) -kms_force_connector$(EXEEXT): $(kms_force_connector_OBJECTS) $(kms_force_connector_DEPENDENCIES) $(EXTRA_kms_force_connector_DEPENDENCIES) - @rm -f kms_force_connector$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(kms_force_connector_OBJECTS) $(kms_force_connector_LDADD) $(LIBS) +kms_force_connector_basic$(EXEEXT): $(kms_force_connector_basic_OBJECTS) $(kms_force_connector_basic_DEPENDENCIES) $(EXTRA_kms_force_connector_basic_DEPENDENCIES) + @rm -f kms_force_connector_basic$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(kms_force_connector_basic_OBJECTS) $(kms_force_connector_basic_LDADD) $(LIBS) kms_frontbuffer_tracking$(EXEEXT): $(kms_frontbuffer_tracking_OBJECTS) $(kms_frontbuffer_tracking_DEPENDENCIES) $(EXTRA_kms_frontbuffer_tracking_DEPENDENCIES) @rm -f kms_frontbuffer_tracking$(EXEEXT) @@ -2800,6 +2798,10 @@ @rm -f kms_legacy_colorkey$(EXEEXT) $(AM_V_CCLD)$(LINK) $(kms_legacy_colorkey_OBJECTS) $(kms_legacy_colorkey_LDADD) $(LIBS) +kms_mmap_write_crc$(EXEEXT): $(kms_mmap_write_crc_OBJECTS) $(kms_mmap_write_crc_DEPENDENCIES) $(EXTRA_kms_mmap_write_crc_DEPENDENCIES) + @rm -f kms_mmap_write_crc$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(kms_mmap_write_crc_OBJECTS) $(kms_mmap_write_crc_LDADD) $(LIBS) + kms_mmio_vs_cs_flip$(EXEEXT): $(kms_mmio_vs_cs_flip_OBJECTS) $(kms_mmio_vs_cs_flip_DEPENDENCIES) $(EXTRA_kms_mmio_vs_cs_flip_DEPENDENCIES) @rm -f kms_mmio_vs_cs_flip$(EXEEXT) $(AM_V_CCLD)$(LINK) $(kms_mmio_vs_cs_flip_OBJECTS) $(kms_mmio_vs_cs_flip_LDADD) $(LIBS) @@ -2812,6 +2814,10 @@ @rm -f kms_pipe_b_c_ivb$(EXEEXT) $(AM_V_CCLD)$(LINK) $(kms_pipe_b_c_ivb_OBJECTS) $(kms_pipe_b_c_ivb_LDADD) $(LIBS) +kms_pipe_color$(EXEEXT): $(kms_pipe_color_OBJECTS) $(kms_pipe_color_DEPENDENCIES) $(EXTRA_kms_pipe_color_DEPENDENCIES) + @rm -f kms_pipe_color$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(kms_pipe_color_OBJECTS) $(kms_pipe_color_LDADD) $(LIBS) + kms_pipe_crc_basic$(EXEEXT): $(kms_pipe_crc_basic_OBJECTS) $(kms_pipe_crc_basic_DEPENDENCIES) $(EXTRA_kms_pipe_crc_basic_DEPENDENCIES) @rm -f kms_pipe_crc_basic$(EXEEXT) $(AM_V_CCLD)$(LINK) $(kms_pipe_crc_basic_OBJECTS) $(kms_pipe_crc_basic_LDADD) $(LIBS) @@ -2880,6 +2886,18 @@ @rm -f pm_sseu$(EXEEXT) $(AM_V_CCLD)$(LINK) $(pm_sseu_OBJECTS) $(pm_sseu_LDADD) $(LIBS) +prime_mmap$(EXEEXT): $(prime_mmap_OBJECTS) $(prime_mmap_DEPENDENCIES) $(EXTRA_prime_mmap_DEPENDENCIES) + @rm -f prime_mmap$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(prime_mmap_OBJECTS) $(prime_mmap_LDADD) $(LIBS) + +prime_mmap_coherency$(EXEEXT): $(prime_mmap_coherency_OBJECTS) $(prime_mmap_coherency_DEPENDENCIES) $(EXTRA_prime_mmap_coherency_DEPENDENCIES) + @rm -f prime_mmap_coherency$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(prime_mmap_coherency_OBJECTS) $(prime_mmap_coherency_LDADD) $(LIBS) + +prime_mmap_kms$(EXEEXT): $(prime_mmap_kms_OBJECTS) $(prime_mmap_kms_DEPENDENCIES) $(EXTRA_prime_mmap_kms_DEPENDENCIES) + @rm -f prime_mmap_kms$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(prime_mmap_kms_OBJECTS) $(prime_mmap_kms_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) @@ -2907,6 +2925,18 @@ testdisplay$(EXEEXT): $(testdisplay_OBJECTS) $(testdisplay_DEPENDENCIES) $(EXTRA_testdisplay_DEPENDENCIES) @rm -f testdisplay$(EXEEXT) $(AM_V_CCLD)$(LINK) $(testdisplay_OBJECTS) $(testdisplay_LDADD) $(LIBS) + +vc4_create_bo$(EXEEXT): $(vc4_create_bo_OBJECTS) $(vc4_create_bo_DEPENDENCIES) $(EXTRA_vc4_create_bo_DEPENDENCIES) + @rm -f vc4_create_bo$(EXEEXT) + $(AM_V_CCLD)$(vc4_create_bo_LINK) $(vc4_create_bo_OBJECTS) $(vc4_create_bo_LDADD) $(LIBS) + +vc4_wait_bo$(EXEEXT): $(vc4_wait_bo_OBJECTS) $(vc4_wait_bo_DEPENDENCIES) $(EXTRA_vc4_wait_bo_DEPENDENCIES) + @rm -f vc4_wait_bo$(EXEEXT) + $(AM_V_CCLD)$(vc4_wait_bo_LINK) $(vc4_wait_bo_OBJECTS) $(vc4_wait_bo_LDADD) $(LIBS) + +vc4_wait_seqno$(EXEEXT): $(vc4_wait_seqno_OBJECTS) $(vc4_wait_seqno_DEPENDENCIES) $(EXTRA_vc4_wait_seqno_DEPENDENCIES) + @rm -f vc4_wait_seqno$(EXEEXT) + $(AM_V_CCLD)$(vc4_wait_seqno_LINK) $(vc4_wait_seqno_OBJECTS) $(vc4_wait_seqno_LDADD) $(LIBS) install-dist_pkglibexecSCRIPTS: $(dist_pkglibexec_SCRIPTS) @$(NORMAL_INSTALL) @list='$(dist_pkglibexec_SCRIPTS)'; test -n "$(pkglibexecdir)" || list=; \ @@ -2972,11 +3002,13 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_bad_length.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_bad_reloc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_basic.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_busy.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_caching.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_close_race-gem_close_race.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_concurrent_all.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_concurrent_blit.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_cpu_reloc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_create.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_cs_prefetch.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_cs_tlb.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_ctx_bad_destroy.Po@am__quote@ @@ -2984,22 +3016,31 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_ctx_basic-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_ctx_param_basic.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_ctx_param.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_ctx_switch.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_ctx_thrash-gem_ctx_thrash.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_eio.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_evict_alignment.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_evict_everything.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_exec_alignment.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_basic.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_exec_big.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_create.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_flush.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_exec_gttfill.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_exec_lut_handle.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_exec_nop.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_exec_parallel-gem_exec_parallel.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_exec_params.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_exec_parse.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_exec_reloc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_exec_store.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_exec_suspend.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_exec_whisper.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_fd_exhaustion.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_fence_upload-gem_fence_upload.Po@am__quote@ @@ -3021,7 +3062,7 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_mmap_gtt-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_mmap_wc-gem_mmap_wc.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_multi_bsd_sync_loop.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_mocs_settings.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_non_secure_batch.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_persistent_relocs.Po@am__quote@ @@ -3051,10 +3092,14 @@ @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_shrink.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_softpin.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_stolen.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.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_streaming_writes.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_stress.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_sync.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_threaded_access_tiled-gem_threaded_access_tiled.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@ @@ -3080,8 +3125,10 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kms_3d.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kms_addfb_basic.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kms_atomic.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kms_chv_cursor_fail.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kms_crtc_background_color.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kms_cursor_crc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kms_cursor_legacy.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kms_draw_crc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kms_fbc_crc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kms_fbcon_fbt.Po@am__quote@ @@ -3089,12 +3136,14 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kms_flip.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kms_flip_event_leak.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kms_flip_tiling.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kms_force_connector.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kms_force_connector_basic.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kms_frontbuffer_tracking.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kms_legacy_colorkey.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kms_mmap_write_crc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kms_mmio_vs_cs_flip.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kms_panel_fitting.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kms_pipe_b_c_ivb.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kms_pipe_color.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kms_pipe_crc_basic.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kms_plane.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kms_plane_scaling.Po@am__quote@ @@ -3112,6 +3161,9 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pm_rpm.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pm_rps.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pm_sseu.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prime_mmap.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prime_mmap_coherency.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prime_mmap_kms.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@ @@ -3120,6 +3172,9 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/template.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@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vc4_create_bo-vc4_create_bo.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vc4_wait_bo-vc4_wait_bo.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vc4_wait_seqno-vc4_wait_seqno.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @@ -3201,6 +3256,20 @@ @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_ctx_thrash_CFLAGS) $(CFLAGS) -c -o gem_ctx_thrash-gem_ctx_thrash.obj `if test -f 'gem_ctx_thrash.c'; then $(CYGPATH_W) 'gem_ctx_thrash.c'; else $(CYGPATH_W) '$(srcdir)/gem_ctx_thrash.c'; fi` +gem_exec_parallel-gem_exec_parallel.o: gem_exec_parallel.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gem_exec_parallel_CFLAGS) $(CFLAGS) -MT gem_exec_parallel-gem_exec_parallel.o -MD -MP -MF $(DEPDIR)/gem_exec_parallel-gem_exec_parallel.Tpo -c -o gem_exec_parallel-gem_exec_parallel.o `test -f 'gem_exec_parallel.c' || echo '$(srcdir)/'`gem_exec_parallel.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/gem_exec_parallel-gem_exec_parallel.Tpo $(DEPDIR)/gem_exec_parallel-gem_exec_parallel.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gem_exec_parallel.c' object='gem_exec_parallel-gem_exec_parallel.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_exec_parallel_CFLAGS) $(CFLAGS) -c -o gem_exec_parallel-gem_exec_parallel.o `test -f 'gem_exec_parallel.c' || echo '$(srcdir)/'`gem_exec_parallel.c + +gem_exec_parallel-gem_exec_parallel.obj: gem_exec_parallel.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gem_exec_parallel_CFLAGS) $(CFLAGS) -MT gem_exec_parallel-gem_exec_parallel.obj -MD -MP -MF $(DEPDIR)/gem_exec_parallel-gem_exec_parallel.Tpo -c -o gem_exec_parallel-gem_exec_parallel.obj `if test -f 'gem_exec_parallel.c'; then $(CYGPATH_W) 'gem_exec_parallel.c'; else $(CYGPATH_W) '$(srcdir)/gem_exec_parallel.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/gem_exec_parallel-gem_exec_parallel.Tpo $(DEPDIR)/gem_exec_parallel-gem_exec_parallel.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gem_exec_parallel.c' object='gem_exec_parallel-gem_exec_parallel.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_exec_parallel_CFLAGS) $(CFLAGS) -c -o gem_exec_parallel-gem_exec_parallel.obj `if test -f 'gem_exec_parallel.c'; then $(CYGPATH_W) 'gem_exec_parallel.c'; else $(CYGPATH_W) '$(srcdir)/gem_exec_parallel.c'; fi` + 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 @@ -3383,6 +3452,48 @@ @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_self_import_CFLAGS) $(CFLAGS) -c -o prime_self_import-prime_self_import.obj `if test -f 'prime_self_import.c'; then $(CYGPATH_W) 'prime_self_import.c'; else $(CYGPATH_W) '$(srcdir)/prime_self_import.c'; fi` +vc4_create_bo-vc4_create_bo.o: vc4_create_bo.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(vc4_create_bo_CFLAGS) $(CFLAGS) -MT vc4_create_bo-vc4_create_bo.o -MD -MP -MF $(DEPDIR)/vc4_create_bo-vc4_create_bo.Tpo -c -o vc4_create_bo-vc4_create_bo.o `test -f 'vc4_create_bo.c' || echo '$(srcdir)/'`vc4_create_bo.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/vc4_create_bo-vc4_create_bo.Tpo $(DEPDIR)/vc4_create_bo-vc4_create_bo.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='vc4_create_bo.c' object='vc4_create_bo-vc4_create_bo.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) $(vc4_create_bo_CFLAGS) $(CFLAGS) -c -o vc4_create_bo-vc4_create_bo.o `test -f 'vc4_create_bo.c' || echo '$(srcdir)/'`vc4_create_bo.c + +vc4_create_bo-vc4_create_bo.obj: vc4_create_bo.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(vc4_create_bo_CFLAGS) $(CFLAGS) -MT vc4_create_bo-vc4_create_bo.obj -MD -MP -MF $(DEPDIR)/vc4_create_bo-vc4_create_bo.Tpo -c -o vc4_create_bo-vc4_create_bo.obj `if test -f 'vc4_create_bo.c'; then $(CYGPATH_W) 'vc4_create_bo.c'; else $(CYGPATH_W) '$(srcdir)/vc4_create_bo.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/vc4_create_bo-vc4_create_bo.Tpo $(DEPDIR)/vc4_create_bo-vc4_create_bo.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='vc4_create_bo.c' object='vc4_create_bo-vc4_create_bo.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) $(vc4_create_bo_CFLAGS) $(CFLAGS) -c -o vc4_create_bo-vc4_create_bo.obj `if test -f 'vc4_create_bo.c'; then $(CYGPATH_W) 'vc4_create_bo.c'; else $(CYGPATH_W) '$(srcdir)/vc4_create_bo.c'; fi` + +vc4_wait_bo-vc4_wait_bo.o: vc4_wait_bo.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(vc4_wait_bo_CFLAGS) $(CFLAGS) -MT vc4_wait_bo-vc4_wait_bo.o -MD -MP -MF $(DEPDIR)/vc4_wait_bo-vc4_wait_bo.Tpo -c -o vc4_wait_bo-vc4_wait_bo.o `test -f 'vc4_wait_bo.c' || echo '$(srcdir)/'`vc4_wait_bo.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/vc4_wait_bo-vc4_wait_bo.Tpo $(DEPDIR)/vc4_wait_bo-vc4_wait_bo.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='vc4_wait_bo.c' object='vc4_wait_bo-vc4_wait_bo.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) $(vc4_wait_bo_CFLAGS) $(CFLAGS) -c -o vc4_wait_bo-vc4_wait_bo.o `test -f 'vc4_wait_bo.c' || echo '$(srcdir)/'`vc4_wait_bo.c + +vc4_wait_bo-vc4_wait_bo.obj: vc4_wait_bo.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(vc4_wait_bo_CFLAGS) $(CFLAGS) -MT vc4_wait_bo-vc4_wait_bo.obj -MD -MP -MF $(DEPDIR)/vc4_wait_bo-vc4_wait_bo.Tpo -c -o vc4_wait_bo-vc4_wait_bo.obj `if test -f 'vc4_wait_bo.c'; then $(CYGPATH_W) 'vc4_wait_bo.c'; else $(CYGPATH_W) '$(srcdir)/vc4_wait_bo.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/vc4_wait_bo-vc4_wait_bo.Tpo $(DEPDIR)/vc4_wait_bo-vc4_wait_bo.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='vc4_wait_bo.c' object='vc4_wait_bo-vc4_wait_bo.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) $(vc4_wait_bo_CFLAGS) $(CFLAGS) -c -o vc4_wait_bo-vc4_wait_bo.obj `if test -f 'vc4_wait_bo.c'; then $(CYGPATH_W) 'vc4_wait_bo.c'; else $(CYGPATH_W) '$(srcdir)/vc4_wait_bo.c'; fi` + +vc4_wait_seqno-vc4_wait_seqno.o: vc4_wait_seqno.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(vc4_wait_seqno_CFLAGS) $(CFLAGS) -MT vc4_wait_seqno-vc4_wait_seqno.o -MD -MP -MF $(DEPDIR)/vc4_wait_seqno-vc4_wait_seqno.Tpo -c -o vc4_wait_seqno-vc4_wait_seqno.o `test -f 'vc4_wait_seqno.c' || echo '$(srcdir)/'`vc4_wait_seqno.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/vc4_wait_seqno-vc4_wait_seqno.Tpo $(DEPDIR)/vc4_wait_seqno-vc4_wait_seqno.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='vc4_wait_seqno.c' object='vc4_wait_seqno-vc4_wait_seqno.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) $(vc4_wait_seqno_CFLAGS) $(CFLAGS) -c -o vc4_wait_seqno-vc4_wait_seqno.o `test -f 'vc4_wait_seqno.c' || echo '$(srcdir)/'`vc4_wait_seqno.c + +vc4_wait_seqno-vc4_wait_seqno.obj: vc4_wait_seqno.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(vc4_wait_seqno_CFLAGS) $(CFLAGS) -MT vc4_wait_seqno-vc4_wait_seqno.obj -MD -MP -MF $(DEPDIR)/vc4_wait_seqno-vc4_wait_seqno.Tpo -c -o vc4_wait_seqno-vc4_wait_seqno.obj `if test -f 'vc4_wait_seqno.c'; then $(CYGPATH_W) 'vc4_wait_seqno.c'; else $(CYGPATH_W) '$(srcdir)/vc4_wait_seqno.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/vc4_wait_seqno-vc4_wait_seqno.Tpo $(DEPDIR)/vc4_wait_seqno-vc4_wait_seqno.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='vc4_wait_seqno.c' object='vc4_wait_seqno-vc4_wait_seqno.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) $(vc4_wait_seqno_CFLAGS) $(CFLAGS) -c -o vc4_wait_seqno-vc4_wait_seqno.obj `if test -f 'vc4_wait_seqno.c'; then $(CYGPATH_W) 'vc4_wait_seqno.c'; else $(CYGPATH_W) '$(srcdir)/vc4_wait_seqno.c'; fi` + mostlyclean-libtool: -rm -f *.lo @@ -3515,7 +3626,8 @@ done check-am: all-am check: check-am -all-am: Makefile $(PROGRAMS) $(SCRIPTS) $(DATA) +@BUILD_TESTS_FALSE@all-local: +all-am: Makefile $(PROGRAMS) $(SCRIPTS) $(DATA) all-local installdirs: for dir in "$(DESTDIR)$(pkglibexecdir)" "$(DESTDIR)$(pkglibexecdir)" "$(DESTDIR)$(pkgdatadir)" "$(DESTDIR)$(pkgdatadir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ @@ -3627,12 +3739,13 @@ .MAKE: install-am install-strip -.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-noinstPROGRAMS clean-pkglibexecPROGRAMS \ - cscopelist-am ctags ctags-am 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-dist_pkgdataDATA \ +.PHONY: CTAGS GTAGS TAGS all all-am all-local check check-am clean \ + clean-generic clean-libtool clean-noinstPROGRAMS \ + clean-pkglibexecPROGRAMS cscopelist-am ctags ctags-am \ + 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-dist_pkgdataDATA \ install-dist_pkglibexecSCRIPTS install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ @@ -3653,6 +3766,15 @@ @BUILD_TESTS_TRUE@ @echo ${single_kernel_tests} ${multi_kernel_tests} >> $@ @BUILD_TESTS_TRUE@ @echo END TESTLIST >> $@ +@BUILD_TESTS_TRUE@test-list-full.txt: Makefile.sources +@BUILD_TESTS_TRUE@ @echo TESTLIST > $@ +@BUILD_TESTS_TRUE@ @echo ${single_kernel_tests} ${multi_kernel_tests} ${extra_multi_kernel_tests} >> $@ +@BUILD_TESTS_TRUE@ @echo END TESTLIST >> $@ + +@BUILD_TESTS_TRUE@all-local: .gitignore +@BUILD_TESTS_TRUE@.gitignore: Makefile.sources +@BUILD_TESTS_TRUE@ @echo "$(pkglibexec_PROGRAMS) $(HANG) test-list.txt test-list-full.txt .gitignore" | sed 's/\s\+/\n/g' | sort > $@ + # 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: diff -Nru intel-gpu-tools-1.13/tests/Makefile.sources intel-gpu-tools-1.15/tests/Makefile.sources --- intel-gpu-tools-1.13/tests/Makefile.sources 2015-12-02 10:41:28.000000000 +0000 +++ intel-gpu-tools-1.15/tests/Makefile.sources 2016-05-24 14:46:32.000000000 +0000 @@ -4,6 +4,12 @@ prime_nv_test \ $(NULL) +VC4_TESTS_M = \ + vc4_create_bo \ + vc4_wait_bo \ + vc4_wait_seqno \ + $(NULL) + TESTS_progs_M = \ core_get_client_auth \ drv_getparams_basic \ @@ -11,24 +17,33 @@ drv_hangman \ gem_bad_reloc \ gem_basic \ + gem_busy \ gem_caching \ gem_close_race \ gem_concurrent_blit \ - gem_concurrent_all \ + gem_create \ gem_cs_tlb \ - gem_ctx_param_basic \ gem_ctx_bad_exec \ gem_ctx_exec \ - gem_dummy_reloc_loop \ + gem_ctx_param \ gem_eio \ gem_evict_alignment \ gem_evict_everything \ gem_exec_alignment \ gem_exec_bad_domains \ + gem_exec_basic \ + gem_exec_create \ gem_exec_faulting_reloc \ + gem_exec_flush \ + gem_exec_gttfill \ gem_exec_nop \ + gem_exec_parallel \ gem_exec_params \ gem_exec_parse \ + gem_exec_store \ + gem_exec_suspend \ + gem_exec_reloc \ + gem_exec_whisper \ gem_fenced_exec_thrash \ gem_fence_thrash \ gem_fence_upload \ @@ -57,6 +72,9 @@ gem_reset_stats \ gem_ringfill \ gem_set_tiling_vs_blt \ + gem_shrink \ + gem_softpin \ + gem_stolen \ gem_storedw_batches_loop \ gem_streaming_writes \ gem_tiled_blits \ @@ -65,7 +83,9 @@ gem_write_read_ring_switch \ kms_addfb_basic \ kms_atomic \ + kms_chv_cursor_fail \ kms_cursor_crc \ + kms_cursor_legacy \ kms_draw_crc \ kms_fbc_crc \ kms_fbcon_fbt \ @@ -76,6 +96,7 @@ kms_legacy_colorkey \ kms_mmio_vs_cs_flip \ kms_pipe_b_c_ivb \ + kms_pipe_color \ kms_pipe_crc_basic \ kms_plane \ kms_psr_sink_crc \ @@ -93,10 +114,17 @@ pm_rps \ pm_rc6_residency \ pm_sseu \ + prime_mmap \ + prime_mmap_coherency \ + prime_mmap_kms \ prime_self_import \ template \ $(NULL) +TESTS_progs_XM = \ + gem_concurrent_all \ + $(NULL) + TESTS_progs = \ core_auth \ core_getclient \ @@ -116,6 +144,7 @@ gem_ctx_bad_destroy \ gem_ctx_basic \ gem_ctx_create \ + gem_ctx_switch \ gem_ctx_thrash \ gem_double_irq_loop \ gem_exec_big \ @@ -130,6 +159,7 @@ gem_lut_handle \ gem_mmap_offset_exhaustion \ gem_media_fill \ + gem_mocs_settings \ gem_gpgpu_fill \ gem_pin \ gem_reg_read \ @@ -138,11 +168,11 @@ gem_render_tiled_blits \ gem_ring_sync_copy \ gem_ring_sync_loop \ - gem_multi_bsd_sync_loop \ gem_seqno_wrap \ gem_set_tiling_vs_gtt \ gem_set_tiling_vs_pwrite \ gem_storedw_loop \ + gem_sync \ gem_threaded_access_tiled \ gem_tiled_fence_blits \ gem_tiled_pread_basic \ @@ -163,7 +193,8 @@ gen7_forcewake_mt \ kms_3d \ kms_fence_pin_leak \ - kms_force_connector \ + kms_force_connector_basic \ + kms_mmap_write_crc \ kms_pwrite_crc \ kms_sink_crc_basic \ prime_udl \ @@ -196,6 +227,15 @@ $(TESTS_scripts_M) \ $(NULL) + +# This target contains testcases with lots of subtests. +# It was split from multi_kernel_tests because of the overhead of listing all +# the subtests in piglit +extra_multi_kernel_tests = \ + $(TESTS_progs_XM) \ + $(NULL) + + # This target is for simple testcase which don't expose any subtest. # # Your testcase should probably use igt_simple_main, but none of the other magic @@ -210,6 +250,12 @@ $(multi_kernel_tests) \ $(NULL) +kernel_tests_full = \ + $(single_kernel_tests) \ + $(multi_kernel_tests) \ + $(extra_multi_kernel_tests) \ + $(NULL) + # Test that exercise specific asserts in the test framework library and are # hence expected to fail. XFAIL_TESTS = \ diff -Nru intel-gpu-tools-1.13/tests/pm_backlight.c intel-gpu-tools-1.15/tests/pm_backlight.c --- intel-gpu-tools-1.13/tests/pm_backlight.c 2015-11-30 16:15:31.000000000 +0000 +++ intel-gpu-tools-1.15/tests/pm_backlight.c 2016-05-23 10:51:28.000000000 +0000 @@ -35,6 +35,10 @@ #include #include +struct context { + int max; +}; + #define TOLERANCE 5 /* percent */ #define BACKLIGHT_PATH "/sys/class/backlight/intel_backlight" @@ -91,9 +95,10 @@ return 0; } -static void test_and_verify(int val) +static void test_and_verify(struct context *context, int val) { int result; + int tolerance = val * TOLERANCE / 100; igt_assert_eq(backlight_write(val, "brightness"), 0); igt_assert_eq(backlight_read(&result, "brightness"), 0); @@ -102,67 +107,69 @@ igt_assert_eq(backlight_read(&result, "actual_brightness"), 0); /* Some rounding may happen depending on hw. Just check that it's close enough. */ - igt_assert(result <= val + val * TOLERANCE / 100 && result >= val - val * TOLERANCE / 100); + igt_assert_lte(result, min(context->max, val + tolerance)); + igt_assert_lte(max(0, val - tolerance), result); } -static void test_brightness(int max) +static void test_brightness(struct context *context) { - test_and_verify(0); - test_and_verify(max); - test_and_verify(max / 2); + test_and_verify(context, 0); + test_and_verify(context, context->max); + test_and_verify(context, context->max / 2); } -static void test_bad_brightness(int max) +static void test_bad_brightness(struct context *context) { int val; /* First write some sane value */ - backlight_write(max / 2, "brightness"); + backlight_write(context->max / 2, "brightness"); /* Writing invalid values should fail and not change the value */ igt_assert_lt(backlight_write(-1, "brightness"), 0); backlight_read(&val, "brightness"); - igt_assert_eq(val, max / 2); - igt_assert_lt(backlight_write(max + 1, "brightness"), 0); + igt_assert_eq(val, context->max / 2); + igt_assert_lt(backlight_write(context->max + 1, "brightness"), 0); backlight_read(&val, "brightness"); - igt_assert_eq(val, max / 2); + igt_assert_eq(val, context->max / 2); igt_assert_lt(backlight_write(INT_MAX, "brightness"), 0); backlight_read(&val, "brightness"); - igt_assert_eq(val, max / 2); + igt_assert_eq(val, context->max / 2); } -static void test_fade(int max) +static void test_fade(struct context *context) { int i; static const struct timespec ts = { .tv_sec = 0, .tv_nsec = FADESPEED*1000000 }; /* Fade out, then in */ - for (i = max; i > 0; i -= max / FADESTEPS) { - test_and_verify(i); + for (i = context->max; i > 0; i -= context->max / FADESTEPS) { + test_and_verify(context, i); nanosleep(&ts, NULL); } - for (i = 0; i <= max; i += max / FADESTEPS) { - test_and_verify(i); + for (i = 0; i <= context->max; i += context->max / FADESTEPS) { + test_and_verify(context, i); nanosleep(&ts, NULL); } } igt_main { - int max, old; + struct context context = {0}; + int old; igt_skip_on_simulation(); igt_fixture { /* Get the max value and skip the whole test if sysfs interface not available */ igt_skip_on(backlight_read(&old, "brightness")); - igt_assert(backlight_read(&max, "max_brightness") > -1); + igt_assert(backlight_read(&context.max, "max_brightness") > -1); } igt_subtest("basic-brightness") - test_brightness(max); + test_brightness(&context); igt_subtest("bad-brightness") - test_bad_brightness(max); + test_bad_brightness(&context); igt_subtest("fade") - test_fade(max); + test_fade(&context); igt_fixture { /* Restore old brightness */ diff -Nru intel-gpu-tools-1.13/tests/pm_lpsp.c intel-gpu-tools-1.15/tests/pm_lpsp.c --- intel-gpu-tools-1.13/tests/pm_lpsp.c 2015-11-30 16:26:23.000000000 +0000 +++ intel-gpu-tools-1.15/tests/pm_lpsp.c 2016-05-23 10:51:28.000000000 +0000 @@ -31,29 +31,6 @@ #include -/* We know that if we don't enable audio runtime PM, snd_hda_intel will never - * release its power well refcount, and we'll never reach the LPSP sate. OTOH - * there's no guarantee that it will release the power well if we enable runtime - * PM, but at least we can try. We don't have any assertions since the user may - * not even have snd_hda_intel loaded, which is not a problem. */ -static void disable_audio_runtime_pm(void) -{ - int fd; - - fd = open("/sys/module/snd_hda_intel/parameters/power_save", O_WRONLY); - if (fd >= 0) { - igt_assert_eq(write(fd, "1\n", 2), 2); - close(fd); - } - fd = open("/sys/bus/pci/devices/0000:00:03.0/power/control", O_WRONLY); - if (fd >= 0) { - igt_assert_eq(write(fd, "auto\n", 5), 5); - close(fd); - } - /* Give some time for it to react. */ - sleep(1); -} - static bool supports_lpsp(uint32_t devid) { return IS_HASWELL(devid) || IS_BROADWELL(devid); @@ -78,16 +55,9 @@ static uint32_t create_fb(int drm_fd, int width, int height) { struct igt_fb fb; - cairo_t *cr; - uint32_t buffer_id; - - buffer_id = igt_create_fb(drm_fd, width, height, DRM_FORMAT_XRGB8888, - LOCAL_DRM_FORMAT_MOD_NONE, &fb); - cr = igt_get_cairo_ctx(drm_fd, &fb); - igt_paint_test_pattern(cr, width, height); - cairo_destroy(cr); - return buffer_id; + return igt_create_pattern_fb(drm_fd, width, height, DRM_FORMAT_XRGB8888, + LOCAL_DRM_FORMAT_MOD_NONE, &fb); } static void edp_subtest(int drm_fd, drmModeResPtr drm_res, @@ -95,7 +65,8 @@ bool use_panel_fitter) { int i, rc; - uint32_t connector_id = 0, crtc_id = 0, buffer_id = 0; + uint32_t crtc_id = 0, buffer_id = 0; + drmModeConnectorPtr connector = NULL; drmModeModeInfoPtr mode = NULL; drmModeModeInfo std_1024_mode = { .clock = 65000, @@ -126,12 +97,12 @@ continue; if (!use_panel_fitter && c->count_modes) { - connector_id = c->connector_id; + connector = c; mode = &c->modes[0]; break; } if (use_panel_fitter) { - connector_id = c->connector_id; + connector = c; /* This is one of the modes Xorg creates for panels, so * it should work just fine. Notice that Gens that @@ -146,18 +117,18 @@ break; } } - igt_require(connector_id); + igt_require(connector); - crtc_id = drm_res->crtcs[0]; + crtc_id = kmstest_find_crtc_for_connector(drm_fd, drm_res, connector, + 0); buffer_id = create_fb(drm_fd, mode->hdisplay, mode->vdisplay); - igt_assert(crtc_id); igt_assert(buffer_id); - igt_assert(connector_id); + igt_assert(connector); igt_assert(mode); - rc = drmModeSetCrtc(drm_fd, crtc_id, buffer_id, 0, 0, &connector_id, 1, - mode); + rc = drmModeSetCrtc(drm_fd, crtc_id, buffer_id, 0, 0, + &connector->connector_id, 1, mode); igt_assert_eq(rc, 0); if (use_panel_fitter) { @@ -174,7 +145,8 @@ drmModeConnectorPtr *drm_connectors) { int i, rc; - uint32_t connector_id = 0, crtc_id = 0, buffer_id = 0; + uint32_t crtc_id = 0, buffer_id = 0; + drmModeConnectorPtr connector = NULL; drmModeModeInfoPtr mode = NULL; kmstest_unset_all_crtcs(drm_fd, drm_res); @@ -188,23 +160,22 @@ continue; if (c->count_modes) { - connector_id = c->connector_id; + connector = c; mode = &c->modes[0]; break; } } - igt_require(connector_id); + igt_require(connector); - crtc_id = drm_res->crtcs[0]; + crtc_id = kmstest_find_crtc_for_connector(drm_fd, drm_res, connector, + 0); buffer_id = create_fb(drm_fd, mode->hdisplay, mode->vdisplay); - igt_assert(crtc_id); igt_assert(buffer_id); - igt_assert(connector_id); igt_assert(mode); - rc = drmModeSetCrtc(drm_fd, crtc_id, buffer_id, 0, 0, &connector_id, 1, - mode); + rc = drmModeSetCrtc(drm_fd, crtc_id, buffer_id, 0, 0, + &connector->connector_id, 1, mode); igt_assert_eq(rc, 0); igt_assert(!lpsp_is_enabled(drm_fd)); @@ -231,10 +202,10 @@ igt_assert(drm_res->count_connectors <= MAX_CONNECTORS); for (i = 0; i < drm_res->count_connectors; i++) - drm_connectors[i] = drmModeGetConnector(drm_fd, + drm_connectors[i] = drmModeGetConnectorCurrent(drm_fd, drm_res->connectors[i]); - disable_audio_runtime_pm(); + igt_pm_enable_audio_runtime_pm(); igt_require(supports_lpsp(devid)); diff -Nru intel-gpu-tools-1.13/tests/pm_rpm.c intel-gpu-tools-1.15/tests/pm_rpm.c --- intel-gpu-tools-1.13/tests/pm_rpm.c 2015-12-02 10:41:28.000000000 +0000 +++ intel-gpu-tools-1.15/tests/pm_rpm.c 2016-05-23 10:51:28.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright © 2013 Intel Corporation + * Copyright © 2013, 2015 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -52,8 +52,6 @@ #define MAX_ENCODERS 32 #define MAX_CRTCS 16 -#define POWER_DIR "/sys/devices/pci0000:00/0000:00:02.0/power" - enum pc8_status { PC8_ENABLED, PC8_DISABLED @@ -111,6 +109,8 @@ struct modeset_params non_lpsp_mode_params; struct modeset_params *default_mode_params; +static int8_t *pm_data = NULL; + /* If the read fails, then the machine doesn't support PC8+ residencies. */ static bool supports_pc8_plus_residencies(void) { @@ -231,9 +231,8 @@ enum screen_type type) { int i; - uint32_t connector_id = 0; + drmModeConnectorPtr connector = NULL; drmModeModeInfoPtr mode = NULL; - cairo_t *cr; for (i = 0; i < data->res->count_connectors; i++) { drmModeConnectorPtr c = data->connectors[i]; @@ -247,24 +246,22 @@ continue; if (c->connection == DRM_MODE_CONNECTED && c->count_modes) { - connector_id = c->connector_id; + connector = c; mode = &c->modes[0]; break; } } - if (!connector_id) + if (!connector) return false; - igt_create_fb(drm_fd, mode->hdisplay, mode->vdisplay, - DRM_FORMAT_XRGB8888, LOCAL_DRM_FORMAT_MOD_NONE, - ¶ms->fb); - cr = igt_get_cairo_ctx(drm_fd, ¶ms->fb); - igt_paint_test_pattern(cr, mode->hdisplay, mode->vdisplay); - cairo_destroy(cr); - - params->crtc_id = data->res->crtcs[0]; - params->connector_id = connector_id; + igt_create_pattern_fb(drm_fd, mode->hdisplay, mode->vdisplay, + DRM_FORMAT_XRGB8888, LOCAL_DRM_FORMAT_MOD_NONE, + ¶ms->fb); + + params->crtc_id = kmstest_find_crtc_for_connector(drm_fd, data->res, + connector, 0); + params->connector_id = connector->connector_id; params->mode = mode; return true; @@ -370,7 +367,7 @@ igt_assert(data->res->count_connectors <= MAX_CONNECTORS); for (i = 0; i < data->res->count_connectors; i++) { - data->connectors[i] = drmModeGetConnector(drm_fd, + data->connectors[i] = drmModeGetConnectorCurrent(drm_fd, data->res->connectors[i]); data->edids[i] = get_connector_edid(data->connectors[i], i); } @@ -405,6 +402,8 @@ igt_assert(data->res->count_crtcs <= MAX_CRTCS); for (i = 0; i < data->res->count_connectors; i++) { + /* Don't use GetConnectorCurrent, we want to force a reprobe + * here. */ data->connectors[i] = drmModeGetConnector(drm_fd, data->res->connectors[i]); data->edids[i] = get_connector_edid(data->connectors[i], i); @@ -668,41 +667,13 @@ has_pc8 = true; } -/* If we want to actually reach PC8+ states, we need to properly configure all - * the devices on the system to allow this. This function will try to setup the - * things we know we need, but won't scream in case anything fails: we don't - * know which devices are present on your machine, so we can't really expect - * anything, just try to help with the more common problems. */ -static void setup_non_graphics_runtime_pm(void) -{ - int fd, i; - char *file_name; - - /* Disk runtime PM policies. */ - file_name = malloc(PATH_MAX); - for (i = 0; ; i++) { - - snprintf(file_name, PATH_MAX, - "/sys/class/scsi_host/host%d/link_power_management_policy", - i); - - fd = open(file_name, O_WRONLY); - if (fd < 0) - break; - - igt_assert(write(fd, "min_power\n", 10) == 10); - close(fd); - } - free(file_name); -} - static void setup_environment(void) { drm_fd = drm_open_driver_master(DRIVER_INTEL); init_mode_set_data(&ms_data); - setup_non_graphics_runtime_pm(); + pm_data = igt_pm_enable_sata_link_power_management(); has_runtime_pm = igt_setup_runtime_pm(); setup_pc8(); @@ -711,11 +682,17 @@ igt_info("PC8 residency support: %d\n", has_pc8); igt_require(has_runtime_pm); +} +static void restore_environment(void) +{ + igt_pm_restore_sata_link_power_management(pm_data); + free(pm_data); } static void teardown_environment(void) { + restore_environment(); fini_mode_set_data(&ms_data); drmClose(drm_fd); close(msr_fd); @@ -1360,15 +1337,13 @@ static bool device_in_pci_d3(void) { - struct pci_device *pci_dev; - int rc; uint16_t val; + int rc; - pci_dev = intel_get_pci_device(); - - rc = pci_device_cfg_read_u16(pci_dev, &val, 0xd4); + rc = pci_device_cfg_read_u16(intel_get_pci_device(), &val, 0xd4); igt_assert_eq(rc, 0); + igt_debug("%s: PCI D3 state=%d\n", __func__, val & 0x3); return (val & 0x3) == 0x3; } @@ -1377,11 +1352,9 @@ igt_require(has_runtime_pm); disable_all_screens_and_wait(&ms_data); - - igt_assert(device_in_pci_d3()); + igt_assert(igt_wait(device_in_pci_d3(), 2000, 100)); enable_one_screen_and_wait(&ms_data); - igt_assert(!device_in_pci_d3()); } @@ -1603,7 +1576,6 @@ disable_all_screens_and_wait(&ms_data); - igt_require(default_mode_params); crtc_id = default_mode_params->crtc_id; switch (plane_type) { @@ -1688,9 +1660,13 @@ /* This one also triggered WARNs on our driver at some point in time. */ static void planes_subtest(bool universal, bool dpms) { - int i, rc, planes_tested = 0; + int i, rc, planes_tested = 0, crtc_idx; drmModePlaneResPtr planes; + igt_require(default_mode_params); + crtc_idx = kmstest_get_crtc_idx(ms_data.res, + default_mode_params->crtc_id); + if (universal) { rc = drmSetClientCap(drm_fd, DRM_CLIENT_CAP_UNIVERSAL_PLANES, 1); @@ -1704,9 +1680,7 @@ plane = drmModeGetPlane(drm_fd, planes->planes[i]); igt_assert(plane); - /* We just pick the first CRTC on the list, so we can test for - * 0x1 as the index. */ - if (plane->possible_crtcs & 0x1) { + if (plane->possible_crtcs & (1 << crtc_idx)) { enum plane_type type; type = universal ? get_plane_type(plane->plane_id) : @@ -1792,7 +1766,8 @@ uint32_t handle; uint8_t *gem_buf; - uint32_t i, got_caching; + uint32_t i; + uint32_t default_cache_level; uint32_t gtt_obj_max_size = (16 * 1024); uint32_t cache_levels[3] = { I915_CACHING_NONE, @@ -1800,42 +1775,34 @@ I915_CACHING_DISPLAY, /* eDRAM caching */ }; + disable_all_screens(&ms_data); handle = gem_create(drm_fd, gtt_obj_max_size); + default_cache_level = gem_get_caching(drm_fd, handle); gem_buf = gem_mmap__gtt(drm_fd, handle, gtt_obj_max_size, PROT_WRITE); for (i = 0; i < ARRAY_SIZE(cache_levels); i++) { - memset(gem_buf, 16 << i, gtt_obj_max_size); + igt_assert(wait_for_suspended()); + gem_set_caching(drm_fd, handle, default_cache_level); - disable_all_screens_and_wait(&ms_data); + /* Ensure we bind the vma into the GGTT */ + memset(gem_buf, 16 << i, gtt_obj_max_size); + /* Now try changing the cache-level on the bound object. + * This will either unlikely unbind the object from the GGTT, + * or more likely just change the PTEs inside the GGTT. Either + * way the driver must take the rpm wakelock around the GSM + * access. + */ igt_debug("Setting cache level %u\n", cache_levels[i]); - + igt_assert(wait_for_suspended()); gem_set_caching(drm_fd, handle, cache_levels[i]); - - got_caching = gem_get_caching(drm_fd, handle); - - igt_debug("Got back %u\n", got_caching); - - /* - * Allow fall-back to CACHING_NONE in case the platform does - * not support it. - */ - if (cache_levels[i] == I915_CACHING_DISPLAY) - igt_assert(got_caching == I915_CACHING_NONE || - got_caching == I915_CACHING_DISPLAY); - else - igt_assert(got_caching == cache_levels[i]); - - enable_one_screen_and_wait(&ms_data); } igt_assert(munmap(gem_buf, gtt_obj_max_size) == 0); gem_close(drm_fd, handle); } - - static void fences_subtest(bool dpms) { int i; diff -Nru intel-gpu-tools-1.13/tests/pm_rps.c intel-gpu-tools-1.15/tests/pm_rps.c --- intel-gpu-tools-1.13/tests/pm_rps.c 2015-11-30 16:26:23.000000000 +0000 +++ intel-gpu-tools-1.15/tests/pm_rps.c 2016-05-23 10:51:28.000000000 +0000 @@ -130,7 +130,7 @@ igt_assert_eq(readval(filp), orig); } else { /* Expecting no error */ - igt_assert_neq(ret, 0); + igt_assert_lt(0, ret); wait_freq_settle(); if (readback_check) igt_assert_eq(readval(filp), val); @@ -146,7 +146,7 @@ { igt_assert_lte(freqs[MIN], freqs[MAX]); igt_assert_lte(freqs[CUR], freqs[MAX]); - igt_assert_lte(freqs[MIN], freqs[CUR]); + igt_assert_lte(freqs[RPn], freqs[CUR]); igt_assert_lte(freqs[RPn], freqs[MIN]); igt_assert_lte(freqs[MAX], freqs[RP0]); igt_assert_lte(freqs[RP1], freqs[RP0]); @@ -288,7 +288,7 @@ static void load_helper_init(void) { lh.devid = intel_get_drm_devid(drm_fd); - lh.has_ppgtt = gem_uses_aliasing_ppgtt(drm_fd); + lh.has_ppgtt = gem_uses_ppgtt(drm_fd); /* MI_STORE_DATA can only use GTT address on gen4+/g33 and needs * snoopable mem on pre-gen6. Hence load-helper only works on gen6+, but @@ -388,10 +388,14 @@ igt_debug("\nIncrease min to midpoint...\n"); writeval(stuff[MIN].filp, fmid); + if (load_gpu) + do_load_gpu(); check(); igt_debug("\nIncrease min to RP0...\n"); writeval(stuff[MIN].filp, origfreqs[RP0]); + if (load_gpu) + do_load_gpu(); check(); igt_debug("\nIncrease min above RP0 (invalid)...\n"); @@ -460,7 +464,7 @@ } #define IDLE_WAIT_TIMESTEP_MSEC 100 -#define IDLE_WAIT_TIMEOUT_MSEC 10000 +#define IDLE_WAIT_TIMEOUT_MSEC 15000 static void idle_check(void) { int freqs[NUMFREQ]; @@ -472,14 +476,14 @@ read_freqs(freqs); dump(freqs); checkit(freqs); - if (freqs[CUR] == freqs[MIN]) + if (freqs[CUR] == freqs[RPn]) break; usleep(1000 * IDLE_WAIT_TIMESTEP_MSEC); wait += IDLE_WAIT_TIMESTEP_MSEC; } while (wait < IDLE_WAIT_TIMEOUT_MSEC); - igt_assert_eq(freqs[CUR], freqs[MIN]); - igt_debug("Required %d msec to reach cur=min\n", wait); + igt_assert_eq(freqs[CUR], freqs[RPn]); + igt_debug("Required %d msec to reach cur=idle\n", wait); } #define LOADED_WAIT_TIMESTEP_MSEC 100 @@ -506,7 +510,7 @@ } #define STABILIZE_WAIT_TIMESTEP_MSEC 100 -#define STABILIZE_WAIT_TIMEOUT_MSEC 10000 +#define STABILIZE_WAIT_TIMEOUT_MSEC 15000 static void stabilize_check(int *freqs) { int wait = 0; @@ -521,6 +525,13 @@ igt_debug("Waited %d msec to stabilize cur\n", wait); } +static void reset_gpu(void) +{ + int fd = drm_open_driver(DRIVER_INTEL); + igt_post_hang_ring(fd, igt_hang_ring(fd, I915_EXEC_DEFAULT)); + close(fd); +} + /* * reset - test that turbo works across a ring stop * @@ -556,11 +567,8 @@ load_helper_run(LOW); stabilize_check(pre_freqs); - igt_debug("Stop rings...\n"); - igt_set_stop_rings(STOP_RING_DEFAULTS); - while (igt_get_stop_rings()) - usleep(1000 * 100); - igt_debug("Ring stop cleared\n"); + igt_debug("Reset gpu...\n"); + reset_gpu(); igt_debug("Apply high load...\n"); load_helper_set_load(HIGH); diff -Nru intel-gpu-tools-1.13/tests/pm_sseu.c intel-gpu-tools-1.15/tests/pm_sseu.c --- intel-gpu-tools-1.13/tests/pm_sseu.c 2015-11-30 16:26:23.000000000 +0000 +++ intel-gpu-tools-1.15/tests/pm_sseu.c 2016-05-23 10:51:28.000000000 +0000 @@ -258,7 +258,7 @@ gem.gen = intel_gen(gem.devid); igt_require_f(gem.gen >= 8, "SSEU power gating only relevant for Gen8+"); - gem.has_ppgtt = gem_uses_aliasing_ppgtt(gem.drm_fd); + gem.has_ppgtt = gem_uses_ppgtt(gem.drm_fd); gem.bufmgr = drm_intel_bufmgr_gem_init(gem.drm_fd, 4096); igt_assert(gem.bufmgr); diff -Nru intel-gpu-tools-1.13/tests/prime_mmap.c intel-gpu-tools-1.15/tests/prime_mmap.c --- intel-gpu-tools-1.13/tests/prime_mmap.c 1970-01-01 00:00:00.000000000 +0000 +++ intel-gpu-tools-1.15/tests/prime_mmap.c 2016-05-23 10:51:28.000000000 +0000 @@ -0,0 +1,519 @@ +/* + * Copyright © 2014 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: + * Rob Bradford + * Tiago Vignatti + * + */ + +/* + * Testcase: Check whether mmap()ing dma-buf works + */ +#define _GNU_SOURCE +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "drm.h" +#include "i915_drm.h" +#include "drmtest.h" +#include "igt_debugfs.h" +#include "ioctl_wrappers.h" + +#define BO_SIZE (16*1024) + +static int fd; + +char pattern[] = {0xff, 0x00, 0x00, 0x00, + 0x00, 0xff, 0x00, 0x00, + 0x00, 0x00, 0xff, 0x00, + 0x00, 0x00, 0x00, 0xff}; + +static void +fill_bo(uint32_t handle, size_t size) +{ + off_t i; + for (i = 0; i < size; i+=sizeof(pattern)) + { + gem_write(fd, handle, i, pattern, sizeof(pattern)); + } +} + +static void +fill_bo_cpu(char *ptr) +{ + memcpy(ptr, pattern, sizeof(pattern)); +} + +static void +test_correct(void) +{ + int dma_buf_fd; + char *ptr1, *ptr2; + uint32_t handle; + + handle = gem_create(fd, BO_SIZE); + fill_bo(handle, BO_SIZE); + + dma_buf_fd = prime_handle_to_fd(fd, handle); + igt_assert(errno == 0); + + /* Check correctness vs GEM_MMAP_GTT */ + ptr1 = gem_mmap__gtt(fd, handle, BO_SIZE, PROT_READ); + ptr2 = mmap(NULL, BO_SIZE, PROT_READ, MAP_SHARED, dma_buf_fd, 0); + igt_assert(ptr1 != MAP_FAILED); + igt_assert(ptr2 != MAP_FAILED); + igt_assert(memcmp(ptr1, ptr2, BO_SIZE) == 0); + + /* Check pattern correctness */ + igt_assert(memcmp(ptr2, pattern, sizeof(pattern)) == 0); + + munmap(ptr1, BO_SIZE); + munmap(ptr2, BO_SIZE); + close(dma_buf_fd); + gem_close(fd, handle); +} + +static void +test_map_unmap(void) +{ + int dma_buf_fd; + char *ptr; + uint32_t handle; + + handle = gem_create(fd, BO_SIZE); + fill_bo(handle, BO_SIZE); + + dma_buf_fd = prime_handle_to_fd(fd, handle); + igt_assert(errno == 0); + + ptr = mmap(NULL, BO_SIZE, PROT_READ, MAP_SHARED, dma_buf_fd, 0); + igt_assert(ptr != MAP_FAILED); + igt_assert(memcmp(ptr, pattern, sizeof(pattern)) == 0); + + /* Unmap and remap */ + munmap(ptr, BO_SIZE); + ptr = mmap(NULL, BO_SIZE, PROT_READ, MAP_SHARED, dma_buf_fd, 0); + igt_assert(ptr != MAP_FAILED); + igt_assert(memcmp(ptr, pattern, sizeof(pattern)) == 0); + + munmap(ptr, BO_SIZE); + close(dma_buf_fd); + gem_close(fd, handle); +} + +/* prime and then unprime and then prime again the same handle */ +static void +test_reprime(void) +{ + int dma_buf_fd; + char *ptr; + uint32_t handle; + + handle = gem_create(fd, BO_SIZE); + fill_bo(handle, BO_SIZE); + + dma_buf_fd = prime_handle_to_fd(fd, handle); + igt_assert(errno == 0); + + ptr = mmap(NULL, BO_SIZE, PROT_READ, MAP_SHARED, dma_buf_fd, 0); + igt_assert(ptr != MAP_FAILED); + igt_assert(memcmp(ptr, pattern, sizeof(pattern)) == 0); + + close (dma_buf_fd); + igt_assert(memcmp(ptr, pattern, sizeof(pattern)) == 0); + munmap(ptr, BO_SIZE); + + dma_buf_fd = prime_handle_to_fd(fd, handle); + ptr = mmap(NULL, BO_SIZE, PROT_READ, MAP_SHARED, dma_buf_fd, 0); + igt_assert(ptr != MAP_FAILED); + igt_assert(memcmp(ptr, pattern, sizeof(pattern)) == 0); + + munmap(ptr, BO_SIZE); + close(dma_buf_fd); + gem_close(fd, handle); +} + +/* map from another process */ +static void +test_forked(void) +{ + int dma_buf_fd; + char *ptr; + uint32_t handle; + + handle = gem_create(fd, BO_SIZE); + fill_bo(handle, BO_SIZE); + + dma_buf_fd = prime_handle_to_fd(fd, handle); + igt_assert(errno == 0); + + igt_fork(childno, 1) { + ptr = mmap(NULL, BO_SIZE, PROT_READ, MAP_SHARED, dma_buf_fd, 0); + igt_assert(ptr != MAP_FAILED); + igt_assert(memcmp(ptr, pattern, sizeof(pattern)) == 0); + munmap(ptr, BO_SIZE); + close(dma_buf_fd); + } + close(dma_buf_fd); + igt_waitchildren(); + gem_close(fd, handle); +} + +/* test simple CPU write */ +static void +test_correct_cpu_write(void) +{ + int dma_buf_fd; + char *ptr; + uint32_t handle; + + handle = gem_create(fd, BO_SIZE); + + dma_buf_fd = prime_handle_to_fd_for_mmap(fd, handle); + + /* Skip if DRM_RDWR is not supported */ + igt_skip_on(errno == EINVAL); + + /* Check correctness of map using write protection (PROT_WRITE) */ + ptr = mmap(NULL, BO_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED, dma_buf_fd, 0); + igt_assert(ptr != MAP_FAILED); + + /* Fill bo using CPU */ + fill_bo_cpu(ptr); + + /* Check pattern correctness */ + igt_assert(memcmp(ptr, pattern, sizeof(pattern)) == 0); + + munmap(ptr, BO_SIZE); + close(dma_buf_fd); + gem_close(fd, handle); +} + +/* map from another process and then write using CPU */ +static void +test_forked_cpu_write(void) +{ + int dma_buf_fd; + char *ptr; + uint32_t handle; + + handle = gem_create(fd, BO_SIZE); + + dma_buf_fd = prime_handle_to_fd_for_mmap(fd, handle); + + /* Skip if DRM_RDWR is not supported */ + igt_skip_on(errno == EINVAL); + + igt_fork(childno, 1) { + ptr = mmap(NULL, BO_SIZE, PROT_READ | PROT_WRITE , MAP_SHARED, dma_buf_fd, 0); + igt_assert(ptr != MAP_FAILED); + fill_bo_cpu(ptr); + + igt_assert(memcmp(ptr, pattern, sizeof(pattern)) == 0); + munmap(ptr, BO_SIZE); + close(dma_buf_fd); + } + close(dma_buf_fd); + igt_waitchildren(); + gem_close(fd, handle); +} + +static void +test_refcounting(void) +{ + int dma_buf_fd; + char *ptr; + uint32_t handle; + + handle = gem_create(fd, BO_SIZE); + fill_bo(handle, BO_SIZE); + + dma_buf_fd = prime_handle_to_fd(fd, handle); + igt_assert(errno == 0); + /* Close gem object before mapping */ + gem_close(fd, handle); + + ptr = mmap(NULL, BO_SIZE, PROT_READ, MAP_SHARED, dma_buf_fd, 0); + igt_assert(ptr != MAP_FAILED); + igt_assert(memcmp(ptr, pattern, sizeof(pattern)) == 0); + munmap(ptr, BO_SIZE); + close (dma_buf_fd); +} + +/* dup before mmap */ +static void +test_dup(void) +{ + int dma_buf_fd; + char *ptr; + uint32_t handle; + + handle = gem_create(fd, BO_SIZE); + fill_bo(handle, BO_SIZE); + + dma_buf_fd = dup(prime_handle_to_fd(fd, handle)); + igt_assert(errno == 0); + + ptr = mmap(NULL, BO_SIZE, PROT_READ, MAP_SHARED, dma_buf_fd, 0); + igt_assert(ptr != MAP_FAILED); + igt_assert(memcmp(ptr, pattern, sizeof(pattern)) == 0); + munmap(ptr, BO_SIZE); + gem_close(fd, handle); + close (dma_buf_fd); +} + +/* Used for error case testing to avoid wrapper */ +static int prime_handle_to_fd_no_assert(uint32_t handle, int flags, int *fd_out) +{ + struct drm_prime_handle args; + int ret; + + args.handle = handle; + args.flags = flags; + args.fd = -1; + + ret = drmIoctl(fd, DRM_IOCTL_PRIME_HANDLE_TO_FD, &args); + if (ret) + ret = errno; + *fd_out = args.fd; + + return ret; +} + +/* test for mmap(dma_buf_export(userptr)) */ +static void +test_userptr(void) +{ + int ret, dma_buf_fd; + void *ptr; + uint32_t handle; + + /* create userptr bo */ + ret = posix_memalign(&ptr, 4096, BO_SIZE); + igt_assert_eq(ret, 0); + + /* we are not allowed to export unsynchronized userptr. Just create a normal + * one */ + gem_userptr(fd, (uint32_t *)ptr, BO_SIZE, 0, 0, &handle); + + /* export userptr */ + ret = prime_handle_to_fd_no_assert(handle, DRM_CLOEXEC, &dma_buf_fd); + if (ret) { + igt_assert(ret == EINVAL || ret == ENODEV); + goto free_userptr; + } else { + igt_assert_eq(ret, 0); + igt_assert_lte(0, dma_buf_fd); + } + + /* a userptr doesn't have the obj->base.filp, but can be exported via + * dma-buf, so make sure it fails here */ + ptr = mmap(NULL, BO_SIZE, PROT_READ, MAP_SHARED, dma_buf_fd, 0); + igt_assert(ptr == MAP_FAILED && errno == ENODEV); +free_userptr: + gem_close(fd, handle); + close(dma_buf_fd); +} + +static void +test_errors(void) +{ + int i, dma_buf_fd; + char *ptr; + uint32_t handle; + int invalid_flags[] = {DRM_CLOEXEC - 1, DRM_CLOEXEC + 1, + DRM_RDWR - 1, DRM_RDWR + 1}; + + /* Test for invalid flags */ + handle = gem_create(fd, BO_SIZE); + for (i = 0; i < sizeof(invalid_flags) / sizeof(invalid_flags[0]); i++) { + prime_handle_to_fd_no_assert(handle, invalid_flags[i], &dma_buf_fd); + igt_assert_eq(errno, EINVAL); + errno = 0; + } + + /* Close gem object before priming */ + handle = gem_create(fd, BO_SIZE); + fill_bo(handle, BO_SIZE); + gem_close(fd, handle); + prime_handle_to_fd_no_assert(handle, DRM_CLOEXEC, &dma_buf_fd); + igt_assert(dma_buf_fd == -1 && errno == ENOENT); + errno = 0; + + /* close fd before mapping */ + handle = gem_create(fd, BO_SIZE); + fill_bo(handle, BO_SIZE); + dma_buf_fd = prime_handle_to_fd(fd, handle); + igt_assert(errno == 0); + close(dma_buf_fd); + ptr = mmap(NULL, BO_SIZE, PROT_READ, MAP_SHARED, dma_buf_fd, 0); + igt_assert(ptr == MAP_FAILED && errno == EBADF); + errno = 0; + gem_close(fd, handle); + + /* Map too big */ + handle = gem_create(fd, BO_SIZE); + fill_bo(handle, BO_SIZE); + dma_buf_fd = prime_handle_to_fd(fd, handle); + igt_assert(errno == 0); + ptr = mmap(NULL, BO_SIZE * 2, PROT_READ, MAP_SHARED, dma_buf_fd, 0); + igt_assert(ptr == MAP_FAILED && errno == EINVAL); + errno = 0; + close(dma_buf_fd); + gem_close(fd, handle); + + /* Overlapping the end of the buffer */ + handle = gem_create(fd, BO_SIZE); + dma_buf_fd = prime_handle_to_fd(fd, handle); + igt_assert(errno == 0); + ptr = mmap(NULL, BO_SIZE, PROT_READ, MAP_SHARED, dma_buf_fd, BO_SIZE / 2); + igt_assert(ptr == MAP_FAILED && errno == EINVAL); + errno = 0; + close(dma_buf_fd); + gem_close(fd, handle); +} + +/* Test for invalid flags on sync ioctl */ +static void +test_invalid_sync_flags(void) +{ + int i, dma_buf_fd; + uint32_t handle; + struct local_dma_buf_sync sync; + int invalid_flags[] = {-1, + 0x00, + LOCAL_DMA_BUF_SYNC_RW + 1, + LOCAL_DMA_BUF_SYNC_VALID_FLAGS_MASK + 1}; + + handle = gem_create(fd, BO_SIZE); + dma_buf_fd = prime_handle_to_fd(fd, handle); + for (i = 0; i < sizeof(invalid_flags) / sizeof(invalid_flags[0]); i++) { + memset(&sync, 0, sizeof(sync)); + sync.flags = invalid_flags[i]; + + drmIoctl(dma_buf_fd, LOCAL_DMA_BUF_IOCTL_SYNC, &sync); + igt_assert_eq(errno, EINVAL); + errno = 0; + } +} + +static void +test_aperture_limit(void) +{ + int dma_buf_fd1, dma_buf_fd2; + char *ptr1, *ptr2; + uint32_t handle1, handle2; + /* Two buffers the sum of which > mappable aperture */ + uint64_t size1 = (gem_mappable_aperture_size() * 7) / 8; + uint64_t size2 = (gem_mappable_aperture_size() * 3) / 8; + + handle1 = gem_create(fd, size1); + fill_bo(handle1, BO_SIZE); + + dma_buf_fd1 = prime_handle_to_fd(fd, handle1); + igt_assert(errno == 0); + ptr1 = mmap(NULL, size1, PROT_READ, MAP_SHARED, dma_buf_fd1, 0); + igt_assert(ptr1 != MAP_FAILED); + igt_assert(memcmp(ptr1, pattern, sizeof(pattern)) == 0); + + handle2 = gem_create(fd, size1); + fill_bo(handle2, BO_SIZE); + dma_buf_fd2 = prime_handle_to_fd(fd, handle2); + igt_assert(errno == 0); + ptr2 = mmap(NULL, size2, PROT_READ, MAP_SHARED, dma_buf_fd2, 0); + igt_assert(ptr2 != MAP_FAILED); + igt_assert(memcmp(ptr2, pattern, sizeof(pattern)) == 0); + + igt_assert(memcmp(ptr1, ptr2, BO_SIZE) == 0); + + munmap(ptr1, size1); + munmap(ptr2, size2); + close(dma_buf_fd1); + close(dma_buf_fd2); + gem_close(fd, handle1); + gem_close(fd, handle2); +} + +static int +check_for_dma_buf_mmap(void) +{ + int dma_buf_fd; + char *ptr; + uint32_t handle; + int ret = 1; + + handle = gem_create(fd, BO_SIZE); + dma_buf_fd = prime_handle_to_fd(fd, handle); + ptr = mmap(NULL, BO_SIZE, PROT_READ, MAP_SHARED, dma_buf_fd, 0); + if (ptr != MAP_FAILED) + ret = 0; + munmap(ptr, BO_SIZE); + gem_close(fd, handle); + close(dma_buf_fd); + return ret; +} + +igt_main +{ + struct { + const char *name; + void (*fn)(void); + } tests[] = { + { "test_correct", test_correct }, + { "test_map_unmap", test_map_unmap }, + { "test_reprime", test_reprime }, + { "test_forked", test_forked }, + { "test_correct_cpu_write", test_correct_cpu_write }, + { "test_forked_cpu_write", test_forked_cpu_write }, + { "test_refcounting", test_refcounting }, + { "test_dup", test_dup }, + { "test_userptr", test_userptr }, + { "test_errors", test_errors }, + { "test_invalid_sync_flags", test_invalid_sync_flags }, + { "test_aperture_limit", test_aperture_limit }, + }; + int i; + + igt_fixture { + fd = drm_open_driver(DRIVER_INTEL); + igt_skip_on((check_for_dma_buf_mmap() != 0)); + errno = 0; + } + + + for (i = 0; i < ARRAY_SIZE(tests); i++) { + igt_subtest(tests[i].name) + tests[i].fn(); + } + + igt_fixture + close(fd); +} diff -Nru intel-gpu-tools-1.13/tests/prime_mmap_coherency.c intel-gpu-tools-1.15/tests/prime_mmap_coherency.c --- intel-gpu-tools-1.13/tests/prime_mmap_coherency.c 1970-01-01 00:00:00.000000000 +0000 +++ intel-gpu-tools-1.15/tests/prime_mmap_coherency.c 2016-05-23 10:51:28.000000000 +0000 @@ -0,0 +1,353 @@ +/* + * Copyright © 2015 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: + * Tiago Vignatti + */ + +/** @file prime_mmap_coherency.c + * + * TODO: need to show the need for prime_sync_end(). + */ + +#include "igt.h" + +IGT_TEST_DESCRIPTION("Test dma-buf mmap on !llc platforms mostly and provoke" + " coherency bugs so we know for sure where we need the sync ioctls."); + +#define ROUNDS 20 + +int fd; +int stale = 0; +static drm_intel_bufmgr *bufmgr; +struct intel_batchbuffer *batch; +static int width = 1024, height = 1024; + +/* + * Exercises the need for read flush: + * 1. create a BO and write '0's, in GTT domain. + * 2. read BO using the dma-buf CPU mmap. + * 3. write '1's, in GTT domain. + * 4. read again through the mapped dma-buf. + */ +static void test_read_flush(bool expect_stale_cache) +{ + drm_intel_bo *bo_1; + drm_intel_bo *bo_2; + uint32_t *ptr_cpu; + uint32_t *ptr_gtt; + int dma_buf_fd, i; + + if (expect_stale_cache) + igt_require(!gem_has_llc(fd)); + + bo_1 = drm_intel_bo_alloc(bufmgr, "BO 1", width * height * 4, 4096); + + /* STEP #1: put the BO 1 in GTT domain. We use the blitter to copy and fill + * zeros to BO 1, so commands will be submitted and likely to place BO 1 in + * the GTT domain. */ + bo_2 = drm_intel_bo_alloc(bufmgr, "BO 2", width * height * 4, 4096); + intel_copy_bo(batch, bo_1, bo_2, width * height); + gem_sync(fd, bo_1->handle); + drm_intel_bo_unreference(bo_2); + + /* STEP #2: read BO 1 using the dma-buf CPU mmap. This dirties the CPU caches. */ + dma_buf_fd = prime_handle_to_fd_for_mmap(fd, bo_1->handle); + igt_skip_on(errno == EINVAL); + + ptr_cpu = mmap(NULL, width * height, PROT_READ | PROT_WRITE, + MAP_SHARED, dma_buf_fd, 0); + igt_assert(ptr_cpu != MAP_FAILED); + + for (i = 0; i < (width * height) / 4; i++) + igt_assert_eq(ptr_cpu[i], 0); + + /* STEP #3: write 0x11 into BO 1. */ + bo_2 = drm_intel_bo_alloc(bufmgr, "BO 2", width * height * 4, 4096); + ptr_gtt = gem_mmap__gtt(fd, bo_2->handle, width * height, PROT_READ | PROT_WRITE); + memset(ptr_gtt, 0x11, width * height); + munmap(ptr_gtt, width * height); + + intel_copy_bo(batch, bo_1, bo_2, width * height); + gem_sync(fd, bo_1->handle); + drm_intel_bo_unreference(bo_2); + + /* STEP #4: read again using the CPU mmap. Doing #1 before #3 makes sure we + * don't do a full CPU cache flush in step #3 again. That makes sure all the + * stale cachelines from step #2 survive (mostly, a few will be evicted) + * until we try to read them again in step #4. This behavior could be fixed + * by flush CPU read right before accessing the CPU pointer */ + if (!expect_stale_cache) + prime_sync_start(dma_buf_fd, false); + + for (i = 0; i < (width * height) / 4; i++) + if (ptr_cpu[i] != 0x11111111) { + igt_warn_on_f(!expect_stale_cache, + "Found 0x%08x at offset 0x%08x\n", ptr_cpu[i], i); + stale++; + } + + drm_intel_bo_unreference(bo_1); + munmap(ptr_cpu, width * height); +} + +/* + * Exercises the need for write flush: + * 1. create BO 1 and write '0's, in GTT domain. + * 2. write '1's into BO 1 using the dma-buf CPU mmap. + * 3. copy BO 1 to new BO 2, in GTT domain. + * 4. read via dma-buf mmap BO 2. + */ +static void test_write_flush(bool expect_stale_cache) +{ + drm_intel_bo *bo_1; + drm_intel_bo *bo_2; + uint32_t *ptr_cpu; + uint32_t *ptr2_cpu; + int dma_buf_fd, dma_buf2_fd, i; + + if (expect_stale_cache) + igt_require(!gem_has_llc(fd)); + + bo_1 = drm_intel_bo_alloc(bufmgr, "BO 1", width * height * 4, 4096); + + /* STEP #1: Put the BO 1 in GTT domain. We use the blitter to copy and fill + * zeros to BO 1, so commands will be submitted and likely to place BO 1 in + * the GTT domain. */ + bo_2 = drm_intel_bo_alloc(bufmgr, "BO 2", width * height * 4, 4096); + intel_copy_bo(batch, bo_1, bo_2, width * height); + gem_sync(fd, bo_1->handle); + drm_intel_bo_unreference(bo_2); + + /* STEP #2: Write '1's into BO 1 using the dma-buf CPU mmap. */ + dma_buf_fd = prime_handle_to_fd_for_mmap(fd, bo_1->handle); + igt_skip_on(errno == EINVAL); + + ptr_cpu = mmap(NULL, width * height, PROT_READ | PROT_WRITE, + MAP_SHARED, dma_buf_fd, 0); + igt_assert(ptr_cpu != MAP_FAILED); + + /* This is the main point of this test: !llc hw requires a cache write + * flush right here (explained in step #4). */ + if (!expect_stale_cache) + prime_sync_start(dma_buf_fd, true); + + memset(ptr_cpu, 0x11, width * height); + + /* STEP #3: Copy BO 1 into BO 2, using blitter. */ + bo_2 = drm_intel_bo_alloc(bufmgr, "BO 2", width * height * 4, 4096); + intel_copy_bo(batch, bo_2, bo_1, width * height); + gem_sync(fd, bo_2->handle); + + /* STEP #4: compare BO 2 against written BO 1. In !llc hardware, there + * should be some cache lines that didn't get flushed out and are still 0, + * requiring cache flush before the write in step 2. */ + dma_buf2_fd = prime_handle_to_fd_for_mmap(fd, bo_2->handle); + igt_skip_on(errno == EINVAL); + + ptr2_cpu = mmap(NULL, width * height, PROT_READ | PROT_WRITE, + MAP_SHARED, dma_buf2_fd, 0); + igt_assert(ptr2_cpu != MAP_FAILED); + + for (i = 0; i < (width * height) / 4; i++) + if (ptr2_cpu[i] != 0x11111111) { + igt_warn_on_f(!expect_stale_cache, + "Found 0x%08x at offset 0x%08x\n", ptr2_cpu[i], i); + stale++; + } + + drm_intel_bo_unreference(bo_1); + drm_intel_bo_unreference(bo_2); + munmap(ptr_cpu, width * height); +} + +static void blit_and_cmp(void) +{ + drm_intel_bo *bo_1; + drm_intel_bo *bo_2; + uint32_t *ptr_cpu; + uint32_t *ptr2_cpu; + int dma_buf_fd, dma_buf2_fd, i; + int local_fd; + drm_intel_bufmgr *local_bufmgr; + struct intel_batchbuffer *local_batch; + + /* recreate process local variables */ + local_fd = drm_open_driver(DRIVER_INTEL); + local_bufmgr = drm_intel_bufmgr_gem_init(local_fd, 4096); + igt_assert(local_bufmgr); + + local_batch = intel_batchbuffer_alloc(local_bufmgr, intel_get_drm_devid(local_fd)); + igt_assert(local_batch); + + bo_1 = drm_intel_bo_alloc(local_bufmgr, "BO 1", width * height * 4, 4096); + dma_buf_fd = prime_handle_to_fd_for_mmap(local_fd, bo_1->handle); + igt_skip_on(errno == EINVAL); + + ptr_cpu = mmap(NULL, width * height, PROT_READ | PROT_WRITE, + MAP_SHARED, dma_buf_fd, 0); + igt_assert(ptr_cpu != MAP_FAILED); + + bo_2 = drm_intel_bo_alloc(local_bufmgr, "BO 2", width * height * 4, 4096); + dma_buf2_fd = prime_handle_to_fd_for_mmap(local_fd, bo_2->handle); + + ptr2_cpu = mmap(NULL, width * height, PROT_READ | PROT_WRITE, + MAP_SHARED, dma_buf2_fd, 0); + igt_assert(ptr2_cpu != MAP_FAILED); + + /* Fill up BO 1 with '1's and BO 2 with '0's */ + prime_sync_start(dma_buf_fd, true); + memset(ptr_cpu, 0x11, width * height); + prime_sync_end(dma_buf_fd, true); + + prime_sync_start(dma_buf2_fd, true); + memset(ptr2_cpu, 0x00, width * height); + prime_sync_end(dma_buf2_fd, true); + + /* Copy BO 1 into BO 2, using blitter. */ + intel_copy_bo(local_batch, bo_2, bo_1, width * height); + usleep(0); /* let someone else claim the mutex */ + + /* Compare BOs. If prime_sync_* were executed properly, the caches + * should be synced. */ + prime_sync_start(dma_buf2_fd, false); + for (i = 0; i < (width * height) / 4; i++) + igt_fail_on_f(ptr2_cpu[i] != 0x11111111, "Found 0x%08x at offset 0x%08x\n", ptr2_cpu[i], i); + prime_sync_end(dma_buf2_fd, false); + + drm_intel_bo_unreference(bo_1); + drm_intel_bo_unreference(bo_2); + munmap(ptr_cpu, width * height); + munmap(ptr2_cpu, width * height); + + close(dma_buf_fd); + close(dma_buf2_fd); + + intel_batchbuffer_free(local_batch); + drm_intel_bufmgr_destroy(local_bufmgr); + close(local_fd); +} + +/* + * Constantly interrupt concurrent blits to stress out prime_sync_* and make + * sure these ioctl errors are handled accordingly. + * + * Important to note that in case of failure (e.g. in a case where the ioctl + * wouldn't try again in a return error) this test does not reliably catch the + * problem with 100% of accuracy. + */ +static void test_ioctl_errors(void) +{ + int ncpus = sysconf(_SC_NPROCESSORS_ONLN); + + /* Ensure we can do at least one child */ + intel_require_memory(2, width*height*4, CHECK_RAM); + + for (int num_children = 1; num_children <= 8 *ncpus; num_children <<= 1) { + uint64_t required, total; + + igt_info("Spawing %d interruptible children\n", num_children); + if (!__intel_check_memory(2*num_children, + width*height*4, + CHECK_RAM, + &required, &total)) { + igt_debug("Estimated that we need %'lluMiB for test, but only have %'lluMiB\n", + (long long)(required >> 20), + (long long)(total >> 20)); + break; + } + + igt_fork(child, num_children) + igt_while_interruptible(true) blit_and_cmp(); + igt_waitchildren(); + } +} + +int main(int argc, char **argv) +{ + int i; + bool expect_stale_cache; + igt_subtest_init(argc, argv); + + igt_fixture { + fd = drm_open_driver(DRIVER_INTEL); + + bufmgr = drm_intel_bufmgr_gem_init(fd, 4096); + batch = intel_batchbuffer_alloc(bufmgr, intel_get_drm_devid(fd)); + } + + /* Cache coherency and the eviction are pretty much unpredictable, so + * reproducing boils down to trial and error to hit different scenarios. + * TODO: We may want to improve tests a bit by picking random subranges. */ + igt_info("%d rounds for each test\n", ROUNDS); + igt_subtest("read") { + stale = 0; + expect_stale_cache = false; + igt_info("exercising read flush\n"); + for (i = 0; i < ROUNDS; i++) + test_read_flush(expect_stale_cache); + igt_fail_on_f(stale, "num of stale cache lines %d\n", stale); + } + + /* Only for !llc platforms */ + igt_subtest("read-and-fail") { + stale = 0; + expect_stale_cache = true; + igt_info("exercising read flush and expect to fail on !llc\n"); + for (i = 0; i < ROUNDS; i++) + test_read_flush(expect_stale_cache); + igt_fail_on_f(!stale, "couldn't find any stale cache lines\n"); + } + + igt_subtest("write") { + stale = 0; + expect_stale_cache = false; + igt_info("exercising write flush\n"); + for (i = 0; i < ROUNDS; i++) + test_write_flush(expect_stale_cache); + igt_fail_on_f(stale, "num of stale cache lines %d\n", stale); + } + + /* Only for !llc platforms */ + igt_subtest("write-and-fail") { + stale = 0; + expect_stale_cache = true; + igt_info("exercising write flush and expect to fail on !llc\n"); + for (i = 0; i < ROUNDS; i++) + test_write_flush(expect_stale_cache); + igt_fail_on_f(!stale, "couldn't find any stale cache lines\n"); + } + + igt_subtest("ioctl-errors") { + igt_info("exercising concurrent blit to get ioctl errors\n"); + test_ioctl_errors(); + } + + igt_fixture { + intel_batchbuffer_free(batch); + drm_intel_bufmgr_destroy(bufmgr); + + close(fd); + } + + igt_exit(); +} diff -Nru intel-gpu-tools-1.13/tests/prime_mmap_kms.c intel-gpu-tools-1.15/tests/prime_mmap_kms.c --- intel-gpu-tools-1.13/tests/prime_mmap_kms.c 1970-01-01 00:00:00.000000000 +0000 +++ intel-gpu-tools-1.15/tests/prime_mmap_kms.c 2016-05-23 10:51:28.000000000 +0000 @@ -0,0 +1,275 @@ +/* + * Copyright © 2016 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: + * Tiago Vignatti + */ + +/* + * Testcase: show case dma-buf new API and processes restrictions. Most likely + * you want to run like ./prime_mmap_kms --interactive-debug=paint, to see the + * actual rectangle painted on the screen. + */ + +#include "igt.h" + +IGT_TEST_DESCRIPTION( + "Efficiently sharing CPU and GPU buffers"); + +/* + * render_process_t: + * + * Render is basically a user-space regular client. It's the unprivileged + * process with limited system accesses. + * + * Worth note the vendor-independent characteristic, meaning that the + * client doesn't need to perform any vendor specific calls for buffer + * handling. Mesa GBM library is a counter-example because, even though its API + * is vendor-independent, under-the-hood the library actually calls vendor + * specific ioctls, which is not really sandboxable and not the goal here. + */ +typedef struct { + int prime_fd; + size_t size; + int width; + int height; +} render_process_t; + +typedef struct { + int x; + int y; + int w; + int h; +} rect_t; + +/* set ptr in a linear view */ +static void set_pixel(void *_ptr, int index, uint32_t color, int bpp) +{ + if (bpp == 16) { + uint16_t *ptr = _ptr; + ptr[index] = color; + } else if (bpp == 32) { + uint32_t *ptr = _ptr; + ptr[index] = color; + } else { + igt_assert_f(false, "bpp: %d\n", bpp); + } +} + +static void paint(render_process_t *render) +{ + void *frame; + rect_t rect = { + .x = 200, + .y = 200, + .w = render->width / 4, + .h = render->height / 4, + }; + uint32_t color = 0xFF; + int stride, bpp; + int x, y, line_begin; + + frame = mmap(NULL, render->size, PROT_READ | PROT_WRITE, MAP_SHARED, + render->prime_fd, 0); + igt_assert(frame != MAP_FAILED); + + /* TODO: what's the mmap'ed buffer semantics on tiling, format etc. How + * does the client know whether that the BO was created X-tiled, + * Y-tiled and how it will map back? This is something we need to + * address in this API still. */ + stride = render->width * 4; + bpp = 32; + + /* ioctls to keep up the GPU <-> CPU coherency */ + prime_sync_start(render->prime_fd, true); + + /* the actual painting phase happens here */ + for (y = rect.y; y < rect.y + rect.h; y++) { + line_begin = y * stride / (bpp / 8); + for (x = rect.x; x < rect.x + rect.w; x++) + set_pixel(frame, line_begin + x, color, bpp); + } + + prime_sync_end(render->prime_fd, true); + munmap(frame, render->size); +} + +static void init_renderer(int prime_fd, int fb_size, int width, int height) +{ + render_process_t render; + + render.prime_fd = prime_fd; + render.size = fb_size; + render.width = width; + render.height = height; + paint(&render); +} + +/* + * gpu_process_t: + * + * GPU process is the privileged process and has access to the system graphics + * routines, like DRM, display management and driver accesses. + */ +typedef struct { + int drm_fd; + igt_display_t display; + struct igt_fb fb; + igt_output_t *output; + igt_plane_t *primary; + enum pipe pipe; +} gpu_process_t; + +static void cleanup_crtc(gpu_process_t *gpu) +{ + igt_display_t *display = &gpu->display; + igt_output_t *output = gpu->output; + + igt_plane_set_fb(gpu->primary, NULL); + + igt_output_set_pipe(output, PIPE_ANY); + igt_display_commit(display); + + igt_remove_fb(gpu->drm_fd, &gpu->fb); +} + +static bool prepare_crtc(gpu_process_t *gpu) +{ + igt_display_t *display = &gpu->display; + igt_output_t *output = gpu->output; + drmModeModeInfo *mode; + + /* select the pipe we want to use */ + igt_output_set_pipe(output, gpu->pipe); + igt_display_commit(display); + + if (!output->valid) { + igt_output_set_pipe(output, PIPE_ANY); + igt_display_commit(display); + return false; + } + + mode = igt_output_get_mode(output); + + /* create a white fb and flip to it */ + igt_create_color_fb(gpu->drm_fd, mode->hdisplay, mode->vdisplay, + DRM_FORMAT_XRGB8888, LOCAL_DRM_FORMAT_MOD_NONE, + 1.0, 1.0, 1.0, &gpu->fb); + + gpu->primary = igt_output_get_plane(output, IGT_PLANE_PRIMARY); + + igt_plane_set_fb(gpu->primary, &gpu->fb); + igt_display_commit(display); + + return true; +} + +/* + * The idea is to create a BO (in this case the framebuffer's) in one process, + * export and pass its prime fd to another process, which in turn uses the fd + * to map and write. This is Chrome-like architectures, where the Web content + * (a "tab" or the "unprivileged process") maps and CPU-paints a buffer, which + * was previously allocated in the GPU process ("privileged process"). + */ +static void run_test(gpu_process_t *gpu) +{ + igt_display_t *display = &gpu->display; + igt_output_t *output; + enum pipe pipe; + int prime_fd; + + for_each_connected_output(display, output) { + gpu->output = output; + for_each_pipe(display, pipe) { + gpu->pipe = pipe; + + if (!prepare_crtc(gpu)) + continue; + + prime_fd = prime_handle_to_fd_for_mmap(gpu->drm_fd, + gpu->fb.gem_handle); + igt_skip_on(prime_fd == -1 && errno == EINVAL); + + /* Note that it only shares the dma-buf fd and some + * other basic info */ + igt_fork(renderer_no, 1) { + init_renderer(prime_fd, gpu->fb.size, gpu->fb.width, + gpu->fb.height); + } + igt_waitchildren(); + + igt_debug_wait_for_keypress("paint"); + cleanup_crtc(gpu); + + /* once is enough */ + return; + } + } + + igt_skip("no valid crtc/connector combinations found\n"); +} + +static int +check_for_dma_buf_mmap(int fd) +{ + int dma_buf_fd; + char *ptr; + uint32_t handle; + int ret = 1; + + handle = gem_create(fd, 4096); + dma_buf_fd = prime_handle_to_fd(fd, handle); + ptr = mmap(NULL, 4096, PROT_READ, MAP_SHARED, dma_buf_fd, 0); + if (ptr != MAP_FAILED) + ret = 0; + munmap(ptr, 4096); + gem_close(fd, handle); + close(dma_buf_fd); + return ret; +} + +igt_main +{ + gpu_process_t gpu; + + igt_skip_on_simulation(); + + igt_fixture { + gpu.drm_fd = drm_open_driver_master(DRIVER_INTEL); + igt_skip_on((check_for_dma_buf_mmap(gpu.drm_fd) != 0)); + kmstest_set_vt_graphics_mode(); + + igt_require_pipe_crc(); + + igt_display_init(&gpu.display, gpu.drm_fd); + } + + igt_subtest("buffer-sharing") + run_test(&gpu); + + igt_fixture { + igt_display_fini(&gpu.display); + close(gpu.drm_fd); + } + + igt_exit(); +} diff -Nru intel-gpu-tools-1.13/tests/prime_self_import.c intel-gpu-tools-1.15/tests/prime_self_import.c --- intel-gpu-tools-1.13/tests/prime_self_import.c 2015-11-30 16:26:23.000000000 +0000 +++ intel-gpu-tools-1.15/tests/prime_self_import.c 2016-05-23 10:51:28.000000000 +0000 @@ -47,7 +47,7 @@ #include "drm.h" IGT_TEST_DESCRIPTION("Check whether prime import/export works on the same" - " device."); + " device... but with different fds."); #define BO_SIZE (16*1024) @@ -157,7 +157,7 @@ dma_buf_fd2 = prime_handle_to_fd(fd2, handle_open); handle_import = prime_fd_to_handle(fd2, dma_buf_fd2); - /* dma-buf selfimporting an flink bo should give the same handle */ + /* dma-buf self importing an flink bo should give the same handle */ igt_assert_eq_u32(handle_import, handle_open); close(fd1); @@ -211,21 +211,6 @@ check_bo(fd2, handle_import1, fd2, handle_import1); } -static int get_object_count(void) -{ - FILE *file; - int ret, scanned; - - igt_drop_caches_set(DROP_RETIRE | DROP_ACTIVE); - - file = igt_debugfs_fopen("i915_gem_objects", "r"); - - scanned = fscanf(file, "%i objects", &ret); - igt_assert_eq(scanned, 1); - - return ret; -} - static void *thread_fn_reimport_vs_close(void *p) { struct drm_gem_close close_bo; @@ -258,8 +243,7 @@ * up the counts */ fake = drm_open_driver(DRIVER_INTEL); - gem_quiescent_gpu(fake); - obj_count = get_object_count(); + obj_count = igt_get_stable_obj_count(fake); num_threads = sysconf(_SC_NPROCESSORS_ONLN); @@ -290,8 +274,7 @@ close(fds[0]); close(fds[1]); - gem_quiescent_gpu(fake); - obj_count = get_object_count() - obj_count; + obj_count = igt_get_stable_obj_count(fake) - obj_count; igt_info("leaked %i objects\n", obj_count); @@ -350,8 +333,7 @@ * up the counts */ fake = drm_open_driver(DRIVER_INTEL); - gem_quiescent_gpu(fake); - obj_count = get_object_count(); + obj_count = igt_get_stable_obj_count(fake); fd = drm_open_driver(DRIVER_INTEL); @@ -373,8 +355,7 @@ close(fd); - gem_quiescent_gpu(fake); - obj_count = get_object_count() - obj_count; + obj_count = igt_get_stable_obj_count(fake) - obj_count; igt_info("leaked %i objects\n", obj_count); diff -Nru intel-gpu-tools-1.13/tests/sysfs_l3_parity intel-gpu-tools-1.15/tests/sysfs_l3_parity --- intel-gpu-tools-1.13/tests/sysfs_l3_parity 2015-08-06 15:22:11.000000000 +0000 +++ intel-gpu-tools-1.15/tests/sysfs_l3_parity 2016-05-23 10:51:28.000000000 +0000 @@ -5,7 +5,7 @@ if ! find /sys/class/drm/card*/ | grep l3_parity > /dev/null ; then echo "no l3_parity interface, skipping test" - exit 77 + exit $IGT_EXIT_SKIP fi $SOURCE_DIR/../tools/intel_l3_parity -r 0 -b 0 -s 0 -e @@ -15,7 +15,7 @@ disabled=`$SOURCE_DIR/../tools/intel_l3_parity -l | grep -c 'Row 0, Bank 0, Subbank 0 is disabled'` if [ "$disabled" != "1" ] ; then echo "Fail" - exit 1 + exit $IGT_EXIT_FAILURE fi $SOURCE_DIR/../tools/intel_l3_parity -r 0 -b 0 -s 0 -e @@ -23,5 +23,5 @@ #Check that we can clear remaps if [ `$SOURCE_DIR/../tools/intel_l3_parity -l | wc -l` != 1 ] ; then echo "Fail 2" - exit 1 + exit $IGT_EXIT_FAILURE fi diff -Nru intel-gpu-tools-1.13/tests/testdisplay.c intel-gpu-tools-1.15/tests/testdisplay.c --- intel-gpu-tools-1.13/tests/testdisplay.c 2015-11-30 16:26:23.000000000 +0000 +++ intel-gpu-tools-1.15/tests/testdisplay.c 2016-05-23 10:51:28.000000000 +0000 @@ -132,7 +132,8 @@ for (i = 0; i < mode_resources->count_connectors; i++) { drmModeConnector *connector; - connector = drmModeGetConnector(drmfd, mode_resources->connectors[i]); + connector = drmModeGetConnectorCurrent(drmfd, + mode_resources->connectors[i]); if (!connector) { igt_warn("could not get connector %i: %s\n", mode_resources->connectors[i], strerror(errno)); continue; @@ -190,12 +191,19 @@ static void connector_find_preferred_mode(uint32_t connector_id, unsigned long crtc_idx_mask, - int mode_num, struct connector *c) + int mode_num, struct connector *c, + bool probe) { struct kmstest_connector_config config; + bool ret; - if (!kmstest_get_connector_config(drm_fd, connector_id, crtc_idx_mask, - &config)) { + if (probe) + ret = kmstest_probe_connector_config(drm_fd, connector_id, + crtc_idx_mask, &config); + else + ret = kmstest_get_connector_config(drm_fd, connector_id, + crtc_idx_mask, &config); + if (!ret) { c->mode_valid = 0; return; } @@ -218,21 +226,15 @@ static void paint_color_key(struct igt_fb *fb_info) { - int i, j; - uint32_t *fb_ptr; - - fb_ptr = gem_mmap__gtt(drm_fd, fb_info->gem_handle, fb_info->size, - PROT_READ | PROT_WRITE); + cairo_t *cr = igt_get_cairo_ctx(drm_fd, fb_info); - for (i = crtc_y; i < crtc_y + crtc_h; i++) - for (j = crtc_x; j < crtc_x + crtc_w; j++) { - uint32_t offset; + cairo_rectangle(cr, crtc_x, crtc_y, crtc_w, crtc_h); + cairo_set_source_rgb(cr, .8, .8, .8); + cairo_fill(cr); - offset = (i * fb_info->stride / 4) + j; - fb_ptr[offset] = SPRITE_COLOR_KEY; - } + igt_assert(!cairo_status(cr)); - munmap(fb_ptr, fb_info->size); + cairo_destroy(cr); } static void paint_image(cairo_t *cr, const char *file) @@ -258,8 +260,6 @@ double max_width; int i; - igt_paint_test_pattern(cr, l_width, l_height); - cairo_move_to(cr, l_width / 2, l_height / 2); /* Print connector and mode name */ @@ -352,9 +352,9 @@ width = c->mode.hdisplay; height = c->mode.vdisplay; - fb_id = igt_create_fb(drm_fd, width, height, - igt_bpp_depth_to_drm_format(bpp, depth), - tiling, &fb_info[current_fb]); + fb_id = igt_create_pattern_fb(drm_fd, width, height, + igt_bpp_depth_to_drm_format(bpp, depth), + tiling, &fb_info[current_fb]); paint_output_info(c, &fb_info[current_fb]); paint_color_key(&fb_info[current_fb]); @@ -457,7 +457,7 @@ * Each connector has a corresponding encoder, except in the SDVO case * where an encoder may have multiple connectors. */ -int update_display(void) +int update_display(bool probe) { struct connector *connectors; int c; @@ -489,7 +489,7 @@ connector_find_preferred_mode(connector->id, crtc_idx_mask, specified_mode_num, - connector); + connector, probe); if (!connector->mode_valid) continue; @@ -514,7 +514,7 @@ connector_find_preferred_mode(connector->id, -1UL, specified_mode_num, - connector); + connector, probe); if (!connector->mode_valid) continue; @@ -724,7 +724,7 @@ specified_mode_num == -1 && !test_stereo_modes) test_all_modes = 1; - drm_fd = drm_open_driver(DRIVER_INTEL); + drm_fd = drm_open_driver(DRIVER_ANY); if (test_stereo_modes && drmSetClientCap(drm_fd, DRM_CLIENT_CAP_STEREO_3D, 1) < 0) { @@ -766,7 +766,7 @@ ret = 0; - if (!update_display()) { + if (!update_display(false)) { ret = 1; goto out_stdio; } diff -Nru intel-gpu-tools-1.13/tests/testdisplay.h intel-gpu-tools-1.15/tests/testdisplay.h --- intel-gpu-tools-1.13/tests/testdisplay.h 2015-11-30 16:15:31.000000000 +0000 +++ intel-gpu-tools-1.15/tests/testdisplay.h 2016-05-23 10:51:28.000000000 +0000 @@ -32,4 +32,4 @@ void testdisplay_cleanup_hotplug(void); /* called by the hotplug code */ -int update_display(void); +int update_display(bool probe); diff -Nru intel-gpu-tools-1.13/tests/testdisplay_hotplug.c intel-gpu-tools-1.15/tests/testdisplay_hotplug.c --- intel-gpu-tools-1.13/tests/testdisplay_hotplug.c 2015-11-30 16:15:31.000000000 +0000 +++ intel-gpu-tools-1.15/tests/testdisplay_hotplug.c 2016-05-23 10:51:28.000000000 +0000 @@ -59,7 +59,7 @@ if (memcmp(&s.st_rdev, &udev_devnum, sizeof(dev_t)) == 0 && hotplug && atoi(hotplug) == 1) - update_display(); + update_display(true); udev_device_unref(dev); out: diff -Nru intel-gpu-tools-1.13/tests/test_rte_check intel-gpu-tools-1.15/tests/test_rte_check --- intel-gpu-tools-1.13/tests/test_rte_check 2015-08-06 15:22:11.000000000 +0000 +++ intel-gpu-tools-1.15/tests/test_rte_check 2016-05-23 10:51:28.000000000 +0000 @@ -3,4 +3,4 @@ SOURCE_DIR="$( dirname "${BASH_SOURCE[0]}" )" . $SOURCE_DIR/drm_lib.sh -exit 0 +exit $IGT_EXIT_SUCCESS diff -Nru intel-gpu-tools-1.13/tests/tools_test intel-gpu-tools-1.15/tests/tools_test --- intel-gpu-tools-1.13/tests/tools_test 2015-11-12 17:30:48.000000000 +0000 +++ intel-gpu-tools-1.15/tests/tools_test 2016-05-23 10:51:28.000000000 +0000 @@ -12,5 +12,5 @@ # TODO: Add more tests -exit 0 +exit $IGT_EXIT_SUCCESS diff -Nru intel-gpu-tools-1.13/tests/vc4_create_bo.c intel-gpu-tools-1.15/tests/vc4_create_bo.c --- intel-gpu-tools-1.13/tests/vc4_create_bo.c 1970-01-01 00:00:00.000000000 +0000 +++ intel-gpu-tools-1.15/tests/vc4_create_bo.c 2016-05-23 10:51:28.000000000 +0000 @@ -0,0 +1,89 @@ +/* + * Copyright © 2016 Broadcom + * + * 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 "igt.h" +#include "igt_vc4.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "vc4_drm.h" + +igt_main +{ + int fd; + + igt_fixture { + fd = drm_open_driver(DRIVER_VC4); + } + + igt_subtest("create-bo-4096") { + int handle = igt_vc4_create_bo(fd, 4096); + gem_close(fd, handle); + } + + igt_subtest("create-bo-0") { + struct drm_vc4_create_bo arg = { + .size = 0, + }; + do_ioctl_err(fd, DRM_IOCTL_VC4_CREATE_BO, &arg, EINVAL); + } + + igt_subtest("create-bo-zeroed") { + int fd2 = drm_open_driver(DRIVER_VC4); + int handle; + uint32_t *map; + /* A size different from any used in our other tests, to try + * to convince it to land as the only one of its size in the + * kernel BO cache + */ + size_t size = 3 * 4096, i; + + /* Make a BO and free it on our main fd. */ + handle = igt_vc4_create_bo(fd, size); + map = igt_vc4_mmap_bo(fd, handle, size, PROT_READ | PROT_WRITE); + memset(map, 0xd0, size); + munmap(map, size); + gem_close(fd, handle); + + /* Now, allocate a BO on the other fd and make sure it doesn't + * have the old contents. + */ + handle = igt_vc4_create_bo(fd2, size); + map = igt_vc4_mmap_bo(fd2, handle, size, PROT_READ | PROT_WRITE); + for (i = 0; i < size / 4; i++) + igt_assert_eq_u32(map[i], 0x0); + munmap(map, size); + gem_close(fd2, handle); + + close(fd2); + } + + igt_fixture + close(fd); +} diff -Nru intel-gpu-tools-1.13/tests/vc4_wait_bo.c intel-gpu-tools-1.15/tests/vc4_wait_bo.c --- intel-gpu-tools-1.13/tests/vc4_wait_bo.c 1970-01-01 00:00:00.000000000 +0000 +++ intel-gpu-tools-1.15/tests/vc4_wait_bo.c 2016-05-23 10:51:28.000000000 +0000 @@ -0,0 +1,123 @@ +/* + * Copyright © 2016 Broadcom + * + * 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 "igt.h" +#include "igt_vc4.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "vc4_drm.h" + +static void +test_used_bo(int fd, uint64_t timeout) +{ + size_t size = 4096; + uint32_t clearval = 0xaabbccdd + timeout; + int handle = igt_vc4_get_cleared_bo(fd, size, clearval); + struct drm_vc4_wait_bo wait = { + .timeout_ns = timeout, + .handle = handle, + }; + int ret, i; + + ret = ioctl(fd, DRM_IOCTL_VC4_WAIT_BO, &wait); + if (timeout == ~0ull) { + igt_assert_eq_u32(ret, 0); + } else { + if (ret == -1 && errno == ETIME) + igt_debug("Timeout triggered\n"); + igt_assert(ret == 0 || (ret == -1 && errno == ETIME)); + } + + if (ret == 0) { + uint32_t *map = igt_vc4_mmap_bo(fd, handle, size, PROT_READ); + for (i = 0; i < size / 4; i++) { + igt_assert_eq_u32(map[i], clearval); + } + munmap((void *)map, size); + } + + gem_close(fd, handle); +} + +igt_main +{ + int fd; + int bo_handle; + + igt_fixture { + fd = drm_open_driver(DRIVER_VC4); + bo_handle = igt_vc4_create_bo(fd, 4096); + } + + igt_subtest("bad-bo") { + struct drm_vc4_wait_bo arg = { + .handle = bo_handle + 1, + .timeout_ns = 0, + }; + do_ioctl_err(fd, DRM_IOCTL_VC4_WAIT_BO, &arg, EINVAL); + } + + igt_subtest("bad-pad") { + struct drm_vc4_wait_bo arg = { + .pad = 1, + .handle = bo_handle, + .timeout_ns = 0, + }; + do_ioctl_err(fd, DRM_IOCTL_VC4_WAIT_BO, &arg, EINVAL); + } + + igt_subtest("unused-bo-0ns") { + struct drm_vc4_wait_bo arg = { + .handle = bo_handle, + .timeout_ns = 0, + }; + do_ioctl(fd, DRM_IOCTL_VC4_WAIT_BO, &arg); + } + + igt_subtest("unused-bo-1ns") { + struct drm_vc4_wait_bo arg = { + .handle = bo_handle, + .timeout_ns = 1, + }; + do_ioctl(fd, DRM_IOCTL_VC4_WAIT_BO, &arg); + } + + igt_subtest("used-bo-0ns") + test_used_bo(fd, 0); + + igt_subtest("used-bo-1ns") + test_used_bo(fd, 1); + + igt_subtest("used-bo") + test_used_bo(fd, ~0ull); + + igt_fixture + close(fd); +} diff -Nru intel-gpu-tools-1.13/tests/vc4_wait_seqno.c intel-gpu-tools-1.15/tests/vc4_wait_seqno.c --- intel-gpu-tools-1.13/tests/vc4_wait_seqno.c 1970-01-01 00:00:00.000000000 +0000 +++ intel-gpu-tools-1.15/tests/vc4_wait_seqno.c 2016-05-23 10:51:28.000000000 +0000 @@ -0,0 +1,66 @@ +/* + * Copyright © 2016 Broadcom + * + * 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 "igt.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "vc4_drm.h" + +igt_main +{ + int fd; + + igt_fixture + fd = drm_open_driver(DRIVER_VC4); + + /* A 64-bit seqno should never hit the maximum value over the + * lifetime of the system. (A submit per 1000 cycles at 1Ghz + * would still take 584000 years). As a result, we can wait + * for it and be sure of a timeout. + */ + igt_subtest("bad-seqno-0ns") { + struct drm_vc4_wait_seqno arg = { + .seqno = ~0ull, + .timeout_ns = 0, + }; + do_ioctl_err(fd, DRM_IOCTL_VC4_WAIT_SEQNO, &arg, ETIME); + } + + igt_subtest("bad-seqno-1ns") { + struct drm_vc4_wait_seqno arg = { + .seqno = ~0ull, + .timeout_ns = 1, + }; + do_ioctl_err(fd, DRM_IOCTL_VC4_WAIT_SEQNO, &arg, ETIME); + } + + igt_fixture + close(fd); +} diff -Nru intel-gpu-tools-1.13/tools/aubdump.c intel-gpu-tools-1.15/tools/aubdump.c --- intel-gpu-tools-1.13/tools/aubdump.c 2015-11-12 17:30:48.000000000 +0000 +++ intel-gpu-tools-1.15/tools/aubdump.c 2016-05-23 10:51:28.000000000 +0000 @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -42,8 +43,11 @@ #include "intel_aub.h" #include "intel_chipset.h" -static int (*libc_close)(int fd); -static int (*libc_ioctl)(int fd, unsigned long request, void *argp); +static int close_init_helper(int fd); +static int ioctl_init_helper(int fd, unsigned long request, ...); + +static int (*libc_close)(int fd) = close_init_helper; +static int (*libc_ioctl)(int fd, unsigned long request, ...) = ioctl_init_helper; static int drm_fd = -1; static char *filename; @@ -106,7 +110,19 @@ vfprintf(stderr, format, args); va_end(args); - exit(1); + raise(SIGTRAP); +} + +static struct bo * +get_bo(uint32_t handle) +{ + struct bo *bo; + + fail_if(handle >= MAX_BO_COUNT, "bo handle too large\n"); + bo = &bos[handle]; + fail_if(bo->size == 0, "invalid bo handle (%d) in execbuf\n", handle); + + return bo; } static inline uint32_t @@ -262,7 +278,7 @@ handle = relocs[i].target_handle; dw = (uint32_t*)(((char *) relocated) + relocs[i].offset); - *dw = bos[handle].offset + relocs[i].delta; + *dw = get_bo(handle)->offset + relocs[i].delta; } return relocated; @@ -338,7 +354,7 @@ for (uint32_t i = 0; i < execbuffer2->buffer_count; i++) { obj = &exec_objects[i]; - bo = &bos[obj->handle]; + bo = get_bo(obj->handle); bo->offset = offset; offset = align_u32(offset + bo->size + 4095, 4096); @@ -348,10 +364,10 @@ fail_if(bo->map == MAP_FAILED, "intel_aubdump: bo mmap failed\n"); } - batch_bo = &bos[exec_objects[execbuffer2->buffer_count - 1].handle]; + batch_bo = get_bo(exec_objects[execbuffer2->buffer_count - 1].handle); for (uint32_t i = 0; i < execbuffer2->buffer_count; i++) { obj = &exec_objects[i]; - bo = &bos[obj->handle]; + bo = get_bo(obj->handle); if (obj->relocation_count > 0) data = relocate_bo(bo, execbuffer2, obj); @@ -390,7 +406,7 @@ static void remove_bo(int handle) { - struct bo *bo = &bos[handle]; + struct bo *bo = get_bo(handle); if (bo->map && !IS_USERPTR(bo->map)) munmap(bo->map, bo->size); @@ -527,7 +543,7 @@ } } -static void __attribute__ ((constructor)) +static void init(void) { const char *args = getenv("INTEL_AUBDUMP_ARGS"); @@ -552,6 +568,27 @@ fail_if(file == NULL, "intel_aubdump: failed to open file '%s'\n", filename); } +static int +close_init_helper(int fd) +{ + init(); + return libc_close(fd); +} + +static int +ioctl_init_helper(int fd, unsigned long request, ...) +{ + va_list args; + void *argp; + + va_start(args, request); + argp = va_arg(args, void *); + va_end(args); + + init(); + return libc_ioctl(fd, request, argp); +} + static void __attribute__ ((destructor)) fini(void) { diff -Nru intel-gpu-tools-1.13/tools/hsw_compute_wrpll.c intel-gpu-tools-1.15/tools/hsw_compute_wrpll.c --- intel-gpu-tools-1.13/tools/hsw_compute_wrpll.c 2015-11-12 17:30:48.000000000 +0000 +++ intel-gpu-tools-1.15/tools/hsw_compute_wrpll.c 2016-05-23 10:51:28.000000000 +0000 @@ -642,7 +642,7 @@ wrpll_compute_rnp(ref->clock, &r2, &n2, &p); igt_fail_on_f(ref->r2 != r2 || ref->n2 != n2 || ref->p != p, - "Computed value differs for %li Hz:\n"" Reference: (%u,%u,%u)\n"" Computed: (%u,%u,%u)\n", (int64_t)ref->clock * 1000, ref->r2, ref->n2, ref->p, r2, n2, p); + "Computed value differs for %"PRId64" Hz:\n"" Reference: (%u,%u,%u)\n"" Computed: (%u,%u,%u)\n", (int64_t)ref->clock * 1000, ref->r2, ref->n2, ref->p, r2, n2, p); } return 0; diff -Nru intel-gpu-tools-1.13/tools/intel_audio_dump.c intel-gpu-tools-1.15/tools/intel_audio_dump.c --- intel-gpu-tools-1.13/tools/intel_audio_dump.c 2015-11-12 17:30:48.000000000 +0000 +++ intel-gpu-tools-1.15/tools/intel_audio_dump.c 2016-05-23 10:51:28.000000000 +0000 @@ -2483,8 +2483,9 @@ || IS_BROADWELL(devid) || IS_HASWELL(devid)) { printf("%s audio registers:\n\n", IS_BROXTON(devid) ? "Broxton" : + (IS_KABYLAKE(devid) ? "Kabylake" : (IS_SKYLAKE(devid) ? "Skylake" : - (IS_BROADWELL(devid) ? "Broadwell" : "Haswell"))); + (IS_BROADWELL(devid) ? "Broadwell" : "Haswell")))); dump_hsw_plus(); } else if (IS_GEN6(devid) || IS_GEN7(devid) || getenv("HAS_PCH_SPLIT")) { diff -Nru intel-gpu-tools-1.13/tools/intel_bios.h intel-gpu-tools-1.15/tools/intel_bios.h --- intel-gpu-tools-1.13/tools/intel_bios.h 2015-11-12 17:30:48.000000000 +0000 +++ intel-gpu-tools-1.15/tools/intel_bios.h 2016-05-23 10:51:28.000000000 +0000 @@ -763,22 +763,31 @@ uint8_t data[0]; } __attribute__ ((packed)); -/* MIPI Sequnece Block definitions */ -enum MIPI_SEQ { - MIPI_SEQ_UNDEFINED = 0, +/* MIPI Sequence Block definitions */ +enum mipi_seq { + MIPI_SEQ_END = 0, MIPI_SEQ_ASSERT_RESET, MIPI_SEQ_INIT_OTP, MIPI_SEQ_DISPLAY_ON, MIPI_SEQ_DISPLAY_OFF, MIPI_SEQ_DEASSERT_RESET, + MIPI_SEQ_BACKLIGHT_ON, /* sequence block v2+ */ + MIPI_SEQ_BACKLIGHT_OFF, /* sequence block v2+ */ + MIPI_SEQ_TEAR_ON, /* sequence block v2+ */ + MIPI_SEQ_TEAR_OFF, /* sequence block v3+ */ + MIPI_SEQ_POWER_ON, /* sequence block v3+ */ + MIPI_SEQ_POWER_OFF, /* sequence block v3+ */ MIPI_SEQ_MAX }; -enum MIPI_SEQ_ELEMENT { - MIPI_SEQ_ELEM_UNDEFINED = 0, +enum mipi_seq_element { + MIPI_SEQ_ELEM_END = 0, MIPI_SEQ_ELEM_SEND_PKT, MIPI_SEQ_ELEM_DELAY, MIPI_SEQ_ELEM_GPIO, + MIPI_SEQ_ELEM_I2C, /* sequence block v2+ */ + MIPI_SEQ_ELEM_SPI, /* sequence block v3+ */ + MIPI_SEQ_ELEM_PMIC, /* sequence block v3+ */ MIPI_SEQ_ELEM_MAX }; diff -Nru intel-gpu-tools-1.13/tools/intel_bios_reader.c intel-gpu-tools-1.15/tools/intel_bios_reader.c --- intel-gpu-tools-1.13/tools/intel_bios_reader.c 2015-11-12 17:30:48.000000000 +0000 +++ intel-gpu-tools-1.15/tools/intel_bios_reader.c 2016-05-23 10:51:28.000000000 +0000 @@ -27,6 +27,7 @@ #include #include +#include #include #include #include @@ -40,8 +41,6 @@ #include "intel_chipset.h" #include "drmtest.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)) @@ -53,49 +52,48 @@ #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") +/* This is not for mapping to memory layout. */ struct bdb_block { uint8_t id; - uint16_t size; - void *data; + uint32_t size; + const void *data; }; -static const char * const seq_name[] = { - "UNDEFINED", - "MIPI_SEQ_ASSERT_RESET", - "MIPI_SEQ_INIT_OTP", - "MIPI_SEQ_DISPLAY_ON", - "MIPI_SEQ_DISPLAY_OFF", - "MIPI_SEQ_DEASSERT_RESET", +struct context { + const struct vbt_header *vbt; + const struct bdb_header *bdb; + int size; + + uint32_t devid; + int panel_type; + bool dump_all_panel_types; + bool hexdump; }; -struct bdb_header *bdb; -struct bdb_lvds_lfp_data_ptrs *lvds_lfp_data_ptrs; -static int tv_present; -static int lvds_present; -static int panel_type; +/* Get BDB block size given a pointer to Block ID. */ +static uint32_t _get_blocksize(const uint8_t *block_base) +{ + /* The MIPI Sequence Block v3+ has a separate size field. */ + if (*block_base == BDB_MIPI_SEQUENCE && *(block_base + 3) >= 3) + return *((const uint32_t *)(block_base + 4)); + else + return *((const uint16_t *)(block_base + 1)); +} -static struct bdb_block *find_section(int section_id, int length) +static struct bdb_block *find_section(struct context *context, int section_id) { + const struct bdb_header *bdb = context->bdb; + int length = context->size; struct bdb_block *block; - unsigned char *base = (unsigned char *)bdb; - int idx = 0; - uint16_t total, current_size; + const uint8_t *base = (const uint8_t *)bdb; + int index = 0; + uint32_t total, current_size; unsigned char current_id; /* skip to first section */ - idx += bdb->header_size; + index += bdb->header_size; total = bdb->bdb_size; if (total > length) total = length; @@ -103,33 +101,36 @@ block = malloc(sizeof(*block)); if (!block) { fprintf(stderr, "out of memory\n"); - exit(-1); + exit(EXIT_FAILURE); } /* 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) + while (index + 3 < total) { + current_id = *(base + index); + current_size = _get_blocksize(base + index); + index += 3; + + if (index + current_size > total) return NULL; if (current_id == section_id) { block->id = current_id; block->size = current_size; - block->data = base + idx + 3; + block->data = base + index; return block; } - idx += current_size + 3; + index += current_size; } free(block); return NULL; } -static void dump_general_features(const struct bdb_block *block) +static void dump_general_features(struct context *context, + const struct bdb_block *block) { - struct bdb_general_features *features = block->data; + const struct bdb_general_features *features = block->data; printf("\tPanel fitting: "); switch (features->panel_fitting) { @@ -153,10 +154,13 @@ printf("\tExternal VBT: %s\n", YESNO(features->download_ext_vbt)); printf("\tEnable SSC: %s\n", YESNO(features->enable_ssc)); if (features->enable_ssc) { - if (IS_VALLEYVIEW(devid) || IS_CHERRYVIEW(devid) || - IS_BROXTON(devid)) + if (!context->devid) + printf("\tSSC frequency: \n"); + else if (IS_VALLEYVIEW(context->devid) || + IS_CHERRYVIEW(context->devid) || + IS_BROXTON(context->devid)) printf("\tSSC frequency: 100 MHz\n"); - else if (HAS_PCH_SPLIT(devid)) + else if (HAS_PCH_SPLIT(context->devid)) printf("\tSSC frequency: %s\n", features->ssc_freq ? "100 MHz" : "120 MHz"); else @@ -174,15 +178,13 @@ 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() */ } -static void dump_backlight_info(const struct bdb_block *block) +static void dump_backlight_info(struct context *context, + const struct bdb_block *block) { - struct bdb_lvds_backlight *backlight = block->data; - struct blc_struct *blc; + const struct bdb_lvds_backlight *backlight = block->data; + const struct blc_struct *blc; if (sizeof(struct blc_struct) != backlight->blcstruct_size) { printf("\tBacklight struct sizes don't match (expected %zu, got %u), skipping\n", @@ -190,7 +192,7 @@ return; } - blc = &backlight->panels[panel_type]; + blc = &backlight->panels[context->panel_type]; printf("\tInverter type: %d\n", blc->inverter_type); printf("\t polarity: %d\n", blc->inverter_polarity); @@ -361,14 +363,15 @@ -static void dump_child_device(struct child_device_config *child) +static void dump_child_device(struct context *context, + struct child_device_config *child) { char child_id[11]; if (!child->device_type) return; - if (bdb->version < 152) { + if (context->bdb->version < 152) { strncpy(child_id, (char *)child->device_id, 10); child_id[10] = 0; @@ -399,9 +402,10 @@ } } -static void dump_general_definitions(const struct bdb_block *block) +static void dump_general_definitions(struct context *context, + const struct bdb_block *block) { - struct bdb_general_definitions *defs = block->data; + const struct bdb_general_definitions *defs = block->data; int i; int child_device_num; @@ -413,18 +417,18 @@ 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)); printf("\tChild device size: %d\n", defs->child_dev_size); child_device_num = (block->size - sizeof(*defs)) / defs->child_dev_size; for (i = 0; i < child_device_num; i++) - dump_child_device((void*)&defs->devices[i * defs->child_dev_size]); + dump_child_device(context, (void*)&defs->devices[i * defs->child_dev_size]); } -static void dump_child_devices(const struct bdb_block *block) +static void dump_child_devices(struct context *context, + const struct bdb_block *block) { - struct bdb_child_devices *child_devs = block->data; - struct child_device_config *child; + const struct bdb_child_devices *child_devs = block->data; + const struct child_device_config *child; int i; for (i = 0; i < DEVICE_CHILD_SIZE; i++) { @@ -444,12 +448,16 @@ } } -static void dump_lvds_options(const struct bdb_block *block) +static void dump_lvds_options(struct context *context, + const struct bdb_block *block) { - struct bdb_lvds_options *options = block->data; + const struct bdb_lvds_options *options = block->data; - panel_type = options->panel_type; - printf("\tPanel type: %d\n", panel_type); + if (context->panel_type == options->panel_type) + printf("\tPanel type: %d\n", options->panel_type); + else + printf("\tPanel type: %d (override %d)\n", + options->panel_type, context->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)); @@ -460,20 +468,20 @@ printf("\tPFIT mode: %d\n", options->pfit_mode); } -static void dump_lvds_ptr_data(const struct bdb_block *block) +static void dump_lvds_ptr_data(struct context *context, + const struct bdb_block *block) { - struct bdb_lvds_lfp_data_ptrs *ptrs = block->data; + const struct bdb_lvds_lfp_data_ptrs *ptrs = block->data; printf("\tNumber of entries: %d\n", ptrs->lvds_entries); - - /* save for use by dump_lvds_data() */ - lvds_lfp_data_ptrs = ptrs; } -static void dump_lvds_data(const struct bdb_block *block) +static void dump_lvds_data(struct context *context, + const struct bdb_block *block) { - struct bdb_lvds_lfp_data *lvds_data = block->data; - struct bdb_lvds_lfp_data_ptrs *ptrs = lvds_lfp_data_ptrs; + const struct bdb_lvds_lfp_data *lvds_data = block->data; + struct bdb_block *ptrs_block; + const struct bdb_lvds_lfp_data_ptrs *ptrs; int num_entries; int i; int hdisplay, hsyncstart, hsyncend, htotal; @@ -481,11 +489,14 @@ float clock; int lfp_data_size, dvo_offset; - if (!ptrs) { + ptrs_block = find_section(context, BDB_LVDS_LFP_DATA_PTRS); + if (!ptrs_block) { printf("No LVDS ptr block\n"); return; } + ptrs = ptrs_block->data; + lfp_data_size = ptrs->ptr[1].fp_timing_offset - ptrs->ptr[0].fp_timing_offset; dvo_offset = @@ -497,14 +508,17 @@ 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; + const uint8_t *lfp_data_ptr = + (const uint8_t *) lvds_data->data + lfp_data_size * i; + const uint8_t *timing_data = lfp_data_ptr + dvo_offset; + const struct bdb_lvds_lfp_data_entry *lfp_data = + (const struct bdb_lvds_lfp_data_entry *)lfp_data_ptr; char marker; - if (i == panel_type) + if (i != context->panel_type && !context->dump_all_panel_types) + continue; + + if (i == context->panel_type) marker = '*'; else marker = ' '; @@ -540,11 +554,14 @@ (hsyncend > htotal || vsyncend > vtotal) ? "BAD!" : "good"); } + + free(ptrs_block); } -static void dump_driver_feature(const struct bdb_block *block) +static void dump_driver_feature(struct context *context, + const struct bdb_block *block) { - struct bdb_driver_feature *feature = block->data; + const struct bdb_driver_feature *feature = block->data; printf("\tBoot Device Algorithm: %s\n", feature->boot_dev_algorithm ? "driver default" : "os default"); @@ -608,14 +625,18 @@ feature->legacy_crt_max_refresh); } -static void dump_edp(const struct bdb_block *block) +static void dump_edp(struct context *context, + const struct bdb_block *block) { - struct bdb_edp *edp = block->data; + const struct bdb_edp *edp = block->data; int bpp, msa; int i; for (i = 0; i < 16; i++) { - printf("\tPanel %d%s\n", i, panel_type == i ? " *" : ""); + if (i != context->panel_type && !context->dump_all_panel_types) + continue; + + printf("\tPanel %d%s\n", i, context->panel_type == i ? " *" : ""); printf("\t\tPower Sequence: T3 %d T7 %d T9 %d T10 %d T12 %d\n", edp->power_seqs[i].t3, @@ -709,7 +730,7 @@ } static void -print_detail_timing_data(struct lvds_dvo_timing2 *dvo_timing) +print_detail_timing_data(const struct lvds_dvo_timing2 *dvo_timing) { int display, sync_start, sync_end, total; @@ -737,9 +758,10 @@ printf("\tclock: %d\n", dvo_timing->clock * 10); } -static void dump_sdvo_panel_dtds(const struct bdb_block *block) +static void dump_sdvo_panel_dtds(struct context *context, + const struct bdb_block *block) { - struct lvds_dvo_timing2 *dvo_timing = block->data; + const struct lvds_dvo_timing2 *dvo_timing = block->data; int n, count; count = block->size / sizeof(struct lvds_dvo_timing2); @@ -749,9 +771,10 @@ } } -static void dump_sdvo_lvds_options(const struct bdb_block *block) +static void dump_sdvo_lvds_options(struct context *context, + const struct bdb_block *block) { - struct bdb_sdvo_lvds_options *options = block->data; + const struct bdb_sdvo_lvds_options *options = block->data; printf("\tbacklight: %d\n", options->panel_backlight); printf("\th40 type: %d\n", options->h40_set_panel_type); @@ -770,14 +793,15 @@ printf("\tmisc[3]: %x\n", options->panel_misc_bits_4); } -static void dump_mipi_config(const struct bdb_block *block) +static void dump_mipi_config(struct context *context, + const struct bdb_block *block) { - struct bdb_mipi_config *start = block->data; - struct mipi_config *config; - struct mipi_pps_data *pps; + const struct bdb_mipi_config *start = block->data; + const struct mipi_config *config; + const struct mipi_pps_data *pps; - config = &start->config[panel_type]; - pps = &start->pps[panel_type]; + config = &start->config[context->panel_type]; + pps = &start->pps[context->panel_type]; printf("\tGeneral Param\n"); printf("\t\t BTA disable: %s\n", config->bta ? "Disabled" : "Enabled"); @@ -852,183 +876,318 @@ printf("\tMIPI PPS\n"); printf("\t\tPanel power ON delay: %d\n", pps->panel_on_delay); - printf("\t\tPanel power on to Baklight enable delay: %d\n", pps->bl_enable_delay); + printf("\t\tPanel power on to Backlight enable delay: %d\n", pps->bl_enable_delay); printf("\t\tBacklight disable to Panel power OFF delay: %d\n", pps->bl_disable_delay); printf("\t\tPanel power OFF delay: %d\n", pps->panel_off_delay); printf("\t\tPanel power cycle delay: %d\n", pps->panel_power_cycle_delay); } -static uint8_t *mipi_dump_send_packet(uint8_t *data) +static const uint8_t *mipi_dump_send_packet(const uint8_t *data) { - uint8_t type, byte, count; - uint16_t len; + uint8_t flags, type; + uint16_t len, i; - byte = *data++; - /* get packet type and increment the pointer */ + flags = *data++; type = *data++; - len = *((uint16_t *) data); data += 2; - printf("\t\t SEND COMMAND: "); - printf("0x%x 0x%x 0x%x", byte, type, len); - for (count = 0; count < len; count++) - printf(" 0x%x",*(data+count)); + + printf("\t\tSend DCS: Port %s, VC %d, %s, Type %02x, Length %u, Data", + (flags >> 3) & 1 ? "C" : "A", + (flags >> 1) & 3, + flags & 1 ? "HS" : "LP", + type, + len); + for (i = 0; i < len; i++) + printf(" %02x", *data++); printf("\n"); - data += len; + return data; } -static uint8_t *mipi_dump_delay(uint8_t *data) +static const uint8_t *mipi_dump_delay(const uint8_t *data) { - printf("\t\t Delay : 0x%x 0x%x 0x%x 0x%x\n", data[0], data[1], data[2], data[3]); - data += 4; + printf("\t\tDelay: %u us\n", *((const uint32_t *)data)); + + return data + 4; +} + +static const uint8_t *mipi_dump_gpio(const uint8_t *data) +{ + uint8_t index, flags; + + index = *data++; + flags = *data++; + + printf("\t\tGPIO index %u, source %d, set %d\n", + index, + (flags >> 1) & 3, + flags & 1); + return data; } -static uint8_t *mipi_dump_gpio(uint8_t *data) +static const uint8_t *mipi_dump_i2c(const uint8_t *data) { - uint8_t gpio, action; + uint8_t flags, index, bus, offset, len, i; + uint16_t address; - printf("\t\t GPIO value:"); - gpio = *data++; + flags = *data++; + index = *data++; + bus = *data++; + address = *((uint16_t *) data); + data += 2; + offset = *data++; + len = *data++; + + printf("\t\tSend I2C: Flags %02x, Index %02x, Bus %02x, Address %04x, Offset %02x, Length %u, Data", + flags, index, bus, address, offset, len); + for (i = 0; i < len; i++) + printf(" %02x", *data++); + printf("\n"); - /* pull up/down */ - action = *data++; - printf(" 0x%x 0x%x\n", gpio, action); return data; } -typedef uint8_t * (*fn_mipi_elem_dump)(uint8_t *data); +typedef const uint8_t * (*fn_mipi_elem_dump)(const uint8_t *data); static const fn_mipi_elem_dump dump_elem[] = { - NULL, /* reserved */ - mipi_dump_send_packet, - mipi_dump_delay, - mipi_dump_gpio, - NULL, /* status read; later */ + [MIPI_SEQ_ELEM_SEND_PKT] = mipi_dump_send_packet, + [MIPI_SEQ_ELEM_DELAY] = mipi_dump_delay, + [MIPI_SEQ_ELEM_GPIO] = mipi_dump_gpio, + [MIPI_SEQ_ELEM_I2C] = mipi_dump_i2c, +}; + +static const char * const seq_name[] = { + [MIPI_SEQ_ASSERT_RESET] = "MIPI_SEQ_ASSERT_RESET", + [MIPI_SEQ_INIT_OTP] = "MIPI_SEQ_INIT_OTP", + [MIPI_SEQ_DISPLAY_ON] = "MIPI_SEQ_DISPLAY_ON", + [MIPI_SEQ_DISPLAY_OFF] = "MIPI_SEQ_DISPLAY_OFF", + [MIPI_SEQ_DEASSERT_RESET] = "MIPI_SEQ_DEASSERT_RESET", + [MIPI_SEQ_BACKLIGHT_ON] = "MIPI_SEQ_BACKLIGHT_ON", + [MIPI_SEQ_BACKLIGHT_OFF] = "MIPI_SEQ_BACKLIGHT_OFF", + [MIPI_SEQ_TEAR_ON] = "MIPI_SEQ_TEAR_ON", + [MIPI_SEQ_TEAR_OFF] = "MIPI_SEQ_TEAR_OFF", + [MIPI_SEQ_POWER_ON] = "MIPI_SEQ_POWER_ON", + [MIPI_SEQ_POWER_OFF] = "MIPI_SEQ_POWER_OFF", }; -static void dump_sequence(uint8_t *sequence) +static const char *sequence_name(enum mipi_seq seq_id) { - uint8_t *data = sequence; - fn_mipi_elem_dump mipi_elem_dump; - int index_no; + if (seq_id < ARRAY_SIZE(seq_name) && seq_name[seq_id]) + return seq_name[seq_id]; + else + return "(unknown)"; +} - if (!sequence) - return; +static const uint8_t *dump_sequence(const uint8_t *data, uint8_t seq_version) +{ + fn_mipi_elem_dump mipi_elem_dump; - printf("\tSequence Name: %s\n", seq_name[*data]); + printf("\tSequence %u - %s\n", *data, sequence_name(*data)); - /* go to the first element of the sequence */ + /* Skip Sequence Byte. */ data++; - /* parse each byte till we reach end of sequence byte - 0x00 */ + /* Skip Size of Sequence. */ + if (seq_version >= 3) + data += 4; + while (1) { - index_no = *data; - mipi_elem_dump = dump_elem[index_no]; - if (!mipi_elem_dump) { - printf("Error: Unsupported MIPI element, skipping sequence execution\n"); - return; + uint8_t operation_byte = *data++; + uint8_t operation_size = 0; + + if (operation_byte == MIPI_SEQ_ELEM_END) + break; + + if (operation_byte < ARRAY_SIZE(dump_elem)) + mipi_elem_dump = dump_elem[operation_byte]; + else + mipi_elem_dump = NULL; + + /* Size of Operation. */ + if (seq_version >= 3) + operation_size = *data++; + + if (mipi_elem_dump) { + data = mipi_elem_dump(data); + } else if (operation_size) { + /* We have size, skip. */ + data += operation_size; + } else { + /* No size, can't skip without parsing. */ + printf("Error: Unsupported MIPI element %u\n", + operation_byte); + return NULL; } - /* goto element payload */ - data++; + } - /* execute the element specifc rotines */ - data = mipi_elem_dump(data); + return data; +} - /* - * After processing the element, data should point to - * next element or end of sequence - * check if have we reached end of sequence - */ +/* Find the sequence block and size for the given panel. */ +static const uint8_t * +find_panel_sequence_block(const struct bdb_mipi_sequence *sequence, + uint16_t panel_id, uint32_t total, uint32_t *seq_size) +{ + const uint8_t *data = &sequence->data[0]; + uint8_t current_id; + uint32_t current_size; + int header_size = sequence->version >= 3 ? 5 : 3; + int index = 0; + int i; - if (*data == 0x00) - break; + /* skip new block size */ + if (sequence->version >= 3) + data += 4; + + for (i = 0; i < MAX_MIPI_CONFIGURATIONS && index < total; i++) { + if (index + header_size > total) { + fprintf(stderr, "Invalid sequence block (header)\n"); + return NULL; + } + + current_id = *(data + index); + if (sequence->version >= 3) + current_size = *((const uint32_t *)(data + index + 1)); + else + current_size = *((const uint16_t *)(data + index + 1)); + + index += header_size; + + if (index + current_size > total) { + fprintf(stderr, "Invalid sequence block\n"); + return NULL; + } + + if (current_id == panel_id) { + *seq_size = current_size; + return data + index; + } + + index += current_size; } + + fprintf(stderr, "Sequence block detected but no valid configuration\n"); + + return NULL; } -static uint8_t *goto_next_sequence(uint8_t *data, int *size) +static int goto_next_sequence(const uint8_t *data, int index, int total) { uint16_t len; - int tmp = *size; - if (--tmp < 0) - return NULL; - - /* goto first element */ - data++; - while (1) { - switch (*data) { + /* Skip Sequence Byte. */ + for (index = index + 1; index < total; index += len) { + uint8_t operation_byte = *(data + index); + index++; + + switch (operation_byte) { + case MIPI_SEQ_ELEM_END: + return index; case MIPI_SEQ_ELEM_SEND_PKT: - /* - * skip by this element payload size - * skip elem id, command flag and data type - */ - tmp -= 5; - if (tmp < 0) - return NULL; - - data += 3; - len = *((uint16_t *)data); - - tmp -= len; - if (tmp < 0) - return NULL; + if (index + 4 > total) + return 0; - /* skip by len */ - data = data + 2 + len; + len = *((const uint16_t *)(data + index + 2)) + 4; break; case MIPI_SEQ_ELEM_DELAY: - /* skip by elem id, and delay is 4 bytes */ - tmp -= 5; - if (tmp < 0) - return NULL; - - data += 5; + len = 4; break; case MIPI_SEQ_ELEM_GPIO: - tmp -= 3; - if (tmp < 0) - return NULL; - - data += 3; + len = 2; + break; + case MIPI_SEQ_ELEM_I2C: + if (index + 7 > total) + return 0; + len = *(data + index + 6) + 7; break; default: - printf("Unknown element\n"); - return NULL; - } + fprintf(stderr, "Unknown operation byte\n"); + return 0; + } + } - /* end of sequence ? */ - if (*data == 0) - break; - } + return 0; +} - /* goto next sequence or end of block byte */ - if (--tmp < 0) - return NULL; +static int goto_next_sequence_v3(const uint8_t *data, int index, int total) +{ + int seq_end; + uint16_t len; + uint32_t size_of_sequence; - data++; + /* + * Could skip sequence based on Size of Sequence alone, but also do some + * checking on the structure. + */ + if (total < 5) { + fprintf(stderr, "Too small sequence size\n"); + return 0; + } - /* update amount of data left for the sequence block to be parsed */ - *size = tmp; - return data; -} + /* Skip Sequence Byte. */ + index++; -static uint16_t get_blocksize(void *p) -{ - uint16_t *block_ptr, block_size; + /* + * Size of Sequence. Excludes the Sequence Byte and the size itself, + * includes MIPI_SEQ_ELEM_END byte, excludes the final MIPI_SEQ_END + * byte. + */ + size_of_sequence = *((const uint32_t *)(data + index)); + index += 4; + + seq_end = index + size_of_sequence; + if (seq_end > total) { + fprintf(stderr, "Invalid sequence size\n"); + return 0; + } + + for (; index < total; index += len) { + uint8_t operation_byte = *(data + index); + index++; + + if (operation_byte == MIPI_SEQ_ELEM_END) { + if (index != seq_end) { + fprintf(stderr, "Invalid element structure\n"); + return 0; + } + return index; + } + + len = *(data + index); + index++; + + /* + * FIXME: Would be nice to check elements like for v1/v2 in + * goto_next_sequence() above. + */ + switch (operation_byte) { + case MIPI_SEQ_ELEM_SEND_PKT: + case MIPI_SEQ_ELEM_DELAY: + case MIPI_SEQ_ELEM_GPIO: + case MIPI_SEQ_ELEM_I2C: + case MIPI_SEQ_ELEM_SPI: + case MIPI_SEQ_ELEM_PMIC: + break; + default: + fprintf(stderr, "Unknown operation byte %u\n", + operation_byte); + break; + } + } - block_ptr = (uint16_t *)((char *)p - 2); - block_size = *block_ptr; - return block_size; + return 0; } -static void dump_mipi_sequence(const struct bdb_block *block) +static void dump_mipi_sequence(struct context *context, + const struct bdb_block *block) { - struct bdb_mipi_sequence *sequence = block->data; - uint8_t *data, *seq_data; - int i, panel_id, seq_size; - uint16_t block_size; + const struct bdb_mipi_sequence *sequence = block->data; + const uint8_t *data; + uint32_t seq_size; + int index = 0, i; + const uint8_t *sequence_ptrs[MIPI_SEQ_MAX] = {}; /* Check if we have sequence block as well */ if (!sequence) { @@ -1036,84 +1195,67 @@ return; } - block_size = get_blocksize(sequence); + printf("\tSequence block version v%u\n", sequence->version); - /* - * parse the sequence block for individual sequences - */ - seq_data = &sequence->data[0]; + /* Fail gracefully for forward incompatible sequence block. */ + if (sequence->version >= 4) { + fprintf(stderr, "Unable to parse MIPI Sequence Block v%u\n", + sequence->version); + return; + } - /* - * sequence block is variable length and hence we need to parse and - * get the sequence data for specific panel id - */ - for (i = 0; i < MAX_MIPI_CONFIGURATIONS; i++) { - panel_id = *seq_data; - seq_size = *((uint16_t *) (seq_data + 1)); - if (panel_id == panel_type) + data = find_panel_sequence_block(sequence, context->panel_type, + block->size, &seq_size); + if (!data) + return; + + /* Parse the sequences. Corresponds to VBT parsing in the kernel. */ + for (;;) { + uint8_t seq_id = *(data + index); + if (seq_id == MIPI_SEQ_END) break; - /* skip the sequence including seq header of 3 bytes */ - seq_data = seq_data + 3 + seq_size; - if ((seq_data - &sequence->data[0]) > block_size) { - printf("Sequence start is beyond sequence block size, corrupted sequence block\n"); + if (seq_id >= MIPI_SEQ_MAX) { + fprintf(stderr, "Unknown sequence %u\n", seq_id); return; } - } - if (i == MAX_MIPI_CONFIGURATIONS) { - printf("Sequence block detected but no valid configuration\n"); - return; - } + sequence_ptrs[seq_id] = data + index; - /* check if found sequence is completely within the sequence block - * just being paranoid */ - if (seq_size > block_size) { - printf("Corrupted sequence/size, bailing out\n"); - return; - } - - /* skip the panel id(1 byte) and seq size(2 bytes) */ - data = (uint8_t *) calloc(1, seq_size); - if (data) - memmove(data, seq_data + 3, seq_size); - else { - printf("Memory not allocated for sequence data\n"); - return; + if (sequence->version >= 3) + index = goto_next_sequence_v3(data, index, seq_size); + else + index = goto_next_sequence(data, index, seq_size); + if (!index) { + fprintf(stderr, "Invalid sequence %u\n", seq_id); + return; + } } - /* - * loop into the sequence data and split into multiple sequneces - * There are only 5 types of sequences as of now - */ - /* two consecutive 0x00 indicate end of all sequences */ - while (1) { - int seq_id = *data; - if (MIPI_SEQ_MAX > seq_id && seq_id > MIPI_SEQ_UNDEFINED) - dump_sequence(data); - else { - printf("Error:undefined sequence\n"); - goto err; - } - - /* partial parsing to skip elements */ - data = goto_next_sequence(data, &seq_size); - - if (data == NULL) { - printf("Sequence elements going beyond block itself. Sequence block parsing failed\n"); - goto err; - } - - if (*data == 0) - break; /* end of sequence reached */ - } - return; - -err: - free(data); - data = NULL; + /* Dump the sequences. Corresponds to sequence execution in kernel. */ + for (i = 0; i < ARRAY_SIZE(sequence_ptrs); i++) + if (sequence_ptrs[i]) + dump_sequence(sequence_ptrs[i], sequence->version); } +/* get panel type from lvds options block, or -1 if block not found */ +static int get_panel_type(struct context *context) +{ + struct bdb_block *block; + const struct bdb_lvds_options *options; + int panel_type; + + block = find_section(context, BDB_LVDS_OPTIONS); + if (!block) + return -1; + + options = block->data; + panel_type = options->panel_type; + + free(block); + + return panel_type; +} static int get_device_id(unsigned char *bios, int size) @@ -1138,7 +1280,8 @@ struct dumper { uint8_t id; const char *name; - void (*dump)(const struct bdb_block *block); + void (*dump)(struct context *context, + const struct bdb_block *block); }; struct dumper dumpers[] = { @@ -1212,7 +1355,7 @@ static void hex_dump(const struct bdb_block *block) { int i; - uint8_t *p = block->data; + const uint8_t *p = block->data; for (i = 0; i < block->size; i++) { if (i % 16 == 0) @@ -1230,20 +1373,15 @@ printf("\n\n"); } -static void dump_section(int section_id, int size) +static bool dump_section(struct context *context, int section_id) { struct dumper *dumper = NULL; - const struct bdb_block *block; - static int done[256]; + struct bdb_block *block; int i; - if (done[section_id]) - return; - done[section_id] = 1; - - block = find_section(section_id, size); + block = find_section(context, section_id); if (!block) - return; + return false; for (i = 0; i < ARRAY_SIZE(dumpers); i++) { if (block->id == dumpers[i].id) { @@ -1257,44 +1395,171 @@ else printf("BDB block %d:\n", block->id); - hex_dump(block); + if (context->hexdump) + hex_dump(block); if (dumper && dumper->dump) - dumper->dump(block); + dumper->dump(context, block); printf("\n"); + + free(block); + + return true; +} + +static void dump_headers(struct context *context) +{ + const struct vbt_header *vbt = context->vbt; + const struct bdb_header *bdb = context->bdb; + int i, j = 0; + + printf("VBT signature:\t\"%.*s\"\n", + (int)sizeof(vbt->signature), vbt->signature); + printf("VBT version:\t%d.%d\n", vbt->version / 100, vbt->version % 100); + + printf("BDB signature:\t\"%.*s\"\n", + (int)sizeof(bdb->signature), bdb->signature); + printf("BDB version:\t%d\n", bdb->version); + + printf("BDB blocks present:"); + for (i = 0; i < 256; i++) { + struct bdb_block *block; + + block = find_section(context, i); + if (!block) + continue; + + if (j++ % 16) + printf(" %3d", i); + else + printf("\n\t%3d", i); + + free(block); + } + printf("\n\n"); +} + +enum opt { + OPT_UNKNOWN = '?', + OPT_END = -1, + OPT_FILE, + OPT_DEVID, + OPT_PANEL_TYPE, + OPT_ALL_PANELS, + OPT_HEXDUMP, + OPT_BLOCK, + OPT_USAGE, +}; + +static void usage(const char *toolname) +{ + fprintf(stderr, "usage: %s", toolname); + fprintf(stderr, " --file=" + " [--devid=]" + " [--panel-type=]" + " [--all-panels]" + " [--hexdump]" + " [--block=]" + " [--help]\n"); } int main(int argc, char **argv) { + uint8_t *VBIOS; + int index; + enum opt opt; int fd; struct vbt_header *vbt = NULL; int vbt_off, bdb_off, i; - const char *filename = "bios"; + const char *filename = NULL; + const char *toolname = argv[0]; struct stat finfo; int size; - struct bdb_block *block; - char signature[17]; - char *devid_string; - - if (argc != 2) { - printf("usage: %s \n", argv[0]); - return 1; + struct context context = { + .panel_type = -1, + }; + char *endp; + int block_number = -1; + + static struct option options[] = { + { "file", required_argument, NULL, OPT_FILE }, + { "devid", required_argument, NULL, OPT_DEVID }, + { "panel-type", required_argument, NULL, OPT_PANEL_TYPE }, + { "all-panels", no_argument, NULL, OPT_ALL_PANELS }, + { "hexdump", no_argument, NULL, OPT_HEXDUMP }, + { "block", required_argument, NULL, OPT_BLOCK }, + { "help", no_argument, NULL, OPT_USAGE }, + { 0 } + }; + + for (opt = 0; opt != OPT_END; ) { + opt = getopt_long(argc, argv, "", options, &index); + + switch (opt) { + case OPT_FILE: + filename = optarg; + break; + case OPT_DEVID: + context.devid = strtoul(optarg, &endp, 16); + if (!context.devid || *endp) { + fprintf(stderr, "invalid devid '%s'\n", optarg); + return EXIT_FAILURE; + } + break; + case OPT_PANEL_TYPE: + context.panel_type = strtoul(optarg, &endp, 0); + if (*endp || context.panel_type > 15) { + fprintf(stderr, "invalid panel type '%s'\n", + optarg); + return EXIT_FAILURE; + } + break; + case OPT_ALL_PANELS: + context.dump_all_panel_types = true; + break; + case OPT_HEXDUMP: + context.hexdump = true; + break; + case OPT_BLOCK: + block_number = strtoul(optarg, &endp, 0); + if (*endp) { + fprintf(stderr, "invalid block number '%s'\n", + optarg); + return EXIT_FAILURE; + } + break; + case OPT_END: + break; + case OPT_USAGE: /* fall-through */ + case OPT_UNKNOWN: + usage(toolname); + return EXIT_FAILURE; + } } - if ((devid_string = getenv("DEVICE"))) - devid = strtoul(devid_string, NULL, 0); + argc -= optind; + argv += optind; - filename = argv[1]; + if (!filename) { + if (argc == 1) { + /* for backwards compatibility */ + filename = argv[0]; + } else { + usage(toolname); + return EXIT_FAILURE; + } + } fd = open(filename, O_RDONLY); if (fd == -1) { - printf("Couldn't open \"%s\": %s\n", filename, strerror(errno)); - return 1; + fprintf(stderr, "Couldn't open \"%s\": %s\n", + filename, strerror(errno)); + return EXIT_FAILURE; } if (stat(filename, &finfo)) { - printf("failed to stat \"%s\": %s\n", filename, - strerror(errno)); - return 1; + fprintf(stderr, "Failed to stat \"%s\": %s\n", + filename, strerror(errno)); + return EXIT_FAILURE; } size = finfo.st_size; @@ -1304,9 +1569,9 @@ VBIOS = malloc (size); while ((ret = read(fd, VBIOS + len, size - len))) { if (ret < 0) { - printf("failed to read \"%s\": %s\n", filename, - strerror(errno)); - return 1; + fprintf(stderr, "Failed to read \"%s\": %s\n", + filename, strerror(errno)); + return EXIT_FAILURE; } len += ret; @@ -1318,8 +1583,9 @@ } else { VBIOS = mmap(NULL, size, PROT_READ, MAP_SHARED, fd, 0); if (VBIOS == MAP_FAILED) { - printf("failed to map \"%s\": %s\n", filename, strerror(errno)); - return 1; + fprintf(stderr, "Failed to map \"%s\": %s\n", + filename, strerror(errno)); + return EXIT_FAILURE; } } @@ -1333,58 +1599,50 @@ } if (!vbt) { - printf("VBT signature missing\n"); - return 1; + fprintf(stderr, "VBT signature missing\n"); + return EXIT_FAILURE; } - printf("VBT vers: %d.%d\n", vbt->version / 100, vbt->version % 100); - bdb_off = vbt_off + vbt->bdb_offset; if (bdb_off >= size - sizeof(struct bdb_header)) { - printf("Invalid VBT found, BDB points beyond end of data block\n"); - return 1; + fprintf(stderr, "Invalid VBT found, BDB points beyond end of data block\n"); + return EXIT_FAILURE; } - 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: "); + context.vbt = vbt; + context.bdb = (const struct bdb_header *)(VBIOS + bdb_off); + context.size = size; + + if (!context.devid) { + const char *devid_string = getenv("DEVICE"); + if (devid_string) + context.devid = strtoul(devid_string, NULL, 16); + } + if (!context.devid) + context.devid = get_device_id(VBIOS, size); + if (!context.devid) + fprintf(stderr, "Warning: could not find PCI device ID!\n"); + + if (context.panel_type == -1) + context.panel_type = get_panel_type(&context); + if (context.panel_type == -1) { + fprintf(stderr, "Warning: panel type not set, using 0\n"); + context.panel_type = 0; + } + + if (block_number != -1) { + /* dump specific section only */ + if (!dump_section(&context, block_number)) { + fprintf(stderr, "Block %d not found\n", block_number); + return EXIT_FAILURE; + } + } else { + dump_headers(&context); - for (i = 0; i < 256; i++) { - block = find_section(i, size); - if (!block) - continue; - printf("%d ", i); - free(block); + /* dump all sections */ + for (i = 0; i < 256; i++) + dump_section(&context, i); } - printf("\n"); - - if (devid == -1) - devid = get_device_id(VBIOS, size); - if (devid == -1) - printf("Warning: could not find PCI device ID!\n"); - - dump_section(BDB_GENERAL_FEATURES, size); - dump_section(BDB_GENERAL_DEFINITIONS, size); - dump_section(BDB_CHILD_DEVICE_TABLE, size); - dump_section(BDB_LVDS_OPTIONS, size); - dump_section(BDB_LVDS_LFP_DATA_PTRS, size); - dump_section(BDB_LVDS_LFP_DATA, size); - dump_section(BDB_LVDS_BACKLIGHT, size); - - dump_section(BDB_SDVO_LVDS_OPTIONS, size); - dump_section(BDB_SDVO_PANEL_DTDS, size); - - dump_section(BDB_DRIVER_FEATURES, size); - dump_section(BDB_EDP, size); - dump_section(BDB_MIPI_CONFIG, size); - dump_section(BDB_MIPI_SEQUENCE, size); - - for (i = 0; i < 256; i++) - dump_section(i, size); return 0; } diff -Nru intel-gpu-tools-1.13/tools/intel_error_decode.c intel-gpu-tools-1.15/tools/intel_error_decode.c --- intel-gpu-tools-1.13/tools/intel_error_decode.c 2015-11-12 17:30:48.000000000 +0000 +++ intel-gpu-tools-1.15/tools/intel_error_decode.c 2016-05-23 10:51:28.000000000 +0000 @@ -51,6 +51,7 @@ #include #include #include +#include #include "intel_chipset.h" #include "intel_io.h" @@ -433,45 +434,131 @@ } #define MAX_RINGS 10 /* I really hope this never... */ -uint32_t head[MAX_RINGS]; -int head_ndx = 0; -int num_rings = 0; -static void print_batch(int is_batch, const char *ring_name, uint32_t gtt_offset) -{ - const char *buffer_type[2] = { "ringbuffer", "batchbuffer" }; - if (is_batch || !num_rings) - printf("%s (%s) at 0x%08x\n", buffer_type[is_batch], ring_name, gtt_offset); - else - printf("%s (%s) at 0x%08x; HEAD points to: 0x%08x\n", buffer_type[is_batch], ring_name, gtt_offset, head[head_ndx++ % num_rings] + gtt_offset); -} -static void decode(struct drm_intel_decode *ctx, bool is_batch, - const char *ring_name, uint32_t gtt_offset, uint32_t *data, +static void decode(struct drm_intel_decode *ctx, + const char *buffer_name, + const char *ring_name, + uint64_t gtt_offset, + uint32_t head_offset, + uint32_t *data, int *count) { if (!*count) return; - print_batch(is_batch, ring_name, gtt_offset); + printf("%s (%s) at 0x%08x_%08x", buffer_name, ring_name, + (unsigned)(gtt_offset >> 32), + (unsigned)(gtt_offset & 0xffffffff)); + if (head_offset != -1) + printf("; HEAD points to: 0x%08x_%08x", + (unsigned)((head_offset + gtt_offset) >> 32), + (unsigned)((head_offset + gtt_offset) & 0xffffffff)); + printf("\n"); + drm_intel_decode_set_batch_pointer(ctx, data, gtt_offset, *count); drm_intel_decode(ctx); *count = 0; } +static int zlib_inflate(uint32_t **ptr, int len) +{ + struct z_stream_s zstream; + void *out; + + memset(&zstream, 0, sizeof(zstream)); + + zstream.next_in = (unsigned char *)*ptr; + zstream.avail_in = 4*len; + + if (inflateInit(&zstream) != Z_OK) + return 0; + + out = malloc(128*4096); /* approximate obj size */ + zstream.next_out = out; + zstream.avail_out = 40*len; + + do { + switch (inflate(&zstream, Z_SYNC_FLUSH)) { + case Z_STREAM_END: + goto end; + case Z_OK: + break; + default: + inflateEnd(&zstream); + return 0; + } + + if (zstream.avail_out) + break; + + out = realloc(out, 2*zstream.total_out); + if (out == NULL) { + inflateEnd(&zstream); + return 0; + } + + zstream.next_out = (unsigned char *)out + zstream.total_out; + zstream.avail_out = zstream.total_out; + } while (1); +end: + inflateEnd(&zstream); + free(*ptr); + *ptr = out; + return zstream.total_out / 4; +} + +static int ascii85_decode(const char *in, uint32_t **out) +{ + int len = 0, size = 1024; + + *out = realloc(*out, sizeof(uint32_t)*size); + if (*out == NULL) + return 0; + + while (*in >= '!' && *in <= 'z') { + uint32_t v = 0; + + if (len == size) { + size *= 2; + *out = realloc(*out, sizeof(uint32_t)*size); + if (*out == NULL) + return 0; + } + + if (*in == 'z') { + in++; + } else { + v += in[0] - 33; v *= 85; + v += in[1] - 33; v *= 85; + v += in[2] - 33; v *= 85; + v += in[3] - 33; v *= 85; + v += in[4] - 33; + in += 5; + } + (*out)[len++] = v; + } + + return zlib_inflate(out, len); +} + 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; + uint32_t head[MAX_RINGS]; + int head_idx = 0; + int num_rings = 0; 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, ring_length = 0; - uint32_t gtt_offset = 0, new_gtt_offset; + uint64_t gtt_offset = 0, new_gtt_offset; + uint32_t head_offset = -1; + const char *buffer_name = "batch buffer"; char *ring_name = NULL; - int is_batch = 1; while (getline(&line, &line_size, file) > 0) { char *dashes; @@ -479,44 +566,99 @@ dashes = strstr(line, "---"); if (dashes) { + uint32_t lo, hi; char *new_ring_name = malloc(dashes - line); strncpy(new_ring_name, line, dashes - line); new_ring_name[dashes - line - 1] = '\0'; - if (num_rings == -1) - num_rings = head_ndx; + matched = sscanf(dashes, "--- gtt_offset = 0x%08x %08x\n", + &hi, &lo); + if (matched > 0) { + new_gtt_offset = hi; + if (matched == 2) { + new_gtt_offset <<= 32; + new_gtt_offset |= lo; + } + + decode(decode_ctx, + buffer_name, ring_name, + gtt_offset, head_offset, + data, &count); + gtt_offset = new_gtt_offset; + head_offset = -1; + free(ring_name); + ring_name = new_ring_name; + buffer_name = "batch buffer"; + continue; + } - matched = sscanf(dashes, "--- gtt_offset = 0x%08x\n", - &new_gtt_offset); - if (matched == 1) { - decode(decode_ctx, is_batch, ring_name, - gtt_offset, data, &count); + matched = sscanf(dashes, "--- ringbuffer = 0x%08x %08x\n", + &hi, &lo); + if (matched > 0) { + new_gtt_offset = hi; + if (matched == 2) { + new_gtt_offset <<= 32; + new_gtt_offset |= lo; + } + + decode(decode_ctx, + buffer_name, ring_name, + gtt_offset, head_offset, + data, &count); gtt_offset = new_gtt_offset; - is_batch = 1; + if (head_idx < num_rings) + head_offset = head[head_idx++]; + else + head_offset = -1; free(ring_name); ring_name = new_ring_name; + buffer_name = "ring buffer"; continue; } - matched = sscanf(dashes, "--- ringbuffer = 0x%08x\n", - &new_gtt_offset); - if (matched == 1) { - decode(decode_ctx, is_batch, ring_name, - gtt_offset, data, &count); + matched = sscanf(dashes, "--- HW Context = 0x%08x %08x\n", + &hi, &lo); + if (matched > 0) { + new_gtt_offset = hi; + if (matched == 2) { + new_gtt_offset <<= 32; + new_gtt_offset |= lo; + } + + decode(decode_ctx, + buffer_name, ring_name, + gtt_offset, head_offset, + data, &count); gtt_offset = new_gtt_offset; - is_batch = 0; + head_offset = -1; free(ring_name); ring_name = new_ring_name; + buffer_name = "HW Context"; continue; } } + if (line[0] == ':') { + count = ascii85_decode(line+1, &data); + if (count == 0) { + fprintf(stderr, "ASCII85 decode failed.\n"); + exit(1); + } + decode(decode_ctx, + buffer_name, ring_name, + gtt_offset, head_offset, + data, &count); + continue; + } + matched = sscanf(line, "%08x : %08x", &offset, &value); if (matched != 2) { unsigned int reg, reg2; /* display reg section is after the ringbuffers, don't mix them */ - decode(decode_ctx, is_batch, ring_name, gtt_offset, + decode(decode_ctx, + buffer_name, ring_name, + gtt_offset, head_offset, data, &count); printf("%s", line); @@ -597,7 +739,10 @@ data[count-1] = value; } - decode(decode_ctx, is_batch, ring_name, gtt_offset, data, &count); + decode(decode_ctx, + buffer_name, ring_name, + gtt_offset, head_offset, + data, &count); free(data); free(line); diff -Nru intel-gpu-tools-1.13/tools/intel_firmware_decode.c intel-gpu-tools-1.15/tools/intel_firmware_decode.c --- intel-gpu-tools-1.13/tools/intel_firmware_decode.c 2015-11-12 17:30:48.000000000 +0000 +++ intel-gpu-tools-1.15/tools/intel_firmware_decode.c 2016-05-23 10:51:28.000000000 +0000 @@ -25,6 +25,7 @@ */ #include +#include #include #include #include @@ -166,7 +167,7 @@ ctx->fd, 0); igt_fail_on_f(ctx->base == MAP_FAILED, "Couldn't mmap %s\n", filename); - printf("Firmware: %s (%zd bytes)\n", filename, st.st_size); + printf("Firmware: %s (%"PRId64" bytes)\n", filename, (int64_t)st.st_size); ctx->css_header = (struct intel_css_header *)ctx->base; ctx->package_header = (struct intel_package_header *) diff -Nru intel-gpu-tools-1.13/tools/intel_gpu_top.c intel-gpu-tools-1.15/tools/intel_gpu_top.c --- intel-gpu-tools-1.13/tools/intel_gpu_top.c 2015-08-17 17:17:55.000000000 +0000 +++ intel-gpu-tools-1.15/tools/intel_gpu_top.c 2016-05-23 10:51:28.000000000 +0000 @@ -679,7 +679,7 @@ for (i = 0; i < MAX_NUM_TOP_BITS; i++) { if (i < STATS_COUNT && HAS_STATS_REGS(devid)) { - fprintf(output, "%lu\t", + fprintf(output, "%"PRIu64"\t", stats[i] - last_stats[i]); last_stats[i] = stats[i]; } diff -Nru intel-gpu-tools-1.13/tools/intel_opregion_decode.c intel-gpu-tools-1.15/tools/intel_opregion_decode.c --- intel-gpu-tools-1.13/tools/intel_opregion_decode.c 2015-08-17 17:17:55.000000000 +0000 +++ intel-gpu-tools-1.15/tools/intel_opregion_decode.c 2016-05-23 10:51:28.000000000 +0000 @@ -122,7 +122,9 @@ uint8_t fdss[8]; uint32_t fdsp; uint32_t stat; - uint8_t rsvd[86]; + uint64_t rvda; /* Physical address of raw vbt data */ + uint32_t rvds; /* Size of raw vbt data */ + uint8_t rsvd[58]; } __attribute__((packed)); /* OpRegion mailbox #4: VBT */ @@ -308,6 +310,8 @@ printf("\tfdsp:\t0x%08x\n", asle->fdsp); printf("\tstat:\t0x%08x\n", asle->stat); + printf("\trvda:\t0x%016lx\n", asle->rvda); + printf("\trvds:\t0x%08x\n", asle->rvds); printf("\n"); } diff -Nru intel-gpu-tools-1.13/tools/intel_reg.c intel-gpu-tools-1.15/tools/intel_reg.c --- intel-gpu-tools-1.13/tools/intel_reg.c 2015-11-12 17:30:48.000000000 +0000 +++ intel-gpu-tools-1.15/tools/intel_reg.c 2016-05-23 10:51:28.000000000 +0000 @@ -669,6 +669,8 @@ return "broadwell"; else if (IS_SKYLAKE(devid)) return "skylake"; + else if (IS_KABYLAKE(devid)) + return "kabylake"; else if (IS_CHERRYVIEW(devid)) return "cherryview"; else if (IS_VALLEYVIEW(devid)) diff -Nru intel-gpu-tools-1.13/tools/intel_reg_decode.c intel-gpu-tools-1.15/tools/intel_reg_decode.c --- intel-gpu-tools-1.13/tools/intel_reg_decode.c 2015-11-12 17:30:48.000000000 +0000 +++ intel-gpu-tools-1.15/tools/intel_reg_decode.c 2016-05-23 10:51:28.000000000 +0000 @@ -54,7 +54,7 @@ if (!IS_MOBILE(devid)) return; - if (IS_965(devid)) { + if (IS_GEN4(devid)) { if (val & (1 << 1)) addressing = "dual channel interleaved"; else @@ -151,11 +151,11 @@ char buf[256]; int buf_len; - if (IS_965(devid)) - bit30 = val & I965_PIPECONF_ACTIVE ? "active" : "inactive"; + if (IS_GEN2(devid) || IS_GEN3(devid)) + bit30 = val & PIPEACONF_DOUBLE_WIDE ? + "double-wide" : "single-wide"; else - bit30 = - val & PIPEACONF_DOUBLE_WIDE ? "double-wide" : "single-wide"; + bit30 = val & I965_PIPECONF_ACTIVE ? "active" : "inactive"; buf_len = snprintf(buf, sizeof(buf), "%s, %s", enabled, bit30); @@ -701,7 +701,7 @@ unsigned int offset = val & 0x0ff00000; int size = (1024 * 1024) << ((val & 0x700) >> 8); - if (IS_965(devid) || (IS_915(devid) && reg >= FENCE_NEW)) + if (IS_GEN4(devid) || (IS_915(devid) && reg >= FENCE_NEW)) return; if (format == 'X') @@ -722,7 +722,7 @@ int pitch = ((val & 0xffc) >> 2) * 128 + 128; unsigned int offset = val & 0xfffff000; - if (!IS_965(devid)) + if (!IS_GEN4(devid)) return; snprintf(result, len, "%s, %c tile walk, %4d pitch, 0x%08x start", @@ -733,7 +733,7 @@ { unsigned int end = val & 0xfffff000; - if (!IS_965(devid)) + if (!IS_GEN4(devid)) return; snprintf(result, len, " 0x%08x end", end); @@ -2580,7 +2580,7 @@ static bool is_gen234(uint32_t devid, uint32_t pch) { - return IS_GEN2(devid) || IS_GEN3(devid) || IS_GEN3(devid); + return IS_GEN2(devid) || IS_GEN3(devid) || IS_GEN4(devid); } #define DECLARE_REGS(d,r,m) \ diff -Nru intel-gpu-tools-1.13/tools/intel_residency.c intel-gpu-tools-1.15/tools/intel_residency.c --- intel-gpu-tools-1.13/tools/intel_residency.c 1970-01-01 00:00:00.000000000 +0000 +++ intel-gpu-tools-1.15/tools/intel_residency.c 2016-05-23 10:51:28.000000000 +0000 @@ -0,0 +1,714 @@ +/* + * Copyright © 2016 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 +#include +#include "igt.h" + +#define IA32_TIME_STAMP_COUNTER 0x10 + +#define MSR_PKG_CST_CONFIG_CONTROL 0xE2 +#define PKG_CST_LIMIT_MASK 0x7 +#define PKG_CST_LIMIT_C0 0x0 +#define PKG_CST_LIMIT_C2 0x1 +#define PKG_CST_LIMIT_C3 0x2 +#define PKG_CST_LIMIT_C6 0x3 +#define PKG_CST_LIMIT_C7 0x4 +#define PKG_CST_LIMIT_C7s 0x5 +#define PKG_CST_NO_LIMIT 0x7 + +#define MSR_PKG_C2_RESIDENCY 0x60D +#define MSR_PKG_C3_RESIDENCY 0x3F8 +#define MSR_PKG_C6_RESIDENCY 0x3F9 +#define MSR_PKG_C7_RESIDENCY 0x3FA +#define MSR_PKG_C8_RESIDENCY 0x630 +#define MSR_PKG_C9_RESIDENCY 0x631 +#define MSR_PKG_C10_RESIDENCY 0x632 + +#define NUM_PC_STATES 7 + +const char *res_msr_names[] = { + "PC2", "PC3", "PC6", "PC7", "PC8", "PC9", "PC10" +}; + +const uint32_t res_msr_addrs[] = { + MSR_PKG_C2_RESIDENCY, + MSR_PKG_C3_RESIDENCY, + MSR_PKG_C6_RESIDENCY, + MSR_PKG_C7_RESIDENCY, + MSR_PKG_C8_RESIDENCY, + MSR_PKG_C9_RESIDENCY, + MSR_PKG_C10_RESIDENCY, +}; + +int msr_fd; + +uint32_t deepest_pc_state; +uint64_t idle_res; + +#define MAX_CONNECTORS 32 +#define MAX_PLANES 32 +struct { + int fd; + drmModeResPtr res; + drmModeConnectorPtr connectors[MAX_CONNECTORS]; + drm_intel_bufmgr *bufmgr; +} drm; + +struct { + uint32_t crtc_id; + uint32_t connector_id; + drmModeModeInfoPtr mode; +} modeset; + +int vblank_interval_us; +struct igt_fb fbs[2], cursor, *front_fb, *back_fb; + +struct { + int draw_size; + bool do_page_flip; + bool do_draw; + bool do_draw_and_flip; + int res_warm_time; + int res_calc_time; + int loop_inc; + char *test_name; +} opts = { + .draw_size = 0, + .do_page_flip = true, + .do_draw = true, + .do_draw_and_flip = true, + .res_warm_time = 1, + .res_calc_time = 4, + .loop_inc = 2, + .test_name = NULL, +}; + +static uint64_t msr_read(uint32_t addr) +{ + int rc; + uint64_t ret; + + rc = pread(msr_fd, &ret, sizeof(uint64_t), addr); + igt_assert(rc == sizeof(ret)); + + return ret; +} + +static void setup_msr(void) +{ +#if 0 + uint64_t control; + const char *limit; +#endif + + /* Make sure our Kernel supports MSR and the module is loaded. */ + igt_assert(system("modprobe -q msr > /dev/null 2>&1") != -1); + + msr_fd = open("/dev/cpu/0/msr", O_RDONLY); + igt_assert_f(msr_fd >= 0, + "Can't open /dev/cpu/0/msr.\n"); + +#if 0 + /* FIXME: why is this code not printing the truth? */ + control = msr_read(MSR_PKG_CST_CONFIG_CONTROL); + printf("Control: 0x016%" PRIx64 "\n", control); + switch (control & PKG_CST_LIMIT_MASK) { + case PKG_CST_LIMIT_C0: + limit = "C0"; + break; + case PKG_CST_LIMIT_C2: + limit = "C2"; + break; + case PKG_CST_LIMIT_C3: + limit = "C3"; + break; + case PKG_CST_LIMIT_C6: + limit = "C6"; + break; + case PKG_CST_LIMIT_C7: + limit = "C7"; + break; + case PKG_CST_LIMIT_C7s: + limit = "C7s"; + break; + case PKG_CST_NO_LIMIT: + limit = "no limit"; + break; + default: + limit = "unknown"; + break; + } + printf("Package C state limit: %s\n", limit); +#endif +} + +static void teardown_msr(void) +{ + close(msr_fd); +} + +static void setup_drm(void) +{ + int i; + + drm.fd = drm_open_driver_master(DRIVER_INTEL); + + drm.res = drmModeGetResources(drm.fd); + igt_assert(drm.res->count_connectors <= MAX_CONNECTORS); + + for (i = 0; i < drm.res->count_connectors; i++) + drm.connectors[i] = drmModeGetConnector(drm.fd, + drm.res->connectors[i]); + + drm.bufmgr = drm_intel_bufmgr_gem_init(drm.fd, 4096); + igt_assert(drm.bufmgr); + drm_intel_bufmgr_gem_enable_reuse(drm.bufmgr); +} + +static void teardown_drm(void) +{ + int i; + + drm_intel_bufmgr_destroy(drm.bufmgr); + + for (i = 0; i < drm.res->count_connectors; i++) + drmModeFreeConnector(drm.connectors[i]); + + drmModeFreeResources(drm.res); + close(drm.fd); +} + +static void draw_rect(struct igt_fb *fb, enum igt_draw_method method, + uint32_t color) +{ + drmModeClip clip; + int rc; + + switch (opts.draw_size) { + case 0: + clip.x1 = fb->width / 2 - 32; + clip.x2 = fb->width / 2 + 32; + clip.y1 = fb->height / 2 - 32; + clip.y2 = fb->height / 2 + 32; + break; + case 1: + clip.x1 = fb->width / 4; + clip.x2 = fb->width / 4 + fb->width / 2; + clip.y1 = fb->height / 4; + clip.y2 = fb->height / 4 + fb->height / 2; + break; + case 2: + clip.x1 = 0; + clip.x2 = fb->width; + clip.y1 = 0; + clip.y2 = fb->height; + break; + default: + igt_assert(false); + } + + igt_draw_rect_fb(drm.fd, drm.bufmgr, NULL, fb, method, clip.x1, clip.y1, + clip.x2 - clip.x1, clip.y2 - clip.y1, color); + + if (method == IGT_DRAW_MMAP_WC) { + rc = drmModeDirtyFB(drm.fd, fb->fb_id, &clip, 1); + igt_assert(rc == 0 || rc == -ENOSYS); + } +} + +static void setup_modeset(void) +{ + int i; + drmModeConnectorPtr connector; + + for (i = 0; i < drm.res->count_connectors; i++) { + connector = drm.connectors[i]; + + if (connector->connection == DRM_MODE_CONNECTED && + connector->count_modes > 0) + break; + } + igt_assert(i < drm.res->count_connectors); + + modeset.connector_id = connector->connector_id; + modeset.mode = &connector->modes[0]; + modeset.crtc_id = kmstest_find_crtc_for_connector(drm.fd, drm.res, + connector, 0); + + for (i = 0; i < 2; i++) { + igt_create_fb(drm.fd, modeset.mode->hdisplay, + modeset.mode->vdisplay, DRM_FORMAT_XRGB8888, + LOCAL_I915_FORMAT_MOD_X_TILED, &fbs[i]); + igt_draw_fill_fb(drm.fd, &fbs[i], 0x80); + } + draw_rect(&fbs[1], IGT_DRAW_BLT, 0x800000); + + igt_create_fb(drm.fd, 64, 64, DRM_FORMAT_ARGB8888, + LOCAL_DRM_FORMAT_MOD_NONE, &cursor); + igt_draw_fill_fb(drm.fd, &cursor, 0xFF008000); +} + +static void teardown_modeset(void) +{ + igt_remove_fb(drm.fd, &fbs[0]); + igt_remove_fb(drm.fd, &fbs[1]); + igt_remove_fb(drm.fd, &cursor); +} + +static void setup_vblank_interval(void) +{ + uint64_t vrefresh, interval; + + vrefresh = ((uint64_t) modeset.mode->clock * 1000 * 1000) / + (modeset.mode->htotal * modeset.mode->vtotal); + interval = 1000000000 / vrefresh; + + vblank_interval_us = interval; + + printf("Interval between vblanks:\t%dus\n", vblank_interval_us); +} + +bool alarm_received; +static void alarm_handler(int signal) +{ + alarm_received = true; +} + +static void setup_alarm(void) +{ + struct sigaction sa; + + sa.sa_handler = alarm_handler; + sigemptyset(&sa.sa_mask); + sa.sa_flags = 0; + sigaction(SIGALRM, &sa, NULL); +} + +static void set_alarm(time_t sec, suseconds_t usec) +{ + struct itimerval timerval = {{0, 0}, {sec, usec}}; + + alarm_received = false; + igt_assert(setitimer(ITIMER_REAL, &timerval, NULL) == 0); +} + +static void unset_mode(void) +{ + int rc; + + kmstest_unset_all_crtcs(drm.fd, drm.res); + rc = drmModeSetCursor(drm.fd, modeset.crtc_id, 0, 0, 0); + igt_assert(rc == 0); +} + +static void set_mode(void) +{ + int rc; + + front_fb = &fbs[0]; + back_fb = &fbs[1]; + rc = drmModeSetCrtc(drm.fd, modeset.crtc_id, front_fb->fb_id, 0, 0, + &modeset.connector_id, 1, modeset.mode); + igt_assert(rc == 0); + + /* TODO: it seems we need a cursor in order to reach PC7 on BDW. Why? */ + rc = drmModeMoveCursor(drm.fd, modeset.crtc_id, 0, 0); + igt_assert(rc == 0); + + rc = drmModeSetCursor(drm.fd, modeset.crtc_id, cursor.gem_handle, + cursor.width, cursor.height); + igt_assert(rc == 0); +} + +static void wait_vblanks(int n_vblanks) +{ + drmVBlank vblank; + + if (!n_vblanks) + return; + + vblank.request.type = DRM_VBLANK_RELATIVE; + vblank.request.sequence = n_vblanks; + vblank.request.signal = 0; + drmWaitVBlank(drm.fd, &vblank); +} + +static void page_flip(void) +{ + struct igt_fb *tmp_fb; + int rc; + + rc = drmModePageFlip(drm.fd, modeset.crtc_id, back_fb->fb_id, 0, NULL); + igt_assert(rc == 0); + + tmp_fb = front_fb; + front_fb = back_fb; + back_fb = tmp_fb; +} + +static void wait_until_idle(void) +{ + uint64_t tsc, pc, res; + + do { + set_alarm(0, 500 * 1000); + + tsc = msr_read(IA32_TIME_STAMP_COUNTER); + pc = msr_read(deepest_pc_state); + + while (!alarm_received) + pause(); + + pc = msr_read(deepest_pc_state) - pc; + tsc = msr_read(IA32_TIME_STAMP_COUNTER) - tsc; + + res = pc * 100 / tsc; + + /*printf("res:%02"PRIu64"\n", res);*/ + } while (res < idle_res && idle_res - res > 3); + + if (res > idle_res && res - idle_res > 3) + fprintf(stderr, "The calculated idle residency may be too low " + "(got %02"PRIu64"%%)\n", res); +} + +static uint64_t do_measurement(void (*callback)(void *ptr), void *ptr) +{ + uint64_t tsc, pc; + + wait_until_idle(); + + set_alarm(opts.res_warm_time, 0); + callback(ptr); + + set_alarm(opts.res_calc_time, 0); + + tsc = msr_read(IA32_TIME_STAMP_COUNTER); + pc = msr_read(deepest_pc_state); + + callback(ptr); + + pc = msr_read(deepest_pc_state) - pc; + tsc = msr_read(IA32_TIME_STAMP_COUNTER) - tsc; + + return pc * 100 / tsc; +} + +static void setup_idle(void) +{ + uint64_t tsc, pc[NUM_PC_STATES], res, best_res; + int pc_i, best_pc_i = 0, retries, consecutive_not_best; + + for (retries = 0; ; retries++) { + + set_alarm(opts.res_warm_time, 0); + while (!alarm_received) + pause(); + + set_alarm(opts.res_calc_time, 0); + + tsc = msr_read(IA32_TIME_STAMP_COUNTER); + for (pc_i = best_pc_i; pc_i < NUM_PC_STATES; pc_i++) + pc[pc_i] = msr_read(res_msr_addrs[pc_i]); + + while (!alarm_received) + pause(); + + for (pc_i = best_pc_i; pc_i < NUM_PC_STATES; pc_i++) + pc[pc_i] = msr_read(res_msr_addrs[pc_i]) - pc[pc_i]; + tsc = msr_read(IA32_TIME_STAMP_COUNTER) - tsc; + + for (pc_i = NUM_PC_STATES -1; pc_i >= best_pc_i; pc_i--) + if (pc[pc_i] != 0) + break; + igt_require_f(pc_i >= 0, "We're not reaching any PC states!\n"); + + res = pc[pc_i] * 100 / tsc; + + if (retries == 0 || pc_i > best_pc_i || res > best_res) { + best_pc_i = pc_i; + best_res = res; + consecutive_not_best = 0; + } else { + consecutive_not_best++; + if (consecutive_not_best > 2) + break; + } + } + + deepest_pc_state = res_msr_addrs[best_pc_i]; + idle_res = best_res; + + printf("Stable idle residency retries:\t%d\n", retries); + printf("Deepest PC state reached when idle:\t%s\n", + res_msr_names[best_pc_i]); + printf("Idle residency for this state:\t%02"PRIu64"%%\n", idle_res); +} + +static void print_result(int ops, int vblanks, uint64_t res) +{ + printf("- %02d ops every %02d vblanks:\t%02"PRIu64"%%\n", + ops, vblanks, res); + fflush(stdout); +} + +struct page_flip_data { + int n_vblanks; +}; + +static void page_flip_cb(void *ptr) +{ + struct page_flip_data *data = ptr; + + while (!alarm_received) { + page_flip(); + wait_vblanks(data->n_vblanks); + } +} + +static void page_flip_test(void) +{ + struct page_flip_data data; + int n_vblanks; + uint64_t res; + + printf("\nPage flip test:\n"); + + for (n_vblanks = 1; n_vblanks <= 64; n_vblanks *= opts.loop_inc) { + data.n_vblanks = n_vblanks; + res = do_measurement(page_flip_cb, &data); + print_result(1, n_vblanks, res); + } +} + +struct draw_data { + enum igt_draw_method method; + int n_vblanks; + int ops_per_vblank; +}; + +static void draw_cb(void *ptr) +{ + struct draw_data *data = ptr; + struct timespec req; + int i, ops; + + req.tv_sec = 0; + req.tv_nsec = vblank_interval_us * 1000 / data->ops_per_vblank; + + for (i = 0; !alarm_received; i++) { + for (ops = 0; ops < data->ops_per_vblank; ops++) { + draw_rect(front_fb, data->method, i << 8); + + /* The code that stops the callbacks relies on SIGALRM, + * so we have to use nanosleep since it doesn't use + * signals. */ + if (data->ops_per_vblank > 1) + nanosleep(&req, NULL); + } + + if (data->n_vblanks) + wait_vblanks(data->n_vblanks); + } +} + +static void draw_test(void) +{ + struct draw_data data; + enum igt_draw_method method; + int i; + uint64_t res; + + for (method = 0; method < IGT_DRAW_METHOD_COUNT; method++) { + data.method = method; + + printf("\nDraw %s test:\n", + igt_draw_get_method_name(method)); + + data.n_vblanks = 0; + for (i = 32; i >= 2; i /= opts.loop_inc) { + data.ops_per_vblank = i; + res = do_measurement(draw_cb, &data); + print_result(i, 1, res); + } + + data.ops_per_vblank = 1; + for (i = 1; i <= 64; i *= opts.loop_inc) { + data.n_vblanks = i ; + res = do_measurement(draw_cb, &data); + print_result(1, i, res); + } + } +} + +static void draw_and_flip_cb(void *ptr) +{ + struct draw_data *data = ptr; + int i, ops; + + for (i = 0; !alarm_received; i++) { + for (ops = 0; ops < data->ops_per_vblank; ops++) + draw_rect(back_fb, data->method, i << 8); + + page_flip(); + wait_vblanks(1); + } +} + +static void draw_and_flip_test(void) +{ + struct draw_data data; + enum igt_draw_method method; + int i; + uint64_t res; + + for (method = 0; method < IGT_DRAW_METHOD_COUNT; method++) { + data.method = method; + + /* Doing everything consumes too much time! */ + if (method != IGT_DRAW_MMAP_CPU && method != IGT_DRAW_BLT) + continue; + + printf("\nDraw and flip %s test:\n", + igt_draw_get_method_name(method)); + + for (i = 16; i >= 1; i /= opts.loop_inc) { + data.ops_per_vblank = 1; + res = do_measurement(draw_and_flip_cb, &data); + print_result(i, 1, res); + } + } +} + +static void parse_opts(int argc, char *argv[]) +{ + int opt; + char short_opts[] = "d:lrbw:c:i:fsn:"; + struct option long_opts[] = { + { "draw-size", required_argument, NULL, 'd'}, + { "no-flip", no_argument, NULL, 'l'}, + { "no-draw", no_argument, NULL, 'r'}, + { "no-draw-and-flip", no_argument, NULL, 'b'}, + { "warm-time", required_argument, NULL, 'w'}, + { "calc-time", required_argument, NULL, 'c'}, + { "loop-increment", required_argument, NULL, 'i'}, + { "fast", no_argument, NULL, 'f'}, + { "slow", no_argument, NULL, 's'}, + { "name", required_argument, NULL, 'n'}, + { 0 }, + }; + + while (1) { + opt = getopt_long(argc, argv, short_opts, long_opts, NULL); + + switch (opt) { + case 'd': + if (strcmp(optarg, "s") == 0) + opts.draw_size = 0; + else if (strcmp(optarg, "m") == 0) + opts.draw_size = 1; + else if (strcmp(optarg, "l") == 0) + opts.draw_size = 2; + else + igt_assert(false); + break; + case 'l': + opts.do_page_flip = false; + break; + case 'r': + opts.do_draw = false; + break; + case 'b': + opts.do_draw_and_flip = false; + break; + case 'w': + opts.res_warm_time = atoi(optarg); + break; + case 'c': + opts.res_calc_time = atoi(optarg); + break; + case 'i': + opts.loop_inc = atoi(optarg); + break; + case 'f': + opts.res_warm_time = 1; + opts.res_calc_time = 2; + opts.loop_inc = 4; + break; + case 's': + opts.res_warm_time = 2; + opts.res_calc_time = 6; + opts.loop_inc = 2; + break; + case 'n': + opts.test_name = optarg; + break; + case -1: + return; + default: + igt_assert(false); + } + } +} + +int main(int argc, char *argv[]) +{ + parse_opts(argc, argv); + + setup_msr(); + setup_drm(); + setup_modeset(); + setup_vblank_interval(); + setup_alarm(); + + printf("Test name:\t%s\n", opts.test_name); + + unset_mode(); + set_mode(); + + setup_idle(); + + if (opts.do_page_flip) + page_flip_test(); + + if (opts.do_draw) + draw_test(); + + if (opts.do_draw_and_flip) + draw_and_flip_test(); + + teardown_modeset(); + teardown_drm(); + teardown_msr(); + return 0; +} diff -Nru intel-gpu-tools-1.13/tools/intel_watermark.c intel-gpu-tools-1.15/tools/intel_watermark.c --- intel-gpu-tools-1.13/tools/intel_watermark.c 2015-11-12 17:30:48.000000000 +0000 +++ intel-gpu-tools-1.15/tools/intel_watermark.c 2016-05-23 10:51:28.000000000 +0000 @@ -95,6 +95,9 @@ struct ilk_wm { struct ilk_wm_level pipe[3]; + struct { + int linetime, ips; + } linetime[3]; struct ilk_wm_level lp[3]; }; @@ -133,6 +136,7 @@ uint32_t dspcntr[3]; uint32_t spcntr[3]; uint32_t wm_pipe[3]; + uint32_t wm_linetime[3]; uint32_t wm_lp[3]; uint32_t wm_lp_spr[3]; uint32_t arb_ctl, arb_ctl2, wm_misc = 0; @@ -153,6 +157,13 @@ wm_pipe[1] = read_reg(0x45104); if (num_pipes == 3) wm_pipe[2] = read_reg(0x45200); + + if (is_hsw_plus(devid)) { + wm_linetime[0] = read_reg(0x45270); + wm_linetime[1] = read_reg(0x45274); + wm_linetime[2] = read_reg(0x45278); + } + wm_lp[0] = read_reg(0x45108); wm_lp[1] = read_reg(0x4510c); wm_lp[2] = read_reg(0x45110); @@ -171,25 +182,34 @@ intel_register_access_fini(); for (i = 0; i < num_pipes; i++) - printf(" WM_PIPE_%c = 0x%08x\n", pipe_name(i), wm_pipe[i]); - printf(" WM_LP1 = 0x%08x\n", wm_lp[0]); - printf(" WM_LP2 = 0x%08x\n", wm_lp[1]); - printf(" WM_LP3 = 0x%08x\n", wm_lp[2]); - printf(" WM_LP1_SPR = 0x%08x\n", wm_lp_spr[0]); + printf(" WM_PIPE_%c = 0x%08x\n", pipe_name(i), wm_pipe[i]); + if (is_hsw_plus(devid)) { + for (i = 0; i < num_pipes; i++) + printf("WM_LINETIME_%c = 0x%08x\n", pipe_name(i), wm_linetime[i]); + } + printf(" WM_LP1 = 0x%08x\n", wm_lp[0]); + printf(" WM_LP2 = 0x%08x\n", wm_lp[1]); + printf(" WM_LP3 = 0x%08x\n", wm_lp[2]); + printf(" WM_LP1_SPR = 0x%08x\n", wm_lp_spr[0]); if (is_gen7_plus(devid)) { - printf(" WM_LP2_SPR = 0x%08x\n", wm_lp_spr[1]); - printf(" WM_LP3_SPR = 0x%08x\n", wm_lp_spr[2]); + printf(" WM_LP2_SPR = 0x%08x\n", wm_lp_spr[1]); + printf(" WM_LP3_SPR = 0x%08x\n", wm_lp_spr[2]); } - printf(" ARB_CTL = 0x%08x\n", arb_ctl); - printf(" ARB_CTL2 = 0x%08x\n", arb_ctl2); + printf(" ARB_CTL = 0x%08x\n", arb_ctl); + printf(" ARB_CTL2 = 0x%08x\n", arb_ctl2); if (is_hsw_plus(devid)) - printf(" WM_MISC = 0x%08x\n", wm_misc); + printf(" WM_MISC = 0x%08x\n", wm_misc); for (i = 0 ; i < num_pipes; i++) { wm.pipe[i].primary = REG_DECODE1(wm_pipe[i], 16, 8); wm.pipe[i].sprite = REG_DECODE1(wm_pipe[i], 8, 8); wm.pipe[i].cursor = REG_DECODE1(wm_pipe[i], 0, 6); + if (is_hsw_plus(devid)) { + wm.linetime[i].linetime = REG_DECODE1(wm_linetime[i], 0, 9); + wm.linetime[i].ips = REG_DECODE1(wm_linetime[i], 16, 9); + } + wm.pipe[i].primary_trickle_feed_dis = REG_DECODE1(dspcntr[i], 14, 1); if (!IS_GEN5(devid)) @@ -218,6 +238,12 @@ printf("WM_PIPE_%c: primary=%d, cursor=%d, sprite=%d\n", pipe_name(i), wm.pipe[i].primary, wm.pipe[i].cursor, wm.pipe[i].sprite); } + if (is_hsw_plus(devid)) { + for (i = 0; i < num_pipes; i++) { + printf("WM_LINETIME_%c: line time=%d, ips line time=%d\n", + pipe_name(i), wm.linetime[i].linetime, wm.linetime[i].ips); + } + } if (is_gen7_plus(devid)) { for (i = 0; i < 3; i++) { printf("WM_LP%d: %s, latency=%d, fbc=%d, primary=%d, cursor=%d, sprite=%d\n", diff -Nru intel-gpu-tools-1.13/tools/Makefile.am intel-gpu-tools-1.15/tools/Makefile.am --- intel-gpu-tools-1.13/tools/Makefile.am 2015-11-24 16:36:54.000000000 +0000 +++ intel-gpu-tools-1.15/tools/Makefile.am 2016-05-23 10:51:28.000000000 +0000 @@ -3,8 +3,10 @@ SUBDIRS = null_state_gen registers AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/lib -AM_CFLAGS = $(DEBUG_CFLAGS) $(DRM_CFLAGS) $(PCIACCESS_CFLAGS) $(CWARNFLAGS) $(CAIRO_CFLAGS) $(LIBUNWIND_CFLAGS) -DPKGDATADIR=\"$(pkgdatadir)\" -LDADD = $(top_builddir)/lib/libintel_tools.la $(DRM_LIBS) $(PCIACCESS_LIBS) $(CAIRO_LIBS) $(LIBUDEV_LIBS) $(LIBUNWIND_LIBS) -lm +AM_CFLAGS = $(DEBUG_CFLAGS) $(DRM_CFLAGS) $(PCIACCESS_CFLAGS) $(CWARNFLAGS) \ + $(CAIRO_CFLAGS) $(LIBUNWIND_CFLAGS) -DPKGDATADIR=\"$(pkgdatadir)\" \ + $(WERROR_CFLAGS) +LDADD = $(top_builddir)/lib/libintel_tools.la AM_LDFLAGS = -Wl,--as-needed diff -Nru intel-gpu-tools-1.13/tools/Makefile.in intel-gpu-tools-1.15/tools/Makefile.in --- intel-gpu-tools-1.13/tools/Makefile.in 2015-12-02 16:47:59.000000000 +0000 +++ intel-gpu-tools-1.15/tools/Makefile.in 2016-05-31 17:03:32.000000000 +0000 @@ -90,6 +90,7 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ +target_triplet = @target@ noinst_PROGRAMS = hsw_compute_wrpll$(EXEEXT) \ skl_compute_wrpll$(EXEEXT) skl_ddb_allocation$(EXEEXT) bin_PROGRAMS = igt_stats$(EXEEXT) intel_audio_dump$(EXEEXT) \ @@ -104,7 +105,8 @@ intel_l3_parity$(EXEEXT) intel_lid$(EXEEXT) \ intel_opregion_decode$(EXEEXT) intel_panel_fitter$(EXEEXT) \ intel_perf_counters$(EXEEXT) intel_reg_checker$(EXEEXT) \ - intel_stepping$(EXEEXT) intel_watermark$(EXEEXT) + intel_residency$(EXEEXT) intel_stepping$(EXEEXT) \ + intel_watermark$(EXEEXT) subdir = tools ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/as-compiler-flag.m4 \ @@ -165,209 +167,145 @@ hsw_compute_wrpll_SOURCES = hsw_compute_wrpll.c hsw_compute_wrpll_OBJECTS = hsw_compute_wrpll.$(OBJEXT) hsw_compute_wrpll_LDADD = $(LDADD) -am__DEPENDENCIES_1 = hsw_compute_wrpll_DEPENDENCIES = \ - $(top_builddir)/lib/libintel_tools.la $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) + $(top_builddir)/lib/libintel_tools.la igt_stats_SOURCES = igt_stats.c igt_stats_OBJECTS = igt_stats.$(OBJEXT) igt_stats_LDADD = $(LDADD) -igt_stats_DEPENDENCIES = $(top_builddir)/lib/libintel_tools.la \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) +igt_stats_DEPENDENCIES = $(top_builddir)/lib/libintel_tools.la intel_audio_dump_SOURCES = intel_audio_dump.c intel_audio_dump_OBJECTS = intel_audio_dump.$(OBJEXT) intel_audio_dump_LDADD = $(LDADD) -intel_audio_dump_DEPENDENCIES = $(top_builddir)/lib/libintel_tools.la \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) +intel_audio_dump_DEPENDENCIES = $(top_builddir)/lib/libintel_tools.la 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) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) +intel_backlight_DEPENDENCIES = $(top_builddir)/lib/libintel_tools.la 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__DEPENDENCIES_1) $(am__DEPENDENCIES_1) + $(top_builddir)/lib/libintel_tools.la 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) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) + $(top_builddir)/lib/libintel_tools.la intel_display_crc_SOURCES = intel_display_crc.c intel_display_crc_OBJECTS = intel_display_crc.$(OBJEXT) intel_display_crc_LDADD = $(LDADD) intel_display_crc_DEPENDENCIES = \ - $(top_builddir)/lib/libintel_tools.la $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) + $(top_builddir)/lib/libintel_tools.la intel_display_poller_SOURCES = intel_display_poller.c intel_display_poller_OBJECTS = intel_display_poller.$(OBJEXT) intel_display_poller_LDADD = $(LDADD) intel_display_poller_DEPENDENCIES = \ - $(top_builddir)/lib/libintel_tools.la $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) + $(top_builddir)/lib/libintel_tools.la 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__DEPENDENCIES_1) $(am__DEPENDENCIES_1) + $(top_builddir)/lib/libintel_tools.la 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) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) + $(top_builddir)/lib/libintel_tools.la +intel_error_decode_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(AM_CFLAGS) $(CFLAGS) $(intel_error_decode_LDFLAGS) \ + $(LDFLAGS) -o $@ intel_firmware_decode_SOURCES = intel_firmware_decode.c intel_firmware_decode_OBJECTS = intel_firmware_decode.$(OBJEXT) intel_firmware_decode_LDADD = $(LDADD) intel_firmware_decode_DEPENDENCIES = \ - $(top_builddir)/lib/libintel_tools.la $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) + $(top_builddir)/lib/libintel_tools.la 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) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) +intel_forcewaked_DEPENDENCIES = $(top_builddir)/lib/libintel_tools.la intel_framebuffer_dump_SOURCES = intel_framebuffer_dump.c intel_framebuffer_dump_OBJECTS = intel_framebuffer_dump.$(OBJEXT) intel_framebuffer_dump_LDADD = $(LDADD) intel_framebuffer_dump_DEPENDENCIES = \ - $(top_builddir)/lib/libintel_tools.la $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) + $(top_builddir)/lib/libintel_tools.la intel_gpu_frequency_SOURCES = intel_gpu_frequency.c intel_gpu_frequency_OBJECTS = intel_gpu_frequency.$(OBJEXT) intel_gpu_frequency_LDADD = $(LDADD) intel_gpu_frequency_DEPENDENCIES = \ - $(top_builddir)/lib/libintel_tools.la $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) + $(top_builddir)/lib/libintel_tools.la 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) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) +intel_gpu_time_DEPENDENCIES = $(top_builddir)/lib/libintel_tools.la 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) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) +intel_gpu_top_DEPENDENCIES = $(top_builddir)/lib/libintel_tools.la 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) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) +intel_gtt_DEPENDENCIES = $(top_builddir)/lib/libintel_tools.la 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) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) +intel_infoframes_DEPENDENCIES = $(top_builddir)/lib/libintel_tools.la am_intel_l3_parity_OBJECTS = intel_l3_parity.$(OBJEXT) \ intel_l3_udev_listener.$(OBJEXT) intel_l3_parity_OBJECTS = $(am_intel_l3_parity_OBJECTS) intel_l3_parity_LDADD = $(LDADD) -intel_l3_parity_DEPENDENCIES = $(top_builddir)/lib/libintel_tools.la \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) +intel_l3_parity_DEPENDENCIES = $(top_builddir)/lib/libintel_tools.la 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) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) +intel_lid_DEPENDENCIES = $(top_builddir)/lib/libintel_tools.la intel_opregion_decode_SOURCES = intel_opregion_decode.c intel_opregion_decode_OBJECTS = intel_opregion_decode.$(OBJEXT) intel_opregion_decode_LDADD = $(LDADD) intel_opregion_decode_DEPENDENCIES = \ - $(top_builddir)/lib/libintel_tools.la $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) + $(top_builddir)/lib/libintel_tools.la 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) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) + $(top_builddir)/lib/libintel_tools.la intel_perf_counters_SOURCES = intel_perf_counters.c intel_perf_counters_OBJECTS = intel_perf_counters.$(OBJEXT) intel_perf_counters_LDADD = $(LDADD) intel_perf_counters_DEPENDENCIES = \ - $(top_builddir)/lib/libintel_tools.la $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) + $(top_builddir)/lib/libintel_tools.la am_intel_reg_OBJECTS = intel_reg.$(OBJEXT) intel_reg_decode.$(OBJEXT) \ intel_reg_spec.$(OBJEXT) intel_reg_OBJECTS = $(am_intel_reg_OBJECTS) intel_reg_LDADD = $(LDADD) -intel_reg_DEPENDENCIES = $(top_builddir)/lib/libintel_tools.la \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) +intel_reg_DEPENDENCIES = $(top_builddir)/lib/libintel_tools.la 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) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) + $(top_builddir)/lib/libintel_tools.la +intel_residency_SOURCES = intel_residency.c +intel_residency_OBJECTS = intel_residency.$(OBJEXT) +intel_residency_LDADD = $(LDADD) +intel_residency_DEPENDENCIES = $(top_builddir)/lib/libintel_tools.la 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__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) +intel_stepping_DEPENDENCIES = $(top_builddir)/lib/libintel_tools.la intel_watermark_SOURCES = intel_watermark.c intel_watermark_OBJECTS = intel_watermark.$(OBJEXT) intel_watermark_LDADD = $(LDADD) -intel_watermark_DEPENDENCIES = $(top_builddir)/lib/libintel_tools.la \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) +intel_watermark_DEPENDENCIES = $(top_builddir)/lib/libintel_tools.la skl_compute_wrpll_SOURCES = skl_compute_wrpll.c skl_compute_wrpll_OBJECTS = skl_compute_wrpll.$(OBJEXT) skl_compute_wrpll_LDADD = $(LDADD) skl_compute_wrpll_DEPENDENCIES = \ - $(top_builddir)/lib/libintel_tools.la $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) + $(top_builddir)/lib/libintel_tools.la skl_ddb_allocation_SOURCES = skl_ddb_allocation.c skl_ddb_allocation_OBJECTS = skl_ddb_allocation.$(OBJEXT) skl_ddb_allocation_LDADD = $(LDADD) skl_ddb_allocation_DEPENDENCIES = \ - $(top_builddir)/lib/libintel_tools.la $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) + $(top_builddir)/lib/libintel_tools.la SCRIPTS = $(bin_SCRIPTS) $(dist_bin_SCRIPTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) @@ -413,8 +351,8 @@ intel_gtt.c intel_infoframes.c $(intel_l3_parity_SOURCES) \ intel_lid.c intel_opregion_decode.c intel_panel_fitter.c \ intel_perf_counters.c $(intel_reg_SOURCES) intel_reg_checker.c \ - intel_stepping.c intel_watermark.c skl_compute_wrpll.c \ - skl_ddb_allocation.c + intel_residency.c intel_stepping.c intel_watermark.c \ + skl_compute_wrpll.c skl_ddb_allocation.c DIST_SOURCES = $(intel_aubdump_la_SOURCES) hsw_compute_wrpll.c \ igt_stats.c intel_audio_dump.c intel_backlight.c \ intel_bios_dumper.c $(intel_bios_reader_SOURCES) \ @@ -426,8 +364,8 @@ intel_infoframes.c $(intel_l3_parity_SOURCES) intel_lid.c \ intel_opregion_decode.c intel_panel_fitter.c \ intel_perf_counters.c $(intel_reg_SOURCES) intel_reg_checker.c \ - intel_stepping.c intel_watermark.c skl_compute_wrpll.c \ - skl_ddb_allocation.c + intel_residency.c intel_stepping.c intel_watermark.c \ + skl_compute_wrpll.c skl_ddb_allocation.c RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ @@ -531,6 +469,8 @@ DRM_LIBS = @DRM_LIBS@ DRM_NOUVEAU_CFLAGS = @DRM_NOUVEAU_CFLAGS@ DRM_NOUVEAU_LIBS = @DRM_NOUVEAU_LIBS@ +DRM_VC4_CFLAGS = @DRM_VC4_CFLAGS@ +DRM_VC4_LIBS = @DRM_VC4_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -575,6 +515,7 @@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MAN_SUBSTS = @MAN_SUBSTS@ @@ -619,6 +560,7 @@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ THREAD_CFLAGS = @THREAD_CFLAGS@ +TIMER_LIBS = @TIMER_LIBS@ VERSION = @VERSION@ XORG_MAN_PAGE = @XORG_MAN_PAGE@ XRANDR_CFLAGS = @XRANDR_CFLAGS@ @@ -673,11 +615,16 @@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ +target = @target@ target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ @@ -694,6 +641,7 @@ intel_error_decode_SOURCES = \ intel_error_decode.c +intel_error_decode_LDFLAGS = -lz intel_bios_reader_SOURCES = \ intel_bios_reader.c \ intel_bios.h @@ -705,8 +653,11 @@ SUBDIRS = null_state_gen registers AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/lib -AM_CFLAGS = $(DEBUG_CFLAGS) $(DRM_CFLAGS) $(PCIACCESS_CFLAGS) $(CWARNFLAGS) $(CAIRO_CFLAGS) $(LIBUNWIND_CFLAGS) -DPKGDATADIR=\"$(pkgdatadir)\" -LDADD = $(top_builddir)/lib/libintel_tools.la $(DRM_LIBS) $(PCIACCESS_LIBS) $(CAIRO_LIBS) $(LIBUDEV_LIBS) $(LIBUNWIND_LIBS) -lm +AM_CFLAGS = $(DEBUG_CFLAGS) $(DRM_CFLAGS) $(PCIACCESS_CFLAGS) $(CWARNFLAGS) \ + $(CAIRO_CFLAGS) $(LIBUNWIND_CFLAGS) -DPKGDATADIR=\"$(pkgdatadir)\" \ + $(WERROR_CFLAGS) + +LDADD = $(top_builddir)/lib/libintel_tools.la AM_LDFLAGS = -Wl,--as-needed # aubdumper @@ -888,7 +839,7 @@ 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) + $(AM_V_CCLD)$(intel_error_decode_LINK) $(intel_error_decode_OBJECTS) $(intel_error_decode_LDADD) $(LIBS) intel_firmware_decode$(EXEEXT): $(intel_firmware_decode_OBJECTS) $(intel_firmware_decode_DEPENDENCIES) $(EXTRA_intel_firmware_decode_DEPENDENCIES) @rm -f intel_firmware_decode$(EXEEXT) @@ -950,6 +901,10 @@ @rm -f intel_reg_checker$(EXEEXT) $(AM_V_CCLD)$(LINK) $(intel_reg_checker_OBJECTS) $(intel_reg_checker_LDADD) $(LIBS) +intel_residency$(EXEEXT): $(intel_residency_OBJECTS) $(intel_residency_DEPENDENCIES) $(EXTRA_intel_residency_DEPENDENCIES) + @rm -f intel_residency$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(intel_residency_OBJECTS) $(intel_residency_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) @@ -1071,6 +1026,7 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/intel_reg_checker.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/intel_reg_decode.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/intel_reg_spec.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/intel_residency.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/intel_stepping.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/intel_watermark.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/skl_compute_wrpll.Po@am__quote@ diff -Nru intel-gpu-tools-1.13/tools/Makefile.sources intel-gpu-tools-1.15/tools/Makefile.sources --- intel-gpu-tools-1.13/tools/Makefile.sources 2015-11-12 17:30:48.000000000 +0000 +++ intel-gpu-tools-1.15/tools/Makefile.sources 2016-05-23 10:51:28.000000000 +0000 @@ -29,6 +29,7 @@ intel_panel_fitter \ intel_perf_counters \ intel_reg_checker \ + intel_residency \ intel_stepping \ intel_watermark @@ -45,6 +46,7 @@ intel_error_decode_SOURCES = \ intel_error_decode.c +intel_error_decode_LDFLAGS = -lz intel_bios_reader_SOURCES = \ intel_bios_reader.c \ diff -Nru intel-gpu-tools-1.13/tools/null_state_gen/Makefile.in intel-gpu-tools-1.15/tools/null_state_gen/Makefile.in --- intel-gpu-tools-1.13/tools/null_state_gen/Makefile.in 2015-12-02 16:47:59.000000000 +0000 +++ intel-gpu-tools-1.15/tools/null_state_gen/Makefile.in 2016-05-31 17:03:32.000000000 +0000 @@ -88,6 +88,7 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ +target_triplet = @target@ noinst_PROGRAMS = intel_null_state_gen$(EXEEXT) subdir = tools/null_state_gen ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 @@ -213,6 +214,8 @@ DRM_LIBS = @DRM_LIBS@ DRM_NOUVEAU_CFLAGS = @DRM_NOUVEAU_CFLAGS@ DRM_NOUVEAU_LIBS = @DRM_NOUVEAU_LIBS@ +DRM_VC4_CFLAGS = @DRM_VC4_CFLAGS@ +DRM_VC4_LIBS = @DRM_VC4_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -257,6 +260,7 @@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MAN_SUBSTS = @MAN_SUBSTS@ @@ -301,6 +305,7 @@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ THREAD_CFLAGS = @THREAD_CFLAGS@ +TIMER_LIBS = @TIMER_LIBS@ VERSION = @VERSION@ XORG_MAN_PAGE = @XORG_MAN_PAGE@ XRANDR_CFLAGS = @XRANDR_CFLAGS@ @@ -355,11 +360,16 @@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ +target = @target@ target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ diff -Nru intel-gpu-tools-1.13/tools/registers/cherryview intel-gpu-tools-1.15/tools/registers/cherryview --- intel-gpu-tools-1.13/tools/registers/cherryview 2015-11-12 17:30:48.000000000 +0000 +++ intel-gpu-tools-1.15/tools/registers/cherryview 2016-05-23 10:51:28.000000000 +0000 @@ -1,6 +1,7 @@ vlv_pipe_a.txt vlv_pipe_b.txt chv_pipe_c.txt +chv_pipe_b_extra.txt chv_display_base.txt chv_dpio_phy_x2.txt chv_dpio_phy_x1.txt diff -Nru intel-gpu-tools-1.13/tools/registers/chv_pipe_b_extra.txt intel-gpu-tools-1.15/tools/registers/chv_pipe_b_extra.txt --- intel-gpu-tools-1.13/tools/registers/chv_pipe_b_extra.txt 1970-01-01 00:00:00.000000000 +0000 +++ intel-gpu-tools-1.15/tools/registers/chv_pipe_b_extra.txt 2016-05-23 10:51:28.000000000 +0000 @@ -0,0 +1,240 @@ +('BLEND_B', '0x61A00', '0x180000') +('CANVAS_B', '0x61A04', '0x180000') +('PRIMPOS_B', '0x61A08', '0x180000') +('PRIMSIZE_B', '0x61A0C', '0x180000') +('PRIMB_CNSTalpha', '0x61A10', '0x180000') +('FLIP_DIS', '0x61B00', '0x180000') + +('SPCSCYGOFF_C', '0x6D900', '0x180000') +('SPCSCBGOFF_C', '0x6D904', '0x180000') +('SPCSCCROFF_C', '0x6D908', '0x180000') +('SPCSCC01_C', '0x6D90C', '0x180000') +('SPCSCC23_C', '0x6D910', '0x180000') +('SPCSCC45_C', '0x6D914', '0x180000') +('SPCSCC67_C', '0x6D918', '0x180000') +('SPCSCC8_C', '0x6D91C', '0x180000') +('SPCSCYGICLAMP_C', '0x6D920', '0x180000') +('SPCSCCBICLAMP_C', '0x6D924', '0x180000') +('SPCSCCRICLAMP_C', '0x6D928', '0x180000') +('SPCSCYGOCLAMP_C', '0x6D92C', '0x180000') +('SPCSCCBOCLAMP_C', '0x6D930', '0x180000') +('SPCSCCROCLAMP_C', '0x6D934', '0x180000') +('SPCSCYGOFF_D', '0x6E900', '0x180000') +('SPCSCBGOFF_D', '0x6E904', '0x180000') +('SPCSCCROFF_D', '0x6E908', '0x180000') +('SPCSCC01_D', '0x6E90C', '0x180000') +('SPCSCC23_D', '0x6E910', '0x180000') +('SPCSCC45_D', '0x6E914', '0x180000') +('SPCSCC67_D', '0x6E918', '0x180000') +('SPCSCC8_D', '0x6E91C', '0x180000') +('SPCSCYGICLAMP_D', '0x6E920', '0x180000') +('SPCSCCBICLAMP_D', '0x6E924', '0x180000') +('SPCSCCRICLAMP_D', '0x6E928', '0x180000') +('SPCSCYGOCLAMP_D', '0x6E92C', '0x180000') +('SPCSCCBOCLAMP_D', '0x6E930', '0x180000') +('SPCSCCROCLAMP_D', '0x6E934', '0x180000') + +('PCPSXCONFIG', '0x6D000', '0x180000') +('PCPSXHS_CNTL', '0x6D100', '0x180000') +('PCPSXHS_H', '0x6D104', '0x180000') +('PCPSXHS_W', '0x6D108', '0x180000') +('PCPSXHS_NBP', '0x6D10C', '0x180000') +('PCPSXHS_ISF', '0x6D110', '0x180000') +('PCPSXHS_PC', '0x6D114', '0x180000') +('PCPSXHS_PM_0_W0', '0x6D200', '0x180000') +('PCPSXHS_PM_0_W1', '0x6D204', '0x180000') +('PCPSXHS_PM_0_W3', '0x6D208', '0x180000') +('PCPSXHS_PM_0_W4', '0x6D20C', '0x180000') +('PCPSXHS_PM_1_W0', '0x6D210', '0x180000') +('PCPSXHS_PM_1_W1', '0x6D214', '0x180000') +('PCPSXHS_PM_1_W2', '0x6D218', '0x180000') +('PCPSXHS_PM_1_W3', '0x6D21C', '0x180000') +('PCPSXHS_PM_2_W0', '0x6D220', '0x180000') +('PCPSXHS_PM_2_W1', '0x6D224', '0x180000') +('PCPSXHS_PM_2_W2', '0x6D228', '0x180000') +('PCPSXHS_PM_2_W3', '0x6D22C', '0x180000') +('PCPSXHS_PM_3_W0', '0x6D230', '0x180000') +('PCPSXHS_PM_3_W1', '0x6D234', '0x180000') +('PCPSXHS_PM_3_W2', '0x6D238', '0x180000') +('PCPSXHS_PM_3_W3', '0x6D23C', '0x180000') +('PCPSXHS_PM_4_W0', '0x6D240', '0x180000') +('PCPSXHS_PM_4_W1', '0x6D244', '0x180000') +('PCPSXHS_PM_4_W3', '0x6D248', '0x180000') +('PCPSXHS_PM_4_W4', '0x6D24C', '0x180000') +('PCPSXHS_PM_5_W0', '0x6D250', '0x180000') +('PCPSXHS_PM_5_W1', '0x6D254', '0x180000') +('PCPSXHS_PM_5_W2', '0x6D258', '0x180000') +('PCPSXHS_PM_5_W3', '0x6D25C', '0x180000') +('PCPSXHS_PM_6_W0', '0x6D260', '0x180000') +('PCPSXHS_PM_6_W1', '0x6D264', '0x180000') +('PCPSXHS_PM_6_W2', '0x6D268', '0x180000') +('PCPSXHS_PM_6_W3', '0x6D26C', '0x180000') +('PCPSXHS_PM_7_W0', '0x6D270', '0x180000') +('PCPSXHS_PM_7_W1', '0x6D274', '0x180000') +('PCPSXHS_PM_7_W2', '0x6D278', '0x180000') +('PCPSXHS_PM_7_W3', '0x6D27C', '0x180000') +('PCPSXHS_PM_8_W0', '0x6D280', '0x180000') +('PCPSXHS_PM_8_W1', '0x6D284', '0x180000') +('PCPSXHS_PM_8_W3', '0x6D288', '0x180000') +('PCPSXHS_PM_8_W4', '0x6D28C', '0x180000') +('PCPSXHS_PM_9_W0', '0x6D290', '0x180000') +('PCPSXHS_PM_9_W1', '0x6D294', '0x180000') +('PCPSXHS_PM_9_W3', '0x6D298', '0x180000') +('PCPSXHS_PM_9_W4', '0x6D29C', '0x180000') +('PCPSXHS_PM_10_W0', '0x6D2A0', '0x180000') +('PCPSXHS_PM_10_W1', '0x6D2A4', '0x180000') +('PCPSXHS_PM_10_W3', '0x6D2A8', '0x180000') +('PCPSXHS_PM_10_W4', '0x6D2AC', '0x180000') +('PCPSXHS_PM_11_W0', '0x6D2B0', '0x180000') +('PCPSXHS_PM_11_W1', '0x6D2B4', '0x180000') +('PCPSXHS_PM_11_W2', '0x6D2B8', '0x180000') +('PCPSXHS_PM_11_W3', '0x6D2BC', '0x180000') +('PCPSXHS_PM_12_W0', '0x6D2C0', '0x180000') +('PCPSXHS_PM_12_W1', '0x6D2C4', '0x180000') +('PCPSXHS_PM_12_W2', '0x6D2C8', '0x180000') +('PCPSXHS_PM_12_W3', '0x6D2CC', '0x180000') +('PCPSXHS_PM_13_W0', '0x6D2D0', '0x180000') +('PCPSXHS_PM_13_W1', '0x6D2D4', '0x180000') +('PCPSXHS_PM_13_W2', '0x6D2D8', '0x180000') +('PCPSXHS_PM_13_W3', '0x6D2DC', '0x180000') +('PCPSXHS_PM_14_W0', '0x6D2E0', '0x180000') +('PCPSXHS_PM_14_W1', '0x6D2E4', '0x180000') +('PCPSXHS_PM_14_W2', '0x6D2E8', '0x180000') +('PCPSXHS_PM_14_W3', '0x6D2EC', '0x180000') +('PCPSXHS_PM_15_W0', '0x6D2F0', '0x180000') +('PCPSXHS_PM_15_W1', '0x6D2F4', '0x180000') +('PCPSXHS_PM_15_W2', '0x6D2F8', '0x180000') +('PCPSXHS_PM_15_W3', '0x6D2FC', '0x180000') +('PCPSXHS_APM_0_W0', '0x6D300', '0x180000') +('PCPSXHS_APM_0_W1', '0x6D304', '0x180000') +('PCPSXHS_APM_0_W3', '0x6D308', '0x180000') +('PCPSXHS_APM_0_W4', '0x6D30C', '0x180000') +('PCPSXHS_APM_1_W0', '0x6D310', '0x180000') +('PCPSXHS_APM_1_W1', '0x6D314', '0x180000') +('PCPSXHS_APM_1_W2', '0x6D318', '0x180000') +('PCPSXHS_APM_1_W3', '0x6D31C', '0x180000') +('PCPSXHS_APM_2_W0', '0x6D320', '0x180000') +('PCPSXHS_APM_2_W1', '0x6D324', '0x180000') +('PCPSXHS_APM_2_W2', '0x6D328', '0x180000') +('PCPSXHS_APM_2_W3', '0x6D32C', '0x180000') +('PCPSXHS_APM_3_W0', '0x6D330', '0x180000') +('PCPSXHS_APM_3_W1', '0x6D334', '0x180000') +('PCPSXHS_APM_3_W2', '0x6D338', '0x180000') +('PCPSXHS_APM_3_W3', '0x6D33C', '0x180000') +('PCPSXHS_APM_4_W0', '0x6D340', '0x180000') +('PCPSXHS_APM_4_W1', '0x6D344', '0x180000') +('PCPSXHS_APM_4_W3', '0x6D348', '0x180000') +('PCPSXHS_APM_4_W4', '0x6D34C', '0x180000') +('PCPSXHS_APM_5_W0', '0x6D350', '0x180000') +('PCPSXHS_APM_5_W1', '0x6D354', '0x180000') +('PCPSXHS_APM_5_W2', '0x6D358', '0x180000') +('PCPSXHS_APM_5_W3', '0x6D35C', '0x180000') +('PCPSXHS_APM_6_W0', '0x6D360', '0x180000') +('PCPSXHS_APM_6_W1', '0x6D364', '0x180000') +('PCPSXHS_APM_6_W2', '0x6D368', '0x180000') +('PCPSXHS_APM_6_W3', '0x6D36C', '0x180000') +('PCPSXHS_APM_7_W0', '0x6D370', '0x180000') +('PCPSXHS_APM_7_W1', '0x6D374', '0x180000') +('PCPSXHS_APM_7_W2', '0x6D378', '0x180000') +('PCPSXHS_APM_7_W3', '0x6D37C', '0x180000') +('PCPSXHS_APM_8_W0', '0x6D380', '0x180000') +('PCPSXHS_APM_8_W1', '0x6D384', '0x180000') +('PCPSXHS_APM_8_W3', '0x6D388', '0x180000') +('PCPSXHS_APM_8_W4', '0x6D38C', '0x180000') +('PCPSXHS_APM_9_W0', '0x6D390', '0x180000') +('PCPSXHS_APM_9_W1', '0x6D394', '0x180000') +('PCPSXHS_APM_9_W3', '0x6D398', '0x180000') +('PCPSXHS_APM_9_W4', '0x6D39C', '0x180000') +('PCPSXHS_APM_10_W0', '0x6D3A0', '0x180000') +('PCPSXHS_APM_10_W1', '0x6D3A4', '0x180000') +('PCPSXHS_APM_10_W3', '0x6D3A8', '0x180000') +('PCPSXHS_APM_10_W4', '0x6D3AC', '0x180000') +('PCPSXHS_APM_11_W0', '0x6D3B0', '0x180000') +('PCPSXHS_APM_11_W1', '0x6D3B4', '0x180000') +('PCPSXHS_APM_11_W2', '0x6D3B8', '0x180000') +('PCPSXHS_APM_11_W3', '0x6D3BC', '0x180000') +('PCPSXHS_APM_12_W0', '0x6D3C0', '0x180000') +('PCPSXHS_APM_12_W1', '0x6D3C4', '0x180000') +('PCPSXHS_APM_12_W2', '0x6D3C8', '0x180000') +('PCPSXHS_APM_12_W3', '0x6D3CC', '0x180000') +('PCPSXHS_APM_13_W0', '0x6D3D0', '0x180000') +('PCPSXHS_APM_13_W1', '0x6D3D4', '0x180000') +('PCPSXHS_APM_13_W2', '0x6D3D8', '0x180000') +('PCPSXHS_APM_13_W3', '0x6D3DC', '0x180000') +('PCPSXHS_APM_14_W0', '0x6D3E0', '0x180000') +('PCPSXHS_APM_14_W1', '0x6D3E4', '0x180000') +('PCPSXHS_APM_14_W2', '0x6D3E8', '0x180000') +('PCPSXHS_APM_14_W3', '0x6D3EC', '0x180000') +('PCPSXHS_APM_15_W0', '0x6D3F0', '0x180000') +('PCPSXHS_APM_15_W1', '0x6D3F4', '0x180000') +('PCPSXHS_APM_15_W2', '0x6D3F8', '0x180000') +('PCPSXHS_APM_15_W3', '0x6D3FC', '0x180000') +('PCPSXVS_CNTL', '0x6D500', '0x180000') +('PCPSXVS_H', '0x6D504', '0x180000') +('PCPSXVS_W', '0x6D508', '0x180000') +('PCPSXVS_ISF', '0x6D510', '0x180000') +('PCPSXVS_PC', '0x6D514', '0x180000') +('PCPSXVS_PM_0_W0', '0x6D600', '0x180000') +('PCPSXVS_PM_0_W1', '0x6D604', '0x180000') +('PCPSXVS_PM_1_W0', '0x6D608', '0x180000') +('PCPSXVS_PM_1_W1', '0x6D60C', '0x180000') +('PCPSXVS_PM_2_W0', '0x6D610', '0x180000') +('PCPSXVS_PM_2_W1', '0x6D614', '0x180000') +('PCPSXVS_PM_3_W0', '0x6D618', '0x180000') +('PCPSXVS_PM_3_W1', '0x6D61C', '0x180000') +('PCPSXVS_PM_4_W0', '0x6D620', '0x180000') +('PCPSXVS_PM_4_W1', '0x6D624', '0x180000') +('PCPSXVS_PM_5_W0', '0x6D628', '0x180000') +('PCPSXVS_PM_5_W1', '0x6D62C', '0x180000') +('PCPSXVS_PM_6_W0', '0x6D630', '0x180000') +('PCPSXVS_PM_6_W1', '0x6D634', '0x180000') +('PCPSXVS_PM_7_W0', '0x6D638', '0x180000') +('PCPSXVS_PM_7_W1', '0x6D63C', '0x180000') +('PCPSXVS_PM_8_W0', '0x6D640', '0x180000') +('PCPSXVS_PM_8_W1', '0x6D644', '0x180000') +('PCPSXVS_PM_9_W0', '0x6D648', '0x180000') +('PCPSXVS_PM_9_W1', '0x6D64C', '0x180000') +('PCPSXVS_PM_10_W0', '0x6D650', '0x180000') +('PCPSXVS_PM_10_W1', '0x6D654', '0x180000') +('PCPSXVS_PM_11_W0', '0x6D658', '0x180000') +('PCPSXVS_PM_11_W1', '0x6D65C', '0x180000') +('PCPSXVS_PM_12_W0', '0x6D660', '0x180000') +('PCPSXVS_PM_12_W1', '0x6D664', '0x180000') +('PCPSXVS_PM_13_W0', '0x6D668', '0x180000') +('PCPSXVS_PM_13_W1', '0x6D66C', '0x180000') +('PCPSXVS_PM_14_W0', '0x6D670', '0x180000') +('PCPSXVS_PM_14_W1', '0x6D674', '0x180000') +('PCPSXVS_PM_15_W0', '0x6D678', '0x180000') +('PCPSXVS_PM_15_W1', '0x6D67C', '0x180000') +('PCPSXVS_APM_0_W0', '0x6D700', '0x180000') +('PCPSXVS_APM_0_W1', '0x6D704', '0x180000') +('PCPSXVS_APM_1_W0', '0x6D708', '0x180000') +('PCPSXVS_APM_1_W1', '0x6D70C', '0x180000') +('PCPSXVS_APM_2_W0', '0x6D710', '0x180000') +('PCPSXVS_APM_2_W1', '0x6D714', '0x180000') +('PCPSXVS_APM_3_W0', '0x6D718', '0x180000') +('PCPSXVS_APM_3_W1', '0x6D71C', '0x180000') +('PCPSXVS_APM_4_W0', '0x6D720', '0x180000') +('PCPSXVS_APM_4_W1', '0x6D724', '0x180000') +('PCPSXVS_APM_5_W0', '0x6D728', '0x180000') +('PCPSXVS_APM_5_W1', '0x6D72C', '0x180000') +('PCPSXVS_APM_6_W0', '0x6D730', '0x180000') +('PCPSXVS_APM_6_W1', '0x6D734', '0x180000') +('PCPSXVS_APM_7_W0', '0x6D738', '0x180000') +('PCPSXVS_APM_7_W1', '0x6D73C', '0x180000') +('PCPSXVS_APM_8_W0', '0x6D740', '0x180000') +('PCPSXVS_APM_8_W1', '0x6D744', '0x180000') +('PCPSXVS_APM_9_W0', '0x6D748', '0x180000') +('PCPSXVS_APM_9_W1', '0x6D74C', '0x180000') +('PCPSXVS_APM_10_W0', '0x6D750', '0x180000') +('PCPSXVS_APM_10_W1', '0x6D754', '0x180000') +('PCPSXVS_APM_11_W0', '0x6D758', '0x180000') +('PCPSXVS_APM_11_W1', '0x6D75C', '0x180000') +('PCPSXVS_APM_12_W0', '0x6D760', '0x180000') +('PCPSXVS_APM_12_W1', '0x6D764', '0x180000') +('PCPSXVS_APM_13_W0', '0x6D768', '0x180000') +('PCPSXVS_APM_13_W1', '0x6D76C', '0x180000') +('PCPSXVS_APM_14_W0', '0x6D770', '0x180000') +('PCPSXVS_APM_14_W1', '0x6D774', '0x180000') +('PCPSXVS_APM_15_W0', '0x6D778', '0x180000') +('PCPSXVS_APM_15_W1', '0x6D77C', '0x180000') diff -Nru intel-gpu-tools-1.13/tools/registers/Makefile.in intel-gpu-tools-1.15/tools/registers/Makefile.in --- intel-gpu-tools-1.13/tools/registers/Makefile.in 2015-12-02 16:47:59.000000000 +0000 +++ intel-gpu-tools-1.15/tools/registers/Makefile.in 2016-05-31 17:03:32.000000000 +0000 @@ -88,6 +88,7 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ +target_triplet = @target@ subdir = tools/registers ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/as-compiler-flag.m4 \ @@ -188,6 +189,8 @@ DRM_LIBS = @DRM_LIBS@ DRM_NOUVEAU_CFLAGS = @DRM_NOUVEAU_CFLAGS@ DRM_NOUVEAU_LIBS = @DRM_NOUVEAU_LIBS@ +DRM_VC4_CFLAGS = @DRM_VC4_CFLAGS@ +DRM_VC4_LIBS = @DRM_VC4_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -232,6 +235,7 @@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MAN_SUBSTS = @MAN_SUBSTS@ @@ -276,6 +280,7 @@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ THREAD_CFLAGS = @THREAD_CFLAGS@ +TIMER_LIBS = @TIMER_LIBS@ VERSION = @VERSION@ XORG_MAN_PAGE = @XORG_MAN_PAGE@ XRANDR_CFLAGS = @XRANDR_CFLAGS@ @@ -330,11 +335,16 @@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ +target = @target@ target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@