Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t] lib/huc_copy: Use softpinning for Gen12+ platforms.
@ 2023-03-16 11:30 Vikas Srivastava
  2023-03-16 12:17 ` [igt-dev] ✗ Fi.CI.BAT: failure for lib/huc_copy: Use softpinning for Gen12+ platforms. (rev2) Patchwork
  0 siblings, 1 reply; 2+ messages in thread
From: Vikas Srivastava @ 2023-03-16 11:30 UTC (permalink / raw)
  To: igt-dev

From: Tony Ye <tony.ye@intel.com>

Stop using relocs and the legacy execbuf flags.

Signed-off-by: Tony Ye <tony.ye@intel.com>
Co-developed-by: Vikas Srivastava <vikas.srivastava@intel.com>
Signed-off-by: Vikas Srivastava <vikas.srivastava@intel.com>
---
 lib/huc_copy.c          | 80 +++++++++++++++++++++++++++++++++++++++++
 lib/huc_copy.h          |  4 +++
 lib/intel_batchbuffer.c |  8 +++--
 3 files changed, 90 insertions(+), 2 deletions(-)

diff --git a/lib/huc_copy.c b/lib/huc_copy.c
index bf8254c612..97643f07f7 100644
--- a/lib/huc_copy.c
+++ b/lib/huc_copy.c
@@ -26,6 +26,8 @@
 #include "drmtest.h"
 #include "huc_copy.h"
 #include "intel_allocator.h"
+#include "intel_ctx.h"
+#include "i915/gem_engine_topology.h"
 
 static void
 gen9_emit_huc_virtual_addr_state(struct drm_i915_gem_exec_object2 *src,
@@ -123,3 +125,81 @@ gen9_huc_copyfunc(int fd, uint64_t ahnd,
 
 	gem_execbuf(fd, &execbuf);
 }
+
+static void
+gen12_emit_huc_virtual_addr_state(struct drm_i915_gem_exec_object2 *src,
+				  struct drm_i915_gem_exec_object2 *dst,
+				  uint32_t *buf,
+				  int *i)
+{
+	buf[(*i)++] = HUC_VIRTUAL_ADDR_STATE;
+
+	igt_assert((src->offset + sizeof(src->offset)) <= 32 || \
+	(dst->offset + sizeof(dst->offset)) <= 32);
+	for (int j = 0; j < HUC_VIRTUAL_ADDR_REGION_NUM; j++) {
+		if (j == HUC_VIRTUAL_ADDR_REGION_SRC) {
+			buf[(*i)++] = upper_32_bits(src->offset);
+		} else if (j == HUC_VIRTUAL_ADDR_REGION_DST) {
+			buf[(*i)++] = upper_32_bits(dst->offset);
+		} else {
+			buf[(*i)++] = 0;
+			buf[(*i)++] = 0;
+		}
+
+		buf[(*i)++] = 0;
+	}
+}
+
+void
+gen12_huc_copyfunc(int fd, uint64_t ahnd,
+		  struct drm_i915_gem_exec_object2 *obj, uint64_t *objsize)
+{
+	struct drm_i915_gem_execbuffer2 execbuf;
+	int i = 0;
+	uint32_t buf[63];
+	const intel_ctx_t *ctx;
+
+	/* load huc kernel */
+	buf[i++] = HUC_IMEM_STATE;
+	buf[i++] = 0;
+	buf[i++] = 0;
+	buf[i++] = 0;
+	buf[i++] = 0x3;
+
+	buf[i++] = MFX_WAIT;
+	buf[i++] = MFX_WAIT;
+
+	buf[i++] = HUC_PIPE_MODE_SELECT;
+	buf[i++] = 0;
+	buf[i++] = 0;
+
+	buf[i++] = MFX_WAIT;
+
+	obj[0].offset = get_offset(ahnd, obj[0].handle, objsize[0], 0);
+	obj[0].flags |= EXEC_OBJECT_PINNED;
+	obj[1].offset = get_offset(ahnd, obj[1].handle, objsize[1], 0);
+	obj[1].flags |= EXEC_OBJECT_PINNED;
+	obj[1].flags |= EXEC_OBJECT_WRITE;
+	obj[2].offset = get_offset(ahnd, obj[2].handle, objsize[2], 0);
+	obj[2].flags |= EXEC_OBJECT_PINNED;
+	gen12_emit_huc_virtual_addr_state(&obj[0], &obj[1], buf, &i);
+
+	buf[i++] = HUC_START;
+	buf[i++] = 1;
+
+	buf[i++] = MI_BATCH_BUFFER_END;
+
+	gem_write(fd, obj[2].handle, 0, buf, sizeof(buf));
+
+	memset(&execbuf, 0, sizeof(execbuf));
+	execbuf.buffers_ptr = to_user_pointer(obj);
+	execbuf.buffer_count = 3;
+	execbuf.flags = I915_EXEC_DEFAULT;
+
+	ctx = intel_ctx_create_for_engine(fd, I915_ENGINE_CLASS_VIDEO, 0);
+	execbuf.rsvd1 = ctx->id;
+
+	gem_execbuf(fd, &execbuf);
+
+	intel_ctx_destroy(fd, ctx);
+}
diff --git a/lib/huc_copy.h b/lib/huc_copy.h
index 1789e87359..4ee7de1288 100644
--- a/lib/huc_copy.h
+++ b/lib/huc_copy.h
@@ -46,4 +46,8 @@ void
 gen9_huc_copyfunc(int fd, uint64_t ahnd,
 		  struct drm_i915_gem_exec_object2 *obj, uint64_t *objsize);
 
+void
+gen12_huc_copyfunc(int fd, uint64_t ahnd,
+		   struct drm_i915_gem_exec_object2 *obj, uint64_t *objsize);
+
 #endif /* HUC_COPY_H */
diff --git a/lib/intel_batchbuffer.c b/lib/intel_batchbuffer.c
index 8695f1b7ac..fa90f6b19e 100644
--- a/lib/intel_batchbuffer.c
+++ b/lib/intel_batchbuffer.c
@@ -2504,14 +2504,18 @@ void intel_bb_copy_intel_buf(struct intel_bb *ibb,
  * Returns:
  *
  * The platform-specific huc copy function pointer for the device specified
- * with @devid. Will return NULL when no media spin function is implemented.
+ * with @devid. Will return NULL when no huc copy function is implemented.
  */
 igt_huc_copyfunc_t igt_get_huc_copyfunc(int devid)
 {
 	igt_huc_copyfunc_t copy = NULL;
 
-	if (IS_GEN12(devid) || IS_GEN11(devid) || IS_GEN9(devid))
+	if (AT_LEAST_GEN(devid, 12))
+		copy = gen12_huc_copyfunc;
+	else if (IS_GEN11(devid) || IS_GEN9(devid))
 		copy = gen9_huc_copyfunc;
+	else
+		copy = NULL;
 
 	return copy;
 }
-- 
2.25.1

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

* [igt-dev] ✗ Fi.CI.BAT: failure for lib/huc_copy: Use softpinning for Gen12+ platforms. (rev2)
  2023-03-16 11:30 [igt-dev] [PATCH i-g-t] lib/huc_copy: Use softpinning for Gen12+ platforms Vikas Srivastava
@ 2023-03-16 12:17 ` Patchwork
  0 siblings, 0 replies; 2+ messages in thread
From: Patchwork @ 2023-03-16 12:17 UTC (permalink / raw)
  To: Vikas Srivastava; +Cc: igt-dev

[-- Attachment #1: Type: text/plain, Size: 10103 bytes --]

== Series Details ==

Series: lib/huc_copy: Use softpinning for Gen12+ platforms. (rev2)
URL   : https://patchwork.freedesktop.org/series/115257/
State : failure

== Summary ==

CI Bug Log - changes from IGT_7198 -> IGTPW_8623
====================================================

Summary
-------

  **FAILURE**

  Serious unknown changes coming with IGTPW_8623 absolutely need to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in IGTPW_8623, please notify your bug team to allow them
  to document this new failure mode, which will reduce false positives in CI.

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

Participating hosts (38 -> 36)
------------------------------

  Missing    (2): fi-snb-2520m fi-pnv-d510 

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

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

### IGT changes ###

#### Possible regressions ####

  * igt@gem_huc_copy@huc-copy:
    - bat-adln-1:         [PASS][1] -> [FAIL][2]
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7198/bat-adln-1/igt@gem_huc_copy@huc-copy.html
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8623/bat-adln-1/igt@gem_huc_copy@huc-copy.html
    - bat-dg2-8:          [PASS][3] -> [FAIL][4]
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7198/bat-dg2-8/igt@gem_huc_copy@huc-copy.html
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8623/bat-dg2-8/igt@gem_huc_copy@huc-copy.html
    - bat-adlm-1:         [PASS][5] -> [FAIL][6]
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7198/bat-adlm-1/igt@gem_huc_copy@huc-copy.html
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8623/bat-adlm-1/igt@gem_huc_copy@huc-copy.html
    - bat-rplp-1:         [PASS][7] -> [FAIL][8]
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7198/bat-rplp-1/igt@gem_huc_copy@huc-copy.html
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8623/bat-rplp-1/igt@gem_huc_copy@huc-copy.html
    - bat-dg2-9:          [PASS][9] -> [FAIL][10]
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7198/bat-dg2-9/igt@gem_huc_copy@huc-copy.html
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8623/bat-dg2-9/igt@gem_huc_copy@huc-copy.html
    - bat-rpls-1:         [PASS][11] -> [FAIL][12]
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7198/bat-rpls-1/igt@gem_huc_copy@huc-copy.html
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8623/bat-rpls-1/igt@gem_huc_copy@huc-copy.html
    - bat-adls-5:         [PASS][13] -> [FAIL][14]
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7198/bat-adls-5/igt@gem_huc_copy@huc-copy.html
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8623/bat-adls-5/igt@gem_huc_copy@huc-copy.html
    - bat-dg1-5:          [PASS][15] -> [FAIL][16]
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7198/bat-dg1-5/igt@gem_huc_copy@huc-copy.html
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8623/bat-dg1-5/igt@gem_huc_copy@huc-copy.html
    - bat-atsm-1:         [PASS][17] -> [FAIL][18]
   [17]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7198/bat-atsm-1/igt@gem_huc_copy@huc-copy.html
   [18]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8623/bat-atsm-1/igt@gem_huc_copy@huc-copy.html
    - bat-dg1-7:          [PASS][19] -> [FAIL][20]
   [19]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7198/bat-dg1-7/igt@gem_huc_copy@huc-copy.html
   [20]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8623/bat-dg1-7/igt@gem_huc_copy@huc-copy.html
    - bat-adlp-9:         [PASS][21] -> [FAIL][22]
   [21]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7198/bat-adlp-9/igt@gem_huc_copy@huc-copy.html
   [22]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8623/bat-adlp-9/igt@gem_huc_copy@huc-copy.html
    - bat-dg2-11:         [PASS][23] -> [FAIL][24]
   [23]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7198/bat-dg2-11/igt@gem_huc_copy@huc-copy.html
   [24]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8623/bat-dg2-11/igt@gem_huc_copy@huc-copy.html
    - bat-dg1-6:          [PASS][25] -> [FAIL][26]
   [25]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7198/bat-dg1-6/igt@gem_huc_copy@huc-copy.html
   [26]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8623/bat-dg1-6/igt@gem_huc_copy@huc-copy.html

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

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

### IGT changes ###

#### Issues hit ####

  * igt@gem_lmem_swapping@basic:
    - bat-adln-1:         NOTRUN -> [SKIP][27] ([i915#4613]) +3 similar issues
   [27]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8623/bat-adln-1/igt@gem_lmem_swapping@basic.html

  * igt@i915_pm_rps@basic-api:
    - bat-adln-1:         NOTRUN -> [SKIP][28] ([i915#6621])
   [28]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8623/bat-adln-1/igt@i915_pm_rps@basic-api.html

  * igt@i915_selftest@live@execlists:
    - fi-bsw-nick:        [PASS][29] -> [ABORT][30] ([i915#7911] / [i915#7913])
   [29]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7198/fi-bsw-nick/igt@i915_selftest@live@execlists.html
   [30]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8623/fi-bsw-nick/igt@i915_selftest@live@execlists.html

  * igt@i915_selftest@live@gt_lrc:
    - bat-adln-1:         NOTRUN -> [INCOMPLETE][31] ([i915#4983] / [i915#7609])
   [31]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8623/bat-adln-1/igt@i915_selftest@live@gt_lrc.html

  * igt@i915_selftest@live@slpc:
    - bat-rpls-1:         [PASS][32] -> [DMESG-FAIL][33] ([i915#6367])
   [32]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7198/bat-rpls-1/igt@i915_selftest@live@slpc.html
   [33]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8623/bat-rpls-1/igt@i915_selftest@live@slpc.html

  * igt@kms_chamelium_hpd@common-hpd-after-suspend:
    - fi-bsw-n3050:       NOTRUN -> [SKIP][34] ([fdo#109271])
   [34]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8623/fi-bsw-n3050/igt@kms_chamelium_hpd@common-hpd-after-suspend.html
    - bat-rpls-1:         NOTRUN -> [SKIP][35] ([i915#7828])
   [35]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8623/bat-rpls-1/igt@kms_chamelium_hpd@common-hpd-after-suspend.html

  * igt@kms_pipe_crc_basic@read-crc:
    - bat-adlp-9:         NOTRUN -> [SKIP][36] ([i915#3546]) +1 similar issue
   [36]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8623/bat-adlp-9/igt@kms_pipe_crc_basic@read-crc.html

  * igt@kms_pipe_crc_basic@suspend-read-crc:
    - bat-rpls-1:         NOTRUN -> [SKIP][37] ([i915#1845])
   [37]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8623/bat-rpls-1/igt@kms_pipe_crc_basic@suspend-read-crc.html

  * igt@prime_vgem@basic-userptr:
    - bat-adln-1:         NOTRUN -> [SKIP][38] ([fdo#109295] / [i915#3301])
   [38]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8623/bat-adln-1/igt@prime_vgem@basic-userptr.html

  * igt@prime_vgem@basic-write:
    - bat-adln-1:         NOTRUN -> [SKIP][39] ([fdo#109295] / [i915#3291]) +2 similar issues
   [39]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8623/bat-adln-1/igt@prime_vgem@basic-write.html

  
#### Possible fixes ####

  * igt@gem_exec_suspend@basic-s3@smem:
    - bat-rpls-1:         [ABORT][40] ([i915#6687] / [i915#7978]) -> [PASS][41]
   [40]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7198/bat-rpls-1/igt@gem_exec_suspend@basic-s3@smem.html
   [41]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8623/bat-rpls-1/igt@gem_exec_suspend@basic-s3@smem.html

  * igt@i915_pm_rpm@basic-rte:
    - bat-adln-1:         [ABORT][42] ([i915#7977]) -> [PASS][43]
   [42]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7198/bat-adln-1/igt@i915_pm_rpm@basic-rte.html
   [43]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8623/bat-adln-1/igt@i915_pm_rpm@basic-rte.html

  * igt@i915_selftest@live@execlists:
    - fi-bsw-n3050:       [ABORT][44] -> [PASS][45]
   [44]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7198/fi-bsw-n3050/igt@i915_selftest@live@execlists.html
   [45]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8623/fi-bsw-n3050/igt@i915_selftest@live@execlists.html

  * igt@i915_selftest@live@migrate:
    - bat-dg2-11:         [DMESG-WARN][46] ([i915#7699]) -> [PASS][47]
   [46]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7198/bat-dg2-11/igt@i915_selftest@live@migrate.html
   [47]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8623/bat-dg2-11/igt@i915_selftest@live@migrate.html

  
  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [fdo#109295]: https://bugs.freedesktop.org/show_bug.cgi?id=109295
  [i915#1845]: https://gitlab.freedesktop.org/drm/intel/issues/1845
  [i915#3291]: https://gitlab.freedesktop.org/drm/intel/issues/3291
  [i915#3301]: https://gitlab.freedesktop.org/drm/intel/issues/3301
  [i915#3546]: https://gitlab.freedesktop.org/drm/intel/issues/3546
  [i915#4613]: https://gitlab.freedesktop.org/drm/intel/issues/4613
  [i915#4983]: https://gitlab.freedesktop.org/drm/intel/issues/4983
  [i915#6367]: https://gitlab.freedesktop.org/drm/intel/issues/6367
  [i915#6621]: https://gitlab.freedesktop.org/drm/intel/issues/6621
  [i915#6687]: https://gitlab.freedesktop.org/drm/intel/issues/6687
  [i915#7609]: https://gitlab.freedesktop.org/drm/intel/issues/7609
  [i915#7699]: https://gitlab.freedesktop.org/drm/intel/issues/7699
  [i915#7828]: https://gitlab.freedesktop.org/drm/intel/issues/7828
  [i915#7911]: https://gitlab.freedesktop.org/drm/intel/issues/7911
  [i915#7913]: https://gitlab.freedesktop.org/drm/intel/issues/7913
  [i915#7977]: https://gitlab.freedesktop.org/drm/intel/issues/7977
  [i915#7978]: https://gitlab.freedesktop.org/drm/intel/issues/7978


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

  * CI: CI-20190529 -> None
  * IGT: IGT_7198 -> IGTPW_8623

  CI-20190529: 20190529
  CI_DRM_12867: 67d4276f8342780b8eaa6e9f5c15d979254a5675 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_8623: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8623/index.html
  IGT_7198: 17eeb3995c74f32ce6338b9e7dcd118c1104aebb @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8623/index.html

[-- Attachment #2: Type: text/html, Size: 11335 bytes --]

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

end of thread, other threads:[~2023-03-16 12:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-16 11:30 [igt-dev] [PATCH i-g-t] lib/huc_copy: Use softpinning for Gen12+ platforms Vikas Srivastava
2023-03-16 12:17 ` [igt-dev] ✗ Fi.CI.BAT: failure for lib/huc_copy: Use softpinning for Gen12+ platforms. (rev2) Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox