All of lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t v2 0/7] Make gpgpu fill tests libdrm independent
@ 2020-05-15  6:44 Zbigniew Kempczyński
  2020-05-15  6:44 ` [igt-dev] [PATCH i-g-t v2 1/7] lib/intel_bufops: Add bufops reference and relaxate stride requirement Zbigniew Kempczyński
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: Zbigniew Kempczyński @ 2020-05-15  6:44 UTC (permalink / raw)
  To: igt-dev; +Cc: Chris Wilson

I've introduced intel_bb which is very simplified version of libdrm
powered intel_batchbuffer. Currently it supports simple relocation
but it is enough to cover all gpgpu fill needs. Other (fenced) 
relocation will be added when I will have to face with such pipelines /
batchbuffers.

I think there're two possibilities - iterate until functions with 
suffix "_v2" will be ready to be replaced older libdrm versions or when 
patch will be mature enough to merge and add other gens one by one
with final replacement of "_v2" to "" on the end. I'm looking forward
review comments and suggestions. 

v2: changes according to the review:
    - make intel_bb api more consistent and universal
    - add intel_bb api documentation
    - add alignment field in buf_ops buffer initalization for linear
      buffers

Cc: Chris Wilson <chris@chris-wilson.co.uk>

Zbigniew Kempczyński (7):
  lib/intel_bufops: Add bufops reference and relaxate stride requirement
  lib/rendercopy_bufmgr: Pass alignment during buffer initialization
  lib/intel_batchbuffer: Introduce intel_bb
  lib/intel_batchbuffer: Introduce temporary igt_fillfunc_v2_t
  lib/gpu_cmds: Add gpgpu pipeline functions based on intel_bb
  lib/gpgpu_fill: libdrm-free gpgpu pipeline creation for gen7
  tests/gem_gpgpu_fill: Add gen7 version without libdrm dependency

 lib/gpgpu_fill.c            |  49 +++++
 lib/gpgpu_fill.h            |   8 +
 lib/gpu_cmds.c              | 342 ++++++++++++++++++++++++++++++++++
 lib/gpu_cmds.h              |  33 ++++
 lib/intel_batchbuffer.c     | 356 ++++++++++++++++++++++++++++++++++++
 lib/intel_batchbuffer.h     |  90 +++++++++
 lib/intel_bufops.c          |  41 ++++-
 lib/intel_bufops.h          |   7 +-
 lib/rendercopy_bufmgr.c     |   4 +-
 tests/i915/gem_gpgpu_fill.c | 127 ++++++++++---
 10 files changed, 1016 insertions(+), 41 deletions(-)

-- 
2.26.0

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [igt-dev] [PATCH i-g-t v2 1/7] lib/intel_bufops: Add bufops reference and relaxate stride requirement
  2020-05-15  6:44 [igt-dev] [PATCH i-g-t v2 0/7] Make gpgpu fill tests libdrm independent Zbigniew Kempczyński
@ 2020-05-15  6:44 ` Zbigniew Kempczyński
  2020-05-15  6:44 ` [igt-dev] [PATCH i-g-t v2 2/7] lib/rendercopy_bufmgr: Pass alignment during buffer initialization Zbigniew Kempczyński
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Zbigniew Kempczyński @ 2020-05-15  6:44 UTC (permalink / raw)
  To: igt-dev; +Cc: Chris Wilson

Add bufops reference to intel_buf to allow acquire drm fd against which
buffer was created.

Relax stride limitation for intel_buf for non-tiled buffers.

v2: add alignment and ensure it is dword sized for linear buffers

Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
---
 lib/intel_bufops.c | 41 +++++++++++++++++++++++++++++++----------
 lib/intel_bufops.h |  7 +++++--
 2 files changed, 36 insertions(+), 12 deletions(-)

diff --git a/lib/intel_bufops.c b/lib/intel_bufops.c
index 804b2a0a..ef36c9cc 100644
--- a/lib/intel_bufops.c
+++ b/lib/intel_bufops.c
@@ -52,7 +52,7 @@
  * struct intel_buf ibuf;
  * ...
  * bops = buf_ops_create(fd);
- * intel_buf_init(bops, &ibuf, 512, 512, 32, I915_TILING_X, false);
+ * intel_buf_init(bops, &ibuf, 512, 512, 32, 64, I915_TILING_X, false);
  * ...
  * linear_to_intel_buf(bops, &ibuf, linear);
  * ...
@@ -673,7 +673,7 @@ void linear_to_intel_buf(struct buf_ops *bops, struct intel_buf *buf,
 static void __intel_buf_init(struct buf_ops *bops,
 			     uint32_t handle,
 			     struct intel_buf *buf,
-			     int width, int height, int bpp,
+			     int width, int height, int bpp, int alignment,
 			     uint32_t req_tiling, uint32_t compression)
 {
 	uint32_t tiling = req_tiling;
@@ -683,9 +683,12 @@ static void __intel_buf_init(struct buf_ops *bops,
 	igt_assert(buf);
 	igt_assert(width > 0 && height > 0);
 	igt_assert(bpp == 8 || bpp == 16 || bpp == 32);
+	igt_assert(alignment % 4 == 0);
 
 	memset(buf, 0, sizeof(*buf));
 
+	buf->bops = bops;
+
 	if (compression) {
 		int aux_width, aux_height;
 
@@ -721,7 +724,10 @@ static void __intel_buf_init(struct buf_ops *bops,
 		size = buf->aux.offset + aux_width * aux_height;
 
 	} else {
-		buf->stride = ALIGN(width * (bpp / 8), 128);
+		if (buf->tiling)
+			buf->stride = ALIGN(width * (bpp / 8), 128);
+		else
+			buf->stride = ALIGN(width * (bpp / 8), alignment ?: 4);
 		buf->size = buf->stride * height;
 		buf->tiling = tiling;
 		buf->bpp = bpp;
@@ -744,6 +750,7 @@ static void __intel_buf_init(struct buf_ops *bops,
  * @width: surface width
  * @height: surface height
  * @bpp: bits-per-pixel (8 / 16 / 32)
+ * @alignment: alignment of the stride for linear surfaces
  * @tiling: surface tiling
  * @compression: surface compression type
  *
@@ -754,11 +761,11 @@ static void __intel_buf_init(struct buf_ops *bops,
  */
 void intel_buf_init(struct buf_ops *bops,
 		    struct intel_buf *buf,
-		    int width, int height, int bpp,
+		    int width, int height, int bpp, int alignment,
 		    uint32_t tiling, uint32_t compression)
 {
-	__intel_buf_init(bops, 0, buf, width, height, bpp, tiling,
-			 compression);
+	__intel_buf_init(bops, 0, buf, width, height, bpp, alignment,
+			 tiling, compression);
 }
 
 /**
@@ -784,6 +791,7 @@ void intel_buf_close(struct buf_ops *bops, struct intel_buf *buf)
  * @width: surface width
  * @height: surface height
  * @bpp: bits-per-pixel (8 / 16 / 32)
+ * @alignment: alignment of the stride for linear surfaces
  * @tiling: surface tiling
  * @compression: surface compression type
  *
@@ -797,11 +805,11 @@ void intel_buf_close(struct buf_ops *bops, struct intel_buf *buf)
 void intel_buf_init_using_handle(struct buf_ops *bops,
 				 uint32_t handle,
 				 struct intel_buf *buf,
-				 int width, int height, int bpp,
+				 int width, int height, int bpp, int alignment,
 				 uint32_t req_tiling, uint32_t compression)
 {
-	__intel_buf_init(bops, handle, buf, width, height, bpp, req_tiling,
-			 compression);
+	__intel_buf_init(bops, handle, buf, width, height, bpp, alignment,
+			 req_tiling, compression);
 }
 
 #define DEFAULT_BUFOPS(__gen_start, __gen_end) \
@@ -908,7 +916,7 @@ static void idempotency_selftest(struct buf_ops *bops, uint32_t tiling)
 			  bool_str(software_tiling),
 			  bool_str(!software_tiling),
 			  tiling_str(tiling));
-		intel_buf_init(bops, &buf, width, height, bpp, tiling, false);
+		intel_buf_init(bops, &buf, width, height, bpp, 0, tiling, false);
 		buf_ops_set_software_tiling(bops, tiling, software_tiling);
 
 		linear_to_intel_buf(bops, &buf, (uint32_t *) linear_in);
@@ -1038,6 +1046,19 @@ void buf_ops_destroy(struct buf_ops *bops)
 	free(bops);
 }
 
+/**
+ * buf_ops_getfd
+ * @bops: pointer to buf_ops
+ *
+ * Returns: drm fd
+ */
+int buf_ops_getfd(struct buf_ops *bops)
+{
+	igt_assert(bops);
+
+	return bops->fd;
+}
+
 /**
  * buf_ops_set_software_tiling
  * @bops: pointer to buf_ops
diff --git a/lib/intel_bufops.h b/lib/intel_bufops.h
index f3d6aed8..3a4fae4e 100644
--- a/lib/intel_bufops.h
+++ b/lib/intel_bufops.h
@@ -2,10 +2,12 @@
 #define __INTEL_BUFOPS_H__
 
 #include <stdint.h>
+#include "igt_aux.h"
 
 struct buf_ops;
 
 struct intel_buf {
+	struct buf_ops *bops;
 	uint32_t handle;
 	uint32_t stride;
 	uint32_t tiling;
@@ -58,6 +60,7 @@ intel_buf_aux_height(int gen, const struct intel_buf *buf)
 
 struct buf_ops *buf_ops_create(int fd);
 void buf_ops_destroy(struct buf_ops *bops);
+int buf_ops_getfd(struct buf_ops *bops);
 
 bool buf_ops_set_software_tiling(struct buf_ops *bops,
 				 uint32_t tiling,
@@ -73,14 +76,14 @@ bool buf_ops_has_hw_fence(struct buf_ops *bops, uint32_t tiling);
 bool buf_ops_has_tiling_support(struct buf_ops *bops, uint32_t tiling);
 
 void intel_buf_init(struct buf_ops *bops, struct intel_buf *buf,
-		    int width, int height, int bpp,
+		    int width, int height, int bpp, int alignment,
 		    uint32_t tiling, uint32_t compression);
 void intel_buf_close(struct buf_ops *bops, struct intel_buf *buf);
 
 void intel_buf_init_using_handle(struct buf_ops *bops,
 				 uint32_t handle,
 				 struct intel_buf *buf,
-				 int width, int height, int bpp,
+				 int width, int height, int bpp, int alignment,
 				 uint32_t req_tiling, uint32_t compression);
 
 #endif
-- 
2.26.0

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [igt-dev] [PATCH i-g-t v2 2/7] lib/rendercopy_bufmgr: Pass alignment during buffer initialization
  2020-05-15  6:44 [igt-dev] [PATCH i-g-t v2 0/7] Make gpgpu fill tests libdrm independent Zbigniew Kempczyński
  2020-05-15  6:44 ` [igt-dev] [PATCH i-g-t v2 1/7] lib/intel_bufops: Add bufops reference and relaxate stride requirement Zbigniew Kempczyński
@ 2020-05-15  6:44 ` Zbigniew Kempczyński
  2020-05-15  6:44 ` [igt-dev] [PATCH i-g-t v2 3/7] lib/intel_batchbuffer: Introduce intel_bb Zbigniew Kempczyński
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Zbigniew Kempczyński @ 2020-05-15  6:44 UTC (permalink / raw)
  To: igt-dev; +Cc: Chris Wilson

For linear buffer buf_ops currently was extended to align the stride
so we need to update the call.

Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
---
 lib/rendercopy_bufmgr.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/rendercopy_bufmgr.c b/lib/rendercopy_bufmgr.c
index 96603229..dc38d530 100644
--- a/lib/rendercopy_bufmgr.c
+++ b/lib/rendercopy_bufmgr.c
@@ -163,8 +163,8 @@ void igt_buf_init(struct rendercopy_bufmgr *bmgr, struct igt_buf *buf,
 	intel_buf_init_using_handle(bmgr->bops,
 				    buf->bo->handle,
 				    &ibuf,
-				    width, height, bpp, tiling,
-				    compression);
+				    width, height, bpp, 0,
+				    tiling, compression);
 
 	buf->ccs[0].offset = ibuf.aux.offset;
 	buf->ccs[0].stride = ibuf.aux.stride;
-- 
2.26.0

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [igt-dev] [PATCH i-g-t v2 3/7] lib/intel_batchbuffer: Introduce intel_bb
  2020-05-15  6:44 [igt-dev] [PATCH i-g-t v2 0/7] Make gpgpu fill tests libdrm independent Zbigniew Kempczyński
  2020-05-15  6:44 ` [igt-dev] [PATCH i-g-t v2 1/7] lib/intel_bufops: Add bufops reference and relaxate stride requirement Zbigniew Kempczyński
  2020-05-15  6:44 ` [igt-dev] [PATCH i-g-t v2 2/7] lib/rendercopy_bufmgr: Pass alignment during buffer initialization Zbigniew Kempczyński
@ 2020-05-15  6:44 ` Zbigniew Kempczyński
  2020-05-15  6:44 ` [igt-dev] [PATCH i-g-t v2 4/7] lib/intel_batchbuffer: Introduce temporary igt_fillfunc_v2_t Zbigniew Kempczyński
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Zbigniew Kempczyński @ 2020-05-15  6:44 UTC (permalink / raw)
  To: igt-dev; +Cc: Chris Wilson

Simple batchbuffer facility which gathers and outputs relocations.

v2: make bb api more consistent and universal

Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
---
 lib/intel_batchbuffer.c | 337 ++++++++++++++++++++++++++++++++++++++++
 lib/intel_batchbuffer.h |  82 ++++++++++
 2 files changed, 419 insertions(+)

diff --git a/lib/intel_batchbuffer.c b/lib/intel_batchbuffer.c
index f1a45b47..965e07dd 100644
--- a/lib/intel_batchbuffer.c
+++ b/lib/intel_batchbuffer.c
@@ -41,6 +41,7 @@
 #include "rendercopy.h"
 #include "media_fill.h"
 #include "ioctl_wrappers.h"
+#include "i915/gem_mman.h"
 #include "media_spin.h"
 #include "gpgpu_fill.h"
 #include "igt_aux.h"
@@ -1171,3 +1172,339 @@ igt_media_spinfunc_t igt_get_media_spinfunc(int devid)
 
 	return spin;
 }
+
+/* Intel batchbuffer v2 */
+
+/**
+ * intel_bb_create:
+ * @i915: drm fd
+ * @size: size of the batchbuffer
+ *
+ * Returns:
+ *
+ * Pointer the intel_bb, asserts on failure.
+ */
+struct intel_bb *intel_bb_create(int i915, uint32_t size)
+{
+	struct intel_bb *ibb = calloc(1, sizeof(*ibb));
+
+	igt_assert(ibb);
+
+	ibb->i915 = i915;
+	ibb->devid = intel_get_drm_devid(i915);
+	ibb->gen = intel_gen(ibb->devid);
+	ibb->handle = gem_create(i915, size);
+	ibb->size = size;
+	ibb->batch = calloc(1, size);
+	igt_assert(ibb->batch);
+	ibb->ptr = ibb->batch;
+	ibb->objects = NULL;
+
+	return ibb;
+}
+
+/**
+ * intel_bb_destroy:
+ * @ibb: pointer to intel_bb
+ *
+ * Frees all relocations / objects allocated during filling the batch.
+ */
+void intel_bb_destroy(struct intel_bb *ibb)
+{
+	uint32_t i;
+
+	igt_assert(ibb);
+
+	/* Free relocations */
+	for (i = 0; i < ibb->num_objects; i++) {
+		if ((void *) ibb->objects->relocs_ptr)
+			free(from_user_pointer(ibb->objects->relocs_ptr));
+	}
+
+	free(ibb->objects);
+
+	munmap(ibb->batch, ibb->size);
+	gem_close(ibb->i915, ibb->handle);
+
+	free(ibb);
+}
+
+/**
+ * intel_bb_set_debug:
+ * @ibb: pointer to intel_bb
+ * @debug: true / false
+ *
+ * Sets debug to true / false. Execbuf is then called synchronously and
+ * object/reloc arrays are printed after execution.
+ */
+void intel_bb_set_debug(struct intel_bb *ibb, bool debug)
+{
+	ibb->debug = debug;
+}
+
+/*
+ * intel_bb_add_handle:
+ * @ibb: pointer to intel_bb
+ * @handle: which handle to add to objects array
+ * @offset: presumed offset of the object when I915_EXEC_NO_RELOC flag is
+ * used in execbuf call
+ *
+ * Function allocates additional execobj slot in object array for a handle.
+ * For batchbuffer only presumed address is saved.
+ */
+static void intel_bb_add_handle(struct intel_bb *ibb,
+				uint32_t handle,
+				uint64_t offset)
+{
+	uint32_t i;
+
+	/* Skip bb as object, it will be added before exec */
+	if (ibb->handle == handle) {
+		igt_assert(ibb->batch_offset == 0 ||
+			   ibb->batch_offset == offset);
+		ibb->batch_offset = offset;
+		return;
+	}
+
+	for (i = 0; i < ibb->num_objects; i++)
+		if (ibb->objects[i].handle == handle)
+			return;
+
+	i = ibb->num_objects++;
+	ibb->objects = realloc(ibb->objects,
+			       sizeof(*ibb->objects) * (i + 1));
+	igt_assert(ibb->objects);
+
+	memset(&ibb->objects[i], 0, sizeof(*ibb->objects));
+	ibb->objects[i].handle = handle;
+	ibb->objects[i].offset = offset;
+}
+
+/*
+ * intel_bb_add_reloc:
+ * @ibb: pointer to intel_bb
+ * @handle: object handle which address will be taken to patch the bb
+ * @read_domains: gem domain bits for the relocation
+ * @write_domain: gem domain bit for the relocation
+ * @delta: delta value to add to @buffer's gpu address
+ * @offset: offset within bb to be patched
+ * @presumed_offset: address of the object in address space, important for
+ * I915_EXEC_NO_RELOC flag
+ *
+ * Function allocates additional relocation slot in reloc array for a handle.
+ */
+static void intel_bb_add_reloc(struct intel_bb *ibb,
+			       uint32_t handle,
+			       uint32_t read_domains,
+			       uint32_t write_domain,
+			       uint64_t delta,
+			       uint64_t offset,
+			       uint64_t presumed_offset)
+{
+	struct drm_i915_gem_relocation_entry *relocs;
+	uint32_t i;
+
+	intel_bb_add_handle(ibb, handle, presumed_offset);
+
+	relocs = ibb->relocs;
+	if (ibb->num_relocs == ibb->allocated_relocs) {
+		ibb->allocated_relocs += 4096 / sizeof(*relocs);
+		relocs = realloc(relocs, sizeof(*relocs) * ibb->allocated_relocs);
+		igt_assert(relocs);
+		ibb->relocs = relocs;
+	}
+
+	i = ibb->num_relocs++;
+	memset(&relocs[i], 0, sizeof(*relocs));
+	relocs[i].target_handle = handle;
+	relocs[i].read_domains = read_domains;
+	relocs[i].write_domain = write_domain;
+	relocs[i].delta = delta;
+	relocs[i].offset = offset;
+	relocs[i].presumed_offset = presumed_offset;
+
+	igt_debug("add reloc: handle: %u, r/w: 0x%x/0x%x, delta: 0x%lx, "
+		  "offset: 0x%lx, poffset: 0x%lx\n",
+		  handle, read_domains, write_domain,
+		  delta, offset, presumed_offset);
+}
+
+/**
+ * intel_bb_emit_reloc:
+ * @ibb: pointer to intel_bb
+ * @handle: object handle which address will be taken to patch the bb
+ * @read_domains: gem domain bits for the relocation
+ * @write_domain: gem domain bit for the relocation
+ * @delta: delta value to add to @buffer's gpu address
+ * @presumed_offset: address of the object in address space, important for
+ * I915_EXEC_NO_RELOC flag
+ *
+ * Function prepares relocation (execobj if required + reloc) and emits
+ * offset in bb. For I915_EXEC_NO_RELOC presumed_offset is a hint we already
+ * have object in valid place and relocation step can be skipped in this case.
+ *
+ * Note: delta is value added to address, mostly used when some instructions
+ * require modify-bit set to apply change. Which delta is valid depends
+ * on instruction (see instruction specification).
+ */
+void intel_bb_emit_reloc(struct intel_bb *ibb,
+			 uint32_t handle,
+			 uint32_t read_domains,
+			 uint32_t write_domain,
+			 uint64_t delta,
+			 uint64_t presumed_offset)
+{
+	igt_assert(ibb);
+
+	intel_bb_add_reloc(ibb, handle, read_domains, write_domain,
+			   delta, intel_bb_offset(ibb), presumed_offset);
+
+	intel_bb_out(ibb, delta + presumed_offset);
+	if (ibb->gen >= 8)
+		intel_bb_out(ibb, presumed_offset >> 32);
+}
+
+/**
+ * intel_bb_offset_reloc:
+ * @ibb: pointer to intel_bb
+ * @handle: object handle which address will be taken to patch the bb
+ * @read_domains: gem domain bits for the relocation
+ * @write_domain: gem domain bit for the relocation
+ * @offset: offset within bb to be patched
+ * @presumed_offset: address of the object in address space, important for
+ * I915_EXEC_NO_RELOC flag
+ *
+ * Function prepares relocation (execobj if required + reloc). It it used
+ * for editing batchbuffer via modifying structures. It means when we're
+ * preparing batchbuffer it is more descriptive to edit the structure
+ * than emitting dwords. But it require for some fields to point the
+ * relocation. For that case @offset is passed by the user and it points
+ * to the offset in bb where the relocation will be applied.
+ */
+void intel_bb_offset_reloc(struct intel_bb *ibb,
+			   uint32_t handle,
+			   uint32_t read_domains,
+			   uint32_t write_domain,
+			   uint32_t offset,
+			   uint64_t presumed_offset)
+{
+	igt_assert(ibb);
+
+	intel_bb_add_reloc(ibb, handle, read_domains, write_domain,
+			   0, offset, presumed_offset);
+}
+
+static void intel_bb_dump_execbuf(struct drm_i915_gem_execbuffer2 *execbuf)
+{
+	struct drm_i915_gem_exec_object2 *objects;
+	struct drm_i915_gem_relocation_entry *relocs, *reloc;
+	int i, j;
+
+	igt_info("execbuf batch len: %u, start offset: 0x%x, "
+		 "DR1: 0x%x, DR4: 0x%x, "
+		 "num clip: %u, clipptr: 0x%llx, "
+		 "flags: 0x%llx, rsvd1: 0x%llx, rsvd2: 0x%llx\n",
+		 execbuf->batch_len, execbuf->batch_start_offset,
+		 execbuf->DR1, execbuf->DR4,
+		 execbuf->num_cliprects, execbuf->cliprects_ptr,
+		 execbuf->flags, execbuf->rsvd1, execbuf->rsvd2);
+
+	igt_info("execbuf buffer_count: %d\n", execbuf->buffer_count);
+	for (i = 0; i < execbuf->buffer_count; i++) {
+		objects = &((struct drm_i915_gem_exec_object2 *) execbuf->buffers_ptr)[i];
+		relocs = (struct drm_i915_gem_relocation_entry *) objects->relocs_ptr;
+		igt_info(" [%d] <handle: %u, reloc_count: %d, reloc_ptr: %p, "
+			 "align: 0x%llx, offset: 0x%llx, flags: 0x%llx, "
+			 "rsvd1: 0x%llx, rsvd2: 0x%llx\n",
+			 i, objects->handle, objects->relocation_count,
+			 from_user_pointer(objects->relocs_ptr),
+			 objects->alignment,
+			 objects->offset, objects->flags,
+			 objects->rsvd1, objects->rsvd2);
+		if (objects->relocation_count) {
+			igt_info("execbuf relocs:\n");
+			for (j = 0; j < objects->relocation_count; j++) {
+				reloc = &relocs[j];
+				igt_info(" [%d] <target handle: %u, "
+					 "offset: %llx, delta: %x, "
+					 "presumed_offset: %llx, "
+					 "read_domains: %x, write_domain: %x\n",
+					 j, reloc->target_handle,
+					 reloc->offset, reloc->delta,
+					 reloc->presumed_offset,
+					 reloc->read_domains,
+					 reloc->write_domain);
+			}
+		}
+	}
+}
+
+/**
+ * intel_bb_exec:
+ * @ibb: pointer to intel_bb
+ * @end_offset: offset of the last instruction in the bb
+ * @flags: flags passed directly to execbuf
+ * @sync: if true wait for execbuf completion, otherwise caller is responsible
+ * to wait for completion
+ *
+ * Note: In this step execobj for bb is allocated and inserted to the objects
+ * array.
+*/
+void intel_bb_exec(struct intel_bb *ibb, uint32_t end_offset,
+		   uint64_t flags, bool sync)
+{
+	struct drm_i915_gem_execbuffer2 execbuf;
+	uint32_t i;
+
+	i = ibb->num_objects;
+
+	if (i == 0 || ibb->objects[i - 1].handle != ibb->handle) {
+		ibb->objects = realloc(ibb->objects, sizeof(*ibb->objects) * (i + 1));
+		igt_assert(ibb->objects);
+
+		gem_write(ibb->i915, ibb->handle, 0, ibb->batch, ibb->size);
+
+		memset(&ibb->objects[i], 0, sizeof(*ibb->objects));
+		ibb->objects[i].relocs_ptr = to_user_pointer(ibb->relocs);
+		ibb->objects[i].relocation_count = ibb->num_relocs;
+		ibb->objects[i].handle = ibb->handle;
+		ibb->objects[i].offset = ibb->batch_offset;
+		ibb->num_objects++;
+	}
+
+	memset(&execbuf, 0, sizeof(execbuf));
+	execbuf.buffers_ptr = (uintptr_t) ibb->objects;
+	execbuf.buffer_count = ibb->num_objects;
+	execbuf.batch_len = end_offset;
+	execbuf.flags = flags;
+
+	gem_execbuf(ibb->i915, &execbuf);
+
+	if (sync || ibb->debug)
+		gem_sync(ibb->i915, ibb->handle);
+
+	if (ibb->debug)
+		intel_bb_dump_execbuf(&execbuf);
+}
+
+/**
+ * intel_bb_get_presumed_address:
+ * @ibb: pointer to intel_bb
+ * @handle: object handle
+ *
+ * When objects addresses are previously pinned and we don't want to relocate
+ * we need to acquire them from previous execbuf. Function checks previous
+ * relocation entry for @handle and returns presumed_offset field.
+ */
+uint64_t intel_bb_get_presumed_offset(struct intel_bb *ibb, uint32_t handle)
+{
+	uint32_t i;
+
+	igt_assert(ibb);
+
+	for (i = 0; i < ibb->num_relocs; i++)
+		if (ibb->relocs[i].target_handle == handle)
+			return ibb->relocs[i].presumed_offset;
+
+	return 0;
+}
diff --git a/lib/intel_batchbuffer.h b/lib/intel_batchbuffer.h
index 442f3a18..c899ec9b 100644
--- a/lib/intel_batchbuffer.h
+++ b/lib/intel_batchbuffer.h
@@ -7,6 +7,7 @@
 
 #include "igt_core.h"
 #include "intel_reg.h"
+#include "drmtest.h"
 
 #define BATCH_SZ 4096
 #define BATCH_RESERVED 16
@@ -422,4 +423,85 @@ typedef void (*igt_media_spinfunc_t)(struct intel_batchbuffer *batch,
 
 igt_media_spinfunc_t igt_get_media_spinfunc(int devid);
 
+
+/*
+ * Batchbuffer without libdrm dependency
+ */
+struct intel_bb {
+	int i915;
+	int gen;
+	bool debug;
+	uint32_t devid;
+	uint32_t handle;
+	uint32_t size;
+	uint32_t *batch;
+	uint32_t *ptr;
+
+	struct drm_i915_gem_exec_object2 *objects;
+	uint32_t num_objects;
+	uint64_t batch_offset;
+
+	struct drm_i915_gem_relocation_entry *relocs;
+	uint32_t num_relocs;
+	uint32_t allocated_relocs;
+};
+
+struct intel_bb *intel_bb_create(int i915, uint32_t size);
+void intel_bb_destroy(struct intel_bb *ibb);
+void intel_bb_set_debug(struct intel_bb *ibb, bool debug);
+
+inline uint32_t intel_bb_offset(struct intel_bb *ibb)
+{
+	return (uint32_t) ((uint8_t *) ibb->ptr - (uint8_t *) ibb->batch);
+}
+
+inline void intel_bb_ptr_set(struct intel_bb *ibb, uint32_t offset)
+{
+	ibb->ptr = (void *) ((uint8_t *) ibb->batch + offset);
+
+	igt_assert(intel_bb_offset(ibb) < ibb->size);
+}
+
+inline void intel_bb_ptr_add(struct intel_bb *ibb, uint32_t offset)
+{
+	intel_bb_ptr_set(ibb, intel_bb_offset(ibb) + offset);
+}
+
+inline void intel_bb_ptr_align(struct intel_bb *ibb, uint32_t alignment)
+{
+	intel_bb_ptr_set(ibb, ALIGN(intel_bb_offset(ibb), alignment));
+}
+
+inline void *intel_bb_ptr(struct intel_bb *ibb)
+{
+	return (void *) ibb->ptr;
+}
+
+inline void intel_bb_out(struct intel_bb *ibb, uint32_t dword)
+{
+	*ibb->ptr = dword;
+	ibb->ptr++;
+
+	igt_assert(intel_bb_offset(ibb) < ibb->size);
+}
+
+void intel_bb_emit_reloc(struct intel_bb *ibb,
+			 uint32_t handle,
+			 uint32_t read_domains,
+			 uint32_t write_domain,
+			 uint64_t delta,
+			 uint64_t presumed_offset);
+
+void intel_bb_offset_reloc(struct intel_bb *ibb,
+			   uint32_t handle,
+			   uint32_t read_domains,
+			   uint32_t write_domain,
+			   uint32_t offset,
+			   uint64_t presumed_offset);
+
+void intel_bb_exec(struct intel_bb *ibb, uint32_t end_offset,
+		   uint64_t flags, bool sync);
+
+uint64_t intel_bb_get_presumed_offset(struct intel_bb *ibb, uint32_t handle);
+
 #endif
-- 
2.26.0

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [igt-dev] [PATCH i-g-t v2 4/7] lib/intel_batchbuffer: Introduce temporary igt_fillfunc_v2_t
  2020-05-15  6:44 [igt-dev] [PATCH i-g-t v2 0/7] Make gpgpu fill tests libdrm independent Zbigniew Kempczyński
                   ` (2 preceding siblings ...)
  2020-05-15  6:44 ` [igt-dev] [PATCH i-g-t v2 3/7] lib/intel_batchbuffer: Introduce intel_bb Zbigniew Kempczyński
@ 2020-05-15  6:44 ` Zbigniew Kempczyński
  2020-05-15  6:44 ` [igt-dev] [PATCH i-g-t v2 5/7] lib/gpu_cmds: Add gpgpu pipeline functions based on intel_bb Zbigniew Kempczyński
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Zbigniew Kempczyński @ 2020-05-15  6:44 UTC (permalink / raw)
  To: igt-dev; +Cc: Chris Wilson

gem_gpgpu_fill test is spread over different generations (gen >= 7)
so some transitional state is required until all gens will be
rewritten to new intel_bb code without libdrm dependency.

So, let's define new igt_fillfunc_v2_t to be new fill function.

Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
---
 lib/intel_batchbuffer.c | 19 +++++++++++++++++++
 lib/intel_batchbuffer.h |  8 ++++++++
 2 files changed, 27 insertions(+)

diff --git a/lib/intel_batchbuffer.c b/lib/intel_batchbuffer.c
index 965e07dd..f3908a90 100644
--- a/lib/intel_batchbuffer.c
+++ b/lib/intel_batchbuffer.c
@@ -1152,6 +1152,25 @@ igt_fillfunc_t igt_get_gpgpu_fillfunc(int devid)
 	return fill;
 }
 
+/**
+ * igt_get_gpgpu_fillfunc_v2:
+ * @devid: pci device id
+ *
+ * Returns:
+ *
+ * The platform-specific gpgpu fill function pointer for the device specified
+ * with @devid. Will return NULL when no gpgpu fill function is implemented.
+ */
+igt_fillfunc_v2_t igt_get_gpgpu_fillfunc_v2(int devid)
+{
+	igt_fillfunc_v2_t fill = NULL;
+
+	if (IS_GEN7(devid))
+		fill = gen7_gpgpu_fillfunc_v2;
+
+	return fill;
+}
+
 /**
  * igt_get_media_spinfunc:
  * @devid: pci device id
diff --git a/lib/intel_batchbuffer.h b/lib/intel_batchbuffer.h
index c899ec9b..09d8d46b 100644
--- a/lib/intel_batchbuffer.h
+++ b/lib/intel_batchbuffer.h
@@ -391,8 +391,16 @@ typedef void (*igt_fillfunc_t)(struct intel_batchbuffer *batch,
 			       unsigned width, unsigned height,
 			       uint8_t color);
 
+struct intel_buf;
+typedef void (*igt_fillfunc_v2_t)(int i915,
+				  struct intel_buf *buf,
+				  unsigned x, unsigned y,
+				  unsigned width, unsigned height,
+				  uint8_t color);
+
 igt_fillfunc_t igt_get_media_fillfunc(int devid);
 igt_fillfunc_t igt_get_gpgpu_fillfunc(int devid);
+igt_fillfunc_v2_t igt_get_gpgpu_fillfunc_v2(int devid);
 
 typedef void (*igt_vme_func_t)(struct intel_batchbuffer *batch,
 			       const struct igt_buf *src,
-- 
2.26.0

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [igt-dev] [PATCH i-g-t v2 5/7] lib/gpu_cmds: Add gpgpu pipeline functions based on intel_bb
  2020-05-15  6:44 [igt-dev] [PATCH i-g-t v2 0/7] Make gpgpu fill tests libdrm independent Zbigniew Kempczyński
                   ` (3 preceding siblings ...)
  2020-05-15  6:44 ` [igt-dev] [PATCH i-g-t v2 4/7] lib/intel_batchbuffer: Introduce temporary igt_fillfunc_v2_t Zbigniew Kempczyński
@ 2020-05-15  6:44 ` Zbigniew Kempczyński
  2020-05-15  6:44 ` [igt-dev] [PATCH i-g-t v2 6/7] lib/gpgpu_fill: libdrm-free gpgpu pipeline creation for gen7 Zbigniew Kempczyński
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Zbigniew Kempczyński @ 2020-05-15  6:44 UTC (permalink / raw)
  To: igt-dev; +Cc: Chris Wilson

Add no-libdrm functions which will replace libdrm version in the
final version.

Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
---
 lib/gpu_cmds.c | 342 +++++++++++++++++++++++++++++++++++++++++++++++++
 lib/gpu_cmds.h |  33 +++++
 2 files changed, 375 insertions(+)

diff --git a/lib/gpu_cmds.c b/lib/gpu_cmds.c
index dc0ae96c..e9c028f6 100644
--- a/lib/gpu_cmds.c
+++ b/lib/gpu_cmds.c
@@ -768,3 +768,345 @@ gen9_emit_state_base_address(struct intel_batchbuffer *batch)
 	OUT_BATCH(0);
 	OUT_BATCH(0xfffff000);
 }
+
+/*
+ * Here we start version of the gpgpu fill pipeline creation which is based
+ * on intel_bb.
+ */
+uint32_t
+gen7_fill_curbe_buffer_data_v2(struct intel_bb *ibb, uint8_t color)
+{
+	uint32_t *curbe_buffer;
+	uint32_t offset;
+
+	intel_bb_ptr_align(ibb, 64);
+	curbe_buffer = intel_bb_ptr(ibb);
+	offset = intel_bb_offset(ibb);
+
+	*curbe_buffer = color;
+	intel_bb_ptr_add(ibb, 32);
+
+	return offset;
+}
+
+static uint32_t
+gen7_fill_kernel_v2(struct intel_bb *ibb,
+		    const uint32_t kernel[][4],
+		    size_t size)
+{
+	uint32_t *kernel_dst;
+	uint32_t offset;
+
+	intel_bb_ptr_align(ibb, 64);
+	kernel_dst = intel_bb_ptr(ibb);
+	offset = intel_bb_offset(ibb);
+
+	memcpy(kernel_dst, kernel, size);
+
+	intel_bb_ptr_add(ibb, size);
+
+	return offset;
+}
+
+static uint32_t
+gen7_fill_surface_state_v2(struct intel_bb *ibb,
+			   struct intel_buf *buf,
+			   uint32_t format,
+			   int is_dst)
+{
+	struct gen7_surface_state *ss;
+	uint32_t write_domain, read_domain, offset;
+
+	if (is_dst) {
+		write_domain = read_domain = I915_GEM_DOMAIN_RENDER;
+	} else {
+		write_domain = 0;
+		read_domain = I915_GEM_DOMAIN_SAMPLER;
+	}
+
+	intel_bb_ptr_align(ibb, 64);
+	offset = intel_bb_offset(ibb);
+	ss = intel_bb_ptr(ibb);
+	intel_bb_ptr_add(ibb, 64);
+
+	ss->ss0.surface_type = SURFACE_2D;
+	ss->ss0.surface_format = format;
+	ss->ss0.render_cache_read_write = 1;
+
+	if (buf->tiling == I915_TILING_X)
+		ss->ss0.tiled_mode = 2;
+	else if (buf->tiling == I915_TILING_Y)
+		ss->ss0.tiled_mode = 3;
+
+	ss->ss1.base_addr = 0;
+
+	intel_bb_offset_reloc(ibb, buf->handle,
+			      read_domain, write_domain,
+			      offset + 4, 0x0);
+
+	ss->ss2.height = intel_buf_height(buf) - 1;
+	ss->ss2.width  = intel_buf_width(buf) - 1;
+	ss->ss3.pitch  = buf->stride - 1;
+
+	ss->ss7.shader_chanel_select_r = 4;
+	ss->ss7.shader_chanel_select_g = 5;
+	ss->ss7.shader_chanel_select_b = 6;
+	ss->ss7.shader_chanel_select_a = 7;
+
+	return offset;
+}
+
+static uint32_t
+gen8_fill_surface_state_v2(struct intel_bb *ibb,
+			   struct intel_buf *buf,
+			   uint32_t format,
+			   int is_dst)
+{
+	struct gen8_surface_state *ss;
+	uint32_t write_domain, read_domain, offset;
+
+	if (is_dst) {
+		write_domain = read_domain = I915_GEM_DOMAIN_RENDER;
+	} else {
+		write_domain = 0;
+		read_domain = I915_GEM_DOMAIN_SAMPLER;
+	}
+
+	intel_bb_ptr_align(ibb, 64);
+	offset = intel_bb_offset(ibb);
+	ss = intel_bb_ptr(ibb);
+	intel_bb_ptr_add(ibb, 64);
+
+	ss->ss0.surface_type = SURFACE_2D;
+	ss->ss0.surface_format = format;
+	ss->ss0.render_cache_read_write = 1;
+	ss->ss0.vertical_alignment = 1; /* align 4 */
+	ss->ss0.horizontal_alignment = 1; /* align 4 */
+
+	if (buf->tiling == I915_TILING_X)
+		ss->ss0.tiled_mode = 2;
+	else if (buf->tiling == I915_TILING_Y)
+		ss->ss0.tiled_mode = 3;
+
+	ss->ss8.base_addr = 0;
+
+	intel_bb_offset_reloc(ibb, buf->handle,
+			      read_domain, write_domain,
+			      offset + 4, 0x0);
+
+	ss->ss2.height = intel_buf_height(buf) - 1;
+	ss->ss2.width  = intel_buf_width(buf) - 1;
+	ss->ss3.pitch  = buf->stride - 1;
+
+	ss->ss7.shader_chanel_select_r = 4;
+	ss->ss7.shader_chanel_select_g = 5;
+	ss->ss7.shader_chanel_select_b = 6;
+	ss->ss7.shader_chanel_select_a = 7;
+
+	return offset;
+}
+
+static uint32_t
+gen7_fill_binding_table_v2(struct intel_bb *ibb,
+			   struct intel_buf *buf)
+{
+	uint32_t binding_table_offset;
+	uint32_t *binding_table;
+	uint32_t devid = intel_get_drm_devid(ibb->i915);
+
+	intel_bb_ptr_align(ibb, 64);
+	binding_table_offset = intel_bb_offset(ibb);
+	binding_table = intel_bb_ptr(ibb);
+	intel_bb_ptr_add(ibb, 64);
+
+	if (IS_GEN7(devid))
+		binding_table[0] = gen7_fill_surface_state_v2(ibb, buf,
+							      SURFACEFORMAT_R8_UNORM, 1);
+
+	else
+		binding_table[0] = gen8_fill_surface_state_v2(ibb, buf,
+							      SURFACEFORMAT_R8_UNORM, 1);
+
+	return binding_table_offset;
+}
+
+uint32_t
+gen7_fill_interface_descriptor_v2(struct intel_bb *ibb,
+				  struct intel_buf *buf,
+				  const uint32_t kernel[][4],
+				  size_t size)
+{
+	struct gen7_interface_descriptor_data *idd;
+	uint32_t offset;
+	uint32_t binding_table_offset, kernel_offset;
+
+	binding_table_offset = gen7_fill_binding_table_v2(ibb, buf);
+	kernel_offset = gen7_fill_kernel_v2(ibb, kernel, size);
+
+	intel_bb_ptr_align(ibb, 64);
+	idd = intel_bb_ptr(ibb);
+	offset = intel_bb_offset(ibb);
+
+	idd->desc0.kernel_start_pointer = (kernel_offset >> 6);
+
+	idd->desc1.single_program_flow = 1;
+	idd->desc1.floating_point_mode = GEN7_FLOATING_POINT_IEEE_754;
+
+	idd->desc2.sampler_count = 0;      /* 0 samplers used */
+	idd->desc2.sampler_state_pointer = 0;
+
+	idd->desc3.binding_table_entry_count = 0;
+	idd->desc3.binding_table_pointer = (binding_table_offset >> 5);
+
+	idd->desc4.constant_urb_entry_read_offset = 0;
+	idd->desc4.constant_urb_entry_read_length = 1; /* grf 1 */
+
+	intel_bb_ptr_add(ibb, sizeof(*idd));
+
+	return offset;
+}
+
+void
+gen7_emit_state_base_address_v2(struct intel_bb *ibb)
+{
+	intel_bb_out(ibb, GEN7_STATE_BASE_ADDRESS | (10 - 2));
+
+	/* general */
+	intel_bb_out(ibb, 0);
+
+	/* surface */
+	intel_bb_emit_reloc(ibb, ibb->handle,
+			    I915_GEM_DOMAIN_INSTRUCTION, 0,
+			    BASE_ADDRESS_MODIFY, 0x0);
+
+	/* dynamic */
+	intel_bb_emit_reloc(ibb, ibb->handle,
+			    I915_GEM_DOMAIN_INSTRUCTION, 0,
+			    BASE_ADDRESS_MODIFY, 0x0);
+
+	/* indirect */
+	intel_bb_out(ibb, 0);
+
+	/* instruction */
+	intel_bb_emit_reloc(ibb, ibb->handle,
+			    I915_GEM_DOMAIN_INSTRUCTION, 0,
+			    BASE_ADDRESS_MODIFY, 0x0);
+
+	/* general/dynamic/indirect/instruction access Bound */
+	intel_bb_out(ibb, 0);
+	intel_bb_out(ibb, 0 | BASE_ADDRESS_MODIFY);
+	intel_bb_out(ibb, 0);
+	intel_bb_out(ibb, 0 | BASE_ADDRESS_MODIFY);
+}
+
+void
+gen7_emit_vfe_state_v2(struct intel_bb *ibb, uint32_t threads,
+		       uint32_t urb_entries, uint32_t urb_size,
+		       uint32_t curbe_size, uint32_t mode)
+{
+	intel_bb_out(ibb, GEN7_MEDIA_VFE_STATE | (8 - 2));
+
+	/* scratch buffer */
+	intel_bb_out(ibb, 0);
+
+	/* number of threads & urb entries */
+	intel_bb_out(ibb, threads << 16 |
+		     urb_entries << 8 |
+		     mode << 2); /* GPGPU vs media mode */
+
+	intel_bb_out(ibb, 0);
+
+	/* urb entry size & curbe size */
+	intel_bb_out(ibb, urb_size << 16 |	/* in 256 bits unit */
+		     curbe_size);		/* in 256 bits unit */
+
+	/* scoreboard */
+	intel_bb_out(ibb, 0);
+	intel_bb_out(ibb, 0);
+	intel_bb_out(ibb, 0);
+}
+
+void
+gen7_emit_curbe_load_v2(struct intel_bb *ibb, uint32_t curbe_buffer)
+{
+	intel_bb_out(ibb, GEN7_MEDIA_CURBE_LOAD | (4 - 2));
+	intel_bb_out(ibb, 0);
+	/* curbe total data length */
+	intel_bb_out(ibb, 64);
+	/* curbe data start address, is relative to the dynamics base address */
+	intel_bb_out(ibb, curbe_buffer);
+}
+
+void
+gen7_emit_interface_descriptor_load_v2(struct intel_bb *ibb,
+				       uint32_t interface_descriptor)
+{
+	intel_bb_out(ibb, GEN7_MEDIA_INTERFACE_DESCRIPTOR_LOAD | (4 - 2));
+	intel_bb_out(ibb, 0);
+	/* interface descriptor data length */
+	if (ibb->gen == 7)
+		intel_bb_out(ibb, sizeof(struct gen7_interface_descriptor_data));
+	else
+		intel_bb_out(ibb, sizeof(struct gen8_interface_descriptor_data));
+	/* interface descriptor address, is relative to the dynamics base
+	 * address
+	 */
+	intel_bb_out(ibb, interface_descriptor);
+}
+
+void
+gen7_emit_gpgpu_walk_v2(struct intel_bb *ibb,
+			unsigned int x, unsigned int y,
+			unsigned int width, unsigned int height)
+{
+	uint32_t x_dim, y_dim, tmp, right_mask;
+
+	/*
+	 * Simply do SIMD16 based dispatch, so every thread uses
+	 * SIMD16 channels.
+	 *
+	 * Define our own thread group size, e.g 16x1 for every group, then
+	 * will have 1 thread each group in SIMD16 dispatch. So thread
+	 * width/height/depth are all 1.
+	 *
+	 * Then thread group X = width / 16 (aligned to 16)
+	 * thread group Y = height;
+	 */
+	x_dim = (width + 15) / 16;
+	y_dim = height;
+
+	tmp = width & 15;
+	if (tmp == 0)
+		right_mask = (1 << 16) - 1;
+	else
+		right_mask = (1 << tmp) - 1;
+
+	intel_bb_out(ibb, GEN7_GPGPU_WALKER | 9);
+
+	/* interface descriptor offset */
+	intel_bb_out(ibb, 0);
+
+	/* SIMD size, thread w/h/d */
+	intel_bb_out(ibb, 1 << 30 | /* SIMD16 */
+		  0 << 16 | /* depth:1 */
+		  0 << 8 | /* height:1 */
+		  0); /* width:1 */
+
+	/* thread group X */
+	intel_bb_out(ibb, 0);
+	intel_bb_out(ibb, x_dim);
+
+	/* thread group Y */
+	intel_bb_out(ibb, 0);
+	intel_bb_out(ibb, y_dim);
+
+	/* thread group Z */
+	intel_bb_out(ibb, 0);
+	intel_bb_out(ibb, 1);
+
+	/* right mask */
+	intel_bb_out(ibb, right_mask);
+
+	/* bottom mask, height 1, always 0xffffffff */
+	intel_bb_out(ibb, 0xffffffff);
+}
diff --git a/lib/gpu_cmds.h b/lib/gpu_cmds.h
index 1321af44..728b4e68 100644
--- a/lib/gpu_cmds.h
+++ b/lib/gpu_cmds.h
@@ -35,6 +35,7 @@
 #include "drmtest.h"
 #include "intel_batchbuffer.h"
 #include "intel_chipset.h"
+#include "intel_bufops.h"
 #include <assert.h>
 
 void
@@ -148,4 +149,36 @@ gen_emit_media_object(struct intel_batchbuffer *batch, unsigned int xoffset,
 void
 gen9_emit_state_base_address(struct intel_batchbuffer *batch);
 
+
+/* No libdrm */
+uint32_t
+gen7_fill_curbe_buffer_data_v2(struct intel_bb *ibb,
+			       uint8_t color);
+
+uint32_t
+gen7_fill_interface_descriptor_v2(struct intel_bb *ibb,
+				  struct intel_buf *buf,
+				  const uint32_t kernel[][4],
+				  size_t size);
+
+void
+gen7_emit_state_base_address_v2(struct intel_bb *ibb);
+
+void
+gen7_emit_vfe_state_v2(struct intel_bb *ibb, uint32_t threads,
+		       uint32_t urb_entries, uint32_t urb_size,
+		       uint32_t curbe_size, uint32_t mode);
+
+void
+gen7_emit_curbe_load_v2(struct intel_bb *ibb, uint32_t curbe_buffer);
+
+void
+gen7_emit_interface_descriptor_load_v2(struct intel_bb *ibb,
+				       uint32_t interface_descriptor);
+
+void
+gen7_emit_gpgpu_walk_v2(struct intel_bb *ibb,
+			unsigned int x, unsigned int y,
+			unsigned int width, unsigned int height);
+
 #endif /* GPU_CMDS_H */
-- 
2.26.0

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [igt-dev] [PATCH i-g-t v2 6/7] lib/gpgpu_fill: libdrm-free gpgpu pipeline creation for gen7
  2020-05-15  6:44 [igt-dev] [PATCH i-g-t v2 0/7] Make gpgpu fill tests libdrm independent Zbigniew Kempczyński
                   ` (4 preceding siblings ...)
  2020-05-15  6:44 ` [igt-dev] [PATCH i-g-t v2 5/7] lib/gpu_cmds: Add gpgpu pipeline functions based on intel_bb Zbigniew Kempczyński
@ 2020-05-15  6:44 ` Zbigniew Kempczyński
  2020-05-15  6:44 ` [igt-dev] [PATCH i-g-t v2 7/7] tests/gem_gpgpu_fill: Add gen7 version without libdrm dependency Zbigniew Kempczyński
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Zbigniew Kempczyński @ 2020-05-15  6:44 UTC (permalink / raw)
  To: igt-dev; +Cc: Chris Wilson

Provide pipeline for gpgpu fill for gen7.

Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
---
 lib/gpgpu_fill.c | 49 ++++++++++++++++++++++++++++++++++++++++++++++++
 lib/gpgpu_fill.h |  8 ++++++++
 2 files changed, 57 insertions(+)

diff --git a/lib/gpgpu_fill.c b/lib/gpgpu_fill.c
index 5660d4c0..cc38ccae 100644
--- a/lib/gpgpu_fill.c
+++ b/lib/gpgpu_fill.c
@@ -120,6 +120,7 @@ static const uint32_t gen12_gpgpu_kernel[][4] = {
  *
  */
 
+#define PAGE_SIZE 4096
 #define BATCH_STATE_SPLIT 2048
 /* VFE STATE params */
 #define THREADS 1
@@ -178,6 +179,54 @@ gen7_gpgpu_fillfunc(struct intel_batchbuffer *batch,
 	intel_batchbuffer_reset(batch);
 }
 
+void
+gen7_gpgpu_fillfunc_v2(int i915,
+		       struct intel_buf *buf,
+		       unsigned x, unsigned y,
+		       unsigned width, unsigned height,
+		       uint8_t color)
+{
+	struct intel_bb *ibb;
+	uint32_t curbe_buffer, interface_descriptor;
+
+	ibb = intel_bb_create(i915, PAGE_SIZE);
+	intel_bb_ptr_set(ibb, BATCH_STATE_SPLIT);
+
+	/* Fill curbe buffer data */
+	curbe_buffer = gen7_fill_curbe_buffer_data_v2(ibb, color);
+
+	/*
+	 * const buffer needs to fill for every thread, but as we have just 1
+	 * thread per every group, so need only one curbe data.
+	 * For each thread, just use thread group ID for buffer offset.
+	 */
+	interface_descriptor =
+			gen7_fill_interface_descriptor_v2(ibb, buf,
+							  gen7_gpgpu_kernel,
+							  sizeof(gen7_gpgpu_kernel));
+
+	intel_bb_ptr_set(ibb, 0);
+
+	/* GPGPU pipeline */
+	intel_bb_out(ibb, GEN7_PIPELINE_SELECT | PIPELINE_SELECT_GPGPU);
+
+	gen7_emit_state_base_address_v2(ibb);
+	gen7_emit_vfe_state_v2(ibb, THREADS, GEN7_GPGPU_URB_ENTRIES,
+			       GPGPU_URB_SIZE, GPGPU_CURBE_SIZE,
+			       GEN7_VFE_STATE_GPGPU_MODE);
+	gen7_emit_curbe_load_v2(ibb, curbe_buffer);
+	gen7_emit_interface_descriptor_load_v2(ibb, interface_descriptor);
+	gen7_emit_gpgpu_walk_v2(ibb, x, y, width, height);
+
+	intel_bb_out(ibb, MI_BATCH_BUFFER_END);
+	intel_bb_ptr_align(ibb, 32);
+
+	intel_bb_exec(ibb, intel_bb_offset(ibb),
+		      I915_EXEC_DEFAULT | I915_EXEC_NO_RELOC, true);
+
+	intel_bb_destroy(ibb);
+}
+
 void
 gen8_gpgpu_fillfunc(struct intel_batchbuffer *batch,
 		    const struct igt_buf *dst,
diff --git a/lib/gpgpu_fill.h b/lib/gpgpu_fill.h
index da7d646f..0ba3d033 100644
--- a/lib/gpgpu_fill.h
+++ b/lib/gpgpu_fill.h
@@ -28,6 +28,7 @@
 #define GPGPU_FILL_H
 
 #include "intel_batchbuffer.h"
+#include "intel_bufops.h"
 
 void
 gen7_gpgpu_fillfunc(struct intel_batchbuffer *batch,
@@ -36,6 +37,13 @@ gen7_gpgpu_fillfunc(struct intel_batchbuffer *batch,
 		    unsigned int width, unsigned int height,
 		    uint8_t color);
 
+void
+gen7_gpgpu_fillfunc_v2(int i915,
+		       struct intel_buf *buf,
+		       unsigned x, unsigned y,
+		       unsigned width, unsigned height,
+		       uint8_t color);
+
 void
 gen8_gpgpu_fillfunc(struct intel_batchbuffer *batch,
 		    const struct igt_buf *dst,
-- 
2.26.0

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [igt-dev] [PATCH i-g-t v2 7/7] tests/gem_gpgpu_fill: Add gen7 version without libdrm dependency
  2020-05-15  6:44 [igt-dev] [PATCH i-g-t v2 0/7] Make gpgpu fill tests libdrm independent Zbigniew Kempczyński
                   ` (5 preceding siblings ...)
  2020-05-15  6:44 ` [igt-dev] [PATCH i-g-t v2 6/7] lib/gpgpu_fill: libdrm-free gpgpu pipeline creation for gen7 Zbigniew Kempczyński
@ 2020-05-15  6:44 ` Zbigniew Kempczyński
  2020-05-15 10:04 ` [igt-dev] ✓ Fi.CI.BAT: success for Make gpgpu fill tests libdrm independent (rev2) Patchwork
  2020-05-15 11:44 ` [igt-dev] ✗ GitLab.Pipeline: warning " Patchwork
  8 siblings, 0 replies; 10+ messages in thread
From: Zbigniew Kempczyński @ 2020-05-15  6:44 UTC (permalink / raw)
  To: igt-dev; +Cc: Chris Wilson

Rewriting all gpgpu tests is time consuming, so provide single
gen7 version which can be litmus paper does change goes toward
appropriate direction or not. Gpgpu pipeline creation is a little
bit coupled (some functions are used in other gens) so providing
"v2" version of the same functions is necessary unless former
will have full replacement.

So gpgpu fill prefers now "newer" version of the same pipeline
creation which is libdrm-free.

Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
---
 tests/i915/gem_gpgpu_fill.c | 127 ++++++++++++++++++++++++++++--------
 1 file changed, 100 insertions(+), 27 deletions(-)

diff --git a/tests/i915/gem_gpgpu_fill.c b/tests/i915/gem_gpgpu_fill.c
index fb1758bd..ca6a9cf0 100644
--- a/tests/i915/gem_gpgpu_fill.c
+++ b/tests/i915/gem_gpgpu_fill.c
@@ -46,6 +46,7 @@
 #include "i915/gem.h"
 #include "igt.h"
 #include "intel_bufmgr.h"
+#include "intel_bufops.h"
 
 #define WIDTH 64
 #define HEIGHT 64
@@ -60,6 +61,7 @@ typedef struct {
 	uint32_t devid;
 	drm_intel_bufmgr *bufmgr;
 	uint8_t linear[WIDTH * HEIGHT];
+	struct buf_ops *bops;
 } data_t;
 
 static void scratch_buf_init(data_t *data, struct igt_buf *buf,
@@ -83,6 +85,34 @@ static void scratch_buf_init(data_t *data, struct igt_buf *buf,
 	buf->bpp = 32;
 }
 
+static struct intel_buf *
+create_buf(data_t *data, int width, int height, uint8_t color)
+{
+	struct intel_buf *buf;
+	uint8_t *ptr;
+	int i;
+
+	buf = calloc(1, sizeof(*buf));
+	igt_assert(buf);
+
+	/*
+	 * Legacy code uses 32 bpp after buffer creation.
+	 * Let's do the same due to keep shader intact.
+	 */
+	intel_buf_init(data->bops, buf, width/4, height, 32, 0,
+		       I915_TILING_NONE, 0);
+
+	ptr = gem_mmap__cpu_coherent(data->drm_fd,
+				     buf->handle, 0, buf->size, PROT_WRITE);
+
+	for (i = 0; i < buf->size; i++)
+		ptr[i] = color;
+
+	munmap(ptr, buf->size);
+
+	return buf;
+}
+
 static void
 scratch_buf_check(data_t *data, struct igt_buf *buf, int x, int y,
 		uint8_t color)
@@ -97,47 +127,90 @@ scratch_buf_check(data_t *data, struct igt_buf *buf, int x, int y,
 		     color, val, x, y);
 }
 
-igt_simple_main
+static void buf_check(uint8_t *ptr, int x, int y, uint8_t color)
+{
+	uint8_t val;
+
+	val = ptr[y * WIDTH + x];
+	igt_assert_f(val == color,
+		     "Expected 0x%02x, found 0x%02x at (%d,%d)\n",
+		     color, val, x, y);
+}
+
+static void no_libdrm(data_t *data, igt_fillfunc_v2_t fill)
+{
+	struct intel_buf *buf;
+	uint8_t *ptr;
+	int i, j;
+
+	buf = create_buf(data, WIDTH, HEIGHT, COLOR_C4);
+	ptr = gem_mmap__cpu_coherent(data->drm_fd, buf->handle,
+				     0, buf->size, PROT_READ);
+	for (i = 0; i < WIDTH; i++)
+		for (j = 0; j < HEIGHT; j++)
+			buf_check(ptr, i, j, COLOR_C4);
+
+	fill(data->drm_fd, buf, 0, 0, WIDTH / 2, HEIGHT / 2, COLOR_4C);
+
+	for (i = 0; i < WIDTH; i++)
+		for (j = 0; j < HEIGHT; j++)
+			if (i < WIDTH / 2 && j < HEIGHT / 2)
+				buf_check(ptr, i, j, COLOR_4C);
+			else
+				buf_check(ptr, i, j, COLOR_C4);
+
+	munmap(ptr, buf->size);
+}
+
+static void with_libdrm(data_t *data, igt_fillfunc_t fill)
 {
-	data_t data = {0, };
 	struct intel_batchbuffer *batch = NULL;
 	struct igt_buf dst;
-	igt_fillfunc_t gpgpu_fill = NULL;
 	int i, j;
 
+	batch = intel_batchbuffer_alloc(data->bufmgr, data->devid);
+	igt_assert(batch);
+
+	scratch_buf_init(data, &dst, WIDTH, HEIGHT, STRIDE, COLOR_C4);
+
+	for (i = 0; i < WIDTH; i++)
+		for (j = 0; j < HEIGHT; j++)
+			scratch_buf_check(data, &dst, i, j, COLOR_C4);
+
+	fill(batch, &dst, 0, 0, WIDTH / 2, HEIGHT / 2, COLOR_4C);
+
+	for (i = 0; i < WIDTH; i++)
+		for (j = 0; j < HEIGHT; j++)
+			if (i < WIDTH / 2 && j < HEIGHT / 2)
+				scratch_buf_check(data, &dst, i, j, COLOR_4C);
+			else
+				scratch_buf_check(data, &dst, i, j, COLOR_C4);
+
+}
+
+igt_simple_main
+{
+	data_t data = {0, };
+	igt_fillfunc_t gpgpu_fill = NULL;
+	igt_fillfunc_v2_t gpgpu_fill_v2 = NULL;
+
 	data.drm_fd = drm_open_driver_render(DRIVER_INTEL);
 	data.devid = intel_get_drm_devid(data.drm_fd);
 	igt_require_gem(data.drm_fd);
+	data.bops = buf_ops_create(data.drm_fd);
 
 	data.bufmgr = drm_intel_bufmgr_gem_init(data.drm_fd, 4096);
 	igt_assert(data.bufmgr);
+	drm_intel_bufmgr_set_debug(data.bufmgr, true);
 
 	gpgpu_fill = igt_get_gpgpu_fillfunc(data.devid);
+	gpgpu_fill_v2 = igt_get_gpgpu_fillfunc_v2(data.devid);
 
-	igt_require_f(gpgpu_fill,
+	igt_require_f(gpgpu_fill || gpgpu_fill_v2,
 		      "no gpgpu-fill function\n");
 
-	batch = intel_batchbuffer_alloc(data.bufmgr, data.devid);
-	igt_assert(batch);
-
-	scratch_buf_init(&data, &dst, WIDTH, HEIGHT, STRIDE, COLOR_C4);
-
-	for (i = 0; i < WIDTH; i++) {
-		for (j = 0; j < HEIGHT; j++) {
-			scratch_buf_check(&data, &dst, i, j, COLOR_C4);
-		}
-	}
-
-	gpgpu_fill(batch,
-		   &dst, 0, 0, WIDTH / 2, HEIGHT / 2,
-		   COLOR_4C);
-
-	for (i = 0; i < WIDTH; i++) {
-		for (j = 0; j < HEIGHT; j++) {
-			if (i < WIDTH / 2 && j < HEIGHT / 2)
-				scratch_buf_check(&data, &dst, i, j, COLOR_4C);
-			else
-				scratch_buf_check(&data, &dst, i, j, COLOR_C4);
-		}
-	}
+	if (gpgpu_fill_v2)
+		no_libdrm(&data, gpgpu_fill_v2);
+	else
+		with_libdrm(&data, gpgpu_fill);
 }
-- 
2.26.0

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [igt-dev] ✓ Fi.CI.BAT: success for Make gpgpu fill tests libdrm independent (rev2)
  2020-05-15  6:44 [igt-dev] [PATCH i-g-t v2 0/7] Make gpgpu fill tests libdrm independent Zbigniew Kempczyński
                   ` (6 preceding siblings ...)
  2020-05-15  6:44 ` [igt-dev] [PATCH i-g-t v2 7/7] tests/gem_gpgpu_fill: Add gen7 version without libdrm dependency Zbigniew Kempczyński
@ 2020-05-15 10:04 ` Patchwork
  2020-05-15 11:44 ` [igt-dev] ✗ GitLab.Pipeline: warning " Patchwork
  8 siblings, 0 replies; 10+ messages in thread
From: Patchwork @ 2020-05-15 10:04 UTC (permalink / raw)
  To: Zbigniew Kempczyński; +Cc: igt-dev

== Series Details ==

Series: Make gpgpu fill tests libdrm independent (rev2)
URL   : https://patchwork.freedesktop.org/series/77175/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_8486 -> IGTPW_4570
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

  External URL: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4570/index.html

Possible new issues
-------------------

  Here are the unknown changes that may have been introduced in IGTPW_4570:

### IGT changes ###

#### Suppressed ####

  The following results come from untrusted machines, tests, or statuses.
  They do not affect the overall result.

  * {igt@kms_flip@basic-flip-vs-wf_vblank@c-hdmi-a2}:
    - fi-bsw-n3050:       [PASS][1] -> [FAIL][2]
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8486/fi-bsw-n3050/igt@kms_flip@basic-flip-vs-wf_vblank@c-hdmi-a2.html
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4570/fi-bsw-n3050/igt@kms_flip@basic-flip-vs-wf_vblank@c-hdmi-a2.html

  
Known issues
------------

  Here are the changes found in IGTPW_4570 that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@i915_selftest@live@execlists:
    - fi-skl-6600u:       [PASS][3] -> [INCOMPLETE][4] ([i915#1795] / [i915#656])
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8486/fi-skl-6600u/igt@i915_selftest@live@execlists.html
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4570/fi-skl-6600u/igt@i915_selftest@live@execlists.html

  
  {name}: This element is suppressed. This means it is ignored when computing
          the status of the difference (SUCCESS, WARNING, or FAILURE).

  [i915#1795]: https://gitlab.freedesktop.org/drm/intel/issues/1795
  [i915#656]: https://gitlab.freedesktop.org/drm/intel/issues/656


Participating hosts (51 -> 44)
------------------------------

  Additional (1): fi-kbl-7560u 
  Missing    (8): fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-ctg-p8600 fi-hsw-4770 fi-byt-clapper fi-bdw-samus 


Build changes
-------------

  * CI: CI-20190529 -> None
  * IGT: IGT_5654 -> IGTPW_4570

  CI-20190529: 20190529
  CI_DRM_8486: f43bb5d8b1ed34a349ce5721ce5c064935a6cf6f @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_4570: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4570/index.html
  IGT_5654: 5637a466a0b09535517751608f5525a8b468a76b @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4570/index.html
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [igt-dev] ✗ GitLab.Pipeline: warning for Make gpgpu fill tests libdrm independent (rev2)
  2020-05-15  6:44 [igt-dev] [PATCH i-g-t v2 0/7] Make gpgpu fill tests libdrm independent Zbigniew Kempczyński
                   ` (7 preceding siblings ...)
  2020-05-15 10:04 ` [igt-dev] ✓ Fi.CI.BAT: success for Make gpgpu fill tests libdrm independent (rev2) Patchwork
@ 2020-05-15 11:44 ` Patchwork
  8 siblings, 0 replies; 10+ messages in thread
From: Patchwork @ 2020-05-15 11:44 UTC (permalink / raw)
  To: Zbigniew Kempczyński; +Cc: igt-dev

== Series Details ==

Series: Make gpgpu fill tests libdrm independent (rev2)
URL   : https://patchwork.freedesktop.org/series/77175/
State : warning

== Summary ==

Did not get list of undocumented tests for this run, something is wrong!

Other than that, pipeline status: FAILED.

see https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/pipelines/147191 for the overview.

build:tests-debian-meson-arm64 has failed (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/2701694):
  [9/324] Linking target tests/gem_exec_params.
  [10/324] Linking target tests/gen7_exec_parse.
  [11/324] Linking target tests/gem_exec_schedule.
  [12/324] Linking target tests/gen9_exec_parse.
  [13/324] Linking target tests/gem_exec_reloc.
  [14/324] Linking target tests/gem_exec_whisper.
  [15/324] Linking target tests/gem_gpgpu_fill.
  FAILED: tests/gem_gpgpu_fill 
  /usr/bin/aarch64-linux-gnu-gcc  -o tests/gem_gpgpu_fill 'tests/59830eb@@gem_gpgpu_fill@exe/i915_gem_gpgpu_fill.c.o' -Wl,--no-undefined -Wl,--as-needed -Wl,--start-group lib/libigt.so.0 /usr/lib/aarch64-linux-gnu/libcairo.so /usr/lib/aarch64-linux-gnu/libglib-2.0.so /usr/lib/aarch64-linux-gnu/libdrm.so /usr/lib/aarch64-linux-gnu/libdw.so /usr/lib/aarch64-linux-gnu/libelf.so /usr/lib/aarch64-linux-gnu/libkmod.so /usr/lib/aarch64-linux-gnu/libprocps.so /lib/aarch64-linux-gnu/libudev.so -lm /usr/lib/aarch64-linux-gnu/libpciaccess.so /usr/lib/aarch64-linux-gnu/libpixman-1.so -lrt -lz /usr/lib/aarch64-linux-gnu/libunwind.so /usr/lib/aarch64-linux-gnu/libgsl.so /usr/lib/aarch64-linux-gnu/libgslcblas.so -lm /usr/lib/aarch64-linux-gnu/libasound.so /usr/lib/aarch64-linux-gnu/libdrm_nouveau.so -Wl,--end-group -pthread '-Wl,-rpath,$ORIGIN/../lib' -Wl,-rpath-link,/builds/gfx-ci/igt-ci-tags/build/lib  
  /usr/lib/gcc-cross/aarch64-linux-gnu/8/../../../../aarch64-linux-gnu/bin/ld: tests/59830eb@@gem_gpgpu_fill@exe/i915_gem_gpgpu_fill.c.o: in function `__real_main191':
  /builds/gfx-ci/igt-ci-tags/build/../tests/i915/gem_gpgpu_fill.c:204: undefined reference to `drm_intel_bufmgr_set_debug'
  collect2: error: ld returned 1 exit status
  ninja: build stopped: subcommand failed.
  section_end:1589535724:build_script
  section_start:1589535724:after_script
  section_end:1589535725:after_script
  section_start:1589535725:upload_artifacts_on_failure
  section_end:1589535727:upload_artifacts_on_failure
  ERROR: Job failed: exit code 1
  

build:tests-debian-meson-armhf has failed (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/2701693):
  ../lib/intel_batchbuffer.c:1346:34: note: format string is defined here
       "offset: 0x%lx, poffset: 0x%lx\n",
                                  ~~^
                                  %llx
  ../lib/intel_batchbuffer.c: In function ‘intel_bb_dump_execbuf’:
  ../lib/intel_batchbuffer.c:1433:15: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
     objects = &((struct drm_i915_gem_exec_object2 *) execbuf->buffers_ptr)[i];
                 ^
  ../lib/intel_batchbuffer.c:1434:12: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
     relocs = (struct drm_i915_gem_relocation_entry *) objects->relocs_ptr;
              ^
  cc1: some warnings being treated as errors
  ninja: build stopped: subcommand failed.
  section_end:1589535705:build_script
  section_start:1589535705:after_script
  section_end:1589535707:after_script
  section_start:1589535707:upload_artifacts_on_failure
  section_end:1589535710:upload_artifacts_on_failure
  ERROR: Job failed: exit code 1
  

build:tests-debian-meson-mips has failed (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/2701695):
              ^
  ../lib/igt_core.h:1185:64: note: in definition of macro ‘igt_debug’
   #define igt_debug(f...) igt_log(IGT_LOG_DOMAIN, IGT_LOG_DEBUG, f)
                                                                  ^
  ../lib/intel_batchbuffer.c: In function ‘intel_bb_dump_execbuf’:
  ../lib/intel_batchbuffer.c:1433:15: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
     objects = &((struct drm_i915_gem_exec_object2 *) execbuf->buffers_ptr)[i];
                 ^
  ../lib/intel_batchbuffer.c:1434:12: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
     relocs = (struct drm_i915_gem_relocation_entry *) objects->relocs_ptr;
              ^
  cc1: some warnings being treated as errors
  ninja: build stopped: subcommand failed.
  section_end:1589535715:build_script
  section_start:1589535715:after_script
  section_end:1589535716:after_script
  section_start:1589535716:upload_artifacts_on_failure
  section_end:1589535718:upload_artifacts_on_failure
  ERROR: Job failed: exit code 1

== Logs ==

For more details see: https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/pipelines/147191
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2020-05-15 11:44 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-15  6:44 [igt-dev] [PATCH i-g-t v2 0/7] Make gpgpu fill tests libdrm independent Zbigniew Kempczyński
2020-05-15  6:44 ` [igt-dev] [PATCH i-g-t v2 1/7] lib/intel_bufops: Add bufops reference and relaxate stride requirement Zbigniew Kempczyński
2020-05-15  6:44 ` [igt-dev] [PATCH i-g-t v2 2/7] lib/rendercopy_bufmgr: Pass alignment during buffer initialization Zbigniew Kempczyński
2020-05-15  6:44 ` [igt-dev] [PATCH i-g-t v2 3/7] lib/intel_batchbuffer: Introduce intel_bb Zbigniew Kempczyński
2020-05-15  6:44 ` [igt-dev] [PATCH i-g-t v2 4/7] lib/intel_batchbuffer: Introduce temporary igt_fillfunc_v2_t Zbigniew Kempczyński
2020-05-15  6:44 ` [igt-dev] [PATCH i-g-t v2 5/7] lib/gpu_cmds: Add gpgpu pipeline functions based on intel_bb Zbigniew Kempczyński
2020-05-15  6:44 ` [igt-dev] [PATCH i-g-t v2 6/7] lib/gpgpu_fill: libdrm-free gpgpu pipeline creation for gen7 Zbigniew Kempczyński
2020-05-15  6:44 ` [igt-dev] [PATCH i-g-t v2 7/7] tests/gem_gpgpu_fill: Add gen7 version without libdrm dependency Zbigniew Kempczyński
2020-05-15 10:04 ` [igt-dev] ✓ Fi.CI.BAT: success for Make gpgpu fill tests libdrm independent (rev2) Patchwork
2020-05-15 11:44 ` [igt-dev] ✗ GitLab.Pipeline: warning " Patchwork

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.