[PATCH RFC 104/111] staging: etnaviv: clean up public API

Lucas Stach l.stach at pengutronix.de
Thu Apr 2 08:30:46 PDT 2015


Drop the last remaining MSM bits and things we don't need for
Vivante GPUs. Those include shifting and or-ing of reloc addresses
and IB buffers.

Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
Signed-off-by: Lucas Stach <l.stach at pengutronix.de>
---
 drivers/staging/etnaviv/etnaviv_gem_submit.c |  9 +--------
 include/uapi/drm/etnaviv_drm.h               | 22 ++++------------------
 2 files changed, 5 insertions(+), 26 deletions(-)

diff --git a/drivers/staging/etnaviv/etnaviv_gem_submit.c b/drivers/staging/etnaviv/etnaviv_gem_submit.c
index 9061f5f7ecc6..2edaa1262fef 100644
--- a/drivers/staging/etnaviv/etnaviv_gem_submit.c
+++ b/drivers/staging/etnaviv/etnaviv_gem_submit.c
@@ -269,14 +269,7 @@ static int submit_reloc(struct etnaviv_gem_submit *submit, struct etnaviv_gem_ob
 			return -EINVAL;
 		}
 
-		iova += submit_reloc.reloc_offset;
-
-		if (submit_reloc.shift < 0)
-			iova >>= -submit_reloc.shift;
-		else
-			iova <<= submit_reloc.shift;
-
-		ptr[off] = iova | submit_reloc.or;
+		ptr[off] = iova + submit_reloc.reloc_offset;
 
 		last_offset = off;
 	}
diff --git a/include/uapi/drm/etnaviv_drm.h b/include/uapi/drm/etnaviv_drm.h
index dfd51fcd56d6..c6ce72ae4dbe 100644
--- a/include/uapi/drm/etnaviv_drm.h
+++ b/include/uapi/drm/etnaviv_drm.h
@@ -1,6 +1,5 @@
 /*
- * Copyright (C) 2013 Red Hat
- * Author: Rob Clark <robdclark at gmail.com>
+ * Copyright (C) 2015 Etnaviv Project
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 as published by
@@ -62,8 +61,6 @@ struct drm_etnaviv_timespec {
 #define ETNAVIV_PARAM_GPU_INSTRUCTION_COUNT         0x18
 #define ETNAVIV_PARAM_GPU_NUM_CONSTANTS             0x19
 
-/* #define MSM_PARAM_GMEM_SIZE  0x02 */
-
 #define ETNA_MAX_PIPES 4
 
 struct drm_etnaviv_param {
@@ -116,35 +113,24 @@ struct drm_etnaviv_gem_cpu_fini {
  */
 
 /* The value written into the cmdstream is logically:
- *
- *   ((relocbuf->gpuaddr + reloc_offset) << shift) | or
- *
- * When we have GPU's w/ >32bit ptrs, it should be possible to deal
- * with this by emit'ing two reloc entries with appropriate shift
- * values.  Or a new ETNA_SUBMIT_CMD_x type would also be an option.
+ * relocbuf->gpuaddr + reloc_offset
  *
  * NOTE that reloc's must be sorted by order of increasing submit_offset,
  * otherwise EINVAL.
  */
 struct drm_etnaviv_gem_submit_reloc {
 	uint32_t submit_offset;  /* in, offset from submit_bo */
-	uint32_t or;             /* in, value OR'd with result */
-	int32_t  shift;          /* in, amount of left shift (can be -ve) */
 	uint32_t reloc_idx;      /* in, index of reloc_bo buffer */
 	uint64_t reloc_offset;   /* in, offset from start of reloc_bo */
 };
 
 /* submit-types:
  *   BUF - this cmd buffer is executed normally.
- *   IB_TARGET_BUF - this cmd buffer is an IB target.  Reloc's are
- *      processed normally, but the kernel does not setup an IB to
- *      this buffer in the first-level ringbuffer
  *   CTX_RESTORE_BUF - only executed if there has been a GPU context
  *      switch since the last SUBMIT ioctl
  */
 #define ETNA_SUBMIT_CMD_BUF             0x0001
-#define ETNA_SUBMIT_CMD_IB_TARGET_BUF   0x0002
-#define ETNA_SUBMIT_CMD_CTX_RESTORE_BUF 0x0003
+#define ETNA_SUBMIT_CMD_CTX_RESTORE_BUF 0x0002
 struct drm_etnaviv_gem_submit_cmd {
 	uint32_t type;           /* in, one of ETNA_SUBMIT_CMD_x */
 	uint32_t submit_idx;     /* in, index of submit_bo cmdstream buffer */
@@ -216,7 +202,7 @@ struct drm_etnaviv_gem_userptr {
 
 #define DRM_ETNAVIV_GET_PARAM          0x00
 /* placeholder:
-#define DRM_MSM_SET_PARAM              0x01
+#define DRM_ETNAVIV_SET_PARAM          0x01
  */
 #define DRM_ETNAVIV_GEM_NEW            0x02
 #define DRM_ETNAVIV_GEM_INFO           0x03
-- 
2.1.4



More information about the dri-devel mailing list