diff -Nru libdrm-2.4.61+git20150614.97be70b4/ChangeLog libdrm-2.4.62+git20150703.676c806d/ChangeLog --- libdrm-2.4.61+git20150614.97be70b4/ChangeLog 2015-06-14 10:07:08.000000000 +0000 +++ libdrm-2.4.62+git20150703.676c806d/ChangeLog 2015-07-03 06:14:50.000000000 +0000 @@ -1,9 +1,239 @@ -commit e9e50c8bf63d60fffdc71cd4d09606901a523ac6 +commit c2cdf2da5f11fb66e6850cbfbc20c2549d12071a Author: Rico Tzschichholz -Date: Sun Jun 14 12:06:45 2015 +0200 +Date: Fri Jul 3 08:14:28 2015 +0200 Add debian tree from origin/debian-unstable +commit 676c806d0221a7ea375676b2eab514c426fcacd3 +Author: Emil Velikov +Date: Tue Jun 30 14:01:14 2015 +0100 + + configure: default --enable-valgrind to auto + + ... as the help text says. + + Reported-by: Jasper St. Pierre + Signed-off-by: Emil Velikov + +commit ba4b5ac010ab85406ec52e3906e13d58cd9aa782 +Author: Emil Velikov +Date: Mon Jun 29 19:25:35 2015 +0100 + + configure.ac: bump version to 2.4.62 for release + + Signed-off-by: Emil Velikov + +commit 2bf0d5bf63cda5a0abd79f2fd4b5737cb852b476 +Author: Tobias Jakobi +Date: Fri Jun 12 20:15:14 2015 +0200 + + tests/exynos: handle G2D_IMGBUF_COLOR in switch statements + + This fixes a compiler warning about missing handling of enum + values in the switch statements. + + Also remove the silent mapping to G2D_IMGBUF_GEM when an + unknown buffer type is encountered. We have full control + about the type here, and if it's unknown then we obviously + have a bug in the code. + + Signed-off-by: Tobias Jakobi + Acked-by: Emil Velikov + +commit b26c8efb6566e78d12a93fee7c01f6857e07f611 +Author: Tobias Jakobi +Date: Fri Jun 12 20:15:13 2015 +0200 + + tests/exynos: remove connector_find_plane + + No test uses DRM planes at the moment so this function + is never called. Inspection of the git history shows + that DRM planes were also never used in these tests + in the past. + + Signed-off-by: Tobias Jakobi + Acked-by: Emil Velikov + +commit 13ad10afc306a76f9a61e6a339e412a34a59bfe4 +Author: Tobias Jakobi +Date: Fri Jun 12 20:15:12 2015 +0200 + + tests/exynos: simplify drm_set_crtc + + We can just return 'ret' here, the goto serves no purpose. + + Signed-off-by: Tobias Jakobi + Acked-by: Emil Velikov + +commit 28d896c763e0cc2ab8f9679ee75b756bdd587da7 +Author: Tobias Jakobi +Date: Fri Jun 12 20:15:11 2015 +0200 + + tests/exynos: remove struct fimg2d_test_case + + It doesn't make sense to keep this structure, since we + can just call all tests directly. An inspection of the + git history shows that no code ever used this + abstraction in the past. + + Signed-off-by: Tobias Jakobi + Acked-by: Emil Velikov + +commit 3aeea6198d3c62bab2ce98450f47ff91e402784b +Author: Tobias Jakobi +Date: Fri Jun 12 20:15:10 2015 +0200 + + tests/exynos: remove unused define + + It doesn't make sense to limit the number of + test cases anyway. + + Signed-off-by: Tobias Jakobi + Acked-by: Emil Velikov + +commit 0536d33f077ef92b5e9577c32a8772dd79f31c43 +Author: Tobias Jakobi +Date: Fri Jun 12 20:15:09 2015 +0200 + + tests/exynos: clean struct connector + + Remove all unused struct members. An inspection of the + git history shows that these members were also never + used in the past. + + Signed-off-by: Tobias Jakobi + Acked-by: Emil Velikov + +commit 53b1081da1b05e6225d93d4a6890fba4eba8313e +Author: Tobias Jakobi +Date: Fri Jun 12 20:15:08 2015 +0200 + + exynos/fimg2d: simplify g2d_fini() + + free()ing a nullptr is a noop, so remove the check. + + Signed-off-by: Tobias Jakobi + Acked-by: Emil Velikov + +commit 8d8bbbb9722c3eed3e2736da95d2fef4613d97fb +Author: Tobias Jakobi +Date: Fri Jun 12 20:15:07 2015 +0200 + + tests/exynos: replace return by break + + The 'usage' function already does exit(0), so that this + 'return -EINVAL' is never called. Just put a break there + to avoid confusion. + + Signed-off-by: Tobias Jakobi + Acked-by: Emil Velikov + +commit 7da8f07274cfe57cfd157e184f1f0b4c15405b9e +Author: Tobias Jakobi +Date: Fri Jun 12 20:15:06 2015 +0200 + + exynos: fimg2d: fix return codes + + Even if flushing the command buffer doesn't succeed, the + G2D calls would still return zero. Fix this by just passing + the flush return code. + + In fact error handling currently ignores the fact that + g2d_add_cmd() can fail. This is going to be handled + in a later patch. + + Signed-off-by: Tobias Jakobi + Acked-by: Emil Velikov + +commit 47a2de27a0f087908e3063fdd6dfdececd2db75b +Author: Matt Turner +Date: Mon Jun 22 09:56:33 2015 -0700 + + configure: Add flag to disable valgrind support. + + v2 [Emil Velikov]: Autodetect valgrind. + Signed-off-by: Emil Velikov + +commit 5f76273d51fee5c176302ae5f57673461b80333b +Author: Emil Velikov +Date: Mon Jun 29 17:32:21 2015 +0100 + + xf86drmMode: include config.h before anything else + + Signed-off-by: Emil Velikov + +commit 8426967d4e34ef5924a30166662c60d1003072bd +Author: Emil Velikov +Date: Mon Jun 22 17:58:05 2015 +0000 + + xf86drmMode: remove unused valgrind(VG) macros + + Signed-off-by: Emil Velikov + +commit 32471b265c6fbce6d519f0420a0ffeb608296502 +Author: Daniel Stone +Date: Mon Jun 22 17:26:03 2015 +0100 + + Add blob property create/destroy ioctl wrappers + + v2: Use memclear to zero out structure. + + Signed-off-by: Daniel Stone + Reviewed-by: Rob Clark + +commit ed44e0b9585c563905447eceed12af9c1c7ca8d4 +Author: Ville Syrjälä +Date: Mon Jun 22 17:26:02 2015 +0100 + + Support atomic modesetting ioctl + + Add support for the atomic modesetting ioctl through a property-set API. + + v1: Squashed intermediate patches from Ville, Rob and myself. Updated + for current kernel interface (no blobs). + v2: Rewrite user-facing API to provide transactional/cursor interface. + Use memclear to zero out ioctl. + + Signed-off-by: Ville Syrjälä + Signed-off-by: Rob Clark + Signed-off-by: Daniel Stone + + v3 [Emil Velikov]: Remove DRM_CAP_ATOMIC - superseded by + DRM_CLIENT_CAP_ATOMIC. + Signed-off-by: Emil Velikov + +commit 5b0e76f143887c4ec7db45c54a7ba27a58f59227 +Author: Emil Velikov +Date: Sat May 30 14:25:08 2015 +0100 + + Revert "Add device enumeration interface (v4)" + + This reverts commit fde4969176822fe54197b6baa78f8b0ef900baba. + + The commit adds an API that does not seem flexible enough to be used in + current open-source projects. Additionally it adds a hidden dependency + of libudev, which when used in mesa caused grief when combined with + Steam('s runtime). + + Let's revert this for now and add a tweaked API later on that can be + used in mesa/xserver. + + Cc: Frank Min + Cc: Christian König + Cc: Alex Deucher + Cc: Jammy Zhou + +commit 203983f842a889b279698fdea46e83ee4450a1db +Author: Ilia Mirkin +Date: Sun Jun 21 19:26:42 2015 -0400 + + nouveau: add asserts to make sure krefs are there + + This should help catch odd bugs at the callsites rather than much later + on with completely bogus bo indices. + + Signed-off-by: Ilia Mirkin + commit 97be70b45eccc37e98a1cecf360593f36956ea42 Author: Boris BREZILLON Date: Thu May 28 10:07:43 2015 +0200 diff -Nru libdrm-2.4.61+git20150614.97be70b4/config.h.in libdrm-2.4.62+git20150703.676c806d/config.h.in --- libdrm-2.4.61+git20150614.97be70b4/config.h.in 2015-06-14 10:07:04.000000000 +0000 +++ libdrm-2.4.62+git20150703.676c806d/config.h.in 2015-07-03 06:14:47.000000000 +0000 @@ -84,6 +84,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_SYSCTL_H + /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H diff -Nru libdrm-2.4.61+git20150614.97be70b4/configure libdrm-2.4.62+git20150703.676c806d/configure --- libdrm-2.4.61+git20150614.97be70b4/configure 2015-06-14 10:07:03.000000000 +0000 +++ libdrm-2.4.62+git20150703.676c806d/configure 2015-07-03 06:14:46.000000000 +0000 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for libdrm 2.4.61. +# Generated by GNU Autoconf 2.69 for libdrm 2.4.62. # # Report bugs to . # @@ -591,8 +591,8 @@ # Identity of this package. PACKAGE_NAME='libdrm' PACKAGE_TARNAME='libdrm' -PACKAGE_VERSION='2.4.61' -PACKAGE_STRING='libdrm 2.4.61' +PACKAGE_VERSION='2.4.62' +PACKAGE_STRING='libdrm 2.4.62' PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=DRI' PACKAGE_URL='' @@ -843,6 +843,7 @@ enable_install_test_programs enable_cairo_tests enable_manpages +enable_valgrind with_kernel_source ' ac_precious_vars='build_alias @@ -1408,7 +1409,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures libdrm 2.4.61 to adapt to many kinds of systems. +\`configure' configures libdrm 2.4.62 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1478,7 +1479,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of libdrm 2.4.61:";; + short | recursive ) echo "Configuration of libdrm 2.4.62:";; esac cat <<\_ACEOF @@ -1525,6 +1526,7 @@ --enable-cairo-tests Enable support for Cairo rendering in tests (default: auto) --enable-manpages enable manpages [default=auto] + --enable-valgrind Build libdrm with valgrind support (default: auto) Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -1639,7 +1641,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -libdrm configure 2.4.61 +libdrm configure 2.4.62 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2062,7 +2064,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by libdrm $as_me 2.4.61, which was +It was created by libdrm $as_me 2.4.62, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3301,7 +3303,7 @@ # Define the identity of the package. PACKAGE='libdrm' - VERSION='2.4.61' + VERSION='2.4.62' cat >>confdefs.h <<_ACEOF @@ -5515,12 +5517,13 @@ fi -for ac_header in sys/mkdev.h +for ac_header in sys/mkdev.h sys/sysctl.h do : - ac_fn_c_check_header_mongrel "$LINENO" "sys/mkdev.h" "ac_cv_header_sys_mkdev_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_mkdev_h" = xyes; then : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF -#define HAVE_SYS_MKDEV_H 1 +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi @@ -13783,6 +13786,13 @@ fi +# Check whether --enable-valgrind was given. +if test "${enable_valgrind+set}" = set; then : + enableval=$enable_valgrind; VALGRIND=$enableval +else + VALGRIND=auto +fi + pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for VALGRIND" >&5 @@ -13854,12 +13864,24 @@ $as_echo "yes" >&6; } have_valgrind=yes fi -if test "x$have_valgrind" = "xyes"; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable Valgrind support" >&5 +$as_echo_n "checking whether to enable Valgrind support... " >&6; } +if test "x$VALGRIND" = xauto; then + VALGRIND="$have_valgrind" +fi + +if test "x$VALGRIND" = "xyes"; then + if ! test "x$have_valgrind" = xyes; then + as_fn_error $? "Valgrind support required but not present" "$LINENO" 5 + fi $as_echo "#define HAVE_VALGRIND 1" >>confdefs.h fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $VALGRIND" >&5 +$as_echo "$VALGRIND" >&6; } + # Check whether --with-kernel-source was given. if test "${with_kernel_source+set}" = set; then : @@ -14496,7 +14518,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by libdrm $as_me 2.4.61, which was +This file was extended by libdrm $as_me 2.4.62, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -14562,7 +14584,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -libdrm config.status 2.4.61 +libdrm config.status 2.4.62 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff -Nru libdrm-2.4.61+git20150614.97be70b4/configure.ac libdrm-2.4.62+git20150703.676c806d/configure.ac --- libdrm-2.4.61+git20150614.97be70b4/configure.ac 2015-05-21 10:58:25.000000000 +0000 +++ libdrm-2.4.62+git20150703.676c806d/configure.ac 2015-07-03 06:14:53.000000000 +0000 @@ -20,7 +20,7 @@ AC_PREREQ([2.63]) AC_INIT([libdrm], - [2.4.61], + [2.4.62], [https://bugs.freedesktop.org/enter_bug.cgi?product=DRI], [libdrm]) @@ -403,11 +403,25 @@ fi AM_CONDITIONAL([HAVE_MANPAGES_STYLESHEET], [test "x$HAVE_MANPAGES_STYLESHEET" = "xyes"]) +AC_ARG_ENABLE(valgrind, + [AS_HELP_STRING([--enable-valgrind], + [Build libdrm with valgrind support (default: auto)])], + [VALGRIND=$enableval], [VALGRIND=auto]) PKG_CHECK_MODULES(VALGRIND, [valgrind], [have_valgrind=yes], [have_valgrind=no]) -if test "x$have_valgrind" = "xyes"; then +AC_MSG_CHECKING([whether to enable Valgrind support]) +if test "x$VALGRIND" = xauto; then + VALGRIND="$have_valgrind" +fi + +if test "x$VALGRIND" = "xyes"; then + if ! test "x$have_valgrind" = xyes; then + AC_MSG_ERROR([Valgrind support required but not present]) + fi AC_DEFINE([HAVE_VALGRIND], 1, [Use valgrind intrinsics to suppress false warnings]) fi +AC_MSG_RESULT([$VALGRIND]) + AC_ARG_WITH([kernel-source], [AS_HELP_STRING([--with-kernel-source], [specify path to linux kernel source])], diff -Nru libdrm-2.4.61+git20150614.97be70b4/debian/changelog libdrm-2.4.62+git20150703.676c806d/debian/changelog --- libdrm-2.4.61+git20150614.97be70b4/debian/changelog 2015-07-03 06:18:23.000000000 +0000 +++ libdrm-2.4.62+git20150703.676c806d/debian/changelog 2015-07-03 06:18:24.000000000 +0000 @@ -1,23 +1,32 @@ -libdrm (2.4.61+git20150614.97be70b4-0ubuntu0ricotz~trusty) trusty; urgency=medium +libdrm (2.4.62+git20150703.676c806d-0ubuntu0ricotz~trusty) trusty; urgency=medium - * Checkout from git 20150614 (master branch) up to commit - 97be70b45eccc37e98a1cecf360593f36956ea42 + * Checkout from git 20150703 (master branch) up to commit + 676c806d0221a7ea375676b2eab514c426fcacd3 * Only added debian/ tree from origin/debian-unstable - -- Rico Tzschichholz Sun, 14 Jun 2015 12:07:09 +0200 + -- Rico Tzschichholz Fri, 03 Jul 2015 08:14:51 +0200 -libdrm (2.4.61-1) UNRELEASED; urgency=medium +libdrm (2.4.62-1) unstable; urgency=medium [ Sven Joachim ] - * New upstream version. + * New upstream release. + - nouveau: restore check that avoids multiple user bos per kernel bo + (Closes: #789759). * Update symbols file and bump shlibs for libdrm2. + * Refresh the patch from 2.4.60-3 after upstream changes. * Remove duplicate Section fields from debian/control. + * Update debian/upstream/signing-key.asc. * Bump Standards-Version to 3.9.6, no changes needed. [ Julien Cristau ] * Update debian/upstream/signing-key.asc. + * Fix kfreebsd patch that caused an FTBFS on Linux/x32: only include + if configure detects it (closes: #787496). Thanks, + Thorsten Glaser. + * Add build-dep on xutils-dev for xorg-macros. + * Cherry-pick upstream patch to let valgrind auto-detection work. - -- Sven Joachim Fri, 08 May 2015 21:35:41 +0200 + -- Julien Cristau Thu, 02 Jul 2015 21:11:21 +0200 libdrm (2.4.60-3) unstable; urgency=medium diff -Nru libdrm-2.4.61+git20150614.97be70b4/debian/control libdrm-2.4.62+git20150703.676c806d/debian/control --- libdrm-2.4.61+git20150614.97be70b4/debian/control 2015-07-03 06:18:23.000000000 +0000 +++ libdrm-2.4.62+git20150703.676c806d/debian/control 2015-07-03 06:18:24.000000000 +0000 @@ -10,12 +10,12 @@ docbook-xsl, libx11-dev, pkg-config, + xutils-dev (>= 1:7.6+2), libpthread-stubs0-dev, libudev-dev [linux-any], libpciaccess-dev, valgrind [amd64 armhf i386 mips mipsel powerpc s390x], libbsd-dev [kfreebsd-any], - xutils-dev, Standards-Version: 3.9.6 Section: libs Vcs-Git: git://git.debian.org/git/pkg-xorg/lib/libdrm diff -Nru libdrm-2.4.61+git20150614.97be70b4/debian/libdrm2.symbols libdrm-2.4.62+git20150703.676c806d/debian/libdrm2.symbols --- libdrm-2.4.61+git20150614.97be70b4/debian/libdrm2.symbols 2015-07-03 06:18:23.000000000 +0000 +++ libdrm-2.4.62+git20150703.676c806d/debian/libdrm2.symbols 2015-07-03 06:18:24.000000000 +0000 @@ -80,10 +80,20 @@ drmMarkBufs@Base 2.3.1 drmModeAddFB2@Base 2.4.30 drmModeAddFB@Base 2.4.3 + drmModeAtomicAddProperty@Base 2.4.62 + drmModeAtomicAlloc@Base 2.4.62 + drmModeAtomicCommit@Base 2.4.62 + drmModeAtomicDuplicate@Base 2.4.62 + drmModeAtomicFree@Base 2.4.62 + drmModeAtomicGetCursor@Base 2.4.62 + drmModeAtomicMerge@Base 2.4.62 + drmModeAtomicSetCursor@Base 2.4.62 drmModeAttachMode@Base 2.4.3 drmModeConnectorSetProperty@Base 2.4.3 + drmModeCreatePropertyBlob@Base 2.4.62 drmModeCrtcGetGamma@Base 2.4.3 drmModeCrtcSetGamma@Base 2.4.3 + drmModeDestroyPropertyBlob@Base 2.4.62 drmModeDetachMode@Base 2.4.3 drmModeDirtyFB@Base 2.4.17 drmModeFreeConnector@Base 2.4.3 diff -Nru libdrm-2.4.61+git20150614.97be70b4/debian/patches/01_default_perms.diff libdrm-2.4.62+git20150703.676c806d/debian/patches/01_default_perms.diff --- libdrm-2.4.61+git20150614.97be70b4/debian/patches/01_default_perms.diff 2015-07-03 06:18:23.000000000 +0000 +++ libdrm-2.4.62+git20150703.676c806d/debian/patches/01_default_perms.diff 2015-07-03 06:18:24.000000000 +0000 @@ -2,7 +2,7 @@ =================================================================== --- libdrm.orig/xf86drm.h +++ libdrm/xf86drm.h -@@ -70,7 +70,7 @@ +@@ -74,7 +74,7 @@ extern "C" { /* Default /dev/dri directory permissions 0755 */ #define DRM_DEV_DIRMODE \ (S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH) diff -Nru libdrm-2.4.61+git20150614.97be70b4/debian/patches/Fix-headers-inclusion-in-xf86drmMode.c.diff libdrm-2.4.62+git20150703.676c806d/debian/patches/Fix-headers-inclusion-in-xf86drmMode.c.diff --- libdrm-2.4.61+git20150614.97be70b4/debian/patches/Fix-headers-inclusion-in-xf86drmMode.c.diff 2015-07-03 06:18:23.000000000 +0000 +++ libdrm-2.4.62+git20150703.676c806d/debian/patches/Fix-headers-inclusion-in-xf86drmMode.c.diff 2015-07-03 06:18:24.000000000 +0000 @@ -3,40 +3,37 @@ Date: Sun, 26 Apr 2015 11:53:02 +0200 Subject: [PATCH] Fix headers inclusion in xf86drmMode.c -- config.h needs to be included first -- add sys/sysctl.h to get sysctlbyname declaration on kFreeBSD ---- - xf86drmMode.c | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) +Add sys/sysctl.h to get sysctlbyname declaration on kFreeBSD -diff --git a/xf86drmMode.c b/xf86drmMode.c -index 61d5e01..de37548 100644 ---- a/xf86drmMode.c -+++ b/xf86drmMode.c -@@ -32,6 +32,9 @@ - * IN THE SOFTWARE. - * - */ -+#ifdef HAVE_CONFIG_H -+#include "config.h" -+#endif - - /* - * TODO the types we are after are defined in diffrent headers on diffrent -@@ -39,12 +42,9 @@ - */ +Updated by Thorsten “mirabilos” Glaser +to add autoconf check and only include if it +is detected by configure as it’s unusable on Linux/x32 (and +others, e.g. other new architectures). + +Index: libdrm/xf86drmMode.c +=================================================================== +--- libdrm.orig/xf86drmMode.c ++++ libdrm/xf86drmMode.c +@@ -46,6 +46,9 @@ #include + #include #include ++#ifdef HAVE_SYS_SYSCTL_H +#include ++#endif #include + #include --#ifdef HAVE_CONFIG_H --#include "config.h" --#endif -- - #include "xf86drmMode.h" - #include "xf86drm.h" - #include --- -2.1.4 - +Index: libdrm/configure.ac +=================================================================== +--- libdrm.orig/configure.ac ++++ libdrm/configure.ac +@@ -53,7 +53,7 @@ AC_USE_SYSTEM_EXTENSIONS + AC_SYS_LARGEFILE + AC_FUNC_ALLOCA + +-AC_CHECK_HEADERS([sys/mkdev.h]) ++AC_CHECK_HEADERS([sys/mkdev.h sys/sysctl.h]) + + # Initialize libtool + LT_PREREQ([2.2]) diff -Nru libdrm-2.4.61+git20150614.97be70b4/debian/rules libdrm-2.4.62+git20150703.676c806d/debian/rules --- libdrm-2.4.61+git20150614.97be70b4/debian/rules 2015-07-03 06:18:23.000000000 +0000 +++ libdrm-2.4.62+git20150703.676c806d/debian/rules 2015-07-03 06:18:24.000000000 +0000 @@ -92,7 +92,7 @@ dh_strip -s --remaining-packages override_dh_makeshlibs: - dh_makeshlibs -plibdrm2 -V'libdrm2 (>= 2.4.61)' --add-udeb=libdrm2-udeb -- -c1 + dh_makeshlibs -plibdrm2 -V'libdrm2 (>= 2.4.62)' --add-udeb=libdrm2-udeb -- -c1 ifeq ($(INTEL), yes) dh_makeshlibs -plibdrm-intel1 -V'libdrm-intel1 (>= 2.4.60)' -- -c1 endif diff -Nru libdrm-2.4.61+git20150614.97be70b4/debian/upstream/signing-key.asc libdrm-2.4.62+git20150703.676c806d/debian/upstream/signing-key.asc --- libdrm-2.4.61+git20150614.97be70b4/debian/upstream/signing-key.asc 2015-07-03 06:18:23.000000000 +0000 +++ libdrm-2.4.62+git20150703.676c806d/debian/upstream/signing-key.asc 2015-07-03 06:18:24.000000000 +0000 @@ -139,3 +139,55 @@ iQyTzgz/F98QzHzNrRk8DdK4kxVkpvk= =G7Eh -----END PGP PUBLIC KEY BLOCK----- +-----BEGIN PGP PUBLIC KEY BLOCK----- +Version: GnuPG v1 + +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 +Omj3BC4KcQ== +=XQbm +-----END PGP PUBLIC KEY BLOCK----- diff -Nru libdrm-2.4.61+git20150614.97be70b4/exynos/exynos_fimg2d.c libdrm-2.4.62+git20150703.676c806d/exynos/exynos_fimg2d.c --- libdrm-2.4.61+git20150614.97be70b4/exynos/exynos_fimg2d.c 2015-05-21 10:58:25.000000000 +0000 +++ libdrm-2.4.62+git20150703.676c806d/exynos/exynos_fimg2d.c 2015-07-03 06:14:28.000000000 +0000 @@ -254,8 +254,7 @@ void g2d_fini(struct g2d_context *ctx) { - if (ctx) - free(ctx); + free(ctx); } /** @@ -330,9 +329,7 @@ bitblt.data.fast_solid_color_fill_en = 1; g2d_add_cmd(ctx, BITBLT_COMMAND_REG, bitblt.val); - g2d_flush(ctx); - - return 0; + return g2d_flush(ctx); } /** @@ -415,9 +412,7 @@ rop4.data.unmasked_rop3 = G2D_ROP3_SRC; g2d_add_cmd(ctx, ROP4_REG, rop4.val); - g2d_flush(ctx); - - return 0; + return g2d_flush(ctx); } /** @@ -527,9 +522,7 @@ pt.data.y = dst_y + dst_h; g2d_add_cmd(ctx, DST_RIGHT_BOTTOM_REG, pt.val); - g2d_flush(ctx); - - return 0; + return g2d_flush(ctx); } /** @@ -636,9 +629,7 @@ pt.data.y = dst_y + h; g2d_add_cmd(ctx, DST_RIGHT_BOTTOM_REG, pt.val); - g2d_flush(ctx); - - return 0; + return g2d_flush(ctx); } /** @@ -766,7 +757,5 @@ pt.data.y = dst_y + dst_h; g2d_add_cmd(ctx, DST_RIGHT_BOTTOM_REG, pt.val); - g2d_flush(ctx); - - return 0; + return g2d_flush(ctx); } diff -Nru libdrm-2.4.61+git20150614.97be70b4/include/drm/drm.h libdrm-2.4.62+git20150703.676c806d/include/drm/drm.h --- libdrm-2.4.61+git20150614.97be70b4/include/drm/drm.h 2015-02-25 14:46:59.000000000 +0000 +++ libdrm-2.4.62+git20150703.676c806d/include/drm/drm.h 2015-07-03 06:14:28.000000000 +0000 @@ -635,6 +635,13 @@ */ #define DRM_CLIENT_CAP_UNIVERSAL_PLANES 2 +/** + * DRM_CLIENT_CAP_ATOMIC + * + * If set to 1, the DRM core will allow atomic modesetting requests. + */ +#define DRM_CLIENT_CAP_ATOMIC 3 + /** DRM_IOCTL_SET_CLIENT_CAP ioctl argument type */ struct drm_set_client_cap { __u64 capability; @@ -758,6 +765,9 @@ #define DRM_IOCTL_MODE_OBJ_GETPROPERTIES DRM_IOWR(0xB9, struct drm_mode_obj_get_properties) #define DRM_IOCTL_MODE_OBJ_SETPROPERTY DRM_IOWR(0xBA, struct drm_mode_obj_set_property) #define DRM_IOCTL_MODE_CURSOR2 DRM_IOWR(0xBB, struct drm_mode_cursor2) +#define DRM_IOCTL_MODE_ATOMIC DRM_IOWR(0xBC, struct drm_mode_atomic) +#define DRM_IOCTL_MODE_CREATEPROPBLOB DRM_IOWR(0xBD, struct drm_mode_create_blob) +#define DRM_IOCTL_MODE_DESTROYPROPBLOB DRM_IOWR(0xBE, struct drm_mode_destroy_blob) /** * Device specific ioctls should only be in their respective headers diff -Nru libdrm-2.4.61+git20150614.97be70b4/include/drm/drm_mode.h libdrm-2.4.62+git20150703.676c806d/include/drm/drm_mode.h --- libdrm-2.4.61+git20150614.97be70b4/include/drm/drm_mode.h 2015-05-21 10:58:25.000000000 +0000 +++ libdrm-2.4.62+git20150703.676c806d/include/drm/drm_mode.h 2015-07-03 06:14:28.000000000 +0000 @@ -507,4 +507,41 @@ __u32 handle; }; +/* page-flip flags are valid, plus: */ +#define DRM_MODE_ATOMIC_TEST_ONLY 0x0100 +#define DRM_MODE_ATOMIC_NONBLOCK 0x0200 +#define DRM_MODE_ATOMIC_ALLOW_MODESET 0x0400 + +struct drm_mode_atomic { + __u32 flags; + __u32 count_objs; + __u64 objs_ptr; + __u64 count_props_ptr; + __u64 props_ptr; + __u64 prop_values_ptr; + __u64 reserved; + __u64 user_data; +}; + +/** + * Create a new 'blob' data property, copying length bytes from data pointer, + * and returning new blob ID. + */ +struct drm_mode_create_blob { + /** Pointer to data to copy. */ + __u64 data; + /** Length of data to copy. */ + __u32 length; + /** Return: new property ID. */ + __u32 blob_id; +}; + +/** + * Destroy a user-created blob property. + */ +struct drm_mode_destroy_blob { + __u32 blob_id; +}; + + #endif diff -Nru libdrm-2.4.61+git20150614.97be70b4/.lastcommit libdrm-2.4.62+git20150703.676c806d/.lastcommit --- libdrm-2.4.61+git20150614.97be70b4/.lastcommit 2015-06-14 10:06:44.000000000 +0000 +++ libdrm-2.4.62+git20150703.676c806d/.lastcommit 2015-07-03 06:14:28.000000000 +0000 @@ -1 +1 @@ -commit 97be70b45eccc37e98a1cecf360593f36956ea42 +commit 676c806d0221a7ea375676b2eab514c426fcacd3 diff -Nru libdrm-2.4.61+git20150614.97be70b4/Makefile.am libdrm-2.4.62+git20150703.676c806d/Makefile.am --- libdrm-2.4.61+git20150614.97be70b4/Makefile.am 2015-06-14 10:06:44.000000000 +0000 +++ libdrm-2.4.62+git20150703.676c806d/Makefile.am 2015-07-03 06:14:15.000000000 +0000 @@ -95,15 +95,12 @@ libdrm_la_LTLIBRARIES = libdrm.la libdrm_ladir = $(libdir) libdrm_la_LDFLAGS = -version-number 2:4:0 -no-undefined -libdrm_la_LIBADD = \ - @CLOCK_LIB@ \ - @LIBUDEV_LIBS@ +libdrm_la_LIBADD = @CLOCK_LIB@ libdrm_la_CPPFLAGS = -I$(top_srcdir)/include/drm AM_CFLAGS = \ $(WARN_CFLAGS) \ - $(VALGRIND_CFLAGS) \ - $(LIBUDEV_CFLAGS) + $(VALGRIND_CFLAGS) libdrm_la_SOURCES = $(LIBDRM_FILES) diff -Nru libdrm-2.4.61+git20150614.97be70b4/Makefile.in libdrm-2.4.62+git20150703.676c806d/Makefile.in --- libdrm-2.4.61+git20150614.97be70b4/Makefile.in 2015-06-14 10:07:05.000000000 +0000 +++ libdrm-2.4.62+git20150703.676c806d/Makefile.in 2015-07-03 06:14:48.000000000 +0000 @@ -533,15 +533,11 @@ libdrm_la_LTLIBRARIES = libdrm.la libdrm_ladir = $(libdir) libdrm_la_LDFLAGS = -version-number 2:4:0 -no-undefined -libdrm_la_LIBADD = \ - @CLOCK_LIB@ \ - @LIBUDEV_LIBS@ - +libdrm_la_LIBADD = @CLOCK_LIB@ libdrm_la_CPPFLAGS = -I$(top_srcdir)/include/drm AM_CFLAGS = \ $(WARN_CFLAGS) \ - $(VALGRIND_CFLAGS) \ - $(LIBUDEV_CFLAGS) + $(VALGRIND_CFLAGS) libdrm_la_SOURCES = $(LIBDRM_FILES) libdrmincludedir = ${includedir} diff -Nru libdrm-2.4.61+git20150614.97be70b4/nouveau/pushbuf.c libdrm-2.4.62+git20150703.676c806d/nouveau/pushbuf.c --- libdrm-2.4.61+git20150614.97be70b4/nouveau/pushbuf.c 2015-05-21 10:58:25.000000000 +0000 +++ libdrm-2.4.62+git20150703.676c806d/nouveau/pushbuf.c 2015-07-03 06:14:28.000000000 +0000 @@ -234,6 +234,8 @@ bkref = cli_kref_get(push->client, bo); krel = &krec->reloc[krec->nr_reloc++]; + assert(pkref); + assert(bkref); krel->reloc_bo_index = pkref - krec->buffer; krel->reloc_bo_offset = (push->cur - nvpb->ptr) * 4; krel->bo_index = bkref - krec->buffer; @@ -721,6 +723,7 @@ if (bo) { kref = cli_kref_get(push->client, bo); + assert(kref); kpsh = &krec->push[krec->nr_push++]; kpsh->bo_index = kref - krec->buffer; kpsh->offset = offset; @@ -757,6 +760,7 @@ if (cli_push_get(push->client, bo) == push) { kref = cli_kref_get(push->client, bo); + assert(kref); if (kref->read_domains) flags |= NOUVEAU_BO_RD; if (kref->write_domains) diff -Nru libdrm-2.4.61+git20150614.97be70b4/tests/exynos/exynos_fimg2d_test.c libdrm-2.4.62+git20150703.676c806d/tests/exynos/exynos_fimg2d_test.c --- libdrm-2.4.61+git20150614.97be70b4/tests/exynos/exynos_fimg2d_test.c 2015-05-21 10:58:25.000000000 +0000 +++ libdrm-2.4.62+git20150703.676c806d/tests/exynos/exynos_fimg2d_test.c 2015-07-03 06:14:28.000000000 +0000 @@ -34,48 +34,15 @@ #include "exynos_fimg2d.h" #define DRM_MODULE_NAME "exynos" -#define MAX_TEST_CASE 8 static unsigned int screen_width, screen_height; -/* - * A structure to test fimg2d hw. - * - * @solid_fill: fill given color data to source buffer. - * @copy: copy source to destination buffer. - * @copy_with_scale: copy source to destination buffer scaling up or - * down properly. - * @blend: blend source to destination buffer. - */ -struct fimg2d_test_case { - int (*solid_fill)(struct exynos_device *dev, struct exynos_bo *dst); - int (*copy)(struct exynos_device *dev, struct exynos_bo *src, - struct exynos_bo *dst, enum e_g2d_buf_type); - int (*copy_with_scale)(struct exynos_device *dev, - struct exynos_bo *src, struct exynos_bo *dst, - enum e_g2d_buf_type); - int (*blend)(struct exynos_device *dev, - struct exynos_bo *src, struct exynos_bo *dst, - enum e_g2d_buf_type); - int (*checkerboard)(struct exynos_device *dev, - struct exynos_bo *src, struct exynos_bo *dst, - enum e_g2d_buf_type); -}; - struct connector { uint32_t id; char mode_str[64]; - char format_str[5]; - unsigned int fourcc; drmModeModeInfo *mode; drmModeEncoder *encoder; int crtc; - int pipe; - int plane_zpos; - unsigned int fb_id[2], current_fb_id; - struct timeval start; - - int swap_count; }; static void connector_find_mode(int fd, struct connector *c, @@ -145,37 +112,6 @@ c->crtc = c->encoder->crtc_id; } -static int connector_find_plane(int fd, unsigned int *plane_id) -{ - drmModePlaneRes *plane_resources; - drmModePlane *ovr; - int i; - - plane_resources = drmModeGetPlaneResources(fd); - if (!plane_resources) { - fprintf(stderr, "drmModeGetPlaneResources failed: %s\n", - strerror(errno)); - return -1; - } - - for (i = 0; i < plane_resources->count_planes; i++) { - plane_id[i] = 0; - - ovr = drmModeGetPlane(fd, plane_resources->planes[i]); - if (!ovr) { - fprintf(stderr, "drmModeGetPlane failed: %s\n", - strerror(errno)); - continue; - } - - if (ovr->possible_crtcs & (1 << 0)) - plane_id[i] = ovr->plane_id; - drmModeFreePlane(ovr); - } - - return 0; -} - static int drm_set_crtc(struct exynos_device *dev, struct connector *c, unsigned int fb_id) { @@ -183,14 +119,9 @@ ret = drmModeSetCrtc(dev->fd, c->crtc, fb_id, 0, 0, &c->id, 1, c->mode); - if (ret) { + if (ret) drmMsg("failed to set mode: %s\n", strerror(errno)); - goto err; - } - return 0; - -err: return ret; } @@ -339,9 +270,10 @@ src_img.user_ptr[0].userptr = userptr; src_img.user_ptr[0].size = size; break; + case G2D_IMGBUF_COLOR: default: - type = G2D_IMGBUF_GEM; - break; + ret = -EFAULT; + goto fail; } printf("copy test with %s.\n", @@ -375,6 +307,7 @@ if (userptr) free((void *)userptr); +fail: g2d_fini(ctx); return ret; @@ -418,9 +351,10 @@ src_img.user_ptr[0].userptr = userptr; src_img.user_ptr[0].size = size; break; + case G2D_IMGBUF_COLOR: default: - type = G2D_IMGBUF_GEM; - break; + ret = -EFAULT; + goto fail; } printf("copy and scale test with %s.\n", @@ -459,6 +393,7 @@ if (userptr) free((void *)userptr); +fail: g2d_fini(ctx); return 0; @@ -504,9 +439,10 @@ src_img.user_ptr[0].userptr = userptr; src_img.user_ptr[0].size = size; break; + case G2D_IMGBUF_COLOR: default: - type = G2D_IMGBUF_GEM; - break; + ret = -EFAULT; + goto fail; } printf("blend test with %s.\n", @@ -556,6 +492,7 @@ if (userptr) free((void *)userptr); +fail: g2d_fini(ctx); return 0; @@ -601,6 +538,7 @@ src_img.user_ptr[0].userptr = (unsigned long)checkerboard; src_img.user_ptr[0].size = img_w * img_h * 4; break; + case G2D_IMGBUF_COLOR: default: ret = -EFAULT; goto fail; @@ -639,14 +577,6 @@ return ret; } -static struct fimg2d_test_case test_case = { - .solid_fill = &g2d_solid_fill_test, - .copy = &g2d_copy_test, - .copy_with_scale = &g2d_copy_with_scale_test, - .blend = &g2d_blend_test, - .checkerboard = &g2d_checkerboard_test, -}; - static void usage(char *name) { fprintf(stderr, "usage: %s [-s]\n", name); @@ -689,7 +619,7 @@ break; default: usage(argv[0]); - return -EINVAL; + break; } } @@ -750,15 +680,13 @@ if (ret < 0) goto err_destroy_buffer; - con.plane_zpos = -1; - memset(bo->vaddr, 0xff, screen_width * screen_height * 4); ret = drm_set_crtc(dev, &con, fb_id); if (ret < 0) goto err_rm_fb; - ret = test_case.solid_fill(dev, bo); + ret = g2d_solid_fill_test(dev, bo); if (ret < 0) { fprintf(stderr, "failed to solid fill operation.\n"); goto err_rm_fb; @@ -772,7 +700,7 @@ goto err_rm_fb; } - ret = test_case.copy(dev, src, bo, G2D_IMGBUF_GEM); + ret = g2d_copy_test(dev, src, bo, G2D_IMGBUF_GEM); if (ret < 0) { fprintf(stderr, "failed to test copy operation.\n"); goto err_free_src; @@ -780,7 +708,7 @@ wait_for_user_input(0); - ret = test_case.copy_with_scale(dev, src, bo, G2D_IMGBUF_GEM); + ret = g2d_copy_with_scale_test(dev, src, bo, G2D_IMGBUF_GEM); if (ret < 0) { fprintf(stderr, "failed to test copy and scale operation.\n"); goto err_free_src; @@ -788,7 +716,7 @@ wait_for_user_input(0); - ret = test_case.checkerboard(dev, src, bo, G2D_IMGBUF_GEM); + ret = g2d_checkerboard_test(dev, src, bo, G2D_IMGBUF_GEM); if (ret < 0) { fprintf(stderr, "failed to issue checkerboard test.\n"); goto err_free_src; @@ -805,7 +733,7 @@ * Disable the test for now, until the kernel code has been sanitized. */ #if 0 - ret = test_case.blend(dev, src, bo, G2D_IMGBUF_USERPTR); + ret = g2d_blend_test(dev, src, bo, G2D_IMGBUF_USERPTR); if (ret < 0) fprintf(stderr, "failed to test blend operation.\n"); diff -Nru libdrm-2.4.61+git20150614.97be70b4/xf86drm.c libdrm-2.4.62+git20150703.676c806d/xf86drm.c --- libdrm-2.4.61+git20150614.97be70b4/xf86drm.c 2015-06-14 10:06:44.000000000 +0000 +++ libdrm-2.4.62+git20150703.676c806d/xf86drm.c 2015-07-03 06:14:28.000000000 +0000 @@ -63,7 +63,6 @@ #include "xf86drm.h" #include "libdrm_macros.h" -#include "libudev.h" #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) #define DRM_MAJOR 145 @@ -2816,102 +2815,3 @@ { return drmGetMinorNameForFD(fd, DRM_NODE_RENDER); } - -/** -* Enumerate the GPU devices on the system -* -* \param devs device array set to return the device information -* (if NULL, the number of device is returned) -* \param vendor the vendor ID for GPU devices to list -* (optional, if not specified, all GPU devices are returned) -* -* \return the number of GPU devices -*/ -int drmGetPciDevices(drmPciDevicePtr devSet, uint16_t vendorId) -{ - struct udev *udev = NULL; - struct udev_enumerate *udev_enumerate; - struct udev_list_entry *list_entry; - struct udev_device *device; - int drmDevCount = 0; - int vendor = 0; - int devid = 0; - int subvendor = 0; - int subdevid = 0; - int revid = 0xff; - int domain = 0; - int bus = 0; - int dev = 0; - int func = 0; - char config[64] = {0}; - char node[128] = {'\0'}; - char slot[] = "0000:00:00.0"; - const char *info = NULL; - int fd = 0; - int ret = 0; - - udev = udev_new(); - if (udev == NULL) { - fprintf(stderr, "no context\n"); - return -EINVAL; - } - udev_enumerate = udev_enumerate_new(udev); - if (udev_enumerate == NULL) - return -EINVAL; - udev_enumerate_add_match_subsystem(udev_enumerate, "drm"); - udev_enumerate_add_match_property(udev_enumerate, "DEVTYPE", "drm_minor"); - - udev_enumerate_scan_devices(udev_enumerate); - - udev_list_entry_foreach(list_entry, udev_enumerate_get_list_entry(udev_enumerate)) { - device = udev_device_new_from_syspath(udev_enumerate_get_udev(udev_enumerate), - udev_list_entry_get_name(list_entry)); - if (device != NULL) { - info = udev_device_get_property_value(device, "MINOR"); - if (!strcmp(info, "0")) { - strcpy(node, udev_device_get_syspath(device)); - info = strstr(node, "/drm"); - strncpy(slot, info - strlen(slot), strlen(slot)); - if (sscanf(slot, "%4x:%2x:%2x.%1x", &domain, &bus, &dev, &func) != 4) { - domain = 0; - bus = 0; - dev = 0; - func = 0; - } - strcpy(node + strlen(node), "/device/config"); - - fd = open(node, O_RDONLY); - if (fd >= 0) { - ret = read(fd, config, 64); - if (ret == 64) { - vendor = config[0] + (config[1] << 8); - devid = config[2] + (config[3] << 8); - revid = config[8]; - subdevid = config[44] + (config[45] << 8); - } - close(fd); - } - - if((vendorId == 0) || (vendorId == vendor)) { - if(devSet != NULL) { - devSet[drmDevCount].domain = domain; - devSet[drmDevCount].bus = bus; - devSet[drmDevCount].dev = dev; - devSet[drmDevCount].func = func; - devSet[drmDevCount].vendor_id = vendor; - devSet[drmDevCount].device_id = devid; - devSet[drmDevCount].subdevice_id = subdevid; - devSet[drmDevCount].subvendor_id = subvendor; - devSet[drmDevCount].revision_id = revid; - } - drmDevCount++; - } - } - } - udev_device_unref(device); - } - udev_enumerate_unref(udev_enumerate); - udev_unref(udev); - - return drmDevCount; -} diff -Nru libdrm-2.4.61+git20150614.97be70b4/xf86drm.h libdrm-2.4.62+git20150703.676c806d/xf86drm.h --- libdrm-2.4.61+git20150614.97be70b4/xf86drm.h 2015-06-14 10:07:10.000000000 +0000 +++ libdrm-2.4.62+git20150703.676c806d/xf86drm.h 2015-07-03 06:14:53.000000000 +0000 @@ -342,24 +342,6 @@ int drm_dd_minor; } drmSetVersion, *drmSetVersionPtr; -/** - * Structure to a general pci gpu device - * - * \sa drmGetDevices() - * -*/ -typedef struct _drmPciDevice { - uint16_t domain; - uint8_t bus; - uint8_t dev; - uint8_t func; - uint16_t vendor_id; - uint16_t device_id; - uint16_t subvendor_id; - uint16_t subdevice_id; - uint8_t revision_id; -} drmPciDevice, *drmPciDevicePtr; - #define __drm_dummy_lock(lock) (*(__volatile__ unsigned int *)lock) #define DRM_LOCK_HELD 0x80000000U /**< Hardware lock is held */ @@ -570,7 +552,6 @@ /* General user-level programmer's API: unprivileged */ extern int drmAvailable(void); extern int drmOpen(const char *name, const char *busid); -extern int drmGetPciDevices(drmPciDevicePtr devSet, uint16_t vendorId); #define DRM_NODE_PRIMARY 0 #define DRM_NODE_CONTROL 1 diff -Nru libdrm-2.4.61+git20150614.97be70b4/xf86drmMode.c libdrm-2.4.62+git20150703.676c806d/xf86drmMode.c --- libdrm-2.4.61+git20150614.97be70b4/xf86drmMode.c 2015-06-14 10:07:11.000000000 +0000 +++ libdrm-2.4.62+git20150703.676c806d/xf86drmMode.c 2015-07-03 06:14:53.000000000 +0000 @@ -37,14 +37,18 @@ * TODO the types we are after are defined in diffrent headers on diffrent * platforms find which headers to include to get uint32_t */ -#include -#include -#include #ifdef HAVE_CONFIG_H #include "config.h" #endif +#include +#include +#include +#include +#include +#include + #include "xf86drmMode.h" #include "xf86drm.h" #include @@ -53,14 +57,6 @@ #include #include -#ifdef HAVE_VALGRIND -#include -#include -#define VG(x) x -#else -#define VG(x) -#endif - #define memclear(s) memset(&s, 0, sizeof(s)) #define U642VOID(x) ((void *)(unsigned long)(x)) @@ -1147,3 +1143,274 @@ return DRM_IOCTL(fd, DRM_IOCTL_MODE_OBJ_SETPROPERTY, &prop); } + +typedef struct _drmModeAtomicReqItem drmModeAtomicReqItem, *drmModeAtomicReqItemPtr; + +struct _drmModeAtomicReqItem { + uint32_t object_id; + uint32_t property_id; + uint64_t value; +}; + +struct _drmModeAtomicReq { + uint32_t cursor; + uint32_t size_items; + drmModeAtomicReqItemPtr items; +}; + +drmModeAtomicReqPtr drmModeAtomicAlloc(void) +{ + drmModeAtomicReqPtr req; + + req = drmMalloc(sizeof *req); + if (!req) + return NULL; + + req->items = NULL; + req->cursor = 0; + req->size_items = 0; + + return req; +} + +drmModeAtomicReqPtr drmModeAtomicDuplicate(drmModeAtomicReqPtr old) +{ + drmModeAtomicReqPtr new; + + new = drmMalloc(sizeof *new); + if (!new) + return NULL; + + new->cursor = old->cursor; + new->size_items = old->size_items; + + if (old->size_items) { + new->items = drmMalloc(old->size_items * sizeof(*new->items)); + if (!new->items) { + free(new); + return NULL; + } + memcpy(new->items, old->items, + old->size_items * sizeof(*new->items)); + } else { + new->items = NULL; + } + + return new; +} + +int drmModeAtomicMerge(drmModeAtomicReqPtr base, drmModeAtomicReqPtr augment) +{ + if (!augment || augment->cursor == 0) + return 0; + + if (base->cursor + augment->cursor >= base->size_items) { + drmModeAtomicReqItemPtr new; + int saved_size = base->size_items; + + base->size_items = base->cursor + augment->cursor; + new = realloc(base->items, + base->size_items * sizeof(*base->items)); + if (!new) { + base->size_items = saved_size; + return -ENOMEM; + } + base->items = new; + } + + memcpy(&base->items[base->cursor], augment->items, + augment->cursor * sizeof(*augment->items)); + base->cursor += augment->cursor; + + return 0; +} + +int drmModeAtomicGetCursor(drmModeAtomicReqPtr req) +{ + return req->cursor; +} + +void drmModeAtomicSetCursor(drmModeAtomicReqPtr req, int cursor) +{ + req->cursor = cursor; +} + +int drmModeAtomicAddProperty(drmModeAtomicReqPtr req, + uint32_t object_id, + uint32_t property_id, + uint64_t value) +{ + if (req->cursor >= req->size_items) { + drmModeAtomicReqItemPtr new; + + req->size_items += 16; + new = realloc(req->items, req->size_items * sizeof(*req->items)); + if (!new) { + req->size_items -= 16; + return -ENOMEM; + } + req->items = new; + } + + req->items[req->cursor].object_id = object_id; + req->items[req->cursor].property_id = property_id; + req->items[req->cursor].value = value; + req->cursor++; + + return req->cursor; +} + +void drmModeAtomicFree(drmModeAtomicReqPtr req) +{ + if (!req) + return; + + if (req->items) + drmFree(req->items); + drmFree(req); +} + +static int sort_req_list(const void *misc, const void *other) +{ + const drmModeAtomicReqItem *first = misc; + const drmModeAtomicReqItem *second = other; + + if (first->object_id < second->object_id) + return -1; + else if (first->object_id > second->object_id) + return 1; + else + return second->property_id - first->property_id; +} + +int drmModeAtomicCommit(int fd, drmModeAtomicReqPtr req, uint32_t flags, + void *user_data) +{ + drmModeAtomicReqPtr sorted = drmModeAtomicDuplicate(req); + struct drm_mode_atomic atomic; + uint32_t *objs_ptr = NULL; + uint32_t *count_props_ptr = NULL; + uint32_t *props_ptr = NULL; + uint64_t *prop_values_ptr = NULL; + uint32_t last_obj_id = 0; + uint32_t i; + int obj_idx = -1; + int ret = -1; + + if (!sorted) + return -ENOMEM; + + memclear(atomic); + + /* Sort the list by object ID, then by property ID. */ + qsort(sorted->items, sorted->cursor, sizeof(*sorted->items), + sort_req_list); + + /* Now the list is sorted, eliminate duplicate property sets. */ + for (i = 0; i < sorted->cursor; i++) { + if (sorted->items[i].object_id != last_obj_id) { + atomic.count_objs++; + last_obj_id = sorted->items[i].object_id; + } + + if (i == sorted->cursor - 1) + continue; + + if (sorted->items[i].object_id != sorted->items[i + 1].object_id || + sorted->items[i].property_id != sorted->items[i + 1].property_id) + continue; + + memmove(&sorted->items[i], &sorted->items[i + 1], + (sorted->cursor - i - 1) * sizeof(*sorted->items)); + sorted->cursor--; + } + + objs_ptr = drmMalloc(atomic.count_objs * sizeof objs_ptr[0]); + if (!objs_ptr) { + errno = ENOMEM; + goto out; + } + + count_props_ptr = drmMalloc(atomic.count_objs * sizeof count_props_ptr[0]); + if (!count_props_ptr) { + errno = ENOMEM; + goto out; + } + + props_ptr = drmMalloc(sorted->cursor * sizeof props_ptr[0]); + if (!props_ptr) { + errno = ENOMEM; + goto out; + } + + prop_values_ptr = drmMalloc(sorted->cursor * sizeof prop_values_ptr[0]); + if (!prop_values_ptr) { + errno = ENOMEM; + goto out; + } + + for (i = 0, last_obj_id = 0; i < sorted->cursor; i++) { + if (sorted->items[i].object_id != last_obj_id) { + obj_idx++; + objs_ptr[obj_idx] = sorted->items[i].object_id; + last_obj_id = objs_ptr[obj_idx]; + } + + count_props_ptr[obj_idx]++; + props_ptr[i] = sorted->items[i].property_id; + prop_values_ptr[i] = sorted->items[i].value; + + } + + atomic.flags = flags; + atomic.objs_ptr = VOID2U64(objs_ptr); + atomic.count_props_ptr = VOID2U64(count_props_ptr); + atomic.props_ptr = VOID2U64(props_ptr); + atomic.prop_values_ptr = VOID2U64(prop_values_ptr); + atomic.user_data = VOID2U64(user_data); + + ret = DRM_IOCTL(fd, DRM_IOCTL_MODE_ATOMIC, &atomic); + +out: + drmFree(objs_ptr); + drmFree(count_props_ptr); + drmFree(props_ptr); + drmFree(prop_values_ptr); + drmModeAtomicFree(sorted); + + return ret; +} + +int +drmModeCreatePropertyBlob(int fd, const void *data, size_t length, uint32_t *id) +{ + struct drm_mode_create_blob create; + int ret; + + if (length >= 0xffffffff) + return -ERANGE; + + memclear(create); + + create.length = length; + create.data = (uintptr_t) data; + create.blob_id = 0; + *id = 0; + + ret = DRM_IOCTL(fd, DRM_IOCTL_MODE_CREATEPROPBLOB, &create); + if (ret != 0) + return ret; + + *id = create.blob_id; + return 0; +} + +int +drmModeDestroyPropertyBlob(int fd, uint32_t id) +{ + struct drm_mode_destroy_blob destroy; + + memclear(destroy); + destroy.blob_id = id; + return DRM_IOCTL(fd, DRM_IOCTL_MODE_DESTROYPROPBLOB, &destroy); +} diff -Nru libdrm-2.4.61+git20150614.97be70b4/xf86drmMode.h libdrm-2.4.62+git20150703.676c806d/xf86drmMode.h --- libdrm-2.4.61+git20150614.97be70b4/xf86drmMode.h 2015-05-21 10:58:25.000000000 +0000 +++ libdrm-2.4.62+git20150703.676c806d/xf86drmMode.h 2015-07-03 06:14:28.000000000 +0000 @@ -484,6 +484,30 @@ uint32_t object_type, uint32_t property_id, uint64_t value); + +typedef struct _drmModeAtomicReq drmModeAtomicReq, *drmModeAtomicReqPtr; + +extern drmModeAtomicReqPtr drmModeAtomicAlloc(void); +extern drmModeAtomicReqPtr drmModeAtomicDuplicate(drmModeAtomicReqPtr req); +extern int drmModeAtomicMerge(drmModeAtomicReqPtr base, + drmModeAtomicReqPtr augment); +extern void drmModeAtomicFree(drmModeAtomicReqPtr req); +extern int drmModeAtomicGetCursor(drmModeAtomicReqPtr req); +extern void drmModeAtomicSetCursor(drmModeAtomicReqPtr req, int cursor); +extern int drmModeAtomicAddProperty(drmModeAtomicReqPtr req, + uint32_t object_id, + uint32_t property_id, + uint64_t value); +extern int drmModeAtomicCommit(int fd, + drmModeAtomicReqPtr req, + uint32_t flags, + void *user_data); + +extern int drmModeCreatePropertyBlob(int fd, const void *data, size_t size, + uint32_t *id); +extern int drmModeDestroyPropertyBlob(int fd, uint32_t id); + + #if defined(__cplusplus) || defined(c_plusplus) } #endif