Hello community,

here is the log from the commit of package libdrm for openSUSE:Factory checked 
in at 2014-01-24 21:41:59
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/libdrm (Old)
 and      /work/SRC/openSUSE:Factory/.libdrm.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "libdrm"

Changes:
--------
--- /work/SRC/openSUSE:Factory/libdrm/libdrm.changes    2014-01-23 
15:47:17.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.libdrm.new/libdrm.changes       2014-01-24 
21:42:00.000000000 +0100
@@ -1,0 +2,15 @@
+Tue Jan 21 11:14:46 UTC 2014 - sndir...@suse.com
+
+- Update to version 2.4.52
+  + intel: squash unused variable 'bo_gem'
+  + intel: Handle malloc fails in context create
+  + intel: Merge latest i915_drm.h
+  + drm: Initialize or valgrind-clear modesetting ioctl arguments.
+  + intel: Track whether a buffer is idle to avoid trips to the kernel.
+  + tests/kmstest: support exynos
+  + Mark debug_print with __attribute__ ((format(__printf__, 1, 0)))
+  + intel: Create a new drm_intel_bo offset64 field.
+  + freedreno: add fd_device_new_dup()
+  + modetest: add the possibility to select the refresh frequency for a mode
+
+-------------------------------------------------------------------

Old:
----
  libdrm-2.4.51.tar.bz2

New:
----
  libdrm-2.4.52.tar.bz2

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

Other differences:
------------------
++++++ libdrm.spec ++++++
--- /var/tmp/diff_new_pack.qCGW0z/_old  2014-01-24 21:42:01.000000000 +0100
+++ /var/tmp/diff_new_pack.qCGW0z/_new  2014-01-24 21:42:01.000000000 +0100
@@ -18,7 +18,7 @@
 
 Name:           libdrm
 Url:            http://dri.freedesktop.org/
-Version:        2.4.51
+Version:        2.4.52
 Release:        0
 Provides:       libdrm23 = %{version}
 Obsoletes:      libdrm23 < %{version}

++++++ libdrm-2.4.51.tar.bz2 -> libdrm-2.4.52.tar.bz2 ++++++
++++ 1774 lines of diff (skipped)
++++    retrying with extended exclude list
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/libdrm-2.4.51/Makefile.am new/libdrm-2.4.52/Makefile.am
--- old/libdrm-2.4.51/Makefile.am       2013-10-09 18:03:23.000000000 +0200
+++ new/libdrm-2.4.52/Makefile.am       2014-01-20 19:58:05.000000000 +0100
@@ -59,6 +59,8 @@
 libdrm_la_LIBADD = @CLOCK_LIB@
 
 libdrm_la_CPPFLAGS = -I$(top_srcdir)/include/drm
+AM_CFLAGS = \
+       $(VALGRIND_CFLAGS)
 
 libdrm_la_SOURCES =                            \
        xf86drm.c                               \
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/libdrm-2.4.51/configure.ac new/libdrm-2.4.52/configure.ac
--- old/libdrm-2.4.51/configure.ac      2014-01-08 21:35:51.000000000 +0100
+++ new/libdrm-2.4.52/configure.ac      2014-01-20 19:58:15.000000000 +0100
@@ -20,7 +20,7 @@
 
 AC_PREREQ([2.63])
 AC_INIT([libdrm],
-        [2.4.51],
+        [2.4.52],
         [https://bugs.freedesktop.org/enter_bug.cgi?product=DRI],
         [libdrm])
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/libdrm-2.4.51/freedreno/freedreno_device.c 
new/libdrm-2.4.52/freedreno/freedreno_device.c
--- old/libdrm-2.4.51/freedreno/freedreno_device.c      2013-12-13 
21:48:10.000000000 +0100
+++ new/libdrm-2.4.52/freedreno/freedreno_device.c      2014-01-13 
22:41:23.000000000 +0100
@@ -135,6 +135,16 @@
        return dev;
 }
 
+/* like fd_device_new() but creates it's own private dup() of the fd
+ * which is close()d when the device is finalized.
+ */
+struct fd_device * fd_device_new_dup(int fd)
+{
+       struct fd_device *dev = fd_device_new(dup(fd));
+       dev->closefd = 1;
+       return dev;
+}
+
 struct fd_device * fd_device_ref(struct fd_device *dev)
 {
        atomic_inc(&dev->refcnt);
@@ -147,6 +157,8 @@
        drmHashDestroy(dev->handle_table);
        drmHashDestroy(dev->name_table);
        drmHashDelete(dev_table, dev->fd);
+       if (dev->closefd)
+               close(dev->fd);
        dev->funcs->destroy(dev);
 }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/libdrm-2.4.51/freedreno/freedreno_drmif.h 
new/libdrm-2.4.52/freedreno/freedreno_drmif.h
--- old/libdrm-2.4.51/freedreno/freedreno_drmif.h       2014-01-07 
17:09:26.000000000 +0100
+++ new/libdrm-2.4.52/freedreno/freedreno_drmif.h       2014-01-13 
22:41:23.000000000 +0100
@@ -72,6 +72,7 @@
  */
 
 struct fd_device * fd_device_new(int fd);
+struct fd_device * fd_device_new_dup(int fd);
 struct fd_device * fd_device_ref(struct fd_device *dev);
 void fd_device_del(struct fd_device *dev);
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/libdrm-2.4.51/freedreno/freedreno_priv.h 
new/libdrm-2.4.52/freedreno/freedreno_priv.h
--- old/libdrm-2.4.51/freedreno/freedreno_priv.h        2013-12-13 
21:48:10.000000000 +0100
+++ new/libdrm-2.4.52/freedreno/freedreno_priv.h        2014-01-13 
22:41:23.000000000 +0100
@@ -84,6 +84,8 @@
        struct fd_bo_bucket cache_bucket[14 * 4];
        int num_buckets;
        time_t time;
+
+       int closefd;        /* call close(fd) upon destruction */
 };
 
 void fd_cleanup_bo_cache(struct fd_device *dev, time_t time);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/libdrm-2.4.51/include/drm/Makefile new/libdrm-2.4.52/include/drm/Makefile
--- old/libdrm-2.4.51/include/drm/Makefile      2014-01-08 21:38:46.000000000 
+0100
+++ new/libdrm-2.4.52/include/drm/Makefile      2014-01-20 20:04:49.000000000 
+0100
@@ -189,16 +189,16 @@
 ETAGS = etags
 CTAGS = ctags
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = ${SHELL} /home/robclark/src/mesa/drm/build-aux/missing aclocal-1.13
+ACLOCAL = ${SHELL} /home/kwg/Projects/drm/build-aux/missing aclocal-1.13
 ALLOCA = 
 AMTAR = $${TAR-tar}
 AM_DEFAULT_VERBOSITY = 0
 AR = ar
-AUTOCONF = ${SHELL} /home/robclark/src/mesa/drm/build-aux/missing autoconf
-AUTOHEADER = ${SHELL} /home/robclark/src/mesa/drm/build-aux/missing autoheader
-AUTOMAKE = ${SHELL} /home/robclark/src/mesa/drm/build-aux/missing automake-1.13
+AUTOCONF = ${SHELL} /home/kwg/Projects/drm/build-aux/missing autoconf
+AUTOHEADER = ${SHELL} /home/kwg/Projects/drm/build-aux/missing autoheader
+AUTOMAKE = ${SHELL} /home/kwg/Projects/drm/build-aux/missing automake-1.13
 AWK = gawk
-CAIRO_CFLAGS = -I/usr/include/cairo -I/usr/include/glib-2.0 
-I/usr/lib64/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 
-I/usr/include/libdrm -I/usr/include/libpng16 
+CAIRO_CFLAGS = -I/usr/include/cairo -I/usr/include/glib-2.0 
-I/usr/lib64/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 
-I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/libdrm 
-I/usr/include/libpng16 
 CAIRO_LIBS = -lcairo 
 CC = gcc
 CCDEPMODE = depmode=gcc3
@@ -215,16 +215,16 @@
 ECHO_C = 
 ECHO_N = -n
 ECHO_T = 
-EGREP = /usr/bin/grep -E
+EGREP = /bin/grep -E
 EXEEXT = 
-FGREP = /usr/bin/grep -F
-GREP = /usr/bin/grep
+FGREP = /bin/grep -F
+GREP = /bin/grep
 INSTALL = /usr/bin/install -c
 INSTALL_DATA = ${INSTALL} -m 644
 INSTALL_PROGRAM = ${INSTALL}
 INSTALL_SCRIPT = ${INSTALL}
 INSTALL_STRIP_PROGRAM = $(install_sh) -c -s
-LD = /usr/bin/ld -m elf_x86_64
+LD = /usr/x86_64-pc-linux-gnu/bin/ld -m elf_x86_64
 LDFLAGS = 
 LIBOBJS = 
 LIBS = 
@@ -235,10 +235,10 @@
 LN_S = ln -s
 LTLIBOBJS = 
 MAINT = 
-MAKEINFO = ${SHELL} /home/robclark/src/mesa/drm/build-aux/missing makeinfo
+MAKEINFO = ${SHELL} /home/kwg/Projects/drm/build-aux/missing makeinfo
 MANIFEST_TOOL = :
 MANPAGES_STYLESHEET = 
http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl
-MKDIR_P = /usr/bin/mkdir -p
+MKDIR_P = /bin/mkdir -p
 NM = /usr/bin/nm -B
 NMEDIT = 
 OBJDUMP = objdump
@@ -248,10 +248,10 @@
 PACKAGE = libdrm
 PACKAGE_BUGREPORT = https://bugs.freedesktop.org/enter_bug.cgi?product=DRI
 PACKAGE_NAME = libdrm
-PACKAGE_STRING = libdrm 2.4.51
+PACKAGE_STRING = libdrm 2.4.52
 PACKAGE_TARNAME = libdrm
 PACKAGE_URL = 
-PACKAGE_VERSION = 2.4.51
+PACKAGE_VERSION = 2.4.52
 PATH_SEPARATOR = :
 PCIACCESS_CFLAGS = 
 PCIACCESS_LIBS = -lpciaccess 
@@ -261,19 +261,19 @@
 PTHREADSTUBS_CFLAGS = 
 PTHREADSTUBS_LIBS = 
 RANLIB = ranlib
-SED = /usr/bin/sed
+SED = /bin/sed
 SET_MAKE = 
 SHELL = /bin/sh
 STRIP = strip
-VALGRIND_CFLAGS = 
-VALGRIND_LIBS = 
-VERSION = 2.4.51
+VALGRIND_CFLAGS = -I/usr/include/valgrind 
+VALGRIND_LIBS = -L/usr/lib64/valgrind -lcoregrind-amd64-linux 
-lvex-amd64-linux -lgcc 
+VERSION = 2.4.52
 WARN_CFLAGS =  -Wall -Wextra -Wsign-compare 
-Werror-implicit-function-declaration -Wpointer-arith -Wwrite-strings 
-Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations 
-Wnested-externs -Wpacked -Wswitch-enum -Wmissing-format-attribute 
-Wstrict-aliasing=2 -Winit-self -Wdeclaration-after-statement 
-Wold-style-definition -Wno-missing-field-initializers -Wno-unused-parameter 
-Wno-attributes -Wno-long-long -Winline
 XSLTPROC = /usr/bin/xsltproc
-abs_builddir = /home/robclark/src/mesa/drm/include/drm
-abs_srcdir = /home/robclark/src/mesa/drm/include/drm
-abs_top_builddir = /home/robclark/src/mesa/drm
-abs_top_srcdir = /home/robclark/src/mesa/drm
+abs_builddir = /home/kwg/Projects/drm/include/drm
+abs_srcdir = /home/kwg/Projects/drm/include/drm
+abs_top_builddir = /home/kwg/Projects/drm
+abs_top_srcdir = /home/kwg/Projects/drm
 ac_ct_AR = ar
 ac_ct_CC = gcc
 ac_ct_DUMPBIN = 
@@ -302,9 +302,9 @@
 htmldir = ${docdir}
 includedir = ${prefix}/include
 infodir = ${datarootdir}/info
-install_sh = ${SHELL} /home/robclark/src/mesa/drm/build-aux/install-sh
+install_sh = ${SHELL} /home/kwg/Projects/drm/build-aux/install-sh
 kernel_source = 
-libdir = ${exec_prefix}/lib
+libdir = /usr/lib64
 libexecdir = ${exec_prefix}/libexec
 localedir = ${datarootdir}/locale
 localstatedir = ${prefix}/var
@@ -312,14 +312,14 @@
 mkdir_p = $(MKDIR_P)
 oldincludedir = /usr/include
 pdfdir = ${docdir}
-pkgconfigdir = ${exec_prefix}/lib/pkgconfig
-prefix = /usr/local/xorg
+pkgconfigdir = /usr/lib64/pkgconfig
+prefix = /usr
 program_transform_name = s,x,x,
 psdir = ${docdir}
 sbindir = ${exec_prefix}/sbin
 sharedstatedir = ${prefix}/com
 srcdir = .
-sysconfdir = ${prefix}/etc
+sysconfdir = /etc
 target_alias = 
 top_build_prefix = ../../
 top_builddir = ../..
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/libdrm-2.4.51/include/drm/i915_drm.h 
new/libdrm-2.4.52/include/drm/i915_drm.h
--- old/libdrm-2.4.51/include/drm/i915_drm.h    2013-12-13 18:17:27.000000000 
+0100
+++ new/libdrm-2.4.52/include/drm/i915_drm.h    2014-01-13 22:41:23.000000000 
+0100
@@ -27,12 +27,36 @@
 #ifndef _I915_DRM_H_
 #define _I915_DRM_H_
 
-#include "drm.h"
+#include <drm.h>
 
 /* Please note that modifications to all structs defined here are
  * subject to backwards-compatibility constraints.
  */
 
+/**
+ * DOC: uevents generated by i915 on it's device node
+ *
+ * I915_L3_PARITY_UEVENT - Generated when the driver receives a parity mismatch
+ *     event from the gpu l3 cache. Additional information supplied is ROW,
+ *     BANK, SUBBANK, SLICE of the affected cacheline. Userspace should keep
+ *     track of these events and if a specific cache-line seems to have a
+ *     persistent error remap it with the l3 remapping tool supplied in
+ *     intel-gpu-tools.  The value supplied with the event is always 1.
+ *
+ * I915_ERROR_UEVENT - Generated upon error detection, currently only via
+ *     hangcheck. The error detection event is a good indicator of when things
+ *     began to go badly. The value supplied with the event is a 1 upon error
+ *     detection, and a 0 upon reset completion, signifying no more error
+ *     exists. NOTE: Disabling hangcheck or reset via module parameter will
+ *     cause the related events to not be seen.
+ *
+ * I915_RESET_UEVENT - Event is generated just before an attempt to reset the
+ *     the GPU. The value supplied with the event is always 1. NOTE: Disable
+ *     reset via module parameter will cause this event to not be seen.
+ */
+#define I915_L3_PARITY_UEVENT          "L3_PARITY_ERROR"
+#define I915_ERROR_UEVENT              "ERROR"
+#define I915_RESET_UEVENT              "RESET"
 
 /* Each region is a minimum of 16k, and there are at most 255 of them.
  */
@@ -195,8 +219,8 @@
 #define DRM_I915_GEM_WAIT      0x2c
 #define DRM_I915_GEM_CONTEXT_CREATE    0x2d
 #define DRM_I915_GEM_CONTEXT_DESTROY   0x2e
-#define DRM_I915_GEM_SET_CACHEING      0x2f
-#define DRM_I915_GEM_GET_CACHEING      0x30
+#define DRM_I915_GEM_SET_CACHING       0x2f
+#define DRM_I915_GEM_GET_CACHING       0x30
 #define DRM_I915_REG_READ              0x31
 #define DRM_I915_GET_RESET_STATS       0x32
 
@@ -223,8 +247,8 @@
 #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_BUSY                DRM_IOWR(DRM_COMMAND_BASE + 
DRM_I915_GEM_BUSY, struct drm_i915_gem_busy)
-#define DRM_IOCTL_I915_GEM_SET_CACHEING                
DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_SET_CACHEING, struct 
drm_i915_gem_cacheing)
-#define DRM_IOCTL_I915_GEM_GET_CACHEING                
DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_GET_CACHEING, struct 
drm_i915_gem_cacheing)
+#define DRM_IOCTL_I915_GEM_SET_CACHING         DRM_IOW(DRM_COMMAND_BASE + 
DRM_I915_GEM_SET_CACHING, struct drm_i915_gem_caching)
+#define DRM_IOCTL_I915_GEM_GET_CACHING         DRM_IOWR(DRM_COMMAND_BASE + 
DRM_I915_GEM_GET_CACHING, struct drm_i915_gem_caching)
 #define DRM_IOCTL_I915_GEM_THROTTLE    DRM_IO ( DRM_COMMAND_BASE + 
DRM_I915_GEM_THROTTLE)
 #define DRM_IOCTL_I915_GEM_ENTERVT     DRM_IO(DRM_COMMAND_BASE + 
DRM_I915_GEM_ENTERVT)
 #define DRM_IOCTL_I915_GEM_LEAVEVT     DRM_IO(DRM_COMMAND_BASE + 
DRM_I915_GEM_LEAVEVT)
@@ -305,7 +329,14 @@
 #define I915_PARAM_HAS_LLC                      17
 #define I915_PARAM_HAS_ALIASING_PPGTT   18
 #define I915_PARAM_HAS_WAIT_TIMEOUT     19
-#define I915_PARAM_HAS_VEBOX            22
+#define I915_PARAM_HAS_SEMAPHORES       20
+#define I915_PARAM_HAS_PRIME_VMAP_FLUSH         21
+#define I915_PARAM_HAS_VEBOX            22
+#define I915_PARAM_HAS_SECURE_BATCHES   23
+#define I915_PARAM_HAS_PINNED_BATCHES   24
+#define I915_PARAM_HAS_EXEC_NO_RELOC    25
+#define I915_PARAM_HAS_EXEC_HANDLE_LUT   26
+#define I915_PARAM_HAS_WT               27
 
 typedef struct drm_i915_getparam {
        int param;
@@ -626,7 +657,11 @@
        __u64 offset;
 
 #define EXEC_OBJECT_NEEDS_FENCE (1<<0)
+#define EXEC_OBJECT_NEEDS_GTT  (1<<1)
+#define EXEC_OBJECT_WRITE      (1<<2)
+#define __EXEC_OBJECT_UNKNOWN_FLAGS -(EXEC_OBJECT_WRITE<<1)
        __u64 flags;
+
        __u64 rsvd1;
        __u64 rsvd2;
 };
@@ -672,6 +707,34 @@
 /** Resets the SO write offset registers for transform feedback on gen7. */
 #define I915_EXEC_GEN7_SOL_RESET       (1<<8)
 
+/** Request a privileged ("secure") batch buffer. Note only available for
+ * DRM_ROOT_ONLY | DRM_MASTER processes.
+ */
+#define I915_EXEC_SECURE               (1<<9)
+
+/** Inform the kernel that the batch is and will always be pinned. This
+ * negates the requirement for a workaround to be performed to avoid
+ * an incoherent CS (such as can be found on 830/845). If this flag is
+ * not passed, the kernel will endeavour to make sure the batch is
+ * coherent with the CS before execution. If this flag is passed,
+ * userspace assumes the responsibility for ensuring the same.
+ */
+#define I915_EXEC_IS_PINNED            (1<<10)
+
+/** Provide a hint to the kernel that the command stream and auxilliary
+ * state buffers already holds the correct presumed addresses and so the
+ * relocation process may be skipped if no buffers need to be moved in
+ * preparation for the execbuffer.
+ */
+#define I915_EXEC_NO_RELOC             (1<<11)
+
+/** Use the reloc.handle as an index into the exec object array rather
+ * than as the per-file handle.
+ */
+#define I915_EXEC_HANDLE_LUT           (1<<12)
+
+#define __I915_EXEC_UNKNOWN_FLAGS -(I915_EXEC_HANDLE_LUT<<1)
+
 #define I915_EXEC_CONTEXT_ID_MASK      (0xffffffff)
 #define i915_execbuffer2_set_context_id(eb2, context) \
        (eb2).rsvd1 = context & I915_EXEC_CONTEXT_ID_MASK
@@ -708,21 +771,45 @@
        __u32 busy;
 };
 
-#define I915_CACHEING_NONE             0
-#define I915_CACHEING_CACHED           1
+/**
+ * I915_CACHING_NONE
+ *
+ * GPU access is not coherent with cpu caches. Default for machines without an
+ * LLC.
+ */
+#define I915_CACHING_NONE              0
+/**
+ * I915_CACHING_CACHED
+ *
+ * GPU access is coherent with cpu caches and furthermore the data is cached in
+ * last-level caches shared between cpu cores and the gpu GT. Default on
+ * machines with HAS_LLC.
+ */
+#define I915_CACHING_CACHED            1
+/**
+ * I915_CACHING_DISPLAY
+ *
+ * Special GPU caching mode which is coherent with the scanout engines.
+ * Transparently falls back to I915_CACHING_NONE on platforms where no special
+ * cache mode (like write-through or gfdt flushing) is available. The kernel
+ * automatically sets this mode when using a buffer as a scanout target.
+ * Userspace can manually set this mode to avoid a costly stall and clflush in
+ * the hotpath of drawing the first frame.
+ */
+#define I915_CACHING_DISPLAY           2
 
-struct drm_i915_gem_cacheing {
+struct drm_i915_gem_caching {
        /**
-        * Handle of the buffer to set/get the cacheing level of. */
+        * Handle of the buffer to set/get the caching level of. */
        __u32 handle;
 
        /**
         * Cacheing level to apply or return value
         *
-        * bits0-15 are for generic cacheing control (i.e. the above defined
+        * bits0-15 are for generic caching control (i.e. the above defined
         * values). bits16-31 are reserved for platform-specific variations
         * (e.g. l3$ caching on gen7). */
-       __u32 cacheing;
+       __u32 caching;
 };
 
 #define I915_TILING_NONE       0
@@ -962,4 +1049,4 @@
        __u32 pad;
 };
 
-#endif                         /* _I915_DRM_H_ */
+#endif /* _I915_DRM_H_ */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/libdrm-2.4.51/intel/intel_bufmgr.h new/libdrm-2.4.52/intel/intel_bufmgr.h
--- old/libdrm-2.4.51/intel/intel_bufmgr.h      2013-12-13 18:17:27.000000000 
+0100
+++ new/libdrm-2.4.52/intel/intel_bufmgr.h      2014-01-20 19:58:15.000000000 
+0100
@@ -61,9 +61,8 @@
        unsigned long align;
 
        /**
-        * Last seen card virtual address (offset from the beginning of the
-        * aperture) for the object.  This should be used to fill relocation
-        * entries when calling drm_intel_bo_emit_reloc()
+        * Deprecated field containing (possibly the low 32-bits of) the last
+        * seen virtual card address.  Use offset64 instead.
         */
        unsigned long offset;
 
@@ -84,6 +83,13 @@
         * MM-specific handle for accessing object
         */
        int handle;
+
+       /**
+        * Last seen card virtual address (offset from the beginning of the
+        * aperture) for the object.  This should be used to fill relocation
+        * entries when calling drm_intel_bo_emit_reloc()
+        */
+       uint64_t offset64;
 };
 
 enum aub_dump_bmp_format {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/libdrm-2.4.51/intel/intel_bufmgr_gem.c 
new/libdrm-2.4.52/intel/intel_bufmgr_gem.c
--- old/libdrm-2.4.51/intel/intel_bufmgr_gem.c  2013-12-13 18:17:27.000000000 
+0100
+++ new/libdrm-2.4.52/intel/intel_bufmgr_gem.c  2014-01-20 19:58:15.000000000 
+0100
@@ -212,6 +212,15 @@
        bool reusable;
 
        /**
+        * Boolean of whether the GPU is definitely not accessing the buffer.
+        *
+        * This is only valid when reusable, since non-reusable
+        * buffers are those that have been shared wth other
+        * processes, so we don't know their state.
+        */
+       bool idle;
+
+       /**
         * Size in bytes of this buffer and its relocation descendents.
         *
         * Used to avoid costly tree walking in
@@ -382,7 +391,7 @@
                            (unsigned long long)bo_gem->relocs[j].offset,
                            target_gem->gem_handle,
                            target_gem->name,
-                           target_bo->offset,
+                           target_bo->offset64,
                            bo_gem->relocs[j].delta);
                }
        }
@@ -567,11 +576,19 @@
        struct drm_i915_gem_busy busy;
        int ret;
 
+       if (bo_gem->reusable && bo_gem->idle)
+               return false;
+
        VG_CLEAR(busy);
        busy.handle = bo_gem->gem_handle;
 
        ret = drmIoctl(bufmgr_gem->fd, DRM_IOCTL_I915_GEM_BUSY, &busy);
-
+       if (ret == 0) {
+               bo_gem->idle = !busy.busy;
+               return busy.busy;
+       } else {
+               return false;
+       }
        return (ret == 0 && busy.busy);
 }
 
@@ -894,6 +911,7 @@
 
        bo_gem->bo.size = open_arg.size;
        bo_gem->bo.offset = 0;
+       bo_gem->bo.offset64 = 0;
        bo_gem->bo.virtual = NULL;
        bo_gem->bo.bufmgr = bufmgr;
        bo_gem->name = name;
@@ -1337,7 +1355,9 @@
 int drm_intel_gem_bo_map_unsynchronized(drm_intel_bo *bo)
 {
        drm_intel_bufmgr_gem *bufmgr_gem = (drm_intel_bufmgr_gem *) bo->bufmgr;
+#ifdef HAVE_VALGRIND
        drm_intel_bo_gem *bo_gem = (drm_intel_bo_gem *) bo;
+#endif
        int ret;
 
        /* If the CPU cache isn't coherent with the GTT, then use a
@@ -1687,7 +1707,7 @@
            target_bo_gem->gem_handle;
        bo_gem->relocs[bo_gem->reloc_count].read_domains = read_domains;
        bo_gem->relocs[bo_gem->reloc_count].write_domain = write_domain;
-       bo_gem->relocs[bo_gem->reloc_count].presumed_offset = target_bo->offset;
+       bo_gem->relocs[bo_gem->reloc_count].presumed_offset = 
target_bo->offset64;
 
        bo_gem->reloc_target_info[bo_gem->reloc_count].bo = target_bo;
        if (target_bo != bo)
@@ -1838,11 +1858,12 @@
                drm_intel_bo_gem *bo_gem = (drm_intel_bo_gem *) bo;
 
                /* Update the buffer offset */
-               if (bufmgr_gem->exec_objects[i].offset != bo->offset) {
+               if (bufmgr_gem->exec_objects[i].offset != bo->offset64) {
                        DBG("BO %d (%s) migrated: 0x%08lx -> 0x%08llx\n",
-                           bo_gem->gem_handle, bo_gem->name, bo->offset,
+                           bo_gem->gem_handle, bo_gem->name, bo->offset64,
                            (unsigned long long)bufmgr_gem->exec_objects[i].
                            offset);
+                       bo->offset64 = bufmgr_gem->exec_objects[i].offset;
                        bo->offset = bufmgr_gem->exec_objects[i].offset;
                }
        }
@@ -1858,10 +1879,11 @@
                drm_intel_bo_gem *bo_gem = (drm_intel_bo_gem *)bo;
 
                /* Update the buffer offset */
-               if (bufmgr_gem->exec2_objects[i].offset != bo->offset) {
+               if (bufmgr_gem->exec2_objects[i].offset != bo->offset64) {
                        DBG("BO %d (%s) migrated: 0x%08lx -> 0x%08llx\n",
-                           bo_gem->gem_handle, bo_gem->name, bo->offset,
+                           bo_gem->gem_handle, bo_gem->name, bo->offset64,
                            (unsigned long 
long)bufmgr_gem->exec2_objects[i].offset);
+                       bo->offset64 = bufmgr_gem->exec2_objects[i].offset;
                        bo->offset = bufmgr_gem->exec2_objects[i].offset;
                }
        }
@@ -2217,6 +2239,8 @@
                drm_intel_bo *bo = bufmgr_gem->exec_bos[i];
                drm_intel_bo_gem *bo_gem = (drm_intel_bo_gem *) bo;
 
+               bo_gem->idle = false;
+
                /* Disconnect the buffer from the validate list */
                bo_gem->validate_index = -1;
                bufmgr_gem->exec_bos[i] = NULL;
@@ -2312,6 +2336,8 @@
                drm_intel_bo *bo = bufmgr_gem->exec_bos[i];
                drm_intel_bo_gem *bo_gem = (drm_intel_bo_gem *)bo;
 
+               bo_gem->idle = false;
+
                /* Disconnect the buffer from the validate list */
                bo_gem->validate_index = -1;
                bufmgr_gem->exec_bos[i] = NULL;
@@ -2365,6 +2391,7 @@
        if (ret != 0)
                return -errno;
 
+       bo->offset64 = pin.offset;
        bo->offset = pin.offset;
        return 0;
 }
@@ -3018,15 +3045,19 @@
        drm_intel_context *context = NULL;
        int ret;
 
+       context = calloc(1, sizeof(*context));
+       if (!context)
+               return NULL;
+
        VG_CLEAR(create);
        ret = drmIoctl(bufmgr_gem->fd, DRM_IOCTL_I915_GEM_CONTEXT_CREATE, 
&create);
        if (ret != 0) {
                DBG("DRM_IOCTL_I915_GEM_CONTEXT_CREATE failed: %s\n",
                    strerror(errno));
+               free(context);
                return NULL;
        }
 
-       context = calloc(1, sizeof(*context));
        context->ctx_id = create.ctx_id;
        context->bufmgr = bufmgr;
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/libdrm-2.4.51/libkms/Makefile.am new/libdrm-2.4.52/libkms/Makefile.am
--- old/libdrm-2.4.51/libkms/Makefile.am        2014-01-08 17:28:31.000000000 
+0100
+++ new/libdrm-2.4.52/libkms/Makefile.am        2014-01-13 22:41:23.000000000 
+0100
@@ -31,6 +31,11 @@
 libkms_la_SOURCES += radeon.c
 endif
 
+if HAVE_EXYNOS
+libkms_la_SOURCES += exynos.c
+AM_CFLAGS += -I$(top_srcdir)/exynos
+endif
+
 libkmsincludedir = ${includedir}/libkms
 libkmsinclude_HEADERS = libkms.h
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/libdrm-2.4.51/libkms/exynos.c new/libdrm-2.4.52/libkms/exynos.c
--- old/libdrm-2.4.51/libkms/exynos.c   1970-01-01 01:00:00.000000000 +0100
+++ new/libdrm-2.4.52/libkms/exynos.c   2014-01-13 22:41:23.000000000 +0100
@@ -0,0 +1,207 @@
+/* exynos.c
+ *
+ * Copyright 2009 Samsung Electronics Co., Ltd.
+ * Authors:
+ *     SooChan Lim <sc1....@samsung.com>
+ *      Sangjin LEE <lsj...@samsung.com>
+ *
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
+ */
+
+#define HAVE_STDINT_H
+#define _FILE_OFFSET_BITS 64
+
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "internal.h"
+
+#include <sys/mman.h>
+#include <sys/ioctl.h>
+#include "xf86drm.h"
+
+#include "exynos_drm.h"
+
+struct exynos_bo
+{
+       struct kms_bo base;
+       unsigned map_count;
+};
+
+static int
+exynos_get_prop(struct kms_driver *kms, unsigned key, unsigned *out)
+{
+       switch (key) {
+       case KMS_BO_TYPE:
+               *out = KMS_BO_TYPE_SCANOUT_X8R8G8B8 | 
KMS_BO_TYPE_CURSOR_64X64_A8R8G8B8;
+               break;
+       default:
+               return -EINVAL;
+       }
+       return 0;
+}
+
+static int
+exynos_destroy(struct kms_driver *kms)
+{
+       free(kms);
+       return 0;
+}
+
+static int
+exynos_bo_create(struct kms_driver *kms,
+                const unsigned width, const unsigned height,
+                const enum kms_bo_type type, const unsigned *attr,
+                struct kms_bo **out)
+{
+       struct drm_exynos_gem_create arg;
+       unsigned size, pitch;
+       struct exynos_bo *bo;
+       int i, ret;
+
+       for (i = 0; attr[i]; i += 2) {
+               switch (attr[i]) {
+               case KMS_WIDTH:
+               case KMS_HEIGHT:
+               case KMS_BO_TYPE:
+                       break;
+               default:
+                       return -EINVAL;
+               }
+       }
+
+       bo = calloc(1, sizeof(*bo));
+       if (!bo)
+               return -ENOMEM;
+
+       if (type == KMS_BO_TYPE_CURSOR_64X64_A8R8G8B8) {
+               pitch = 64 * 4;
+               size = 64 * 64 * 4;
+       } else if (type == KMS_BO_TYPE_SCANOUT_X8R8G8B8) {
+               pitch = width * 4;
+               pitch = (pitch + 512 - 1) & ~(512 - 1);
+               size = pitch * ((height + 4 - 1) & ~(4 - 1));
+       } else {
+               return -EINVAL;
+       }
+
+       memset(&arg, 0, sizeof(arg));
+       arg.size = size;
+
+       ret = drmCommandWriteRead(kms->fd, DRM_EXYNOS_GEM_CREATE, &arg, 
sizeof(arg));
+       if (ret)
+               goto err_free;
+
+       bo->base.kms = kms;
+       bo->base.handle = arg.handle;
+       bo->base.size = size;
+       bo->base.pitch = pitch;
+
+       *out = &bo->base;
+
+       return 0;
+
+err_free:
+       free(bo);
+       return ret;
+}
+
+static int
+exynos_bo_get_prop(struct kms_bo *bo, unsigned key, unsigned *out)
+{
+       switch (key) {
+       default:
+               return -EINVAL;
+       }
+}
+
+static int
+exynos_bo_map(struct kms_bo *_bo, void **out)
+{
+       struct exynos_bo *bo = (struct exynos_bo *)_bo;
+       struct drm_exynos_gem_map_off arg;
+       void *map = NULL;
+       int ret;
+
+       if (bo->base.ptr) {
+               bo->map_count++;
+               *out = bo->base.ptr;
+               return 0;
+       }
+
+       memset(&arg, 0, sizeof(arg));
+       arg.handle = bo->base.handle;
+
+       ret = drmCommandWriteRead(bo->base.kms->fd, DRM_EXYNOS_GEM_MAP_OFFSET, 
&arg, sizeof(arg));
+       if (ret)
+               return ret;
+
+       map = mmap(0, bo->base.size, PROT_READ | PROT_WRITE, MAP_SHARED, 
bo->base.kms->fd, arg.offset);
+       if (map == MAP_FAILED)
+               return -errno;
+
+       bo->base.ptr = map;
+       bo->map_count++;
+       *out = bo->base.ptr;
+
+       return 0;
+}
+
+static int
+exynos_bo_unmap(struct kms_bo *_bo)
+{
+       struct exynos_bo *bo = (struct exynos_bo *)_bo;
+       bo->map_count--;
+       return 0;
+}
+
+static int
+exynos_bo_destroy(struct kms_bo *_bo)
+{
+       struct exynos_bo *bo = (struct exynos_bo *)_bo;
+       struct drm_gem_close arg;
+       int ret;
+
+       if (bo->base.ptr) {
+               /* XXX Sanity check map_count */
+               munmap(bo->base.ptr, bo->base.size);
+               bo->base.ptr = NULL;
+       }
+
+       memset(&arg, 0, sizeof(arg));
+       arg.handle = bo->base.handle;
+
+       ret = drmIoctl(bo->base.kms->fd, DRM_IOCTL_GEM_CLOSE, &arg);
+       if (ret)
+               return -errno;
+
+       free(bo);
+       return 0;
+}
+
+int
+exynos_create(int fd, struct kms_driver **out)
+{
+       struct kms_driver *kms;
+
+       kms = calloc(1, sizeof(*kms));
+       if (!kms)
+               return -ENOMEM;
+
+       kms->fd = fd;
+
+       kms->bo_create = exynos_bo_create;
+       kms->bo_map = exynos_bo_map;
+       kms->bo_unmap = exynos_bo_unmap;
+       kms->bo_get_prop = exynos_bo_get_prop;
+       kms->bo_destroy = exynos_bo_destroy;
+       kms->get_prop = exynos_get_prop;
+       kms->destroy = exynos_destroy;
+       *out = kms;
+
+       return 0;
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/libdrm-2.4.51/libkms/internal.h new/libdrm-2.4.52/libkms/internal.h
--- old/libdrm-2.4.51/libkms/internal.h 2014-01-08 17:28:31.000000000 +0100
+++ new/libdrm-2.4.52/libkms/internal.h 2014-01-13 22:41:23.000000000 +0100
@@ -74,4 +74,6 @@
 
 int radeon_create(int fd, struct kms_driver **out);
 
+int exynos_create(int fd, struct kms_driver **out);
+
 #endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/libdrm-2.4.51/libkms/linux.c new/libdrm-2.4.52/libkms/linux.c
--- old/libdrm-2.4.51/libkms/linux.c    2014-01-08 17:28:31.000000000 +0100
+++ new/libdrm-2.4.52/libkms/linux.c    2014-01-13 22:41:23.000000000 +0100
@@ -115,6 +115,10 @@
        else if (!strcmp(name, "radeon"))
                ret = radeon_create(fd, out);
 #endif
+#ifdef HAVE_EXYNOS
+       else if (!strcmp(name, "exynos"))
+               ret = exynos_create(fd, out);
+#endif
        else
                ret = -ENOSYS;
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/libdrm-2.4.51/m4/libtool.m4 new/libdrm-2.4.52/m4/libtool.m4
--- old/libdrm-2.4.51/m4/libtool.m4     2014-01-08 21:38:41.000000000 +0100
+++ new/libdrm-2.4.52/m4/libtool.m4     2014-01-20 20:04:43.000000000 +0100
@@ -1312,7 +1312,7 @@
   rm -rf conftest*
   ;;
 
-x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
+x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
 s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
   # Find out which ABI we are using.
   echo 'int i;' > conftest.$ac_ext
@@ -1326,10 +1326,7 @@
          x86_64-*linux*)
            LD="${LD-ld} -m elf_i386"
            ;;
-         powerpcle-*linux*)
-           LD="${LD-ld} -m elf32lppclinux"
-           ;;
-         powerpc-*linux*)
+         ppc64-*linux*|powerpc64-*linux*)
            LD="${LD-ld} -m elf32ppclinux"
            ;;
          s390x-*linux*)
@@ -1348,10 +1345,7 @@
          x86_64-*linux*)
            LD="${LD-ld} -m elf_x86_64"
            ;;
-         powerpcle-*linux*)
-           LD="${LD-ld} -m elf64lppc"
-           ;;
-         powerpc-*linux*)
+         ppc*-*linux*|powerpc*-*linux*)
            LD="${LD-ld} -m elf64ppc"
            ;;
          s390*-*linux*|s390*-*tpf*)
@@ -2485,7 +2479,14 @@
     *) objformat=elf ;;
     esac
   fi
-  version_type=freebsd-$objformat
+  # Handle Gentoo/FreeBSD as it was Linux
+  case $host_vendor in
+    gentoo)
+      version_type=linux ;;
+    *)
+      version_type=freebsd-$objformat ;;
+  esac
+
   case $version_type in
     freebsd-elf*)
       library_names_spec='${libname}${release}${shared_ext}$versuffix 
${libname}${release}${shared_ext} $libname${shared_ext}'
@@ -2496,6 +2497,12 @@
       library_names_spec='${libname}${release}${shared_ext}$versuffix 
$libname${shared_ext}$versuffix'
       need_version=yes
       ;;
+    linux)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix 
${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+      soname_spec='${libname}${release}${shared_ext}$major'
+      need_lib_prefix=no
+      need_version=no
+      ;;
   esac
   shlibpath_var=LD_LIBRARY_PATH
   case $host_os in
@@ -2675,14 +2682,10 @@
   # before this can be enabled.
   hardcode_into_libs=yes
 
-  # Add ABI-specific directories to the system library path.
-  sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib"
-
   # Append ld.so.conf contents to the search path
   if test -f /etc/ld.so.conf; then
     lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 
2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < 
/etc/ld.so.conf | $SED -e 's/#.*//;/^[  ]*hwcap[        ]/d;s/[:,      ]/ 
/g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
-    sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra"
-
+    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
   fi
 
   # We used to test for /lib/ld.so.1 and disable shared libraries on
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/libdrm-2.4.51/tests/kmstest/main.c new/libdrm-2.4.52/tests/kmstest/main.c
--- old/libdrm-2.4.51/tests/kmstest/main.c      2014-01-08 17:28:31.000000000 
+0100
+++ new/libdrm-2.4.52/tests/kmstest/main.c      2014-01-13 22:41:23.000000000 
+0100
@@ -61,6 +61,7 @@
        "radeon",
        "nouveau",
        "vmwgfx",
+       "exynos",
        NULL
 };
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/libdrm-2.4.51/tests/modetest/modetest.c 
new/libdrm-2.4.52/tests/modetest/modetest.c
--- old/libdrm-2.4.51/tests/modetest/modetest.c 2013-12-13 18:13:34.000000000 
+0100
+++ new/libdrm-2.4.52/tests/modetest/modetest.c 2014-01-13 22:41:23.000000000 
+0100
@@ -693,6 +693,7 @@
        uint32_t crtc_id;
        char mode_str[64];
        char format_str[5];
+       unsigned int vrefresh;
        unsigned int fourcc;
        drmModeModeInfo *mode;
        struct crtc *crtc;
@@ -714,7 +715,8 @@
 };
 
 static drmModeModeInfo *
-connector_find_mode(struct device *dev, uint32_t con_id, const char *mode_str)
+connector_find_mode(struct device *dev, uint32_t con_id, const char *mode_str,
+        const unsigned int vrefresh)
 {
        drmModeConnector *connector;
        drmModeModeInfo *mode;
@@ -726,8 +728,16 @@
 
        for (i = 0; i < connector->count_modes; i++) {
                mode = &connector->modes[i];
-               if (!strcmp(mode->name, mode_str))
-                       return mode;
+               if (!strcmp(mode->name, mode_str)) {
+                       /* If the vertical refresh frequency is not specified 
then return the
+                        * first mode that match with the name. Else, return 
the mode that match
+                        * the name and the specified vertical refresh 
frequency.
+                        */
+                       if (vrefresh == 0)
+                               return mode;
+                       else if (mode->vrefresh == vrefresh)
+                               return mode;
+               }
        }
 
        return NULL;
@@ -789,7 +799,7 @@
 
        for (i = 0; i < (int)pipe->num_cons; i++) {
                mode = connector_find_mode(dev, pipe->con_ids[i],
-                                          pipe->mode_str);
+                                          pipe->mode_str, pipe->vrefresh);
                if (mode == NULL) {
                        fprintf(stderr,
                                "failed to find mode \"%s\" for connector %u\n",
@@ -1059,8 +1069,8 @@
                if (pipe->mode == NULL)
                        continue;
 
-               printf("setting mode %s@%s on connectors ",
-                      pipe->mode_str, pipe->format_str);
+               printf("setting mode %s-%dHz@%s on connectors ",
+                      pipe->mode_str, pipe->mode->vrefresh, pipe->format_str);
                for (j = 0; j < pipe->num_cons; ++j)
                        printf("%u, ", pipe->con_ids[j]);
                printf("crtc %d\n", pipe->crtc->crtc->crtc_id);
@@ -1192,6 +1202,7 @@
        const char *p;
        char *endp;
 
+       pipe->vrefresh = 0;
        pipe->crtc_id = (uint32_t)-1;
        strcpy(pipe->format_str, "XR24");
 
@@ -1226,11 +1237,19 @@
 
        arg = endp + 1;
 
-       p = strchrnul(arg, '@');
+       /* Search for the vertical refresh or the format. */
+       p = strpbrk(arg, "-@");
+       if (p == NULL)
+               p = arg + strlen(arg);
        len = min(sizeof pipe->mode_str - 1, (unsigned int)(p - arg));
        strncpy(pipe->mode_str, arg, len);
        pipe->mode_str[len] = '\0';
 
+       if (*p == '-') {
+               pipe->vrefresh = strtoul(p + 1, &endp, 10);
+               p = endp;
+       }
+
        if (*p == '@') {
                strncpy(pipe->format_str, p + 1, 4);
                pipe->format_str[4] = '\0';
@@ -1323,7 +1342,7 @@
 
        fprintf(stderr, "\n Test options:\n\n");
        fprintf(stderr, "\t-P 
<crtc_id>:<w>x<h>[+<x>+<y>][*<scale>][@<format>]\tset a plane\n");
-       fprintf(stderr, "\t-s 
<connector_id>[,<connector_id>][@<crtc_id>]:<mode>[@<format>]\tset a mode\n");
+       fprintf(stderr, "\t-s 
<connector_id>[,<connector_id>][@<crtc_id>]:<mode>[-<vrefresh>][@<format>]\tset 
a mode\n");
        fprintf(stderr, "\t-v\ttest vsynced page flipping\n");
        fprintf(stderr, "\t-w <obj_id>:<prop_name>:<value>\tset property\n");
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/libdrm-2.4.51/xf86drm.h new/libdrm-2.4.52/xf86drm.h
--- old/libdrm-2.4.51/xf86drm.h 2013-12-13 18:17:27.000000000 +0100
+++ new/libdrm-2.4.52/xf86drm.h 2014-01-13 22:41:23.000000000 +0100
@@ -92,8 +92,14 @@
 typedef unsigned int  drmSize,     *drmSizePtr;            /**< For mapped 
regions */
 typedef void          *drmAddress, **drmAddressPtr; /**< For mapped regions */
 
+#if (__GNUC__ >= 3)
+#define DRM_PRINTFLIKE(f, a) __attribute__ ((format(__printf__, f, a)))
+#else
+#define DRM_PRINTFLIKE(f, a)
+#endif
+
 typedef struct _drmServerInfo {
-  int (*debug_print)(const char *format, va_list ap);
+  int (*debug_print)(const char *format, va_list ap) DRM_PRINTFLIKE(1,0);
   int (*load_module)(const char *name);
   void (*get_perms)(gid_t *, mode_t *);
 } drmServerInfo, *drmServerInfoPtr;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/libdrm-2.4.51/xf86drmMode.c new/libdrm-2.4.52/xf86drmMode.c
--- old/libdrm-2.4.51/xf86drmMode.c     2013-12-13 18:13:34.000000000 +0100
+++ new/libdrm-2.4.52/xf86drmMode.c     2014-01-20 19:58:05.000000000 +0100
@@ -41,6 +41,10 @@
 #include <sys/ioctl.h>
 #include <stdio.h>
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #include "xf86drmMode.h"
 #include "xf86drm.h"
 #include <drm.h>
@@ -49,6 +53,16 @@
 #include <unistd.h>
 #include <errno.h>
 
+#ifdef HAVE_VALGRIND
+#include <valgrind.h>
+#include <memcheck.h>
+#define VG(x) x
+#else
+#define VG(x)
+#endif
+
+#define VG_CLEAR(s) VG(memset(&s, 0, sizeof(s)))
+
 #define U642VOID(x) ((void *)(unsigned long)(x))
 #define VOID2U64(x) ((uint64_t)(unsigned long)(x))
 
@@ -245,6 +259,7 @@
        struct drm_mode_fb_cmd f;
        int ret;
 
+       VG_CLEAR(f);
        f.width  = width;
        f.height = height;
        f.pitch  = pitch;
@@ -335,6 +350,7 @@
        struct drm_mode_crtc crtc;
        drmModeCrtcPtr r;
 
+       VG_CLEAR(crtc);
        crtc.crtc_id = crtcId;
 
        if (drmIoctl(fd, DRM_IOCTL_MODE_GETCRTC, &crtc))
@@ -368,6 +384,7 @@
 {
        struct drm_mode_crtc crtc;
 
+       VG_CLEAR(crtc);
        crtc.x             = x;
        crtc.y             = y;
        crtc.crtc_id       = crtcId;
@@ -436,6 +453,7 @@
        drmModeEncoderPtr r = NULL;
 
        enc.encoder_id = encoder_id;
+       enc.crtc_id = 0;
        enc.encoder_type = 0;
        enc.possible_crtcs = 0;
        enc.possible_clones = 0;
@@ -580,6 +598,7 @@
        struct drm_mode_get_property prop;
        drmModePropertyPtr r;
 
+       VG_CLEAR(prop);
        prop.prop_id = property_id;
        prop.count_enum_blobs = 0;
        prop.count_values = 0;

-- 
To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org
For additional commands, e-mail: opensuse-commit+h...@opensuse.org

Reply via email to