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

libdrm: Changes to 'upstream-unstable'



 Makefile.am                      |    1 
 README                           |    2 -
 configure.ac                     |    2 -
 etnaviv/etnaviv-symbol-check     |    3 ++
 etnaviv/etnaviv_bo.c             |    2 -
 etnaviv/etnaviv_device.c         |   23 +++++++++++++++++
 etnaviv/etnaviv_drmif.h          |    3 ++
 etnaviv/etnaviv_pipe.c           |    9 +++++-
 etnaviv/etnaviv_priv.h           |    8 +++---
 freedreno/freedreno-symbol-check |    1 
 freedreno/freedreno_pipe.c       |    4 +++
 freedreno/freedreno_priv.h       |    1 
 freedreno/freedreno_ringbuffer.c |    9 ++++++
 freedreno/freedreno_ringbuffer.h |    6 +++-
 freedreno/kgsl/kgsl_pipe.c       |    5 +++
 freedreno/msm/msm_ringbuffer.c   |   27 ++++++++++++++++++--
 include/drm/README               |    2 -
 include/drm/vc4_drm.h            |    2 +
 intel/intel-symbol-check         |    1 
 intel/intel_bufmgr.h             |    2 +
 intel/intel_bufmgr_fake.c        |    4 +--
 intel/intel_bufmgr_gem.c         |   17 ++++++++++---
 intel/intel_chipset.h            |   13 +++++++--
 radeon/radeon_cs_gem.c           |   10 +++----
 radeon/radeon_surface.c          |    2 -
 tests/kms/kms-universal-planes.c |    2 -
 xf86drm.c                        |   51 +++++++++++++++++++++++++++++++++++++++
 xf86drm.h                        |    5 +++
 28 files changed, 189 insertions(+), 28 deletions(-)

New commits:
commit dae413e43866d36500538c2801cc66a5a89e426d
Author: Robert Bragg <robert.bragg@intel.com>
Date:   Tue Nov 29 10:42:38 2016 +0000

    Bump version for release

diff --git a/configure.ac b/configure.ac
index 9f25a4c..708c562 100644
--- a/configure.ac
+++ b/configure.ac
@@ -20,7 +20,7 @@
 
 AC_PREREQ([2.63])
 AC_INIT([libdrm],
-        [2.4.73],
+        [2.4.74],
         [https://bugs.freedesktop.org/enter_bug.cgi?product=DRI],
         [libdrm])
 

commit a8315834a9d975efa901ba2add7f5001d645119e
Author: Eric Anholt <eric@anholt.net>
Date:   Wed Nov 16 17:06:10 2016 -0800

    vc4: Add new GETPARAMs that have been merged to drm-next.
    
    Signed-off-by: Eric Anholt <eric@anholt.net>

diff --git a/include/drm/vc4_drm.h b/include/drm/vc4_drm.h
index 919eece..319881d 100644
--- a/include/drm/vc4_drm.h
+++ b/include/drm/vc4_drm.h
@@ -286,6 +286,8 @@ struct drm_vc4_get_hang_state {
 #define DRM_VC4_PARAM_V3D_IDENT1		1
 #define DRM_VC4_PARAM_V3D_IDENT2		2
 #define DRM_VC4_PARAM_SUPPORTS_BRANCHES		3
+#define DRM_VC4_PARAM_SUPPORTS_ETC1		4
+#define DRM_VC4_PARAM_SUPPORTS_THREADED_FS	5
 
 struct drm_vc4_get_param {
 	__u32 param;

commit 23d10b82440f59f2a685db34d3662d75f4a3784b
Author: Rob Clark <robclark@freedesktop.org>
Date:   Wed Nov 9 09:02:09 2016 -0500

    freedreno: 64bit support
    
    a5xx and later are 64bit devices.. make reloc's handle that.  A new
    public symbol is introduced to avoid silent problems with new mesa and
    old libdrm (since on 64b reloc consumes two dwords).
    
    Signed-off-by: Rob Clark <robclark@freedesktop.org>

diff --git a/freedreno/freedreno-symbol-check b/freedreno/freedreno-symbol-check
index ad367fc..42f2c43 100755
--- a/freedreno/freedreno-symbol-check
+++ b/freedreno/freedreno-symbol-check
@@ -43,6 +43,7 @@ fd_ringbuffer_flush
 fd_ringbuffer_grow
 fd_ringbuffer_new
 fd_ringbuffer_reloc
+fd_ringbuffer_reloc2
 fd_ringbuffer_reset
 fd_ringbuffer_set_parent
 fd_ringbuffer_timestamp
diff --git a/freedreno/freedreno_pipe.c b/freedreno/freedreno_pipe.c
index 4a756d7..3f8c834 100644
--- a/freedreno/freedreno_pipe.c
+++ b/freedreno/freedreno_pipe.c
@@ -37,6 +37,7 @@ struct fd_pipe *
 fd_pipe_new(struct fd_device *dev, enum fd_pipe_id id)
 {
 	struct fd_pipe *pipe = NULL;
+	uint64_t val;
 
 	if (id > FD_PIPE_MAX) {
 		ERROR_MSG("invalid pipe id: %d", id);
@@ -52,6 +53,9 @@ fd_pipe_new(struct fd_device *dev, enum fd_pipe_id id)
 	pipe->dev = dev;
 	pipe->id = id;
 
+	fd_pipe_get_param(pipe, FD_GPU_ID, &val);
+	pipe->gpu_id = val;
+
 	return pipe;
 fail:
 	if (pipe)
diff --git a/freedreno/freedreno_priv.h b/freedreno/freedreno_priv.h
index 86da83b..3217039 100644
--- a/freedreno/freedreno_priv.h
+++ b/freedreno/freedreno_priv.h
@@ -123,6 +123,7 @@ struct fd_pipe_funcs {
 struct fd_pipe {
 	struct fd_device *dev;
 	enum fd_pipe_id id;
+	uint32_t gpu_id;
 	const struct fd_pipe_funcs *funcs;
 };
 
diff --git a/freedreno/freedreno_ringbuffer.c b/freedreno/freedreno_ringbuffer.c
index c132145..7310f1f 100644
--- a/freedreno/freedreno_ringbuffer.c
+++ b/freedreno/freedreno_ringbuffer.c
@@ -115,6 +115,13 @@ uint32_t fd_ringbuffer_timestamp(struct fd_ringbuffer *ring)
 void fd_ringbuffer_reloc(struct fd_ringbuffer *ring,
 				    const struct fd_reloc *reloc)
 {
+	assert(ring->pipe->gpu_id < 500);
+	ring->funcs->emit_reloc(ring, reloc);
+}
+
+void fd_ringbuffer_reloc2(struct fd_ringbuffer *ring,
+				     const struct fd_reloc *reloc)
+{
 	ring->funcs->emit_reloc(ring, reloc);
 }
 
@@ -123,6 +130,8 @@ void fd_ringbuffer_emit_reloc_ring(struct fd_ringbuffer *ring,
 {
 	uint32_t submit_offset, size;
 
+	/* This function is deprecated and not supported on 64b devices: */
+	assert(ring->pipe->gpu_id < 500);
 	assert(target->ring == end->ring);
 
 	submit_offset = offset_bytes(target->cur, target->ring->start);
diff --git a/freedreno/freedreno_ringbuffer.h b/freedreno/freedreno_ringbuffer.h
index 108d5a6..c501fba 100644
--- a/freedreno/freedreno_ringbuffer.h
+++ b/freedreno/freedreno_ringbuffer.h
@@ -78,9 +78,13 @@ struct fd_reloc {
 	uint32_t offset;
 	uint32_t or;
 	int32_t  shift;
+	uint32_t orhi;      /* used for a5xx+ */
 };
 
-void fd_ringbuffer_reloc(struct fd_ringbuffer *ring, const struct fd_reloc *reloc);
+/* NOTE: relocs are 2 dwords on a5xx+ */
+
+void fd_ringbuffer_reloc2(struct fd_ringbuffer *ring, const struct fd_reloc *reloc);
+will_be_deprecated void fd_ringbuffer_reloc(struct fd_ringbuffer *ring, const struct fd_reloc *reloc);
 will_be_deprecated void fd_ringbuffer_emit_reloc_ring(struct fd_ringbuffer *ring,
 		struct fd_ringmarker *target, struct fd_ringmarker *end);
 uint32_t fd_ringbuffer_cmd_count(struct fd_ringbuffer *ring);
diff --git a/freedreno/kgsl/kgsl_pipe.c b/freedreno/kgsl/kgsl_pipe.c
index 3546718..8a39eb4 100644
--- a/freedreno/kgsl/kgsl_pipe.c
+++ b/freedreno/kgsl/kgsl_pipe.c
@@ -255,6 +255,11 @@ drm_private struct fd_pipe * kgsl_pipe_new(struct fd_device *dev,
 	GETPROP(fd, VERSION,     kgsl_pipe->version);
 	GETPROP(fd, DEVICE_INFO, kgsl_pipe->devinfo);
 
+	if (kgsl_pipe->devinfo.gpu_id >= 500) {
+		ERROR_MSG("64b unsupported with kgsl");
+		goto fail;
+	}
+
 	INFO_MSG("Pipe Info:");
 	INFO_MSG(" Device:          %s", paths[id]);
 	INFO_MSG(" Chip-id:         %d.%d.%d.%d",
diff --git a/freedreno/msm/msm_ringbuffer.c b/freedreno/msm/msm_ringbuffer.c
index 5117df1..17194f4 100644
--- a/freedreno/msm/msm_ringbuffer.c
+++ b/freedreno/msm/msm_ringbuffer.c
@@ -487,11 +487,32 @@ static void msm_ringbuffer_emit_reloc(struct fd_ringbuffer *ring,
 	reloc->submit_offset = offset_bytes(ring->cur, ring->start);
 
 	addr = msm_bo->presumed;
-	if (r->shift < 0)
-		addr >>= -r->shift;
+	if (reloc->shift < 0)
+		addr >>= -reloc->shift;
 	else
-		addr <<= r->shift;
+		addr <<= reloc->shift;
 	(*ring->cur++) = addr | r->or;
+
+	if (ring->pipe->gpu_id >= 500) {
+		struct drm_msm_gem_submit_reloc *reloc_hi;
+
+		idx = APPEND(cmd, relocs);
+
+		reloc_hi = &cmd->relocs[idx];
+
+		reloc_hi->reloc_idx = reloc->reloc_idx;
+		reloc_hi->reloc_offset = r->offset;
+		reloc_hi->or = r->orhi;
+		reloc_hi->shift = r->shift - 32;
+		reloc_hi->submit_offset = offset_bytes(ring->cur, ring->start);
+
+		addr = msm_bo->presumed >> 32;
+		if (reloc_hi->shift < 0)
+			addr >>= -reloc_hi->shift;
+		else
+			addr <<= reloc_hi->shift;
+		(*ring->cur++) = addr | r->orhi;
+	}
 }
 
 static uint32_t msm_ringbuffer_emit_reloc_ring(struct fd_ringbuffer *ring,

commit d15515aea3c3e51336f9ab29691162c69acc9807
Author: Christian Gmeiner <christian.gmeiner@gmail.com>
Date:   Wed Nov 23 22:09:11 2016 +0100

    etnaviv: add etna_pipe_wait_ns(..)
    
    We need to pass through a timeout parameter to implement
    pipe->fence_finish() properly. The new fxn accepts a timeout
    in nanoseconds. Simplify etna_pipe_wait(..) by using
    etna_pipe_wait_ns(..).
    
    Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
    Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>

diff --git a/etnaviv/etnaviv-symbol-check b/etnaviv/etnaviv-symbol-check
index 72f2bc5..22afd16 100755
--- a/etnaviv/etnaviv-symbol-check
+++ b/etnaviv/etnaviv-symbol-check
@@ -21,6 +21,7 @@ etna_gpu_get_param
 etna_pipe_new
 etna_pipe_del
 etna_pipe_wait
+etna_pipe_wait_ns
 etna_bo_new
 etna_bo_from_handle
 etna_bo_from_name
diff --git a/etnaviv/etnaviv_drmif.h b/etnaviv/etnaviv_drmif.h
index fe9d5db..8119baa 100644
--- a/etnaviv/etnaviv_drmif.h
+++ b/etnaviv/etnaviv_drmif.h
@@ -104,6 +104,7 @@ int etna_gpu_get_param(struct etna_gpu *gpu, enum etna_param_id param,
 struct etna_pipe *etna_pipe_new(struct etna_gpu *gpu, enum etna_pipe_id id);
 void etna_pipe_del(struct etna_pipe *pipe);
 int etna_pipe_wait(struct etna_pipe *pipe, uint32_t timestamp, uint32_t ms);
+int etna_pipe_wait_ns(struct etna_pipe *pipe, uint32_t timestamp, uint64_t ns);
 
 
 /* buffer-object functions:
diff --git a/etnaviv/etnaviv_pipe.c b/etnaviv/etnaviv_pipe.c
index 1157fa6..94c5d37 100644
--- a/etnaviv/etnaviv_pipe.c
+++ b/etnaviv/etnaviv_pipe.c
@@ -32,6 +32,11 @@
 
 int etna_pipe_wait(struct etna_pipe *pipe, uint32_t timestamp, uint32_t ms)
 {
+	return etna_pipe_wait_ns(pipe, timestamp, ms * 1000000);
+}
+
+int etna_pipe_wait_ns(struct etna_pipe *pipe, uint32_t timestamp, uint64_t ns)
+{
 	struct etna_device *dev = pipe->gpu->dev;
 	int ret;
 
@@ -40,10 +45,10 @@ int etna_pipe_wait(struct etna_pipe *pipe, uint32_t timestamp, uint32_t ms)
 		.fence = timestamp,
 	};
 
-	if (ms == 0)
+	if (ns == 0)
 		req.flags |= ETNA_WAIT_NONBLOCK;
 
-	get_abs_timeout(&req.timeout, ms * 1000000);
+	get_abs_timeout(&req.timeout, ns);
 
 	ret = drmCommandWrite(dev->fd, DRM_ETNAVIV_WAIT_FENCE, &req, sizeof(req));
 	if (ret) {

commit 4f750ec756e66e1012b312dbc7f2d11fc9848ce2
Author: Christian Gmeiner <christian.gmeiner@gmail.com>
Date:   Wed Nov 23 22:02:25 2016 +0100

    etnaviv: change get_abs_timeout(..) to use ns.
    
    Also update all callers.
    
    Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
    Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>

diff --git a/etnaviv/etnaviv_bo.c b/etnaviv/etnaviv_bo.c
index 833f8bd..4ad0434 100644
--- a/etnaviv/etnaviv_bo.c
+++ b/etnaviv/etnaviv_bo.c
@@ -330,7 +330,7 @@ int etna_bo_cpu_prep(struct etna_bo *bo, uint32_t op)
 		.op = op,
 	};
 
-	get_abs_timeout(&req.timeout, 5000);
+	get_abs_timeout(&req.timeout, 5000000000);
 
 	return drmCommandWrite(bo->dev->fd, DRM_ETNAVIV_GEM_CPU_PREP,
 			&req, sizeof(req));
diff --git a/etnaviv/etnaviv_pipe.c b/etnaviv/etnaviv_pipe.c
index 402b71d..1157fa6 100644
--- a/etnaviv/etnaviv_pipe.c
+++ b/etnaviv/etnaviv_pipe.c
@@ -43,7 +43,7 @@ int etna_pipe_wait(struct etna_pipe *pipe, uint32_t timestamp, uint32_t ms)
 	if (ms == 0)
 		req.flags |= ETNA_WAIT_NONBLOCK;
 
-	get_abs_timeout(&req.timeout, ms);
+	get_abs_timeout(&req.timeout, ms * 1000000);
 
 	ret = drmCommandWrite(dev->fd, DRM_ETNAVIV_WAIT_FENCE, &req, sizeof(req));
 	if (ret) {
diff --git a/etnaviv/etnaviv_priv.h b/etnaviv/etnaviv_priv.h
index eb62ed3..feaa5ad 100644
--- a/etnaviv/etnaviv_priv.h
+++ b/etnaviv/etnaviv_priv.h
@@ -189,13 +189,13 @@ struct etna_cmd_stream_priv {
 
 #define VOID2U64(x) ((uint64_t)(unsigned long)(x))
 
-static inline void get_abs_timeout(struct drm_etnaviv_timespec *tv, uint32_t ms)
+static inline void get_abs_timeout(struct drm_etnaviv_timespec *tv, uint64_t ns)
 {
 	struct timespec t;
-	uint32_t s = ms / 1000;
+	uint32_t s = ns / 1000000000;
 	clock_gettime(CLOCK_MONOTONIC, &t);
 	tv->tv_sec = t.tv_sec + s;
-	tv->tv_nsec = t.tv_nsec + ((ms - (s * 1000)) * 1000000);
+	tv->tv_nsec = t.tv_nsec + ns - (s * 1000000000);
 }
 
 #endif /* ETNAVIV_PRIV_H_ */

commit 1924b6704aa34bb3dd044b8e1e29558c521c6902
Author: Grazvydas Ignotas <notasas@gmail.com>
Date:   Sun Nov 20 20:25:46 2016 +0200

    libdrm: random typo fixes
    
    Just some trivial boring typo fixes all over the tree.
    READMEs and comments only.
    
    Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
    Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
    Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>

diff --git a/README b/README
index 603a1c1..7eeae38 100644
--- a/README
+++ b/README
@@ -1,7 +1,7 @@
 libdrm - userspace library for drm
 
 This  is libdrm,  a userspace  library for  accessing the  DRM, direct
-rendering  manager, on  Linux,  BSD and  other  operating systes  that
+rendering  manager, on  Linux,  BSD and  other  operating systems that
 support the  ioctl interface.  The library  provides wrapper functions
 for the  ioctls to avoid  exposing the kernel interface  directly, and
 for chipsets with drm memory manager, support for tracking relocations
diff --git a/include/drm/README b/include/drm/README
index c3292f3..a50b02c 100644
--- a/include/drm/README
+++ b/include/drm/README
@@ -89,7 +89,7 @@ Nearly all headers:
 Status: Trivial.
 
 Most UMS headers:
- - Not using fixed size interers - compat ioctls are broken.
+ - Not using fixed size integers - compat ioctls are broken.
 Status: ?
 Promote to fixed size ints, which match the current (32bit) ones.
 
diff --git a/intel/intel_bufmgr_fake.c b/intel/intel_bufmgr_fake.c
index 24b3732..641df6a 100644
--- a/intel/intel_bufmgr_fake.c
+++ b/intel/intel_bufmgr_fake.c
@@ -737,7 +737,7 @@ drm_intel_bufmgr_fake_wait_idle(drm_intel_bufmgr_fake *bufmgr_fake)
 /**
  * Wait for rendering to a buffer to complete.
  *
- * It is assumed that the bathcbuffer which performed the rendering included
+ * It is assumed that the batchbuffer which performed the rendering included
  * the necessary flushing.
  */
 static void
@@ -1200,7 +1200,7 @@ static int
 		assert(!(bo_fake->flags & (BM_NO_BACKING_STORE | BM_PINNED)));
 
 		/* Actually, should be able to just wait for a fence on the
-		 * mmory, hich we would be tracking when we free it.  Waiting
+		 * memory, which we would be tracking when we free it. Waiting
 		 * for idle is a sufficiently large hammer for now.
 		 */
 		drm_intel_bufmgr_fake_wait_idle(bufmgr_fake);
diff --git a/intel/intel_bufmgr_gem.c b/intel/intel_bufmgr_gem.c
index 5fc022a..75949b9 100644
--- a/intel/intel_bufmgr_gem.c
+++ b/intel/intel_bufmgr_gem.c
@@ -256,7 +256,7 @@ struct _drm_intel_bo_gem {
 	 * 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
+	 * buffers are those that have been shared with other
 	 * processes, so we don't know their state.
 	 */
 	bool idle;
@@ -294,7 +294,7 @@ struct _drm_intel_bo_gem {
 	 */
 	int reloc_tree_fences;
 
-	/** Flags that we may need to do the SW_FINSIH ioctl on unmap. */
+	/** Flags that we may need to do the SW_FINISH ioctl on unmap. */
 	bool mapped_cpu_write;
 };
 
@@ -1719,7 +1719,7 @@ static int drm_intel_gem_bo_unmap(drm_intel_bo *bo)
 	}
 
 	/* We need to unmap after every innovation as we cannot track
-	 * an open vma for every bo as that will exhaasut the system
+	 * an open vma for every bo as that will exhaust the system
 	 * limits and cause later failures.
 	 */
 	if (--bo_gem->map_count == 0) {
diff --git a/radeon/radeon_cs_gem.c b/radeon/radeon_cs_gem.c
index 23f33af..f3dccb6 100644
--- a/radeon/radeon_cs_gem.c
+++ b/radeon/radeon_cs_gem.c
@@ -189,7 +189,7 @@ static int cs_gem_write_reloc(struct radeon_cs_int *cs,
     /* check domains */
     if ((read_domain && write_domain) || (!read_domain && !write_domain)) {
         /* in one CS a bo can only be in read or write domain but not
-         * in read & write domain at the same sime
+         * in read & write domain at the same time
          */
         return -EINVAL;
     }
@@ -242,7 +242,7 @@ static int cs_gem_write_reloc(struct radeon_cs_int *cs,
     }
     /* new relocation */
     if (csg->base.crelocs >= csg->nrelocs) {
-        /* allocate more memory (TODO: should use a slab allocatore maybe) */
+        /* allocate more memory (TODO: should use a slab allocator maybe) */
         uint32_t *tmp, size;
         size = ((csg->nrelocs + 1) * sizeof(struct radeon_bo*));
         tmp = (uint32_t*)realloc(csg->relocs_bo, size);
@@ -268,7 +268,7 @@ static int cs_gem_write_reloc(struct radeon_cs_int *cs,
     reloc->flags = flags;
     csg->chunks[1].length_dw += RELOC_SIZE;
     radeon_bo_ref(bo);
-    /* bo might be referenced from another context so have to use atomic opertions */
+    /* bo might be referenced from another context so have to use atomic operations */
     atomic_add((atomic_t *)radeon_gem_get_reloc_in_cs(bo), cs->id);
     cs->relocs_total_size += boi->size;
     radeon_cs_write_dword((struct radeon_cs *)cs, 0xc0001000);
@@ -449,7 +449,7 @@ static int cs_gem_emit(struct radeon_cs_int *cs)
                             &csg->cs, sizeof(struct drm_radeon_cs));
     for (i = 0; i < csg->base.crelocs; i++) {
         csg->relocs_bo[i]->space_accounted = 0;
-        /* bo might be referenced from another context so have to use atomic opertions */
+        /* bo might be referenced from another context so have to use atomic operations */
         atomic_dec((atomic_t *)radeon_gem_get_reloc_in_cs((struct radeon_bo*)csg->relocs_bo[i]), cs->id);
         radeon_bo_unref((struct radeon_bo *)csg->relocs_bo[i]);
         csg->relocs_bo[i] = NULL;
@@ -481,7 +481,7 @@ static int cs_gem_erase(struct radeon_cs_int *cs)
     if (csg->relocs_bo) {
         for (i = 0; i < csg->base.crelocs; i++) {
             if (csg->relocs_bo[i]) {
-                /* bo might be referenced from another context so have to use atomic opertions */
+                /* bo might be referenced from another context so have to use atomic operations */
                 atomic_dec((atomic_t *)radeon_gem_get_reloc_in_cs((struct radeon_bo*)csg->relocs_bo[i]), cs->id);
                 radeon_bo_unref((struct radeon_bo *)csg->relocs_bo[i]);
                 csg->relocs_bo[i] = NULL;
diff --git a/radeon/radeon_surface.c b/radeon/radeon_surface.c
index 16a8b00..965be24 100644
--- a/radeon/radeon_surface.c
+++ b/radeon/radeon_surface.c
@@ -981,7 +981,7 @@ static int eg_surface_best(struct radeon_surface_manager *surf_man,
     /* bankw or bankh greater than 1 increase alignment requirement, not
      * sure if it's worth using smaller bankw & bankh to stick with 2D
      * tiling on small surface rather than falling back to 1D tiling.
-     * Use recommanded value based on tile size for now.
+     * Use recommended value based on tile size for now.
      *
      * fmask buffer has different optimal value figure them out once we
      * use it.

commit 1fc32f1cc5046fe76f2d5094fc576e097ea031e7
Author: Grazvydas Ignotas <notasas@gmail.com>
Date:   Sun Nov 20 20:25:47 2016 +0200

    tests: kms: fix shadowed declaration warning
    
    There is no need to maintain the value in the shadowed variable from
    what I can see.
    
    Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
    Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>

diff --git a/tests/kms/kms-universal-planes.c b/tests/kms/kms-universal-planes.c
index d8e5fc4..89057bb 100644
--- a/tests/kms/kms-universal-planes.c
+++ b/tests/kms/kms-universal-planes.c
@@ -212,9 +212,9 @@ int main(int argc, char *argv[])
 		printf("Planes: %u\n", device->num_planes);
 
 		for (i = 0; i < device->num_planes; i++) {
-			struct kms_plane *plane = device->planes[i];
 			const char *type = NULL;
 
+			plane = device->planes[i];
 			switch (plane->type) {
 			case DRM_PLANE_TYPE_OVERLAY:
 				type = "overlay";

commit 37d790f7d449874d0bf199d9ca9871d12b4d599a
Author: Emil Velikov <emil.velikov@collabora.com>
Date:   Thu Nov 10 17:26:50 2016 +0000

    xf86drm: introduce drmGetDeviceNameFromFd2
    
    The original version considered only card devices, while this will pick
    the device/node name regardless - card, control, renderD, other...
    
    Current implementation is "linux" specific, in such that it relies on
    sysfs/uevent file. At the same time this gives us the flexibility to
    support any nodes even future ones, as long as they're within DRM_MAJOR.
    
    Shamelessly copied from mesa, latter by: Gary Wong <gtw@gnu.org>
    Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
    Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>

diff --git a/xf86drm.c b/xf86drm.c
index 9b97bbb..ed924a7 100644
--- a/xf86drm.c
+++ b/xf86drm.c
@@ -3303,3 +3303,54 @@ free_locals:
     free(local_devices);
     return ret;
 }
+
+char *drmGetDeviceNameFromFd2(int fd)
+{
+#ifdef __linux__
+    struct stat sbuf;
+    char *device_name = NULL;
+    unsigned int maj, min;
+    FILE *f;
+    char buf[512];
+    static const char match[9] = "\nDEVNAME=";
+    int expected = 1;
+
+
+    if (fstat(fd, &sbuf))
+        return NULL;
+
+    maj = major(sbuf.st_rdev);
+    min = minor(sbuf.st_rdev);
+
+    if (maj != DRM_MAJOR || !S_ISCHR(sbuf.st_mode))
+        return NULL;
+
+    snprintf(buf, sizeof(buf), "/sys/dev/char/%d:%d/uevent", maj, min);
+    if (!(f = fopen(buf, "r")))
+        return NULL;
+
+    while (expected < sizeof(match)) {
+        int c = getc(f);
+
+        if (c == EOF) {
+            fclose(f);
+            return NULL;
+        } else if (c == match[expected] )
+            expected++;
+        else
+            expected = 0;
+    }
+
+    strcpy(buf, "/dev/");
+    if (fgets(buf + 5, sizeof(buf) - 5, f)) {
+        buf[strcspn(buf, "\n")] = '\0';
+        device_name = strdup(buf);
+    }
+
+    fclose(f);
+    return device_name;
+#else
+#warning "Missing implementation of drmGetDeviceNameFromFd2"
+    return NULL;
+#endif
+}
diff --git a/xf86drm.h b/xf86drm.h
index 481d882..4da6bd3 100644
--- a/xf86drm.h
+++ b/xf86drm.h
@@ -753,6 +753,11 @@ typedef struct _drmEventContext {
 extern int drmHandleEvent(int fd, drmEventContextPtr evctx);
 
 extern char *drmGetDeviceNameFromFd(int fd);
+
+/* Improved version of drmGetDeviceNameFromFd which attributes for any type of
+ * device/node - card, control or renderD.
+ */
+extern char *drmGetDeviceNameFromFd2(int fd);
 extern int drmGetNodeTypeFromFd(int fd);
 
 extern int drmPrimeHandleToFD(int fd, uint32_t handle, uint32_t flags, int *prime_fd);

commit 7e0bc3bf1c247e1d53733d0e2e2ada52d29b5327
Author: Emil Velikov <emil.l.velikov@gmail.com>
Date:   Sat Nov 12 20:45:25 2016 +0000

    automake: make the build less chatty
    
    Having the "Entering|Leaving directory X" messages it not required nor
    useful in vast majority of the cases.
    
    One can always have them printed by `make -w' or by overriding the
    AM_MAKEFLAGS variable.
    
    Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>

diff --git a/Makefile.am b/Makefile.am
index 2e46bde..dfb8fcd 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -22,6 +22,7 @@ include Makefile.sources
 
 ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
 
+AM_MAKEFLAGS = -s
 AM_DISTCHECK_CONFIGURE_FLAGS = \
 	--enable-udev \
 	--enable-libkms \

commit 911280cb4a0106b869405e36f7317957628181d5
Author: Michel Dänzer <michel.daenzer@amd.com>
Date:   Tue Nov 22 15:48:12 2016 +0900

    intel: Add drm_intel_gem_context_get_id to intel-symbols-check
    
    Fixes make check. Trivial.

diff --git a/intel/intel-symbol-check b/intel/intel-symbol-check
index 4462533..038c982 100755
--- a/intel/intel-symbol-check
+++ b/intel/intel-symbol-check
@@ -80,6 +80,7 @@ drm_intel_gem_bo_unmap_gtt
 drm_intel_gem_bo_wait
 drm_intel_gem_context_create
 drm_intel_gem_context_destroy
+drm_intel_gem_context_get_id
 drm_intel_get_aperture_sizes
 drm_intel_get_eu_total
 drm_intel_get_min_eu_in_pool

commit 770f6bc424f93ab92f2c2f651615d02240f7387a
Author: Robert Bragg <robert@sixbynine.org>
Date:   Mon Jan 26 16:11:26 2015 +0000

    intel: Add a getter for the intel_context ctx_id
    
    Exposing the u32 context ID makes it possible to define new drm kernel
    interfaces based on the same IDs that e.g. execbuf uses to identify a
    gem context, that aren't themselves abstracted by libdrm but need to be
    used by libdrm/drm_intel_context based clients such as (parts of) i-g-t
    or Mesa.
    
    For example this can be used to configure an i915-perf stream to collect
    metrics for a specific context.
    
    v2: s/drm_intel_gem_context_get_context_id/drm_intel_gem_context_get_id/
    
    Signed-off-by: Robert Bragg <robert@sixbynine.org>
    Reviewed-by: Matthew Auld <matthew.auld@intel.com>

diff --git a/intel/intel_bufmgr.h b/intel/intel_bufmgr.h
index ce4e70d..85e4ff7 100644
--- a/intel/intel_bufmgr.h
+++ b/intel/intel_bufmgr.h
@@ -212,6 +212,8 @@ int drm_intel_bufmgr_gem_get_devid(drm_intel_bufmgr *bufmgr);
 int drm_intel_gem_bo_wait(drm_intel_bo *bo, int64_t timeout_ns);
 
 drm_intel_context *drm_intel_gem_context_create(drm_intel_bufmgr *bufmgr);
+int drm_intel_gem_context_get_id(drm_intel_context *ctx,
+                                 uint32_t *ctx_id);
 void drm_intel_gem_context_destroy(drm_intel_context *ctx);
 int drm_intel_gem_bo_context_exec(drm_intel_bo *bo, drm_intel_context *ctx,
 				  int used, unsigned int flags);
diff --git a/intel/intel_bufmgr_gem.c b/intel/intel_bufmgr_gem.c
index 15c79b3..5fc022a 100644
--- a/intel/intel_bufmgr_gem.c
+++ b/intel/intel_bufmgr_gem.c
@@ -3184,6 +3184,17 @@ drm_intel_gem_context_create(drm_intel_bufmgr *bufmgr)
 	return context;
 }
 
+int
+drm_intel_gem_context_get_id(drm_intel_context *ctx, uint32_t *ctx_id)
+{
+	if (ctx == NULL)
+		return -EINVAL;
+
+	*ctx_id = ctx->ctx_id;
+
+	return 0;
+}
+
 void
 drm_intel_gem_context_destroy(drm_intel_context *ctx)
 {

commit befb6429f03072b128a55360c1cf57f7b4d47b67
Author: Christian Gmeiner <christian.gmeiner@gmail.com>
Date:   Sun Nov 13 21:29:22 2016 +0100

    etnaviv: add API to create etna_device from private dup() fd
    
    Like etna_device_new() but creates it's own private dup() of the fd
    which is close()d when the device is finalized.
    
    Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
    Acked-by: Eric Anholt <eric@anholt.net>

diff --git a/etnaviv/etnaviv-symbol-check b/etnaviv/etnaviv-symbol-check
index 378e073..72f2bc5 100755
--- a/etnaviv/etnaviv-symbol-check
+++ b/etnaviv/etnaviv-symbol-check
@@ -11,6 +11,7 @@ _end
 _fini
 _init
 etna_device_new
+etna_device_new_dup
 etna_device_ref
 etna_device_del
 etna_device_fd
diff --git a/etnaviv/etnaviv_device.c b/etnaviv/etnaviv_device.c
index b716360..3ce9203 100644
--- a/etnaviv/etnaviv_device.c
+++ b/etnaviv/etnaviv_device.c
@@ -61,6 +61,21 @@ struct etna_device *etna_device_new(int fd)
 	return dev;
 }
 
+/* like etna_device_new() but creates it's own private dup() of the fd
+ * which is close()d when the device is finalized. */
+struct etna_device *etna_device_new_dup(int fd)
+{
+	int dup_fd = dup(fd);
+	struct etna_device *dev = etna_device_new(dup_fd);
+
+	if (dev)
+		dev->closefd = 1;
+	else
+		close(dup_fd);
+
+	return dev;
+}
+
 struct etna_device *etna_device_ref(struct etna_device *dev)
 {
 	atomic_inc(&dev->refcnt);
@@ -74,6 +89,9 @@ static void etna_device_del_impl(struct etna_device *dev)
 	drmHashDestroy(dev->handle_table);
 	drmHashDestroy(dev->name_table);
 
+	if (dev->closefd)
+		close(dev->fd);
+
 	free(dev);
 }
 
diff --git a/etnaviv/etnaviv_drmif.h b/etnaviv/etnaviv_drmif.h
index 3a5cb51..fe9d5db 100644
--- a/etnaviv/etnaviv_drmif.h
+++ b/etnaviv/etnaviv_drmif.h
@@ -84,6 +84,7 @@ enum etna_param_id {
  */
 
 struct etna_device *etna_device_new(int fd);
+struct etna_device *etna_device_new_dup(int fd);
 struct etna_device *etna_device_ref(struct etna_device *dev);
 void etna_device_del(struct etna_device *dev);
 int etna_device_fd(struct etna_device *dev);
diff --git a/etnaviv/etnaviv_priv.h b/etnaviv/etnaviv_priv.h
index 6bb0c8d..eb62ed3 100644
--- a/etnaviv/etnaviv_priv.h
+++ b/etnaviv/etnaviv_priv.h
@@ -93,6 +93,8 @@ struct etna_device {
 	void *handle_table, *name_table;
 
 	struct etna_bo_cache bo_cache;
+
+	int closefd;        /* call close(fd) upon destruction */
 };
 
 drm_private void etna_bo_cache_init(struct etna_bo_cache *cache);

commit a14d6a6a43742cfad7ab346bf9168eb893881816
Author: Christian Gmeiner <christian.gmeiner@gmail.com>
Date:   Sun Nov 13 21:14:57 2016 +0100

    etnaviv: add API to get drm fd from etna_device
    
    Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
    Acked-by: Eric Anholt <eric@anholt.net>

diff --git a/etnaviv/etnaviv-symbol-check b/etnaviv/etnaviv-symbol-check
index 77c94c6..378e073 100755
--- a/etnaviv/etnaviv-symbol-check
+++ b/etnaviv/etnaviv-symbol-check
@@ -13,6 +13,7 @@ _init
 etna_device_new
 etna_device_ref
 etna_device_del
+etna_device_fd
 etna_gpu_new
 etna_gpu_del
 etna_gpu_get_param
diff --git a/etnaviv/etnaviv_device.c b/etnaviv/etnaviv_device.c
index f954ca4..b716360 100644
--- a/etnaviv/etnaviv_device.c
+++ b/etnaviv/etnaviv_device.c
@@ -94,3 +94,8 @@ void etna_device_del(struct etna_device *dev)
 	etna_device_del_impl(dev);
 	pthread_mutex_unlock(&table_lock);
 }
+
+int etna_device_fd(struct etna_device *dev)
+{
+   return dev->fd;
+}
diff --git a/etnaviv/etnaviv_drmif.h b/etnaviv/etnaviv_drmif.h
index 979b16a..3a5cb51 100644
--- a/etnaviv/etnaviv_drmif.h
+++ b/etnaviv/etnaviv_drmif.h
@@ -86,6 +86,7 @@ enum etna_param_id {
 struct etna_device *etna_device_new(int fd);
 struct etna_device *etna_device_ref(struct etna_device *dev);
 void etna_device_del(struct etna_device *dev);
+int etna_device_fd(struct etna_device *dev);
 
 /* gpu functions:
  */

commit 3e81f8b7b974c66915ea1bbc43d5c613c97e72c1
Author: Ben Widawsky <ben@bwidawsk.net>
Date:   Thu Nov 10 10:28:02 2016 -0800

    intel: Add Geminilake PCI IDs
    
    Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
    Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>

diff --git a/intel/intel_chipset.h b/intel/intel_chipset.h
index 514f659..41fc0da 100644
--- a/intel/intel_chipset.h
+++ b/intel/intel_chipset.h
@@ -218,6 +218,9 @@
 #define PCI_CHIP_BROXTON_3		0x1A85
 #define PCI_CHIP_BROXTON_4		0x5A85
 
+#define PCI_CHIP_GLK			0x3184
+#define PCI_CHIP_GLK_2X6		0x3185
+
 #define IS_MOBILE(devid)	((devid) == PCI_CHIP_I855_GM || \
 				 (devid) == PCI_CHIP_I915_GM || \
 				 (devid) == PCI_CHIP_I945_GM || \
@@ -446,9 +449,13 @@
 				 (devid) == PCI_CHIP_BROXTON_3	|| \
 				 (devid) == PCI_CHIP_BROXTON_4)
 
-#define IS_GEN9(devid)		(IS_SKYLAKE(devid) || \
-				 IS_BROXTON(devid) || \
-				 IS_KABYLAKE(devid))
+#define IS_GEMINILAKE(devid)	((devid) == PCI_CHIP_GLK || \
+				 (devid) == PCI_CHIP_GLK_2X6)
+
+#define IS_GEN9(devid)		(IS_SKYLAKE(devid)  || \
+				 IS_BROXTON(devid)  || \
+				 IS_KABYLAKE(devid) || \
+				 IS_GEMINILAKE(devid))
 
 #define IS_9XX(dev)		(IS_GEN3(dev) || \
 				 IS_GEN4(dev) || \


Reply to: