[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

libdrm: Changes to 'debian-unstable'



 Makefile.am                      |    2 
 Makefile.sources                 |    3 
 configure.ac                     |    2 
 debian/changelog                 |    9 
 debian/libdrm-freedreno1.symbols |    4 
 debian/rules                     |    2 
 debian/source/local-options      |   14 +
 freedreno/Makefile.am            |    2 
 freedreno/Makefile.sources       |    1 
 freedreno/README                 |   16 -
 freedreno/freedreno-symbol-check |    4 
 freedreno/freedreno_bo.c         |  141 +------------
 freedreno/freedreno_bo_cache.c   |  222 +++++++++++++++++++++
 freedreno/freedreno_device.c     |   62 +----
 freedreno/freedreno_drmif.h      |   14 +
 freedreno/freedreno_priv.h       |   38 +++
 freedreno/freedreno_ringbuffer.c |   51 ++++
 freedreno/freedreno_ringbuffer.h |   16 -
 freedreno/kgsl/README            |   26 ++
 freedreno/kgsl/kgsl_bo.c         |    6 
 freedreno/kgsl/kgsl_ringbuffer.c |   13 -
 freedreno/msm/msm_bo.c           |   20 +
 freedreno/msm/msm_device.c       |    3 
 freedreno/msm/msm_drm.h          |  109 ++++++----
 freedreno/msm/msm_priv.h         |   17 -
 freedreno/msm/msm_ringbuffer.c   |  410 ++++++++++++++++++++++++++++-----------
 include/drm/virtgpu_drm.h        |  109 +++++-----
 intel/Makefile.am                |    1 
 libkms/Makefile.am               |    2 
 man/drm-kms.xml                  |    2 
 nouveau/Makefile.am              |    2 
 radeon/Makefile.am               |    3 
 radeon/radeon_cs_gem.c           |    2 
 tests/drmdevice.c                |   13 -
 tests/modetest/Makefile.am       |    2 
 util_double_list.h               |    6 
 xf86drm.c                        |   25 +-
 37 files changed, 922 insertions(+), 452 deletions(-)

New commits:
commit cc02f99b2c3e19f8108a7341eedb2666e6c6e602
Author: Andreas Boll <andreas.boll.dev@gmail.com>
Date:   Mon Jul 25 12:33:11 2016 +0200

    Upload to unstable.

diff --git a/debian/changelog b/debian/changelog
index 915a635..7cb5342 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,11 +1,11 @@
-libdrm (2.4.70-1) UNRELEASED; urgency=medium
+libdrm (2.4.70-1) unstable; urgency=medium
 
   * New upstream release.
   * Update libdrm-freedreno1.symbols and shlibs.
   * source/local-options: Add more files to extend-diff-ignore option.
     Fixes 17 patch-system-but-direct-changes-in-diff lintian warnings.
 
- -- Andreas Boll <andreas.boll.dev@gmail.com>  Mon, 25 Jul 2016 11:54:36 +0200
+ -- Andreas Boll <andreas.boll.dev@gmail.com>  Mon, 25 Jul 2016 12:32:20 +0200
 
 libdrm (2.4.69-1) unstable; urgency=medium
 

commit a2bfeba63f2c5f58a2c9803dd9aea01abd346c4c
Author: Andreas Boll <andreas.boll.dev@gmail.com>
Date:   Mon Jul 25 12:17:05 2016 +0200

    source/local-options: Add more files to extend-diff-ignore option.
    
    Fixes 17 patch-system-but-direct-changes-in-diff lintian warnings.

diff --git a/debian/changelog b/debian/changelog
index 010c37e..915a635 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,8 @@ libdrm (2.4.70-1) UNRELEASED; urgency=medium
 
   * New upstream release.
   * Update libdrm-freedreno1.symbols and shlibs.
+  * source/local-options: Add more files to extend-diff-ignore option.
+    Fixes 17 patch-system-but-direct-changes-in-diff lintian warnings.
 
  -- Andreas Boll <andreas.boll.dev@gmail.com>  Mon, 25 Jul 2016 11:54:36 +0200
 
diff --git a/debian/source/local-options b/debian/source/local-options
index ec29ae8..b0c5d03 100644
--- a/debian/source/local-options
+++ b/debian/source/local-options
@@ -1 +1,13 @@
---extend-diff-ignore=intel/tests/g.*batch.sh
+# ignore symlinks from git, use source files from the tarball
+extend-diff-ignore = intel/tests/g.*batch.sh
+
+## The following files aren't shipped in the upstream tarball
+
+# Android Makefiles
+extend-diff-ignore = Android\.mk|CleanSpec\.mk
+
+# misc. files and scripts used by libdrm developers but not required for the build
+extend-diff-ignore = RELEASING|autogen\.sh|freedreno/kgsl/README
+
+# dead code
+extend-diff-ignore = tests/auth.c|tests/lock.c

commit 108ad20738f8d67fc7e728e79f136aa8fc41c5d1
Author: Andreas Boll <andreas.boll.dev@gmail.com>
Date:   Mon Jul 25 12:03:22 2016 +0200

    Update libdrm-freedreno1.symbols and shlibs.

diff --git a/debian/changelog b/debian/changelog
index 4b565b5..010c37e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,7 @@
 libdrm (2.4.70-1) UNRELEASED; urgency=medium
 
   * New upstream release.
+  * Update libdrm-freedreno1.symbols and shlibs.
 
  -- Andreas Boll <andreas.boll.dev@gmail.com>  Mon, 25 Jul 2016 11:54:36 +0200
 
diff --git a/debian/libdrm-freedreno1.symbols b/debian/libdrm-freedreno1.symbols
index 5a4f465..b686576 100644
--- a/debian/libdrm-freedreno1.symbols
+++ b/debian/libdrm-freedreno1.symbols
@@ -18,14 +18,18 @@ libdrm_freedreno.so.1 libdrm-freedreno1 #MINVER#
  fd_device_new@Base 0
  fd_device_new_dup@Base 0
  fd_device_ref@Base 0
+ fd_device_version@Base 2.4.70
  fd_pipe_del@Base 0
  fd_pipe_get_param@Base 0
  fd_pipe_new@Base 0
  fd_pipe_wait@Base 0
  fd_pipe_wait_timeout@Base 2.4.64
+ fd_ringbuffer_cmd_count@Base 2.4.70
  fd_ringbuffer_del@Base 0
  fd_ringbuffer_emit_reloc_ring@Base 0
+ fd_ringbuffer_emit_reloc_ring_full@Base 2.4.70
  fd_ringbuffer_flush@Base 0
+ fd_ringbuffer_grow@Base 2.4.70
  fd_ringbuffer_new@Base 0
  fd_ringbuffer_reloc@Base 0
  fd_ringbuffer_reset@Base 0
diff --git a/debian/rules b/debian/rules
index 169f648..b107ea1 100755
--- a/debian/rules
+++ b/debian/rules
@@ -131,7 +131,7 @@ ifeq ($(TEGRA), yes)
 	dh_makeshlibs -plibdrm-tegra0 -V'libdrm-tegra0' -- -c4
 endif
 ifeq ($(FREEDRENO), yes)
-	dh_makeshlibs -plibdrm-freedreno1 -V'libdrm-freedreno1 (>= 2.4.65)' -- -c4
+	dh_makeshlibs -plibdrm-freedreno1 -V'libdrm-freedreno1 (>= 2.4.70)' -- -c4
 endif
 
 %:

commit 73a70d053898d46c3e40fb611424f456e69c88b9
Author: Andreas Boll <andreas.boll.dev@gmail.com>
Date:   Mon Jul 25 11:54:52 2016 +0200

    Bump changelog

diff --git a/debian/changelog b/debian/changelog
index 1a625e7..4b565b5 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+libdrm (2.4.70-1) UNRELEASED; urgency=medium
+
+  * New upstream release.
+
+ -- Andreas Boll <andreas.boll.dev@gmail.com>  Mon, 25 Jul 2016 11:54:36 +0200
+
 libdrm (2.4.69-1) unstable; urgency=medium
 
   [ Andreas Boll ]

commit 0caa84cb046156b9b2ca248d32af9548b04316e1
Author: Rob Clark <robclark@freedesktop.org>
Date:   Sat Jul 23 09:25:48 2016 -0400

    Bump version for release
    
    Signed-off-by: Rob Clark <robclark@freedesktop.org>

diff --git a/configure.ac b/configure.ac
index 0f91d43..e3048c7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -20,7 +20,7 @@
 
 AC_PREREQ([2.63])
 AC_INIT([libdrm],
-        [2.4.69],
+        [2.4.70],
         [https://bugs.freedesktop.org/enter_bug.cgi?product=DRI],
         [libdrm])
 

commit 248b3343ce4b855c89bdad4e8251885d1fa6904e
Author: Andreas Boll <andreas.boll.dev@gmail.com>
Date:   Thu Jul 21 14:27:33 2016 +0200

    radeon: Fix typo in stderr message
    
    Signed-off-by: Andreas Boll <andreas.boll.dev@gmail.com>
    Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>

diff --git a/radeon/radeon_cs_gem.c b/radeon/radeon_cs_gem.c
index cdec64e..23f33af 100644
--- a/radeon/radeon_cs_gem.c
+++ b/radeon/radeon_cs_gem.c
@@ -323,7 +323,7 @@ static int cs_gem_end(struct radeon_cs_int *cs,
         return -EPIPE;
     }
     if (cs->section_ndw != cs->section_cdw) {
-        fprintf(stderr, "CS section size missmatch start at (%s,%s,%d) %d vs %d\n",
+        fprintf(stderr, "CS section size mismatch start at (%s,%s,%d) %d vs %d\n",
                 cs->section_file, cs->section_func, cs->section_line, cs->section_ndw, cs->section_cdw);
         fprintf(stderr, "CS section end at (%s,%s,%d)\n",
                 file, func, line);

commit 22263ca11a44abb57639f19318ad1dd4ef7fe956
Author: Andreas Boll <andreas.boll.dev@gmail.com>
Date:   Thu Jul 21 14:25:41 2016 +0200

    man: Fix typo
    
    Signed-off-by: Andreas Boll <andreas.boll.dev@gmail.com>
    Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>

diff --git a/man/drm-kms.xml b/man/drm-kms.xml
index 5f04157..ae38dc8 100644
--- a/man/drm-kms.xml
+++ b/man/drm-kms.xml
@@ -126,7 +126,7 @@
           <listitem>
             <para><emphasis>Framebuffers</emphasis> are abstract memory objects
                   that provide a source of pixel data to scanout to a CRTC.
-                  Applications explicitely request the creation of framebuffers
+                  Applications explicitly request the creation of framebuffers
                   and can control their behavior. Framebuffers rely on the
                   underneath memory manager for low-level memory operations.
                   When creating a framebuffer, applications pass a memory handle

commit 7e9e373935bc47e59156c53ba299a3df0b18a4c3
Author: Andreas Boll <andreas.boll.dev@gmail.com>
Date:   Thu Jul 21 14:03:33 2016 +0200

    automake: Include virtgpu_drm.h in the release tarball
    
    The plan is to use this version of virtgpu_drm.h in mesa and drop mesa's
    local copy.
    To actually use this header it needs to be shipped in the tarball.
    
    This was missed in c745e541a9d8dfd3fb5e1ac57297e58d34d9328f
    
    Signed-off-by: Andreas Boll <andreas.boll.dev@gmail.com>
    Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>

diff --git a/Makefile.sources b/Makefile.sources
index 1a1f0fe..a57036a 100644
--- a/Makefile.sources
+++ b/Makefile.sources
@@ -33,7 +33,8 @@ LIBDRM_INCLUDE_H_FILES := \
 	include/drm/sis_drm.h \
 	include/drm/tegra_drm.h \
 	include/drm/vc4_drm.h \
-	include/drm/via_drm.h
+	include/drm/via_drm.h \
+	include/drm/virtgpu_drm.h
 
 LIBDRM_INCLUDE_VMWGFX_H_FILES := \
 	include/drm/vmwgfx_drm.h

commit 9af2ccdef3428ade565d8213803a9dd094427f26
Author: Andreas Boll <andreas.boll.dev@gmail.com>
Date:   Fri Jul 22 11:45:36 2016 +0200

    virtgpu: Update kernel header
    
    Generated using make headers_install.
    
    This brings the C++ guard, proper include path for drm.h and the
    switching to kernel types for fixed-with integers.
    
    Generated from drm-next commit c11dea5b0290984fa48111957ba3fdc5b3bdae5a
    
    Suggested-by: Emil Velikov <emil.l.velikov@gmail.com>
    Signed-off-by: Andreas Boll <andreas.boll.dev@gmail.com>
    Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>

diff --git a/include/drm/virtgpu_drm.h b/include/drm/virtgpu_drm.h
index abf11c5..91a31ff 100644
--- a/include/drm/virtgpu_drm.h
+++ b/include/drm/virtgpu_drm.h
@@ -24,13 +24,16 @@
 #ifndef VIRTGPU_DRM_H
 #define VIRTGPU_DRM_H
 
-#include <stddef.h>
-#include "drm/drm.h"
+#include "drm.h"
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
 
 /* Please note that modifications to all structs defined here are
  * subject to backwards-compatibility constraints.
  *
- * Do not use pointers, use uint64_t instead for 32 bit / 64 bit user/kernel
+ * Do not use pointers, use __u64 instead for 32 bit / 64 bit user/kernel
  * compatibility Keep fields aligned to their size
  */
 
@@ -45,88 +48,88 @@
 #define DRM_VIRTGPU_GET_CAPS  0x09
 
 struct drm_virtgpu_map {
-	uint64_t offset; /* use for mmap system call */
-	uint32_t handle;
-	uint32_t pad;
+	__u64 offset; /* use for mmap system call */
+	__u32 handle;
+	__u32 pad;
 };
 
 struct drm_virtgpu_execbuffer {
-	uint32_t flags;		/* for future use */
-	uint32_t size;
-	uint64_t command; /* void* */
-	uint64_t bo_handles;
-	uint32_t num_bo_handles;
-	uint32_t pad;
+	__u32		flags;		/* for future use */
+	__u32 size;
+	__u64 command; /* void* */
+	__u64 bo_handles;
+	__u32 num_bo_handles;
+	__u32 pad;
 };
 
 #define VIRTGPU_PARAM_3D_FEATURES 1 /* do we have 3D features in the hw */
 
 struct drm_virtgpu_getparam {
-	uint64_t param;
-	uint64_t value;
+	__u64 param;
+	__u64 value;
 };
 
 /* NO_BO flags? NO resource flag? */
 /* resource flag for y_0_top */
 struct drm_virtgpu_resource_create {
-	uint32_t target;
-	uint32_t format;
-	uint32_t bind;
-	uint32_t width;
-	uint32_t height;
-	uint32_t depth;
-	uint32_t array_size;
-	uint32_t last_level;
-	uint32_t nr_samples;
-	uint32_t flags;
-	uint32_t bo_handle; /* if this is set - recreate a new resource attached to this bo ? */
-	uint32_t res_handle;  /* returned by kernel */
-	uint32_t size;        /* validate transfer in the host */
-	uint32_t stride;      /* validate transfer in the host */
+	__u32 target;
+	__u32 format;
+	__u32 bind;
+	__u32 width;
+	__u32 height;
+	__u32 depth;
+	__u32 array_size;
+	__u32 last_level;
+	__u32 nr_samples;
+	__u32 flags;
+	__u32 bo_handle; /* if this is set - recreate a new resource attached to this bo ? */
+	__u32 res_handle;  /* returned by kernel */
+	__u32 size;        /* validate transfer in the host */
+	__u32 stride;      /* validate transfer in the host */
 };
 
 struct drm_virtgpu_resource_info {
-	uint32_t bo_handle;
-	uint32_t res_handle;
-	uint32_t size;
-	uint32_t stride;
+	__u32 bo_handle;
+	__u32 res_handle;
+	__u32 size;
+	__u32 stride;
 };
 
 struct drm_virtgpu_3d_box {
-	uint32_t x;
-	uint32_t y;
-	uint32_t z;
-	uint32_t w;
-	uint32_t h;
-	uint32_t d;
+	__u32 x;
+	__u32 y;
+	__u32 z;
+	__u32 w;
+	__u32 h;
+	__u32 d;
 };
 
 struct drm_virtgpu_3d_transfer_to_host {
-	uint32_t bo_handle;
+	__u32 bo_handle;
 	struct drm_virtgpu_3d_box box;
-	uint32_t level;
-	uint32_t offset;
+	__u32 level;
+	__u32 offset;
 };
 
 struct drm_virtgpu_3d_transfer_from_host {
-	uint32_t bo_handle;
+	__u32 bo_handle;
 	struct drm_virtgpu_3d_box box;
-	uint32_t level;
-	uint32_t offset;
+	__u32 level;
+	__u32 offset;
 };
 
 #define VIRTGPU_WAIT_NOWAIT 1 /* like it */
 struct drm_virtgpu_3d_wait {
-	uint32_t handle; /* 0 is an invalid handle */
-	uint32_t flags;
+	__u32 handle; /* 0 is an invalid handle */
+	__u32 flags;
 };
 
 struct drm_virtgpu_get_caps {
-	uint32_t cap_set_id;
-	uint32_t cap_set_ver;
-	uint64_t addr;
-	uint32_t size;
-	uint32_t pad;
+	__u32 cap_set_id;
+	__u32 cap_set_ver;
+	__u64 addr;
+	__u32 size;
+	__u32 pad;
 };
 
 #define DRM_IOCTL_VIRTGPU_MAP \
@@ -164,4 +167,8 @@ struct drm_virtgpu_get_caps {
 	DRM_IOWR(DRM_COMMAND_BASE + DRM_VIRTGPU_GET_CAPS, \
 	struct drm_virtgpu_get_caps)
 
+#if defined(__cplusplus)
+}
+#endif
+
 #endif

commit a5446775f27b52c120c75b8f82656aa64f93319d
Author: Andreas Boll <andreas.boll.dev@gmail.com>
Date:   Thu Jul 21 12:05:03 2016 +0200

    automake: Don't include Android Makefiles in the release tarball
    
    Currently only some Android Makefiles are included in the release tarball.
    To be more consistent one could either add the remaining files or don't
    ship Android Makefiles altogether.
    
    According to Emil the Android folk doesn't use our release tarballs.
    Thus it makes sense to remove those files from distribution which also
    means less work for maintenance in the future.
    
    Suggested-by: Emil Velikov <emil.l.velikov@gmail.com>
    Signed-off-by: Andreas Boll <andreas.boll.dev@gmail.com>
    Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>

diff --git a/Makefile.am b/Makefile.am
index feecba7..2ceb352 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -120,8 +120,6 @@ libdrm_la_SOURCES = $(LIBDRM_FILES)
 libdrmincludedir = ${includedir}
 libdrminclude_HEADERS = $(LIBDRM_H_FILES)
 
-EXTRA_DIST = Android.mk
-
 klibdrmincludedir = ${includedir}/libdrm
 klibdrminclude_HEADERS = $(LIBDRM_INCLUDE_H_FILES)
 
diff --git a/freedreno/Makefile.am b/freedreno/Makefile.am
index 9b7ec7d..0771d14 100644
--- a/freedreno/Makefile.am
+++ b/freedreno/Makefile.am
@@ -27,4 +27,4 @@ pkgconfigdir = @pkgconfigdir@
 pkgconfig_DATA = libdrm_freedreno.pc
 
 TESTS = freedreno-symbol-check
-EXTRA_DIST = Android.mk $(TESTS)
+EXTRA_DIST = $(TESTS)
diff --git a/intel/Makefile.am b/intel/Makefile.am
index d004568..c52e8c0 100644
--- a/intel/Makefile.am
+++ b/intel/Makefile.am
@@ -66,7 +66,6 @@ EXTRA_DIST = \
 	$(BATCHES:.batch=.batch-ref.txt) \
 	$(BATCHES:.batch=.batch-ref.txt) \
 	tests/test-batch.sh \
-	Android.mk \
 	$(TESTS)
 
 test_decode_LDADD = libdrm_intel.la ../libdrm.la
diff --git a/libkms/Makefile.am b/libkms/Makefile.am
index 6c0ab7a..7c1debe 100644
--- a/libkms/Makefile.am
+++ b/libkms/Makefile.am
@@ -44,4 +44,4 @@ pkgconfigdir = @pkgconfigdir@
 pkgconfig_DATA = libkms.pc
 
 TESTS = kms-symbol-check
-EXTRA_DIST = Android.mk $(TESTS)
+EXTRA_DIST = $(TESTS)
diff --git a/nouveau/Makefile.am b/nouveau/Makefile.am
index 76cdeca..344a844 100644
--- a/nouveau/Makefile.am
+++ b/nouveau/Makefile.am
@@ -30,4 +30,4 @@ pkgconfigdir = @pkgconfigdir@
 pkgconfig_DATA = libdrm_nouveau.pc
 
 TESTS = nouveau-symbol-check
-EXTRA_DIST = Android.mk $(TESTS)
+EXTRA_DIST = $(TESTS)
diff --git a/radeon/Makefile.am b/radeon/Makefile.am
index 31f19e5..e241531 100644
--- a/radeon/Makefile.am
+++ b/radeon/Makefile.am
@@ -44,4 +44,4 @@ pkgconfigdir = @pkgconfigdir@
 pkgconfig_DATA = libdrm_radeon.pc
 
 TESTS = radeon-symbol-check
-EXTRA_DIST = Android.mk $(LIBDRM_RADEON_BOF_FILES) $(TESTS)
+EXTRA_DIST = $(LIBDRM_RADEON_BOF_FILES) $(TESTS)
diff --git a/tests/modetest/Makefile.am b/tests/modetest/Makefile.am
index 25ce372..9686ccb 100644
--- a/tests/modetest/Makefile.am
+++ b/tests/modetest/Makefile.am
@@ -22,5 +22,3 @@ modetest_LDADD = \
 	$(top_builddir)/tests/util/libutil.la \
 	$(CAIRO_LIBS) \
 	-lpthread
-
-EXTRA_DIST = Android.mk

commit 9d1ce35c68bd05a56199afd94600716ea269187a
Author: Andreas Boll <andreas.boll.dev@gmail.com>
Date:   Thu Jul 21 10:54:15 2016 +0200

    radeon: Wire up radeon-symbol-check to make check
    
    This was missed in 552de225bf2740ba0cb52312c21353d71d934b8c
    
    Signed-off-by: Andreas Boll <andreas.boll.dev@gmail.com>
    Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>

diff --git a/radeon/Makefile.am b/radeon/Makefile.am
index 25c03d3..31f19e5 100644
--- a/radeon/Makefile.am
+++ b/radeon/Makefile.am
@@ -43,4 +43,5 @@ libdrm_radeoninclude_HEADERS = $(LIBDRM_RADEON_H_FILES)
 pkgconfigdir = @pkgconfigdir@
 pkgconfig_DATA = libdrm_radeon.pc
 
+TESTS = radeon-symbol-check
 EXTRA_DIST = Android.mk $(LIBDRM_RADEON_BOF_FILES) $(TESTS)

commit feb1b39be164019ca47b5d3923873a39d7dd0d77
Author: Rob Clark <robclark@freedesktop.org>
Date:   Thu Jul 21 13:59:53 2016 -0400

    freedreno: fix warnings
    
    Signed-off-by: Rob Clark <robclark@freedesktop.org>
    Tested-by: Rob Herring <robh@kernel.org>

diff --git a/freedreno/msm/msm_ringbuffer.c b/freedreno/msm/msm_ringbuffer.c
index fbfaefa..a78806c 100644
--- a/freedreno/msm/msm_ringbuffer.c
+++ b/freedreno/msm/msm_ringbuffer.c
@@ -232,10 +232,10 @@ static uint32_t bo2idx(struct fd_ringbuffer *ring, struct fd_bo *bo, uint32_t fl
 
 		if (!drmHashLookup(msm_ring->bo_table, bo->handle, &val)) {
 			/* found */
-			idx = (uint32_t)val;
+			idx = (uint32_t)(uintptr_t)val;
 		} else {
 			idx = append_bo(ring, bo);
-			val = (void *)idx;
+			val = (void *)(uintptr_t)idx;
 			drmHashInsert(msm_ring->bo_table, bo->handle, val);
 		}
 		msm_bo->current_ring_seqno = msm_ring->seqno;

commit 1f1b61d49128716f9808be23af20f54f1c26a573
Author: Rob Clark <robclark@freedesktop.org>
Date:   Thu Jul 21 13:19:35 2016 -0400

    freedreno: fix android build break
    
    The 'deprecated' #define was causing problems with bionic system headers
    which used __attribute__((deprecated)).
    
    Signed-off-by: Rob Clark <robclark@freedesktop.org>
    Tested-by: Rob Herring <robh@kernel.org>

diff --git a/freedreno/freedreno_drmif.h b/freedreno/freedreno_drmif.h
index af5e1da..2d913e6 100644
--- a/freedreno/freedreno_drmif.h
+++ b/freedreno/freedreno_drmif.h
@@ -33,9 +33,9 @@
 #include <stdint.h>
 
 #if defined(__GNUC__)
-#  define deprecated __attribute__((__deprecated__))
+#  define drm_deprecated __attribute__((__deprecated__))
 #else
-#  define deprecated
+#  define drm_deprecated
 #endif
 
 /* an empty marker for things that will be deprecated in the future: */

commit 1af780cc2710ddcbee78764d856ef5d1cce3e313
Author: Rob Clark <robclark@freedesktop.org>
Date:   Thu Jul 21 10:54:49 2016 -0400

    freedreno: fix distcheck errors
    
    Signed-off-by: Rob Clark <robclark@freedesktop.org>

diff --git a/freedreno/freedreno-symbol-check b/freedreno/freedreno-symbol-check
index f517b6e..7b31a34 100755
--- a/freedreno/freedreno-symbol-check
+++ b/freedreno/freedreno-symbol-check
@@ -29,14 +29,18 @@ fd_device_fd
 fd_device_new
 fd_device_new_dup
 fd_device_ref
+fd_device_version
 fd_pipe_del
 fd_pipe_get_param
 fd_pipe_new
 fd_pipe_wait
 fd_pipe_wait_timeout
+fd_ringbuffer_cmd_count
 fd_ringbuffer_del
 fd_ringbuffer_emit_reloc_ring
+fd_ringbuffer_emit_reloc_ring_full
 fd_ringbuffer_flush
+fd_ringbuffer_grow
 fd_ringbuffer_new
 fd_ringbuffer_reloc
 fd_ringbuffer_reset

commit b59ed1881890de75fd13eb7056396bc7848760bc
Author: Rob Clark <robclark@freedesktop.org>
Date:   Wed Jul 20 13:11:58 2016 -0400

    freedreno: move legacy kgsl related README
    
    Signed-off-by: Rob Clark <robclark@freedesktop.org>

diff --git a/freedreno/README b/freedreno/README
deleted file mode 100644
index ae22e01..0000000
--- a/freedreno/README
+++ /dev/null
@@ -1,16 +0,0 @@
-Note that current msm kernel driver is a bit strange.  It provides a
-DRM interface for GEM, which is basically sufficient to have DRI2
-working.  But it does not provide KMS.  And interface to 2d and 3d
-cores is via different other devices (/dev/kgsl-*).  This is not
-quite how I'd write a DRM driver, but at this stage it is useful for
-xf86-video-freedreno and fdre (and eventual gallium driver) to be
-able to work on existing kernel driver from QCOM, to allow to
-capture cmdstream dumps from the binary blob drivers without having
-to reboot.  So libdrm_freedreno attempts to hide most of the crazy.
-The intention is that when there is a proper kernel driver, it will
-be mostly just changes in libdrm_freedreno to adapt the gallium
-driver and xf86-video-freedreno (ignoring the fbdev->KMS changes).
-
-So don't look at freedreno as an example of how to write a libdrm
-module or a DRM driver.. it is just an attempt to paper over a non-
-standard kernel driver architecture.
diff --git a/freedreno/kgsl/README b/freedreno/kgsl/README
new file mode 100644
index 0000000..56874b4
--- /dev/null
+++ b/freedreno/kgsl/README
@@ -0,0 +1,26 @@
+This is a historical discription of what is now the kgsl backend
+in libdrm freedreno (before the upstream drm/msm driver).  Note
+that the kgsl backend requires the "kgsl-drm" shim driver, which
+usually is in disrepair (QCOM does not build it for android), and
+due to random differences between different downstream android
+kernel branches it may or may not work.  So YMMV.
+
+Original README:
+----------------
+
+Note that current msm kernel driver is a bit strange.  It provides a
+DRM interface for GEM, which is basically sufficient to have DRI2
+working.  But it does not provide KMS.  And interface to 2d and 3d
+cores is via different other devices (/dev/kgsl-*).  This is not
+quite how I'd write a DRM driver, but at this stage it is useful for
+xf86-video-freedreno and fdre (and eventual gallium driver) to be
+able to work on existing kernel driver from QCOM, to allow to
+capture cmdstream dumps from the binary blob drivers without having
+to reboot.  So libdrm_freedreno attempts to hide most of the crazy.
+The intention is that when there is a proper kernel driver, it will
+be mostly just changes in libdrm_freedreno to adapt the gallium
+driver and xf86-video-freedreno (ignoring the fbdev->KMS changes).
+
+So don't look at freedreno as an example of how to write a libdrm
+module or a DRM driver.. it is just an attempt to paper over a non-
+standard kernel driver architecture.

commit 6a23bd4b3c52fcd7529062b31c36dd03ae0cdd75
Author: Rob Clark <robclark@freedesktop.org>
Date:   Tue Jun 28 13:33:07 2016 -0400

    freedreno/msm: use hashtable to track bo idx
    
    Note: cache the last ring the bo was emitted on, to avoid excess
    hashtable lookups.  We do this by tracking ring seqno to avoid
    problems with dangling pointers.
    
    Signed-off-by: Rob Clark <robclark@freedesktop.org>

diff --git a/freedreno/msm/msm_priv.h b/freedreno/msm/msm_priv.h
index 1f44398..6d670aa 100644
--- a/freedreno/msm/msm_priv.h
+++ b/freedreno/msm/msm_priv.h
@@ -40,6 +40,7 @@
 struct msm_device {
 	struct fd_device base;
 	struct fd_bo_cache ring_cache;
+	unsigned ring_cnt;
 };
 
 static inline struct msm_device * to_msm_device(struct fd_device *x)
@@ -72,18 +73,11 @@ struct msm_bo {
 	struct fd_bo base;
 	uint64_t offset;
 	uint64_t presumed;
-	/* in the common case, a bo won't be referenced by more than a single
-	 * (parent) ring[*].  So to avoid looping over all the bo's in the
-	 * reloc table to find the idx of a bo that might already be in the
-	 * table, we cache the idx in the bo.  But in order to detect the
-	 * slow-path where bo is ref'd in multiple rb's, we also must track
-	 * the current_ring for which the idx is valid.  See bo2idx().
-	 *
-	 * [*] in case multiple ringbuffers, ie. one toplevel and other rb(s)
-	 *     used for IB target(s), the toplevel rb is the parent which is
-	 *     tracking bo's for the submit
+	/* to avoid excess hashtable lookups, cache the ring this bo was
+	 * last emitted on (since that will probably also be the next ring
+	 * it is emitted on)
 	 */
-	struct fd_ringbuffer *current_ring;
+	unsigned current_ring_seqno;
 	uint32_t idx;
 };
 
diff --git a/freedreno/msm/msm_ringbuffer.c b/freedreno/msm/msm_ringbuffer.c
index 86fc83e..fbfaefa 100644
--- a/freedreno/msm/msm_ringbuffer.c
+++ b/freedreno/msm/msm_ringbuffer.c
@@ -92,6 +92,11 @@ struct msm_ringbuffer {
 
 	int is_growable;
 	unsigned cmd_count;
+
+	unsigned seqno;
+
+	/* maps fd_bo to idx: */
+	void *bo_table;
 };
 
 static inline struct msm_ringbuffer * to_msm_ringbuffer(struct fd_ringbuffer *x)
@@ -217,21 +222,24 @@ static uint32_t bo2idx(struct fd_ringbuffer *ring, struct fd_bo *bo, uint32_t fl
 	struct msm_bo *msm_bo = to_msm_bo(bo);
 	uint32_t idx;
 	pthread_mutex_lock(&idx_lock);
-	if (!msm_bo->current_ring) {
-		idx = append_bo(ring, bo);
-		msm_bo->current_ring = ring;
-		msm_bo->idx = idx;
-	} else if (msm_bo->current_ring == ring) {
+	if (msm_bo->current_ring_seqno == msm_ring->seqno) {
 		idx = msm_bo->idx;
 	} else {
-		/* slow-path: */
-		for (idx = 0; idx < msm_ring->nr_bos; idx++)
-			if (msm_ring->bos[idx] == bo)
-				break;
-		if (idx == msm_ring->nr_bos) {
-			/* not found */
+		void *val;
+
+		if (!msm_ring->bo_table)
+			msm_ring->bo_table = drmHashCreate();
+
+		if (!drmHashLookup(msm_ring->bo_table, bo->handle, &val)) {
+			/* found */
+			idx = (uint32_t)val;
+		} else {
 			idx = append_bo(ring, bo);
+			val = (void *)idx;
+			drmHashInsert(msm_ring->bo_table, bo->handle, val);
 		}
+		msm_bo->current_ring_seqno = msm_ring->seqno;
+		msm_bo->idx = idx;
 	}
 	pthread_mutex_unlock(&idx_lock);
 	if (flags & FD_RELOC_READ)
@@ -318,7 +326,7 @@ static void flush_reset(struct fd_ringbuffer *ring)
 
 	for (i = 0; i < msm_ring->nr_bos; i++) {
 		struct msm_bo *msm_bo = to_msm_bo(msm_ring->bos[i]);
-		msm_bo->current_ring = NULL;
+		msm_bo->current_ring_seqno = 0;
 		fd_bo_del(&msm_bo->base);
 	}
 
@@ -333,6 +341,11 @@ static void flush_reset(struct fd_ringbuffer *ring)
 	msm_ring->nr_cmds = 0;
 	msm_ring->nr_bos = 0;
 
+	if (msm_ring->bo_table) {
+		drmHashDestroy(msm_ring->bo_table);
+		msm_ring->bo_table = NULL;
+	}
+
 	if (msm_ring->is_growable) {
 		delete_cmds(msm_ring);
 	} else {
@@ -551,6 +564,7 @@ drm_private struct fd_ringbuffer * msm_ringbuffer_new(struct fd_pipe *pipe,
 	}
 
 	list_inithead(&msm_ring->cmd_list);
+	msm_ring->seqno = ++to_msm_device(pipe->dev)->ring_cnt;
 
 	ring = &msm_ring->base;
 	ring->funcs = &funcs;

commit 419a154dbef839b920689bea72aa9af41b2b114f
Author: Rob Clark <robclark@freedesktop.org>
Date:   Mon Jun 20 14:06:24 2016 -0400

    freedreno: support growable cmdstream buffers
    
    The issue that userspace needed to solve is that there is ~two orders of
    magnitude size difference in cmdstream buffers (both for gmem commands
    and for draw commands), and that the previous practice of allocating
    worst-case sizes is quite wasteful.  Previously a submit would be
    constructed (for example) like:
    
      CMD  TARGET  DESCRIPTION
       g0    N     gmem/tiling commands
       b0    Y     binning commands
       d0    Y     draw commands
    
    Which, after the one non-IB-target cmd buffer is inserted into the
    kernel controlled ringbuffer, looks like (not to scale):
    
             b0:           d0:
            +-----+       +-----+
       IB1  | ... |       | ... |
            +-----+       +-----+
             ^             ^
             |             |
             +-----+       +-+---------+
             g0:   |         |         |
            +----+----+----+----+----+----+----
       IB0  | .. | IB | .. | IB | .. | IB | ...
            +----+----+----+----+----+----+----
             ^              tile0     tile1
             |
             +-----------+
      userspace          |
      ~~~~~~~~~~~~~~~~~~~|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      kernel             |
                   ----+----+----
       ringbuffer  ... | IB | ...
                   ----+----+----
    
    Now, multiple physical cmdstream buffers per fd_ringbuffer are supported,
    so this becomes:
    
      CMD  TARGET  DESCRIPTION
       g0    N
       ...   N     gmem/tiling commands
       gN    N
       b0    Y
       ...   Y     binning commands
       bN    Y
       d0    Y
       ...   Y     draw commands
       dN    Y
    
    Which, after the non-IB-target cmd buffers (g0..gN) are inserted into
    the kernel controlled ringbuffer, looks like:
    
                 b0:      b1            d0:      d1
                +-----+  +-----+        +-----+  +-----+
           IB1  | ... |  | ... | ...    | ... |  | ... | ...
                +-----+  +-----+        +-----+  +-----+
                 ^        ^              ^        ^
                 |        |              |        |
                 |        +-+            |  +-----+------+
                 +-----+    |            |  |            |
                       |    |         +--+----------+    |
                 g0:   |    |         |     |       |    |
                +----+----+----+----+----+----+---+----+----+----
           IB0  | .. | IB | IB | .. | IB | IB |.. | IB | IB |...
                +----+----+----+----+----+----+---+----+----+----
                 ^                   tile0         tile1
                 | to b0  to b1
                 |   |      |          to|d0    to|d1
                 |   |      +----+       |      +-+-----------+
                 |   |           |       |      |             |
                 |   +------+    |       +-+-------------+    |
                 |    g1:   |    |         |    |        |    |
                 |   +----+----+----+----+----+----+---+----+----+----
           IB0   |   | .. | IB | IB | .. | IB | IB |.. | IB | IB |...
                 |   +----+----+----+----+----+----+---+----+----+----
                 |    ^                   tileX         tileY
                 |    |
                 |    +-----------+
                 +-----------+    |
          userspace          |    |
          ~~~~~~~~~~~~~~~~~~~|~~~~|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          kernel             |    |
                       ----+----+----+----
           ringbuffer  ... | IB | IB | ...
                       ----+----+----+----
    
    Signed-off-by: Rob Clark <robclark@freedesktop.org>

diff --git a/freedreno/freedreno_priv.h b/freedreno/freedreno_priv.h
index 9737b32..cdfdbe8 100644
--- a/freedreno/freedreno_priv.h
+++ b/freedreno/freedreno_priv.h
@@ -134,12 +134,14 @@ struct fd_ringmarker {
 struct fd_ringbuffer_funcs {
 	void * (*hostptr)(struct fd_ringbuffer *ring);
 	int (*flush)(struct fd_ringbuffer *ring, uint32_t *last_start);
+	void (*grow)(struct fd_ringbuffer *ring, uint32_t size);
 	void (*reset)(struct fd_ringbuffer *ring);
 	void (*emit_reloc)(struct fd_ringbuffer *ring,
 			const struct fd_reloc *reloc);
-	void (*emit_reloc_ring)(struct fd_ringbuffer *ring,
-			struct fd_ringbuffer *target,
+	uint32_t (*emit_reloc_ring)(struct fd_ringbuffer *ring,
+			struct fd_ringbuffer *target, uint32_t cmd_idx,
 			uint32_t submit_offset, uint32_t size);
+	uint32_t (*cmd_count)(struct fd_ringbuffer *ring);
 	void (*destroy)(struct fd_ringbuffer *ring);
 };
 
diff --git a/freedreno/freedreno_ringbuffer.c b/freedreno/freedreno_ringbuffer.c
index 34a06d8..22dafb3 100644
--- a/freedreno/freedreno_ringbuffer.c
+++ b/freedreno/freedreno_ringbuffer.c
@@ -45,10 +45,9 @@ fd_ringbuffer_new(struct fd_pipe *pipe, uint32_t size)
 	if (!ring)
 		return NULL;
 
-	ring->size = size;
 	ring->pipe = pipe;
 	ring->start = ring->funcs->hostptr(ring);
-	ring->end = &(ring->start[size/4]);
+	ring->end = &(ring->start[ring->size/4]);
 
 	ring->cur = ring->last_start = ring->start;
 
@@ -87,6 +86,22 @@ int fd_ringbuffer_flush(struct fd_ringbuffer *ring)
 	return ring->funcs->flush(ring, ring->last_start);
 }
 
+void fd_ringbuffer_grow(struct fd_ringbuffer *ring, uint32_t ndwords)


Reply to: