Merge libdrm 2.4.75

This commit is contained in:
jsg 2017-02-05 05:46:41 +00:00
parent ae9658c5c0
commit 6f7c809ebb
59 changed files with 1461 additions and 2195 deletions

View File

@ -22,6 +22,7 @@ include Makefile.sources
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS} ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
AM_MAKEFLAGS = -s
AM_DISTCHECK_CONFIGURE_FLAGS = \ AM_DISTCHECK_CONFIGURE_FLAGS = \
--enable-udev \ --enable-udev \
--enable-libkms \ --enable-libkms \

View File

@ -1,6 +1,6 @@
# $OpenBSD: Makefile.bsd-wrapper,v 1.9 2016/11/19 05:45:00 jsg Exp $ # $OpenBSD: Makefile.bsd-wrapper,v 1.10 2017/02/05 05:46:41 jsg Exp $
SHARED_LIBS= drm 7.3 drm_radeon 4.0 drm_intel 5.3 \ SHARED_LIBS= drm 7.4 drm_radeon 4.0 drm_intel 5.4 \
drm_amdgpu 1.2 drm_nouveau 3.0 drm_amdgpu 1.2 drm_nouveau 3.0
.include <bsd.xorg.mk> .include <bsd.xorg.mk>

View File

@ -306,8 +306,6 @@ LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@ LIBOBJS = @LIBOBJS@
LIBS = @LIBS@ LIBS = @LIBS@
LIBTOOL = @LIBTOOL@ LIBTOOL = @LIBTOOL@
LIBUDEV_CFLAGS = @LIBUDEV_CFLAGS@
LIBUDEV_LIBS = @LIBUDEV_LIBS@
LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_DIR = @LIB_MAN_DIR@
LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@
LIPO = @LIPO@ LIPO = @LIPO@
@ -450,6 +448,7 @@ LIBDRM_INCLUDE_VMWGFX_H_FILES := \
include/drm/vmwgfx_drm.h include/drm/vmwgfx_drm.h
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS} ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
AM_MAKEFLAGS = -s
AM_DISTCHECK_CONFIGURE_FLAGS = \ AM_DISTCHECK_CONFIGURE_FLAGS = \
--enable-udev \ --enable-udev \
--enable-libkms \ --enable-libkms \

View File

@ -13,6 +13,7 @@ LIBDRM_FILES := \
util_math.h util_math.h
LIBDRM_H_FILES := \ LIBDRM_H_FILES := \
libsync.h \
xf86drm.h \ xf86drm.h \
xf86drmMode.h xf86drmMode.h

View File

@ -1,7 +1,7 @@
libdrm - userspace library for drm libdrm - userspace library for drm
This is libdrm, a userspace library for accessing the DRM, direct This is libdrm, a userspace library for accessing the DRM, direct
rendering manager, on Linux, BSD and other operating systes that rendering manager, on Linux, BSD and other operating systems that
support the ioctl interface. The library provides wrapper functions support the ioctl interface. The library provides wrapper functions
for the ioctls to avoid exposing the kernel interface directly, and for the ioctls to avoid exposing the kernel interface directly, and
for chipsets with drm memory manager, support for tracking relocations for chipsets with drm memory manager, support for tracking relocations
@ -15,7 +15,7 @@ with an older kernel.
Compiling Compiling
--------- ---------
libdrm is a standard autotools packages and follows the normal libdrm is a standard autotools package and follows the normal
configure, build and install steps. The first step is to configure configure, build and install steps. The first step is to configure
the package, which is done by running the configure shell script: the package, which is done by running the configure shell script:
@ -37,5 +37,5 @@ and once make finishes successfully, install the package using
make install make install
If you are install into a system location, you will need to be root to If you are installing into a system location, you will need to be root
perform the install step. to perform the install step.

View File

@ -236,8 +236,6 @@ LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@ LIBOBJS = @LIBOBJS@
LIBS = @LIBS@ LIBS = @LIBS@
LIBTOOL = @LIBTOOL@ LIBTOOL = @LIBTOOL@
LIBUDEV_CFLAGS = @LIBUDEV_CFLAGS@
LIBUDEV_LIBS = @LIBUDEV_LIBS@
LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_DIR = @LIB_MAN_DIR@
LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@
LIPO = @LIPO@ LIPO = @LIPO@

View File

@ -54,9 +54,6 @@
/* Enable if your compiler supports the Intel __sync_* atomic primitives */ /* Enable if your compiler supports the Intel __sync_* atomic primitives */
#undef HAVE_LIBDRM_ATOMIC_PRIMITIVES #undef HAVE_LIBDRM_ATOMIC_PRIMITIVES
/* Have libudev support */
#undef HAVE_LIBUDEV
/* Enable if you have libatomic-ops-dev installed */ /* Enable if you have libatomic-ops-dev installed */
#undef HAVE_LIB_ATOMIC_OPS #undef HAVE_LIB_ATOMIC_OPS

462
lib/libdrm/configure vendored
View File

@ -1,6 +1,6 @@
#! /bin/sh #! /bin/sh
# Guess values for system-dependent variables and create Makefiles. # Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for libdrm 2.4.73. # Generated by GNU Autoconf 2.69 for libdrm 2.4.75.
# #
# Report bugs to <https://bugs.freedesktop.org/enter_bug.cgi?product=DRI>. # Report bugs to <https://bugs.freedesktop.org/enter_bug.cgi?product=DRI>.
# #
@ -591,8 +591,8 @@ MAKEFLAGS=
# Identity of this package. # Identity of this package.
PACKAGE_NAME='libdrm' PACKAGE_NAME='libdrm'
PACKAGE_TARNAME='libdrm' PACKAGE_TARNAME='libdrm'
PACKAGE_VERSION='2.4.73' PACKAGE_VERSION='2.4.75'
PACKAGE_STRING='libdrm 2.4.73' PACKAGE_STRING='libdrm 2.4.75'
PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=DRI' PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=DRI'
PACKAGE_URL='' PACKAGE_URL=''
@ -646,10 +646,6 @@ HAVE_MANPAGES_STYLESHEET_TRUE
MANPAGES_STYLESHEET MANPAGES_STYLESHEET
BUILD_MANPAGES_FALSE BUILD_MANPAGES_FALSE
BUILD_MANPAGES_TRUE BUILD_MANPAGES_TRUE
HAVE_LIBUDEV_FALSE
HAVE_LIBUDEV_TRUE
LIBUDEV_LIBS
LIBUDEV_CFLAGS
HAVE_CAIRO_FALSE HAVE_CAIRO_FALSE
HAVE_CAIRO_TRUE HAVE_CAIRO_TRUE
CAIRO_LIBS CAIRO_LIBS
@ -688,13 +684,13 @@ HAVE_LIBKMS_FALSE
HAVE_LIBKMS_TRUE HAVE_LIBKMS_TRUE
PCIACCESS_LIBS PCIACCESS_LIBS
PCIACCESS_CFLAGS PCIACCESS_CFLAGS
PKG_CONFIG_LIBDIR
PKG_CONFIG_PATH
PKG_CONFIG
CLOCK_LIB CLOCK_LIB
pkgconfigdir pkgconfigdir
PTHREADSTUBS_LIBS PTHREADSTUBS_LIBS
PTHREADSTUBS_CFLAGS PTHREADSTUBS_CFLAGS
PKG_CONFIG_LIBDIR
PKG_CONFIG_PATH
PKG_CONFIG
OTOOL64 OTOOL64
OTOOL OTOOL
LIPO LIPO
@ -876,16 +872,12 @@ CPP
PKG_CONFIG PKG_CONFIG
PKG_CONFIG_PATH PKG_CONFIG_PATH
PKG_CONFIG_LIBDIR PKG_CONFIG_LIBDIR
PTHREADSTUBS_CFLAGS
PTHREADSTUBS_LIBS
PCIACCESS_CFLAGS PCIACCESS_CFLAGS
PCIACCESS_LIBS PCIACCESS_LIBS
CUNIT_CFLAGS CUNIT_CFLAGS
CUNIT_LIBS CUNIT_LIBS
CAIRO_CFLAGS CAIRO_CFLAGS
CAIRO_LIBS CAIRO_LIBS
LIBUDEV_CFLAGS
LIBUDEV_LIBS
VALGRIND_CFLAGS VALGRIND_CFLAGS
VALGRIND_LIBS' VALGRIND_LIBS'
@ -1428,7 +1420,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing. # 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. # This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF cat <<_ACEOF
\`configure' configures libdrm 2.4.73 to adapt to many kinds of systems. \`configure' configures libdrm 2.4.75 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]... Usage: $0 [OPTION]... [VAR=VALUE]...
@ -1498,7 +1490,7 @@ fi
if test -n "$ac_init_help"; then if test -n "$ac_init_help"; then
case $ac_init_help in case $ac_init_help in
short | recursive ) echo "Configuration of libdrm 2.4.73:";; short | recursive ) echo "Configuration of libdrm 2.4.75:";;
esac esac
cat <<\_ACEOF cat <<\_ACEOF
@ -1583,10 +1575,6 @@ Some influential environment variables:
directories to add to pkg-config's search path directories to add to pkg-config's search path
PKG_CONFIG_LIBDIR PKG_CONFIG_LIBDIR
path overriding pkg-config's built-in search path path overriding pkg-config's built-in search path
PTHREADSTUBS_CFLAGS
C compiler flags for PTHREADSTUBS, overriding pkg-config
PTHREADSTUBS_LIBS
linker flags for PTHREADSTUBS, overriding pkg-config
PCIACCESS_CFLAGS PCIACCESS_CFLAGS
C compiler flags for PCIACCESS, overriding pkg-config C compiler flags for PCIACCESS, overriding pkg-config
PCIACCESS_LIBS PCIACCESS_LIBS
@ -1597,10 +1585,6 @@ Some influential environment variables:
CAIRO_CFLAGS CAIRO_CFLAGS
C compiler flags for CAIRO, overriding pkg-config C compiler flags for CAIRO, overriding pkg-config
CAIRO_LIBS linker flags for CAIRO, overriding pkg-config CAIRO_LIBS linker flags for CAIRO, overriding pkg-config
LIBUDEV_CFLAGS
C compiler flags for LIBUDEV, overriding pkg-config
LIBUDEV_LIBS
linker flags for LIBUDEV, overriding pkg-config
VALGRIND_CFLAGS VALGRIND_CFLAGS
C compiler flags for VALGRIND, overriding pkg-config C compiler flags for VALGRIND, overriding pkg-config
VALGRIND_LIBS VALGRIND_LIBS
@ -1672,7 +1656,7 @@ fi
test -n "$ac_init_help" && exit $ac_status test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then if $ac_init_version; then
cat <<\_ACEOF cat <<\_ACEOF
libdrm configure 2.4.73 libdrm configure 2.4.75
generated by GNU Autoconf 2.69 generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc. Copyright (C) 2012 Free Software Foundation, Inc.
@ -2095,7 +2079,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake. running configure, to aid debugging if configure makes a mistake.
It was created by libdrm $as_me 2.4.73, which was It was created by libdrm $as_me 2.4.75, which was
generated by GNU Autoconf 2.69. Invocation command line was generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@ $ $0 $@
@ -3318,7 +3302,7 @@ fi
# Define the identity of the package. # Define the identity of the package.
PACKAGE='libdrm' PACKAGE='libdrm'
VERSION='2.4.73' VERSION='2.4.75'
cat >>confdefs.h <<_ACEOF cat >>confdefs.h <<_ACEOF
@ -12610,216 +12594,6 @@ CC="$lt_save_CC"
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_path_PKG_CONFIG+:} false; then :
$as_echo_n "(cached) " >&6
else
case $PKG_CONFIG in
[\\/]* | ?:[\\/]*)
ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
;;
*)
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
;;
esac
fi
PKG_CONFIG=$ac_cv_path_PKG_CONFIG
if test -n "$PKG_CONFIG"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
$as_echo "$PKG_CONFIG" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
fi
if test -z "$ac_cv_path_PKG_CONFIG"; then
ac_pt_PKG_CONFIG=$PKG_CONFIG
# Extract the first word of "pkg-config", so it can be a program name with args.
set dummy pkg-config; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
$as_echo_n "(cached) " >&6
else
case $ac_pt_PKG_CONFIG in
[\\/]* | ?:[\\/]*)
ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
;;
*)
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
;;
esac
fi
ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
if test -n "$ac_pt_PKG_CONFIG"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
$as_echo "$ac_pt_PKG_CONFIG" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
if test "x$ac_pt_PKG_CONFIG" = x; then
PKG_CONFIG=""
else
case $cross_compiling:$ac_tool_warned in
yes:)
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
PKG_CONFIG=$ac_pt_PKG_CONFIG
fi
else
PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
fi
fi
if test -n "$PKG_CONFIG"; then
_pkg_min_version=0.9.0
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
PKG_CONFIG=""
fi
fi
pkg_failed=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for PTHREADSTUBS" >&5
$as_echo_n "checking for PTHREADSTUBS... " >&6; }
if test -n "$PTHREADSTUBS_CFLAGS"; then
pkg_cv_PTHREADSTUBS_CFLAGS="$PTHREADSTUBS_CFLAGS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"pthread-stubs\""; } >&5
($PKG_CONFIG --exists --print-errors "pthread-stubs") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_PTHREADSTUBS_CFLAGS=`$PKG_CONFIG --cflags "pthread-stubs" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
fi
else
pkg_failed=untried
fi
if test -n "$PTHREADSTUBS_LIBS"; then
pkg_cv_PTHREADSTUBS_LIBS="$PTHREADSTUBS_LIBS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"pthread-stubs\""; } >&5
($PKG_CONFIG --exists --print-errors "pthread-stubs") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_PTHREADSTUBS_LIBS=`$PKG_CONFIG --libs "pthread-stubs" 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
PTHREADSTUBS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "pthread-stubs" 2>&1`
else
PTHREADSTUBS_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "pthread-stubs" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$PTHREADSTUBS_PKG_ERRORS" >&5
as_fn_error $? "Package requirements (pthread-stubs) were not met:
$PTHREADSTUBS_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 PTHREADSTUBS_CFLAGS
and PTHREADSTUBS_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 PTHREADSTUBS_CFLAGS
and PTHREADSTUBS_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
To get pkg-config, see <http://pkg-config.freedesktop.org/>.
See \`config.log' for more details" "$LINENO" 5; }
else
PTHREADSTUBS_CFLAGS=$pkg_cv_PTHREADSTUBS_CFLAGS
PTHREADSTUBS_LIBS=$pkg_cv_PTHREADSTUBS_LIBS
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
fi
pkgconfigdir=${libdir}/pkgconfig pkgconfigdir=${libdir}/pkgconfig
# Check whether --enable-udev was given. # Check whether --enable-udev was given.
@ -13266,6 +13040,126 @@ fi
if test "x$INTEL" != "xno"; then if test "x$INTEL" != "xno"; then
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_path_PKG_CONFIG+:} false; then :
$as_echo_n "(cached) " >&6
else
case $PKG_CONFIG in
[\\/]* | ?:[\\/]*)
ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
;;
*)
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
;;
esac
fi
PKG_CONFIG=$ac_cv_path_PKG_CONFIG
if test -n "$PKG_CONFIG"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
$as_echo "$PKG_CONFIG" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
fi
if test -z "$ac_cv_path_PKG_CONFIG"; then
ac_pt_PKG_CONFIG=$PKG_CONFIG
# Extract the first word of "pkg-config", so it can be a program name with args.
set dummy pkg-config; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
$as_echo_n "(cached) " >&6
else
case $ac_pt_PKG_CONFIG in
[\\/]* | ?:[\\/]*)
ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
;;
*)
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
;;
esac
fi
ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
if test -n "$ac_pt_PKG_CONFIG"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
$as_echo "$ac_pt_PKG_CONFIG" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
if test "x$ac_pt_PKG_CONFIG" = x; then
PKG_CONFIG=""
else
case $cross_compiling:$ac_tool_warned in
yes:)
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
PKG_CONFIG=$ac_pt_PKG_CONFIG
fi
else
PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
fi
fi
if test -n "$PKG_CONFIG"; then
_pkg_min_version=0.9.0
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
PKG_CONFIG=""
fi
fi
pkg_failed=no pkg_failed=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for PCIACCESS" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PCIACCESS" >&5
$as_echo_n "checking for PCIACCESS... " >&6; } $as_echo_n "checking for PCIACCESS... " >&6; }
@ -13824,92 +13718,6 @@ else
fi fi
# For enumerating devices in test case
pkg_failed=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBUDEV" >&5
$as_echo_n "checking for LIBUDEV... " >&6; }
if test -n "$LIBUDEV_CFLAGS"; then
pkg_cv_LIBUDEV_CFLAGS="$LIBUDEV_CFLAGS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libudev\""; } >&5
($PKG_CONFIG --exists --print-errors "libudev") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_LIBUDEV_CFLAGS=`$PKG_CONFIG --cflags "libudev" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
fi
else
pkg_failed=untried
fi
if test -n "$LIBUDEV_LIBS"; then
pkg_cv_LIBUDEV_LIBS="$LIBUDEV_LIBS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libudev\""; } >&5
($PKG_CONFIG --exists --print-errors "libudev") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_LIBUDEV_LIBS=`$PKG_CONFIG --libs "libudev" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
fi
else
pkg_failed=untried
fi
if test $pkg_failed = yes; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
_pkg_short_errors_supported=yes
else
_pkg_short_errors_supported=no
fi
if test $_pkg_short_errors_supported = yes; then
LIBUDEV_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libudev" 2>&1`
else
LIBUDEV_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libudev" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$LIBUDEV_PKG_ERRORS" >&5
HAVE_LIBUDEV=no
elif test $pkg_failed = untried; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
HAVE_LIBUDEV=no
else
LIBUDEV_CFLAGS=$pkg_cv_LIBUDEV_CFLAGS
LIBUDEV_LIBS=$pkg_cv_LIBUDEV_LIBS
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
HAVE_LIBUDEV=yes
fi
if test "x$HAVE_LIBUDEV" = xyes; then
$as_echo "#define HAVE_LIBUDEV 1" >>confdefs.h
fi
if test "x$HAVE_LIBUDEV" = xyes; then
HAVE_LIBUDEV_TRUE=
HAVE_LIBUDEV_FALSE='#'
else
HAVE_LIBUDEV_TRUE='#'
HAVE_LIBUDEV_FALSE=
fi
# xsltproc for docbook manpages # xsltproc for docbook manpages
# Check whether --enable-manpages was given. # Check whether --enable-manpages was given.
if test "${enable_manpages+set}" = set; then : if test "${enable_manpages+set}" = set; then :
@ -14320,10 +14128,6 @@ if test -z "${HAVE_CAIRO_TRUE}" && test -z "${HAVE_CAIRO_FALSE}"; then
as_fn_error $? "conditional \"HAVE_CAIRO\" was never defined. as_fn_error $? "conditional \"HAVE_CAIRO\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5 Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi fi
if test -z "${HAVE_LIBUDEV_TRUE}" && test -z "${HAVE_LIBUDEV_FALSE}"; then
as_fn_error $? "conditional \"HAVE_LIBUDEV\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${BUILD_MANPAGES_TRUE}" && test -z "${BUILD_MANPAGES_FALSE}"; then if test -z "${BUILD_MANPAGES_TRUE}" && test -z "${BUILD_MANPAGES_FALSE}"; then
as_fn_error $? "conditional \"BUILD_MANPAGES\" was never defined. as_fn_error $? "conditional \"BUILD_MANPAGES\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5 Usually this means the macro was only invoked conditionally." "$LINENO" 5
@ -14729,7 +14533,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their # report actual input values of CONFIG_FILES etc. instead of their
# values after options handling. # values after options handling.
ac_log=" ac_log="
This file was extended by libdrm $as_me 2.4.73, which was This file was extended by libdrm $as_me 2.4.75, which was
generated by GNU Autoconf 2.69. Invocation command line was generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES CONFIG_FILES = $CONFIG_FILES
@ -14795,7 +14599,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\ ac_cs_version="\\
libdrm config.status 2.4.73 libdrm config.status 2.4.75
configured by $0, generated by GNU Autoconf 2.69, configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\" with options \\"\$ac_cs_config\\"

View File

@ -20,7 +20,7 @@
AC_PREREQ([2.63]) AC_PREREQ([2.63])
AC_INIT([libdrm], AC_INIT([libdrm],
[2.4.73], [2.4.75],
[https://bugs.freedesktop.org/enter_bug.cgi?product=DRI], [https://bugs.freedesktop.org/enter_bug.cgi?product=DRI],
[libdrm]) [libdrm])
@ -61,7 +61,7 @@ LT_PREREQ([2.2])
LT_INIT([disable-static]) LT_INIT([disable-static])
PKG_CHECK_MODULES(PTHREADSTUBS, pthread-stubs)
AC_SUBST(PTHREADSTUBS_CFLAGS) AC_SUBST(PTHREADSTUBS_CFLAGS)
AC_SUBST(PTHREADSTUBS_LIBS) AC_SUBST(PTHREADSTUBS_LIBS)
@ -451,13 +451,6 @@ fi
AC_MSG_RESULT([$CAIRO]) AC_MSG_RESULT([$CAIRO])
AM_CONDITIONAL(HAVE_CAIRO, [test "x$CAIRO" = xyes]) AM_CONDITIONAL(HAVE_CAIRO, [test "x$CAIRO" = xyes])
# For enumerating devices in test case
PKG_CHECK_MODULES(LIBUDEV, libudev, [HAVE_LIBUDEV=yes], [HAVE_LIBUDEV=no])
if test "x$HAVE_LIBUDEV" = xyes; then
AC_DEFINE(HAVE_LIBUDEV, 1, [Have libudev support])
fi
AM_CONDITIONAL(HAVE_LIBUDEV, [test "x$HAVE_LIBUDEV" = xyes])
# xsltproc for docbook manpages # xsltproc for docbook manpages
AC_ARG_ENABLE([manpages], AC_ARG_ENABLE([manpages],
AS_HELP_STRING([--enable-manpages], [enable manpages @<:@default=auto@:>@]), AS_HELP_STRING([--enable-manpages], [enable manpages @<:@default=auto@:>@]),

View File

@ -211,8 +211,6 @@ LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@ LIBOBJS = @LIBOBJS@
LIBS = @LIBS@ LIBS = @LIBS@
LIBTOOL = @LIBTOOL@ LIBTOOL = @LIBTOOL@
LIBUDEV_CFLAGS = @LIBUDEV_CFLAGS@
LIBUDEV_LIBS = @LIBUDEV_LIBS@
LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_DIR = @LIB_MAN_DIR@
LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@
LIPO = @LIPO@ LIPO = @LIPO@

View File

@ -212,8 +212,6 @@ LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@ LIBOBJS = @LIBOBJS@
LIBS = @LIBS@ LIBS = @LIBS@
LIBTOOL = @LIBTOOL@ LIBTOOL = @LIBTOOL@
LIBUDEV_CFLAGS = @LIBUDEV_CFLAGS@
LIBUDEV_LIBS = @LIBUDEV_LIBS@
LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_DIR = @LIB_MAN_DIR@
LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@
LIPO = @LIPO@ LIPO = @LIPO@

View File

@ -226,8 +226,6 @@ LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@ LIBOBJS = @LIBOBJS@
LIBS = @LIBS@ LIBS = @LIBS@
LIBTOOL = @LIBTOOL@ LIBTOOL = @LIBTOOL@
LIBUDEV_CFLAGS = @LIBUDEV_CFLAGS@
LIBUDEV_LIBS = @LIBUDEV_LIBS@
LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_DIR = @LIB_MAN_DIR@
LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@
LIPO = @LIPO@ LIPO = @LIPO@

View File

@ -29,6 +29,10 @@
#include "drm.h" #include "drm.h"
#if defined(__cplusplus)
extern "C" {
#endif
/* Please note that modifications to all structs defined here are /* Please note that modifications to all structs defined here are
* subject to backwards-compatibility constraints. * subject to backwards-compatibility constraints.
*/ */
@ -58,6 +62,30 @@
#define I915_ERROR_UEVENT "ERROR" #define I915_ERROR_UEVENT "ERROR"
#define I915_RESET_UEVENT "RESET" #define I915_RESET_UEVENT "RESET"
/*
* MOCS indexes used for GPU surfaces, defining the cacheability of the
* surface data and the coherency for this data wrt. CPU vs. GPU accesses.
*/
enum i915_mocs_table_index {
/*
* Not cached anywhere, coherency between CPU and GPU accesses is
* guaranteed.
*/
I915_MOCS_UNCACHED,
/*
* Cacheability and coherency controlled by the kernel automatically
* based on the DRM_I915_GEM_SET_CACHING IOCTL setting and the current
* usage of the surface (used for display scanout or not).
*/
I915_MOCS_PTE,
/*
* Cached in all GPU caches available on the platform.
* Coherency between CPU and GPU accesses to the surface is not
* guaranteed without extra synchronization.
*/
I915_MOCS_CACHED,
};
/* Each region is a minimum of 16k, and there are at most 255 of them. /* Each region is a minimum of 16k, and there are at most 255 of them.
*/ */
#define I915_NR_TEX_REGIONS 255 /* table size 2k - maximum due to use #define I915_NR_TEX_REGIONS 255 /* table size 2k - maximum due to use
@ -225,6 +253,7 @@ typedef struct _drm_i915_sarea {
#endif #endif
#define DRM_I915_OVERLAY_PUT_IMAGE 0x27 #define DRM_I915_OVERLAY_PUT_IMAGE 0x27
#define DRM_I915_OVERLAY_ATTRS 0x28 #define DRM_I915_OVERLAY_ATTRS 0x28
#define DRM_I915_GEM_EXECBUFFER2_WR DRM_I915_GEM_EXECBUFFER2
#define DRM_I915_GET_SPRITE_COLORKEY 0x2a #define DRM_I915_GET_SPRITE_COLORKEY 0x2a
#define DRM_I915_SET_SPRITE_COLORKEY 0x2b #define DRM_I915_SET_SPRITE_COLORKEY 0x2b
#define DRM_I915_GEM_WAIT 0x2c #define DRM_I915_GEM_WAIT 0x2c
@ -237,6 +266,7 @@ typedef struct _drm_i915_sarea {
#define DRM_I915_GEM_USERPTR 0x33 #define DRM_I915_GEM_USERPTR 0x33
#define DRM_I915_GEM_CONTEXT_GETPARAM 0x34 #define DRM_I915_GEM_CONTEXT_GETPARAM 0x34
#define DRM_I915_GEM_CONTEXT_SETPARAM 0x35 #define DRM_I915_GEM_CONTEXT_SETPARAM 0x35
#define DRM_I915_PERF_OPEN 0x36
#define DRM_IOCTL_I915_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_I915_INIT, drm_i915_init_t) #define DRM_IOCTL_I915_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_I915_INIT, drm_i915_init_t)
#define DRM_IOCTL_I915_FLUSH DRM_IO ( DRM_COMMAND_BASE + DRM_I915_FLUSH) #define DRM_IOCTL_I915_FLUSH DRM_IO ( DRM_COMMAND_BASE + DRM_I915_FLUSH)
@ -258,6 +288,7 @@ typedef struct _drm_i915_sarea {
#define DRM_IOCTL_I915_GEM_INIT DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_INIT, struct drm_i915_gem_init) #define DRM_IOCTL_I915_GEM_INIT DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_INIT, struct drm_i915_gem_init)
#define DRM_IOCTL_I915_GEM_EXECBUFFER DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_EXECBUFFER, struct drm_i915_gem_execbuffer) #define DRM_IOCTL_I915_GEM_EXECBUFFER DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_EXECBUFFER, struct drm_i915_gem_execbuffer)
#define DRM_IOCTL_I915_GEM_EXECBUFFER2 DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_EXECBUFFER2, struct drm_i915_gem_execbuffer2) #define DRM_IOCTL_I915_GEM_EXECBUFFER2 DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_EXECBUFFER2, struct drm_i915_gem_execbuffer2)
#define DRM_IOCTL_I915_GEM_EXECBUFFER2_WR DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_EXECBUFFER2_WR, struct drm_i915_gem_execbuffer2)
#define DRM_IOCTL_I915_GEM_PIN DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_PIN, struct drm_i915_gem_pin) #define DRM_IOCTL_I915_GEM_PIN DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_PIN, struct drm_i915_gem_pin)
#define DRM_IOCTL_I915_GEM_UNPIN DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_UNPIN, struct drm_i915_gem_unpin) #define DRM_IOCTL_I915_GEM_UNPIN DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_UNPIN, struct drm_i915_gem_unpin)
#define DRM_IOCTL_I915_GEM_BUSY DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_BUSY, struct drm_i915_gem_busy) #define DRM_IOCTL_I915_GEM_BUSY DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_BUSY, struct drm_i915_gem_busy)
@ -290,6 +321,7 @@ typedef struct _drm_i915_sarea {
#define DRM_IOCTL_I915_GEM_USERPTR DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_USERPTR, struct drm_i915_gem_userptr) #define DRM_IOCTL_I915_GEM_USERPTR DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_USERPTR, struct drm_i915_gem_userptr)
#define DRM_IOCTL_I915_GEM_CONTEXT_GETPARAM DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_CONTEXT_GETPARAM, struct drm_i915_gem_context_param) #define DRM_IOCTL_I915_GEM_CONTEXT_GETPARAM DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_CONTEXT_GETPARAM, struct drm_i915_gem_context_param)
#define DRM_IOCTL_I915_GEM_CONTEXT_SETPARAM DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_CONTEXT_SETPARAM, struct drm_i915_gem_context_param) #define DRM_IOCTL_I915_GEM_CONTEXT_SETPARAM DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_CONTEXT_SETPARAM, struct drm_i915_gem_context_param)
#define DRM_IOCTL_I915_PERF_OPEN DRM_IOW(DRM_COMMAND_BASE + DRM_I915_PERF_OPEN, struct drm_i915_perf_open_param)
/* Allow drivers to submit batchbuffers directly to hardware, relying /* Allow drivers to submit batchbuffers directly to hardware, relying
* on the security mechanisms provided by hardware. * on the security mechanisms provided by hardware.
@ -364,8 +396,28 @@ typedef struct drm_i915_irq_wait {
#define I915_PARAM_HAS_GPU_RESET 35 #define I915_PARAM_HAS_GPU_RESET 35
#define I915_PARAM_HAS_RESOURCE_STREAMER 36 #define I915_PARAM_HAS_RESOURCE_STREAMER 36
#define I915_PARAM_HAS_EXEC_SOFTPIN 37 #define I915_PARAM_HAS_EXEC_SOFTPIN 37
#define I915_PARAM_HAS_POOLED_EU 38 #define I915_PARAM_HAS_POOLED_EU 38
#define I915_PARAM_MIN_EU_IN_POOL 39 #define I915_PARAM_MIN_EU_IN_POOL 39
#define I915_PARAM_MMAP_GTT_VERSION 40
/* Query whether DRM_I915_GEM_EXECBUFFER2 supports user defined execution
* priorities and the driver will attempt to execute batches in priority order.
*/
#define I915_PARAM_HAS_SCHEDULER 41
#define I915_PARAM_HUC_STATUS 42
/* Query whether DRM_I915_GEM_EXECBUFFER2 supports the ability to opt-out of
* synchronisation with implicit fencing on individual objects.
* See EXEC_OBJECT_ASYNC.
*/
#define I915_PARAM_HAS_EXEC_ASYNC 43
/* Query whether DRM_I915_GEM_EXECBUFFER2 supports explicit fence support -
* both being able to pass in a sync_file fd to wait upon before executing,
* and being able to return a new sync_file fd that is signaled when the
* current request is complete. See I915_EXEC_FENCE_IN and I915_EXEC_FENCE_OUT.
*/
#define I915_PARAM_HAS_EXEC_FENCE 44
typedef struct drm_i915_getparam { typedef struct drm_i915_getparam {
__s32 param; __s32 param;
@ -703,15 +755,41 @@ struct drm_i915_gem_exec_object2 {
*/ */
__u64 offset; __u64 offset;
#define EXEC_OBJECT_NEEDS_FENCE (1<<0) #define EXEC_OBJECT_NEEDS_FENCE (1<<0)
#define EXEC_OBJECT_NEEDS_GTT (1<<1) #define EXEC_OBJECT_NEEDS_GTT (1<<1)
#define EXEC_OBJECT_WRITE (1<<2) #define EXEC_OBJECT_WRITE (1<<2)
#define EXEC_OBJECT_SUPPORTS_48B_ADDRESS (1<<3) #define EXEC_OBJECT_SUPPORTS_48B_ADDRESS (1<<3)
#define EXEC_OBJECT_PINNED (1<<4) #define EXEC_OBJECT_PINNED (1<<4)
#define __EXEC_OBJECT_UNKNOWN_FLAGS -(EXEC_OBJECT_PINNED<<1) #define EXEC_OBJECT_PAD_TO_SIZE (1<<5)
/* The kernel implicitly tracks GPU activity on all GEM objects, and
* synchronises operations with outstanding rendering. This includes
* rendering on other devices if exported via dma-buf. However, sometimes
* this tracking is too coarse and the user knows better. For example,
* if the object is split into non-overlapping ranges shared between different
* clients or engines (i.e. suballocating objects), the implicit tracking
* by kernel assumes that each operation affects the whole object rather
* than an individual range, causing needless synchronisation between clients.
* The kernel will also forgo any CPU cache flushes prior to rendering from
* the object as the client is expected to be also handling such domain
* tracking.
*
* The kernel maintains the implicit tracking in order to manage resources
* used by the GPU - this flag only disables the synchronisation prior to
* rendering with this object in this execbuf.
*
* Opting out of implicit synhronisation requires the user to do its own
* explicit tracking to avoid rendering corruption. See, for example,
* I915_PARAM_HAS_EXEC_FENCE to order execbufs and execute them asynchronously.
*/
#define EXEC_OBJECT_ASYNC (1<<6)
/* All remaining bits are MBZ and RESERVED FOR FUTURE USE */
#define __EXEC_OBJECT_UNKNOWN_FLAGS -(EXEC_OBJECT_ASYNC<<1)
__u64 flags; __u64 flags;
__u64 rsvd1; union {
__u64 rsvd1;
__u64 pad_to_size;
};
__u64 rsvd2; __u64 rsvd2;
}; };
@ -797,7 +875,32 @@ struct drm_i915_gem_execbuffer2 {
*/ */
#define I915_EXEC_RESOURCE_STREAMER (1<<15) #define I915_EXEC_RESOURCE_STREAMER (1<<15)
#define __I915_EXEC_UNKNOWN_FLAGS -(I915_EXEC_RESOURCE_STREAMER<<1) /* Setting I915_EXEC_FENCE_IN implies that lower_32_bits(rsvd2) represent
* a sync_file fd to wait upon (in a nonblocking manner) prior to executing
* the batch.
*
* Returns -EINVAL if the sync_file fd cannot be found.
*/
#define I915_EXEC_FENCE_IN (1<<16)
/* Setting I915_EXEC_FENCE_OUT causes the ioctl to return a sync_file fd
* in the upper_32_bits(rsvd2) upon success. Ownership of the fd is given
* to the caller, and it should be close() after use. (The fd is a regular
* file descriptor and will be cleaned up on process termination. It holds
* a reference to the request, but nothing else.)
*
* The sync_file fd can be combined with other sync_file and passed either
* to execbuf using I915_EXEC_FENCE_IN, to atomic KMS ioctls (so that a flip
* will only occur after this request completes), or to other devices.
*
* Using I915_EXEC_FENCE_OUT requires use of
* DRM_IOCTL_I915_GEM_EXECBUFFER2_WR ioctl so that the result is written
* back to userspace. Failure to do so will cause the out-fence to always
* be reported as zero, and the real fence fd to be leaked.
*/
#define I915_EXEC_FENCE_OUT (1<<17)
#define __I915_EXEC_UNKNOWN_FLAGS (-(I915_EXEC_FENCE_OUT<<1))
#define I915_EXEC_CONTEXT_ID_MASK (0xffffffff) #define I915_EXEC_CONTEXT_ID_MASK (0xffffffff)
#define i915_execbuffer2_set_context_id(eb2, context) \ #define i915_execbuffer2_set_context_id(eb2, context) \
@ -833,7 +936,16 @@ struct drm_i915_gem_busy {
* having flushed any pending activity), and a non-zero return that * having flushed any pending activity), and a non-zero return that
* the object is still in-flight on the GPU. (The GPU has not yet * the object is still in-flight on the GPU. (The GPU has not yet
* signaled completion for all pending requests that reference the * signaled completion for all pending requests that reference the
* object.) * object.) An object is guaranteed to become idle eventually (so
* long as no new GPU commands are executed upon it). Due to the
* asynchronous nature of the hardware, an object reported
* as busy may become idle before the ioctl is completed.
*
* Furthermore, if the object is busy, which engine is busy is only
* provided as a guide. There are race conditions which prevent the
* report of which engines are busy from being always accurate.
* However, the converse is not true. If the object is idle, the
* result of the ioctl, that all engines are idle, is accurate.
* *
* The returned dword is split into two fields to indicate both * The returned dword is split into two fields to indicate both
* the engines on which the object is being read, and the * the engines on which the object is being read, and the
@ -856,6 +968,11 @@ struct drm_i915_gem_busy {
* execution engines, e.g. multiple media engines, which are * execution engines, e.g. multiple media engines, which are
* mapped to the same identifier in the EXECBUFFER2 ioctl and * mapped to the same identifier in the EXECBUFFER2 ioctl and
* so are not separately reported for busyness. * so are not separately reported for busyness.
*
* Caveat emptor:
* Only the boolean result of this query is reliable; that is whether
* the object is idle or busy. The report of which engines are busy
* should be only used as a heuristic.
*/ */
__u32 busy; __u32 busy;
}; };
@ -904,6 +1021,7 @@ struct drm_i915_gem_caching {
#define I915_TILING_NONE 0 #define I915_TILING_NONE 0
#define I915_TILING_X 1 #define I915_TILING_X 1
#define I915_TILING_Y 2 #define I915_TILING_Y 2
#define I915_TILING_LAST I915_TILING_Y
#define I915_BIT_6_SWIZZLE_NONE 0 #define I915_BIT_6_SWIZZLE_NONE 0
#define I915_BIT_6_SWIZZLE_9 1 #define I915_BIT_6_SWIZZLE_9 1
@ -1180,7 +1298,145 @@ struct drm_i915_gem_context_param {
#define I915_CONTEXT_PARAM_BAN_PERIOD 0x1 #define I915_CONTEXT_PARAM_BAN_PERIOD 0x1
#define I915_CONTEXT_PARAM_NO_ZEROMAP 0x2 #define I915_CONTEXT_PARAM_NO_ZEROMAP 0x2
#define I915_CONTEXT_PARAM_GTT_SIZE 0x3 #define I915_CONTEXT_PARAM_GTT_SIZE 0x3
#define I915_CONTEXT_PARAM_NO_ERROR_CAPTURE 0x4
#define I915_CONTEXT_PARAM_BANNABLE 0x5
__u64 value; __u64 value;
}; };
enum drm_i915_oa_format {
I915_OA_FORMAT_A13 = 1,
I915_OA_FORMAT_A29,
I915_OA_FORMAT_A13_B8_C8,
I915_OA_FORMAT_B4_C8,
I915_OA_FORMAT_A45_B8_C8,
I915_OA_FORMAT_B4_C8_A16,
I915_OA_FORMAT_C4_B8,
I915_OA_FORMAT_MAX /* non-ABI */
};
enum drm_i915_perf_property_id {
/**
* Open the stream for a specific context handle (as used with
* execbuffer2). A stream opened for a specific context this way
* won't typically require root privileges.
*/
DRM_I915_PERF_PROP_CTX_HANDLE = 1,
/**
* A value of 1 requests the inclusion of raw OA unit reports as
* part of stream samples.
*/
DRM_I915_PERF_PROP_SAMPLE_OA,
/**
* The value specifies which set of OA unit metrics should be
* be configured, defining the contents of any OA unit reports.
*/
DRM_I915_PERF_PROP_OA_METRICS_SET,
/**
* The value specifies the size and layout of OA unit reports.
*/
DRM_I915_PERF_PROP_OA_FORMAT,
/**
* Specifying this property implicitly requests periodic OA unit
* sampling and (at least on Haswell) the sampling frequency is derived
* from this exponent as follows:
*
* 80ns * 2^(period_exponent + 1)
*/
DRM_I915_PERF_PROP_OA_EXPONENT,
DRM_I915_PERF_PROP_MAX /* non-ABI */
};
struct drm_i915_perf_open_param {
__u32 flags;
#define I915_PERF_FLAG_FD_CLOEXEC (1<<0)
#define I915_PERF_FLAG_FD_NONBLOCK (1<<1)
#define I915_PERF_FLAG_DISABLED (1<<2)
/** The number of u64 (id, value) pairs */
__u32 num_properties;
/**
* Pointer to array of u64 (id, value) pairs configuring the stream
* to open.
*/
__u64 properties_ptr;
};
/**
* Enable data capture for a stream that was either opened in a disabled state
* via I915_PERF_FLAG_DISABLED or was later disabled via
* I915_PERF_IOCTL_DISABLE.
*
* It is intended to be cheaper to disable and enable a stream than it may be
* to close and re-open a stream with the same configuration.
*
* It's undefined whether any pending data for the stream will be lost.
*/
#define I915_PERF_IOCTL_ENABLE _IO('i', 0x0)
/**
* Disable data capture for a stream.
*
* It is an error to try and read a stream that is disabled.
*/
#define I915_PERF_IOCTL_DISABLE _IO('i', 0x1)
/**
* Common to all i915 perf records
*/
struct drm_i915_perf_record_header {
__u32 type;
__u16 pad;
__u16 size;
};
enum drm_i915_perf_record_type {
/**
* Samples are the work horse record type whose contents are extensible
* and defined when opening an i915 perf stream based on the given
* properties.
*
* Boolean properties following the naming convention
* DRM_I915_PERF_SAMPLE_xyz_PROP request the inclusion of 'xyz' data in
* every sample.
*
* The order of these sample properties given by userspace has no
* affect on the ordering of data within a sample. The order is
* documented here.
*
* struct {
* struct drm_i915_perf_record_header header;
*
* { u32 oa_report[]; } && DRM_I915_PERF_PROP_SAMPLE_OA
* };
*/
DRM_I915_PERF_RECORD_SAMPLE = 1,
/*
* Indicates that one or more OA reports were not written by the
* hardware. This can happen for example if an MI_REPORT_PERF_COUNT
* command collides with periodic sampling - which would be more likely
* at higher sampling frequencies.
*/
DRM_I915_PERF_RECORD_OA_REPORT_LOST = 2,
/**
* An error occurred that resulted in all pending OA reports being lost.
*/
DRM_I915_PERF_RECORD_OA_BUFFER_LOST = 3,
DRM_I915_PERF_RECORD_MAX /* non-ABI */
};
#if defined(__cplusplus)
}
#endif
#endif /* _I915_DRM_H_ */ #endif /* _I915_DRM_H_ */

View File

@ -68,6 +68,7 @@ EXTRA_DIST = \
tests/test-batch.sh \ tests/test-batch.sh \
$(TESTS) $(TESTS)
test_decode_LDADD = libdrm_intel.la ../libdrm.la test_decode_LDADD = libdrm_intel.la ../libdrm.la \
-lpthread
pkgconfig_DATA = libdrm_intel.pc pkgconfig_DATA = libdrm_intel.pc

View File

@ -245,8 +245,6 @@ LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@ LIBOBJS = @LIBOBJS@
LIBS = @LIBS@ LIBS = @LIBS@
LIBTOOL = @LIBTOOL@ LIBTOOL = @LIBTOOL@
LIBUDEV_CFLAGS = @LIBUDEV_CFLAGS@
LIBUDEV_LIBS = @LIBUDEV_LIBS@
LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_DIR = @LIB_MAN_DIR@
LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@
LIPO = @LIPO@ LIPO = @LIPO@
@ -397,7 +395,9 @@ EXTRA_DIST = \
tests/test-batch.sh \ tests/test-batch.sh \
$(TESTS) $(TESTS)
test_decode_LDADD = libdrm_intel.la ../libdrm.la test_decode_LDADD = libdrm_intel.la ../libdrm.la \
-lpthread
pkgconfig_DATA = libdrm_intel.pc pkgconfig_DATA = libdrm_intel.pc
all: all-am all: all-am

View File

@ -184,6 +184,11 @@ int drm_intel_gem_bo_map_unsynchronized(drm_intel_bo *bo);
int drm_intel_gem_bo_map_gtt(drm_intel_bo *bo); int drm_intel_gem_bo_map_gtt(drm_intel_bo *bo);
int drm_intel_gem_bo_unmap_gtt(drm_intel_bo *bo); int drm_intel_gem_bo_unmap_gtt(drm_intel_bo *bo);
#define HAVE_DRM_INTEL_GEM_BO_DISABLE_IMPLICIT_SYNC 1
int drm_intel_bufmgr_gem_can_disable_implicit_sync(drm_intel_bufmgr *bufmgr);
void drm_intel_gem_bo_disable_implicit_sync(drm_intel_bo *bo);
void drm_intel_gem_bo_enable_implicit_sync(drm_intel_bo *bo);
void *drm_intel_gem_bo_map__cpu(drm_intel_bo *bo); void *drm_intel_gem_bo_map__cpu(drm_intel_bo *bo);
void *drm_intel_gem_bo_map__gtt(drm_intel_bo *bo); void *drm_intel_gem_bo_map__gtt(drm_intel_bo *bo);
void *drm_intel_gem_bo_map__wc(drm_intel_bo *bo); void *drm_intel_gem_bo_map__wc(drm_intel_bo *bo);
@ -212,9 +217,17 @@ int drm_intel_bufmgr_gem_get_devid(drm_intel_bufmgr *bufmgr);
int drm_intel_gem_bo_wait(drm_intel_bo *bo, int64_t timeout_ns); int drm_intel_gem_bo_wait(drm_intel_bo *bo, int64_t timeout_ns);
drm_intel_context *drm_intel_gem_context_create(drm_intel_bufmgr *bufmgr); drm_intel_context *drm_intel_gem_context_create(drm_intel_bufmgr *bufmgr);
int drm_intel_gem_context_get_id(drm_intel_context *ctx,
uint32_t *ctx_id);
void drm_intel_gem_context_destroy(drm_intel_context *ctx); void drm_intel_gem_context_destroy(drm_intel_context *ctx);
int drm_intel_gem_bo_context_exec(drm_intel_bo *bo, drm_intel_context *ctx, int drm_intel_gem_bo_context_exec(drm_intel_bo *bo, drm_intel_context *ctx,
int used, unsigned int flags); int used, unsigned int flags);
int drm_intel_gem_bo_fence_exec(drm_intel_bo *bo,
drm_intel_context *ctx,
int used,
int in_fence,
int *out_fence,
unsigned int flags);
int drm_intel_bo_gem_export_to_prime(drm_intel_bo *bo, int *prime_fd); int drm_intel_bo_gem_export_to_prime(drm_intel_bo *bo, int *prime_fd);
drm_intel_bo *drm_intel_bo_gem_create_from_prime(drm_intel_bufmgr *bufmgr, drm_intel_bo *drm_intel_bo_gem_create_from_prime(drm_intel_bufmgr *bufmgr,

View File

@ -737,7 +737,7 @@ drm_intel_bufmgr_fake_wait_idle(drm_intel_bufmgr_fake *bufmgr_fake)
/** /**
* Wait for rendering to a buffer to complete. * Wait for rendering to a buffer to complete.
* *
* It is assumed that the bathcbuffer which performed the rendering included * It is assumed that the batchbuffer which performed the rendering included
* the necessary flushing. * the necessary flushing.
*/ */
static void static void
@ -1200,7 +1200,7 @@ static int
assert(!(bo_fake->flags & (BM_NO_BACKING_STORE | BM_PINNED))); assert(!(bo_fake->flags & (BM_NO_BACKING_STORE | BM_PINNED)));
/* Actually, should be able to just wait for a fence on the /* Actually, should be able to just wait for a fence on the
* mmory, hich we would be tracking when we free it. Waiting * memory, which we would be tracking when we free it. Waiting
* for idle is a sufficiently large hammer for now. * for idle is a sufficiently large hammer for now.
*/ */
drm_intel_bufmgr_fake_wait_idle(bufmgr_fake); drm_intel_bufmgr_fake_wait_idle(bufmgr_fake);

View File

@ -151,6 +151,7 @@ typedef struct _drm_intel_bufmgr_gem {
unsigned int bo_reuse : 1; unsigned int bo_reuse : 1;
unsigned int no_exec : 1; unsigned int no_exec : 1;
unsigned int has_vebox : 1; unsigned int has_vebox : 1;
unsigned int has_exec_async : 1;
bool fenced_relocs; bool fenced_relocs;
struct { struct {
@ -197,6 +198,8 @@ struct _drm_intel_bo_gem {
uint32_t swizzle_mode; uint32_t swizzle_mode;
unsigned long stride; unsigned long stride;
unsigned long kflags;
time_t free_time; time_t free_time;
/** Array passed to the DRM containing relocation information. */ /** Array passed to the DRM containing relocation information. */
@ -258,7 +261,7 @@ struct _drm_intel_bo_gem {
* Boolean of whether the GPU is definitely not accessing the buffer. * Boolean of whether the GPU is definitely not accessing the buffer.
* *
* This is only valid when reusable, since non-reusable * This is only valid when reusable, since non-reusable
* buffers are those that have been shared wth other * buffers are those that have been shared with other
* processes, so we don't know their state. * processes, so we don't know their state.
*/ */
bool idle; bool idle;
@ -296,7 +299,7 @@ struct _drm_intel_bo_gem {
*/ */
int reloc_tree_fences; int reloc_tree_fences;
/** Flags that we may need to do the SW_FINSIH ioctl on unmap. */ /** Flags that we may need to do the SW_FINISH ioctl on unmap. */
bool mapped_cpu_write; bool mapped_cpu_write;
}; };
@ -579,12 +582,11 @@ drm_intel_add_validate_buffer2(drm_intel_bo *bo, int need_fence)
bufmgr_gem->exec2_objects[index].relocation_count = bo_gem->reloc_count; bufmgr_gem->exec2_objects[index].relocation_count = bo_gem->reloc_count;
bufmgr_gem->exec2_objects[index].relocs_ptr = (uintptr_t)bo_gem->relocs; bufmgr_gem->exec2_objects[index].relocs_ptr = (uintptr_t)bo_gem->relocs;
bufmgr_gem->exec2_objects[index].alignment = bo->align; bufmgr_gem->exec2_objects[index].alignment = bo->align;
bufmgr_gem->exec2_objects[index].offset = bo_gem->is_softpin ? bufmgr_gem->exec2_objects[index].offset = bo->offset64;
bo->offset64 : 0; bufmgr_gem->exec2_objects[index].flags = flags | bo_gem->kflags;
bufmgr_gem->exec_bos[index] = bo;
bufmgr_gem->exec2_objects[index].flags = flags;
bufmgr_gem->exec2_objects[index].rsvd1 = 0; bufmgr_gem->exec2_objects[index].rsvd1 = 0;
bufmgr_gem->exec2_objects[index].rsvd2 = 0; bufmgr_gem->exec2_objects[index].rsvd2 = 0;
bufmgr_gem->exec_bos[index] = bo;
bufmgr_gem->exec_count++; bufmgr_gem->exec_count++;
} }
@ -1372,6 +1374,7 @@ drm_intel_gem_bo_unreference_final(drm_intel_bo *bo, time_t time)
for (i = 0; i < bo_gem->softpin_target_count; i++) for (i = 0; i < bo_gem->softpin_target_count; i++)
drm_intel_gem_bo_unreference_locked_timed(bo_gem->softpin_target[i], drm_intel_gem_bo_unreference_locked_timed(bo_gem->softpin_target[i],
time); time);
bo_gem->kflags = 0;
bo_gem->reloc_count = 0; bo_gem->reloc_count = 0;
bo_gem->used_as_reloc_target = false; bo_gem->used_as_reloc_target = false;
bo_gem->softpin_target_count = 0; bo_gem->softpin_target_count = 0;
@ -1412,6 +1415,8 @@ drm_intel_gem_bo_unreference_final(drm_intel_bo *bo, time_t time)
bo_gem->name = NULL; bo_gem->name = NULL;
bo_gem->validate_index = -1; bo_gem->validate_index = -1;
bo_gem->kflags = 0;
DRMLISTADDTAIL(&bo_gem->head, &bucket->head); DRMLISTADDTAIL(&bo_gem->head, &bucket->head);
} else { } else {
drm_intel_gem_bo_free(bo); drm_intel_gem_bo_free(bo);
@ -1723,7 +1728,7 @@ static int drm_intel_gem_bo_unmap(drm_intel_bo *bo)
} }
/* We need to unmap after every innovation as we cannot track /* We need to unmap after every innovation as we cannot track
* an open vma for every bo as that will exhaasut the system * an open vma for every bo as that will exhaust the system
* limits and cause later failures. * limits and cause later failures.
*/ */
if (--bo_gem->map_count == 0) { if (--bo_gem->map_count == 0) {
@ -2385,6 +2390,7 @@ drm_intel_gem_bo_exec(drm_intel_bo *bo, int used,
static int static int
do_exec2(drm_intel_bo *bo, int used, drm_intel_context *ctx, do_exec2(drm_intel_bo *bo, int used, drm_intel_context *ctx,
drm_clip_rect_t *cliprects, int num_cliprects, int DR4, drm_clip_rect_t *cliprects, int num_cliprects, int DR4,
int in_fence, int *out_fence,
unsigned int flags) unsigned int flags)
{ {
drm_intel_bufmgr_gem *bufmgr_gem = (drm_intel_bufmgr_gem *)bo->bufmgr; drm_intel_bufmgr_gem *bufmgr_gem = (drm_intel_bufmgr_gem *)bo->bufmgr;
@ -2441,12 +2447,20 @@ do_exec2(drm_intel_bo *bo, int used, drm_intel_context *ctx,
else else
i915_execbuffer2_set_context_id(execbuf, ctx->ctx_id); i915_execbuffer2_set_context_id(execbuf, ctx->ctx_id);
execbuf.rsvd2 = 0; execbuf.rsvd2 = 0;
if (in_fence != -1) {
execbuf.rsvd2 = in_fence;
execbuf.flags |= I915_EXEC_FENCE_IN;
}
if (out_fence != NULL) {
*out_fence = -1;
execbuf.flags |= I915_EXEC_FENCE_OUT;
}
if (bufmgr_gem->no_exec) if (bufmgr_gem->no_exec)
goto skip_execution; goto skip_execution;
ret = drmIoctl(bufmgr_gem->fd, ret = drmIoctl(bufmgr_gem->fd,
DRM_IOCTL_I915_GEM_EXECBUFFER2, DRM_IOCTL_I915_GEM_EXECBUFFER2_WR,
&execbuf); &execbuf);
if (ret != 0) { if (ret != 0) {
ret = -errno; ret = -errno;
@ -2462,6 +2476,9 @@ do_exec2(drm_intel_bo *bo, int used, drm_intel_context *ctx,
} }
drm_intel_update_buffer_offsets2(bufmgr_gem); drm_intel_update_buffer_offsets2(bufmgr_gem);
if (ret == 0 && out_fence != NULL)
*out_fence = execbuf.rsvd2 >> 32;
skip_execution: skip_execution:
if (bufmgr_gem->bufmgr.debug) if (bufmgr_gem->bufmgr.debug)
drm_intel_gem_dump_validation_list(bufmgr_gem); drm_intel_gem_dump_validation_list(bufmgr_gem);
@ -2487,7 +2504,7 @@ drm_intel_gem_bo_exec2(drm_intel_bo *bo, int used,
int DR4) int DR4)
{ {
return do_exec2(bo, used, NULL, cliprects, num_cliprects, DR4, return do_exec2(bo, used, NULL, cliprects, num_cliprects, DR4,
I915_EXEC_RENDER); -1, NULL, I915_EXEC_RENDER);
} }
static int static int
@ -2496,14 +2513,25 @@ drm_intel_gem_bo_mrb_exec2(drm_intel_bo *bo, int used,
unsigned int flags) unsigned int flags)
{ {
return do_exec2(bo, used, NULL, cliprects, num_cliprects, DR4, return do_exec2(bo, used, NULL, cliprects, num_cliprects, DR4,
flags); -1, NULL, flags);
} }
int int
drm_intel_gem_bo_context_exec(drm_intel_bo *bo, drm_intel_context *ctx, drm_intel_gem_bo_context_exec(drm_intel_bo *bo, drm_intel_context *ctx,
int used, unsigned int flags) int used, unsigned int flags)
{ {
return do_exec2(bo, used, ctx, NULL, 0, 0, flags); return do_exec2(bo, used, ctx, NULL, 0, 0, -1, NULL, flags);
}
int
drm_intel_gem_bo_fence_exec(drm_intel_bo *bo,
drm_intel_context *ctx,
int used,
int in_fence,
int *out_fence,
unsigned int flags)
{
return do_exec2(bo, used, ctx, NULL, 0, 0, in_fence, out_fence, flags);
} }
static int static int
@ -2750,11 +2778,12 @@ drm_intel_gem_bo_flink(drm_intel_bo *bo, uint32_t * name)
pthread_mutex_lock(&bufmgr_gem->lock); pthread_mutex_lock(&bufmgr_gem->lock);
if (!bo_gem->global_name) { if (!bo_gem->global_name) {
bo_gem->global_name = flink.name;
bo_gem->reusable = false;
HASH_ADD(name_hh, bufmgr_gem->name_table, HASH_ADD(name_hh, bufmgr_gem->name_table,
global_name, sizeof(bo_gem->global_name), global_name, sizeof(bo_gem->global_name),
bo_gem); bo_gem);
bo_gem->global_name = flink.name;
bo_gem->reusable = false;
} }
pthread_mutex_unlock(&bufmgr_gem->lock); pthread_mutex_unlock(&bufmgr_gem->lock);
} }
@ -2778,6 +2807,59 @@ drm_intel_bufmgr_gem_enable_reuse(drm_intel_bufmgr *bufmgr)
bufmgr_gem->bo_reuse = true; bufmgr_gem->bo_reuse = true;
} }
/**
* Disables implicit synchronisation before executing the bo
*
* This will cause rendering corruption unless you correctly manage explicit
* fences for all rendering involving this buffer - including use by others.
* Disabling the implicit serialisation is only required if that serialisation
* is too coarse (for example, you have split the buffer into many
* non-overlapping regions and are sharing the whole buffer between concurrent
* independent command streams).
*
* Note the kernel must advertise support via I915_PARAM_HAS_EXEC_ASYNC,
* which can be checked using drm_intel_bufmgr_can_disable_implicit_sync,
* or subsequent execbufs involving the bo will generate EINVAL.
*/
void
drm_intel_gem_bo_disable_implicit_sync(drm_intel_bo *bo)
{
drm_intel_bo_gem *bo_gem = (drm_intel_bo_gem *) bo;
bo_gem->kflags |= EXEC_OBJECT_ASYNC;
}
/**
* Enables implicit synchronisation before executing the bo
*
* This is the default behaviour of the kernel, to wait upon prior writes
* completing on the object before rendering with it, or to wait for prior
* reads to complete before writing into the object.
* drm_intel_gem_bo_disable_implicit_sync() can stop this behaviour, telling
* the kernel never to insert a stall before using the object. Then this
* function can be used to restore the implicit sync before subsequent
* rendering.
*/
void
drm_intel_gem_bo_enable_implicit_sync(drm_intel_bo *bo)
{
drm_intel_bo_gem *bo_gem = (drm_intel_bo_gem *) bo;
bo_gem->kflags &= ~EXEC_OBJECT_ASYNC;
}
/**
* Query whether the kernel supports disabling of its implicit synchronisation
* before execbuf. See drm_intel_gem_bo_disable_implicit_sync()
*/
int
drm_intel_bufmgr_gem_can_disable_implicit_sync(drm_intel_bufmgr *bufmgr)
{
drm_intel_bufmgr_gem *bufmgr_gem = (drm_intel_bufmgr_gem *) bufmgr;
return bufmgr_gem->has_exec_async;
}
/** /**
* Enable use of fenced reloc type. * Enable use of fenced reloc type.
* *
@ -3198,6 +3280,17 @@ drm_intel_gem_context_create(drm_intel_bufmgr *bufmgr)
return context; return context;
} }
int
drm_intel_gem_context_get_id(drm_intel_context *ctx, uint32_t *ctx_id)
{
if (ctx == NULL)
return -EINVAL;
*ctx_id = ctx->ctx_id;
return 0;
}
void void
drm_intel_gem_context_destroy(drm_intel_context *ctx) drm_intel_gem_context_destroy(drm_intel_context *ctx)
{ {
@ -3641,6 +3734,10 @@ drm_intel_bufmgr_gem_init(int fd, int batch_size)
ret = drmIoctl(bufmgr_gem->fd, DRM_IOCTL_I915_GETPARAM, &gp); ret = drmIoctl(bufmgr_gem->fd, DRM_IOCTL_I915_GETPARAM, &gp);
bufmgr_gem->has_relaxed_fencing = ret == 0; bufmgr_gem->has_relaxed_fencing = ret == 0;
gp.param = I915_PARAM_HAS_EXEC_ASYNC;
ret = drmIoctl(bufmgr_gem->fd, DRM_IOCTL_I915_GETPARAM, &gp);
bufmgr_gem->has_exec_async = ret == 0;
bufmgr_gem->bufmgr.bo_alloc_userptr = check_bo_alloc_userptr; bufmgr_gem->bufmgr.bo_alloc_userptr = check_bo_alloc_userptr;
gp.param = I915_PARAM_HAS_WAIT_TIMEOUT; gp.param = I915_PARAM_HAS_WAIT_TIMEOUT;

View File

@ -218,6 +218,9 @@
#define PCI_CHIP_BROXTON_3 0x1A85 #define PCI_CHIP_BROXTON_3 0x1A85
#define PCI_CHIP_BROXTON_4 0x5A85 #define PCI_CHIP_BROXTON_4 0x5A85
#define PCI_CHIP_GLK 0x3184
#define PCI_CHIP_GLK_2X6 0x3185
#define IS_MOBILE(devid) ((devid) == PCI_CHIP_I855_GM || \ #define IS_MOBILE(devid) ((devid) == PCI_CHIP_I855_GM || \
(devid) == PCI_CHIP_I915_GM || \ (devid) == PCI_CHIP_I915_GM || \
(devid) == PCI_CHIP_I945_GM || \ (devid) == PCI_CHIP_I945_GM || \
@ -446,9 +449,13 @@
(devid) == PCI_CHIP_BROXTON_3 || \ (devid) == PCI_CHIP_BROXTON_3 || \
(devid) == PCI_CHIP_BROXTON_4) (devid) == PCI_CHIP_BROXTON_4)
#define IS_GEN9(devid) (IS_SKYLAKE(devid) || \ #define IS_GEMINILAKE(devid) ((devid) == PCI_CHIP_GLK || \
IS_BROXTON(devid) || \ (devid) == PCI_CHIP_GLK_2X6)
IS_KABYLAKE(devid))
#define IS_GEN9(devid) (IS_SKYLAKE(devid) || \
IS_BROXTON(devid) || \
IS_KABYLAKE(devid) || \
IS_GEMINILAKE(devid))
#define IS_9XX(dev) (IS_GEN3(dev) || \ #define IS_9XX(dev) (IS_GEN3(dev) || \
IS_GEN4(dev) || \ IS_GEN4(dev) || \

View File

@ -228,8 +228,6 @@ LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@ LIBOBJS = @LIBOBJS@
LIBS = @LIBS@ LIBS = @LIBS@
LIBTOOL = @LIBTOOL@ LIBTOOL = @LIBTOOL@
LIBUDEV_CFLAGS = @LIBUDEV_CFLAGS@
LIBUDEV_LIBS = @LIBUDEV_LIBS@
LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_DIR = @LIB_MAN_DIR@
LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@
LIPO = @LIPO@ LIPO = @LIPO@
@ -359,10 +357,6 @@ libkms_la_LTLIBRARIES = libkms.la
libkms_ladir = $(libdir) libkms_ladir = $(libdir)
libkms_la_LDFLAGS = -version-number 1:0:0 -no-undefined libkms_la_LDFLAGS = -version-number 1:0:0 -no-undefined
libkms_la_LIBADD = ../libdrm.la libkms_la_LIBADD = ../libdrm.la
#if HAVE_LIBUDEV
#libkms_la_LIBADD += $(LIBUDEV_LIBS)
#endif
libkms_la_SOURCES = $(LIBKMS_FILES) $(am__append_1) $(am__append_2) \ libkms_la_SOURCES = $(LIBKMS_FILES) $(am__append_1) $(am__append_2) \
$(am__append_3) $(am__append_4) $(am__append_5) $(am__append_3) $(am__append_4) $(am__append_5)
libkmsincludedir = ${includedir}/libkms libkmsincludedir = ${includedir}/libkms

View File

@ -141,105 +141,11 @@ linux_from_sysfs(int fd, struct kms_driver **out)
return ret; return ret;
} }
#if 0
#define LIBUDEV_I_KNOW_THE_API_IS_SUBJECT_TO_CHANGE
#include <libudev.h>
struct create_record
{
unsigned vendor;
unsigned chip;
int (*func)(int fd, struct kms_driver **out);
};
static const struct create_record table[] = {
{ 0x8086, 0x2a42, intel_create }, /* i965 */
#ifdef HAVE_VMWGFX
{ 0x15ad, 0x0405, vmwgfx_create }, /* VMware vGPU */
#endif
{ 0, 0, NULL },
};
static int
linux_get_pciid_from_fd(int fd, unsigned *vendor_id, unsigned *chip_id)
{
struct udev *udev;
struct udev_device *device;
struct udev_device *parent;
const char *pci_id;
struct stat buffer;
int ret;
ret = fstat(fd, &buffer);
if (ret)
return -EINVAL;
if (!S_ISCHR(buffer.st_mode))
return -EINVAL;
udev = udev_new();
if (!udev)
return -ENOMEM;
device = udev_device_new_from_devnum(udev, 'c', buffer.st_rdev);
if (!device)
goto err_free_udev;
parent = udev_device_get_parent(device);
if (!parent)
goto err_free_device;
pci_id = udev_device_get_property_value(parent, "PCI_ID");
if (!pci_id)
goto err_free_device;
if (sscanf(pci_id, "%x:%x", vendor_id, chip_id) != 2)
goto err_free_device;
udev_device_unref(device);
udev_unref(udev);
return 0;
err_free_device:
udev_device_unref(device);
err_free_udev:
udev_unref(udev);
return -EINVAL;
}
static int
linux_from_udev(int fd, struct kms_driver **out)
{
unsigned vendor_id, chip_id;
int ret, i;
ret = linux_get_pciid_from_fd(fd, &vendor_id, &chip_id);
if (ret)
return ret;
for (i = 0; table[i].func; i++)
if (table[i].vendor == vendor_id && table[i].chip == chip_id)
return table[i].func(fd, out);
return -ENOSYS;
}
#else
static int
linux_from_udev(int fd, struct kms_driver **out)
{
return -ENOSYS;
}
#endif
drm_private int drm_private int
linux_create(int fd, struct kms_driver **out) linux_create(int fd, struct kms_driver **out)
{ {
if (!dumb_create(fd, out)) if (!dumb_create(fd, out))
return 0; return 0;
if (!linux_from_udev(fd, out))
return 0;
return linux_from_sysfs(fd, out); return linux_from_sysfs(fd, out);
} }

View File

@ -75,7 +75,7 @@ static inline int sync_wait(int fd, int timeout)
} }
return 0; return 0;
} else if (ret == 0) { } else if (ret == 0) {
errno = ETIME; errno = ETIMEDOUT;
return -1; return -1;
} }
} while (ret == -1 && (errno == EINTR || errno == EAGAIN)); } while (ret == -1 && (errno == EINTR || errno == EAGAIN));

View File

@ -169,8 +169,6 @@ LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@ LIBOBJS = @LIBOBJS@
LIBS = @LIBS@ LIBS = @LIBS@
LIBTOOL = @LIBTOOL@ LIBTOOL = @LIBTOOL@
LIBUDEV_CFLAGS = @LIBUDEV_CFLAGS@
LIBUDEV_LIBS = @LIBUDEV_LIBS@
LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_DIR = @LIB_MAN_DIR@
LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@
LIPO = @LIPO@ LIPO = @LIPO@

View File

@ -213,8 +213,6 @@ LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@ LIBOBJS = @LIBOBJS@
LIBS = @LIBS@ LIBS = @LIBS@
LIBTOOL = @LIBTOOL@ LIBTOOL = @LIBTOOL@
LIBUDEV_CFLAGS = @LIBUDEV_CFLAGS@
LIBUDEV_LIBS = @LIBUDEV_LIBS@
LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_DIR = @LIB_MAN_DIR@
LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@
LIPO = @LIPO@ LIPO = @LIPO@

View File

@ -212,8 +212,6 @@ LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@ LIBOBJS = @LIBOBJS@
LIBS = @LIBS@ LIBS = @LIBS@
LIBTOOL = @LIBTOOL@ LIBTOOL = @LIBTOOL@
LIBUDEV_CFLAGS = @LIBUDEV_CFLAGS@
LIBUDEV_LIBS = @LIBUDEV_LIBS@
LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_DIR = @LIB_MAN_DIR@
LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@
LIPO = @LIPO@ LIPO = @LIPO@

View File

@ -235,8 +235,6 @@ LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@ LIBOBJS = @LIBOBJS@
LIBS = @LIBS@ LIBS = @LIBS@
LIBTOOL = @LIBTOOL@ LIBTOOL = @LIBTOOL@
LIBUDEV_CFLAGS = @LIBUDEV_CFLAGS@
LIBUDEV_LIBS = @LIBUDEV_LIBS@
LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_DIR = @LIB_MAN_DIR@
LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@
LIPO = @LIPO@ LIPO = @LIPO@

View File

@ -189,7 +189,7 @@ static int cs_gem_write_reloc(struct radeon_cs_int *cs,
/* check domains */ /* check domains */
if ((read_domain && write_domain) || (!read_domain && !write_domain)) { if ((read_domain && write_domain) || (!read_domain && !write_domain)) {
/* in one CS a bo can only be in read or write domain but not /* in one CS a bo can only be in read or write domain but not
* in read & write domain at the same sime * in read & write domain at the same time
*/ */
return -EINVAL; return -EINVAL;
} }
@ -242,7 +242,7 @@ static int cs_gem_write_reloc(struct radeon_cs_int *cs,
} }
/* new relocation */ /* new relocation */
if (csg->base.crelocs >= csg->nrelocs) { if (csg->base.crelocs >= csg->nrelocs) {
/* allocate more memory (TODO: should use a slab allocatore maybe) */ /* allocate more memory (TODO: should use a slab allocator maybe) */
uint32_t *tmp, size; uint32_t *tmp, size;
size = ((csg->nrelocs + 1) * sizeof(struct radeon_bo*)); size = ((csg->nrelocs + 1) * sizeof(struct radeon_bo*));
tmp = (uint32_t*)realloc(csg->relocs_bo, size); tmp = (uint32_t*)realloc(csg->relocs_bo, size);
@ -268,7 +268,7 @@ static int cs_gem_write_reloc(struct radeon_cs_int *cs,
reloc->flags = flags; reloc->flags = flags;
csg->chunks[1].length_dw += RELOC_SIZE; csg->chunks[1].length_dw += RELOC_SIZE;
radeon_bo_ref(bo); radeon_bo_ref(bo);
/* bo might be referenced from another context so have to use atomic opertions */ /* bo might be referenced from another context so have to use atomic operations */
atomic_add((atomic_t *)radeon_gem_get_reloc_in_cs(bo), cs->id); atomic_add((atomic_t *)radeon_gem_get_reloc_in_cs(bo), cs->id);
cs->relocs_total_size += boi->size; cs->relocs_total_size += boi->size;
radeon_cs_write_dword((struct radeon_cs *)cs, 0xc0001000); radeon_cs_write_dword((struct radeon_cs *)cs, 0xc0001000);
@ -449,7 +449,7 @@ static int cs_gem_emit(struct radeon_cs_int *cs)
&csg->cs, sizeof(struct drm_radeon_cs)); &csg->cs, sizeof(struct drm_radeon_cs));
for (i = 0; i < csg->base.crelocs; i++) { for (i = 0; i < csg->base.crelocs; i++) {
csg->relocs_bo[i]->space_accounted = 0; csg->relocs_bo[i]->space_accounted = 0;
/* bo might be referenced from another context so have to use atomic opertions */ /* bo might be referenced from another context so have to use atomic operations */
atomic_dec((atomic_t *)radeon_gem_get_reloc_in_cs((struct radeon_bo*)csg->relocs_bo[i]), cs->id); atomic_dec((atomic_t *)radeon_gem_get_reloc_in_cs((struct radeon_bo*)csg->relocs_bo[i]), cs->id);
radeon_bo_unref((struct radeon_bo *)csg->relocs_bo[i]); radeon_bo_unref((struct radeon_bo *)csg->relocs_bo[i]);
csg->relocs_bo[i] = NULL; csg->relocs_bo[i] = NULL;
@ -481,7 +481,7 @@ static int cs_gem_erase(struct radeon_cs_int *cs)
if (csg->relocs_bo) { if (csg->relocs_bo) {
for (i = 0; i < csg->base.crelocs; i++) { for (i = 0; i < csg->base.crelocs; i++) {
if (csg->relocs_bo[i]) { if (csg->relocs_bo[i]) {
/* bo might be referenced from another context so have to use atomic opertions */ /* bo might be referenced from another context so have to use atomic operations */
atomic_dec((atomic_t *)radeon_gem_get_reloc_in_cs((struct radeon_bo*)csg->relocs_bo[i]), cs->id); atomic_dec((atomic_t *)radeon_gem_get_reloc_in_cs((struct radeon_bo*)csg->relocs_bo[i]), cs->id);
radeon_bo_unref((struct radeon_bo *)csg->relocs_bo[i]); radeon_bo_unref((struct radeon_bo *)csg->relocs_bo[i]);
csg->relocs_bo[i] = NULL; csg->relocs_bo[i] = NULL;

View File

@ -981,7 +981,7 @@ static int eg_surface_best(struct radeon_surface_manager *surf_man,
/* bankw or bankh greater than 1 increase alignment requirement, not /* bankw or bankh greater than 1 increase alignment requirement, not
* sure if it's worth using smaller bankw & bankh to stick with 2D * sure if it's worth using smaller bankw & bankh to stick with 2D
* tiling on small surface rather than falling back to 1D tiling. * tiling on small surface rather than falling back to 1D tiling.
* Use recommanded value based on tile size for now. * Use recommended value based on tile size for now.
* *
* fmask buffer has different optimal value figure them out once we * fmask buffer has different optimal value figure them out once we
* use it. * use it.

View File

@ -209,8 +209,6 @@ LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@ LIBOBJS = @LIBOBJS@
LIBS = @LIBS@ LIBS = @LIBS@
LIBTOOL = @LIBTOOL@ LIBTOOL = @LIBTOOL@
LIBUDEV_CFLAGS = @LIBUDEV_CFLAGS@
LIBUDEV_LIBS = @LIBUDEV_LIBS@
LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_DIR = @LIB_MAN_DIR@
LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@
LIPO = @LIPO@ LIPO = @LIPO@

View File

@ -55,23 +55,9 @@ host_triplet = @host@
@HAVE_EXYNOS_TRUE@am__append_4 = exynos @HAVE_EXYNOS_TRUE@am__append_4 = exynos
@HAVE_TEGRA_TRUE@am__append_5 = tegra @HAVE_TEGRA_TRUE@am__append_5 = tegra
@HAVE_ETNAVIV_TRUE@am__append_6 = etnaviv @HAVE_ETNAVIV_TRUE@am__append_6 = etnaviv
check_PROGRAMS = dristat$(EXEEXT) drmdevice$(EXEEXT) drmstat$(EXEEXT) \
$(am__EXEEXT_2)
@HAVE_NOUVEAU_TRUE@am__append_7 = nouveau @HAVE_NOUVEAU_TRUE@am__append_7 = nouveau
TESTS = drmsl$(EXEEXT) hash$(EXEEXT) random$(EXEEXT) $(am__EXEEXT_1) TESTS = drmsl$(EXEEXT) hash$(EXEEXT) random$(EXEEXT)
@HAVE_LIBUDEV_TRUE@am__append_8 = \ check_PROGRAMS = $(am__EXEEXT_1) drmdevice$(EXEEXT)
@HAVE_LIBUDEV_TRUE@ libdrmtest.la \
@HAVE_LIBUDEV_TRUE@ $(LIBUDEV_LIBS)
@HAVE_LIBUDEV_TRUE@am__append_9 = \
@HAVE_LIBUDEV_TRUE@ openclose \
@HAVE_LIBUDEV_TRUE@ getversion \
@HAVE_LIBUDEV_TRUE@ getclient \
@HAVE_LIBUDEV_TRUE@ getstats \
@HAVE_LIBUDEV_TRUE@ setversion \
@HAVE_LIBUDEV_TRUE@ updatedraw \
@HAVE_LIBUDEV_TRUE@ name_from_fd
subdir = tests subdir = tests
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
$(top_srcdir)/build-aux/depcomp $(top_srcdir)/build-aux/depcomp
@ -86,83 +72,27 @@ mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES = CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES = CONFIG_CLEAN_VPATH_FILES =
libdrmtest_la_LIBADD = am__EXEEXT_1 = drmsl$(EXEEXT) hash$(EXEEXT) random$(EXEEXT)
am__libdrmtest_la_SOURCES_DIST = drmtest.c drmtest.h drmdevice_SOURCES = drmdevice.c
@HAVE_LIBUDEV_TRUE@am_libdrmtest_la_OBJECTS = drmtest.lo drmdevice_OBJECTS = drmdevice.$(OBJEXT)
libdrmtest_la_OBJECTS = $(am_libdrmtest_la_OBJECTS) drmdevice_LDADD = $(LDADD)
drmdevice_DEPENDENCIES = $(top_builddir)/libdrm.la
AM_V_lt = $(am__v_lt_@AM_V@) AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
am__v_lt_0 = --silent am__v_lt_0 = --silent
am__v_lt_1 = am__v_lt_1 =
@HAVE_LIBUDEV_TRUE@am_libdrmtest_la_rpath =
@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)
am__EXEEXT_2 = drmsl$(EXEEXT) hash$(EXEEXT) random$(EXEEXT) \
$(am__EXEEXT_1)
dristat_SOURCES = dristat.c
dristat_OBJECTS = dristat.$(OBJEXT)
dristat_DEPENDENCIES =
drmdevice_SOURCES = drmdevice.c
drmdevice_OBJECTS = drmdevice.$(OBJEXT)
drmdevice_LDADD = $(LDADD)
am__DEPENDENCIES_1 =
@HAVE_LIBUDEV_TRUE@am__DEPENDENCIES_2 = libdrmtest.la \
@HAVE_LIBUDEV_TRUE@ $(am__DEPENDENCIES_1)
drmdevice_DEPENDENCIES = $(top_builddir)/libdrm.la \
$(am__DEPENDENCIES_2)
drmsl_SOURCES = drmsl.c drmsl_SOURCES = drmsl.c
drmsl_OBJECTS = drmsl.$(OBJEXT) drmsl_OBJECTS = drmsl.$(OBJEXT)
drmsl_LDADD = $(LDADD) drmsl_LDADD = $(LDADD)
drmsl_DEPENDENCIES = $(top_builddir)/libdrm.la $(am__DEPENDENCIES_2) drmsl_DEPENDENCIES = $(top_builddir)/libdrm.la
drmstat_SOURCES = drmstat.c
drmstat_OBJECTS = drmstat.$(OBJEXT)
drmstat_LDADD = $(LDADD)
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__DEPENDENCIES_2)
getstats_SOURCES = getstats.c
getstats_OBJECTS = getstats.$(OBJEXT)
getstats_LDADD = $(LDADD)
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__DEPENDENCIES_2)
hash_SOURCES = hash.c hash_SOURCES = hash.c
hash_OBJECTS = hash.$(OBJEXT) hash_OBJECTS = hash.$(OBJEXT)
hash_LDADD = $(LDADD) hash_LDADD = $(LDADD)
hash_DEPENDENCIES = $(top_builddir)/libdrm.la $(am__DEPENDENCIES_2) hash_DEPENDENCIES = $(top_builddir)/libdrm.la
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__DEPENDENCIES_2)
openclose_SOURCES = openclose.c
openclose_OBJECTS = openclose.$(OBJEXT)
openclose_LDADD = $(LDADD)
openclose_DEPENDENCIES = $(top_builddir)/libdrm.la \
$(am__DEPENDENCIES_2)
random_SOURCES = random.c random_SOURCES = random.c
random_OBJECTS = random.$(OBJEXT) random_OBJECTS = random.$(OBJEXT)
random_LDADD = $(LDADD) random_LDADD = $(LDADD)
random_DEPENDENCIES = $(top_builddir)/libdrm.la $(am__DEPENDENCIES_2) random_DEPENDENCIES = $(top_builddir)/libdrm.la
setversion_SOURCES = setversion.c
setversion_OBJECTS = setversion.$(OBJEXT)
setversion_LDADD = $(LDADD)
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__DEPENDENCIES_2)
AM_V_P = $(am__v_P_@AM_V@) AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false am__v_P_0 = false
@ -197,12 +127,8 @@ AM_V_CCLD = $(am__v_CCLD_@AM_V@)
am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_0 = @echo " CCLD " $@;
am__v_CCLD_1 = am__v_CCLD_1 =
SOURCES = $(libdrmtest_la_SOURCES) dristat.c drmdevice.c drmsl.c \ SOURCES = drmdevice.c drmsl.c hash.c random.c
drmstat.c getclient.c getstats.c getversion.c hash.c \ DIST_SOURCES = drmdevice.c drmsl.c hash.c random.c
name_from_fd.c openclose.c random.c setversion.c updatedraw.c
DIST_SOURCES = $(am__libdrmtest_la_SOURCES_DIST) dristat.c drmdevice.c \
drmsl.c drmstat.c getclient.c getstats.c getversion.c hash.c \
name_from_fd.c openclose.c random.c setversion.c updatedraw.c
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
html-recursive info-recursive install-data-recursive \ html-recursive info-recursive install-data-recursive \
install-dvi-recursive install-exec-recursive \ install-dvi-recursive install-exec-recursive \
@ -304,8 +230,6 @@ LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@ LIBOBJS = @LIBOBJS@
LIBS = @LIBS@ LIBS = @LIBS@
LIBTOOL = @LIBTOOL@ LIBTOOL = @LIBTOOL@
LIBUDEV_CFLAGS = @LIBUDEV_CFLAGS@
LIBUDEV_LIBS = @LIBUDEV_LIBS@
LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_DIR = @LIB_MAN_DIR@
LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@
LIPO = @LIPO@ LIPO = @LIPO@
@ -413,17 +337,7 @@ AM_CFLAGS = \
-I $(top_srcdir)/include/drm \ -I $(top_srcdir)/include/drm \
-I $(top_srcdir) -I $(top_srcdir)
LDADD = $(top_builddir)/libdrm.la $(am__append_8) LDADD = $(top_builddir)/libdrm.la
dristat_LDADD = -lm
@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@XFAIL_TESTS = \
@HAVE_LIBUDEV_TRUE@ auth \
@HAVE_LIBUDEV_TRUE@ lock
all: all-recursive all: all-recursive
.SUFFIXES: .SUFFIXES:
@ -459,19 +373,6 @@ $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps): $(am__aclocal_m4_deps):
clean-checkLTLIBRARIES:
-test -z "$(check_LTLIBRARIES)" || rm -f $(check_LTLIBRARIES)
@list='$(check_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}; \
}
libdrmtest.la: $(libdrmtest_la_OBJECTS) $(libdrmtest_la_DEPENDENCIES) $(EXTRA_libdrmtest_la_DEPENDENCIES)
$(AM_V_CCLD)$(LINK) $(am_libdrmtest_la_rpath) $(libdrmtest_la_OBJECTS) $(libdrmtest_la_LIBADD) $(LIBS)
clean-checkPROGRAMS: clean-checkPROGRAMS:
@list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \ @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \
echo " rm -f" $$list; \ echo " rm -f" $$list; \
@ -480,45 +381,18 @@ clean-checkPROGRAMS:
list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
echo " rm -f" $$list; \ echo " rm -f" $$list; \
rm -f $$list rm -f $$list
dristat$(EXEEXT): $(dristat_OBJECTS) $(dristat_DEPENDENCIES) $(EXTRA_dristat_DEPENDENCIES)
@rm -f dristat$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(dristat_OBJECTS) $(dristat_LDADD) $(LIBS)
drmdevice$(EXEEXT): $(drmdevice_OBJECTS) $(drmdevice_DEPENDENCIES) $(EXTRA_drmdevice_DEPENDENCIES) drmdevice$(EXEEXT): $(drmdevice_OBJECTS) $(drmdevice_DEPENDENCIES) $(EXTRA_drmdevice_DEPENDENCIES)
@rm -f drmdevice$(EXEEXT) @rm -f drmdevice$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(drmdevice_OBJECTS) $(drmdevice_LDADD) $(LIBS) $(AM_V_CCLD)$(LINK) $(drmdevice_OBJECTS) $(drmdevice_LDADD) $(LIBS)
drmsl$(EXEEXT): $(drmsl_OBJECTS) $(drmsl_DEPENDENCIES) $(EXTRA_drmsl_DEPENDENCIES) drmsl$(EXEEXT): $(drmsl_OBJECTS) $(drmsl_DEPENDENCIES) $(EXTRA_drmsl_DEPENDENCIES)
@rm -f drmsl$(EXEEXT) @rm -f drmsl$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(drmsl_OBJECTS) $(drmsl_LDADD) $(LIBS) $(AM_V_CCLD)$(LINK) $(drmsl_OBJECTS) $(drmsl_LDADD) $(LIBS)
drmstat$(EXEEXT): $(drmstat_OBJECTS) $(drmstat_DEPENDENCIES) $(EXTRA_drmstat_DEPENDENCIES)
@rm -f drmstat$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(drmstat_OBJECTS) $(drmstat_LDADD) $(LIBS)
getclient$(EXEEXT): $(getclient_OBJECTS) $(getclient_DEPENDENCIES) $(EXTRA_getclient_DEPENDENCIES)
@rm -f getclient$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(getclient_OBJECTS) $(getclient_LDADD) $(LIBS)
getstats$(EXEEXT): $(getstats_OBJECTS) $(getstats_DEPENDENCIES) $(EXTRA_getstats_DEPENDENCIES)
@rm -f getstats$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(getstats_OBJECTS) $(getstats_LDADD) $(LIBS)
getversion$(EXEEXT): $(getversion_OBJECTS) $(getversion_DEPENDENCIES) $(EXTRA_getversion_DEPENDENCIES)
@rm -f getversion$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(getversion_OBJECTS) $(getversion_LDADD) $(LIBS)
hash$(EXEEXT): $(hash_OBJECTS) $(hash_DEPENDENCIES) $(EXTRA_hash_DEPENDENCIES) hash$(EXEEXT): $(hash_OBJECTS) $(hash_DEPENDENCIES) $(EXTRA_hash_DEPENDENCIES)
@rm -f hash$(EXEEXT) @rm -f hash$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(hash_OBJECTS) $(hash_LDADD) $(LIBS) $(AM_V_CCLD)$(LINK) $(hash_OBJECTS) $(hash_LDADD) $(LIBS)
name_from_fd$(EXEEXT): $(name_from_fd_OBJECTS) $(name_from_fd_DEPENDENCIES) $(EXTRA_name_from_fd_DEPENDENCIES)
@rm -f name_from_fd$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(name_from_fd_OBJECTS) $(name_from_fd_LDADD) $(LIBS)
openclose$(EXEEXT): $(openclose_OBJECTS) $(openclose_DEPENDENCIES) $(EXTRA_openclose_DEPENDENCIES)
@rm -f openclose$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(openclose_OBJECTS) $(openclose_LDADD) $(LIBS)
random$(EXEEXT): $(random_OBJECTS) $(random_DEPENDENCIES) $(EXTRA_random_DEPENDENCIES) random$(EXEEXT): $(random_OBJECTS) $(random_DEPENDENCIES) $(EXTRA_random_DEPENDENCIES)
@rm -f random$(EXEEXT) @rm -f random$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(random_OBJECTS) $(random_LDADD) $(LIBS) $(AM_V_CCLD)$(LINK) $(random_OBJECTS) $(random_LDADD) $(LIBS)
setversion$(EXEEXT): $(setversion_OBJECTS) $(setversion_DEPENDENCIES) $(EXTRA_setversion_DEPENDENCIES)
@rm -f setversion$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(setversion_OBJECTS) $(setversion_LDADD) $(LIBS)
updatedraw$(EXEEXT): $(updatedraw_OBJECTS) $(updatedraw_DEPENDENCIES) $(EXTRA_updatedraw_DEPENDENCIES)
@rm -f updatedraw$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(updatedraw_OBJECTS) $(updatedraw_LDADD) $(LIBS)
mostlyclean-compile: mostlyclean-compile:
-rm -f *.$(OBJEXT) -rm -f *.$(OBJEXT)
@ -526,20 +400,10 @@ mostlyclean-compile:
distclean-compile: distclean-compile:
-rm -f *.tab.c -rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dristat.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/drmdevice.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/drmdevice.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/drmsl.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/drmsl.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)/getclient.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getstats.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getversion.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hash.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hash.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/name_from_fd.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/openclose.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/random.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/random.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setversion.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/updatedraw.Po@am__quote@
.c.o: .c.o:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@ -843,7 +707,7 @@ distdir: $(DISTFILES)
fi; \ fi; \
done done
check-am: all-am check-am: all-am
$(MAKE) $(AM_MAKEFLAGS) $(check_LTLIBRARIES) $(check_PROGRAMS) $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS)
$(MAKE) $(AM_MAKEFLAGS) check-TESTS $(MAKE) $(AM_MAKEFLAGS) check-TESTS
check: check-recursive check: check-recursive
all-am: Makefile all-am: Makefile
@ -881,8 +745,8 @@ maintainer-clean-generic:
@echo "it deletes files that may require special tools to rebuild." @echo "it deletes files that may require special tools to rebuild."
clean: clean-recursive clean: clean-recursive
clean-am: clean-checkLTLIBRARIES clean-checkPROGRAMS clean-generic \ clean-am: clean-checkPROGRAMS clean-generic clean-libtool \
clean-libtool mostlyclean-am mostlyclean-am
distclean: distclean-recursive distclean: distclean-recursive
-rm -rf ./$(DEPDIR) -rm -rf ./$(DEPDIR)
@ -956,19 +820,19 @@ uninstall-am:
.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
all all-am check check-TESTS check-am clean \ all all-am check check-TESTS check-am clean \
clean-checkLTLIBRARIES clean-checkPROGRAMS clean-generic \ clean-checkPROGRAMS clean-generic clean-libtool cscopelist \
clean-libtool cscopelist cscopelist-recursive ctags \ cscopelist-recursive ctags ctags-recursive distclean \
ctags-recursive distclean distclean-compile distclean-generic \ distclean-compile distclean-generic distclean-libtool \
distclean-libtool distclean-tags distdir dvi dvi-am html \ distclean-tags distdir dvi dvi-am html html-am info info-am \
html-am info info-am install install-am install-data \ install install-am install-data install-data-am install-dvi \
install-data-am install-dvi install-dvi-am install-exec \ install-dvi-am install-exec install-exec-am install-html \
install-exec-am install-html install-html-am install-info \ install-html-am install-info install-info-am install-man \
install-info-am install-man install-pdf install-pdf-am \ install-pdf install-pdf-am install-ps install-ps-am \
install-ps install-ps-am install-strip installcheck \ install-strip installcheck installcheck-am installdirs \
installcheck-am installdirs installdirs-am maintainer-clean \ installdirs-am maintainer-clean maintainer-clean-generic \
maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean mostlyclean-compile mostlyclean-generic \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
tags tags-recursive uninstall uninstall-am uninstall uninstall-am
# Tell versions [3.59,3.63) of GNU make to not export all variables. # Tell versions [3.59,3.63) of GNU make to not export all variables.

View File

@ -175,8 +175,6 @@ LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@ LIBOBJS = @LIBOBJS@
LIBS = @LIBS@ LIBS = @LIBS@
LIBTOOL = @LIBTOOL@ LIBTOOL = @LIBTOOL@
LIBUDEV_CFLAGS = @LIBUDEV_CFLAGS@
LIBUDEV_LIBS = @LIBUDEV_LIBS@
LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_DIR = @LIB_MAN_DIR@
LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@
LIPO = @LIPO@ LIPO = @LIPO@

View File

@ -1,285 +0,0 @@
/* dristat.c --
* Created: Mon Jan 15 05:05:07 2001 by faith@acm.org
*
* Copyright 2000 VA Linux Systems, Inc., Fremont, California.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
* Authors: Rickard E. (Rik) Faith <faith@valinux.com>
*
*/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include "xf86drm.h"
#include "xf86drmRandom.c"
#include "xf86drmHash.c"
#include "xf86drm.c"
#define DRM_VERSION 0x00000001
#define DRM_MEMORY 0x00000002
#define DRM_CLIENTS 0x00000004
#define DRM_STATS 0x00000008
#define DRM_BUSID 0x00000010
static void getversion(int fd)
{
drmVersionPtr version;
version = drmGetVersion(fd);
if (version) {
printf(" Version information:\n");
printf(" Name: %s\n", version->name ? version->name : "?");
printf(" Version: %d.%d.%d\n",
version->version_major,
version->version_minor,
version->version_patchlevel);
printf(" Date: %s\n", version->date ? version->date : "?");
printf(" Desc: %s\n", version->desc ? version->desc : "?");
drmFreeVersion(version);
} else {
printf(" No version information available\n");
}
}
static void getbusid(int fd)
{
const char *busid = drmGetBusid(fd);
printf(" Busid: %s\n", *busid ? busid : "(not set)");
drmFreeBusid(busid);
}
static void getvm(int fd)
{
int i;
const char *typename;
char flagname[33];
drm_handle_t offset;
drmSize size;
drmMapType type;
drmMapFlags flags;
drm_handle_t handle;
int mtrr;
printf(" VM map information:\n");
printf(" flags: (R)estricted (r)ead/(w)rite (l)ocked (k)ernel (W)rite-combine (L)ock:\n");
printf(" slot offset size type flags address mtrr\n");
for (i = 0;
!drmGetMap(fd, i, &offset, &size, &type, &flags, &handle, &mtrr);
i++) {
switch (type) {
case DRM_FRAME_BUFFER: typename = "FB"; break;
case DRM_REGISTERS: typename = "REG"; break;
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;
}
flagname[0] = (flags & DRM_RESTRICTED) ? 'R' : ' ';
flagname[1] = (flags & DRM_READ_ONLY) ? 'r' : 'w';
flagname[2] = (flags & DRM_LOCKED) ? 'l' : ' ';
flagname[3] = (flags & DRM_KERNEL) ? 'k' : ' ';
flagname[4] = (flags & DRM_WRITE_COMBINING) ? 'W' : ' ';
flagname[5] = (flags & DRM_CONTAINS_LOCK) ? 'L' : ' ';
flagname[6] = '\0';
printf(" %4d 0x%08lx 0x%08lx %3.3s %6.6s 0x%08lx ",
i, (unsigned long)offset, (unsigned long)size,
typename, flagname, (unsigned long)handle);
if (mtrr < 0) printf("none\n");
else printf("%4d\n", mtrr);
}
}
static void getclients(int fd)
{
int i;
int auth;
int pid;
int uid;
unsigned long magic;
unsigned long iocs;
char buf[64];
char cmd[40];
int procfd;
printf(" DRI client information:\n");
printf(" a pid uid magic ioctls prog\n");
for (i = 0; !drmGetClient(fd, i, &auth, &pid, &uid, &magic, &iocs); i++) {
sprintf(buf, "/proc/%d/cmdline", pid);
memset(cmd, 0, sizeof(cmd));
if ((procfd = open(buf, O_RDONLY, 0)) >= 0) {
read(procfd, cmd, sizeof(cmd)-1);
close(procfd);
}
if (*cmd) {
char *pt;
for (pt = cmd; *pt; pt++) if (!isprint(*pt)) *pt = ' ';
printf(" %c %5d %5d %10lu %10lu %s\n",
auth ? 'y' : 'n', pid, uid, magic, iocs, cmd);
} else {
printf(" %c %5d %5d %10lu %10lu\n",
auth ? 'y' : 'n', pid, uid, magic, iocs);
}
}
}
static void printhuman(unsigned long value, const char *name, int mult)
{
const char *p;
double f;
/* Print width 5 number in width 6 space */
if (value < 100000) {
printf(" %5lu", value);
return;
}
p = name;
f = (double)value / (double)mult;
if (f < 10.0) {
printf(" %4.2f%c", f, *p);
return;
}
p++;
f = (double)value / (double)mult;
if (f < 10.0) {
printf(" %4.2f%c", f, *p);
return;
}
p++;
f = (double)value / (double)mult;
if (f < 10.0) {
printf(" %4.2f%c", f, *p);
return;
}
}
static void getstats(int fd, int i)
{
drmStatsT prev, curr;
unsigned j;
double rate;
printf(" System statistics:\n");
if (drmGetStats(fd, &prev)) return;
if (!i) {
for (j = 0; j < prev.count; j++) {
printf(" ");
printf(prev.data[j].long_format, prev.data[j].long_name);
if (prev.data[j].isvalue) printf(" 0x%08lx\n", prev.data[j].value);
else printf(" %10lu\n", prev.data[j].value);
}
return;
}
printf(" ");
for (j = 0; j < prev.count; j++)
if (!prev.data[j].verbose) {
printf(" ");
printf(prev.data[j].rate_format, prev.data[j].rate_name);
}
printf("\n");
for (;;) {
sleep(i);
if (drmGetStats(fd, &curr)) return;
printf(" ");
for (j = 0; j < curr.count; j++) {
if (curr.data[j].verbose) continue;
if (curr.data[j].isvalue) {
printf(" %08lx", curr.data[j].value);
} else {
rate = (curr.data[j].value - prev.data[j].value) / (double)i;
printhuman(rate, curr.data[j].mult_names, curr.data[j].mult);
}
}
printf("\n");
memcpy(&prev, &curr, sizeof(prev));
}
}
int main(int argc, char **argv)
{
int c;
int mask = 0;
int minor = 0;
int interval = 0;
int fd;
char buf[64];
int i;
while ((c = getopt(argc, argv, "avmcsbM:i:")) != EOF)
switch (c) {
case 'a': mask = ~0; break;
case 'v': mask |= DRM_VERSION; break;
case 'm': mask |= DRM_MEMORY; break;
case 'c': mask |= DRM_CLIENTS; break;
case 's': mask |= DRM_STATS; break;
case 'b': mask |= DRM_BUSID; break;
case 'i': interval = strtol(optarg, NULL, 0); break;
case 'M': minor = strtol(optarg, NULL, 0); break;
default:
fprintf( stderr, "Usage: dristat [options]\n\n" );
fprintf( stderr, "Displays DRM information. Use with no arguments to display available cards.\n\n" );
fprintf( stderr, " -a Show all available information\n" );
fprintf( stderr, " -b Show DRM bus ID's\n" );
fprintf( stderr, " -c Display information about DRM clients\n" );
fprintf( stderr, " -i [interval] Continuously display statistics every [interval] seconds\n" );
fprintf( stderr, " -v Display DRM module and card version information\n" );
fprintf( stderr, " -m Display memory use information\n" );
fprintf( stderr, " -s Display DRM statistics\n" );
fprintf( stderr, " -M [minor] Select card by minor number\n" );
return 1;
}
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_PRIMARY);
if (fd >= 0) {
printf("%s\n", buf);
if (mask & DRM_BUSID) getbusid(fd);
if (mask & DRM_VERSION) getversion(fd);
if (mask & DRM_MEMORY) getvm(fd);
if (mask & DRM_CLIENTS) getclients(fd);
if (mask & DRM_STATS) getstats(fd, interval);
close(fd);
}
}
return 0;
}

View File

@ -1,419 +0,0 @@
/* drmstat.c -- DRM device status and testing program
* Created: Tue Jan 5 08:19:24 1999 by faith@precisioninsight.com
*
* Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
* Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
* Authors: Rickard E. (Rik) Faith <faith@valinux.com>
*
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/time.h>
#include <sys/mman.h>
#include <getopt.h>
#include <strings.h>
#include <errno.h>
#include <signal.h>
#include <fcntl.h>
#ifdef HAVE_ALLOCA_H
# include <alloca.h>
#endif
#include "xf86drm.h"
int sigio_fd;
static double usec(struct timeval *end, struct timeval *start)
{
double e = end->tv_sec * 1000000 + end->tv_usec;
double s = start->tv_sec * 1000000 + start->tv_usec;
return e - s;
}
static void getversion(int fd)
{
drmVersionPtr version;
version = drmGetVersion(fd);
if (version) {
printf( "Name: %s\n", version->name ? version->name : "?" );
printf( " Version: %d.%d.%d\n",
version->version_major,
version->version_minor,
version->version_patchlevel );
printf( " Date: %s\n", version->date ? version->date : "?" );
printf( " Desc: %s\n", version->desc ? version->desc : "?" );
drmFreeVersion(version);
} else {
printf( "No driver available\n" );
}
}
static void process_sigio(char *device)
{
int fd;
if ((fd = open(device, 0)) < 0) {
drmError(-errno, __func__);
exit(1);
}
sigio_fd = fd;
for (;;) sleep(60);
}
int main(int argc, char **argv)
{
int c;
int r = 0;
int fd = -1;
drm_handle_t handle;
void *address;
char *pt;
unsigned long count;
unsigned long offset;
unsigned long size;
drm_context_t context;
int loops;
char buf[1024];
int i;
drmBufInfoPtr info;
drmBufMapPtr bufs;
drmLockPtr lock;
int secs;
while ((c = getopt(argc, argv,
"lc:vo:O:f:s:w:W:b:r:R:P:L:C:XS:B:F:")) != EOF)
switch (c) {
case 'F':
count = strtoul(optarg, NULL, 0);
if (!fork()) {
dup(fd);
sleep(count);
}
close(fd);
break;
case 'v': getversion(fd); break;
case 'X':
if ((r = drmCreateContext(fd, &context))) {
drmError(r, argv[0]);
return 1;
}
printf( "Got %d\n", context);
break;
case 'S':
process_sigio(optarg);
break;
case 'C':
if ((r = drmSwitchToContext(fd, strtoul(optarg, NULL, 0)))) {
drmError(r, argv[0]);
return 1;
}
break;
case 'c':
if ((r = drmSetBusid(fd,optarg))) {
drmError(r, argv[0]);
return 1;
}
break;
case 'o':
if ((fd = drmOpen(optarg, NULL)) < 0) {
drmError(fd, argv[0]);
return 1;
}
break;
case 'O':
if ((fd = drmOpen(NULL, optarg)) < 0) {
drmError(fd, argv[0]);
return 1;
}
break;
case 'B': /* Test buffer allocation */
count = strtoul(optarg, &pt, 0);
size = strtoul(pt+1, &pt, 0);
secs = strtoul(pt+1, NULL, 0);
{
drmDMAReq dma;
int *indices, *sizes;
indices = alloca(sizeof(*indices) * count);
sizes = alloca(sizeof(*sizes) * count);
dma.context = context;
dma.send_count = 0;
dma.request_count = count;
dma.request_size = size;
dma.request_list = indices;
dma.request_sizes = sizes;
dma.flags = DRM_DMA_WAIT;
if ((r = drmDMA(fd, &dma))) {
drmError(r, argv[0]);
return 1;
}
for (i = 0; i < dma.granted_count; i++) {
printf("%5d: index = %d, size = %d\n",
i, dma.request_list[i], dma.request_sizes[i]);
}
sleep(secs);
drmFreeBufs(fd, dma.granted_count, indices);
}
break;
case 'b':
count = strtoul(optarg, &pt, 0);
size = strtoul(pt+1, NULL, 0);
if ((r = drmAddBufs(fd, count, size, 0, 65536)) < 0) {
drmError(r, argv[0]);
return 1;
}
if (!(info = drmGetBufInfo(fd))) {
drmError(0, argv[0]);
return 1;
}
for (i = 0; i < info->count; i++) {
printf("%5d buffers of size %6d (low = %d, high = %d)\n",
info->list[i].count,
info->list[i].size,
info->list[i].low_mark,
info->list[i].high_mark);
}
if ((r = drmMarkBufs(fd, 0.50, 0.80))) {
drmError(r, argv[0]);
return 1;
}
if (!(info = drmGetBufInfo(fd))) {
drmError(0, argv[0]);
return 1;
}
for (i = 0; i < info->count; i++) {
printf("%5d buffers of size %6d (low = %d, high = %d)\n",
info->list[i].count,
info->list[i].size,
info->list[i].low_mark,
info->list[i].high_mark);
}
printf("===== /proc/dri/0/mem =====\n");
sprintf(buf, "cat /proc/dri/0/mem");
system(buf);
#if 1
if (!(bufs = drmMapBufs(fd))) {
drmError(0, argv[0]);
return 1;
}
printf("===============================\n");
printf( "%d bufs\n", bufs->count);
for (i = 0; i < bufs->count; i++) {
printf( " %4d: %8d bytes at %p\n",
i,
bufs->list[i].total,
bufs->list[i].address);
}
printf("===== /proc/dri/0/vma =====\n");
sprintf(buf, "cat /proc/dri/0/vma");
system(buf);
#endif
break;
case 'f':
offset = strtoul(optarg, &pt, 0);
size = strtoul(pt+1, NULL, 0);
handle = 0;
if ((r = drmAddMap(fd, offset, size,
DRM_FRAME_BUFFER, 0, &handle))) {
drmError(r, argv[0]);
return 1;
}
printf("0x%08lx:0x%04lx added\n", offset, size);
printf("===== /proc/dri/0/mem =====\n");
sprintf(buf, "cat /proc/dri/0/mem");
system(buf);
break;
case 'r':
case 'R':
offset = strtoul(optarg, &pt, 0);
size = strtoul(pt+1, NULL, 0);
handle = 0;
if ((r = drmAddMap(fd, offset, size,
DRM_REGISTERS,
c == 'R' ? DRM_READ_ONLY : 0,
&handle))) {
drmError(r, argv[0]);
return 1;
}
printf("0x%08lx:0x%04lx added\n", offset, size);
printf("===== /proc/dri/0/mem =====\n");
sprintf(buf, "cat /proc/dri/0/mem");
system(buf);
break;
case 's':
size = strtoul(optarg, &pt, 0);
handle = 0;
if ((r = drmAddMap(fd, 0, size,
DRM_SHM, DRM_CONTAINS_LOCK,
&handle))) {
drmError(r, argv[0]);
return 1;
}
printf("0x%04lx byte shm added at 0x%08lx\n", size, handle);
sprintf(buf, "cat /proc/dri/0/vm");
system(buf);
break;
case 'P':
offset = strtoul(optarg, &pt, 0);
size = strtoul(pt+1, NULL, 0);
address = NULL;
if ((r = drmMap(fd, offset, size, &address))) {
drmError(r, argv[0]);
return 1;
}
printf("0x%08lx:0x%04lx mapped at %p for pid %d\n",
offset, size, address, getpid());
printf("===== /proc/dri/0/vma =====\n");
sprintf(buf, "cat /proc/dri/0/vma");
system(buf);
mprotect((void *)offset, size, PROT_READ);
printf("===== /proc/dri/0/vma =====\n");
sprintf(buf, "cat /proc/dri/0/vma");
system(buf);
break;
case 'w':
case 'W':
offset = strtoul(optarg, &pt, 0);
size = strtoul(pt+1, NULL, 0);
address = NULL;
if ((r = drmMap(fd, offset, size, &address))) {
drmError(r, argv[0]);
return 1;
}
printf("0x%08lx:0x%04lx mapped at %p for pid %d\n",
offset, size, address, getpid());
printf("===== /proc/%d/maps =====\n", getpid());
sprintf(buf, "cat /proc/%d/maps", getpid());
system(buf);
printf("===== /proc/dri/0/mem =====\n");
sprintf(buf, "cat /proc/dri/0/mem");
system(buf);
printf("===== /proc/dri/0/vma =====\n");
sprintf(buf, "cat /proc/dri/0/vma");
system(buf);
printf("===== READING =====\n");
for (i = 0; i < 0x10; i++)
printf("%02x ", (unsigned int)((unsigned char *)address)[i]);
printf("\n");
if (c == 'w') {
printf("===== WRITING =====\n");
for (i = 0; i < size; i+=2) {
((char *)address)[i] = i & 0xff;
((char *)address)[i+1] = i & 0xff;
}
}
printf("===== READING =====\n");
for (i = 0; i < 0x10; i++)
printf("%02x ", (unsigned int)((unsigned char *)address)[i]);
printf("\n");
printf("===== /proc/dri/0/vma =====\n");
sprintf(buf, "cat /proc/dri/0/vma");
system(buf);
break;
case 'L':
context = strtoul(optarg, &pt, 0);
offset = strtoul(pt+1, &pt, 0);
size = strtoul(pt+1, &pt, 0);
loops = strtoul(pt+1, NULL, 0);
address = NULL;
if ((r = drmMap(fd, offset, size, &address))) {
drmError(r, argv[0]);
return 1;
}
lock = address;
#if 1
{
int counter = 0;
struct timeval loop_start, loop_end;
struct timeval lock_start, lock_end;
double wt;
#define HISTOSIZE 9
int histo[HISTOSIZE];
int output = 0;
int fast = 0;
if (loops < 0) {
loops = -loops;
++output;
}
for (i = 0; i < HISTOSIZE; i++) histo[i] = 0;
gettimeofday(&loop_start, NULL);
for (i = 0; i < loops; i++) {
gettimeofday(&lock_start, NULL);
DRM_LIGHT_LOCK_COUNT(fd,lock,context,fast);
gettimeofday(&lock_end, NULL);
DRM_UNLOCK(fd,lock,context);
++counter;
wt = usec(&lock_end, &lock_start);
if (wt <= 2.5) ++histo[8];
if (wt < 5.0) ++histo[0];
else if (wt < 50.0) ++histo[1];
else if (wt < 500.0) ++histo[2];
else if (wt < 5000.0) ++histo[3];
else if (wt < 50000.0) ++histo[4];
else if (wt < 500000.0) ++histo[5];
else if (wt < 5000000.0) ++histo[6];
else ++histo[7];
if (output) printf( "%.2f uSec, %d fast\n", wt, fast);
}
gettimeofday(&loop_end, NULL);
printf( "Average wait time = %.2f usec, %d fast\n",
usec(&loop_end, &loop_start) / counter, fast);
printf( "%9d <= 2.5 uS\n", histo[8]);
printf( "%9d < 5 uS\n", histo[0]);
printf( "%9d < 50 uS\n", histo[1]);
printf( "%9d < 500 uS\n", histo[2]);
printf( "%9d < 5000 uS\n", histo[3]);
printf( "%9d < 50000 uS\n", histo[4]);
printf( "%9d < 500000 uS\n", histo[5]);
printf( "%9d < 5000000 uS\n", histo[6]);
printf( "%9d >= 5000000 uS\n", histo[7]);
}
#else
printf( "before lock: 0x%08x\n", lock->lock);
printf( "lock: 0x%08x\n", lock->lock);
sleep(5);
printf( "unlock: 0x%08x\n", lock->lock);
#endif
break;
default:
fprintf( stderr, "Usage: drmstat [options]\n" );
return 1;
}
return r;
}
int xf86ConfigDRI[10];

View File

@ -1,135 +0,0 @@
/*
* Copyright © 2007 Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*
* Authors:
* Eric Anholt <eric@anholt.net>
*
*/
#include <string.h>
#include <fcntl.h>
#include <fnmatch.h>
#include <sys/stat.h>
#include <sys/ioctl.h>
#include "drmtest.h"
#define LIBUDEV_I_KNOW_THE_API_IS_SUBJECT_TO_CHANGE
#include <libudev.h>
static int is_master(int fd)
{
drm_client_t client;
int ret;
/* Check that we're the only opener and authed. */
client.idx = 0;
ret = ioctl(fd, DRM_IOCTL_GET_CLIENT, &client);
assert (ret == 0);
if (!client.auth)
return 0;
client.idx = 1;
ret = ioctl(fd, DRM_IOCTL_GET_CLIENT, &client);
if (ret != -1 || errno != EINVAL)
return 0;
return 1;
}
/** Open the first DRM device matching the criteria */
int drm_open_matching(const char *pci_glob, int flags)
{
struct udev *udev;
struct udev_enumerate *e;
struct udev_device *device, *parent;
struct udev_list_entry *entry;
const char *pci_id, *path;
const char *usub, *dnode;
int fd;
udev = udev_new();
if (udev == NULL) {
fprintf(stderr, "failed to initialize udev context\n");
abort();
}
fd = -1;
e = udev_enumerate_new(udev);
udev_enumerate_add_match_subsystem(e, "drm");
udev_enumerate_scan_devices(e);
udev_list_entry_foreach(entry, udev_enumerate_get_list_entry(e)) {
path = udev_list_entry_get_name(entry);
device = udev_device_new_from_syspath(udev, path);
parent = udev_device_get_parent(device);
usub = udev_device_get_subsystem(parent);
/* Filter out KMS output devices. */
if (!usub || (strcmp(usub, "pci") != 0))
continue;
pci_id = udev_device_get_property_value(parent, "PCI_ID");
if (fnmatch(pci_glob, pci_id, 0) != 0)
continue;
dnode = udev_device_get_devnode(device);
if (strstr(dnode, "control"))
continue;
fd = open(dnode, O_RDWR);
if (fd < 0)
continue;
if ((flags & DRM_TEST_MASTER) && !is_master(fd)) {
close(fd);
fd = -1;
continue;
}
break;
}
udev_enumerate_unref(e);
udev_unref(udev);
return fd;
}
int drm_open_any(void)
{
int fd = drm_open_matching("*:*", 0);
if (fd < 0) {
fprintf(stderr, "failed to open any drm device\n");
exit(0);
}
return fd;
}
/**
* Open the first DRM device we can find where we end up being the master.
*/
int drm_open_any_master(void)
{
int fd = drm_open_matching("*:*", DRM_TEST_MASTER);
if (fd < 0) {
fprintf(stderr, "failed to open any drm device\n");
exit(0);
}
return fd;
}

View File

@ -1,40 +0,0 @@
/*
* Copyright © 2007 Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*
* Authors:
* Eric Anholt <eric@anholt.net>
*
*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <assert.h>
#include <errno.h>
#include "xf86drm.h"
#define DRM_TEST_MASTER 0x01
int drm_open_any(void);
int drm_open_any_master(void);
int drm_open_matching(const char *pci_glob, int flags);

View File

@ -188,8 +188,6 @@ LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@ LIBOBJS = @LIBOBJS@
LIBS = @LIBS@ LIBS = @LIBS@
LIBTOOL = @LIBTOOL@ LIBTOOL = @LIBTOOL@
LIBUDEV_CFLAGS = @LIBUDEV_CFLAGS@
LIBUDEV_LIBS = @LIBUDEV_LIBS@
LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_DIR = @LIB_MAN_DIR@
LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@
LIPO = @LIPO@ LIPO = @LIPO@

View File

@ -201,8 +201,6 @@ LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@ LIBOBJS = @LIBOBJS@
LIBS = @LIBS@ LIBS = @LIBS@
LIBTOOL = @LIBTOOL@ LIBTOOL = @LIBTOOL@
LIBUDEV_CFLAGS = @LIBUDEV_CFLAGS@
LIBUDEV_LIBS = @LIBUDEV_LIBS@
LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_DIR = @LIB_MAN_DIR@
LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@
LIPO = @LIPO@ LIPO = @LIPO@
@ -303,6 +301,7 @@ top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@ top_builddir = @top_builddir@
top_srcdir = @top_srcdir@ top_srcdir = @top_srcdir@
AM_CFLAGS = \ AM_CFLAGS = \
-pthread \
$(WARN_CFLAGS)\ $(WARN_CFLAGS)\
-I $(top_srcdir)/include/drm \ -I $(top_srcdir)/include/drm \
-I $(top_srcdir)/libkms/ \ -I $(top_srcdir)/libkms/ \
@ -315,8 +314,7 @@ exynos_fimg2d_perf_LDADD = \
exynos_fimg2d_event_LDADD = \ exynos_fimg2d_event_LDADD = \
$(top_builddir)/libdrm.la \ $(top_builddir)/libdrm.la \
$(top_builddir)/exynos/libdrm_exynos.la \ $(top_builddir)/exynos/libdrm_exynos.la
-lpthread
exynos_fimg2d_test_LDADD = \ exynos_fimg2d_test_LDADD = \
$(top_builddir)/libdrm.la \ $(top_builddir)/libdrm.la \

View File

@ -1,61 +0,0 @@
/*
* Copyright © 2007 Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*
* Authors:
* Eric Anholt <eric@anholt.net>
*
*/
#include <limits.h>
#include <sys/ioctl.h>
#include "drmtest.h"
/**
* Checks DRM_IOCTL_GET_CLIENT.
*/
int main(int argc, char **argv)
{
int fd, ret;
drm_client_t client;
fd = drm_open_any();
/* Look for client index 0. This should exist whether we're operating
* on an otherwise unused drm device, or the X Server is running on
* the device.
*/
client.idx = 0;
ret = ioctl(fd, DRM_IOCTL_GET_CLIENT, &client);
assert(ret == 0);
/* Look for some absurd client index and make sure it's invalid.
* The DRM drivers currently always return data, so the user has
* no real way to detect when the list has terminated. That's bad,
* and this test is XFAIL as a result.
*/
client.idx = 0x7fffffff;
ret = ioctl(fd, DRM_IOCTL_GET_CLIENT, &client);
assert(ret == -1 && errno == EINVAL);
close(fd);
return 0;
}

View File

@ -1,50 +0,0 @@
/*
* Copyright © 2007 Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*
* Authors:
* Eric Anholt <eric@anholt.net>
*
*/
#include <limits.h>
#include <sys/ioctl.h>
#include "drmtest.h"
/**
* Checks DRM_IOCTL_GET_STATS.
*
* I don't care too much about the actual contents, just that the kernel
* doesn't crash.
*/
int main(int argc, char **argv)
{
int fd, ret;
drm_stats_t stats;
fd = drm_open_any();
ret = ioctl(fd, DRM_IOCTL_GET_STATS, &stats);
assert(ret == 0);
close(fd);
return 0;
}

View File

@ -1,49 +0,0 @@
/*
* Copyright © 2007 Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*
* Authors:
* Eric Anholt <eric@anholt.net>
*
*/
#include <string.h>
#include "drmtest.h"
/**
* Checks DRM_IOCTL_GET_VERSION and libdrm's drmGetVersion() interface to it.
*/
int main(int argc, char **argv)
{
int fd;
drmVersionPtr v;
fd = drm_open_any();
v = drmGetVersion(fd);
assert(strlen(v->name) != 0);
assert(strlen(v->date) != 0);
assert(strlen(v->desc) != 0);
if (strcmp(v->name, "i915") == 0)
assert(v->version_major >= 1);
drmFreeVersion(v);
close(fd);
return 0;
}

View File

@ -186,8 +186,6 @@ LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@ LIBOBJS = @LIBOBJS@
LIBS = @LIBS@ LIBS = @LIBS@
LIBTOOL = @LIBTOOL@ LIBTOOL = @LIBTOOL@
LIBUDEV_CFLAGS = @LIBUDEV_CFLAGS@
LIBUDEV_LIBS = @LIBUDEV_LIBS@
LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_DIR = @LIB_MAN_DIR@
LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@
LIPO = @LIPO@ LIPO = @LIPO@

View File

@ -170,8 +170,6 @@ LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@ LIBOBJS = @LIBOBJS@
LIBS = @LIBS@ LIBS = @LIBS@
LIBTOOL = @LIBTOOL@ LIBTOOL = @LIBTOOL@
LIBUDEV_CFLAGS = @LIBUDEV_CFLAGS@
LIBUDEV_LIBS = @LIBUDEV_LIBS@
LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_DIR = @LIB_MAN_DIR@
LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@
LIPO = @LIPO@ LIPO = @LIPO@

View File

@ -169,8 +169,6 @@ LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@ LIBOBJS = @LIBOBJS@
LIBS = @LIBS@ LIBS = @LIBS@
LIBTOOL = @LIBTOOL@ LIBTOOL = @LIBTOOL@
LIBUDEV_CFLAGS = @LIBUDEV_CFLAGS@
LIBUDEV_LIBS = @LIBUDEV_LIBS@
LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_DIR = @LIB_MAN_DIR@
LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@
LIPO = @LIPO@ LIPO = @LIPO@

View File

@ -172,8 +172,6 @@ LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@ LIBOBJS = @LIBOBJS@
LIBS = @LIBS@ LIBS = @LIBS@
LIBTOOL = @LIBTOOL@ LIBTOOL = @LIBTOOL@
LIBUDEV_CFLAGS = @LIBUDEV_CFLAGS@
LIBUDEV_LIBS = @LIBUDEV_LIBS@
LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_DIR = @LIB_MAN_DIR@
LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@
LIPO = @LIPO@ LIPO = @LIPO@
@ -280,15 +278,14 @@ MODETEST_FILES := \
cursor.h \ cursor.h \
modetest.c modetest.c
AM_CFLAGS = $(filter-out -Wpointer-arith, $(WARN_CFLAGS)) \ AM_CFLAGS = $(filter-out -Wpointer-arith, $(WARN_CFLAGS)) -pthread \
-I$(top_srcdir)/include/drm -I$(top_srcdir)/tests \ -I$(top_srcdir)/include/drm -I$(top_srcdir)/tests \
-I$(top_srcdir) -I$(top_srcdir)
modetest_SOURCES = $(MODETEST_FILES) modetest_SOURCES = $(MODETEST_FILES)
modetest_LDADD = \ modetest_LDADD = \
$(top_builddir)/libdrm.la \ $(top_builddir)/libdrm.la \
$(top_builddir)/tests/util/libutil.la \ $(top_builddir)/tests/util/libutil.la \
$(CAIRO_LIBS) \ $(CAIRO_LIBS)
-lpthread
all: all-am all: all-am

View File

@ -1,58 +0,0 @@
/*
* Copyright © 2009 Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*
* Authors:
* Kristian Høgsberg <krh@bitplanet.net>
*
*/
#include <unistd.h>
#include <fcntl.h>
#include <limits.h>
#include <string.h>
#include "drmtest.h"
/**
* Checks drmGetDeviceNameFromFd
*
* This tests that we can get the actual version out, and that setting invalid
* major/minor numbers fails appropriately. It does not check the actual
* behavior differenses resulting from an increased DI version.
*/
int main(int argc, char **argv)
{
int fd;
const char *name = "/dev/dri/card0";
char *v;
fd = open("/dev/dri/card0", O_RDWR);
if (fd < 0)
return 0;
v = drmGetDeviceNameFromFd(fd);
close(fd);
assert(strcmp(name, v) == 0);
drmFree(v);
return 0;
}

View File

@ -173,8 +173,6 @@ LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@ LIBOBJS = @LIBOBJS@
LIBS = @LIBS@ LIBS = @LIBS@
LIBTOOL = @LIBTOOL@ LIBTOOL = @LIBTOOL@
LIBUDEV_CFLAGS = @LIBUDEV_CFLAGS@
LIBUDEV_LIBS = @LIBUDEV_LIBS@
LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_DIR = @LIB_MAN_DIR@
LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@
LIPO = @LIPO@ LIPO = @LIPO@
@ -274,16 +272,17 @@ target_alias = @target_alias@
top_build_prefix = @top_build_prefix@ top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@ top_builddir = @top_builddir@
top_srcdir = @top_srcdir@ top_srcdir = @top_srcdir@
AM_CPPFLAGS = \ AM_CFLAGS = \
-pthread \
$(WARN_CFLAGS) \
-I$(top_srcdir)/include/drm \ -I$(top_srcdir)/include/drm \
-I$(top_srcdir)/nouveau \ -I$(top_srcdir)/nouveau \
-I$(top_srcdir) -I$(top_srcdir)
AM_CFLAGS = $(WARN_CFLAGS)
LDADD = \ LDADD = \
../../nouveau/libdrm_nouveau.la \ ../../nouveau/libdrm_nouveau.la \
../../libdrm.la \ ../../libdrm.la \
-ldl -lpthread -ldl
all: all-am all: all-am

View File

@ -1,37 +0,0 @@
/*
* Copyright © 2007 Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*
* Authors:
* Eric Anholt <eric@anholt.net>
*
*/
#include "drmtest.h"
int main(int argc, char **argv)
{
int fd;
fd = drm_open_any();
close(fd);
return 0;
}

View File

@ -171,8 +171,6 @@ LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@ LIBOBJS = @LIBOBJS@
LIBS = @LIBS@ LIBS = @LIBS@
LIBTOOL = @LIBTOOL@ LIBTOOL = @LIBTOOL@
LIBUDEV_CFLAGS = @LIBUDEV_CFLAGS@
LIBUDEV_LIBS = @LIBUDEV_LIBS@
LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_DIR = @LIB_MAN_DIR@
LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@
LIPO = @LIPO@ LIPO = @LIPO@

View File

@ -168,8 +168,6 @@ LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@ LIBOBJS = @LIBOBJS@
LIBS = @LIBS@ LIBS = @LIBS@
LIBTOOL = @LIBTOOL@ LIBTOOL = @LIBTOOL@
LIBUDEV_CFLAGS = @LIBUDEV_CFLAGS@
LIBUDEV_LIBS = @LIBUDEV_LIBS@
LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_DIR = @LIB_MAN_DIR@
LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@
LIPO = @LIPO@ LIPO = @LIPO@

View File

@ -1,91 +0,0 @@
/*
* Copyright © 2007 Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*
* Authors:
* Eric Anholt <eric@anholt.net>
*
*/
#include <limits.h>
#include <string.h>
#include <sys/ioctl.h>
#include "drmtest.h"
/**
* Checks DRM_IOCTL_SET_VERSION.
*
* This tests that we can get the actual version out, and that setting invalid
* major/minor numbers fails appropriately. It does not check the actual
* behavior differenses resulting from an increased DI version.
*/
int main(int argc, char **argv)
{
int fd, ret;
drm_set_version_t sv, version;
if (getuid() != 0) {
fprintf(stderr, "setversion test requires root, skipping\n");
return 0;
}
fd = drm_open_any_master();
/* First, check that we can get the DD/DI versions. */
memset(&version, 0, sizeof(version));
version.drm_di_major = -1;
version.drm_di_minor = -1;
version.drm_dd_major = -1;
version.drm_dd_minor = -1;
ret = ioctl(fd, DRM_IOCTL_SET_VERSION, &version);
assert(ret == 0);
assert(version.drm_di_major != -1);
assert(version.drm_di_minor != -1);
assert(version.drm_dd_major != -1);
assert(version.drm_dd_minor != -1);
/* Check that an invalid DI major fails */
sv = version;
sv.drm_di_major++;
ret = ioctl(fd, DRM_IOCTL_SET_VERSION, &sv);
assert(ret == -1 && errno == EINVAL);
/* Check that an invalid DI minor fails */
sv = version;
sv.drm_di_major++;
ret = ioctl(fd, DRM_IOCTL_SET_VERSION, &sv);
assert(ret == -1 && errno == EINVAL);
/* Check that an invalid DD major fails */
sv = version;
sv.drm_dd_major++;
ret = ioctl(fd, DRM_IOCTL_SET_VERSION, &sv);
assert(ret == -1 && errno == EINVAL);
/* Check that an invalid DD minor fails */
sv = version;
sv.drm_dd_minor++;
ret = ioctl(fd, DRM_IOCTL_SET_VERSION, &sv);
assert(ret == -1 && errno == EINVAL);
close(fd);
return 0;
}

View File

@ -168,8 +168,6 @@ LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@ LIBOBJS = @LIBOBJS@
LIBS = @LIBS@ LIBS = @LIBS@
LIBTOOL = @LIBTOOL@ LIBTOOL = @LIBTOOL@
LIBUDEV_CFLAGS = @LIBUDEV_CFLAGS@
LIBUDEV_LIBS = @LIBUDEV_LIBS@
LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_DIR = @LIB_MAN_DIR@
LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@
LIPO = @LIPO@ LIPO = @LIPO@

View File

@ -1,154 +0,0 @@
/*
* Copyright © 2007 Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*
* Authors:
* Eric Anholt <eric@anholt.net>
*
*/
#include <sys/ioctl.h>
#include "drmtest.h"
static void
set_draw_cliprects_empty(int fd, int drawable)
{
int ret;
struct drm_update_draw update;
update.handle = drawable;
update.type = DRM_DRAWABLE_CLIPRECTS;
update.num = 0;
update.data = 0;
ret = ioctl(fd, DRM_IOCTL_UPDATE_DRAW, &update);
assert(ret == 0);
}
static void
set_draw_cliprects_empty_fail(int fd, int drawable)
{
int ret;
struct drm_update_draw update;
update.handle = drawable;
update.type = DRM_DRAWABLE_CLIPRECTS;
update.num = 0;
update.data = 0;
ret = ioctl(fd, DRM_IOCTL_UPDATE_DRAW, &update);
assert(ret == -1 && errno == EINVAL);
}
static void
set_draw_cliprects_2(int fd, int drawable)
{
int ret;
struct drm_update_draw update;
drm_clip_rect_t rects[2];
rects[0].x1 = 0;
rects[0].y1 = 0;
rects[0].x2 = 10;
rects[0].y2 = 10;
rects[1].x1 = 10;
rects[1].y1 = 10;
rects[1].x2 = 20;
rects[1].y2 = 20;
update.handle = drawable;
update.type = DRM_DRAWABLE_CLIPRECTS;
update.num = 2;
update.data = (unsigned long long)(uintptr_t)&rects;
ret = ioctl(fd, DRM_IOCTL_UPDATE_DRAW, &update);
assert(ret == 0);
}
static int add_drawable(int fd)
{
drm_draw_t drawarg;
int ret;
/* Create a drawable.
* IOCTL_ADD_DRAW is RDWR, though it should really just be RD
*/
drawarg.handle = 0;
ret = ioctl(fd, DRM_IOCTL_ADD_DRAW, &drawarg);
assert(ret == 0);
return drawarg.handle;
}
static int rm_drawable(int fd, int drawable, int fail)
{
drm_draw_t drawarg;
int ret;
/* Create a drawable.
* IOCTL_ADD_DRAW is RDWR, though it should really just be RD
*/
drawarg.handle = drawable;
ret = ioctl(fd, DRM_IOCTL_RM_DRAW, &drawarg);
if (!fail)
assert(ret == 0);
else
assert(ret == -1 && errno == EINVAL);
return drawarg.handle;
}
/**
* Tests drawable management: adding, removing, and updating the cliprects of
* drawables.
*/
int main(int argc, char **argv)
{
int fd, d1, d2;
if (getuid() != 0) {
fprintf(stderr, "updatedraw test requires root, skipping\n");
return 0;
}
fd = drm_open_any_master();
d1 = add_drawable(fd);
d2 = add_drawable(fd);
/* Do a series of cliprect updates */
set_draw_cliprects_empty(fd, d1);
set_draw_cliprects_empty(fd, d2);
set_draw_cliprects_2(fd, d1);
set_draw_cliprects_empty(fd, d1);
/* Remove our drawables */
rm_drawable(fd, d1, 0);
rm_drawable(fd, d2, 0);
/* Check that removing an unknown drawable returns error */
rm_drawable(fd, 0x7fffffff, 1);
/* Attempt to set cliprects on a nonexistent drawable */
set_draw_cliprects_empty_fail(fd, d1);
close(fd);
return 0;
}

View File

@ -171,8 +171,6 @@ LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@ LIBOBJS = @LIBOBJS@
LIBS = @LIBS@ LIBS = @LIBS@
LIBTOOL = @LIBTOOL@ LIBTOOL = @LIBTOOL@
LIBUDEV_CFLAGS = @LIBUDEV_CFLAGS@
LIBUDEV_LIBS = @LIBUDEV_LIBS@
LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_DIR = @LIB_MAN_DIR@
LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@
LIPO = @LIPO@ LIPO = @LIPO@

View File

@ -170,8 +170,6 @@ LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@ LIBOBJS = @LIBOBJS@
LIBS = @LIBS@ LIBS = @LIBS@
LIBTOOL = @LIBTOOL@ LIBTOOL = @LIBTOOL@
LIBUDEV_CFLAGS = @LIBUDEV_CFLAGS@
LIBUDEV_LIBS = @LIBUDEV_LIBS@
LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_DIR = @LIB_MAN_DIR@
LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@
LIPO = @LIPO@ LIPO = @LIPO@

View File

@ -190,8 +190,6 @@ LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@ LIBOBJS = @LIBOBJS@
LIBS = @LIBS@ LIBS = @LIBS@
LIBTOOL = @LIBTOOL@ LIBTOOL = @LIBTOOL@
LIBUDEV_CFLAGS = @LIBUDEV_CFLAGS@
LIBUDEV_LIBS = @LIBUDEV_LIBS@
LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_DIR = @LIB_MAN_DIR@
LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@
LIPO = @LIPO@ LIPO = @LIPO@

File diff suppressed because it is too large Load Diff

View File

@ -753,6 +753,11 @@ typedef struct _drmEventContext {
extern int drmHandleEvent(int fd, drmEventContextPtr evctx); extern int drmHandleEvent(int fd, drmEventContextPtr evctx);
extern char *drmGetDeviceNameFromFd(int fd); extern char *drmGetDeviceNameFromFd(int fd);
/* Improved version of drmGetDeviceNameFromFd which attributes for any type of
* device/node - card, control or renderD.
*/
extern char *drmGetDeviceNameFromFd2(int fd);
extern int drmGetNodeTypeFromFd(int fd); extern int drmGetNodeTypeFromFd(int fd);
extern int drmPrimeHandleToFD(int fd, uint32_t handle, uint32_t flags, int *prime_fd); extern int drmPrimeHandleToFD(int fd, uint32_t handle, uint32_t flags, int *prime_fd);
@ -761,7 +766,10 @@ extern int drmPrimeFDToHandle(int fd, int prime_fd, uint32_t *handle);
extern char *drmGetPrimaryDeviceNameFromFd(int fd); extern char *drmGetPrimaryDeviceNameFromFd(int fd);
extern char *drmGetRenderDeviceNameFromFd(int fd); extern char *drmGetRenderDeviceNameFromFd(int fd);
#define DRM_BUS_PCI 0 #define DRM_BUS_PCI 0
#define DRM_BUS_USB 1
#define DRM_BUS_PLATFORM 2
#define DRM_BUS_HOST1X 3
typedef struct _drmPciBusInfo { typedef struct _drmPciBusInfo {
uint16_t domain; uint16_t domain;
@ -778,15 +786,51 @@ typedef struct _drmPciDeviceInfo {
uint8_t revision_id; uint8_t revision_id;
} drmPciDeviceInfo, *drmPciDeviceInfoPtr; } drmPciDeviceInfo, *drmPciDeviceInfoPtr;
typedef struct _drmUsbBusInfo {
uint8_t bus;
uint8_t dev;
} drmUsbBusInfo, *drmUsbBusInfoPtr;
typedef struct _drmUsbDeviceInfo {
uint16_t vendor;
uint16_t product;
} drmUsbDeviceInfo, *drmUsbDeviceInfoPtr;
#define DRM_PLATFORM_DEVICE_NAME_LEN 512
typedef struct _drmPlatformBusInfo {
char fullname[DRM_PLATFORM_DEVICE_NAME_LEN];
} drmPlatformBusInfo, *drmPlatformBusInfoPtr;
typedef struct _drmPlatformDeviceInfo {
char **compatible; /* NULL terminated list of compatible strings */
} drmPlatformDeviceInfo, *drmPlatformDeviceInfoPtr;
#define DRM_HOST1X_DEVICE_NAME_LEN 512
typedef struct _drmHost1xBusInfo {
char fullname[DRM_HOST1X_DEVICE_NAME_LEN];
} drmHost1xBusInfo, *drmHost1xBusInfoPtr;
typedef struct _drmHost1xDeviceInfo {
char **compatible; /* NULL terminated list of compatible strings */
} drmHost1xDeviceInfo, *drmHost1xDeviceInfoPtr;
typedef struct _drmDevice { typedef struct _drmDevice {
char **nodes; /* DRM_NODE_MAX sized array */ char **nodes; /* DRM_NODE_MAX sized array */
int available_nodes; /* DRM_NODE_* bitmask */ int available_nodes; /* DRM_NODE_* bitmask */
int bustype; int bustype;
union { union {
drmPciBusInfoPtr pci; drmPciBusInfoPtr pci;
drmUsbBusInfoPtr usb;
drmPlatformBusInfoPtr platform;
drmHost1xBusInfoPtr host1x;
} businfo; } businfo;
union { union {
drmPciDeviceInfoPtr pci; drmPciDeviceInfoPtr pci;
drmUsbDeviceInfoPtr usb;
drmPlatformDeviceInfoPtr platform;
drmHost1xDeviceInfoPtr host1x;
} deviceinfo; } deviceinfo;
} drmDevice, *drmDevicePtr; } drmDevice, *drmDevicePtr;
@ -796,6 +840,10 @@ extern void drmFreeDevice(drmDevicePtr *device);
extern int drmGetDevices(drmDevicePtr devices[], int max_devices); extern int drmGetDevices(drmDevicePtr devices[], int max_devices);
extern void drmFreeDevices(drmDevicePtr devices[], int count); extern void drmFreeDevices(drmDevicePtr devices[], int count);
#define DRM_DEVICE_GET_PCI_REVISION (1 << 0)
extern int drmGetDevice2(int fd, uint32_t flags, drmDevicePtr *device);
extern int drmGetDevices2(uint32_t flags, drmDevicePtr devices[], int max_devices);
#if defined(__cplusplus) #if defined(__cplusplus)
} }
#endif #endif

View File

@ -901,7 +901,7 @@ int drmHandleEvent(int fd, drmEventContextPtr evctx)
i = 0; i = 0;
while (i < len) { while (i < len) {
e = (struct drm_event *) &buffer[i]; e = (struct drm_event *)(buffer + i);
switch (e->type) { switch (e->type) {
case DRM_EVENT_VBLANK: case DRM_EVENT_VBLANK:
if (evctx->version < 1 || if (evctx->version < 1 ||

View File

@ -123,13 +123,15 @@ extern "C" {
#define DRM_MODE_DITHERING_OFF 0 #define DRM_MODE_DITHERING_OFF 0
#define DRM_MODE_DITHERING_ON 1 #define DRM_MODE_DITHERING_ON 1
#define DRM_MODE_ENCODER_NONE 0 #define DRM_MODE_ENCODER_NONE 0
#define DRM_MODE_ENCODER_DAC 1 #define DRM_MODE_ENCODER_DAC 1
#define DRM_MODE_ENCODER_TMDS 2 #define DRM_MODE_ENCODER_TMDS 2
#define DRM_MODE_ENCODER_LVDS 3 #define DRM_MODE_ENCODER_LVDS 3
#define DRM_MODE_ENCODER_TVDAC 4 #define DRM_MODE_ENCODER_TVDAC 4
#define DRM_MODE_ENCODER_VIRTUAL 5 #define DRM_MODE_ENCODER_VIRTUAL 5
#define DRM_MODE_ENCODER_DSI 6 #define DRM_MODE_ENCODER_DSI 6
#define DRM_MODE_ENCODER_DPMST 7
#define DRM_MODE_ENCODER_DPI 8
#define DRM_MODE_SUBCONNECTOR_Automatic 0 #define DRM_MODE_SUBCONNECTOR_Automatic 0
#define DRM_MODE_SUBCONNECTOR_Unknown 0 #define DRM_MODE_SUBCONNECTOR_Unknown 0
@ -153,10 +155,11 @@ extern "C" {
#define DRM_MODE_CONNECTOR_DisplayPort 10 #define DRM_MODE_CONNECTOR_DisplayPort 10
#define DRM_MODE_CONNECTOR_HDMIA 11 #define DRM_MODE_CONNECTOR_HDMIA 11
#define DRM_MODE_CONNECTOR_HDMIB 12 #define DRM_MODE_CONNECTOR_HDMIB 12
#define DRM_MODE_CONNECTOR_TV 13 #define DRM_MODE_CONNECTOR_TV 13
#define DRM_MODE_CONNECTOR_eDP 14 #define DRM_MODE_CONNECTOR_eDP 14
#define DRM_MODE_CONNECTOR_VIRTUAL 15 #define DRM_MODE_CONNECTOR_VIRTUAL 15
#define DRM_MODE_CONNECTOR_DSI 16 #define DRM_MODE_CONNECTOR_DSI 16
#define DRM_MODE_CONNECTOR_DPI 17
#define DRM_MODE_PROP_PENDING (1<<0) #define DRM_MODE_PROP_PENDING (1<<0)
#define DRM_MODE_PROP_RANGE (1<<1) #define DRM_MODE_PROP_RANGE (1<<1)