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

libdrm: Changes to 'upstream-unstable'



 configure.ac                      |    2 -
 exynos/exynos_drm.c               |   52 ++++++++------------------------------
 exynos/exynos_drmif.h             |    2 -
 exynos/exynos_fimg2d.c            |    8 ++---
 exynos/fimg2d.h                   |    2 -
 freedreno/freedreno_drmif.h       |    1 
 freedreno/kgsl/kgsl_pipe.c        |    3 ++
 freedreno/msm/msm_drm.h           |   12 ++++++++
 freedreno/msm/msm_pipe.c          |    5 +++
 freedreno/msm/msm_priv.h          |    1 
 include/drm/drm.h                 |    8 +++++
 include/drm/i915_drm.h            |   19 +++++++++++++
 radeon/radeon_surface.c           |   18 ++++++-------
 tests/exynos/Makefile.am          |    9 +++++-
 tests/exynos/exynos_fimg2d_test.c |    2 -
 tests/radeon/radeon_ttm.c         |    2 +
 xf86drm.c                         |   13 ---------
 xf86drmMode.h                     |    4 ++
 18 files changed, 89 insertions(+), 74 deletions(-)

New commits:
commit 6f15ca80815ae34d412c9fbdf526d69c45561a0f
Author: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Date:   Fri Jul 25 15:08:23 2014 +0200

    bump to version 2.4.55 for release

diff --git a/configure.ac b/configure.ac
index 1c78c45..a7be095 100644
--- a/configure.ac
+++ b/configure.ac
@@ -20,7 +20,7 @@
 
 AC_PREREQ([2.63])
 AC_INIT([libdrm],
-        [2.4.54],
+        [2.4.55],
         [https://bugs.freedesktop.org/enter_bug.cgi?product=DRI],
         [libdrm])
 

commit a328b02c1d0b2e19e3587221aa290f05e33baefe
Author: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Date:   Fri Jul 25 11:22:24 2014 +0200

    exynos: do not build fimg2d_test when building without libkms support.
    
    This prevents a build failure.
    
    Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>

diff --git a/tests/exynos/Makefile.am b/tests/exynos/Makefile.am
index 518f00b..92de4e4 100644
--- a/tests/exynos/Makefile.am
+++ b/tests/exynos/Makefile.am
@@ -4,6 +4,7 @@ AM_CFLAGS = \
 	-I $(top_srcdir)/exynos \
 	-I $(top_srcdir)
 
+if HAVE_LIBKMS
 if HAVE_INSTALL_TESTS
 bin_PROGRAMS = \
 	exynos_fimg2d_test
@@ -11,6 +12,7 @@ else
 noinst_PROGRAMS = \
 	exynos_fimg2d_test
 endif
+endif
 
 exynos_fimg2d_test_LDADD = \
 	$(top_builddir)/libdrm.la \

commit c0b34dca2632a774249cfa3b969c3f7ce9df33e1
Author: Thomas Klausner <wiz@NetBSD.org>
Date:   Tue Jul 15 19:22:55 2014 +0200

    radeon: Add missing header includes.
    
    unistd.h for close() and xf86drm.h for drmOpen().
    
    Signed-off-by: Thomas Klausner <wiz@NetBSD.org>

diff --git a/tests/radeon/radeon_ttm.c b/tests/radeon/radeon_ttm.c
index 246fd99..ac3297a 100644
--- a/tests/radeon/radeon_ttm.c
+++ b/tests/radeon/radeon_ttm.c
@@ -25,7 +25,9 @@
  */
 #include <stdio.h>
 #include <stdlib.h>
+#include <unistd.h>
 #include "rbo.h"
+#include "xf86drm.h"
 
 /* allocate as many single page bo to try to starve the kernel
  * memory zone (below highmem)

commit 72f84b85afbe762b86ea8c095fee01e7d406b131
Author: Thomas Klausner <wiz@NetBSD.org>
Date:   Tue Jul 15 19:22:52 2014 +0200

    radeon: Remove superfluous parentheses.
    
    Signed-off-by: Thomas Klausner <wiz@NetBSD.org>

diff --git a/radeon/radeon_surface.c b/radeon/radeon_surface.c
index 109bd6b..9c3a192 100644
--- a/radeon/radeon_surface.c
+++ b/radeon/radeon_surface.c
@@ -282,7 +282,7 @@ static int r6_surface_init_linear(struct radeon_surface_manager *surf_man,
         surf_minify(surf, surf->level+i, surf->bpe, i, xalign, yalign, zalign, offset);
         /* level0 and first mipmap need to have alignment */
         offset = surf->bo_size;
-        if ((i == 0)) {
+        if (i == 0) {
             offset = ALIGN(offset, surf->bo_alignment);
         }
     }
@@ -310,7 +310,7 @@ static int r6_surface_init_linear_aligned(struct radeon_surface_manager *surf_ma
         surf_minify(surf, surf->level+i, surf->bpe, i, xalign, yalign, zalign, offset);
         /* level0 and first mipmap need to have alignment */
         offset = surf->bo_size;
-        if ((i == 0)) {
+        if (i == 0) {
             offset = ALIGN(offset, surf->bo_alignment);
         }
     }
@@ -343,7 +343,7 @@ static int r6_surface_init_1d(struct radeon_surface_manager *surf_man,
         surf_minify(surf, surf->level+i, surf->bpe, i, xalign, yalign, zalign, offset);
         /* level0 and first mipmap need to have alignment */
         offset = surf->bo_size;
-        if ((i == 0)) {
+        if (i == 0) {
             offset = ALIGN(offset, surf->bo_alignment);
         }
     }
@@ -384,7 +384,7 @@ static int r6_surface_init_2d(struct radeon_surface_manager *surf_man,
         }
         /* level0 and first mipmap need to have alignment */
         offset = surf->bo_size;
-        if ((i == 0)) {
+        if (i == 0) {
             offset = ALIGN(offset, surf->bo_alignment);
         }
     }
@@ -632,7 +632,7 @@ static int eg_surface_init_1d(struct radeon_surface_manager *surf_man,
         surf_minify(surf, level+i, bpe, i, xalign, yalign, zalign, offset);
         /* level0 and first mipmap need to have alignment */
         offset = surf->bo_size;
-        if ((i == 0)) {
+        if (i == 0) {
             offset = ALIGN(offset, surf->bo_alignment);
         }
     }
@@ -685,7 +685,7 @@ static int eg_surface_init_2d(struct radeon_surface_manager *surf_man,
         }
         /* level0 and first mipmap need to have alignment */
         offset = surf->bo_size;
-        if ((i == 0)) {
+        if (i == 0) {
             offset = ALIGN(offset, surf->bo_alignment);
         }
     }
@@ -1524,7 +1524,7 @@ static int si_surface_init_linear_aligned(struct radeon_surface_manager *surf_ma
         si_surf_minify(surf, surf->level+i, surf->bpe, i, xalign, yalign, zalign, slice_align, offset);
         /* level0 and first mipmap need to have alignment */
         offset = surf->bo_size;
-        if ((i == 0)) {
+        if (i == 0) {
             offset = ALIGN(offset, surf->bo_alignment);
         }
         if (surf->flags & RADEON_SURF_HAS_TILE_MODE_INDEX) {
@@ -1567,7 +1567,7 @@ static int si_surface_init_1d(struct radeon_surface_manager *surf_man,
         si_surf_minify(surf, level+i, bpe, i, xalign, yalign, zalign, slice_align, offset);
         /* level0 and first mipmap need to have alignment */
         offset = surf->bo_size;
-        if ((i == 0)) {
+        if (i == 0) {
             offset = ALIGN(offset, alignment);
         }
         if (surf->flags & RADEON_SURF_HAS_TILE_MODE_INDEX) {
@@ -1669,7 +1669,7 @@ static int si_surface_init_2d(struct radeon_surface_manager *surf_man,
         }
         /* level0 and first mipmap need to have alignment */
         aligned_offset = offset = surf->bo_size;
-        if ((i == 0)) {
+        if (i == 0) {
             aligned_offset = ALIGN(aligned_offset, surf->bo_alignment);
         }
         if (surf->flags & RADEON_SURF_HAS_TILE_MODE_INDEX) {

commit e8c3c1358ecaf4e90f7d43762357ae6f8e2022b6
Author: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Date:   Sun Jun 1 18:04:06 2014 +0200

    exynos: fix scaling factor computation in g2d_copy_with_scale
    
    When division of source and destination width yields the
    scaling factor for the x-coordinate, then it should be
    source/destination _height_ for y.
    
    Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
    Signed-off-by: Inki Dae <inki.dae@samsung.com>

diff --git a/exynos/exynos_fimg2d.c b/exynos/exynos_fimg2d.c
index a565910..fc281b6 100644
--- a/exynos/exynos_fimg2d.c
+++ b/exynos/exynos_fimg2d.c
@@ -451,7 +451,7 @@ int g2d_copy_with_scale(struct g2d_context *ctx, struct g2d_image *src,
 	else {
 		scale = 1;
 		scale_x = (double)src_w / (double)dst_w;
-		scale_y = (double)src_w / (double)dst_h;
+		scale_y = (double)src_h / (double)dst_h;
 	}
 
 	if (src_x + src_w > src->width)

commit 3001c232d14a07153c36a0722e196041d6536d30
Author: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Date:   Sun Jun 1 18:04:05 2014 +0200

    exynos: fix G2D_DOUBLE_TO_FIXED for non-integer input
    
    The hardware accepts scaling factors formatted in a
    fixed-point format. The current macro casts to integer
    first, then multiplies by the fp conversion factor.
    
    This does not make any sense. In particular, truly
    'fractional' inputs, like 1.5, won't work that way.
    
    Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
    Signed-off-by: Inki Dae <inki.dae@samsung.com>

diff --git a/exynos/fimg2d.h b/exynos/fimg2d.h
index 1aac378..4785e2f 100644
--- a/exynos/fimg2d.h
+++ b/exynos/fimg2d.h
@@ -25,7 +25,7 @@
 #define G2D_MAX_CMD_LIST_NR	64
 #define G2D_PLANE_MAX_NR	2
 
-#define G2D_DOUBLE_TO_FIXED(d)		((unsigned int)(d) * 65536.0)
+#define G2D_DOUBLE_TO_FIXED(d)		((unsigned int)((d) * 65536.0))
 
 enum e_g2d_color_mode {
 	/* COLOR FORMAT */

commit 63f51fc4d34814c80d452e03814b5b495548987b
Author: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Date:   Sun Jun 1 18:04:04 2014 +0200

    exynos: fix coordinate computation in g2d_copy
    
    The right-bottom register isn't set correctly.
    Looks like a copy-and-paste error.
    
    Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
    Signed-off-by: Inki Dae <inki.dae@samsung.com>

diff --git a/exynos/exynos_fimg2d.c b/exynos/exynos_fimg2d.c
index 0b14618..a565910 100644
--- a/exynos/exynos_fimg2d.c
+++ b/exynos/exynos_fimg2d.c
@@ -382,7 +382,7 @@ int g2d_copy(struct g2d_context *ctx, struct g2d_image *src,
 	g2d_add_cmd(ctx, DST_LEFT_TOP_REG, pt.val);
 	pt.val = 0;
 	pt.data.x = dst_x + w;
-	pt.data.y = dst_x + h;
+	pt.data.y = dst_y + h;
 	g2d_add_cmd(ctx, DST_RIGHT_BOTTOM_REG, pt.val);
 
 	rop4.val = 0;

commit 4fddc92e04f5326d78b1bb0252e2f64725e96edb
Author: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Date:   Thu Jun 19 15:48:34 2014 +0100

    intel: Add new userptr ioctl
    
    Reviewed-by: Damien Lespiau <damien.lespiau@intel.com>
    Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

diff --git a/include/drm/i915_drm.h b/include/drm/i915_drm.h
index 8eb0cb3..15dd01d 100644
--- a/include/drm/i915_drm.h
+++ b/include/drm/i915_drm.h
@@ -223,6 +223,7 @@ typedef struct _drm_i915_sarea {
 #define DRM_I915_GEM_GET_CACHING	0x30
 #define DRM_I915_REG_READ		0x31
 #define DRM_I915_GET_RESET_STATS	0x32
+#define DRM_I915_GEM_USERPTR		0x33
 
 #define DRM_IOCTL_I915_INIT		DRM_IOW( DRM_COMMAND_BASE + DRM_I915_INIT, drm_i915_init_t)
 #define DRM_IOCTL_I915_FLUSH		DRM_IO ( DRM_COMMAND_BASE + DRM_I915_FLUSH)
@@ -273,6 +274,7 @@ typedef struct _drm_i915_sarea {
 #define DRM_IOCTL_I915_GEM_CONTEXT_DESTROY	DRM_IOW (DRM_COMMAND_BASE + DRM_I915_GEM_CONTEXT_DESTROY, struct drm_i915_gem_context_destroy)
 #define DRM_IOCTL_I915_REG_READ			DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_REG_READ, struct drm_i915_reg_read)
 #define DRM_IOCTL_I915_GET_RESET_STATS		DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GET_RESET_STATS, struct drm_i915_reset_stats)
+#define DRM_IOCTL_I915_GEM_USERPTR		DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_USERPTR,  struct drm_i915_gem_userptr)
 
 /* Allow drivers to submit batchbuffers directly to hardware, relying
  * on the security mechanisms provided by hardware.
@@ -1050,4 +1052,18 @@ struct drm_i915_reset_stats {
 	__u32 pad;
 };
 
+struct drm_i915_gem_userptr {
+	__u64 user_ptr;
+	__u64 user_size;
+	__u32 flags;
+#define I915_USERPTR_READ_ONLY 0x1
+#define I915_USERPTR_UNSYNCHRONIZED 0x80000000
+	/**
+	* Returned handle for the object.
+	*
+	* Object handles are nonzero.
+	*/
+	__u32 handle;
+};
+
 #endif /* _I915_DRM_H_ */

commit 20edfb9a16414688670439f8849488e08b64c5e7
Author: Damien Lespiau <damien.lespiau@intel.com>
Date:   Thu Jun 19 11:25:48 2014 +0100

    intel: Sync typo fix from the kernel sources.
    
    Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>

diff --git a/include/drm/i915_drm.h b/include/drm/i915_drm.h
index 980dbf8..8eb0cb3 100644
--- a/include/drm/i915_drm.h
+++ b/include/drm/i915_drm.h
@@ -722,7 +722,7 @@ struct drm_i915_gem_execbuffer2 {
  */
 #define I915_EXEC_IS_PINNED		(1<<10)
 
-/** Provide a hint to the kernel that the command stream and auxilliary
+/** Provide a hint to the kernel that the command stream and auxiliary
  * 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.

commit 3cde43f5669bf5edbd6adef7902e96411fc53e9c
Author: Damien Lespiau <damien.lespiau@intel.com>
Date:   Thu Jun 19 11:25:03 2014 +0100

    intel: Sync the command parser version parameter from kernel
    
    Cc: Bradley Volkin <bradley.d.volkin@intel.com>
    Reviewed-by: Brad Volkin <bradley.d.volkin@intel.com>
    Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>

diff --git a/include/drm/i915_drm.h b/include/drm/i915_drm.h
index 2f4eb8c..980dbf8 100644
--- a/include/drm/i915_drm.h
+++ b/include/drm/i915_drm.h
@@ -337,6 +337,7 @@ typedef struct drm_i915_irq_wait {
 #define I915_PARAM_HAS_EXEC_NO_RELOC	 25
 #define I915_PARAM_HAS_EXEC_HANDLE_LUT   26
 #define I915_PARAM_HAS_WT     	 	 27
+#define I915_PARAM_CMD_PARSER_VERSION	 28
 
 typedef struct drm_i915_getparam {
 	int param;

commit 56d170bc06c3ac69deb697f057c213f7c46d9a68
Author: Rob Clark <robclark@freedesktop.org>
Date:   Wed Jun 18 09:45:23 2014 -0400

    freedreno: add chip-id property
    
    Userspace needs to know the patch-revision in addition to just the
    gpu-id (ie. 320, 305, etc).
    
    Signed-off-by: Rob Clark <robclark@freedesktop.org>

diff --git a/freedreno/freedreno_drmif.h b/freedreno/freedreno_drmif.h
index 41ef609..7c54e04 100644
--- a/freedreno/freedreno_drmif.h
+++ b/freedreno/freedreno_drmif.h
@@ -49,6 +49,7 @@ enum fd_param_id {
 	FD_DEVICE_ID,
 	FD_GMEM_SIZE,
 	FD_GPU_ID,
+	FD_CHIP_ID,
 };
 
 /* bo flags: */
diff --git a/freedreno/kgsl/kgsl_pipe.c b/freedreno/kgsl/kgsl_pipe.c
index f7ff7fe..88d9505 100644
--- a/freedreno/kgsl/kgsl_pipe.c
+++ b/freedreno/kgsl/kgsl_pipe.c
@@ -43,6 +43,9 @@ static int kgsl_pipe_get_param(struct fd_pipe *pipe,
 	case FD_GMEM_SIZE:
 		*value = kgsl_pipe->devinfo.gmem_sizebytes;
 		return 0;
+	case FD_CHIP_ID:
+		*value = kgsl_pipe->devinfo.chip_id;
+		return 0;
 	default:
 		ERROR_MSG("invalid param id: %d", param);
 		return -1;
diff --git a/freedreno/msm/msm_pipe.c b/freedreno/msm/msm_pipe.c
index ece4de5..5650503 100644
--- a/freedreno/msm/msm_pipe.c
+++ b/freedreno/msm/msm_pipe.c
@@ -41,6 +41,9 @@ static int msm_pipe_get_param(struct fd_pipe *pipe,
 	case FD_GMEM_SIZE:
 		*value = msm_pipe->gmem;
 		return 0;
+	case FD_CHIP_ID:
+		*value = msm_pipe->chip_id;
+		return 0;
 	default:
 		ERROR_MSG("invalid param id: %d", param);
 		return -1;
@@ -117,12 +120,14 @@ struct fd_pipe * msm_pipe_new(struct fd_device *dev, enum fd_pipe_id id)
 	msm_pipe->pipe = pipe_id[id];
 	msm_pipe->gpu_id = get_param(dev, pipe_id[id], MSM_PARAM_GPU_ID);
 	msm_pipe->gmem   = get_param(dev, pipe_id[id], MSM_PARAM_GMEM_SIZE);
+	msm_pipe->chip_id = get_param(dev, pipe_id[id], MSM_PARAM_CHIP_ID);
 
 	if (! msm_pipe->gpu_id)
 		goto fail;
 
 	INFO_MSG("Pipe Info:");
 	INFO_MSG(" GPU-id:          %d", msm_pipe->gpu_id);
+	INFO_MSG(" Chip-id:         0x%08x", msm_pipe->chip_id);
 	INFO_MSG(" GMEM size:       0x%08x", msm_pipe->gmem);
 
 	return pipe;
diff --git a/freedreno/msm/msm_priv.h b/freedreno/msm/msm_priv.h
index 4c5623a..75ae883 100644
--- a/freedreno/msm/msm_priv.h
+++ b/freedreno/msm/msm_priv.h
@@ -53,6 +53,7 @@ struct msm_pipe {
 	uint32_t pipe;
 	uint32_t gpu_id;
 	uint32_t gmem;
+	uint32_t chip_id;
 };
 
 static inline struct msm_pipe * to_msm_pipe(struct fd_pipe *x)

commit 09db8019da88644cd54dc9d93e8398d8b1f7d923
Author: Rob Clark <robclark@freedesktop.org>
Date:   Wed Jun 18 09:42:11 2014 -0400

    freedreno: sync kernel header
    
    Signed-off-by: Rob Clark <robclark@freedesktop.org>

diff --git a/freedreno/msm/msm_drm.h b/freedreno/msm/msm_drm.h
index b83c9a8..f7474c5 100644
--- a/freedreno/msm/msm_drm.h
+++ b/freedreno/msm/msm_drm.h
@@ -57,6 +57,7 @@ struct drm_msm_timespec {
 
 #define MSM_PARAM_GPU_ID     0x01
 #define MSM_PARAM_GMEM_SIZE  0x02
+#define MSM_PARAM_CHIP_ID    0x03
 
 struct drm_msm_param {
 	uint32_t pipe;           /* in, MSM_PIPE_x */
@@ -76,6 +77,12 @@ struct drm_msm_param {
 #define MSM_BO_WC            0x00020000
 #define MSM_BO_UNCACHED      0x00040000
 
+#define MSM_BO_FLAGS         (MSM_BO_SCANOUT | \
+                              MSM_BO_GPU_READONLY | \
+                              MSM_BO_CACHED | \
+                              MSM_BO_WC | \
+                              MSM_BO_UNCACHED)
+
 struct drm_msm_gem_new {
 	uint64_t size;           /* in */
 	uint32_t flags;          /* in, mask of MSM_BO_x */
@@ -92,6 +99,8 @@ struct drm_msm_gem_info {
 #define MSM_PREP_WRITE       0x02
 #define MSM_PREP_NOSYNC      0x04
 
+#define MSM_PREP_FLAGS       (MSM_PREP_READ | MSM_PREP_WRITE | MSM_PREP_NOSYNC)
+
 struct drm_msm_gem_cpu_prep {
 	uint32_t handle;         /* in */
 	uint32_t op;             /* in, mask of MSM_PREP_x */
@@ -159,6 +168,9 @@ struct drm_msm_gem_submit_cmd {
  */
 #define MSM_SUBMIT_BO_READ             0x0001
 #define MSM_SUBMIT_BO_WRITE            0x0002
+
+#define MSM_SUBMIT_BO_FLAGS            (MSM_SUBMIT_BO_READ | MSM_SUBMIT_BO_WRITE)
+
 struct drm_msm_gem_submit_bo {
 	uint32_t flags;          /* in, mask of MSM_SUBMIT_BO_x */
 	uint32_t handle;         /* in, GEM handle */

commit 8fc62ca8ac010659023bb63c4759eb683de4f9af
Author: Matt Roper <matthew.d.roper@intel.com>
Date:   Thu Apr 10 14:23:12 2014 -0700

    drm: Add universal plane capability bit and plane type enums
    
    Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
    Signed-off-by: Rob Clark <robclark@freedesktop.org>

diff --git a/include/drm/drm.h b/include/drm/drm.h
index f0b4c16..229a29f 100644
--- a/include/drm/drm.h
+++ b/include/drm/drm.h
@@ -627,6 +627,14 @@ struct drm_get_cap {
  */
 #define DRM_CLIENT_CAP_STEREO_3D	1
 
+/**
+ * DRM_CLIENT_CAP_UNIVERSAL_PLANES
+ *
+ * if set to 1, the DRM core will expose the full universal plane list
+ * (including primary and cursor planes).
+ */
+#define DRM_CLIENT_CAP_UNIVERSAL_PLANES 2
+
 /** DRM_IOCTL_SET_CLIENT_CAP ioctl argument type */
 struct drm_set_client_cap {
 	__u64 capability;
diff --git a/xf86drmMode.h b/xf86drmMode.h
index 6eab565..b260af7 100644
--- a/xf86drmMode.h
+++ b/xf86drmMode.h
@@ -296,6 +296,10 @@ typedef struct _drmModeConnector {
 	uint32_t *encoders; /**< List of encoder ids */
 } drmModeConnector, *drmModeConnectorPtr;
 
+#define DRM_PLANE_TYPE_OVERLAY 0
+#define DRM_PLANE_TYPE_PRIMARY 1
+#define DRM_PLANE_TYPE_CURSOR  2
+
 typedef struct _drmModeObjectProperties {
 	uint32_t count_props;
 	uint32_t *props;

commit 305478ce02ebd908a75c9830ecea15f6e2469b42
Author: Daniel Kurtz <djkurtz@chromium.org>
Date:   Thu Apr 17 12:08:01 2014 +0800

    drmOpenByName: remove redundant drmAvailable check
    
    drmOpenByName() is a static function that is only called by drmOpen().
    drmOpen() already checks drmAvailable(), so the check in
    drmOpenByName() is redundant.
    
    Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
    Signed-off-by: Thierry Reding <treding@nvidia.com>

diff --git a/xf86drm.c b/xf86drm.c
index e94f2cd..85beb8c 100644
--- a/xf86drm.c
+++ b/xf86drm.c
@@ -541,19 +541,6 @@ static int drmOpenByName(const char *name)
     int           fd;
     drmVersionPtr version;
     char *        id;
-    
-    if (!drmAvailable()) {
-	if (!drm_server_info) {
-	    return -1;
-	}
-	else {
-	    /* try to load the kernel module now */
-	    if (!drm_server_info->load_module(name)) {
-		drmMsg("[drm] failed to load kernel module \"%s\"\n", name);
-		return -1;
-	    }
-	}
-    }
 
     /*
      * Open the first minor number that matches the driver name and isn't

commit ee87b4716d416be94071eea5dd67a22d1e78df31
Author: Daniel Kurtz <djkurtz@chromium.org>
Date:   Thu Apr 17 11:54:41 2014 +0800

    exynos: removed unused fd field
    
    The documentation says fd holds the fd from prime import/export.
    However, it isn't actually used, nor is it necessary, so let's just remove
    it.
    
    Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
    Acked-by: Inki Dae <inki.dae@samsung.com>

diff --git a/exynos/exynos_drmif.h b/exynos/exynos_drmif.h
index 92f613e..c7c1d44 100644
--- a/exynos/exynos_drmif.h
+++ b/exynos/exynos_drmif.h
@@ -41,7 +41,6 @@ struct exynos_device {
  * @dev: exynos device object allocated.
  * @handle: a gem handle to gem object created.
  * @flags: indicate memory allocation and cache attribute types.
- * @fd: file descriptor exported into dmabuf.
  * @size: size to the buffer created.
  * @vaddr: user space address to a gem buffer mmaped.
  * @name: a gem global handle from flink request.
@@ -50,7 +49,6 @@ struct exynos_bo {
 	struct exynos_device	*dev;
 	uint32_t		handle;
 	uint32_t		flags;
-	int			fd;
 	size_t			size;
 	void			*vaddr;
 	uint32_t		name;

commit a13bdd5c7197c4c008c0f3976742231cf61d8ce9
Author: Daniel Kurtz <djkurtz@chromium.org>
Date:   Thu Apr 17 11:54:40 2014 +0800

    exynos: prime: use drmPrime*() helpers
    
    Reuse the common drmPrime() helper functions rather than reinventing them.
    
    Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
    Acked-by: Inki Dae <inki.dae@samsung.com>

diff --git a/exynos/exynos_drm.c b/exynos/exynos_drm.c
index b7acdf5..5fff259 100644
--- a/exynos/exynos_drm.c
+++ b/exynos/exynos_drm.c
@@ -303,59 +303,31 @@ void *exynos_bo_map(struct exynos_bo *bo)
 /*
  * Export gem object to dmabuf as file descriptor.
  *
- * @dev: a exynos device object.
- * @handle: gem handle to be exported into dmabuf as file descriptor.
- * @fd: file descriptor to dmabuf exported from gem handle and
- *	returned by kernel side.
+ * @dev: exynos device object
+ * @handle: gem handle to export as file descriptor of dmabuf
+ * @fd: file descriptor returned from kernel
  *
- * if true, return 0 else negative.
+ * @return: 0 on success, -1 on error, and errno will be set
  */
 int exynos_prime_handle_to_fd(struct exynos_device *dev, uint32_t handle,
 					int *fd)
 {
-	int ret;
-	struct drm_prime_handle req = {
-		.handle	= handle,
-	};
-
-	ret = drmIoctl(dev->fd, DRM_IOCTL_PRIME_HANDLE_TO_FD, &req);
-	if (ret) {
-		fprintf(stderr, "failed to mmap[%s].\n",
-			strerror(errno));
-		return ret;
-	}
-
-	*fd = req.fd;
-	return 0;
+	return drmPrimeHandleToFD(dev->fd, handle, 0, fd);
 }
 
 /*
  * Import file descriptor into gem handle.
  *
- * @dev: a exynos device object.
- * @fd: file descriptor exported into dmabuf.
- * @handle: gem handle to gem object imported from file descriptor
- *	and returned by kernel side.
+ * @dev: exynos device object
+ * @fd: file descriptor of dmabuf to import
+ * @handle: gem handle returned from kernel
  *
- * if true, return 0 else negative.
+ * @return: 0 on success, -1 on error, and errno will be set
  */
 int exynos_prime_fd_to_handle(struct exynos_device *dev, int fd,
 					uint32_t *handle)
 {
-	int ret;
-	struct drm_prime_handle req = {
-		.fd	= fd,
-	};
-
-	ret = drmIoctl(dev->fd, DRM_IOCTL_PRIME_FD_TO_HANDLE, &req);
-	if (ret) {
-		fprintf(stderr, "failed to mmap[%s].\n",
-			strerror(errno));
-		return ret;
-	}
-
-	*handle = req.handle;
-	return 0;
+	return drmPrimeFDToHandle(dev->fd, fd, handle);
 }
 
 

commit d1000c432c8ce76ea64f7f9eb6094d11542e0495
Author: Daniel Kurtz <djkurtz@chromium.org>
Date:   Thu Apr 17 11:54:39 2014 +0800

    exynos_fimg2d_test: fix drmModeRmFB
    
    The first parameter should be the drm fd, second param is the fb id.
    
    Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
    Acked-by: Inki Dae <inki.dae@samsung.com>

diff --git a/tests/exynos/exynos_fimg2d_test.c b/tests/exynos/exynos_fimg2d_test.c
index e80455a..c6bd558 100644
--- a/tests/exynos/exynos_fimg2d_test.c
+++ b/tests/exynos/exynos_fimg2d_test.c
@@ -682,7 +682,7 @@ err_free_src:
 		exynos_destroy_buffer(src);
 
 err_rm_fb:
-	drmModeRmFB(fb_id, bo->handle);
+	drmModeRmFB(dev->fd, fb_id);
 
 err_destroy_buffer:
 	exynos_destroy_buffer(bo);

commit 382043ee4843ecafb82dda148e43953ab0d016fc
Author: Daniel Kurtz <djkurtz@chromium.org>
Date:   Thu Apr 17 11:54:38 2014 +0800

    exynos: remove unusable "run" target
    
    This looks like it was copied from kmstest, but isn't needed, and doesn't
    actually work since exynos_fimg2d_test requires parameters.
    
    Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
    Acked-by: Inki Dae <inki.dae@samsung.com>

diff --git a/tests/exynos/Makefile.am b/tests/exynos/Makefile.am
index 6703dcf..518f00b 100644
--- a/tests/exynos/Makefile.am
+++ b/tests/exynos/Makefile.am
@@ -20,5 +20,3 @@ exynos_fimg2d_test_LDADD = \
 exynos_fimg2d_test_SOURCES = \
 	exynos_fimg2d_test.c
 
-run: exynos_fimg2d_test
-	./exynos_fimg2d_test

commit 4e193aa817685d23cb38722788541caee0115cb5
Author: Daniel Kurtz <djkurtz@chromium.org>
Date:   Thu Apr 17 11:54:37 2014 +0800

    exynos_fimg2d: fix cast from pointer to integer of different size
    
    Fixes two gcc [-Wpointer-to-int-cast] warnings.
    
    Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
    Acked-by: Inki Dae <inki.dae@samsung.com>

diff --git a/exynos/exynos_fimg2d.c b/exynos/exynos_fimg2d.c
index cf712a8..0b14618 100644
--- a/exynos/exynos_fimg2d.c
+++ b/exynos/exynos_fimg2d.c
@@ -158,8 +158,8 @@ static int g2d_flush(struct g2d_context *ctx)
 
 	memset(&cmdlist, 0, sizeof(struct drm_exynos_g2d_set_cmdlist));
 
-	cmdlist.cmd = (unsigned int)&ctx->cmd[0];
-	cmdlist.cmd_buf = (unsigned int)&ctx->cmd_buf[0];
+	cmdlist.cmd = (uint64_t)(uintptr_t)&ctx->cmd[0];
+	cmdlist.cmd_buf = (uint64_t)(uintptr_t)&ctx->cmd_buf[0];
 	cmdlist.cmd_nr = ctx->cmd_nr;
 	cmdlist.cmd_buf_nr = ctx->cmd_buf_nr;
 	cmdlist.event_type = G2D_EVENT_NOT;

commit ebe21baec5ec180068eb2ec2a97561ba7b482a38
Author: Daniel Kurtz <djkurtz@chromium.org>
Date:   Thu Apr 17 11:54:36 2014 +0800

    exynos: fix two warnings
    
    warning: assignment makes pointer from integer without a cast [enabled by default]
    warning: initialization makes integer from pointer without a cast [enabled by default]
    
    Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
    Acked-by: Inki Dae <inki.dae@samsung.com>

diff --git a/exynos/exynos_drm.c b/exynos/exynos_drm.c
index 4db755e..b7acdf5 100644
--- a/exynos/exynos_drm.c
+++ b/exynos/exynos_drm.c
@@ -294,7 +294,7 @@ void *exynos_bo_map(struct exynos_bo *bo)
 			return NULL;
 		}
 
-		bo->vaddr = req.mapped;
+		bo->vaddr = (void *)(uintptr_t)req.mapped;
 	}
 
 	return bo->vaddr;
@@ -381,7 +381,7 @@ int exynos_vidi_connection(struct exynos_device *dev, uint32_t connect,
 	struct drm_exynos_vidi_connection req = {
 		.connection	= connect,
 		.extensions	= ext,
-		.edid		= edid,
+		.edid		= (uint64_t)(uintptr_t)edid,
 	};
 	int ret;
 

commit 71bbf86f58b5b1fccc045dced8612572c01a93eb
Author: Daniel Kurtz <djkurtz@chromium.org>
Date:   Thu Apr 17 11:54:35 2014 +0800

    eyxnos: install exynos tests if HAVE_INSTALL_TESTS
    
    This exynos test was added just before HAVE_INSTALL_TESTS, and so didn't
    get this annotation.
    
    Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
    Acked-by: Inki Dae <inki.dae@samsung.com>

diff --git a/tests/exynos/Makefile.am b/tests/exynos/Makefile.am
index bf9ad82..6703dcf 100644
--- a/tests/exynos/Makefile.am
+++ b/tests/exynos/Makefile.am
@@ -4,8 +4,13 @@ AM_CFLAGS = \
 	-I $(top_srcdir)/exynos \
 	-I $(top_srcdir)
 
+if HAVE_INSTALL_TESTS
+bin_PROGRAMS = \
+	exynos_fimg2d_test
+else
 noinst_PROGRAMS = \
 	exynos_fimg2d_test
+endif
 
 exynos_fimg2d_test_LDADD = \
 	$(top_builddir)/libdrm.la \


Reply to: