diff -Nru libdrm-2.4.56/aclocal.m4 libdrm-2.4.60/aclocal.m4 --- libdrm-2.4.56/aclocal.m4 2014-07-29 16:13:51.000000000 +0000 +++ libdrm-2.4.60/aclocal.m4 2015-03-19 14:37:44.000000000 +0000 @@ -1,4 +1,4 @@ -# generated automatically by aclocal 1.14.1 -*- Autoconf -*- +# generated automatically by aclocal 1.13.4 -*- Autoconf -*- # Copyright (C) 1996-2013 Free Software Foundation, Inc. @@ -180,6 +180,46 @@ fi[]dnl ])# PKG_CHECK_MODULES + +# 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. +AC_DEFUN([PKG_INSTALLDIR], +[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])]) +m4_pushdef([pkg_description], + [pkg-config installation directory @<:@]pkg_default[@:>@]) +AC_ARG_WITH([pkgconfigdir], + [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],, + [with_pkgconfigdir=]pkg_default) +AC_SUBST([pkgconfigdir], [$with_pkgconfigdir]) +m4_popdef([pkg_default]) +m4_popdef([pkg_description]) +]) 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. +AC_DEFUN([PKG_NOARCH_INSTALLDIR], +[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])]) +m4_pushdef([pkg_description], + [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@]) +AC_ARG_WITH([noarch-pkgconfigdir], + [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],, + [with_noarch_pkgconfigdir=]pkg_default) +AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir]) +m4_popdef([pkg_default]) +m4_popdef([pkg_description]) +]) dnl PKG_NOARCH_INSTALLDIR + # Copyright (C) 2002-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation @@ -192,10 +232,10 @@ # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], -[am__api_version='1.14' +[am__api_version='1.13' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.14.1], [], +m4_if([$1], [1.13.4], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -211,7 +251,7 @@ # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.14.1])dnl +[AM_AUTOMAKE_VERSION([1.13.4])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) @@ -578,12 +618,6 @@ # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. -dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. -m4_define([AC_PROG_CC], -m4_defn([AC_PROG_CC]) -[_AM_PROG_CC_C_O -]) - # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- @@ -692,48 +726,7 @@ AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl - -# POSIX will say in a future version that running "rm -f" with no argument -# is OK; and we want to be able to make that assumption in our Makefile -# recipes. So use an aggressive probe to check that the usage we want is -# actually supported "in the wild" to an acceptable degree. -# See automake bug#10828. -# To make any issue more visible, cause the running configure to be aborted -# by default if the 'rm' program in use doesn't match our expectations; the -# user can still override this though. -if rm -f && rm -fr && rm -rf; then : OK; else - cat >&2 <<'END' -Oops! - -Your 'rm' program seems unable to run without file operands specified -on the command line, even when the '-f' option is present. This is contrary -to the behaviour of most rm programs out there, and not conforming with -the upcoming POSIX standard: - -Please tell bug-automake@gnu.org about your system, including the value -of your $PATH and any error possibly output before this message. This -can help us improve future automake versions. - -END - if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then - echo 'Configuration will proceed anyway, since you have set the' >&2 - echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 - echo >&2 - else - cat >&2 <<'END' -Aborting the configuration process, to ensure you take notice of the issue. - -You can download and install GNU coreutils to get an 'rm' implementation -that behaves properly: . - -If you want to complete the configuration process using your problematic -'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM -to "yes", and re-run configure. - -END - AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) - fi -fi]) +]) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further @@ -741,6 +734,7 @@ m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) + # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. @@ -802,42 +796,6 @@ rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) -# Add --enable-maintainer-mode option to configure. -*- Autoconf -*- -# From Jim Meyering - -# Copyright (C) 1996-2013 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_MAINTAINER_MODE([DEFAULT-MODE]) -# ---------------------------------- -# Control maintainer-specific portions of Makefiles. -# Default is to disable them, unless 'enable' is passed literally. -# For symmetry, 'disable' may be passed as well. Anyway, the user -# can override the default with the --enable/--disable switch. -AC_DEFUN([AM_MAINTAINER_MODE], -[m4_case(m4_default([$1], [disable]), - [enable], [m4_define([am_maintainer_other], [disable])], - [disable], [m4_define([am_maintainer_other], [enable])], - [m4_define([am_maintainer_other], [enable]) - m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) -AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) - dnl maintainer-mode's default is 'disable' unless 'enable' is passed - AC_ARG_ENABLE([maintainer-mode], - [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode], - am_maintainer_other[ make rules and dependencies not useful - (and sometimes confusing) to the casual installer])], - [USE_MAINTAINER_MODE=$enableval], - [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) - AC_MSG_RESULT([$USE_MAINTAINER_MODE]) - AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) - MAINT=$MAINTAINER_MODE_TRUE - AC_SUBST([MAINT])dnl -] -) - # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001-2013 Free Software Foundation, Inc. @@ -958,70 +916,6 @@ AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) -# Copyright (C) 1999-2013 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# _AM_PROG_CC_C_O -# --------------- -# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC -# to automatically call this. -AC_DEFUN([_AM_PROG_CC_C_O], -[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -AC_REQUIRE_AUX_FILE([compile])dnl -AC_LANG_PUSH([C])dnl -AC_CACHE_CHECK( - [whether $CC understands -c and -o together], - [am_cv_prog_cc_c_o], - [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) - # Make sure it works both with $CC and with simple cc. - # Following AC_PROG_CC_C_O, we do the test twice because some - # compilers refuse to overwrite an existing .o file with -o, - # though they will create one. - am_cv_prog_cc_c_o=yes - for am_i in 1 2; do - if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ - && test -f conftest2.$ac_objext; then - : OK - else - am_cv_prog_cc_c_o=no - break - fi - done - rm -f core conftest* - unset am_i]) -if test "$am_cv_prog_cc_c_o" != yes; then - # Losing compiler, so override with the script. - # FIXME: It is wrong to rewrite CC. - # But if we don't then we get into trouble of one sort or another. - # A longer-term fix would be to have automake use am__CC in this case, - # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" - CC="$am_aux_dir/compile $CC" -fi -AC_LANG_POP([C])]) - -# For backward compatibility. -AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) - -# Copyright (C) 2001-2013 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_RUN_LOG(COMMAND) -# ------------------- -# Run COMMAND, save the exit status in ac_status, and log it. -# (This has been adapted from Autoconf's _AC_RUN_LOG macro.) -AC_DEFUN([AM_RUN_LOG], -[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD - ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD - (exit $ac_status); }]) - # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996-2013 Free Software Foundation, Inc. diff -Nru libdrm-2.4.56/Android.mk libdrm-2.4.60/Android.mk --- libdrm-2.4.56/Android.mk 1970-01-01 00:00:00.000000000 +0000 +++ libdrm-2.4.60/Android.mk 2015-02-28 18:34:25.000000000 +0000 @@ -0,0 +1,63 @@ +# +# Copyright © 2011-2012 Intel Corporation +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# the rights to use, copy, modify, merge, publish, distribute, sublicense, +# and/or sell copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice (including the next +# paragraph) shall be included in all copies or substantial portions of the +# Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# + +LOCAL_PATH := $(call my-dir) +include $(CLEAR_VARS) + +LIBDRM_TOP := $(LOCAL_PATH) + +# Import variables LIBDRM_{,H_,INCLUDE_H_,INCLUDE_VMWGFX_H_}FILES +include $(LOCAL_PATH)/Makefile.sources + +LOCAL_MODULE := libdrm +LOCAL_MODULE_TAGS := optional + +LOCAL_SRC_FILES := $(LIBDRM_FILES) +LOCAL_EXPORT_C_INCLUDE_DIRS += \ + $(LOCAL_PATH) \ + $(LOCAL_PATH)/include/drm + +LOCAL_C_INCLUDES := \ + $(LIBDRM_TOP)/include/drm + +LOCAL_CFLAGS := \ + -DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1 + +LOCAL_COPY_HEADERS := \ + $(LIBDRM_H_FILES) \ + $(LIBDRM_INCLUDE_H_FILES) \ + $(LIBDRM_INCLUDE_VMWGFX_H_FILES) + +LOCAL_COPY_HEADERS_TO := libdrm +include $(BUILD_SHARED_LIBRARY) + +SUBDIRS := \ + freedreno \ + intel \ + nouveau \ + radeon \ + libkms \ + tests/modetest + +mkfiles := $(patsubst %,$(LIBDRM_TOP)/%/Android.mk,$(SUBDIRS)) +include $(mkfiles) diff -Nru libdrm-2.4.56/autogen.sh libdrm-2.4.60/autogen.sh --- libdrm-2.4.56/autogen.sh 2015-05-07 19:02:17.000000000 +0000 +++ libdrm-2.4.60/autogen.sh 2015-05-07 19:02:17.000000000 +0000 @@ -1,6 +1,14 @@ #! /bin/sh -test -n "$srcdir" || srcdir=`dirname "$0"` -test -n "$srcdir" || srcdir=. -autoreconf --force --install --verbose "$srcdir" -test -n "$NOCONFIGURE" || "$srcdir/configure" --enable-maintainer-mode "$@" +srcdir=`dirname "$0"` +test -z "$srcdir" && srcdir=. + +ORIGDIR=`pwd` +cd "$srcdir" + +autoreconf --force --verbose --install || exit 1 +cd "$ORIGDIR" || exit $? + +if test -z "$NOCONFIGURE"; then + "$srcdir"/configure "$@" +fi diff -Nru libdrm-2.4.56/build-aux/compile libdrm-2.4.60/build-aux/compile --- libdrm-2.4.56/build-aux/compile 2014-07-29 16:13:52.000000000 +0000 +++ libdrm-2.4.60/build-aux/compile 1970-01-01 00:00:00.000000000 +0000 @@ -1,347 +0,0 @@ -#! /bin/sh -# Wrapper for compilers which do not understand '-c -o'. - -scriptversion=2012-10-14.11; # UTC - -# Copyright (C) 1999-2013 Free Software Foundation, Inc. -# Written by Tom Tromey . -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# This file is maintained in Automake, please report -# bugs to or send patches to -# . - -nl=' -' - -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent tools from complaining about whitespace usage. -IFS=" "" $nl" - -file_conv= - -# func_file_conv build_file lazy -# Convert a $build file to $host form and store it in $file -# Currently only supports Windows hosts. If the determined conversion -# type is listed in (the comma separated) LAZY, no conversion will -# take place. -func_file_conv () -{ - file=$1 - case $file in - / | /[!/]*) # absolute file, and not a UNC file - if test -z "$file_conv"; then - # lazily determine how to convert abs files - case `uname -s` in - MINGW*) - file_conv=mingw - ;; - CYGWIN*) - file_conv=cygwin - ;; - *) - file_conv=wine - ;; - esac - fi - case $file_conv/,$2, in - *,$file_conv,*) - ;; - mingw/*) - file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` - ;; - cygwin/*) - file=`cygpath -m "$file" || echo "$file"` - ;; - wine/*) - file=`winepath -w "$file" || echo "$file"` - ;; - esac - ;; - esac -} - -# func_cl_dashL linkdir -# Make cl look for libraries in LINKDIR -func_cl_dashL () -{ - func_file_conv "$1" - if test -z "$lib_path"; then - lib_path=$file - else - lib_path="$lib_path;$file" - fi - linker_opts="$linker_opts -LIBPATH:$file" -} - -# func_cl_dashl library -# Do a library search-path lookup for cl -func_cl_dashl () -{ - lib=$1 - found=no - save_IFS=$IFS - IFS=';' - for dir in $lib_path $LIB - do - IFS=$save_IFS - if $shared && test -f "$dir/$lib.dll.lib"; then - found=yes - lib=$dir/$lib.dll.lib - break - fi - if test -f "$dir/$lib.lib"; then - found=yes - lib=$dir/$lib.lib - break - fi - if test -f "$dir/lib$lib.a"; then - found=yes - lib=$dir/lib$lib.a - break - fi - done - IFS=$save_IFS - - if test "$found" != yes; then - lib=$lib.lib - fi -} - -# func_cl_wrapper cl arg... -# Adjust compile command to suit cl -func_cl_wrapper () -{ - # Assume a capable shell - lib_path= - shared=: - linker_opts= - for arg - do - if test -n "$eat"; then - eat= - else - case $1 in - -o) - # configure might choose to run compile as 'compile cc -o foo foo.c'. - eat=1 - case $2 in - *.o | *.[oO][bB][jJ]) - func_file_conv "$2" - set x "$@" -Fo"$file" - shift - ;; - *) - func_file_conv "$2" - set x "$@" -Fe"$file" - shift - ;; - esac - ;; - -I) - eat=1 - func_file_conv "$2" mingw - set x "$@" -I"$file" - shift - ;; - -I*) - func_file_conv "${1#-I}" mingw - set x "$@" -I"$file" - shift - ;; - -l) - eat=1 - func_cl_dashl "$2" - set x "$@" "$lib" - shift - ;; - -l*) - func_cl_dashl "${1#-l}" - set x "$@" "$lib" - shift - ;; - -L) - eat=1 - func_cl_dashL "$2" - ;; - -L*) - func_cl_dashL "${1#-L}" - ;; - -static) - shared=false - ;; - -Wl,*) - arg=${1#-Wl,} - save_ifs="$IFS"; IFS=',' - for flag in $arg; do - IFS="$save_ifs" - linker_opts="$linker_opts $flag" - done - IFS="$save_ifs" - ;; - -Xlinker) - eat=1 - linker_opts="$linker_opts $2" - ;; - -*) - set x "$@" "$1" - shift - ;; - *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) - func_file_conv "$1" - set x "$@" -Tp"$file" - shift - ;; - *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) - func_file_conv "$1" mingw - set x "$@" "$file" - shift - ;; - *) - set x "$@" "$1" - shift - ;; - esac - fi - shift - done - if test -n "$linker_opts"; then - linker_opts="-link$linker_opts" - fi - exec "$@" $linker_opts - exit 1 -} - -eat= - -case $1 in - '') - echo "$0: No command. Try '$0 --help' for more information." 1>&2 - exit 1; - ;; - -h | --h*) - cat <<\EOF -Usage: compile [--help] [--version] PROGRAM [ARGS] - -Wrapper for compilers which do not understand '-c -o'. -Remove '-o dest.o' from ARGS, run PROGRAM with the remaining -arguments, and rename the output as expected. - -If you are trying to build a whole package this is not the -right script to run: please start by reading the file 'INSTALL'. - -Report bugs to . -EOF - exit $? - ;; - -v | --v*) - echo "compile $scriptversion" - exit $? - ;; - cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) - func_cl_wrapper "$@" # Doesn't return... - ;; -esac - -ofile= -cfile= - -for arg -do - if test -n "$eat"; then - eat= - else - case $1 in - -o) - # configure might choose to run compile as 'compile cc -o foo foo.c'. - # So we strip '-o arg' only if arg is an object. - eat=1 - case $2 in - *.o | *.obj) - ofile=$2 - ;; - *) - set x "$@" -o "$2" - shift - ;; - esac - ;; - *.c) - cfile=$1 - set x "$@" "$1" - shift - ;; - *) - set x "$@" "$1" - shift - ;; - esac - fi - shift -done - -if test -z "$ofile" || test -z "$cfile"; then - # If no '-o' option was seen then we might have been invoked from a - # pattern rule where we don't need one. That is ok -- this is a - # normal compilation that the losing compiler can handle. If no - # '.c' file was seen then we are probably linking. That is also - # ok. - exec "$@" -fi - -# Name of file we expect compiler to create. -cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` - -# Create the lock directory. -# Note: use '[/\\:.-]' here to ensure that we don't use the same name -# that we are using for the .o file. Also, base the name on the expected -# object file name, since that is what matters with a parallel build. -lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d -while true; do - if mkdir "$lockdir" >/dev/null 2>&1; then - break - fi - sleep 1 -done -# FIXME: race condition here if user kills between mkdir and trap. -trap "rmdir '$lockdir'; exit 1" 1 2 15 - -# Run the compile. -"$@" -ret=$? - -if test -f "$cofile"; then - test "$cofile" = "$ofile" || mv "$cofile" "$ofile" -elif test -f "${cofile}bj"; then - test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" -fi - -rmdir "$lockdir" -exit $ret - -# Local Variables: -# mode: shell-script -# sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" -# time-stamp-end: "; # UTC" -# End: diff -Nru libdrm-2.4.56/build-aux/config.sub libdrm-2.4.60/build-aux/config.sub --- libdrm-2.4.56/build-aux/config.sub 2014-07-29 16:13:52.000000000 +0000 +++ libdrm-2.4.60/build-aux/config.sub 2015-03-19 14:37:46.000000000 +0000 @@ -2,7 +2,7 @@ # Configuration validation subroutine script. # Copyright 1992-2013 Free Software Foundation, Inc. -timestamp='2013-08-10' +timestamp='2013-04-24' # 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 @@ -257,7 +257,7 @@ | avr | avr32 \ | be32 | be64 \ | bfin \ - | c4x | c8051 | clipper \ + | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | epiphany \ | fido | fr30 | frv \ @@ -372,7 +372,7 @@ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ - | c8051-* | clipper-* | craynv-* | cydra-* \ + | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ @@ -794,7 +794,7 @@ os=-mingw64 ;; mingw32) - basic_machine=i686-pc + basic_machine=i386-pc os=-mingw32 ;; mingw32ce) @@ -830,7 +830,7 @@ basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; msys) - basic_machine=i686-pc + basic_machine=i386-pc os=-msys ;; mvs) @@ -1006,7 +1006,7 @@ ;; ppc64) basic_machine=powerpc64-unknown ;; - ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ppc64-* | ppc64p7-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown @@ -1546,9 +1546,6 @@ c4x-* | tic4x-*) os=-coff ;; - c8051-*) - os=-elf - ;; hexagon-*) os=-elf ;; diff -Nru libdrm-2.4.56/build-aux/ltmain.sh libdrm-2.4.60/build-aux/ltmain.sh --- libdrm-2.4.56/build-aux/ltmain.sh 2014-07-29 16:13:50.000000000 +0000 +++ libdrm-2.4.60/build-aux/ltmain.sh 2015-03-19 14:37:41.000000000 +0000 @@ -70,7 +70,7 @@ # compiler: $LTCC # compiler flags: $LTCFLAGS # linker: $LD (gnu? $with_gnu_ld) -# $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1.7ubuntu1 +# $progname: (GNU libtool) 2.4.2 # automake: $automake_version # autoconf: $autoconf_version # @@ -80,7 +80,7 @@ PROGRAM=libtool PACKAGE=libtool -VERSION="2.4.2 Debian-2.4.2-1.7ubuntu1" +VERSION=2.4.2 TIMESTAMP="" package_revision=1.3337 @@ -6124,10 +6124,7 @@ case $pass in dlopen) libs="$dlfiles" ;; dlpreopen) libs="$dlprefiles" ;; - link) - libs="$deplibs %DEPLIBS%" - test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs" - ;; + link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; esac fi if test "$linkmode,$pass" = "lib,dlpreopen"; then @@ -6447,19 +6444,19 @@ # It is a libtool convenience library, so add in its objects. func_append convenience " $ladir/$objdir/$old_library" func_append old_convenience " $ladir/$objdir/$old_library" - tmp_libs= - for deplib in $dependency_libs; do - deplibs="$deplib $deplibs" - if $opt_preserve_dup_deps ; then - case "$tmp_libs " in - *" $deplib "*) func_append specialdeplibs " $deplib" ;; - esac - fi - func_append tmp_libs " $deplib" - done elif test "$linkmode" != prog && test "$linkmode" != lib; then func_fatal_error "\`$lib' is not a convenience library" fi + 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 @@ -7352,9 +7349,6 @@ revision="$number_minor" lt_irix_increment=no ;; - *) - func_fatal_configuration "$modename: unknown library version type \`$version_type'" - ;; esac ;; no) diff -Nru libdrm-2.4.56/build-aux/missing libdrm-2.4.60/build-aux/missing --- libdrm-2.4.56/build-aux/missing 2014-07-29 16:13:52.000000000 +0000 +++ libdrm-2.4.60/build-aux/missing 2015-03-19 14:37:46.000000000 +0000 @@ -1,7 +1,7 @@ #! /bin/sh # Common wrapper for a few potentially missing GNU programs. -scriptversion=2013-10-28.13; # UTC +scriptversion=2012-06-26.16; # UTC # Copyright (C) 1996-2013 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. @@ -160,7 +160,7 @@ ;; autom4te*) echo "You might have modified some maintainer files that require" - echo "the 'autom4te' program to be rebuilt." + echo "the 'automa4te' program to be rebuilt." program_details 'autom4te' ;; bison*|yacc*) diff -Nru libdrm-2.4.56/build-aux/test-driver libdrm-2.4.60/build-aux/test-driver --- libdrm-2.4.56/build-aux/test-driver 2014-07-29 16:13:53.000000000 +0000 +++ libdrm-2.4.60/build-aux/test-driver 2015-03-19 14:37:47.000000000 +0000 @@ -1,7 +1,7 @@ #! /bin/sh # test-driver - basic testsuite driver script. -scriptversion=2013-07-13.22; # UTC +scriptversion=2012-06-27.10; # UTC # Copyright (C) 2011-2013 Free Software Foundation, Inc. # @@ -44,12 +44,13 @@ Usage: test-driver --test-name=NAME --log-file=PATH --trs-file=PATH [--expect-failure={yes|no}] [--color-tests={yes|no}] - [--enable-hard-errors={yes|no}] [--] - TEST-SCRIPT [TEST-SCRIPT-ARGUMENTS] + [--enable-hard-errors={yes|no}] [--] TEST-SCRIPT The '--test-name', '--log-file' and '--trs-file' options are mandatory. END } +# TODO: better error handling in option parsing (in particular, ensure +# TODO: $log_file, $trs_file and $test_name are defined). test_name= # Used for reporting. log_file= # Where to save the output of the test script. trs_file= # Where to save the metadata of the test run. @@ -68,23 +69,10 @@ --enable-hard-errors) enable_hard_errors=$2; shift;; --) shift; break;; -*) usage_error "invalid option: '$1'";; - *) break;; esac shift done -missing_opts= -test x"$test_name" = x && missing_opts="$missing_opts --test-name" -test x"$log_file" = x && missing_opts="$missing_opts --log-file" -test x"$trs_file" = x && missing_opts="$missing_opts --trs-file" -if test x"$missing_opts" != x; then - usage_error "the following mandatory options are missing:$missing_opts" -fi - -if test $# -eq 0; then - usage_error "missing argument" -fi - if test $color_tests = yes; then # Keep this in sync with 'lib/am/check.am:$(am__tty_colors)'. red='' # Red. diff -Nru libdrm-2.4.56/CleanSpec.mk libdrm-2.4.60/CleanSpec.mk --- libdrm-2.4.56/CleanSpec.mk 1970-01-01 00:00:00.000000000 +0000 +++ libdrm-2.4.60/CleanSpec.mk 2015-05-07 19:02:17.000000000 +0000 @@ -0,0 +1,3 @@ +$(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/include/libdrm) +$(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/include/freedreno) +$(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/SHARED_LIBRARIES/libdrm_*intermediates) diff -Nru libdrm-2.4.56/config.h.in libdrm-2.4.60/config.h.in --- libdrm-2.4.56/config.h.in 2014-07-29 16:13:52.000000000 +0000 +++ libdrm-2.4.60/config.h.in 2015-03-19 14:37:45.000000000 +0000 @@ -30,9 +30,15 @@ /* Have freedreno support */ #undef HAVE_FREEDRENO +/* Have freedreno support for KGSL kernel interface */ +#undef HAVE_FREEDRENO_KGSL + /* Install test programs */ #undef HAVE_INSTALL_TESTS +/* Have intel support */ +#undef HAVE_INTEL + /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H @@ -72,18 +78,27 @@ /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_MKDEV_H + /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H +/* Have Tegra support */ +#undef HAVE_TEGRA + /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Use valgrind intrinsics to suppress false warnings */ #undef HAVE_VALGRIND +/* Compiler has -fvisibility support */ +#undef HAVE_VISIBILITY + /* Have vmwgfx kernel headers */ #undef HAVE_VMWGFX diff -Nru libdrm-2.4.56/configure libdrm-2.4.60/configure --- libdrm-2.4.56/configure 2014-07-29 16:13:52.000000000 +0000 +++ libdrm-2.4.60/configure 2015-03-19 14:37:45.000000000 +0000 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for libdrm 2.4.56. +# Generated by GNU Autoconf 2.69 for libdrm 2.4.60. # # Report bugs to . # @@ -591,8 +591,8 @@ # Identity of this package. PACKAGE_NAME='libdrm' PACKAGE_TARNAME='libdrm' -PACKAGE_VERSION='2.4.56' -PACKAGE_STRING='libdrm 2.4.56' +PACKAGE_VERSION='2.4.60' +PACKAGE_STRING='libdrm 2.4.60' PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=DRI' PACKAGE_URL='' @@ -638,15 +638,10 @@ LTLIBOBJS LIBOBJS WARN_CFLAGS +VISIBILITY_CFLAGS kernel_source -HAVE_RADEON_FALSE -HAVE_RADEON_TRUE -HAVE_INTEL_FALSE -HAVE_INTEL_TRUE VALGRIND_LIBS VALGRIND_CFLAGS -PCIACCESS_LIBS -PCIACCESS_CFLAGS HAVE_MANPAGES_STYLESHEET_FALSE HAVE_MANPAGES_STYLESHEET_TRUE MANPAGES_STYLESHEET @@ -663,6 +658,12 @@ CAIRO_CFLAGS HAVE_INSTALL_TESTS_FALSE HAVE_INSTALL_TESTS_TRUE +HAVE_TEGRA_FALSE +HAVE_TEGRA_TRUE +HAVE_RADEON_FALSE +HAVE_RADEON_TRUE +HAVE_FREEDRENO_KGSL_FALSE +HAVE_FREEDRENO_KGSL_TRUE HAVE_FREEDRENO_FALSE HAVE_FREEDRENO_TRUE HAVE_EXYNOS_FALSE @@ -673,8 +674,12 @@ HAVE_NOUVEAU_TRUE HAVE_VMWGFX_FALSE HAVE_VMWGFX_TRUE +HAVE_INTEL_FALSE +HAVE_INTEL_TRUE HAVE_LIBKMS_FALSE HAVE_LIBKMS_TRUE +PCIACCESS_LIBS +PCIACCESS_CFLAGS CLOCK_LIB pkgconfigdir PTHREADSTUBS_LIBS @@ -730,9 +735,6 @@ LDFLAGS CFLAGS CC -MAINT -MAINTAINER_MODE_FALSE -MAINTAINER_MODE_TRUE AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V @@ -802,7 +804,6 @@ ac_user_opts=' enable_option_checking enable_silent_rules -enable_maintainer_mode enable_dependency_tracking enable_largefile enable_static @@ -820,7 +821,9 @@ enable_vmwgfx enable_omap_experimental_api enable_exynos_experimental_api -enable_freedreno_experimental_api +enable_freedreno +enable_freedreno_kgsl +enable_tegra_experimental_api enable_install_test_programs enable_cairo_tests enable_manpages @@ -840,12 +843,12 @@ PKG_CONFIG_LIBDIR PTHREADSTUBS_CFLAGS PTHREADSTUBS_LIBS +PCIACCESS_CFLAGS +PCIACCESS_LIBS CAIRO_CFLAGS CAIRO_LIBS LIBUDEV_CFLAGS LIBUDEV_LIBS -PCIACCESS_CFLAGS -PCIACCESS_LIBS VALGRIND_CFLAGS VALGRIND_LIBS' @@ -1388,7 +1391,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 libdrm 2.4.56 to adapt to many kinds of systems. +\`configure' configures libdrm 2.4.60 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1458,7 +1461,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of libdrm 2.4.56:";; + short | recursive ) echo "Configuration of libdrm 2.4.60:";; esac cat <<\_ACEOF @@ -1468,9 +1471,6 @@ --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-silent-rules less verbose build output (undo: "make V=1") --disable-silent-rules verbose build output (undo: "make V=0") - --disable-maintainer-mode - disable make rules and dependencies not useful (and - sometimes confusing) to the casual installer --enable-dependency-tracking do not reject slow dependency extractors --disable-dependency-tracking @@ -1483,8 +1483,10 @@ --disable-libtool-lock avoid locking (might break parallel builds) --enable-udev Enable support for using udev instead of mknod (default: disabled) - --disable-libkms Disable KMS mm abstraction library (default: auto) - --disable-intel Enable support for intel's KMS API (default: auto) + --disable-libkms Disable KMS mm abstraction library (default: auto, + enabled on supported platforms) + --disable-intel Enable support for intel's KMS API (default: auto, + enabled on x86) --disable-radeon Enable support for radeon's KMS API (default: auto) --disable-nouveau Enable support for nouveau's KMS API (default: auto) --disable-vmwgfx Enable support for vmwgfx's KMS API (default: yes) @@ -1494,8 +1496,12 @@ --enable-exynos-experimental-api Enable support for EXYNOS's experimental API (default: disabled) - --enable-freedreno-experimental-api - Enable support for freedreno's experimental API + --disable-freedreno Enable support for freedreno's KMS API (default: + auto, enabled on arm) + --enable-freedreno-kgsl Enable support for freedreno's to use downstream + android kernel API (default: disabled) + --enable-tegra-experimental-api + Enable support for Tegra's experimental API (default: disabled) --enable-install-test-programs Install test programs (default: no) @@ -1531,6 +1537,10 @@ C compiler flags for PTHREADSTUBS, overriding pkg-config PTHREADSTUBS_LIBS linker flags for PTHREADSTUBS, overriding pkg-config + PCIACCESS_CFLAGS + C compiler flags for PCIACCESS, overriding pkg-config + PCIACCESS_LIBS + linker flags for PCIACCESS, overriding pkg-config CAIRO_CFLAGS C compiler flags for CAIRO, overriding pkg-config CAIRO_LIBS linker flags for CAIRO, overriding pkg-config @@ -1538,10 +1548,6 @@ C compiler flags for LIBUDEV, overriding pkg-config LIBUDEV_LIBS linker flags for LIBUDEV, overriding pkg-config - PCIACCESS_CFLAGS - C compiler flags for PCIACCESS, overriding pkg-config - PCIACCESS_LIBS - linker flags for PCIACCESS, overriding pkg-config VALGRIND_CFLAGS C compiler flags for VALGRIND, overriding pkg-config VALGRIND_LIBS @@ -1613,7 +1619,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -libdrm configure 2.4.56 +libdrm configure 2.4.60 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2036,7 +2042,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by libdrm $as_me 2.4.56, which was +It was created by libdrm $as_me 2.4.60, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2419,7 +2425,7 @@ -am__api_version='1.14' +am__api_version='1.13' # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or @@ -2905,7 +2911,7 @@ # Define the identity of the package. PACKAGE='libdrm' - VERSION='2.4.56' + VERSION='2.4.60' cat >>confdefs.h <<_ACEOF @@ -2956,70 +2962,6 @@ -# POSIX will say in a future version that running "rm -f" with no argument -# is OK; and we want to be able to make that assumption in our Makefile -# recipes. So use an aggressive probe to check that the usage we want is -# actually supported "in the wild" to an acceptable degree. -# See automake bug#10828. -# To make any issue more visible, cause the running configure to be aborted -# by default if the 'rm' program in use doesn't match our expectations; the -# user can still override this though. -if rm -f && rm -fr && rm -rf; then : OK; else - cat >&2 <<'END' -Oops! - -Your 'rm' program seems unable to run without file operands specified -on the command line, even when the '-f' option is present. This is contrary -to the behaviour of most rm programs out there, and not conforming with -the upcoming POSIX standard: - -Please tell bug-automake@gnu.org about your system, including the value -of your $PATH and any error possibly output before this message. This -can help us improve future automake versions. - -END - if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then - echo 'Configuration will proceed anyway, since you have set the' >&2 - echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 - echo >&2 - else - cat >&2 <<'END' -Aborting the configuration process, to ensure you take notice of the issue. - -You can download and install GNU coreutils to get an 'rm' implementation -that behaves properly: . - -If you want to complete the configuration process using your problematic -'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM -to "yes", and re-run configure. - -END - as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 - fi -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 -$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } - # Check whether --enable-maintainer-mode was given. -if test "${enable_maintainer_mode+set}" = set; then : - enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval -else - USE_MAINTAINER_MODE=yes -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 -$as_echo "$USE_MAINTAINER_MODE" >&6; } - if test $USE_MAINTAINER_MODE = yes; then - MAINTAINER_MODE_TRUE= - MAINTAINER_MODE_FALSE='#' -else - MAINTAINER_MODE_TRUE='#' - MAINTAINER_MODE_FALSE= -fi - - MAINT=$MAINTAINER_MODE_TRUE - - # Enable quiet compiles on automake 1.11. # Check whether --enable-silent-rules was given. @@ -3851,65 +3793,6 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 -$as_echo_n "checking whether $CC understands -c and -o together... " >&6; } -if ${am_cv_prog_cc_c_o+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF - # Make sure it works both with $CC and with simple cc. - # Following AC_PROG_CC_C_O, we do the test twice because some - # compilers refuse to overwrite an existing .o file with -o, - # though they will create one. - am_cv_prog_cc_c_o=yes - for am_i in 1 2; do - if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 - ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } \ - && test -f conftest2.$ac_objext; then - : OK - else - am_cv_prog_cc_c_o=no - break - fi - done - rm -f core conftest* - unset am_i -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 -$as_echo "$am_cv_prog_cc_c_o" >&6; } -if test "$am_cv_prog_cc_c_o" != yes; then - # Losing compiler, so override with the script. - # FIXME: It is wrong to rewrite CC. - # But if we don't then we get into trouble of one sort or another. - # A longer-term fix would be to have automake use am__CC in this case, - # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" - CC="$am_aux_dir/compile $CC" -fi -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" @@ -4587,7 +4470,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 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; @@ -4633,7 +4516,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 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; @@ -4657,7 +4540,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 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; @@ -4702,7 +4585,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 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; @@ -4726,7 +4609,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 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; @@ -4960,6 +4843,19 @@ fi +for ac_header in sys/mkdev.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "sys/mkdev.h" "ac_cv_header_sys_mkdev_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_mkdev_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SYS_MKDEV_H 1 +_ACEOF + +fi + +done + + # Initialize libtool case `pwd` in @@ -5717,8 +5613,7 @@ ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` - if test -n "$lt_cv_sys_max_cmd_len" && \ - test undefined != "$lt_cv_sys_max_cmd_len"; then + if test -n "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else @@ -6119,6 +6014,10 @@ fi ;; +gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + haiku*) lt_cv_deplibs_check_method=pass_all ;; @@ -6157,11 +6056,11 @@ ;; # This must be glibc/ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) +linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; -netbsd* | netbsdelf*-gnu) +netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else @@ -7254,19 +7153,12 @@ LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) - case `/usr/bin/file conftest.o` in - *x86-64*) - LD="${LD-ld} -m elf32_x86_64" - ;; - *) - LD="${LD-ld} -m elf_i386" - ;; - esac + LD="${LD-ld} -m elf_i386" ;; - powerpc64le-*) + powerpc64le-*linux*) LD="${LD-ld} -m elf32lppclinux" ;; - powerpc64-*) + powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) @@ -7285,10 +7177,10 @@ x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; - powerpcle-*) + powerpcle-*linux*) LD="${LD-ld} -m elf64lppc" ;; - powerpc-*) + powerpc-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) @@ -8828,7 +8720,7 @@ lt_prog_compiler_static='-non_shared' ;; - linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) @@ -9306,9 +9198,6 @@ openbsd*) with_gnu_ld=no ;; - linux* | k*bsd*-gnu | gnu*) - link_all_deplibs=no - ;; esac ld_shlibs=yes @@ -9530,7 +9419,7 @@ fi ;; - netbsd* | netbsdelf*-gnu) + netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= @@ -9707,7 +9596,6 @@ if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi - link_all_deplibs=no else # not using gcc if test "$host_cpu" = ia64; then @@ -10161,7 +10049,7 @@ link_all_deplibs=yes ;; - netbsd* | netbsdelf*-gnu) + netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else @@ -10998,6 +10886,17 @@ 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 @@ -11114,7 +11013,7 @@ ;; # This must be glibc/ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) +linux* | k*bsd*-gnu | kopensolaris*-gnu) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no @@ -11163,10 +11062,14 @@ # before this can be enabled. hardcode_into_libs=yes + # Add ABI-specific directories to the system library path. + sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" + # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` - sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" + fi # We used to test for /lib/ld.so.1 and disable shared libraries on @@ -11178,18 +11081,6 @@ 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 @@ -12442,11 +12333,27 @@ fi -# Check whether --enable-freedreno-experimental-api was given. -if test "${enable_freedreno_experimental_api+set}" = set; then : - enableval=$enable_freedreno_experimental_api; FREEDRENO=$enableval +# Check whether --enable-freedreno was given. +if test "${enable_freedreno+set}" = set; then : + enableval=$enable_freedreno; FREEDRENO=$enableval +else + FREEDRENO=auto +fi + + +# Check whether --enable-freedreno-kgsl was given. +if test "${enable_freedreno_kgsl+set}" = set; then : + enableval=$enable_freedreno_kgsl; FREEDRENO_KGSL=$enableval else - FREEDRENO=no + FREEDRENO_KGSL=no +fi + + +# Check whether --enable-tegra-experimental-api was given. +if test "${enable_tegra_experimental_api+set}" = set; then : + enableval=$enable_tegra_experimental_api; TEGRA=$enableval +else + TEGRA=no fi @@ -12605,138 +12512,167 @@ $as_echo "$libdrm_cv_warn_cflags" >&6; } WARN_CFLAGS="$libdrm_cv_warn_cflags" -if test "x$UDEV" = xyes; then +# Check for atomic intrinsics +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for native atomic primitives" >&5 +$as_echo_n "checking for native atomic primitives... " >&6; } +if ${drm_cv_atomic_primitives+:} false; then : + $as_echo_n "(cached) " >&6 +else -$as_echo "#define UDEV 1" >>confdefs.h + drm_cv_atomic_primitives="none" -fi + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + int atomic_add(int i) { return __sync_fetch_and_add (&i, 1); } + int atomic_cmpxchg(int i, int j, int k) { return __sync_val_compare_and_swap (&i, j, k); } -if test "x$LIBKMS" = xauto ; then - case $host_os in - linux*) LIBKMS="yes" ;; - freebsd* | kfreebsd*-gnu) - LIBKMS="yes" ;; - dragonfly*) LIBKMS="yes" ;; - *) LIBKMS="no" ;; - esac -fi +int +main () +{ - if test "x$LIBKMS" = xyes; then - HAVE_LIBKMS_TRUE= - HAVE_LIBKMS_FALSE='#' -else - HAVE_LIBKMS_TRUE='#' - HAVE_LIBKMS_FALSE= + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + drm_cv_atomic_primitives="Intel" fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext - - if test "x$VMWGFX" = xyes; then - HAVE_VMWGFX_TRUE= - HAVE_VMWGFX_FALSE='#' -else - HAVE_VMWGFX_TRUE='#' - HAVE_VMWGFX_FALSE= + if test "x$drm_cv_atomic_primitives" = "xnone"; then + ac_fn_c_check_header_mongrel "$LINENO" "atomic_ops.h" "ac_cv_header_atomic_ops_h" "$ac_includes_default" +if test "x$ac_cv_header_atomic_ops_h" = xyes; then : + drm_cv_atomic_primitives="libatomic-ops" fi -if test "x$VMWGFX" = xyes; then -$as_echo "#define HAVE_VMWGFX 1" >>confdefs.h + fi + # atomic functions defined in & libc on Solaris + if test "x$drm_cv_atomic_primitives" = "xnone"; then + ac_fn_c_check_func "$LINENO" "atomic_cas_uint" "ac_cv_func_atomic_cas_uint" +if test "x$ac_cv_func_atomic_cas_uint" = xyes; then : + drm_cv_atomic_primitives="Solaris" fi - if test "x$NOUVEAU" = xyes; then - HAVE_NOUVEAU_TRUE= - HAVE_NOUVEAU_FALSE='#' -else - HAVE_NOUVEAU_TRUE='#' - HAVE_NOUVEAU_FALSE= + fi + fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $drm_cv_atomic_primitives" >&5 +$as_echo "$drm_cv_atomic_primitives" >&6; } -if test "x$NOUVEAU" = xyes; then +if test "x$drm_cv_atomic_primitives" = xIntel; then -$as_echo "#define HAVE_NOUVEAU 1" >>confdefs.h +$as_echo "#define HAVE_LIBDRM_ATOMIC_PRIMITIVES 1" >>confdefs.h fi +if test "x$drm_cv_atomic_primitives" = "xlibatomic-ops"; then + +$as_echo "#define HAVE_LIB_ATOMIC_OPS 1" >>confdefs.h - if test "x$OMAP" = xyes; then - HAVE_OMAP_TRUE= - HAVE_OMAP_FALSE='#' -else - HAVE_OMAP_TRUE='#' - HAVE_OMAP_FALSE= fi -if test "x$OMAP" = xyes; then -$as_echo "#define HAVE_OMAP 1" >>confdefs.h -fi +if test "x$drm_cv_atomic_primitives" = "xnone"; then - if test "x$EXYNOS" = xyes; then - HAVE_EXYNOS_TRUE= - HAVE_EXYNOS_FALSE='#' -else - HAVE_EXYNOS_TRUE='#' - HAVE_EXYNOS_FALSE= -fi + case "x$INTEL" in + xyes) as_fn_error $? "libdrm_intel depends upon atomic operations, which were not found for your compiler/cpu. Try compiling with -march=native, or install the libatomics-op-dev package, or, failing both of those, disable support for Intel GPUs by passing --disable-intel to ./configure" "$LINENO" 5 ;; + xauto) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Disabling intel. It depends on atomic operations, which were not found for your compiler/cpu. Try compiling with -march=native, or install the libatomics-op-dev package." >&5 +$as_echo "$as_me: WARNING: Disabling intel. It depends on atomic operations, which were not found for your compiler/cpu. Try compiling with -march=native, or install the libatomics-op-dev package." >&2;} ;; + *) ;; + esac -if test "x$EXYNOS" = xyes; then + INTEL=no -$as_echo "#define HAVE_EXYNOS 1" >>confdefs.h -fi + case "x$RADEON" in + xyes) as_fn_error $? "libdrm_radeon depends upon atomic operations, which were not found for your compiler/cpu. Try compiling with -march=native, or install the libatomics-op-dev package, or, failing both of those, disable support for Radeon GPUs by passing --disable-radeon to ./configure" "$LINENO" 5 ;; + xauto) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Disabling radeon. It depends on atomic operations, which were not found for your compiler/cpu. Try compiling with -march=native, or install the libatomics-op-dev package." >&5 +$as_echo "$as_me: WARNING: Disabling radeon. It depends on atomic operations, which were not found for your compiler/cpu. Try compiling with -march=native, or install the libatomics-op-dev package." >&2;} ;; + *) ;; + esac - if test "x$FREEDRENO" = xyes; then - HAVE_FREEDRENO_TRUE= - HAVE_FREEDRENO_FALSE='#' -else - HAVE_FREEDRENO_TRUE='#' - HAVE_FREEDRENO_FALSE= -fi + RADEON=no -if test "x$FREEDRENO" = xyes; then -$as_echo "#define HAVE_FREEDRENO 1" >>confdefs.h + case "x$NOUVEAU" in + xyes) as_fn_error $? "libdrm_nouveau depends upon atomic operations, which were not found for your compiler/cpu. Try compiling with -march=native, or install the libatomics-op-dev package, or, failing both of those, disable support for NVIDIA GPUs by passing --disable-nouveau to ./configure" "$LINENO" 5 ;; + xauto) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Disabling nouveau. It depends on atomic operations, which were not found for your compiler/cpu. Try compiling with -march=native, or install the libatomics-op-dev package." >&5 +$as_echo "$as_me: WARNING: Disabling nouveau. It depends on atomic operations, which were not found for your compiler/cpu. Try compiling with -march=native, or install the libatomics-op-dev package." >&2;} ;; + *) ;; + esac -fi + NOUVEAU=no - if test "x$INSTALL_TESTS" = xyes; then - HAVE_INSTALL_TESTS_TRUE= - HAVE_INSTALL_TESTS_FALSE='#' -else - HAVE_INSTALL_TESTS_TRUE='#' - HAVE_INSTALL_TESTS_FALSE= -fi -if test "x$INSTALL_TESTS" = xyes; then + case "x$OMAP" in + xyes) as_fn_error $? "libdrm_omap depends upon atomic operations, which were not found for your compiler/cpu. Try compiling with -march=native, or install the libatomics-op-dev package, or, failing both of those, disable support for OMAP GPUs by passing --disable-omap-experimental-api to ./configure" "$LINENO" 5 ;; + xauto) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Disabling omap. It depends on atomic operations, which were not found for your compiler/cpu. Try compiling with -march=native, or install the libatomics-op-dev package." >&5 +$as_echo "$as_me: WARNING: Disabling omap. It depends on atomic operations, which were not found for your compiler/cpu. Try compiling with -march=native, or install the libatomics-op-dev package." >&2;} ;; + *) ;; + esac -$as_echo "#define HAVE_INSTALL_TESTS 1" >>confdefs.h + OMAP=no -fi -# Check whether --enable-cairo-tests was given. -if test "${enable_cairo_tests+set}" = set; then : - enableval=$enable_cairo_tests; CAIRO=$enableval + case "x$FREEDRENO" in + xyes) as_fn_error $? "libdrm_freedreno depends upon atomic operations, which were not found for your compiler/cpu. Try compiling with -march=native, or install the libatomics-op-dev package, or, failing both of those, disable support for Qualcomm Adreno GPUs by passing --disable-freedreno to ./configure" "$LINENO" 5 ;; + xauto) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Disabling freedreno. It depends on atomic operations, which were not found for your compiler/cpu. Try compiling with -march=native, or install the libatomics-op-dev package." >&5 +$as_echo "$as_me: WARNING: Disabling freedreno. It depends on atomic operations, which were not found for your compiler/cpu. Try compiling with -march=native, or install the libatomics-op-dev package." >&2;} ;; + *) ;; + esac + + FREEDRENO=no + + + case "x$TEGRA" in + xyes) as_fn_error $? "libdrm_tegra depends upon atomic operations, which were not found for your compiler/cpu. Try compiling with -march=native, or install the libatomics-op-dev package, or, failing both of those, disable support for NVIDIA Tegra GPUs by passing --disable-tegra-experimental-api to ./configure" "$LINENO" 5 ;; + xauto) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Disabling tegra. It depends on atomic operations, which were not found for your compiler/cpu. Try compiling with -march=native, or install the libatomics-op-dev package." >&5 +$as_echo "$as_me: WARNING: Disabling tegra. It depends on atomic operations, which were not found for your compiler/cpu. Try compiling with -march=native, or install the libatomics-op-dev package." >&2;} ;; + *) ;; + esac + + TEGRA=no else - CAIRO=auto + if test "x$INTEL" = xauto; then + case $host_cpu in + i?86|x86_64) INTEL=yes ;; + *) INTEL=no ;; + esac + fi + if test "x$RADEON" = xauto; then + RADEON=yes + fi + if test "x$NOUVEAU" = xauto; then + NOUVEAU=yes + fi + if test "x$FREEDRENO" = xauto; then + case $host_cpu in + arm*|aarch64) FREEDRENO=yes ;; + *) FREEDRENO=no ;; + esac + fi fi +if test "x$INTEL" != "xno"; then pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for CAIRO" >&5 -$as_echo_n "checking for CAIRO... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for PCIACCESS" >&5 +$as_echo_n "checking for PCIACCESS... " >&6; } -if test -n "$CAIRO_CFLAGS"; then - pkg_cv_CAIRO_CFLAGS="$CAIRO_CFLAGS" +if test -n "$PCIACCESS_CFLAGS"; then + pkg_cv_PCIACCESS_CFLAGS="$PCIACCESS_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"cairo\""; } >&5 - ($PKG_CONFIG --exists --print-errors "cairo") 2>&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"pciaccess >= 0.10\""; } >&5 + ($PKG_CONFIG --exists --print-errors "pciaccess >= 0.10") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_CAIRO_CFLAGS=`$PKG_CONFIG --cflags "cairo" 2>/dev/null` + pkg_cv_PCIACCESS_CFLAGS=`$PKG_CONFIG --cflags "pciaccess >= 0.10" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -12744,11 +12680,284 @@ else pkg_failed=untried fi -if test -n "$CAIRO_LIBS"; then - pkg_cv_CAIRO_LIBS="$CAIRO_LIBS" +if test -n "$PCIACCESS_LIBS"; then + pkg_cv_PCIACCESS_LIBS="$PCIACCESS_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"cairo\""; } >&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"pciaccess >= 0.10\""; } >&5 + ($PKG_CONFIG --exists --print-errors "pciaccess >= 0.10") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_PCIACCESS_LIBS=`$PKG_CONFIG --libs "pciaccess >= 0.10" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + PCIACCESS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "pciaccess >= 0.10" 2>&1` + else + PCIACCESS_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "pciaccess >= 0.10" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$PCIACCESS_PKG_ERRORS" >&5 + + as_fn_error $? "Package requirements (pciaccess >= 0.10) were not met: + +$PCIACCESS_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively, you may set the environment variables PCIACCESS_CFLAGS +and PCIACCESS_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details." "$LINENO" 5 +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +Alternatively, you may set the environment variables PCIACCESS_CFLAGS +and PCIACCESS_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. + +To get pkg-config, see . +See \`config.log' for more details" "$LINENO" 5; } +else + PCIACCESS_CFLAGS=$pkg_cv_PCIACCESS_CFLAGS + PCIACCESS_LIBS=$pkg_cv_PCIACCESS_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +fi +fi + + + +if test "x$UDEV" = xyes; then + +$as_echo "#define UDEV 1" >>confdefs.h + +fi + + +if test "x$LIBKMS" = xauto ; then + case $host_os in + linux*) LIBKMS="yes" ;; + freebsd* | kfreebsd*-gnu) + LIBKMS="yes" ;; + dragonfly*) LIBKMS="yes" ;; + *) LIBKMS="no" ;; + esac +fi + + if test "x$LIBKMS" = xyes; then + HAVE_LIBKMS_TRUE= + HAVE_LIBKMS_FALSE='#' +else + HAVE_LIBKMS_TRUE='#' + HAVE_LIBKMS_FALSE= +fi + + + if test "x$INTEL" = xyes; then + HAVE_INTEL_TRUE= + HAVE_INTEL_FALSE='#' +else + HAVE_INTEL_TRUE='#' + HAVE_INTEL_FALSE= +fi + +if test "x$INTEL" = xyes; then + +$as_echo "#define HAVE_INTEL 1" >>confdefs.h + +fi + + if test "x$VMWGFX" = xyes; then + HAVE_VMWGFX_TRUE= + HAVE_VMWGFX_FALSE='#' +else + HAVE_VMWGFX_TRUE='#' + HAVE_VMWGFX_FALSE= +fi + +if test "x$VMWGFX" = xyes; then + +$as_echo "#define HAVE_VMWGFX 1" >>confdefs.h + +fi + + if test "x$NOUVEAU" = xyes; then + HAVE_NOUVEAU_TRUE= + HAVE_NOUVEAU_FALSE='#' +else + HAVE_NOUVEAU_TRUE='#' + HAVE_NOUVEAU_FALSE= +fi + +if test "x$NOUVEAU" = xyes; then + +$as_echo "#define HAVE_NOUVEAU 1" >>confdefs.h + +fi + + if test "x$OMAP" = xyes; then + HAVE_OMAP_TRUE= + HAVE_OMAP_FALSE='#' +else + HAVE_OMAP_TRUE='#' + HAVE_OMAP_FALSE= +fi + +if test "x$OMAP" = xyes; then + +$as_echo "#define HAVE_OMAP 1" >>confdefs.h + +fi + + if test "x$EXYNOS" = xyes; then + HAVE_EXYNOS_TRUE= + HAVE_EXYNOS_FALSE='#' +else + HAVE_EXYNOS_TRUE='#' + HAVE_EXYNOS_FALSE= +fi + +if test "x$EXYNOS" = xyes; then + +$as_echo "#define HAVE_EXYNOS 1" >>confdefs.h + +fi + + if test "x$FREEDRENO" = xyes; then + HAVE_FREEDRENO_TRUE= + HAVE_FREEDRENO_FALSE='#' +else + HAVE_FREEDRENO_TRUE='#' + HAVE_FREEDRENO_FALSE= +fi + +if test "x$FREEDRENO" = xyes; then + +$as_echo "#define HAVE_FREEDRENO 1" >>confdefs.h + +fi + +if test "x$FREEDRENO_KGSL" = xyes; then + if test "x$FREEDRENO" != xyes; then + as_fn_error $? "Cannot enable freedreno KGSL interface if freedreno is disabled" "$LINENO" 5 + fi +fi + if test "x$FREEDRENO_KGSL" = xyes; then + HAVE_FREEDRENO_KGSL_TRUE= + HAVE_FREEDRENO_KGSL_FALSE='#' +else + HAVE_FREEDRENO_KGSL_TRUE='#' + HAVE_FREEDRENO_KGSL_FALSE= +fi + +if test "x$FREEDRENO_KGSL" = xyes; then + +$as_echo "#define HAVE_FREEDRENO_KGSL 1" >>confdefs.h + +fi + + if test "x$RADEON" = xyes; then + HAVE_RADEON_TRUE= + HAVE_RADEON_FALSE='#' +else + HAVE_RADEON_TRUE='#' + HAVE_RADEON_FALSE= +fi + +if test "x$RADEON" = xyes; then + +$as_echo "#define HAVE_RADEON 1" >>confdefs.h + +fi + + if test "x$TEGRA" = xyes; then + HAVE_TEGRA_TRUE= + HAVE_TEGRA_FALSE='#' +else + HAVE_TEGRA_TRUE='#' + HAVE_TEGRA_FALSE= +fi + +if test "x$TEGRA" = xyes; then + +$as_echo "#define HAVE_TEGRA 1" >>confdefs.h + +fi + + if test "x$INSTALL_TESTS" = xyes; then + HAVE_INSTALL_TESTS_TRUE= + HAVE_INSTALL_TESTS_FALSE='#' +else + HAVE_INSTALL_TESTS_TRUE='#' + HAVE_INSTALL_TESTS_FALSE= +fi + +if test "x$INSTALL_TESTS" = xyes; then + +$as_echo "#define HAVE_INSTALL_TESTS 1" >>confdefs.h + +fi + +# Check whether --enable-cairo-tests was given. +if test "${enable_cairo_tests+set}" = set; then : + enableval=$enable_cairo_tests; CAIRO=$enableval +else + CAIRO=auto +fi + + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for CAIRO" >&5 +$as_echo_n "checking for CAIRO... " >&6; } + +if test -n "$CAIRO_CFLAGS"; then + pkg_cv_CAIRO_CFLAGS="$CAIRO_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"cairo\""; } >&5 + ($PKG_CONFIG --exists --print-errors "cairo") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_CAIRO_CFLAGS=`$PKG_CONFIG --cflags "cairo" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$CAIRO_LIBS"; then + pkg_cv_CAIRO_LIBS="$CAIRO_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"cairo\""; } >&5 ($PKG_CONFIG --exists --print-errors "cairo") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 @@ -13008,209 +13217,6 @@ fi -if test "x$INTEL" != "xno" -o "x$RADEON" != "xno" -o "x$NOUVEAU" != "xno" -o "x$OMAP" != "xno" -o "x$FREEDRENO" != "xno"; then - # Check for atomic intrinsics - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for native atomic primitives" >&5 -$as_echo_n "checking for native atomic primitives... " >&6; } -if ${drm_cv_atomic_primitives+:} false; then : - $as_echo_n "(cached) " >&6 -else - - drm_cv_atomic_primitives="none" - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - int atomic_add(int i) { return __sync_fetch_and_add (&i, 1); } - int atomic_cmpxchg(int i, int j, int k) { return __sync_val_compare_and_swap (&i, j, k); } - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - drm_cv_atomic_primitives="Intel" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - - if test "x$drm_cv_atomic_primitives" = "xnone"; then - ac_fn_c_check_header_mongrel "$LINENO" "atomic_ops.h" "ac_cv_header_atomic_ops_h" "$ac_includes_default" -if test "x$ac_cv_header_atomic_ops_h" = xyes; then : - drm_cv_atomic_primitives="libatomic-ops" -fi - - - fi - - # atomic functions defined in & libc on Solaris - if test "x$drm_cv_atomic_primitives" = "xnone"; then - ac_fn_c_check_func "$LINENO" "atomic_cas_uint" "ac_cv_func_atomic_cas_uint" -if test "x$ac_cv_func_atomic_cas_uint" = xyes; then : - drm_cv_atomic_primitives="Solaris" -fi - - fi - - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $drm_cv_atomic_primitives" >&5 -$as_echo "$drm_cv_atomic_primitives" >&6; } - if test "x$drm_cv_atomic_primitives" = xIntel; then - -$as_echo "#define HAVE_LIBDRM_ATOMIC_PRIMITIVES 1" >>confdefs.h - - fi - if test "x$drm_cv_atomic_primitives" = "xlibatomic-ops"; then - -$as_echo "#define HAVE_LIB_ATOMIC_OPS 1" >>confdefs.h - - fi - - if test "x$drm_cv_atomic_primitives" = "xnone"; then - if test "x$INTEL" != "xauto"; then - if test "x$INTEL" != "xno"; then - as_fn_error $? "libdrm_intel depends upon atomic operations, which were not found for your compiler/cpu. Try compiling with -march=native, or install the libatomics-op-dev package, or, failing both of those, disable support for Intel GPUs by passing --disable-intel to ./configure" "$LINENO" 5 - fi - else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Disabling libdrm_intel. It depends on atomic operations, which were not found for your compiler/cpu. Try compiling with -march=native, or install the libatomics-op-dev package." >&5 -$as_echo "$as_me: WARNING: Disabling libdrm_intel. It depends on atomic operations, which were not found for your compiler/cpu. Try compiling with -march=native, or install the libatomics-op-dev package." >&2;} - INTEL=no - fi - if test "x$RADEON" != "xauto"; then - if test "x$RADEON" != "xno"; then - as_fn_error $? "libdrm_radeon depends upon atomic operations, which were not found for your compiler/cpu. Try compiling with -march=native, or install the libatomics-op-dev package, or, failing both of those, disable support for Radeon support by passing --disable-radeon to ./configure" "$LINENO" 5 - fi - else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Disabling libdrm_radeon. It depends on atomic operations, which were not found for your compiler/cpu. Try compiling with -march=native, or install the libatomics-op-dev package." >&5 -$as_echo "$as_me: WARNING: Disabling libdrm_radeon. It depends on atomic operations, which were not found for your compiler/cpu. Try compiling with -march=native, or install the libatomics-op-dev package." >&2;} - RADEON=no - fi - if test "x$NOUVEAU" != "xauto"; then - if test "x$NOUVEAU" != "xno"; then - as_fn_error $? "libdrm_nouveau depends upon atomic operations, which were not found for your compiler/cpu. Try compiling with -march=native, or install the libatomics-op-dev package, or, failing both of those, disable support for NVIDIA GPUs by passing --disable-nouveau to ./configure" "$LINENO" 5 - fi - else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Disabling libdrm_nouveau. It depends on atomic operations, which were not found for your compiler/cpu. Try compiling with -march=native, or install the libatomics-op-dev package." >&5 -$as_echo "$as_me: WARNING: Disabling libdrm_nouveau. It depends on atomic operations, which were not found for your compiler/cpu. Try compiling with -march=native, or install the libatomics-op-dev package." >&2;} - NOUVEAU=no - fi - else - if test "x$INTEL" != "xno"; then - case $host_cpu in - i?86|x86_64) INTEL=yes ;; - *) INTEL=no ;; - esac - fi - if test "x$RADEON" != "xno"; then - RADEON=yes - fi - if test "x$NOUVEAU" != "xno"; then - NOUVEAU=yes - fi - fi -fi - -if test "x$INTEL" != "xno"; then - -pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for PCIACCESS" >&5 -$as_echo_n "checking for PCIACCESS... " >&6; } - -if test -n "$PCIACCESS_CFLAGS"; then - pkg_cv_PCIACCESS_CFLAGS="$PCIACCESS_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"pciaccess >= 0.10\""; } >&5 - ($PKG_CONFIG --exists --print-errors "pciaccess >= 0.10") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_PCIACCESS_CFLAGS=`$PKG_CONFIG --cflags "pciaccess >= 0.10" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi -if test -n "$PCIACCESS_LIBS"; then - pkg_cv_PCIACCESS_LIBS="$PCIACCESS_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"pciaccess >= 0.10\""; } >&5 - ($PKG_CONFIG --exists --print-errors "pciaccess >= 0.10") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_PCIACCESS_LIBS=`$PKG_CONFIG --libs "pciaccess >= 0.10" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi - - - -if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes -else - _pkg_short_errors_supported=no -fi - if test $_pkg_short_errors_supported = yes; then - PCIACCESS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "pciaccess >= 0.10" 2>&1` - else - PCIACCESS_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "pciaccess >= 0.10" 2>&1` - fi - # Put the nasty error message in config.log where it belongs - echo "$PCIACCESS_PKG_ERRORS" >&5 - - as_fn_error $? "Package requirements (pciaccess >= 0.10) were not met: - -$PCIACCESS_PKG_ERRORS - -Consider adjusting the PKG_CONFIG_PATH environment variable if you -installed software in a non-standard prefix. - -Alternatively, you may set the environment variables PCIACCESS_CFLAGS -and PCIACCESS_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details." "$LINENO" 5 -elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it -is in your PATH or set the PKG_CONFIG environment variable to the full -path to pkg-config. - -Alternatively, you may set the environment variables PCIACCESS_CFLAGS -and PCIACCESS_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details. - -To get pkg-config, see . -See \`config.log' for more details" "$LINENO" 5; } -else - PCIACCESS_CFLAGS=$pkg_cv_PCIACCESS_CFLAGS - PCIACCESS_LIBS=$pkg_cv_PCIACCESS_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -fi -fi - - - pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for VALGRIND" >&5 @@ -13288,46 +13294,56 @@ fi - if test "x$INTEL" != "xno"; then - HAVE_INTEL_TRUE= - HAVE_INTEL_FALSE='#' -else - HAVE_INTEL_TRUE='#' - HAVE_INTEL_FALSE= -fi - if test "x$RADEON" != "xno"; then - HAVE_RADEON_TRUE= - HAVE_RADEON_FALSE='#' -else - HAVE_RADEON_TRUE='#' - HAVE_RADEON_FALSE= +# Check whether --with-kernel-source was given. +if test "${with_kernel_source+set}" = set; then : + withval=$with_kernel_source; kernel_source="$with_kernel_source" fi - if test "x$NOUVEAU" != "xno"; then - HAVE_NOUVEAU_TRUE= - HAVE_NOUVEAU_FALSE='#' -else - HAVE_NOUVEAU_TRUE='#' - HAVE_NOUVEAU_FALSE= -fi -if test "x$RADEON" = xyes; then -$as_echo "#define HAVE_RADEON 1" >>confdefs.h +if test "x$GCC" = xyes; then + # Enable -fvisibility=hidden if using a gcc that supports it + save_CFLAGS="$CFLAGS" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -fvisibility=hidden" >&5 +$as_echo_n "checking whether $CC supports -fvisibility=hidden... " >&6; } + VISIBILITY_CFLAGS="-fvisibility=hidden" + CFLAGS="$CFLAGS $VISIBILITY_CFLAGS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + VISIBILITY_CFLAGS=""; { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext; + # Restore CFLAGS; VISIBILITY_CFLAGS are added to it where needed. + CFLAGS=$save_CFLAGS -# Check whether --with-kernel-source was given. -if test "${with_kernel_source+set}" = set; then : - withval=$with_kernel_source; kernel_source="$with_kernel_source" -fi + if test "x$VISIBILITY_CFLAGS" != x; then +$as_echo "#define HAVE_VISIBILITY 1" >>confdefs.h + fi -ac_config_files="$ac_config_files Makefile libkms/Makefile libkms/libkms.pc intel/Makefile intel/libdrm_intel.pc radeon/Makefile radeon/libdrm_radeon.pc nouveau/Makefile nouveau/libdrm_nouveau.pc omap/Makefile omap/libdrm_omap.pc exynos/Makefile exynos/libdrm_exynos.pc freedreno/Makefile freedreno/libdrm_freedreno.pc tests/Makefile tests/modeprint/Makefile tests/modetest/Makefile tests/kmstest/Makefile tests/radeon/Makefile tests/vbltest/Makefile tests/exynos/Makefile include/Makefile include/drm/Makefile man/Makefile libdrm.pc" +fi + + +ac_config_files="$ac_config_files Makefile libkms/Makefile libkms/libkms.pc intel/Makefile intel/libdrm_intel.pc radeon/Makefile radeon/libdrm_radeon.pc nouveau/Makefile nouveau/libdrm_nouveau.pc omap/Makefile omap/libdrm_omap.pc exynos/Makefile exynos/libdrm_exynos.pc freedreno/Makefile freedreno/libdrm_freedreno.pc tegra/Makefile tegra/libdrm_tegra.pc tests/Makefile tests/modeprint/Makefile tests/modetest/Makefile tests/kmstest/Makefile tests/proptest/Makefile tests/radeon/Makefile tests/vbltest/Makefile tests/exynos/Makefile tests/tegra/Makefile tests/nouveau/Makefile man/Makefile libdrm.pc" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -13454,10 +13470,6 @@ am__EXEEXT_FALSE= fi -if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then - as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -13470,6 +13482,10 @@ as_fn_error $? "conditional \"HAVE_LIBKMS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${HAVE_INTEL_TRUE}" && test -z "${HAVE_INTEL_FALSE}"; then + as_fn_error $? "conditional \"HAVE_INTEL\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${HAVE_VMWGFX_TRUE}" && test -z "${HAVE_VMWGFX_FALSE}"; then as_fn_error $? "conditional \"HAVE_VMWGFX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -13490,6 +13506,18 @@ as_fn_error $? "conditional \"HAVE_FREEDRENO\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${HAVE_FREEDRENO_KGSL_TRUE}" && test -z "${HAVE_FREEDRENO_KGSL_FALSE}"; then + as_fn_error $? "conditional \"HAVE_FREEDRENO_KGSL\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_RADEON_TRUE}" && test -z "${HAVE_RADEON_FALSE}"; then + as_fn_error $? "conditional \"HAVE_RADEON\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_TEGRA_TRUE}" && test -z "${HAVE_TEGRA_FALSE}"; then + as_fn_error $? "conditional \"HAVE_TEGRA\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${HAVE_INSTALL_TESTS_TRUE}" && test -z "${HAVE_INSTALL_TESTS_FALSE}"; then as_fn_error $? "conditional \"HAVE_INSTALL_TESTS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -13510,18 +13538,6 @@ as_fn_error $? "conditional \"HAVE_MANPAGES_STYLESHEET\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${HAVE_INTEL_TRUE}" && test -z "${HAVE_INTEL_FALSE}"; then - as_fn_error $? "conditional \"HAVE_INTEL\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${HAVE_RADEON_TRUE}" && test -z "${HAVE_RADEON_FALSE}"; then - as_fn_error $? "conditional \"HAVE_RADEON\" 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 : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 @@ -13919,7 +13935,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by libdrm $as_me 2.4.56, which was +This file was extended by libdrm $as_me 2.4.60, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -13985,7 +14001,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -libdrm config.status 2.4.56 +libdrm config.status 2.4.60 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" @@ -14409,15 +14425,18 @@ "exynos/libdrm_exynos.pc") CONFIG_FILES="$CONFIG_FILES exynos/libdrm_exynos.pc" ;; "freedreno/Makefile") CONFIG_FILES="$CONFIG_FILES freedreno/Makefile" ;; "freedreno/libdrm_freedreno.pc") CONFIG_FILES="$CONFIG_FILES freedreno/libdrm_freedreno.pc" ;; + "tegra/Makefile") CONFIG_FILES="$CONFIG_FILES tegra/Makefile" ;; + "tegra/libdrm_tegra.pc") CONFIG_FILES="$CONFIG_FILES tegra/libdrm_tegra.pc" ;; "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;; "tests/modeprint/Makefile") CONFIG_FILES="$CONFIG_FILES tests/modeprint/Makefile" ;; "tests/modetest/Makefile") CONFIG_FILES="$CONFIG_FILES tests/modetest/Makefile" ;; "tests/kmstest/Makefile") CONFIG_FILES="$CONFIG_FILES tests/kmstest/Makefile" ;; + "tests/proptest/Makefile") CONFIG_FILES="$CONFIG_FILES tests/proptest/Makefile" ;; "tests/radeon/Makefile") CONFIG_FILES="$CONFIG_FILES tests/radeon/Makefile" ;; "tests/vbltest/Makefile") CONFIG_FILES="$CONFIG_FILES tests/vbltest/Makefile" ;; "tests/exynos/Makefile") CONFIG_FILES="$CONFIG_FILES tests/exynos/Makefile" ;; - "include/Makefile") CONFIG_FILES="$CONFIG_FILES include/Makefile" ;; - "include/drm/Makefile") CONFIG_FILES="$CONFIG_FILES include/drm/Makefile" ;; + "tests/tegra/Makefile") CONFIG_FILES="$CONFIG_FILES tests/tegra/Makefile" ;; + "tests/nouveau/Makefile") CONFIG_FILES="$CONFIG_FILES tests/nouveau/Makefile" ;; "man/Makefile") CONFIG_FILES="$CONFIG_FILES man/Makefile" ;; "libdrm.pc") CONFIG_FILES="$CONFIG_FILES libdrm.pc" ;; @@ -15787,5 +15806,6 @@ echo " Nouveau API $NOUVEAU" echo " OMAP API $OMAP" echo " EXYNOS API $EXYNOS" -echo " Freedreno API $FREEDRENO" +echo " Freedreno API $FREEDRENO (kgsl: $FREEDRENO_KGSL)" +echo " Tegra API $TEGRA" echo "" diff -Nru libdrm-2.4.56/configure.ac libdrm-2.4.60/configure.ac --- libdrm-2.4.56/configure.ac 2014-07-29 16:11:41.000000000 +0000 +++ libdrm-2.4.60/configure.ac 2015-03-19 14:36:53.000000000 +0000 @@ -20,7 +20,7 @@ AC_PREREQ([2.63]) AC_INIT([libdrm], - [2.4.56], + [2.4.60], [https://bugs.freedesktop.org/enter_bug.cgi?product=DRI], [libdrm]) @@ -30,7 +30,6 @@ AC_CONFIG_AUX_DIR([build-aux]) AM_INIT_AUTOMAKE([1.10 foreign dist-bzip2]) -AM_MAINTAINER_MODE([enable]) # Enable quiet compiles on automake 1.11. m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) @@ -42,6 +41,8 @@ AC_SYS_LARGEFILE AC_FUNC_ALLOCA +AC_CHECK_HEADERS([sys/mkdev.h]) + # Initialize libtool LT_PREREQ([2.2]) LT_INIT([disable-static]) @@ -60,12 +61,12 @@ AC_ARG_ENABLE(libkms, AS_HELP_STRING([--disable-libkms], - [Disable KMS mm abstraction library (default: auto)]), + [Disable KMS mm abstraction library (default: auto, enabled on supported platforms)]), [LIBKMS=$enableval], [LIBKMS=auto]) AC_ARG_ENABLE(intel, AS_HELP_STRING([--disable-intel], - [Enable support for intel's KMS API (default: auto)]), + [Enable support for intel's KMS API (default: auto, enabled on x86)]), [INTEL=$enableval], [INTEL=auto]) AC_ARG_ENABLE(radeon, @@ -93,10 +94,20 @@ [Enable support for EXYNOS's experimental API (default: disabled)]), [EXYNOS=$enableval], [EXYNOS=no]) -AC_ARG_ENABLE(freedreno-experimental-api, - AS_HELP_STRING([--enable-freedreno-experimental-api], - [Enable support for freedreno's experimental API (default: disabled)]), - [FREEDRENO=$enableval], [FREEDRENO=no]) +AC_ARG_ENABLE(freedreno, + AS_HELP_STRING([--disable-freedreno], + [Enable support for freedreno's KMS API (default: auto, enabled on arm)]), + [FREEDRENO=$enableval], [FREEDRENO=auto]) + +AC_ARG_ENABLE(freedreno-kgsl, + AS_HELP_STRING([--enable-freedreno-kgsl], + [Enable support for freedreno's to use downstream android kernel API (default: disabled)]), + [FREEDRENO_KGSL=$enableval], [FREEDRENO_KGSL=no]) + +AC_ARG_ENABLE(tegra-experimental-api, + AS_HELP_STRING([--enable-tegra-experimental-api], + [Enable support for Tegra's experimental API (default: disabled)]), + [TEGRA=$enableval], [TEGRA=no]) AC_ARG_ENABLE(install-test-programs, AS_HELP_STRING([--enable-install-test-programs], @@ -177,6 +188,92 @@ AC_MSG_CHECKING([which warning flags were supported])]) WARN_CFLAGS="$libdrm_cv_warn_cflags" +# Check for atomic intrinsics +AC_CACHE_CHECK([for native atomic primitives], drm_cv_atomic_primitives, [ + drm_cv_atomic_primitives="none" + + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ + int atomic_add(int i) { return __sync_fetch_and_add (&i, 1); } + int atomic_cmpxchg(int i, int j, int k) { return __sync_val_compare_and_swap (&i, j, k); } + ]],[[]])], [drm_cv_atomic_primitives="Intel"],[]) + + if test "x$drm_cv_atomic_primitives" = "xnone"; then + AC_CHECK_HEADER([atomic_ops.h], drm_cv_atomic_primitives="libatomic-ops") + fi + + # atomic functions defined in & libc on Solaris + if test "x$drm_cv_atomic_primitives" = "xnone"; then + AC_CHECK_FUNC([atomic_cas_uint], drm_cv_atomic_primitives="Solaris") + fi +]) + +if test "x$drm_cv_atomic_primitives" = xIntel; then + AC_DEFINE(HAVE_LIBDRM_ATOMIC_PRIMITIVES, 1, + [Enable if your compiler supports the Intel __sync_* atomic primitives]) +fi +if test "x$drm_cv_atomic_primitives" = "xlibatomic-ops"; then + AC_DEFINE(HAVE_LIB_ATOMIC_OPS, 1, [Enable if you have libatomic-ops-dev installed]) +fi + +dnl Print out the approapriate message considering the value set be the +dnl respective in $1. +dnl $1 - value to be evaluated. Eg. $INTEL, $NOUVEAU, ... +dnl $2 - libdrm shortname. Eg. intel, freedreno, ... +dnl $3 - GPU name/brand. Eg. Intel, NVIDIA Tegra, ... +dnl $4 - Configure switch. Eg. intel, omap-experimental-api, ... +AC_DEFUN([LIBDRM_ATOMICS_NOT_FOUND_MSG], [ + case "x$1" in + xyes) AC_MSG_ERROR([libdrm_$2 depends upon atomic operations, which were not found for your compiler/cpu. Try compiling with -march=native, or install the libatomics-op-dev package, or, failing both of those, disable support for $3 GPUs by passing --disable-$4 to ./configure]) ;; + xauto) AC_MSG_WARN([Disabling $2. It depends on atomic operations, which were not found for your compiler/cpu. Try compiling with -march=native, or install the libatomics-op-dev package.]) ;; + *) ;; + esac +]) + +if test "x$drm_cv_atomic_primitives" = "xnone"; then + LIBDRM_ATOMICS_NOT_FOUND_MSG($INTEL, intel, Intel, intel) + INTEL=no + + LIBDRM_ATOMICS_NOT_FOUND_MSG($RADEON, radeon, Radeon, radeon) + RADEON=no + + LIBDRM_ATOMICS_NOT_FOUND_MSG($NOUVEAU, nouveau, NVIDIA, nouveau) + NOUVEAU=no + + LIBDRM_ATOMICS_NOT_FOUND_MSG($OMAP, omap, OMAP, omap-experimental-api) + OMAP=no + + LIBDRM_ATOMICS_NOT_FOUND_MSG($FREEDRENO, freedreno, Qualcomm Adreno, freedreno) + FREEDRENO=no + + LIBDRM_ATOMICS_NOT_FOUND_MSG($TEGRA, tegra, NVIDIA Tegra, tegra-experimental-api) + TEGRA=no +else + if test "x$INTEL" = xauto; then + case $host_cpu in + i?86|x86_64) INTEL=yes ;; + *) INTEL=no ;; + esac + fi + if test "x$RADEON" = xauto; then + RADEON=yes + fi + if test "x$NOUVEAU" = xauto; then + NOUVEAU=yes + fi + if test "x$FREEDRENO" = xauto; then + case $host_cpu in + arm*|aarch64) FREEDRENO=yes ;; + *) FREEDRENO=no ;; + esac + fi +fi + +if test "x$INTEL" != "xno"; then + PKG_CHECK_MODULES(PCIACCESS, [pciaccess >= 0.10]) +fi +AC_SUBST(PCIACCESS_CFLAGS) +AC_SUBST(PCIACCESS_LIBS) + if test "x$UDEV" = xyes; then AC_DEFINE(UDEV, 1, [Have UDEV support]) fi @@ -194,6 +291,11 @@ AM_CONDITIONAL(HAVE_LIBKMS, [test "x$LIBKMS" = xyes]) +AM_CONDITIONAL(HAVE_INTEL, [test "x$INTEL" = xyes]) +if test "x$INTEL" = xyes; then + AC_DEFINE(HAVE_INTEL, 1, [Have intel support]) +fi + AM_CONDITIONAL(HAVE_VMWGFX, [test "x$VMWGFX" = xyes]) if test "x$VMWGFX" = xyes; then AC_DEFINE(HAVE_VMWGFX, 1, [Have vmwgfx kernel headers]) @@ -219,6 +321,26 @@ AC_DEFINE(HAVE_FREEDRENO, 1, [Have freedreno support]) fi +if test "x$FREEDRENO_KGSL" = xyes; then + if test "x$FREEDRENO" != xyes; then + AC_MSG_ERROR([Cannot enable freedreno KGSL interface if freedreno is disabled]) + fi +fi +AM_CONDITIONAL(HAVE_FREEDRENO_KGSL, [test "x$FREEDRENO_KGSL" = xyes]) +if test "x$FREEDRENO_KGSL" = xyes; then + AC_DEFINE(HAVE_FREEDRENO_KGSL, 1, [Have freedreno support for KGSL kernel interface]) +fi + +AM_CONDITIONAL(HAVE_RADEON, [test "x$RADEON" = xyes]) +if test "x$RADEON" = xyes; then + AC_DEFINE(HAVE_RADEON, 1, [Have radeon support]) +fi + +AM_CONDITIONAL(HAVE_TEGRA, [test "x$TEGRA" = xyes]) +if test "x$TEGRA" = xyes; then + AC_DEFINE(HAVE_TEGRA, 1, [Have Tegra support]) +fi + AM_CONDITIONAL(HAVE_INSTALL_TESTS, [test "x$INSTALL_TESTS" = xyes]) if test "x$INSTALL_TESTS" = xyes; then AC_DEFINE(HAVE_INSTALL_TESTS, 1, [Install test programs]) @@ -270,102 +392,37 @@ fi AM_CONDITIONAL([HAVE_MANPAGES_STYLESHEET], [test "x$HAVE_MANPAGES_STYLESHEET" = "xyes"]) -if test "x$INTEL" != "xno" -o "x$RADEON" != "xno" -o "x$NOUVEAU" != "xno" -o "x$OMAP" != "xno" -o "x$FREEDRENO" != "xno"; then - # Check for atomic intrinsics - AC_CACHE_CHECK([for native atomic primitives], drm_cv_atomic_primitives, - [ - drm_cv_atomic_primitives="none" - - AC_LINK_IFELSE([AC_LANG_PROGRAM([[ - int atomic_add(int i) { return __sync_fetch_and_add (&i, 1); } - int atomic_cmpxchg(int i, int j, int k) { return __sync_val_compare_and_swap (&i, j, k); } - ]],[[]])], - [drm_cv_atomic_primitives="Intel"],[]) - - if test "x$drm_cv_atomic_primitives" = "xnone"; then - AC_CHECK_HEADER([atomic_ops.h], drm_cv_atomic_primitives="libatomic-ops") - fi - - # atomic functions defined in & libc on Solaris - if test "x$drm_cv_atomic_primitives" = "xnone"; then - AC_CHECK_FUNC([atomic_cas_uint], - drm_cv_atomic_primitives="Solaris") - fi - - ]) - if test "x$drm_cv_atomic_primitives" = xIntel; then - AC_DEFINE(HAVE_LIBDRM_ATOMIC_PRIMITIVES, 1, - [Enable if your compiler supports the Intel __sync_* atomic primitives]) - fi - if test "x$drm_cv_atomic_primitives" = "xlibatomic-ops"; then - AC_DEFINE(HAVE_LIB_ATOMIC_OPS, 1, [Enable if you have libatomic-ops-dev installed]) - fi - - if test "x$drm_cv_atomic_primitives" = "xnone"; then - if test "x$INTEL" != "xauto"; then - if test "x$INTEL" != "xno"; then - AC_MSG_ERROR([libdrm_intel depends upon atomic operations, which were not found for your compiler/cpu. Try compiling with -march=native, or install the libatomics-op-dev package, or, failing both of those, disable support for Intel GPUs by passing --disable-intel to ./configure]) - fi - else - AC_MSG_WARN([Disabling libdrm_intel. It depends on atomic operations, which were not found for your compiler/cpu. Try compiling with -march=native, or install the libatomics-op-dev package.]) - INTEL=no - fi - if test "x$RADEON" != "xauto"; then - if test "x$RADEON" != "xno"; then - AC_MSG_ERROR([libdrm_radeon depends upon atomic operations, which were not found for your compiler/cpu. Try compiling with -march=native, or install the libatomics-op-dev package, or, failing both of those, disable support for Radeon support by passing --disable-radeon to ./configure]) - fi - else - AC_MSG_WARN([Disabling libdrm_radeon. It depends on atomic operations, which were not found for your compiler/cpu. Try compiling with -march=native, or install the libatomics-op-dev package.]) - RADEON=no - fi - if test "x$NOUVEAU" != "xauto"; then - if test "x$NOUVEAU" != "xno"; then - AC_MSG_ERROR([libdrm_nouveau depends upon atomic operations, which were not found for your compiler/cpu. Try compiling with -march=native, or install the libatomics-op-dev package, or, failing both of those, disable support for NVIDIA GPUs by passing --disable-nouveau to ./configure]) - fi - else - AC_MSG_WARN([Disabling libdrm_nouveau. It depends on atomic operations, which were not found for your compiler/cpu. Try compiling with -march=native, or install the libatomics-op-dev package.]) - NOUVEAU=no - fi - else - if test "x$INTEL" != "xno"; then - case $host_cpu in - i?86|x86_64) INTEL=yes ;; - *) INTEL=no ;; - esac - fi - if test "x$RADEON" != "xno"; then - RADEON=yes - fi - if test "x$NOUVEAU" != "xno"; then - NOUVEAU=yes - fi - fi -fi - -if test "x$INTEL" != "xno"; then - PKG_CHECK_MODULES(PCIACCESS, [pciaccess >= 0.10]) -fi -AC_SUBST(PCIACCESS_CFLAGS) -AC_SUBST(PCIACCESS_LIBS) - PKG_CHECK_MODULES(VALGRIND, [valgrind], [have_valgrind=yes], [have_valgrind=no]) if test "x$have_valgrind" = "xyes"; then AC_DEFINE([HAVE_VALGRIND], 1, [Use valgrind intrinsics to suppress false warnings]) fi -AM_CONDITIONAL(HAVE_INTEL, [test "x$INTEL" != "xno"]) -AM_CONDITIONAL(HAVE_RADEON, [test "x$RADEON" != "xno"]) -AM_CONDITIONAL(HAVE_NOUVEAU, [test "x$NOUVEAU" != "xno"]) -if test "x$RADEON" = xyes; then - AC_DEFINE(HAVE_RADEON, 1, [Have radeon support]) -fi - AC_ARG_WITH([kernel-source], [AS_HELP_STRING([--with-kernel-source], [specify path to linux kernel source])], [kernel_source="$with_kernel_source"]) AC_SUBST(kernel_source) +dnl Add flags for gcc and g++ +if test "x$GCC" = xyes; then + # Enable -fvisibility=hidden if using a gcc that supports it + save_CFLAGS="$CFLAGS" + AC_MSG_CHECKING([whether $CC supports -fvisibility=hidden]) + VISIBILITY_CFLAGS="-fvisibility=hidden" + CFLAGS="$CFLAGS $VISIBILITY_CFLAGS" + AC_LINK_IFELSE([AC_LANG_PROGRAM()], AC_MSG_RESULT([yes]), + [VISIBILITY_CFLAGS=""; AC_MSG_RESULT([no])]); + + # Restore CFLAGS; VISIBILITY_CFLAGS are added to it where needed. + CFLAGS=$save_CFLAGS + + if test "x$VISIBILITY_CFLAGS" != x; then + AC_DEFINE(HAVE_VISIBILITY, 1, [Compiler has -fvisibility support]) + fi + + AC_SUBST([VISIBILITY_CFLAGS]) +fi + AC_SUBST(WARN_CFLAGS) AC_CONFIG_FILES([ Makefile @@ -383,15 +440,18 @@ exynos/libdrm_exynos.pc freedreno/Makefile freedreno/libdrm_freedreno.pc + tegra/Makefile + tegra/libdrm_tegra.pc tests/Makefile tests/modeprint/Makefile tests/modetest/Makefile tests/kmstest/Makefile + tests/proptest/Makefile tests/radeon/Makefile tests/vbltest/Makefile tests/exynos/Makefile - include/Makefile - include/drm/Makefile + tests/tegra/Makefile + tests/nouveau/Makefile man/Makefile libdrm.pc]) AC_OUTPUT @@ -406,5 +466,6 @@ echo " Nouveau API $NOUVEAU" echo " OMAP API $OMAP" echo " EXYNOS API $EXYNOS" -echo " Freedreno API $FREEDRENO" +echo " Freedreno API $FREEDRENO (kgsl: $FREEDRENO_KGSL)" +echo " Tegra API $TEGRA" echo "" diff -Nru libdrm-2.4.56/debian/changelog libdrm-2.4.60/debian/changelog --- libdrm-2.4.56/debian/changelog 2015-05-07 19:02:17.000000000 +0000 +++ libdrm-2.4.60/debian/changelog 2015-05-07 19:02:17.000000000 +0000 @@ -1,14 +1,47 @@ -libdrm (2.4.56-1~ubuntu2) trusty-security; urgency=medium +libdrm (2.4.60-2~ubuntu14.04.1) trusty; urgency=medium - * No change rebuild in the security pocket + * Backport to trusty. (LP: #1441847) + * control: Fix libdrm-tegra0 description typo. + * revert-65041c4a1.diff: Revert a commit which broke ABI. - -- Marc Deslauriers Thu, 12 Feb 2015 10:56:21 -0500 + -- Timo Aaltonen Wed, 08 Apr 2015 23:55:25 +0300 -libdrm (2.4.56-1~ubuntu1) trusty-proposed; urgency=medium +libdrm (2.4.60-2) experimental; urgency=medium - * Copy package back to trusty. (LP: #1400626) + [ Maarten Lankhorst ] + * Fix ftbfs on armhf. - -- Maarten Lankhorst Tue, 09 Dec 2014 10:21:05 +0100 + -- Timo Aaltonen Wed, 08 Apr 2015 09:21:00 +0300 + +libdrm (2.4.60-1) experimental; urgency=medium + + * New upstream release. + * libdrm-intel1.symbols, libdrm2.symbols: Updated. + + -- Timo Aaltonen Fri, 20 Mar 2015 09:07:11 +0200 + +libdrm (2.4.59-1) experimental; urgency=medium + + * New upstream release. + * Add libdrm-tegra0 on arm. + + -- Maarten Lankhorst Wed, 21 Jan 2015 13:24:22 +0100 + +libdrm (2.4.58-2) unstable; urgency=medium + + [ Andreas Boll ] + * Update libdrm-freedreno1.symbols and shlibs (fixes FTBFS). + + -- Julien Cristau Sun, 05 Oct 2014 19:00:32 +0200 + +libdrm (2.4.58-1) unstable; urgency=medium + + [ Andreas Boll ] + * New upstream release. + - 03_hide_symbols.diff dropped, upstream. + * Update libdrm-intel1.symbols and shlibs. + + -- Julien Cristau Sun, 05 Oct 2014 15:53:13 +0200 libdrm (2.4.56-1) unstable; urgency=medium diff -Nru libdrm-2.4.56/debian/control libdrm-2.4.60/debian/control --- libdrm-2.4.56/debian/control 2015-05-07 19:02:17.000000000 +0000 +++ libdrm-2.4.60/debian/control 2015-05-07 19:02:17.000000000 +0000 @@ -1,7 +1,6 @@ Source: libdrm Priority: optional -Maintainer: Ubuntu X-SWAT -XSBC-Orig-Maintainer: Debian X Strike Force +Maintainer: Debian X Strike Force Build-Depends: debhelper (>= 9), dh-autoreconf, @@ -277,3 +276,35 @@ OpenGL drivers. . This package provides the debugging symbols for the libdrm-exynos1 package. + +Package: libdrm-tegra0 +Section: libs +Architecture: any-arm +Depends: + ${shlibs:Depends}, + ${misc:Depends}, +Pre-Depends: ${misc:Pre-Depends} +Multi-Arch: same +Description: Userspace interface to tegra-specific kernel DRM services -- runtime + This library implements the userspace interface to the kernel DRM + services. DRM stands for "Direct Rendering Manager", which is the + kernelspace portion of the "Direct Rendering Infrastructure" (DRI). + The DRI is currently used on Linux to provide hardware-accelerated + OpenGL drivers. + +Package: libdrm-tegra0-dbg +Section: debug +Priority: extra +Architecture: any-arm +Depends: + libdrm-tegra0 (= ${binary:Version}), + ${misc:Depends}, +Multi-Arch: same +Description: Userspace interface to tegra-specific kernel DRM services -- debugging symbols + This library implements the userspace interface to the kernel DRM + services. DRM stands for "Direct Rendering Manager", which is the + kernelspace portion of the "Direct Rendering Infrastructure" (DRI). + The DRI is currently used on Linux to provide hardware-accelerated + OpenGL drivers. + . + This package provides the debugging symbols for the libdrm-tegra0 package. diff -Nru libdrm-2.4.56/debian/libdrm2.symbols libdrm-2.4.60/debian/libdrm2.symbols --- libdrm-2.4.56/debian/libdrm2.symbols 2015-05-07 19:02:17.000000000 +0000 +++ libdrm-2.4.60/debian/libdrm2.symbols 2015-05-07 19:02:17.000000000 +0000 @@ -60,6 +60,9 @@ drmGetLock@Base 2.3.1 drmGetMagic@Base 2.3.1 drmGetMap@Base 2.3.1 + drmGetNodeTypeFromFd@Base 2.4.60 + drmGetPrimaryDeviceNameFromFd@Base 2.4.60 + drmGetRenderDeviceNameFromFd@Base 2.4.60 drmGetReservedContextList@Base 2.3.1 drmGetStats@Base 2.3.1 drmGetVersion@Base 2.3.1 @@ -117,6 +120,9 @@ drmOpen@Base 2.3.1 drmOpenControl@Base 2.4.3 drmOpenOnce@Base 2.3.1 + drmOpenOnceWithType@Base 2.4.60 + drmOpenRender@Base 2.4.60 + drmOpenWithType@Base 2.4.60 drmPrimeFDToHandle@Base 2.4.38 drmPrimeHandleToFD@Base 2.4.38 drmRandom@Base 2.3.1 diff -Nru libdrm-2.4.56/debian/libdrm-exynos1.symbols libdrm-2.4.60/debian/libdrm-exynos1.symbols --- libdrm-2.4.56/debian/libdrm-exynos1.symbols 2015-05-07 19:02:17.000000000 +0000 +++ libdrm-2.4.60/debian/libdrm-exynos1.symbols 2015-05-07 19:02:17.000000000 +0000 @@ -17,4 +17,5 @@ g2d_exec@Base 0 g2d_fini@Base 0 g2d_init@Base 0 + g2d_scale_and_blend@Base 2.4.60 g2d_solid_fill@Base 0 diff -Nru libdrm-2.4.56/debian/libdrm-freedreno1.symbols libdrm-2.4.60/debian/libdrm-freedreno1.symbols --- libdrm-2.4.56/debian/libdrm-freedreno1.symbols 2015-05-07 19:02:17.000000000 +0000 +++ libdrm-2.4.60/debian/libdrm-freedreno1.symbols 2015-05-07 19:02:17.000000000 +0000 @@ -2,6 +2,8 @@ fd_bo_cpu_fini@Base 0 fd_bo_cpu_prep@Base 0 fd_bo_del@Base 0 + fd_bo_dmabuf@Base 2.4.57 + fd_bo_from_dmabuf@Base 2.4.57 fd_bo_from_fbdev@Base 0 fd_bo_from_handle@Base 0 fd_bo_from_name@Base 0 diff -Nru libdrm-2.4.56/debian/libdrm-intel1.symbols libdrm-2.4.60/debian/libdrm-intel1.symbols --- libdrm-2.4.56/debian/libdrm-intel1.symbols 2015-05-07 19:02:17.000000000 +0000 +++ libdrm-2.4.60/debian/libdrm-intel1.symbols 2015-05-07 19:02:17.000000000 +0000 @@ -2,6 +2,7 @@ drm_intel_bo_alloc@Base 2.4.1 drm_intel_bo_alloc_for_render@Base 2.4.5 drm_intel_bo_alloc_tiled@Base 2.4.15 + drm_intel_bo_alloc_userptr@Base 2.4.57 drm_intel_bo_busy@Base 2.4.13 drm_intel_bo_disable_reuse@Base 2.4.10 drm_intel_bo_emit_reloc@Base 2.4.1 @@ -64,6 +65,8 @@ drm_intel_gem_context_create@Base 2.4.37 drm_intel_gem_context_destroy@Base 2.4.37 drm_intel_get_aperture_sizes@Base 2.4.26 + drm_intel_get_eu_total@Base 2.4.60 drm_intel_get_pipe_from_crtc_id@Base 2.4.11 drm_intel_get_reset_stats@Base 2.4.48 + drm_intel_get_subslice_total@Base 2.4.60 drm_intel_reg_read@Base 2.4.38 diff -Nru libdrm-2.4.56/debian/libdrm-tegra0.install libdrm-2.4.60/debian/libdrm-tegra0.install --- libdrm-2.4.56/debian/libdrm-tegra0.install 1970-01-01 00:00:00.000000000 +0000 +++ libdrm-2.4.60/debian/libdrm-tegra0.install 2015-05-07 19:02:17.000000000 +0000 @@ -0,0 +1 @@ +usr/lib/*/libdrm_tegra.so.0* diff -Nru libdrm-2.4.56/debian/libdrm-tegra0.symbols libdrm-2.4.60/debian/libdrm-tegra0.symbols --- libdrm-2.4.56/debian/libdrm-tegra0.symbols 1970-01-01 00:00:00.000000000 +0000 +++ libdrm-2.4.60/debian/libdrm-tegra0.symbols 2015-05-07 19:02:17.000000000 +0000 @@ -0,0 +1,15 @@ +libdrm_tegra.so.0 libdrm-tegra0 #MINVER# + drm_tegra_bo_get_flags@Base 0 + drm_tegra_bo_get_handle@Base 0 + drm_tegra_bo_get_tiling@Base 0 + drm_tegra_bo_map@Base 0 + drm_tegra_bo_new@Base 0 + drm_tegra_bo_ref@Base 0 + drm_tegra_bo_set_flags@Base 0 + drm_tegra_bo_set_tiling@Base 0 + drm_tegra_bo_unmap@Base 0 + drm_tegra_bo_unref@Base 0 + drm_tegra_bo_wrap@Base 0 + drm_tegra_close@Base 0 + drm_tegra_new@Base 0 + diff -Nru libdrm-2.4.56/debian/patches/03_hide_symbols.diff libdrm-2.4.60/debian/patches/03_hide_symbols.diff --- libdrm-2.4.56/debian/patches/03_hide_symbols.diff 2015-05-07 19:02:17.000000000 +0000 +++ libdrm-2.4.60/debian/patches/03_hide_symbols.diff 1970-01-01 00:00:00.000000000 +0000 @@ -1,2389 +0,0 @@ -diff --git a/Makefile.am b/Makefile.am -index 826c30d..65680da 100644 ---- a/Makefile.am -+++ b/Makefile.am -@@ -69,6 +69,7 @@ libdrm_la_SOURCES = \ - xf86drmSL.c \ - xf86drmMode.c \ - xf86atomic.h \ -+ libdrm.h \ - libdrm_lists.h - - libdrmincludedir = ${includedir} -diff --git a/configure.ac b/configure.ac -index 5e9cb6c..bb0559a 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -366,6 +366,26 @@ AC_ARG_WITH([kernel-source], - [kernel_source="$with_kernel_source"]) - AC_SUBST(kernel_source) - -+dnl Add flags for gcc and g++ -+if test "x$GCC" = xyes; then -+ # Enable -fvisibility=hidden if using a gcc that supports it -+ save_CFLAGS="$CFLAGS" -+ AC_MSG_CHECKING([whether $CC supports -fvisibility=hidden]) -+ VISIBILITY_CFLAGS="-fvisibility=hidden" -+ CFLAGS="$CFLAGS $VISIBILITY_CFLAGS" -+ AC_LINK_IFELSE([AC_LANG_PROGRAM()], AC_MSG_RESULT([yes]), -+ [VISIBILITY_CFLAGS=""; AC_MSG_RESULT([no])]); -+ -+ # Restore CFLAGS; VISIBILITY_CFLAGS are added to it where needed. -+ CFLAGS=$save_CFLAGS -+ -+ if test "x$VISIBILITY_CFLAGS" != x; then -+ AC_DEFINE(HAVE_VISIBILITY, 1, [Compiler has -fvisibility support]) -+ fi -+ -+ AC_SUBST([VISIBILITY_CFLAGS]) -+fi -+ - AC_SUBST(WARN_CFLAGS) - AC_CONFIG_FILES([ - Makefile -diff --git a/exynos/Makefile.am b/exynos/Makefile.am -index 0a2663a..06bee00 100644 ---- a/exynos/Makefile.am -+++ b/exynos/Makefile.am -@@ -1,5 +1,6 @@ - AM_CFLAGS = \ - $(WARN_CFLAGS) \ -+ $(VISIBILITY_CFLAGS) \ - -I$(top_srcdir) \ - -I$(top_srcdir)/exynos \ - $(PTHREADSTUBS_CFLAGS) \ -diff --git a/exynos/exynos_drm.c b/exynos/exynos_drm.c -index 5fff259..4c7dd13 100644 ---- a/exynos/exynos_drm.c -+++ b/exynos/exynos_drm.c -@@ -38,6 +38,7 @@ - - #include - -+#include "libdrm.h" - #include "exynos_drm.h" - #include "exynos_drmif.h" - -@@ -48,7 +49,7 @@ - * - * if true, return the device object else NULL. - */ --struct exynos_device * exynos_device_create(int fd) -+drm_public struct exynos_device * exynos_device_create(int fd) - { - struct exynos_device *dev; - -@@ -69,7 +70,7 @@ struct exynos_device * exynos_device_create(int fd) - * - * @dev: exynos drm device object. - */ --void exynos_device_destroy(struct exynos_device *dev) -+drm_public void exynos_device_destroy(struct exynos_device *dev) - { - free(dev); - } -@@ -87,8 +88,8 @@ void exynos_device_destroy(struct exynos_device *dev) - * - * if true, return a exynos buffer object else NULL. - */ --struct exynos_bo * exynos_bo_create(struct exynos_device *dev, -- size_t size, uint32_t flags) -+drm_public struct exynos_bo * exynos_bo_create(struct exynos_device *dev, -+ size_t size, uint32_t flags) - { - struct exynos_bo *bo; - struct drm_exynos_gem_create req = { -@@ -141,8 +142,8 @@ fail: - * - * if true, return 0 else negative. - */ --int exynos_bo_get_info(struct exynos_device *dev, uint32_t handle, -- size_t *size, uint32_t *flags) -+drm_public int exynos_bo_get_info(struct exynos_device *dev, uint32_t handle, -+ size_t *size, uint32_t *flags) - { - int ret; - struct drm_exynos_gem_info req = { -@@ -167,7 +168,7 @@ int exynos_bo_get_info(struct exynos_device *dev, uint32_t handle, - * - * @bo: a exynos buffer object to be destroyed. - */ --void exynos_bo_destroy(struct exynos_bo *bo) -+drm_public void exynos_bo_destroy(struct exynos_bo *bo) - { - if (!bo) - return; -@@ -199,7 +200,8 @@ void exynos_bo_destroy(struct exynos_bo *bo) - * if true, return a exynos buffer object else NULL. - * - */ --struct exynos_bo * exynos_bo_from_name(struct exynos_device *dev, uint32_t name) -+drm_public struct exynos_bo * -+exynos_bo_from_name(struct exynos_device *dev, uint32_t name) - { - struct exynos_bo *bo; - struct drm_gem_open req = { -@@ -241,7 +243,7 @@ err_free_bo: - * - * if true, return 0 else negative. - */ --int exynos_bo_get_name(struct exynos_bo *bo, uint32_t *name) -+drm_public int exynos_bo_get_name(struct exynos_bo *bo, uint32_t *name) - { - if (!bo->name) { - struct drm_gem_flink req = { -@@ -264,7 +266,7 @@ int exynos_bo_get_name(struct exynos_bo *bo, uint32_t *name) - return 0; - } - --uint32_t exynos_bo_handle(struct exynos_bo *bo) -+drm_public uint32_t exynos_bo_handle(struct exynos_bo *bo) - { - return bo->handle; - } -@@ -277,7 +279,7 @@ uint32_t exynos_bo_handle(struct exynos_bo *bo) - * - * if true, user pointer mmaped else NULL. - */ --void *exynos_bo_map(struct exynos_bo *bo) -+drm_public void *exynos_bo_map(struct exynos_bo *bo) - { - if (!bo->vaddr) { - struct exynos_device *dev = bo->dev; -@@ -309,8 +311,8 @@ void *exynos_bo_map(struct exynos_bo *bo) - * - * @return: 0 on success, -1 on error, and errno will be set - */ --int exynos_prime_handle_to_fd(struct exynos_device *dev, uint32_t handle, -- int *fd) -+drm_public int -+exynos_prime_handle_to_fd(struct exynos_device *dev, uint32_t handle, int *fd) - { - return drmPrimeHandleToFD(dev->fd, handle, 0, fd); - } -@@ -324,8 +326,8 @@ int exynos_prime_handle_to_fd(struct exynos_device *dev, uint32_t handle, - * - * @return: 0 on success, -1 on error, and errno will be set - */ --int exynos_prime_fd_to_handle(struct exynos_device *dev, int fd, -- uint32_t *handle) -+drm_public int -+exynos_prime_fd_to_handle(struct exynos_device *dev, int fd, uint32_t *handle) - { - return drmPrimeFDToHandle(dev->fd, fd, handle); - } -@@ -347,8 +349,9 @@ int exynos_prime_fd_to_handle(struct exynos_device *dev, int fd, - * - * if true, return 0 else negative. - */ --int exynos_vidi_connection(struct exynos_device *dev, uint32_t connect, -- uint32_t ext, void *edid) -+drm_public int -+exynos_vidi_connection(struct exynos_device *dev, uint32_t connect, -+ uint32_t ext, void *edid) - { - struct drm_exynos_vidi_connection req = { - .connection = connect, -diff --git a/exynos/exynos_fimg2d.c b/exynos/exynos_fimg2d.c -index fc281b6..ce1ba1e 100644 ---- a/exynos/exynos_fimg2d.c -+++ b/exynos/exynos_fimg2d.c -@@ -24,6 +24,7 @@ - - #include - -+#include "libdrm.h" - #include "exynos_drm.h" - #include "fimg2d_reg.h" - #include "fimg2d.h" -@@ -184,7 +185,7 @@ static int g2d_flush(struct g2d_context *ctx) - * - * fd: a file descriptor to drm device driver opened. - */ --struct g2d_context *g2d_init(int fd) -+drm_public struct g2d_context *g2d_init(int fd) - { - struct drm_exynos_g2d_get_ver ver; - struct g2d_context *ctx; -@@ -212,7 +213,7 @@ struct g2d_context *g2d_init(int fd) - return ctx; - } - --void g2d_fini(struct g2d_context *ctx) -+drm_public void g2d_fini(struct g2d_context *ctx) - { - if (ctx) - free(ctx); -@@ -223,7 +224,7 @@ void g2d_fini(struct g2d_context *ctx) - * - * @ctx: a pointer to g2d_context structure. - */ --int g2d_exec(struct g2d_context *ctx) -+drm_public int g2d_exec(struct g2d_context *ctx) - { - struct drm_exynos_g2d_exec exec; - int ret; -@@ -255,7 +256,8 @@ int g2d_exec(struct g2d_context *ctx) - * @w: width value to buffer filled with given color data. - * @h: height value to buffer filled with given color data. - */ --int g2d_solid_fill(struct g2d_context *ctx, struct g2d_image *img, -+drm_public int -+g2d_solid_fill(struct g2d_context *ctx, struct g2d_image *img, - unsigned int x, unsigned int y, unsigned int w, - unsigned int h) - { -@@ -315,7 +317,8 @@ int g2d_solid_fill(struct g2d_context *ctx, struct g2d_image *img, - * @w: width value to source and destination buffers. - * @h: height value to source and destination buffers. - */ --int g2d_copy(struct g2d_context *ctx, struct g2d_image *src, -+drm_public int -+g2d_copy(struct g2d_context *ctx, struct g2d_image *src, - struct g2d_image *dst, unsigned int src_x, unsigned int src_y, - unsigned int dst_x, unsigned dst_y, unsigned int w, - unsigned int h) -@@ -414,7 +417,8 @@ int g2d_copy(struct g2d_context *ctx, struct g2d_image *src, - * @negative: indicate that it uses color negative to source and - * destination buffers. - */ --int g2d_copy_with_scale(struct g2d_context *ctx, struct g2d_image *src, -+drm_public int -+g2d_copy_with_scale(struct g2d_context *ctx, struct g2d_image *src, - struct g2d_image *dst, unsigned int src_x, - unsigned int src_y, unsigned int src_w, - unsigned int src_h, unsigned int dst_x, -@@ -526,7 +530,8 @@ int g2d_copy_with_scale(struct g2d_context *ctx, struct g2d_image *src, - * @h: height value to source and destination buffer. - * @op: blend operation type. - */ --int g2d_blend(struct g2d_context *ctx, struct g2d_image *src, -+drm_public int -+g2d_blend(struct g2d_context *ctx, struct g2d_image *src, - struct g2d_image *dst, unsigned int src_x, - unsigned int src_y, unsigned int dst_x, unsigned int dst_y, - unsigned int w, unsigned int h, enum e_g2d_op op) -diff --git a/freedreno/Makefile.am b/freedreno/Makefile.am -index 7903e5b..49471e9 100644 ---- a/freedreno/Makefile.am -+++ b/freedreno/Makefile.am -@@ -2,6 +2,7 @@ AUTOMAKE_OPTIONS=subdir-objects - - AM_CFLAGS = \ - $(WARN_CFLAGS) \ -+ $(VISIBILITY_CFLAGS) \ - -I$(top_srcdir) \ - -I$(top_srcdir)/freedreno \ - $(PTHREADSTUBS_CFLAGS) \ -diff --git a/freedreno/freedreno_bo.c b/freedreno/freedreno_bo.c -index 8cea4de..3a2e464 100644 ---- a/freedreno/freedreno_bo.c -+++ b/freedreno/freedreno_bo.c -@@ -163,8 +163,8 @@ static struct fd_bo *find_in_bucket(struct fd_device *dev, - } - - --struct fd_bo * fd_bo_new(struct fd_device *dev, -- uint32_t size, uint32_t flags) -+drm_public struct fd_bo * -+fd_bo_new(struct fd_device *dev, uint32_t size, uint32_t flags) - { - struct fd_bo *bo = NULL; - struct fd_bo_bucket *bucket; -@@ -197,8 +197,8 @@ struct fd_bo * fd_bo_new(struct fd_device *dev, - return bo; - } - --struct fd_bo *fd_bo_from_handle(struct fd_device *dev, -- uint32_t handle, uint32_t size) -+drm_public struct fd_bo * -+fd_bo_from_handle(struct fd_device *dev, uint32_t handle, uint32_t size) - { - struct fd_bo *bo = NULL; - -@@ -209,7 +209,7 @@ struct fd_bo *fd_bo_from_handle(struct fd_device *dev, - return bo; - } - --struct fd_bo * fd_bo_from_name(struct fd_device *dev, uint32_t name) -+drm_public struct fd_bo * fd_bo_from_name(struct fd_device *dev, uint32_t name) - { - struct drm_gem_open req = { - .name = name, -@@ -242,13 +242,13 @@ out_unlock: - return bo; - } - --struct fd_bo * fd_bo_ref(struct fd_bo *bo) -+drm_public struct fd_bo * fd_bo_ref(struct fd_bo *bo) - { - atomic_inc(&bo->refcnt); - return bo; - } - --void fd_bo_del(struct fd_bo *bo) -+drm_public void fd_bo_del(struct fd_bo *bo) - { - struct fd_device *dev = bo->dev; - -@@ -307,7 +307,7 @@ static void bo_del(struct fd_bo *bo) - bo->funcs->destroy(bo); - } - --int fd_bo_get_name(struct fd_bo *bo, uint32_t *name) -+drm_public int fd_bo_get_name(struct fd_bo *bo, uint32_t *name) - { - if (!bo->name) { - struct drm_gem_flink req = { -@@ -330,17 +330,17 @@ int fd_bo_get_name(struct fd_bo *bo, uint32_t *name) - return 0; - } - --uint32_t fd_bo_handle(struct fd_bo *bo) -+drm_public uint32_t fd_bo_handle(struct fd_bo *bo) - { - return bo->handle; - } - --uint32_t fd_bo_size(struct fd_bo *bo) -+drm_public uint32_t fd_bo_size(struct fd_bo *bo) - { - return bo->size; - } - --void * fd_bo_map(struct fd_bo *bo) -+drm_public void * fd_bo_map(struct fd_bo *bo) - { - if (!bo->map) { - uint64_t offset; -@@ -362,12 +362,12 @@ void * fd_bo_map(struct fd_bo *bo) - } - - /* a bit odd to take the pipe as an arg, but it's a, umm, quirk of kgsl.. */ --int fd_bo_cpu_prep(struct fd_bo *bo, struct fd_pipe *pipe, uint32_t op) -+drm_public int fd_bo_cpu_prep(struct fd_bo *bo, struct fd_pipe *pipe, uint32_t op) - { - return bo->funcs->cpu_prep(bo, pipe, op); - } - --void fd_bo_cpu_fini(struct fd_bo *bo) -+drm_public void fd_bo_cpu_fini(struct fd_bo *bo) - { - bo->funcs->cpu_fini(bo); - } -diff --git a/freedreno/freedreno_device.c b/freedreno/freedreno_device.c -index c34963c..2d3aa33 100644 ---- a/freedreno/freedreno_device.c -+++ b/freedreno/freedreno_device.c -@@ -76,7 +76,7 @@ init_cache_buckets(struct fd_device *dev) - } - } - --struct fd_device * fd_device_new(int fd) -+drm_public struct fd_device * fd_device_new(int fd) - { - struct fd_device *dev; - drmVersionPtr version; -@@ -115,7 +115,7 @@ struct fd_device * fd_device_new(int fd) - /* like fd_device_new() but creates it's own private dup() of the fd - * which is close()d when the device is finalized. - */ --struct fd_device * fd_device_new_dup(int fd) -+drm_public struct fd_device * fd_device_new_dup(int fd) - { - struct fd_device *dev = fd_device_new(dup(fd)); - if (dev) -@@ -123,7 +123,7 @@ struct fd_device * fd_device_new_dup(int fd) - return dev; - } - --struct fd_device * fd_device_ref(struct fd_device *dev) -+drm_public struct fd_device * fd_device_ref(struct fd_device *dev) - { - atomic_inc(&dev->refcnt); - return dev; -@@ -146,7 +146,7 @@ void fd_device_del_locked(struct fd_device *dev) - fd_device_del_impl(dev); - } - --void fd_device_del(struct fd_device *dev) -+drm_public void fd_device_del(struct fd_device *dev) - { - if (!atomic_dec_and_test(&dev->refcnt)) - return; -diff --git a/freedreno/freedreno_pipe.c b/freedreno/freedreno_pipe.c -index 805bf00..f55aaa4 100644 ---- a/freedreno/freedreno_pipe.c -+++ b/freedreno/freedreno_pipe.c -@@ -29,7 +29,8 @@ - #include "freedreno_drmif.h" - #include "freedreno_priv.h" - --struct fd_pipe * fd_pipe_new(struct fd_device *dev, enum fd_pipe_id id) -+drm_public struct fd_pipe * -+fd_pipe_new(struct fd_device *dev, enum fd_pipe_id id) - { - struct fd_pipe *pipe = NULL; - -@@ -54,18 +55,18 @@ fail: - return NULL; - } - --void fd_pipe_del(struct fd_pipe *pipe) -+drm_public void fd_pipe_del(struct fd_pipe *pipe) - { - pipe->funcs->destroy(pipe); - } - --int fd_pipe_get_param(struct fd_pipe *pipe, enum fd_param_id param, -- uint64_t *value) -+drm_public int fd_pipe_get_param(struct fd_pipe *pipe, -+ enum fd_param_id param, uint64_t *value) - { - return pipe->funcs->get_param(pipe, param, value); - } - --int fd_pipe_wait(struct fd_pipe *pipe, uint32_t timestamp) -+drm_public int fd_pipe_wait(struct fd_pipe *pipe, uint32_t timestamp) - { - return pipe->funcs->wait(pipe, timestamp); - } -diff --git a/freedreno/freedreno_priv.h b/freedreno/freedreno_priv.h -index 7438485..6bd1dec 100644 ---- a/freedreno/freedreno_priv.h -+++ b/freedreno/freedreno_priv.h -@@ -29,6 +29,10 @@ - #ifndef FREEDRENO_PRIV_H_ - #define FREEDRENO_PRIV_H_ - -+#ifdef HAVE_CONFIG_H -+#include "config.h" -+#endif -+ - #include - #include - #include -@@ -41,6 +45,7 @@ - #include - #include - -+#include "libdrm.h" - #include "xf86drm.h" - #include "xf86atomic.h" - -diff --git a/freedreno/freedreno_ringbuffer.c b/freedreno/freedreno_ringbuffer.c -index b9849c5..def869f 100644 ---- a/freedreno/freedreno_ringbuffer.c -+++ b/freedreno/freedreno_ringbuffer.c -@@ -32,8 +32,8 @@ - #include "freedreno_priv.h" - #include "freedreno_ringbuffer.h" - --struct fd_ringbuffer * fd_ringbuffer_new(struct fd_pipe *pipe, -- uint32_t size) -+drm_public struct fd_ringbuffer * -+fd_ringbuffer_new(struct fd_pipe *pipe, uint32_t size) - { - struct fd_ringbuffer *ring; - -@@ -51,7 +51,7 @@ struct fd_ringbuffer * fd_ringbuffer_new(struct fd_pipe *pipe, - return ring; - } - --void fd_ringbuffer_del(struct fd_ringbuffer *ring) -+drm_public void fd_ringbuffer_del(struct fd_ringbuffer *ring) - { - ring->funcs->destroy(ring); - } -@@ -60,13 +60,13 @@ void fd_ringbuffer_del(struct fd_ringbuffer *ring) - * the IB source) as it's parent before emitting reloc's, to ensure - * the bookkeeping works out properly. - */ --void fd_ringbuffer_set_parent(struct fd_ringbuffer *ring, -- struct fd_ringbuffer *parent) -+drm_public void fd_ringbuffer_set_parent(struct fd_ringbuffer *ring, -+ struct fd_ringbuffer *parent) - { - ring->parent = parent; - } - --void fd_ringbuffer_reset(struct fd_ringbuffer *ring) -+drm_public void fd_ringbuffer_reset(struct fd_ringbuffer *ring) - { - uint32_t *start = ring->start; - if (ring->pipe->id == FD_PIPE_2D) -@@ -77,30 +77,32 @@ void fd_ringbuffer_reset(struct fd_ringbuffer *ring) - } - - /* maybe get rid of this and use fd_ringmarker_flush() from DDX too? */ --int fd_ringbuffer_flush(struct fd_ringbuffer *ring) -+drm_public int fd_ringbuffer_flush(struct fd_ringbuffer *ring) - { - return ring->funcs->flush(ring, ring->last_start); - } - --uint32_t fd_ringbuffer_timestamp(struct fd_ringbuffer *ring) -+drm_public uint32_t fd_ringbuffer_timestamp(struct fd_ringbuffer *ring) - { - return ring->last_timestamp; - } - --void fd_ringbuffer_reloc(struct fd_ringbuffer *ring, -- const struct fd_reloc *reloc) -+drm_public void fd_ringbuffer_reloc(struct fd_ringbuffer *ring, -+ const struct fd_reloc *reloc) - { - ring->funcs->emit_reloc(ring, reloc); - } - --void fd_ringbuffer_emit_reloc_ring(struct fd_ringbuffer *ring, -- struct fd_ringmarker *target, struct fd_ringmarker *end) -+drm_public void -+fd_ringbuffer_emit_reloc_ring(struct fd_ringbuffer *ring, -+ struct fd_ringmarker *target, -+ struct fd_ringmarker *end) - { - assert(target->ring == end->ring); - ring->funcs->emit_reloc_ring(ring, target, end); - } - --struct fd_ringmarker * fd_ringmarker_new(struct fd_ringbuffer *ring) -+drm_public struct fd_ringmarker * fd_ringmarker_new(struct fd_ringbuffer *ring) - { - struct fd_ringmarker *marker = NULL; - -@@ -117,23 +119,23 @@ struct fd_ringmarker * fd_ringmarker_new(struct fd_ringbuffer *ring) - return marker; - } - --void fd_ringmarker_del(struct fd_ringmarker *marker) -+drm_public void fd_ringmarker_del(struct fd_ringmarker *marker) - { - free(marker); - } - --void fd_ringmarker_mark(struct fd_ringmarker *marker) -+drm_public void fd_ringmarker_mark(struct fd_ringmarker *marker) - { - marker->cur = marker->ring->cur; - } - --uint32_t fd_ringmarker_dwords(struct fd_ringmarker *start, -- struct fd_ringmarker *end) -+drm_public uint32_t fd_ringmarker_dwords(struct fd_ringmarker *start, -+ struct fd_ringmarker *end) - { - return end->cur - start->cur; - } - --int fd_ringmarker_flush(struct fd_ringmarker *marker) -+drm_public int fd_ringmarker_flush(struct fd_ringmarker *marker) - { - struct fd_ringbuffer *ring = marker->ring; - return ring->funcs->flush(ring, marker->cur); -diff --git a/freedreno/kgsl/kgsl_bo.c b/freedreno/kgsl/kgsl_bo.c -index 19a1008..c868097 100644 ---- a/freedreno/kgsl/kgsl_bo.c -+++ b/freedreno/kgsl/kgsl_bo.c -@@ -171,8 +171,8 @@ struct fd_bo * kgsl_bo_from_handle(struct fd_device *dev, - return bo; - } - --struct fd_bo * fd_bo_from_fbdev(struct fd_pipe *pipe, -- int fbfd, uint32_t size) -+drm_public struct fd_bo * -+fd_bo_from_fbdev(struct fd_pipe *pipe, int fbfd, uint32_t size) - { - struct fd_bo *bo; - -diff --git a/intel/Makefile.am b/intel/Makefile.am -index f49b099..f734b0b 100644 ---- a/intel/Makefile.am -+++ b/intel/Makefile.am -@@ -24,6 +24,7 @@ - - AM_CFLAGS = \ - $(WARN_CFLAGS) \ -+ $(VISIBILITY_CFLAGS) \ - -I$(top_srcdir) \ - -I$(top_srcdir)/intel \ - $(PTHREADSTUBS_CFLAGS) \ -diff --git a/intel/intel_bufmgr.c b/intel/intel_bufmgr.c -index 905556f..03dba50 100644 ---- a/intel/intel_bufmgr.c -+++ b/intel/intel_bufmgr.c -@@ -37,6 +37,7 @@ - #include - #include - #include -+#include "libdrm.h" - #include "intel_bufmgr.h" - #include "intel_bufmgr_priv.h" - #include "xf86drm.h" -@@ -46,21 +47,21 @@ - * Convenience functions for buffer management methods. - */ - --drm_intel_bo *drm_intel_bo_alloc(drm_intel_bufmgr *bufmgr, const char *name, -- unsigned long size, unsigned int alignment) -+drm_public drm_intel_bo * -+drm_intel_bo_alloc(drm_intel_bufmgr *bufmgr, const char *name, -+ unsigned long size, unsigned int alignment) - { - return bufmgr->bo_alloc(bufmgr, name, size, alignment); - } - --drm_intel_bo *drm_intel_bo_alloc_for_render(drm_intel_bufmgr *bufmgr, -- const char *name, -- unsigned long size, -- unsigned int alignment) -+drm_public drm_intel_bo * -+drm_intel_bo_alloc_for_render(drm_intel_bufmgr *bufmgr, const char *name, -+ unsigned long size, unsigned int alignment) - { - return bufmgr->bo_alloc_for_render(bufmgr, name, size, alignment); - } - --drm_intel_bo * -+drm_public drm_intel_bo * - drm_intel_bo_alloc_tiled(drm_intel_bufmgr *bufmgr, const char *name, - int x, int y, int cpp, uint32_t *tiling_mode, - unsigned long *pitch, unsigned long flags) -@@ -69,12 +70,14 @@ drm_intel_bo_alloc_tiled(drm_intel_bufmgr *bufmgr, const char *name, - tiling_mode, pitch, flags); - } - --void drm_intel_bo_reference(drm_intel_bo *bo) -+drm_public void -+drm_intel_bo_reference(drm_intel_bo *bo) - { - bo->bufmgr->bo_reference(bo); - } - --void drm_intel_bo_unreference(drm_intel_bo *bo) -+drm_public void -+drm_intel_bo_unreference(drm_intel_bo *bo) - { - if (bo == NULL) - return; -@@ -82,24 +85,26 @@ void drm_intel_bo_unreference(drm_intel_bo *bo) - bo->bufmgr->bo_unreference(bo); - } - --int drm_intel_bo_map(drm_intel_bo *buf, int write_enable) -+drm_public int -+drm_intel_bo_map(drm_intel_bo *buf, int write_enable) - { - return buf->bufmgr->bo_map(buf, write_enable); - } - --int drm_intel_bo_unmap(drm_intel_bo *buf) -+drm_public int -+drm_intel_bo_unmap(drm_intel_bo *buf) - { - return buf->bufmgr->bo_unmap(buf); - } - --int -+drm_public int - drm_intel_bo_subdata(drm_intel_bo *bo, unsigned long offset, - unsigned long size, const void *data) - { - return bo->bufmgr->bo_subdata(bo, offset, size, data); - } - --int -+drm_public int - drm_intel_bo_get_subdata(drm_intel_bo *bo, unsigned long offset, - unsigned long size, void *data) - { -@@ -118,24 +123,26 @@ drm_intel_bo_get_subdata(drm_intel_bo *bo, unsigned long offset, - return 0; - } - --void drm_intel_bo_wait_rendering(drm_intel_bo *bo) -+drm_public void -+drm_intel_bo_wait_rendering(drm_intel_bo *bo) - { - bo->bufmgr->bo_wait_rendering(bo); - } - --void drm_intel_bufmgr_destroy(drm_intel_bufmgr *bufmgr) -+drm_public void -+drm_intel_bufmgr_destroy(drm_intel_bufmgr *bufmgr) - { - bufmgr->destroy(bufmgr); - } - --int -+drm_public int - drm_intel_bo_exec(drm_intel_bo *bo, int used, - drm_clip_rect_t * cliprects, int num_cliprects, int DR4) - { - return bo->bufmgr->bo_exec(bo, used, cliprects, num_cliprects, DR4); - } - --int -+drm_public int - drm_intel_bo_mrb_exec(drm_intel_bo *bo, int used, - drm_clip_rect_t *cliprects, int num_cliprects, int DR4, - unsigned int rings) -@@ -155,17 +162,20 @@ drm_intel_bo_mrb_exec(drm_intel_bo *bo, int used, - } - } - --void drm_intel_bufmgr_set_debug(drm_intel_bufmgr *bufmgr, int enable_debug) -+drm_public void -+drm_intel_bufmgr_set_debug(drm_intel_bufmgr *bufmgr, int enable_debug) - { - bufmgr->debug = enable_debug; - } - --int drm_intel_bufmgr_check_aperture_space(drm_intel_bo ** bo_array, int count) -+drm_public int -+drm_intel_bufmgr_check_aperture_space(drm_intel_bo ** bo_array, int count) - { - return bo_array[0]->bufmgr->check_aperture_space(bo_array, count); - } - --int drm_intel_bo_flink(drm_intel_bo *bo, uint32_t * name) -+drm_public int -+drm_intel_bo_flink(drm_intel_bo *bo, uint32_t * name) - { - if (bo->bufmgr->bo_flink) - return bo->bufmgr->bo_flink(bo, name); -@@ -173,7 +183,7 @@ int drm_intel_bo_flink(drm_intel_bo *bo, uint32_t * name) - return -ENODEV; - } - --int -+drm_public int - drm_intel_bo_emit_reloc(drm_intel_bo *bo, uint32_t offset, - drm_intel_bo *target_bo, uint32_t target_offset, - uint32_t read_domains, uint32_t write_domain) -@@ -184,7 +194,7 @@ drm_intel_bo_emit_reloc(drm_intel_bo *bo, uint32_t offset, - } - - /* For fence registers, not GL fences */ --int -+drm_public int - drm_intel_bo_emit_reloc_fence(drm_intel_bo *bo, uint32_t offset, - drm_intel_bo *target_bo, uint32_t target_offset, - uint32_t read_domains, uint32_t write_domain) -@@ -195,7 +205,8 @@ drm_intel_bo_emit_reloc_fence(drm_intel_bo *bo, uint32_t offset, - } - - --int drm_intel_bo_pin(drm_intel_bo *bo, uint32_t alignment) -+drm_public int -+drm_intel_bo_pin(drm_intel_bo *bo, uint32_t alignment) - { - if (bo->bufmgr->bo_pin) - return bo->bufmgr->bo_pin(bo, alignment); -@@ -203,7 +214,8 @@ int drm_intel_bo_pin(drm_intel_bo *bo, uint32_t alignment) - return -ENODEV; - } - --int drm_intel_bo_unpin(drm_intel_bo *bo) -+drm_public int -+drm_intel_bo_unpin(drm_intel_bo *bo) - { - if (bo->bufmgr->bo_unpin) - return bo->bufmgr->bo_unpin(bo); -@@ -211,8 +223,9 @@ int drm_intel_bo_unpin(drm_intel_bo *bo) - return -ENODEV; - } - --int drm_intel_bo_set_tiling(drm_intel_bo *bo, uint32_t * tiling_mode, -- uint32_t stride) -+drm_public int -+drm_intel_bo_set_tiling(drm_intel_bo *bo, uint32_t * tiling_mode, -+ uint32_t stride) - { - if (bo->bufmgr->bo_set_tiling) - return bo->bufmgr->bo_set_tiling(bo, tiling_mode, stride); -@@ -221,8 +234,9 @@ int drm_intel_bo_set_tiling(drm_intel_bo *bo, uint32_t * tiling_mode, - return 0; - } - --int drm_intel_bo_get_tiling(drm_intel_bo *bo, uint32_t * tiling_mode, -- uint32_t * swizzle_mode) -+drm_public int -+drm_intel_bo_get_tiling(drm_intel_bo *bo, uint32_t * tiling_mode, -+ uint32_t * swizzle_mode) - { - if (bo->bufmgr->bo_get_tiling) - return bo->bufmgr->bo_get_tiling(bo, tiling_mode, swizzle_mode); -@@ -232,40 +246,46 @@ int drm_intel_bo_get_tiling(drm_intel_bo *bo, uint32_t * tiling_mode, - return 0; - } - --int drm_intel_bo_disable_reuse(drm_intel_bo *bo) -+drm_public int -+drm_intel_bo_disable_reuse(drm_intel_bo *bo) - { - if (bo->bufmgr->bo_disable_reuse) - return bo->bufmgr->bo_disable_reuse(bo); - return 0; - } - --int drm_intel_bo_is_reusable(drm_intel_bo *bo) -+drm_public int -+drm_intel_bo_is_reusable(drm_intel_bo *bo) - { - if (bo->bufmgr->bo_is_reusable) - return bo->bufmgr->bo_is_reusable(bo); - return 0; - } - --int drm_intel_bo_busy(drm_intel_bo *bo) -+drm_public int -+drm_intel_bo_busy(drm_intel_bo *bo) - { - if (bo->bufmgr->bo_busy) - return bo->bufmgr->bo_busy(bo); - return 0; - } - --int drm_intel_bo_madvise(drm_intel_bo *bo, int madv) -+drm_public int -+drm_intel_bo_madvise(drm_intel_bo *bo, int madv) - { - if (bo->bufmgr->bo_madvise) - return bo->bufmgr->bo_madvise(bo, madv); - return -1; - } - --int drm_intel_bo_references(drm_intel_bo *bo, drm_intel_bo *target_bo) -+drm_public int -+drm_intel_bo_references(drm_intel_bo *bo, drm_intel_bo *target_bo) - { - return bo->bufmgr->bo_references(bo, target_bo); - } - --int drm_intel_get_pipe_from_crtc_id(drm_intel_bufmgr *bufmgr, int crtc_id) -+drm_public int -+drm_intel_get_pipe_from_crtc_id(drm_intel_bufmgr *bufmgr, int crtc_id) - { - if (bufmgr->get_pipe_from_crtc_id) - return bufmgr->get_pipe_from_crtc_id(bufmgr, crtc_id); -@@ -298,9 +318,8 @@ err: - return size; - } - --int drm_intel_get_aperture_sizes(int fd, -- size_t *mappable, -- size_t *total) -+drm_public int -+drm_intel_get_aperture_sizes(int fd, size_t *mappable, size_t *total) - { - - struct drm_i915_gem_get_aperture aperture; -diff --git a/intel/intel_bufmgr_fake.c b/intel/intel_bufmgr_fake.c -index d63fc81..c4828fa 100644 ---- a/intel/intel_bufmgr_fake.c -+++ b/intel/intel_bufmgr_fake.c -@@ -49,6 +49,7 @@ - #include "drm.h" - #include "i915_drm.h" - #include "mm.h" -+#include "libdrm.h" - #include "libdrm_lists.h" - - /* Support gcc's __FUNCTION__ for people using other compilers */ -@@ -248,7 +249,7 @@ FENCE_LTE(unsigned a, unsigned b) - return 0; - } - --void -+drm_public void - drm_intel_bufmgr_fake_set_fence_callback(drm_intel_bufmgr *bufmgr, - unsigned int (*emit) (void *priv), - void (*wait) (unsigned int fence, -@@ -771,7 +772,7 @@ drm_intel_fake_bo_wait_rendering(drm_intel_bo *bo) - * -- just evict everything - * -- and wait for idle - */ --void -+drm_public void - drm_intel_bufmgr_fake_contended_lock_take(drm_intel_bufmgr *bufmgr) - { - drm_intel_bufmgr_fake *bufmgr_fake = (drm_intel_bufmgr_fake *) bufmgr; -@@ -867,7 +868,7 @@ drm_intel_fake_bo_alloc_tiled(drm_intel_bufmgr * bufmgr, - 4096); - } - --drm_intel_bo * -+drm_public drm_intel_bo * - drm_intel_bo_fake_alloc_static(drm_intel_bufmgr *bufmgr, - const char *name, - unsigned long offset, -@@ -962,7 +963,7 @@ drm_intel_fake_bo_unreference(drm_intel_bo *bo) - * Set the buffer as not requiring backing store, and instead get the callback - * invoked whenever it would be set dirty. - */ --void -+drm_public void - drm_intel_bo_fake_disable_backing_store(drm_intel_bo *bo, - void (*invalidate_cb) (drm_intel_bo *bo, - void *ptr), -@@ -1416,7 +1417,7 @@ drm_intel_bo_fake_post_submit(drm_intel_bo *bo) - bo_fake->write_domain = 0; - } - --void -+drm_public void - drm_intel_bufmgr_fake_set_exec_callback(drm_intel_bufmgr *bufmgr, - int (*exec) (drm_intel_bo *bo, - unsigned int used, -@@ -1539,7 +1540,8 @@ drm_intel_fake_check_aperture_space(drm_intel_bo ** bo_array, int count) - * Used by the X Server on LeaveVT, when the card memory is no longer our - * own. - */ --void drm_intel_bufmgr_fake_evict_all(drm_intel_bufmgr *bufmgr) -+drm_public void -+drm_intel_bufmgr_fake_evict_all(drm_intel_bufmgr *bufmgr) - { - drm_intel_bufmgr_fake *bufmgr_fake = (drm_intel_bufmgr_fake *) bufmgr; - struct block *block, *tmp; -@@ -1573,21 +1575,20 @@ void drm_intel_bufmgr_fake_evict_all(drm_intel_bufmgr *bufmgr) - pthread_mutex_unlock(&bufmgr_fake->lock); - } - --void drm_intel_bufmgr_fake_set_last_dispatch(drm_intel_bufmgr *bufmgr, -- volatile unsigned int -- *last_dispatch) -+drm_public void -+drm_intel_bufmgr_fake_set_last_dispatch(drm_intel_bufmgr *bufmgr, -+ volatile unsigned int -+ *last_dispatch) - { - drm_intel_bufmgr_fake *bufmgr_fake = (drm_intel_bufmgr_fake *) bufmgr; - - bufmgr_fake->last_dispatch = (volatile int *)last_dispatch; - } - --drm_intel_bufmgr *drm_intel_bufmgr_fake_init(int fd, -- unsigned long low_offset, -- void *low_virtual, -- unsigned long size, -- volatile unsigned int -- *last_dispatch) -+drm_public drm_intel_bufmgr * -+drm_intel_bufmgr_fake_init(int fd, unsigned long low_offset, -+ void *low_virtual, unsigned long size, -+ volatile unsigned int *last_dispatch) - { - drm_intel_bufmgr_fake *bufmgr_fake; - -diff --git a/intel/intel_bufmgr_gem.c b/intel/intel_bufmgr_gem.c -index 007a6d8..0e1cb0d 100644 ---- a/intel/intel_bufmgr_gem.c -+++ b/intel/intel_bufmgr_gem.c -@@ -57,6 +57,7 @@ - #ifndef ETIME - #define ETIME ETIMEDOUT - #endif -+#include "libdrm.h" - #include "libdrm_lists.h" - #include "intel_bufmgr.h" - #include "intel_bufmgr_priv.h" -@@ -853,7 +854,7 @@ drm_intel_gem_bo_alloc_tiled(drm_intel_bufmgr *bufmgr, const char *name, - * This can be used when one application needs to pass a buffer object - * to another. - */ --drm_intel_bo * -+drm_public drm_intel_bo * - drm_intel_bo_gem_create_from_name(drm_intel_bufmgr *bufmgr, - const char *name, - unsigned int handle) -@@ -1294,7 +1295,8 @@ map_gtt(drm_intel_bo *bo) - return 0; - } - --int drm_intel_gem_bo_map_gtt(drm_intel_bo *bo) -+drm_public int -+drm_intel_gem_bo_map_gtt(drm_intel_bo *bo) - { - drm_intel_bufmgr_gem *bufmgr_gem = (drm_intel_bufmgr_gem *) bo->bufmgr; - drm_intel_bo_gem *bo_gem = (drm_intel_bo_gem *) bo; -@@ -1352,7 +1354,8 @@ int drm_intel_gem_bo_map_gtt(drm_intel_bo *bo) - * undefined). - */ - --int drm_intel_gem_bo_map_unsynchronized(drm_intel_bo *bo) -+drm_public int -+drm_intel_gem_bo_map_unsynchronized(drm_intel_bo *bo) - { - drm_intel_bufmgr_gem *bufmgr_gem = (drm_intel_bufmgr_gem *) bo->bufmgr; - #ifdef HAVE_VALGRIND -@@ -1435,7 +1438,8 @@ static int drm_intel_gem_bo_unmap(drm_intel_bo *bo) - return ret; - } - --int drm_intel_gem_bo_unmap_gtt(drm_intel_bo *bo) -+drm_public int -+drm_intel_gem_bo_unmap_gtt(drm_intel_bo *bo) - { - return drm_intel_gem_bo_unmap(bo); - } -@@ -1550,7 +1554,8 @@ drm_intel_gem_bo_wait_rendering(drm_intel_bo *bo) - * handle. Userspace must make sure this race does not occur if such precision - * is important. - */ --int drm_intel_gem_bo_wait(drm_intel_bo *bo, int64_t timeout_ns) -+drm_public int -+drm_intel_gem_bo_wait(drm_intel_bo *bo, int64_t timeout_ns) - { - drm_intel_bufmgr_gem *bufmgr_gem = (drm_intel_bufmgr_gem *) bo->bufmgr; - drm_intel_bo_gem *bo_gem = (drm_intel_bo_gem *) bo; -@@ -1585,7 +1590,7 @@ int drm_intel_gem_bo_wait(drm_intel_bo *bo, int64_t timeout_ns) - * In combination with drm_intel_gem_bo_pin() and manual fence management, we - * can do tiled pixmaps this way. - */ --void -+drm_public void - drm_intel_gem_bo_start_gtt_access(drm_intel_bo *bo, int write_enable) - { - drm_intel_bufmgr_gem *bufmgr_gem = (drm_intel_bufmgr_gem *) bo->bufmgr; -@@ -1745,7 +1750,7 @@ drm_intel_gem_bo_emit_reloc_fence(drm_intel_bo *bo, uint32_t offset, - read_domains, write_domain, true); - } - --int -+drm_public int - drm_intel_gem_bo_get_reloc_count(drm_intel_bo *bo) - { - drm_intel_bo_gem *bo_gem = (drm_intel_bo_gem *) bo; -@@ -1766,7 +1771,7 @@ drm_intel_gem_bo_get_reloc_count(drm_intel_bo *bo) - * Any further drm_intel_bufmgr_check_aperture_space() queries - * involving this buffer in the tree are undefined after this call. - */ --void -+drm_public void - drm_intel_gem_bo_clear_relocs(drm_intel_bo *bo, int start) - { - drm_intel_bo_gem *bo_gem = (drm_intel_bo_gem *) bo; -@@ -2095,7 +2100,7 @@ aub_build_dump_ringbuffer(drm_intel_bufmgr_gem *bufmgr_gem, - bufmgr_gem->aub_offset += 4096; - } - --void -+drm_public void - drm_intel_gem_bo_aub_dump_bmp(drm_intel_bo *bo, - int x1, int y1, int width, int height, - enum aub_dump_bmp_format format, -@@ -2366,7 +2371,7 @@ drm_intel_gem_bo_mrb_exec2(drm_intel_bo *bo, int used, - flags); - } - --int -+drm_public int - drm_intel_gem_bo_context_exec(drm_intel_bo *bo, drm_intel_context *ctx, - int used, unsigned int flags) - { -@@ -2485,7 +2490,7 @@ drm_intel_gem_bo_get_tiling(drm_intel_bo *bo, uint32_t * tiling_mode, - return 0; - } - --drm_intel_bo * -+drm_public drm_intel_bo * - drm_intel_bo_gem_create_from_prime(drm_intel_bufmgr *bufmgr, int prime_fd, int size) - { - drm_intel_bufmgr_gem *bufmgr_gem = (drm_intel_bufmgr_gem *) bufmgr; -@@ -2566,7 +2571,7 @@ drm_intel_bo_gem_create_from_prime(drm_intel_bufmgr *bufmgr, int prime_fd, int s - return &bo_gem->bo; - } - --int -+drm_public int - drm_intel_bo_gem_export_to_prime(drm_intel_bo *bo, int *prime_fd) - { - drm_intel_bufmgr_gem *bufmgr_gem = (drm_intel_bufmgr_gem *) bo->bufmgr; -@@ -2619,7 +2624,7 @@ drm_intel_gem_bo_flink(drm_intel_bo *bo, uint32_t * name) - * size is only bounded by how many buffers of that size we've managed to have - * in flight at once. - */ --void -+drm_public void - drm_intel_bufmgr_gem_enable_reuse(drm_intel_bufmgr *bufmgr) - { - drm_intel_bufmgr_gem *bufmgr_gem = (drm_intel_bufmgr_gem *) bufmgr; -@@ -2634,7 +2639,7 @@ drm_intel_bufmgr_gem_enable_reuse(drm_intel_bufmgr *bufmgr) - * allocation. If this option is not enabled, all relocs will have fence - * register allocated. - */ --void -+drm_public void - drm_intel_bufmgr_gem_enable_fenced_relocs(drm_intel_bufmgr *bufmgr) - { - drm_intel_bufmgr_gem *bufmgr_gem = (drm_intel_bufmgr_gem *)bufmgr; -@@ -2906,7 +2911,7 @@ init_cache_buckets(drm_intel_bufmgr_gem *bufmgr_gem) - } - } - --void -+drm_public void - drm_intel_bufmgr_gem_set_vma_cache_size(drm_intel_bufmgr *bufmgr, int limit) - { - drm_intel_bufmgr_gem *bufmgr_gem = (drm_intel_bufmgr_gem *)bufmgr; -@@ -2948,7 +2953,7 @@ get_pci_device_id(drm_intel_bufmgr_gem *bufmgr_gem) - return devid; - } - --int -+drm_public int - drm_intel_bufmgr_gem_get_devid(drm_intel_bufmgr *bufmgr) - { - drm_intel_bufmgr_gem *bufmgr_gem = (drm_intel_bufmgr_gem *)bufmgr; -@@ -2962,7 +2967,7 @@ drm_intel_bufmgr_gem_get_devid(drm_intel_bufmgr *bufmgr) - * This function has to be called before drm_intel_bufmgr_gem_set_aub_dump() - * for it to have any effect. - */ --void -+drm_public void - drm_intel_bufmgr_gem_set_aub_filename(drm_intel_bufmgr *bufmgr, - const char *filename) - { -@@ -2981,7 +2986,7 @@ drm_intel_bufmgr_gem_set_aub_filename(drm_intel_bufmgr *bufmgr, - * You can set up a GTT and upload your objects into the referenced - * space, then send off batchbuffers and get BMPs out the other end. - */ --void -+drm_public void - drm_intel_bufmgr_gem_set_aub_dump(drm_intel_bufmgr *bufmgr, int enable) - { - drm_intel_bufmgr_gem *bufmgr_gem = (drm_intel_bufmgr_gem *)bufmgr; -@@ -3037,7 +3042,7 @@ drm_intel_bufmgr_gem_set_aub_dump(drm_intel_bufmgr *bufmgr, int enable) - } - } - --drm_intel_context * -+drm_public drm_intel_context * - drm_intel_gem_context_create(drm_intel_bufmgr *bufmgr) - { - drm_intel_bufmgr_gem *bufmgr_gem = (drm_intel_bufmgr_gem *)bufmgr; -@@ -3064,7 +3069,7 @@ drm_intel_gem_context_create(drm_intel_bufmgr *bufmgr) - return context; - } - --void -+drm_public void - drm_intel_gem_context_destroy(drm_intel_context *ctx) - { - drm_intel_bufmgr_gem *bufmgr_gem; -@@ -3087,7 +3092,7 @@ drm_intel_gem_context_destroy(drm_intel_context *ctx) - free(ctx); - } - --int -+drm_public int - drm_intel_get_reset_stats(drm_intel_context *ctx, - uint32_t *reset_count, - uint32_t *active, -@@ -3121,7 +3126,7 @@ drm_intel_get_reset_stats(drm_intel_context *ctx, - return ret; - } - --int -+drm_public int - drm_intel_reg_read(drm_intel_bufmgr *bufmgr, - uint32_t offset, - uint64_t *result) -@@ -3161,7 +3166,7 @@ drm_intel_reg_read(drm_intel_bufmgr *bufmgr, - * default state (no annotations), call this function with a \c count - * of zero. - */ --void -+drm_public void - drm_intel_bufmgr_gem_set_aub_annotations(drm_intel_bo *bo, - drm_intel_aub_annotation *annotations, - unsigned count) -@@ -3187,7 +3192,7 @@ drm_intel_bufmgr_gem_set_aub_annotations(drm_intel_bo *bo, - * - * \param fd File descriptor of the opened DRM device. - */ --drm_intel_bufmgr * -+drm_public drm_intel_bufmgr * - drm_intel_bufmgr_gem_init(int fd, int batch_size) - { - drm_intel_bufmgr_gem *bufmgr_gem; -diff --git a/intel/intel_decode.c b/intel/intel_decode.c -index 61239dd..a5d6e04 100644 ---- a/intel/intel_decode.c -+++ b/intel/intel_decode.c -@@ -21,6 +21,10 @@ - * IN THE SOFTWARE. - */ - -+#ifdef HAVE_CONFIG_H -+#include "config.h" -+#endif -+ - #include - #include - #include -@@ -29,6 +33,7 @@ - #include - #include - -+#include "libdrm.h" - #include "xf86drm.h" - #include "intel_chipset.h" - #include "intel_bufmgr.h" -@@ -3812,7 +3817,7 @@ decode_3d_i830(struct drm_intel_decode *ctx) - return 1; - } - --struct drm_intel_decode * -+drm_public struct drm_intel_decode * - drm_intel_decode_context_alloc(uint32_t devid) - { - struct drm_intel_decode *ctx; -@@ -3844,20 +3849,20 @@ drm_intel_decode_context_alloc(uint32_t devid) - return ctx; - } - --void -+drm_public void - drm_intel_decode_context_free(struct drm_intel_decode *ctx) - { - free(ctx); - } - --void -+drm_public void - drm_intel_decode_set_dump_past_end(struct drm_intel_decode *ctx, - int dump_past_end) - { - ctx->dump_past_end = !!dump_past_end; - } - --void -+drm_public void - drm_intel_decode_set_batch_pointer(struct drm_intel_decode *ctx, - void *data, uint32_t hw_offset, int count) - { -@@ -3866,7 +3871,7 @@ drm_intel_decode_set_batch_pointer(struct drm_intel_decode *ctx, - ctx->base_count = count; - } - --void -+drm_public void - drm_intel_decode_set_head_tail(struct drm_intel_decode *ctx, - uint32_t head, uint32_t tail) - { -@@ -3874,7 +3879,7 @@ drm_intel_decode_set_head_tail(struct drm_intel_decode *ctx, - ctx->tail = tail; - } - --void -+drm_public void - drm_intel_decode_set_output_file(struct drm_intel_decode *ctx, - FILE *out) - { -@@ -3888,7 +3893,7 @@ drm_intel_decode_set_output_file(struct drm_intel_decode *ctx, - * \param count number of DWORDs to decode in the batch buffer - * \param hw_offset hardware address for the buffer - */ --void -+drm_public void - drm_intel_decode(struct drm_intel_decode *ctx) - { - int ret; -diff --git a/libdrm.h b/libdrm.h -new file mode 100644 -index 0000000..23926e6 ---- /dev/null -+++ b/libdrm.h -@@ -0,0 +1,34 @@ -+/* -+ * Copyright © 2014 NVIDIA Corporation -+ * -+ * Permission is hereby granted, free of charge, to any person obtaining a -+ * copy of this software and associated documentation files (the "Software"), -+ * to deal in the Software without restriction, including without limitation -+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, -+ * and/or sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following conditions: -+ * -+ * The above copyright notice and this permission notice shall be included in -+ * all copies or substantial portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -+ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR -+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -+ * OTHER DEALINGS IN THE SOFTWARE. -+ */ -+ -+#ifndef LIBDRM_LIBDRM_H -+#define LIBDRM_LIBDRM_H -+ -+#if defined(HAVE_VISIBILITY) -+# define drm_private __attribute__((visibility("hidden"))) -+# define drm_public __attribute__((visibility("default"))) -+#else -+# define drm_private -+# define drm_public -+#endif -+ -+#endif -diff --git a/nouveau/Makefile.am b/nouveau/Makefile.am -index 206e892..73cff9f 100644 ---- a/nouveau/Makefile.am -+++ b/nouveau/Makefile.am -@@ -1,5 +1,6 @@ - AM_CFLAGS = \ - $(WARN_CFLAGS) \ -+ $(VISIBILITY_CFLAGS) \ - -I$(top_srcdir) \ - -I$(top_srcdir)/nouveau \ - $(PTHREADSTUBS_CFLAGS) \ -diff --git a/nouveau/bufctx.c b/nouveau/bufctx.c -index 23d6f09..fdd3164 100644 ---- a/nouveau/bufctx.c -+++ b/nouveau/bufctx.c -@@ -68,7 +68,7 @@ nouveau_bufctx(struct nouveau_bufctx *bctx) - return (struct nouveau_bufctx_priv *)bctx; - } - --int -+drm_public int - nouveau_bufctx_new(struct nouveau_client *client, int bins, - struct nouveau_bufctx **pbctx) - { -@@ -88,7 +88,7 @@ nouveau_bufctx_new(struct nouveau_client *client, int bins, - return -ENOMEM; - } - --void -+drm_public void - nouveau_bufctx_del(struct nouveau_bufctx **pbctx) - { - struct nouveau_bufctx_priv *pctx = nouveau_bufctx(*pbctx); -@@ -105,7 +105,7 @@ nouveau_bufctx_del(struct nouveau_bufctx **pbctx) - } - } - --void -+drm_public void - nouveau_bufctx_reset(struct nouveau_bufctx *bctx, int bin) - { - struct nouveau_bufctx_priv *pctx = nouveau_bufctx(bctx); -@@ -123,7 +123,7 @@ nouveau_bufctx_reset(struct nouveau_bufctx *bctx, int bin) - pbin->relocs = 0; - } - --struct nouveau_bufref * -+drm_public struct nouveau_bufref * - nouveau_bufctx_refn(struct nouveau_bufctx *bctx, int bin, - struct nouveau_bo *bo, uint32_t flags) - { -@@ -150,7 +150,7 @@ nouveau_bufctx_refn(struct nouveau_bufctx *bctx, int bin, - return &pref->base; - } - --struct nouveau_bufref * -+drm_public struct nouveau_bufref * - nouveau_bufctx_mthd(struct nouveau_bufctx *bctx, int bin, uint32_t packet, - struct nouveau_bo *bo, uint64_t data, uint32_t flags, - uint32_t vor, uint32_t tor) -diff --git a/nouveau/nouveau.c b/nouveau/nouveau.c -index 1bede84..43f0d3c 100644 ---- a/nouveau/nouveau.c -+++ b/nouveau/nouveau.c -@@ -62,14 +62,14 @@ debug_init(char *args) - * is kept here to prevent AIGLX from crashing if the DDX is linked against - * the new libdrm, but the DRI driver against the old - */ --int -+drm_public int - nouveau_device_open_existing(struct nouveau_device **pdev, int close, int fd, - drm_context_t ctx) - { - return -EACCES; - } - --int -+drm_public int - nouveau_device_wrap(int fd, int close, struct nouveau_device **pdev) - { - struct nouveau_device_priv *nvdev = calloc(1, sizeof(*nvdev)); -@@ -147,7 +147,7 @@ nouveau_device_wrap(int fd, int close, struct nouveau_device **pdev) - return 0; - } - --int -+drm_public int - nouveau_device_open(const char *busid, struct nouveau_device **pdev) - { - int ret = -ENODEV, fd = drmOpen("nouveau", busid); -@@ -159,7 +159,7 @@ nouveau_device_open(const char *busid, struct nouveau_device **pdev) - return ret; - } - --void -+drm_public void - nouveau_device_del(struct nouveau_device **pdev) - { - struct nouveau_device_priv *nvdev = nouveau_device(*pdev); -@@ -173,7 +173,7 @@ nouveau_device_del(struct nouveau_device **pdev) - } - } - --int -+drm_public int - nouveau_getparam(struct nouveau_device *dev, uint64_t param, uint64_t *value) - { - struct drm_nouveau_getparam r = { param, 0 }; -@@ -183,14 +183,14 @@ nouveau_getparam(struct nouveau_device *dev, uint64_t param, uint64_t *value) - return ret; - } - --int -+drm_public int - nouveau_setparam(struct nouveau_device *dev, uint64_t param, uint64_t value) - { - struct drm_nouveau_setparam r = { param, value }; - return drmCommandWrite(dev->fd, DRM_NOUVEAU_SETPARAM, &r, sizeof(r)); - } - --int -+drm_public int - nouveau_client_new(struct nouveau_device *dev, struct nouveau_client **pclient) - { - struct nouveau_device_priv *nvdev = nouveau_device(dev); -@@ -229,7 +229,7 @@ unlock: - return ret; - } - --void -+drm_public void - nouveau_client_del(struct nouveau_client **pclient) - { - struct nouveau_client_priv *pcli = nouveau_client(*pclient); -@@ -245,7 +245,7 @@ nouveau_client_del(struct nouveau_client **pclient) - } - } - --int -+drm_public int - nouveau_object_new(struct nouveau_object *parent, uint64_t handle, - uint32_t oclass, void *data, uint32_t length, - struct nouveau_object **pobj) -@@ -307,7 +307,7 @@ nouveau_object_new(struct nouveau_object *parent, uint64_t handle, - return 0; - } - --void -+drm_public void - nouveau_object_del(struct nouveau_object **pobj) - { - struct nouveau_object *obj = *pobj; -@@ -331,7 +331,7 @@ nouveau_object_del(struct nouveau_object **pobj) - *pobj = NULL; - } - --void * -+drm_public void * - nouveau_object_find(struct nouveau_object *obj, uint32_t pclass) - { - while (obj && obj->oclass != pclass) { -@@ -385,7 +385,7 @@ nouveau_bo_del(struct nouveau_bo *bo) - free(nvbo); - } - --int -+drm_public int - nouveau_bo_new(struct nouveau_device *dev, uint32_t flags, uint32_t align, - uint64_t size, union nouveau_bo_config *config, - struct nouveau_bo **pbo) -@@ -451,7 +451,7 @@ nouveau_bo_wrap_locked(struct nouveau_device *dev, uint32_t handle, - return -ENOMEM; - } - --int -+drm_public int - nouveau_bo_wrap(struct nouveau_device *dev, uint32_t handle, - struct nouveau_bo **pbo) - { -@@ -463,7 +463,7 @@ nouveau_bo_wrap(struct nouveau_device *dev, uint32_t handle, - return ret; - } - --int -+drm_public int - nouveau_bo_name_ref(struct nouveau_device *dev, uint32_t name, - struct nouveau_bo **pbo) - { -@@ -492,7 +492,7 @@ nouveau_bo_name_ref(struct nouveau_device *dev, uint32_t name, - return ret; - } - --int -+drm_public int - nouveau_bo_name_get(struct nouveau_bo *bo, uint32_t *name) - { - struct drm_gem_flink req = { .handle = bo->handle }; -@@ -510,7 +510,7 @@ nouveau_bo_name_get(struct nouveau_bo *bo, uint32_t *name) - return 0; - } - --void -+drm_public void - nouveau_bo_ref(struct nouveau_bo *bo, struct nouveau_bo **pref) - { - struct nouveau_bo *ref = *pref; -@@ -524,7 +524,7 @@ nouveau_bo_ref(struct nouveau_bo *bo, struct nouveau_bo **pref) - *pref = bo; - } - --int -+drm_public int - nouveau_bo_prime_handle_ref(struct nouveau_device *dev, int prime_fd, - struct nouveau_bo **bo) - { -@@ -553,7 +553,7 @@ nouveau_bo_prime_handle_ref(struct nouveau_device *dev, int prime_fd, - return ret; - } - --int -+drm_public int - nouveau_bo_set_prime(struct nouveau_bo *bo, int *prime_fd) - { - struct nouveau_bo_priv *nvbo = nouveau_bo(bo); -@@ -567,7 +567,7 @@ nouveau_bo_set_prime(struct nouveau_bo *bo, int *prime_fd) - return 0; - } - --int -+drm_public int - nouveau_bo_wait(struct nouveau_bo *bo, uint32_t access, - struct nouveau_client *client) - { -@@ -601,7 +601,7 @@ nouveau_bo_wait(struct nouveau_bo *bo, uint32_t access, - return ret; - } - --int -+drm_public int - nouveau_bo_map(struct nouveau_bo *bo, uint32_t access, - struct nouveau_client *client) - { -diff --git a/nouveau/private.h b/nouveau/private.h -index 4f337ad..bf9db04 100644 ---- a/nouveau/private.h -+++ b/nouveau/private.h -@@ -1,6 +1,7 @@ - #ifndef __NOUVEAU_LIBDRM_PRIVATE_H__ - #define __NOUVEAU_LIBDRM_PRIVATE_H__ - -+#include - #include - #include - #include -diff --git a/nouveau/pushbuf.c b/nouveau/pushbuf.c -index 4f77881..6e703a4 100644 ---- a/nouveau/pushbuf.c -+++ b/nouveau/pushbuf.c -@@ -529,7 +529,7 @@ pushbuf_validate(struct nouveau_pushbuf *push, bool retry) - return ret; - } - --int -+drm_public int - nouveau_pushbuf_new(struct nouveau_client *client, struct nouveau_object *chan, - int nr, uint32_t size, bool immediate, - struct nouveau_pushbuf **ppush) -@@ -600,7 +600,7 @@ nouveau_pushbuf_new(struct nouveau_client *client, struct nouveau_object *chan, - return 0; - } - --void -+drm_public void - nouveau_pushbuf_del(struct nouveau_pushbuf **ppush) - { - struct nouveau_pushbuf_priv *nvpb = nouveau_pushbuf(*ppush); -@@ -626,7 +626,7 @@ nouveau_pushbuf_del(struct nouveau_pushbuf **ppush) - *ppush = NULL; - } - --struct nouveau_bufctx * -+drm_public struct nouveau_bufctx * - nouveau_pushbuf_bufctx(struct nouveau_pushbuf *push, struct nouveau_bufctx *ctx) - { - struct nouveau_bufctx *prev = push->bufctx; -@@ -634,7 +634,7 @@ nouveau_pushbuf_bufctx(struct nouveau_pushbuf *push, struct nouveau_bufctx *ctx) - return prev; - } - --int -+drm_public int - nouveau_pushbuf_space(struct nouveau_pushbuf *push, - uint32_t dwords, uint32_t relocs, uint32_t pushes) - { -@@ -698,7 +698,7 @@ nouveau_pushbuf_space(struct nouveau_pushbuf *push, - return flushed ? pushbuf_validate(push, false) : 0; - } - --void -+drm_public void - nouveau_pushbuf_data(struct nouveau_pushbuf *push, struct nouveau_bo *bo, - uint64_t offset, uint64_t length) - { -@@ -728,14 +728,14 @@ nouveau_pushbuf_data(struct nouveau_pushbuf *push, struct nouveau_bo *bo, - } - } - --int -+drm_public int - nouveau_pushbuf_refn(struct nouveau_pushbuf *push, - struct nouveau_pushbuf_refn *refs, int nr) - { - return pushbuf_refn(push, true, refs, nr); - } - --void -+drm_public void - nouveau_pushbuf_reloc(struct nouveau_pushbuf *push, struct nouveau_bo *bo, - uint32_t data, uint32_t flags, uint32_t vor, uint32_t tor) - { -@@ -743,13 +743,13 @@ nouveau_pushbuf_reloc(struct nouveau_pushbuf *push, struct nouveau_bo *bo, - push->cur++; - } - --int -+drm_public int - nouveau_pushbuf_validate(struct nouveau_pushbuf *push) - { - return pushbuf_validate(push, true); - } - --uint32_t -+drm_public uint32_t - nouveau_pushbuf_refd(struct nouveau_pushbuf *push, struct nouveau_bo *bo) - { - struct drm_nouveau_gem_pushbuf_bo *kref; -@@ -766,7 +766,7 @@ nouveau_pushbuf_refd(struct nouveau_pushbuf *push, struct nouveau_bo *bo) - return flags; - } - --int -+drm_public int - nouveau_pushbuf_kick(struct nouveau_pushbuf *push, struct nouveau_object *chan) - { - if (!push->channel) -diff --git a/omap/Makefile.am b/omap/Makefile.am -index c77520b..0778bdd 100644 ---- a/omap/Makefile.am -+++ b/omap/Makefile.am -@@ -1,5 +1,6 @@ - AM_CFLAGS = \ - $(WARN_CFLAGS) \ -+ $(VISIBILITY_CFLAGS) \ - -I$(top_srcdir) \ - -I$(top_srcdir)/omap \ - $(PTHREADSTUBS_CFLAGS) \ -diff --git a/omap/omap_drm.c b/omap/omap_drm.c -index 89f1491..8b4ec46 100644 ---- a/omap/omap_drm.c -+++ b/omap/omap_drm.c -@@ -39,6 +39,7 @@ - #include - #include - -+#include - #include - #include - -@@ -91,7 +92,7 @@ static struct omap_device * omap_device_new_impl(int fd) - return dev; - } - --struct omap_device * omap_device_new(int fd) -+drm_public struct omap_device * omap_device_new(int fd) - { - struct omap_device *dev = NULL; - -@@ -114,13 +115,13 @@ struct omap_device * omap_device_new(int fd) - return dev; - } - --struct omap_device * omap_device_ref(struct omap_device *dev) -+drm_public struct omap_device * omap_device_ref(struct omap_device *dev) - { - atomic_inc(&dev->refcnt); - return dev; - } - --void omap_device_del(struct omap_device *dev) -+drm_public void omap_device_del(struct omap_device *dev) - { - if (!atomic_dec_and_test(&dev->refcnt)) - return; -@@ -131,7 +132,8 @@ void omap_device_del(struct omap_device *dev) - free(dev); - } - --int omap_get_param(struct omap_device *dev, uint64_t param, uint64_t *value) -+drm_public int -+omap_get_param(struct omap_device *dev, uint64_t param, uint64_t *value) - { - struct drm_omap_param req = { - .param = param, -@@ -148,7 +150,8 @@ int omap_get_param(struct omap_device *dev, uint64_t param, uint64_t *value) - return 0; - } - --int omap_set_param(struct omap_device *dev, uint64_t param, uint64_t value) -+drm_public int -+omap_set_param(struct omap_device *dev, uint64_t param, uint64_t value) - { - struct drm_omap_param req = { - .param = param, -@@ -226,8 +229,8 @@ fail: - - - /* allocate a new (un-tiled) buffer object */ --struct omap_bo * omap_bo_new(struct omap_device *dev, -- uint32_t size, uint32_t flags) -+drm_public struct omap_bo * -+omap_bo_new(struct omap_device *dev, uint32_t size, uint32_t flags) - { - union omap_gem_size gsize = { - .bytes = size, -@@ -239,8 +242,9 @@ struct omap_bo * omap_bo_new(struct omap_device *dev, - } - - /* allocate a new buffer object */ --struct omap_bo * omap_bo_new_tiled(struct omap_device *dev, -- uint32_t width, uint32_t height, uint32_t flags) -+drm_public struct omap_bo * -+omap_bo_new_tiled(struct omap_device *dev, uint32_t width, -+ uint32_t height, uint32_t flags) - { - union omap_gem_size gsize = { - .tiled = { -@@ -254,7 +258,7 @@ struct omap_bo * omap_bo_new_tiled(struct omap_device *dev, - return omap_bo_new_impl(dev, gsize, flags); - } - --struct omap_bo * omap_bo_ref(struct omap_bo *bo) -+drm_public struct omap_bo *omap_bo_ref(struct omap_bo *bo) - { - atomic_inc(&bo->refcnt); - return bo; -@@ -280,7 +284,8 @@ static int get_buffer_info(struct omap_bo *bo) - } - - /* import a buffer object from DRI2 name */ --struct omap_bo * omap_bo_from_name(struct omap_device *dev, uint32_t name) -+drm_public struct omap_bo * -+omap_bo_from_name(struct omap_device *dev, uint32_t name) - { - struct omap_bo *bo = NULL; - struct drm_gem_open req = { -@@ -313,7 +318,8 @@ fail: - * fd so caller should close() the fd when it is otherwise done - * with it (even if it is still using the 'struct omap_bo *') - */ --struct omap_bo * omap_bo_from_dmabuf(struct omap_device *dev, int fd) -+drm_public struct omap_bo * -+omap_bo_from_dmabuf(struct omap_device *dev, int fd) - { - struct omap_bo *bo = NULL; - struct drm_prime_handle req = { -@@ -344,7 +350,7 @@ fail: - } - - /* destroy a buffer object */ --void omap_bo_del(struct omap_bo *bo) -+drm_public void omap_bo_del(struct omap_bo *bo) - { - if (!bo) { - return; -@@ -377,7 +383,7 @@ void omap_bo_del(struct omap_bo *bo) - } - - /* get the global flink/DRI2 buffer name */ --int omap_bo_get_name(struct omap_bo *bo, uint32_t *name) -+drm_public int omap_bo_get_name(struct omap_bo *bo, uint32_t *name) - { - if (!bo->name) { - struct drm_gem_flink req = { -@@ -398,7 +404,7 @@ int omap_bo_get_name(struct omap_bo *bo, uint32_t *name) - return 0; - } - --uint32_t omap_bo_handle(struct omap_bo *bo) -+drm_public uint32_t omap_bo_handle(struct omap_bo *bo) - { - return bo->handle; - } -@@ -406,7 +412,7 @@ uint32_t omap_bo_handle(struct omap_bo *bo) - /* caller owns the dmabuf fd that is returned and is responsible - * to close() it when done - */ --int omap_bo_dmabuf(struct omap_bo *bo) -+drm_public int omap_bo_dmabuf(struct omap_bo *bo) - { - if (!bo->fd) { - struct drm_prime_handle req = { -@@ -425,7 +431,7 @@ int omap_bo_dmabuf(struct omap_bo *bo) - return dup(bo->fd); - } - --uint32_t omap_bo_size(struct omap_bo *bo) -+drm_public uint32_t omap_bo_size(struct omap_bo *bo) - { - if (!bo->size) { - get_buffer_info(bo); -@@ -433,7 +439,7 @@ uint32_t omap_bo_size(struct omap_bo *bo) - return bo->size; - } - --void * omap_bo_map(struct omap_bo *bo) -+drm_public void *omap_bo_map(struct omap_bo *bo) - { - if (!bo->map) { - if (!bo->offset) { -@@ -449,7 +455,7 @@ void * omap_bo_map(struct omap_bo *bo) - return bo->map; - } - --int omap_bo_cpu_prep(struct omap_bo *bo, enum omap_gem_op op) -+drm_public int omap_bo_cpu_prep(struct omap_bo *bo, enum omap_gem_op op) - { - struct drm_omap_gem_cpu_prep req = { - .handle = bo->handle, -@@ -459,7 +465,7 @@ int omap_bo_cpu_prep(struct omap_bo *bo, enum omap_gem_op op) - DRM_OMAP_GEM_CPU_PREP, &req, sizeof(req)); - } - --int omap_bo_cpu_fini(struct omap_bo *bo, enum omap_gem_op op) -+drm_public int omap_bo_cpu_fini(struct omap_bo *bo, enum omap_gem_op op) - { - struct drm_omap_gem_cpu_fini req = { - .handle = bo->handle, -diff --git a/radeon/Makefile.am b/radeon/Makefile.am -index a8cd100..c969573 100644 ---- a/radeon/Makefile.am -+++ b/radeon/Makefile.am -@@ -24,6 +24,7 @@ - - AM_CFLAGS = \ - $(WARN_CFLAGS) \ -+ $(VISIBILITY_CFLAGS) \ - -I$(top_srcdir) \ - -I$(top_srcdir)/radeon \ - $(PTHREADSTUBS_CFLAGS) \ -diff --git a/radeon/radeon_bo.c b/radeon/radeon_bo.c -index 6a0f8e7..865e3f7 100644 ---- a/radeon/radeon_bo.c -+++ b/radeon/radeon_bo.c -@@ -29,10 +29,14 @@ - * Dave Airlie - * Jérôme Glisse - */ -+#ifdef HAVE_CONFIG_H -+#include -+#endif -+#include - #include - #include - --void radeon_bo_debug(struct radeon_bo *bo, const char *op) -+drm_public void radeon_bo_debug(struct radeon_bo *bo, const char *op) - { - struct radeon_bo_int *boi = (struct radeon_bo_int *)bo; - -@@ -40,26 +44,23 @@ void radeon_bo_debug(struct radeon_bo *bo, const char *op) - op, bo, bo->handle, boi->size, boi->cref); - } - --struct radeon_bo *radeon_bo_open(struct radeon_bo_manager *bom, -- uint32_t handle, -- uint32_t size, -- uint32_t alignment, -- uint32_t domains, -- uint32_t flags) -+drm_public struct radeon_bo * -+radeon_bo_open(struct radeon_bo_manager *bom, uint32_t handle, uint32_t size, -+ uint32_t alignment, uint32_t domains, uint32_t flags) - { - struct radeon_bo *bo; - bo = bom->funcs->bo_open(bom, handle, size, alignment, domains, flags); - return bo; - } - --void radeon_bo_ref(struct radeon_bo *bo) -+drm_public void radeon_bo_ref(struct radeon_bo *bo) - { - struct radeon_bo_int *boi = (struct radeon_bo_int *)bo; - boi->cref++; - boi->bom->funcs->bo_ref(boi); - } - --struct radeon_bo *radeon_bo_unref(struct radeon_bo *bo) -+drm_public struct radeon_bo *radeon_bo_unref(struct radeon_bo *bo) - { - struct radeon_bo_int *boi = (struct radeon_bo_int *)bo; - if (bo == NULL) -@@ -69,19 +70,19 @@ struct radeon_bo *radeon_bo_unref(struct radeon_bo *bo) - return boi->bom->funcs->bo_unref(boi); - } - --int radeon_bo_map(struct radeon_bo *bo, int write) -+drm_public int radeon_bo_map(struct radeon_bo *bo, int write) - { - struct radeon_bo_int *boi = (struct radeon_bo_int *)bo; - return boi->bom->funcs->bo_map(boi, write); - } - --int radeon_bo_unmap(struct radeon_bo *bo) -+drm_public int radeon_bo_unmap(struct radeon_bo *bo) - { - struct radeon_bo_int *boi = (struct radeon_bo_int *)bo; - return boi->bom->funcs->bo_unmap(boi); - } - --int radeon_bo_wait(struct radeon_bo *bo) -+drm_public int radeon_bo_wait(struct radeon_bo *bo) - { - struct radeon_bo_int *boi = (struct radeon_bo_int *)bo; - if (!boi->bom->funcs->bo_wait) -@@ -89,27 +90,29 @@ int radeon_bo_wait(struct radeon_bo *bo) - return boi->bom->funcs->bo_wait(boi); - } - --int radeon_bo_is_busy(struct radeon_bo *bo, uint32_t *domain) -+drm_public int radeon_bo_is_busy(struct radeon_bo *bo, uint32_t *domain) - { - struct radeon_bo_int *boi = (struct radeon_bo_int *)bo; - return boi->bom->funcs->bo_is_busy(boi, domain); - } - --int radeon_bo_set_tiling(struct radeon_bo *bo, -- uint32_t tiling_flags, uint32_t pitch) -+drm_public int -+radeon_bo_set_tiling(struct radeon_bo *bo, -+ uint32_t tiling_flags, uint32_t pitch) - { - struct radeon_bo_int *boi = (struct radeon_bo_int *)bo; - return boi->bom->funcs->bo_set_tiling(boi, tiling_flags, pitch); - } - --int radeon_bo_get_tiling(struct radeon_bo *bo, -- uint32_t *tiling_flags, uint32_t *pitch) -+drm_public int -+radeon_bo_get_tiling(struct radeon_bo *bo, -+ uint32_t *tiling_flags, uint32_t *pitch) - { - struct radeon_bo_int *boi = (struct radeon_bo_int *)bo; - return boi->bom->funcs->bo_get_tiling(boi, tiling_flags, pitch); - } - --int radeon_bo_is_static(struct radeon_bo *bo) -+drm_public int radeon_bo_is_static(struct radeon_bo *bo) - { - struct radeon_bo_int *boi = (struct radeon_bo_int *)bo; - if (boi->bom->funcs->bo_is_static) -@@ -117,18 +120,19 @@ int radeon_bo_is_static(struct radeon_bo *bo) - return 0; - } - --int radeon_bo_is_referenced_by_cs(struct radeon_bo *bo, struct radeon_cs *cs) -+drm_public int -+radeon_bo_is_referenced_by_cs(struct radeon_bo *bo, struct radeon_cs *cs) - { - struct radeon_bo_int *boi = (struct radeon_bo_int *)bo; - return boi->cref > 1; - } - --uint32_t radeon_bo_get_handle(struct radeon_bo *bo) -+drm_public uint32_t radeon_bo_get_handle(struct radeon_bo *bo) - { - return bo->handle; - } - --uint32_t radeon_bo_get_src_domain(struct radeon_bo *bo) -+drm_public uint32_t radeon_bo_get_src_domain(struct radeon_bo *bo) - { - struct radeon_bo_int *boi = (struct radeon_bo_int *)bo; - uint32_t src_domain; -diff --git a/radeon/radeon_bo_gem.c b/radeon/radeon_bo_gem.c -index 4ea405f..251ec1b 100644 ---- a/radeon/radeon_bo_gem.c -+++ b/radeon/radeon_bo_gem.c -@@ -38,6 +38,7 @@ - #include - #include - #include -+#include "libdrm.h" - #include "xf86drm.h" - #include "xf86atomic.h" - #include "drm.h" -@@ -283,7 +284,7 @@ static struct radeon_bo_funcs bo_gem_funcs = { - bo_is_busy, - }; - --struct radeon_bo_manager *radeon_bo_manager_gem_ctor(int fd) -+drm_public struct radeon_bo_manager *radeon_bo_manager_gem_ctor(int fd) - { - struct bo_manager_gem *bomg; - -@@ -296,7 +297,7 @@ struct radeon_bo_manager *radeon_bo_manager_gem_ctor(int fd) - return (struct radeon_bo_manager*)bomg; - } - --void radeon_bo_manager_gem_dtor(struct radeon_bo_manager *bom) -+drm_public void radeon_bo_manager_gem_dtor(struct radeon_bo_manager *bom) - { - struct bo_manager_gem *bomg = (struct bo_manager_gem*)bom; - -@@ -306,19 +307,22 @@ void radeon_bo_manager_gem_dtor(struct radeon_bo_manager *bom) - free(bomg); - } - --uint32_t radeon_gem_name_bo(struct radeon_bo *bo) -+drm_public uint32_t -+radeon_gem_name_bo(struct radeon_bo *bo) - { - struct radeon_bo_gem *bo_gem = (struct radeon_bo_gem*)bo; - return bo_gem->name; - } - --void *radeon_gem_get_reloc_in_cs(struct radeon_bo *bo) -+drm_public void * -+radeon_gem_get_reloc_in_cs(struct radeon_bo *bo) - { - struct radeon_bo_gem *bo_gem = (struct radeon_bo_gem*)bo; - return &bo_gem->reloc_in_cs; - } - --int radeon_gem_get_kernel_name(struct radeon_bo *bo, uint32_t *name) -+drm_public int -+radeon_gem_get_kernel_name(struct radeon_bo *bo, uint32_t *name) - { - struct radeon_bo_gem *bo_gem = (struct radeon_bo_gem*)bo; - struct radeon_bo_int *boi = (struct radeon_bo_int *)bo; -@@ -339,7 +343,8 @@ int radeon_gem_get_kernel_name(struct radeon_bo *bo, uint32_t *name) - return 0; - } - --int radeon_gem_set_domain(struct radeon_bo *bo, uint32_t read_domains, uint32_t write_domain) -+drm_public int -+radeon_gem_set_domain(struct radeon_bo *bo, uint32_t read_domains, uint32_t write_domain) - { - struct radeon_bo_int *boi = (struct radeon_bo_int *)bo; - struct drm_radeon_gem_set_domain args; -@@ -356,7 +361,7 @@ int radeon_gem_set_domain(struct radeon_bo *bo, uint32_t read_domains, uint32_t - return r; - } - --int radeon_gem_prime_share_bo(struct radeon_bo *bo, int *handle) -+drm_public int radeon_gem_prime_share_bo(struct radeon_bo *bo, int *handle) - { - struct radeon_bo_gem *bo_gem = (struct radeon_bo_gem*)bo; - int ret; -@@ -365,9 +370,8 @@ int radeon_gem_prime_share_bo(struct radeon_bo *bo, int *handle) - return ret; - } - --struct radeon_bo *radeon_gem_bo_open_prime(struct radeon_bo_manager *bom, -- int fd_handle, -- uint32_t size) -+drm_public struct radeon_bo * -+radeon_gem_bo_open_prime(struct radeon_bo_manager *bom, int fd_handle, uint32_t size) - { - struct radeon_bo_gem *bo; - int r; -diff --git a/radeon/radeon_cs.c b/radeon/radeon_cs.c -index d0e922b..fe5bbce 100644 ---- a/radeon/radeon_cs.c -+++ b/radeon/radeon_cs.c -@@ -1,19 +1,22 @@ -- -+#ifdef HAVE_CONFIG_H -+#include -+#endif -+#include "libdrm.h" - #include - #include "radeon_cs.h" - #include "radeon_cs_int.h" - --struct radeon_cs *radeon_cs_create(struct radeon_cs_manager *csm, uint32_t ndw) -+drm_public struct radeon_cs * -+radeon_cs_create(struct radeon_cs_manager *csm, uint32_t ndw) - { - struct radeon_cs_int *csi = csm->funcs->cs_create(csm, ndw); - return (struct radeon_cs *)csi; - } - --int radeon_cs_write_reloc(struct radeon_cs *cs, -- struct radeon_bo *bo, -- uint32_t read_domain, -- uint32_t write_domain, -- uint32_t flags) -+drm_public int -+radeon_cs_write_reloc(struct radeon_cs *cs, struct radeon_bo *bo, -+ uint32_t read_domain, uint32_t write_domain, -+ uint32_t flags) - { - struct radeon_cs_int *csi = (struct radeon_cs_int *)cs; - -@@ -24,56 +27,54 @@ int radeon_cs_write_reloc(struct radeon_cs *cs, - flags); - } - --int radeon_cs_begin(struct radeon_cs *cs, -- uint32_t ndw, -- const char *file, -- const char *func, -- int line) -+drm_public int -+radeon_cs_begin(struct radeon_cs *cs, uint32_t ndw, -+ const char *file, const char *func, int line) - { - struct radeon_cs_int *csi = (struct radeon_cs_int *)cs; - return csi->csm->funcs->cs_begin(csi, ndw, file, func, line); - } - --int radeon_cs_end(struct radeon_cs *cs, -- const char *file, -- const char *func, -- int line) -+drm_public int -+radeon_cs_end(struct radeon_cs *cs, -+ const char *file, const char *func, int line) - { - struct radeon_cs_int *csi = (struct radeon_cs_int *)cs; - return csi->csm->funcs->cs_end(csi, file, func, line); - } - --int radeon_cs_emit(struct radeon_cs *cs) -+drm_public int radeon_cs_emit(struct radeon_cs *cs) - { - struct radeon_cs_int *csi = (struct radeon_cs_int *)cs; - return csi->csm->funcs->cs_emit(csi); - } - --int radeon_cs_destroy(struct radeon_cs *cs) -+drm_public int radeon_cs_destroy(struct radeon_cs *cs) - { - struct radeon_cs_int *csi = (struct radeon_cs_int *)cs; - return csi->csm->funcs->cs_destroy(csi); - } - --int radeon_cs_erase(struct radeon_cs *cs) -+drm_public int radeon_cs_erase(struct radeon_cs *cs) - { - struct radeon_cs_int *csi = (struct radeon_cs_int *)cs; - return csi->csm->funcs->cs_erase(csi); - } - --int radeon_cs_need_flush(struct radeon_cs *cs) -+drm_public int radeon_cs_need_flush(struct radeon_cs *cs) - { - struct radeon_cs_int *csi = (struct radeon_cs_int *)cs; - return csi->csm->funcs->cs_need_flush(csi); - } - --void radeon_cs_print(struct radeon_cs *cs, FILE *file) -+drm_public void radeon_cs_print(struct radeon_cs *cs, FILE *file) - { - struct radeon_cs_int *csi = (struct radeon_cs_int *)cs; - csi->csm->funcs->cs_print(csi, file); - } - --void radeon_cs_set_limit(struct radeon_cs *cs, uint32_t domain, uint32_t limit) -+drm_public void -+radeon_cs_set_limit(struct radeon_cs *cs, uint32_t domain, uint32_t limit) - { - struct radeon_cs_int *csi = (struct radeon_cs_int *)cs; - if (domain == RADEON_GEM_DOMAIN_VRAM) -@@ -82,14 +83,15 @@ void radeon_cs_set_limit(struct radeon_cs *cs, uint32_t domain, uint32_t limit) - csi->csm->gart_limit = limit; - } - --void radeon_cs_space_set_flush(struct radeon_cs *cs, void (*fn)(void *), void *data) -+drm_public void radeon_cs_space_set_flush(struct radeon_cs *cs, -+ void (*fn)(void *), void *data) - { - struct radeon_cs_int *csi = (struct radeon_cs_int *)cs; - csi->space_flush_fn = fn; - csi->space_flush_data = data; - } - --uint32_t radeon_cs_get_id(struct radeon_cs *cs) -+drm_public uint32_t radeon_cs_get_id(struct radeon_cs *cs) - { - struct radeon_cs_int *csi = (struct radeon_cs_int *)cs; - return csi->id; -diff --git a/radeon/radeon_cs_gem.c b/radeon/radeon_cs_gem.c -index b87c6b1..2020e1a 100644 ---- a/radeon/radeon_cs_gem.c -+++ b/radeon/radeon_cs_gem.c -@@ -29,6 +29,9 @@ - * Nicolai Haehnle - * Jérôme Glisse - */ -+#ifdef HAVE_CONFIG_H -+#include "config.h" -+#endif - #include - #include - #include -@@ -42,6 +45,7 @@ - #include "radeon_cs_gem.h" - #include "radeon_bo_gem.h" - #include "drm.h" -+#include "libdrm.h" - #include "xf86drm.h" - #include "xf86atomic.h" - #include "radeon_drm.h" -@@ -533,7 +537,7 @@ static int radeon_get_device_id(int fd, uint32_t *device_id) - return r; - } - --struct radeon_cs_manager *radeon_cs_manager_gem_ctor(int fd) -+drm_public struct radeon_cs_manager *radeon_cs_manager_gem_ctor(int fd) - { - struct radeon_cs_manager_gem *csm; - -@@ -547,7 +551,7 @@ struct radeon_cs_manager *radeon_cs_manager_gem_ctor(int fd) - return &csm->base; - } - --void radeon_cs_manager_gem_dtor(struct radeon_cs_manager *csm) -+drm_public void radeon_cs_manager_gem_dtor(struct radeon_cs_manager *csm) - { - free(csm); - } -diff --git a/radeon/radeon_cs_space.c b/radeon/radeon_cs_space.c -index be047a7..cca650b 100644 ---- a/radeon/radeon_cs_space.c -+++ b/radeon/radeon_cs_space.c -@@ -25,9 +25,13 @@ - */ - /* - */ -+#ifdef HAVE_CONFIG_H -+#include -+#endif - #include - #include - #include -+#include "libdrm.h" - #include "radeon_cs.h" - #include "radeon_bo_int.h" - #include "radeon_cs_int.h" -@@ -161,7 +165,9 @@ static int radeon_cs_do_space_check(struct radeon_cs_int *cs, struct radeon_cs_s - return RADEON_CS_SPACE_OK; - } - --void radeon_cs_space_add_persistent_bo(struct radeon_cs *cs, struct radeon_bo *bo, uint32_t read_domains, uint32_t write_domain) -+drm_public void -+radeon_cs_space_add_persistent_bo(struct radeon_cs *cs, struct radeon_bo *bo, -+ uint32_t read_domains, uint32_t write_domain) - { - struct radeon_cs_int *csi = (struct radeon_cs_int *)cs; - struct radeon_bo_int *boi = (struct radeon_bo_int *)bo; -@@ -203,9 +209,9 @@ again: - return 0; - } - --int radeon_cs_space_check_with_bo(struct radeon_cs *cs, -- struct radeon_bo *bo, -- uint32_t read_domains, uint32_t write_domain) -+drm_public int -+radeon_cs_space_check_with_bo(struct radeon_cs *cs, struct radeon_bo *bo, -+ uint32_t read_domains, uint32_t write_domain) - { - struct radeon_cs_int *csi = (struct radeon_cs_int *)cs; - struct radeon_bo_int *boi = (struct radeon_bo_int *)bo; -@@ -224,13 +230,13 @@ int radeon_cs_space_check_with_bo(struct radeon_cs *cs, - return ret; - } - --int radeon_cs_space_check(struct radeon_cs *cs) -+drm_public int radeon_cs_space_check(struct radeon_cs *cs) - { - struct radeon_cs_int *csi = (struct radeon_cs_int *)cs; - return radeon_cs_check_space_internal(csi, NULL); - } - --void radeon_cs_space_reset_bos(struct radeon_cs *cs) -+drm_public void radeon_cs_space_reset_bos(struct radeon_cs *cs) - { - struct radeon_cs_int *csi = (struct radeon_cs_int *)cs; - int i; -diff --git a/radeon/radeon_surface.c b/radeon/radeon_surface.c -index 8a1fe7d..e056ed4 100644 ---- a/radeon/radeon_surface.c -+++ b/radeon/radeon_surface.c -@@ -26,6 +26,9 @@ - * Authors: - * Jérôme Glisse - */ -+#ifdef HAVE_CONFIG_H -+#include -+#endif - #include - #include - #include -@@ -35,6 +38,7 @@ - #include - #include - #include "drm.h" -+#include "libdrm.h" - #include "xf86drm.h" - #include "radeon_drm.h" - #include "radeon_surface.h" -@@ -2395,7 +2399,8 @@ static int cik_surface_best(struct radeon_surface_manager *surf_man, - /* =========================================================================== - * public API - */ --struct radeon_surface_manager *radeon_surface_manager_new(int fd) -+drm_public struct radeon_surface_manager * -+radeon_surface_manager_new(int fd) - { - struct radeon_surface_manager *surf_man; - -@@ -2443,7 +2448,8 @@ out_err: - return NULL; - } - --void radeon_surface_manager_free(struct radeon_surface_manager *surf_man) -+drm_public void -+radeon_surface_manager_free(struct radeon_surface_manager *surf_man) - { - free(surf_man); - } -@@ -2515,8 +2521,9 @@ static int radeon_surface_sanity(struct radeon_surface_manager *surf_man, - return 0; - } - --int radeon_surface_init(struct radeon_surface_manager *surf_man, -- struct radeon_surface *surf) -+drm_public int -+radeon_surface_init(struct radeon_surface_manager *surf_man, -+ struct radeon_surface *surf) - { - unsigned mode, type; - int r; -@@ -2531,8 +2538,9 @@ int radeon_surface_init(struct radeon_surface_manager *surf_man, - return surf_man->surface_init(surf_man, surf); - } - --int radeon_surface_best(struct radeon_surface_manager *surf_man, -- struct radeon_surface *surf) -+drm_public int -+radeon_surface_best(struct radeon_surface_manager *surf_man, -+ struct radeon_surface *surf) - { - unsigned mode, type; - int r; diff -Nru libdrm-2.4.56/debian/patches/revert-65041c4a1.diff libdrm-2.4.60/debian/patches/revert-65041c4a1.diff --- libdrm-2.4.56/debian/patches/revert-65041c4a1.diff 1970-01-01 00:00:00.000000000 +0000 +++ libdrm-2.4.60/debian/patches/revert-65041c4a1.diff 2015-05-07 19:02:17.000000000 +0000 @@ -0,0 +1,51 @@ +commit a29ec5af4820285226ab28cb0f2e86a4cab448ce +Author: Timo Aaltonen +Date: Tue Apr 21 08:12:41 2015 +0300 + + Revert "Fix type-limits, pointer-arith and sign-compare warnings" + which breaks ABI. + + This reverts commit 65041c4a19bc6d1cc86f768259b9e0888af0bd5f. + +diff --git a/tests/dristat.c b/tests/dristat.c +index cca4b03..57cecc9 100644 +--- a/tests/dristat.c ++++ b/tests/dristat.c +@@ -190,9 +190,9 @@ static void printhuman(unsigned long value, const char *name, int mult) + static void getstats(int fd, int i) + { + drmStatsT prev, curr; +- unsigned j; ++ int j; + double rate; +- ++ + printf(" System statistics:\n"); + + if (drmGetStats(fd, &prev)) return; +diff --git a/tests/getstats.c b/tests/getstats.c +index 8a7d299..8d40d0b 100644 +--- a/tests/getstats.c ++++ b/tests/getstats.c +@@ -45,6 +45,8 @@ int main(int argc, char **argv) + ret = ioctl(fd, DRM_IOCTL_GET_STATS, &stats); + assert(ret == 0); + ++ assert(stats.count >= 0); ++ + close(fd); + return 0; + } +diff --git a/xf86drmMode.c b/xf86drmMode.c +index 61d5e01..9ea8fe7 100644 +--- a/xf86drmMode.c ++++ b/xf86drmMode.c +@@ -76,7 +76,7 @@ static inline int DRM_IOCTL(int fd, unsigned long cmd, void *arg) + * Util functions + */ + +-static void* drmAllocCpy(char *array, int count, int entry_size) ++void* drmAllocCpy(void *array, int count, int entry_size) + { + char *r; + int i; diff -Nru libdrm-2.4.56/debian/patches/series libdrm-2.4.60/debian/patches/series --- libdrm-2.4.56/debian/patches/series 2015-05-07 19:02:17.000000000 +0000 +++ libdrm-2.4.60/debian/patches/series 2015-05-07 19:02:17.000000000 +0000 @@ -1,2 +1,2 @@ 01_default_perms.diff -03_hide_symbols.diff \ No newline at end of file +revert-65041c4a1.diff diff -Nru libdrm-2.4.56/debian/rules libdrm-2.4.60/debian/rules --- libdrm-2.4.56/debian/rules 2015-05-07 19:02:17.000000000 +0000 +++ libdrm-2.4.60/debian/rules 2015-05-07 19:02:17.000000000 +0000 @@ -45,13 +45,15 @@ ARM = yes endif ifeq ($(ARM), yes) - confflags += --enable-omap-experimental-api - confflags += --enable-freedreno-experimental-api + confflags += --enable-freedreno --enable-freedreno-kgsl confflags += --enable-exynos-experimental-api + confflags += --enable-omap-experimental-api + confflags += --enable-tegra-experimental-api else - confflags += --disable-omap-experimental-api - confflags += --disable-freedreno-experimental-api + confflags += --disable-freedreno confflags += --disable-exynos-experimental-api + confflags += --disable-omap-experimental-api + confflags += --disable-tegra-experimental-api endif ### @@ -84,13 +86,14 @@ dh_strip -plibdrm-omap1 --dbg-package=libdrm-omap1-dbg dh_strip -plibdrm-freedreno1 --dbg-package=libdrm-freedreno1-dbg dh_strip -plibdrm-exynos1 --dbg-package=libdrm-exynos1-dbg + dh_strip -plibdrm-tegra0 --dbg-package=libdrm-tegra0-dbg endif dh_strip -s --remaining-packages override_dh_makeshlibs: dh_makeshlibs -plibdrm2 -V'libdrm2 (>= 2.4.46)' --add-udeb=libdrm2-udeb -- -c4 ifeq ($(INTEL), yes) - dh_makeshlibs -plibdrm-intel1 -V'libdrm-intel1 (>= 2.4.46)' -- -c4 + dh_makeshlibs -plibdrm-intel1 -V'libdrm-intel1 (>= 2.4.57)' -- -c4 endif ifeq ($(NOUVEAU), yes) dh_makeshlibs -plibdrm-nouveau2 -V'libdrm-nouveau2 (>= 2.4.38)' -- -c4 @@ -98,8 +101,9 @@ dh_makeshlibs -plibdrm-radeon1 -V'libdrm-radeon1 (>= 2.4.39)' -- -c4 ifeq ($(ARM), yes) dh_makeshlibs -plibdrm-omap1 -V'libdrm-omap1 (>= 2.4.38)' -- -c4 - dh_makeshlibs -plibdrm-freedreno1 -V'libdrm-freedreno1' -- -c4 + dh_makeshlibs -plibdrm-freedreno1 -V'libdrm-freedreno1 (>= 2.4.57)' -- -c4 dh_makeshlibs -plibdrm-exynos1 -V'libdrm-exynos1' -- -c4 + dh_makeshlibs -plibdrm-tegra0 -V'libdrm-tegra0' -- -c4 endif %: diff -Nru libdrm-2.4.56/exynos/exynos_drm.c libdrm-2.4.60/exynos/exynos_drm.c --- libdrm-2.4.56/exynos/exynos_drm.c 2014-07-25 17:40:07.000000000 +0000 +++ libdrm-2.4.60/exynos/exynos_drm.c 2015-02-28 18:34:25.000000000 +0000 @@ -38,6 +38,7 @@ #include +#include "libdrm.h" #include "exynos_drm.h" #include "exynos_drmif.h" @@ -48,7 +49,7 @@ * * if true, return the device object else NULL. */ -struct exynos_device * exynos_device_create(int fd) +drm_public struct exynos_device * exynos_device_create(int fd) { struct exynos_device *dev; @@ -69,7 +70,7 @@ * * @dev: exynos drm device object. */ -void exynos_device_destroy(struct exynos_device *dev) +drm_public void exynos_device_destroy(struct exynos_device *dev) { free(dev); } @@ -87,8 +88,8 @@ * * if true, return a exynos buffer object else NULL. */ -struct exynos_bo * exynos_bo_create(struct exynos_device *dev, - size_t size, uint32_t flags) +drm_public struct exynos_bo * exynos_bo_create(struct exynos_device *dev, + size_t size, uint32_t flags) { struct exynos_bo *bo; struct drm_exynos_gem_create req = { @@ -141,8 +142,8 @@ * * if true, return 0 else negative. */ -int exynos_bo_get_info(struct exynos_device *dev, uint32_t handle, - size_t *size, uint32_t *flags) +drm_public int exynos_bo_get_info(struct exynos_device *dev, uint32_t handle, + size_t *size, uint32_t *flags) { int ret; struct drm_exynos_gem_info req = { @@ -167,7 +168,7 @@ * * @bo: a exynos buffer object to be destroyed. */ -void exynos_bo_destroy(struct exynos_bo *bo) +drm_public void exynos_bo_destroy(struct exynos_bo *bo) { if (!bo) return; @@ -199,7 +200,8 @@ * if true, return a exynos buffer object else NULL. * */ -struct exynos_bo * exynos_bo_from_name(struct exynos_device *dev, uint32_t name) +drm_public struct exynos_bo * +exynos_bo_from_name(struct exynos_device *dev, uint32_t name) { struct exynos_bo *bo; struct drm_gem_open req = { @@ -241,7 +243,7 @@ * * if true, return 0 else negative. */ -int exynos_bo_get_name(struct exynos_bo *bo, uint32_t *name) +drm_public int exynos_bo_get_name(struct exynos_bo *bo, uint32_t *name) { if (!bo->name) { struct drm_gem_flink req = { @@ -264,7 +266,7 @@ return 0; } -uint32_t exynos_bo_handle(struct exynos_bo *bo) +drm_public uint32_t exynos_bo_handle(struct exynos_bo *bo) { return bo->handle; } @@ -277,24 +279,29 @@ * * if true, user pointer mmaped else NULL. */ -void *exynos_bo_map(struct exynos_bo *bo) +drm_public void *exynos_bo_map(struct exynos_bo *bo) { if (!bo->vaddr) { struct exynos_device *dev = bo->dev; - struct drm_exynos_gem_mmap req = { - .handle = bo->handle, - .size = bo->size, - }; + struct drm_mode_map_dumb arg; + void *map = NULL; int ret; - ret = drmIoctl(dev->fd, DRM_IOCTL_EXYNOS_GEM_MMAP, &req); + memset(&arg, 0, sizeof(arg)); + arg.handle = bo->handle; + + ret = drmIoctl(dev->fd, DRM_IOCTL_MODE_MAP_DUMB, &arg); if (ret) { - fprintf(stderr, "failed to mmap[%s].\n", + fprintf(stderr, "failed to map dumb buffer[%s].\n", strerror(errno)); return NULL; } - bo->vaddr = (void *)(uintptr_t)req.mapped; + map = drm_mmap(0, bo->size, PROT_READ | PROT_WRITE, MAP_SHARED, + dev->fd, arg.offset); + + if (map != MAP_FAILED) + bo->vaddr = map; } return bo->vaddr; @@ -309,8 +316,8 @@ * * @return: 0 on success, -1 on error, and errno will be set */ -int exynos_prime_handle_to_fd(struct exynos_device *dev, uint32_t handle, - int *fd) +drm_public int +exynos_prime_handle_to_fd(struct exynos_device *dev, uint32_t handle, int *fd) { return drmPrimeHandleToFD(dev->fd, handle, 0, fd); } @@ -324,8 +331,8 @@ * * @return: 0 on success, -1 on error, and errno will be set */ -int exynos_prime_fd_to_handle(struct exynos_device *dev, int fd, - uint32_t *handle) +drm_public int +exynos_prime_fd_to_handle(struct exynos_device *dev, int fd, uint32_t *handle) { return drmPrimeFDToHandle(dev->fd, fd, handle); } @@ -347,8 +354,9 @@ * * if true, return 0 else negative. */ -int exynos_vidi_connection(struct exynos_device *dev, uint32_t connect, - uint32_t ext, void *edid) +drm_public int +exynos_vidi_connection(struct exynos_device *dev, uint32_t connect, + uint32_t ext, void *edid) { struct drm_exynos_vidi_connection req = { .connection = connect, diff -Nru libdrm-2.4.56/exynos/exynos_drm.h libdrm-2.4.60/exynos/exynos_drm.h --- libdrm-2.4.56/exynos/exynos_drm.h 2013-08-12 18:00:50.000000000 +0000 +++ libdrm-2.4.60/exynos/exynos_drm.h 2015-02-28 18:34:25.000000000 +0000 @@ -47,38 +47,6 @@ }; /** - * A structure for getting buffer offset. - * - * @handle: a pointer to gem object created. - * @pad: just padding to be 64-bit aligned. - * @offset: relatived offset value of the memory region allocated. - * - this value should be set by user. - */ -struct drm_exynos_gem_map_off { - unsigned int handle; - unsigned int pad; - uint64_t offset; -}; - -/** - * A structure for mapping buffer. - * - * @handle: a handle to gem object created. - * @pad: just padding to be 64-bit aligned. - * @size: memory size to be mapped. - * @mapped: having user virtual address mmaped. - * - this variable would be filled by exynos gem module - * of kernel side with user virtual address which is allocated - * by do_mmap(). - */ -struct drm_exynos_gem_mmap { - unsigned int handle; - unsigned int pad; - uint64_t size; - uint64_t mapped; -}; - -/** * A structure to gem information. * * @handle: a handle to gem object created. @@ -164,8 +132,6 @@ }; #define DRM_EXYNOS_GEM_CREATE 0x00 -#define DRM_EXYNOS_GEM_MAP_OFFSET 0x01 -#define DRM_EXYNOS_GEM_MMAP 0x02 /* Reserved 0x04 ~ 0x05 for exynos specific gem ioctl */ #define DRM_EXYNOS_GEM_GET 0x04 #define DRM_EXYNOS_VIDI_CONNECTION 0x07 @@ -178,12 +144,6 @@ #define DRM_IOCTL_EXYNOS_GEM_CREATE DRM_IOWR(DRM_COMMAND_BASE + \ DRM_EXYNOS_GEM_CREATE, struct drm_exynos_gem_create) -#define DRM_IOCTL_EXYNOS_GEM_MAP_OFFSET DRM_IOWR(DRM_COMMAND_BASE + \ - DRM_EXYNOS_GEM_MAP_OFFSET, struct drm_exynos_gem_map_off) - -#define DRM_IOCTL_EXYNOS_GEM_MMAP DRM_IOWR(DRM_COMMAND_BASE + \ - DRM_EXYNOS_GEM_MMAP, struct drm_exynos_gem_mmap) - #define DRM_IOCTL_EXYNOS_GEM_GET DRM_IOWR(DRM_COMMAND_BASE + \ DRM_EXYNOS_GEM_GET, struct drm_exynos_gem_info) diff -Nru libdrm-2.4.56/exynos/exynos_fimg2d.c libdrm-2.4.60/exynos/exynos_fimg2d.c --- libdrm-2.4.56/exynos/exynos_fimg2d.c 2014-07-26 18:08:30.000000000 +0000 +++ libdrm-2.4.60/exynos/exynos_fimg2d.c 2015-03-18 17:33:36.000000000 +0000 @@ -24,9 +24,10 @@ #include +#include "libdrm.h" #include "exynos_drm.h" #include "fimg2d_reg.h" -#include "fimg2d.h" +#include "exynos_fimg2d.h" #define SET_BF(val, sc, si, scsa, scda, dc, di, dcsa, dcda) \ val.data.src_coeff = sc; \ @@ -40,6 +41,23 @@ #define MIN(a, b) ((a) < (b) ? (a) : (b)) +enum g2d_base_addr_reg { + g2d_dst = 0, + g2d_src +}; + +static unsigned int g2d_get_scaling(unsigned int src, unsigned int dst) +{ + /* + * The G2D hw scaling factor is a normalized inverse of the scaling factor. + * For example: When source width is 100 and destination width is 200 + * (scaling of 2x), then the hw factor is NC * 100 / 200. + * The normalization factor (NC) is 2^16 = 0x10000. + */ + + return ((src << 16) / dst); +} + static unsigned int g2d_get_blend_op(enum e_g2d_op op) { union g2d_blend_func_val val; @@ -69,6 +87,10 @@ SET_BF(val, G2D_COEFF_MODE_ONE, 0, 0, 0, G2D_COEFF_MODE_SRC_ALPHA, 1, 0, 0); break; + case G2D_OP_INTERPOLATE: + SET_BF(val, G2D_COEFF_MODE_SRC_ALPHA, 0, 0, 0, + G2D_COEFF_MODE_SRC_ALPHA, 1, 0, 0); + break; default: fprintf(stderr, "Not support operation(%d).\n", op); SET_BF(val, G2D_COEFF_MODE_ONE, 0, 0, 0, G2D_COEFF_MODE_ZERO, @@ -117,7 +139,27 @@ break; } - return TRUE; + return 0; +} + +/* + * g2d_add_base_addr - helper function to set dst/src base address register. + * + * @ctx: a pointer to g2d_context structure. + * @img: a pointer to the dst/src g2d_image structure. + * @reg: the register that should be set. + */ +static void g2d_add_base_addr(struct g2d_context *ctx, struct g2d_image *img, + enum g2d_base_addr_reg reg) +{ + const unsigned long cmd = (reg == g2d_dst) ? + DST_BASE_ADDR_REG : SRC_BASE_ADDR_REG; + + if (img->buf_type == G2D_IMGBUF_USERPTR) + g2d_add_cmd(ctx, cmd | G2D_BUF_USERPTR, + (unsigned long)&img->user_ptr[0]); + else + g2d_add_cmd(ctx, cmd, img->bo[0]); } /* @@ -135,29 +177,27 @@ } /* - * g2d_flush - summit all commands and values in user side command buffer + * g2d_flush - submit all commands and values in user side command buffer * to command queue aware of fimg2d dma. * * @ctx: a pointer to g2d_context structure. * * This function should be called after all commands and values to user - * side command buffer is set to summit that buffer to kernel side driver. + * side command buffer are set. It submits that buffer to the kernel side driver. */ static int g2d_flush(struct g2d_context *ctx) { int ret; - struct drm_exynos_g2d_set_cmdlist cmdlist; + struct drm_exynos_g2d_set_cmdlist cmdlist = {0}; - if (ctx->cmd_nr == 0 && ctx->cmd_buf_nr == 0) - return FALSE; + if (ctx->cmd_nr == 0 && ctx->cmd_buf_nr == 0) + return -1; if (ctx->cmdlist_nr >= G2D_MAX_CMD_LIST_NR) { fprintf(stderr, "Overflow cmdlist.\n"); return -EINVAL; } - memset(&cmdlist, 0, sizeof(struct drm_exynos_g2d_set_cmdlist)); - cmdlist.cmd = (uint64_t)(uintptr_t)&ctx->cmd[0]; cmdlist.cmd_buf = (uint64_t)(uintptr_t)&ctx->cmd_buf[0]; cmdlist.cmd_nr = ctx->cmd_nr; @@ -182,9 +222,9 @@ /** * g2d_init - create a new g2d context and get hardware version. * - * fd: a file descriptor to drm device driver opened. + * fd: a file descriptor to an opened drm device. */ -struct g2d_context *g2d_init(int fd) +drm_public struct g2d_context *g2d_init(int fd) { struct drm_exynos_g2d_get_ver ver; struct g2d_context *ctx; @@ -212,7 +252,7 @@ return ctx; } -void g2d_fini(struct g2d_context *ctx) +drm_public void g2d_fini(struct g2d_context *ctx) { if (ctx) free(ctx); @@ -223,7 +263,7 @@ * * @ctx: a pointer to g2d_context structure. */ -int g2d_exec(struct g2d_context *ctx) +drm_public int g2d_exec(struct g2d_context *ctx) { struct drm_exynos_g2d_exec exec; int ret; @@ -255,7 +295,8 @@ * @w: width value to buffer filled with given color data. * @h: height value to buffer filled with given color data. */ -int g2d_solid_fill(struct g2d_context *ctx, struct g2d_image *img, +drm_public int +g2d_solid_fill(struct g2d_context *ctx, struct g2d_image *img, unsigned int x, unsigned int y, unsigned int w, unsigned int h) { @@ -264,13 +305,7 @@ g2d_add_cmd(ctx, DST_SELECT_REG, G2D_SELECT_MODE_NORMAL); g2d_add_cmd(ctx, DST_COLOR_MODE_REG, img->color_mode); - - if (img->buf_type == G2D_IMGBUF_USERPTR) - g2d_add_cmd(ctx, DST_BASE_ADDR_REG | G2D_BUF_USERPTR, - (unsigned long)&img->user_ptr[0]); - else - g2d_add_cmd(ctx, DST_BASE_ADDR_REG, img->bo[0]); - + g2d_add_base_addr(ctx, img, g2d_dst); g2d_add_cmd(ctx, DST_STRIDE_REG, img->stride); if (x + w > img->width) @@ -315,7 +350,8 @@ * @w: width value to source and destination buffers. * @h: height value to source and destination buffers. */ -int g2d_copy(struct g2d_context *ctx, struct g2d_image *src, +drm_public int +g2d_copy(struct g2d_context *ctx, struct g2d_image *src, struct g2d_image *dst, unsigned int src_x, unsigned int src_y, unsigned int dst_x, unsigned dst_y, unsigned int w, unsigned int h) @@ -326,22 +362,12 @@ g2d_add_cmd(ctx, DST_SELECT_REG, G2D_SELECT_MODE_BGCOLOR); g2d_add_cmd(ctx, DST_COLOR_MODE_REG, dst->color_mode); - if (dst->buf_type == G2D_IMGBUF_USERPTR) - g2d_add_cmd(ctx, DST_BASE_ADDR_REG | G2D_BUF_USERPTR, - (unsigned long)&dst->user_ptr[0]); - else - g2d_add_cmd(ctx, DST_BASE_ADDR_REG, dst->bo[0]); - + g2d_add_base_addr(ctx, dst, g2d_dst); g2d_add_cmd(ctx, DST_STRIDE_REG, dst->stride); g2d_add_cmd(ctx, SRC_SELECT_REG, G2D_SELECT_MODE_NORMAL); g2d_add_cmd(ctx, SRC_COLOR_MODE_REG, src->color_mode); - if (src->buf_type == G2D_IMGBUF_USERPTR) - g2d_add_cmd(ctx, SRC_BASE_ADDR_REG | G2D_BUF_USERPTR, - (unsigned long)&src->user_ptr[0]); - else - g2d_add_cmd(ctx, SRC_BASE_ADDR_REG, src->bo[0]); - + g2d_add_base_addr(ctx, src, g2d_src); g2d_add_cmd(ctx, SRC_STRIDE_REG, src->stride); src_w = w; @@ -414,7 +440,8 @@ * @negative: indicate that it uses color negative to source and * destination buffers. */ -int g2d_copy_with_scale(struct g2d_context *ctx, struct g2d_image *src, +drm_public int +g2d_copy_with_scale(struct g2d_context *ctx, struct g2d_image *src, struct g2d_image *dst, unsigned int src_x, unsigned int src_y, unsigned int src_w, unsigned int src_h, unsigned int dst_x, @@ -424,34 +451,29 @@ union g2d_rop4_val rop4; union g2d_point_val pt; unsigned int scale; - double scale_x = 0.0f, scale_y = 0.0f; + unsigned int scale_x, scale_y; g2d_add_cmd(ctx, DST_SELECT_REG, G2D_SELECT_MODE_BGCOLOR); g2d_add_cmd(ctx, DST_COLOR_MODE_REG, dst->color_mode); - if (dst->buf_type == G2D_IMGBUF_USERPTR) - g2d_add_cmd(ctx, DST_BASE_ADDR_REG | G2D_BUF_USERPTR, - (unsigned long)&dst->user_ptr[0]); - else - g2d_add_cmd(ctx, DST_BASE_ADDR_REG, dst->bo[0]); - + g2d_add_base_addr(ctx, dst, g2d_dst); g2d_add_cmd(ctx, DST_STRIDE_REG, dst->stride); g2d_add_cmd(ctx, SRC_SELECT_REG, G2D_SELECT_MODE_NORMAL); g2d_add_cmd(ctx, SRC_COLOR_MODE_REG, src->color_mode); - if (src->buf_type == G2D_IMGBUF_USERPTR) - g2d_add_cmd(ctx, SRC_BASE_ADDR_REG | G2D_BUF_USERPTR, - (unsigned long)&src->user_ptr[0]); - else - g2d_add_cmd(ctx, SRC_BASE_ADDR_REG, src->bo[0]); + g2d_add_cmd(ctx, SRC_REPEAT_MODE_REG, src->repeat_mode); + if (src->repeat_mode == G2D_REPEAT_MODE_PAD) + g2d_add_cmd(ctx, SRC_PAD_VALUE_REG, dst->color); + + g2d_add_base_addr(ctx, src, g2d_src); g2d_add_cmd(ctx, SRC_STRIDE_REG, src->stride); if (src_w == dst_w && src_h == dst_h) scale = 0; else { scale = 1; - scale_x = (double)src_w / (double)dst_w; - scale_y = (double)src_h / (double)dst_h; + scale_x = g2d_get_scaling(src_w, dst_w); + scale_y = g2d_get_scaling(src_h, dst_h); } if (src_x + src_w > src->width) @@ -483,8 +505,8 @@ if (scale) { g2d_add_cmd(ctx, SRC_SCALE_CTRL_REG, G2D_SCALE_MODE_BILINEAR); - g2d_add_cmd(ctx, SRC_XSCALE_REG, G2D_DOUBLE_TO_FIXED(scale_x)); - g2d_add_cmd(ctx, SRC_YSCALE_REG, G2D_DOUBLE_TO_FIXED(scale_y)); + g2d_add_cmd(ctx, SRC_XSCALE_REG, scale_x); + g2d_add_cmd(ctx, SRC_YSCALE_REG, scale_y); } pt.val = 0; @@ -511,7 +533,7 @@ } /** - * g2d_blend - blend image data in source and destion buffers + * g2d_blend - blend image data in source and destination buffers. * * @ctx: a pointer to g2d_context structure. * @src: a pointer to g2d_image structure including image and buffer @@ -526,7 +548,8 @@ * @h: height value to source and destination buffer. * @op: blend operation type. */ -int g2d_blend(struct g2d_context *ctx, struct g2d_image *src, +drm_public int +g2d_blend(struct g2d_context *ctx, struct g2d_image *src, struct g2d_image *dst, unsigned int src_x, unsigned int src_y, unsigned int dst_x, unsigned int dst_y, unsigned int w, unsigned int h, enum e_g2d_op op) @@ -545,12 +568,7 @@ g2d_add_cmd(ctx, DST_SELECT_REG, G2D_SELECT_MODE_NORMAL); g2d_add_cmd(ctx, DST_COLOR_MODE_REG, dst->color_mode); - if (dst->buf_type == G2D_IMGBUF_USERPTR) - g2d_add_cmd(ctx, DST_BASE_ADDR_REG | G2D_BUF_USERPTR, - (unsigned long)&dst->user_ptr[0]); - else - g2d_add_cmd(ctx, DST_BASE_ADDR_REG, dst->bo[0]); - + g2d_add_base_addr(ctx, dst, g2d_dst); g2d_add_cmd(ctx, DST_STRIDE_REG, dst->stride); g2d_add_cmd(ctx, SRC_SELECT_REG, src->select_mode); @@ -558,12 +576,7 @@ switch (src->select_mode) { case G2D_SELECT_MODE_NORMAL: - if (src->buf_type == G2D_IMGBUF_USERPTR) - g2d_add_cmd(ctx, SRC_BASE_ADDR_REG | G2D_BUF_USERPTR, - (unsigned long)&src->user_ptr[0]); - else - g2d_add_cmd(ctx, SRC_BASE_ADDR_REG, src->bo[0]); - + g2d_add_base_addr(ctx, src, g2d_src); g2d_add_cmd(ctx, SRC_STRIDE_REG, src->stride); break; case G2D_SELECT_MODE_FGCOLOR: @@ -628,3 +641,132 @@ return 0; } +/** + * g2d_scale_and_blend - apply scaling to source buffer and then blend to destination buffer + * + * @ctx: a pointer to g2d_context structure. + * @src: a pointer to g2d_image structure including image and buffer + * information to source. + * @dst: a pointer to g2d_image structure including image and buffer + * information to destination. + * @src_x: x start position to source buffer. + * @src_y: y start position to source buffer. + * @src_w: width value to source buffer. + * @src_h: height value to source buffer. + * @dst_x: x start position to destination buffer. + * @dst_y: y start position to destination buffer. + * @dst_w: width value to destination buffer. + * @dst_h: height value to destination buffer. + * @op: blend operation type. + */ +drm_public int +g2d_scale_and_blend(struct g2d_context *ctx, struct g2d_image *src, + struct g2d_image *dst, unsigned int src_x, unsigned int src_y, + unsigned int src_w, unsigned int src_h, unsigned int dst_x, + unsigned int dst_y, unsigned int dst_w, unsigned int dst_h, + enum e_g2d_op op) +{ + union g2d_point_val pt; + union g2d_bitblt_cmd_val bitblt; + union g2d_blend_func_val blend; + unsigned int scale; + unsigned int scale_x, scale_y; + + bitblt.val = 0; + blend.val = 0; + + if (op == G2D_OP_SRC || op == G2D_OP_CLEAR) + g2d_add_cmd(ctx, DST_SELECT_REG, G2D_SELECT_MODE_BGCOLOR); + else + g2d_add_cmd(ctx, DST_SELECT_REG, G2D_SELECT_MODE_NORMAL); + + g2d_add_cmd(ctx, DST_COLOR_MODE_REG, dst->color_mode); + if (dst->buf_type == G2D_IMGBUF_USERPTR) + g2d_add_cmd(ctx, DST_BASE_ADDR_REG | G2D_BUF_USERPTR, + (unsigned long)&dst->user_ptr[0]); + else + g2d_add_cmd(ctx, DST_BASE_ADDR_REG, dst->bo[0]); + + g2d_add_cmd(ctx, DST_STRIDE_REG, dst->stride); + + g2d_add_cmd(ctx, SRC_SELECT_REG, src->select_mode); + g2d_add_cmd(ctx, SRC_COLOR_MODE_REG, src->color_mode); + + switch (src->select_mode) { + case G2D_SELECT_MODE_NORMAL: + if (src->buf_type == G2D_IMGBUF_USERPTR) + g2d_add_cmd(ctx, SRC_BASE_ADDR_REG | G2D_BUF_USERPTR, + (unsigned long)&src->user_ptr[0]); + else + g2d_add_cmd(ctx, SRC_BASE_ADDR_REG, src->bo[0]); + + g2d_add_cmd(ctx, SRC_STRIDE_REG, src->stride); + break; + case G2D_SELECT_MODE_FGCOLOR: + g2d_add_cmd(ctx, FG_COLOR_REG, src->color); + break; + case G2D_SELECT_MODE_BGCOLOR: + g2d_add_cmd(ctx, BG_COLOR_REG, src->color); + break; + default: + fprintf(stderr , "failed to set src.\n"); + return -EINVAL; + } + + if (src_w == dst_w && src_h == dst_h) + scale = 0; + else { + scale = 1; + scale_x = g2d_get_scaling(src_w, dst_w); + scale_y = g2d_get_scaling(src_h, dst_h); + } + + if (src_x + src_w > src->width) + src_w = src->width - src_x; + if (src_y + src_h > src->height) + src_h = src->height - src_y; + + if (dst_x + dst_w > dst->width) + dst_w = dst->width - dst_x; + if (dst_y + dst_h > dst->height) + dst_h = dst->height - dst_y; + + if (src_w <= 0 || src_h <= 0 || dst_w <= 0 || dst_h <= 0) { + fprintf(stderr, "invalid width or height.\n"); + g2d_reset(ctx); + return -EINVAL; + } + + if (scale) { + g2d_add_cmd(ctx, SRC_SCALE_CTRL_REG, G2D_SCALE_MODE_BILINEAR); + g2d_add_cmd(ctx, SRC_XSCALE_REG, scale_x); + g2d_add_cmd(ctx, SRC_YSCALE_REG, scale_y); + } + + bitblt.data.alpha_blend_mode = G2D_ALPHA_BLEND_MODE_ENABLE; + blend.val = g2d_get_blend_op(op); + g2d_add_cmd(ctx, BITBLT_COMMAND_REG, bitblt.val); + g2d_add_cmd(ctx, BLEND_FUNCTION_REG, blend.val); + + pt.val = 0; + pt.data.x = src_x; + pt.data.y = src_y; + g2d_add_cmd(ctx, SRC_LEFT_TOP_REG, pt.val); + pt.val = 0; + pt.data.x = src_x + src_w; + pt.data.y = src_y + src_h; + g2d_add_cmd(ctx, SRC_RIGHT_BOTTOM_REG, pt.val); + + pt.val = 0; + pt.data.x = dst_x; + pt.data.y = dst_y; + g2d_add_cmd(ctx, DST_LEFT_TOP_REG, pt.val); + pt.val = 0; + pt.data.x = dst_x + dst_w; + pt.data.y = dst_y + dst_h; + g2d_add_cmd(ctx, DST_RIGHT_BOTTOM_REG, pt.val); + + g2d_flush(ctx); + + return 0; +} diff -Nru libdrm-2.4.56/exynos/exynos_fimg2d.h libdrm-2.4.60/exynos/exynos_fimg2d.h --- libdrm-2.4.56/exynos/exynos_fimg2d.h 1970-01-01 00:00:00.000000000 +0000 +++ libdrm-2.4.60/exynos/exynos_fimg2d.h 2015-03-18 17:33:36.000000000 +0000 @@ -0,0 +1,328 @@ +/* + * Copyright (C) 2013 Samsung Electronics Co.Ltd + * Authors: + * Inki Dae + * + * 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. + * + */ + +#ifndef _FIMG2D_H_ +#define _FIMG2D_H_ + +#define G2D_MAX_CMD_NR 64 +#define G2D_MAX_GEM_CMD_NR 64 +#define G2D_MAX_CMD_LIST_NR 64 +#define G2D_PLANE_MAX_NR 2 + +enum e_g2d_color_mode { + /* COLOR FORMAT */ + G2D_COLOR_FMT_XRGB8888, + G2D_COLOR_FMT_ARGB8888, + G2D_COLOR_FMT_RGB565, + G2D_COLOR_FMT_XRGB1555, + G2D_COLOR_FMT_ARGB1555, + G2D_COLOR_FMT_XRGB4444, + G2D_COLOR_FMT_ARGB4444, + G2D_COLOR_FMT_PRGB888, + G2D_COLOR_FMT_YCbCr444, + G2D_COLOR_FMT_YCbCr422, + G2D_COLOR_FMT_YCbCr420, + /* alpha 8bit */ + G2D_COLOR_FMT_A8, + /* Luminance 8bit: gray color */ + G2D_COLOR_FMT_L8, + /* alpha 1bit */ + G2D_COLOR_FMT_A1, + /* alpha 4bit */ + G2D_COLOR_FMT_A4, + G2D_COLOR_FMT_MASK, /* VER4.1 */ + + /* COLOR ORDER */ + G2D_ORDER_AXRGB = (0 << 4), /* VER4.1 */ + G2D_ORDER_RGBAX = (1 << 4), /* VER4.1 */ + G2D_ORDER_AXBGR = (2 << 4), /* VER4.1 */ + G2D_ORDER_BGRAX = (3 << 4), /* VER4.1 */ + G2D_ORDER_MASK = (3 << 4), /* VER4.1 */ + + /* Number of YCbCr plane */ + G2D_YCbCr_1PLANE = (0 << 8), /* VER4.1 */ + G2D_YCbCr_2PLANE = (1 << 8), /* VER4.1 */ + G2D_YCbCr_PLANE_MASK = (3 << 8), /* VER4.1 */ + + /* Order in YCbCr */ + G2D_YCbCr_ORDER_CrY1CbY0 = (0 << 12), /* VER4.1 */ + G2D_YCbCr_ORDER_CbY1CrY0 = (1 << 12), /* VER4.1 */ + G2D_YCbCr_ORDER_Y1CrY0Cb = (2 << 12), /* VER4.1 */ + G2D_YCbCr_ORDER_Y1CbY0Cr = (3 << 12), /* VER4.1 */ + G2D_YCbCr_ORDER_CrCb = G2D_YCbCr_ORDER_CrY1CbY0, /* VER4.1 */ + G2D_YCbCr_ORDER_CbCr = G2D_YCbCr_ORDER_CbY1CrY0, /* VER4.1 */ + G2D_YCbCr_ORDER_MASK = (3 < 12), /* VER4.1 */ + + /* CSC */ + G2D_CSC_601 = (0 << 16), /* VER4.1 */ + G2D_CSC_709 = (1 << 16), /* VER4.1 */ + G2D_CSC_MASK = (1 << 16), /* VER4.1 */ + + /* Valid value range of YCbCr */ + G2D_YCbCr_RANGE_NARROW = (0 << 17), /* VER4.1 */ + G2D_YCbCr_RANGE_WIDE = (1 << 17), /* VER4.1 */ + G2D_YCbCr_RANGE_MASK = (1 << 17), /* VER4.1 */ + + G2D_COLOR_MODE_MASK = 0xFFFFFFFF, +}; + +enum e_g2d_select_mode { + G2D_SELECT_MODE_NORMAL = (0 << 0), + G2D_SELECT_MODE_FGCOLOR = (1 << 0), + G2D_SELECT_MODE_BGCOLOR = (2 << 0), +}; + +enum e_g2d_repeat_mode { + G2D_REPEAT_MODE_REPEAT, + G2D_REPEAT_MODE_PAD, + G2D_REPEAT_MODE_REFLECT, + G2D_REPEAT_MODE_CLAMP, + G2D_REPEAT_MODE_NONE, +}; + +enum e_g2d_scale_mode { + G2D_SCALE_MODE_NONE = 0, + G2D_SCALE_MODE_NEAREST, + G2D_SCALE_MODE_BILINEAR, + G2D_SCALE_MODE_MAX, +}; + +enum e_g2d_buf_type { + G2D_IMGBUF_COLOR, + G2D_IMGBUF_GEM, + G2D_IMGBUF_USERPTR, +}; + +enum e_g2d_rop3_type { + G2D_ROP3_DST = 0xAA, + G2D_ROP3_SRC = 0xCC, + G2D_ROP3_3RD = 0xF0, + G2D_ROP3_MASK = 0xFF, +}; + +enum e_g2d_select_alpha_src { + G2D_SELECT_SRC_FOR_ALPHA_BLEND, /* VER4.1 */ + G2D_SELECT_ROP_FOR_ALPHA_BLEND, /* VER4.1 */ +}; + +enum e_g2d_transparent_mode { + G2D_TRANSPARENT_MODE_OPAQUE, + G2D_TRANSPARENT_MODE_TRANSPARENT, + G2D_TRANSPARENT_MODE_BLUESCREEN, + G2D_TRANSPARENT_MODE_MAX, +}; + +enum e_g2d_color_key_mode { + G2D_COLORKEY_MODE_DISABLE = 0, + G2D_COLORKEY_MODE_SRC_RGBA = (1<<0), + G2D_COLORKEY_MODE_DST_RGBA = (1<<1), + G2D_COLORKEY_MODE_SRC_YCbCr = (1<<2), /* VER4.1 */ + G2D_COLORKEY_MODE_DST_YCbCr = (1<<3), /* VER4.1 */ + G2D_COLORKEY_MODE_MASK = 15, +}; + +enum e_g2d_alpha_blend_mode { + G2D_ALPHA_BLEND_MODE_DISABLE, + G2D_ALPHA_BLEND_MODE_ENABLE, + G2D_ALPHA_BLEND_MODE_FADING, /* VER3.0 */ + G2D_ALPHA_BLEND_MODE_MAX, +}; + +enum e_g2d_op { + G2D_OP_CLEAR = 0x00, + G2D_OP_SRC = 0x01, + G2D_OP_DST = 0x02, + G2D_OP_OVER = 0x03, + G2D_OP_INTERPOLATE = 0x04, + G2D_OP_DISJOINT_CLEAR = 0x10, + G2D_OP_DISJOINT_SRC = 0x11, + G2D_OP_DISJOINT_DST = 0x12, + G2D_OP_CONJOINT_CLEAR = 0x20, + G2D_OP_CONJOINT_SRC = 0x21, + G2D_OP_CONJOINT_DST = 0x22, +}; + +/* + * The G2D_COEFF_MODE_DST_{COLOR,ALPHA} modes both use the ALPHA_REG(0x618) + * register. The registers fields are as follows: + * bits 31:8 = color value (RGB order) + * bits 7:0 = alpha value + */ +enum e_g2d_coeff_mode { + G2D_COEFF_MODE_ONE, + G2D_COEFF_MODE_ZERO, + G2D_COEFF_MODE_SRC_ALPHA, + G2D_COEFF_MODE_SRC_COLOR, + G2D_COEFF_MODE_DST_ALPHA, + G2D_COEFF_MODE_DST_COLOR, + /* Global Alpha : Set by ALPHA_REG(0x618) */ + G2D_COEFF_MODE_GB_ALPHA, + /* Global Color and Alpha : Set by ALPHA_REG(0x618) */ + G2D_COEFF_MODE_GB_COLOR, + /* (1-SRC alpha)/DST Alpha */ + G2D_COEFF_MODE_DISJOINT_S, + /* (1-DST alpha)/SRC Alpha */ + G2D_COEFF_MODE_DISJOINT_D, + /* SRC alpha/DST alpha */ + G2D_COEFF_MODE_CONJOINT_S, + /* DST alpha/SRC alpha */ + G2D_COEFF_MODE_CONJOINT_D, + /* DST alpha/SRC alpha */ + G2D_COEFF_MODE_MASK +}; + +enum e_g2d_acoeff_mode { + G2D_ACOEFF_MODE_A, /* alpha */ + G2D_ACOEFF_MODE_APGA, /* alpha + global alpha */ + G2D_ACOEFF_MODE_AMGA, /* alpha * global alpha */ + G2D_ACOEFF_MODE_MASK +}; + +union g2d_point_val { + unsigned int val; + struct { + /* + * Coordinate of Source Image + * Range: 0 ~ 8000 (Requirement: SrcLeftX < SrcRightX) + * In YCbCr 422 and YCbCr 420 format with even number. + */ + unsigned int x:16; + /* + * Y Coordinate of Source Image + * Range: 0 ~ 8000 (Requirement: SrcTopY < SrcBottomY) + * In YCbCr 420 format with even number. + */ + unsigned int y:16; + } data; +}; + +union g2d_rop4_val { + unsigned int val; + struct { + enum e_g2d_rop3_type unmasked_rop3:8; + enum e_g2d_rop3_type masked_rop3:8; + unsigned int reserved:16; + } data; +}; + +union g2d_bitblt_cmd_val { + unsigned int val; + struct { + /* [0:3] */ + unsigned int mask_rop4_en:1; + unsigned int masking_en:1; + enum e_g2d_select_alpha_src rop4_alpha_en:1; + unsigned int dither_en:1; + /* [4:7] */ + unsigned int resolved1:4; + /* [8:11] */ + unsigned int cw_en:4; + /* [12:15] */ + enum e_g2d_transparent_mode transparent_mode:4; + /* [16:19] */ + enum e_g2d_color_key_mode color_key_mode:4; + /* [20:23] */ + enum e_g2d_alpha_blend_mode alpha_blend_mode:4; + /* [24:27] */ + unsigned int src_pre_multiply:1; + unsigned int pat_pre_multiply:1; + unsigned int dst_pre_multiply:1; + unsigned int dst_depre_multiply:1; + /* [28:31] */ + unsigned int fast_solid_color_fill_en:1; + unsigned int reserved:3; + } data; +}; + +union g2d_blend_func_val { + unsigned int val; + struct { + /* [0:15] */ + enum e_g2d_coeff_mode src_coeff:4; + enum e_g2d_acoeff_mode src_coeff_src_a:2; + enum e_g2d_acoeff_mode src_coeff_dst_a:2; + enum e_g2d_coeff_mode dst_coeff:4; + enum e_g2d_acoeff_mode dst_coeff_src_a:2; + enum e_g2d_acoeff_mode dst_coeff_dst_a:2; + /* [16:19] */ + unsigned int inv_src_color_coeff:1; + unsigned int resoled1:1; + unsigned int inv_dst_color_coeff:1; + unsigned int resoled2:1; + /* [20:23] */ + unsigned int lighten_en:1; + unsigned int darken_en:1; + unsigned int win_ce_src_over_en:2; + /* [24:31] */ + unsigned int reserved:8; + } data; +}; + +struct g2d_image { + enum e_g2d_select_mode select_mode; + enum e_g2d_color_mode color_mode; + enum e_g2d_repeat_mode repeat_mode; + enum e_g2d_scale_mode scale_mode; + unsigned int xscale; + unsigned int yscale; + unsigned char rotate_90; + unsigned char x_dir; + unsigned char y_dir; + unsigned char component_alpha; + unsigned int width; + unsigned int height; + unsigned int stride; + unsigned int need_free; + unsigned int color; + enum e_g2d_buf_type buf_type; + unsigned int bo[G2D_PLANE_MAX_NR]; + struct drm_exynos_g2d_userptr user_ptr[G2D_PLANE_MAX_NR]; + void *mapped_ptr[G2D_PLANE_MAX_NR]; +}; + +struct g2d_context { + int fd; + unsigned int major; + unsigned int minor; + struct drm_exynos_g2d_cmd cmd[G2D_MAX_CMD_NR]; + struct drm_exynos_g2d_cmd cmd_buf[G2D_MAX_GEM_CMD_NR]; + unsigned int cmd_nr; + unsigned int cmd_buf_nr; + unsigned int cmdlist_nr; +}; + +struct g2d_context *g2d_init(int fd); +void g2d_fini(struct g2d_context *ctx); +int g2d_exec(struct g2d_context *ctx); +int g2d_solid_fill(struct g2d_context *ctx, struct g2d_image *img, + unsigned int x, unsigned int y, unsigned int w, + unsigned int h); +int g2d_copy(struct g2d_context *ctx, struct g2d_image *src, + struct g2d_image *dst, unsigned int src_x, + unsigned int src_y, unsigned int dst_x, unsigned int dst_y, + unsigned int w, unsigned int h); +int g2d_copy_with_scale(struct g2d_context *ctx, struct g2d_image *src, + struct g2d_image *dst, unsigned int src_x, + unsigned int src_y, unsigned int src_w, + unsigned int src_h, unsigned int dst_x, + unsigned int dst_y, unsigned int dst_w, + unsigned int dst_h, unsigned int negative); +int g2d_blend(struct g2d_context *ctx, struct g2d_image *src, + struct g2d_image *dst, unsigned int src_x, + unsigned int src_y, unsigned int dst_x, unsigned int dst_y, + unsigned int w, unsigned int h, enum e_g2d_op op); +int g2d_scale_and_blend(struct g2d_context *ctx, struct g2d_image *src, + struct g2d_image *dst, unsigned int src_x, unsigned int src_y, + unsigned int src_w, unsigned int src_h, unsigned int dst_x, + unsigned int dst_y, unsigned int dst_w, unsigned int dst_h, + enum e_g2d_op op); +#endif /* _FIMG2D_H_ */ diff -Nru libdrm-2.4.56/exynos/fimg2d.h libdrm-2.4.60/exynos/fimg2d.h --- libdrm-2.4.56/exynos/fimg2d.h 2014-07-26 18:08:30.000000000 +0000 +++ libdrm-2.4.60/exynos/fimg2d.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,325 +0,0 @@ -/* - * Copyright (C) 2013 Samsung Electronics Co.Ltd - * Authors: - * Inki Dae - * - * 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. - * - */ - -#ifndef _FIMG2D_H_ -#define _FIMG2D_H_ - -#ifndef TRUE -#define TRUE 0 -#endif -#ifndef FALSE -#define FALSE -1 -#endif - -#define G2D_MAX_CMD_NR 64 -#define G2D_MAX_GEM_CMD_NR 64 -#define G2D_MAX_CMD_LIST_NR 64 -#define G2D_PLANE_MAX_NR 2 - -#define G2D_DOUBLE_TO_FIXED(d) ((unsigned int)((d) * 65536.0)) - -enum e_g2d_color_mode { - /* COLOR FORMAT */ - G2D_COLOR_FMT_XRGB8888, - G2D_COLOR_FMT_ARGB8888, - G2D_COLOR_FMT_RGB565, - G2D_COLOR_FMT_XRGB1555, - G2D_COLOR_FMT_ARGB1555, - G2D_COLOR_FMT_XRGB4444, - G2D_COLOR_FMT_ARGB4444, - G2D_COLOR_FMT_PRGB888, - G2D_COLOR_FMT_YCbCr444, - G2D_COLOR_FMT_YCbCr422, - G2D_COLOR_FMT_YCbCr420, - /* alpha 8bit */ - G2D_COLOR_FMT_A8, - /* Luminance 8bit: gray color */ - G2D_COLOR_FMT_L8, - /* alpha 1bit */ - G2D_COLOR_FMT_A1, - /* alpha 4bit */ - G2D_COLOR_FMT_A4, - G2D_COLOR_FMT_MASK, /* VER4.1 */ - - /* COLOR ORDER */ - G2D_ORDER_AXRGB = (0 << 4), /* VER4.1 */ - G2D_ORDER_RGBAX = (1 << 4), /* VER4.1 */ - G2D_ORDER_AXBGR = (2 << 4), /* VER4.1 */ - G2D_ORDER_BGRAX = (3 << 4), /* VER4.1 */ - G2D_ORDER_MASK = (3 << 4), /* VER4.1 */ - - /* Number of YCbCr plane */ - G2D_YCbCr_1PLANE = (0 << 8), /* VER4.1 */ - G2D_YCbCr_2PLANE = (1 << 8), /* VER4.1 */ - G2D_YCbCr_PLANE_MASK = (3 << 8), /* VER4.1 */ - - /* Order in YCbCr */ - G2D_YCbCr_ORDER_CrY1CbY0 = (0 << 12), /* VER4.1 */ - G2D_YCbCr_ORDER_CbY1CrY0 = (1 << 12), /* VER4.1 */ - G2D_YCbCr_ORDER_Y1CrY0Cb = (2 << 12), /* VER4.1 */ - G2D_YCbCr_ORDER_Y1CbY0Cr = (3 << 12), /* VER4.1 */ - G2D_YCbCr_ORDER_CrCb = G2D_YCbCr_ORDER_CrY1CbY0, /* VER4.1 */ - G2D_YCbCr_ORDER_CbCr = G2D_YCbCr_ORDER_CbY1CrY0, /* VER4.1 */ - G2D_YCbCr_ORDER_MASK = (3 < 12), /* VER4.1 */ - - /* CSC */ - G2D_CSC_601 = (0 << 16), /* VER4.1 */ - G2D_CSC_709 = (1 << 16), /* VER4.1 */ - G2D_CSC_MASK = (1 << 16), /* VER4.1 */ - - /* Valid value range of YCbCr */ - G2D_YCbCr_RANGE_NARROW = (0 << 17), /* VER4.1 */ - G2D_YCbCr_RANGE_WIDE = (1 << 17), /* VER4.1 */ - G2D_YCbCr_RANGE_MASK = (1 << 17), /* VER4.1 */ - - G2D_COLOR_MODE_MASK = 0xFFFFFFFF, -}; - -enum e_g2d_select_mode { - G2D_SELECT_MODE_NORMAL = (0 << 0), - G2D_SELECT_MODE_FGCOLOR = (1 << 0), - G2D_SELECT_MODE_BGCOLOR = (2 << 0), -}; - -enum e_g2d_repeat_mode { - G2D_REPEAT_MODE_REPEAT, - G2D_REPEAT_MODE_PAD, - G2D_REPEAT_MODE_REFLECT, - G2D_REPEAT_MODE_CLAMP, - G2D_REPEAT_MODE_NONE, -}; - -enum e_g2d_scale_mode { - G2D_SCALE_MODE_NONE = 0, - G2D_SCALE_MODE_NEAREST, - G2D_SCALE_MODE_BILINEAR, - G2D_SCALE_MODE_MAX, -}; - -enum e_g2d_buf_type { - G2D_IMGBUF_COLOR, - G2D_IMGBUF_GEM, - G2D_IMGBUF_USERPTR, -}; - -enum e_g2d_rop3_type { - G2D_ROP3_DST = 0xAA, - G2D_ROP3_SRC = 0xCC, - G2D_ROP3_3RD = 0xF0, - G2D_ROP3_MASK = 0xFF, -}; - -enum e_g2d_select_alpha_src { - G2D_SELECT_SRC_FOR_ALPHA_BLEND, /* VER4.1 */ - G2D_SELECT_ROP_FOR_ALPHA_BLEND, /* VER4.1 */ -}; - -enum e_g2d_transparent_mode { - G2D_TRANSPARENT_MODE_OPAQUE, - G2D_TRANSPARENT_MODE_TRANSPARENT, - G2D_TRANSPARENT_MODE_BLUESCREEN, - G2D_TRANSPARENT_MODE_MAX, -}; - -enum e_g2d_color_key_mode { - G2D_COLORKEY_MODE_DISABLE = 0, - G2D_COLORKEY_MODE_SRC_RGBA = (1<<0), - G2D_COLORKEY_MODE_DST_RGBA = (1<<1), - G2D_COLORKEY_MODE_SRC_YCbCr = (1<<2), /* VER4.1 */ - G2D_COLORKEY_MODE_DST_YCbCr = (1<<3), /* VER4.1 */ - G2D_COLORKEY_MODE_MASK = 15, -}; - -enum e_g2d_alpha_blend_mode { - G2D_ALPHA_BLEND_MODE_DISABLE, - G2D_ALPHA_BLEND_MODE_ENABLE, - G2D_ALPHA_BLEND_MODE_FADING, /* VER3.0 */ - G2D_ALPHA_BLEND_MODE_MAX, -}; - -enum e_g2d_op { - G2D_OP_CLEAR = 0x00, - G2D_OP_SRC = 0x01, - G2D_OP_DST = 0x02, - G2D_OP_OVER = 0x03, - G2D_OP_DISJOINT_CLEAR = 0x10, - G2D_OP_DISJOINT_SRC = 0x11, - G2D_OP_DISJOINT_DST = 0x12, - G2D_OP_CONJOINT_CLEAR = 0x20, - G2D_OP_CONJOINT_SRC = 0x21, - G2D_OP_CONJOINT_DST = 0x22, -}; - -enum e_g2d_coeff_mode { - G2D_COEFF_MODE_ONE, - G2D_COEFF_MODE_ZERO, - G2D_COEFF_MODE_SRC_ALPHA, - G2D_COEFF_MODE_SRC_COLOR, - G2D_COEFF_MODE_DST_ALPHA, - G2D_COEFF_MODE_DST_COLOR, - /* Global Alpha : Set by ALPHA_REG(0x618) */ - G2D_COEFF_MODE_GB_ALPHA, - /* Global Alpha : Set by ALPHA_REG(0x618) */ - G2D_COEFF_MODE_GB_COLOR, - /* (1-SRC alpha)/DST Alpha */ - G2D_COEFF_MODE_DISJOINT_S, - /* (1-DST alpha)/SRC Alpha */ - G2D_COEFF_MODE_DISJOINT_D, - /* SRC alpha/DST alpha */ - G2D_COEFF_MODE_CONJOINT_S, - /* DST alpha/SRC alpha */ - G2D_COEFF_MODE_CONJOINT_D, - /* DST alpha/SRC alpha */ - G2D_COEFF_MODE_MASK -}; - -enum e_g2d_acoeff_mode { - G2D_ACOEFF_MODE_A, /* alpha */ - G2D_ACOEFF_MODE_APGA, /* alpha + global alpha */ - G2D_ACOEFF_MODE_AMGA, /* alpha * global alpha */ - G2D_ACOEFF_MODE_MASK -}; - -union g2d_point_val { - unsigned int val; - struct { - /* - * Coordinate of Source Image - * Range: 0 ~ 8000 (Requirement: SrcLeftX < SrcRightX) - * In YCbCr 422 and YCbCr 420 format with even number. - */ - unsigned int x:16; - /* - * Y Coordinate of Source Image - * Range: 0 ~ 8000 (Requirement: SrcTopY < SrcBottomY) - * In YCbCr 420 format with even number. - */ - unsigned int y:16; - } data; -}; - -union g2d_rop4_val { - unsigned int val; - struct { - enum e_g2d_rop3_type unmasked_rop3:8; - enum e_g2d_rop3_type masked_rop3:8; - unsigned int reserved:16; - } data; -}; - -union g2d_bitblt_cmd_val { - unsigned int val; - struct { - /* [0:3] */ - unsigned int mask_rop4_en:1; - unsigned int masking_en:1; - enum e_g2d_select_alpha_src rop4_alpha_en:1; - unsigned int dither_en:1; - /* [4:7] */ - unsigned int resolved1:4; - /* [8:11] */ - unsigned int cw_en:4; - /* [12:15] */ - enum e_g2d_transparent_mode transparent_mode:4; - /* [16:19] */ - enum e_g2d_color_key_mode color_key_mode:4; - /* [20:23] */ - enum e_g2d_alpha_blend_mode alpha_blend_mode:4; - /* [24:27] */ - unsigned int src_pre_multiply:1; - unsigned int pat_pre_multiply:1; - unsigned int dst_pre_multiply:1; - unsigned int dst_depre_multiply:1; - /* [28:31] */ - unsigned int fast_solid_color_fill_en:1; - unsigned int reserved:3; - } data; -}; - -union g2d_blend_func_val { - unsigned int val; - struct { - /* [0:15] */ - enum e_g2d_coeff_mode src_coeff:4; - enum e_g2d_acoeff_mode src_coeff_src_a:2; - enum e_g2d_acoeff_mode src_coeff_dst_a:2; - enum e_g2d_coeff_mode dst_coeff:4; - enum e_g2d_acoeff_mode dst_coeff_src_a:2; - enum e_g2d_acoeff_mode dst_coeff_dst_a:2; - /* [16:19] */ - unsigned int inv_src_color_coeff:1; - unsigned int resoled1:1; - unsigned int inv_dst_color_coeff:1; - unsigned int resoled2:1; - /* [20:23] */ - unsigned int lighten_en:1; - unsigned int darken_en:1; - unsigned int win_ce_src_over_en:2; - /* [24:31] */ - unsigned int reserved:8; - } data; -}; - -struct g2d_image { - enum e_g2d_select_mode select_mode; - enum e_g2d_color_mode color_mode; - enum e_g2d_repeat_mode repeat_mode; - enum e_g2d_scale_mode scale_mode; - unsigned int xscale; - unsigned int yscale; - unsigned char rotate_90; - unsigned char x_dir; - unsigned char y_dir; - unsigned char component_alpha; - unsigned int width; - unsigned int height; - unsigned int stride; - unsigned int need_free; - unsigned int color; - enum e_g2d_buf_type buf_type; - unsigned int bo[G2D_PLANE_MAX_NR]; - struct drm_exynos_g2d_userptr user_ptr[G2D_PLANE_MAX_NR]; - void *mapped_ptr[G2D_PLANE_MAX_NR]; -}; - -struct g2d_context { - int fd; - unsigned int major; - unsigned int minor; - struct drm_exynos_g2d_cmd cmd[G2D_MAX_CMD_NR]; - struct drm_exynos_g2d_cmd cmd_buf[G2D_MAX_GEM_CMD_NR]; - unsigned int cmd_nr; - unsigned int cmd_buf_nr; - unsigned int cmdlist_nr; -}; - -struct g2d_context *g2d_init(int fd); -void g2d_fini(struct g2d_context *ctx); -int g2d_exec(struct g2d_context *ctx); -int g2d_solid_fill(struct g2d_context *ctx, struct g2d_image *img, - unsigned int x, unsigned int y, unsigned int w, - unsigned int h); -int g2d_copy(struct g2d_context *ctx, struct g2d_image *src, - struct g2d_image *dst, unsigned int src_x, - unsigned int src_y, unsigned int dst_x, unsigned int dst_y, - unsigned int w, unsigned int h); -int g2d_copy_with_scale(struct g2d_context *ctx, struct g2d_image *src, - struct g2d_image *dst, unsigned int src_x, - unsigned int src_y, unsigned int src_w, - unsigned int src_h, unsigned int dst_x, - unsigned int dst_y, unsigned int dst_w, - unsigned int dst_h, unsigned int negative); -int g2d_blend(struct g2d_context *ctx, struct g2d_image *src, - struct g2d_image *dst, unsigned int src_x, - unsigned int src_y, unsigned int dst_x, unsigned int dst_y, - unsigned int w, unsigned int h, enum e_g2d_op op); -#endif /* _FIMG2D_H_ */ diff -Nru libdrm-2.4.56/exynos/fimg2d_reg.h libdrm-2.4.60/exynos/fimg2d_reg.h --- libdrm-2.4.56/exynos/fimg2d_reg.h 2013-08-12 18:00:51.000000000 +0000 +++ libdrm-2.4.60/exynos/fimg2d_reg.h 2015-03-18 17:33:36.000000000 +0000 @@ -15,7 +15,7 @@ #define SOFT_RESET_REG (0x0000) #define INTEN_REG (0x0004) -#define INTC_PEND_REG (0x000c) +#define INTC_PEND_REG (0x000C) #define FIFO_STAT_REG (0x0010) #define AXI_MODE_REG (0x001C) #define DMA_SFR_BASE_ADDR_REG (0x0080) diff -Nru libdrm-2.4.56/exynos/Makefile.am libdrm-2.4.60/exynos/Makefile.am --- libdrm-2.4.56/exynos/Makefile.am 2013-08-12 18:00:49.000000000 +0000 +++ libdrm-2.4.60/exynos/Makefile.am 2015-03-18 17:33:36.000000000 +0000 @@ -1,5 +1,6 @@ AM_CFLAGS = \ $(WARN_CFLAGS) \ + $(VISIBILITY_CFLAGS) \ -I$(top_srcdir) \ -I$(top_srcdir)/exynos \ $(PTHREADSTUBS_CFLAGS) \ @@ -13,11 +14,10 @@ libdrm_exynos_la_SOURCES = \ exynos_drm.c \ exynos_fimg2d.c \ - fimg2d.h \ fimg2d_reg.h libdrm_exynoscommonincludedir = ${includedir}/exynos -libdrm_exynoscommoninclude_HEADERS = exynos_drm.h +libdrm_exynoscommoninclude_HEADERS = exynos_drm.h exynos_fimg2d.h libdrm_exynosincludedir = ${includedir}/libdrm libdrm_exynosinclude_HEADERS = exynos_drmif.h diff -Nru libdrm-2.4.56/exynos/Makefile.in libdrm-2.4.60/exynos/Makefile.in --- libdrm-2.4.56/exynos/Makefile.in 2014-07-29 16:13:53.000000000 +0000 +++ libdrm-2.4.60/exynos/Makefile.in 2015-03-19 14:37:46.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.14.1 from Makefile.am. +# Makefile.in generated by automake 1.13.4 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. @@ -248,7 +248,6 @@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MANPAGES_STYLESHEET = @MANPAGES_STYLESHEET@ @@ -282,6 +281,7 @@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ VALGRIND_LIBS = @VALGRIND_LIBS@ VERSION = @VERSION@ +VISIBILITY_CFLAGS = @VISIBILITY_CFLAGS@ WARN_CFLAGS = @WARN_CFLAGS@ XSLTPROC = @XSLTPROC@ abs_builddir = @abs_builddir@ @@ -340,6 +340,7 @@ top_srcdir = @top_srcdir@ AM_CFLAGS = \ $(WARN_CFLAGS) \ + $(VISIBILITY_CFLAGS) \ -I$(top_srcdir) \ -I$(top_srcdir)/exynos \ $(PTHREADSTUBS_CFLAGS) \ @@ -352,11 +353,10 @@ libdrm_exynos_la_SOURCES = \ exynos_drm.c \ exynos_fimg2d.c \ - fimg2d.h \ fimg2d_reg.h libdrm_exynoscommonincludedir = ${includedir}/exynos -libdrm_exynoscommoninclude_HEADERS = exynos_drm.h +libdrm_exynoscommoninclude_HEADERS = exynos_drm.h exynos_fimg2d.h libdrm_exynosincludedir = ${includedir}/libdrm libdrm_exynosinclude_HEADERS = exynos_drmif.h pkgconfig_DATA = libdrm_exynos.pc @@ -364,7 +364,7 @@ .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -389,9 +389,9 @@ $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): libdrm_exynos.pc: $(top_builddir)/config.status $(srcdir)/libdrm_exynos.pc.in @@ -449,14 +449,14 @@ @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< diff -Nru libdrm-2.4.56/freedreno/Android.mk libdrm-2.4.60/freedreno/Android.mk --- libdrm-2.4.56/freedreno/Android.mk 1970-01-01 00:00:00.000000000 +0000 +++ libdrm-2.4.60/freedreno/Android.mk 2015-02-28 18:34:25.000000000 +0000 @@ -0,0 +1,27 @@ +LOCAL_PATH := $(call my-dir) +include $(CLEAR_VARS) + +# Import variables LIBDRM_FREEDRENO_FILES, LIBDRM_FREEDRENO_H_FILES +include $(LOCAL_PATH)/Makefile.sources + +LOCAL_MODULE := libdrm_freedreno +LOCAL_MODULE_TAGS := optional + +LOCAL_SHARED_LIBRARIES := libdrm + +LOCAL_SRC_FILES := $(LIBDRM_FREEDRENO_FILES) +LOCAL_EXPORT_C_INCLUDE_DIRS += \ + $(LOCAL_PATH)/freedreno + +LOCAL_C_INCLUDES := \ + $(LIBDRM_TOP) \ + $(LIBDRM_TOP)/freedreno \ + $(LIBDRM_TOP)/include/drm + +LOCAL_CFLAGS := \ + -DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1 + +LOCAL_COPY_HEADERS := $(LIBDRM_FREEDRENO_H_FILES) +LOCAL_COPY_HEADERS_TO := freedreno + +include $(BUILD_SHARED_LIBRARY) diff -Nru libdrm-2.4.56/freedreno/freedreno_bo.c libdrm-2.4.60/freedreno/freedreno_bo.c --- libdrm-2.4.56/freedreno/freedreno_bo.c 2014-02-07 16:58:41.000000000 +0000 +++ libdrm-2.4.60/freedreno/freedreno_bo.c 2015-02-28 18:34:25.000000000 +0000 @@ -26,6 +26,10 @@ * Rob Clark */ +#ifdef HAVE_CONFIG_H +# include +#endif + #include "freedreno_drmif.h" #include "freedreno_priv.h" @@ -163,8 +167,8 @@ } -struct fd_bo * fd_bo_new(struct fd_device *dev, - uint32_t size, uint32_t flags) +drm_public struct fd_bo * +fd_bo_new(struct fd_device *dev, uint32_t size, uint32_t flags) { struct fd_bo *bo = NULL; struct fd_bo_bucket *bucket; @@ -197,19 +201,45 @@ return bo; } -struct fd_bo *fd_bo_from_handle(struct fd_device *dev, - uint32_t handle, uint32_t size) +drm_public struct fd_bo * +fd_bo_from_handle(struct fd_device *dev, uint32_t handle, uint32_t size) { struct fd_bo *bo = NULL; pthread_mutex_lock(&table_lock); + + bo = lookup_bo(dev->handle_table, handle); + if (bo) + goto out_unlock; + bo = bo_from_handle(dev, size, handle); + +out_unlock: pthread_mutex_unlock(&table_lock); return bo; } -struct fd_bo * fd_bo_from_name(struct fd_device *dev, uint32_t name) +drm_public struct fd_bo * +fd_bo_from_dmabuf(struct fd_device *dev, int fd) +{ + struct drm_prime_handle req = { + .fd = fd, + }; + int ret, size; + + ret = drmIoctl(dev->fd, DRM_IOCTL_PRIME_FD_TO_HANDLE, &req); + if (ret) { + return NULL; + } + + /* hmm, would be nice if we had a way to figure out the size.. */ + size = 0; + + return fd_bo_from_handle(dev, req.handle, size); +} + +drm_public struct fd_bo * fd_bo_from_name(struct fd_device *dev, uint32_t name) { struct drm_gem_open req = { .name = name, @@ -242,19 +272,24 @@ return bo; } -struct fd_bo * fd_bo_ref(struct fd_bo *bo) +drm_public struct fd_bo * fd_bo_ref(struct fd_bo *bo) { atomic_inc(&bo->refcnt); return bo; } -void fd_bo_del(struct fd_bo *bo) +drm_public void fd_bo_del(struct fd_bo *bo) { struct fd_device *dev = bo->dev; if (!atomic_dec_and_test(&bo->refcnt)) return; + if (bo->fd) { + close(bo->fd); + bo->fd = 0; + } + pthread_mutex_lock(&table_lock); if (bo->bo_reuse) { @@ -288,7 +323,7 @@ static void bo_del(struct fd_bo *bo) { if (bo->map) - munmap(bo->map, bo->size); + drm_munmap(bo->map, bo->size); /* TODO probably bo's in bucket list get removed from * handle table?? @@ -307,7 +342,7 @@ bo->funcs->destroy(bo); } -int fd_bo_get_name(struct fd_bo *bo, uint32_t *name) +drm_public int fd_bo_get_name(struct fd_bo *bo, uint32_t *name) { if (!bo->name) { struct drm_gem_flink req = { @@ -330,17 +365,36 @@ return 0; } -uint32_t fd_bo_handle(struct fd_bo *bo) +drm_public uint32_t fd_bo_handle(struct fd_bo *bo) { return bo->handle; } -uint32_t fd_bo_size(struct fd_bo *bo) +drm_public int fd_bo_dmabuf(struct fd_bo *bo) +{ + if (!bo->fd) { + struct drm_prime_handle req = { + .handle = bo->handle, + .flags = DRM_CLOEXEC, + }; + int ret; + + ret = drmIoctl(bo->dev->fd, DRM_IOCTL_PRIME_HANDLE_TO_FD, &req); + if (ret) { + return ret; + } + + bo->fd = req.fd; + } + return dup(bo->fd); +} + +drm_public uint32_t fd_bo_size(struct fd_bo *bo) { return bo->size; } -void * fd_bo_map(struct fd_bo *bo) +drm_public void * fd_bo_map(struct fd_bo *bo) { if (!bo->map) { uint64_t offset; @@ -351,7 +405,7 @@ return NULL; } - bo->map = mmap(0, bo->size, PROT_READ | PROT_WRITE, MAP_SHARED, + bo->map = drm_mmap(0, bo->size, PROT_READ | PROT_WRITE, MAP_SHARED, bo->dev->fd, offset); if (bo->map == MAP_FAILED) { ERROR_MSG("mmap failed: %s", strerror(errno)); @@ -362,12 +416,12 @@ } /* a bit odd to take the pipe as an arg, but it's a, umm, quirk of kgsl.. */ -int fd_bo_cpu_prep(struct fd_bo *bo, struct fd_pipe *pipe, uint32_t op) +drm_public int fd_bo_cpu_prep(struct fd_bo *bo, struct fd_pipe *pipe, uint32_t op) { return bo->funcs->cpu_prep(bo, pipe, op); } -void fd_bo_cpu_fini(struct fd_bo *bo) +drm_public void fd_bo_cpu_fini(struct fd_bo *bo) { bo->funcs->cpu_fini(bo); } diff -Nru libdrm-2.4.56/freedreno/freedreno_device.c libdrm-2.4.60/freedreno/freedreno_device.c --- libdrm-2.4.56/freedreno/freedreno_device.c 2014-05-30 16:38:28.000000000 +0000 +++ libdrm-2.4.60/freedreno/freedreno_device.c 2015-02-28 18:34:25.000000000 +0000 @@ -26,6 +26,10 @@ * Rob Clark */ +#ifdef HAVE_CONFIG_H +# include +#endif + #include #include #include @@ -76,7 +80,7 @@ } } -struct fd_device * fd_device_new(int fd) +drm_public struct fd_device * fd_device_new(int fd) { struct fd_device *dev; drmVersionPtr version; @@ -88,12 +92,14 @@ return NULL; } - if (!strcmp(version->name, "kgsl")) { - DEBUG_MSG("kgsl DRM device"); - dev = kgsl_device_new(fd); - } else if (!strcmp(version->name, "msm")) { + if (!strcmp(version->name, "msm")) { DEBUG_MSG("msm DRM device"); dev = msm_device_new(fd); +#ifdef HAVE_FREEDRENO_KGSL + } else if (!strcmp(version->name, "kgsl")) { + DEBUG_MSG("kgsl DRM device"); + dev = kgsl_device_new(fd); +#endif } else { ERROR_MSG("unknown device: %s", version->name); dev = NULL; @@ -115,7 +121,7 @@ /* like fd_device_new() but creates it's own private dup() of the fd * which is close()d when the device is finalized. */ -struct fd_device * fd_device_new_dup(int fd) +drm_public struct fd_device * fd_device_new_dup(int fd) { struct fd_device *dev = fd_device_new(dup(fd)); if (dev) @@ -123,7 +129,7 @@ return dev; } -struct fd_device * fd_device_ref(struct fd_device *dev) +drm_public struct fd_device * fd_device_ref(struct fd_device *dev) { atomic_inc(&dev->refcnt); return dev; @@ -146,7 +152,7 @@ fd_device_del_impl(dev); } -void fd_device_del(struct fd_device *dev) +drm_public void fd_device_del(struct fd_device *dev) { if (!atomic_dec_and_test(&dev->refcnt)) return; diff -Nru libdrm-2.4.56/freedreno/freedreno_drmif.h libdrm-2.4.60/freedreno/freedreno_drmif.h --- libdrm-2.4.56/freedreno/freedreno_drmif.h 2014-07-26 18:08:30.000000000 +0000 +++ libdrm-2.4.60/freedreno/freedreno_drmif.h 2015-02-28 18:32:39.000000000 +0000 @@ -98,10 +98,12 @@ struct fd_bo *fd_bo_from_handle(struct fd_device *dev, uint32_t handle, uint32_t size); struct fd_bo * fd_bo_from_name(struct fd_device *dev, uint32_t name); +struct fd_bo * fd_bo_from_dmabuf(struct fd_device *dev, int fd); struct fd_bo * fd_bo_ref(struct fd_bo *bo); void fd_bo_del(struct fd_bo *bo); int fd_bo_get_name(struct fd_bo *bo, uint32_t *name); uint32_t fd_bo_handle(struct fd_bo *bo); +int fd_bo_dmabuf(struct fd_bo *bo); uint32_t fd_bo_size(struct fd_bo *bo); void * fd_bo_map(struct fd_bo *bo); int fd_bo_cpu_prep(struct fd_bo *bo, struct fd_pipe *pipe, uint32_t op); diff -Nru libdrm-2.4.56/freedreno/freedreno_pipe.c libdrm-2.4.60/freedreno/freedreno_pipe.c --- libdrm-2.4.56/freedreno/freedreno_pipe.c 2013-09-17 13:02:43.000000000 +0000 +++ libdrm-2.4.60/freedreno/freedreno_pipe.c 2015-02-28 18:34:25.000000000 +0000 @@ -26,10 +26,15 @@ * Rob Clark */ +#ifdef HAVE_CONFIG_H +# include +#endif + #include "freedreno_drmif.h" #include "freedreno_priv.h" -struct fd_pipe * fd_pipe_new(struct fd_device *dev, enum fd_pipe_id id) +drm_public struct fd_pipe * +fd_pipe_new(struct fd_device *dev, enum fd_pipe_id id) { struct fd_pipe *pipe = NULL; @@ -54,18 +59,18 @@ return NULL; } -void fd_pipe_del(struct fd_pipe *pipe) +drm_public void fd_pipe_del(struct fd_pipe *pipe) { pipe->funcs->destroy(pipe); } -int fd_pipe_get_param(struct fd_pipe *pipe, enum fd_param_id param, - uint64_t *value) +drm_public int fd_pipe_get_param(struct fd_pipe *pipe, + enum fd_param_id param, uint64_t *value) { return pipe->funcs->get_param(pipe, param, value); } -int fd_pipe_wait(struct fd_pipe *pipe, uint32_t timestamp) +drm_public int fd_pipe_wait(struct fd_pipe *pipe, uint32_t timestamp) { return pipe->funcs->wait(pipe, timestamp); } diff -Nru libdrm-2.4.56/freedreno/freedreno_priv.h libdrm-2.4.60/freedreno/freedreno_priv.h --- libdrm-2.4.56/freedreno/freedreno_priv.h 2014-04-04 16:45:41.000000000 +0000 +++ libdrm-2.4.60/freedreno/freedreno_priv.h 2015-02-28 18:34:25.000000000 +0000 @@ -29,6 +29,10 @@ #ifndef FREEDRENO_PRIV_H_ #define FREEDRENO_PRIV_H_ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include #include #include @@ -36,11 +40,11 @@ #include #include #include -#include #include #include #include +#include "libdrm.h" #include "xf86drm.h" #include "xf86atomic.h" @@ -134,6 +138,7 @@ uint32_t size; uint32_t handle; uint32_t name; + int fd; /* dmabuf handle */ void *map; atomic_t refcnt; struct fd_bo_funcs *funcs; @@ -143,9 +148,6 @@ time_t free_time; /* time when added to bucket-list */ }; -struct fd_bo *fd_bo_from_handle(struct fd_device *dev, - uint32_t handle, uint32_t size); - #define ALIGN(v,a) (((v) + (a) - 1) & ~((a) - 1)) #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0])) diff -Nru libdrm-2.4.56/freedreno/freedreno_ringbuffer.c libdrm-2.4.60/freedreno/freedreno_ringbuffer.c --- libdrm-2.4.56/freedreno/freedreno_ringbuffer.c 2014-04-04 16:45:41.000000000 +0000 +++ libdrm-2.4.60/freedreno/freedreno_ringbuffer.c 2015-02-28 18:34:25.000000000 +0000 @@ -26,14 +26,18 @@ * Rob Clark */ +#ifdef HAVE_CONFIG_H +# include +#endif + #include #include "freedreno_drmif.h" #include "freedreno_priv.h" #include "freedreno_ringbuffer.h" -struct fd_ringbuffer * fd_ringbuffer_new(struct fd_pipe *pipe, - uint32_t size) +drm_public struct fd_ringbuffer * +fd_ringbuffer_new(struct fd_pipe *pipe, uint32_t size) { struct fd_ringbuffer *ring; @@ -51,7 +55,7 @@ return ring; } -void fd_ringbuffer_del(struct fd_ringbuffer *ring) +drm_public void fd_ringbuffer_del(struct fd_ringbuffer *ring) { ring->funcs->destroy(ring); } @@ -60,13 +64,13 @@ * the IB source) as it's parent before emitting reloc's, to ensure * the bookkeeping works out properly. */ -void fd_ringbuffer_set_parent(struct fd_ringbuffer *ring, - struct fd_ringbuffer *parent) +drm_public void fd_ringbuffer_set_parent(struct fd_ringbuffer *ring, + struct fd_ringbuffer *parent) { ring->parent = parent; } -void fd_ringbuffer_reset(struct fd_ringbuffer *ring) +drm_public void fd_ringbuffer_reset(struct fd_ringbuffer *ring) { uint32_t *start = ring->start; if (ring->pipe->id == FD_PIPE_2D) @@ -77,30 +81,32 @@ } /* maybe get rid of this and use fd_ringmarker_flush() from DDX too? */ -int fd_ringbuffer_flush(struct fd_ringbuffer *ring) +drm_public int fd_ringbuffer_flush(struct fd_ringbuffer *ring) { return ring->funcs->flush(ring, ring->last_start); } -uint32_t fd_ringbuffer_timestamp(struct fd_ringbuffer *ring) +drm_public uint32_t fd_ringbuffer_timestamp(struct fd_ringbuffer *ring) { return ring->last_timestamp; } -void fd_ringbuffer_reloc(struct fd_ringbuffer *ring, - const struct fd_reloc *reloc) +drm_public void fd_ringbuffer_reloc(struct fd_ringbuffer *ring, + const struct fd_reloc *reloc) { ring->funcs->emit_reloc(ring, reloc); } -void fd_ringbuffer_emit_reloc_ring(struct fd_ringbuffer *ring, - struct fd_ringmarker *target, struct fd_ringmarker *end) +drm_public void +fd_ringbuffer_emit_reloc_ring(struct fd_ringbuffer *ring, + struct fd_ringmarker *target, + struct fd_ringmarker *end) { assert(target->ring == end->ring); ring->funcs->emit_reloc_ring(ring, target, end); } -struct fd_ringmarker * fd_ringmarker_new(struct fd_ringbuffer *ring) +drm_public struct fd_ringmarker * fd_ringmarker_new(struct fd_ringbuffer *ring) { struct fd_ringmarker *marker = NULL; @@ -117,23 +123,23 @@ return marker; } -void fd_ringmarker_del(struct fd_ringmarker *marker) +drm_public void fd_ringmarker_del(struct fd_ringmarker *marker) { free(marker); } -void fd_ringmarker_mark(struct fd_ringmarker *marker) +drm_public void fd_ringmarker_mark(struct fd_ringmarker *marker) { marker->cur = marker->ring->cur; } -uint32_t fd_ringmarker_dwords(struct fd_ringmarker *start, - struct fd_ringmarker *end) +drm_public uint32_t fd_ringmarker_dwords(struct fd_ringmarker *start, + struct fd_ringmarker *end) { return end->cur - start->cur; } -int fd_ringmarker_flush(struct fd_ringmarker *marker) +drm_public int fd_ringmarker_flush(struct fd_ringmarker *marker) { struct fd_ringbuffer *ring = marker->ring; return ring->funcs->flush(ring, marker->cur); diff -Nru libdrm-2.4.56/freedreno/kgsl/kgsl_bo.c libdrm-2.4.60/freedreno/kgsl/kgsl_bo.c --- libdrm-2.4.56/freedreno/kgsl/kgsl_bo.c 2014-04-04 16:45:41.000000000 +0000 +++ libdrm-2.4.60/freedreno/kgsl/kgsl_bo.c 2015-02-28 18:34:25.000000000 +0000 @@ -26,6 +26,10 @@ * Rob Clark */ +#ifdef HAVE_CONFIG_H +# include +#endif + #include "kgsl_priv.h" #include @@ -171,8 +175,8 @@ return bo; } -struct fd_bo * fd_bo_from_fbdev(struct fd_pipe *pipe, - int fbfd, uint32_t size) +drm_public struct fd_bo * +fd_bo_from_fbdev(struct fd_pipe *pipe, int fbfd, uint32_t size) { struct fd_bo *bo; @@ -186,7 +190,7 @@ * thinks the buffer hasn't be allocate and fails */ if (bo) { - void *fbmem = mmap(NULL, size, PROT_READ | PROT_WRITE, + void *fbmem = drm_mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, fbfd, 0); struct kgsl_map_user_mem req = { .memtype = KGSL_USER_MEM_TYPE_ADDR, diff -Nru libdrm-2.4.56/freedreno/kgsl/kgsl_device.c libdrm-2.4.60/freedreno/kgsl/kgsl_device.c --- libdrm-2.4.56/freedreno/kgsl/kgsl_device.c 2013-09-17 13:02:43.000000000 +0000 +++ libdrm-2.4.60/freedreno/kgsl/kgsl_device.c 2015-02-28 18:34:25.000000000 +0000 @@ -26,6 +26,10 @@ * Rob Clark */ +#ifdef HAVE_CONFIG_H +# include +#endif + #include #include #include diff -Nru libdrm-2.4.56/freedreno/kgsl/kgsl_pipe.c libdrm-2.4.60/freedreno/kgsl/kgsl_pipe.c --- libdrm-2.4.56/freedreno/kgsl/kgsl_pipe.c 2014-07-26 18:08:30.000000000 +0000 +++ libdrm-2.4.60/freedreno/kgsl/kgsl_pipe.c 2015-02-28 18:34:25.000000000 +0000 @@ -26,6 +26,10 @@ * Rob Clark */ +#ifdef HAVE_CONFIG_H +# include +#endif + #include "kgsl_priv.h" diff -Nru libdrm-2.4.56/freedreno/kgsl/kgsl_ringbuffer.c libdrm-2.4.60/freedreno/kgsl/kgsl_ringbuffer.c --- libdrm-2.4.56/freedreno/kgsl/kgsl_ringbuffer.c 2013-09-17 13:02:43.000000000 +0000 +++ libdrm-2.4.60/freedreno/kgsl/kgsl_ringbuffer.c 2015-02-28 18:34:25.000000000 +0000 @@ -26,6 +26,10 @@ * Rob Clark */ +#ifdef HAVE_CONFIG_H +# include +#endif + #include #include "freedreno_ringbuffer.h" @@ -60,7 +64,7 @@ }; int ret; - munmap(bo->hostptr, bo->size); + drm_munmap(bo->hostptr, bo->size); ret = ioctl(bo->pipe->fd, IOCTL_KGSL_SHAREDMEM_FREE, &req); if (ret) { @@ -93,7 +97,7 @@ bo->pipe = pipe; bo->gpuaddr = req.gpuaddr; bo->size = size; - bo->hostptr = mmap(NULL, size, PROT_WRITE|PROT_READ, + bo->hostptr = drm_mmap(NULL, size, PROT_WRITE|PROT_READ, MAP_SHARED, pipe->fd, req.gpuaddr); return bo; diff -Nru libdrm-2.4.56/freedreno/Makefile.am libdrm-2.4.60/freedreno/Makefile.am --- libdrm-2.4.56/freedreno/Makefile.am 2013-09-17 13:02:43.000000000 +0000 +++ libdrm-2.4.60/freedreno/Makefile.am 2015-02-28 18:34:25.000000000 +0000 @@ -1,7 +1,9 @@ AUTOMAKE_OPTIONS=subdir-objects +include Makefile.sources AM_CFLAGS = \ $(WARN_CFLAGS) \ + $(VISIBILITY_CFLAGS) \ -I$(top_srcdir) \ -I$(top_srcdir)/freedreno \ $(PTHREADSTUBS_CFLAGS) \ @@ -12,29 +14,15 @@ libdrm_freedreno_la_LDFLAGS = -version-number 1:0:0 -no-undefined libdrm_freedreno_la_LIBADD = ../libdrm.la @PTHREADSTUBS_LIBS@ -libdrm_freedreno_la_SOURCES = \ - freedreno_device.c \ - freedreno_pipe.c \ - freedreno_priv.h \ - freedreno_ringbuffer.c \ - freedreno_bo.c \ - kgsl/kgsl_bo.c \ - kgsl/kgsl_device.c \ - kgsl/kgsl_drm.h \ - kgsl/kgsl_pipe.c \ - kgsl/kgsl_priv.h \ - kgsl/kgsl_ringbuffer.c \ - kgsl/msm_kgsl.h \ - msm/msm_bo.c \ - msm/msm_device.c \ - msm/msm_drm.h \ - msm/msm_pipe.c \ - msm/msm_priv.h \ - msm/msm_ringbuffer.c \ - list.h +libdrm_freedreno_la_SOURCES = $(LIBDRM_FREEDRENO_FILES) +if HAVE_FREEDRENO_KGSL +libdrm_freedreno_la_SOURCES += $(LIBDRM_FREEDRENO_KGSL_FILES) +endif libdrm_freedrenocommonincludedir = ${includedir}/freedreno -libdrm_freedrenocommoninclude_HEADERS = freedreno_drmif.h freedreno_ringbuffer.h +libdrm_freedrenocommoninclude_HEADERS = $(LIBDRM_FREEDRENO_H_FILES) pkgconfigdir = @pkgconfigdir@ pkgconfig_DATA = libdrm_freedreno.pc + +EXTRA_DIST = Android.mk diff -Nru libdrm-2.4.56/freedreno/Makefile.in libdrm-2.4.60/freedreno/Makefile.in --- libdrm-2.4.56/freedreno/Makefile.in 2014-07-29 16:13:53.000000000 +0000 +++ libdrm-2.4.60/freedreno/Makefile.in 2015-03-19 14:37:46.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.14.1 from Makefile.am. +# Makefile.in generated by automake 1.13.4 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. @@ -80,11 +80,12 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -subdir = freedreno -DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ - $(srcdir)/libdrm_freedreno.pc.in \ +DIST_COMMON = $(srcdir)/Makefile.sources $(srcdir)/Makefile.in \ + $(srcdir)/Makefile.am $(srcdir)/libdrm_freedreno.pc.in \ $(top_srcdir)/build-aux/depcomp \ $(libdrm_freedrenocommoninclude_HEADERS) README +@HAVE_FREEDRENO_KGSL_TRUE@am__append_1 = $(LIBDRM_FREEDRENO_KGSL_FILES) +subdir = freedreno ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ @@ -128,12 +129,21 @@ "$(DESTDIR)$(libdrm_freedrenocommonincludedir)" LTLIBRARIES = $(libdrm_freedreno_la_LTLIBRARIES) libdrm_freedreno_la_DEPENDENCIES = ../libdrm.la +am__libdrm_freedreno_la_SOURCES_DIST = freedreno_device.c \ + freedreno_pipe.c freedreno_priv.h freedreno_ringbuffer.c \ + freedreno_bo.c msm/msm_bo.c msm/msm_device.c msm/msm_drm.h \ + msm/msm_pipe.c msm/msm_priv.h msm/msm_ringbuffer.c list.h \ + kgsl/kgsl_bo.c kgsl/kgsl_device.c kgsl/kgsl_drm.h \ + kgsl/kgsl_pipe.c kgsl/kgsl_priv.h kgsl/kgsl_ringbuffer.c \ + kgsl/msm_kgsl.h am__dirstamp = $(am__leading_dot)dirstamp -am_libdrm_freedreno_la_OBJECTS = freedreno_device.lo freedreno_pipe.lo \ - freedreno_ringbuffer.lo freedreno_bo.lo kgsl/kgsl_bo.lo \ - kgsl/kgsl_device.lo kgsl/kgsl_pipe.lo kgsl/kgsl_ringbuffer.lo \ - msm/msm_bo.lo msm/msm_device.lo msm/msm_pipe.lo \ - msm/msm_ringbuffer.lo +am__objects_1 = freedreno_device.lo freedreno_pipe.lo \ + freedreno_ringbuffer.lo freedreno_bo.lo msm/msm_bo.lo \ + msm/msm_device.lo msm/msm_pipe.lo msm/msm_ringbuffer.lo +am__objects_2 = kgsl/kgsl_bo.lo kgsl/kgsl_device.lo kgsl/kgsl_pipe.lo \ + kgsl/kgsl_ringbuffer.lo +@HAVE_FREEDRENO_KGSL_TRUE@am__objects_3 = $(am__objects_2) +am_libdrm_freedreno_la_OBJECTS = $(am__objects_1) $(am__objects_3) libdrm_freedreno_la_OBJECTS = $(am_libdrm_freedreno_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) @@ -178,7 +188,7 @@ am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libdrm_freedreno_la_SOURCES) -DIST_SOURCES = $(libdrm_freedreno_la_SOURCES) +DIST_SOURCES = $(am__libdrm_freedreno_la_SOURCES_DIST) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ @@ -251,7 +261,6 @@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MANPAGES_STYLESHEET = @MANPAGES_STYLESHEET@ @@ -285,6 +294,7 @@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ VALGRIND_LIBS = @VALGRIND_LIBS@ VERSION = @VERSION@ +VISIBILITY_CFLAGS = @VISIBILITY_CFLAGS@ WARN_CFLAGS = @WARN_CFLAGS@ XSLTPROC = @XSLTPROC@ abs_builddir = @abs_builddir@ @@ -342,30 +352,12 @@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = subdir-objects -AM_CFLAGS = \ - $(WARN_CFLAGS) \ - -I$(top_srcdir) \ - -I$(top_srcdir)/freedreno \ - $(PTHREADSTUBS_CFLAGS) \ - -I$(top_srcdir)/include/drm - -libdrm_freedreno_la_LTLIBRARIES = libdrm_freedreno.la -libdrm_freedreno_ladir = $(libdir) -libdrm_freedreno_la_LDFLAGS = -version-number 1:0:0 -no-undefined -libdrm_freedreno_la_LIBADD = ../libdrm.la @PTHREADSTUBS_LIBS@ -libdrm_freedreno_la_SOURCES = \ +LIBDRM_FREEDRENO_FILES := \ freedreno_device.c \ freedreno_pipe.c \ freedreno_priv.h \ freedreno_ringbuffer.c \ freedreno_bo.c \ - kgsl/kgsl_bo.c \ - kgsl/kgsl_device.c \ - kgsl/kgsl_drm.h \ - kgsl/kgsl_pipe.c \ - kgsl/kgsl_priv.h \ - kgsl/kgsl_ringbuffer.c \ - kgsl/msm_kgsl.h \ msm/msm_bo.c \ msm/msm_device.c \ msm/msm_drm.h \ @@ -374,14 +366,42 @@ msm/msm_ringbuffer.c \ list.h +LIBDRM_FREEDRENO_KGSL_FILES := \ + kgsl/kgsl_bo.c \ + kgsl/kgsl_device.c \ + kgsl/kgsl_drm.h \ + kgsl/kgsl_pipe.c \ + kgsl/kgsl_priv.h \ + kgsl/kgsl_ringbuffer.c \ + kgsl/msm_kgsl.h + +LIBDRM_FREEDRENO_H_FILES := \ + freedreno_drmif.h \ + freedreno_ringbuffer.h + +AM_CFLAGS = \ + $(WARN_CFLAGS) \ + $(VISIBILITY_CFLAGS) \ + -I$(top_srcdir) \ + -I$(top_srcdir)/freedreno \ + $(PTHREADSTUBS_CFLAGS) \ + -I$(top_srcdir)/include/drm + +libdrm_freedreno_la_LTLIBRARIES = libdrm_freedreno.la +libdrm_freedreno_ladir = $(libdir) +libdrm_freedreno_la_LDFLAGS = -version-number 1:0:0 -no-undefined +libdrm_freedreno_la_LIBADD = ../libdrm.la @PTHREADSTUBS_LIBS@ +libdrm_freedreno_la_SOURCES = $(LIBDRM_FREEDRENO_FILES) \ + $(am__append_1) libdrm_freedrenocommonincludedir = ${includedir}/freedreno -libdrm_freedrenocommoninclude_HEADERS = freedreno_drmif.h freedreno_ringbuffer.h +libdrm_freedrenocommoninclude_HEADERS = $(LIBDRM_FREEDRENO_H_FILES) pkgconfig_DATA = libdrm_freedreno.pc +EXTRA_DIST = Android.mk all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(srcdir)/Makefile.sources $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -402,13 +422,14 @@ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; +$(srcdir)/Makefile.sources: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): libdrm_freedreno.pc: $(top_builddir)/config.status $(srcdir)/libdrm_freedreno.pc.in @@ -448,6 +469,17 @@ echo rm -f $${locs}; \ rm -f $${locs}; \ } +msm/$(am__dirstamp): + @$(MKDIR_P) msm + @: > msm/$(am__dirstamp) +msm/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) msm/$(DEPDIR) + @: > msm/$(DEPDIR)/$(am__dirstamp) +msm/msm_bo.lo: msm/$(am__dirstamp) msm/$(DEPDIR)/$(am__dirstamp) +msm/msm_device.lo: msm/$(am__dirstamp) msm/$(DEPDIR)/$(am__dirstamp) +msm/msm_pipe.lo: msm/$(am__dirstamp) msm/$(DEPDIR)/$(am__dirstamp) +msm/msm_ringbuffer.lo: msm/$(am__dirstamp) \ + msm/$(DEPDIR)/$(am__dirstamp) kgsl/$(am__dirstamp): @$(MKDIR_P) kgsl @: > kgsl/$(am__dirstamp) @@ -460,17 +492,6 @@ kgsl/kgsl_pipe.lo: kgsl/$(am__dirstamp) kgsl/$(DEPDIR)/$(am__dirstamp) kgsl/kgsl_ringbuffer.lo: kgsl/$(am__dirstamp) \ kgsl/$(DEPDIR)/$(am__dirstamp) -msm/$(am__dirstamp): - @$(MKDIR_P) msm - @: > msm/$(am__dirstamp) -msm/$(DEPDIR)/$(am__dirstamp): - @$(MKDIR_P) msm/$(DEPDIR) - @: > msm/$(DEPDIR)/$(am__dirstamp) -msm/msm_bo.lo: msm/$(am__dirstamp) msm/$(DEPDIR)/$(am__dirstamp) -msm/msm_device.lo: msm/$(am__dirstamp) msm/$(DEPDIR)/$(am__dirstamp) -msm/msm_pipe.lo: msm/$(am__dirstamp) msm/$(DEPDIR)/$(am__dirstamp) -msm/msm_ringbuffer.lo: msm/$(am__dirstamp) \ - msm/$(DEPDIR)/$(am__dirstamp) libdrm_freedreno.la: $(libdrm_freedreno_la_OBJECTS) $(libdrm_freedreno_la_DEPENDENCIES) $(EXTRA_libdrm_freedreno_la_DEPENDENCIES) $(AM_V_CCLD)$(libdrm_freedreno_la_LINK) -rpath $(libdrm_freedreno_ladir) $(libdrm_freedreno_la_OBJECTS) $(libdrm_freedreno_la_LIBADD) $(LIBS) diff -Nru libdrm-2.4.56/freedreno/Makefile.sources libdrm-2.4.60/freedreno/Makefile.sources --- libdrm-2.4.56/freedreno/Makefile.sources 1970-01-01 00:00:00.000000000 +0000 +++ libdrm-2.4.60/freedreno/Makefile.sources 2015-02-28 18:34:25.000000000 +0000 @@ -0,0 +1,26 @@ +LIBDRM_FREEDRENO_FILES := \ + freedreno_device.c \ + freedreno_pipe.c \ + freedreno_priv.h \ + freedreno_ringbuffer.c \ + freedreno_bo.c \ + msm/msm_bo.c \ + msm/msm_device.c \ + msm/msm_drm.h \ + msm/msm_pipe.c \ + msm/msm_priv.h \ + msm/msm_ringbuffer.c \ + list.h + +LIBDRM_FREEDRENO_KGSL_FILES := \ + kgsl/kgsl_bo.c \ + kgsl/kgsl_device.c \ + kgsl/kgsl_drm.h \ + kgsl/kgsl_pipe.c \ + kgsl/kgsl_priv.h \ + kgsl/kgsl_ringbuffer.c \ + kgsl/msm_kgsl.h + +LIBDRM_FREEDRENO_H_FILES := \ + freedreno_drmif.h \ + freedreno_ringbuffer.h diff -Nru libdrm-2.4.56/freedreno/msm/msm_bo.c libdrm-2.4.60/freedreno/msm/msm_bo.c --- libdrm-2.4.56/freedreno/msm/msm_bo.c 2013-09-17 13:02:43.000000000 +0000 +++ libdrm-2.4.60/freedreno/msm/msm_bo.c 2015-02-28 18:34:25.000000000 +0000 @@ -26,6 +26,10 @@ * Rob Clark */ +#ifdef HAVE_CONFIG_H +# include +#endif + #include "msm_priv.h" static int bo_allocate(struct msm_bo *msm_bo) diff -Nru libdrm-2.4.56/freedreno/msm/msm_device.c libdrm-2.4.60/freedreno/msm/msm_device.c --- libdrm-2.4.56/freedreno/msm/msm_device.c 2013-09-17 13:02:43.000000000 +0000 +++ libdrm-2.4.60/freedreno/msm/msm_device.c 2015-02-28 18:34:25.000000000 +0000 @@ -26,6 +26,10 @@ * Rob Clark */ +#ifdef HAVE_CONFIG_H +# include +#endif + #include #include #include diff -Nru libdrm-2.4.56/freedreno/msm/msm_pipe.c libdrm-2.4.60/freedreno/msm/msm_pipe.c --- libdrm-2.4.56/freedreno/msm/msm_pipe.c 2014-07-26 18:08:30.000000000 +0000 +++ libdrm-2.4.60/freedreno/msm/msm_pipe.c 2015-02-28 18:34:25.000000000 +0000 @@ -26,6 +26,10 @@ * Rob Clark */ +#ifdef HAVE_CONFIG_H +# include +#endif + #include "msm_priv.h" diff -Nru libdrm-2.4.56/freedreno/msm/msm_ringbuffer.c libdrm-2.4.60/freedreno/msm/msm_ringbuffer.c --- libdrm-2.4.56/freedreno/msm/msm_ringbuffer.c 2014-05-30 16:38:28.000000000 +0000 +++ libdrm-2.4.60/freedreno/msm/msm_ringbuffer.c 2015-02-28 18:34:25.000000000 +0000 @@ -26,6 +26,10 @@ * Rob Clark */ +#ifdef HAVE_CONFIG_H +# include +#endif + #include #include "freedreno_ringbuffer.h" diff -Nru libdrm-2.4.56/include/drm/drm_mode.h libdrm-2.4.60/include/drm/drm_mode.h --- libdrm-2.4.56/include/drm/drm_mode.h 2013-11-22 15:25:06.000000000 +0000 +++ libdrm-2.4.60/include/drm/drm_mode.h 2015-02-28 18:34:25.000000000 +0000 @@ -173,6 +173,9 @@ #define DRM_MODE_ENCODER_TMDS 2 #define DRM_MODE_ENCODER_LVDS 3 #define DRM_MODE_ENCODER_TVDAC 4 +#define DRM_MODE_ENCODER_VIRTUAL 5 +#define DRM_MODE_ENCODER_DSI 6 +#define DRM_MODE_ENCODER_DPMST 7 struct drm_mode_get_encoder { __u32 encoder_id; @@ -210,6 +213,8 @@ #define DRM_MODE_CONNECTOR_HDMIB 12 #define DRM_MODE_CONNECTOR_TV 13 #define DRM_MODE_CONNECTOR_eDP 14 +#define DRM_MODE_CONNECTOR_VIRTUAL 15 +#define DRM_MODE_CONNECTOR_DSI 16 struct drm_mode_get_connector { @@ -239,6 +244,21 @@ #define DRM_MODE_PROP_BLOB (1<<4) #define DRM_MODE_PROP_BITMASK (1<<5) /* bitmask of enumerated types */ +/* non-extended types: legacy bitmask, one bit per type: */ +#define DRM_MODE_PROP_LEGACY_TYPE ( \ + DRM_MODE_PROP_RANGE | \ + DRM_MODE_PROP_ENUM | \ + DRM_MODE_PROP_BLOB | \ + DRM_MODE_PROP_BITMASK) + +/* extended-types: rather than continue to consume a bit per type, + * grab a chunk of the bits to use as integer type id. + */ +#define DRM_MODE_PROP_EXTENDED_TYPE 0x0000ffc0 +#define DRM_MODE_PROP_TYPE(n) ((n) << 6) +#define DRM_MODE_PROP_OBJECT DRM_MODE_PROP_TYPE(1) +#define DRM_MODE_PROP_SIGNED_RANGE DRM_MODE_PROP_TYPE(2) + struct drm_mode_property_enum { __u64 value; char name[DRM_PROP_NAME_LEN]; diff -Nru libdrm-2.4.56/include/drm/i810_drm.h libdrm-2.4.60/include/drm/i810_drm.h --- libdrm-2.4.56/include/drm/i810_drm.h 2013-08-12 18:01:03.000000000 +0000 +++ libdrm-2.4.60/include/drm/i810_drm.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,281 +0,0 @@ -#ifndef _I810_DRM_H_ -#define _I810_DRM_H_ - -/* WARNING: These defines must be the same as what the Xserver uses. - * if you change them, you must change the defines in the Xserver. - */ - -#ifndef _I810_DEFINES_ -#define _I810_DEFINES_ - -#define I810_DMA_BUF_ORDER 12 -#define I810_DMA_BUF_SZ (1<&2; \ - exit 1;; \ - esac; \ - has_opt=no; \ - sane_makeflags=$$MAKEFLAGS; \ - if $(am__is_gnu_make); then \ - sane_makeflags=$$MFLAGS; \ - else \ - case $$MAKEFLAGS in \ - *\\[\ \ ]*) \ - bs=\\; \ - sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ - | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ - esac; \ - fi; \ - skip_next=no; \ - strip_trailopt () \ - { \ - flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ - }; \ - for flg in $$sane_makeflags; do \ - test $$skip_next = yes && { skip_next=no; continue; }; \ - case $$flg in \ - *=*|--*) continue;; \ - -*I) strip_trailopt 'I'; skip_next=yes;; \ - -*I?*) strip_trailopt 'I';; \ - -*O) strip_trailopt 'O'; skip_next=yes;; \ - -*O?*) strip_trailopt 'O';; \ - -*l) strip_trailopt 'l'; skip_next=yes;; \ - -*l?*) strip_trailopt 'l';; \ - -[dEDm]) skip_next=yes;; \ - -[JT]) skip_next=yes;; \ - esac; \ - case $$flg in \ - *$$target_option*) has_opt=yes; break;; \ - esac; \ - done; \ - test $$has_opt = yes -am__make_dryrun = (target_option=n; $(am__make_running_with_option)) -am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) -pkgdatadir = $(datadir)/libdrm -pkgincludedir = $(includedir)/libdrm -pkglibdir = $(libdir)/libdrm -pkglibexecdir = $(libexecdir)/libdrm -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = x86_64-unknown-linux-gnu -host_triplet = x86_64-unknown-linux-gnu -am__append_1 = vmwgfx_drm.h -subdir = include/drm -DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ - $(am__klibdrminclude_HEADERS_DIST) -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -AM_V_P = $(am__v_P_$(V)) -am__v_P_ = $(am__v_P_$(AM_DEFAULT_VERBOSITY)) -am__v_P_0 = false -am__v_P_1 = : -AM_V_GEN = $(am__v_GEN_$(V)) -am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) -am__v_GEN_0 = @echo " GEN " $@; -am__v_GEN_1 = -AM_V_at = $(am__v_at_$(V)) -am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) -am__v_at_0 = @ -am__v_at_1 = -SOURCES = -DIST_SOURCES = -am__can_run_installinfo = \ - case $$AM_UPDATE_INFO_DIR in \ - n|no|NO) false;; \ - *) (install-info --version) >/dev/null 2>&1;; \ - esac -am__klibdrminclude_HEADERS_DIST = drm.h drm_mode.h drm_fourcc.h \ - drm_sarea.h i915_drm.h mga_drm.h nouveau_drm.h r128_drm.h \ - radeon_drm.h savage_drm.h sis_drm.h via_drm.h mach64_drm.h \ - qxl_drm.h vmwgfx_drm.h -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } -am__installdirs = "$(DESTDIR)$(klibdrmincludedir)" -HEADERS = $(klibdrminclude_HEADERS) -am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) -# Read a list of newline-separated strings from the standard input, -# and print each of them once, without duplicates. Input order is -# *not* preserved. -am__uniquify_input = $(AWK) '\ - BEGIN { nonempty = 0; } \ - { items[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in items) print i; }; } \ -' -# Make sure the list of sources is unique. This is necessary because, -# e.g., the same source file might be shared among _SOURCES variables -# for different programs/libraries. -am__define_uniq_tagged_files = \ - list='$(am__tagged_files)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = ${SHELL} /home/marek/dev/drm/build-aux/missing aclocal-1.14 -ALLOCA = -AMTAR = $${TAR-tar} -AM_DEFAULT_VERBOSITY = 0 -AR = ar -AUTOCONF = ${SHELL} /home/marek/dev/drm/build-aux/missing autoconf -AUTOHEADER = ${SHELL} /home/marek/dev/drm/build-aux/missing autoheader -AUTOMAKE = ${SHELL} /home/marek/dev/drm/build-aux/missing automake-1.14 -AWK = gawk -CAIRO_CFLAGS = -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -CAIRO_LIBS = -lcairo -CC = gcc -CCDEPMODE = depmode=gcc3 -CFLAGS = -g -O2 -fno-omit-frame-pointer -CLOCK_LIB = -CPP = gcc -E -CPPFLAGS = -CYGPATH_W = echo -DEFS = -DHAVE_CONFIG_H -DEPDIR = .deps -DLLTOOL = false -DSYMUTIL = -DUMPBIN = -ECHO_C = -ECHO_N = -n -ECHO_T = -EGREP = /bin/grep -E -EXEEXT = -FGREP = /bin/grep -F -GREP = /bin/grep -INSTALL = /usr/bin/install -c -INSTALL_DATA = ${INSTALL} -m 644 -INSTALL_PROGRAM = ${INSTALL} -INSTALL_SCRIPT = ${INSTALL} -INSTALL_STRIP_PROGRAM = $(install_sh) -c -s -LD = /usr/bin/ld -m elf_x86_64 -LDFLAGS = -LIBOBJS = -LIBS = -LIBTOOL = $(SHELL) $(top_builddir)/libtool -LIBUDEV_CFLAGS = -LIBUDEV_LIBS = -ludev -LIPO = -LN_S = ln -s -LTLIBOBJS = -MAINT = -MAKEINFO = ${SHELL} /home/marek/dev/drm/build-aux/missing makeinfo -MANIFEST_TOOL = : -MANPAGES_STYLESHEET = http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl -MKDIR_P = /bin/mkdir -p -NM = /usr/bin/nm -B -NMEDIT = -OBJDUMP = objdump -OBJEXT = o -OTOOL = -OTOOL64 = -PACKAGE = libdrm -PACKAGE_BUGREPORT = https://bugs.freedesktop.org/enter_bug.cgi?product=DRI -PACKAGE_NAME = libdrm -PACKAGE_STRING = libdrm 2.4.56 -PACKAGE_TARNAME = libdrm -PACKAGE_URL = -PACKAGE_VERSION = 2.4.56 -PATH_SEPARATOR = : -PCIACCESS_CFLAGS = -PCIACCESS_LIBS = -lpciaccess -PKG_CONFIG = /usr/bin/pkg-config -PKG_CONFIG_LIBDIR = -PKG_CONFIG_PATH = -PTHREADSTUBS_CFLAGS = -PTHREADSTUBS_LIBS = -RANLIB = ranlib -SED = /bin/sed -SET_MAKE = -SHELL = /bin/bash -STRIP = strip -VALGRIND_CFLAGS = -I/usr/include/valgrind -VALGRIND_LIBS = -L/usr/lib/valgrind -lcoregrind-amd64-linux -lvex-amd64-linux -lgcc -VERSION = 2.4.56 -WARN_CFLAGS = -Wall -Wextra -Wsign-compare -Werror-implicit-function-declaration -Wpointer-arith -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wpacked -Wswitch-enum -Wmissing-format-attribute -Wstrict-aliasing=2 -Winit-self -Wdeclaration-after-statement -Wold-style-definition -Wno-missing-field-initializers -Wno-unused-parameter -Wno-attributes -Wno-long-long -Winline -XSLTPROC = /usr/bin/xsltproc -abs_builddir = /home/marek/dev/drm/include/drm -abs_srcdir = /home/marek/dev/drm/include/drm -abs_top_builddir = /home/marek/dev/drm -abs_top_srcdir = /home/marek/dev/drm -ac_ct_AR = ar -ac_ct_CC = gcc -ac_ct_DUMPBIN = -am__include = include -am__leading_dot = . -am__quote = -am__tar = $${TAR-tar} chof - "$$tardir" -am__untar = $${TAR-tar} xf - -bindir = ${exec_prefix}/bin -build = x86_64-unknown-linux-gnu -build_alias = -build_cpu = x86_64 -build_os = linux-gnu -build_vendor = unknown -builddir = . -datadir = ${datarootdir} -datarootdir = ${prefix}/share -docdir = ${datarootdir}/doc/${PACKAGE_TARNAME} -dvidir = ${docdir} -exec_prefix = ${prefix} -host = x86_64-unknown-linux-gnu -host_alias = -host_cpu = x86_64 -host_os = linux-gnu -host_vendor = unknown -htmldir = ${docdir} -includedir = ${prefix}/include -infodir = ${datarootdir}/info -install_sh = ${SHELL} /home/marek/dev/drm/build-aux/install-sh -kernel_source = -libdir = /usr/lib/x86_64-linux-gnu -libexecdir = ${exec_prefix}/libexec -localedir = ${datarootdir}/locale -localstatedir = ${prefix}/var -mandir = ${datarootdir}/man -mkdir_p = $(MKDIR_P) -oldincludedir = /usr/include -pdfdir = ${docdir} -pkgconfigdir = /usr/lib/x86_64-linux-gnu/pkgconfig -prefix = /usr -program_transform_name = s,x,x, -psdir = ${docdir} -sbindir = ${exec_prefix}/sbin -sharedstatedir = ${prefix}/com -srcdir = . -sysconfdir = ${prefix}/etc -target_alias = -top_build_prefix = ../../ -top_builddir = ../.. -top_srcdir = ../.. -klibdrmincludedir = ${includedir}/libdrm -klibdrminclude_HEADERS = drm.h drm_mode.h drm_fourcc.h drm_sarea.h \ - i915_drm.h mga_drm.h nouveau_drm.h r128_drm.h radeon_drm.h \ - savage_drm.h sis_drm.h via_drm.h mach64_drm.h qxl_drm.h \ - $(am__append_1) -all: all-am - -.SUFFIXES: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign include/drm/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --foreign include/drm/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs -install-klibdrmincludeHEADERS: $(klibdrminclude_HEADERS) - @$(NORMAL_INSTALL) - @list='$(klibdrminclude_HEADERS)'; test -n "$(klibdrmincludedir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(klibdrmincludedir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(klibdrmincludedir)" || exit 1; \ - fi; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; \ - done | $(am__base_list) | \ - while read files; do \ - echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(klibdrmincludedir)'"; \ - $(INSTALL_HEADER) $$files "$(DESTDIR)$(klibdrmincludedir)" || exit $$?; \ - done - -uninstall-klibdrmincludeHEADERS: - @$(NORMAL_UNINSTALL) - @list='$(klibdrminclude_HEADERS)'; test -n "$(klibdrmincludedir)" || list=; \ - files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - dir='$(DESTDIR)$(klibdrmincludedir)'; $(am__uninstall_files_from_dir) - -ID: $(am__tagged_files) - $(am__define_uniq_tagged_files); mkid -fID $$unique -tags: tags-am -TAGS: tags - -tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - set x; \ - here=`pwd`; \ - $(am__define_uniq_tagged_files); \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: ctags-am - -CTAGS: ctags -ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - $(am__define_uniq_tagged_files); \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" -cscopelist: cscopelist-am - -cscopelist-am: $(am__tagged_files) - list='$(am__tagged_files)'; \ - case "$(srcdir)" in \ - [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ - *) sdir=$(subdir)/$(srcdir) ;; \ - esac; \ - for i in $$list; do \ - if test -f "$$i"; then \ - echo "$(subdir)/$$i"; \ - else \ - echo "$$sdir/$$i"; \ - fi; \ - done >> $(top_builddir)/cscope.files - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(HEADERS) -installdirs: - for dir in "$(DESTDIR)$(klibdrmincludedir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool mostlyclean-am - -distclean: distclean-am - -rm -f Makefile -distclean-am: clean-am distclean-generic distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: install-klibdrmincludeHEADERS - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-generic mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-klibdrmincludeHEADERS - -.MAKE: install-am install-strip - -.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ - clean-libtool cscopelist-am ctags ctags-am distclean \ - distclean-generic distclean-libtool distclean-tags distdir dvi \ - dvi-am html html-am info info-am install install-am \ - install-data install-data-am install-dvi install-dvi-am \ - install-exec install-exec-am install-html install-html-am \ - install-info install-info-am install-klibdrmincludeHEADERS \ - install-man install-pdf install-pdf-am install-ps \ - install-ps-am install-strip installcheck installcheck-am \ - installdirs maintainer-clean maintainer-clean-generic \ - mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ - ps ps-am tags tags-am uninstall uninstall-am \ - uninstall-klibdrmincludeHEADERS - - -# 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 libdrm-2.4.56/include/drm/Makefile.am libdrm-2.4.60/include/drm/Makefile.am --- libdrm-2.4.56/include/drm/Makefile.am 2014-07-26 18:08:30.000000000 +0000 +++ libdrm-2.4.60/include/drm/Makefile.am 1970-01-01 00:00:00.000000000 +0000 @@ -1,44 +0,0 @@ -# Copyright 2005 Adam Jackson. -# -# Permission is hereby granted, free of charge, to any person obtaining a -# copy of this software and associated documentation files (the "Software"), -# to deal in the Software without restriction, including without limitation -# on the rights to use, copy, modify, merge, publish, distribute, sub -# license, and/or sell copies of the Software, and to permit persons to whom -# the Software is furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice (including the next -# paragraph) shall be included in all copies or substantial portions of the -# Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL -# ADAM JACKSON BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -# XXX airlied says, nothing besides *_drm.h and drm*.h should be necessary. -# however, r300 and via need their reg headers installed in order to build. -# better solutions are welcome. - -klibdrmincludedir = ${includedir}/libdrm -klibdrminclude_HEADERS = \ - drm.h \ - drm_mode.h \ - drm_fourcc.h \ - drm_sarea.h \ - i915_drm.h \ - mga_drm.h \ - nouveau_drm.h \ - r128_drm.h \ - radeon_drm.h \ - savage_drm.h \ - sis_drm.h \ - via_drm.h \ - mach64_drm.h \ - qxl_drm.h - -if HAVE_VMWGFX -klibdrminclude_HEADERS += vmwgfx_drm.h -endif diff -Nru libdrm-2.4.56/include/drm/Makefile.in libdrm-2.4.60/include/drm/Makefile.in --- libdrm-2.4.56/include/drm/Makefile.in 2014-07-29 16:13:53.000000000 +0000 +++ libdrm-2.4.60/include/drm/Makefile.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,597 +0,0 @@ -# Makefile.in generated by automake 1.14.1 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994-2013 Free Software Foundation, Inc. - -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -# Copyright 2005 Adam Jackson. -# -# Permission is hereby granted, free of charge, to any person obtaining a -# copy of this software and associated documentation files (the "Software"), -# to deal in the Software without restriction, including without limitation -# on the rights to use, copy, modify, merge, publish, distribute, sub -# license, and/or sell copies of the Software, and to permit persons to whom -# the Software is furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice (including the next -# paragraph) shall be included in all copies or substantial portions of the -# Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL -# ADAM JACKSON BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -# XXX airlied says, nothing besides *_drm.h and drm*.h should be necessary. -# however, r300 and via need their reg headers installed in order to build. -# better solutions are welcome. - -VPATH = @srcdir@ -am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' -am__make_running_with_option = \ - case $${target_option-} in \ - ?) ;; \ - *) echo "am__make_running_with_option: internal error: invalid" \ - "target option '$${target_option-}' specified" >&2; \ - exit 1;; \ - esac; \ - has_opt=no; \ - sane_makeflags=$$MAKEFLAGS; \ - if $(am__is_gnu_make); then \ - sane_makeflags=$$MFLAGS; \ - else \ - case $$MAKEFLAGS in \ - *\\[\ \ ]*) \ - bs=\\; \ - sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ - | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ - esac; \ - fi; \ - skip_next=no; \ - strip_trailopt () \ - { \ - flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ - }; \ - for flg in $$sane_makeflags; do \ - test $$skip_next = yes && { skip_next=no; continue; }; \ - case $$flg in \ - *=*|--*) continue;; \ - -*I) strip_trailopt 'I'; skip_next=yes;; \ - -*I?*) strip_trailopt 'I';; \ - -*O) strip_trailopt 'O'; skip_next=yes;; \ - -*O?*) strip_trailopt 'O';; \ - -*l) strip_trailopt 'l'; skip_next=yes;; \ - -*l?*) strip_trailopt 'l';; \ - -[dEDm]) skip_next=yes;; \ - -[JT]) skip_next=yes;; \ - esac; \ - case $$flg in \ - *$$target_option*) has_opt=yes; break;; \ - esac; \ - done; \ - test $$has_opt = yes -am__make_dryrun = (target_option=n; $(am__make_running_with_option)) -am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -@HAVE_VMWGFX_TRUE@am__append_1 = vmwgfx_drm.h -subdir = include/drm -DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ - $(am__klibdrminclude_HEADERS_DIST) -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -AM_V_P = $(am__v_P_@AM_V@) -am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) -am__v_P_0 = false -am__v_P_1 = : -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -am__v_GEN_1 = -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -am__v_at_1 = -SOURCES = -DIST_SOURCES = -am__can_run_installinfo = \ - case $$AM_UPDATE_INFO_DIR in \ - n|no|NO) false;; \ - *) (install-info --version) >/dev/null 2>&1;; \ - esac -am__klibdrminclude_HEADERS_DIST = drm.h drm_mode.h drm_fourcc.h \ - drm_sarea.h i915_drm.h mga_drm.h nouveau_drm.h r128_drm.h \ - radeon_drm.h savage_drm.h sis_drm.h via_drm.h mach64_drm.h \ - qxl_drm.h vmwgfx_drm.h -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } -am__installdirs = "$(DESTDIR)$(klibdrmincludedir)" -HEADERS = $(klibdrminclude_HEADERS) -am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) -# Read a list of newline-separated strings from the standard input, -# and print each of them once, without duplicates. Input order is -# *not* preserved. -am__uniquify_input = $(AWK) '\ - BEGIN { nonempty = 0; } \ - { items[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in items) print i; }; } \ -' -# Make sure the list of sources is unique. This is necessary because, -# e.g., the same source file might be shared among _SOURCES variables -# for different programs/libraries. -am__define_uniq_tagged_files = \ - list='$(am__tagged_files)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -ALLOCA = @ALLOCA@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CAIRO_CFLAGS = @CAIRO_CFLAGS@ -CAIRO_LIBS = @CAIRO_LIBS@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CLOCK_LIB = @CLOCK_LIB@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -GREP = @GREP@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIBUDEV_CFLAGS = @LIBUDEV_CFLAGS@ -LIBUDEV_LIBS = @LIBUDEV_LIBS@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MANPAGES_STYLESHEET = @MANPAGES_STYLESHEET@ -MKDIR_P = @MKDIR_P@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PCIACCESS_CFLAGS = @PCIACCESS_CFLAGS@ -PCIACCESS_LIBS = @PCIACCESS_LIBS@ -PKG_CONFIG = @PKG_CONFIG@ -PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ -PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ -PTHREADSTUBS_CFLAGS = @PTHREADSTUBS_CFLAGS@ -PTHREADSTUBS_LIBS = @PTHREADSTUBS_LIBS@ -RANLIB = @RANLIB@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ -VALGRIND_LIBS = @VALGRIND_LIBS@ -VERSION = @VERSION@ -WARN_CFLAGS = @WARN_CFLAGS@ -XSLTPROC = @XSLTPROC@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -kernel_source = @kernel_source@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -pkgconfigdir = @pkgconfigdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -klibdrmincludedir = ${includedir}/libdrm -klibdrminclude_HEADERS = drm.h drm_mode.h drm_fourcc.h drm_sarea.h \ - i915_drm.h mga_drm.h nouveau_drm.h r128_drm.h radeon_drm.h \ - savage_drm.h sis_drm.h via_drm.h mach64_drm.h qxl_drm.h \ - $(am__append_1) -all: all-am - -.SUFFIXES: -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign include/drm/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --foreign include/drm/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs -install-klibdrmincludeHEADERS: $(klibdrminclude_HEADERS) - @$(NORMAL_INSTALL) - @list='$(klibdrminclude_HEADERS)'; test -n "$(klibdrmincludedir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(klibdrmincludedir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(klibdrmincludedir)" || exit 1; \ - fi; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; \ - done | $(am__base_list) | \ - while read files; do \ - echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(klibdrmincludedir)'"; \ - $(INSTALL_HEADER) $$files "$(DESTDIR)$(klibdrmincludedir)" || exit $$?; \ - done - -uninstall-klibdrmincludeHEADERS: - @$(NORMAL_UNINSTALL) - @list='$(klibdrminclude_HEADERS)'; test -n "$(klibdrmincludedir)" || list=; \ - files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - dir='$(DESTDIR)$(klibdrmincludedir)'; $(am__uninstall_files_from_dir) - -ID: $(am__tagged_files) - $(am__define_uniq_tagged_files); mkid -fID $$unique -tags: tags-am -TAGS: tags - -tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - set x; \ - here=`pwd`; \ - $(am__define_uniq_tagged_files); \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: ctags-am - -CTAGS: ctags -ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - $(am__define_uniq_tagged_files); \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" -cscopelist: cscopelist-am - -cscopelist-am: $(am__tagged_files) - list='$(am__tagged_files)'; \ - case "$(srcdir)" in \ - [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ - *) sdir=$(subdir)/$(srcdir) ;; \ - esac; \ - for i in $$list; do \ - if test -f "$$i"; then \ - echo "$(subdir)/$$i"; \ - else \ - echo "$$sdir/$$i"; \ - fi; \ - done >> $(top_builddir)/cscope.files - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(HEADERS) -installdirs: - for dir in "$(DESTDIR)$(klibdrmincludedir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool mostlyclean-am - -distclean: distclean-am - -rm -f Makefile -distclean-am: clean-am distclean-generic distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: install-klibdrmincludeHEADERS - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-generic mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-klibdrmincludeHEADERS - -.MAKE: install-am install-strip - -.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ - clean-libtool cscopelist-am ctags ctags-am distclean \ - distclean-generic distclean-libtool distclean-tags distdir dvi \ - dvi-am html html-am info info-am install install-am \ - install-data install-data-am install-dvi install-dvi-am \ - install-exec install-exec-am install-html install-html-am \ - install-info install-info-am install-klibdrmincludeHEADERS \ - install-man install-pdf install-pdf-am install-ps \ - install-ps-am install-strip installcheck installcheck-am \ - installdirs maintainer-clean maintainer-clean-generic \ - mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ - ps ps-am tags tags-am uninstall uninstall-am \ - uninstall-klibdrmincludeHEADERS - - -# 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 libdrm-2.4.56/include/drm/tegra_drm.h libdrm-2.4.60/include/drm/tegra_drm.h --- libdrm-2.4.56/include/drm/tegra_drm.h 1970-01-01 00:00:00.000000000 +0000 +++ libdrm-2.4.60/include/drm/tegra_drm.h 2015-02-28 18:34:25.000000000 +0000 @@ -0,0 +1,200 @@ +/* + * Copyright (c) 2012-2013, NVIDIA CORPORATION. All rights reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#ifndef _UAPI_TEGRA_DRM_H_ +#define _UAPI_TEGRA_DRM_H_ + +#include + +#define DRM_TEGRA_GEM_CREATE_TILED (1 << 0) +#define DRM_TEGRA_GEM_CREATE_BOTTOM_UP (1 << 1) + +struct drm_tegra_gem_create { + __u64 size; + __u32 flags; + __u32 handle; +}; + +struct drm_tegra_gem_mmap { + __u32 handle; + __u32 offset; +}; + +struct drm_tegra_syncpt_read { + __u32 id; + __u32 value; +}; + +struct drm_tegra_syncpt_incr { + __u32 id; + __u32 pad; +}; + +struct drm_tegra_syncpt_wait { + __u32 id; + __u32 thresh; + __u32 timeout; + __u32 value; +}; + +#define DRM_TEGRA_NO_TIMEOUT (0xffffffff) + +struct drm_tegra_open_channel { + __u32 client; + __u32 pad; + __u64 context; +}; + +struct drm_tegra_close_channel { + __u64 context; +}; + +struct drm_tegra_get_syncpt { + __u64 context; + __u32 index; + __u32 id; +}; + +struct drm_tegra_get_syncpt_base { + __u64 context; + __u32 syncpt; + __u32 id; +}; + +struct drm_tegra_syncpt { + __u32 id; + __u32 incrs; +}; + +struct drm_tegra_cmdbuf { + __u32 handle; + __u32 offset; + __u32 words; + __u32 pad; +}; + +struct drm_tegra_reloc { + struct { + __u32 handle; + __u32 offset; + } cmdbuf; + struct { + __u32 handle; + __u32 offset; + } target; + __u32 shift; + __u32 pad; +}; + +struct drm_tegra_waitchk { + __u32 handle; + __u32 offset; + __u32 syncpt; + __u32 thresh; +}; + +struct drm_tegra_submit { + __u64 context; + __u32 num_syncpts; + __u32 num_cmdbufs; + __u32 num_relocs; + __u32 num_waitchks; + __u32 waitchk_mask; + __u32 timeout; + __u64 syncpts; + __u64 cmdbufs; + __u64 relocs; + __u64 waitchks; + __u32 fence; /* Return value */ + + __u32 reserved[5]; /* future expansion */ +}; + +#define DRM_TEGRA_GEM_TILING_MODE_PITCH 0 +#define DRM_TEGRA_GEM_TILING_MODE_TILED 1 +#define DRM_TEGRA_GEM_TILING_MODE_BLOCK 2 + +struct drm_tegra_gem_set_tiling { + /* input */ + __u32 handle; + __u32 mode; + __u32 value; + __u32 pad; +}; + +struct drm_tegra_gem_get_tiling { + /* input */ + __u32 handle; + /* output */ + __u32 mode; + __u32 value; + __u32 pad; +}; + +#define DRM_TEGRA_GEM_BOTTOM_UP (1 << 0) +#define DRM_TEGRA_GEM_FLAGS (DRM_TEGRA_GEM_BOTTOM_UP) + +struct drm_tegra_gem_set_flags { + /* input */ + __u32 handle; + /* output */ + __u32 flags; +}; + +struct drm_tegra_gem_get_flags { + /* input */ + __u32 handle; + /* output */ + __u32 flags; +}; + +#define DRM_TEGRA_GEM_CREATE 0x00 +#define DRM_TEGRA_GEM_MMAP 0x01 +#define DRM_TEGRA_SYNCPT_READ 0x02 +#define DRM_TEGRA_SYNCPT_INCR 0x03 +#define DRM_TEGRA_SYNCPT_WAIT 0x04 +#define DRM_TEGRA_OPEN_CHANNEL 0x05 +#define DRM_TEGRA_CLOSE_CHANNEL 0x06 +#define DRM_TEGRA_GET_SYNCPT 0x07 +#define DRM_TEGRA_SUBMIT 0x08 +#define DRM_TEGRA_GET_SYNCPT_BASE 0x09 +#define DRM_TEGRA_GEM_SET_TILING 0x0a +#define DRM_TEGRA_GEM_GET_TILING 0x0b +#define DRM_TEGRA_GEM_SET_FLAGS 0x0c +#define DRM_TEGRA_GEM_GET_FLAGS 0x0d + +#define DRM_IOCTL_TEGRA_GEM_CREATE DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_GEM_CREATE, struct drm_tegra_gem_create) +#define DRM_IOCTL_TEGRA_GEM_MMAP DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_GEM_MMAP, struct drm_tegra_gem_mmap) +#define DRM_IOCTL_TEGRA_SYNCPT_READ DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_SYNCPT_READ, struct drm_tegra_syncpt_read) +#define DRM_IOCTL_TEGRA_SYNCPT_INCR DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_SYNCPT_INCR, struct drm_tegra_syncpt_incr) +#define DRM_IOCTL_TEGRA_SYNCPT_WAIT DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_SYNCPT_WAIT, struct drm_tegra_syncpt_wait) +#define DRM_IOCTL_TEGRA_OPEN_CHANNEL DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_OPEN_CHANNEL, struct drm_tegra_open_channel) +#define DRM_IOCTL_TEGRA_CLOSE_CHANNEL DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_CLOSE_CHANNEL, struct drm_tegra_open_channel) +#define DRM_IOCTL_TEGRA_GET_SYNCPT DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_GET_SYNCPT, struct drm_tegra_get_syncpt) +#define DRM_IOCTL_TEGRA_SUBMIT DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_SUBMIT, struct drm_tegra_submit) +#define DRM_IOCTL_TEGRA_GET_SYNCPT_BASE DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_GET_SYNCPT_BASE, struct drm_tegra_get_syncpt_base) +#define DRM_IOCTL_TEGRA_GEM_SET_TILING DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_GEM_SET_TILING, struct drm_tegra_gem_set_tiling) +#define DRM_IOCTL_TEGRA_GEM_GET_TILING DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_GEM_GET_TILING, struct drm_tegra_gem_get_tiling) +#define DRM_IOCTL_TEGRA_GEM_SET_FLAGS DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_GEM_SET_FLAGS, struct drm_tegra_gem_set_flags) +#define DRM_IOCTL_TEGRA_GEM_GET_FLAGS DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_GEM_GET_FLAGS, struct drm_tegra_gem_get_flags) + +#endif diff -Nru libdrm-2.4.56/include/Makefile.am libdrm-2.4.60/include/Makefile.am --- libdrm-2.4.56/include/Makefile.am 2013-08-12 18:00:58.000000000 +0000 +++ libdrm-2.4.60/include/Makefile.am 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -SUBDIRS = drm diff -Nru libdrm-2.4.56/include/Makefile.in libdrm-2.4.60/include/Makefile.in --- libdrm-2.4.56/include/Makefile.in 2014-07-29 16:13:53.000000000 +0000 +++ libdrm-2.4.60/include/Makefile.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,623 +0,0 @@ -# Makefile.in generated by automake 1.14.1 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994-2013 Free Software Foundation, Inc. - -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ -VPATH = @srcdir@ -am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' -am__make_running_with_option = \ - case $${target_option-} in \ - ?) ;; \ - *) echo "am__make_running_with_option: internal error: invalid" \ - "target option '$${target_option-}' specified" >&2; \ - exit 1;; \ - esac; \ - has_opt=no; \ - sane_makeflags=$$MAKEFLAGS; \ - if $(am__is_gnu_make); then \ - sane_makeflags=$$MFLAGS; \ - else \ - case $$MAKEFLAGS in \ - *\\[\ \ ]*) \ - bs=\\; \ - sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ - | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ - esac; \ - fi; \ - skip_next=no; \ - strip_trailopt () \ - { \ - flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ - }; \ - for flg in $$sane_makeflags; do \ - test $$skip_next = yes && { skip_next=no; continue; }; \ - case $$flg in \ - *=*|--*) continue;; \ - -*I) strip_trailopt 'I'; skip_next=yes;; \ - -*I?*) strip_trailopt 'I';; \ - -*O) strip_trailopt 'O'; skip_next=yes;; \ - -*O?*) strip_trailopt 'O';; \ - -*l) strip_trailopt 'l'; skip_next=yes;; \ - -*l?*) strip_trailopt 'l';; \ - -[dEDm]) skip_next=yes;; \ - -[JT]) skip_next=yes;; \ - esac; \ - case $$flg in \ - *$$target_option*) has_opt=yes; break;; \ - esac; \ - done; \ - test $$has_opt = yes -am__make_dryrun = (target_option=n; $(am__make_running_with_option)) -am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -subdir = include -DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -AM_V_P = $(am__v_P_@AM_V@) -am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) -am__v_P_0 = false -am__v_P_1 = : -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -am__v_GEN_1 = -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -am__v_at_1 = -SOURCES = -DIST_SOURCES = -RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ - ctags-recursive dvi-recursive html-recursive info-recursive \ - install-data-recursive install-dvi-recursive \ - install-exec-recursive install-html-recursive \ - install-info-recursive install-pdf-recursive \ - install-ps-recursive install-recursive installcheck-recursive \ - installdirs-recursive pdf-recursive ps-recursive \ - tags-recursive uninstall-recursive -am__can_run_installinfo = \ - case $$AM_UPDATE_INFO_DIR in \ - n|no|NO) false;; \ - *) (install-info --version) >/dev/null 2>&1;; \ - esac -RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ - distclean-recursive maintainer-clean-recursive -am__recursive_targets = \ - $(RECURSIVE_TARGETS) \ - $(RECURSIVE_CLEAN_TARGETS) \ - $(am__extra_recursive_targets) -AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ - distdir -am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) -# Read a list of newline-separated strings from the standard input, -# and print each of them once, without duplicates. Input order is -# *not* preserved. -am__uniquify_input = $(AWK) '\ - BEGIN { nonempty = 0; } \ - { items[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in items) print i; }; } \ -' -# Make sure the list of sources is unique. This is necessary because, -# e.g., the same source file might be shared among _SOURCES variables -# for different programs/libraries. -am__define_uniq_tagged_files = \ - list='$(am__tagged_files)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags -DIST_SUBDIRS = $(SUBDIRS) -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -am__relativize = \ - dir0=`pwd`; \ - sed_first='s,^\([^/]*\)/.*$$,\1,'; \ - sed_rest='s,^[^/]*/*,,'; \ - sed_last='s,^.*/\([^/]*\)$$,\1,'; \ - sed_butlast='s,/*[^/]*$$,,'; \ - while test -n "$$dir1"; do \ - first=`echo "$$dir1" | sed -e "$$sed_first"`; \ - if test "$$first" != "."; then \ - if test "$$first" = ".."; then \ - dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ - dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ - else \ - first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ - if test "$$first2" = "$$first"; then \ - dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ - else \ - dir2="../$$dir2"; \ - fi; \ - dir0="$$dir0"/"$$first"; \ - fi; \ - fi; \ - dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ - done; \ - reldir="$$dir2" -ACLOCAL = @ACLOCAL@ -ALLOCA = @ALLOCA@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CAIRO_CFLAGS = @CAIRO_CFLAGS@ -CAIRO_LIBS = @CAIRO_LIBS@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CLOCK_LIB = @CLOCK_LIB@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -GREP = @GREP@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIBUDEV_CFLAGS = @LIBUDEV_CFLAGS@ -LIBUDEV_LIBS = @LIBUDEV_LIBS@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MANPAGES_STYLESHEET = @MANPAGES_STYLESHEET@ -MKDIR_P = @MKDIR_P@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PCIACCESS_CFLAGS = @PCIACCESS_CFLAGS@ -PCIACCESS_LIBS = @PCIACCESS_LIBS@ -PKG_CONFIG = @PKG_CONFIG@ -PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ -PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ -PTHREADSTUBS_CFLAGS = @PTHREADSTUBS_CFLAGS@ -PTHREADSTUBS_LIBS = @PTHREADSTUBS_LIBS@ -RANLIB = @RANLIB@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ -VALGRIND_LIBS = @VALGRIND_LIBS@ -VERSION = @VERSION@ -WARN_CFLAGS = @WARN_CFLAGS@ -XSLTPROC = @XSLTPROC@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -kernel_source = @kernel_source@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -pkgconfigdir = @pkgconfigdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -SUBDIRS = drm -all: all-recursive - -.SUFFIXES: -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign include/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --foreign include/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -# This directory's subdirectories are mostly independent; you can cd -# into them and run 'make' without going through this Makefile. -# To change the values of 'make' variables: instead of editing Makefiles, -# (1) if the variable is set in 'config.status', edit 'config.status' -# (which will cause the Makefiles to be regenerated when you run 'make'); -# (2) otherwise, pass the desired values on the 'make' command line. -$(am__recursive_targets): - @fail=; \ - if $(am__make_keepgoing); then \ - failcom='fail=yes'; \ - else \ - failcom='exit 1'; \ - fi; \ - dot_seen=no; \ - target=`echo $@ | sed s/-recursive//`; \ - case "$@" in \ - distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ - *) list='$(SUBDIRS)' ;; \ - esac; \ - for subdir in $$list; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - dot_seen=yes; \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done; \ - if test "$$dot_seen" = "no"; then \ - $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ - fi; test -z "$$fail" - -ID: $(am__tagged_files) - $(am__define_uniq_tagged_files); mkid -fID $$unique -tags: tags-recursive -TAGS: tags - -tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - set x; \ - here=`pwd`; \ - if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ - include_option=--etags-include; \ - empty_fix=.; \ - else \ - include_option=--include; \ - empty_fix=; \ - fi; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test ! -f $$subdir/TAGS || \ - set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ - fi; \ - done; \ - $(am__define_uniq_tagged_files); \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: ctags-recursive - -CTAGS: ctags -ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - $(am__define_uniq_tagged_files); \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" -cscopelist: cscopelist-recursive - -cscopelist-am: $(am__tagged_files) - list='$(am__tagged_files)'; \ - case "$(srcdir)" in \ - [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ - *) sdir=$(subdir)/$(srcdir) ;; \ - esac; \ - for i in $$list; do \ - if test -f "$$i"; then \ - echo "$(subdir)/$$i"; \ - else \ - echo "$$sdir/$$i"; \ - fi; \ - done >> $(top_builddir)/cscope.files - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done - @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - $(am__make_dryrun) \ - || test -d "$(distdir)/$$subdir" \ - || $(MKDIR_P) "$(distdir)/$$subdir" \ - || exit 1; \ - dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ - $(am__relativize); \ - new_distdir=$$reldir; \ - dir1=$$subdir; dir2="$(top_distdir)"; \ - $(am__relativize); \ - new_top_distdir=$$reldir; \ - echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ - echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ - ($(am__cd) $$subdir && \ - $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$$new_top_distdir" \ - distdir="$$new_distdir" \ - am__remove_distdir=: \ - am__skip_length_check=: \ - am__skip_mode_fix=: \ - distdir) \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-recursive -all-am: Makefile -installdirs: installdirs-recursive -installdirs-am: -install: install-recursive -install-exec: install-exec-recursive -install-data: install-data-recursive -uninstall: uninstall-recursive - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-recursive -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-recursive - -clean-am: clean-generic clean-libtool mostlyclean-am - -distclean: distclean-recursive - -rm -f Makefile -distclean-am: clean-am distclean-generic distclean-tags - -dvi: dvi-recursive - -dvi-am: - -html: html-recursive - -html-am: - -info: info-recursive - -info-am: - -install-data-am: - -install-dvi: install-dvi-recursive - -install-dvi-am: - -install-exec-am: - -install-html: install-html-recursive - -install-html-am: - -install-info: install-info-recursive - -install-info-am: - -install-man: - -install-pdf: install-pdf-recursive - -install-pdf-am: - -install-ps: install-ps-recursive - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-recursive - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-recursive - -mostlyclean-am: mostlyclean-generic mostlyclean-libtool - -pdf: pdf-recursive - -pdf-am: - -ps: ps-recursive - -ps-am: - -uninstall-am: - -.MAKE: $(am__recursive_targets) install-am install-strip - -.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ - check-am clean clean-generic clean-libtool cscopelist-am ctags \ - ctags-am distclean distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-ps install-ps-am \ - install-strip installcheck installcheck-am installdirs \ - installdirs-am maintainer-clean maintainer-clean-generic \ - mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ - ps ps-am tags tags-am uninstall uninstall-am - - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff -Nru libdrm-2.4.56/intel/Android.mk libdrm-2.4.60/intel/Android.mk --- libdrm-2.4.56/intel/Android.mk 1970-01-01 00:00:00.000000000 +0000 +++ libdrm-2.4.60/intel/Android.mk 2015-02-28 18:34:25.000000000 +0000 @@ -0,0 +1,53 @@ +# +# 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. +# + +LOCAL_PATH := $(call my-dir) +include $(CLEAR_VARS) + +# Import variables LIBDRM_INTEL_FILES, LIBDRM_INTEL_H_FILES +include $(LOCAL_PATH)/Makefile.sources + +LOCAL_MODULE := libdrm_intel +LOCAL_MODULE_TAGS := optional + +LOCAL_SRC_FILES := $(LIBDRM_INTEL_FILES) +LOCAL_EXPORT_C_INCLUDE_DIRS += \ + $(LOCAL_PATH)/intel + +LOCAL_C_INCLUDES := \ + $(LIBDRM_TOP) \ + $(LIBDRM_TOP)/intel \ + $(LIBDRM_TOP)/include/drm \ + external/libpciaccess/include + +LOCAL_CFLAGS := \ + -DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1 + +LOCAL_COPY_HEADERS := $(LIBDRM_INTEL_H_FILES) +LOCAL_COPY_HEADERS_TO := libdrm + +LOCAL_SHARED_LIBRARIES := \ + libdrm \ + libpciaccess + +include $(BUILD_SHARED_LIBRARY) diff -Nru libdrm-2.4.56/intel/intel_bufmgr.c libdrm-2.4.60/intel/intel_bufmgr.c --- libdrm-2.4.56/intel/intel_bufmgr.c 2013-08-12 18:01:14.000000000 +0000 +++ libdrm-2.4.60/intel/intel_bufmgr.c 2015-02-28 18:32:39.000000000 +0000 @@ -37,6 +37,7 @@ #include #include #include +#include "libdrm.h" #include "intel_bufmgr.h" #include "intel_bufmgr_priv.h" #include "xf86drm.h" @@ -46,21 +47,35 @@ * Convenience functions for buffer management methods. */ -drm_intel_bo *drm_intel_bo_alloc(drm_intel_bufmgr *bufmgr, const char *name, - unsigned long size, unsigned int alignment) +drm_public drm_intel_bo * +drm_intel_bo_alloc(drm_intel_bufmgr *bufmgr, const char *name, + unsigned long size, unsigned int alignment) { return bufmgr->bo_alloc(bufmgr, name, size, alignment); } -drm_intel_bo *drm_intel_bo_alloc_for_render(drm_intel_bufmgr *bufmgr, - const char *name, - unsigned long size, - unsigned int alignment) +drm_public drm_intel_bo * +drm_intel_bo_alloc_for_render(drm_intel_bufmgr *bufmgr, const char *name, + unsigned long size, unsigned int alignment) { return bufmgr->bo_alloc_for_render(bufmgr, name, size, alignment); } -drm_intel_bo * +drm_public drm_intel_bo * +drm_intel_bo_alloc_userptr(drm_intel_bufmgr *bufmgr, + const char *name, void *addr, + uint32_t tiling_mode, + uint32_t stride, + unsigned long size, + unsigned long flags) +{ + if (bufmgr->bo_alloc_userptr) + return bufmgr->bo_alloc_userptr(bufmgr, name, addr, tiling_mode, + stride, size, flags); + return NULL; +} + +drm_public drm_intel_bo * drm_intel_bo_alloc_tiled(drm_intel_bufmgr *bufmgr, const char *name, int x, int y, int cpp, uint32_t *tiling_mode, unsigned long *pitch, unsigned long flags) @@ -69,12 +84,14 @@ tiling_mode, pitch, flags); } -void drm_intel_bo_reference(drm_intel_bo *bo) +drm_public void +drm_intel_bo_reference(drm_intel_bo *bo) { bo->bufmgr->bo_reference(bo); } -void drm_intel_bo_unreference(drm_intel_bo *bo) +drm_public void +drm_intel_bo_unreference(drm_intel_bo *bo) { if (bo == NULL) return; @@ -82,24 +99,26 @@ bo->bufmgr->bo_unreference(bo); } -int drm_intel_bo_map(drm_intel_bo *buf, int write_enable) +drm_public int +drm_intel_bo_map(drm_intel_bo *buf, int write_enable) { return buf->bufmgr->bo_map(buf, write_enable); } -int drm_intel_bo_unmap(drm_intel_bo *buf) +drm_public int +drm_intel_bo_unmap(drm_intel_bo *buf) { return buf->bufmgr->bo_unmap(buf); } -int +drm_public int drm_intel_bo_subdata(drm_intel_bo *bo, unsigned long offset, unsigned long size, const void *data) { return bo->bufmgr->bo_subdata(bo, offset, size, data); } -int +drm_public int drm_intel_bo_get_subdata(drm_intel_bo *bo, unsigned long offset, unsigned long size, void *data) { @@ -118,24 +137,26 @@ return 0; } -void drm_intel_bo_wait_rendering(drm_intel_bo *bo) +drm_public void +drm_intel_bo_wait_rendering(drm_intel_bo *bo) { bo->bufmgr->bo_wait_rendering(bo); } -void drm_intel_bufmgr_destroy(drm_intel_bufmgr *bufmgr) +drm_public void +drm_intel_bufmgr_destroy(drm_intel_bufmgr *bufmgr) { bufmgr->destroy(bufmgr); } -int +drm_public int drm_intel_bo_exec(drm_intel_bo *bo, int used, drm_clip_rect_t * cliprects, int num_cliprects, int DR4) { return bo->bufmgr->bo_exec(bo, used, cliprects, num_cliprects, DR4); } -int +drm_public int drm_intel_bo_mrb_exec(drm_intel_bo *bo, int used, drm_clip_rect_t *cliprects, int num_cliprects, int DR4, unsigned int rings) @@ -155,17 +176,20 @@ } } -void drm_intel_bufmgr_set_debug(drm_intel_bufmgr *bufmgr, int enable_debug) +drm_public void +drm_intel_bufmgr_set_debug(drm_intel_bufmgr *bufmgr, int enable_debug) { bufmgr->debug = enable_debug; } -int drm_intel_bufmgr_check_aperture_space(drm_intel_bo ** bo_array, int count) +drm_public int +drm_intel_bufmgr_check_aperture_space(drm_intel_bo ** bo_array, int count) { return bo_array[0]->bufmgr->check_aperture_space(bo_array, count); } -int drm_intel_bo_flink(drm_intel_bo *bo, uint32_t * name) +drm_public int +drm_intel_bo_flink(drm_intel_bo *bo, uint32_t * name) { if (bo->bufmgr->bo_flink) return bo->bufmgr->bo_flink(bo, name); @@ -173,7 +197,7 @@ return -ENODEV; } -int +drm_public int drm_intel_bo_emit_reloc(drm_intel_bo *bo, uint32_t offset, drm_intel_bo *target_bo, uint32_t target_offset, uint32_t read_domains, uint32_t write_domain) @@ -184,7 +208,7 @@ } /* For fence registers, not GL fences */ -int +drm_public int drm_intel_bo_emit_reloc_fence(drm_intel_bo *bo, uint32_t offset, drm_intel_bo *target_bo, uint32_t target_offset, uint32_t read_domains, uint32_t write_domain) @@ -195,7 +219,8 @@ } -int drm_intel_bo_pin(drm_intel_bo *bo, uint32_t alignment) +drm_public int +drm_intel_bo_pin(drm_intel_bo *bo, uint32_t alignment) { if (bo->bufmgr->bo_pin) return bo->bufmgr->bo_pin(bo, alignment); @@ -203,7 +228,8 @@ return -ENODEV; } -int drm_intel_bo_unpin(drm_intel_bo *bo) +drm_public int +drm_intel_bo_unpin(drm_intel_bo *bo) { if (bo->bufmgr->bo_unpin) return bo->bufmgr->bo_unpin(bo); @@ -211,8 +237,9 @@ return -ENODEV; } -int drm_intel_bo_set_tiling(drm_intel_bo *bo, uint32_t * tiling_mode, - uint32_t stride) +drm_public int +drm_intel_bo_set_tiling(drm_intel_bo *bo, uint32_t * tiling_mode, + uint32_t stride) { if (bo->bufmgr->bo_set_tiling) return bo->bufmgr->bo_set_tiling(bo, tiling_mode, stride); @@ -221,8 +248,9 @@ return 0; } -int drm_intel_bo_get_tiling(drm_intel_bo *bo, uint32_t * tiling_mode, - uint32_t * swizzle_mode) +drm_public int +drm_intel_bo_get_tiling(drm_intel_bo *bo, uint32_t * tiling_mode, + uint32_t * swizzle_mode) { if (bo->bufmgr->bo_get_tiling) return bo->bufmgr->bo_get_tiling(bo, tiling_mode, swizzle_mode); @@ -232,40 +260,46 @@ return 0; } -int drm_intel_bo_disable_reuse(drm_intel_bo *bo) +drm_public int +drm_intel_bo_disable_reuse(drm_intel_bo *bo) { if (bo->bufmgr->bo_disable_reuse) return bo->bufmgr->bo_disable_reuse(bo); return 0; } -int drm_intel_bo_is_reusable(drm_intel_bo *bo) +drm_public int +drm_intel_bo_is_reusable(drm_intel_bo *bo) { if (bo->bufmgr->bo_is_reusable) return bo->bufmgr->bo_is_reusable(bo); return 0; } -int drm_intel_bo_busy(drm_intel_bo *bo) +drm_public int +drm_intel_bo_busy(drm_intel_bo *bo) { if (bo->bufmgr->bo_busy) return bo->bufmgr->bo_busy(bo); return 0; } -int drm_intel_bo_madvise(drm_intel_bo *bo, int madv) +drm_public int +drm_intel_bo_madvise(drm_intel_bo *bo, int madv) { if (bo->bufmgr->bo_madvise) return bo->bufmgr->bo_madvise(bo, madv); return -1; } -int drm_intel_bo_references(drm_intel_bo *bo, drm_intel_bo *target_bo) +drm_public int +drm_intel_bo_references(drm_intel_bo *bo, drm_intel_bo *target_bo) { return bo->bufmgr->bo_references(bo, target_bo); } -int drm_intel_get_pipe_from_crtc_id(drm_intel_bufmgr *bufmgr, int crtc_id) +drm_public int +drm_intel_get_pipe_from_crtc_id(drm_intel_bufmgr *bufmgr, int crtc_id) { if (bufmgr->get_pipe_from_crtc_id) return bufmgr->get_pipe_from_crtc_id(bufmgr, crtc_id); @@ -298,9 +332,8 @@ return size; } -int drm_intel_get_aperture_sizes(int fd, - size_t *mappable, - size_t *total) +drm_public int +drm_intel_get_aperture_sizes(int fd, size_t *mappable, size_t *total) { struct drm_i915_gem_get_aperture aperture; diff -Nru libdrm-2.4.56/intel/intel_bufmgr_fake.c libdrm-2.4.60/intel/intel_bufmgr_fake.c --- libdrm-2.4.56/intel/intel_bufmgr_fake.c 2014-05-30 16:38:28.000000000 +0000 +++ libdrm-2.4.60/intel/intel_bufmgr_fake.c 2015-02-28 18:32:39.000000000 +0000 @@ -49,6 +49,7 @@ #include "drm.h" #include "i915_drm.h" #include "mm.h" +#include "libdrm.h" #include "libdrm_lists.h" /* Support gcc's __FUNCTION__ for people using other compilers */ @@ -248,7 +249,7 @@ return 0; } -void +drm_public void drm_intel_bufmgr_fake_set_fence_callback(drm_intel_bufmgr *bufmgr, unsigned int (*emit) (void *priv), void (*wait) (unsigned int fence, @@ -771,7 +772,7 @@ * -- just evict everything * -- and wait for idle */ -void +drm_public void drm_intel_bufmgr_fake_contended_lock_take(drm_intel_bufmgr *bufmgr) { drm_intel_bufmgr_fake *bufmgr_fake = (drm_intel_bufmgr_fake *) bufmgr; @@ -867,7 +868,7 @@ 4096); } -drm_intel_bo * +drm_public drm_intel_bo * drm_intel_bo_fake_alloc_static(drm_intel_bufmgr *bufmgr, const char *name, unsigned long offset, @@ -962,7 +963,7 @@ * Set the buffer as not requiring backing store, and instead get the callback * invoked whenever it would be set dirty. */ -void +drm_public void drm_intel_bo_fake_disable_backing_store(drm_intel_bo *bo, void (*invalidate_cb) (drm_intel_bo *bo, void *ptr), @@ -1416,7 +1417,7 @@ bo_fake->write_domain = 0; } -void +drm_public void drm_intel_bufmgr_fake_set_exec_callback(drm_intel_bufmgr *bufmgr, int (*exec) (drm_intel_bo *bo, unsigned int used, @@ -1539,7 +1540,8 @@ * Used by the X Server on LeaveVT, when the card memory is no longer our * own. */ -void drm_intel_bufmgr_fake_evict_all(drm_intel_bufmgr *bufmgr) +drm_public void +drm_intel_bufmgr_fake_evict_all(drm_intel_bufmgr *bufmgr) { drm_intel_bufmgr_fake *bufmgr_fake = (drm_intel_bufmgr_fake *) bufmgr; struct block *block, *tmp; @@ -1573,21 +1575,20 @@ pthread_mutex_unlock(&bufmgr_fake->lock); } -void drm_intel_bufmgr_fake_set_last_dispatch(drm_intel_bufmgr *bufmgr, - volatile unsigned int - *last_dispatch) +drm_public void +drm_intel_bufmgr_fake_set_last_dispatch(drm_intel_bufmgr *bufmgr, + volatile unsigned int + *last_dispatch) { drm_intel_bufmgr_fake *bufmgr_fake = (drm_intel_bufmgr_fake *) bufmgr; bufmgr_fake->last_dispatch = (volatile int *)last_dispatch; } -drm_intel_bufmgr *drm_intel_bufmgr_fake_init(int fd, - unsigned long low_offset, - void *low_virtual, - unsigned long size, - volatile unsigned int - *last_dispatch) +drm_public drm_intel_bufmgr * +drm_intel_bufmgr_fake_init(int fd, unsigned long low_offset, + void *low_virtual, unsigned long size, + volatile unsigned int *last_dispatch) { drm_intel_bufmgr_fake *bufmgr_fake; diff -Nru libdrm-2.4.56/intel/intel_bufmgr_gem.c libdrm-2.4.60/intel/intel_bufmgr_gem.c --- libdrm-2.4.56/intel/intel_bufmgr_gem.c 2014-02-07 16:58:41.000000000 +0000 +++ libdrm-2.4.60/intel/intel_bufmgr_gem.c 2015-03-18 18:10:52.000000000 +0000 @@ -48,7 +48,6 @@ #include #include #include -#include #include #include #include @@ -57,6 +56,7 @@ #ifndef ETIME #define ETIME ETIMEDOUT #endif +#include "libdrm.h" #include "libdrm_lists.h" #include "intel_bufmgr.h" #include "intel_bufmgr_priv.h" @@ -74,7 +74,7 @@ #define VG(x) #endif -#define VG_CLEAR(s) VG(memset(&s, 0, sizeof(s))) +#define memclear(s) memset(&s, 0, sizeof(s)) #define DBG(...) do { \ if (bufmgr_gem->bufmgr.debug) \ @@ -93,6 +93,8 @@ typedef struct _drm_intel_bufmgr_gem { drm_intel_bufmgr bufmgr; + atomic_t refcount; + int fd; int max_relocs; @@ -110,6 +112,8 @@ int num_buckets; time_t time; + drmMMListHead managers; + drmMMListHead named; drmMMListHead vma_cache; int vma_count, vma_open, vma_max; @@ -182,6 +186,11 @@ void *mem_virtual; /** GTT virtual address for the buffer, saved across map/unmap cycles */ void *gtt_virtual; + /** + * Virtual address of the buffer allocated by user, used for userptr + * objects only. + */ + void *user_virtual; int map_count; drmMMListHead vma_list; @@ -221,6 +230,11 @@ bool idle; /** + * Boolean of whether this buffer was allocated with userptr + */ + bool is_userptr; + + /** * Size in bytes of this buffer and its relocation descendents. * * Used to avoid costly tree walking in @@ -579,7 +593,7 @@ if (bo_gem->reusable && bo_gem->idle) return false; - VG_CLEAR(busy); + memclear(busy); busy.handle = bo_gem->gem_handle; ret = drmIoctl(bufmgr_gem->fd, DRM_IOCTL_I915_GEM_BUSY, &busy); @@ -598,7 +612,7 @@ { struct drm_i915_gem_madvise madv; - VG_CLEAR(madv); + memclear(madv); madv.handle = bo_gem->gem_handle; madv.madv = state; madv.retained = 1; @@ -727,7 +741,7 @@ bo_gem->bo.size = bo_size; - VG_CLEAR(create); + memclear(create); create.size = bo_size; ret = drmIoctl(bufmgr_gem->fd, @@ -745,15 +759,16 @@ bo_gem->swizzle_mode = I915_BIT_6_SWIZZLE_NONE; bo_gem->stride = 0; + /* drm_intel_gem_bo_free calls DRMLISTDEL() for an uninitialized + list (vma_list), so better set the list head here */ + DRMINITLISTHEAD(&bo_gem->name_list); + DRMINITLISTHEAD(&bo_gem->vma_list); if (drm_intel_gem_bo_set_tiling_internal(&bo_gem->bo, tiling_mode, stride)) { drm_intel_gem_bo_free(&bo_gem->bo); return NULL; } - - DRMINITLISTHEAD(&bo_gem->name_list); - DRMINITLISTHEAD(&bo_gem->vma_list); } bo_gem->name = name; @@ -847,13 +862,87 @@ tiling, stride); } +static drm_intel_bo * +drm_intel_gem_bo_alloc_userptr(drm_intel_bufmgr *bufmgr, + const char *name, + void *addr, + uint32_t tiling_mode, + uint32_t stride, + unsigned long size, + unsigned long flags) +{ + drm_intel_bufmgr_gem *bufmgr_gem = (drm_intel_bufmgr_gem *) bufmgr; + drm_intel_bo_gem *bo_gem; + int ret; + struct drm_i915_gem_userptr userptr; + + /* Tiling with userptr surfaces is not supported + * on all hardware so refuse it for time being. + */ + if (tiling_mode != I915_TILING_NONE) + return NULL; + + bo_gem = calloc(1, sizeof(*bo_gem)); + if (!bo_gem) + return NULL; + + bo_gem->bo.size = size; + + memclear(userptr); + userptr.user_ptr = (__u64)((unsigned long)addr); + userptr.user_size = size; + userptr.flags = flags; + + ret = drmIoctl(bufmgr_gem->fd, + DRM_IOCTL_I915_GEM_USERPTR, + &userptr); + if (ret != 0) { + DBG("bo_create_userptr: " + "ioctl failed with user ptr %p size 0x%lx, " + "user flags 0x%lx\n", addr, size, flags); + free(bo_gem); + return NULL; + } + + bo_gem->gem_handle = userptr.handle; + bo_gem->bo.handle = bo_gem->gem_handle; + bo_gem->bo.bufmgr = bufmgr; + bo_gem->is_userptr = true; + bo_gem->bo.virtual = addr; + /* Save the address provided by user */ + bo_gem->user_virtual = addr; + bo_gem->tiling_mode = I915_TILING_NONE; + bo_gem->swizzle_mode = I915_BIT_6_SWIZZLE_NONE; + bo_gem->stride = 0; + + DRMINITLISTHEAD(&bo_gem->name_list); + DRMINITLISTHEAD(&bo_gem->vma_list); + + bo_gem->name = name; + atomic_set(&bo_gem->refcount, 1); + bo_gem->validate_index = -1; + bo_gem->reloc_tree_fences = 0; + bo_gem->used_as_reloc_target = false; + bo_gem->has_error = false; + bo_gem->reusable = false; + + drm_intel_bo_gem_set_in_aperture_size(bufmgr_gem, bo_gem); + + DBG("bo_create_userptr: " + "ptr %p buf %d (%s) size %ldb, stride 0x%x, tile mode %d\n", + addr, bo_gem->gem_handle, bo_gem->name, + size, stride, tiling_mode); + + return &bo_gem->bo; +} + /** * Returns a drm_intel_bo wrapping the given buffer object handle. * * This can be used when one application needs to pass a buffer object * to another. */ -drm_intel_bo * +drm_public drm_intel_bo * drm_intel_bo_gem_create_from_name(drm_intel_bufmgr *bufmgr, const char *name, unsigned int handle) @@ -871,17 +960,19 @@ * alternating names for the front/back buffer a linear search * provides a sufficiently fast match. */ + pthread_mutex_lock(&bufmgr_gem->lock); for (list = bufmgr_gem->named.next; list != &bufmgr_gem->named; list = list->next) { bo_gem = DRMLISTENTRY(drm_intel_bo_gem, list, name_list); if (bo_gem->global_name == handle) { drm_intel_gem_bo_reference(&bo_gem->bo); + pthread_mutex_unlock(&bufmgr_gem->lock); return &bo_gem->bo; } } - VG_CLEAR(open_arg); + memclear(open_arg); open_arg.name = handle; ret = drmIoctl(bufmgr_gem->fd, DRM_IOCTL_GEM_OPEN, @@ -889,6 +980,7 @@ if (ret != 0) { DBG("Couldn't reference %s handle 0x%08x: %s\n", name, handle, strerror(errno)); + pthread_mutex_unlock(&bufmgr_gem->lock); return NULL; } /* Now see if someone has used a prime handle to get this @@ -901,13 +993,16 @@ bo_gem = DRMLISTENTRY(drm_intel_bo_gem, list, name_list); if (bo_gem->gem_handle == open_arg.handle) { drm_intel_gem_bo_reference(&bo_gem->bo); + pthread_mutex_unlock(&bufmgr_gem->lock); return &bo_gem->bo; } } bo_gem = calloc(1, sizeof(*bo_gem)); - if (!bo_gem) + if (!bo_gem) { + pthread_mutex_unlock(&bufmgr_gem->lock); return NULL; + } bo_gem->bo.size = open_arg.size; bo_gem->bo.offset = 0; @@ -922,13 +1017,14 @@ bo_gem->global_name = handle; bo_gem->reusable = false; - VG_CLEAR(get_tiling); + memclear(get_tiling); get_tiling.handle = bo_gem->gem_handle; ret = drmIoctl(bufmgr_gem->fd, DRM_IOCTL_I915_GEM_GET_TILING, &get_tiling); if (ret != 0) { drm_intel_gem_bo_unreference(&bo_gem->bo); + pthread_mutex_unlock(&bufmgr_gem->lock); return NULL; } bo_gem->tiling_mode = get_tiling.tiling_mode; @@ -938,6 +1034,7 @@ DRMINITLISTHEAD(&bo_gem->vma_list); DRMLISTADDTAIL(&bo_gem->name_list, &bufmgr_gem->named); + pthread_mutex_unlock(&bufmgr_gem->lock); DBG("bo_create_from_handle: %d (%s)\n", handle, bo_gem->name); return &bo_gem->bo; @@ -954,16 +1051,16 @@ DRMLISTDEL(&bo_gem->vma_list); if (bo_gem->mem_virtual) { VG(VALGRIND_FREELIKE_BLOCK(bo_gem->mem_virtual, 0)); - munmap(bo_gem->mem_virtual, bo_gem->bo.size); + drm_munmap(bo_gem->mem_virtual, bo_gem->bo.size); bufmgr_gem->vma_count--; } if (bo_gem->gtt_virtual) { - munmap(bo_gem->gtt_virtual, bo_gem->bo.size); + drm_munmap(bo_gem->gtt_virtual, bo_gem->bo.size); bufmgr_gem->vma_count--; } /* Close this object */ - VG_CLEAR(close); + memclear(close); close.handle = bo_gem->gem_handle; ret = drmIoctl(bufmgr_gem->fd, DRM_IOCTL_GEM_CLOSE, &close); if (ret != 0) { @@ -1043,12 +1140,12 @@ DRMLISTDELINIT(&bo_gem->vma_list); if (bo_gem->mem_virtual) { - munmap(bo_gem->mem_virtual, bo_gem->bo.size); + drm_munmap(bo_gem->mem_virtual, bo_gem->bo.size); bo_gem->mem_virtual = NULL; bufmgr_gem->vma_count--; } if (bo_gem->gtt_virtual) { - munmap(bo_gem->gtt_virtual, bo_gem->bo.size); + drm_munmap(bo_gem->gtt_virtual, bo_gem->bo.size); bo_gem->gtt_virtual = NULL; bufmgr_gem->vma_count--; } @@ -1152,7 +1249,8 @@ drm_intel_bo_gem *bo_gem = (drm_intel_bo_gem *) bo; assert(atomic_read(&bo_gem->refcount) > 0); - if (atomic_dec_and_test(&bo_gem->refcount)) { + + if (atomic_add_unless(&bo_gem->refcount, -1, 1)) { drm_intel_bufmgr_gem *bufmgr_gem = (drm_intel_bufmgr_gem *) bo->bufmgr; struct timespec time; @@ -1160,8 +1258,12 @@ clock_gettime(CLOCK_MONOTONIC, &time); pthread_mutex_lock(&bufmgr_gem->lock); - drm_intel_gem_bo_unreference_final(bo, time.tv_sec); - drm_intel_gem_cleanup_bo_cache(bufmgr_gem, time.tv_sec); + + if (atomic_dec_and_test(&bo_gem->refcount)) { + drm_intel_gem_bo_unreference_final(bo, time.tv_sec); + drm_intel_gem_cleanup_bo_cache(bufmgr_gem, time.tv_sec); + } + pthread_mutex_unlock(&bufmgr_gem->lock); } } @@ -1173,6 +1275,12 @@ struct drm_i915_gem_set_domain set_domain; int ret; + if (bo_gem->is_userptr) { + /* Return the same user ptr */ + bo->virtual = bo_gem->user_virtual; + return 0; + } + pthread_mutex_lock(&bufmgr_gem->lock); if (bo_gem->map_count++ == 0) @@ -1184,9 +1292,8 @@ DBG("bo_map: %d (%s), map_count=%d\n", bo_gem->gem_handle, bo_gem->name, bo_gem->map_count); - VG_CLEAR(mmap_arg); + memclear(mmap_arg); mmap_arg.handle = bo_gem->gem_handle; - mmap_arg.offset = 0; mmap_arg.size = bo->size; ret = drmIoctl(bufmgr_gem->fd, DRM_IOCTL_I915_GEM_MMAP, @@ -1208,7 +1315,7 @@ bo_gem->mem_virtual); bo->virtual = bo_gem->mem_virtual; - VG_CLEAR(set_domain); + memclear(set_domain); set_domain.handle = bo_gem->gem_handle; set_domain.read_domains = I915_GEM_DOMAIN_CPU; if (write_enable) @@ -1241,6 +1348,9 @@ drm_intel_bo_gem *bo_gem = (drm_intel_bo_gem *) bo; int ret; + if (bo_gem->is_userptr) + return -EINVAL; + if (bo_gem->map_count++ == 0) drm_intel_gem_bo_open_vma(bufmgr_gem, bo_gem); @@ -1251,7 +1361,7 @@ DBG("bo_map_gtt: mmap %d (%s), map_count=%d\n", bo_gem->gem_handle, bo_gem->name, bo_gem->map_count); - VG_CLEAR(mmap_arg); + memclear(mmap_arg); mmap_arg.handle = bo_gem->gem_handle; /* Get the fake offset back... */ @@ -1270,9 +1380,9 @@ } /* and mmap it */ - bo_gem->gtt_virtual = mmap(0, bo->size, PROT_READ | PROT_WRITE, - MAP_SHARED, bufmgr_gem->fd, - mmap_arg.offset); + bo_gem->gtt_virtual = drm_mmap(0, bo->size, PROT_READ | PROT_WRITE, + MAP_SHARED, bufmgr_gem->fd, + mmap_arg.offset); if (bo_gem->gtt_virtual == MAP_FAILED) { bo_gem->gtt_virtual = NULL; ret = -errno; @@ -1294,7 +1404,8 @@ return 0; } -int drm_intel_gem_bo_map_gtt(drm_intel_bo *bo) +drm_public int +drm_intel_gem_bo_map_gtt(drm_intel_bo *bo) { drm_intel_bufmgr_gem *bufmgr_gem = (drm_intel_bufmgr_gem *) bo->bufmgr; drm_intel_bo_gem *bo_gem = (drm_intel_bo_gem *) bo; @@ -1318,7 +1429,7 @@ * tell it when we're about to use things if we had done * rendering and it still happens to be bound to the GTT. */ - VG_CLEAR(set_domain); + memclear(set_domain); set_domain.handle = bo_gem->gem_handle; set_domain.read_domains = I915_GEM_DOMAIN_GTT; set_domain.write_domain = I915_GEM_DOMAIN_GTT; @@ -1352,7 +1463,8 @@ * undefined). */ -int drm_intel_gem_bo_map_unsynchronized(drm_intel_bo *bo) +drm_public int +drm_intel_gem_bo_map_unsynchronized(drm_intel_bo *bo) { drm_intel_bufmgr_gem *bufmgr_gem = (drm_intel_bufmgr_gem *) bo->bufmgr; #ifdef HAVE_VALGRIND @@ -1385,13 +1497,18 @@ static int drm_intel_gem_bo_unmap(drm_intel_bo *bo) { - drm_intel_bufmgr_gem *bufmgr_gem = (drm_intel_bufmgr_gem *) bo->bufmgr; + drm_intel_bufmgr_gem *bufmgr_gem; drm_intel_bo_gem *bo_gem = (drm_intel_bo_gem *) bo; int ret = 0; if (bo == NULL) return 0; + if (bo_gem->is_userptr) + return 0; + + bufmgr_gem = (drm_intel_bufmgr_gem *) bo->bufmgr; + pthread_mutex_lock(&bufmgr_gem->lock); if (bo_gem->map_count <= 0) { @@ -1411,7 +1528,7 @@ * Unlike GTT set domains, this only does work if the * buffer should be scanout-related. */ - VG_CLEAR(sw_finish); + memclear(sw_finish); sw_finish.handle = bo_gem->gem_handle; ret = drmIoctl(bufmgr_gem->fd, DRM_IOCTL_I915_GEM_SW_FINISH, @@ -1435,7 +1552,8 @@ return ret; } -int drm_intel_gem_bo_unmap_gtt(drm_intel_bo *bo) +drm_public int +drm_intel_gem_bo_unmap_gtt(drm_intel_bo *bo) { return drm_intel_gem_bo_unmap(bo); } @@ -1449,7 +1567,10 @@ struct drm_i915_gem_pwrite pwrite; int ret; - VG_CLEAR(pwrite); + if (bo_gem->is_userptr) + return -EINVAL; + + memclear(pwrite); pwrite.handle = bo_gem->gem_handle; pwrite.offset = offset; pwrite.size = size; @@ -1474,7 +1595,7 @@ struct drm_i915_get_pipe_from_crtc_id get_pipe_from_crtc_id; int ret; - VG_CLEAR(get_pipe_from_crtc_id); + memclear(get_pipe_from_crtc_id); get_pipe_from_crtc_id.crtc_id = crtc_id; ret = drmIoctl(bufmgr_gem->fd, DRM_IOCTL_I915_GET_PIPE_FROM_CRTC_ID, @@ -1501,7 +1622,10 @@ struct drm_i915_gem_pread pread; int ret; - VG_CLEAR(pread); + if (bo_gem->is_userptr) + return -EINVAL; + + memclear(pread); pread.handle = bo_gem->gem_handle; pread.offset = offset; pread.size = size; @@ -1549,8 +1673,12 @@ * not guarantee that the buffer is re-issued via another thread, or an flinked * handle. Userspace must make sure this race does not occur if such precision * is important. + * + * Note that some kernels have broken the inifite wait for negative values + * promise, upgrade to latest stable kernels if this is the case. */ -int drm_intel_gem_bo_wait(drm_intel_bo *bo, int64_t timeout_ns) +drm_public int +drm_intel_gem_bo_wait(drm_intel_bo *bo, int64_t timeout_ns) { drm_intel_bufmgr_gem *bufmgr_gem = (drm_intel_bufmgr_gem *) bo->bufmgr; drm_intel_bo_gem *bo_gem = (drm_intel_bo_gem *) bo; @@ -1568,9 +1696,9 @@ } } + memclear(wait); wait.bo_handle = bo_gem->gem_handle; wait.timeout_ns = timeout_ns; - wait.flags = 0; ret = drmIoctl(bufmgr_gem->fd, DRM_IOCTL_I915_GEM_WAIT, &wait); if (ret == -1) return -errno; @@ -1585,7 +1713,7 @@ * In combination with drm_intel_gem_bo_pin() and manual fence management, we * can do tiled pixmaps this way. */ -void +drm_public void drm_intel_gem_bo_start_gtt_access(drm_intel_bo *bo, int write_enable) { drm_intel_bufmgr_gem *bufmgr_gem = (drm_intel_bufmgr_gem *) bo->bufmgr; @@ -1593,7 +1721,7 @@ struct drm_i915_gem_set_domain set_domain; int ret; - VG_CLEAR(set_domain); + memclear(set_domain); set_domain.handle = bo_gem->gem_handle; set_domain.read_domains = I915_GEM_DOMAIN_GTT; set_domain.write_domain = write_enable ? I915_GEM_DOMAIN_GTT : 0; @@ -1686,6 +1814,14 @@ assert(offset <= bo->size - 4); assert((write_domain & (write_domain - 1)) == 0); + /* An object needing a fence is a tiled buffer, so it won't have + * relocs to other buffers. + */ + if (need_fence) { + assert(target_bo_gem->reloc_count == 0); + target_bo_gem->reloc_tree_fences = 1; + } + /* Make sure that we're not adding a reloc to something whose size has * already been accounted for. */ @@ -1693,13 +1829,8 @@ if (target_bo_gem != bo_gem) { target_bo_gem->used_as_reloc_target = true; bo_gem->reloc_tree_size += target_bo_gem->reloc_tree_size; + bo_gem->reloc_tree_fences += target_bo_gem->reloc_tree_fences; } - /* An object needing a fence is a tiled buffer, so it won't have - * relocs to other buffers. - */ - if (need_fence) - target_bo_gem->reloc_tree_fences = 1; - bo_gem->reloc_tree_fences += target_bo_gem->reloc_tree_fences; bo_gem->relocs[bo_gem->reloc_count].offset = offset; bo_gem->relocs[bo_gem->reloc_count].delta = target_offset; @@ -1745,7 +1876,7 @@ read_domains, write_domain, true); } -int +drm_public int drm_intel_gem_bo_get_reloc_count(drm_intel_bo *bo) { drm_intel_bo_gem *bo_gem = (drm_intel_bo_gem *) bo; @@ -1766,9 +1897,10 @@ * Any further drm_intel_bufmgr_check_aperture_space() queries * involving this buffer in the tree are undefined after this call. */ -void +drm_public void drm_intel_gem_bo_clear_relocs(drm_intel_bo *bo, int start) { + drm_intel_bufmgr_gem *bufmgr_gem = (drm_intel_bufmgr_gem *) bo->bufmgr; drm_intel_bo_gem *bo_gem = (drm_intel_bo_gem *) bo; int i; struct timespec time; @@ -1776,7 +1908,10 @@ clock_gettime(CLOCK_MONOTONIC, &time); assert(bo_gem->reloc_count >= start); + /* Unreference the cleared target buffers */ + pthread_mutex_lock(&bufmgr_gem->lock); + for (i = start; i < bo_gem->reloc_count; i++) { drm_intel_bo_gem *target_bo_gem = (drm_intel_bo_gem *) bo_gem->reloc_target_info[i].bo; if (&target_bo_gem->bo != bo) { @@ -1786,6 +1921,9 @@ } } bo_gem->reloc_count = start; + + pthread_mutex_unlock(&bufmgr_gem->lock); + } /** @@ -2095,7 +2233,7 @@ bufmgr_gem->aub_offset += 4096; } -void +drm_public void drm_intel_gem_bo_aub_dump_bmp(drm_intel_bo *bo, int x1, int y1, int width, int height, enum aub_dump_bmp_format format, @@ -2203,7 +2341,7 @@ */ drm_intel_add_validate_buffer(bo); - VG_CLEAR(execbuf); + memclear(execbuf); execbuf.buffers_ptr = (uintptr_t) bufmgr_gem->exec_objects; execbuf.buffer_count = bufmgr_gem->exec_count; execbuf.batch_start_offset = 0; @@ -2290,7 +2428,7 @@ */ drm_intel_add_validate_buffer2(bo, 0); - VG_CLEAR(execbuf); + memclear(execbuf); execbuf.buffers_ptr = (uintptr_t)bufmgr_gem->exec2_objects; execbuf.buffer_count = bufmgr_gem->exec_count; execbuf.batch_start_offset = 0; @@ -2366,7 +2504,7 @@ flags); } -int +drm_public int drm_intel_gem_bo_context_exec(drm_intel_bo *bo, drm_intel_context *ctx, int used, unsigned int flags) { @@ -2381,7 +2519,7 @@ struct drm_i915_gem_pin pin; int ret; - VG_CLEAR(pin); + memclear(pin); pin.handle = bo_gem->gem_handle; pin.alignment = alignment; @@ -2404,7 +2542,7 @@ struct drm_i915_gem_unpin unpin; int ret; - VG_CLEAR(unpin); + memclear(unpin); unpin.handle = bo_gem->gem_handle; ret = drmIoctl(bufmgr_gem->fd, DRM_IOCTL_I915_GEM_UNPIN, &unpin); @@ -2460,6 +2598,12 @@ drm_intel_bo_gem *bo_gem = (drm_intel_bo_gem *) bo; int ret; + /* Tiling with userptr surfaces is not supported + * on all hardware so refuse it for time being. + */ + if (bo_gem->is_userptr) + return -EINVAL; + /* Linear buffers have no stride. By ensuring that we only ever use * stride 0 with linear buffers, we simplify our code. */ @@ -2485,7 +2629,7 @@ return 0; } -drm_intel_bo * +drm_public drm_intel_bo * drm_intel_bo_gem_create_from_prime(drm_intel_bufmgr *bufmgr, int prime_fd, int size) { drm_intel_bufmgr_gem *bufmgr_gem = (drm_intel_bufmgr_gem *) bufmgr; @@ -2502,25 +2646,29 @@ * for named buffers, we must not create two bo's pointing at the same * kernel object */ + pthread_mutex_lock(&bufmgr_gem->lock); for (list = bufmgr_gem->named.next; list != &bufmgr_gem->named; list = list->next) { bo_gem = DRMLISTENTRY(drm_intel_bo_gem, list, name_list); if (bo_gem->gem_handle == handle) { drm_intel_gem_bo_reference(&bo_gem->bo); + pthread_mutex_unlock(&bufmgr_gem->lock); return &bo_gem->bo; } } if (ret) { fprintf(stderr,"ret is %d %d\n", ret, errno); + pthread_mutex_unlock(&bufmgr_gem->lock); return NULL; } bo_gem = calloc(1, sizeof(*bo_gem)); - if (!bo_gem) + if (!bo_gem) { + pthread_mutex_unlock(&bufmgr_gem->lock); return NULL; - + } /* Determine size of bo. The fd-to-handle ioctl really should * return the size, but it doesn't. If we have kernel 3.12 or * later, we can lseek on the prime fd to get the size. Older @@ -2548,8 +2696,9 @@ DRMINITLISTHEAD(&bo_gem->vma_list); DRMLISTADDTAIL(&bo_gem->name_list, &bufmgr_gem->named); + pthread_mutex_unlock(&bufmgr_gem->lock); - VG_CLEAR(get_tiling); + memclear(get_tiling); get_tiling.handle = bo_gem->gem_handle; ret = drmIoctl(bufmgr_gem->fd, DRM_IOCTL_I915_GEM_GET_TILING, @@ -2566,14 +2715,16 @@ return &bo_gem->bo; } -int +drm_public int drm_intel_bo_gem_export_to_prime(drm_intel_bo *bo, int *prime_fd) { drm_intel_bufmgr_gem *bufmgr_gem = (drm_intel_bufmgr_gem *) bo->bufmgr; drm_intel_bo_gem *bo_gem = (drm_intel_bo_gem *) bo; + pthread_mutex_lock(&bufmgr_gem->lock); if (DRMLISTEMPTY(&bo_gem->name_list)) DRMLISTADDTAIL(&bo_gem->name_list, &bufmgr_gem->named); + pthread_mutex_unlock(&bufmgr_gem->lock); if (drmPrimeHandleToFD(bufmgr_gem->fd, bo_gem->gem_handle, DRM_CLOEXEC, prime_fd) != 0) @@ -2594,18 +2745,23 @@ if (!bo_gem->global_name) { struct drm_gem_flink flink; - VG_CLEAR(flink); + memclear(flink); flink.handle = bo_gem->gem_handle; + pthread_mutex_lock(&bufmgr_gem->lock); + ret = drmIoctl(bufmgr_gem->fd, DRM_IOCTL_GEM_FLINK, &flink); - if (ret != 0) + if (ret != 0) { + pthread_mutex_unlock(&bufmgr_gem->lock); return -errno; + } bo_gem->global_name = flink.name; bo_gem->reusable = false; if (DRMLISTEMPTY(&bo_gem->name_list)) DRMLISTADDTAIL(&bo_gem->name_list, &bufmgr_gem->named); + pthread_mutex_unlock(&bufmgr_gem->lock); } *name = bo_gem->global_name; @@ -2619,7 +2775,7 @@ * size is only bounded by how many buffers of that size we've managed to have * in flight at once. */ -void +drm_public void drm_intel_bufmgr_gem_enable_reuse(drm_intel_bufmgr *bufmgr) { drm_intel_bufmgr_gem *bufmgr_gem = (drm_intel_bufmgr_gem *) bufmgr; @@ -2634,7 +2790,7 @@ * allocation. If this option is not enabled, all relocs will have fence * register allocated. */ -void +drm_public void drm_intel_bufmgr_gem_enable_fenced_relocs(drm_intel_bufmgr *bufmgr) { drm_intel_bufmgr_gem *bufmgr_gem = (drm_intel_bufmgr_gem *)bufmgr; @@ -2906,7 +3062,7 @@ } } -void +drm_public void drm_intel_bufmgr_gem_set_vma_cache_size(drm_intel_bufmgr *bufmgr, int limit) { drm_intel_bufmgr_gem *bufmgr_gem = (drm_intel_bufmgr_gem *)bufmgr; @@ -2924,7 +3080,7 @@ get_pci_device_id(drm_intel_bufmgr_gem *bufmgr_gem) { char *devid_override; - int devid; + int devid = 0; int ret; drm_i915_getparam_t gp; @@ -2936,8 +3092,7 @@ } } - VG_CLEAR(devid); - VG_CLEAR(gp); + memclear(gp); gp.param = I915_PARAM_CHIPSET_ID; gp.value = &devid; ret = drmIoctl(bufmgr_gem->fd, DRM_IOCTL_I915_GETPARAM, &gp); @@ -2948,7 +3103,7 @@ return devid; } -int +drm_public int drm_intel_bufmgr_gem_get_devid(drm_intel_bufmgr *bufmgr) { drm_intel_bufmgr_gem *bufmgr_gem = (drm_intel_bufmgr_gem *)bufmgr; @@ -2962,7 +3117,7 @@ * This function has to be called before drm_intel_bufmgr_gem_set_aub_dump() * for it to have any effect. */ -void +drm_public void drm_intel_bufmgr_gem_set_aub_filename(drm_intel_bufmgr *bufmgr, const char *filename) { @@ -2981,7 +3136,7 @@ * You can set up a GTT and upload your objects into the referenced * space, then send off batchbuffers and get BMPs out the other end. */ -void +drm_public void drm_intel_bufmgr_gem_set_aub_dump(drm_intel_bufmgr *bufmgr, int enable) { drm_intel_bufmgr_gem *bufmgr_gem = (drm_intel_bufmgr_gem *)bufmgr; @@ -3026,7 +3181,8 @@ /* Set up the GTT. The max we can handle is 256M */ aub_out(bufmgr_gem, CMD_AUB_TRACE_HEADER_BLOCK | ((bufmgr_gem->gen >= 8 ? 6 : 5) - 2)); - aub_out(bufmgr_gem, AUB_TRACE_MEMTYPE_NONLOCAL | 0 | AUB_TRACE_OP_DATA_WRITE); + /* Need to use GTT_ENTRY type for recent emulator */ + aub_out(bufmgr_gem, AUB_TRACE_MEMTYPE_GTT_ENTRY | 0 | AUB_TRACE_OP_DATA_WRITE); aub_out(bufmgr_gem, 0); /* subtype */ aub_out(bufmgr_gem, 0); /* offset */ aub_out(bufmgr_gem, gtt_size); /* size */ @@ -3037,7 +3193,7 @@ } } -drm_intel_context * +drm_public drm_intel_context * drm_intel_gem_context_create(drm_intel_bufmgr *bufmgr) { drm_intel_bufmgr_gem *bufmgr_gem = (drm_intel_bufmgr_gem *)bufmgr; @@ -3049,7 +3205,7 @@ if (!context) return NULL; - VG_CLEAR(create); + memclear(create); ret = drmIoctl(bufmgr_gem->fd, DRM_IOCTL_I915_GEM_CONTEXT_CREATE, &create); if (ret != 0) { DBG("DRM_IOCTL_I915_GEM_CONTEXT_CREATE failed: %s\n", @@ -3064,7 +3220,7 @@ return context; } -void +drm_public void drm_intel_gem_context_destroy(drm_intel_context *ctx) { drm_intel_bufmgr_gem *bufmgr_gem; @@ -3074,7 +3230,7 @@ if (ctx == NULL) return; - VG_CLEAR(destroy); + memclear(destroy); bufmgr_gem = (drm_intel_bufmgr_gem *)ctx->bufmgr; destroy.ctx_id = ctx->ctx_id; @@ -3087,7 +3243,7 @@ free(ctx); } -int +drm_public int drm_intel_get_reset_stats(drm_intel_context *ctx, uint32_t *reset_count, uint32_t *active, @@ -3100,7 +3256,7 @@ if (ctx == NULL) return -EINVAL; - memset(&stats, 0, sizeof(stats)); + memclear(stats); bufmgr_gem = (drm_intel_bufmgr_gem *)ctx->bufmgr; stats.ctx_id = ctx->ctx_id; @@ -3121,7 +3277,7 @@ return ret; } -int +drm_public int drm_intel_reg_read(drm_intel_bufmgr *bufmgr, uint32_t offset, uint64_t *result) @@ -3130,7 +3286,7 @@ struct drm_i915_reg_read reg_read; int ret; - VG_CLEAR(reg_read); + memclear(reg_read); reg_read.offset = offset; ret = drmIoctl(bufmgr_gem->fd, DRM_IOCTL_I915_REG_READ, ®_read); @@ -3139,6 +3295,37 @@ return ret; } +drm_public int +drm_intel_get_subslice_total(int fd, unsigned int *subslice_total) +{ + drm_i915_getparam_t gp; + int ret; + + memclear(gp); + gp.value = (int*)subslice_total; + gp.param = I915_PARAM_SUBSLICE_TOTAL; + ret = drmIoctl(fd, DRM_IOCTL_I915_GETPARAM, &gp); + if (ret) + return -errno; + + return 0; +} + +drm_public int +drm_intel_get_eu_total(int fd, unsigned int *eu_total) +{ + drm_i915_getparam_t gp; + int ret; + + memclear(gp); + gp.value = (int*)eu_total; + gp.param = I915_PARAM_EU_TOTAL; + ret = drmIoctl(fd, DRM_IOCTL_I915_GETPARAM, &gp); + if (ret) + return -errno; + + return 0; +} /** * Annotate the given bo for use in aub dumping. @@ -3161,7 +3348,7 @@ * default state (no annotations), call this function with a \c count * of zero. */ -void +drm_public void drm_intel_bufmgr_gem_set_aub_annotations(drm_intel_bo *bo, drm_intel_aub_annotation *annotations, unsigned count) @@ -3181,13 +3368,95 @@ bo_gem->aub_annotation_count = count; } +static pthread_mutex_t bufmgr_list_mutex = PTHREAD_MUTEX_INITIALIZER; +static drmMMListHead bufmgr_list = { &bufmgr_list, &bufmgr_list }; + +static drm_intel_bufmgr_gem * +drm_intel_bufmgr_gem_find(int fd) +{ + drm_intel_bufmgr_gem *bufmgr_gem; + + DRMLISTFOREACHENTRY(bufmgr_gem, &bufmgr_list, managers) { + if (bufmgr_gem->fd == fd) { + atomic_inc(&bufmgr_gem->refcount); + return bufmgr_gem; + } + } + + return NULL; +} + +static void +drm_intel_bufmgr_gem_unref(drm_intel_bufmgr *bufmgr) +{ + drm_intel_bufmgr_gem *bufmgr_gem = (drm_intel_bufmgr_gem *)bufmgr; + + if (atomic_add_unless(&bufmgr_gem->refcount, -1, 1)) { + pthread_mutex_lock(&bufmgr_list_mutex); + + if (atomic_dec_and_test(&bufmgr_gem->refcount)) { + DRMLISTDEL(&bufmgr_gem->managers); + drm_intel_bufmgr_gem_destroy(bufmgr); + } + + pthread_mutex_unlock(&bufmgr_list_mutex); + } +} + +static bool +has_userptr(drm_intel_bufmgr_gem *bufmgr_gem) +{ + int ret; + void *ptr; + long pgsz; + struct drm_i915_gem_userptr userptr; + struct drm_gem_close close_bo; + + pgsz = sysconf(_SC_PAGESIZE); + assert(pgsz > 0); + + ret = posix_memalign(&ptr, pgsz, pgsz); + if (ret) { + DBG("Failed to get a page (%ld) for userptr detection!\n", + pgsz); + return false; + } + + memclear(userptr); + userptr.user_ptr = (__u64)(unsigned long)ptr; + userptr.user_size = pgsz; + +retry: + ret = drmIoctl(bufmgr_gem->fd, DRM_IOCTL_I915_GEM_USERPTR, &userptr); + if (ret) { + if (errno == ENODEV && userptr.flags == 0) { + userptr.flags = I915_USERPTR_UNSYNCHRONIZED; + goto retry; + } + free(ptr); + return false; + } + + memclear(close_bo); + close_bo.handle = userptr.handle; + ret = drmIoctl(bufmgr_gem->fd, DRM_IOCTL_GEM_CLOSE, &close_bo); + free(ptr); + if (ret) { + fprintf(stderr, "Failed to release test userptr object! (%d) " + "i915 kernel driver may not be sane!\n", errno); + return false; + } + + return true; +} + /** * Initializes the GEM buffer manager, which uses the kernel to allocate, map, * and manage map buffer objections. * * \param fd File descriptor of the opened DRM device. */ -drm_intel_bufmgr * +drm_public drm_intel_bufmgr * drm_intel_bufmgr_gem_init(int fd, int batch_size) { drm_intel_bufmgr_gem *bufmgr_gem; @@ -3196,17 +3465,26 @@ int ret, tmp; bool exec2 = false; + pthread_mutex_lock(&bufmgr_list_mutex); + + bufmgr_gem = drm_intel_bufmgr_gem_find(fd); + if (bufmgr_gem) + goto exit; + bufmgr_gem = calloc(1, sizeof(*bufmgr_gem)); if (bufmgr_gem == NULL) - return NULL; + goto exit; bufmgr_gem->fd = fd; + atomic_set(&bufmgr_gem->refcount, 1); if (pthread_mutex_init(&bufmgr_gem->lock, NULL) != 0) { free(bufmgr_gem); - return NULL; + bufmgr_gem = NULL; + goto exit; } + memclear(aperture); ret = drmIoctl(bufmgr_gem->fd, DRM_IOCTL_I915_GEM_GET_APERTURE, &aperture); @@ -3239,9 +3517,12 @@ bufmgr_gem->gen = 7; else if (IS_GEN8(bufmgr_gem->pci_device)) bufmgr_gem->gen = 8; + else if (IS_GEN9(bufmgr_gem->pci_device)) + bufmgr_gem->gen = 9; else { free(bufmgr_gem); - return NULL; + bufmgr_gem = NULL; + goto exit; } if (IS_GEN3(bufmgr_gem->pci_device) && @@ -3253,7 +3534,7 @@ bufmgr_gem->gtt_size -= 256*1024*1024; } - VG_CLEAR(gp); + memclear(gp); gp.value = &tmp; gp.param = I915_PARAM_HAS_EXECBUF2; @@ -3273,6 +3554,10 @@ ret = drmIoctl(bufmgr_gem->fd, DRM_IOCTL_I915_GETPARAM, &gp); bufmgr_gem->has_relaxed_fencing = ret == 0; + if (has_userptr(bufmgr_gem)) + bufmgr_gem->bufmgr.bo_alloc_userptr = + drm_intel_gem_bo_alloc_userptr; + gp.param = I915_PARAM_HAS_WAIT_TIMEOUT; ret = drmIoctl(bufmgr_gem->fd, DRM_IOCTL_I915_GETPARAM, &gp); bufmgr_gem->has_wait_timeout = ret == 0; @@ -3352,7 +3637,7 @@ bufmgr_gem->bufmgr.bo_exec = drm_intel_gem_bo_exec; bufmgr_gem->bufmgr.bo_busy = drm_intel_gem_bo_busy; bufmgr_gem->bufmgr.bo_madvise = drm_intel_gem_bo_madvise; - bufmgr_gem->bufmgr.destroy = drm_intel_bufmgr_gem_destroy; + bufmgr_gem->bufmgr.destroy = drm_intel_bufmgr_gem_unref; bufmgr_gem->bufmgr.debug = 0; bufmgr_gem->bufmgr.check_aperture_space = drm_intel_gem_check_aperture_space; @@ -3368,5 +3653,10 @@ DRMINITLISTHEAD(&bufmgr_gem->vma_cache); bufmgr_gem->vma_max = -1; /* unlimited by default */ - return &bufmgr_gem->bufmgr; + DRMLISTADD(&bufmgr_gem->managers, &bufmgr_list); + +exit: + pthread_mutex_unlock(&bufmgr_list_mutex); + + return bufmgr_gem != NULL ? &bufmgr_gem->bufmgr : NULL; } diff -Nru libdrm-2.4.56/intel/intel_bufmgr.h libdrm-2.4.60/intel/intel_bufmgr.h --- libdrm-2.4.56/intel/intel_bufmgr.h 2014-02-07 16:58:41.000000000 +0000 +++ libdrm-2.4.60/intel/intel_bufmgr.h 2015-03-18 18:10:52.000000000 +0000 @@ -113,6 +113,11 @@ const char *name, unsigned long size, unsigned int alignment); +drm_intel_bo *drm_intel_bo_alloc_userptr(drm_intel_bufmgr *bufmgr, + const char *name, + void *addr, uint32_t tiling_mode, + uint32_t stride, unsigned long size, + unsigned long flags); drm_intel_bo *drm_intel_bo_alloc_tiled(drm_intel_bufmgr *bufmgr, const char *name, int x, int y, int cpp, @@ -259,6 +264,9 @@ uint32_t *active, uint32_t *pending); +int drm_intel_get_subslice_total(int fd, unsigned int *subslice_total); +int drm_intel_get_eu_total(int fd, unsigned int *eu_total); + /** @{ Compatibility defines to keep old code building despite the symbol rename * from dri_* to drm_intel_* */ diff -Nru libdrm-2.4.56/intel/intel_bufmgr_priv.h libdrm-2.4.60/intel/intel_bufmgr_priv.h --- libdrm-2.4.56/intel/intel_bufmgr_priv.h 2013-08-12 18:01:15.000000000 +0000 +++ libdrm-2.4.60/intel/intel_bufmgr_priv.h 2015-02-28 18:32:39.000000000 +0000 @@ -62,6 +62,18 @@ unsigned int alignment); /** + * Allocate a buffer object from an existing user accessible + * address malloc'd with the provided size. + * Alignment is used when mapping to the gtt. + * Flags may be I915_VMAP_READ_ONLY or I915_USERPTR_UNSYNCHRONIZED + */ + drm_intel_bo *(*bo_alloc_userptr)(drm_intel_bufmgr *bufmgr, + const char *name, void *addr, + uint32_t tiling_mode, uint32_t stride, + unsigned long size, + unsigned long flags); + + /** * Allocate a tiled buffer object. * * Alignment for tiled objects is set automatically; the 'flags' diff -Nru libdrm-2.4.56/intel/intel_chipset.h libdrm-2.4.60/intel/intel_chipset.h --- libdrm-2.4.56/intel/intel_chipset.h 2014-05-30 16:38:28.000000000 +0000 +++ libdrm-2.4.60/intel/intel_chipset.h 2015-03-18 17:33:12.000000000 +0000 @@ -165,6 +165,22 @@ #define PCI_CHIP_CHERRYVIEW_2 0x22b2 #define PCI_CHIP_CHERRYVIEW_3 0x22b3 +#define PCI_CHIP_SKYLAKE_ULT_GT2 0x1916 +#define PCI_CHIP_SKYLAKE_ULT_GT1 0x1906 +#define PCI_CHIP_SKYLAKE_ULT_GT3 0x1926 +#define PCI_CHIP_SKYLAKE_ULT_GT2F 0x1921 +#define PCI_CHIP_SKYLAKE_ULX_GT1 0x190E +#define PCI_CHIP_SKYLAKE_ULX_GT2 0x191E +#define PCI_CHIP_SKYLAKE_DT_GT2 0x1912 +#define PCI_CHIP_SKYLAKE_DT_GT1 0x1902 +#define PCI_CHIP_SKYLAKE_HALO_GT2 0x191B +#define PCI_CHIP_SKYLAKE_HALO_GT3 0x192B +#define PCI_CHIP_SKYLAKE_HALO_GT1 0x190B +#define PCI_CHIP_SKYLAKE_SRV_GT2 0x191A +#define PCI_CHIP_SKYLAKE_SRV_GT3 0x192A +#define PCI_CHIP_SKYLAKE_SRV_GT1 0x190A +#define PCI_CHIP_SKYLAKE_WKS_GT2 0x191D + #define IS_MOBILE(devid) ((devid) == PCI_CHIP_I855_GM || \ (devid) == PCI_CHIP_I915_GM || \ (devid) == PCI_CHIP_I945_GM || \ @@ -324,12 +340,37 @@ #define IS_GEN8(devid) (IS_BROADWELL(devid) || \ IS_CHERRYVIEW(devid)) +#define IS_SKL_GT1(devid) ((devid) == PCI_CHIP_SKYLAKE_ULT_GT1 || \ + (devid) == PCI_CHIP_SKYLAKE_ULX_GT1 || \ + (devid) == PCI_CHIP_SKYLAKE_DT_GT1 || \ + (devid) == PCI_CHIP_SKYLAKE_HALO_GT1 || \ + (devid) == PCI_CHIP_SKYLAKE_SRV_GT1) + +#define IS_SKL_GT2(devid) ((devid) == PCI_CHIP_SKYLAKE_ULT_GT2 || \ + (devid) == PCI_CHIP_SKYLAKE_ULT_GT2F || \ + (devid) == PCI_CHIP_SKYLAKE_ULX_GT2 || \ + (devid) == PCI_CHIP_SKYLAKE_DT_GT2 || \ + (devid) == PCI_CHIP_SKYLAKE_HALO_GT2 || \ + (devid) == PCI_CHIP_SKYLAKE_SRV_GT2 || \ + (devid) == PCI_CHIP_SKYLAKE_WKS_GT2) + +#define IS_SKL_GT3(devid) ((devid) == PCI_CHIP_SKYLAKE_ULT_GT3 || \ + (devid) == PCI_CHIP_SKYLAKE_HALO_GT3 || \ + (devid) == PCI_CHIP_SKYLAKE_SRV_GT3) + +#define IS_SKYLAKE(devid) (IS_SKL_GT1(devid) || \ + IS_SKL_GT2(devid) || \ + IS_SKL_GT3(devid)) + +#define IS_GEN9(devid) IS_SKYLAKE(devid) + #define IS_9XX(dev) (IS_GEN3(dev) || \ IS_GEN4(dev) || \ IS_GEN5(dev) || \ IS_GEN6(dev) || \ IS_GEN7(dev) || \ - IS_GEN8(dev)) + IS_GEN8(dev) || \ + IS_GEN9(dev)) #endif /* _INTEL_CHIPSET_H */ diff -Nru libdrm-2.4.56/intel/intel_decode.c libdrm-2.4.60/intel/intel_decode.c --- libdrm-2.4.56/intel/intel_decode.c 2014-05-30 16:38:28.000000000 +0000 +++ libdrm-2.4.60/intel/intel_decode.c 2015-03-18 17:33:12.000000000 +0000 @@ -21,6 +21,10 @@ * IN THE SOFTWARE. */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include #include #include @@ -29,6 +33,7 @@ #include #include +#include "libdrm.h" #include "xf86drm.h" #include "intel_chipset.h" #include "intel_bufmgr.h" @@ -3812,7 +3817,7 @@ return 1; } -struct drm_intel_decode * +drm_public struct drm_intel_decode * drm_intel_decode_context_alloc(uint32_t devid) { struct drm_intel_decode *ctx; @@ -3824,7 +3829,9 @@ ctx->devid = devid; ctx->out = stdout; - if (IS_GEN8(devid)) + if (IS_GEN9(devid)) + ctx->gen = 9; + else if (IS_GEN8(devid)) ctx->gen = 8; else if (IS_GEN7(devid)) ctx->gen = 7; @@ -3844,20 +3851,20 @@ return ctx; } -void +drm_public void drm_intel_decode_context_free(struct drm_intel_decode *ctx) { free(ctx); } -void +drm_public void drm_intel_decode_set_dump_past_end(struct drm_intel_decode *ctx, int dump_past_end) { ctx->dump_past_end = !!dump_past_end; } -void +drm_public void drm_intel_decode_set_batch_pointer(struct drm_intel_decode *ctx, void *data, uint32_t hw_offset, int count) { @@ -3866,7 +3873,7 @@ ctx->base_count = count; } -void +drm_public void drm_intel_decode_set_head_tail(struct drm_intel_decode *ctx, uint32_t head, uint32_t tail) { @@ -3874,7 +3881,7 @@ ctx->tail = tail; } -void +drm_public void drm_intel_decode_set_output_file(struct drm_intel_decode *ctx, FILE *out) { @@ -3888,7 +3895,7 @@ * \param count number of DWORDs to decode in the batch buffer * \param hw_offset hardware address for the buffer */ -void +drm_public void drm_intel_decode(struct drm_intel_decode *ctx) { int ret; diff -Nru libdrm-2.4.56/intel/Makefile.am libdrm-2.4.60/intel/Makefile.am --- libdrm-2.4.56/intel/Makefile.am 2013-08-12 18:01:14.000000000 +0000 +++ libdrm-2.4.60/intel/Makefile.am 2015-02-28 18:34:25.000000000 +0000 @@ -22,8 +22,11 @@ # Authors: # Eric Anholt +include Makefile.sources + AM_CFLAGS = \ $(WARN_CFLAGS) \ + $(VISIBILITY_CFLAGS) \ -I$(top_srcdir) \ -I$(top_srcdir)/intel \ $(PTHREADSTUBS_CFLAGS) \ @@ -39,22 +42,12 @@ @PCIACCESS_LIBS@ \ @CLOCK_LIB@ -libdrm_intel_la_SOURCES = \ - intel_bufmgr.c \ - intel_bufmgr_priv.h \ - intel_bufmgr_fake.c \ - intel_bufmgr_gem.c \ - intel_decode.c \ - intel_chipset.h \ - mm.c \ - mm.h +libdrm_intel_la_SOURCES = $(LIBDRM_INTEL_FILES) intel_bufmgr_gem_o_CFLAGS = $(AM_CFLAGS) -c99 libdrm_intelincludedir = ${includedir}/libdrm -libdrm_intelinclude_HEADERS = intel_bufmgr.h \ - intel_aub.h \ - intel_debug.h +libdrm_intelinclude_HEADERS = $(LIBDRM_INTEL_H_FILES) # This may be interesting even outside of "make check", due to the -dump option. noinst_PROGRAMS = test_decode @@ -75,7 +68,8 @@ $(BATCHES:.batch=.batch.sh) \ $(BATCHES:.batch=.batch-ref.txt) \ $(BATCHES:.batch=.batch-ref.txt) \ - tests/test-batch.sh + tests/test-batch.sh \ + Android.mk test_decode_LDADD = libdrm_intel.la ../libdrm.la diff -Nru libdrm-2.4.56/intel/Makefile.in libdrm-2.4.60/intel/Makefile.in --- libdrm-2.4.56/intel/Makefile.in 2014-07-29 16:13:53.000000000 +0000 +++ libdrm-2.4.60/intel/Makefile.in 2015-03-19 14:37:46.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.14.1 from Makefile.am. +# Makefile.in generated by automake 1.13.4 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. @@ -105,13 +105,13 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ +DIST_COMMON = $(srcdir)/Makefile.sources $(srcdir)/Makefile.in \ + $(srcdir)/Makefile.am $(srcdir)/libdrm_intel.pc.in \ + $(top_srcdir)/build-aux/depcomp $(libdrm_intelinclude_HEADERS) \ + $(top_srcdir)/build-aux/test-driver noinst_PROGRAMS = test_decode$(EXEEXT) TESTS = $(am__EXEEXT_1) subdir = intel -DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ - $(srcdir)/libdrm_intel.pc.in $(top_srcdir)/build-aux/depcomp \ - $(libdrm_intelinclude_HEADERS) \ - $(top_srcdir)/build-aux/test-driver ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ @@ -155,8 +155,9 @@ "$(DESTDIR)$(libdrm_intelincludedir)" LTLIBRARIES = $(libdrm_intel_la_LTLIBRARIES) libdrm_intel_la_DEPENDENCIES = ../libdrm.la -am_libdrm_intel_la_OBJECTS = intel_bufmgr.lo intel_bufmgr_fake.lo \ +am__objects_1 = intel_bufmgr.lo intel_bufmgr_fake.lo \ intel_bufmgr_gem.lo intel_decode.lo mm.lo +am_libdrm_intel_la_OBJECTS = $(am__objects_1) libdrm_intel_la_OBJECTS = $(am_libdrm_intel_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) @@ -458,7 +459,6 @@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MANPAGES_STYLESHEET = @MANPAGES_STYLESHEET@ @@ -492,6 +492,7 @@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ VALGRIND_LIBS = @VALGRIND_LIBS@ VERSION = @VERSION@ +VISIBILITY_CFLAGS = @VISIBILITY_CFLAGS@ WARN_CFLAGS = @WARN_CFLAGS@ XSLTPROC = @XSLTPROC@ abs_builddir = @abs_builddir@ @@ -548,8 +549,24 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ +LIBDRM_INTEL_FILES := \ + intel_bufmgr.c \ + intel_bufmgr_priv.h \ + intel_bufmgr_fake.c \ + intel_bufmgr_gem.c \ + intel_decode.c \ + intel_chipset.h \ + mm.c \ + mm.h + +LIBDRM_INTEL_H_FILES := \ + intel_bufmgr.h \ + intel_aub.h \ + intel_debug.h + AM_CFLAGS = \ $(WARN_CFLAGS) \ + $(VISIBILITY_CFLAGS) \ -I$(top_srcdir) \ -I$(top_srcdir)/intel \ $(PTHREADSTUBS_CFLAGS) \ @@ -565,22 +582,10 @@ @PCIACCESS_LIBS@ \ @CLOCK_LIB@ -libdrm_intel_la_SOURCES = \ - intel_bufmgr.c \ - intel_bufmgr_priv.h \ - intel_bufmgr_fake.c \ - intel_bufmgr_gem.c \ - intel_decode.c \ - intel_chipset.h \ - mm.c \ - mm.h - +libdrm_intel_la_SOURCES = $(LIBDRM_INTEL_FILES) intel_bufmgr_gem_o_CFLAGS = $(AM_CFLAGS) -c99 libdrm_intelincludedir = ${includedir}/libdrm -libdrm_intelinclude_HEADERS = intel_bufmgr.h \ - intel_aub.h \ - intel_debug.h - +libdrm_intelinclude_HEADERS = $(LIBDRM_INTEL_H_FILES) BATCHES = \ tests/gen4-3d.batch \ tests/gm45-3d.batch \ @@ -594,7 +599,8 @@ $(BATCHES:.batch=.batch.sh) \ $(BATCHES:.batch=.batch-ref.txt) \ $(BATCHES:.batch=.batch-ref.txt) \ - tests/test-batch.sh + tests/test-batch.sh \ + Android.mk test_decode_LDADD = libdrm_intel.la ../libdrm.la pkgconfig_DATA = libdrm_intel.pc @@ -602,7 +608,7 @@ .SUFFIXES: .SUFFIXES: .c .lo .log .o .obj .test .test$(EXEEXT) .trs -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(srcdir)/Makefile.sources $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -623,13 +629,14 @@ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; +$(srcdir)/Makefile.sources: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): libdrm_intel.pc: $(top_builddir)/config.status $(srcdir)/libdrm_intel.pc.in @@ -704,14 +711,14 @@ @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< diff -Nru libdrm-2.4.56/intel/Makefile.sources libdrm-2.4.60/intel/Makefile.sources --- libdrm-2.4.56/intel/Makefile.sources 1970-01-01 00:00:00.000000000 +0000 +++ libdrm-2.4.60/intel/Makefile.sources 2015-03-18 17:33:12.000000000 +0000 @@ -0,0 +1,14 @@ +LIBDRM_INTEL_FILES := \ + intel_bufmgr.c \ + intel_bufmgr_priv.h \ + intel_bufmgr_fake.c \ + intel_bufmgr_gem.c \ + intel_decode.c \ + intel_chipset.h \ + mm.c \ + mm.h + +LIBDRM_INTEL_H_FILES := \ + intel_bufmgr.h \ + intel_aub.h \ + intel_debug.h diff -Nru libdrm-2.4.56/intel/test_decode.c libdrm-2.4.60/intel/test_decode.c --- libdrm-2.4.56/intel/test_decode.c 2014-02-07 16:58:41.000000000 +0000 +++ libdrm-2.4.60/intel/test_decode.c 2015-03-18 17:33:12.000000000 +0000 @@ -21,7 +21,9 @@ * IN THE SOFTWARE. */ -#define _GNU_SOURCE +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif #include #include @@ -30,10 +32,9 @@ #include #include #include -#include #include -#include "config.h" +#include "libdrm.h" #include "intel_bufmgr.h" #include "intel_chipset.h" @@ -63,7 +64,7 @@ errx(1, "couldn't stat `%s'", filename); *size = st.st_size; - *ptr = mmap(NULL, st.st_size, PROT_READ, MAP_SHARED, fd, 0); + *ptr = drm_mmap(NULL, st.st_size, PROT_READ, MAP_SHARED, fd, 0); if (*ptr == MAP_FAILED) errx(1, "couldn't map `%s'", filename); @@ -90,7 +91,10 @@ { FILE *out = NULL; void *ptr, *ref_ptr, *batch_ptr; - size_t size, ref_size, batch_size; +#ifdef HAVE_OPEN_MEMSTREAM + size_t size; +#endif + size_t ref_size, batch_size; const char *ref_suffix = "-ref.txt"; char *ref_filename; diff -Nru libdrm-2.4.56/libdrm.h libdrm-2.4.60/libdrm.h --- libdrm-2.4.56/libdrm.h 1970-01-01 00:00:00.000000000 +0000 +++ libdrm-2.4.60/libdrm.h 2015-02-28 18:34:25.000000000 +0000 @@ -0,0 +1,89 @@ +/* + * Copyright © 2014 NVIDIA Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#ifndef LIBDRM_LIBDRM_H +#define LIBDRM_LIBDRM_H + +#if defined(HAVE_VISIBILITY) +# define drm_private __attribute__((visibility("hidden"))) +# define drm_public __attribute__((visibility("default"))) +#else +# define drm_private +# define drm_public +#endif + + +/** + * Static (compile-time) assertion. + * Basically, use COND to dimension an array. If COND is false/zero the + * array size will be -1 and we'll get a compilation error. + */ +#define STATIC_ASSERT(COND) \ + do { \ + (void) sizeof(char [1 - 2*!(COND)]); \ + } while (0) + + +#include + +#if defined(ANDROID) && !defined(__LP64__) +#include /* for EINVAL */ + +extern void *__mmap2(void *, size_t, int, int, int, size_t); + +static inline void *drm_mmap(void *addr, size_t length, int prot, int flags, + int fd, loff_t offset) +{ + /* offset must be aligned to 4096 (not necessarily the page size) */ + if (offset & 4095) { + errno = EINVAL; + return MAP_FAILED; + } + + return __mmap2(addr, length, prot, flags, fd, (size_t) (offset >> 12)); +} + +# define drm_munmap(addr, length) \ + munmap(addr, length) + + +#else + +/* assume large file support exists */ +# define drm_mmap(addr, length, prot, flags, fd, offset) \ + mmap(addr, length, prot, flags, fd, offset) + + +static inline int drm_munmap(void *addr, size_t length) +{ + /* Copied from configure code generated by AC_SYS_LARGEFILE */ +#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + \ + (((off_t) 1 << 31) << 31)) + STATIC_ASSERT(LARGE_OFF_T % 2147483629 == 721 && + LARGE_OFF_T % 2147483647 == 1); +#undef LARGE_OFF_T + + return munmap(addr, length); +} +#endif + +#endif diff -Nru libdrm-2.4.56/libkms/Android.mk libdrm-2.4.60/libkms/Android.mk --- libdrm-2.4.56/libkms/Android.mk 1970-01-01 00:00:00.000000000 +0000 +++ libdrm-2.4.60/libkms/Android.mk 2015-02-28 18:34:25.000000000 +0000 @@ -0,0 +1,53 @@ +DRM_GPU_DRIVERS := $(strip $(filter-out swrast, $(BOARD_GPU_DRIVERS))) + +intel_drivers := i915 i965 i915g ilo +radeon_drivers := r300g r600g radeonsi +nouveau_drivers := nouveau +vmwgfx_drivers := vmwgfx + +valid_drivers := \ + $(intel_drivers) \ + $(radeon_drivers) \ + $(nouveau_drivers) \ + $(vmwgfx_drivers) + +# warn about invalid drivers +invalid_drivers := $(filter-out $(valid_drivers), $(DRM_GPU_DRIVERS)) +ifneq ($(invalid_drivers),) +$(warning invalid GPU drivers: $(invalid_drivers)) +# tidy up +DRM_GPU_DRIVERS := $(filter-out $(invalid_drivers), $(DRM_GPU_DRIVERS)) +endif + +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) +include $(LOCAL_PATH)/Makefile.sources + +LOCAL_SRC_FILES := $(LIBKMS_FILES) + +ifneq ($(filter $(vmwgfx_drivers), $(DRM_GPU_DRIVERS)),) +LOCAL_SRC_FILES += $(LIBKMS_VMWGFX_FILES) +endif + +ifneq ($(filter $(intel_drivers), $(DRM_GPU_DRIVERS)),) +LOCAL_SRC_FILES += $(LIBKMS_INTEL_FILES) +endif + +ifneq ($(filter $(nouveau_drivers), $(DRM_GPU_DRIVERS)),) +LOCAL_SRC_FILES += $(LIBKMS_NOUVEAU_FILES) +endif + +ifneq ($(filter $(radeon_drivers), $(DRM_GPU_DRIVERS)),) +LOCAL_SRC_FILES += $(LIBKMS_RADEON_FILES) +endif + +LOCAL_MODULE := libkms +LOCAL_SHARED_LIBRARIES := libdrm + +LOCAL_C_INCLUDES += $(TARGET_OUT_HEADERS)/libdrm + +LOCAL_COPY_HEADERS_TO := libdrm +LOCAL_COPY_HEADERS := $(LIBKMS_H_FILES) + +include $(BUILD_SHARED_LIBRARY) diff -Nru libdrm-2.4.56/libkms/api.c libdrm-2.4.60/libkms/api.c --- libdrm-2.4.56/libkms/api.c 2013-08-12 18:01:20.000000000 +0000 +++ libdrm-2.4.60/libkms/api.c 2015-02-28 18:32:39.000000000 +0000 @@ -26,7 +26,9 @@ **************************************************************************/ +#ifdef HAVE_CONFIG_H #include "config.h" +#endif #include #include #include diff -Nru libdrm-2.4.56/libkms/dumb.c libdrm-2.4.60/libkms/dumb.c --- libdrm-2.4.56/libkms/dumb.c 2013-08-12 18:01:20.000000000 +0000 +++ libdrm-2.4.60/libkms/dumb.c 2015-02-28 18:34:25.000000000 +0000 @@ -26,8 +26,9 @@ **************************************************************************/ -#define HAVE_STDINT_H -#define _FILE_OFFSET_BITS 64 +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif #include #include @@ -35,11 +36,9 @@ #include #include "internal.h" -#include #include #include "xf86drm.h" - -#include "i915_drm.h" +#include "libdrm.h" struct dumb_bo { @@ -148,7 +147,7 @@ if (ret) return ret; - map = mmap(0, bo->base.size, PROT_READ | PROT_WRITE, MAP_SHARED, bo->base.kms->fd, arg.offset); + map = drm_mmap(0, bo->base.size, PROT_READ | PROT_WRITE, MAP_SHARED, bo->base.kms->fd, arg.offset); if (map == MAP_FAILED) return -errno; @@ -176,7 +175,7 @@ if (bo->base.ptr) { /* XXX Sanity check map_count */ - munmap(bo->base.ptr, bo->base.size); + drm_munmap(bo->base.ptr, bo->base.size); bo->base.ptr = NULL; } diff -Nru libdrm-2.4.56/libkms/exynos.c libdrm-2.4.60/libkms/exynos.c --- libdrm-2.4.56/libkms/exynos.c 2014-02-07 16:58:41.000000000 +0000 +++ libdrm-2.4.60/libkms/exynos.c 2015-02-28 18:34:25.000000000 +0000 @@ -11,8 +11,9 @@ * option) any later version. */ -#define HAVE_STDINT_H -#define _FILE_OFFSET_BITS 64 +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif #include #include @@ -24,6 +25,7 @@ #include #include "xf86drm.h" +#include "libdrm.h" #include "exynos_drm.h" struct exynos_bo @@ -123,7 +125,7 @@ exynos_bo_map(struct kms_bo *_bo, void **out) { struct exynos_bo *bo = (struct exynos_bo *)_bo; - struct drm_exynos_gem_map_off arg; + struct drm_mode_map_dumb arg; void *map = NULL; int ret; @@ -136,11 +138,11 @@ memset(&arg, 0, sizeof(arg)); arg.handle = bo->base.handle; - ret = drmCommandWriteRead(bo->base.kms->fd, DRM_EXYNOS_GEM_MAP_OFFSET, &arg, sizeof(arg)); + ret = drmIoctl(bo->base.kms->fd, DRM_IOCTL_MODE_MAP_DUMB, &arg); if (ret) return ret; - map = mmap(0, bo->base.size, PROT_READ | PROT_WRITE, MAP_SHARED, bo->base.kms->fd, arg.offset); + map = drm_mmap(0, bo->base.size, PROT_READ | PROT_WRITE, MAP_SHARED, bo->base.kms->fd, arg.offset); if (map == MAP_FAILED) return -errno; diff -Nru libdrm-2.4.56/libkms/intel.c libdrm-2.4.60/libkms/intel.c --- libdrm-2.4.56/libkms/intel.c 2013-08-12 18:01:20.000000000 +0000 +++ libdrm-2.4.60/libkms/intel.c 2015-02-28 18:34:25.000000000 +0000 @@ -26,8 +26,9 @@ **************************************************************************/ -#define HAVE_STDINT_H -#define _FILE_OFFSET_BITS 64 +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif #include #include @@ -35,9 +36,9 @@ #include #include "internal.h" -#include #include #include "xf86drm.h" +#include "libdrm.h" #include "i915_drm.h" @@ -172,7 +173,7 @@ if (ret) return ret; - map = mmap(0, bo->base.size, PROT_READ | PROT_WRITE, MAP_SHARED, bo->base.kms->fd, arg.offset); + map = drm_mmap(0, bo->base.size, PROT_READ | PROT_WRITE, MAP_SHARED, bo->base.kms->fd, arg.offset); if (map == MAP_FAILED) return -errno; @@ -200,7 +201,7 @@ if (bo->base.ptr) { /* XXX Sanity check map_count */ - munmap(bo->base.ptr, bo->base.size); + drm_munmap(bo->base.ptr, bo->base.size); bo->base.ptr = NULL; } diff -Nru libdrm-2.4.56/libkms/linux.c libdrm-2.4.60/libkms/linux.c --- libdrm-2.4.56/libkms/linux.c 2014-07-26 18:08:30.000000000 +0000 +++ libdrm-2.4.60/libkms/linux.c 2015-02-28 18:34:25.000000000 +0000 @@ -30,7 +30,9 @@ */ +#ifdef HAVE_CONFIG_H #include "config.h" +#endif #include #include #include @@ -101,25 +103,31 @@ if (ret) return ret; +#ifdef HAVE_INTEL if (!strcmp(name, "intel")) ret = intel_create(fd, out); + else +#endif #ifdef HAVE_VMWGFX - else if (!strcmp(name, "vmwgfx")) + if (!strcmp(name, "vmwgfx")) ret = vmwgfx_create(fd, out); + else #endif #ifdef HAVE_NOUVEAU - else if (!strcmp(name, "nouveau")) + if (!strcmp(name, "nouveau")) ret = nouveau_create(fd, out); + else #endif #ifdef HAVE_RADEON - else if (!strcmp(name, "radeon")) + if (!strcmp(name, "radeon")) ret = radeon_create(fd, out); + else #endif #ifdef HAVE_EXYNOS - else if (!strcmp(name, "exynos")) + if (!strcmp(name, "exynos")) ret = exynos_create(fd, out); -#endif else +#endif ret = -ENOSYS; free(name); diff -Nru libdrm-2.4.56/libkms/Makefile.am libdrm-2.4.60/libkms/Makefile.am --- libdrm-2.4.56/libkms/Makefile.am 2014-07-26 18:08:30.000000000 +0000 +++ libdrm-2.4.60/libkms/Makefile.am 2015-02-28 18:34:25.000000000 +0000 @@ -1,3 +1,5 @@ +include Makefile.sources + AM_CFLAGS = \ $(WARN_CFLAGS) \ -I$(top_srcdir)/include/drm \ @@ -12,34 +14,33 @@ #libkms_la_LIBADD += $(LIBUDEV_LIBS) #endif -libkms_la_SOURCES = \ - internal.h \ - linux.c \ - intel.c \ - dumb.c \ - api.c +libkms_la_SOURCES = $(LIBKMS_FILES) if HAVE_VMWGFX -libkms_la_SOURCES += vmwgfx.c +libkms_la_SOURCES += $(LIBKMS_VMWGFX_FILES) +endif + +if HAVE_INTEL +libkms_la_SOURCES += $(LIBKMS_INTEL_FILES) endif if HAVE_NOUVEAU -libkms_la_SOURCES += nouveau.c +libkms_la_SOURCES += $(LIBKMS_NOUVEAU_FILES) endif if HAVE_RADEON -libkms_la_SOURCES += radeon.c +libkms_la_SOURCES += $(LIBKMS_RADEON_FILES) endif if HAVE_EXYNOS -libkms_la_SOURCES += exynos.c +libkms_la_SOURCES += $(LIBKMS_EXYNOS_FILES) AM_CFLAGS += -I$(top_srcdir)/exynos endif libkmsincludedir = ${includedir}/libkms -libkmsinclude_HEADERS = libkms.h +libkmsinclude_HEADERS = $(LIBKMS_H_FILES) pkgconfigdir = @pkgconfigdir@ pkgconfig_DATA = libkms.pc -EXTRA_DIST = libkms.pc.in +EXTRA_DIST = Android.mk diff -Nru libdrm-2.4.56/libkms/Makefile.in libdrm-2.4.60/libkms/Makefile.in --- libdrm-2.4.56/libkms/Makefile.in 2014-07-29 16:13:53.000000000 +0000 +++ libdrm-2.4.60/libkms/Makefile.in 2015-03-19 14:37:46.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.14.1 from Makefile.am. +# Makefile.in generated by automake 1.13.4 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. @@ -80,15 +80,16 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -@HAVE_VMWGFX_TRUE@am__append_1 = vmwgfx.c -@HAVE_NOUVEAU_TRUE@am__append_2 = nouveau.c -@HAVE_RADEON_TRUE@am__append_3 = radeon.c -@HAVE_EXYNOS_TRUE@am__append_4 = exynos.c -@HAVE_EXYNOS_TRUE@am__append_5 = -I$(top_srcdir)/exynos +DIST_COMMON = $(srcdir)/Makefile.sources $(srcdir)/Makefile.in \ + $(srcdir)/Makefile.am $(srcdir)/libkms.pc.in \ + $(top_srcdir)/build-aux/depcomp $(libkmsinclude_HEADERS) +@HAVE_VMWGFX_TRUE@am__append_1 = $(LIBKMS_VMWGFX_FILES) +@HAVE_INTEL_TRUE@am__append_2 = $(LIBKMS_INTEL_FILES) +@HAVE_NOUVEAU_TRUE@am__append_3 = $(LIBKMS_NOUVEAU_FILES) +@HAVE_RADEON_TRUE@am__append_4 = $(LIBKMS_RADEON_FILES) +@HAVE_EXYNOS_TRUE@am__append_5 = $(LIBKMS_EXYNOS_FILES) +@HAVE_EXYNOS_TRUE@am__append_6 = -I$(top_srcdir)/exynos subdir = libkms -DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ - $(srcdir)/libkms.pc.in $(top_srcdir)/build-aux/depcomp \ - $(libkmsinclude_HEADERS) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ @@ -131,15 +132,22 @@ "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(libkmsincludedir)" LTLIBRARIES = $(libkms_la_LTLIBRARIES) libkms_la_DEPENDENCIES = ../libdrm.la -am__libkms_la_SOURCES_DIST = internal.h linux.c intel.c dumb.c api.c \ - vmwgfx.c nouveau.c radeon.c exynos.c -@HAVE_VMWGFX_TRUE@am__objects_1 = vmwgfx.lo -@HAVE_NOUVEAU_TRUE@am__objects_2 = nouveau.lo -@HAVE_RADEON_TRUE@am__objects_3 = radeon.lo -@HAVE_EXYNOS_TRUE@am__objects_4 = exynos.lo -am_libkms_la_OBJECTS = linux.lo intel.lo dumb.lo api.lo \ - $(am__objects_1) $(am__objects_2) $(am__objects_3) \ - $(am__objects_4) +am__libkms_la_SOURCES_DIST = internal.h linux.c dumb.c api.c vmwgfx.c \ + intel.c nouveau.c radeon.c exynos.c +am__objects_1 = linux.lo dumb.lo api.lo +am__objects_2 = vmwgfx.lo +@HAVE_VMWGFX_TRUE@am__objects_3 = $(am__objects_2) +am__objects_4 = intel.lo +@HAVE_INTEL_TRUE@am__objects_5 = $(am__objects_4) +am__objects_6 = nouveau.lo +@HAVE_NOUVEAU_TRUE@am__objects_7 = $(am__objects_6) +am__objects_8 = radeon.lo +@HAVE_RADEON_TRUE@am__objects_9 = $(am__objects_8) +am__objects_10 = exynos.lo +@HAVE_EXYNOS_TRUE@am__objects_11 = $(am__objects_10) +am_libkms_la_OBJECTS = $(am__objects_1) $(am__objects_3) \ + $(am__objects_5) $(am__objects_7) $(am__objects_9) \ + $(am__objects_11) libkms_la_OBJECTS = $(am_libkms_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) @@ -256,7 +264,6 @@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MANPAGES_STYLESHEET = @MANPAGES_STYLESHEET@ @@ -290,6 +297,7 @@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ VALGRIND_LIBS = @VALGRIND_LIBS@ VERSION = @VERSION@ +VISIBILITY_CFLAGS = @VISIBILITY_CFLAGS@ WARN_CFLAGS = @WARN_CFLAGS@ XSLTPROC = @XSLTPROC@ abs_builddir = @abs_builddir@ @@ -346,8 +354,32 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ +LIBKMS_FILES := \ + internal.h \ + linux.c \ + dumb.c \ + api.c + +LIBKMS_VMWGFX_FILES := \ + vmwgfx.c + +LIBKMS_INTEL_FILES := \ + intel.c + +LIBKMS_NOUVEAU_FILES := \ + nouveau.c + +LIBKMS_RADEON_FILES := \ + radeon.c + +LIBKMS_EXYNOS_FILES := \ + exynos.c + +LIBKMS_H_FILES := \ + libkms.h + AM_CFLAGS = $(WARN_CFLAGS) -I$(top_srcdir)/include/drm -I$(top_srcdir) \ - $(am__append_5) + $(am__append_6) libkms_la_LTLIBRARIES = libkms.la libkms_ladir = $(libdir) libkms_la_LDFLAGS = -version-number 1:0:0 -no-undefined @@ -356,18 +388,17 @@ #if HAVE_LIBUDEV #libkms_la_LIBADD += $(LIBUDEV_LIBS) #endif -libkms_la_SOURCES = internal.h linux.c intel.c dumb.c api.c \ - $(am__append_1) $(am__append_2) $(am__append_3) \ - $(am__append_4) +libkms_la_SOURCES = $(LIBKMS_FILES) $(am__append_1) $(am__append_2) \ + $(am__append_3) $(am__append_4) $(am__append_5) libkmsincludedir = ${includedir}/libkms -libkmsinclude_HEADERS = libkms.h +libkmsinclude_HEADERS = $(LIBKMS_H_FILES) pkgconfig_DATA = libkms.pc -EXTRA_DIST = libkms.pc.in +EXTRA_DIST = Android.mk all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(srcdir)/Makefile.sources $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -388,13 +419,14 @@ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; +$(srcdir)/Makefile.sources: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): libkms.pc: $(top_builddir)/config.status $(srcdir)/libkms.pc.in @@ -458,14 +490,14 @@ @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< diff -Nru libdrm-2.4.56/libkms/Makefile.sources libdrm-2.4.60/libkms/Makefile.sources --- libdrm-2.4.56/libkms/Makefile.sources 1970-01-01 00:00:00.000000000 +0000 +++ libdrm-2.4.60/libkms/Makefile.sources 2015-02-28 18:34:25.000000000 +0000 @@ -0,0 +1,23 @@ +LIBKMS_FILES := \ + internal.h \ + linux.c \ + dumb.c \ + api.c + +LIBKMS_VMWGFX_FILES := \ + vmwgfx.c + +LIBKMS_INTEL_FILES := \ + intel.c + +LIBKMS_NOUVEAU_FILES := \ + nouveau.c + +LIBKMS_RADEON_FILES := \ + radeon.c + +LIBKMS_EXYNOS_FILES := \ + exynos.c + +LIBKMS_H_FILES := \ + libkms.h diff -Nru libdrm-2.4.56/libkms/nouveau.c libdrm-2.4.60/libkms/nouveau.c --- libdrm-2.4.56/libkms/nouveau.c 2013-08-12 18:01:22.000000000 +0000 +++ libdrm-2.4.60/libkms/nouveau.c 2015-02-28 18:34:25.000000000 +0000 @@ -26,8 +26,9 @@ **************************************************************************/ -#define HAVE_STDINT_H -#define _FILE_OFFSET_BITS 64 +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif #include #include @@ -35,9 +36,9 @@ #include #include "internal.h" -#include #include #include "xf86drm.h" +#include "libdrm.h" #include "nouveau_drm.h" @@ -154,7 +155,7 @@ return 0; } - map = mmap(0, bo->base.size, PROT_READ | PROT_WRITE, MAP_SHARED, bo->base.kms->fd, bo->map_handle); + map = drm_mmap(0, bo->base.size, PROT_READ | PROT_WRITE, MAP_SHARED, bo->base.kms->fd, bo->map_handle); if (map == MAP_FAILED) return -errno; @@ -182,7 +183,7 @@ if (bo->base.ptr) { /* XXX Sanity check map_count */ - munmap(bo->base.ptr, bo->base.size); + drm_munmap(bo->base.ptr, bo->base.size); bo->base.ptr = NULL; } diff -Nru libdrm-2.4.56/libkms/radeon.c libdrm-2.4.60/libkms/radeon.c --- libdrm-2.4.56/libkms/radeon.c 2013-08-12 18:01:22.000000000 +0000 +++ libdrm-2.4.60/libkms/radeon.c 2015-02-28 18:34:25.000000000 +0000 @@ -26,8 +26,9 @@ **************************************************************************/ -#define HAVE_STDINT_H -#define _FILE_OFFSET_BITS 64 +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif #include #include @@ -35,9 +36,9 @@ #include #include "internal.h" -#include #include #include "xf86drm.h" +#include "libdrm.h" #include "radeon_drm.h" @@ -171,7 +172,7 @@ if (ret) return -errno; - map = mmap(0, arg.size, PROT_READ | PROT_WRITE, MAP_SHARED, + map = drm_mmap(0, arg.size, PROT_READ | PROT_WRITE, MAP_SHARED, bo->base.kms->fd, arg.addr_ptr); if (map == MAP_FAILED) return -errno; @@ -188,7 +189,7 @@ { struct radeon_bo *bo = (struct radeon_bo *)_bo; if (--bo->map_count == 0) { - munmap(bo->base.ptr, bo->base.size); + drm_munmap(bo->base.ptr, bo->base.size); bo->base.ptr = NULL; } return 0; @@ -203,7 +204,7 @@ if (bo->base.ptr) { /* XXX Sanity check map_count */ - munmap(bo->base.ptr, bo->base.size); + drm_munmap(bo->base.ptr, bo->base.size); bo->base.ptr = NULL; } diff -Nru libdrm-2.4.56/libkms/vmwgfx.c libdrm-2.4.60/libkms/vmwgfx.c --- libdrm-2.4.56/libkms/vmwgfx.c 2013-08-12 18:01:22.000000000 +0000 +++ libdrm-2.4.60/libkms/vmwgfx.c 2015-02-28 18:34:25.000000000 +0000 @@ -26,16 +26,17 @@ **************************************************************************/ -#define HAVE_STDINT_H -#define _FILE_OFFSET_BITS 64 +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif #include #include #include #include "internal.h" -#include #include "xf86drm.h" +#include "libdrm.h" #include "vmwgfx_drm.h" struct vmwgfx_bo @@ -145,7 +146,7 @@ return 0; } - map = mmap(NULL, bo->base.size, PROT_READ | PROT_WRITE, MAP_SHARED, bo->base.kms->fd, bo->map_handle); + map = drm_mmap(NULL, bo->base.size, PROT_READ | PROT_WRITE, MAP_SHARED, bo->base.kms->fd, bo->map_handle); if (map == MAP_FAILED) return -errno; @@ -172,7 +173,7 @@ if (bo->base.ptr) { /* XXX Sanity check map_count */ - munmap(bo->base.ptr, bo->base.size); + drm_munmap(bo->base.ptr, bo->base.size); bo->base.ptr = NULL; } diff -Nru libdrm-2.4.56/m4/libtool.m4 libdrm-2.4.60/m4/libtool.m4 --- libdrm-2.4.56/m4/libtool.m4 2014-07-29 16:13:50.000000000 +0000 +++ libdrm-2.4.60/m4/libtool.m4 2015-03-19 14:37:41.000000000 +0000 @@ -1324,19 +1324,12 @@ LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) - case `/usr/bin/file conftest.o` in - *x86-64*) - LD="${LD-ld} -m elf32_x86_64" - ;; - *) - LD="${LD-ld} -m elf_i386" - ;; - esac + LD="${LD-ld} -m elf_i386" ;; - powerpc64le-*) + powerpc64le-*linux*) LD="${LD-ld} -m elf32lppclinux" ;; - powerpc64-*) + powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) @@ -1355,10 +1348,10 @@ x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; - powerpcle-*) + powerpcle-*linux*) LD="${LD-ld} -m elf64lppc" ;; - powerpc-*) + powerpc-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) @@ -1701,8 +1694,7 @@ ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` - if test -n "$lt_cv_sys_max_cmd_len" && \ - test undefined != "$lt_cv_sys_max_cmd_len"; then + if test -n "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else @@ -2526,6 +2518,17 @@ 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 @@ -2642,7 +2645,7 @@ ;; # This must be glibc/ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) +linux* | k*bsd*-gnu | kopensolaris*-gnu) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no @@ -2672,10 +2675,14 @@ # before this can be enabled. hardcode_into_libs=yes + # Add ABI-specific directories to the system library path. + sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" + # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` - sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" + fi # We used to test for /lib/ld.so.1 and disable shared libraries on @@ -2687,18 +2694,6 @@ 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 @@ -3258,6 +3253,10 @@ fi ;; +gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + haiku*) lt_cv_deplibs_check_method=pass_all ;; @@ -3296,11 +3295,11 @@ ;; # This must be glibc/ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) +linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; -netbsd* | netbsdelf*-gnu) +netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else @@ -4048,7 +4047,7 @@ ;; esac ;; - linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # KAI C++ Compiler @@ -4112,7 +4111,7 @@ ;; esac ;; - netbsd* | netbsdelf*-gnu) + netbsd*) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise @@ -4347,7 +4346,7 @@ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; - linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) @@ -4589,9 +4588,6 @@ ;; 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' ;; @@ -4654,9 +4650,6 @@ openbsd*) with_gnu_ld=no ;; - linux* | k*bsd*-gnu | gnu*) - _LT_TAGVAR(link_all_deplibs, $1)=no - ;; esac _LT_TAGVAR(ld_shlibs, $1)=yes @@ -4878,7 +4871,7 @@ fi ;; - netbsd* | netbsdelf*-gnu) + netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= @@ -5055,7 +5048,6 @@ if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi - _LT_TAGVAR(link_all_deplibs, $1)=no else # not using gcc if test "$host_cpu" = ia64; then @@ -5360,7 +5352,7 @@ _LT_TAGVAR(link_all_deplibs, $1)=yes ;; - netbsd* | netbsdelf*-gnu) + netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else @@ -6240,6 +6232,9 @@ _LT_TAGVAR(ld_shlibs, $1)=yes ;; + gnu*) + ;; + haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes @@ -6401,7 +6396,7 @@ _LT_TAGVAR(inherit_rpath, $1)=yes ;; - linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler diff -Nru libdrm-2.4.56/Makefile.am libdrm-2.4.60/Makefile.am --- libdrm-2.4.56/Makefile.am 2014-07-26 18:08:30.000000000 +0000 +++ libdrm-2.4.60/Makefile.am 2015-03-18 17:33:36.000000000 +0000 @@ -18,8 +18,26 @@ # IN AN ACTION 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 Makefile.sources + ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS} +AM_DISTCHECK_CONFIGURE_FLAGS = \ + --enable-udev \ + --enable-libkms \ + --enable-intel \ + --enable-radeon \ + --enable-nouveau \ + --enable-vmwgfx \ + --enable-omap-experimental-api \ + --enable-exynos-experimental-api \ + --enable-freedreno \ + --enable-freedreno-kgsl\ + --enable-tegra-experimental-api \ + --enable-install-test-programs \ + --enable-cairo-tests \ + --enable-manpages + pkgconfigdir = @pkgconfigdir@ pkgconfig_DATA = libdrm.pc @@ -51,7 +69,22 @@ FREEDRENO_SUBDIR = freedreno endif -SUBDIRS = . $(LIBKMS_SUBDIR) $(INTEL_SUBDIR) $(NOUVEAU_SUBDIR) $(RADEON_SUBDIR) $(OMAP_SUBDIR) $(EXYNOS_SUBDIR) $(FREEDRENO_SUBDIR) tests include man +if HAVE_TEGRA +TEGRA_SUBDIR = tegra +endif + +SUBDIRS = \ + . \ + $(LIBKMS_SUBDIR) \ + $(INTEL_SUBDIR) \ + $(NOUVEAU_SUBDIR) \ + $(RADEON_SUBDIR) \ + $(OMAP_SUBDIR) \ + $(EXYNOS_SUBDIR) \ + $(FREEDRENO_SUBDIR) \ + $(TEGRA_SUBDIR) \ + tests \ + man libdrm_la_LTLIBRARIES = libdrm.la libdrm_ladir = $(libdir) @@ -60,25 +93,27 @@ libdrm_la_CPPFLAGS = -I$(top_srcdir)/include/drm AM_CFLAGS = \ + $(WARN_CFLAGS) \ $(VALGRIND_CFLAGS) -libdrm_la_SOURCES = \ - xf86drm.c \ - xf86drmHash.c \ - xf86drmRandom.c \ - xf86drmSL.c \ - xf86drmMode.c \ - xf86atomic.h \ - libdrm_lists.h +libdrm_la_SOURCES = $(LIBDRM_FILES) libdrmincludedir = ${includedir} -libdrminclude_HEADERS = xf86drm.h xf86drmMode.h +libdrminclude_HEADERS = $(LIBDRM_H_FILES) + +EXTRA_DIST = Android.mk + +klibdrmincludedir = ${includedir}/libdrm +klibdrminclude_HEADERS = $(LIBDRM_INCLUDE_H_FILES) + +if HAVE_VMWGFX +klibdrminclude_HEADERS += $(LIBDRM_INCLUDE_VMWGFX_H_FILES) +endif -EXTRA_DIST = libdrm.pc.in include/drm/* copy-headers : - cp -r $(kernel_source)/usr/include/drm $(top_srcdir)/include + cp -r $(kernel_source)/include/uapi/drm/*.h $(top_srcdir)/include/drm/ commit-headers : copy-headers - git add include + git add include/drm/*.h git commit -am "Copy headers from kernel $$(GIT_DIR=$(kernel_source)/.git git describe)" diff -Nru libdrm-2.4.56/Makefile.in libdrm-2.4.60/Makefile.in --- libdrm-2.4.56/Makefile.in 2014-07-29 16:13:52.000000000 +0000 +++ libdrm-2.4.60/Makefile.in 2015-03-19 14:37:46.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.14.1 from Makefile.am. +# Makefile.in generated by automake 1.13.4 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. @@ -100,20 +100,20 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -subdir = . -DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ - $(top_srcdir)/configure $(am__configure_deps) \ - $(srcdir)/config.h.in $(srcdir)/libdrm.pc.in \ - $(top_srcdir)/build-aux/depcomp $(libdrminclude_HEADERS) \ - README build-aux/compile build-aux/config.guess \ - build-aux/config.sub build-aux/depcomp build-aux/install-sh \ - build-aux/missing build-aux/ltmain.sh \ - $(top_srcdir)/build-aux/compile \ - $(top_srcdir)/build-aux/config.guess \ +DIST_COMMON = $(srcdir)/Makefile.sources $(srcdir)/Makefile.in \ + $(srcdir)/Makefile.am $(top_srcdir)/configure \ + $(am__configure_deps) $(srcdir)/config.h.in \ + $(srcdir)/libdrm.pc.in $(top_srcdir)/build-aux/depcomp \ + $(am__klibdrminclude_HEADERS_DIST) $(libdrminclude_HEADERS) \ + README build-aux/config.guess build-aux/config.sub \ + build-aux/depcomp build-aux/install-sh build-aux/missing \ + build-aux/ltmain.sh $(top_srcdir)/build-aux/config.guess \ $(top_srcdir)/build-aux/config.sub \ $(top_srcdir)/build-aux/install-sh \ $(top_srcdir)/build-aux/ltmain.sh \ $(top_srcdir)/build-aux/missing +@HAVE_VMWGFX_TRUE@am__append_1 = $(LIBDRM_INCLUDE_VMWGFX_H_FILES) +subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ @@ -155,12 +155,14 @@ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libdrm_ladir)" \ - "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(libdrmincludedir)" + "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(klibdrmincludedir)" \ + "$(DESTDIR)$(libdrmincludedir)" LTLIBRARIES = $(libdrm_la_LTLIBRARIES) libdrm_la_DEPENDENCIES = -am_libdrm_la_OBJECTS = libdrm_la-xf86drm.lo libdrm_la-xf86drmHash.lo \ +am__objects_1 = libdrm_la-xf86drm.lo libdrm_la-xf86drmHash.lo \ libdrm_la-xf86drmRandom.lo libdrm_la-xf86drmSL.lo \ libdrm_la-xf86drmMode.lo +am_libdrm_la_OBJECTS = $(am__objects_1) libdrm_la_OBJECTS = $(am_libdrm_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) @@ -219,7 +221,16 @@ *) (install-info --version) >/dev/null 2>&1;; \ esac DATA = $(pkgconfig_DATA) -HEADERS = $(libdrminclude_HEADERS) +am__klibdrminclude_HEADERS_DIST = include/drm/drm.h \ + include/drm/drm_fourcc.h include/drm/drm_mode.h \ + include/drm/drm_sarea.h include/drm/i915_drm.h \ + include/drm/mach64_drm.h include/drm/mga_drm.h \ + include/drm/nouveau_drm.h include/drm/qxl_drm.h \ + include/drm/r128_drm.h include/drm/radeon_drm.h \ + include/drm/savage_drm.h include/drm/sis_drm.h \ + include/drm/tegra_drm.h include/drm/via_drm.h \ + include/drm/vmwgfx_drm.h +HEADERS = $(klibdrminclude_HEADERS) $(libdrminclude_HEADERS) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ @@ -250,7 +261,7 @@ CTAGS = ctags CSCOPE = cscope DIST_SUBDIRS = . libkms intel nouveau radeon omap exynos freedreno \ - tests include man + tegra tests man DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) @@ -338,7 +349,6 @@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MANPAGES_STYLESHEET = @MANPAGES_STYLESHEET@ @@ -372,6 +382,7 @@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ VALGRIND_LIBS = @VALGRIND_LIBS@ VERSION = @VERSION@ +VISIBILITY_CFLAGS = @VISIBILITY_CFLAGS@ WARN_CFLAGS = @WARN_CFLAGS@ XSLTPROC = @XSLTPROC@ abs_builddir = @abs_builddir@ @@ -428,7 +439,57 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ +LIBDRM_FILES := \ + xf86drm.c \ + xf86drmHash.c \ + xf86drmRandom.c \ + xf86drmSL.c \ + xf86drmMode.c \ + xf86atomic.h \ + libdrm.h \ + libdrm_lists.h + +LIBDRM_H_FILES := \ + xf86drm.h \ + xf86drmMode.h + +LIBDRM_INCLUDE_H_FILES := \ + include/drm/drm.h \ + include/drm/drm_fourcc.h \ + include/drm/drm_mode.h \ + include/drm/drm_sarea.h \ + include/drm/i915_drm.h \ + include/drm/mach64_drm.h \ + include/drm/mga_drm.h \ + include/drm/nouveau_drm.h \ + include/drm/qxl_drm.h \ + include/drm/r128_drm.h \ + include/drm/radeon_drm.h \ + include/drm/savage_drm.h \ + include/drm/sis_drm.h \ + include/drm/tegra_drm.h \ + include/drm/via_drm.h + +LIBDRM_INCLUDE_VMWGFX_H_FILES := \ + include/drm/vmwgfx_drm.h + ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS} +AM_DISTCHECK_CONFIGURE_FLAGS = \ + --enable-udev \ + --enable-libkms \ + --enable-intel \ + --enable-radeon \ + --enable-nouveau \ + --enable-vmwgfx \ + --enable-omap-experimental-api \ + --enable-exynos-experimental-api \ + --enable-freedreno \ + --enable-freedreno-kgsl\ + --enable-tegra-experimental-api \ + --enable-install-test-programs \ + --enable-cairo-tests \ + --enable-manpages + pkgconfig_DATA = libdrm.pc @HAVE_LIBKMS_TRUE@LIBKMS_SUBDIR = libkms @HAVE_INTEL_TRUE@INTEL_SUBDIR = intel @@ -437,27 +498,35 @@ @HAVE_OMAP_TRUE@OMAP_SUBDIR = omap @HAVE_EXYNOS_TRUE@EXYNOS_SUBDIR = exynos @HAVE_FREEDRENO_TRUE@FREEDRENO_SUBDIR = freedreno -SUBDIRS = . $(LIBKMS_SUBDIR) $(INTEL_SUBDIR) $(NOUVEAU_SUBDIR) $(RADEON_SUBDIR) $(OMAP_SUBDIR) $(EXYNOS_SUBDIR) $(FREEDRENO_SUBDIR) tests include man +@HAVE_TEGRA_TRUE@TEGRA_SUBDIR = tegra +SUBDIRS = \ + . \ + $(LIBKMS_SUBDIR) \ + $(INTEL_SUBDIR) \ + $(NOUVEAU_SUBDIR) \ + $(RADEON_SUBDIR) \ + $(OMAP_SUBDIR) \ + $(EXYNOS_SUBDIR) \ + $(FREEDRENO_SUBDIR) \ + $(TEGRA_SUBDIR) \ + tests \ + man + libdrm_la_LTLIBRARIES = libdrm.la libdrm_ladir = $(libdir) libdrm_la_LDFLAGS = -version-number 2:4:0 -no-undefined libdrm_la_LIBADD = @CLOCK_LIB@ libdrm_la_CPPFLAGS = -I$(top_srcdir)/include/drm AM_CFLAGS = \ + $(WARN_CFLAGS) \ $(VALGRIND_CFLAGS) -libdrm_la_SOURCES = \ - xf86drm.c \ - xf86drmHash.c \ - xf86drmRandom.c \ - xf86drmSL.c \ - xf86drmMode.c \ - xf86atomic.h \ - libdrm_lists.h - +libdrm_la_SOURCES = $(LIBDRM_FILES) libdrmincludedir = ${includedir} -libdrminclude_HEADERS = xf86drm.h xf86drmMode.h -EXTRA_DIST = libdrm.pc.in include/drm/* +libdrminclude_HEADERS = $(LIBDRM_H_FILES) +EXTRA_DIST = Android.mk +klibdrmincludedir = ${includedir}/libdrm +klibdrminclude_HEADERS = $(LIBDRM_INCLUDE_H_FILES) $(am__append_1) all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive @@ -465,7 +534,7 @@ .SUFFIXES: .c .lo .o .obj am--refresh: Makefile @: -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(srcdir)/Makefile.sources $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -488,24 +557,25 @@ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; +$(srcdir)/Makefile.sources: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): config.h: stamp-h1 - @test -f $@ || rm -f stamp-h1 - @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 + @if test ! -f $@; then rm -f stamp-h1; else :; fi + @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h -$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(srcdir)/config.h.in: $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ @@ -570,14 +640,14 @@ @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @@ -650,6 +720,27 @@ @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir) +install-klibdrmincludeHEADERS: $(klibdrminclude_HEADERS) + @$(NORMAL_INSTALL) + @list='$(klibdrminclude_HEADERS)'; test -n "$(klibdrmincludedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(klibdrmincludedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(klibdrmincludedir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(klibdrmincludedir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(klibdrmincludedir)" || exit $$?; \ + done + +uninstall-klibdrmincludeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(klibdrminclude_HEADERS)'; test -n "$(klibdrmincludedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(klibdrmincludedir)'; $(am__uninstall_files_from_dir) install-libdrmincludeHEADERS: $(libdrminclude_HEADERS) @$(NORMAL_INSTALL) @list='$(libdrminclude_HEADERS)'; test -n "$(libdrmincludedir)" || list=; \ @@ -858,16 +949,10 @@ $(am__post_remove_distdir) dist-tarZ: distdir - @echo WARNING: "Support for shar distribution archives is" \ - "deprecated." >&2 - @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir - @echo WARNING: "Support for distribution archives compressed with" \ - "legacy program 'compress' is deprecated." >&2 - @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__post_remove_distdir) @@ -909,10 +994,9 @@ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build \ - && ../configure \ + && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ - --srcdir=.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ @@ -970,7 +1054,7 @@ all-am: Makefile $(LTLIBRARIES) $(DATA) $(HEADERS) config.h installdirs: installdirs-recursive installdirs-am: - for dir in "$(DESTDIR)$(libdrm_ladir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(libdrmincludedir)"; do \ + for dir in "$(DESTDIR)$(libdrm_ladir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(klibdrmincludedir)" "$(DESTDIR)$(libdrmincludedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive @@ -1027,8 +1111,9 @@ info-am: -install-data-am: install-libdrm_laLTLIBRARIES \ - install-libdrmincludeHEADERS install-pkgconfigDATA +install-data-am: install-klibdrmincludeHEADERS \ + install-libdrm_laLTLIBRARIES install-libdrmincludeHEADERS \ + install-pkgconfigDATA install-dvi: install-dvi-recursive @@ -1076,8 +1161,9 @@ ps-am: -uninstall-am: uninstall-libdrm_laLTLIBRARIES \ - uninstall-libdrmincludeHEADERS uninstall-pkgconfigDATA +uninstall-am: uninstall-klibdrmincludeHEADERS \ + uninstall-libdrm_laLTLIBRARIES uninstall-libdrmincludeHEADERS \ + uninstall-pkgconfigDATA .MAKE: $(am__recursive_targets) all install-am install-strip @@ -1092,22 +1178,23 @@ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am \ - install-libdrm_laLTLIBRARIES install-libdrmincludeHEADERS \ - install-man install-pdf install-pdf-am install-pkgconfigDATA \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs installdirs-am maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags tags-am uninstall uninstall-am \ + install-klibdrmincludeHEADERS install-libdrm_laLTLIBRARIES \ + install-libdrmincludeHEADERS install-man install-pdf \ + install-pdf-am install-pkgconfigDATA install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + installdirs-am maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ + uninstall-am uninstall-klibdrmincludeHEADERS \ uninstall-libdrm_laLTLIBRARIES uninstall-libdrmincludeHEADERS \ uninstall-pkgconfigDATA copy-headers : - cp -r $(kernel_source)/usr/include/drm $(top_srcdir)/include + cp -r $(kernel_source)/include/uapi/drm/*.h $(top_srcdir)/include/drm/ commit-headers : copy-headers - git add include + git add include/drm/*.h git commit -am "Copy headers from kernel $$(GIT_DIR=$(kernel_source)/.git git describe)" # Tell versions [3.59,3.63) of GNU make to not export all variables. diff -Nru libdrm-2.4.56/Makefile.sources libdrm-2.4.60/Makefile.sources --- libdrm-2.4.56/Makefile.sources 1970-01-01 00:00:00.000000000 +0000 +++ libdrm-2.4.60/Makefile.sources 2015-02-28 18:34:25.000000000 +0000 @@ -0,0 +1,33 @@ +LIBDRM_FILES := \ + xf86drm.c \ + xf86drmHash.c \ + xf86drmRandom.c \ + xf86drmSL.c \ + xf86drmMode.c \ + xf86atomic.h \ + libdrm.h \ + libdrm_lists.h + +LIBDRM_H_FILES := \ + xf86drm.h \ + xf86drmMode.h + +LIBDRM_INCLUDE_H_FILES := \ + include/drm/drm.h \ + include/drm/drm_fourcc.h \ + include/drm/drm_mode.h \ + include/drm/drm_sarea.h \ + include/drm/i915_drm.h \ + include/drm/mach64_drm.h \ + include/drm/mga_drm.h \ + include/drm/nouveau_drm.h \ + include/drm/qxl_drm.h \ + include/drm/r128_drm.h \ + include/drm/radeon_drm.h \ + include/drm/savage_drm.h \ + include/drm/sis_drm.h \ + include/drm/tegra_drm.h \ + include/drm/via_drm.h + +LIBDRM_INCLUDE_VMWGFX_H_FILES := \ + include/drm/vmwgfx_drm.h diff -Nru libdrm-2.4.56/man/Makefile.in libdrm-2.4.60/man/Makefile.in --- libdrm-2.4.56/man/Makefile.in 2014-07-29 16:13:53.000000000 +0000 +++ libdrm-2.4.60/man/Makefile.in 2015-03-19 14:37:46.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.14.1 from Makefile.am. +# Makefile.in generated by automake 1.13.4 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. @@ -195,7 +195,6 @@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MANPAGES_STYLESHEET = @MANPAGES_STYLESHEET@ @@ -229,6 +228,7 @@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ VALGRIND_LIBS = @VALGRIND_LIBS@ VERSION = @VERSION@ +VISIBILITY_CFLAGS = @VISIBILITY_CFLAGS@ WARN_CFLAGS = @WARN_CFLAGS@ XSLTPROC = @XSLTPROC@ abs_builddir = @abs_builddir@ @@ -319,7 +319,7 @@ all: all-am .SUFFIXES: -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -344,9 +344,9 @@ $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): diff -Nru libdrm-2.4.56/nouveau/abi16.c libdrm-2.4.60/nouveau/abi16.c --- libdrm-2.4.56/nouveau/abi16.c 2013-08-12 18:01:25.000000000 +0000 +++ libdrm-2.4.60/nouveau/abi16.c 2015-02-28 18:34:25.000000000 +0000 @@ -22,6 +22,10 @@ * Authors: Ben Skeggs */ +#ifdef HAVE_CONFIG_H +# include +#endif + #include #include #include diff -Nru libdrm-2.4.56/nouveau/Android.mk libdrm-2.4.60/nouveau/Android.mk --- libdrm-2.4.56/nouveau/Android.mk 1970-01-01 00:00:00.000000000 +0000 +++ libdrm-2.4.60/nouveau/Android.mk 2015-02-28 18:34:25.000000000 +0000 @@ -0,0 +1,27 @@ +LOCAL_PATH := $(call my-dir) +include $(CLEAR_VARS) + +# Import variables LIBDRM_NOUVEAU_FILES, LIBDRM_NOUVEAU_H_FILES +include $(LOCAL_PATH)/Makefile.sources + +LOCAL_MODULE := libdrm_nouveau +LOCAL_MODULE_TAGS := optional + +LOCAL_SHARED_LIBRARIES := libdrm + +LOCAL_SRC_FILES := $(LIBDRM_NOUVEAU_FILES) +LOCAL_EXPORT_C_INCLUDE_DIRS += \ + $(LOCAL_PATH)/nouveau + +LOCAL_C_INCLUDES := \ + $(LIBDRM_TOP) \ + $(LIBDRM_TOP)/nouveau \ + $(LIBDRM_TOP)/include/drm + +LOCAL_CFLAGS := \ + -DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1 + +LOCAL_COPY_HEADERS := $(LIBDRM_NOUVEAU_H_FILES) +LOCAL_COPY_HEADERS_TO := libdrm + +include $(BUILD_SHARED_LIBRARY) diff -Nru libdrm-2.4.56/nouveau/bufctx.c libdrm-2.4.60/nouveau/bufctx.c --- libdrm-2.4.56/nouveau/bufctx.c 2013-08-12 18:01:26.000000000 +0000 +++ libdrm-2.4.60/nouveau/bufctx.c 2015-02-28 18:34:25.000000000 +0000 @@ -44,12 +44,6 @@ struct nouveau_bufctx *bufctx; }; -static inline struct nouveau_bufref_priv * -nouveau_bufref(struct nouveau_bufref *bctx) -{ - return (struct nouveau_bufref_priv *)bctx; -} - struct nouveau_bufbin_priv { struct nouveau_bufref_priv *list; int relocs; @@ -68,7 +62,7 @@ return (struct nouveau_bufctx_priv *)bctx; } -int +drm_public int nouveau_bufctx_new(struct nouveau_client *client, int bins, struct nouveau_bufctx **pbctx) { @@ -88,7 +82,7 @@ return -ENOMEM; } -void +drm_public void nouveau_bufctx_del(struct nouveau_bufctx **pbctx) { struct nouveau_bufctx_priv *pctx = nouveau_bufctx(*pbctx); @@ -105,7 +99,7 @@ } } -void +drm_public void nouveau_bufctx_reset(struct nouveau_bufctx *bctx, int bin) { struct nouveau_bufctx_priv *pctx = nouveau_bufctx(bctx); @@ -123,7 +117,7 @@ pbin->relocs = 0; } -struct nouveau_bufref * +drm_public struct nouveau_bufref * nouveau_bufctx_refn(struct nouveau_bufctx *bctx, int bin, struct nouveau_bo *bo, uint32_t flags) { @@ -150,7 +144,7 @@ return &pref->base; } -struct nouveau_bufref * +drm_public struct nouveau_bufref * nouveau_bufctx_mthd(struct nouveau_bufctx *bctx, int bin, uint32_t packet, struct nouveau_bo *bo, uint64_t data, uint32_t flags, uint32_t vor, uint32_t tor) diff -Nru libdrm-2.4.56/nouveau/Makefile.am libdrm-2.4.60/nouveau/Makefile.am --- libdrm-2.4.56/nouveau/Makefile.am 2013-08-12 18:01:25.000000000 +0000 +++ libdrm-2.4.60/nouveau/Makefile.am 2015-02-28 18:34:25.000000000 +0000 @@ -1,5 +1,8 @@ +include Makefile.sources + AM_CFLAGS = \ $(WARN_CFLAGS) \ + $(VISIBILITY_CFLAGS) \ -I$(top_srcdir) \ -I$(top_srcdir)/nouveau \ $(PTHREADSTUBS_CFLAGS) \ @@ -11,15 +14,12 @@ libdrm_nouveau_la_LDFLAGS = -version-number 2:0:0 -no-undefined libdrm_nouveau_la_LIBADD = ../libdrm.la @PTHREADSTUBS_LIBS@ -libdrm_nouveau_la_SOURCES = nouveau.c \ - pushbuf.c \ - bufctx.c \ - abi16.c \ - private.h - +libdrm_nouveau_la_SOURCES = $(LIBDRM_NOUVEAU_FILES) libdrm_nouveauincludedir = ${includedir}/libdrm -libdrm_nouveauinclude_HEADERS = nouveau.h +libdrm_nouveauinclude_HEADERS = $(LIBDRM_NOUVEAU_H_FILES) pkgconfigdir = @pkgconfigdir@ pkgconfig_DATA = libdrm_nouveau.pc + +EXTRA_DIST = Android.mk diff -Nru libdrm-2.4.56/nouveau/Makefile.in libdrm-2.4.60/nouveau/Makefile.in --- libdrm-2.4.56/nouveau/Makefile.in 2014-07-29 16:13:53.000000000 +0000 +++ libdrm-2.4.60/nouveau/Makefile.in 2015-03-19 14:37:46.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.14.1 from Makefile.am. +# Makefile.in generated by automake 1.13.4 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. @@ -80,10 +80,11 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -subdir = nouveau -DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ - $(srcdir)/libdrm_nouveau.pc.in $(top_srcdir)/build-aux/depcomp \ +DIST_COMMON = $(srcdir)/Makefile.sources $(srcdir)/Makefile.in \ + $(srcdir)/Makefile.am $(srcdir)/libdrm_nouveau.pc.in \ + $(top_srcdir)/build-aux/depcomp \ $(libdrm_nouveauinclude_HEADERS) +subdir = nouveau ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ @@ -127,8 +128,8 @@ "$(DESTDIR)$(libdrm_nouveauincludedir)" LTLIBRARIES = $(libdrm_nouveau_la_LTLIBRARIES) libdrm_nouveau_la_DEPENDENCIES = ../libdrm.la -am_libdrm_nouveau_la_OBJECTS = nouveau.lo pushbuf.lo bufctx.lo \ - abi16.lo +am__objects_1 = nouveau.lo pushbuf.lo bufctx.lo abi16.lo +am_libdrm_nouveau_la_OBJECTS = $(am__objects_1) libdrm_nouveau_la_OBJECTS = $(am_libdrm_nouveau_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) @@ -246,7 +247,6 @@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MANPAGES_STYLESHEET = @MANPAGES_STYLESHEET@ @@ -280,6 +280,7 @@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ VALGRIND_LIBS = @VALGRIND_LIBS@ VERSION = @VERSION@ +VISIBILITY_CFLAGS = @VISIBILITY_CFLAGS@ WARN_CFLAGS = @WARN_CFLAGS@ XSLTPROC = @XSLTPROC@ abs_builddir = @abs_builddir@ @@ -336,8 +337,19 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ +LIBDRM_NOUVEAU_FILES := \ + nouveau.c \ + pushbuf.c \ + bufctx.c \ + abi16.c \ + private.h + +LIBDRM_NOUVEAU_H_FILES := \ + nouveau.h + AM_CFLAGS = \ $(WARN_CFLAGS) \ + $(VISIBILITY_CFLAGS) \ -I$(top_srcdir) \ -I$(top_srcdir)/nouveau \ $(PTHREADSTUBS_CFLAGS) \ @@ -348,20 +360,16 @@ libdrm_nouveau_ladir = $(libdir) libdrm_nouveau_la_LDFLAGS = -version-number 2:0:0 -no-undefined libdrm_nouveau_la_LIBADD = ../libdrm.la @PTHREADSTUBS_LIBS@ -libdrm_nouveau_la_SOURCES = nouveau.c \ - pushbuf.c \ - bufctx.c \ - abi16.c \ - private.h - +libdrm_nouveau_la_SOURCES = $(LIBDRM_NOUVEAU_FILES) libdrm_nouveauincludedir = ${includedir}/libdrm -libdrm_nouveauinclude_HEADERS = nouveau.h +libdrm_nouveauinclude_HEADERS = $(LIBDRM_NOUVEAU_H_FILES) pkgconfig_DATA = libdrm_nouveau.pc +EXTRA_DIST = Android.mk all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(srcdir)/Makefile.sources $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -382,13 +390,14 @@ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; +$(srcdir)/Makefile.sources: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): libdrm_nouveau.pc: $(top_builddir)/config.status $(srcdir)/libdrm_nouveau.pc.in @@ -448,14 +457,14 @@ @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< diff -Nru libdrm-2.4.56/nouveau/Makefile.sources libdrm-2.4.60/nouveau/Makefile.sources --- libdrm-2.4.56/nouveau/Makefile.sources 1970-01-01 00:00:00.000000000 +0000 +++ libdrm-2.4.60/nouveau/Makefile.sources 2015-02-28 18:32:39.000000000 +0000 @@ -0,0 +1,9 @@ +LIBDRM_NOUVEAU_FILES := \ + nouveau.c \ + pushbuf.c \ + bufctx.c \ + abi16.c \ + private.h + +LIBDRM_NOUVEAU_H_FILES := \ + nouveau.h diff -Nru libdrm-2.4.56/nouveau/nouveau.c libdrm-2.4.60/nouveau/nouveau.c --- libdrm-2.4.56/nouveau/nouveau.c 2014-05-30 16:38:28.000000000 +0000 +++ libdrm-2.4.60/nouveau/nouveau.c 2015-03-18 17:33:36.000000000 +0000 @@ -33,11 +33,11 @@ #include #include #include -#include #include #include #include +#include "libdrm.h" #include "libdrm_lists.h" #include "nouveau_drm.h" @@ -62,14 +62,14 @@ * is kept here to prevent AIGLX from crashing if the DDX is linked against * the new libdrm, but the DRI driver against the old */ -int +drm_public int nouveau_device_open_existing(struct nouveau_device **pdev, int close, int fd, drm_context_t ctx) { return -EACCES; } -int +drm_public int nouveau_device_wrap(int fd, int close, struct nouveau_device **pdev) { struct nouveau_device_priv *nvdev = calloc(1, sizeof(*nvdev)); @@ -147,7 +147,7 @@ return 0; } -int +drm_public int nouveau_device_open(const char *busid, struct nouveau_device **pdev) { int ret = -ENODEV, fd = drmOpen("nouveau", busid); @@ -159,7 +159,7 @@ return ret; } -void +drm_public void nouveau_device_del(struct nouveau_device **pdev) { struct nouveau_device_priv *nvdev = nouveau_device(*pdev); @@ -173,7 +173,7 @@ } } -int +drm_public int nouveau_getparam(struct nouveau_device *dev, uint64_t param, uint64_t *value) { struct drm_nouveau_getparam r = { param, 0 }; @@ -183,14 +183,14 @@ return ret; } -int +drm_public int nouveau_setparam(struct nouveau_device *dev, uint64_t param, uint64_t value) { struct drm_nouveau_setparam r = { param, value }; return drmCommandWrite(dev->fd, DRM_NOUVEAU_SETPARAM, &r, sizeof(r)); } -int +drm_public int nouveau_client_new(struct nouveau_device *dev, struct nouveau_client **pclient) { struct nouveau_device_priv *nvdev = nouveau_device(dev); @@ -229,7 +229,7 @@ return ret; } -void +drm_public void nouveau_client_del(struct nouveau_client **pclient) { struct nouveau_client_priv *pcli = nouveau_client(*pclient); @@ -245,7 +245,7 @@ } } -int +drm_public int nouveau_object_new(struct nouveau_object *parent, uint64_t handle, uint32_t oclass, void *data, uint32_t length, struct nouveau_object **pobj) @@ -307,7 +307,7 @@ return 0; } -void +drm_public void nouveau_object_del(struct nouveau_object **pobj) { struct nouveau_object *obj = *pobj; @@ -331,7 +331,7 @@ *pobj = NULL; } -void * +drm_public void * nouveau_object_find(struct nouveau_object *obj, uint32_t pclass) { while (obj && obj->oclass != pclass) { @@ -349,48 +349,34 @@ struct nouveau_bo_priv *nvbo = nouveau_bo(bo); struct drm_gem_close req = { bo->handle }; - pthread_mutex_lock(&nvdev->lock); - if (nvbo->name) { - if (atomic_read(&nvbo->refcnt)) { + if (nvbo->head.next) { + pthread_mutex_lock(&nvdev->lock); + if (atomic_read(&nvbo->refcnt) == 0) { + DRMLISTDEL(&nvbo->head); /* - * bo has been revived by a race with - * nouveau_bo_prime_handle_ref, or nouveau_bo_name_ref. - * - * In theory there's still a race possible with - * nouveau_bo_wrap, but when using this function - * the lifetime of the handle is probably already - * handled in another way. If there are races - * you're probably using nouveau_bo_wrap wrong. + * This bo has to be closed with the lock held because + * gem handles are not refcounted. If a shared bo is + * closed and re-opened in another thread a race + * against DRM_IOCTL_GEM_OPEN or drmPrimeFDToHandle + * might cause the bo to be closed accidentally while + * re-importing. */ - pthread_mutex_unlock(&nvdev->lock); - return; + drmIoctl(bo->device->fd, DRM_IOCTL_GEM_CLOSE, &req); } - DRMLISTDEL(&nvbo->head); - /* - * This bo has to be closed with the lock held because gem - * handles are not refcounted. If a shared bo is closed and - * re-opened in another thread a race against - * DRM_IOCTL_GEM_OPEN or drmPrimeFDToHandle might cause the - * bo to be closed accidentally while re-importing. - */ - drmIoctl(bo->device->fd, DRM_IOCTL_GEM_CLOSE, &req); pthread_mutex_unlock(&nvdev->lock); } else { - DRMLISTDEL(&nvbo->head); - pthread_mutex_unlock(&nvdev->lock); drmIoctl(bo->device->fd, DRM_IOCTL_GEM_CLOSE, &req); } if (bo->map) - munmap(bo->map, bo->size); + drm_munmap(bo->map, bo->size); free(nvbo); } -int +drm_public int nouveau_bo_new(struct nouveau_device *dev, uint32_t flags, uint32_t align, uint64_t size, union nouveau_bo_config *config, struct nouveau_bo **pbo) { - struct nouveau_device_priv *nvdev = nouveau_device(dev); struct nouveau_bo_priv *nvbo = calloc(1, sizeof(*nvbo)); struct nouveau_bo *bo = &nvbo->base; int ret; @@ -408,17 +394,13 @@ return ret; } - pthread_mutex_lock(&nvdev->lock); - DRMLISTADD(&nvbo->head, &nvdev->bo_list); - pthread_mutex_unlock(&nvdev->lock); - *pbo = bo; return 0; } static int nouveau_bo_wrap_locked(struct nouveau_device *dev, uint32_t handle, - struct nouveau_bo **pbo) + struct nouveau_bo **pbo, int name) { struct nouveau_device_priv *nvdev = nouveau_device(dev); struct drm_nouveau_gem_info req = { .handle = handle }; @@ -427,8 +409,24 @@ DRMLISTFOREACHENTRY(nvbo, &nvdev->bo_list, head) { if (nvbo->base.handle == handle) { - *pbo = NULL; - nouveau_bo_ref(&nvbo->base, pbo); + if (atomic_inc_return(&nvbo->refcnt) == 1) { + /* + * Uh oh, this bo is dead and someone else + * will free it, but because refcnt is + * now non-zero fortunately they won't + * call the ioctl to close the bo. + * + * Remove this bo from the list so other + * calls to nouveau_bo_wrap_locked will + * see our replacement nvbo. + */ + DRMLISTDEL(&nvbo->head); + if (!name) + name = nvbo->name; + break; + } + + *pbo = &nvbo->base; return 0; } } @@ -443,6 +441,7 @@ atomic_set(&nvbo->refcnt, 1); nvbo->base.device = dev; abi16_bo_info(&nvbo->base, &req); + nvbo->name = name; DRMLISTADD(&nvbo->head, &nvdev->bo_list); *pbo = &nvbo->base; return 0; @@ -451,66 +450,70 @@ return -ENOMEM; } -int +static void +nouveau_bo_make_global(struct nouveau_bo_priv *nvbo) +{ + if (!nvbo->head.next) { + struct nouveau_device_priv *nvdev = nouveau_device(nvbo->base.device); + pthread_mutex_lock(&nvdev->lock); + if (!nvbo->head.next) + DRMLISTADD(&nvbo->head, &nvdev->bo_list); + pthread_mutex_unlock(&nvdev->lock); + } +} + +drm_public int nouveau_bo_wrap(struct nouveau_device *dev, uint32_t handle, struct nouveau_bo **pbo) { struct nouveau_device_priv *nvdev = nouveau_device(dev); int ret; pthread_mutex_lock(&nvdev->lock); - ret = nouveau_bo_wrap_locked(dev, handle, pbo); + ret = nouveau_bo_wrap_locked(dev, handle, pbo, 0); pthread_mutex_unlock(&nvdev->lock); return ret; } -int +drm_public int nouveau_bo_name_ref(struct nouveau_device *dev, uint32_t name, struct nouveau_bo **pbo) { struct nouveau_device_priv *nvdev = nouveau_device(dev); - struct nouveau_bo_priv *nvbo; struct drm_gem_open req = { .name = name }; int ret; pthread_mutex_lock(&nvdev->lock); - DRMLISTFOREACHENTRY(nvbo, &nvdev->bo_list, head) { - if (nvbo->name == name) { - *pbo = NULL; - nouveau_bo_ref(&nvbo->base, pbo); - pthread_mutex_unlock(&nvdev->lock); - return 0; - } - } - ret = drmIoctl(dev->fd, DRM_IOCTL_GEM_OPEN, &req); if (ret == 0) { - ret = nouveau_bo_wrap_locked(dev, req.handle, pbo); - nouveau_bo((*pbo))->name = name; - pthread_mutex_unlock(&nvdev->lock); + ret = nouveau_bo_wrap_locked(dev, req.handle, pbo, name); } + pthread_mutex_unlock(&nvdev->lock); return ret; } -int +drm_public int nouveau_bo_name_get(struct nouveau_bo *bo, uint32_t *name) { struct drm_gem_flink req = { .handle = bo->handle }; struct nouveau_bo_priv *nvbo = nouveau_bo(bo); *name = nvbo->name; - if (!*name || *name == ~0U) { + if (!*name) { int ret = drmIoctl(bo->device->fd, DRM_IOCTL_GEM_FLINK, &req); + if (ret) { *name = 0; return ret; } nvbo->name = *name = req.name; + + nouveau_bo_make_global(nvbo); } return 0; } -void +drm_public void nouveau_bo_ref(struct nouveau_bo *bo, struct nouveau_bo **pref) { struct nouveau_bo *ref = *pref; @@ -524,7 +527,7 @@ *pref = bo; } -int +drm_public int nouveau_bo_prime_handle_ref(struct nouveau_device *dev, int prime_fd, struct nouveau_bo **bo) { @@ -537,23 +540,13 @@ pthread_mutex_lock(&nvdev->lock); ret = drmPrimeFDToHandle(dev->fd, prime_fd, &handle); if (ret == 0) { - ret = nouveau_bo_wrap_locked(dev, handle, bo); - if (!ret) { - struct nouveau_bo_priv *nvbo = nouveau_bo(*bo); - if (!nvbo->name) { - /* - * XXX: Force locked DRM_IOCTL_GEM_CLOSE - * to rule out race conditions - */ - nvbo->name = ~0; - } - } + ret = nouveau_bo_wrap_locked(dev, handle, bo, 0); } pthread_mutex_unlock(&nvdev->lock); return ret; } -int +drm_public int nouveau_bo_set_prime(struct nouveau_bo *bo, int *prime_fd) { struct nouveau_bo_priv *nvbo = nouveau_bo(bo); @@ -562,12 +555,12 @@ ret = drmPrimeHandleToFD(bo->device->fd, nvbo->base.handle, DRM_CLOEXEC, prime_fd); if (ret) return ret; - if (!nvbo->name) - nvbo->name = ~0; + + nouveau_bo_make_global(nvbo); return 0; } -int +drm_public int nouveau_bo_wait(struct nouveau_bo *bo, uint32_t access, struct nouveau_client *client) { @@ -583,8 +576,8 @@ if (push && push->channel) nouveau_pushbuf_kick(push, push->channel); - if (!nvbo->name && !(nvbo->access & NOUVEAU_BO_WR) && - !( access & NOUVEAU_BO_WR)) + if (!nvbo->head.next && !(nvbo->access & NOUVEAU_BO_WR) && + !(access & NOUVEAU_BO_WR)) return 0; req.handle = bo->handle; @@ -601,13 +594,13 @@ return ret; } -int +drm_public int nouveau_bo_map(struct nouveau_bo *bo, uint32_t access, struct nouveau_client *client) { struct nouveau_bo_priv *nvbo = nouveau_bo(bo); if (bo->map == NULL) { - bo->map = mmap(0, bo->size, PROT_READ | PROT_WRITE, + bo->map = drm_mmap(0, bo->size, PROT_READ | PROT_WRITE, MAP_SHARED, bo->device->fd, nvbo->map_handle); if (bo->map == MAP_FAILED) { bo->map = NULL; diff -Nru libdrm-2.4.56/nouveau/private.h libdrm-2.4.60/nouveau/private.h --- libdrm-2.4.56/nouveau/private.h 2014-05-30 16:38:28.000000000 +0000 +++ libdrm-2.4.60/nouveau/private.h 2015-02-28 18:32:39.000000000 +0000 @@ -1,6 +1,7 @@ #ifndef __NOUVEAU_LIBDRM_PRIVATE_H__ #define __NOUVEAU_LIBDRM_PRIVATE_H__ +#include #include #include #include diff -Nru libdrm-2.4.56/nouveau/pushbuf.c libdrm-2.4.60/nouveau/pushbuf.c --- libdrm-2.4.56/nouveau/pushbuf.c 2013-11-22 15:25:06.000000000 +0000 +++ libdrm-2.4.60/nouveau/pushbuf.c 2015-02-28 18:32:39.000000000 +0000 @@ -529,7 +529,7 @@ return ret; } -int +drm_public int nouveau_pushbuf_new(struct nouveau_client *client, struct nouveau_object *chan, int nr, uint32_t size, bool immediate, struct nouveau_pushbuf **ppush) @@ -600,7 +600,7 @@ return 0; } -void +drm_public void nouveau_pushbuf_del(struct nouveau_pushbuf **ppush) { struct nouveau_pushbuf_priv *nvpb = nouveau_pushbuf(*ppush); @@ -626,7 +626,7 @@ *ppush = NULL; } -struct nouveau_bufctx * +drm_public struct nouveau_bufctx * nouveau_pushbuf_bufctx(struct nouveau_pushbuf *push, struct nouveau_bufctx *ctx) { struct nouveau_bufctx *prev = push->bufctx; @@ -634,7 +634,7 @@ return prev; } -int +drm_public int nouveau_pushbuf_space(struct nouveau_pushbuf *push, uint32_t dwords, uint32_t relocs, uint32_t pushes) { @@ -698,7 +698,7 @@ return flushed ? pushbuf_validate(push, false) : 0; } -void +drm_public void nouveau_pushbuf_data(struct nouveau_pushbuf *push, struct nouveau_bo *bo, uint64_t offset, uint64_t length) { @@ -728,14 +728,14 @@ } } -int +drm_public int nouveau_pushbuf_refn(struct nouveau_pushbuf *push, struct nouveau_pushbuf_refn *refs, int nr) { return pushbuf_refn(push, true, refs, nr); } -void +drm_public void nouveau_pushbuf_reloc(struct nouveau_pushbuf *push, struct nouveau_bo *bo, uint32_t data, uint32_t flags, uint32_t vor, uint32_t tor) { @@ -743,13 +743,13 @@ push->cur++; } -int +drm_public int nouveau_pushbuf_validate(struct nouveau_pushbuf *push) { return pushbuf_validate(push, true); } -uint32_t +drm_public uint32_t nouveau_pushbuf_refd(struct nouveau_pushbuf *push, struct nouveau_bo *bo) { struct drm_nouveau_gem_pushbuf_bo *kref; @@ -766,7 +766,7 @@ return flags; } -int +drm_public int nouveau_pushbuf_kick(struct nouveau_pushbuf *push, struct nouveau_object *chan) { if (!push->channel) diff -Nru libdrm-2.4.56/omap/Makefile.am libdrm-2.4.60/omap/Makefile.am --- libdrm-2.4.56/omap/Makefile.am 2013-08-12 18:01:28.000000000 +0000 +++ libdrm-2.4.60/omap/Makefile.am 2015-02-28 18:32:39.000000000 +0000 @@ -1,5 +1,6 @@ AM_CFLAGS = \ $(WARN_CFLAGS) \ + $(VISIBILITY_CFLAGS) \ -I$(top_srcdir) \ -I$(top_srcdir)/omap \ $(PTHREADSTUBS_CFLAGS) \ diff -Nru libdrm-2.4.56/omap/Makefile.in libdrm-2.4.60/omap/Makefile.in --- libdrm-2.4.56/omap/Makefile.in 2014-07-29 16:13:53.000000000 +0000 +++ libdrm-2.4.60/omap/Makefile.in 2015-03-19 14:37:47.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.14.1 from Makefile.am. +# Makefile.in generated by automake 1.13.4 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. @@ -248,7 +248,6 @@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MANPAGES_STYLESHEET = @MANPAGES_STYLESHEET@ @@ -282,6 +281,7 @@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ VALGRIND_LIBS = @VALGRIND_LIBS@ VERSION = @VERSION@ +VISIBILITY_CFLAGS = @VISIBILITY_CFLAGS@ WARN_CFLAGS = @WARN_CFLAGS@ XSLTPROC = @XSLTPROC@ abs_builddir = @abs_builddir@ @@ -340,6 +340,7 @@ top_srcdir = @top_srcdir@ AM_CFLAGS = \ $(WARN_CFLAGS) \ + $(VISIBILITY_CFLAGS) \ -I$(top_srcdir) \ -I$(top_srcdir)/omap \ $(PTHREADSTUBS_CFLAGS) \ @@ -359,7 +360,7 @@ .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -384,9 +385,9 @@ $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): libdrm_omap.pc: $(top_builddir)/config.status $(srcdir)/libdrm_omap.pc.in @@ -443,14 +444,14 @@ @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< diff -Nru libdrm-2.4.56/omap/omap_drm.c libdrm-2.4.60/omap/omap_drm.c --- libdrm-2.4.56/omap/omap_drm.c 2013-08-12 18:01:28.000000000 +0000 +++ libdrm-2.4.60/omap/omap_drm.c 2015-02-28 18:32:39.000000000 +0000 @@ -39,6 +39,7 @@ #include #include +#include #include #include @@ -91,7 +92,7 @@ return dev; } -struct omap_device * omap_device_new(int fd) +drm_public struct omap_device * omap_device_new(int fd) { struct omap_device *dev = NULL; @@ -114,13 +115,13 @@ return dev; } -struct omap_device * omap_device_ref(struct omap_device *dev) +drm_public struct omap_device * omap_device_ref(struct omap_device *dev) { atomic_inc(&dev->refcnt); return dev; } -void omap_device_del(struct omap_device *dev) +drm_public void omap_device_del(struct omap_device *dev) { if (!atomic_dec_and_test(&dev->refcnt)) return; @@ -131,7 +132,8 @@ free(dev); } -int omap_get_param(struct omap_device *dev, uint64_t param, uint64_t *value) +drm_public int +omap_get_param(struct omap_device *dev, uint64_t param, uint64_t *value) { struct drm_omap_param req = { .param = param, @@ -148,7 +150,8 @@ return 0; } -int omap_set_param(struct omap_device *dev, uint64_t param, uint64_t value) +drm_public int +omap_set_param(struct omap_device *dev, uint64_t param, uint64_t value) { struct drm_omap_param req = { .param = param, @@ -226,8 +229,8 @@ /* allocate a new (un-tiled) buffer object */ -struct omap_bo * omap_bo_new(struct omap_device *dev, - uint32_t size, uint32_t flags) +drm_public struct omap_bo * +omap_bo_new(struct omap_device *dev, uint32_t size, uint32_t flags) { union omap_gem_size gsize = { .bytes = size, @@ -239,8 +242,9 @@ } /* allocate a new buffer object */ -struct omap_bo * omap_bo_new_tiled(struct omap_device *dev, - uint32_t width, uint32_t height, uint32_t flags) +drm_public struct omap_bo * +omap_bo_new_tiled(struct omap_device *dev, uint32_t width, + uint32_t height, uint32_t flags) { union omap_gem_size gsize = { .tiled = { @@ -254,7 +258,7 @@ return omap_bo_new_impl(dev, gsize, flags); } -struct omap_bo * omap_bo_ref(struct omap_bo *bo) +drm_public struct omap_bo *omap_bo_ref(struct omap_bo *bo) { atomic_inc(&bo->refcnt); return bo; @@ -280,7 +284,8 @@ } /* import a buffer object from DRI2 name */ -struct omap_bo * omap_bo_from_name(struct omap_device *dev, uint32_t name) +drm_public struct omap_bo * +omap_bo_from_name(struct omap_device *dev, uint32_t name) { struct omap_bo *bo = NULL; struct drm_gem_open req = { @@ -313,7 +318,8 @@ * fd so caller should close() the fd when it is otherwise done * with it (even if it is still using the 'struct omap_bo *') */ -struct omap_bo * omap_bo_from_dmabuf(struct omap_device *dev, int fd) +drm_public struct omap_bo * +omap_bo_from_dmabuf(struct omap_device *dev, int fd) { struct omap_bo *bo = NULL; struct drm_prime_handle req = { @@ -344,7 +350,7 @@ } /* destroy a buffer object */ -void omap_bo_del(struct omap_bo *bo) +drm_public void omap_bo_del(struct omap_bo *bo) { if (!bo) { return; @@ -377,7 +383,7 @@ } /* get the global flink/DRI2 buffer name */ -int omap_bo_get_name(struct omap_bo *bo, uint32_t *name) +drm_public int omap_bo_get_name(struct omap_bo *bo, uint32_t *name) { if (!bo->name) { struct drm_gem_flink req = { @@ -398,7 +404,7 @@ return 0; } -uint32_t omap_bo_handle(struct omap_bo *bo) +drm_public uint32_t omap_bo_handle(struct omap_bo *bo) { return bo->handle; } @@ -406,7 +412,7 @@ /* caller owns the dmabuf fd that is returned and is responsible * to close() it when done */ -int omap_bo_dmabuf(struct omap_bo *bo) +drm_public int omap_bo_dmabuf(struct omap_bo *bo) { if (!bo->fd) { struct drm_prime_handle req = { @@ -425,7 +431,7 @@ return dup(bo->fd); } -uint32_t omap_bo_size(struct omap_bo *bo) +drm_public uint32_t omap_bo_size(struct omap_bo *bo) { if (!bo->size) { get_buffer_info(bo); @@ -433,7 +439,7 @@ return bo->size; } -void * omap_bo_map(struct omap_bo *bo) +drm_public void *omap_bo_map(struct omap_bo *bo) { if (!bo->map) { if (!bo->offset) { @@ -449,7 +455,7 @@ return bo->map; } -int omap_bo_cpu_prep(struct omap_bo *bo, enum omap_gem_op op) +drm_public int omap_bo_cpu_prep(struct omap_bo *bo, enum omap_gem_op op) { struct drm_omap_gem_cpu_prep req = { .handle = bo->handle, @@ -459,7 +465,7 @@ DRM_OMAP_GEM_CPU_PREP, &req, sizeof(req)); } -int omap_bo_cpu_fini(struct omap_bo *bo, enum omap_gem_op op) +drm_public int omap_bo_cpu_fini(struct omap_bo *bo, enum omap_gem_op op) { struct drm_omap_gem_cpu_fini req = { .handle = bo->handle, diff -Nru libdrm-2.4.56/radeon/Android.mk libdrm-2.4.60/radeon/Android.mk --- libdrm-2.4.56/radeon/Android.mk 1970-01-01 00:00:00.000000000 +0000 +++ libdrm-2.4.60/radeon/Android.mk 2015-02-28 18:34:25.000000000 +0000 @@ -0,0 +1,27 @@ +LOCAL_PATH := $(call my-dir) +include $(CLEAR_VARS) + +# Import variables LIBDRM_RADEON_FILES, LIBDRM_RADEON_H_FILES +include $(LOCAL_PATH)/Makefile.sources + +LOCAL_MODULE := libdrm_radeon +LOCAL_MODULE_TAGS := optional + +LOCAL_SHARED_LIBRARIES := libdrm + +LOCAL_SRC_FILES := $(LIBDRM_RADEON_FILES) +LOCAL_EXPORT_C_INCLUDE_DIRS += \ + $(LOCAL_PATH)/radeon + +LOCAL_C_INCLUDES := \ + $(LIBDRM_TOP) \ + $(LIBDRM_TOP)/radeon \ + $(LIBDRM_TOP)/include/drm + +LOCAL_CFLAGS := \ + -DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1 + +LOCAL_COPY_HEADERS := $(LIBDRM_RADEON_H_FILES) +LOCAL_COPY_HEADERS_TO := libdrm + +include $(BUILD_SHARED_LIBRARY) diff -Nru libdrm-2.4.56/radeon/Makefile.am libdrm-2.4.60/radeon/Makefile.am --- libdrm-2.4.56/radeon/Makefile.am 2013-08-12 18:01:29.000000000 +0000 +++ libdrm-2.4.60/radeon/Makefile.am 2015-02-28 18:34:25.000000000 +0000 @@ -22,8 +22,11 @@ # Authors: # Jérôme Glisse +include Makefile.sources + AM_CFLAGS = \ $(WARN_CFLAGS) \ + $(VISIBILITY_CFLAGS) \ -I$(top_srcdir) \ -I$(top_srcdir)/radeon \ $(PTHREADSTUBS_CFLAGS) \ @@ -34,28 +37,12 @@ libdrm_radeon_la_LDFLAGS = -version-number 1:0:1 -no-undefined libdrm_radeon_la_LIBADD = ../libdrm.la @PTHREADSTUBS_LIBS@ -libdrm_radeon_la_SOURCES = \ - radeon_bo_gem.c \ - radeon_cs_gem.c \ - radeon_cs_space.c \ - radeon_bo.c \ - radeon_cs.c \ - radeon_surface.c \ - bof.c \ - bof.h +libdrm_radeon_la_SOURCES = $(LIBDRM_RADEON_FILES) libdrm_radeonincludedir = ${includedir}/libdrm -libdrm_radeoninclude_HEADERS = \ - radeon_bo.h \ - radeon_cs.h \ - radeon_surface.h \ - radeon_bo_gem.h \ - radeon_cs_gem.h \ - radeon_bo_int.h \ - radeon_cs_int.h \ - r600_pci_ids.h +libdrm_radeoninclude_HEADERS = $(LIBDRM_RADEON_H_FILES) pkgconfigdir = @pkgconfigdir@ pkgconfig_DATA = libdrm_radeon.pc -EXTRA_DIST = libdrm_radeon.pc.in +EXTRA_DIST = Android.mk diff -Nru libdrm-2.4.56/radeon/Makefile.in libdrm-2.4.60/radeon/Makefile.in --- libdrm-2.4.56/radeon/Makefile.in 2014-07-29 16:13:53.000000000 +0000 +++ libdrm-2.4.60/radeon/Makefile.in 2015-03-19 14:37:47.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.14.1 from Makefile.am. +# Makefile.in generated by automake 1.13.4 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. @@ -104,10 +104,11 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -subdir = radeon -DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ - $(srcdir)/libdrm_radeon.pc.in $(top_srcdir)/build-aux/depcomp \ +DIST_COMMON = $(srcdir)/Makefile.sources $(srcdir)/Makefile.in \ + $(srcdir)/Makefile.am $(srcdir)/libdrm_radeon.pc.in \ + $(top_srcdir)/build-aux/depcomp \ $(libdrm_radeoninclude_HEADERS) +subdir = radeon ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ @@ -151,9 +152,9 @@ "$(DESTDIR)$(libdrm_radeonincludedir)" LTLIBRARIES = $(libdrm_radeon_la_LTLIBRARIES) libdrm_radeon_la_DEPENDENCIES = ../libdrm.la -am_libdrm_radeon_la_OBJECTS = radeon_bo_gem.lo radeon_cs_gem.lo \ - radeon_cs_space.lo radeon_bo.lo radeon_cs.lo radeon_surface.lo \ - bof.lo +am__objects_1 = radeon_bo_gem.lo radeon_cs_gem.lo radeon_cs_space.lo \ + radeon_bo.lo radeon_cs.lo radeon_surface.lo bof.lo +am_libdrm_radeon_la_OBJECTS = $(am__objects_1) libdrm_radeon_la_OBJECTS = $(am_libdrm_radeon_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) @@ -271,7 +272,6 @@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MANPAGES_STYLESHEET = @MANPAGES_STYLESHEET@ @@ -305,6 +305,7 @@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ VALGRIND_LIBS = @VALGRIND_LIBS@ VERSION = @VERSION@ +VISIBILITY_CFLAGS = @VISIBILITY_CFLAGS@ WARN_CFLAGS = @WARN_CFLAGS@ XSLTPROC = @XSLTPROC@ abs_builddir = @abs_builddir@ @@ -361,18 +362,7 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -AM_CFLAGS = \ - $(WARN_CFLAGS) \ - -I$(top_srcdir) \ - -I$(top_srcdir)/radeon \ - $(PTHREADSTUBS_CFLAGS) \ - -I$(top_srcdir)/include/drm - -libdrm_radeon_la_LTLIBRARIES = libdrm_radeon.la -libdrm_radeon_ladir = $(libdir) -libdrm_radeon_la_LDFLAGS = -version-number 1:0:1 -no-undefined -libdrm_radeon_la_LIBADD = ../libdrm.la @PTHREADSTUBS_LIBS@ -libdrm_radeon_la_SOURCES = \ +LIBDRM_RADEON_FILES := \ radeon_bo_gem.c \ radeon_cs_gem.c \ radeon_cs_space.c \ @@ -382,8 +372,7 @@ bof.c \ bof.h -libdrm_radeonincludedir = ${includedir}/libdrm -libdrm_radeoninclude_HEADERS = \ +LIBDRM_RADEON_H_FILES := \ radeon_bo.h \ radeon_cs.h \ radeon_surface.h \ @@ -393,13 +382,28 @@ radeon_cs_int.h \ r600_pci_ids.h +AM_CFLAGS = \ + $(WARN_CFLAGS) \ + $(VISIBILITY_CFLAGS) \ + -I$(top_srcdir) \ + -I$(top_srcdir)/radeon \ + $(PTHREADSTUBS_CFLAGS) \ + -I$(top_srcdir)/include/drm + +libdrm_radeon_la_LTLIBRARIES = libdrm_radeon.la +libdrm_radeon_ladir = $(libdir) +libdrm_radeon_la_LDFLAGS = -version-number 1:0:1 -no-undefined +libdrm_radeon_la_LIBADD = ../libdrm.la @PTHREADSTUBS_LIBS@ +libdrm_radeon_la_SOURCES = $(LIBDRM_RADEON_FILES) +libdrm_radeonincludedir = ${includedir}/libdrm +libdrm_radeoninclude_HEADERS = $(LIBDRM_RADEON_H_FILES) pkgconfig_DATA = libdrm_radeon.pc -EXTRA_DIST = libdrm_radeon.pc.in +EXTRA_DIST = Android.mk all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(srcdir)/Makefile.sources $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -420,13 +424,14 @@ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; +$(srcdir)/Makefile.sources: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): libdrm_radeon.pc: $(top_builddir)/config.status $(srcdir)/libdrm_radeon.pc.in @@ -489,14 +494,14 @@ @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< diff -Nru libdrm-2.4.56/radeon/Makefile.sources libdrm-2.4.60/radeon/Makefile.sources --- libdrm-2.4.56/radeon/Makefile.sources 1970-01-01 00:00:00.000000000 +0000 +++ libdrm-2.4.60/radeon/Makefile.sources 2015-02-28 18:32:39.000000000 +0000 @@ -0,0 +1,19 @@ +LIBDRM_RADEON_FILES := \ + radeon_bo_gem.c \ + radeon_cs_gem.c \ + radeon_cs_space.c \ + radeon_bo.c \ + radeon_cs.c \ + radeon_surface.c \ + bof.c \ + bof.h + +LIBDRM_RADEON_H_FILES := \ + radeon_bo.h \ + radeon_cs.h \ + radeon_surface.h \ + radeon_bo_gem.h \ + radeon_cs_gem.h \ + radeon_bo_int.h \ + radeon_cs_int.h \ + r600_pci_ids.h diff -Nru libdrm-2.4.56/radeon/r600_pci_ids.h libdrm-2.4.60/radeon/r600_pci_ids.h --- libdrm-2.4.56/radeon/r600_pci_ids.h 2014-05-30 16:38:28.000000000 +0000 +++ libdrm-2.4.60/radeon/r600_pci_ids.h 2015-02-28 18:32:39.000000000 +0000 @@ -366,6 +366,7 @@ CHIPSET(0x6829, VERDE_6829, VERDE) CHIPSET(0x682A, VERDE_682A, VERDE) CHIPSET(0x682B, VERDE_682B, VERDE) +CHIPSET(0x682C, VERDE_682C, VERDE) CHIPSET(0x682D, VERDE_682D, VERDE) CHIPSET(0x682F, VERDE_682F, VERDE) CHIPSET(0x6830, VERDE_6830, VERDE) @@ -382,8 +383,11 @@ CHIPSET(0x6601, OLAND_6601, OLAND) CHIPSET(0x6602, OLAND_6602, OLAND) CHIPSET(0x6603, OLAND_6603, OLAND) +CHIPSET(0x6604, OLAND_6604, OLAND) +CHIPSET(0x6605, OLAND_6605, OLAND) CHIPSET(0x6606, OLAND_6606, OLAND) CHIPSET(0x6607, OLAND_6607, OLAND) +CHIPSET(0x6608, OLAND_6608, OLAND) CHIPSET(0x6610, OLAND_6610, OLAND) CHIPSET(0x6611, OLAND_6611, OLAND) CHIPSET(0x6613, OLAND_6613, OLAND) @@ -401,6 +405,8 @@ CHIPSET(0x6640, BONAIRE_6640, BONAIRE) CHIPSET(0x6641, BONAIRE_6641, BONAIRE) +CHIPSET(0x6646, BONAIRE_6646, BONAIRE) +CHIPSET(0x6647, BONAIRE_6647, BONAIRE) CHIPSET(0x6649, BONAIRE_6649, BONAIRE) CHIPSET(0x6650, BONAIRE_6650, BONAIRE) CHIPSET(0x6651, BONAIRE_6651, BONAIRE) @@ -460,6 +466,7 @@ CHIPSET(0x1315, KAVERI_1315, KAVERI) CHIPSET(0x1316, KAVERI_1316, KAVERI) CHIPSET(0x1317, KAVERI_1317, KAVERI) +CHIPSET(0x1318, KAVERI_1318, KAVERI) CHIPSET(0x131B, KAVERI_131B, KAVERI) CHIPSET(0x131C, KAVERI_131C, KAVERI) CHIPSET(0x131D, KAVERI_131D, KAVERI) diff -Nru libdrm-2.4.56/radeon/radeon_bo.c libdrm-2.4.60/radeon/radeon_bo.c --- libdrm-2.4.56/radeon/radeon_bo.c 2013-08-12 18:01:30.000000000 +0000 +++ libdrm-2.4.60/radeon/radeon_bo.c 2015-02-28 18:32:39.000000000 +0000 @@ -29,10 +29,14 @@ * Dave Airlie * Jérôme Glisse */ +#ifdef HAVE_CONFIG_H +#include +#endif +#include #include #include -void radeon_bo_debug(struct radeon_bo *bo, const char *op) +drm_public void radeon_bo_debug(struct radeon_bo *bo, const char *op) { struct radeon_bo_int *boi = (struct radeon_bo_int *)bo; @@ -40,26 +44,23 @@ op, bo, bo->handle, boi->size, boi->cref); } -struct radeon_bo *radeon_bo_open(struct radeon_bo_manager *bom, - uint32_t handle, - uint32_t size, - uint32_t alignment, - uint32_t domains, - uint32_t flags) +drm_public struct radeon_bo * +radeon_bo_open(struct radeon_bo_manager *bom, uint32_t handle, uint32_t size, + uint32_t alignment, uint32_t domains, uint32_t flags) { struct radeon_bo *bo; bo = bom->funcs->bo_open(bom, handle, size, alignment, domains, flags); return bo; } -void radeon_bo_ref(struct radeon_bo *bo) +drm_public void radeon_bo_ref(struct radeon_bo *bo) { struct radeon_bo_int *boi = (struct radeon_bo_int *)bo; boi->cref++; boi->bom->funcs->bo_ref(boi); } -struct radeon_bo *radeon_bo_unref(struct radeon_bo *bo) +drm_public struct radeon_bo *radeon_bo_unref(struct radeon_bo *bo) { struct radeon_bo_int *boi = (struct radeon_bo_int *)bo; if (bo == NULL) @@ -69,19 +70,19 @@ return boi->bom->funcs->bo_unref(boi); } -int radeon_bo_map(struct radeon_bo *bo, int write) +drm_public int radeon_bo_map(struct radeon_bo *bo, int write) { struct radeon_bo_int *boi = (struct radeon_bo_int *)bo; return boi->bom->funcs->bo_map(boi, write); } -int radeon_bo_unmap(struct radeon_bo *bo) +drm_public int radeon_bo_unmap(struct radeon_bo *bo) { struct radeon_bo_int *boi = (struct radeon_bo_int *)bo; return boi->bom->funcs->bo_unmap(boi); } -int radeon_bo_wait(struct radeon_bo *bo) +drm_public int radeon_bo_wait(struct radeon_bo *bo) { struct radeon_bo_int *boi = (struct radeon_bo_int *)bo; if (!boi->bom->funcs->bo_wait) @@ -89,27 +90,29 @@ return boi->bom->funcs->bo_wait(boi); } -int radeon_bo_is_busy(struct radeon_bo *bo, uint32_t *domain) +drm_public int radeon_bo_is_busy(struct radeon_bo *bo, uint32_t *domain) { struct radeon_bo_int *boi = (struct radeon_bo_int *)bo; return boi->bom->funcs->bo_is_busy(boi, domain); } -int radeon_bo_set_tiling(struct radeon_bo *bo, - uint32_t tiling_flags, uint32_t pitch) +drm_public int +radeon_bo_set_tiling(struct radeon_bo *bo, + uint32_t tiling_flags, uint32_t pitch) { struct radeon_bo_int *boi = (struct radeon_bo_int *)bo; return boi->bom->funcs->bo_set_tiling(boi, tiling_flags, pitch); } -int radeon_bo_get_tiling(struct radeon_bo *bo, - uint32_t *tiling_flags, uint32_t *pitch) +drm_public int +radeon_bo_get_tiling(struct radeon_bo *bo, + uint32_t *tiling_flags, uint32_t *pitch) { struct radeon_bo_int *boi = (struct radeon_bo_int *)bo; return boi->bom->funcs->bo_get_tiling(boi, tiling_flags, pitch); } -int radeon_bo_is_static(struct radeon_bo *bo) +drm_public int radeon_bo_is_static(struct radeon_bo *bo) { struct radeon_bo_int *boi = (struct radeon_bo_int *)bo; if (boi->bom->funcs->bo_is_static) @@ -117,18 +120,19 @@ return 0; } -int radeon_bo_is_referenced_by_cs(struct radeon_bo *bo, struct radeon_cs *cs) +drm_public int +radeon_bo_is_referenced_by_cs(struct radeon_bo *bo, struct radeon_cs *cs) { struct radeon_bo_int *boi = (struct radeon_bo_int *)bo; return boi->cref > 1; } -uint32_t radeon_bo_get_handle(struct radeon_bo *bo) +drm_public uint32_t radeon_bo_get_handle(struct radeon_bo *bo) { return bo->handle; } -uint32_t radeon_bo_get_src_domain(struct radeon_bo *bo) +drm_public uint32_t radeon_bo_get_src_domain(struct radeon_bo *bo) { struct radeon_bo_int *boi = (struct radeon_bo_int *)bo; uint32_t src_domain; diff -Nru libdrm-2.4.56/radeon/radeon_bo_gem.c libdrm-2.4.60/radeon/radeon_bo_gem.c --- libdrm-2.4.56/radeon/radeon_bo_gem.c 2013-08-12 18:01:31.000000000 +0000 +++ libdrm-2.4.60/radeon/radeon_bo_gem.c 2015-02-28 18:34:25.000000000 +0000 @@ -36,8 +36,8 @@ #include #include #include -#include #include +#include "libdrm.h" #include "xf86drm.h" #include "xf86atomic.h" #include "drm.h" @@ -134,7 +134,7 @@ return (struct radeon_bo *)boi; } if (bo_gem->priv_ptr) { - munmap(bo_gem->priv_ptr, boi->size); + drm_munmap(bo_gem->priv_ptr, boi->size); } /* Zero out args to make valgrind happy */ @@ -178,7 +178,7 @@ boi, boi->handle, r); return r; } - ptr = mmap(0, args.size, PROT_READ|PROT_WRITE, MAP_SHARED, boi->bom->fd, args.addr_ptr); + ptr = drm_mmap(0, args.size, PROT_READ|PROT_WRITE, MAP_SHARED, boi->bom->fd, args.addr_ptr); if (ptr == MAP_FAILED) return -errno; bo_gem->priv_ptr = ptr; @@ -197,7 +197,7 @@ if (--bo_gem->map_count > 0) { return 0; } - //munmap(bo->ptr, bo->size); + //drm_munmap(bo->ptr, bo->size); boi->ptr = NULL; return 0; } @@ -283,7 +283,7 @@ bo_is_busy, }; -struct radeon_bo_manager *radeon_bo_manager_gem_ctor(int fd) +drm_public struct radeon_bo_manager *radeon_bo_manager_gem_ctor(int fd) { struct bo_manager_gem *bomg; @@ -296,7 +296,7 @@ return (struct radeon_bo_manager*)bomg; } -void radeon_bo_manager_gem_dtor(struct radeon_bo_manager *bom) +drm_public void radeon_bo_manager_gem_dtor(struct radeon_bo_manager *bom) { struct bo_manager_gem *bomg = (struct bo_manager_gem*)bom; @@ -306,19 +306,22 @@ free(bomg); } -uint32_t radeon_gem_name_bo(struct radeon_bo *bo) +drm_public uint32_t +radeon_gem_name_bo(struct radeon_bo *bo) { struct radeon_bo_gem *bo_gem = (struct radeon_bo_gem*)bo; return bo_gem->name; } -void *radeon_gem_get_reloc_in_cs(struct radeon_bo *bo) +drm_public void * +radeon_gem_get_reloc_in_cs(struct radeon_bo *bo) { struct radeon_bo_gem *bo_gem = (struct radeon_bo_gem*)bo; return &bo_gem->reloc_in_cs; } -int radeon_gem_get_kernel_name(struct radeon_bo *bo, uint32_t *name) +drm_public int +radeon_gem_get_kernel_name(struct radeon_bo *bo, uint32_t *name) { struct radeon_bo_gem *bo_gem = (struct radeon_bo_gem*)bo; struct radeon_bo_int *boi = (struct radeon_bo_int *)bo; @@ -339,7 +342,8 @@ return 0; } -int radeon_gem_set_domain(struct radeon_bo *bo, uint32_t read_domains, uint32_t write_domain) +drm_public int +radeon_gem_set_domain(struct radeon_bo *bo, uint32_t read_domains, uint32_t write_domain) { struct radeon_bo_int *boi = (struct radeon_bo_int *)bo; struct drm_radeon_gem_set_domain args; @@ -356,7 +360,7 @@ return r; } -int radeon_gem_prime_share_bo(struct radeon_bo *bo, int *handle) +drm_public int radeon_gem_prime_share_bo(struct radeon_bo *bo, int *handle) { struct radeon_bo_gem *bo_gem = (struct radeon_bo_gem*)bo; int ret; @@ -365,9 +369,8 @@ return ret; } -struct radeon_bo *radeon_gem_bo_open_prime(struct radeon_bo_manager *bom, - int fd_handle, - uint32_t size) +drm_public struct radeon_bo * +radeon_gem_bo_open_prime(struct radeon_bo_manager *bom, int fd_handle, uint32_t size) { struct radeon_bo_gem *bo; int r; diff -Nru libdrm-2.4.56/radeon/radeon_cs.c libdrm-2.4.60/radeon/radeon_cs.c --- libdrm-2.4.56/radeon/radeon_cs.c 2013-08-12 18:01:32.000000000 +0000 +++ libdrm-2.4.60/radeon/radeon_cs.c 2015-02-28 18:32:39.000000000 +0000 @@ -1,19 +1,22 @@ - +#ifdef HAVE_CONFIG_H +#include +#endif +#include "libdrm.h" #include #include "radeon_cs.h" #include "radeon_cs_int.h" -struct radeon_cs *radeon_cs_create(struct radeon_cs_manager *csm, uint32_t ndw) +drm_public struct radeon_cs * +radeon_cs_create(struct radeon_cs_manager *csm, uint32_t ndw) { struct radeon_cs_int *csi = csm->funcs->cs_create(csm, ndw); return (struct radeon_cs *)csi; } -int radeon_cs_write_reloc(struct radeon_cs *cs, - struct radeon_bo *bo, - uint32_t read_domain, - uint32_t write_domain, - uint32_t flags) +drm_public int +radeon_cs_write_reloc(struct radeon_cs *cs, struct radeon_bo *bo, + uint32_t read_domain, uint32_t write_domain, + uint32_t flags) { struct radeon_cs_int *csi = (struct radeon_cs_int *)cs; @@ -24,56 +27,54 @@ flags); } -int radeon_cs_begin(struct radeon_cs *cs, - uint32_t ndw, - const char *file, - const char *func, - int line) +drm_public int +radeon_cs_begin(struct radeon_cs *cs, uint32_t ndw, + const char *file, const char *func, int line) { struct radeon_cs_int *csi = (struct radeon_cs_int *)cs; return csi->csm->funcs->cs_begin(csi, ndw, file, func, line); } -int radeon_cs_end(struct radeon_cs *cs, - const char *file, - const char *func, - int line) +drm_public int +radeon_cs_end(struct radeon_cs *cs, + const char *file, const char *func, int line) { struct radeon_cs_int *csi = (struct radeon_cs_int *)cs; return csi->csm->funcs->cs_end(csi, file, func, line); } -int radeon_cs_emit(struct radeon_cs *cs) +drm_public int radeon_cs_emit(struct radeon_cs *cs) { struct radeon_cs_int *csi = (struct radeon_cs_int *)cs; return csi->csm->funcs->cs_emit(csi); } -int radeon_cs_destroy(struct radeon_cs *cs) +drm_public int radeon_cs_destroy(struct radeon_cs *cs) { struct radeon_cs_int *csi = (struct radeon_cs_int *)cs; return csi->csm->funcs->cs_destroy(csi); } -int radeon_cs_erase(struct radeon_cs *cs) +drm_public int radeon_cs_erase(struct radeon_cs *cs) { struct radeon_cs_int *csi = (struct radeon_cs_int *)cs; return csi->csm->funcs->cs_erase(csi); } -int radeon_cs_need_flush(struct radeon_cs *cs) +drm_public int radeon_cs_need_flush(struct radeon_cs *cs) { struct radeon_cs_int *csi = (struct radeon_cs_int *)cs; return csi->csm->funcs->cs_need_flush(csi); } -void radeon_cs_print(struct radeon_cs *cs, FILE *file) +drm_public void radeon_cs_print(struct radeon_cs *cs, FILE *file) { struct radeon_cs_int *csi = (struct radeon_cs_int *)cs; csi->csm->funcs->cs_print(csi, file); } -void radeon_cs_set_limit(struct radeon_cs *cs, uint32_t domain, uint32_t limit) +drm_public void +radeon_cs_set_limit(struct radeon_cs *cs, uint32_t domain, uint32_t limit) { struct radeon_cs_int *csi = (struct radeon_cs_int *)cs; if (domain == RADEON_GEM_DOMAIN_VRAM) @@ -82,14 +83,15 @@ csi->csm->gart_limit = limit; } -void radeon_cs_space_set_flush(struct radeon_cs *cs, void (*fn)(void *), void *data) +drm_public void radeon_cs_space_set_flush(struct radeon_cs *cs, + void (*fn)(void *), void *data) { struct radeon_cs_int *csi = (struct radeon_cs_int *)cs; csi->space_flush_fn = fn; csi->space_flush_data = data; } -uint32_t radeon_cs_get_id(struct radeon_cs *cs) +drm_public uint32_t radeon_cs_get_id(struct radeon_cs *cs) { struct radeon_cs_int *csi = (struct radeon_cs_int *)cs; return csi->id; diff -Nru libdrm-2.4.56/radeon/radeon_cs_gem.c libdrm-2.4.60/radeon/radeon_cs_gem.c --- libdrm-2.4.56/radeon/radeon_cs_gem.c 2013-09-17 13:02:43.000000000 +0000 +++ libdrm-2.4.60/radeon/radeon_cs_gem.c 2015-02-28 18:34:25.000000000 +0000 @@ -29,12 +29,14 @@ * Nicolai Haehnle * Jérôme Glisse */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif #include #include #include #include #include -#include #include #include "radeon_cs.h" #include "radeon_cs_int.h" @@ -42,6 +44,7 @@ #include "radeon_cs_gem.h" #include "radeon_bo_gem.h" #include "drm.h" +#include "libdrm.h" #include "xf86drm.h" #include "xf86atomic.h" #include "radeon_drm.h" @@ -533,7 +536,7 @@ return r; } -struct radeon_cs_manager *radeon_cs_manager_gem_ctor(int fd) +drm_public struct radeon_cs_manager *radeon_cs_manager_gem_ctor(int fd) { struct radeon_cs_manager_gem *csm; @@ -547,7 +550,7 @@ return &csm->base; } -void radeon_cs_manager_gem_dtor(struct radeon_cs_manager *csm) +drm_public void radeon_cs_manager_gem_dtor(struct radeon_cs_manager *csm) { free(csm); } diff -Nru libdrm-2.4.56/radeon/radeon_cs_space.c libdrm-2.4.60/radeon/radeon_cs_space.c --- libdrm-2.4.56/radeon/radeon_cs_space.c 2013-08-12 18:01:33.000000000 +0000 +++ libdrm-2.4.60/radeon/radeon_cs_space.c 2015-02-28 18:32:39.000000000 +0000 @@ -25,9 +25,13 @@ */ /* */ +#ifdef HAVE_CONFIG_H +#include +#endif #include #include #include +#include "libdrm.h" #include "radeon_cs.h" #include "radeon_bo_int.h" #include "radeon_cs_int.h" @@ -161,7 +165,9 @@ return RADEON_CS_SPACE_OK; } -void radeon_cs_space_add_persistent_bo(struct radeon_cs *cs, struct radeon_bo *bo, uint32_t read_domains, uint32_t write_domain) +drm_public void +radeon_cs_space_add_persistent_bo(struct radeon_cs *cs, struct radeon_bo *bo, + uint32_t read_domains, uint32_t write_domain) { struct radeon_cs_int *csi = (struct radeon_cs_int *)cs; struct radeon_bo_int *boi = (struct radeon_bo_int *)bo; @@ -203,9 +209,9 @@ return 0; } -int radeon_cs_space_check_with_bo(struct radeon_cs *cs, - struct radeon_bo *bo, - uint32_t read_domains, uint32_t write_domain) +drm_public int +radeon_cs_space_check_with_bo(struct radeon_cs *cs, struct radeon_bo *bo, + uint32_t read_domains, uint32_t write_domain) { struct radeon_cs_int *csi = (struct radeon_cs_int *)cs; struct radeon_bo_int *boi = (struct radeon_bo_int *)bo; @@ -224,13 +230,13 @@ return ret; } -int radeon_cs_space_check(struct radeon_cs *cs) +drm_public int radeon_cs_space_check(struct radeon_cs *cs) { struct radeon_cs_int *csi = (struct radeon_cs_int *)cs; return radeon_cs_check_space_internal(csi, NULL); } -void radeon_cs_space_reset_bos(struct radeon_cs *cs) +drm_public void radeon_cs_space_reset_bos(struct radeon_cs *cs) { struct radeon_cs_int *csi = (struct radeon_cs_int *)cs; int i; diff -Nru libdrm-2.4.56/radeon/radeon_surface.c libdrm-2.4.60/radeon/radeon_surface.c --- libdrm-2.4.56/radeon/radeon_surface.c 2014-07-28 22:24:32.000000000 +0000 +++ libdrm-2.4.60/radeon/radeon_surface.c 2015-02-28 18:34:25.000000000 +0000 @@ -26,15 +26,18 @@ * Authors: * Jérôme Glisse */ +#ifdef HAVE_CONFIG_H +#include +#endif #include #include #include #include #include #include -#include #include #include "drm.h" +#include "libdrm.h" #include "xf86drm.h" #include "radeon_drm.h" #include "radeon_surface.h" @@ -363,6 +366,8 @@ xalign = (surf_man->hw_info.group_bytes * surf_man->hw_info.num_banks) / (tilew * surf->bpe * surf->nsamples); xalign = MAX2(tilew * surf_man->hw_info.num_banks, xalign); + if (surf->flags & RADEON_SURF_FMASK) + xalign = MAX2(128, xalign); yalign = tilew * surf_man->hw_info.num_pipes; if (surf->flags & RADEON_SURF_SCANOUT) { xalign = MAX2((surf->bpe == 1) ? 64 : 32, xalign); @@ -592,7 +597,7 @@ mtile_ps = (mtile_pr * surflevel->nblk_y) / mtileh; surflevel->offset = offset; - surflevel->pitch_bytes = surflevel->nblk_x * bpe * slice_pt; + surflevel->pitch_bytes = surflevel->nblk_x * bpe * surf->nsamples; surflevel->slice_size = mtile_ps * mtileb * slice_pt; surf->bo_size = offset + surflevel->slice_size * surflevel->nblk_z * surf->array_size; @@ -1307,7 +1312,7 @@ /* default value */ surf->mtilea = 1; surf->bankw = 1; - surf->bankw = 1; + surf->bankh = 1; surf->tile_split = 64; surf->stencil_tile_split = 64; } @@ -1495,7 +1500,7 @@ /* macro tile per slice */ mtile_ps = (mtile_pr * surflevel->nblk_y) / yalign; surflevel->offset = offset; - surflevel->pitch_bytes = surflevel->nblk_x * bpe * slice_pt; + surflevel->pitch_bytes = surflevel->nblk_x * bpe * surf->nsamples; surflevel->slice_size = mtile_ps * mtileb * slice_pt; surf->bo_size = offset + surflevel->slice_size * surflevel->nblk_z * surf->array_size; @@ -2134,7 +2139,7 @@ /* default value */ surf->mtilea = 1; surf->bankw = 1; - surf->bankw = 1; + surf->bankh = 1; surf->tile_split = 64; surf->stencil_tile_split = 64; } @@ -2395,7 +2400,8 @@ /* =========================================================================== * public API */ -struct radeon_surface_manager *radeon_surface_manager_new(int fd) +drm_public struct radeon_surface_manager * +radeon_surface_manager_new(int fd) { struct radeon_surface_manager *surf_man; @@ -2443,7 +2449,8 @@ return NULL; } -void radeon_surface_manager_free(struct radeon_surface_manager *surf_man) +drm_public void +radeon_surface_manager_free(struct radeon_surface_manager *surf_man) { free(surf_man); } @@ -2515,8 +2522,9 @@ return 0; } -int radeon_surface_init(struct radeon_surface_manager *surf_man, - struct radeon_surface *surf) +drm_public int +radeon_surface_init(struct radeon_surface_manager *surf_man, + struct radeon_surface *surf) { unsigned mode, type; int r; @@ -2531,8 +2539,9 @@ return surf_man->surface_init(surf_man, surf); } -int radeon_surface_best(struct radeon_surface_manager *surf_man, - struct radeon_surface *surf) +drm_public int +radeon_surface_best(struct radeon_surface_manager *surf_man, + struct radeon_surface *surf) { unsigned mode, type; int r; diff -Nru libdrm-2.4.56/tegra/libdrm_tegra.pc.in libdrm-2.4.60/tegra/libdrm_tegra.pc.in --- libdrm-2.4.56/tegra/libdrm_tegra.pc.in 1970-01-01 00:00:00.000000000 +0000 +++ libdrm-2.4.60/tegra/libdrm_tegra.pc.in 2015-02-28 18:34:25.000000000 +0000 @@ -0,0 +1,11 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: libdrm_tegra +Description: Userspace interface to Tegra kernel DRM services +Version: @PACKAGE_VERSION@ +Libs: -L${libdir} -ldrm_tegra +Cflags: -I${includedir} -I${includedir}/libdrm +Requires.private: libdrm diff -Nru libdrm-2.4.56/tegra/Makefile.am libdrm-2.4.60/tegra/Makefile.am --- libdrm-2.4.56/tegra/Makefile.am 1970-01-01 00:00:00.000000000 +0000 +++ libdrm-2.4.60/tegra/Makefile.am 2015-02-28 18:34:25.000000000 +0000 @@ -0,0 +1,23 @@ +AM_CPPFLAGS = \ + -I$(top_srcdir) \ + -I$(top_srcdir)/include/drm + +AM_CFLAGS = \ + @PTHREADSTUBS_CFLAGS@ \ + $(VISIBILITY_CFLAGS) \ + $(WARN_CFLAGS) + +libdrm_tegra_ladir = $(libdir) +libdrm_tegra_la_LTLIBRARIES = libdrm_tegra.la +libdrm_tegra_la_LDFLAGS = -version-number 0:0:0 -no-undefined +libdrm_tegra_la_LIBADD = ../libdrm.la @PTHREADSTUBS_LIBS@ + +libdrm_tegra_la_SOURCES = \ + private.h \ + tegra.c + +libdrm_tegraincludedir = ${includedir}/libdrm +libdrm_tegrainclude_HEADERS = tegra.h + +pkgconfigdir = @pkgconfigdir@ +pkgconfig_DATA = libdrm_tegra.pc diff -Nru libdrm-2.4.56/tegra/Makefile.in libdrm-2.4.60/tegra/Makefile.in --- libdrm-2.4.56/tegra/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ libdrm-2.4.60/tegra/Makefile.in 2015-03-19 14:37:47.000000000 +0000 @@ -0,0 +1,724 @@ +# Makefile.in generated by automake 1.13.4 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2013 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + + + +VPATH = @srcdir@ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = tegra +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(srcdir)/libdrm_tegra.pc.in $(top_srcdir)/build-aux/depcomp \ + $(libdrm_tegrainclude_HEADERS) +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = libdrm_tegra.pc +CONFIG_CLEAN_VPATH_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(libdrm_tegra_ladir)" \ + "$(DESTDIR)$(pkgconfigdir)" \ + "$(DESTDIR)$(libdrm_tegraincludedir)" +LTLIBRARIES = $(libdrm_tegra_la_LTLIBRARIES) +libdrm_tegra_la_DEPENDENCIES = ../libdrm.la +am_libdrm_tegra_la_OBJECTS = tegra.lo +libdrm_tegra_la_OBJECTS = $(am_libdrm_tegra_la_OBJECTS) +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 = +libdrm_tegra_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(AM_CFLAGS) $(CFLAGS) $(libdrm_tegra_la_LDFLAGS) $(LDFLAGS) \ + -o $@ +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(libdrm_tegra_la_SOURCES) +DIST_SOURCES = $(libdrm_tegra_la_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +DATA = $(pkgconfig_DATA) +HEADERS = $(libdrm_tegrainclude_HEADERS) +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CAIRO_CFLAGS = @CAIRO_CFLAGS@ +CAIRO_LIBS = @CAIRO_LIBS@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CLOCK_LIB = @CLOCK_LIB@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBUDEV_CFLAGS = @LIBUDEV_CFLAGS@ +LIBUDEV_LIBS = @LIBUDEV_LIBS@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MANPAGES_STYLESHEET = @MANPAGES_STYLESHEET@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PCIACCESS_CFLAGS = @PCIACCESS_CFLAGS@ +PCIACCESS_LIBS = @PCIACCESS_LIBS@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +PTHREADSTUBS_CFLAGS = @PTHREADSTUBS_CFLAGS@ +PTHREADSTUBS_LIBS = @PTHREADSTUBS_LIBS@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ +VALGRIND_LIBS = @VALGRIND_LIBS@ +VERSION = @VERSION@ +VISIBILITY_CFLAGS = @VISIBILITY_CFLAGS@ +WARN_CFLAGS = @WARN_CFLAGS@ +XSLTPROC = @XSLTPROC@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +kernel_source = @kernel_source@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +pkgconfigdir = @pkgconfigdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AM_CPPFLAGS = \ + -I$(top_srcdir) \ + -I$(top_srcdir)/include/drm + +AM_CFLAGS = \ + @PTHREADSTUBS_CFLAGS@ \ + $(VISIBILITY_CFLAGS) \ + $(WARN_CFLAGS) + +libdrm_tegra_ladir = $(libdir) +libdrm_tegra_la_LTLIBRARIES = libdrm_tegra.la +libdrm_tegra_la_LDFLAGS = -version-number 0:0:0 -no-undefined +libdrm_tegra_la_LIBADD = ../libdrm.la @PTHREADSTUBS_LIBS@ +libdrm_tegra_la_SOURCES = \ + private.h \ + tegra.c + +libdrm_tegraincludedir = ${includedir}/libdrm +libdrm_tegrainclude_HEADERS = tegra.h +pkgconfig_DATA = libdrm_tegra.pc +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tegra/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign tegra/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +libdrm_tegra.pc: $(top_builddir)/config.status $(srcdir)/libdrm_tegra.pc.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ + +install-libdrm_tegra_laLTLIBRARIES: $(libdrm_tegra_la_LTLIBRARIES) + @$(NORMAL_INSTALL) + @list='$(libdrm_tegra_la_LTLIBRARIES)'; test -n "$(libdrm_tegra_ladir)" || list=; \ + list2=; for p in $$list; do \ + if test -f $$p; then \ + list2="$$list2 $$p"; \ + else :; fi; \ + done; \ + test -z "$$list2" || { \ + echo " $(MKDIR_P) '$(DESTDIR)$(libdrm_tegra_ladir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(libdrm_tegra_ladir)" || exit 1; \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdrm_tegra_ladir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdrm_tegra_ladir)"; \ + } + +uninstall-libdrm_tegra_laLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(libdrm_tegra_la_LTLIBRARIES)'; test -n "$(libdrm_tegra_ladir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdrm_tegra_ladir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdrm_tegra_ladir)/$$f"; \ + done + +clean-libdrm_tegra_laLTLIBRARIES: + -test -z "$(libdrm_tegra_la_LTLIBRARIES)" || rm -f $(libdrm_tegra_la_LTLIBRARIES) + @list='$(libdrm_tegra_la_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } + +libdrm_tegra.la: $(libdrm_tegra_la_OBJECTS) $(libdrm_tegra_la_DEPENDENCIES) $(EXTRA_libdrm_tegra_la_DEPENDENCIES) + $(AM_V_CCLD)$(libdrm_tegra_la_LINK) -rpath $(libdrm_tegra_ladir) $(libdrm_tegra_la_OBJECTS) $(libdrm_tegra_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tegra.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-pkgconfigDATA: $(pkgconfig_DATA) + @$(NORMAL_INSTALL) + @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \ + done + +uninstall-pkgconfigDATA: + @$(NORMAL_UNINSTALL) + @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir) +install-libdrm_tegraincludeHEADERS: $(libdrm_tegrainclude_HEADERS) + @$(NORMAL_INSTALL) + @list='$(libdrm_tegrainclude_HEADERS)'; test -n "$(libdrm_tegraincludedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(libdrm_tegraincludedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(libdrm_tegraincludedir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(libdrm_tegraincludedir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(libdrm_tegraincludedir)" || exit $$?; \ + done + +uninstall-libdrm_tegraincludeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(libdrm_tegrainclude_HEADERS)'; test -n "$(libdrm_tegraincludedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(libdrm_tegraincludedir)'; $(am__uninstall_files_from_dir) + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) $(DATA) $(HEADERS) +installdirs: + for dir in "$(DESTDIR)$(libdrm_tegra_ladir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(libdrm_tegraincludedir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libdrm_tegra_laLTLIBRARIES clean-libtool \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-libdrm_tegra_laLTLIBRARIES \ + install-libdrm_tegraincludeHEADERS install-pkgconfigDATA + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-libdrm_tegra_laLTLIBRARIES \ + uninstall-libdrm_tegraincludeHEADERS uninstall-pkgconfigDATA + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ + clean-libdrm_tegra_laLTLIBRARIES clean-libtool 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-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-libdrm_tegra_laLTLIBRARIES \ + install-libdrm_tegraincludeHEADERS install-man install-pdf \ + install-pdf-am install-pkgconfigDATA install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ + uninstall-libdrm_tegra_laLTLIBRARIES \ + uninstall-libdrm_tegraincludeHEADERS uninstall-pkgconfigDATA + + +# 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 libdrm-2.4.56/tegra/private.h libdrm-2.4.60/tegra/private.h --- libdrm-2.4.56/tegra/private.h 1970-01-01 00:00:00.000000000 +0000 +++ libdrm-2.4.60/tegra/private.h 2015-02-28 18:34:25.000000000 +0000 @@ -0,0 +1,51 @@ +/* + * Copyright © 2012, 2013 Thierry Reding + * Copyright © 2013 Erik Faye-Lund + * Copyright © 2014 NVIDIA Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#ifndef __DRM_TEGRA_PRIVATE_H__ +#define __DRM_TEGRA_PRIVATE_H__ 1 + +#include +#include + +#include +#include + +#include "tegra.h" + +struct drm_tegra { + bool close; + int fd; +}; + +struct drm_tegra_bo { + struct drm_tegra *drm; + uint32_t handle; + uint32_t offset; + uint32_t flags; + uint32_t size; + atomic_t ref; + void *map; +}; + +#endif /* __DRM_TEGRA_PRIVATE_H__ */ diff -Nru libdrm-2.4.56/tegra/tegra.c libdrm-2.4.60/tegra/tegra.c --- libdrm-2.4.56/tegra/tegra.c 1970-01-01 00:00:00.000000000 +0000 +++ libdrm-2.4.60/tegra/tegra.c 2015-02-28 18:34:25.000000000 +0000 @@ -0,0 +1,345 @@ +/* + * Copyright © 2012, 2013 Thierry Reding + * Copyright © 2013 Erik Faye-Lund + * Copyright © 2014 NVIDIA Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include +#include +#include +#include + +#include + +#include + +#include + +#include "private.h" + +static void drm_tegra_bo_free(struct drm_tegra_bo *bo) +{ + struct drm_tegra *drm = bo->drm; + struct drm_gem_close args; + + if (bo->map) + munmap(bo->map, bo->size); + + memset(&args, 0, sizeof(args)); + args.handle = bo->handle; + + drmIoctl(drm->fd, DRM_IOCTL_GEM_CLOSE, &args); + + free(bo); +} + +static int drm_tegra_wrap(struct drm_tegra **drmp, int fd, bool close) +{ + struct drm_tegra *drm; + + if (fd < 0 || !drmp) + return -EINVAL; + + drm = calloc(1, sizeof(*drm)); + if (!drm) + return -ENOMEM; + + drm->close = close; + drm->fd = fd; + + *drmp = drm; + + return 0; +} + +drm_public +int drm_tegra_new(struct drm_tegra **drmp, int fd) +{ + bool supported = false; + drmVersionPtr version; + + version = drmGetVersion(fd); + if (!version) + return -ENOMEM; + + if (!strncmp(version->name, "tegra", version->name_len)) + supported = true; + + drmFreeVersion(version); + + if (!supported) + return -ENOTSUP; + + return drm_tegra_wrap(drmp, fd, false); +} + +drm_public +void drm_tegra_close(struct drm_tegra *drm) +{ + if (!drm) + return; + + if (drm->close) + close(drm->fd); + + free(drm); +} + +drm_public +int drm_tegra_bo_new(struct drm_tegra_bo **bop, struct drm_tegra *drm, + uint32_t flags, uint32_t size) +{ + struct drm_tegra_gem_create args; + struct drm_tegra_bo *bo; + int err; + + if (!drm || size == 0 || !bop) + return -EINVAL; + + bo = calloc(1, sizeof(*bo)); + if (!bo) + return -ENOMEM; + + atomic_set(&bo->ref, 1); + bo->flags = flags; + bo->size = size; + bo->drm = drm; + + memset(&args, 0, sizeof(args)); + args.flags = flags; + args.size = size; + + err = drmCommandWriteRead(drm->fd, DRM_TEGRA_GEM_CREATE, &args, + sizeof(args)); + if (err < 0) { + err = -errno; + free(bo); + return err; + } + + bo->handle = args.handle; + + *bop = bo; + + return 0; +} + +drm_public +int drm_tegra_bo_wrap(struct drm_tegra_bo **bop, struct drm_tegra *drm, + uint32_t handle, uint32_t flags, uint32_t size) +{ + struct drm_tegra_bo *bo; + + if (!drm || !bop) + return -EINVAL; + + bo = calloc(1, sizeof(*bo)); + if (!bo) + return -ENOMEM; + + atomic_set(&bo->ref, 1); + bo->handle = handle; + bo->flags = flags; + bo->size = size; + bo->drm = drm; + + *bop = bo; + + return 0; +} + +drm_public +struct drm_tegra_bo *drm_tegra_bo_ref(struct drm_tegra_bo *bo) +{ + if (bo) + atomic_inc(&bo->ref); + + return bo; +} + +drm_public +void drm_tegra_bo_unref(struct drm_tegra_bo *bo) +{ + if (bo && atomic_dec_and_test(&bo->ref)) + drm_tegra_bo_free(bo); +} + +drm_public +int drm_tegra_bo_get_handle(struct drm_tegra_bo *bo, uint32_t *handle) +{ + if (!bo || !handle) + return -EINVAL; + + *handle = bo->handle; + + return 0; +} + +drm_public +int drm_tegra_bo_map(struct drm_tegra_bo *bo, void **ptr) +{ + struct drm_tegra *drm = bo->drm; + + if (!bo->map) { + struct drm_tegra_gem_mmap args; + int err; + + memset(&args, 0, sizeof(args)); + args.handle = bo->handle; + + err = drmCommandWriteRead(drm->fd, DRM_TEGRA_GEM_MMAP, &args, + sizeof(args)); + if (err < 0) + return -errno; + + bo->offset = args.offset; + + bo->map = mmap(0, bo->size, PROT_READ | PROT_WRITE, MAP_SHARED, + drm->fd, bo->offset); + if (bo->map == MAP_FAILED) { + bo->map = NULL; + return -errno; + } + } + + if (ptr) + *ptr = bo->map; + + return 0; +} + +drm_public +int drm_tegra_bo_unmap(struct drm_tegra_bo *bo) +{ + if (!bo) + return -EINVAL; + + if (!bo->map) + return 0; + + if (munmap(bo->map, bo->size)) + return -errno; + + bo->map = NULL; + + return 0; +} + +drm_public +int drm_tegra_bo_get_flags(struct drm_tegra_bo *bo, uint32_t *flags) +{ + struct drm_tegra_gem_get_flags args; + struct drm_tegra *drm = bo->drm; + int err; + + if (!bo) + return -EINVAL; + + memset(&args, 0, sizeof(args)); + args.handle = bo->handle; + + err = drmCommandWriteRead(drm->fd, DRM_TEGRA_GEM_GET_FLAGS, &args, + sizeof(args)); + if (err < 0) + return -errno; + + if (flags) + *flags = args.flags; + + return 0; +} + +drm_public +int drm_tegra_bo_set_flags(struct drm_tegra_bo *bo, uint32_t flags) +{ + struct drm_tegra_gem_get_flags args; + struct drm_tegra *drm = bo->drm; + int err; + + if (!bo) + return -EINVAL; + + memset(&args, 0, sizeof(args)); + args.handle = bo->handle; + args.flags = flags; + + err = drmCommandWriteRead(drm->fd, DRM_TEGRA_GEM_SET_FLAGS, &args, + sizeof(args)); + if (err < 0) + return -errno; + + return 0; +} + +drm_public +int drm_tegra_bo_get_tiling(struct drm_tegra_bo *bo, + struct drm_tegra_bo_tiling *tiling) +{ + struct drm_tegra_gem_get_tiling args; + struct drm_tegra *drm = bo->drm; + int err; + + if (!bo) + return -EINVAL; + + memset(&args, 0, sizeof(args)); + args.handle = bo->handle; + + err = drmCommandWriteRead(drm->fd, DRM_TEGRA_GEM_GET_TILING, &args, + sizeof(args)); + if (err < 0) + return -errno; + + if (tiling) { + tiling->mode = args.mode; + tiling->value = args.value; + } + + return 0; +} + +drm_public +int drm_tegra_bo_set_tiling(struct drm_tegra_bo *bo, + const struct drm_tegra_bo_tiling *tiling) +{ + struct drm_tegra_gem_set_tiling args; + struct drm_tegra *drm = bo->drm; + int err; + + if (!bo) + return -EINVAL; + + memset(&args, 0, sizeof(args)); + args.handle = bo->handle; + args.mode = tiling->mode; + args.value = tiling->value; + + err = drmCommandWriteRead(drm->fd, DRM_TEGRA_GEM_SET_TILING, &args, + sizeof(args)); + if (err < 0) + return -errno; + + return 0; +} diff -Nru libdrm-2.4.56/tegra/tegra.h libdrm-2.4.60/tegra/tegra.h --- libdrm-2.4.56/tegra/tegra.h 1970-01-01 00:00:00.000000000 +0000 +++ libdrm-2.4.60/tegra/tegra.h 2015-02-28 18:34:25.000000000 +0000 @@ -0,0 +1,60 @@ +/* + * Copyright © 2012, 2013 Thierry Reding + * Copyright © 2013 Erik Faye-Lund + * Copyright © 2014 NVIDIA Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#ifndef __DRM_TEGRA_H__ +#define __DRM_TEGRA_H__ 1 + +#include +#include + +struct drm_tegra_bo; +struct drm_tegra; + +int drm_tegra_new(struct drm_tegra **drmp, int fd); +void drm_tegra_close(struct drm_tegra *drm); + +int drm_tegra_bo_new(struct drm_tegra_bo **bop, struct drm_tegra *drm, + uint32_t flags, uint32_t size); +int drm_tegra_bo_wrap(struct drm_tegra_bo **bop, struct drm_tegra *drm, + uint32_t handle, uint32_t flags, uint32_t size); +struct drm_tegra_bo *drm_tegra_bo_ref(struct drm_tegra_bo *bo); +void drm_tegra_bo_unref(struct drm_tegra_bo *bo); +int drm_tegra_bo_get_handle(struct drm_tegra_bo *bo, uint32_t *handle); +int drm_tegra_bo_map(struct drm_tegra_bo *bo, void **ptr); +int drm_tegra_bo_unmap(struct drm_tegra_bo *bo); + +int drm_tegra_bo_get_flags(struct drm_tegra_bo *bo, uint32_t *flags); +int drm_tegra_bo_set_flags(struct drm_tegra_bo *bo, uint32_t flags); + +struct drm_tegra_bo_tiling { + uint32_t mode; + uint32_t value; +}; + +int drm_tegra_bo_get_tiling(struct drm_tegra_bo *bo, + struct drm_tegra_bo_tiling *tiling); +int drm_tegra_bo_set_tiling(struct drm_tegra_bo *bo, + const struct drm_tegra_bo_tiling *tiling); + +#endif /* __DRM_TEGRA_H__ */ diff -Nru libdrm-2.4.56/tests/auth.c libdrm-2.4.60/tests/auth.c --- libdrm-2.4.56/tests/auth.c 2015-05-07 19:02:17.000000000 +0000 +++ libdrm-2.4.60/tests/auth.c 2015-05-07 19:02:17.000000000 +0000 @@ -26,6 +26,7 @@ */ #include +#include #include "drmtest.h" enum auth_event { diff -Nru libdrm-2.4.56/tests/dristat.c libdrm-2.4.60/tests/dristat.c --- libdrm-2.4.56/tests/dristat.c 2013-08-12 18:01:35.000000000 +0000 +++ libdrm-2.4.60/tests/dristat.c 2015-03-18 17:33:36.000000000 +0000 @@ -27,6 +27,10 @@ * */ +#ifdef HAVE_CONFIG_H +# include +#endif + #include #include #include @@ -96,6 +100,7 @@ case DRM_SHM: typename = "SHM"; break; case DRM_AGP: typename = "AGP"; break; case DRM_SCATTER_GATHER: typename = "SG"; break; + case DRM_CONSISTENT: typename = "CON"; break; default: typename = "???"; break; } @@ -185,9 +190,9 @@ static void getstats(int fd, int i) { drmStatsT prev, curr; - int j; + unsigned j; double rate; - + printf(" System statistics:\n"); if (drmGetStats(fd, &prev)) return; @@ -264,7 +269,7 @@ for (i = 0; i < 16; i++) if (!minor || i == minor) { sprintf(buf, DRM_DEV_NAME, DRM_DIR_NAME, i); - fd = drmOpenMinor(i, 1, DRM_NODE_RENDER); + fd = drmOpenMinor(i, 1, DRM_NODE_PRIMARY); if (fd >= 0) { printf("%s\n", buf); if (mask & DRM_BUSID) getbusid(fd); diff -Nru libdrm-2.4.56/tests/drmstat.c libdrm-2.4.60/tests/drmstat.c --- libdrm-2.4.56/tests/drmstat.c 2014-05-30 16:38:28.000000000 +0000 +++ libdrm-2.4.60/tests/drmstat.c 2015-03-18 17:33:36.000000000 +0000 @@ -28,7 +28,9 @@ * */ +#ifdef HAVE_CONFIG_H #include "config.h" +#endif #include #include @@ -85,7 +87,7 @@ printf("Got fd %d\n", fd); } -void process_sigio(char *device) +static void process_sigio(char *device) { int fd; diff -Nru libdrm-2.4.56/tests/exynos/exynos_fimg2d_test.c libdrm-2.4.60/tests/exynos/exynos_fimg2d_test.c --- libdrm-2.4.56/tests/exynos/exynos_fimg2d_test.c 2014-07-25 17:40:07.000000000 +0000 +++ libdrm-2.4.60/tests/exynos/exynos_fimg2d_test.c 2015-03-18 17:33:36.000000000 +0000 @@ -18,6 +18,8 @@ #include #include #include +#include +#include #include #include @@ -29,7 +31,7 @@ #include "exynos_drm.h" #include "exynos_drmif.h" -#include "fimg2d.h" +#include "exynos_fimg2d.h" #define DRM_MODULE_NAME "exynos" #define MAX_TEST_CASE 8 @@ -39,7 +41,7 @@ /* * A structure to test fimg2d hw. * - * @solid_fild: fill given color data to source buffer. + * @solid_fill: fill given color data to source buffer. * @copy: copy source to destination buffer. * @copy_with_scale: copy source to destination buffer scaling up or * down properly. @@ -55,6 +57,9 @@ int (*blend)(struct exynos_device *dev, struct exynos_bo *src, struct exynos_bo *dst, enum e_g2d_buf_type); + int (*checkerboard)(struct exynos_device *dev, + struct exynos_bo *src, struct exynos_bo *dst, + enum e_g2d_buf_type); }; struct connector { @@ -207,15 +212,50 @@ return bo; } +/* Allocate buffer and fill it with checkerboard pattern, where the tiles * + * have a random color. The caller has to free the buffer. */ +void *create_checkerboard_pattern(unsigned int num_tiles_x, + unsigned int num_tiles_y, unsigned int tile_size) +{ + unsigned int *buf; + unsigned int x, y, i, j; + const unsigned int stride = num_tiles_x * tile_size; + + if (posix_memalign((void*)&buf, 64, num_tiles_y * tile_size * stride * 4) != 0) + return NULL; + + for (x = 0; x < num_tiles_x; ++x) { + for (y = 0; y < num_tiles_y; ++y) { + const unsigned int color = 0xff000000 + (random() & 0xffffff); + + for (i = 0; i < tile_size; ++i) { + for (j = 0; j < tile_size; ++j) { + buf[x * tile_size + y * stride * tile_size + i + j * stride] = color; + } + } + } + } + + return buf; +} + static void exynos_destroy_buffer(struct exynos_bo *bo) { exynos_bo_destroy(bo); } +static void wait_for_user_input(int last) +{ + printf("press to %s\n", last ? "exit test application" : + "skip to next test"); + + getchar(); +} + static int g2d_solid_fill_test(struct exynos_device *dev, struct exynos_bo *dst) { struct g2d_context *ctx; - struct g2d_image img; + struct g2d_image img = {0}; unsigned int count, img_w, img_h; int ret = 0; @@ -223,10 +263,9 @@ if (!ctx) return -EFAULT; - memset(&img, 0, sizeof(struct g2d_image)); img.bo[0] = dst->handle; - printf("soild fill test.\n"); + printf("solid fill test.\n"); srand(time(NULL)); img_w = screen_width; @@ -266,8 +305,7 @@ enum e_g2d_buf_type type) { struct g2d_context *ctx; - struct g2d_image src_img, dst_img; - unsigned int count; + struct g2d_image src_img = {0}, dst_img = {0}; unsigned int src_x, src_y, dst_x, dst_y, img_w, img_h; unsigned long userptr, size; int ret; @@ -276,8 +314,6 @@ if (!ctx) return -EFAULT; - memset(&src_img, 0, sizeof(struct g2d_image)); - memset(&dst_img, 0, sizeof(struct g2d_image)); dst_img.bo[0] = dst->handle; src_x = 0; @@ -350,9 +386,8 @@ enum e_g2d_buf_type type) { struct g2d_context *ctx; - struct g2d_image src_img, dst_img; - unsigned int count; - unsigned int src_x, src_y, dst_x, dst_y, img_w, img_h; + struct g2d_image src_img = {0}, dst_img = {0}; + unsigned int src_x, src_y, img_w, img_h; unsigned long userptr, size; int ret; @@ -360,14 +395,10 @@ if (!ctx) return -EFAULT; - memset(&src_img, 0, sizeof(struct g2d_image)); - memset(&dst_img, 0, sizeof(struct g2d_image)); dst_img.bo[0] = dst->handle; src_x = 0; src_y = 0; - dst_x = 0; - dst_y = 0; img_w = screen_width; img_h = screen_height; @@ -439,8 +470,7 @@ enum e_g2d_buf_type type) { struct g2d_context *ctx; - struct g2d_image src_img, dst_img; - unsigned int count; + struct g2d_image src_img = {0}, dst_img = {0}; unsigned int src_x, src_y, dst_x, dst_y, img_w, img_h; unsigned long userptr, size; int ret; @@ -449,8 +479,6 @@ if (!ctx) return -EFAULT; - memset(&src_img, 0, sizeof(struct g2d_image)); - memset(&dst_img, 0, sizeof(struct g2d_image)); dst_img.bo[0] = dst->handle; src_x = 0; @@ -533,11 +561,90 @@ return 0; } +static int g2d_checkerboard_test(struct exynos_device *dev, + struct exynos_bo *src, + struct exynos_bo *dst, + enum e_g2d_buf_type type) +{ + struct g2d_context *ctx; + struct g2d_image src_img = {0}, dst_img = {0}; + unsigned int src_x, src_y, dst_x, dst_y, img_w, img_h; + void *checkerboard = NULL; + int ret; + + ctx = g2d_init(dev->fd); + if (!ctx) + return -EFAULT; + + dst_img.bo[0] = dst->handle; + + src_x = 0; + src_y = 0; + dst_x = 0; + dst_y = 0; + + checkerboard = create_checkerboard_pattern(screen_width / 32, screen_height / 32, 32); + if (checkerboard == NULL) { + ret = -1; + goto fail; + } + + img_w = screen_width - (screen_width % 32); + img_h = screen_height - (screen_height % 32); + + switch (type) { + case G2D_IMGBUF_GEM: + memcpy(src->vaddr, checkerboard, img_w * img_h * 4); + src_img.bo[0] = src->handle; + break; + case G2D_IMGBUF_USERPTR: + src_img.user_ptr[0].userptr = (unsigned long)checkerboard; + src_img.user_ptr[0].size = img_w * img_h * 4; + break; + default: + ret = -EFAULT; + goto fail; + } + + printf("checkerboard test with %s.\n", + type == G2D_IMGBUF_GEM ? "gem" : "userptr"); + + src_img.width = img_w; + src_img.height = img_h; + src_img.stride = src_img.width * 4; + src_img.buf_type = type; + src_img.color_mode = G2D_COLOR_FMT_ARGB8888 | G2D_ORDER_AXRGB; + + dst_img.width = screen_width; + dst_img.height = screen_height; + dst_img.stride = dst_img.width * 4; + dst_img.buf_type = G2D_IMGBUF_GEM; + dst_img.color_mode = G2D_COLOR_FMT_ARGB8888 | G2D_ORDER_AXRGB; + src_img.color = 0xff000000; + ret = g2d_solid_fill(ctx, &dst_img, src_x, src_y, screen_width, screen_height); + if (ret < 0) + goto fail; + + ret = g2d_copy(ctx, &src_img, &dst_img, src_x, src_y, dst_x, dst_y, + img_w, img_h); + if (ret < 0) + goto fail; + + g2d_exec(ctx); + +fail: + free(checkerboard); + g2d_fini(ctx); + + return ret; +} + static struct fimg2d_test_case test_case = { .solid_fill = &g2d_solid_fill_test, .copy = &g2d_copy_test, .copy_with_scale = &g2d_copy_with_scale_test, .blend = &g2d_blend_test, + .checkerboard = &g2d_checkerboard_test, }; static void usage(char *name) @@ -555,7 +662,6 @@ struct exynos_device *dev; struct exynos_bo *bo, *src; struct connector con; - char *modeset = NULL; unsigned int fb_id; uint32_t handles[4] = {0}, pitches[4] = {0}, offsets[4] = {0}; drmModeRes *resources; @@ -571,7 +677,6 @@ while ((c = getopt(argc, argv, optstr)) != -1) { switch (c) { case 's': - modeset = strdup(optarg); con.crtc = -1; if (sscanf(optarg, "%d:0x%64s", &con.id, @@ -611,10 +716,22 @@ connector_find_mode(dev->fd, &con, resources); drmModeFreeResources(resources); + if (!con.mode) { + fprintf(stderr, "failed to find usable connector\n"); + ret = -EFAULT; + goto err_drm_close; + } + screen_width = con.mode->hdisplay; screen_height = con.mode->vdisplay; - printf("screen width = %d, screen height = %d\n", screen_width, + if (screen_width == 0 || screen_height == 0) { + fprintf(stderr, "failed to find sane resolution on connector\n"); + ret = -EFAULT; + goto err_drm_close; + } + + printf("screen width = %d, screen height = %d\n", screen_width, screen_height); bo = exynos_create_buffer(dev, screen_width * screen_height * 4, 0); @@ -647,7 +764,7 @@ goto err_rm_fb; } - getchar(); + wait_for_user_input(0); src = exynos_create_buffer(dev, screen_width * screen_height * 4, 0); if (!src) { @@ -661,7 +778,7 @@ goto err_free_src; } - getchar(); + wait_for_user_input(0); ret = test_case.copy_with_scale(dev, src, bo, G2D_IMGBUF_GEM); if (ret < 0) { @@ -669,13 +786,31 @@ goto err_free_src; } - getchar(); + wait_for_user_input(0); + + ret = test_case.checkerboard(dev, src, bo, G2D_IMGBUF_GEM); + if (ret < 0) { + fprintf(stderr, "failed to issue checkerboard test.\n"); + goto err_free_src; + } + + wait_for_user_input(1); + /* + * The blend test uses the userptr functionality of exynos-drm, which + * is currently not safe to use. If the kernel hasn't been build with + * exynos-iommu support, then the blend test is going to produce (kernel) + * memory corruption, eventually leading to a system crash. + * + * Disable the test for now, until the kernel code has been sanitized. + */ +#if 0 ret = test_case.blend(dev, src, bo, G2D_IMGBUF_USERPTR); if (ret < 0) fprintf(stderr, "failed to test blend operation.\n"); getchar(); +#endif err_free_src: if (src) diff -Nru libdrm-2.4.56/tests/exynos/Makefile.am libdrm-2.4.60/tests/exynos/Makefile.am --- libdrm-2.4.56/tests/exynos/Makefile.am 2014-07-26 18:08:30.000000000 +0000 +++ libdrm-2.4.60/tests/exynos/Makefile.am 2015-02-28 18:34:25.000000000 +0000 @@ -1,4 +1,5 @@ AM_CFLAGS = \ + $(WARN_CFLAGS)\ -I $(top_srcdir)/include/drm \ -I $(top_srcdir)/libkms/ \ -I $(top_srcdir)/exynos \ diff -Nru libdrm-2.4.56/tests/exynos/Makefile.in libdrm-2.4.60/tests/exynos/Makefile.in --- libdrm-2.4.56/tests/exynos/Makefile.in 2014-07-29 16:13:53.000000000 +0000 +++ libdrm-2.4.60/tests/exynos/Makefile.in 2015-03-19 14:37:47.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.14.1 from Makefile.am. +# Makefile.in generated by automake 1.13.4 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. @@ -211,7 +211,6 @@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MANPAGES_STYLESHEET = @MANPAGES_STYLESHEET@ @@ -245,6 +244,7 @@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ VALGRIND_LIBS = @VALGRIND_LIBS@ VERSION = @VERSION@ +VISIBILITY_CFLAGS = @VISIBILITY_CFLAGS@ WARN_CFLAGS = @WARN_CFLAGS@ XSLTPROC = @XSLTPROC@ abs_builddir = @abs_builddir@ @@ -302,6 +302,7 @@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CFLAGS = \ + $(WARN_CFLAGS)\ -I $(top_srcdir)/include/drm \ -I $(top_srcdir)/libkms/ \ -I $(top_srcdir)/exynos \ @@ -319,7 +320,7 @@ .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -344,9 +345,9 @@ $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @@ -425,14 +426,14 @@ @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< diff -Nru libdrm-2.4.56/tests/gem_basic.c libdrm-2.4.60/tests/gem_basic.c --- libdrm-2.4.56/tests/gem_basic.c 2013-08-12 18:01:36.000000000 +0000 +++ libdrm-2.4.60/tests/gem_basic.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,102 +0,0 @@ -/* - * Copyright © 2008 Intel Corporation - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice (including the next - * paragraph) shall be included in all copies or substantial portions of the - * Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - * IN THE SOFTWARE. - * - * Authors: - * Eric Anholt - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include "drm.h" -#include "i915_drm.h" - -static void -test_bad_close(int fd) -{ - struct drm_gem_close close; - int ret; - - printf("Testing error return on bad close ioctl.\n"); - - close.handle = 0x10101010; - ret = ioctl(fd, DRM_IOCTL_GEM_CLOSE, &close); - - assert(ret == -1 && errno == EINVAL); -} - -static void -test_create_close(int fd) -{ - struct drm_i915_gem_create create; - struct drm_gem_close close; - int ret; - - printf("Testing creating and closing an object.\n"); - - memset(&create, 0, sizeof(create)); - create.size = 16 * 1024; - ret = ioctl(fd, DRM_IOCTL_I915_GEM_CREATE, &create); - assert(ret == 0); - - close.handle = create.handle; - ret = ioctl(fd, DRM_IOCTL_GEM_CLOSE, &close); -} - -static void -test_create_fd_close(int fd) -{ - struct drm_i915_gem_create create; - int ret; - - printf("Testing closing with an object allocated.\n"); - - memset(&create, 0, sizeof(create)); - create.size = 16 * 1024; - ret = ioctl(fd, DRM_IOCTL_I915_GEM_CREATE, &create); - assert(ret == 0); - - close(fd); -} - -int main(int argc, char **argv) -{ - int fd; - - fd = drm_open_matching("8086:*", 0); - if (fd < 0) { - fprintf(stderr, "failed to open intel drm device\n"); - return 0; - } - - test_bad_close(fd); - test_create_close(fd); - test_create_fd_close(fd); - - return 0; -} diff -Nru libdrm-2.4.56/tests/gem_flink.c libdrm-2.4.60/tests/gem_flink.c --- libdrm-2.4.56/tests/gem_flink.c 2013-08-12 18:01:37.000000000 +0000 +++ libdrm-2.4.60/tests/gem_flink.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,137 +0,0 @@ -/* - * Copyright © 2008 Intel Corporation - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice (including the next - * paragraph) shall be included in all copies or substantial portions of the - * Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - * IN THE SOFTWARE. - * - * Authors: - * Eric Anholt - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include "drm.h" -#include "i915_drm.h" - -static void -test_flink(int fd) -{ - struct drm_i915_gem_create create; - struct drm_gem_flink flink; - struct drm_gem_open open; - int ret; - - printf("Testing flink and open.\n"); - - memset(&create, 0, sizeof(create)); - create.size = 16 * 1024; - ret = ioctl(fd, DRM_IOCTL_I915_GEM_CREATE, &create); - assert(ret == 0); - - flink.handle = create.handle; - ret = ioctl(fd, DRM_IOCTL_GEM_FLINK, &flink); - assert(ret == 0); - - open.name = flink.name; - ret = ioctl(fd, DRM_IOCTL_GEM_OPEN, &open); - assert(ret == 0); - assert(open.handle != 0); -} - -static void -test_double_flink(int fd) -{ - struct drm_i915_gem_create create; - struct drm_gem_flink flink; - struct drm_gem_flink flink2; - int ret; - - printf("Testing repeated flink.\n"); - - memset(&create, 0, sizeof(create)); - create.size = 16 * 1024; - ret = ioctl(fd, DRM_IOCTL_I915_GEM_CREATE, &create); - assert(ret == 0); - - flink.handle = create.handle; - ret = ioctl(fd, DRM_IOCTL_GEM_FLINK, &flink); - assert(ret == 0); - - flink2.handle = create.handle; - ret = ioctl(fd, DRM_IOCTL_GEM_FLINK, &flink2); - assert(ret == 0); - assert(flink2.name == flink.name); -} - -static void -test_bad_flink(int fd) -{ - struct drm_gem_flink flink; - int ret; - - printf("Testing error return on bad flink ioctl.\n"); - - flink.handle = 0x10101010; - ret = ioctl(fd, DRM_IOCTL_GEM_FLINK, &flink); - assert(ret == -1 && errno == ENOENT); -} - -static void -test_bad_open(int fd) -{ - struct drm_gem_open open; - int ret; - - printf("Testing error return on bad open ioctl.\n"); - - open.name = 0x10101010; - ret = ioctl(fd, DRM_IOCTL_GEM_OPEN, &open); - - assert(ret == -1 && errno == ENOENT); -} - -int main(int argc, char **argv) -{ - int fd; - - if (geteuid()) { - fprintf(stderr, "requires root privileges, skipping\n"); - return 77; - } - - fd = drm_open_matching("8086:*", 0); - if (fd < 0) { - fprintf(stderr, "failed to open intel drm device, skipping\n"); - return 77; - } - - test_flink(fd); - test_double_flink(fd); - test_bad_flink(fd); - test_bad_open(fd); - - return 0; -} diff -Nru libdrm-2.4.56/tests/gem_mmap.c libdrm-2.4.60/tests/gem_mmap.c --- libdrm-2.4.56/tests/gem_mmap.c 2013-08-12 18:01:37.000000000 +0000 +++ libdrm-2.4.60/tests/gem_mmap.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,136 +0,0 @@ -/* - * Copyright © 2008 Intel Corporation - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice (including the next - * paragraph) shall be included in all copies or substantial portions of the - * Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - * IN THE SOFTWARE. - * - * Authors: - * Eric Anholt - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include "drm.h" -#include "i915_drm.h" - -#define OBJECT_SIZE 16384 - -int do_read(int fd, int handle, void *buf, int offset, int size) -{ - struct drm_i915_gem_pread read; - - /* Ensure that we don't have any convenient data in buf in case - * we fail. - */ - memset(buf, 0xd0, size); - - memset(&read, 0, sizeof(read)); - read.handle = handle; - read.data_ptr = (uintptr_t)buf; - read.size = size; - read.offset = offset; - - return ioctl(fd, DRM_IOCTL_I915_GEM_PREAD, &read); -} - -int do_write(int fd, int handle, void *buf, int offset, int size) -{ - struct drm_i915_gem_pwrite write; - - memset(&write, 0, sizeof(write)); - write.handle = handle; - write.data_ptr = (uintptr_t)buf; - write.size = size; - write.offset = offset; - - return ioctl(fd, DRM_IOCTL_I915_GEM_PWRITE, &write); -} - -int main(int argc, char **argv) -{ - int fd; - struct drm_i915_gem_create create; - struct drm_i915_gem_mmap mmap; - struct drm_gem_close unref; - uint8_t expected[OBJECT_SIZE]; - uint8_t buf[OBJECT_SIZE]; - uint8_t *addr; - int ret; - int handle; - - fd = drm_open_matching("8086:*", 0); - if (fd < 0) { - fprintf(stderr, "failed to open intel drm device, skipping\n"); - return 0; - } - - memset(&mmap, 0, sizeof(mmap)); - mmap.handle = 0x10101010; - mmap.offset = 0; - mmap.size = 4096; - printf("Testing mmaping of bad object.\n"); - ret = ioctl(fd, DRM_IOCTL_I915_GEM_MMAP, &mmap); - assert(ret == -1 && errno == ENOENT); - - memset(&create, 0, sizeof(create)); - create.size = OBJECT_SIZE; - ret = ioctl(fd, DRM_IOCTL_I915_GEM_CREATE, &create); - assert(ret == 0); - handle = create.handle; - - printf("Testing mmaping of newly created object.\n"); - mmap.handle = handle; - mmap.offset = 0; - mmap.size = OBJECT_SIZE; - ret = ioctl(fd, DRM_IOCTL_I915_GEM_MMAP, &mmap); - assert(ret == 0); - addr = (uint8_t *)(uintptr_t)mmap.addr_ptr; - - printf("Testing contents of newly created object.\n"); - memset(expected, 0, sizeof(expected)); - assert(memcmp(addr, expected, sizeof(expected)) == 0); - - printf("Testing coherency of writes and mmap reads.\n"); - memset(buf, 0, sizeof(buf)); - memset(buf + 1024, 0x01, 1024); - memset(expected + 1024, 0x01, 1024); - ret = do_write(fd, handle, buf, 0, OBJECT_SIZE); - assert(ret == 0); - assert(memcmp(buf, addr, sizeof(buf)) == 0); - - printf("Testing that mapping stays after close\n"); - unref.handle = handle; - ret = ioctl(fd, DRM_IOCTL_GEM_CLOSE, &unref); - assert(ret == 0); - assert(memcmp(buf, addr, sizeof(buf)) == 0); - - printf("Testing unmapping\n"); - munmap(addr, OBJECT_SIZE); - - close(fd); - - return 0; -} diff -Nru libdrm-2.4.56/tests/gem_readwrite.c libdrm-2.4.60/tests/gem_readwrite.c --- libdrm-2.4.56/tests/gem_readwrite.c 2013-08-12 18:01:37.000000000 +0000 +++ libdrm-2.4.60/tests/gem_readwrite.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,139 +0,0 @@ -/* - * Copyright © 2008 Intel Corporation - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice (including the next - * paragraph) shall be included in all copies or substantial portions of the - * Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - * IN THE SOFTWARE. - * - * Authors: - * Eric Anholt - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include "drm.h" -#include "i915_drm.h" - -#define OBJECT_SIZE 16384 - -int do_read(int fd, int handle, void *buf, int offset, int size) -{ - struct drm_i915_gem_pread read; - - /* Ensure that we don't have any convenient data in buf in case - * we fail. - */ - memset(buf, 0xd0, size); - - memset(&read, 0, sizeof(read)); - read.handle = handle; - read.data_ptr = (uintptr_t)buf; - read.size = size; - read.offset = offset; - - return ioctl(fd, DRM_IOCTL_I915_GEM_PREAD, &read); -} - -int do_write(int fd, int handle, void *buf, int offset, int size) -{ - struct drm_i915_gem_pwrite write; - - memset(&write, 0, sizeof(write)); - write.handle = handle; - write.data_ptr = (uintptr_t)buf; - write.size = size; - write.offset = offset; - - return ioctl(fd, DRM_IOCTL_I915_GEM_PWRITE, &write); -} - -int main(int argc, char **argv) -{ - int fd; - struct drm_i915_gem_create create; - uint8_t expected[OBJECT_SIZE]; - uint8_t buf[OBJECT_SIZE]; - int ret; - int handle; - - fd = drm_open_matching("8086:*", 0); - if (fd < 0) { - fprintf(stderr, "failed to open intel drm device, skipping\n"); - return 0; - } - - memset(&create, 0, sizeof(create)); - create.size = OBJECT_SIZE; - ret = ioctl(fd, DRM_IOCTL_I915_GEM_CREATE, &create); - assert(ret == 0); - handle = create.handle; - - printf("Testing contents of newly created object.\n"); - ret = do_read(fd, handle, buf, 0, OBJECT_SIZE); - assert(ret == 0); - memset(&expected, 0, sizeof(expected)); - assert(memcmp(expected, buf, sizeof(expected)) == 0); - - printf("Testing read beyond end of buffer.\n"); - ret = do_read(fd, handle, buf, OBJECT_SIZE / 2, OBJECT_SIZE); - printf("%d %d\n", ret, errno); - assert(ret == -1 && errno == EINVAL); - - printf("Testing full write of buffer\n"); - memset(buf, 0, sizeof(buf)); - memset(buf + 1024, 0x01, 1024); - memset(expected + 1024, 0x01, 1024); - ret = do_write(fd, handle, buf, 0, OBJECT_SIZE); - assert(ret == 0); - ret = do_read(fd, handle, buf, 0, OBJECT_SIZE); - assert(ret == 0); - assert(memcmp(buf, expected, sizeof(buf)) == 0); - - printf("Testing partial write of buffer\n"); - memset(buf + 4096, 0x02, 1024); - memset(expected + 4096, 0x02, 1024); - ret = do_write(fd, handle, buf + 4096, 4096, 1024); - assert(ret == 0); - ret = do_read(fd, handle, buf, 0, OBJECT_SIZE); - assert(ret == 0); - assert(memcmp(buf, expected, sizeof(buf)) == 0); - - printf("Testing partial read of buffer\n"); - ret = do_read(fd, handle, buf, 512, 1024); - assert(ret == 0); - assert(memcmp(buf, expected + 512, 1024) == 0); - - printf("Testing read of bad buffer handle\n"); - ret = do_read(fd, 1234, buf, 0, 1024); - assert(ret == -1 && errno == ENOENT); - - printf("Testing write of bad buffer handle\n"); - ret = do_write(fd, 1234, buf, 0, 1024); - assert(ret == -1 && errno == ENOENT); - - close(fd); - - return 0; -} diff -Nru libdrm-2.4.56/tests/getclient.c libdrm-2.4.60/tests/getclient.c --- libdrm-2.4.56/tests/getclient.c 2013-08-12 18:01:37.000000000 +0000 +++ libdrm-2.4.60/tests/getclient.c 2015-02-28 18:34:25.000000000 +0000 @@ -26,6 +26,7 @@ */ #include +#include #include "drmtest.h" /** diff -Nru libdrm-2.4.56/tests/getstats.c libdrm-2.4.60/tests/getstats.c --- libdrm-2.4.56/tests/getstats.c 2013-08-12 18:01:38.000000000 +0000 +++ libdrm-2.4.60/tests/getstats.c 2015-03-18 17:33:36.000000000 +0000 @@ -26,6 +26,7 @@ */ #include +#include #include "drmtest.h" /** @@ -44,8 +45,6 @@ ret = ioctl(fd, DRM_IOCTL_GET_STATS, &stats); assert(ret == 0); - assert(stats.count >= 0); - close(fd); return 0; } diff -Nru libdrm-2.4.56/tests/kmstest/main.c libdrm-2.4.60/tests/kmstest/main.c --- libdrm-2.4.56/tests/kmstest/main.c 2014-02-07 16:58:41.000000000 +0000 +++ libdrm-2.4.60/tests/kmstest/main.c 2015-03-18 17:33:36.000000000 +0000 @@ -37,7 +37,7 @@ return ret; \ } -int test_bo(struct kms_driver *kms) +static int test_bo(struct kms_driver *kms) { struct kms_bo *bo; int ret; @@ -56,12 +56,13 @@ return 0; } -char *drivers[] = { +static const char *drivers[] = { "i915", "radeon", "nouveau", "vmwgfx", "exynos", + "imx-drm", NULL }; diff -Nru libdrm-2.4.56/tests/kmstest/Makefile.am libdrm-2.4.60/tests/kmstest/Makefile.am --- libdrm-2.4.56/tests/kmstest/Makefile.am 2013-08-12 18:01:38.000000000 +0000 +++ libdrm-2.4.60/tests/kmstest/Makefile.am 2015-02-28 18:34:25.000000000 +0000 @@ -1,4 +1,5 @@ AM_CFLAGS = \ + $(WARN_CFLAGS)\ -I$(top_srcdir)/include/drm \ -I$(top_srcdir)/libkms/ \ -I$(top_srcdir) diff -Nru libdrm-2.4.56/tests/kmstest/Makefile.in libdrm-2.4.60/tests/kmstest/Makefile.in --- libdrm-2.4.56/tests/kmstest/Makefile.in 2014-07-29 16:13:53.000000000 +0000 +++ libdrm-2.4.60/tests/kmstest/Makefile.in 2015-03-19 14:37:47.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.14.1 from Makefile.am. +# Makefile.in generated by automake 1.13.4 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. @@ -210,7 +210,6 @@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MANPAGES_STYLESHEET = @MANPAGES_STYLESHEET@ @@ -244,6 +243,7 @@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ VALGRIND_LIBS = @VALGRIND_LIBS@ VERSION = @VERSION@ +VISIBILITY_CFLAGS = @VISIBILITY_CFLAGS@ WARN_CFLAGS = @WARN_CFLAGS@ XSLTPROC = @XSLTPROC@ abs_builddir = @abs_builddir@ @@ -301,6 +301,7 @@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CFLAGS = \ + $(WARN_CFLAGS)\ -I$(top_srcdir)/include/drm \ -I$(top_srcdir)/libkms/ \ -I$(top_srcdir) @@ -316,7 +317,7 @@ .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -341,9 +342,9 @@ $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @@ -422,14 +423,14 @@ @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< diff -Nru libdrm-2.4.56/tests/lock.c libdrm-2.4.60/tests/lock.c --- libdrm-2.4.56/tests/lock.c 2015-05-07 19:02:17.000000000 +0000 +++ libdrm-2.4.60/tests/lock.c 2015-05-07 19:02:17.000000000 +0000 @@ -30,6 +30,7 @@ */ #include +#include #include "drmtest.h" enum auth_event { diff -Nru libdrm-2.4.56/tests/Makefile.am libdrm-2.4.60/tests/Makefile.am --- libdrm-2.4.56/tests/Makefile.am 2014-07-26 18:08:30.000000000 +0000 +++ libdrm-2.4.60/tests/Makefile.am 2015-03-18 17:33:36.000000000 +0000 @@ -1,19 +1,7 @@ -NULL:=# - -AM_CPPFLAGS = \ - -I $(top_srcdir)/include/drm \ - -I $(top_srcdir) - -LDADD = $(top_builddir)/libdrm.la - -check_PROGRAMS = \ - dristat \ - drmstat - -SUBDIRS = modeprint +SUBDIRS = modeprint proptest modetest if HAVE_LIBKMS -SUBDIRS += kmstest modetest +SUBDIRS += kmstest endif if HAVE_RADEON @@ -24,6 +12,29 @@ SUBDIRS += exynos endif +if HAVE_TEGRA +SUBDIRS += tegra +endif + +if HAVE_LIBUDEV +SUBDIRS += vbltest +endif + +AM_CFLAGS = \ + $(WARN_CFLAGS)\ + -I $(top_srcdir)/include/drm \ + -I $(top_srcdir) + +LDADD = $(top_builddir)/libdrm.la + +check_PROGRAMS = \ + dristat \ + drmstat + +if HAVE_NOUVEAU +SUBDIRS += nouveau +endif + if HAVE_LIBUDEV check_LTLIBRARIES = libdrmtest.la @@ -32,11 +43,10 @@ drmtest.c \ drmtest.h -libdrmtest_la_LIBADD = \ - $(top_builddir)/libdrm.la \ +LDADD += \ + libdrmtest.la \ $(LIBUDEV_LIBS) -LDADD += libdrmtest.la XFAIL_TESTS = \ auth \ @@ -49,19 +59,7 @@ getstats \ setversion \ updatedraw \ - name_from_fd \ - $(NULL) - -SUBDIRS += vbltest $(NULL) - -if HAVE_INTEL -TESTS += \ - gem_basic \ - gem_flink \ - gem_readwrite \ - gem_mmap \ - $(NULL) -endif + name_from_fd check_PROGRAMS += $(TESTS) diff -Nru libdrm-2.4.56/tests/Makefile.in libdrm-2.4.60/tests/Makefile.in --- libdrm-2.4.56/tests/Makefile.in 2014-07-29 16:13:53.000000000 +0000 +++ libdrm-2.4.60/tests/Makefile.in 2015-03-19 14:37:47.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.14.1 from Makefile.am. +# Makefile.in generated by automake 1.13.4 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. @@ -77,25 +77,22 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -check_PROGRAMS = dristat$(EXEEXT) drmstat$(EXEEXT) $(am__EXEEXT_4) -@HAVE_LIBKMS_TRUE@am__append_1 = kmstest modetest +@HAVE_LIBKMS_TRUE@am__append_1 = kmstest @HAVE_RADEON_TRUE@am__append_2 = radeon @HAVE_EXYNOS_TRUE@am__append_3 = exynos -@HAVE_LIBUDEV_TRUE@am__append_4 = libdrmtest.la +@HAVE_TEGRA_TRUE@am__append_4 = tegra +@HAVE_LIBUDEV_TRUE@am__append_5 = vbltest +check_PROGRAMS = dristat$(EXEEXT) drmstat$(EXEEXT) $(am__EXEEXT_2) +@HAVE_NOUVEAU_TRUE@am__append_6 = nouveau +@HAVE_LIBUDEV_TRUE@am__append_7 = \ +@HAVE_LIBUDEV_TRUE@ libdrmtest.la \ +@HAVE_LIBUDEV_TRUE@ $(LIBUDEV_LIBS) + @HAVE_LIBUDEV_TRUE@TESTS = openclose$(EXEEXT) getversion$(EXEEXT) \ @HAVE_LIBUDEV_TRUE@ getclient$(EXEEXT) getstats$(EXEEXT) \ @HAVE_LIBUDEV_TRUE@ setversion$(EXEEXT) updatedraw$(EXEEXT) \ -@HAVE_LIBUDEV_TRUE@ name_from_fd$(EXEEXT) $(am__EXEEXT_1) \ -@HAVE_LIBUDEV_TRUE@ $(am__EXEEXT_2) -@HAVE_LIBUDEV_TRUE@am__append_5 = vbltest $(NULL) -@HAVE_INTEL_TRUE@@HAVE_LIBUDEV_TRUE@am__append_6 = \ -@HAVE_INTEL_TRUE@@HAVE_LIBUDEV_TRUE@ gem_basic \ -@HAVE_INTEL_TRUE@@HAVE_LIBUDEV_TRUE@ gem_flink \ -@HAVE_INTEL_TRUE@@HAVE_LIBUDEV_TRUE@ gem_readwrite \ -@HAVE_INTEL_TRUE@@HAVE_LIBUDEV_TRUE@ gem_mmap \ -@HAVE_INTEL_TRUE@@HAVE_LIBUDEV_TRUE@ $(NULL) - -@HAVE_LIBUDEV_TRUE@am__append_7 = $(TESTS) +@HAVE_LIBUDEV_TRUE@ name_from_fd$(EXEEXT) +@HAVE_LIBUDEV_TRUE@am__append_8 = $(TESTS) subdir = tests DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/build-aux/depcomp \ @@ -111,10 +108,7 @@ CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = -am__DEPENDENCIES_1 = -@HAVE_LIBUDEV_TRUE@libdrmtest_la_DEPENDENCIES = \ -@HAVE_LIBUDEV_TRUE@ $(top_builddir)/libdrm.la \ -@HAVE_LIBUDEV_TRUE@ $(am__DEPENDENCIES_1) +libdrmtest_la_LIBADD = am__libdrmtest_la_SOURCES_DIST = drmtest.c drmtest.h @HAVE_LIBUDEV_TRUE@am_libdrmtest_la_OBJECTS = drmtest.lo libdrmtest_la_OBJECTS = $(am_libdrmtest_la_OBJECTS) @@ -123,70 +117,57 @@ am__v_lt_0 = --silent am__v_lt_1 = @HAVE_LIBUDEV_TRUE@am_libdrmtest_la_rpath = -am__EXEEXT_1 = -@HAVE_INTEL_TRUE@@HAVE_LIBUDEV_TRUE@am__EXEEXT_2 = gem_basic$(EXEEXT) \ -@HAVE_INTEL_TRUE@@HAVE_LIBUDEV_TRUE@ gem_flink$(EXEEXT) \ -@HAVE_INTEL_TRUE@@HAVE_LIBUDEV_TRUE@ gem_readwrite$(EXEEXT) \ -@HAVE_INTEL_TRUE@@HAVE_LIBUDEV_TRUE@ gem_mmap$(EXEEXT) \ -@HAVE_INTEL_TRUE@@HAVE_LIBUDEV_TRUE@ $(am__EXEEXT_1) -@HAVE_LIBUDEV_TRUE@am__EXEEXT_3 = openclose$(EXEEXT) \ +@HAVE_LIBUDEV_TRUE@am__EXEEXT_1 = openclose$(EXEEXT) \ @HAVE_LIBUDEV_TRUE@ getversion$(EXEEXT) getclient$(EXEEXT) \ @HAVE_LIBUDEV_TRUE@ getstats$(EXEEXT) setversion$(EXEEXT) \ -@HAVE_LIBUDEV_TRUE@ updatedraw$(EXEEXT) name_from_fd$(EXEEXT) \ -@HAVE_LIBUDEV_TRUE@ $(am__EXEEXT_1) $(am__EXEEXT_2) -@HAVE_LIBUDEV_TRUE@am__EXEEXT_4 = $(am__EXEEXT_3) +@HAVE_LIBUDEV_TRUE@ updatedraw$(EXEEXT) name_from_fd$(EXEEXT) +@HAVE_LIBUDEV_TRUE@am__EXEEXT_2 = $(am__EXEEXT_1) dristat_SOURCES = dristat.c dristat_OBJECTS = dristat.$(OBJEXT) dristat_LDADD = $(LDADD) -dristat_DEPENDENCIES = $(top_builddir)/libdrm.la $(am__append_4) +am__DEPENDENCIES_1 = +@HAVE_LIBUDEV_TRUE@am__DEPENDENCIES_2 = libdrmtest.la \ +@HAVE_LIBUDEV_TRUE@ $(am__DEPENDENCIES_1) +dristat_DEPENDENCIES = $(top_builddir)/libdrm.la $(am__DEPENDENCIES_2) drmstat_SOURCES = drmstat.c drmstat_OBJECTS = drmstat.$(OBJEXT) drmstat_LDADD = $(LDADD) -drmstat_DEPENDENCIES = $(top_builddir)/libdrm.la $(am__append_4) -gem_basic_SOURCES = gem_basic.c -gem_basic_OBJECTS = gem_basic.$(OBJEXT) -gem_basic_LDADD = $(LDADD) -gem_basic_DEPENDENCIES = $(top_builddir)/libdrm.la $(am__append_4) -gem_flink_SOURCES = gem_flink.c -gem_flink_OBJECTS = gem_flink.$(OBJEXT) -gem_flink_LDADD = $(LDADD) -gem_flink_DEPENDENCIES = $(top_builddir)/libdrm.la $(am__append_4) -gem_mmap_SOURCES = gem_mmap.c -gem_mmap_OBJECTS = gem_mmap.$(OBJEXT) -gem_mmap_LDADD = $(LDADD) -gem_mmap_DEPENDENCIES = $(top_builddir)/libdrm.la $(am__append_4) -gem_readwrite_SOURCES = gem_readwrite.c -gem_readwrite_OBJECTS = gem_readwrite.$(OBJEXT) -gem_readwrite_LDADD = $(LDADD) -gem_readwrite_DEPENDENCIES = $(top_builddir)/libdrm.la $(am__append_4) +drmstat_DEPENDENCIES = $(top_builddir)/libdrm.la $(am__DEPENDENCIES_2) getclient_SOURCES = getclient.c getclient_OBJECTS = getclient.$(OBJEXT) getclient_LDADD = $(LDADD) -getclient_DEPENDENCIES = $(top_builddir)/libdrm.la $(am__append_4) +getclient_DEPENDENCIES = $(top_builddir)/libdrm.la \ + $(am__DEPENDENCIES_2) getstats_SOURCES = getstats.c getstats_OBJECTS = getstats.$(OBJEXT) getstats_LDADD = $(LDADD) -getstats_DEPENDENCIES = $(top_builddir)/libdrm.la $(am__append_4) +getstats_DEPENDENCIES = $(top_builddir)/libdrm.la \ + $(am__DEPENDENCIES_2) getversion_SOURCES = getversion.c getversion_OBJECTS = getversion.$(OBJEXT) getversion_LDADD = $(LDADD) -getversion_DEPENDENCIES = $(top_builddir)/libdrm.la $(am__append_4) +getversion_DEPENDENCIES = $(top_builddir)/libdrm.la \ + $(am__DEPENDENCIES_2) name_from_fd_SOURCES = name_from_fd.c name_from_fd_OBJECTS = name_from_fd.$(OBJEXT) name_from_fd_LDADD = $(LDADD) -name_from_fd_DEPENDENCIES = $(top_builddir)/libdrm.la $(am__append_4) +name_from_fd_DEPENDENCIES = $(top_builddir)/libdrm.la \ + $(am__DEPENDENCIES_2) openclose_SOURCES = openclose.c openclose_OBJECTS = openclose.$(OBJEXT) openclose_LDADD = $(LDADD) -openclose_DEPENDENCIES = $(top_builddir)/libdrm.la $(am__append_4) +openclose_DEPENDENCIES = $(top_builddir)/libdrm.la \ + $(am__DEPENDENCIES_2) setversion_SOURCES = setversion.c setversion_OBJECTS = setversion.$(OBJEXT) setversion_LDADD = $(LDADD) -setversion_DEPENDENCIES = $(top_builddir)/libdrm.la $(am__append_4) +setversion_DEPENDENCIES = $(top_builddir)/libdrm.la \ + $(am__DEPENDENCIES_2) updatedraw_SOURCES = updatedraw.c updatedraw_OBJECTS = updatedraw.$(OBJEXT) updatedraw_LDADD = $(LDADD) -updatedraw_DEPENDENCIES = $(top_builddir)/libdrm.la $(am__append_4) +updatedraw_DEPENDENCIES = $(top_builddir)/libdrm.la \ + $(am__DEPENDENCIES_2) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false @@ -221,14 +202,12 @@ am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = -SOURCES = $(libdrmtest_la_SOURCES) dristat.c drmstat.c gem_basic.c \ - gem_flink.c gem_mmap.c gem_readwrite.c getclient.c getstats.c \ - getversion.c name_from_fd.c openclose.c setversion.c \ - updatedraw.c -DIST_SOURCES = $(am__libdrmtest_la_SOURCES_DIST) dristat.c drmstat.c \ - gem_basic.c gem_flink.c gem_mmap.c gem_readwrite.c getclient.c \ +SOURCES = $(libdrmtest_la_SOURCES) dristat.c drmstat.c getclient.c \ getstats.c getversion.c name_from_fd.c openclose.c \ setversion.c updatedraw.c +DIST_SOURCES = $(am__libdrmtest_la_SOURCES_DIST) dristat.c drmstat.c \ + getclient.c getstats.c getversion.c name_from_fd.c openclose.c \ + setversion.c updatedraw.c RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ @@ -472,7 +451,8 @@ TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/build-aux/test-driver TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ $(TEST_LOG_FLAGS) -DIST_SUBDIRS = modeprint kmstest modetest radeon exynos vbltest +DIST_SUBDIRS = modeprint proptest modetest kmstest radeon exynos tegra \ + vbltest nouveau DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ @@ -544,7 +524,6 @@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MANPAGES_STYLESHEET = @MANPAGES_STYLESHEET@ @@ -578,6 +557,7 @@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ VALGRIND_LIBS = @VALGRIND_LIBS@ VERSION = @VERSION@ +VISIBILITY_CFLAGS = @VISIBILITY_CFLAGS@ WARN_CFLAGS = @WARN_CFLAGS@ XSLTPROC = @XSLTPROC@ abs_builddir = @abs_builddir@ @@ -634,23 +614,20 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -NULL := # -AM_CPPFLAGS = \ +SUBDIRS = modeprint proptest modetest $(am__append_1) $(am__append_2) \ + $(am__append_3) $(am__append_4) $(am__append_5) \ + $(am__append_6) +AM_CFLAGS = \ + $(WARN_CFLAGS)\ -I $(top_srcdir)/include/drm \ -I $(top_srcdir) -LDADD = $(top_builddir)/libdrm.la $(am__append_4) -SUBDIRS = modeprint $(am__append_1) $(am__append_2) $(am__append_3) \ - $(am__append_5) +LDADD = $(top_builddir)/libdrm.la $(am__append_7) @HAVE_LIBUDEV_TRUE@check_LTLIBRARIES = libdrmtest.la @HAVE_LIBUDEV_TRUE@libdrmtest_la_SOURCES = \ @HAVE_LIBUDEV_TRUE@ drmtest.c \ @HAVE_LIBUDEV_TRUE@ drmtest.h -@HAVE_LIBUDEV_TRUE@libdrmtest_la_LIBADD = \ -@HAVE_LIBUDEV_TRUE@ $(top_builddir)/libdrm.la \ -@HAVE_LIBUDEV_TRUE@ $(LIBUDEV_LIBS) - @HAVE_LIBUDEV_TRUE@XFAIL_TESTS = \ @HAVE_LIBUDEV_TRUE@ auth \ @HAVE_LIBUDEV_TRUE@ lock @@ -659,7 +636,7 @@ .SUFFIXES: .SUFFIXES: .c .lo .log .o .obj .test .test$(EXEEXT) .trs -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -684,9 +661,9 @@ $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): @@ -721,22 +698,6 @@ @rm -f drmstat$(EXEEXT) $(AM_V_CCLD)$(LINK) $(drmstat_OBJECTS) $(drmstat_LDADD) $(LIBS) -gem_basic$(EXEEXT): $(gem_basic_OBJECTS) $(gem_basic_DEPENDENCIES) $(EXTRA_gem_basic_DEPENDENCIES) - @rm -f gem_basic$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(gem_basic_OBJECTS) $(gem_basic_LDADD) $(LIBS) - -gem_flink$(EXEEXT): $(gem_flink_OBJECTS) $(gem_flink_DEPENDENCIES) $(EXTRA_gem_flink_DEPENDENCIES) - @rm -f gem_flink$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(gem_flink_OBJECTS) $(gem_flink_LDADD) $(LIBS) - -gem_mmap$(EXEEXT): $(gem_mmap_OBJECTS) $(gem_mmap_DEPENDENCIES) $(EXTRA_gem_mmap_DEPENDENCIES) - @rm -f gem_mmap$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(gem_mmap_OBJECTS) $(gem_mmap_LDADD) $(LIBS) - -gem_readwrite$(EXEEXT): $(gem_readwrite_OBJECTS) $(gem_readwrite_DEPENDENCIES) $(EXTRA_gem_readwrite_DEPENDENCIES) - @rm -f gem_readwrite$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(gem_readwrite_OBJECTS) $(gem_readwrite_LDADD) $(LIBS) - getclient$(EXEEXT): $(getclient_OBJECTS) $(getclient_DEPENDENCIES) $(EXTRA_getclient_DEPENDENCIES) @rm -f getclient$(EXEEXT) $(AM_V_CCLD)$(LINK) $(getclient_OBJECTS) $(getclient_LDADD) $(LIBS) @@ -774,10 +735,6 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dristat.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/drmstat.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/drmtest.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_basic.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_flink.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_mmap.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gem_readwrite.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getclient.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getstats.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getversion.Po@am__quote@ @@ -791,14 +748,14 @@ @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @@ -1101,34 +1058,6 @@ $(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) -gem_basic.log: gem_basic$(EXEEXT) - @p='gem_basic$(EXEEXT)'; \ - b='gem_basic'; \ - $(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) -gem_flink.log: gem_flink$(EXEEXT) - @p='gem_flink$(EXEEXT)'; \ - b='gem_flink'; \ - $(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) -gem_readwrite.log: gem_readwrite$(EXEEXT) - @p='gem_readwrite$(EXEEXT)'; \ - b='gem_readwrite'; \ - $(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) -gem_mmap.log: gem_mmap$(EXEEXT) - @p='gem_mmap$(EXEEXT)'; \ - b='gem_mmap'; \ - $(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) .test.log: @p='$<'; \ diff -Nru libdrm-2.4.56/tests/modeprint/Makefile.am libdrm-2.4.60/tests/modeprint/Makefile.am --- libdrm-2.4.56/tests/modeprint/Makefile.am 2013-08-12 18:01:39.000000000 +0000 +++ libdrm-2.4.60/tests/modeprint/Makefile.am 2015-02-28 18:34:25.000000000 +0000 @@ -1,4 +1,5 @@ AM_CFLAGS = \ + $(WARN_CFLAGS)\ -I$(top_srcdir)/include/drm \ -I$(top_srcdir) diff -Nru libdrm-2.4.56/tests/modeprint/Makefile.in libdrm-2.4.60/tests/modeprint/Makefile.in --- libdrm-2.4.56/tests/modeprint/Makefile.in 2014-07-29 16:13:53.000000000 +0000 +++ libdrm-2.4.60/tests/modeprint/Makefile.in 2015-03-19 14:37:47.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.14.1 from Makefile.am. +# Makefile.in generated by automake 1.13.4 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. @@ -209,7 +209,6 @@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MANPAGES_STYLESHEET = @MANPAGES_STYLESHEET@ @@ -243,6 +242,7 @@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ VALGRIND_LIBS = @VALGRIND_LIBS@ VERSION = @VERSION@ +VISIBILITY_CFLAGS = @VISIBILITY_CFLAGS@ WARN_CFLAGS = @WARN_CFLAGS@ XSLTPROC = @XSLTPROC@ abs_builddir = @abs_builddir@ @@ -300,6 +300,7 @@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CFLAGS = \ + $(WARN_CFLAGS)\ -I$(top_srcdir)/include/drm \ -I$(top_srcdir) @@ -313,7 +314,7 @@ .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -338,9 +339,9 @@ $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @@ -419,14 +420,14 @@ @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< diff -Nru libdrm-2.4.56/tests/modeprint/modeprint.c libdrm-2.4.60/tests/modeprint/modeprint.c --- libdrm-2.4.56/tests/modeprint/modeprint.c 2014-02-07 16:58:41.000000000 +0000 +++ libdrm-2.4.60/tests/modeprint/modeprint.c 2015-03-18 17:33:36.000000000 +0000 @@ -53,7 +53,7 @@ int fbs; char *module_name; -const char* getConnectionText(drmModeConnection conn) +static const char* getConnectionText(drmModeConnection conn) { switch (conn) { case DRM_MODE_CONNECTED: @@ -66,7 +66,7 @@ } -int printMode(struct drm_mode_modeinfo *mode) +static int printMode(struct drm_mode_modeinfo *mode) { if (full_modes) { printf("Mode: %s\n", mode->name); @@ -90,7 +90,7 @@ return 0; } -int printProperty(int fd, drmModeResPtr res, drmModePropertyPtr props, uint64_t value) +static int printProperty(int fd, drmModeResPtr res, drmModePropertyPtr props, uint64_t value) { const char *name = NULL; int j; @@ -161,7 +161,7 @@ "DSI", }; -int printConnector(int fd, drmModeResPtr res, drmModeConnectorPtr connector, uint32_t id) +static int printConnector(int fd, drmModeResPtr res, drmModeConnectorPtr connector, uint32_t id) { int i = 0; struct drm_mode_modeinfo *mode = NULL; @@ -214,7 +214,7 @@ return 0; } -int printEncoder(int fd, drmModeResPtr res, drmModeEncoderPtr encoder, uint32_t id) +static int printEncoder(int fd, drmModeResPtr res, drmModeEncoderPtr encoder, uint32_t id) { printf("Encoder\n"); printf("\tid :%i\n", id); @@ -225,7 +225,7 @@ return 0; } -int printCrtc(int fd, drmModeResPtr res, drmModeCrtcPtr crtc, uint32_t id) +static int printCrtc(int fd, drmModeResPtr res, drmModeCrtcPtr crtc, uint32_t id) { printf("Crtc\n"); printf("\tid : %i\n", id); @@ -239,7 +239,7 @@ return 0; } -int printFrameBuffer(int fd, drmModeResPtr res, drmModeFBPtr fb) +static int printFrameBuffer(int fd, drmModeResPtr res, drmModeFBPtr fb) { printf("Framebuffer\n"); printf("\thandle : %i\n", fb->handle); @@ -253,7 +253,7 @@ return 0; } -int printRes(int fd, drmModeResPtr res) +static int printRes(int fd, drmModeResPtr res) { int i; drmModeFBPtr fb; @@ -329,7 +329,7 @@ return 0; } -void args(int argc, char **argv) +static void args(int argc, char **argv) { int i; diff -Nru libdrm-2.4.56/tests/modetest/Android.mk libdrm-2.4.60/tests/modetest/Android.mk --- libdrm-2.4.56/tests/modetest/Android.mk 1970-01-01 00:00:00.000000000 +0000 +++ libdrm-2.4.60/tests/modetest/Android.mk 2015-02-28 18:34:25.000000000 +0000 @@ -0,0 +1,14 @@ +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) +include $(LOCAL_PATH)/Makefile.sources + +LOCAL_SRC_FILES := $(MODETEST_FILES) + +LOCAL_MODULE := modetest + +LOCAL_C_INCLUDES += $(TARGET_OUT_HEADERS)/libdrm + +LOCAL_SHARED_LIBRARIES := libdrm + +include $(BUILD_EXECUTABLE) diff -Nru libdrm-2.4.56/tests/modetest/buffers.c libdrm-2.4.60/tests/modetest/buffers.c --- libdrm-2.4.56/tests/modetest/buffers.c 2013-09-17 13:02:43.000000000 +0000 +++ libdrm-2.4.60/tests/modetest/buffers.c 2015-02-28 18:34:25.000000000 +0000 @@ -24,7 +24,9 @@ * IN THE SOFTWARE. */ +#ifdef HAVE_CONFIG_H #include "config.h" +#endif #include #include @@ -32,9 +34,13 @@ #include #include #include +#include +#include "drm.h" #include "drm_fourcc.h" -#include "libkms.h" + +#include "libdrm.h" +#include "xf86drm.h" #include "buffers.h" @@ -45,6 +51,16 @@ #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0])) +struct bo +{ + int fd; + void *ptr; + size_t size; + size_t offset; + size_t pitch; + unsigned handle; +}; + /* ----------------------------------------------------------------------------- * Formats */ @@ -852,10 +868,11 @@ div_t d = div(x+y, width); uint32_t rgb32 = 0x00130502 * (d.quot >> 6) + 0x000a1120 * (d.rem >> 6); + uint32_t alpha = ((y < height/2) && (x < width/2)) ? 127 : 255; uint32_t color = MAKE_RGBA(rgb, (rgb32 >> 16) & 0xff, (rgb32 >> 8) & 0xff, rgb32 & 0xff, - 255); + alpha); ((uint32_t *)mem)[x] = color; } @@ -998,48 +1015,82 @@ * Buffers management */ -static struct kms_bo * -allocate_buffer(struct kms_driver *kms, unsigned int width, unsigned int height, - unsigned int *stride) -{ - struct kms_bo *bo; - unsigned bo_attribs[] = { - KMS_WIDTH, 0, - KMS_HEIGHT, 0, - KMS_BO_TYPE, KMS_BO_TYPE_SCANOUT_X8R8G8B8, - KMS_TERMINATE_PROP_LIST - }; +static struct bo * +bo_create_dumb(int fd, unsigned int width, unsigned int height, unsigned int bpp) +{ + struct drm_mode_create_dumb arg; + struct bo *bo; int ret; - bo_attribs[1] = width; - bo_attribs[3] = height; - - ret = kms_bo_create(kms, bo_attribs, &bo); - if (ret) { - fprintf(stderr, "failed to alloc buffer: %s\n", - strerror(-ret)); + bo = malloc(sizeof(*bo)); + if (bo == NULL) { + fprintf(stderr, "failed to allocate buffer object\n"); return NULL; } - ret = kms_bo_get_prop(bo, KMS_PITCH, stride); + memset(&arg, 0, sizeof(arg)); + arg.bpp = bpp; + arg.width = width; + arg.height = height; + + ret = drmIoctl(fd, DRM_IOCTL_MODE_CREATE_DUMB, &arg); if (ret) { - fprintf(stderr, "failed to retreive buffer stride: %s\n", - strerror(-ret)); - kms_bo_destroy(&bo); + fprintf(stderr, "failed to create dumb buffer: %s\n", + strerror(errno)); + free(bo); return NULL; } + bo->fd = fd; + bo->handle = arg.handle; + bo->size = arg.size; + bo->pitch = arg.pitch; + return bo; } -struct kms_bo * -create_test_buffer(struct kms_driver *kms, unsigned int format, - unsigned int width, unsigned int height, - unsigned int handles[4], unsigned int pitches[4], - unsigned int offsets[4], enum fill_pattern pattern) +static int bo_map(struct bo *bo, void **out) +{ + struct drm_mode_map_dumb arg; + void *map; + int ret; + + memset(&arg, 0, sizeof(arg)); + arg.handle = bo->handle; + + ret = drmIoctl(bo->fd, DRM_IOCTL_MODE_MAP_DUMB, &arg); + if (ret) + return ret; + + map = drm_mmap(0, bo->size, PROT_READ | PROT_WRITE, MAP_SHARED, + bo->fd, arg.offset); + if (map == MAP_FAILED) + return -EINVAL; + + bo->ptr = map; + *out = map; + + return 0; +} + +static void bo_unmap(struct bo *bo) +{ + if (!bo->ptr) + return; + + drm_munmap(bo->ptr, bo->size); + bo->ptr = NULL; +} + +struct bo * +bo_create(int fd, unsigned int format, + unsigned int width, unsigned int height, + unsigned int handles[4], unsigned int pitches[4], + unsigned int offsets[4], enum fill_pattern pattern) { unsigned int virtual_height; - struct kms_bo *bo; + struct bo *bo; + unsigned int bpp; void *planes[3] = { 0, }; void *virtual; int ret; @@ -1047,6 +1098,70 @@ switch (format) { case DRM_FORMAT_NV12: case DRM_FORMAT_NV21: + case DRM_FORMAT_NV16: + case DRM_FORMAT_NV61: + case DRM_FORMAT_YUV420: + case DRM_FORMAT_YVU420: + bpp = 8; + break; + + case DRM_FORMAT_ARGB4444: + case DRM_FORMAT_XRGB4444: + case DRM_FORMAT_ABGR4444: + case DRM_FORMAT_XBGR4444: + case DRM_FORMAT_RGBA4444: + case DRM_FORMAT_RGBX4444: + case DRM_FORMAT_BGRA4444: + case DRM_FORMAT_BGRX4444: + case DRM_FORMAT_ARGB1555: + case DRM_FORMAT_XRGB1555: + case DRM_FORMAT_ABGR1555: + case DRM_FORMAT_XBGR1555: + case DRM_FORMAT_RGBA5551: + case DRM_FORMAT_RGBX5551: + case DRM_FORMAT_BGRA5551: + case DRM_FORMAT_BGRX5551: + case DRM_FORMAT_RGB565: + case DRM_FORMAT_BGR565: + case DRM_FORMAT_UYVY: + case DRM_FORMAT_VYUY: + case DRM_FORMAT_YUYV: + case DRM_FORMAT_YVYU: + bpp = 16; + break; + + case DRM_FORMAT_BGR888: + case DRM_FORMAT_RGB888: + bpp = 24; + break; + + case DRM_FORMAT_ARGB8888: + case DRM_FORMAT_XRGB8888: + case DRM_FORMAT_ABGR8888: + case DRM_FORMAT_XBGR8888: + case DRM_FORMAT_RGBA8888: + case DRM_FORMAT_RGBX8888: + case DRM_FORMAT_BGRA8888: + case DRM_FORMAT_BGRX8888: + case DRM_FORMAT_ARGB2101010: + case DRM_FORMAT_XRGB2101010: + case DRM_FORMAT_ABGR2101010: + case DRM_FORMAT_XBGR2101010: + case DRM_FORMAT_RGBA1010102: + case DRM_FORMAT_RGBX1010102: + case DRM_FORMAT_BGRA1010102: + case DRM_FORMAT_BGRX1010102: + bpp = 32; + break; + + default: + fprintf(stderr, "unsupported format 0x%08x\n", format); + return NULL; + } + + switch (format) { + case DRM_FORMAT_NV12: + case DRM_FORMAT_NV21: virtual_height = height * 3 / 2; break; @@ -1060,15 +1175,15 @@ break; } - bo = allocate_buffer(kms, width, virtual_height, &pitches[0]); + bo = bo_create_dumb(fd, width, virtual_height, bpp); if (!bo) return NULL; - ret = kms_bo_map(bo, &virtual); + ret = bo_map(bo, &virtual); if (ret) { fprintf(stderr, "failed to map buffer: %s\n", - strerror(-ret)); - kms_bo_destroy(&bo); + strerror(-errno)); + bo_destroy(bo); return NULL; } @@ -1081,8 +1196,8 @@ case DRM_FORMAT_YUYV: case DRM_FORMAT_YVYU: offsets[0] = 0; - kms_bo_get_prop(bo, KMS_HANDLE, &handles[0]); - kms_bo_get_prop(bo, KMS_PITCH, &pitches[0]); + handles[0] = bo->handle; + pitches[0] = bo->pitch; planes[0] = virtual; break; @@ -1092,11 +1207,11 @@ case DRM_FORMAT_NV16: case DRM_FORMAT_NV61: offsets[0] = 0; - kms_bo_get_prop(bo, KMS_HANDLE, &handles[0]); - kms_bo_get_prop(bo, KMS_PITCH, &pitches[0]); + handles[0] = bo->handle; + pitches[0] = bo->pitch; pitches[1] = pitches[0]; offsets[1] = pitches[0] * height; - kms_bo_get_prop(bo, KMS_HANDLE, &handles[1]); + handles[1] = bo->handle; planes[0] = virtual; planes[1] = virtual + offsets[1]; @@ -1105,14 +1220,14 @@ case DRM_FORMAT_YUV420: case DRM_FORMAT_YVU420: offsets[0] = 0; - kms_bo_get_prop(bo, KMS_HANDLE, &handles[0]); - kms_bo_get_prop(bo, KMS_PITCH, &pitches[0]); + handles[0] = bo->handle; + pitches[0] = bo->pitch; pitches[1] = pitches[0] / 2; offsets[1] = pitches[0] * height; - kms_bo_get_prop(bo, KMS_HANDLE, &handles[1]); + handles[1] = bo->handle; pitches[2] = pitches[1]; offsets[2] = offsets[1] + pitches[1] * height / 2; - kms_bo_get_prop(bo, KMS_HANDLE, &handles[2]); + handles[2] = bo->handle; planes[0] = virtual; planes[1] = virtual + offsets[1]; @@ -1156,15 +1271,31 @@ case DRM_FORMAT_BGRA1010102: case DRM_FORMAT_BGRX1010102: offsets[0] = 0; - kms_bo_get_prop(bo, KMS_HANDLE, &handles[0]); - kms_bo_get_prop(bo, KMS_PITCH, &pitches[0]); + handles[0] = bo->handle; + pitches[0] = bo->pitch; planes[0] = virtual; break; } fill_pattern(format, pattern, planes, width, height, pitches[0]); - kms_bo_unmap(bo); + bo_unmap(bo); return bo; } + +void bo_destroy(struct bo *bo) +{ + struct drm_mode_destroy_dumb arg; + int ret; + + memset(&arg, 0, sizeof(arg)); + arg.handle = bo->handle; + + ret = drmIoctl(bo->fd, DRM_IOCTL_MODE_DESTROY_DUMB, &arg); + if (ret) + fprintf(stderr, "failed to destroy dumb buffer: %s\n", + strerror(errno)); + + free(bo); +} diff -Nru libdrm-2.4.56/tests/modetest/buffers.h libdrm-2.4.60/tests/modetest/buffers.h --- libdrm-2.4.56/tests/modetest/buffers.h 2013-09-17 13:02:43.000000000 +0000 +++ libdrm-2.4.60/tests/modetest/buffers.h 2015-02-28 18:34:25.000000000 +0000 @@ -27,8 +27,7 @@ #ifndef __BUFFERS_H__ #define __BUFFERS_H__ -struct kms_bo; -struct kms_driver; +struct bo; enum fill_pattern { PATTERN_TILES = 0, @@ -36,10 +35,11 @@ PATTERN_SMPTE = 2, }; -struct kms_bo *create_test_buffer(struct kms_driver *kms, unsigned int format, +struct bo *bo_create(int fd, unsigned int format, unsigned int width, unsigned int height, unsigned int handles[4], unsigned int pitches[4], unsigned int offsets[4], enum fill_pattern pattern); +void bo_destroy(struct bo *bo); unsigned int format_fourcc(const char *name); diff -Nru libdrm-2.4.56/tests/modetest/cursor.c libdrm-2.4.60/tests/modetest/cursor.c --- libdrm-2.4.56/tests/modetest/cursor.c 2014-05-30 16:38:28.000000000 +0000 +++ libdrm-2.4.60/tests/modetest/cursor.c 2015-02-28 18:34:25.000000000 +0000 @@ -22,7 +22,9 @@ * IN THE SOFTWARE. */ +#ifdef HAVE_CONFIG_H #include "config.h" +#endif #include #include @@ -32,6 +34,8 @@ #include #include #include +#include +#include #include "xf86drm.h" #include "xf86drmMode.h" @@ -57,6 +61,9 @@ static struct cursor cursors[MAX_CURSORS]; static int ncursors; +static pthread_t cursor_thread; +static int cursor_running; + /* * Timer driven program loops through these steps to move/enable/disable * the cursor @@ -135,33 +142,29 @@ { set_cursor, 10, 0, 0 }, /* disable */ }; -/* - * Cursor API: - */ - -static void run_step(int sig) +static void *cursor_thread_func(void *data) { - struct cursor_step *step = &steps[indx % ARRAY_SIZE(steps)]; - struct itimerval itimer = { - .it_value.tv_usec = 1000 * step->msec, - }; - int i; - - for (i = 0; i < ncursors; i++) { - struct cursor *cursor = &cursors[i]; - step->run(cursor, step); - } + while (cursor_running) { + struct cursor_step *step = &steps[indx % ARRAY_SIZE(steps)]; + int i; + + for (i = 0; i < ncursors; i++) { + struct cursor *cursor = &cursors[i]; + step->run(cursor, step); + } + + /* iterate to next count/step: */ + if (count < step->repeat) { + count++; + } else { + count = 0; + indx++; + } - /* iterate to next count/step: */ - if (count < step->repeat) { - count++; - } else { - count = 0; - indx++; + usleep(1000 * step->msec); } - /* and lastly, setup timer for next step */ - setitimer(ITIMER_REAL, &itimer, NULL); + return NULL; } int cursor_init(int fd, uint32_t bo_handle, uint32_t crtc_id, @@ -192,16 +195,16 @@ int cursor_start(void) { - /* setup signal handler to update cursor: */ - signal(SIGALRM, run_step); + cursor_running = 1; + pthread_create(&cursor_thread, NULL, cursor_thread_func, NULL); printf("starting cursor\n"); - run_step(SIGALRM); return 0; } int cursor_stop(void) { - signal(SIGALRM, NULL); + cursor_running = 0; + pthread_join(cursor_thread, NULL); printf("cursor stopped\n"); return 0; } diff -Nru libdrm-2.4.56/tests/modetest/Makefile.am libdrm-2.4.60/tests/modetest/Makefile.am --- libdrm-2.4.56/tests/modetest/Makefile.am 2014-05-30 16:38:28.000000000 +0000 +++ libdrm-2.4.60/tests/modetest/Makefile.am 2015-02-28 18:34:25.000000000 +0000 @@ -1,8 +1,9 @@ +include Makefile.sources + AM_CFLAGS = $(filter-out -Wpointer-arith, $(WARN_CFLAGS)) AM_CFLAGS += \ -I$(top_srcdir)/include/drm \ - -I$(top_srcdir)/libkms/ \ -I$(top_srcdir) if HAVE_INSTALL_TESTS @@ -13,16 +14,15 @@ modetest endif -modetest_SOURCES = \ - buffers.c buffers.h \ - cursor.c cursor.h \ - modetest.c +modetest_SOURCES = $(MODETEST_FILES) modetest_LDADD = \ $(top_builddir)/libdrm.la \ - $(top_builddir)/libkms/libkms.la + -lpthread if HAVE_CAIRO AM_CFLAGS += $(CAIRO_CFLAGS) modetest_LDADD += $(CAIRO_LIBS) endif + +EXTRA_DIST = Android.mk diff -Nru libdrm-2.4.56/tests/modetest/Makefile.in libdrm-2.4.60/tests/modetest/Makefile.in --- libdrm-2.4.56/tests/modetest/Makefile.in 2014-07-29 16:13:53.000000000 +0000 +++ libdrm-2.4.60/tests/modetest/Makefile.in 2015-03-19 14:37:47.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.14.1 from Makefile.am. +# Makefile.in generated by automake 1.13.4 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. @@ -78,13 +78,13 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ +DIST_COMMON = $(srcdir)/Makefile.sources $(srcdir)/Makefile.in \ + $(srcdir)/Makefile.am $(top_srcdir)/build-aux/depcomp @HAVE_INSTALL_TESTS_TRUE@bin_PROGRAMS = modetest$(EXEEXT) @HAVE_INSTALL_TESTS_FALSE@noinst_PROGRAMS = modetest$(EXEEXT) @HAVE_CAIRO_TRUE@am__append_1 = $(CAIRO_CFLAGS) @HAVE_CAIRO_TRUE@am__append_2 = $(CAIRO_LIBS) subdir = tests/modetest -DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ - $(top_srcdir)/build-aux/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ @@ -98,13 +98,13 @@ CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS) -am_modetest_OBJECTS = buffers.$(OBJEXT) cursor.$(OBJEXT) \ - modetest.$(OBJEXT) +am__objects_1 = buffers.$(OBJEXT) cursor.$(OBJEXT) modetest.$(OBJEXT) +am_modetest_OBJECTS = $(am__objects_1) modetest_OBJECTS = $(am_modetest_OBJECTS) am__DEPENDENCIES_1 = @HAVE_CAIRO_TRUE@am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) modetest_DEPENDENCIES = $(top_builddir)/libdrm.la \ - $(top_builddir)/libkms/libkms.la $(am__DEPENDENCIES_2) + $(am__DEPENDENCIES_2) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent @@ -215,7 +215,6 @@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MANPAGES_STYLESHEET = @MANPAGES_STYLESHEET@ @@ -249,6 +248,7 @@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ VALGRIND_LIBS = @VALGRIND_LIBS@ VERSION = @VERSION@ +VISIBILITY_CFLAGS = @VISIBILITY_CFLAGS@ WARN_CFLAGS = @WARN_CFLAGS@ XSLTPROC = @XSLTPROC@ abs_builddir = @abs_builddir@ @@ -305,21 +305,23 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -AM_CFLAGS = $(filter-out -Wpointer-arith, $(WARN_CFLAGS)) \ - -I$(top_srcdir)/include/drm -I$(top_srcdir)/libkms/ \ - -I$(top_srcdir) $(am__append_1) -modetest_SOURCES = \ - buffers.c buffers.h \ - cursor.c cursor.h \ +MODETEST_FILES := \ + buffers.c \ + buffers.h \ + cursor.c \ + cursor.h \ modetest.c -modetest_LDADD = $(top_builddir)/libdrm.la \ - $(top_builddir)/libkms/libkms.la $(am__append_2) +AM_CFLAGS = $(filter-out -Wpointer-arith, $(WARN_CFLAGS)) \ + -I$(top_srcdir)/include/drm -I$(top_srcdir) $(am__append_1) +modetest_SOURCES = $(MODETEST_FILES) +modetest_LDADD = $(top_builddir)/libdrm.la -lpthread $(am__append_2) +EXTRA_DIST = Android.mk all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(srcdir)/Makefile.sources $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -340,13 +342,14 @@ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; +$(srcdir)/Makefile.sources: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @@ -427,14 +430,14 @@ @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< diff -Nru libdrm-2.4.56/tests/modetest/Makefile.sources libdrm-2.4.60/tests/modetest/Makefile.sources --- libdrm-2.4.56/tests/modetest/Makefile.sources 1970-01-01 00:00:00.000000000 +0000 +++ libdrm-2.4.60/tests/modetest/Makefile.sources 2015-02-28 18:34:25.000000000 +0000 @@ -0,0 +1,6 @@ +MODETEST_FILES := \ + buffers.c \ + buffers.h \ + cursor.c \ + cursor.h \ + modetest.c diff -Nru libdrm-2.4.56/tests/modetest/modetest.c libdrm-2.4.60/tests/modetest/modetest.c --- libdrm-2.4.56/tests/modetest/modetest.c 2014-05-30 16:38:28.000000000 +0000 +++ libdrm-2.4.60/tests/modetest/modetest.c 2015-02-28 18:34:25.000000000 +0000 @@ -37,7 +37,9 @@ * TODO: use cairo to write the mode info on the selected output once * the mode has been programmed, along with possible test patterns. */ +#ifdef HAVE_CONFIG_H #include "config.h" +#endif #include #include @@ -55,7 +57,6 @@ #include "xf86drm.h" #include "xf86drmMode.h" #include "drm_fourcc.h" -#include "libkms.h" #include "buffers.h" #include "cursor.h" @@ -102,18 +103,21 @@ int fd; struct resources *resources; - struct kms_driver *kms; struct { unsigned int width; unsigned int height; unsigned int fb_id; - struct kms_bo *bo; + struct bo *bo; } mode; }; #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0])) +static inline int64_t U642I64(uint64_t val) +{ + return (int64_t)*((int64_t *)&val); +} struct type_name { int type; @@ -262,8 +266,10 @@ drmModePropertyBlobPtr blob; blob = drmModeGetPropertyBlob(dev->fd, blob_id); - if (!blob) + if (!blob) { + printf("\n"); return; + } blob_data = blob->data; @@ -292,32 +298,43 @@ printf("\t\tflags:"); if (prop->flags & DRM_MODE_PROP_PENDING) printf(" pending"); - if (prop->flags & DRM_MODE_PROP_RANGE) - printf(" range"); if (prop->flags & DRM_MODE_PROP_IMMUTABLE) printf(" immutable"); - if (prop->flags & DRM_MODE_PROP_ENUM) + if (drm_property_type_is(prop, DRM_MODE_PROP_SIGNED_RANGE)) + printf(" signed range"); + if (drm_property_type_is(prop, DRM_MODE_PROP_RANGE)) + printf(" range"); + if (drm_property_type_is(prop, DRM_MODE_PROP_ENUM)) printf(" enum"); - if (prop->flags & DRM_MODE_PROP_BITMASK) + if (drm_property_type_is(prop, DRM_MODE_PROP_BITMASK)) printf(" bitmask"); - if (prop->flags & DRM_MODE_PROP_BLOB) + if (drm_property_type_is(prop, DRM_MODE_PROP_BLOB)) printf(" blob"); + if (drm_property_type_is(prop, DRM_MODE_PROP_OBJECT)) + printf(" object"); printf("\n"); - if (prop->flags & DRM_MODE_PROP_RANGE) { + if (drm_property_type_is(prop, DRM_MODE_PROP_SIGNED_RANGE)) { + printf("\t\tvalues:"); + for (i = 0; i < prop->count_values; i++) + printf(" %"PRId64, U642I64(prop->values[i])); + printf("\n"); + } + + if (drm_property_type_is(prop, DRM_MODE_PROP_RANGE)) { printf("\t\tvalues:"); for (i = 0; i < prop->count_values; i++) printf(" %"PRIu64, prop->values[i]); printf("\n"); } - if (prop->flags & DRM_MODE_PROP_ENUM) { + if (drm_property_type_is(prop, DRM_MODE_PROP_ENUM)) { printf("\t\tenums:"); for (i = 0; i < prop->count_enums; i++) printf(" %s=%llu", prop->enums[i].name, prop->enums[i].value); printf("\n"); - } else if (prop->flags & DRM_MODE_PROP_BITMASK) { + } else if (drm_property_type_is(prop, DRM_MODE_PROP_BITMASK)) { printf("\t\tvalues:"); for (i = 0; i < prop->count_enums; i++) printf(" %s=0x%llx", prop->enums[i].name, @@ -327,7 +344,7 @@ assert(prop->count_enums == 0); } - if (prop->flags & DRM_MODE_PROP_BLOB) { + if (drm_property_type_is(prop, DRM_MODE_PROP_BLOB)) { printf("\t\tblobs:\n"); for (i = 0; i < prop->count_blobs; i++) dump_blob(dev, prop->blob_ids[i]); @@ -337,7 +354,7 @@ } printf("\t\tvalue:"); - if (prop->flags & DRM_MODE_PROP_BLOB) + if (drm_property_type_is(prop, DRM_MODE_PROP_BLOB)) dump_blob(dev, value); else printf(" %"PRIu64"\n", value); @@ -543,6 +560,8 @@ memset(res, 0, sizeof *res); + drmSetClientCap(dev->fd, DRM_CLIENT_CAP_UNIVERSAL_PLANES, 1); + res->res = drmModeGetResources(dev->fd); if (!res->res) { fprintf(stderr, "drmModeGetResources failed: %s\n", @@ -947,7 +966,7 @@ drmModePlane *ovr; uint32_t handles[4], pitches[4], offsets[4] = {0}; /* we only use [0] */ uint32_t plane_id = 0; - struct kms_bo *plane_bo; + struct bo *plane_bo; uint32_t plane_flags = 0; int crtc_x, crtc_y, crtc_w, crtc_h; struct crtc *crtc = NULL; @@ -988,8 +1007,8 @@ fprintf(stderr, "testing %dx%d@%s overlay plane %u\n", p->w, p->h, p->format_str, plane_id); - plane_bo = create_test_buffer(dev->kms, p->fourcc, p->w, p->h, handles, - pitches, offsets, PATTERN_TILES); + plane_bo = bo_create(dev->fd, p->fourcc, p->w, p->h, handles, + pitches, offsets, PATTERN_TILES); if (plane_bo == NULL) return -1; @@ -1029,7 +1048,7 @@ { uint32_t handles[4], pitches[4], offsets[4] = {0}; /* we only use [0] */ unsigned int fb_id; - struct kms_bo *bo; + struct bo *bo; unsigned int i; unsigned int j; int ret, x; @@ -1049,9 +1068,8 @@ dev->mode.height = pipe->mode->vdisplay; } - bo = create_test_buffer(dev->kms, pipes[0].fourcc, - dev->mode.width, dev->mode.height, - handles, pitches, offsets, PATTERN_SMPTE); + bo = bo_create(dev->fd, pipes[0].fourcc, dev->mode.width, dev->mode.height, + handles, pitches, offsets, PATTERN_SMPTE); if (bo == NULL) return; @@ -1108,7 +1126,7 @@ static void set_cursors(struct device *dev, struct pipe_arg *pipes, unsigned int count) { uint32_t handles[4], pitches[4], offsets[4] = {0}; /* we only use [0] */ - struct kms_bo *bo; + struct bo *bo; unsigned int i; int ret; @@ -1119,8 +1137,8 @@ /* create cursor bo.. just using PATTERN_PLAIN as it has * translucent alpha */ - bo = create_test_buffer(dev->kms, DRM_FORMAT_ARGB8888, - cw, ch, handles, pitches, offsets, PATTERN_PLAIN); + bo = bo_create(dev->fd, DRM_FORMAT_ARGB8888, cw, ch, handles, pitches, + offsets, PATTERN_PLAIN); if (bo == NULL) return; @@ -1149,14 +1167,14 @@ { uint32_t handles[4], pitches[4], offsets[4] = {0}; /* we only use [0] */ unsigned int other_fb_id; - struct kms_bo *other_bo; + struct bo *other_bo; drmEventContext evctx; unsigned int i; int ret; - other_bo = create_test_buffer(dev->kms, pipes[0].fourcc, - dev->mode.width, dev->mode.height, - handles, pitches, offsets, PATTERN_PLAIN); + other_bo = bo_create(dev->fd, pipes[0].fourcc, + dev->mode.width, dev->mode.height, + handles, pitches, offsets, PATTERN_PLAIN); if (other_bo == NULL) return; @@ -1231,7 +1249,7 @@ drmHandleEvent(dev->fd, &evctx); } - kms_bo_destroy(&other_bo); + bo_destroy(other_bo); } #define min(a, b) ((a) < (b) ? (a) : (b)) @@ -1435,7 +1453,7 @@ int drop_master = 0; int test_vsync = 0; int test_cursor = 0; - const char *modules[] = { "i915", "radeon", "nouveau", "vmwgfx", "omapdrm", "exynos", "tilcdc", "msm" }; + const char *modules[] = { "i915", "radeon", "nouveau", "vmwgfx", "omapdrm", "exynos", "tilcdc", "msm", "sti", "tegra", "imx-drm" }; char *device = NULL; char *module = NULL; unsigned int i; @@ -1590,10 +1608,11 @@ set_property(&dev, &prop_args[i]); if (count || plane_count) { - ret = kms_create(dev.fd, &dev.kms); - if (ret) { - fprintf(stderr, "failed to create kms driver: %s\n", - strerror(-ret)); + uint64_t cap = 0; + + ret = drmGetCap(dev.fd, DRM_CAP_DUMB_BUFFER, &cap); + if (ret || cap == 0) { + fprintf(stderr, "driver doesn't support the dumb buffer API\n"); return 1; } @@ -1617,8 +1636,7 @@ if (test_cursor) clear_cursors(&dev); - kms_bo_destroy(&dev.mode.bo); - kms_destroy(&dev.kms); + bo_destroy(dev.mode.bo); } free_resources(dev.resources); diff -Nru libdrm-2.4.56/tests/name_from_fd.c libdrm-2.4.60/tests/name_from_fd.c --- libdrm-2.4.56/tests/name_from_fd.c 2013-08-12 18:01:41.000000000 +0000 +++ libdrm-2.4.60/tests/name_from_fd.c 2015-02-28 18:34:25.000000000 +0000 @@ -28,6 +28,7 @@ #include #include #include +#include #include "drmtest.h" /** @@ -39,8 +40,7 @@ */ int main(int argc, char **argv) { - int fd, ret; - drm_set_version_t sv, version; + int fd; const char *name = "/dev/dri/card0"; char *v; diff -Nru libdrm-2.4.56/tests/nouveau/Makefile.am libdrm-2.4.60/tests/nouveau/Makefile.am --- libdrm-2.4.56/tests/nouveau/Makefile.am 1970-01-01 00:00:00.000000000 +0000 +++ libdrm-2.4.60/tests/nouveau/Makefile.am 2015-03-18 17:33:36.000000000 +0000 @@ -0,0 +1,16 @@ +AM_CPPFLAGS = \ + -I$(top_srcdir)/include/drm \ + -I$(top_srcdir)/nouveau \ + -I$(top_srcdir) + +AM_CFLAGS = $(WARN_CFLAGS) + +LDADD = \ + ../../nouveau/libdrm_nouveau.la \ + ../../libdrm.la \ + -ldl -lpthread + +TESTS = threaded + +check_PROGRAMS = $(TESTS) + diff -Nru libdrm-2.4.56/tests/nouveau/Makefile.in libdrm-2.4.60/tests/nouveau/Makefile.in --- libdrm-2.4.56/tests/nouveau/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ libdrm-2.4.60/tests/nouveau/Makefile.in 2015-03-19 14:37:47.000000000 +0000 @@ -0,0 +1,975 @@ +# Makefile.in generated by automake 1.13.4 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2013 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +VPATH = @srcdir@ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +TESTS = threaded$(EXEEXT) +check_PROGRAMS = $(am__EXEEXT_1) +subdir = tests/nouveau +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(top_srcdir)/build-aux/depcomp \ + $(top_srcdir)/build-aux/test-driver +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__EXEEXT_1 = threaded$(EXEEXT) +threaded_SOURCES = threaded.c +threaded_OBJECTS = threaded.$(OBJEXT) +threaded_LDADD = $(LDADD) +threaded_DEPENDENCIES = ../../nouveau/libdrm_nouveau.la \ + ../../libdrm.la +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 = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = threaded.c +DIST_SOURCES = threaded.c +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +am__tty_colors_dummy = \ + mgn= red= grn= lgn= blu= brg= std=; \ + am__color_tests=no +am__tty_colors = { \ + $(am__tty_colors_dummy); \ + if test "X$(AM_COLOR_TESTS)" = Xno; then \ + am__color_tests=no; \ + elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ + am__color_tests=yes; \ + elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ + am__color_tests=yes; \ + fi; \ + if test $$am__color_tests = yes; then \ + red=''; \ + grn=''; \ + lgn=''; \ + blu=''; \ + mgn=''; \ + brg=''; \ + std=''; \ + fi; \ +} +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__recheck_rx = ^[ ]*:recheck:[ ]* +am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* +am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* +# A command that, given a newline-separated list of test names on the +# standard input, print the name of the tests that are to be re-run +# upon "make recheck". +am__list_recheck_tests = $(AWK) '{ \ + recheck = 1; \ + while ((rc = (getline line < ($$0 ".trs"))) != 0) \ + { \ + if (rc < 0) \ + { \ + if ((getline line2 < ($$0 ".log")) < 0) \ + recheck = 0; \ + break; \ + } \ + else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ + { \ + recheck = 0; \ + break; \ + } \ + else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ + { \ + break; \ + } \ + }; \ + if (recheck) \ + print $$0; \ + close ($$0 ".trs"); \ + close ($$0 ".log"); \ +}' +# A command that, given a newline-separated list of test names on the +# standard input, create the global log from their .trs and .log files. +am__create_global_log = $(AWK) ' \ +function fatal(msg) \ +{ \ + print "fatal: making $@: " msg | "cat >&2"; \ + exit 1; \ +} \ +function rst_section(header) \ +{ \ + print header; \ + len = length(header); \ + for (i = 1; i <= len; i = i + 1) \ + printf "="; \ + printf "\n\n"; \ +} \ +{ \ + copy_in_global_log = 1; \ + global_test_result = "RUN"; \ + while ((rc = (getline line < ($$0 ".trs"))) != 0) \ + { \ + if (rc < 0) \ + fatal("failed to read from " $$0 ".trs"); \ + if (line ~ /$(am__global_test_result_rx)/) \ + { \ + sub("$(am__global_test_result_rx)", "", line); \ + sub("[ ]*$$", "", line); \ + global_test_result = line; \ + } \ + else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ + copy_in_global_log = 0; \ + }; \ + if (copy_in_global_log) \ + { \ + rst_section(global_test_result ": " $$0); \ + while ((rc = (getline line < ($$0 ".log"))) != 0) \ + { \ + if (rc < 0) \ + fatal("failed to read from " $$0 ".log"); \ + print line; \ + }; \ + printf "\n"; \ + }; \ + close ($$0 ".trs"); \ + close ($$0 ".log"); \ +}' +# Restructured Text title. +am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } +# Solaris 10 'make', and several other traditional 'make' implementations, +# pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it +# by disabling -e (using the XSI extension "set +e") if it's set. +am__sh_e_setup = case $$- in *e*) set +e;; esac +# Default flags passed to test drivers. +am__common_driver_flags = \ + --color-tests "$$am__color_tests" \ + --enable-hard-errors "$$am__enable_hard_errors" \ + --expect-failure "$$am__expect_failure" +# To be inserted before the command running the test. Creates the +# directory for the log if needed. Stores in $dir the directory +# containing $f, in $tst the test, in $log the log. Executes the +# developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and +# passes TESTS_ENVIRONMENT. Set up options for the wrapper that +# will run the test scripts (or their associated LOG_COMPILER, if +# thy have one). +am__check_pre = \ +$(am__sh_e_setup); \ +$(am__vpath_adj_setup) $(am__vpath_adj) \ +$(am__tty_colors); \ +srcdir=$(srcdir); export srcdir; \ +case "$@" in \ + */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ + *) am__odir=.;; \ +esac; \ +test "x$$am__odir" = x"." || test -d "$$am__odir" \ + || $(MKDIR_P) "$$am__odir" || exit $$?; \ +if test -f "./$$f"; then dir=./; \ +elif test -f "$$f"; then dir=; \ +else dir="$(srcdir)/"; fi; \ +tst=$$dir$$f; log='$@'; \ +if test -n '$(DISABLE_HARD_ERRORS)'; then \ + am__enable_hard_errors=no; \ +else \ + am__enable_hard_errors=yes; \ +fi; \ +case " $(XFAIL_TESTS) " in \ + *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ + am__expect_failure=yes;; \ + *) \ + am__expect_failure=no;; \ +esac; \ +$(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) +# A shell command to get the names of the tests scripts with any registered +# extension removed (i.e., equivalently, the names of the test logs, with +# the '.log' extension removed). The result is saved in the shell variable +# '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, +# we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", +# since that might cause problem with VPATH rewrites for suffix-less tests. +# See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. +am__set_TESTS_bases = \ + bases='$(TEST_LOGS)'; \ + bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ + bases=`echo $$bases` +RECHECK_LOGS = $(TEST_LOGS) +AM_RECURSIVE_TARGETS = check recheck +TEST_SUITE_LOG = test-suite.log +TEST_EXTENSIONS = @EXEEXT@ .test +LOG_DRIVER = $(SHELL) $(top_srcdir)/build-aux/test-driver +LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) +am__set_b = \ + case '$@' in \ + */*) \ + case '$*' in \ + */*) b='$*';; \ + *) b=`echo '$@' | sed 's/\.log$$//'`; \ + esac;; \ + *) \ + b='$*';; \ + esac +am__test_logs1 = $(TESTS:=.log) +am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) +TEST_LOGS = $(am__test_logs2:.test.log=.log) +TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/build-aux/test-driver +TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ + $(TEST_LOG_FLAGS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CAIRO_CFLAGS = @CAIRO_CFLAGS@ +CAIRO_LIBS = @CAIRO_LIBS@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CLOCK_LIB = @CLOCK_LIB@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBUDEV_CFLAGS = @LIBUDEV_CFLAGS@ +LIBUDEV_LIBS = @LIBUDEV_LIBS@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MANPAGES_STYLESHEET = @MANPAGES_STYLESHEET@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PCIACCESS_CFLAGS = @PCIACCESS_CFLAGS@ +PCIACCESS_LIBS = @PCIACCESS_LIBS@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +PTHREADSTUBS_CFLAGS = @PTHREADSTUBS_CFLAGS@ +PTHREADSTUBS_LIBS = @PTHREADSTUBS_LIBS@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ +VALGRIND_LIBS = @VALGRIND_LIBS@ +VERSION = @VERSION@ +VISIBILITY_CFLAGS = @VISIBILITY_CFLAGS@ +WARN_CFLAGS = @WARN_CFLAGS@ +XSLTPROC = @XSLTPROC@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +kernel_source = @kernel_source@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +pkgconfigdir = @pkgconfigdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AM_CPPFLAGS = \ + -I$(top_srcdir)/include/drm \ + -I$(top_srcdir)/nouveau \ + -I$(top_srcdir) + +AM_CFLAGS = $(WARN_CFLAGS) +LDADD = \ + ../../nouveau/libdrm_nouveau.la \ + ../../libdrm.la \ + -ldl -lpthread + +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .log .o .obj .test .test$(EXEEXT) .trs +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tests/nouveau/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign tests/nouveau/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-checkPROGRAMS: + @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list + +threaded$(EXEEXT): $(threaded_OBJECTS) $(threaded_DEPENDENCIES) $(EXTRA_threaded_DEPENDENCIES) + @rm -f threaded$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(threaded_OBJECTS) $(threaded_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/threaded.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +# Recover from deleted '.trs' file; this should ensure that +# "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create +# both 'foo.log' and 'foo.trs'. Break the recipe in two subshells +# to avoid problems with "make -n". +.log.trs: + rm -f $< $@ + $(MAKE) $(AM_MAKEFLAGS) $< + +# Leading 'am--fnord' is there to ensure the list of targets does not +# expand to empty, as could happen e.g. with make check TESTS=''. +am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) +am--force-recheck: + @: + +$(TEST_SUITE_LOG): $(TEST_LOGS) + @$(am__set_TESTS_bases); \ + am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ + redo_bases=`for i in $$bases; do \ + am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ + done`; \ + if test -n "$$redo_bases"; then \ + redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ + redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ + if $(am__make_dryrun); then :; else \ + rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ + fi; \ + fi; \ + if test -n "$$am__remaking_logs"; then \ + echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ + "recursion detected" >&2; \ + else \ + am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ + fi; \ + if $(am__make_dryrun); then :; else \ + st=0; \ + errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ + for i in $$redo_bases; do \ + test -f $$i.trs && test -r $$i.trs \ + || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ + test -f $$i.log && test -r $$i.log \ + || { echo "$$errmsg $$i.log" >&2; st=1; }; \ + done; \ + test $$st -eq 0 || exit 1; \ + fi + @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ + ws='[ ]'; \ + results=`for b in $$bases; do echo $$b.trs; done`; \ + test -n "$$results" || results=/dev/null; \ + all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ + pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ + fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ + skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ + xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ + xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ + error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ + if test `expr $$fail + $$xpass + $$error` -eq 0; then \ + success=true; \ + else \ + success=false; \ + fi; \ + br='==================='; br=$$br$$br$$br$$br; \ + result_count () \ + { \ + if test x"$$1" = x"--maybe-color"; then \ + maybe_colorize=yes; \ + elif test x"$$1" = x"--no-color"; then \ + maybe_colorize=no; \ + else \ + echo "$@: invalid 'result_count' usage" >&2; exit 4; \ + fi; \ + shift; \ + desc=$$1 count=$$2; \ + if test $$maybe_colorize = yes && test $$count -gt 0; then \ + color_start=$$3 color_end=$$std; \ + else \ + color_start= color_end=; \ + fi; \ + echo "$${color_start}# $$desc $$count$${color_end}"; \ + }; \ + create_testsuite_report () \ + { \ + result_count $$1 "TOTAL:" $$all "$$brg"; \ + result_count $$1 "PASS: " $$pass "$$grn"; \ + result_count $$1 "SKIP: " $$skip "$$blu"; \ + result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ + result_count $$1 "FAIL: " $$fail "$$red"; \ + result_count $$1 "XPASS:" $$xpass "$$red"; \ + result_count $$1 "ERROR:" $$error "$$mgn"; \ + }; \ + { \ + echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ + $(am__rst_title); \ + create_testsuite_report --no-color; \ + echo; \ + echo ".. contents:: :depth: 2"; \ + echo; \ + for b in $$bases; do echo $$b; done \ + | $(am__create_global_log); \ + } >$(TEST_SUITE_LOG).tmp || exit 1; \ + mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ + if $$success; then \ + col="$$grn"; \ + else \ + col="$$red"; \ + test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ + fi; \ + echo "$${col}$$br$${std}"; \ + echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \ + echo "$${col}$$br$${std}"; \ + create_testsuite_report --maybe-color; \ + echo "$$col$$br$$std"; \ + if $$success; then :; else \ + echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ + if test -n "$(PACKAGE_BUGREPORT)"; then \ + echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ + fi; \ + echo "$$col$$br$$std"; \ + fi; \ + $$success || exit 1 + +check-TESTS: + @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list + @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list + @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + @set +e; $(am__set_TESTS_bases); \ + log_list=`for i in $$bases; do echo $$i.log; done`; \ + trs_list=`for i in $$bases; do echo $$i.trs; done`; \ + log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ + $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ + exit $$?; +recheck: all $(check_PROGRAMS) + @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + @set +e; $(am__set_TESTS_bases); \ + bases=`for i in $$bases; do echo $$i; done \ + | $(am__list_recheck_tests)` || exit 1; \ + log_list=`for i in $$bases; do echo $$i.log; done`; \ + log_list=`echo $$log_list`; \ + $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ + am__force_recheck=am--force-recheck \ + TEST_LOGS="$$log_list"; \ + exit $$? +threaded.log: threaded$(EXEEXT) + @p='threaded$(EXEEXT)'; \ + b='threaded'; \ + $(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) +.test.log: + @p='$<'; \ + $(am__set_b); \ + $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +@am__EXEEXT_TRUE@.test$(EXEEXT).log: +@am__EXEEXT_TRUE@ @p='$<'; \ +@am__EXEEXT_TRUE@ $(am__set_b); \ +@am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ +@am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ +@am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ +@am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) + $(MAKE) $(AM_MAKEFLAGS) check-TESTS +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS) + -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs) + -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-checkPROGRAMS clean-generic clean-libtool \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: check-am install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am check check-TESTS check-am clean \ + clean-checkPROGRAMS clean-generic clean-libtool 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-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + recheck tags tags-am uninstall uninstall-am + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff -Nru libdrm-2.4.56/tests/nouveau/threaded.c libdrm-2.4.60/tests/nouveau/threaded.c --- libdrm-2.4.56/tests/nouveau/threaded.c 1970-01-01 00:00:00.000000000 +0000 +++ libdrm-2.4.60/tests/nouveau/threaded.c 2015-03-18 17:33:36.000000000 +0000 @@ -0,0 +1,156 @@ +/* + * Copyright © 2015 Canonical Ltd. (Maarten Lankhorst) + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include +#include +#include +#include +#include +#include +#include + +#include "xf86drm.h" +#include "nouveau.h" + +static typeof(ioctl) *old_ioctl; +static int failed; + +static int import_fd; + +int ioctl(int fd, unsigned long request, ...) +{ + va_list va; + int ret; + void *arg; + + va_start(va, request); + arg = va_arg(va, void *); + ret = old_ioctl(fd, request, arg); + va_end(va); + + if (ret < 0 && request == DRM_IOCTL_GEM_CLOSE && errno == EINVAL) + failed = 1; + + return ret; +} + +static void * +openclose(void *dev) +{ + struct nouveau_device *nvdev = dev; + struct nouveau_bo *bo = NULL; + int i; + + for (i = 0; i < 100000; ++i) { + if (!nouveau_bo_prime_handle_ref(nvdev, import_fd, &bo)) + nouveau_bo_ref(NULL, &bo); + } + return NULL; +} + +int main(int argc, char *argv[]) +{ + drmVersionPtr version; + const char *device = NULL; + int err, fd, fd2; + struct nouveau_device *nvdev, *nvdev2; + struct nouveau_bo *bo; + pthread_t t1, t2; + + old_ioctl = dlsym(RTLD_NEXT, "ioctl"); + + if (argc < 2) { + fd = drmOpenWithType("nouveau", NULL, DRM_NODE_RENDER); + if (fd >= 0) + fd2 = drmOpenWithType("nouveau", NULL, DRM_NODE_RENDER); + } else { + device = argv[1]; + + fd = open(device, O_RDWR); + if (fd >= 0) + fd2 = open(device, O_RDWR); + else + fd2 = fd = -errno; + } + + if (fd < 0) { + fprintf(stderr, "Opening nouveau render node failed with %i\n", fd); + return device ? -fd : 77; + } + + if (fd2 < 0) { + fprintf(stderr, "Opening second nouveau render node failed with %i\n", -errno); + return errno; + } + + version = drmGetVersion(fd); + if (version) { + printf("Version: %d.%d.%d\n", version->version_major, + version->version_minor, version->version_patchlevel); + printf(" Name: %s\n", version->name); + printf(" Date: %s\n", version->date); + printf(" Description: %s\n", version->desc); + + drmFreeVersion(version); + } + + err = nouveau_device_wrap(fd, 0, &nvdev); + if (!err) + err = nouveau_device_wrap(fd2, 0, &nvdev2); + if (err < 0) + return 1; + + err = nouveau_bo_new(nvdev2, NOUVEAU_BO_GART, 0, 4096, NULL, &bo); + if (!err) + err = nouveau_bo_set_prime(bo, &import_fd); + + if (!err) { + pthread_create(&t1, NULL, openclose, nvdev); + pthread_create(&t2, NULL, openclose, nvdev); + } + + pthread_join(t1, NULL); + pthread_join(t2, NULL); + + close(import_fd); + nouveau_bo_ref(NULL, &bo); + + nouveau_device_del(&nvdev2); + nouveau_device_del(&nvdev); + if (device) { + close(fd2); + close(fd); + } else { + drmClose(fd2); + drmClose(fd); + } + + if (failed) + fprintf(stderr, "DRM_IOCTL_GEM_CLOSE failed with EINVAL,\n" + "race in opening/closing bo is likely.\n"); + + return failed; +} diff -Nru libdrm-2.4.56/tests/proptest/Makefile.am libdrm-2.4.60/tests/proptest/Makefile.am --- libdrm-2.4.56/tests/proptest/Makefile.am 1970-01-01 00:00:00.000000000 +0000 +++ libdrm-2.4.60/tests/proptest/Makefile.am 2015-02-28 18:34:25.000000000 +0000 @@ -0,0 +1,12 @@ +AM_CFLAGS = \ + $(WARN_CFLAGS)\ + -I$(top_srcdir)/include/drm \ + -I$(top_srcdir) + +noinst_PROGRAMS = \ + proptest + +proptest_SOURCES = \ + proptest.c +proptest_LDADD = \ + $(top_builddir)/libdrm.la diff -Nru libdrm-2.4.56/tests/proptest/Makefile.in libdrm-2.4.60/tests/proptest/Makefile.in --- libdrm-2.4.56/tests/proptest/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ libdrm-2.4.60/tests/proptest/Makefile.in 2015-03-19 14:37:47.000000000 +0000 @@ -0,0 +1,600 @@ +# Makefile.in generated by automake 1.13.4 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2013 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +noinst_PROGRAMS = proptest$(EXEEXT) +subdir = tests/proptest +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(top_srcdir)/build-aux/depcomp +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +PROGRAMS = $(noinst_PROGRAMS) +am_proptest_OBJECTS = proptest.$(OBJEXT) +proptest_OBJECTS = $(am_proptest_OBJECTS) +proptest_DEPENDENCIES = $(top_builddir)/libdrm.la +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 = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(proptest_SOURCES) +DIST_SOURCES = $(proptest_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CAIRO_CFLAGS = @CAIRO_CFLAGS@ +CAIRO_LIBS = @CAIRO_LIBS@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CLOCK_LIB = @CLOCK_LIB@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBUDEV_CFLAGS = @LIBUDEV_CFLAGS@ +LIBUDEV_LIBS = @LIBUDEV_LIBS@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MANPAGES_STYLESHEET = @MANPAGES_STYLESHEET@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PCIACCESS_CFLAGS = @PCIACCESS_CFLAGS@ +PCIACCESS_LIBS = @PCIACCESS_LIBS@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +PTHREADSTUBS_CFLAGS = @PTHREADSTUBS_CFLAGS@ +PTHREADSTUBS_LIBS = @PTHREADSTUBS_LIBS@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ +VALGRIND_LIBS = @VALGRIND_LIBS@ +VERSION = @VERSION@ +VISIBILITY_CFLAGS = @VISIBILITY_CFLAGS@ +WARN_CFLAGS = @WARN_CFLAGS@ +XSLTPROC = @XSLTPROC@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +kernel_source = @kernel_source@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +pkgconfigdir = @pkgconfigdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AM_CFLAGS = \ + $(WARN_CFLAGS)\ + -I$(top_srcdir)/include/drm \ + -I$(top_srcdir) + +proptest_SOURCES = \ + proptest.c + +proptest_LDADD = \ + $(top_builddir)/libdrm.la + +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tests/proptest/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign tests/proptest/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-noinstPROGRAMS: + @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list + +proptest$(EXEEXT): $(proptest_OBJECTS) $(proptest_DEPENDENCIES) $(EXTRA_proptest_DEPENDENCIES) + @rm -f proptest$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(proptest_OBJECTS) $(proptest_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/proptest.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(PROGRAMS) +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-noinstPROGRAMS 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-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags tags-am uninstall uninstall-am + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff -Nru libdrm-2.4.56/tests/proptest/proptest.c libdrm-2.4.60/tests/proptest/proptest.c --- libdrm-2.4.56/tests/proptest/proptest.c 1970-01-01 00:00:00.000000000 +0000 +++ libdrm-2.4.60/tests/proptest/proptest.c 2015-03-18 17:33:36.000000000 +0000 @@ -0,0 +1,343 @@ +/* + * Copyright © 2012 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + * + * Authors: + * Paulo Zanoni + * + */ + +#include +#include +#include +#include +#include +#include + +#include "xf86drm.h" +#include "xf86drmMode.h" + +#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0])) +static inline int64_t U642I64(uint64_t val) +{ + return (int64_t)*((int64_t *)&val); +} + +int fd; +drmModeResPtr res = NULL; + +static const char *connector_type_str(uint32_t type) +{ + switch (type) { + case DRM_MODE_CONNECTOR_Unknown: + return "Unknown"; + case DRM_MODE_CONNECTOR_VGA: + return "VGA"; + case DRM_MODE_CONNECTOR_DVII: + return "DVI-I"; + case DRM_MODE_CONNECTOR_DVID: + return "DVI-D"; + case DRM_MODE_CONNECTOR_DVIA: + return "DVI-A"; + case DRM_MODE_CONNECTOR_Composite: + return "Composite"; + case DRM_MODE_CONNECTOR_SVIDEO: + return "SVIDEO"; + case DRM_MODE_CONNECTOR_LVDS: + return "LVDS"; + case DRM_MODE_CONNECTOR_Component: + return "Component"; + case DRM_MODE_CONNECTOR_9PinDIN: + return "9PinDin"; + case DRM_MODE_CONNECTOR_DisplayPort: + return "DisplayPort"; + case DRM_MODE_CONNECTOR_HDMIA: + return "HDMI-A"; + case DRM_MODE_CONNECTOR_HDMIB: + return "HDMI-B"; + case DRM_MODE_CONNECTOR_TV: + return "TV"; + case DRM_MODE_CONNECTOR_eDP: + return "eDP"; + default: + return "Invalid"; + } +} + +/* dump_blob and dump_prop shamelessly copied from ../modetest/modetest.c */ +static void +dump_blob(uint32_t blob_id) +{ + uint32_t i; + unsigned char *blob_data; + drmModePropertyBlobPtr blob; + + blob = drmModeGetPropertyBlob(fd, blob_id); + if (!blob) { + printf("\n"); + return; + } + + blob_data = blob->data; + + for (i = 0; i < blob->length; i++) { + if (i % 16 == 0) + printf("\n\t\t\t"); + printf("%.2hhx", blob_data[i]); + } + printf("\n"); + + drmModeFreePropertyBlob(blob); +} + +static void +dump_prop(uint32_t prop_id, uint64_t value) +{ + int i; + drmModePropertyPtr prop; + + prop = drmModeGetProperty(fd, prop_id); + + printf("\t%d", prop_id); + if (!prop) { + printf("\n"); + return; + } + + printf(" %s:\n", prop->name); + + printf("\t\tflags:"); + if (prop->flags & DRM_MODE_PROP_PENDING) + printf(" pending"); + if (prop->flags & DRM_MODE_PROP_IMMUTABLE) + printf(" immutable"); + if (drm_property_type_is(prop, DRM_MODE_PROP_SIGNED_RANGE)) + printf(" signed range"); + if (drm_property_type_is(prop, DRM_MODE_PROP_RANGE)) + printf(" range"); + if (drm_property_type_is(prop, DRM_MODE_PROP_ENUM)) + printf(" enum"); + if (drm_property_type_is(prop, DRM_MODE_PROP_BITMASK)) + printf(" bitmask"); + if (drm_property_type_is(prop, DRM_MODE_PROP_BLOB)) + printf(" blob"); + if (drm_property_type_is(prop, DRM_MODE_PROP_OBJECT)) + printf(" object"); + printf("\n"); + + + if (drm_property_type_is(prop, DRM_MODE_PROP_SIGNED_RANGE)) { + printf("\t\tvalues:"); + for (i = 0; i < prop->count_values; i++) + printf(" %"PRId64, U642I64(prop->values[i])); + printf("\n"); + } + + if (drm_property_type_is(prop, DRM_MODE_PROP_RANGE)) { + printf("\t\tvalues:"); + for (i = 0; i < prop->count_values; i++) + printf(" %"PRIu64, prop->values[i]); + printf("\n"); + } + + if (drm_property_type_is(prop, DRM_MODE_PROP_ENUM)) { + printf("\t\tenums:"); + for (i = 0; i < prop->count_enums; i++) + printf(" %s=%llu", prop->enums[i].name, + prop->enums[i].value); + printf("\n"); + } else if (drm_property_type_is(prop, DRM_MODE_PROP_BITMASK)) { + printf("\t\tvalues:"); + for (i = 0; i < prop->count_enums; i++) + printf(" %s=0x%llx", prop->enums[i].name, + (1LL << prop->enums[i].value)); + printf("\n"); + } else { + assert(prop->count_enums == 0); + } + + if (drm_property_type_is(prop, DRM_MODE_PROP_BLOB)) { + printf("\t\tblobs:\n"); + for (i = 0; i < prop->count_blobs; i++) + dump_blob(prop->blob_ids[i]); + printf("\n"); + } else { + assert(prop->count_blobs == 0); + } + + printf("\t\tvalue:"); + if (drm_property_type_is(prop, DRM_MODE_PROP_BLOB)) + dump_blob(value); + else + printf(" %"PRIu64"\n", value); + + drmModeFreeProperty(prop); +} + +static void listObjectProperties(uint32_t id, uint32_t type) +{ + unsigned int i; + drmModeObjectPropertiesPtr props; + + props = drmModeObjectGetProperties(fd, id, type); + + if (!props) { + printf("\tNo properties: %s.\n", strerror(errno)); + return; + } + + for (i = 0; i < props->count_props; i++) + dump_prop(props->props[i], props->prop_values[i]); + + drmModeFreeObjectProperties(props); +} + +static void listConnectorProperties(void) +{ + int i; + drmModeConnectorPtr c; + + for (i = 0; i < res->count_connectors; i++) { + c = drmModeGetConnector(fd, res->connectors[i]); + + if (!c) { + fprintf(stderr, "Could not get connector %u: %s\n", + res->connectors[i], strerror(errno)); + continue; + } + + printf("Connector %u (%s-%u)\n", c->connector_id, + connector_type_str(c->connector_type), + c->connector_type_id); + + listObjectProperties(c->connector_id, + DRM_MODE_OBJECT_CONNECTOR); + + drmModeFreeConnector(c); + } +} + +static void listCrtcProperties(void) +{ + int i; + drmModeCrtcPtr c; + + for (i = 0; i < res->count_crtcs; i++) { + c = drmModeGetCrtc(fd, res->crtcs[i]); + + if (!c) { + fprintf(stderr, "Could not get crtc %u: %s\n", + res->crtcs[i], strerror(errno)); + continue; + } + + printf("CRTC %u\n", c->crtc_id); + + listObjectProperties(c->crtc_id, DRM_MODE_OBJECT_CRTC); + + drmModeFreeCrtc(c); + } +} + +static void listAllProperties(void) +{ + listConnectorProperties(); + listCrtcProperties(); +} + +static int setProperty(char *argv[]) +{ + uint32_t obj_id, obj_type, prop_id; + uint64_t value; + + obj_id = atoi(argv[1]); + + if (!strcmp(argv[2], "connector")) { + obj_type = DRM_MODE_OBJECT_CONNECTOR; + } else if (!strcmp(argv[2], "crtc")) { + obj_type = DRM_MODE_OBJECT_CRTC; + } else { + fprintf(stderr, "Invalid object type.\n"); + return 1; + } + + prop_id = atoi(argv[3]); + value = atoll(argv[4]); + + return drmModeObjectSetProperty(fd, obj_id, obj_type, prop_id, value); +} + +static void printUsage(void) +{ + printf("Usage:\n" +" proptest\n" +" proptest [obj id] [obj type] [prop id] [value]\n" +"\n" +"The first form just prints all the existing properties. The second one is\n" +"used to set the value of a specified property. The object type can be one of\n" +"the following strings:\n" +" connector crtc\n" +"\n" +"Example:\n" +" proptest 7 connector 2 1\n" +"will set property 2 of connector 7 to 1\n"); +} + +int main(int argc, char *argv[]) +{ + const char *modules[] = { "i915", "radeon", "nouveau", "vmwgfx", "omapdrm", "msm" }; + unsigned int i, ret = 0; + + for (i = 0; i < ARRAY_SIZE(modules); i++){ + fd = drmOpen(modules[i], NULL); + if (fd >= 0) { + printf("Module %s loaded.\n", modules[i]); + break; + } + } + + if (i == ARRAY_SIZE(modules)) { + fprintf(stderr, "Failed to load drm modules.\n"); + return 1; + } + + res = drmModeGetResources(fd); + if (!res) { + fprintf(stderr, "Failed to get resources: %s\n", + strerror(errno)); + ret = 1; + goto done; + } + + if (argc < 2) { + listAllProperties(); + } else if (argc == 5) { + ret = setProperty(argv); + } else { + printUsage(); + ret = 1; + } + + drmModeFreeResources(res); +done: + drmClose(fd); + return ret; +} diff -Nru libdrm-2.4.56/tests/radeon/list.h libdrm-2.4.60/tests/radeon/list.h --- libdrm-2.4.56/tests/radeon/list.h 2013-08-12 18:01:42.000000000 +0000 +++ libdrm-2.4.60/tests/radeon/list.h 2015-02-28 18:34:25.000000000 +0000 @@ -44,13 +44,13 @@ struct list_head *next; }; -static void list_inithead(struct list_head *item) +static inline void list_inithead(struct list_head *item) { item->prev = item; item->next = item; } -static void list_add(struct list_head *item, struct list_head *list) +static inline void list_add(struct list_head *item, struct list_head *list) { item->prev = list; item->next = list->next; @@ -58,7 +58,7 @@ list->next = item; } -static void list_addtail(struct list_head *item, struct list_head *list) +static inline void list_addtail(struct list_head *item, struct list_head *list) { item->next = list; item->prev = list->prev; @@ -66,7 +66,7 @@ list->prev = item; } -static void list_replace(struct list_head *from, struct list_head *to) +static inline void list_replace(struct list_head *from, struct list_head *to) { to->prev = from->prev; to->next = from->next; @@ -74,13 +74,13 @@ from->prev->next = to; } -static void list_del(struct list_head *item) +static inline void list_del(struct list_head *item) { item->prev->next = item->next; item->next->prev = item->prev; } -static void list_delinit(struct list_head *item) +static inline void list_delinit(struct list_head *item) { item->prev->next = item->next; item->next->prev = item->prev; diff -Nru libdrm-2.4.56/tests/radeon/Makefile.am libdrm-2.4.60/tests/radeon/Makefile.am --- libdrm-2.4.56/tests/radeon/Makefile.am 2013-08-12 18:01:41.000000000 +0000 +++ libdrm-2.4.60/tests/radeon/Makefile.am 2015-02-28 18:34:25.000000000 +0000 @@ -1,4 +1,5 @@ AM_CFLAGS = \ + $(WARN_CFLAGS)\ -I $(top_srcdir)/include/drm \ -I $(top_srcdir) diff -Nru libdrm-2.4.56/tests/radeon/Makefile.in libdrm-2.4.60/tests/radeon/Makefile.in --- libdrm-2.4.56/tests/radeon/Makefile.in 2014-07-29 16:13:53.000000000 +0000 +++ libdrm-2.4.60/tests/radeon/Makefile.in 2015-03-19 14:37:47.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.14.1 from Makefile.am. +# Makefile.in generated by automake 1.13.4 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. @@ -208,7 +208,6 @@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MANPAGES_STYLESHEET = @MANPAGES_STYLESHEET@ @@ -242,6 +241,7 @@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ VALGRIND_LIBS = @VALGRIND_LIBS@ VERSION = @VERSION@ +VISIBILITY_CFLAGS = @VISIBILITY_CFLAGS@ WARN_CFLAGS = @WARN_CFLAGS@ XSLTPROC = @XSLTPROC@ abs_builddir = @abs_builddir@ @@ -299,6 +299,7 @@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CFLAGS = \ + $(WARN_CFLAGS)\ -I $(top_srcdir)/include/drm \ -I $(top_srcdir) @@ -313,7 +314,7 @@ .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -338,9 +339,9 @@ $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): @@ -371,14 +372,14 @@ @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< diff -Nru libdrm-2.4.56/tests/radeon/radeon_ttm.c libdrm-2.4.60/tests/radeon/radeon_ttm.c --- libdrm-2.4.56/tests/radeon/radeon_ttm.c 2014-07-26 18:08:30.000000000 +0000 +++ libdrm-2.4.60/tests/radeon/radeon_ttm.c 2015-03-18 17:33:36.000000000 +0000 @@ -32,7 +32,7 @@ /* allocate as many single page bo to try to starve the kernel * memory zone (below highmem) */ -void ttm_starve_kernel_private_memory(int fd) +static void ttm_starve_kernel_private_memory(int fd) { struct list_head list; struct rbo *bo, *tmp; @@ -55,7 +55,7 @@ } } -int radeon_open_fd(void) +static int radeon_open_fd(void) { return drmOpen("radeon", NULL); } diff -Nru libdrm-2.4.56/tests/setversion.c libdrm-2.4.60/tests/setversion.c --- libdrm-2.4.56/tests/setversion.c 2013-09-17 13:02:43.000000000 +0000 +++ libdrm-2.4.60/tests/setversion.c 2015-02-28 18:34:25.000000000 +0000 @@ -27,6 +27,7 @@ #include #include +#include #include "drmtest.h" /** diff -Nru libdrm-2.4.56/tests/tegra/Makefile.am libdrm-2.4.60/tests/tegra/Makefile.am --- libdrm-2.4.56/tests/tegra/Makefile.am 1970-01-01 00:00:00.000000000 +0000 +++ libdrm-2.4.60/tests/tegra/Makefile.am 2015-02-28 18:34:25.000000000 +0000 @@ -0,0 +1,13 @@ +AM_CPPFLAGS = \ + -I$(top_srcdir)/include/drm \ + -I$(top_srcdir)/tegra \ + -I$(top_srcdir) + +AM_CFLAGS = $(WARN_CFLAGS) + +LDADD = \ + ../../tegra/libdrm_tegra.la \ + ../../libdrm.la + +noinst_PROGRAMS = \ + openclose diff -Nru libdrm-2.4.56/tests/tegra/Makefile.in libdrm-2.4.60/tests/tegra/Makefile.in --- libdrm-2.4.56/tests/tegra/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ libdrm-2.4.60/tests/tegra/Makefile.in 2015-03-19 14:37:47.000000000 +0000 @@ -0,0 +1,600 @@ +# Makefile.in generated by automake 1.13.4 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2013 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +noinst_PROGRAMS = openclose$(EXEEXT) +subdir = tests/tegra +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(top_srcdir)/build-aux/depcomp +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +PROGRAMS = $(noinst_PROGRAMS) +openclose_SOURCES = openclose.c +openclose_OBJECTS = openclose.$(OBJEXT) +openclose_LDADD = $(LDADD) +openclose_DEPENDENCIES = ../../tegra/libdrm_tegra.la ../../libdrm.la +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 = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = openclose.c +DIST_SOURCES = openclose.c +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CAIRO_CFLAGS = @CAIRO_CFLAGS@ +CAIRO_LIBS = @CAIRO_LIBS@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CLOCK_LIB = @CLOCK_LIB@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBUDEV_CFLAGS = @LIBUDEV_CFLAGS@ +LIBUDEV_LIBS = @LIBUDEV_LIBS@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MANPAGES_STYLESHEET = @MANPAGES_STYLESHEET@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PCIACCESS_CFLAGS = @PCIACCESS_CFLAGS@ +PCIACCESS_LIBS = @PCIACCESS_LIBS@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +PTHREADSTUBS_CFLAGS = @PTHREADSTUBS_CFLAGS@ +PTHREADSTUBS_LIBS = @PTHREADSTUBS_LIBS@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ +VALGRIND_LIBS = @VALGRIND_LIBS@ +VERSION = @VERSION@ +VISIBILITY_CFLAGS = @VISIBILITY_CFLAGS@ +WARN_CFLAGS = @WARN_CFLAGS@ +XSLTPROC = @XSLTPROC@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +kernel_source = @kernel_source@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +pkgconfigdir = @pkgconfigdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AM_CPPFLAGS = \ + -I$(top_srcdir)/include/drm \ + -I$(top_srcdir)/tegra \ + -I$(top_srcdir) + +AM_CFLAGS = $(WARN_CFLAGS) +LDADD = \ + ../../tegra/libdrm_tegra.la \ + ../../libdrm.la + +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tests/tegra/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign tests/tegra/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-noinstPROGRAMS: + @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list + +openclose$(EXEEXT): $(openclose_OBJECTS) $(openclose_DEPENDENCIES) $(EXTRA_openclose_DEPENDENCIES) + @rm -f openclose$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(openclose_OBJECTS) $(openclose_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/openclose.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(PROGRAMS) +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-noinstPROGRAMS 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-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags tags-am uninstall uninstall-am + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff -Nru libdrm-2.4.56/tests/tegra/openclose.c libdrm-2.4.60/tests/tegra/openclose.c --- libdrm-2.4.56/tests/tegra/openclose.c 1970-01-01 00:00:00.000000000 +0000 +++ libdrm-2.4.60/tests/tegra/openclose.c 2015-02-28 18:34:25.000000000 +0000 @@ -0,0 +1,71 @@ +/* + * Copyright © 2014 NVIDIA Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include +#include +#include + +#include "xf86drm.h" +#include "tegra.h" + +static const char default_device[] = "/dev/dri/card0"; + +int main(int argc, char *argv[]) +{ + struct drm_tegra *tegra; + drmVersionPtr version; + const char *device; + int err, fd; + + if (argc < 2) + device = default_device; + else + device = argv[1]; + + fd = open(device, O_RDWR); + if (fd < 0) + return 1; + + version = drmGetVersion(fd); + if (version) { + printf("Version: %d.%d.%d\n", version->version_major, + version->version_minor, version->version_patchlevel); + printf(" Name: %s\n", version->name); + printf(" Date: %s\n", version->date); + printf(" Description: %s\n", version->desc); + + drmFreeVersion(version); + } + + err = drm_tegra_new(&tegra, fd); + if (err < 0) + return 1; + + drm_tegra_close(tegra); + close(fd); + + return 0; +} diff -Nru libdrm-2.4.56/tests/updatedraw.c libdrm-2.4.60/tests/updatedraw.c --- libdrm-2.4.56/tests/updatedraw.c 2013-08-12 18:01:46.000000000 +0000 +++ libdrm-2.4.60/tests/updatedraw.c 2015-02-28 18:34:25.000000000 +0000 @@ -25,6 +25,7 @@ * */ +#include #include "drmtest.h" static void @@ -121,7 +122,7 @@ */ int main(int argc, char **argv) { - int fd, ret, d1, d2; + int fd, d1, d2; if (getuid() != 0) { fprintf(stderr, "updatedraw test requires root, skipping\n"); diff -Nru libdrm-2.4.56/tests/vbltest/Makefile.am libdrm-2.4.60/tests/vbltest/Makefile.am --- libdrm-2.4.56/tests/vbltest/Makefile.am 2013-08-12 18:01:47.000000000 +0000 +++ libdrm-2.4.60/tests/vbltest/Makefile.am 2015-02-28 18:34:25.000000000 +0000 @@ -1,6 +1,8 @@ AM_CFLAGS = \ + $(WARN_CFLAGS)\ -I$(top_srcdir)/include/drm \ -I$(top_srcdir) + if HAVE_INSTALL_TESTS bin_PROGRAMS = \ vbltest diff -Nru libdrm-2.4.56/tests/vbltest/Makefile.in libdrm-2.4.60/tests/vbltest/Makefile.in --- libdrm-2.4.56/tests/vbltest/Makefile.in 2014-07-29 16:13:53.000000000 +0000 +++ libdrm-2.4.60/tests/vbltest/Makefile.in 2015-03-19 14:37:47.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.14.1 from Makefile.am. +# Makefile.in generated by automake 1.13.4 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. @@ -209,7 +209,6 @@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MANPAGES_STYLESHEET = @MANPAGES_STYLESHEET@ @@ -243,6 +242,7 @@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ VALGRIND_LIBS = @VALGRIND_LIBS@ VERSION = @VERSION@ +VISIBILITY_CFLAGS = @VISIBILITY_CFLAGS@ WARN_CFLAGS = @WARN_CFLAGS@ XSLTPROC = @XSLTPROC@ abs_builddir = @abs_builddir@ @@ -300,6 +300,7 @@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CFLAGS = \ + $(WARN_CFLAGS)\ -I$(top_srcdir)/include/drm \ -I$(top_srcdir) @@ -313,7 +314,7 @@ .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -338,9 +339,9 @@ $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @@ -419,14 +420,14 @@ @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< diff -Nru libdrm-2.4.56/tests/vbltest/vbltest.c libdrm-2.4.60/tests/vbltest/vbltest.c --- libdrm-2.4.56/tests/vbltest/vbltest.c 2013-09-17 13:02:43.000000000 +0000 +++ libdrm-2.4.60/tests/vbltest/vbltest.c 2015-03-18 17:33:36.000000000 +0000 @@ -37,7 +37,9 @@ * TODO: use cairo to write the mode info on the selected output once * the mode has been programmed, along with possible test patterns. */ +#ifdef HAVE_CONFIG_H #include "config.h" +#endif #include #include @@ -102,8 +104,9 @@ int main(int argc, char **argv) { - int i, c, fd, ret; - char *modules[] = { "i915", "radeon", "nouveau", "vmwgfx", "exynos", "omapdrm", "tilcdc", "msm" }; + unsigned i; + int c, fd, ret; + const char *modules[] = { "i915", "radeon", "nouveau", "vmwgfx", "exynos", "omapdrm", "tilcdc", "msm", "tegra", "imx-drm" }; drmVBlank vbl; drmEventContext evctx; struct vbl_info handler_info; diff -Nru libdrm-2.4.56/xf86atomic.h libdrm-2.4.60/xf86atomic.h --- libdrm-2.4.56/xf86atomic.h 2013-08-12 18:01:47.000000000 +0000 +++ libdrm-2.4.60/xf86atomic.h 2015-03-18 17:33:36.000000000 +0000 @@ -49,7 +49,8 @@ # define atomic_read(x) ((x)->atomic) # define atomic_set(x, val) ((x)->atomic = (val)) # define atomic_inc(x) ((void) __sync_fetch_and_add (&(x)->atomic, 1)) -# define atomic_dec_and_test(x) (__sync_fetch_and_add (&(x)->atomic, -1) == 1) +# define atomic_inc_return(x) (__sync_add_and_fetch (&(x)->atomic, 1)) +# define atomic_dec_and_test(x) (__sync_add_and_fetch (&(x)->atomic, -1) == 0) # define atomic_add(x, v) ((void) __sync_add_and_fetch(&(x)->atomic, (v))) # define atomic_dec(x, v) ((void) __sync_sub_and_fetch(&(x)->atomic, (v))) # define atomic_cmpxchg(x, oldv, newv) __sync_val_compare_and_swap (&(x)->atomic, oldv, newv) @@ -68,6 +69,7 @@ # define atomic_read(x) AO_load_full(&(x)->atomic) # define atomic_set(x, val) AO_store_full(&(x)->atomic, (val)) # define atomic_inc(x) ((void) AO_fetch_and_add1_full(&(x)->atomic)) +# define atomic_inc_return(x) (AO_fetch_and_add1_full(&(x)->atomic) + 1) # define atomic_add(x, v) ((void) AO_fetch_and_add_full(&(x)->atomic, (v))) # define atomic_dec(x, v) ((void) AO_fetch_and_add_full(&(x)->atomic, -(v))) # define atomic_dec_and_test(x) (AO_fetch_and_sub1_full(&(x)->atomic) == 1) @@ -75,17 +77,24 @@ #endif -#if defined(__sun) && !defined(HAS_ATOMIC_OPS) /* Solaris & OpenSolaris */ +#if (defined(__sun) || defined(__NetBSD__)) && !defined(HAS_ATOMIC_OPS) /* Solaris & OpenSolaris & NetBSD */ #include #define HAS_ATOMIC_OPS 1 -typedef struct { uint_t atomic; } atomic_t; +#if defined(__NetBSD__) +#define LIBDRM_ATOMIC_TYPE int +#else +#define LIBDRM_ATOMIC_TYPE uint_t +#endif + +typedef struct { LIBDRM_ATOMIC_TYPE atomic; } atomic_t; # define atomic_read(x) (int) ((x)->atomic) -# define atomic_set(x, val) ((x)->atomic = (uint_t)(val)) +# define atomic_set(x, val) ((x)->atomic = (LIBDRM_ATOMIC_TYPE)(val)) # define atomic_inc(x) (atomic_inc_uint (&(x)->atomic)) -# define atomic_dec_and_test(x) (atomic_dec_uint_nv(&(x)->atomic) == 1) +# define atomic_inc_return (atomic_inc_uint_nv(&(x)->atomic)) +# define atomic_dec_and_test(x) (atomic_dec_uint_nv(&(x)->atomic) == 0) # define atomic_add(x, v) (atomic_add_int(&(x)->atomic, (v))) # define atomic_dec(x, v) (atomic_add_int(&(x)->atomic, -(v))) # define atomic_cmpxchg(x, oldv, newv) atomic_cas_uint (&(x)->atomic, oldv, newv) @@ -96,4 +105,13 @@ #error libdrm requires atomic operations, please define them for your CPU/compiler. #endif +static inline int atomic_add_unless(atomic_t *v, int add, int unless) +{ + int c, old; + c = atomic_read(v); + while (c != unless && (old = atomic_cmpxchg(v, c, c + add)) != c) + c = old; + return c == unless; +} + #endif diff -Nru libdrm-2.4.56/xf86drm.c libdrm-2.4.60/xf86drm.c --- libdrm-2.4.56/xf86drm.c 2014-07-25 17:40:07.000000000 +0000 +++ libdrm-2.4.60/xf86drm.c 2015-03-18 17:33:36.000000000 +0000 @@ -40,6 +40,8 @@ #include #include #include +#include +#include #include #include #include @@ -48,9 +50,11 @@ #include #define stat_t struct stat #include -#include #include #include +#ifdef HAVE_SYS_MKDEV_H +# include /* defines major(), minor(), and makedev() on Solaris */ +#endif /* Not all systems have MAP_FAILED defined */ #ifndef MAP_FAILED @@ -58,6 +62,7 @@ #endif #include "xf86drm.h" +#include "libdrm.h" #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) #define DRM_MAJOR 145 @@ -85,8 +90,7 @@ #define DRM_MSG_VERBOSITY 3 -#define DRM_NODE_CONTROL 0 -#define DRM_NODE_RENDER 1 +#define memclear(s) memset(&s, 0, sizeof(s)) static drmServerInfoPtr drm_server_info; @@ -302,24 +306,41 @@ * special file node with the major and minor numbers specified by \p dev and * parent directory if necessary and was called by root. */ -static int drmOpenDevice(long dev, int minor, int type) +static int drmOpenDevice(dev_t dev, int minor, int type) { stat_t st; + const char *dev_name; char buf[64]; int fd; mode_t devmode = DRM_DEV_MODE, serv_mode; + gid_t serv_group; +#if !defined(UDEV) int isroot = !geteuid(); uid_t user = DRM_DEV_UID; - gid_t group = DRM_DEV_GID, serv_group; - - sprintf(buf, type ? DRM_DEV_NAME : DRM_CONTROL_DEV_NAME, DRM_DIR_NAME, minor); + gid_t group = DRM_DEV_GID; +#endif + + switch (type) { + case DRM_NODE_PRIMARY: + dev_name = DRM_DEV_NAME; + break; + case DRM_NODE_CONTROL: + dev_name = DRM_CONTROL_DEV_NAME; + break; + case DRM_NODE_RENDER: + dev_name = DRM_RENDER_DEV_NAME; + break; + default: + return -EINVAL; + }; + + sprintf(buf, dev_name, DRM_DIR_NAME, minor); drmMsg("drmOpenDevice: node name is %s\n", buf); if (drm_server_info) { drm_server_info->get_perms(&serv_group, &serv_mode); devmode = serv_mode ? serv_mode : DRM_DEV_MODE; devmode &= ~(S_IXUSR|S_IXGRP|S_IXOTH); - group = (serv_group >= 0) ? serv_group : DRM_DEV_GID; } #if !defined(UDEV) @@ -340,6 +361,7 @@ } if (drm_server_info) { + group = (serv_group >= 0) ? serv_group : DRM_DEV_GID; chown_check_return(buf, user, group); chmod(buf, devmode); } @@ -417,11 +439,26 @@ { int fd; char buf[64]; + const char *dev_name; if (create) return drmOpenDevice(makedev(DRM_MAJOR, minor), minor, type); - sprintf(buf, type ? DRM_DEV_NAME : DRM_CONTROL_DEV_NAME, DRM_DIR_NAME, minor); + switch (type) { + case DRM_NODE_PRIMARY: + dev_name = DRM_DEV_NAME; + break; + case DRM_NODE_CONTROL: + dev_name = DRM_CONTROL_DEV_NAME; + break; + case DRM_NODE_RENDER: + dev_name = DRM_RENDER_DEV_NAME; + break; + default: + return -EINVAL; + }; + + sprintf(buf, dev_name, DRM_DIR_NAME, minor); if ((fd = open(buf, O_RDWR, 0)) >= 0) return fd; return -errno; @@ -444,7 +481,7 @@ int retval = 0; int fd; - if ((fd = drmOpenMinor(0, 1, DRM_NODE_RENDER)) < 0) { + if ((fd = drmOpenMinor(0, 1, DRM_NODE_PRIMARY)) < 0) { #ifdef __linux__ /* Try proc for backward Linux compatibility */ if (!access("/proc/dri/0", R_OK)) @@ -462,11 +499,56 @@ return retval; } +static int drmGetMinorBase(int type) +{ + switch (type) { + case DRM_NODE_PRIMARY: + return 0; + case DRM_NODE_CONTROL: + return 64; + case DRM_NODE_RENDER: + return 128; + default: + return -1; + }; +} + +static int drmGetMinorType(int minor) +{ + int type = minor >> 6; + + if (minor < 0) + return -1; + + switch (type) { + case DRM_NODE_PRIMARY: + case DRM_NODE_CONTROL: + case DRM_NODE_RENDER: + return type; + default: + return -1; + } +} + +static const char *drmGetMinorName(int type) +{ + switch (type) { + case DRM_NODE_PRIMARY: + return "card"; + case DRM_NODE_CONTROL: + return "controlD"; + case DRM_NODE_RENDER: + return "renderD"; + default: + return NULL; + } +} /** * Open the device by bus ID. * * \param busid bus ID. + * \param type device node type. * * \return a file descriptor on success, or a negative value on error. * @@ -476,16 +558,20 @@ * * \sa drmOpenMinor() and drmGetBusid(). */ -static int drmOpenByBusid(const char *busid) +static int drmOpenByBusid(const char *busid, int type) { int i, pci_domain_ok = 1; int fd; const char *buf; drmSetVersion sv; + int base = drmGetMinorBase(type); + + if (base < 0) + return -1; drmMsg("drmOpenByBusid: Searching for BusID %s\n", busid); - for (i = 0; i < DRM_MAX_MINOR; i++) { - fd = drmOpenMinor(i, 1, DRM_NODE_RENDER); + for (i = base; i < base + DRM_MAX_MINOR; i++) { + fd = drmOpenMinor(i, 1, type); drmMsg("drmOpenByBusid: drmOpenMinor returns %d\n", fd); if (fd >= 0) { /* We need to try for 1.4 first for proper PCI domain support @@ -525,6 +611,7 @@ * Open the device by name. * * \param name driver name. + * \param type the device node type. * * \return a file descriptor on success, or a negative value on error. * @@ -535,19 +622,23 @@ * * \sa drmOpenMinor(), drmGetVersion() and drmGetBusid(). */ -static int drmOpenByName(const char *name) +static int drmOpenByName(const char *name, int type) { int i; int fd; drmVersionPtr version; char * id; + int base = drmGetMinorBase(type); + + if (base < 0) + return -1; /* * Open the first minor number that matches the driver name and isn't * already in use. If it's in use it will have a busid assigned already. */ - for (i = 0; i < DRM_MAX_MINOR; i++) { - if ((fd = drmOpenMinor(i, 1, DRM_NODE_RENDER)) >= 0) { + for (i = base; i < base + DRM_MAX_MINOR; i++) { + if ((fd = drmOpenMinor(i, 1, type)) >= 0) { if ((version = drmGetVersion(fd))) { if (!strcmp(version->name, name)) { drmFreeVersion(version); @@ -589,9 +680,9 @@ for (devstring = ++pt; *pt && *pt != ' '; ++pt) ; if (*pt) { /* Found busid */ - return drmOpenByBusid(++pt); + return drmOpenByBusid(++pt, type); } else { /* No busid */ - return drmOpenDevice(strtol(devstring, NULL, 0),i, DRM_NODE_RENDER); + return drmOpenDevice(strtol(devstring, NULL, 0),i, type); } } } @@ -621,8 +712,29 @@ */ int drmOpen(const char *name, const char *busid) { + return drmOpenWithType(name, busid, DRM_NODE_PRIMARY); +} + +/** + * Open the DRM device with specified type. + * + * Looks up the specified name and bus ID, and opens the device found. The + * entry in /dev/dri is created if necessary and if called by root. + * + * \param name driver name. Not referenced if bus ID is supplied. + * \param busid bus ID. Zero if not known. + * \param type the device node type to open, PRIMARY, CONTROL or RENDER + * + * \return a file descriptor on success, or a negative value on error. + * + * \internal + * It calls drmOpenByBusid() if \p busid is specified or drmOpenByName() + * otherwise. + */ +int drmOpenWithType(const char *name, const char *busid, int type) +{ if (!drmAvailable() && name != NULL && drm_server_info) { - /* try to load the kernel */ + /* try to load the kernel module */ if (!drm_server_info->load_module(name)) { drmMsg("[drm] failed to load kernel module \"%s\"\n", name); return -1; @@ -630,13 +742,13 @@ } if (busid) { - int fd = drmOpenByBusid(busid); + int fd = drmOpenByBusid(busid, type); if (fd >= 0) return fd; } if (name) - return drmOpenByName(name); + return drmOpenByName(name, type); return -1; } @@ -646,6 +758,11 @@ return drmOpenMinor(minor, 0, DRM_NODE_CONTROL); } +int drmOpenRender(int minor) +{ + return drmOpenMinor(minor, 0, DRM_NODE_RENDER); +} + /** * Free the version information returned by drmGetVersion(). * @@ -730,12 +847,7 @@ drmVersionPtr retval; drm_version_t *version = drmMalloc(sizeof(*version)); - version->name_len = 0; - version->name = NULL; - version->date_len = 0; - version->date = NULL; - version->desc_len = 0; - version->desc = NULL; + memclear(*version); if (drmIoctl(fd, DRM_IOCTL_VERSION, version)) { drmFreeKernelVersion(version); @@ -803,9 +915,12 @@ int drmGetCap(int fd, uint64_t capability, uint64_t *value) { - struct drm_get_cap cap = { capability, 0 }; + struct drm_get_cap cap; int ret; + memclear(cap); + cap.capability = capability; + ret = drmIoctl(fd, DRM_IOCTL_GET_CAP, &cap); if (ret) return ret; @@ -816,7 +931,11 @@ int drmSetClientCap(int fd, uint64_t capability, uint64_t value) { - struct drm_set_client_cap cap = { capability, value }; + struct drm_set_client_cap cap; + + memclear(cap); + cap.capability = capability; + cap.value = value; return drmIoctl(fd, DRM_IOCTL_SET_CLIENT_CAP, &cap); } @@ -851,8 +970,7 @@ { drm_unique_t u; - u.unique_len = 0; - u.unique = NULL; + memclear(u); if (drmIoctl(fd, DRM_IOCTL_GET_UNIQUE, &u)) return NULL; @@ -881,6 +999,7 @@ { drm_unique_t u; + memclear(u); u.unique = (char *)busid; u.unique_len = strlen(busid); @@ -894,6 +1013,8 @@ { drm_auth_t auth; + memclear(auth); + *magic = 0; if (drmIoctl(fd, DRM_IOCTL_GET_MAGIC, &auth)) return -errno; @@ -905,6 +1026,7 @@ { drm_auth_t auth; + memclear(auth); auth.magic = magic; if (drmIoctl(fd, DRM_IOCTL_AUTH_MAGIC, &auth)) return -errno; @@ -966,9 +1088,9 @@ { drm_map_t map; + memclear(map); map.offset = offset; map.size = size; - map.handle = 0; map.type = type; map.flags = flags; if (drmIoctl(fd, DRM_IOCTL_ADD_MAP, &map)) @@ -982,6 +1104,7 @@ { drm_map_t map; + memclear(map); map.handle = (void *)(uintptr_t)handle; if(drmIoctl(fd, DRM_IOCTL_RM_MAP, &map)) @@ -1010,10 +1133,9 @@ { drm_buf_desc_t request; + memclear(request); request.count = count; request.size = size; - request.low_mark = 0; - request.high_mark = 0; request.flags = flags; request.agp_start = agp_offset; @@ -1027,8 +1149,7 @@ drm_buf_info_t info; int i; - info.count = 0; - info.list = NULL; + memclear(info); if (drmIoctl(fd, DRM_IOCTL_INFO_BUFS, &info)) return -EINVAL; @@ -1078,6 +1199,7 @@ { drm_buf_free_t request; + memclear(request); request.count = count; request.list = list; if (drmIoctl(fd, DRM_IOCTL_FREE_BUFS, &request)) @@ -1137,7 +1259,7 @@ size = (size + pagesize_mask) & ~pagesize_mask; - *address = mmap(0, size, PROT_READ|PROT_WRITE, MAP_SHARED, fd, handle); + *address = drm_mmap(0, size, PROT_READ|PROT_WRITE, MAP_SHARED, fd, handle); if (*address == MAP_FAILED) return -errno; return 0; @@ -1157,7 +1279,7 @@ */ int drmUnmap(drmAddress address, drmSize size) { - return munmap(address, size); + return drm_munmap(address, size); } drmBufInfoPtr drmGetBufInfo(int fd) @@ -1166,8 +1288,7 @@ drmBufInfoPtr retval; int i; - info.count = 0; - info.list = NULL; + memclear(info); if (drmIoctl(fd, DRM_IOCTL_INFO_BUFS, &info)) return NULL; @@ -1217,9 +1338,7 @@ drmBufMapPtr retval; int i; - bufs.count = 0; - bufs.list = NULL; - bufs.virtual = NULL; + memclear(bufs); if (drmIoctl(fd, DRM_IOCTL_MAP_BUFS, &bufs)) return NULL; @@ -1264,7 +1383,7 @@ int i; for (i = 0; i < bufs->count; i++) { - munmap(bufs->list[i].address, bufs->list[i].total); + drm_munmap(bufs->list[i].address, bufs->list[i].total); } drmFree(bufs->list); @@ -1335,6 +1454,7 @@ { drm_lock_t lock; + memclear(lock); lock.context = context; lock.flags = 0; if (flags & DRM_LOCK_READY) lock.flags |= _DRM_LOCK_READY; @@ -1365,8 +1485,8 @@ { drm_lock_t lock; + memclear(lock); lock.context = context; - lock.flags = 0; return drmIoctl(fd, DRM_IOCTL_UNLOCK, &lock); } @@ -1377,8 +1497,7 @@ drm_context_t * retval; int i; - res.count = 0; - res.contexts = NULL; + memclear(res); if (drmIoctl(fd, DRM_IOCTL_RES_CTX, &res)) return NULL; @@ -1431,7 +1550,7 @@ { drm_ctx_t ctx; - ctx.flags = 0; /* Modified with functions below */ + memclear(ctx); if (drmIoctl(fd, DRM_IOCTL_ADD_CTX, &ctx)) return -errno; *handle = ctx.handle; @@ -1442,6 +1561,7 @@ { drm_ctx_t ctx; + memclear(ctx); ctx.handle = context; if (drmIoctl(fd, DRM_IOCTL_SWITCH_CTX, &ctx)) return -errno; @@ -1458,8 +1578,8 @@ * X server (which promises to maintain hardware context), or in the * client-side library when buffers are swapped on behalf of two threads. */ + memclear(ctx); ctx.handle = context; - ctx.flags = 0; if (flags & DRM_CONTEXT_PRESERVED) ctx.flags |= _DRM_CONTEXT_PRESERVED; if (flags & DRM_CONTEXT_2DONLY) @@ -1474,6 +1594,7 @@ { drm_ctx_t ctx; + memclear(ctx); ctx.handle = context; if (drmIoctl(fd, DRM_IOCTL_GET_CTX, &ctx)) return -errno; @@ -1505,6 +1626,8 @@ int drmDestroyContext(int fd, drm_context_t handle) { drm_ctx_t ctx; + + memclear(ctx); ctx.handle = handle; if (drmIoctl(fd, DRM_IOCTL_RM_CTX, &ctx)) return -errno; @@ -1514,6 +1637,8 @@ int drmCreateDrawable(int fd, drm_drawable_t *handle) { drm_draw_t draw; + + memclear(draw); if (drmIoctl(fd, DRM_IOCTL_ADD_DRAW, &draw)) return -errno; *handle = draw.handle; @@ -1523,6 +1648,8 @@ int drmDestroyDrawable(int fd, drm_drawable_t handle) { drm_draw_t draw; + + memclear(draw); draw.handle = handle; if (drmIoctl(fd, DRM_IOCTL_RM_DRAW, &draw)) return -errno; @@ -1535,6 +1662,7 @@ { drm_update_draw_t update; + memclear(update); update.handle = handle; update.type = type; update.num = num; @@ -1600,6 +1728,7 @@ { drm_agp_mode_t m; + memclear(mode); m.mode = mode; if (drmIoctl(fd, DRM_IOCTL_AGP_ENABLE, &m)) return -errno; @@ -1628,9 +1757,9 @@ { drm_agp_buffer_t b; + memclear(b); *handle = DRM_AGP_NO_HANDLE; b.size = size; - b.handle = 0; b.type = type; if (drmIoctl(fd, DRM_IOCTL_AGP_ALLOC, &b)) return -errno; @@ -1657,7 +1786,7 @@ { drm_agp_buffer_t b; - b.size = 0; + memclear(b); b.handle = handle; if (drmIoctl(fd, DRM_IOCTL_AGP_FREE, &b)) return -errno; @@ -1682,6 +1811,7 @@ { drm_agp_binding_t b; + memclear(b); b.handle = handle; b.offset = offset; if (drmIoctl(fd, DRM_IOCTL_AGP_BIND, &b)) @@ -1706,8 +1836,8 @@ { drm_agp_binding_t b; + memclear(b); b.handle = handle; - b.offset = 0; if (drmIoctl(fd, DRM_IOCTL_AGP_UNBIND, &b)) return -errno; return 0; @@ -1729,6 +1859,8 @@ { drm_agp_info_t i; + memclear(i); + if (drmIoctl(fd, DRM_IOCTL_AGP_INFO, &i)) return -errno; return i.agp_version_major; @@ -1750,6 +1882,8 @@ { drm_agp_info_t i; + memclear(i); + if (drmIoctl(fd, DRM_IOCTL_AGP_INFO, &i)) return -errno; return i.agp_version_minor; @@ -1771,6 +1905,8 @@ { drm_agp_info_t i; + memclear(i); + if (drmIoctl(fd, DRM_IOCTL_AGP_INFO, &i)) return 0; return i.mode; @@ -1792,6 +1928,8 @@ { drm_agp_info_t i; + memclear(i); + if (drmIoctl(fd, DRM_IOCTL_AGP_INFO, &i)) return 0; return i.aperture_base; @@ -1813,6 +1951,8 @@ { drm_agp_info_t i; + memclear(i); + if (drmIoctl(fd, DRM_IOCTL_AGP_INFO, &i)) return 0; return i.aperture_size; @@ -1834,6 +1974,8 @@ { drm_agp_info_t i; + memclear(i); + if (drmIoctl(fd, DRM_IOCTL_AGP_INFO, &i)) return 0; return i.memory_used; @@ -1855,6 +1997,8 @@ { drm_agp_info_t i; + memclear(i); + if (drmIoctl(fd, DRM_IOCTL_AGP_INFO, &i)) return 0; return i.memory_allowed; @@ -1876,6 +2020,8 @@ { drm_agp_info_t i; + memclear(i); + if (drmIoctl(fd, DRM_IOCTL_AGP_INFO, &i)) return 0; return i.id_vendor; @@ -1897,6 +2043,8 @@ { drm_agp_info_t i; + memclear(i); + if (drmIoctl(fd, DRM_IOCTL_AGP_INFO, &i)) return 0; return i.id_device; @@ -1906,9 +2054,10 @@ { drm_scatter_gather_t sg; + memclear(sg); + *handle = 0; sg.size = size; - sg.handle = 0; if (drmIoctl(fd, DRM_IOCTL_SG_ALLOC, &sg)) return -errno; *handle = sg.handle; @@ -1919,7 +2068,7 @@ { drm_scatter_gather_t sg; - sg.size = 0; + memclear(sg); sg.handle = handle; if (drmIoctl(fd, DRM_IOCTL_SG_FREE, &sg)) return -errno; @@ -2010,6 +2159,7 @@ { drm_control_t ctl; + memclear(ctl); ctl.func = DRM_INST_HANDLER; ctl.irq = irq; if (drmIoctl(fd, DRM_IOCTL_CONTROL, &ctl)) @@ -2033,6 +2183,7 @@ { drm_control_t ctl; + memclear(ctl); ctl.func = DRM_UNINST_HANDLER; ctl.irq = 0; if (drmIoctl(fd, DRM_IOCTL_CONTROL, &ctl)) @@ -2044,8 +2195,8 @@ { drm_lock_t lock; + memclear(lock); lock.context = context; - lock.flags = 0; if (flags & DRM_LOCK_READY) lock.flags |= _DRM_LOCK_READY; if (flags & DRM_LOCK_QUIESCENT) lock.flags |= _DRM_LOCK_QUIESCENT; if (flags & DRM_LOCK_FLUSH) lock.flags |= _DRM_LOCK_FLUSH; @@ -2075,6 +2226,7 @@ { drm_irq_busid_t p; + memclear(p); p.busnum = busnum; p.devnum = devnum; p.funcnum = funcnum; @@ -2117,6 +2269,7 @@ { drm_ctx_priv_map_t map; + memclear(map); map.ctx_id = ctx_id; map.handle = (void *)(uintptr_t)handle; @@ -2130,6 +2283,7 @@ { drm_ctx_priv_map_t map; + memclear(map); map.ctx_id = ctx_id; if (drmIoctl(fd, DRM_IOCTL_GET_SAREA_CTX, &map)) @@ -2146,6 +2300,7 @@ { drm_map_t map; + memclear(map); map.offset = idx; if (drmIoctl(fd, DRM_IOCTL_GET_MAP, &map)) return -errno; @@ -2163,6 +2318,7 @@ { drm_client_t client; + memclear(client); client.idx = idx; if (drmIoctl(fd, DRM_IOCTL_GET_CLIENT, &client)) return -errno; @@ -2177,8 +2333,9 @@ int drmGetStats(int fd, drmStatsT *stats) { drm_stats_t s; - int i; + unsigned i; + memclear(s); if (drmIoctl(fd, DRM_IOCTL_GET_STATS, &s)) return -errno; @@ -2316,6 +2473,7 @@ int retcode = 0; drm_set_version_t sv; + memclear(sv); sv.drm_di_major = version->drm_di_major; sv.drm_di_minor = version->drm_di_minor; sv.drm_dd_major = version->drm_dd_major; @@ -2347,12 +2505,11 @@ */ int drmCommandNone(int fd, unsigned long drmCommandIndex) { - void *data = NULL; /* dummy */ unsigned long request; request = DRM_IO( DRM_COMMAND_BASE + drmCommandIndex); - if (drmIoctl(fd, request, data)) { + if (drmIoctl(fd, request, NULL)) { return -errno; } return 0; @@ -2449,6 +2606,7 @@ char *BusID; int fd; int refcount; + int type; } connection[DRM_MAX_FDS]; static int nr_fds = 0; @@ -2457,23 +2615,30 @@ const char *BusID, int *newlyopened) { + return drmOpenOnceWithType(BusID, newlyopened, DRM_NODE_PRIMARY); +} + +int drmOpenOnceWithType(const char *BusID, int *newlyopened, int type) +{ int i; int fd; for (i = 0; i < nr_fds; i++) - if (strcmp(BusID, connection[i].BusID) == 0) { + if ((strcmp(BusID, connection[i].BusID) == 0) && + (connection[i].type == type)) { connection[i].refcount++; *newlyopened = 0; return connection[i].fd; } - fd = drmOpen(unused, BusID); + fd = drmOpenWithType(NULL, BusID, type); if (fd <= 0 || nr_fds == DRM_MAX_FDS) return fd; connection[nr_fds].BusID = strdup(BusID); connection[nr_fds].fd = fd; connection[nr_fds].refcount = 1; + connection[nr_fds].type = type; *newlyopened = 1; if (0) @@ -2507,12 +2672,12 @@ int drmSetMaster(int fd) { - return ioctl(fd, DRM_IOCTL_SET_MASTER, 0); + return drmIoctl(fd, DRM_IOCTL_SET_MASTER, NULL); } int drmDropMaster(int fd) { - return ioctl(fd, DRM_IOCTL_DROP_MASTER, 0); + return drmIoctl(fd, DRM_IOCTL_DROP_MASTER, NULL); } char *drmGetDeviceNameFromFd(int fd) @@ -2541,6 +2706,28 @@ return strdup(name); } +int drmGetNodeTypeFromFd(int fd) +{ + struct stat sbuf; + int maj, min, type; + + if (fstat(fd, &sbuf)) + return -1; + + maj = major(sbuf.st_rdev); + min = minor(sbuf.st_rdev); + + if (maj != DRM_MAJOR || !S_ISCHR(sbuf.st_mode)) { + errno = EINVAL; + return -1; + } + + type = drmGetMinorType(min); + if (type == -1) + errno = ENODEV; + return type; +} + int drmPrimeHandleToFD(int fd, uint32_t handle, uint32_t flags, int *prime_fd) { struct drm_prime_handle args; @@ -2571,3 +2758,71 @@ return 0; } +static char *drmGetMinorNameForFD(int fd, int type) +{ +#ifdef __linux__ + DIR *sysdir; + struct dirent *pent, *ent; + struct stat sbuf; + const char *name = drmGetMinorName(type); + int len; + char dev_name[64], buf[64]; + long name_max; + int maj, min; + + if (!name) + return NULL; + + len = strlen(name); + + if (fstat(fd, &sbuf)) + return NULL; + + maj = major(sbuf.st_rdev); + min = minor(sbuf.st_rdev); + + if (maj != DRM_MAJOR || !S_ISCHR(sbuf.st_mode)) + return NULL; + + snprintf(buf, sizeof(buf), "/sys/dev/char/%d:%d/device/drm", maj, min); + + sysdir = opendir(buf); + if (!sysdir) + return NULL; + + name_max = fpathconf(dirfd(sysdir), _PC_NAME_MAX); + if (name_max == -1) + goto out_close_dir; + + pent = malloc(offsetof(struct dirent, d_name) + name_max + 1); + if (pent == NULL) + goto out_close_dir; + + while (readdir_r(sysdir, pent, &ent) == 0 && ent != NULL) { + if (strncmp(ent->d_name, name, len) == 0) { + free(pent); + closedir(sysdir); + + snprintf(dev_name, sizeof(dev_name), DRM_DIR_NAME "/%s", + ent->d_name); + return strdup(dev_name); + } + } + + free(pent); + +out_close_dir: + closedir(sysdir); +#endif + return NULL; +} + +char *drmGetPrimaryDeviceNameFromFd(int fd) +{ + return drmGetMinorNameForFD(fd, DRM_NODE_PRIMARY); +} + +char *drmGetRenderDeviceNameFromFd(int fd) +{ + return drmGetMinorNameForFD(fd, DRM_NODE_RENDER); +} diff -Nru libdrm-2.4.56/xf86drm.h libdrm-2.4.60/xf86drm.h --- libdrm-2.4.56/xf86drm.h 2014-05-30 16:38:28.000000000 +0000 +++ libdrm-2.4.60/xf86drm.h 2015-03-18 17:33:36.000000000 +0000 @@ -79,6 +79,7 @@ #define DRM_DIR_NAME "/dev/dri" #define DRM_DEV_NAME "%s/card%d" #define DRM_CONTROL_DEV_NAME "%s/controlD%d" +#define DRM_RENDER_DEV_NAME "%s/renderD%d" #define DRM_PROC_NAME "/proc/dri/" /* For backward Linux compatibility */ #define DRM_ERR_NO_DEVICE (-1001) @@ -551,7 +552,15 @@ /* General user-level programmer's API: unprivileged */ extern int drmAvailable(void); extern int drmOpen(const char *name, const char *busid); -extern int drmOpenControl(int minor); + +#define DRM_NODE_PRIMARY 0 +#define DRM_NODE_CONTROL 1 +#define DRM_NODE_RENDER 2 +extern int drmOpenWithType(const char *name, const char *busid, + int type); + +extern int drmOpenControl(int minor); +extern int drmOpenRender(int minor); extern int drmClose(int fd); extern drmVersionPtr drmGetVersion(int fd); extern drmVersionPtr drmGetLibVersion(int fd); @@ -703,6 +712,7 @@ unsigned long *next_key, void **next_value); extern int drmOpenOnce(void *unused, const char *BusID, int *newlyopened); +extern int drmOpenOnceWithType(const char *BusID, int *newlyopened, int type); extern void drmCloseOnce(int fd); extern void drmMsg(const char *format, ...) DRM_PRINTFLIKE(1, 2); @@ -734,10 +744,14 @@ extern int drmHandleEvent(int fd, drmEventContextPtr evctx); extern char *drmGetDeviceNameFromFd(int fd); +extern int drmGetNodeTypeFromFd(int fd); extern int drmPrimeHandleToFD(int fd, uint32_t handle, uint32_t flags, int *prime_fd); extern int drmPrimeFDToHandle(int fd, int prime_fd, uint32_t *handle); +extern char *drmGetPrimaryDeviceNameFromFd(int fd); +extern char *drmGetRenderDeviceNameFromFd(int fd); + #if defined(__cplusplus) || defined(c_plusplus) } #endif diff -Nru libdrm-2.4.56/xf86drmMode.c libdrm-2.4.60/xf86drmMode.c --- libdrm-2.4.56/xf86drmMode.c 2014-05-30 16:38:28.000000000 +0000 +++ libdrm-2.4.60/xf86drmMode.c 2015-03-18 17:33:36.000000000 +0000 @@ -61,7 +61,7 @@ #define VG(x) #endif -#define VG_CLEAR(s) VG(memset(&s, 0, sizeof(s))) +#define memclear(s) memset(&s, 0, sizeof(s)) #define U642VOID(x) ((void *)(unsigned long)(x)) #define VOID2U64(x) ((uint64_t)(unsigned long)(x)) @@ -76,7 +76,7 @@ * Util functions */ -void* drmAllocCpy(void *array, int count, int entry_size) +static void* drmAllocCpy(char *array, int count, int entry_size) { char *r; int i; @@ -164,7 +164,7 @@ drmModeResPtr r = 0; retry: - memset(&res, 0, sizeof(struct drm_mode_card_res)); + memclear(res); if (drmIoctl(fd, DRM_IOCTL_MODE_GETRESOURCES, &res)) return 0; @@ -259,7 +259,7 @@ struct drm_mode_fb_cmd f; int ret; - VG_CLEAR(f); + memclear(f); f.width = width; f.height = height; f.pitch = pitch; @@ -282,6 +282,7 @@ struct drm_mode_fb_cmd2 f; int ret; + memclear(f); f.width = width; f.height = height; f.pixel_format = pixel_format; @@ -300,8 +301,6 @@ int drmModeRmFB(int fd, uint32_t bufferId) { return DRM_IOCTL(fd, DRM_IOCTL_MODE_RMFB, &bufferId); - - } drmModeFBPtr drmModeGetFB(int fd, uint32_t buf) @@ -309,6 +308,7 @@ struct drm_mode_fb_cmd info; drmModeFBPtr r; + memclear(info); info.fb_id = buf; if (drmIoctl(fd, DRM_IOCTL_MODE_GETFB, &info)) @@ -331,8 +331,9 @@ int drmModeDirtyFB(int fd, uint32_t bufferId, drmModeClipPtr clips, uint32_t num_clips) { - struct drm_mode_fb_dirty_cmd dirty = { 0 }; + struct drm_mode_fb_dirty_cmd dirty; + memclear(dirty); dirty.fb_id = bufferId; dirty.clips_ptr = VOID2U64(clips); dirty.num_clips = num_clips; @@ -350,7 +351,7 @@ struct drm_mode_crtc crtc; drmModeCrtcPtr r; - VG_CLEAR(crtc); + memclear(crtc); crtc.crtc_id = crtcId; if (drmIoctl(fd, DRM_IOCTL_MODE_GETCRTC, &crtc)) @@ -384,7 +385,7 @@ { struct drm_mode_crtc crtc; - VG_CLEAR(crtc); + memclear(crtc); crtc.x = x; crtc.y = y; crtc.crtc_id = crtcId; @@ -394,8 +395,7 @@ if (mode) { memcpy(&crtc.mode, mode, sizeof(struct drm_mode_modeinfo)); crtc.mode_valid = 1; - } else - crtc.mode_valid = 0; + } return DRM_IOCTL(fd, DRM_IOCTL_MODE_SETCRTC, &crtc); } @@ -408,6 +408,7 @@ { struct drm_mode_cursor arg; + memclear(arg); arg.flags = DRM_MODE_CURSOR_BO; arg.crtc_id = crtcId; arg.width = width; @@ -421,6 +422,7 @@ { struct drm_mode_cursor2 arg; + memclear(arg); arg.flags = DRM_MODE_CURSOR_BO; arg.crtc_id = crtcId; arg.width = width; @@ -436,6 +438,7 @@ { struct drm_mode_cursor arg; + memclear(arg); arg.flags = DRM_MODE_CURSOR_MOVE; arg.crtc_id = crtcId; arg.x = x; @@ -452,11 +455,8 @@ struct drm_mode_get_encoder enc; drmModeEncoderPtr r = NULL; + memclear(enc); enc.encoder_id = encoder_id; - enc.crtc_id = 0; - enc.encoder_type = 0; - enc.possible_crtcs = 0; - enc.possible_clones = 0; if (drmIoctl(fd, DRM_IOCTL_MODE_GETENCODER, &enc)) return 0; @@ -483,7 +483,7 @@ drmModeConnectorPtr r = NULL; retry: - memset(&conn, 0, sizeof(struct drm_mode_get_connector)); + memclear(conn); conn.connector_id = connector_id; if (drmIoctl(fd, DRM_IOCTL_MODE_GETCONNECTOR, &conn)) @@ -576,6 +576,7 @@ { struct drm_mode_mode_cmd res; + memclear(res); memcpy(&res.mode, mode_info, sizeof(struct drm_mode_modeinfo)); res.connector_id = connector_id; @@ -586,6 +587,7 @@ { struct drm_mode_mode_cmd res; + memclear(res); memcpy(&res.mode, mode_info, sizeof(struct drm_mode_modeinfo)); res.connector_id = connector_id; @@ -598,13 +600,8 @@ struct drm_mode_get_property prop; drmModePropertyPtr r; - VG_CLEAR(prop); + memclear(prop); prop.prop_id = property_id; - prop.count_enum_blobs = 0; - prop.count_values = 0; - prop.flags = 0; - prop.enum_blob_ptr = 0; - prop.values_ptr = 0; if (drmIoctl(fd, DRM_IOCTL_MODE_GETPROPERTY, &prop)) return 0; @@ -667,8 +664,7 @@ struct drm_mode_get_blob blob; drmModePropertyBlobPtr r; - blob.length = 0; - blob.data = 0; + memclear(blob); blob.blob_id = blob_id; if (drmIoctl(fd, DRM_IOCTL_MODE_GETPROPBLOB, &blob)) @@ -708,6 +704,7 @@ { struct drm_mode_connector_set_property osp; + memclear(osp); osp.connector_id = connector_id; osp.prop_id = property_id; osp.value = value; @@ -806,6 +803,8 @@ return -EINVAL; return (modesetting ? 0 : -ENOSYS); } +#elif defined(__DragonFly__) + return 0; #endif return -ENOSYS; @@ -816,6 +815,7 @@ { struct drm_mode_crtc_lut l; + memclear(l); l.crtc_id = crtc_id; l.gamma_size = size; l.red = VOID2U64(red); @@ -830,6 +830,7 @@ { struct drm_mode_crtc_lut l; + memclear(l); l.crtc_id = crtc_id; l.gamma_size = size; l.red = VOID2U64(red); @@ -852,7 +853,7 @@ len = read(fd, buffer, sizeof buffer); if (len == 0) return 0; - if (len < sizeof *e) + if (len < (int)sizeof *e) return -1; i = 0; @@ -895,11 +896,11 @@ { struct drm_mode_crtc_page_flip flip; + memclear(flip); flip.fb_id = fb_id; flip.crtc_id = crtc_id; flip.user_data = VOID2U64(user_data); flip.flags = flags; - flip.reserved = 0; return DRM_IOCTL(fd, DRM_IOCTL_MODE_PAGE_FLIP, &flip); } @@ -914,6 +915,7 @@ { struct drm_mode_set_plane s; + memclear(s); s.plane_id = plane_id; s.crtc_id = crtc_id; s.fb_id = fb_id; @@ -937,7 +939,7 @@ drmModePlanePtr r = 0; retry: - memset(&ovr, 0, sizeof(struct drm_mode_get_plane)); + memclear(ovr); ovr.plane_id = plane_id; if (drmIoctl(fd, DRM_IOCTL_MODE_GETPLANE, &ovr)) return 0; @@ -997,7 +999,7 @@ drmModePlaneResPtr r = 0; retry: - memset(&res, 0, sizeof(struct drm_mode_get_plane_res)); + memclear(res); if (drmIoctl(fd, DRM_IOCTL_MODE_GETPLANERESOURCES, &res)) return 0; @@ -1054,7 +1056,7 @@ uint32_t count; retry: - memset(&properties, 0, sizeof(struct drm_mode_obj_get_properties)); + memclear(properties); properties.obj_id = object_id; properties.obj_type = object_type; @@ -1120,6 +1122,7 @@ { struct drm_mode_obj_set_property prop; + memclear(prop); prop.value = value; prop.prop_id = property_id; prop.obj_id = object_id; diff -Nru libdrm-2.4.56/xf86drmMode.h libdrm-2.4.60/xf86drmMode.h --- libdrm-2.4.56/xf86drmMode.h 2014-07-25 17:40:07.000000000 +0000 +++ libdrm-2.4.60/xf86drmMode.h 2015-02-28 18:34:25.000000000 +0000 @@ -240,6 +240,15 @@ uint32_t *blob_ids; /* store the blob IDs */ } drmModePropertyRes, *drmModePropertyPtr; +static inline int drm_property_type_is(drmModePropertyPtr property, + uint32_t type) +{ + /* instanceof for props.. handles extended type vs original types: */ + if (property->flags & DRM_MODE_PROP_EXTENDED_TYPE) + return (property->flags & DRM_MODE_PROP_EXTENDED_TYPE) == type; + return property->flags & type; +} + typedef struct _drmModeCrtc { uint32_t crtc_id; uint32_t buffer_id; /**< FB id to connect to 0 = disconnect */ diff -Nru libdrm-2.4.56/xf86drmRandom.c libdrm-2.4.60/xf86drmRandom.c --- libdrm-2.4.56/xf86drmRandom.c 2014-03-30 23:55:27.000000000 +0000 +++ libdrm-2.4.60/xf86drmRandom.c 2015-02-28 18:34:25.000000000 +0000 @@ -98,7 +98,7 @@ unsigned long q; /* m div a */ unsigned long r; /* m mod a */ unsigned long check; - long seed; + unsigned long seed; } RandomState; #if RANDOM_MAIN @@ -147,13 +147,13 @@ unsigned long drmRandom(void *state) { RandomState *s = (RandomState *)state; - long hi; - long lo; + unsigned long hi; + unsigned long lo; hi = s->seed / s->q; lo = s->seed % s->q; s->seed = s->a * lo - s->r * hi; - if (s->seed <= 0) s->seed += s->m; + if ((s->a * lo) <= (s->r * hi)) s->seed += s->m; return s->seed; } @@ -166,7 +166,7 @@ } #if RANDOM_MAIN -static void check_period(long seed) +static void check_period(unsigned long seed) { unsigned long count = 0; unsigned long initial; @@ -178,7 +178,7 @@ while (initial != drmRandom(state)) { if (!++count) break; } - printf("With seed of %10ld, period = %10lu (0x%08lx)\n", + printf("With seed of %10lu, period = %10lu (0x%08lx)\n", seed, count, count); drmRandomDestroy(state); }