All of lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t] tests/i915/gem_huc_copy: Enable a HuC copy test
@ 2019-12-19 23:50 Robert M. Fosha
  2019-12-20  0:34 ` [igt-dev] ✗ GitLab.Pipeline: warning for " Patchwork
                   ` (12 more replies)
  0 siblings, 13 replies; 25+ messages in thread
From: Robert M. Fosha @ 2019-12-19 23:50 UTC (permalink / raw)
  To: igt-dev; +Cc: Sally Qi

From: Sally Qi <feng.qi@intel.com>

This test case loads the HuC copy firmware to copy the content of
the source buffer to the destination buffer.

v2: (Tony Ye)
 * Restructured some functions and files.
 * Defined the copy buffer size as 4K explicitly as the HuC Copy kernel
   always copy 4K bytes from src buffer to dst buffer.

v3: (Feng Qi, Antonio Argenziano, Tony Ye)
 * Restructured some functions as igt requested, exclude libdrm function call.
 * Remove huc function wrappers
 * Random initialize source input buffer

Signed-off-by: Sally Qi <feng.qi@intel.com>
Signed-off-by: Tony Ye <tony.ye@intel.com>
---
 lib/Makefile.sources      |   2 +
 lib/huc_copy.c            | 109 +++++++++++++++++++++++++++++++++++++
 lib/huc_copy.h            |  51 ++++++++++++++++++
 lib/intel_batchbuffer.c   |  20 +++++++
 lib/intel_batchbuffer.h   |  19 +++++++
 lib/meson.build           |   1 +
 tests/Makefile.sources    |   3 ++
 tests/i915/gem_huc_copy.c | 111 ++++++++++++++++++++++++++++++++++++++
 tests/meson.build         |   1 +
 9 files changed, 317 insertions(+)
 create mode 100644 lib/huc_copy.c
 create mode 100644 lib/huc_copy.h
 create mode 100644 tests/i915/gem_huc_copy.c

diff --git a/lib/Makefile.sources b/lib/Makefile.sources
index 5dd3962e..e9e132c1 100644
--- a/lib/Makefile.sources
+++ b/lib/Makefile.sources
@@ -78,6 +78,8 @@ lib_source_list =	 	\
 	ioctl_wrappers.h	\
 	media_fill.c		\
 	media_fill.h            \
+	huc_copy.c		\
+	huc_copy.h		\
 	media_spin.h		\
 	media_spin.c		\
 	gpgpu_fill.h		\
diff --git a/lib/huc_copy.c b/lib/huc_copy.c
new file mode 100644
index 00000000..32541157
--- /dev/null
+++ b/lib/huc_copy.c
@@ -0,0 +1,109 @@
+/*
+ * Copyright © 2019 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ *
+ */
+
+#include <i915_drm.h>
+#include "huc_copy.h"
+
+static void
+gen9_emit_huc_virtual_addr_state(struct drm_i915_gem_exec_object2 *src,
+		struct drm_i915_gem_exec_object2 *dst,
+		struct drm_i915_gem_relocation_entry *reloc_src,
+		struct drm_i915_gem_relocation_entry *reloc_dst,
+		uint32_t *buf,
+		int *i)
+{
+	buf[(*i)++] = HUC_VIRTUAL_ADDR_STATE;
+
+	for (int j = 0; j < HUC_VIRTUAL_ADDR_REGION_NUM; j++) {
+		if (j == HUC_VIRTUAL_ADDR_REGION_SRC) {
+			buf[(*i)++] = src->offset;
+
+			reloc_src->target_handle = src->handle;
+			reloc_src->delta = 0;
+			reloc_src->offset = (*i - 1) * sizeof(buf[0]);
+			reloc_src->read_domains = 0;
+			reloc_src->write_domain = 0;
+		} else if (j == HUC_VIRTUAL_ADDR_REGION_DST) {
+			buf[(*i)++] = dst->offset;
+
+			reloc_dst->target_handle = dst->handle;
+			reloc_dst->delta = 0;
+			reloc_dst->offset = (*i - 1) * sizeof(buf[0]);
+			reloc_dst->read_domains = 0;
+			reloc_dst->write_domain = I915_GEM_DOMAIN_RENDER;
+		} else {
+			buf[(*i)++] = 0;
+		}
+		buf[(*i)++] = 0;
+		buf[(*i)++] = 0;
+	}
+}
+
+void
+gen9_huc_copyfunc(int fd,
+		struct drm_i915_gem_exec_object2 *src,
+		struct drm_i915_gem_exec_object2 *dst,
+		struct drm_i915_gem_exec_object2 *exec)
+{
+	struct drm_i915_gem_relocation_entry reloc[2];
+	struct drm_i915_gem_execbuffer2 execbuf;
+	int i = 0;
+	uint32_t buf[63];
+
+	/* 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;
+
+	memset(reloc, 0, sizeof(reloc));
+	gen9_emit_huc_virtual_addr_state(src, dst, &reloc[0], &reloc[1], buf, &i);
+
+	buf[i++] = HUC_START;
+	buf[i++] = 1;
+
+	buf[i++] = MI_BATCH_BUFFER_END;
+
+	gem_write(fd, exec->handle, 0, buf, sizeof(buf));
+	exec->relocation_count = 2;
+	exec->relocs_ptr = to_user_pointer(reloc);
+
+	memset(&execbuf, 0, sizeof(execbuf));
+	execbuf.buffers_ptr = to_user_pointer(src);
+	execbuf.buffer_count = 3;
+	execbuf.flags = I915_EXEC_BSD;
+
+	gem_execbuf(fd, &execbuf);
+	gem_close(fd, exec->handle);
+}
diff --git a/lib/huc_copy.h b/lib/huc_copy.h
new file mode 100644
index 00000000..c435f6cb
--- /dev/null
+++ b/lib/huc_copy.h
@@ -0,0 +1,51 @@
+/*
+ * Copyright © 2019 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ *
+ */
+
+#ifndef HUC_COPY_H
+#define HUC_COPY_H
+
+#include <stdint.h>
+#include <string.h>
+#include "ioctl_wrappers.h"
+#include "intel_reg.h"
+
+#define PARALLEL_VIDEO_PIPE		(0x3<<29)
+#define MFX_WAIT			(PARALLEL_VIDEO_PIPE|(0x1<<27)|(0x1<<8))
+
+#define HUC_IMEM_STATE			(PARALLEL_VIDEO_PIPE|(0x2<<27)|(0xb<<23)|(0x1<<16)|0x3)
+#define HUC_PIPE_MODE_SELECT		(PARALLEL_VIDEO_PIPE|(0x2<<27)|(0xb<<23)|0x1)
+#define HUC_START			(PARALLEL_VIDEO_PIPE|(0x2<<27)|(0xb<<23)|(0x21<<16))
+#define HUC_VIRTUAL_ADDR_STATE		(PARALLEL_VIDEO_PIPE|(0x2<<27)|(0xb<<23)|(0x4<<16)|0x2f)
+
+#define HUC_VIRTUAL_ADDR_REGION_NUM	16
+#define HUC_VIRTUAL_ADDR_REGION_SRC	0
+#define HUC_VIRTUAL_ADDR_REGION_DST	14
+
+void
+gen9_huc_copyfunc(int fd,
+		struct drm_i915_gem_exec_object2 *src,
+		struct drm_i915_gem_exec_object2 *dst,
+		struct drm_i915_gem_exec_object2 *exec);
+
+#endif /* HUC_COPY_H */
diff --git a/lib/intel_batchbuffer.c b/lib/intel_batchbuffer.c
index 51aae4dc..d8cb9df3 100644
--- a/lib/intel_batchbuffer.c
+++ b/lib/intel_batchbuffer.c
@@ -43,6 +43,7 @@
 #include "ioctl_wrappers.h"
 #include "media_spin.h"
 #include "gpgpu_fill.h"
+#include "huc_copy.h"
 
 #include <i915_drm.h>
 
@@ -942,3 +943,22 @@ igt_media_spinfunc_t igt_get_media_spinfunc(int devid)
 
 	return spin;
 }
+
+/**
+ * igt_get_huc_copyfunc:
+ * @devid: pci device id
+ *
+ * Returns:
+ *
+ * The platform-specific huc copy function pointer for the device specified
+ * with @devid. Will return NULL when no media spin 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))
+		copy = gen9_huc_copyfunc;
+
+	return copy;
+}
diff --git a/lib/intel_batchbuffer.h b/lib/intel_batchbuffer.h
index 37e3affe..5af585ed 100644
--- a/lib/intel_batchbuffer.h
+++ b/lib/intel_batchbuffer.h
@@ -388,4 +388,23 @@ typedef void (*igt_media_spinfunc_t)(struct intel_batchbuffer *batch,
 
 igt_media_spinfunc_t igt_get_media_spinfunc(int devid);
 
+/**
+ * igt_huc_copyfunc_t:
+ * @fd: drm fd
+ * @src: source drm buffer
+ * @dst: destination drm buffer
+ * @exec: execution drm buffer
+ *
+ * This is the type of the per-platform huc copy functions.
+ *
+ * The huc copy function emits a batchbuffer to the VDBOX engine to
+ * invoke the HuC Copy kernel to copy 4K bytes from the source buffer
+ * to the destination buffer.
+ */
+typedef void (*igt_huc_copyfunc_t)(int fd,
+		struct drm_i915_gem_exec_object2 *src,
+		struct drm_i915_gem_exec_object2 *dst,
+		struct drm_i915_gem_exec_object2 *exec);
+
+igt_huc_copyfunc_t	igt_get_huc_copyfunc(int devid);
 #endif
diff --git a/lib/meson.build b/lib/meson.build
index 57eb7d93..3d720683 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -1,5 +1,6 @@
 lib_sources = [
 	'drmtest.c',
+	'huc_copy.c',
 	'i915/gem_context.c',
 	'i915/gem_engine_topology.c',
 	'i915/gem_scheduler.c',
diff --git a/tests/Makefile.sources b/tests/Makefile.sources
index 806eb02d..8ba97bac 100644
--- a/tests/Makefile.sources
+++ b/tests/Makefile.sources
@@ -313,6 +313,9 @@ gem_media_fill_SOURCES = i915/gem_media_fill.c
 TESTS_progs += gem_media_vme
 gem_media_vme_SOURCES = i915/gem_media_vme.c
 
+TESTS_progs += gem_huc_copy
+gem_media_vme_SOURCES = i915/gem_huc_copy.c
+
 TESTS_progs += gem_mmap
 gem_mmap_SOURCES = i915/gem_mmap.c
 
diff --git a/tests/i915/gem_huc_copy.c b/tests/i915/gem_huc_copy.c
new file mode 100644
index 00000000..f8da115d
--- /dev/null
+++ b/tests/i915/gem_huc_copy.c
@@ -0,0 +1,111 @@
+/*
+ * Copyright © 2019 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+#include "igt.h"
+#include <stdbool.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <sys/ioctl.h>
+#include <stdio.h>
+#include <string.h>
+#include <fcntl.h>
+#include <inttypes.h>
+#include <errno.h>
+#include <sys/stat.h>
+#include <sys/time.h>
+#include "drm.h"
+
+IGT_TEST_DESCRIPTION("A very simple workload for the HuC.");
+
+#define HUC_COPY_DATA_BUF_SIZE	4096
+
+static void
+compare_huc_copy_result(int drm_fd, uint32_t src_handle, uint32_t dst_handle)
+{
+	char src_output[HUC_COPY_DATA_BUF_SIZE];
+	char dst_output[HUC_COPY_DATA_BUF_SIZE];
+
+	gem_read(drm_fd, src_handle, 0, src_output, HUC_COPY_DATA_BUF_SIZE);
+	gem_read(drm_fd, dst_handle, 0, dst_output, HUC_COPY_DATA_BUF_SIZE);
+
+	for (int i = 0; i < HUC_COPY_DATA_BUF_SIZE; i++) {
+		igt_assert_f(src_output[i] == dst_output[i],
+				"Huc Copy failed!\n");
+	}
+}
+
+static bool
+check_huc_status(int fd)
+{
+	int val = 0;
+	struct drm_i915_getparam pg;
+
+	pg.param = I915_PARAM_HUC_STATUS;
+	pg.value = &val;
+	if (ioctl(fd, DRM_IOCTL_I915_GETPARAM, &pg) == 0) {
+		return !!val;
+	} else {
+		return 0;
+	}
+}
+
+igt_main
+{
+	int drm_fd = -1;
+	uint32_t devid;
+	igt_huc_copyfunc_t huc_copy;
+
+	igt_fixture {
+		drm_fd = drm_open_driver(DRIVER_INTEL);
+		igt_require_gem(drm_fd);
+		devid = intel_get_drm_devid(drm_fd);
+		huc_copy = igt_get_huc_copyfunc(devid);
+		igt_require_f(huc_copy, "no huc_copy function\n");
+		igt_assert_f(check_huc_status(drm_fd) == true,
+			"HuC is not successfully loaded!\n");
+	}
+
+	igt_subtest_f("huc-copy") {
+		char inputs[HUC_COPY_DATA_BUF_SIZE];
+		struct drm_i915_gem_exec_object2 obj[3];
+
+		/* Initialize src buffer randomly */
+		srand(time(NULL));
+		for (int i = 0; i < HUC_COPY_DATA_BUF_SIZE; i++) {
+			inputs[i] = (char) (rand() % 256);
+		}
+
+		memset(obj, 0, sizeof(obj));
+		obj[0].handle = gem_create(drm_fd, HUC_COPY_DATA_BUF_SIZE);
+		obj[1].handle = gem_create(drm_fd, HUC_COPY_DATA_BUF_SIZE);
+		obj[2].handle = gem_create(drm_fd, 4096);
+
+		gem_write(drm_fd, obj[0].handle, 0, inputs, HUC_COPY_DATA_BUF_SIZE);
+
+		huc_copy(drm_fd, &obj[0], &obj[1], &obj[2]);
+		compare_huc_copy_result(drm_fd, obj[0].handle, obj[1].handle);
+	}
+
+	igt_fixture {
+		close(drm_fd);
+	}
+}
diff --git a/tests/meson.build b/tests/meson.build
index 570de545..0545b612 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -165,6 +165,7 @@ i915_progs = [
 	'gem_gtt_cpu_tlb',
 	'gem_gtt_hog',
 	'gem_gtt_speed',
+	'gem_huc_copy',
 	'gem_largeobject',
 	'gem_linear_blits',
 	'gem_lut_handle',
-- 
2.21.0.5.gaeb582a983

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

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

* [igt-dev] ✗ GitLab.Pipeline: warning for tests/i915/gem_huc_copy: Enable a HuC copy test
  2019-12-19 23:50 [igt-dev] [PATCH i-g-t] tests/i915/gem_huc_copy: Enable a HuC copy test Robert M. Fosha
@ 2019-12-20  0:34 ` Patchwork
  2019-12-20  0:58 ` [igt-dev] ✓ Fi.CI.BAT: success " Patchwork
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 25+ messages in thread
From: Patchwork @ 2019-12-20  0:34 UTC (permalink / raw)
  To: Robert M. Fosha; +Cc: igt-dev

== Series Details ==

Series: tests/i915/gem_huc_copy: Enable a HuC copy test
URL   : https://patchwork.freedesktop.org/series/71194/
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/91026 for the overview.

build:tests-debian-autotools has failed (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/1208859):
    CCLD     gem_largeobject
    CCLD     gem_linear_blits
    CCLD     gem_lut_handle
    CCLD     gem_madvise
    CCLD     gem_media_fill
    CCLD     gem_media_vme
  make[3]: Leaving directory '/builds/gfx-ci/igt-ci-tags/tests'
  make[3]: *** No rule to make target 'gem_huc_copy.c', needed by 'gem_huc_copy.o'.  Stop.
  make[2]: Leaving directory '/builds/gfx-ci/igt-ci-tags/tests'
  make[2]: *** [Makefile:5280: all-recursive] Error 1
  make[1]: Leaving directory '/builds/gfx-ci/igt-ci-tags'
  make[1]: *** [Makefile:514: all-recursive] Error 1
  make: *** [Makefile:446: all] Error 2
  section_end:1576801970:build_script
  ^[[0Ksection_start:1576801970:after_script
  ^[[0Ksection_end:1576801972:after_script
  ^[[0Ksection_start:1576801972:upload_artifacts_on_failure
  ^[[0Ksection_end:1576801973:upload_artifacts_on_failure
  ^[[0K^[[31;1mERROR: Job failed: exit code 1
  ^[[0;m

== Logs ==

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

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

* [igt-dev] ✓ Fi.CI.BAT: success for tests/i915/gem_huc_copy: Enable a HuC copy test
  2019-12-19 23:50 [igt-dev] [PATCH i-g-t] tests/i915/gem_huc_copy: Enable a HuC copy test Robert M. Fosha
  2019-12-20  0:34 ` [igt-dev] ✗ GitLab.Pipeline: warning for " Patchwork
@ 2019-12-20  0:58 ` Patchwork
  2019-12-20 22:11 ` [igt-dev] [PATCH i-g-t] " Antonio Argenziano
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 25+ messages in thread
From: Patchwork @ 2019-12-20  0:58 UTC (permalink / raw)
  To: Robert M. Fosha; +Cc: igt-dev

== Series Details ==

Series: tests/i915/gem_huc_copy: Enable a HuC copy test
URL   : https://patchwork.freedesktop.org/series/71194/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_7611 -> IGTPW_3880
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

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

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

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

### IGT changes ###

#### Issues hit ####

  * igt@i915_selftest@live_blt:
    - fi-ivb-3770:        [PASS][1] -> [DMESG-FAIL][2] ([i915#725])
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7611/fi-ivb-3770/igt@i915_selftest@live_blt.html
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3880/fi-ivb-3770/igt@i915_selftest@live_blt.html
    - fi-hsw-4770:        [PASS][3] -> [DMESG-FAIL][4] ([i915#770])
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7611/fi-hsw-4770/igt@i915_selftest@live_blt.html
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3880/fi-hsw-4770/igt@i915_selftest@live_blt.html

  * igt@i915_selftest@live_gem_contexts:
    - fi-hsw-4770r:       [PASS][5] -> [DMESG-FAIL][6] ([i915#722])
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7611/fi-hsw-4770r/igt@i915_selftest@live_gem_contexts.html
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3880/fi-hsw-4770r/igt@i915_selftest@live_gem_contexts.html

  * igt@i915_selftest@live_hugepages:
    - fi-byt-j1900:       [PASS][7] -> [DMESG-FAIL][8] ([i915#845])
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7611/fi-byt-j1900/igt@i915_selftest@live_hugepages.html
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3880/fi-byt-j1900/igt@i915_selftest@live_hugepages.html

  
#### Possible fixes ####

  * igt@i915_selftest@live_blt:
    - fi-hsw-4770r:       [DMESG-FAIL][9] ([i915#725]) -> [PASS][10]
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7611/fi-hsw-4770r/igt@i915_selftest@live_blt.html
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3880/fi-hsw-4770r/igt@i915_selftest@live_blt.html

  * igt@i915_selftest@live_gem_contexts:
    - fi-byt-n2820:       [INCOMPLETE][11] ([i915#45]) -> [PASS][12]
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7611/fi-byt-n2820/igt@i915_selftest@live_gem_contexts.html
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3880/fi-byt-n2820/igt@i915_selftest@live_gem_contexts.html

  * igt@i915_selftest@live_gt_contexts:
    - fi-tgl-y:           [DMESG-FAIL][13] -> [PASS][14]
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7611/fi-tgl-y/igt@i915_selftest@live_gt_contexts.html
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3880/fi-tgl-y/igt@i915_selftest@live_gt_contexts.html

  * igt@kms_chamelium@hdmi-hpd-fast:
    - fi-kbl-7500u:       [FAIL][15] ([fdo#111096] / [i915#323]) -> [PASS][16]
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7611/fi-kbl-7500u/igt@kms_chamelium@hdmi-hpd-fast.html
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3880/fi-kbl-7500u/igt@kms_chamelium@hdmi-hpd-fast.html

  * igt@kms_frontbuffer_tracking@basic:
    - fi-icl-u2:          [INCOMPLETE][17] ([i915#140]) -> [PASS][18]
   [17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7611/fi-icl-u2/igt@kms_frontbuffer_tracking@basic.html
   [18]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3880/fi-icl-u2/igt@kms_frontbuffer_tracking@basic.html

  
#### Warnings ####

  * igt@kms_cursor_legacy@basic-busy-flip-before-cursor-legacy:
    - fi-kbl-x1275:       [DMESG-WARN][19] ([i915#62] / [i915#92]) -> [DMESG-WARN][20] ([i915#62] / [i915#92] / [i915#95]) +5 similar issues
   [19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7611/fi-kbl-x1275/igt@kms_cursor_legacy@basic-busy-flip-before-cursor-legacy.html
   [20]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3880/fi-kbl-x1275/igt@kms_cursor_legacy@basic-busy-flip-before-cursor-legacy.html

  * igt@kms_flip@basic-flip-vs-modeset:
    - fi-kbl-x1275:       [DMESG-WARN][21] ([i915#62] / [i915#92] / [i915#95]) -> [DMESG-WARN][22] ([i915#62] / [i915#92]) +5 similar issues
   [21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7611/fi-kbl-x1275/igt@kms_flip@basic-flip-vs-modeset.html
   [22]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3880/fi-kbl-x1275/igt@kms_flip@basic-flip-vs-modeset.html

  
  [fdo#111096]: https://bugs.freedesktop.org/show_bug.cgi?id=111096
  [i915#140]: https://gitlab.freedesktop.org/drm/intel/issues/140
  [i915#323]: https://gitlab.freedesktop.org/drm/intel/issues/323
  [i915#45]: https://gitlab.freedesktop.org/drm/intel/issues/45
  [i915#62]: https://gitlab.freedesktop.org/drm/intel/issues/62
  [i915#722]: https://gitlab.freedesktop.org/drm/intel/issues/722
  [i915#725]: https://gitlab.freedesktop.org/drm/intel/issues/725
  [i915#770]: https://gitlab.freedesktop.org/drm/intel/issues/770
  [i915#845]: https://gitlab.freedesktop.org/drm/intel/issues/845
  [i915#92]: https://gitlab.freedesktop.org/drm/intel/issues/92
  [i915#95]: https://gitlab.freedesktop.org/drm/intel/issues/95


Participating hosts (48 -> 41)
------------------------------

  Missing    (7): fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-ctg-p8600 fi-byt-clapper fi-bdw-samus 


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

  * CI: CI-20190529 -> None
  * IGT: IGT_5351 -> IGTPW_3880

  CI-20190529: 20190529
  CI_DRM_7611: a838a8d6accc9027d4d04fb67d2f8a7a2049946c @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_3880: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3880/index.html
  IGT_5351: e7fdcef72d1d6b3bb9f3003bbc37571959e6e8bb @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools



== Testlist changes ==

+igt@gem_huc_copy@huc-copy

== Logs ==

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

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

* Re: [igt-dev] [PATCH i-g-t] tests/i915/gem_huc_copy: Enable a HuC copy test
  2019-12-19 23:50 [igt-dev] [PATCH i-g-t] tests/i915/gem_huc_copy: Enable a HuC copy test Robert M. Fosha
  2019-12-20  0:34 ` [igt-dev] ✗ GitLab.Pipeline: warning for " Patchwork
  2019-12-20  0:58 ` [igt-dev] ✓ Fi.CI.BAT: success " Patchwork
@ 2019-12-20 22:11 ` Antonio Argenziano
  2019-12-20 22:41 ` [igt-dev] [PATCH i-g-t v2] " Robert M. Fosha
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 25+ messages in thread
From: Antonio Argenziano @ 2019-12-20 22:11 UTC (permalink / raw)
  To: Robert M. Fosha, igt-dev; +Cc: Sally Qi



On 19/12/19 15:50, Robert M. Fosha wrote:
> From: Sally Qi <feng.qi@intel.com>
> 
> This test case loads the HuC copy firmware to copy the content of
> the source buffer to the destination buffer.
> 
> v2: (Tony Ye)
>   * Restructured some functions and files.
>   * Defined the copy buffer size as 4K explicitly as the HuC Copy kernel
>     always copy 4K bytes from src buffer to dst buffer.
> 
> v3: (Feng Qi, Antonio Argenziano, Tony Ye)
>   * Restructured some functions as igt requested, exclude libdrm function call.
>   * Remove huc function wrappers
>   * Random initialize source input buffer
> 
> Signed-off-by: Sally Qi <feng.qi@intel.com>
> Signed-off-by: Tony Ye <tony.ye@intel.com>

LGTM but, I can't really comment on HuC stuff and possibly I am a bit 
out of the loop of the latest IGT code base.

Acked-by: Antonio Argenziano <antonio.argenziano@intel.com>

(Ofc fix the autotools build first ;))

> ---
>   lib/Makefile.sources      |   2 +
>   lib/huc_copy.c            | 109 +++++++++++++++++++++++++++++++++++++
>   lib/huc_copy.h            |  51 ++++++++++++++++++
>   lib/intel_batchbuffer.c   |  20 +++++++
>   lib/intel_batchbuffer.h   |  19 +++++++
>   lib/meson.build           |   1 +
>   tests/Makefile.sources    |   3 ++
>   tests/i915/gem_huc_copy.c | 111 ++++++++++++++++++++++++++++++++++++++
>   tests/meson.build         |   1 +
>   9 files changed, 317 insertions(+)
>   create mode 100644 lib/huc_copy.c
>   create mode 100644 lib/huc_copy.h
>   create mode 100644 tests/i915/gem_huc_copy.c
> 
> diff --git a/lib/Makefile.sources b/lib/Makefile.sources
> index 5dd3962e..e9e132c1 100644
> --- a/lib/Makefile.sources
> +++ b/lib/Makefile.sources
> @@ -78,6 +78,8 @@ lib_source_list =	 	\
>   	ioctl_wrappers.h	\
>   	media_fill.c		\
>   	media_fill.h            \
> +	huc_copy.c		\
> +	huc_copy.h		\
>   	media_spin.h		\
>   	media_spin.c		\
>   	gpgpu_fill.h		\
> diff --git a/lib/huc_copy.c b/lib/huc_copy.c
> new file mode 100644
> index 00000000..32541157
> --- /dev/null
> +++ b/lib/huc_copy.c
> @@ -0,0 +1,109 @@
> +/*
> + * Copyright © 2019 Intel Corporation
> + *
> + * Permission is hereby granted, free of charge, to any person obtaining a
> + * copy of this software and associated documentation files (the "Software"),
> + * to deal in the Software without restriction, including without limitation
> + * the rights to use, copy, modify, merge, publish, distribute, sublicense,
> + * and/or sell copies of the Software, and to permit persons to whom the
> + * Software is furnished to do so, subject to the following conditions:
> + *
> + * The above copyright notice and this permission notice (including the next
> + * paragraph) shall be included in all copies or substantial portions of the
> + * Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
> + * IN THE SOFTWARE.
> + *
> + */
> +
> +#include <i915_drm.h>
> +#include "huc_copy.h"
> +
> +static void
> +gen9_emit_huc_virtual_addr_state(struct drm_i915_gem_exec_object2 *src,
> +		struct drm_i915_gem_exec_object2 *dst,
> +		struct drm_i915_gem_relocation_entry *reloc_src,
> +		struct drm_i915_gem_relocation_entry *reloc_dst,
> +		uint32_t *buf,
> +		int *i)
> +{
> +	buf[(*i)++] = HUC_VIRTUAL_ADDR_STATE;
> +
> +	for (int j = 0; j < HUC_VIRTUAL_ADDR_REGION_NUM; j++) {
> +		if (j == HUC_VIRTUAL_ADDR_REGION_SRC) {
> +			buf[(*i)++] = src->offset;
> +
> +			reloc_src->target_handle = src->handle;
> +			reloc_src->delta = 0;
> +			reloc_src->offset = (*i - 1) * sizeof(buf[0]);
> +			reloc_src->read_domains = 0;
> +			reloc_src->write_domain = 0;
> +		} else if (j == HUC_VIRTUAL_ADDR_REGION_DST) {
> +			buf[(*i)++] = dst->offset;
> +
> +			reloc_dst->target_handle = dst->handle;
> +			reloc_dst->delta = 0;
> +			reloc_dst->offset = (*i - 1) * sizeof(buf[0]);
> +			reloc_dst->read_domains = 0;
> +			reloc_dst->write_domain = I915_GEM_DOMAIN_RENDER;
> +		} else {
> +			buf[(*i)++] = 0;
> +		}
> +		buf[(*i)++] = 0;
> +		buf[(*i)++] = 0;
> +	}
> +}
> +
> +void
> +gen9_huc_copyfunc(int fd,
> +		struct drm_i915_gem_exec_object2 *src,
> +		struct drm_i915_gem_exec_object2 *dst,
> +		struct drm_i915_gem_exec_object2 *exec)
> +{
> +	struct drm_i915_gem_relocation_entry reloc[2];
> +	struct drm_i915_gem_execbuffer2 execbuf;
> +	int i = 0;
> +	uint32_t buf[63];
> +
> +	/* 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;
> +
> +	memset(reloc, 0, sizeof(reloc));
> +	gen9_emit_huc_virtual_addr_state(src, dst, &reloc[0], &reloc[1], buf, &i);
> +
> +	buf[i++] = HUC_START;
> +	buf[i++] = 1;
> +
> +	buf[i++] = MI_BATCH_BUFFER_END;
> +
> +	gem_write(fd, exec->handle, 0, buf, sizeof(buf));
> +	exec->relocation_count = 2;
> +	exec->relocs_ptr = to_user_pointer(reloc);
> +
> +	memset(&execbuf, 0, sizeof(execbuf));
> +	execbuf.buffers_ptr = to_user_pointer(src);
> +	execbuf.buffer_count = 3;
> +	execbuf.flags = I915_EXEC_BSD;
> +
> +	gem_execbuf(fd, &execbuf);
> +	gem_close(fd, exec->handle);
> +}
> diff --git a/lib/huc_copy.h b/lib/huc_copy.h
> new file mode 100644
> index 00000000..c435f6cb
> --- /dev/null
> +++ b/lib/huc_copy.h
> @@ -0,0 +1,51 @@
> +/*
> + * Copyright © 2019 Intel Corporation
> + *
> + * Permission is hereby granted, free of charge, to any person obtaining a
> + * copy of this software and associated documentation files (the "Software"),
> + * to deal in the Software without restriction, including without limitation
> + * the rights to use, copy, modify, merge, publish, distribute, sublicense,
> + * and/or sell copies of the Software, and to permit persons to whom the
> + * Software is furnished to do so, subject to the following conditions:
> + *
> + * The above copyright notice and this permission notice (including the next
> + * paragraph) shall be included in all copies or substantial portions of the
> + * Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
> + * IN THE SOFTWARE.
> + *
> + */
> +
> +#ifndef HUC_COPY_H
> +#define HUC_COPY_H
> +
> +#include <stdint.h>
> +#include <string.h>
> +#include "ioctl_wrappers.h"
> +#include "intel_reg.h"
> +
> +#define PARALLEL_VIDEO_PIPE		(0x3<<29)
> +#define MFX_WAIT			(PARALLEL_VIDEO_PIPE|(0x1<<27)|(0x1<<8))
> +
> +#define HUC_IMEM_STATE			(PARALLEL_VIDEO_PIPE|(0x2<<27)|(0xb<<23)|(0x1<<16)|0x3)
> +#define HUC_PIPE_MODE_SELECT		(PARALLEL_VIDEO_PIPE|(0x2<<27)|(0xb<<23)|0x1)
> +#define HUC_START			(PARALLEL_VIDEO_PIPE|(0x2<<27)|(0xb<<23)|(0x21<<16))
> +#define HUC_VIRTUAL_ADDR_STATE		(PARALLEL_VIDEO_PIPE|(0x2<<27)|(0xb<<23)|(0x4<<16)|0x2f)
> +
> +#define HUC_VIRTUAL_ADDR_REGION_NUM	16
> +#define HUC_VIRTUAL_ADDR_REGION_SRC	0
> +#define HUC_VIRTUAL_ADDR_REGION_DST	14
> +
> +void
> +gen9_huc_copyfunc(int fd,
> +		struct drm_i915_gem_exec_object2 *src,
> +		struct drm_i915_gem_exec_object2 *dst,
> +		struct drm_i915_gem_exec_object2 *exec);
> +
> +#endif /* HUC_COPY_H */
> diff --git a/lib/intel_batchbuffer.c b/lib/intel_batchbuffer.c
> index 51aae4dc..d8cb9df3 100644
> --- a/lib/intel_batchbuffer.c
> +++ b/lib/intel_batchbuffer.c
> @@ -43,6 +43,7 @@
>   #include "ioctl_wrappers.h"
>   #include "media_spin.h"
>   #include "gpgpu_fill.h"
> +#include "huc_copy.h"
>   
>   #include <i915_drm.h>
>   
> @@ -942,3 +943,22 @@ igt_media_spinfunc_t igt_get_media_spinfunc(int devid)
>   
>   	return spin;
>   }
> +
> +/**
> + * igt_get_huc_copyfunc:
> + * @devid: pci device id
> + *
> + * Returns:
> + *
> + * The platform-specific huc copy function pointer for the device specified
> + * with @devid. Will return NULL when no media spin 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))
> +		copy = gen9_huc_copyfunc;
> +
> +	return copy;
> +}
> diff --git a/lib/intel_batchbuffer.h b/lib/intel_batchbuffer.h
> index 37e3affe..5af585ed 100644
> --- a/lib/intel_batchbuffer.h
> +++ b/lib/intel_batchbuffer.h
> @@ -388,4 +388,23 @@ typedef void (*igt_media_spinfunc_t)(struct intel_batchbuffer *batch,
>   
>   igt_media_spinfunc_t igt_get_media_spinfunc(int devid);
>   
> +/**
> + * igt_huc_copyfunc_t:
> + * @fd: drm fd
> + * @src: source drm buffer
> + * @dst: destination drm buffer
> + * @exec: execution drm buffer
> + *
> + * This is the type of the per-platform huc copy functions.
> + *
> + * The huc copy function emits a batchbuffer to the VDBOX engine to
> + * invoke the HuC Copy kernel to copy 4K bytes from the source buffer
> + * to the destination buffer.
> + */
> +typedef void (*igt_huc_copyfunc_t)(int fd,
> +		struct drm_i915_gem_exec_object2 *src,
> +		struct drm_i915_gem_exec_object2 *dst,
> +		struct drm_i915_gem_exec_object2 *exec);
> +
> +igt_huc_copyfunc_t	igt_get_huc_copyfunc(int devid);
>   #endif
> diff --git a/lib/meson.build b/lib/meson.build
> index 57eb7d93..3d720683 100644
> --- a/lib/meson.build
> +++ b/lib/meson.build
> @@ -1,5 +1,6 @@
>   lib_sources = [
>   	'drmtest.c',
> +	'huc_copy.c',
>   	'i915/gem_context.c',
>   	'i915/gem_engine_topology.c',
>   	'i915/gem_scheduler.c',
> diff --git a/tests/Makefile.sources b/tests/Makefile.sources
> index 806eb02d..8ba97bac 100644
> --- a/tests/Makefile.sources
> +++ b/tests/Makefile.sources
> @@ -313,6 +313,9 @@ gem_media_fill_SOURCES = i915/gem_media_fill.c
>   TESTS_progs += gem_media_vme
>   gem_media_vme_SOURCES = i915/gem_media_vme.c
>   
> +TESTS_progs += gem_huc_copy
> +gem_media_vme_SOURCES = i915/gem_huc_copy.c
> +
>   TESTS_progs += gem_mmap
>   gem_mmap_SOURCES = i915/gem_mmap.c
>   
> diff --git a/tests/i915/gem_huc_copy.c b/tests/i915/gem_huc_copy.c
> new file mode 100644
> index 00000000..f8da115d
> --- /dev/null
> +++ b/tests/i915/gem_huc_copy.c
> @@ -0,0 +1,111 @@
> +/*
> + * Copyright © 2019 Intel Corporation
> + *
> + * Permission is hereby granted, free of charge, to any person obtaining a
> + * copy of this software and associated documentation files (the "Software"),
> + * to deal in the Software without restriction, including without limitation
> + * the rights to use, copy, modify, merge, publish, distribute, sublicense,
> + * and/or sell copies of the Software, and to permit persons to whom the
> + * Software is furnished to do so, subject to the following conditions:
> + *
> + * The above copyright notice and this permission notice (including the next
> + * paragraph) shall be included in all copies or substantial portions of the
> + * Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
> + * IN THE SOFTWARE.
> + */
> +#include "igt.h"
> +#include <stdbool.h>
> +#include <unistd.h>
> +#include <stdlib.h>
> +#include <sys/ioctl.h>
> +#include <stdio.h>
> +#include <string.h>
> +#include <fcntl.h>
> +#include <inttypes.h>
> +#include <errno.h>
> +#include <sys/stat.h>
> +#include <sys/time.h>
> +#include "drm.h"
> +
> +IGT_TEST_DESCRIPTION("A very simple workload for the HuC.");
> +
> +#define HUC_COPY_DATA_BUF_SIZE	4096
> +
> +static void
> +compare_huc_copy_result(int drm_fd, uint32_t src_handle, uint32_t dst_handle)
> +{
> +	char src_output[HUC_COPY_DATA_BUF_SIZE];
> +	char dst_output[HUC_COPY_DATA_BUF_SIZE];
> +
> +	gem_read(drm_fd, src_handle, 0, src_output, HUC_COPY_DATA_BUF_SIZE);
> +	gem_read(drm_fd, dst_handle, 0, dst_output, HUC_COPY_DATA_BUF_SIZE);
> +
> +	for (int i = 0; i < HUC_COPY_DATA_BUF_SIZE; i++) {
> +		igt_assert_f(src_output[i] == dst_output[i],
> +				"Huc Copy failed!\n");
> +	}
> +}
> +
> +static bool
> +check_huc_status(int fd)
> +{
> +	int val = 0;
> +	struct drm_i915_getparam pg;
> +
> +	pg.param = I915_PARAM_HUC_STATUS;
> +	pg.value = &val;
> +	if (ioctl(fd, DRM_IOCTL_I915_GETPARAM, &pg) == 0) {
> +		return !!val;
> +	} else {
> +		return 0;
> +	}
> +}
> +
> +igt_main
> +{
> +	int drm_fd = -1;
> +	uint32_t devid;
> +	igt_huc_copyfunc_t huc_copy;
> +
> +	igt_fixture {
> +		drm_fd = drm_open_driver(DRIVER_INTEL);
> +		igt_require_gem(drm_fd);
> +		devid = intel_get_drm_devid(drm_fd);
> +		huc_copy = igt_get_huc_copyfunc(devid);
> +		igt_require_f(huc_copy, "no huc_copy function\n");
> +		igt_assert_f(check_huc_status(drm_fd) == true,
> +			"HuC is not successfully loaded!\n");
> +	}
> +
> +	igt_subtest_f("huc-copy") {
> +		char inputs[HUC_COPY_DATA_BUF_SIZE];
> +		struct drm_i915_gem_exec_object2 obj[3];
> +
> +		/* Initialize src buffer randomly */
> +		srand(time(NULL));
> +		for (int i = 0; i < HUC_COPY_DATA_BUF_SIZE; i++) {
> +			inputs[i] = (char) (rand() % 256);
> +		}
> +
> +		memset(obj, 0, sizeof(obj));
> +		obj[0].handle = gem_create(drm_fd, HUC_COPY_DATA_BUF_SIZE);
> +		obj[1].handle = gem_create(drm_fd, HUC_COPY_DATA_BUF_SIZE);
> +		obj[2].handle = gem_create(drm_fd, 4096);
> +
> +		gem_write(drm_fd, obj[0].handle, 0, inputs, HUC_COPY_DATA_BUF_SIZE);
> +
> +		huc_copy(drm_fd, &obj[0], &obj[1], &obj[2]);
> +		compare_huc_copy_result(drm_fd, obj[0].handle, obj[1].handle);
> +	}
> +
> +	igt_fixture {
> +		close(drm_fd);
> +	}
> +}
> diff --git a/tests/meson.build b/tests/meson.build
> index 570de545..0545b612 100644
> --- a/tests/meson.build
> +++ b/tests/meson.build
> @@ -165,6 +165,7 @@ i915_progs = [
>   	'gem_gtt_cpu_tlb',
>   	'gem_gtt_hog',
>   	'gem_gtt_speed',
> +	'gem_huc_copy',
>   	'gem_largeobject',
>   	'gem_linear_blits',
>   	'gem_lut_handle',
> 
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [igt-dev] [PATCH i-g-t v2] tests/i915/gem_huc_copy: Enable a HuC copy test
  2019-12-19 23:50 [igt-dev] [PATCH i-g-t] tests/i915/gem_huc_copy: Enable a HuC copy test Robert M. Fosha
                   ` (2 preceding siblings ...)
  2019-12-20 22:11 ` [igt-dev] [PATCH i-g-t] " Antonio Argenziano
@ 2019-12-20 22:41 ` Robert M. Fosha
  2019-12-23 22:19   ` [igt-dev] [PATCH i-g-t v3] " Robert M. Fosha
  2019-12-20 23:19 ` [igt-dev] ✗ GitLab.Pipeline: failure for tests/i915/gem_huc_copy: Enable a HuC copy test (rev2) Patchwork
                   ` (8 subsequent siblings)
  12 siblings, 1 reply; 25+ messages in thread
From: Robert M. Fosha @ 2019-12-20 22:41 UTC (permalink / raw)
  To: igt-dev; +Cc: Sally Qi

From: Sally Qi <feng.qi@intel.com>

This test case loads the HuC copy firmware to copy the content of
the source buffer to the destination buffer.

v2: (Tony Ye)
 * Restructured some functions and files.
 * Defined the copy buffer size as 4K explicitly as the HuC Copy kernel
   always copy 4K bytes from src buffer to dst buffer.

v3: (Feng Qi, Antonio Argenziano, Tony Ye)
 * Restructured some functions as igt requested, exclude libdrm function call.
 * Remove huc function wrappers
 * Random initialize source input buffer

v4:
 * Fix autotools build failure.

Signed-off-by: Sally Qi <feng.qi@intel.com>
Signed-off-by: Tony Ye <tony.ye@intel.com>
Acked-by: Antonio Argenziano <antonio.argenziano@intel.com>
---
 lib/Makefile.sources      |   2 +
 lib/huc_copy.c            | 109 +++++++++++++++++++++++++++++++++++++
 lib/huc_copy.h            |  51 ++++++++++++++++++
 lib/intel_batchbuffer.c   |  20 +++++++
 lib/intel_batchbuffer.h   |  19 +++++++
 lib/meson.build           |   1 +
 tests/Makefile.sources    |   3 ++
 tests/i915/gem_huc_copy.c | 111 ++++++++++++++++++++++++++++++++++++++
 tests/meson.build         |   1 +
 9 files changed, 317 insertions(+)
 create mode 100644 lib/huc_copy.c
 create mode 100644 lib/huc_copy.h
 create mode 100644 tests/i915/gem_huc_copy.c

diff --git a/lib/Makefile.sources b/lib/Makefile.sources
index 5dd3962e..e9e132c1 100644
--- a/lib/Makefile.sources
+++ b/lib/Makefile.sources
@@ -78,6 +78,8 @@ lib_source_list =	 	\
 	ioctl_wrappers.h	\
 	media_fill.c		\
 	media_fill.h            \
+	huc_copy.c		\
+	huc_copy.h		\
 	media_spin.h		\
 	media_spin.c		\
 	gpgpu_fill.h		\
diff --git a/lib/huc_copy.c b/lib/huc_copy.c
new file mode 100644
index 00000000..32541157
--- /dev/null
+++ b/lib/huc_copy.c
@@ -0,0 +1,109 @@
+/*
+ * Copyright © 2019 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ *
+ */
+
+#include <i915_drm.h>
+#include "huc_copy.h"
+
+static void
+gen9_emit_huc_virtual_addr_state(struct drm_i915_gem_exec_object2 *src,
+		struct drm_i915_gem_exec_object2 *dst,
+		struct drm_i915_gem_relocation_entry *reloc_src,
+		struct drm_i915_gem_relocation_entry *reloc_dst,
+		uint32_t *buf,
+		int *i)
+{
+	buf[(*i)++] = HUC_VIRTUAL_ADDR_STATE;
+
+	for (int j = 0; j < HUC_VIRTUAL_ADDR_REGION_NUM; j++) {
+		if (j == HUC_VIRTUAL_ADDR_REGION_SRC) {
+			buf[(*i)++] = src->offset;
+
+			reloc_src->target_handle = src->handle;
+			reloc_src->delta = 0;
+			reloc_src->offset = (*i - 1) * sizeof(buf[0]);
+			reloc_src->read_domains = 0;
+			reloc_src->write_domain = 0;
+		} else if (j == HUC_VIRTUAL_ADDR_REGION_DST) {
+			buf[(*i)++] = dst->offset;
+
+			reloc_dst->target_handle = dst->handle;
+			reloc_dst->delta = 0;
+			reloc_dst->offset = (*i - 1) * sizeof(buf[0]);
+			reloc_dst->read_domains = 0;
+			reloc_dst->write_domain = I915_GEM_DOMAIN_RENDER;
+		} else {
+			buf[(*i)++] = 0;
+		}
+		buf[(*i)++] = 0;
+		buf[(*i)++] = 0;
+	}
+}
+
+void
+gen9_huc_copyfunc(int fd,
+		struct drm_i915_gem_exec_object2 *src,
+		struct drm_i915_gem_exec_object2 *dst,
+		struct drm_i915_gem_exec_object2 *exec)
+{
+	struct drm_i915_gem_relocation_entry reloc[2];
+	struct drm_i915_gem_execbuffer2 execbuf;
+	int i = 0;
+	uint32_t buf[63];
+
+	/* 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;
+
+	memset(reloc, 0, sizeof(reloc));
+	gen9_emit_huc_virtual_addr_state(src, dst, &reloc[0], &reloc[1], buf, &i);
+
+	buf[i++] = HUC_START;
+	buf[i++] = 1;
+
+	buf[i++] = MI_BATCH_BUFFER_END;
+
+	gem_write(fd, exec->handle, 0, buf, sizeof(buf));
+	exec->relocation_count = 2;
+	exec->relocs_ptr = to_user_pointer(reloc);
+
+	memset(&execbuf, 0, sizeof(execbuf));
+	execbuf.buffers_ptr = to_user_pointer(src);
+	execbuf.buffer_count = 3;
+	execbuf.flags = I915_EXEC_BSD;
+
+	gem_execbuf(fd, &execbuf);
+	gem_close(fd, exec->handle);
+}
diff --git a/lib/huc_copy.h b/lib/huc_copy.h
new file mode 100644
index 00000000..c435f6cb
--- /dev/null
+++ b/lib/huc_copy.h
@@ -0,0 +1,51 @@
+/*
+ * Copyright © 2019 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ *
+ */
+
+#ifndef HUC_COPY_H
+#define HUC_COPY_H
+
+#include <stdint.h>
+#include <string.h>
+#include "ioctl_wrappers.h"
+#include "intel_reg.h"
+
+#define PARALLEL_VIDEO_PIPE		(0x3<<29)
+#define MFX_WAIT			(PARALLEL_VIDEO_PIPE|(0x1<<27)|(0x1<<8))
+
+#define HUC_IMEM_STATE			(PARALLEL_VIDEO_PIPE|(0x2<<27)|(0xb<<23)|(0x1<<16)|0x3)
+#define HUC_PIPE_MODE_SELECT		(PARALLEL_VIDEO_PIPE|(0x2<<27)|(0xb<<23)|0x1)
+#define HUC_START			(PARALLEL_VIDEO_PIPE|(0x2<<27)|(0xb<<23)|(0x21<<16))
+#define HUC_VIRTUAL_ADDR_STATE		(PARALLEL_VIDEO_PIPE|(0x2<<27)|(0xb<<23)|(0x4<<16)|0x2f)
+
+#define HUC_VIRTUAL_ADDR_REGION_NUM	16
+#define HUC_VIRTUAL_ADDR_REGION_SRC	0
+#define HUC_VIRTUAL_ADDR_REGION_DST	14
+
+void
+gen9_huc_copyfunc(int fd,
+		struct drm_i915_gem_exec_object2 *src,
+		struct drm_i915_gem_exec_object2 *dst,
+		struct drm_i915_gem_exec_object2 *exec);
+
+#endif /* HUC_COPY_H */
diff --git a/lib/intel_batchbuffer.c b/lib/intel_batchbuffer.c
index 51aae4dc..d8cb9df3 100644
--- a/lib/intel_batchbuffer.c
+++ b/lib/intel_batchbuffer.c
@@ -43,6 +43,7 @@
 #include "ioctl_wrappers.h"
 #include "media_spin.h"
 #include "gpgpu_fill.h"
+#include "huc_copy.h"
 
 #include <i915_drm.h>
 
@@ -942,3 +943,22 @@ igt_media_spinfunc_t igt_get_media_spinfunc(int devid)
 
 	return spin;
 }
+
+/**
+ * igt_get_huc_copyfunc:
+ * @devid: pci device id
+ *
+ * Returns:
+ *
+ * The platform-specific huc copy function pointer for the device specified
+ * with @devid. Will return NULL when no media spin 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))
+		copy = gen9_huc_copyfunc;
+
+	return copy;
+}
diff --git a/lib/intel_batchbuffer.h b/lib/intel_batchbuffer.h
index 37e3affe..5af585ed 100644
--- a/lib/intel_batchbuffer.h
+++ b/lib/intel_batchbuffer.h
@@ -388,4 +388,23 @@ typedef void (*igt_media_spinfunc_t)(struct intel_batchbuffer *batch,
 
 igt_media_spinfunc_t igt_get_media_spinfunc(int devid);
 
+/**
+ * igt_huc_copyfunc_t:
+ * @fd: drm fd
+ * @src: source drm buffer
+ * @dst: destination drm buffer
+ * @exec: execution drm buffer
+ *
+ * This is the type of the per-platform huc copy functions.
+ *
+ * The huc copy function emits a batchbuffer to the VDBOX engine to
+ * invoke the HuC Copy kernel to copy 4K bytes from the source buffer
+ * to the destination buffer.
+ */
+typedef void (*igt_huc_copyfunc_t)(int fd,
+		struct drm_i915_gem_exec_object2 *src,
+		struct drm_i915_gem_exec_object2 *dst,
+		struct drm_i915_gem_exec_object2 *exec);
+
+igt_huc_copyfunc_t	igt_get_huc_copyfunc(int devid);
 #endif
diff --git a/lib/meson.build b/lib/meson.build
index 57eb7d93..3d720683 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -1,5 +1,6 @@
 lib_sources = [
 	'drmtest.c',
+	'huc_copy.c',
 	'i915/gem_context.c',
 	'i915/gem_engine_topology.c',
 	'i915/gem_scheduler.c',
diff --git a/tests/Makefile.sources b/tests/Makefile.sources
index 806eb02d..d230d6b4 100644
--- a/tests/Makefile.sources
+++ b/tests/Makefile.sources
@@ -313,6 +313,9 @@ gem_media_fill_SOURCES = i915/gem_media_fill.c
 TESTS_progs += gem_media_vme
 gem_media_vme_SOURCES = i915/gem_media_vme.c
 
+TESTS_progs += gem_huc_copy
+gem_huc_copy_SOURCES = i915/gem_huc_copy.c
+
 TESTS_progs += gem_mmap
 gem_mmap_SOURCES = i915/gem_mmap.c
 
diff --git a/tests/i915/gem_huc_copy.c b/tests/i915/gem_huc_copy.c
new file mode 100644
index 00000000..f8da115d
--- /dev/null
+++ b/tests/i915/gem_huc_copy.c
@@ -0,0 +1,111 @@
+/*
+ * Copyright © 2019 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+#include "igt.h"
+#include <stdbool.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <sys/ioctl.h>
+#include <stdio.h>
+#include <string.h>
+#include <fcntl.h>
+#include <inttypes.h>
+#include <errno.h>
+#include <sys/stat.h>
+#include <sys/time.h>
+#include "drm.h"
+
+IGT_TEST_DESCRIPTION("A very simple workload for the HuC.");
+
+#define HUC_COPY_DATA_BUF_SIZE	4096
+
+static void
+compare_huc_copy_result(int drm_fd, uint32_t src_handle, uint32_t dst_handle)
+{
+	char src_output[HUC_COPY_DATA_BUF_SIZE];
+	char dst_output[HUC_COPY_DATA_BUF_SIZE];
+
+	gem_read(drm_fd, src_handle, 0, src_output, HUC_COPY_DATA_BUF_SIZE);
+	gem_read(drm_fd, dst_handle, 0, dst_output, HUC_COPY_DATA_BUF_SIZE);
+
+	for (int i = 0; i < HUC_COPY_DATA_BUF_SIZE; i++) {
+		igt_assert_f(src_output[i] == dst_output[i],
+				"Huc Copy failed!\n");
+	}
+}
+
+static bool
+check_huc_status(int fd)
+{
+	int val = 0;
+	struct drm_i915_getparam pg;
+
+	pg.param = I915_PARAM_HUC_STATUS;
+	pg.value = &val;
+	if (ioctl(fd, DRM_IOCTL_I915_GETPARAM, &pg) == 0) {
+		return !!val;
+	} else {
+		return 0;
+	}
+}
+
+igt_main
+{
+	int drm_fd = -1;
+	uint32_t devid;
+	igt_huc_copyfunc_t huc_copy;
+
+	igt_fixture {
+		drm_fd = drm_open_driver(DRIVER_INTEL);
+		igt_require_gem(drm_fd);
+		devid = intel_get_drm_devid(drm_fd);
+		huc_copy = igt_get_huc_copyfunc(devid);
+		igt_require_f(huc_copy, "no huc_copy function\n");
+		igt_assert_f(check_huc_status(drm_fd) == true,
+			"HuC is not successfully loaded!\n");
+	}
+
+	igt_subtest_f("huc-copy") {
+		char inputs[HUC_COPY_DATA_BUF_SIZE];
+		struct drm_i915_gem_exec_object2 obj[3];
+
+		/* Initialize src buffer randomly */
+		srand(time(NULL));
+		for (int i = 0; i < HUC_COPY_DATA_BUF_SIZE; i++) {
+			inputs[i] = (char) (rand() % 256);
+		}
+
+		memset(obj, 0, sizeof(obj));
+		obj[0].handle = gem_create(drm_fd, HUC_COPY_DATA_BUF_SIZE);
+		obj[1].handle = gem_create(drm_fd, HUC_COPY_DATA_BUF_SIZE);
+		obj[2].handle = gem_create(drm_fd, 4096);
+
+		gem_write(drm_fd, obj[0].handle, 0, inputs, HUC_COPY_DATA_BUF_SIZE);
+
+		huc_copy(drm_fd, &obj[0], &obj[1], &obj[2]);
+		compare_huc_copy_result(drm_fd, obj[0].handle, obj[1].handle);
+	}
+
+	igt_fixture {
+		close(drm_fd);
+	}
+}
diff --git a/tests/meson.build b/tests/meson.build
index 570de545..0545b612 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -165,6 +165,7 @@ i915_progs = [
 	'gem_gtt_cpu_tlb',
 	'gem_gtt_hog',
 	'gem_gtt_speed',
+	'gem_huc_copy',
 	'gem_largeobject',
 	'gem_linear_blits',
 	'gem_lut_handle',
-- 
2.21.0.5.gaeb582a983

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

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

* [igt-dev] ✗ GitLab.Pipeline: failure for tests/i915/gem_huc_copy: Enable a HuC copy test (rev2)
  2019-12-19 23:50 [igt-dev] [PATCH i-g-t] tests/i915/gem_huc_copy: Enable a HuC copy test Robert M. Fosha
                   ` (3 preceding siblings ...)
  2019-12-20 22:41 ` [igt-dev] [PATCH i-g-t v2] " Robert M. Fosha
@ 2019-12-20 23:19 ` Patchwork
  2019-12-21  0:38 ` [igt-dev] ✗ Fi.CI.BAT: " Patchwork
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 25+ messages in thread
From: Patchwork @ 2019-12-20 23:19 UTC (permalink / raw)
  To: Robert M. Fosha; +Cc: igt-dev

== Series Details ==

Series: tests/i915/gem_huc_copy: Enable a HuC copy test (rev2)
URL   : https://patchwork.freedesktop.org/series/71194/
State : failure

== Summary ==

ERROR! This series introduces new undocumented tests:

gem_huc_copy@huc-copy

Can you document them as per the requirement in the [CONTRIBUTING.md]?

[Documentation] has more details on how to do this.

Here are few examples:
https://gitlab.freedesktop.org/drm/igt-gpu-tools/commit/0316695d03aa46108296b27f3982ec93200c7a6e
https://gitlab.freedesktop.org/drm/igt-gpu-tools/commit/443cc658e1e6b492ee17bf4f4d891029eb7a205d

Thanks in advance!

[CONTRIBUTING.md]: https://gitlab.freedesktop.org/drm/igt-gpu-tools/blob/master/CONTRIBUTING.md#L19
[Documentation]: https://drm.pages.freedesktop.org/igt-gpu-tools/igt-gpu-tools-Core.html#igt-describe

Other than that, pipeline status: SUCCESS.

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

== Logs ==

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

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

* [igt-dev] ✗ Fi.CI.BAT: failure for tests/i915/gem_huc_copy: Enable a HuC copy test (rev2)
  2019-12-19 23:50 [igt-dev] [PATCH i-g-t] tests/i915/gem_huc_copy: Enable a HuC copy test Robert M. Fosha
                   ` (4 preceding siblings ...)
  2019-12-20 23:19 ` [igt-dev] ✗ GitLab.Pipeline: failure for tests/i915/gem_huc_copy: Enable a HuC copy test (rev2) Patchwork
@ 2019-12-21  0:38 ` Patchwork
  2019-12-21  3:18 ` [igt-dev] ✓ Fi.CI.IGT: success for tests/i915/gem_huc_copy: Enable a HuC copy test Patchwork
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 25+ messages in thread
From: Patchwork @ 2019-12-21  0:38 UTC (permalink / raw)
  To: Robert M. Fosha; +Cc: igt-dev

== Series Details ==

Series: tests/i915/gem_huc_copy: Enable a HuC copy test (rev2)
URL   : https://patchwork.freedesktop.org/series/71194/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_7616 -> IGTPW_3882
====================================================

Summary
-------

  **FAILURE**

  Serious unknown changes coming with IGTPW_3882 absolutely need to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in IGTPW_3882, 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_3882/index.html

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

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

### IGT changes ###

#### Possible regressions ####

  * igt@i915_selftest@live_gt_heartbeat:
    - fi-bsw-n3050:       NOTRUN -> [DMESG-FAIL][1]
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3882/fi-bsw-n3050/igt@i915_selftest@live_gt_heartbeat.html

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

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

### IGT changes ###

#### Issues hit ####

  * igt@i915_selftest@live_blt:
    - fi-ivb-3770:        [PASS][2] -> [DMESG-FAIL][3] ([i915#770])
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7616/fi-ivb-3770/igt@i915_selftest@live_blt.html
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3882/fi-ivb-3770/igt@i915_selftest@live_blt.html
    - fi-hsw-4770:        [PASS][4] -> [DMESG-FAIL][5] ([i915#553] / [i915#725])
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7616/fi-hsw-4770/igt@i915_selftest@live_blt.html
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3882/fi-hsw-4770/igt@i915_selftest@live_blt.html
    - fi-hsw-4770r:       [PASS][6] -> [DMESG-FAIL][7] ([i915#553] / [i915#725])
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7616/fi-hsw-4770r/igt@i915_selftest@live_blt.html
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3882/fi-hsw-4770r/igt@i915_selftest@live_blt.html

  * igt@i915_selftest@live_gem_contexts:
    - fi-byt-n2820:       [PASS][8] -> [INCOMPLETE][9] ([i915#45])
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7616/fi-byt-n2820/igt@i915_selftest@live_gem_contexts.html
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3882/fi-byt-n2820/igt@i915_selftest@live_gem_contexts.html

  * igt@kms_chamelium@hdmi-hpd-fast:
    - fi-kbl-7500u:       [PASS][10] -> [FAIL][11] ([fdo#111407])
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7616/fi-kbl-7500u/igt@kms_chamelium@hdmi-hpd-fast.html
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3882/fi-kbl-7500u/igt@kms_chamelium@hdmi-hpd-fast.html

  
#### Possible fixes ####

  * igt@gem_close_race@basic-threads:
    - fi-byt-j1900:       [TIMEOUT][12] ([i915#816]) -> [PASS][13]
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7616/fi-byt-j1900/igt@gem_close_race@basic-threads.html
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3882/fi-byt-j1900/igt@gem_close_race@basic-threads.html

  
#### Warnings ####

  * igt@kms_cursor_legacy@basic-busy-flip-before-cursor-legacy:
    - fi-kbl-x1275:       [DMESG-WARN][14] ([i915#62] / [i915#92]) -> [DMESG-WARN][15] ([i915#62] / [i915#92] / [i915#95]) +5 similar issues
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7616/fi-kbl-x1275/igt@kms_cursor_legacy@basic-busy-flip-before-cursor-legacy.html
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3882/fi-kbl-x1275/igt@kms_cursor_legacy@basic-busy-flip-before-cursor-legacy.html

  * igt@kms_flip@basic-flip-vs-modeset:
    - fi-kbl-x1275:       [DMESG-WARN][16] ([i915#62] / [i915#92] / [i915#95]) -> [DMESG-WARN][17] ([i915#62] / [i915#92]) +5 similar issues
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7616/fi-kbl-x1275/igt@kms_flip@basic-flip-vs-modeset.html
   [17]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3882/fi-kbl-x1275/igt@kms_flip@basic-flip-vs-modeset.html

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

  [fdo#111407]: https://bugs.freedesktop.org/show_bug.cgi?id=111407
  [fdo#111735]: https://bugs.freedesktop.org/show_bug.cgi?id=111735
  [i915#45]: https://gitlab.freedesktop.org/drm/intel/issues/45
  [i915#553]: https://gitlab.freedesktop.org/drm/intel/issues/553
  [i915#62]: https://gitlab.freedesktop.org/drm/intel/issues/62
  [i915#725]: https://gitlab.freedesktop.org/drm/intel/issues/725
  [i915#770]: https://gitlab.freedesktop.org/drm/intel/issues/770
  [i915#816]: https://gitlab.freedesktop.org/drm/intel/issues/816
  [i915#92]: https://gitlab.freedesktop.org/drm/intel/issues/92
  [i915#95]: https://gitlab.freedesktop.org/drm/intel/issues/95


Participating hosts (46 -> 44)
------------------------------

  Additional (4): fi-hsw-peppy fi-bsw-nick fi-elk-e7500 fi-bsw-n3050 
  Missing    (6): fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-ctg-p8600 fi-byt-clapper fi-bdw-samus 


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

  * CI: CI-20190529 -> None
  * IGT: IGT_5351 -> IGTPW_3882

  CI-20190529: 20190529
  CI_DRM_7616: 81105b549355270c1d15073dc7f7b137cdc3d5c4 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_3882: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3882/index.html
  IGT_5351: e7fdcef72d1d6b3bb9f3003bbc37571959e6e8bb @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools



== Testlist changes ==

+igt@gem_huc_copy@huc-copy

== Logs ==

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

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

* [igt-dev] ✓ Fi.CI.IGT: success for tests/i915/gem_huc_copy: Enable a HuC copy test
  2019-12-19 23:50 [igt-dev] [PATCH i-g-t] tests/i915/gem_huc_copy: Enable a HuC copy test Robert M. Fosha
                   ` (5 preceding siblings ...)
  2019-12-21  0:38 ` [igt-dev] ✗ Fi.CI.BAT: " Patchwork
@ 2019-12-21  3:18 ` Patchwork
  2019-12-23 23:28 ` [igt-dev] ✗ Fi.CI.BAT: failure for tests/i915/gem_huc_copy: Enable a HuC copy test (rev3) Patchwork
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 25+ messages in thread
From: Patchwork @ 2019-12-21  3:18 UTC (permalink / raw)
  To: Robert M. Fosha; +Cc: igt-dev

== Series Details ==

Series: tests/i915/gem_huc_copy: Enable a HuC copy test
URL   : https://patchwork.freedesktop.org/series/71194/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_7611_full -> IGTPW_3880_full
====================================================

Summary
-------

  **WARNING**

  Minor unknown changes coming with IGTPW_3880_full need to be verified
  manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in IGTPW_3880_full, 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_3880/index.html

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

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

### IGT changes ###

#### Possible regressions ####

  * {igt@gem_huc_copy@huc-copy} (NEW):
    - shard-apl:          NOTRUN -> [FAIL][1]
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3880/shard-apl7/igt@gem_huc_copy@huc-copy.html
    - shard-glk:          NOTRUN -> [FAIL][2]
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3880/shard-glk4/igt@gem_huc_copy@huc-copy.html
    - shard-iclb:         NOTRUN -> [FAIL][3]
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3880/shard-iclb6/igt@gem_huc_copy@huc-copy.html
    - shard-kbl:          NOTRUN -> [FAIL][4]
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3880/shard-kbl3/igt@gem_huc_copy@huc-copy.html

  
#### Warnings ####

  * igt@i915_selftest@mock_requests:
    - shard-snb:          [INCOMPLETE][5] ([i915#82]) -> [DMESG-WARN][6]
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7611/shard-snb5/igt@i915_selftest@mock_requests.html
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3880/shard-snb5/igt@i915_selftest@mock_requests.html
    - shard-iclb:         [INCOMPLETE][7] ([i915#140]) -> [DMESG-WARN][8]
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7611/shard-iclb8/igt@i915_selftest@mock_requests.html
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3880/shard-iclb3/igt@i915_selftest@mock_requests.html

  * igt@runner@aborted:
    - shard-apl:          [FAIL][9] -> ([FAIL][10], [FAIL][11]) ([i915#716])
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7611/shard-apl8/igt@runner@aborted.html
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3880/shard-apl2/igt@runner@aborted.html
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3880/shard-apl3/igt@runner@aborted.html

  
New tests
---------

  New tests have been introduced between CI_DRM_7611_full and IGTPW_3880_full:

### New IGT tests (1) ###

  * igt@gem_huc_copy@huc-copy:
    - Statuses : 4 fail(s) 2 skip(s)
    - Exec time: [0.0] s

  

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

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

### IGT changes ###

#### Issues hit ####

  * igt@gem_busy@busy-vcs1:
    - shard-iclb:         [PASS][12] -> [SKIP][13] ([fdo#112080]) +7 similar issues
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7611/shard-iclb4/igt@gem_busy@busy-vcs1.html
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3880/shard-iclb5/igt@gem_busy@busy-vcs1.html

  * igt@gem_ctx_isolation@bcs0-s3:
    - shard-apl:          [PASS][14] -> [DMESG-WARN][15] ([i915#180]) +2 similar issues
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7611/shard-apl7/igt@gem_ctx_isolation@bcs0-s3.html
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3880/shard-apl4/igt@gem_ctx_isolation@bcs0-s3.html

  * igt@gem_ctx_persistence@vcs1-queued:
    - shard-iclb:         [PASS][16] -> [SKIP][17] ([fdo#109276] / [fdo#112080])
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7611/shard-iclb1/igt@gem_ctx_persistence@vcs1-queued.html
   [17]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3880/shard-iclb6/igt@gem_ctx_persistence@vcs1-queued.html

  * igt@gem_ctx_shared@q-smoketest-vebox:
    - shard-tglb:         [PASS][18] -> [INCOMPLETE][19] ([fdo#111735])
   [18]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7611/shard-tglb5/igt@gem_ctx_shared@q-smoketest-vebox.html
   [19]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3880/shard-tglb4/igt@gem_ctx_shared@q-smoketest-vebox.html

  * igt@gem_eio@hibernate:
    - shard-tglb:         [PASS][20] -> [INCOMPLETE][21] ([i915#456])
   [20]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7611/shard-tglb1/igt@gem_eio@hibernate.html
   [21]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3880/shard-tglb5/igt@gem_eio@hibernate.html

  * igt@gem_exec_parallel@contexts:
    - shard-tglb:         [PASS][22] -> [INCOMPLETE][23] ([i915#470])
   [22]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7611/shard-tglb3/igt@gem_exec_parallel@contexts.html
   [23]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3880/shard-tglb4/igt@gem_exec_parallel@contexts.html

  * igt@gem_exec_schedule@preempt-contexts-bsd:
    - shard-iclb:         [PASS][24] -> [SKIP][25] ([fdo#112146]) +1 similar issue
   [24]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7611/shard-iclb3/igt@gem_exec_schedule@preempt-contexts-bsd.html
   [25]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3880/shard-iclb2/igt@gem_exec_schedule@preempt-contexts-bsd.html

  * igt@gem_exec_schedule@preempt-queue-chain-bsd1:
    - shard-tglb:         [PASS][26] -> [INCOMPLETE][27] ([fdo#111606] / [fdo#111677])
   [26]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7611/shard-tglb3/igt@gem_exec_schedule@preempt-queue-chain-bsd1.html
   [27]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3880/shard-tglb6/igt@gem_exec_schedule@preempt-queue-chain-bsd1.html

  * igt@gem_exec_whisper@normal:
    - shard-tglb:         [PASS][28] -> [INCOMPLETE][29] ([i915#435])
   [28]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7611/shard-tglb6/igt@gem_exec_whisper@normal.html
   [29]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3880/shard-tglb7/igt@gem_exec_whisper@normal.html

  * igt@gem_persistent_relocs@forked-interruptible-thrashing:
    - shard-kbl:          [PASS][30] -> [TIMEOUT][31] ([i915#530])
   [30]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7611/shard-kbl7/igt@gem_persistent_relocs@forked-interruptible-thrashing.html
   [31]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3880/shard-kbl1/igt@gem_persistent_relocs@forked-interruptible-thrashing.html

  * igt@gem_ppgtt@flink-and-close-vma-leak:
    - shard-glk:          [PASS][32] -> [FAIL][33] ([i915#644])
   [32]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7611/shard-glk2/igt@gem_ppgtt@flink-and-close-vma-leak.html
   [33]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3880/shard-glk1/igt@gem_ppgtt@flink-and-close-vma-leak.html
    - shard-apl:          [PASS][34] -> [FAIL][35] ([i915#644])
   [34]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7611/shard-apl6/igt@gem_ppgtt@flink-and-close-vma-leak.html
   [35]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3880/shard-apl4/igt@gem_ppgtt@flink-and-close-vma-leak.html

  * igt@gem_userptr_blits@sync-unmap-after-close:
    - shard-snb:          [PASS][36] -> [DMESG-WARN][37] ([fdo#111870])
   [36]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7611/shard-snb2/igt@gem_userptr_blits@sync-unmap-after-close.html
   [37]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3880/shard-snb5/igt@gem_userptr_blits@sync-unmap-after-close.html

  * igt@i915_pm_dc@dc6-psr:
    - shard-iclb:         [PASS][38] -> [FAIL][39] ([i915#454])
   [38]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7611/shard-iclb5/igt@i915_pm_dc@dc6-psr.html
   [39]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3880/shard-iclb6/igt@i915_pm_dc@dc6-psr.html

  * igt@i915_pm_rpm@system-suspend-modeset:
    - shard-tglb:         [PASS][40] -> [INCOMPLETE][41] ([i915#456] / [i915#460])
   [40]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7611/shard-tglb6/igt@i915_pm_rpm@system-suspend-modeset.html
   [41]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3880/shard-tglb2/igt@i915_pm_rpm@system-suspend-modeset.html

  * igt@kms_concurrent@pipe-b:
    - shard-snb:          [PASS][42] -> [DMESG-WARN][43] ([i915#478])
   [42]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7611/shard-snb4/igt@kms_concurrent@pipe-b.html
   [43]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3880/shard-snb6/igt@kms_concurrent@pipe-b.html

  * igt@kms_cursor_crc@pipe-a-cursor-suspend:
    - shard-kbl:          [PASS][44] -> [DMESG-WARN][45] ([i915#180]) +2 similar issues
   [44]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7611/shard-kbl7/igt@kms_cursor_crc@pipe-a-cursor-suspend.html
   [45]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3880/shard-kbl1/igt@kms_cursor_crc@pipe-a-cursor-suspend.html

  * igt@kms_flip@flip-vs-suspend-interruptible:
    - shard-tglb:         [PASS][46] -> [INCOMPLETE][47] ([i915#456] / [i915#460] / [i915#516])
   [46]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7611/shard-tglb6/igt@kms_flip@flip-vs-suspend-interruptible.html
   [47]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3880/shard-tglb4/igt@kms_flip@flip-vs-suspend-interruptible.html

  * igt@kms_frontbuffer_tracking@fbc-2p-primscrn-cur-indfb-move:
    - shard-glk:          [PASS][48] -> [FAIL][49] ([i915#49])
   [48]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7611/shard-glk8/igt@kms_frontbuffer_tracking@fbc-2p-primscrn-cur-indfb-move.html
   [49]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3880/shard-glk8/igt@kms_frontbuffer_tracking@fbc-2p-primscrn-cur-indfb-move.html

  * igt@kms_frontbuffer_tracking@fbcpsr-suspend:
    - shard-tglb:         [PASS][50] -> [INCOMPLETE][51] ([i915#456] / [i915#460] / [i915#474])
   [50]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7611/shard-tglb7/igt@kms_frontbuffer_tracking@fbcpsr-suspend.html
   [51]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3880/shard-tglb5/igt@kms_frontbuffer_tracking@fbcpsr-suspend.html

  * igt@kms_psr@psr2_cursor_plane_move:
    - shard-iclb:         [PASS][52] -> [SKIP][53] ([fdo#109441])
   [52]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7611/shard-iclb2/igt@kms_psr@psr2_cursor_plane_move.html
   [53]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3880/shard-iclb3/igt@kms_psr@psr2_cursor_plane_move.html

  * igt@prime_vgem@fence-wait-bsd2:
    - shard-iclb:         [PASS][54] -> [SKIP][55] ([fdo#109276]) +11 similar issues
   [54]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7611/shard-iclb4/igt@prime_vgem@fence-wait-bsd2.html
   [55]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3880/shard-iclb3/igt@prime_vgem@fence-wait-bsd2.html

  
#### Possible fixes ####

  * igt@gem_ctx_persistence@vcs1-mixed:
    - shard-iclb:         [SKIP][56] ([fdo#109276] / [fdo#112080]) -> [PASS][57] +1 similar issue
   [56]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7611/shard-iclb6/igt@gem_ctx_persistence@vcs1-mixed.html
   [57]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3880/shard-iclb2/igt@gem_ctx_persistence@vcs1-mixed.html

  * igt@gem_exec_nop@basic-sequential:
    - shard-tglb:         [INCOMPLETE][58] ([i915#435]) -> [PASS][59]
   [58]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7611/shard-tglb9/igt@gem_exec_nop@basic-sequential.html
   [59]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3880/shard-tglb2/igt@gem_exec_nop@basic-sequential.html

  * {igt@gem_exec_schedule@pi-common-bsd1}:
    - shard-iclb:         [SKIP][60] ([fdo#109276]) -> [PASS][61] +10 similar issues
   [60]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7611/shard-iclb6/igt@gem_exec_schedule@pi-common-bsd1.html
   [61]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3880/shard-iclb4/igt@gem_exec_schedule@pi-common-bsd1.html

  * {igt@gem_exec_schedule@pi-shared-iova-bsd}:
    - shard-iclb:         [SKIP][62] ([i915#677]) -> [PASS][63]
   [62]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7611/shard-iclb4/igt@gem_exec_schedule@pi-shared-iova-bsd.html
   [63]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3880/shard-iclb6/igt@gem_exec_schedule@pi-shared-iova-bsd.html

  * igt@gem_exec_schedule@preemptive-hang-bsd:
    - shard-iclb:         [SKIP][64] ([fdo#112146]) -> [PASS][65] +3 similar issues
   [64]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7611/shard-iclb4/igt@gem_exec_schedule@preemptive-hang-bsd.html
   [65]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3880/shard-iclb8/igt@gem_exec_schedule@preemptive-hang-bsd.html

  * igt@gem_exec_store@pages-vcs1:
    - shard-iclb:         [SKIP][66] ([fdo#112080]) -> [PASS][67] +7 similar issues
   [66]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7611/shard-iclb3/igt@gem_exec_store@pages-vcs1.html
   [67]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3880/shard-iclb2/igt@gem_exec_store@pages-vcs1.html

  * igt@gem_persistent_relocs@interruptible:
    - shard-snb:          [DMESG-WARN][68] ([i915#478]) -> [PASS][69] +1 similar issue
   [68]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7611/shard-snb1/igt@gem_persistent_relocs@interruptible.html
   [69]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3880/shard-snb1/igt@gem_persistent_relocs@interruptible.html

  * igt@gem_workarounds@suspend-resume:
    - shard-tglb:         [INCOMPLETE][70] ([i915#456] / [i915#460]) -> [PASS][71] +1 similar issue
   [70]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7611/shard-tglb1/igt@gem_workarounds@suspend-resume.html
   [71]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3880/shard-tglb9/igt@gem_workarounds@suspend-resume.html

  * igt@kms_cursor_crc@pipe-a-cursor-128x128-onscreen:
    - shard-apl:          [FAIL][72] ([i915#54]) -> [PASS][73]
   [72]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7611/shard-apl6/igt@kms_cursor_crc@pipe-a-cursor-128x128-onscreen.html
   [73]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3880/shard-apl3/igt@kms_cursor_crc@pipe-a-cursor-128x128-onscreen.html
    - shard-kbl:          [FAIL][74] ([i915#54]) -> [PASS][75]
   [74]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7611/shard-kbl7/igt@kms_cursor_crc@pipe-a-cursor-128x128-onscreen.html
   [75]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3880/shard-kbl2/igt@kms_cursor_crc@pipe-a-cursor-128x128-onscreen.html

  * igt@kms_cursor_crc@pipe-c-cursor-suspend:
    - shard-kbl:          [DMESG-WARN][76] ([i915#180]) -> [PASS][77] +7 similar issues
   [76]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7611/shard-kbl3/igt@kms_cursor_crc@pipe-c-cursor-suspend.html
   [77]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3880/shard-kbl6/igt@kms_cursor_crc@pipe-c-cursor-suspend.html

  * igt@kms_flip@2x-flip-vs-expired-vblank-interruptible:
    - shard-glk:          [FAIL][78] ([i915#79]) -> [PASS][79]
   [78]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7611/shard-glk3/igt@kms_flip@2x-flip-vs-expired-vblank-interruptible.html
   [79]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3880/shard-glk8/igt@kms_flip@2x-flip-vs-expired-vblank-interruptible.html

  * igt@kms_flip@flip-vs-suspend-interruptible:
    - shard-apl:          [DMESG-WARN][80] ([i915#180]) -> [PASS][81]
   [80]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7611/shard-apl6/igt@kms_flip@flip-vs-suspend-interruptible.html
   [81]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3880/shard-apl7/igt@kms_flip@flip-vs-suspend-interruptible.html
    - shard-kbl:          [DMESG-WARN][82] ([i915#180] / [i915#56]) -> [PASS][83]
   [82]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7611/shard-kbl3/igt@kms_flip@flip-vs-suspend-interruptible.html
   [83]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3880/shard-kbl3/igt@kms_flip@flip-vs-suspend-interruptible.html

  * igt@kms_frontbuffer_tracking@fbc-1p-primscrn-cur-indfb-move:
    - shard-kbl:          [FAIL][84] ([i915#49]) -> [PASS][85]
   [84]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7611/shard-kbl7/igt@kms_frontbuffer_tracking@fbc-1p-primscrn-cur-indfb-move.html
   [85]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3880/shard-kbl3/igt@kms_frontbuffer_tracking@fbc-1p-primscrn-cur-indfb-move.html

  * igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-render:
    - shard-apl:          [FAIL][86] ([i915#49]) -> [PASS][87] +1 similar issue
   [86]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7611/shard-apl6/igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-render.html
   [87]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3880/shard-apl7/igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-render.html

  * igt@kms_pipe_crc_basic@suspend-read-crc-pipe-c:
    - shard-kbl:          [INCOMPLETE][88] ([fdo#103665]) -> [PASS][89]
   [88]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7611/shard-kbl3/igt@kms_pipe_crc_basic@suspend-read-crc-pipe-c.html
   [89]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3880/shard-kbl4/igt@kms_pipe_crc_basic@suspend-read-crc-pipe-c.html

  * igt@kms_psr2_su@frontbuffer:
    - shard-tglb:         [FAIL][90] ([fdo#111842] / [i915#608]) -> [PASS][91]
   [90]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7611/shard-tglb6/igt@kms_psr2_su@frontbuffer.html
   [91]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3880/shard-tglb3/igt@kms_psr2_su@frontbuffer.html

  * igt@kms_psr@psr2_primary_mmap_gtt:
    - shard-iclb:         [SKIP][92] ([fdo#109441]) -> [PASS][93] +1 similar issue
   [92]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7611/shard-iclb8/igt@kms_psr@psr2_primary_mmap_gtt.html
   [93]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3880/shard-iclb2/igt@kms_psr@psr2_primary_mmap_gtt.html

  * igt@kms_psr@psr2_suspend:
    - shard-iclb:         [DMESG-WARN][94] ([fdo#107724]) -> [PASS][95]
   [94]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7611/shard-iclb2/igt@kms_psr@psr2_suspend.html
   [95]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3880/shard-iclb2/igt@kms_psr@psr2_suspend.html

  * igt@perf@oa-exponents:
    - shard-tglb:         [FAIL][96] ([i915#84]) -> [PASS][97]
   [96]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7611/shard-tglb6/igt@perf@oa-exponents.html
   [97]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3880/shard-tglb9/igt@perf@oa-exponents.html

  
#### Warnings ####

  * igt@gem_eio@kms:
    - shard-snb:          [DMESG-WARN][98] ([i915#444]) -> [INCOMPLETE][99] ([i915#82])
   [98]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7611/shard-snb1/igt@gem_eio@kms.html
   [99]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3880/shard-snb1/igt@gem_eio@kms.html

  * igt@gem_userptr_blits@map-fixed-invalidate-overlap-busy-gup:
    - shard-snb:          [DMESG-WARN][100] ([fdo#110789] / [fdo#111870]) -> [DMESG-WARN][101] ([fdo#111870])
   [100]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7611/shard-snb4/igt@gem_userptr_blits@map-fixed-invalidate-overlap-busy-gup.html
   [101]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3880/shard-snb5/igt@gem_userptr_blits@map-fixed-invalidate-overlap-busy-gup.html

  * igt@i915_pm_dc@dc5-dpms:
    - shard-snb:          [INCOMPLETE][102] ([i915#82]) -> [SKIP][103] ([fdo#109271])
   [102]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7611/shard-snb2/igt@i915_pm_dc@dc5-dpms.html
   [103]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3880/shard-snb7/igt@i915_pm_dc@dc5-dpms.html

  * igt@runner@aborted:
    - shard-kbl:          [FAIL][104] ([fdo#103665]) -> ([FAIL][105], [FAIL][106]) ([fdo#103665] / [i915#716])
   [104]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7611/shard-kbl7/igt@runner@aborted.html
   [105]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3880/shard-kbl1/igt@runner@aborted.html
   [106]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3880/shard-kbl3/igt@runner@aborted.html

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

  [fdo#103665]: https://bugs.freedesktop.org/show_bug.cgi?id=103665
  [fdo#107724]: https://bugs.freedesktop.org/show_bug.cgi?id=107724
  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [fdo#109276]: https://bugs.freedesktop.org/show_bug.cgi?id=109276
  [fdo#109441]: https://bugs.freedesktop.org/show_bug.cgi?id=109441
  [fdo#110789]: https://bugs.freedesktop.org/show_bug.cgi?id=110789
  [fdo#111606]: https://bugs.freedesktop.org/show_bug.cgi?id=111606
  [fdo#111677]: https://bugs.freedesktop.org/show_bug.cgi?id=111677
  [fdo#111735]: https://bugs.freedesktop.org/show_bug.cgi?id=111735
  [fdo#111842]: https://bugs.freedesktop.org/show_bug.cgi?id=111842
  [fdo#111870]: https://bugs.freedesktop.org/show_bug.cgi?id=111870
  [fdo#112080]: https://bugs.freedesktop.org/show_bug.cgi?id=112080
  [fdo#112146]: https://bugs.freedesktop.org/show_bug.cgi?id=112146
  [i915#140]: https://gitlab.freedesktop.org/drm/intel/issues/140
  [i915#180]: https://gitlab.freedesktop.org/drm/intel/issues/180
  [i915#435]: https://gitlab.freedesktop.org/drm/intel/issues/435
  [i915#444]: https://gitlab.freedesktop.org/drm/intel/issues/444
  [i915#454]: https://gitlab.freedesktop.org/drm/intel/issues/454
  [i915#456]: https://gitlab.freedesktop.org/drm/intel/issues/456
  [i915#460]: https://gitlab.freedesktop.org/drm/intel/issues/460
  [i915#470]: https://gitlab.freedesktop.org/drm/intel/issues/470
  [i915#474]: https://gitlab.freedesktop.org/drm/intel/issues/474
  [i915#478]: https://gitlab.freedesktop.org/drm/intel/issues/478
  [i915#49]: https://gitlab.freedesktop.org/drm/intel/issues/49
  [i915#516]: https://gitlab.freedesktop.org/drm/intel/issues/516
  [i915#530]: https://gitlab.freedesktop.org/drm/intel/issues/530
  [i915#54]: https://gitlab.freedesktop.org/drm/intel/issues/54
  [i915#56]: https://gitlab.freedesktop.org/drm/intel/issues/56
  [i915#608]: https://gitlab.freedesktop.org/drm/intel/issues/608
  [i915#644]: https://gitlab.freedesktop.org/drm/intel/issues/644
  [i915#677]: https://gitlab.freedesktop.org/drm/intel/issues/677
  [i915#716]: https://gitlab.freedesktop.org/drm/intel/issues/716
  [i915#79]: https://gitlab.freedesktop.org/drm/intel/issues/79
  [i915#82]: https://gitlab.freedesktop.org/drm/intel/issues/82
  [i915#84]: https://gitlab.freedesktop.org/drm/intel/issues/84


Participating hosts (10 -> 8)
------------------------------

  Missing    (2): pig-skl-6260u pig-glk-j5005 


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

  * CI: CI-20190529 -> None
  * IGT: IGT_5351 -> IGTPW_3880
  * Piglit: piglit_4509 -> None

  CI-20190529: 20190529
  CI_DRM_7611: a838a8d6accc9027d4d04fb67d2f8a7a2049946c @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_3880: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3880/index.html
  IGT_5351: e7fdcef72d1d6b3bb9f3003bbc37571959e6e8bb @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit

== Logs ==

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

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

* [igt-dev] [PATCH i-g-t v3] tests/i915/gem_huc_copy: Enable a HuC copy test
  2019-12-20 22:41 ` [igt-dev] [PATCH i-g-t v2] " Robert M. Fosha
@ 2019-12-23 22:19   ` Robert M. Fosha
  2020-01-10 17:41     ` [igt-dev] [PATCH i-g-t v4] " Robert M. Fosha
  0 siblings, 1 reply; 25+ messages in thread
From: Robert M. Fosha @ 2019-12-23 22:19 UTC (permalink / raw)
  To: igt-dev; +Cc: Sally Qi

From: Sally Qi <feng.qi@intel.com>

This test case loads the HuC copy firmware to copy the content of
the source buffer to the destination buffer.

v2: (Tony Ye)
 * Restructured some functions and files.
 * Defined the copy buffer size as 4K explicitly as the HuC Copy kernel
   always copy 4K bytes from src buffer to dst buffer.

v3: (Feng Qi, Antonio Argenziano, Tony Ye)
 * Restructured some functions as igt requested, exclude libdrm function call.
 * Remove huc function wrappers
 * Random initialize source input buffer

v4:
 * Fix autotools build failure.

v5: (Feng Qi, Tony Ye)
 * Released all bo buffer after huc copying.
 * Restructured huc_copy() function.

Signed-off-by: Sally Qi <feng.qi@intel.com>
Signed-off-by: Tony Ye <tony.ye@intel.com>
Acked-by: Antonio Argenziano <antonio.argenziano@intel.com>
---
 lib/Makefile.sources      |   2 +
 lib/huc_copy.c            | 107 +++++++++++++++++++++++++++++++++
 lib/huc_copy.h            |  50 ++++++++++++++++
 lib/intel_batchbuffer.c   |  20 +++++++
 lib/intel_batchbuffer.h   |  20 +++++++
 lib/meson.build           |   1 +
 tests/Makefile.sources    |   3 +
 tests/i915/gem_huc_copy.c | 123 ++++++++++++++++++++++++++++++++++++++
 tests/meson.build         |   1 +
 9 files changed, 327 insertions(+)
 create mode 100644 lib/huc_copy.c
 create mode 100644 lib/huc_copy.h
 create mode 100644 tests/i915/gem_huc_copy.c

diff --git a/lib/Makefile.sources b/lib/Makefile.sources
index 5dd3962e..e9e132c1 100644
--- a/lib/Makefile.sources
+++ b/lib/Makefile.sources
@@ -78,6 +78,8 @@ lib_source_list =	 	\
 	ioctl_wrappers.h	\
 	media_fill.c		\
 	media_fill.h            \
+	huc_copy.c		\
+	huc_copy.h		\
 	media_spin.h		\
 	media_spin.c		\
 	gpgpu_fill.h		\
diff --git a/lib/huc_copy.c b/lib/huc_copy.c
new file mode 100644
index 00000000..c3dece9f
--- /dev/null
+++ b/lib/huc_copy.c
@@ -0,0 +1,107 @@
+/*
+ * Copyright © 2019 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ *
+ */
+
+#include <i915_drm.h>
+#include "huc_copy.h"
+
+static void
+gen9_emit_huc_virtual_addr_state(struct drm_i915_gem_exec_object2 *src,
+		struct drm_i915_gem_exec_object2 *dst,
+		struct drm_i915_gem_relocation_entry *reloc_src,
+		struct drm_i915_gem_relocation_entry *reloc_dst,
+		uint32_t *buf,
+		int *i)
+{
+	buf[(*i)++] = HUC_VIRTUAL_ADDR_STATE;
+
+	for (int j = 0; j < HUC_VIRTUAL_ADDR_REGION_NUM; j++) {
+		if (j == HUC_VIRTUAL_ADDR_REGION_SRC) {
+			buf[(*i)++] = src->offset;
+
+			reloc_src->target_handle = src->handle;
+			reloc_src->delta = 0;
+			reloc_src->offset = (*i - 1) * sizeof(buf[0]);
+			reloc_src->read_domains = 0;
+			reloc_src->write_domain = 0;
+		} else if (j == HUC_VIRTUAL_ADDR_REGION_DST) {
+			buf[(*i)++] = dst->offset;
+
+			reloc_dst->target_handle = dst->handle;
+			reloc_dst->delta = 0;
+			reloc_dst->offset = (*i - 1) * sizeof(buf[0]);
+			reloc_dst->read_domains = 0;
+			reloc_dst->write_domain = I915_GEM_DOMAIN_RENDER;
+		} else {
+			buf[(*i)++] = 0;
+		}
+		buf[(*i)++] = 0;
+		buf[(*i)++] = 0;
+	}
+}
+
+void
+gen9_huc_copyfunc(int fd,
+		struct drm_i915_gem_exec_object2 *obj,
+		int n_bo)
+{
+	struct drm_i915_gem_relocation_entry reloc[2];
+	struct drm_i915_gem_execbuffer2 execbuf;
+	int i = 0;
+	uint32_t buf[63];
+
+	/* 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;
+
+	memset(reloc, 0, sizeof(reloc));
+	gen9_emit_huc_virtual_addr_state(&obj[0], &obj[1], &reloc[0], &reloc[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));
+	obj[2].relocation_count = 2;
+	obj[2].relocs_ptr = to_user_pointer(reloc);
+
+	memset(&execbuf, 0, sizeof(execbuf));
+	execbuf.buffers_ptr = to_user_pointer(obj);
+	execbuf.buffer_count = n_bo;
+	execbuf.flags = I915_EXEC_BSD;
+
+	gem_execbuf(fd, &execbuf);
+}
diff --git a/lib/huc_copy.h b/lib/huc_copy.h
new file mode 100644
index 00000000..088f7954
--- /dev/null
+++ b/lib/huc_copy.h
@@ -0,0 +1,50 @@
+/*
+ * Copyright © 2019 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ *
+ */
+
+#ifndef HUC_COPY_H
+#define HUC_COPY_H
+
+#include <stdint.h>
+#include <string.h>
+#include "ioctl_wrappers.h"
+#include "intel_reg.h"
+
+#define PARALLEL_VIDEO_PIPE		(0x3<<29)
+#define MFX_WAIT			(PARALLEL_VIDEO_PIPE|(0x1<<27)|(0x1<<8))
+
+#define HUC_IMEM_STATE			(PARALLEL_VIDEO_PIPE|(0x2<<27)|(0xb<<23)|(0x1<<16)|0x3)
+#define HUC_PIPE_MODE_SELECT		(PARALLEL_VIDEO_PIPE|(0x2<<27)|(0xb<<23)|0x1)
+#define HUC_START			(PARALLEL_VIDEO_PIPE|(0x2<<27)|(0xb<<23)|(0x21<<16))
+#define HUC_VIRTUAL_ADDR_STATE		(PARALLEL_VIDEO_PIPE|(0x2<<27)|(0xb<<23)|(0x4<<16)|0x2f)
+
+#define HUC_VIRTUAL_ADDR_REGION_NUM	16
+#define HUC_VIRTUAL_ADDR_REGION_SRC	0
+#define HUC_VIRTUAL_ADDR_REGION_DST	14
+
+void
+gen9_huc_copyfunc(int fd,
+		struct drm_i915_gem_exec_object2 *obj,
+		int n_bo);
+
+#endif /* HUC_COPY_H */
diff --git a/lib/intel_batchbuffer.c b/lib/intel_batchbuffer.c
index 51aae4dc..d8cb9df3 100644
--- a/lib/intel_batchbuffer.c
+++ b/lib/intel_batchbuffer.c
@@ -43,6 +43,7 @@
 #include "ioctl_wrappers.h"
 #include "media_spin.h"
 #include "gpgpu_fill.h"
+#include "huc_copy.h"
 
 #include <i915_drm.h>
 
@@ -942,3 +943,22 @@ igt_media_spinfunc_t igt_get_media_spinfunc(int devid)
 
 	return spin;
 }
+
+/**
+ * igt_get_huc_copyfunc:
+ * @devid: pci device id
+ *
+ * Returns:
+ *
+ * The platform-specific huc copy function pointer for the device specified
+ * with @devid. Will return NULL when no media spin 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))
+		copy = gen9_huc_copyfunc;
+
+	return copy;
+}
diff --git a/lib/intel_batchbuffer.h b/lib/intel_batchbuffer.h
index 37e3affe..1c3ad851 100644
--- a/lib/intel_batchbuffer.h
+++ b/lib/intel_batchbuffer.h
@@ -388,4 +388,24 @@ typedef void (*igt_media_spinfunc_t)(struct intel_batchbuffer *batch,
 
 igt_media_spinfunc_t igt_get_media_spinfunc(int devid);
 
+/**
+ * igt_huc_copyfunc_t:
+ * @fd: drm fd
+ * @obj: drm_i915_gem_exec_object2 buffer array
+ *       obj[0] is source buffer
+ *       obj[1] is destination buffer
+ *       obj[2] is execution buffer
+ * @n_bo: the size of @obj array
+ *
+ * This is the type of the per-platform huc copy functions.
+ *
+ * The huc copy function emits a batchbuffer to the VDBOX engine to
+ * invoke the HuC Copy kernel to copy 4K bytes from the source buffer
+ * to the destination buffer.
+ */
+typedef void (*igt_huc_copyfunc_t)(int fd,
+		struct drm_i915_gem_exec_object2 *obj,
+		int n_bo);
+
+igt_huc_copyfunc_t	igt_get_huc_copyfunc(int devid);
 #endif
diff --git a/lib/meson.build b/lib/meson.build
index 57eb7d93..3d720683 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -1,5 +1,6 @@
 lib_sources = [
 	'drmtest.c',
+	'huc_copy.c',
 	'i915/gem_context.c',
 	'i915/gem_engine_topology.c',
 	'i915/gem_scheduler.c',
diff --git a/tests/Makefile.sources b/tests/Makefile.sources
index 806eb02d..d230d6b4 100644
--- a/tests/Makefile.sources
+++ b/tests/Makefile.sources
@@ -313,6 +313,9 @@ gem_media_fill_SOURCES = i915/gem_media_fill.c
 TESTS_progs += gem_media_vme
 gem_media_vme_SOURCES = i915/gem_media_vme.c
 
+TESTS_progs += gem_huc_copy
+gem_huc_copy_SOURCES = i915/gem_huc_copy.c
+
 TESTS_progs += gem_mmap
 gem_mmap_SOURCES = i915/gem_mmap.c
 
diff --git a/tests/i915/gem_huc_copy.c b/tests/i915/gem_huc_copy.c
new file mode 100644
index 00000000..312c303e
--- /dev/null
+++ b/tests/i915/gem_huc_copy.c
@@ -0,0 +1,123 @@
+/*
+ * Copyright © 2019 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+#include "igt.h"
+#include <stdbool.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <sys/ioctl.h>
+#include <stdio.h>
+#include <string.h>
+#include <fcntl.h>
+#include <inttypes.h>
+#include <errno.h>
+#include <sys/stat.h>
+#include <sys/time.h>
+#include "drm.h"
+
+IGT_TEST_DESCRIPTION("A very simple workload for the HuC.");
+
+#define HUC_COPY_DATA_BUF_SIZE	4096
+
+static void
+compare_huc_copy_result(int drm_fd, uint32_t src_handle, uint32_t dst_handle)
+{
+	char src_output[HUC_COPY_DATA_BUF_SIZE];
+	char dst_output[HUC_COPY_DATA_BUF_SIZE];
+
+	gem_read(drm_fd, src_handle, 0, src_output, HUC_COPY_DATA_BUF_SIZE);
+	gem_read(drm_fd, dst_handle, 0, dst_output, HUC_COPY_DATA_BUF_SIZE);
+
+	for (int i = 0; i < HUC_COPY_DATA_BUF_SIZE; i++) {
+		igt_assert_f(src_output[i] == dst_output[i],
+			     "Exepected %c, found %c at %4d.\n",
+			     src_output[i], dst_output[i], i);
+	}
+}
+
+static bool
+check_huc_status(int fd)
+{
+	int val = 0;
+	struct drm_i915_getparam pg;
+
+	pg.param = I915_PARAM_HUC_STATUS;
+	pg.value = &val;
+	if (ioctl(fd, DRM_IOCTL_I915_GETPARAM, &pg) == 0) {
+		return !!val;
+	} else {
+		return 0;
+	}
+}
+
+igt_main
+{
+	int drm_fd = -1;
+	uint32_t devid;
+	igt_huc_copyfunc_t huc_copy;
+
+	igt_fixture {
+		drm_fd = drm_open_driver(DRIVER_INTEL);
+		igt_require_gem(drm_fd);
+		devid = intel_get_drm_devid(drm_fd);
+		huc_copy = igt_get_huc_copyfunc(devid);
+		igt_require_f(huc_copy, "no huc_copy function\n");
+		igt_assert_f(check_huc_status(drm_fd) == true,
+			"HuC is not successfully loaded!\n");
+	}
+
+	igt_describe("Make sure that Huc firmware works"
+		     "by copying a char array using Huc"
+		     "and verifying the copied result");
+
+	igt_subtest("huc-copy") {
+		char inputs[HUC_COPY_DATA_BUF_SIZE];
+		struct drm_i915_gem_exec_object2 obj[3];
+
+		/* Initialize src buffer randomly */
+		srand(time(NULL));
+		for (int i = 0; i < HUC_COPY_DATA_BUF_SIZE; i++) {
+			inputs[i] = (char) (rand() % 256);
+		}
+
+		memset(obj, 0, sizeof(obj));
+		/* source buffer object for storing input */
+		obj[0].handle = gem_create(drm_fd, HUC_COPY_DATA_BUF_SIZE);
+		/* destination buffer object to receive input */
+		obj[1].handle = gem_create(drm_fd, HUC_COPY_DATA_BUF_SIZE);
+		/* execution buffer object */
+		obj[2].handle = gem_create(drm_fd, 4096);
+
+		gem_write(drm_fd, obj[0].handle, 0, inputs, HUC_COPY_DATA_BUF_SIZE);
+
+		huc_copy(drm_fd, obj, 3);
+		compare_huc_copy_result(drm_fd, obj[0].handle, obj[1].handle);
+
+		gem_close(drm_fd, obj[0].handle);
+		gem_close(drm_fd, obj[1].handle);
+		gem_close(drm_fd, obj[2].handle);
+	}
+
+	igt_fixture {
+		close(drm_fd);
+	}
+}
diff --git a/tests/meson.build b/tests/meson.build
index 570de545..0545b612 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -165,6 +165,7 @@ i915_progs = [
 	'gem_gtt_cpu_tlb',
 	'gem_gtt_hog',
 	'gem_gtt_speed',
+	'gem_huc_copy',
 	'gem_largeobject',
 	'gem_linear_blits',
 	'gem_lut_handle',
-- 
2.21.0.5.gaeb582a983

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

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

* [igt-dev] ✗ Fi.CI.BAT: failure for tests/i915/gem_huc_copy: Enable a HuC copy test (rev3)
  2019-12-19 23:50 [igt-dev] [PATCH i-g-t] tests/i915/gem_huc_copy: Enable a HuC copy test Robert M. Fosha
                   ` (6 preceding siblings ...)
  2019-12-21  3:18 ` [igt-dev] ✓ Fi.CI.IGT: success for tests/i915/gem_huc_copy: Enable a HuC copy test Patchwork
@ 2019-12-23 23:28 ` Patchwork
  2020-01-10 19:14 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/i915/gem_huc_copy: Enable a HuC copy test (rev4) Patchwork
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 25+ messages in thread
From: Patchwork @ 2019-12-23 23:28 UTC (permalink / raw)
  To: Robert M. Fosha; +Cc: igt-dev

== Series Details ==

Series: tests/i915/gem_huc_copy: Enable a HuC copy test (rev3)
URL   : https://patchwork.freedesktop.org/series/71194/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_7630 -> IGTPW_3884
====================================================

Summary
-------

  **FAILURE**

  Serious unknown changes coming with IGTPW_3884 absolutely need to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in IGTPW_3884, 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_3884/index.html

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

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

### IGT changes ###

#### Possible regressions ####

  * igt@i915_selftest@live_blt:
    - fi-ivb-3770:        NOTRUN -> [DMESG-FAIL][1]
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3884/fi-ivb-3770/igt@i915_selftest@live_blt.html

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

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

### IGT changes ###

#### Possible fixes ####

  * igt@i915_module_load@reload-with-fault-injection:
    - fi-cfl-8700k:       [INCOMPLETE][2] ([i915#505]) -> [PASS][3]
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7630/fi-cfl-8700k/igt@i915_module_load@reload-with-fault-injection.html
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3884/fi-cfl-8700k/igt@i915_module_load@reload-with-fault-injection.html

  * igt@i915_selftest@live_blt:
    - fi-hsw-4770:        [DMESG-FAIL][4] ([i915#725]) -> [PASS][5]
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7630/fi-hsw-4770/igt@i915_selftest@live_blt.html
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3884/fi-hsw-4770/igt@i915_selftest@live_blt.html

  * igt@i915_selftest@live_execlists:
    - fi-kbl-soraka:      [DMESG-FAIL][6] ([i915#656]) -> [PASS][7]
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7630/fi-kbl-soraka/igt@i915_selftest@live_execlists.html
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3884/fi-kbl-soraka/igt@i915_selftest@live_execlists.html

  * igt@i915_selftest@live_memory_region:
    - fi-bwr-2160:        [FAIL][8] -> [PASS][9]
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7630/fi-bwr-2160/igt@i915_selftest@live_memory_region.html
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3884/fi-bwr-2160/igt@i915_selftest@live_memory_region.html

  
#### Warnings ####

  * igt@kms_cursor_legacy@basic-busy-flip-before-cursor-legacy:
    - fi-kbl-x1275:       [DMESG-WARN][10] ([i915#62] / [i915#92] / [i915#95]) -> [DMESG-WARN][11] ([i915#62] / [i915#92]) +5 similar issues
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7630/fi-kbl-x1275/igt@kms_cursor_legacy@basic-busy-flip-before-cursor-legacy.html
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3884/fi-kbl-x1275/igt@kms_cursor_legacy@basic-busy-flip-before-cursor-legacy.html

  * igt@kms_force_connector_basic@force-edid:
    - fi-kbl-x1275:       [DMESG-WARN][12] ([i915#62] / [i915#92]) -> [DMESG-WARN][13] ([i915#62] / [i915#92] / [i915#95]) +5 similar issues
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7630/fi-kbl-x1275/igt@kms_force_connector_basic@force-edid.html
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3884/fi-kbl-x1275/igt@kms_force_connector_basic@force-edid.html

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

  [fdo#111735]: https://bugs.freedesktop.org/show_bug.cgi?id=111735
  [i915#505]: https://gitlab.freedesktop.org/drm/intel/issues/505
  [i915#62]: https://gitlab.freedesktop.org/drm/intel/issues/62
  [i915#656]: https://gitlab.freedesktop.org/drm/intel/issues/656
  [i915#725]: https://gitlab.freedesktop.org/drm/intel/issues/725
  [i915#92]: https://gitlab.freedesktop.org/drm/intel/issues/92
  [i915#95]: https://gitlab.freedesktop.org/drm/intel/issues/95


Participating hosts (43 -> 38)
------------------------------

  Additional (8): fi-byt-j1900 fi-skl-6770hq fi-glk-dsi fi-whl-u fi-gdg-551 fi-ivb-3770 fi-bsw-nick fi-snb-2600 
  Missing    (13): fi-ilk-m540 fi-bdw-5557u fi-skl-guc fi-byt-squawks fi-bsw-cyan fi-ctg-p8600 fi-elk-e7500 fi-bsw-kefka fi-skl-lmem fi-bdw-samus fi-tgl-y fi-byt-clapper fi-skl-6600u 


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

  * CI: CI-20190529 -> None
  * IGT: IGT_5352 -> IGTPW_3884

  CI-20190529: 20190529
  CI_DRM_7630: 28a2aa0ebf1520ea8a0dd89299f7ceea80dfd96f @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_3884: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3884/index.html
  IGT_5352: 0586d205f651674e575351c2d5a7d0760716c9f1 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools



== Testlist changes ==

+igt@gem_huc_copy@huc-copy

== Logs ==

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

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

* [igt-dev] [PATCH i-g-t v4] tests/i915/gem_huc_copy: Enable a HuC copy test
  2019-12-23 22:19   ` [igt-dev] [PATCH i-g-t v3] " Robert M. Fosha
@ 2020-01-10 17:41     ` Robert M. Fosha
  2020-01-10 18:28       ` Chris Wilson
  2020-04-14 21:24       ` [igt-dev] [PATCH i-g-t v5] " Robert M. Fosha
  0 siblings, 2 replies; 25+ messages in thread
From: Robert M. Fosha @ 2020-01-10 17:41 UTC (permalink / raw)
  To: igt-dev; +Cc: Sally Qi

From: Sally Qi <feng.qi@intel.com>

This test case loads the HuC copy firmware to copy the content of
the source buffer to the destination buffer.

v2: (Tony Ye)
 * Restructured some functions and files.
 * Defined the copy buffer size as 4K explicitly as the HuC Copy kernel
   always copy 4K bytes from src buffer to dst buffer.

v3: (Feng Qi, Antonio Argenziano, Tony Ye)
 * Restructured some functions as igt requested, exclude libdrm function call.
 * Remove huc function wrappers
 * Random initialize source input buffer

v4:
 * Fix autotools build failure.

v5: (Feng Qi, Tony Ye)
 * Released all bo buffer after huc copying.
 * Restructured huc_copy() function.

v6: (Feng Qi)
 * Fixed the function of huc enabling and status check
 * Added huc_copy to fast feedback testlist

Signed-off-by: Sally Qi <feng.qi@intel.com>
Signed-off-by: Tony Ye <tony.ye@intel.com>
Acked-by: Antonio Argenziano <antonio.argenziano@intel.com>
---
 lib/Makefile.sources                  |   2 +
 lib/huc_copy.c                        | 107 ++++++++++++++++++++
 lib/huc_copy.h                        |  50 ++++++++++
 lib/intel_batchbuffer.c               |  20 ++++
 lib/intel_batchbuffer.h               |  20 ++++
 lib/meson.build                       |   1 +
 tests/Makefile.sources                |   3 +
 tests/i915/gem_huc_copy.c             | 138 ++++++++++++++++++++++++++
 tests/intel-ci/fast-feedback.testlist |   1 +
 tests/meson.build                     |   1 +
 10 files changed, 343 insertions(+)
 create mode 100644 lib/huc_copy.c
 create mode 100644 lib/huc_copy.h
 create mode 100644 tests/i915/gem_huc_copy.c

diff --git a/lib/Makefile.sources b/lib/Makefile.sources
index 5dd3962e..e9e132c1 100644
--- a/lib/Makefile.sources
+++ b/lib/Makefile.sources
@@ -78,6 +78,8 @@ lib_source_list =	 	\
 	ioctl_wrappers.h	\
 	media_fill.c		\
 	media_fill.h            \
+	huc_copy.c		\
+	huc_copy.h		\
 	media_spin.h		\
 	media_spin.c		\
 	gpgpu_fill.h		\
diff --git a/lib/huc_copy.c b/lib/huc_copy.c
new file mode 100644
index 00000000..c3dece9f
--- /dev/null
+++ b/lib/huc_copy.c
@@ -0,0 +1,107 @@
+/*
+ * Copyright © 2019 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ *
+ */
+
+#include <i915_drm.h>
+#include "huc_copy.h"
+
+static void
+gen9_emit_huc_virtual_addr_state(struct drm_i915_gem_exec_object2 *src,
+		struct drm_i915_gem_exec_object2 *dst,
+		struct drm_i915_gem_relocation_entry *reloc_src,
+		struct drm_i915_gem_relocation_entry *reloc_dst,
+		uint32_t *buf,
+		int *i)
+{
+	buf[(*i)++] = HUC_VIRTUAL_ADDR_STATE;
+
+	for (int j = 0; j < HUC_VIRTUAL_ADDR_REGION_NUM; j++) {
+		if (j == HUC_VIRTUAL_ADDR_REGION_SRC) {
+			buf[(*i)++] = src->offset;
+
+			reloc_src->target_handle = src->handle;
+			reloc_src->delta = 0;
+			reloc_src->offset = (*i - 1) * sizeof(buf[0]);
+			reloc_src->read_domains = 0;
+			reloc_src->write_domain = 0;
+		} else if (j == HUC_VIRTUAL_ADDR_REGION_DST) {
+			buf[(*i)++] = dst->offset;
+
+			reloc_dst->target_handle = dst->handle;
+			reloc_dst->delta = 0;
+			reloc_dst->offset = (*i - 1) * sizeof(buf[0]);
+			reloc_dst->read_domains = 0;
+			reloc_dst->write_domain = I915_GEM_DOMAIN_RENDER;
+		} else {
+			buf[(*i)++] = 0;
+		}
+		buf[(*i)++] = 0;
+		buf[(*i)++] = 0;
+	}
+}
+
+void
+gen9_huc_copyfunc(int fd,
+		struct drm_i915_gem_exec_object2 *obj,
+		int n_bo)
+{
+	struct drm_i915_gem_relocation_entry reloc[2];
+	struct drm_i915_gem_execbuffer2 execbuf;
+	int i = 0;
+	uint32_t buf[63];
+
+	/* 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;
+
+	memset(reloc, 0, sizeof(reloc));
+	gen9_emit_huc_virtual_addr_state(&obj[0], &obj[1], &reloc[0], &reloc[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));
+	obj[2].relocation_count = 2;
+	obj[2].relocs_ptr = to_user_pointer(reloc);
+
+	memset(&execbuf, 0, sizeof(execbuf));
+	execbuf.buffers_ptr = to_user_pointer(obj);
+	execbuf.buffer_count = n_bo;
+	execbuf.flags = I915_EXEC_BSD;
+
+	gem_execbuf(fd, &execbuf);
+}
diff --git a/lib/huc_copy.h b/lib/huc_copy.h
new file mode 100644
index 00000000..088f7954
--- /dev/null
+++ b/lib/huc_copy.h
@@ -0,0 +1,50 @@
+/*
+ * Copyright © 2019 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ *
+ */
+
+#ifndef HUC_COPY_H
+#define HUC_COPY_H
+
+#include <stdint.h>
+#include <string.h>
+#include "ioctl_wrappers.h"
+#include "intel_reg.h"
+
+#define PARALLEL_VIDEO_PIPE		(0x3<<29)
+#define MFX_WAIT			(PARALLEL_VIDEO_PIPE|(0x1<<27)|(0x1<<8))
+
+#define HUC_IMEM_STATE			(PARALLEL_VIDEO_PIPE|(0x2<<27)|(0xb<<23)|(0x1<<16)|0x3)
+#define HUC_PIPE_MODE_SELECT		(PARALLEL_VIDEO_PIPE|(0x2<<27)|(0xb<<23)|0x1)
+#define HUC_START			(PARALLEL_VIDEO_PIPE|(0x2<<27)|(0xb<<23)|(0x21<<16))
+#define HUC_VIRTUAL_ADDR_STATE		(PARALLEL_VIDEO_PIPE|(0x2<<27)|(0xb<<23)|(0x4<<16)|0x2f)
+
+#define HUC_VIRTUAL_ADDR_REGION_NUM	16
+#define HUC_VIRTUAL_ADDR_REGION_SRC	0
+#define HUC_VIRTUAL_ADDR_REGION_DST	14
+
+void
+gen9_huc_copyfunc(int fd,
+		struct drm_i915_gem_exec_object2 *obj,
+		int n_bo);
+
+#endif /* HUC_COPY_H */
diff --git a/lib/intel_batchbuffer.c b/lib/intel_batchbuffer.c
index 3dc89024..f7040049 100644
--- a/lib/intel_batchbuffer.c
+++ b/lib/intel_batchbuffer.c
@@ -43,6 +43,7 @@
 #include "ioctl_wrappers.h"
 #include "media_spin.h"
 #include "gpgpu_fill.h"
+#include "huc_copy.h"
 
 #include <i915_drm.h>
 
@@ -942,3 +943,22 @@ igt_media_spinfunc_t igt_get_media_spinfunc(int devid)
 
 	return spin;
 }
+
+/**
+ * igt_get_huc_copyfunc:
+ * @devid: pci device id
+ *
+ * Returns:
+ *
+ * The platform-specific huc copy function pointer for the device specified
+ * with @devid. Will return NULL when no media spin 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))
+		copy = gen9_huc_copyfunc;
+
+	return copy;
+}
diff --git a/lib/intel_batchbuffer.h b/lib/intel_batchbuffer.h
index fd7ef03f..956eca15 100644
--- a/lib/intel_batchbuffer.h
+++ b/lib/intel_batchbuffer.h
@@ -399,4 +399,24 @@ typedef void (*igt_media_spinfunc_t)(struct intel_batchbuffer *batch,
 
 igt_media_spinfunc_t igt_get_media_spinfunc(int devid);
 
+/**
+ * igt_huc_copyfunc_t:
+ * @fd: drm fd
+ * @obj: drm_i915_gem_exec_object2 buffer array
+ *       obj[0] is source buffer
+ *       obj[1] is destination buffer
+ *       obj[2] is execution buffer
+ * @n_bo: the size of @obj array
+ *
+ * This is the type of the per-platform huc copy functions.
+ *
+ * The huc copy function emits a batchbuffer to the VDBOX engine to
+ * invoke the HuC Copy kernel to copy 4K bytes from the source buffer
+ * to the destination buffer.
+ */
+typedef void (*igt_huc_copyfunc_t)(int fd,
+		struct drm_i915_gem_exec_object2 *obj,
+		int n_bo);
+
+igt_huc_copyfunc_t	igt_get_huc_copyfunc(int devid);
 #endif
diff --git a/lib/meson.build b/lib/meson.build
index 57eb7d93..3d720683 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -1,5 +1,6 @@
 lib_sources = [
 	'drmtest.c',
+	'huc_copy.c',
 	'i915/gem_context.c',
 	'i915/gem_engine_topology.c',
 	'i915/gem_scheduler.c',
diff --git a/tests/Makefile.sources b/tests/Makefile.sources
index 806eb02d..d230d6b4 100644
--- a/tests/Makefile.sources
+++ b/tests/Makefile.sources
@@ -313,6 +313,9 @@ gem_media_fill_SOURCES = i915/gem_media_fill.c
 TESTS_progs += gem_media_vme
 gem_media_vme_SOURCES = i915/gem_media_vme.c
 
+TESTS_progs += gem_huc_copy
+gem_huc_copy_SOURCES = i915/gem_huc_copy.c
+
 TESTS_progs += gem_mmap
 gem_mmap_SOURCES = i915/gem_mmap.c
 
diff --git a/tests/i915/gem_huc_copy.c b/tests/i915/gem_huc_copy.c
new file mode 100644
index 00000000..20aeb239
--- /dev/null
+++ b/tests/i915/gem_huc_copy.c
@@ -0,0 +1,138 @@
+/*
+ * Copyright © 2019 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+#include "igt.h"
+#include <stdbool.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <sys/ioctl.h>
+#include <stdio.h>
+#include <string.h>
+#include <fcntl.h>
+#include <inttypes.h>
+#include <errno.h>
+#include <sys/stat.h>
+#include <sys/time.h>
+#include "drm.h"
+#include "igt_sysfs.c"
+
+IGT_TEST_DESCRIPTION("A very simple workload for the HuC.");
+
+#define HUC_COPY_DATA_BUF_SIZE	4096
+
+static void
+compare_huc_copy_result(int drm_fd, uint32_t src_handle, uint32_t dst_handle)
+{
+	char src_output[HUC_COPY_DATA_BUF_SIZE];
+	char dst_output[HUC_COPY_DATA_BUF_SIZE];
+
+	gem_read(drm_fd, src_handle, 0, src_output, HUC_COPY_DATA_BUF_SIZE);
+	gem_read(drm_fd, dst_handle, 0, dst_output, HUC_COPY_DATA_BUF_SIZE);
+
+	for (int i = 0; i < HUC_COPY_DATA_BUF_SIZE; i++)
+		igt_assert_f(src_output[i] == dst_output[i],
+			     "Exepected %c, found %c at %4d.\n",
+			     src_output[i], dst_output[i], i);
+}
+
+static bool
+check_huc_enabled(int fd)
+{
+	int dir;
+	dir = igt_sysfs_open_parameters(fd);
+
+	if (dir < 0)
+		return 0;
+
+	if (igt_sysfs_get_u32(dir, "enable_guc") & 2)
+		return 1;
+	else
+		return 0;
+
+}
+
+static bool
+check_huc_status(int fd)
+{
+	int val = 0;
+	struct drm_i915_getparam pg;
+
+	pg.param = I915_PARAM_HUC_STATUS;
+	pg.value = &val;
+	if (ioctl(fd, DRM_IOCTL_I915_GETPARAM, &pg) == 0)
+		return !!val;
+	else
+		return 0;
+}
+
+igt_main
+{
+	int drm_fd = -1;
+	uint32_t devid;
+	igt_huc_copyfunc_t huc_copy;
+
+	igt_fixture {
+		drm_fd = drm_open_driver(DRIVER_INTEL);
+		igt_require_gem(drm_fd);
+		devid = intel_get_drm_devid(drm_fd);
+		huc_copy = igt_get_huc_copyfunc(devid);
+
+		igt_require_f(huc_copy, "no huc_copy function\n");
+		igt_require_f(check_huc_enabled(drm_fd), "HuC is disabled.\n");
+		igt_assert_f(check_huc_status(drm_fd) == true,
+			"HuC is not successfully loaded!\n");
+	}
+
+	igt_describe("Make sure that Huc firmware works"
+		     "by copying a char array using Huc"
+		     "and verifying the copied result");
+
+	igt_subtest("huc-copy") {
+		char inputs[HUC_COPY_DATA_BUF_SIZE];
+		struct drm_i915_gem_exec_object2 obj[3];
+
+		/* Initialize src buffer randomly */
+		srand(time(NULL));
+		for (int i = 0; i < HUC_COPY_DATA_BUF_SIZE; i++)
+			inputs[i] = (char) (rand() % 256);
+
+		memset(obj, 0, sizeof(obj));
+		/* source buffer object for storing input */
+		obj[0].handle = gem_create(drm_fd, HUC_COPY_DATA_BUF_SIZE);
+		/* destination buffer object to receive input */
+		obj[1].handle = gem_create(drm_fd, HUC_COPY_DATA_BUF_SIZE);
+		/* execution buffer object */
+		obj[2].handle = gem_create(drm_fd, 4096);
+
+		gem_write(drm_fd, obj[0].handle, 0, inputs, HUC_COPY_DATA_BUF_SIZE);
+
+		huc_copy(drm_fd, obj, 3);
+		compare_huc_copy_result(drm_fd, obj[0].handle, obj[1].handle);
+
+		gem_close(drm_fd, obj[0].handle);
+		gem_close(drm_fd, obj[1].handle);
+		gem_close(drm_fd, obj[2].handle);
+	}
+
+	igt_fixture
+		close(drm_fd);
+}
diff --git a/tests/intel-ci/fast-feedback.testlist b/tests/intel-ci/fast-feedback.testlist
index 71dc99a6..49004c88 100644
--- a/tests/intel-ci/fast-feedback.testlist
+++ b/tests/intel-ci/fast-feedback.testlist
@@ -34,6 +34,7 @@ igt@gem_flink_basic@bad-open
 igt@gem_flink_basic@basic
 igt@gem_flink_basic@double-flink
 igt@gem_flink_basic@flink-lifetime
+igt@gem_huc_copy@huc_copy
 igt@gem_linear_blits@basic
 igt@gem_mmap@basic
 igt@gem_mmap@basic-small-bo
diff --git a/tests/meson.build b/tests/meson.build
index 570de545..0545b612 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -165,6 +165,7 @@ i915_progs = [
 	'gem_gtt_cpu_tlb',
 	'gem_gtt_hog',
 	'gem_gtt_speed',
+	'gem_huc_copy',
 	'gem_largeobject',
 	'gem_linear_blits',
 	'gem_lut_handle',
-- 
2.21.0.5.gaeb582a983

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

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

* Re: [igt-dev] [PATCH i-g-t v4] tests/i915/gem_huc_copy: Enable a HuC copy test
  2020-01-10 17:41     ` [igt-dev] [PATCH i-g-t v4] " Robert M. Fosha
@ 2020-01-10 18:28       ` Chris Wilson
  2020-01-10 19:51         ` Ye, Tony
  2020-04-14 21:24       ` [igt-dev] [PATCH i-g-t v5] " Robert M. Fosha
  1 sibling, 1 reply; 25+ messages in thread
From: Chris Wilson @ 2020-01-10 18:28 UTC (permalink / raw)
  To: Robert M. Fosha, igt-dev; +Cc: Sally Qi

Quoting Robert M. Fosha (2020-01-10 17:41:46)
> +static bool
> +check_huc_enabled(int fd)
> +{
> +       int dir;
> +       dir = igt_sysfs_open_parameters(fd);
> +
> +       if (dir < 0)
> +               return 0;
> +
> +       if (igt_sysfs_get_u32(dir, "enable_guc") & 2)
> +               return 1;
> +       else
> +               return 0;

No. If you have this in your userspace, please immediately remove it,
and backport that to any and all stable branches and releases.
-Chris
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [igt-dev] ✓ Fi.CI.BAT: success for tests/i915/gem_huc_copy: Enable a HuC copy test (rev4)
  2019-12-19 23:50 [igt-dev] [PATCH i-g-t] tests/i915/gem_huc_copy: Enable a HuC copy test Robert M. Fosha
                   ` (7 preceding siblings ...)
  2019-12-23 23:28 ` [igt-dev] ✗ Fi.CI.BAT: failure for tests/i915/gem_huc_copy: Enable a HuC copy test (rev3) Patchwork
@ 2020-01-10 19:14 ` Patchwork
  2020-01-14 10:10 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 25+ messages in thread
From: Patchwork @ 2020-01-10 19:14 UTC (permalink / raw)
  To: Robert M. Fosha; +Cc: igt-dev

== Series Details ==

Series: tests/i915/gem_huc_copy: Enable a HuC copy test (rev4)
URL   : https://patchwork.freedesktop.org/series/71194/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_7719 -> IGTPW_3915
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

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

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

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

### IGT changes ###

#### Possible regressions ####

  * {igt@gem_huc_copy@huc_copy} (NEW):
    - fi-cml-u2:          NOTRUN -> [SKIP][1]
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3915/fi-cml-u2/igt@gem_huc_copy@huc_copy.html
    - fi-icl-guc:         NOTRUN -> [SKIP][2]
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3915/fi-icl-guc/igt@gem_huc_copy@huc_copy.html
    - fi-icl-dsi:         NOTRUN -> [SKIP][3]
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3915/fi-icl-dsi/igt@gem_huc_copy@huc_copy.html
    - fi-icl-y:           NOTRUN -> [SKIP][4]
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3915/fi-icl-y/igt@gem_huc_copy@huc_copy.html
    - fi-icl-u3:          NOTRUN -> [SKIP][5]
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3915/fi-icl-u3/igt@gem_huc_copy@huc_copy.html
    - {fi-tgl-u}:         NOTRUN -> [SKIP][6]
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3915/fi-tgl-u/igt@gem_huc_copy@huc_copy.html
    - fi-icl-u2:          NOTRUN -> [SKIP][7]
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3915/fi-icl-u2/igt@gem_huc_copy@huc_copy.html

  
New tests
---------

  New tests have been introduced between CI_DRM_7719 and IGTPW_3915:

### New IGT tests (1) ###

  * igt@gem_huc_copy@huc_copy:
    - Statuses : 42 skip(s)
    - Exec time: [0.0] s

  

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

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

### IGT changes ###

#### Issues hit ####

  * igt@i915_module_load@reload-with-fault-injection:
    - fi-skl-6700k2:      [PASS][8] -> [INCOMPLETE][9] ([i915#671])
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7719/fi-skl-6700k2/igt@i915_module_load@reload-with-fault-injection.html
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3915/fi-skl-6700k2/igt@i915_module_load@reload-with-fault-injection.html
    - fi-bxt-dsi:         [PASS][10] -> [INCOMPLETE][11] ([fdo#103927])
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7719/fi-bxt-dsi/igt@i915_module_load@reload-with-fault-injection.html
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3915/fi-bxt-dsi/igt@i915_module_load@reload-with-fault-injection.html

  * igt@i915_selftest@live_blt:
    - fi-ivb-3770:        [PASS][12] -> [DMESG-FAIL][13] ([i915#725])
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7719/fi-ivb-3770/igt@i915_selftest@live_blt.html
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3915/fi-ivb-3770/igt@i915_selftest@live_blt.html
    - fi-bsw-nick:        [PASS][14] -> [DMESG-FAIL][15] ([i915#723])
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7719/fi-bsw-nick/igt@i915_selftest@live_blt.html
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3915/fi-bsw-nick/igt@i915_selftest@live_blt.html

  
#### Possible fixes ####

  * igt@gem_close_race@basic-threads:
    - fi-byt-j1900:       [TIMEOUT][16] ([i915#816]) -> [PASS][17]
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7719/fi-byt-j1900/igt@gem_close_race@basic-threads.html
   [17]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3915/fi-byt-j1900/igt@gem_close_race@basic-threads.html
    - fi-byt-n2820:       [TIMEOUT][18] ([i915#816]) -> [PASS][19]
   [18]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7719/fi-byt-n2820/igt@gem_close_race@basic-threads.html
   [19]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3915/fi-byt-n2820/igt@gem_close_race@basic-threads.html

  * igt@i915_pm_rpm@module-reload:
    - fi-skl-6770hq:      [FAIL][20] ([i915#178]) -> [PASS][21]
   [20]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7719/fi-skl-6770hq/igt@i915_pm_rpm@module-reload.html
   [21]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3915/fi-skl-6770hq/igt@i915_pm_rpm@module-reload.html

  * igt@i915_selftest@live_blt:
    - fi-hsw-4770:        [DMESG-FAIL][22] ([i915#770]) -> [PASS][23]
   [22]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7719/fi-hsw-4770/igt@i915_selftest@live_blt.html
   [23]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3915/fi-hsw-4770/igt@i915_selftest@live_blt.html

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

  [fdo#103927]: https://bugs.freedesktop.org/show_bug.cgi?id=103927
  [i915#178]: https://gitlab.freedesktop.org/drm/intel/issues/178
  [i915#671]: https://gitlab.freedesktop.org/drm/intel/issues/671
  [i915#723]: https://gitlab.freedesktop.org/drm/intel/issues/723
  [i915#725]: https://gitlab.freedesktop.org/drm/intel/issues/725
  [i915#770]: https://gitlab.freedesktop.org/drm/intel/issues/770
  [i915#816]: https://gitlab.freedesktop.org/drm/intel/issues/816


Participating hosts (50 -> 45)
------------------------------

  Additional (1): fi-hsw-4770r 
  Missing    (6): fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-ctg-p8600 fi-tgl-y fi-byt-clapper 


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

  * CI: CI-20190529 -> None
  * IGT: IGT_5363 -> IGTPW_3915

  CI-20190529: 20190529
  CI_DRM_7719: 8be213204694b671bd894aced16be510d84d16d4 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_3915: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3915/index.html
  IGT_5363: 2d453ec48fbda1f4f7ddaf69060be3992f28f680 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools



== Testlist changes ==

+igt@gem_huc_copy@huc-copy

== Logs ==

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

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

* Re: [igt-dev] [PATCH i-g-t v4] tests/i915/gem_huc_copy: Enable a HuC copy test
  2020-01-10 18:28       ` Chris Wilson
@ 2020-01-10 19:51         ` Ye, Tony
  2020-01-10 19:54           ` Chris Wilson
  0 siblings, 1 reply; 25+ messages in thread
From: Ye, Tony @ 2020-01-10 19:51 UTC (permalink / raw)
  To: Chris Wilson, Robert M. Fosha, igt-dev; +Cc: Sally Qi



On 1/10/2020 10:28 AM, Chris Wilson wrote:
> Quoting Robert M. Fosha (2020-01-10 17:41:46)
>> +static bool
>> +check_huc_enabled(int fd)
>> +{
>> +       int dir;
>> +       dir = igt_sysfs_open_parameters(fd);
>> +
>> +       if (dir < 0)
>> +               return 0;
>> +
>> +       if (igt_sysfs_get_u32(dir, "enable_guc") & 2)
>> +               return 1;
>> +       else
>> +               return 0;
> 
> No. If you have this in your userspace, please immediately remove it,
> and backport that to any and all stable branches and releases.
> -Chris

The code is to skip the test when HuC is disabled by the enable_guc 
module parameter. If HuC is disabled by the enable_guc param, then skip 
the test. If the HuC failed to load due to a real error, then fail the 
test.

Could you suggest how to handle HUC_STATUS failure properly without this 
code?

Regards,
Tony

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

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

* Re: [igt-dev] [PATCH i-g-t v4] tests/i915/gem_huc_copy: Enable a HuC copy test
  2020-01-10 19:51         ` Ye, Tony
@ 2020-01-10 19:54           ` Chris Wilson
  2020-01-11  1:05             ` Ye, Tony
  0 siblings, 1 reply; 25+ messages in thread
From: Chris Wilson @ 2020-01-10 19:54 UTC (permalink / raw)
  To: Robert M. Fosha, Ye, Tony, igt-dev; +Cc: Sally Qi

Quoting Ye, Tony (2020-01-10 19:51:58)
> 
> 
> On 1/10/2020 10:28 AM, Chris Wilson wrote:
> > Quoting Robert M. Fosha (2020-01-10 17:41:46)
> >> +static bool
> >> +check_huc_enabled(int fd)
> >> +{
> >> +       int dir;
> >> +       dir = igt_sysfs_open_parameters(fd);
> >> +
> >> +       if (dir < 0)
> >> +               return 0;
> >> +
> >> +       if (igt_sysfs_get_u32(dir, "enable_guc") & 2)
> >> +               return 1;
> >> +       else
> >> +               return 0;
> > 
> > No. If you have this in your userspace, please immediately remove it,
> > and backport that to any and all stable branches and releases.
> > -Chris
> 
> The code is to skip the test when HuC is disabled by the enable_guc 
> module parameter. If HuC is disabled by the enable_guc param, then skip 
> the test. If the HuC failed to load due to a real error, then fail the 
> test.
> 
> Could you suggest how to handle HUC_STATUS failure properly without this 
> code?

Look at the error code from querying HUC_STATUS.
-Chris
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* Re: [igt-dev] [PATCH i-g-t v4] tests/i915/gem_huc_copy: Enable a HuC copy test
  2020-01-10 19:54           ` Chris Wilson
@ 2020-01-11  1:05             ` Ye, Tony
  2020-01-16 23:56               ` Ye, Tony
  0 siblings, 1 reply; 25+ messages in thread
From: Ye, Tony @ 2020-01-11  1:05 UTC (permalink / raw)
  To: Chris Wilson, Robert M. Fosha, igt-dev; +Cc: Sally Qi



On 1/10/2020 11:54 AM, Chris Wilson wrote:
> Quoting Ye, Tony (2020-01-10 19:51:58)
>>
>>
>> On 1/10/2020 10:28 AM, Chris Wilson wrote:
>>> Quoting Robert M. Fosha (2020-01-10 17:41:46)
>>>> +static bool
>>>> +check_huc_enabled(int fd)
>>>> +{
>>>> +       int dir;
>>>> +       dir = igt_sysfs_open_parameters(fd);
>>>> +
>>>> +       if (dir < 0)
>>>> +               return 0;
>>>> +
>>>> +       if (igt_sysfs_get_u32(dir, "enable_guc") & 2)
>>>> +               return 1;
>>>> +       else
>>>> +               return 0;
>>>
>>> No. If you have this in your userspace, please immediately remove it,
>>> and backport that to any and all stable branches and releases.
>>> -Chris
>>
>> The code is to skip the test when HuC is disabled by the enable_guc
>> module parameter. If HuC is disabled by the enable_guc param, then skip
>> the test. If the HuC failed to load due to a real error, then fail the
>> test.
>>
>> Could you suggest how to handle HUC_STATUS failure properly without this
>> code?
> 
> Look at the error code from querying HUC_STATUS.
> -Chris

Agree that the check should be done via uAPI instead of the sysfs. 
Thanks for the feedback.
Tony
> 
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [igt-dev] ✓ Fi.CI.IGT: success for tests/i915/gem_huc_copy: Enable a HuC copy test (rev4)
  2019-12-19 23:50 [igt-dev] [PATCH i-g-t] tests/i915/gem_huc_copy: Enable a HuC copy test Robert M. Fosha
                   ` (8 preceding siblings ...)
  2020-01-10 19:14 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/i915/gem_huc_copy: Enable a HuC copy test (rev4) Patchwork
@ 2020-01-14 10:10 ` Patchwork
  2020-04-14 22:07 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/i915/gem_huc_copy: Enable a HuC copy test (rev5) Patchwork
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 25+ messages in thread
From: Patchwork @ 2020-01-14 10:10 UTC (permalink / raw)
  To: Robert M. Fosha; +Cc: igt-dev

== Series Details ==

Series: tests/i915/gem_huc_copy: Enable a HuC copy test (rev4)
URL   : https://patchwork.freedesktop.org/series/71194/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_7719_full -> IGTPW_3915_full
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

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

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

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

### IGT changes ###

#### Possible regressions ####

  * {igt@gem_huc_copy@huc-copy} (NEW):
    - shard-iclb:         NOTRUN -> [SKIP][1]
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3915/shard-iclb8/igt@gem_huc_copy@huc-copy.html

  
New tests
---------

  New tests have been introduced between CI_DRM_7719_full and IGTPW_3915_full:

### New IGT tests (1) ###

  * igt@gem_huc_copy@huc-copy:
    - Statuses : 1 pass(s) 5 skip(s)
    - Exec time: [0.0, 0.00] s

  

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

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

### IGT changes ###

#### Issues hit ####

  * igt@gem_busy@busy-vcs1:
    - shard-iclb:         [PASS][2] -> [SKIP][3] ([fdo#112080]) +11 similar issues
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7719/shard-iclb1/igt@gem_busy@busy-vcs1.html
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3915/shard-iclb3/igt@gem_busy@busy-vcs1.html

  * igt@gem_ctx_isolation@vcs1-none:
    - shard-iclb:         [PASS][4] -> [SKIP][5] ([fdo#109276] / [fdo#112080]) +1 similar issue
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7719/shard-iclb2/igt@gem_ctx_isolation@vcs1-none.html
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3915/shard-iclb8/igt@gem_ctx_isolation@vcs1-none.html

  * igt@gem_ctx_shared@q-smoketest-all:
    - shard-tglb:         [PASS][6] -> [INCOMPLETE][7] ([fdo#111735])
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7719/shard-tglb5/igt@gem_ctx_shared@q-smoketest-all.html
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3915/shard-tglb3/igt@gem_ctx_shared@q-smoketest-all.html

  * igt@gem_eio@kms:
    - shard-tglb:         [PASS][8] -> [INCOMPLETE][9] ([i915#476])
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7719/shard-tglb4/igt@gem_eio@kms.html
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3915/shard-tglb3/igt@gem_eio@kms.html

  * igt@gem_exec_async@concurrent-writes-bsd:
    - shard-iclb:         [PASS][10] -> [SKIP][11] ([fdo#112146]) +10 similar issues
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7719/shard-iclb8/igt@gem_exec_async@concurrent-writes-bsd.html
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3915/shard-iclb4/igt@gem_exec_async@concurrent-writes-bsd.html

  * igt@gem_exec_await@wide-all:
    - shard-tglb:         [PASS][12] -> [INCOMPLETE][13] ([fdo#111736] / [i915#472]) +1 similar issue
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7719/shard-tglb4/igt@gem_exec_await@wide-all.html
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3915/shard-tglb6/igt@gem_exec_await@wide-all.html

  * igt@gem_exec_balancer@smoke:
    - shard-iclb:         [PASS][14] -> [SKIP][15] ([fdo#110854])
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7719/shard-iclb2/igt@gem_exec_balancer@smoke.html
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3915/shard-iclb3/igt@gem_exec_balancer@smoke.html

  * igt@gem_exec_nop@basic-series:
    - shard-tglb:         [PASS][16] -> [INCOMPLETE][17] ([i915#472])
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7719/shard-tglb2/igt@gem_exec_nop@basic-series.html
   [17]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3915/shard-tglb4/igt@gem_exec_nop@basic-series.html

  * igt@gem_exec_parallel@contexts:
    - shard-tglb:         [PASS][18] -> [INCOMPLETE][19] ([i915#470] / [i915#472]) +1 similar issue
   [18]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7719/shard-tglb2/igt@gem_exec_parallel@contexts.html
   [19]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3915/shard-tglb3/igt@gem_exec_parallel@contexts.html

  * igt@gem_exec_schedule@pi-common-bsd:
    - shard-iclb:         [PASS][20] -> [SKIP][21] ([i915#677])
   [20]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7719/shard-iclb6/igt@gem_exec_schedule@pi-common-bsd.html
   [21]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3915/shard-iclb4/igt@gem_exec_schedule@pi-common-bsd.html

  * igt@gem_ppgtt@flink-and-close-vma-leak:
    - shard-glk:          [PASS][22] -> [FAIL][23] ([i915#644])
   [22]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7719/shard-glk5/igt@gem_ppgtt@flink-and-close-vma-leak.html
   [23]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3915/shard-glk2/igt@gem_ppgtt@flink-and-close-vma-leak.html

  * igt@i915_pm_dc@dc6-psr:
    - shard-iclb:         [PASS][24] -> [FAIL][25] ([i915#454])
   [24]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7719/shard-iclb3/igt@i915_pm_dc@dc6-psr.html
   [25]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3915/shard-iclb2/igt@i915_pm_dc@dc6-psr.html

  * igt@kms_cursor_crc@pipe-a-cursor-suspend:
    - shard-kbl:          [PASS][26] -> [DMESG-WARN][27] ([i915#180]) +4 similar issues
   [26]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7719/shard-kbl4/igt@kms_cursor_crc@pipe-a-cursor-suspend.html
   [27]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3915/shard-kbl6/igt@kms_cursor_crc@pipe-a-cursor-suspend.html

  * igt@kms_flip@flip-vs-expired-vblank:
    - shard-glk:          [PASS][28] -> [FAIL][29] ([i915#79])
   [28]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7719/shard-glk6/igt@kms_flip@flip-vs-expired-vblank.html
   [29]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3915/shard-glk3/igt@kms_flip@flip-vs-expired-vblank.html

  * igt@kms_frontbuffer_tracking@fbc-2p-scndscrn-pri-shrfb-draw-pwrite:
    - shard-glk:          [PASS][30] -> [FAIL][31] ([i915#49])
   [30]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7719/shard-glk6/igt@kms_frontbuffer_tracking@fbc-2p-scndscrn-pri-shrfb-draw-pwrite.html
   [31]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3915/shard-glk9/igt@kms_frontbuffer_tracking@fbc-2p-scndscrn-pri-shrfb-draw-pwrite.html

  * igt@kms_frontbuffer_tracking@fbc-suspend:
    - shard-apl:          [PASS][32] -> [DMESG-WARN][33] ([i915#180]) +3 similar issues
   [32]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7719/shard-apl4/igt@kms_frontbuffer_tracking@fbc-suspend.html
   [33]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3915/shard-apl4/igt@kms_frontbuffer_tracking@fbc-suspend.html

  * igt@kms_frontbuffer_tracking@fbcpsr-rgb565-draw-pwrite:
    - shard-tglb:         [PASS][34] -> [FAIL][35] ([i915#49]) +3 similar issues
   [34]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7719/shard-tglb7/igt@kms_frontbuffer_tracking@fbcpsr-rgb565-draw-pwrite.html
   [35]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3915/shard-tglb2/igt@kms_frontbuffer_tracking@fbcpsr-rgb565-draw-pwrite.html

  * igt@kms_psr@psr2_cursor_mmap_cpu:
    - shard-iclb:         [PASS][36] -> [SKIP][37] ([fdo#109441]) +1 similar issue
   [36]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7719/shard-iclb2/igt@kms_psr@psr2_cursor_mmap_cpu.html
   [37]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3915/shard-iclb5/igt@kms_psr@psr2_cursor_mmap_cpu.html

  * igt@prime_busy@hang-bsd2:
    - shard-iclb:         [PASS][38] -> [SKIP][39] ([fdo#109276]) +20 similar issues
   [38]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7719/shard-iclb1/igt@prime_busy@hang-bsd2.html
   [39]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3915/shard-iclb3/igt@prime_busy@hang-bsd2.html

  
#### Possible fixes ####

  * igt@gem_ctx_persistence@vcs1-queued:
    - shard-iclb:         [SKIP][40] ([fdo#109276] / [fdo#112080]) -> [PASS][41]
   [40]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7719/shard-iclb5/igt@gem_ctx_persistence@vcs1-queued.html
   [41]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3915/shard-iclb2/igt@gem_ctx_persistence@vcs1-queued.html

  * igt@gem_ctx_shared@exec-single-timeline-bsd:
    - shard-iclb:         [SKIP][42] ([fdo#110841]) -> [PASS][43]
   [42]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7719/shard-iclb1/igt@gem_ctx_shared@exec-single-timeline-bsd.html
   [43]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3915/shard-iclb6/igt@gem_ctx_shared@exec-single-timeline-bsd.html

  * igt@gem_exec_create@forked:
    - shard-glk:          [TIMEOUT][44] ([fdo#112271] / [i915#940]) -> [PASS][45]
   [44]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7719/shard-glk9/igt@gem_exec_create@forked.html
   [45]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3915/shard-glk2/igt@gem_exec_create@forked.html

  * igt@gem_exec_create@madvise:
    - shard-tglb:         [INCOMPLETE][46] ([i915#472]) -> [PASS][47]
   [46]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7719/shard-tglb7/igt@gem_exec_create@madvise.html
   [47]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3915/shard-tglb7/igt@gem_exec_create@madvise.html

  * igt@gem_exec_schedule@preempt-other-chain-bsd:
    - shard-iclb:         [SKIP][48] ([fdo#112146]) -> [PASS][49] +4 similar issues
   [48]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7719/shard-iclb4/igt@gem_exec_schedule@preempt-other-chain-bsd.html
   [49]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3915/shard-iclb6/igt@gem_exec_schedule@preempt-other-chain-bsd.html

  * igt@gen9_exec_parse@allowed-all:
    - shard-glk:          [DMESG-WARN][50] ([i915#716]) -> [PASS][51]
   [50]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7719/shard-glk2/igt@gen9_exec_parse@allowed-all.html
   [51]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3915/shard-glk8/igt@gen9_exec_parse@allowed-all.html

  * igt@i915_pm_rps@reset:
    - shard-iclb:         [FAIL][52] ([i915#413]) -> [PASS][53] +1 similar issue
   [52]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7719/shard-iclb7/igt@i915_pm_rps@reset.html
   [53]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3915/shard-iclb8/igt@i915_pm_rps@reset.html

  * igt@kms_atomic_transition@plane-use-after-nonblocking-unbind-fencing:
    - shard-snb:          [SKIP][54] ([fdo#109271]) -> [PASS][55] +2 similar issues
   [54]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7719/shard-snb1/igt@kms_atomic_transition@plane-use-after-nonblocking-unbind-fencing.html
   [55]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3915/shard-snb5/igt@kms_atomic_transition@plane-use-after-nonblocking-unbind-fencing.html

  * igt@kms_ccs@pipe-b-crc-primary-rotation-180:
    - shard-tglb:         [FAIL][56] -> [PASS][57]
   [56]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7719/shard-tglb7/igt@kms_ccs@pipe-b-crc-primary-rotation-180.html
   [57]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3915/shard-tglb7/igt@kms_ccs@pipe-b-crc-primary-rotation-180.html

  * igt@kms_cursor_crc@pipe-b-cursor-suspend:
    - shard-apl:          [DMESG-WARN][58] ([i915#180]) -> [PASS][59] +1 similar issue
   [58]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7719/shard-apl1/igt@kms_cursor_crc@pipe-b-cursor-suspend.html
   [59]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3915/shard-apl7/igt@kms_cursor_crc@pipe-b-cursor-suspend.html

  * igt@kms_cursor_crc@pipe-c-cursor-suspend:
    - shard-kbl:          [DMESG-WARN][60] ([i915#180]) -> [PASS][61] +1 similar issue
   [60]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7719/shard-kbl6/igt@kms_cursor_crc@pipe-c-cursor-suspend.html
   [61]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3915/shard-kbl2/igt@kms_cursor_crc@pipe-c-cursor-suspend.html

  * igt@kms_frontbuffer_tracking@fbc-1p-primscrn-cur-indfb-draw-blt:
    - shard-tglb:         [FAIL][62] ([i915#49]) -> [PASS][63]
   [62]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7719/shard-tglb7/igt@kms_frontbuffer_tracking@fbc-1p-primscrn-cur-indfb-draw-blt.html
   [63]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3915/shard-tglb8/igt@kms_frontbuffer_tracking@fbc-1p-primscrn-cur-indfb-draw-blt.html

  * igt@kms_psr2_su@frontbuffer:
    - shard-iclb:         [SKIP][64] ([fdo#109642] / [fdo#111068]) -> [PASS][65] +1 similar issue
   [64]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7719/shard-iclb7/igt@kms_psr2_su@frontbuffer.html
   [65]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3915/shard-iclb2/igt@kms_psr2_su@frontbuffer.html

  * igt@kms_psr@psr2_suspend:
    - shard-iclb:         [SKIP][66] ([fdo#109441]) -> [PASS][67] +1 similar issue
   [66]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7719/shard-iclb1/igt@kms_psr@psr2_suspend.html
   [67]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3915/shard-iclb2/igt@kms_psr@psr2_suspend.html

  * igt@perf@oa-exponents:
    - shard-tglb:         [INCOMPLETE][68] ([i915#472] / [i915#807]) -> [PASS][69]
   [68]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7719/shard-tglb4/igt@perf@oa-exponents.html
   [69]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3915/shard-tglb5/igt@perf@oa-exponents.html

  * igt@perf_pmu@busy-no-semaphores-vcs1:
    - shard-iclb:         [SKIP][70] ([fdo#112080]) -> [PASS][71] +10 similar issues
   [70]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7719/shard-iclb7/igt@perf_pmu@busy-no-semaphores-vcs1.html
   [71]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3915/shard-iclb4/igt@perf_pmu@busy-no-semaphores-vcs1.html

  * igt@prime_vgem@fence-wait-bsd2:
    - shard-iclb:         [SKIP][72] ([fdo#109276]) -> [PASS][73] +20 similar issues
   [72]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7719/shard-iclb7/igt@prime_vgem@fence-wait-bsd2.html
   [73]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3915/shard-iclb4/igt@prime_vgem@fence-wait-bsd2.html

  
#### Warnings ####

  * igt@gem_ctx_isolation@vcs1-nonpriv:
    - shard-iclb:         [FAIL][74] ([IGT#28]) -> [SKIP][75] ([fdo#109276] / [fdo#112080])
   [74]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7719/shard-iclb1/igt@gem_ctx_isolation@vcs1-nonpriv.html
   [75]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3915/shard-iclb8/igt@gem_ctx_isolation@vcs1-nonpriv.html

  * igt@gem_eio@kms:
    - shard-snb:          [DMESG-WARN][76] ([i915#444]) -> [INCOMPLETE][77] ([i915#82])
   [76]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7719/shard-snb1/igt@gem_eio@kms.html
   [77]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3915/shard-snb4/igt@gem_eio@kms.html

  * igt@gem_persistent_relocs@forked-faulting-reloc-thrashing:
    - shard-iclb:         [TIMEOUT][78] ([fdo#112271] / [i915#530]) -> [INCOMPLETE][79] ([i915#140] / [i915#530])
   [78]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7719/shard-iclb8/igt@gem_persistent_relocs@forked-faulting-reloc-thrashing.html
   [79]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3915/shard-iclb6/igt@gem_persistent_relocs@forked-faulting-reloc-thrashing.html

  * igt@gem_tiled_blits@normal:
    - shard-hsw:          [FAIL][80] ([i915#818]) -> [FAIL][81] ([i915#694])
   [80]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7719/shard-hsw5/igt@gem_tiled_blits@normal.html
   [81]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3915/shard-hsw7/igt@gem_tiled_blits@normal.html

  * igt@gem_userptr_blits@dmabuf-sync:
    - shard-snb:          [DMESG-WARN][82] ([fdo#110789] / [fdo#111870]) -> [DMESG-WARN][83] ([fdo#111870])
   [82]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7719/shard-snb4/igt@gem_userptr_blits@dmabuf-sync.html
   [83]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3915/shard-snb2/igt@gem_userptr_blits@dmabuf-sync.html

  * igt@gem_userptr_blits@sync-unmap-after-close:
    - shard-snb:          [DMESG-WARN][84] ([fdo#111870]) -> [DMESG-WARN][85] ([fdo#110789] / [fdo#111870])
   [84]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7719/shard-snb6/igt@gem_userptr_blits@sync-unmap-after-close.html
   [85]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3915/shard-snb1/igt@gem_userptr_blits@sync-unmap-after-close.html

  * igt@i915_pm_dc@dc6-psr:
    - shard-tglb:         [SKIP][86] ([i915#468]) -> [FAIL][87] ([i915#454])
   [86]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7719/shard-tglb1/igt@i915_pm_dc@dc6-psr.html
   [87]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3915/shard-tglb5/igt@i915_pm_dc@dc6-psr.html

  * igt@i915_pm_rpm@modeset-pc8-residency-stress:
    - shard-snb:          [INCOMPLETE][88] ([i915#82]) -> [SKIP][89] ([fdo#109271])
   [88]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7719/shard-snb2/igt@i915_pm_rpm@modeset-pc8-residency-stress.html
   [89]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3915/shard-snb5/igt@i915_pm_rpm@modeset-pc8-residency-stress.html

  * igt@kms_atomic_transition@6x-modeset-transitions-fencing:
    - shard-tglb:         [SKIP][90] ([fdo#112016] / [fdo#112021]) -> [SKIP][91] ([fdo#112021])
   [90]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7719/shard-tglb3/igt@kms_atomic_transition@6x-modeset-transitions-fencing.html
   [91]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3915/shard-tglb9/igt@kms_atomic_transition@6x-modeset-transitions-fencing.html

  * igt@runner@aborted:
    - shard-glk:          ([FAIL][92], [FAIL][93], [FAIL][94]) ([i915#940] / [k.org#202321]) -> [FAIL][95] ([k.org#202321])
   [92]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7719/shard-glk4/igt@runner@aborted.html
   [93]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7719/shard-glk2/igt@runner@aborted.html
   [94]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7719/shard-glk9/igt@runner@aborted.html
   [95]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3915/shard-glk5/igt@runner@aborted.html

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

  [IGT#28]: https://gitlab.freedesktop.org/drm/igt-gpu-tools/issues/28
  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [fdo#109276]: https://bugs.freedesktop.org/show_bug.cgi?id=109276
  [fdo#109441]: https://bugs.freedesktop.org/show_bug.cgi?id=109441
  [fdo#109642]: https://bugs.freedesktop.org/show_bug.cgi?id=109642
  [fdo#110789]: https://bugs.freedesktop.org/show_bug.cgi?id=110789
  [fdo#110841]: https://bugs.freedesktop.org/show_bug.cgi?id=110841
  [fdo#110854]: https://bugs.freedesktop.org/show_bug.cgi?id=110854
  [fdo#111068]: https://bugs.freedesktop.org/show_bug.cgi?id=111068
  [fdo#111735]: https://bugs.freedesktop.org/show_bug.cgi?id=111735
  [fdo#111736]: https://bugs.freedesktop.org/show_bug.cgi?id=111736
  [fdo#111870]: https://bugs.freedesktop.org/show_bug.cgi?id=111870
  [fdo#112016]: https://bugs.freedesktop.org/show_bug.cgi?id=112016
  [fdo#112021]: https://bugs.freedesktop.org/show_bug.cgi?id=112021
  [fdo#112080]: https://bugs.freedesktop.org/show_bug.cgi?id=112080
  [fdo#112146]: https://bugs.freedesktop.org/show_bug.cgi?id=112146
  [fdo#112271]: https://bugs.freedesktop.org/show_bug.cgi?id=112271
  [i915#140]: https://gitlab.freedesktop.org/drm/intel/issues/140
  [i915#180]: https://gitlab.freedesktop.org/drm/intel/issues/180
  [i915#413]: https://gitlab.freedesktop.org/drm/intel/issues/413
  [i915#444]: https://gitlab.freedesktop.org/drm/intel/issues/444
  [i915#454]: https://gitlab.freedesktop.org/drm/intel/issues/454
  [i915#468]: https://gitlab.freedesktop.org/drm/intel/issues/468
  [i915#470]: https://gitlab.freedesktop.org/drm/intel/issues/470
  [i915#472]: https://gitlab.freedesktop.org/drm/intel/issues/472
  [i915#476]: https://gitlab.freedesktop.org/drm/intel/issues/476
  [i915#49]: https://gitlab.freedesktop.org/drm/intel/issues/49
  [i915#530]: https://gitlab.freedesktop.org/drm/intel/issues/530
  [i915#644]: https://gitlab.freedesktop.org/drm/intel/issues/644
  [i915#677]: https://gitlab.freedesktop.org/drm/intel/issues/677
  [i915#694]: https://gitlab.freedesktop.org/drm/intel/issues/694
  [i915#716]: https://gitlab.freedesktop.org/drm/intel/issues/716
  [i915#79]: https://gitlab.freedesktop.org/drm/intel/issues/79
  [i915#807]: https://gitlab.freedesktop.org/drm/intel/issues/807
  [i915#818]: https://gitlab.freedesktop.org/drm/intel/issues/818
  [i915#82]: https://gitlab.freedesktop.org/drm/intel/issues/82
  [i915#940]: https://gitlab.freedesktop.org/drm/intel/issues/940
  [k.org#202321]: https://bugzilla.kernel.org/show_bug.cgi?id=202321


Participating hosts (11 -> 8)
------------------------------

  Missing    (3): pig-skl-6260u pig-glk-j5005 pig-hsw-4770r 


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

  * CI: CI-20190529 -> None
  * IGT: IGT_5363 -> IGTPW_3915
  * Piglit: piglit_4509 -> None

  CI-20190529: 20190529
  CI_DRM_7719: 8be213204694b671bd894aced16be510d84d16d4 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_3915: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3915/index.html
  IGT_5363: 2d453ec48fbda1f4f7ddaf69060be3992f28f680 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit

== Logs ==

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

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

* Re: [igt-dev] [PATCH i-g-t v4] tests/i915/gem_huc_copy: Enable a HuC copy test
  2020-01-11  1:05             ` Ye, Tony
@ 2020-01-16 23:56               ` Ye, Tony
  2020-01-16 23:59                 ` Ye, Tony
  0 siblings, 1 reply; 25+ messages in thread
From: Ye, Tony @ 2020-01-16 23:56 UTC (permalink / raw)
  To: Chris Wilson, Robert M. Fosha, igt-dev; +Cc: Sally Qi

There are two issues with the HUC_STATUS query ioctl.

1. on a platform with huc supported, i915.enable_guc=0, got unexpected 
return value:
ret=0, param.value=0, errno=ENODEV

2. the return value doesn't differentiate these two conditions:
a. i915.enable_guc=0/1, huc is disabled, skip the huc_copy test;
b. i915.enable_guc=2/3, huc load/authentication failed, fail huc_copy.
A patch like this is required:
https://patchwork.freedesktop.org/patch/306419/?series=61001&rev=1

Regards,
Tony
On 1/10/2020 5:05 PM, Ye, Tony wrote:
> 
> 
> On 1/10/2020 11:54 AM, Chris Wilson wrote:
>> Quoting Ye, Tony (2020-01-10 19:51:58)
>>>
>>>
>>> On 1/10/2020 10:28 AM, Chris Wilson wrote:
>>>> Quoting Robert M. Fosha (2020-01-10 17:41:46)
>>>>> +static bool
>>>>> +check_huc_enabled(int fd)
>>>>> +{
>>>>> +       int dir;
>>>>> +       dir = igt_sysfs_open_parameters(fd);
>>>>> +
>>>>> +       if (dir < 0)
>>>>> +               return 0;
>>>>> +
>>>>> +       if (igt_sysfs_get_u32(dir, "enable_guc") & 2)
>>>>> +               return 1;
>>>>> +       else
>>>>> +               return 0;
>>>>
>>>> No. If you have this in your userspace, please immediately remove it,
>>>> and backport that to any and all stable branches and releases.
>>>> -Chris
>>>
>>> The code is to skip the test when HuC is disabled by the enable_guc
>>> module parameter. If HuC is disabled by the enable_guc param, then skip
>>> the test. If the HuC failed to load due to a real error, then fail the
>>> test.
>>>
>>> Could you suggest how to handle HUC_STATUS failure properly without this
>>> code?
>>
>> Look at the error code from querying HUC_STATUS.
>> -Chris
> 
> Agree that the check should be done via uAPI instead of the sysfs. 
> Thanks for the feedback.
> Tony
>>
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* Re: [igt-dev] [PATCH i-g-t v4] tests/i915/gem_huc_copy: Enable a HuC copy test
  2020-01-16 23:56               ` Ye, Tony
@ 2020-01-16 23:59                 ` Ye, Tony
  0 siblings, 0 replies; 25+ messages in thread
From: Ye, Tony @ 2020-01-16 23:59 UTC (permalink / raw)
  To: Chris Wilson, Robert M. Fosha, igt-dev; +Cc: Sally Qi



On 1/16/2020 3:56 PM, Ye, Tony wrote:
> There are two issues with the HUC_STATUS query ioctl.
> 
> 1. on a platform with huc supported, i915.enable_guc=0, got unexpected 
> return value:
> ret=0, param.value=0, errno=ENODEV
it is ret=-1, param.value=0, errno=ENODEV, sorry for the typo.
> 
> 2. the return value doesn't differentiate these two conditions:
> a. i915.enable_guc=0/1, huc is disabled, skip the huc_copy test;
> b. i915.enable_guc=2/3, huc load/authentication failed, fail huc_copy.
> A patch like this is required:
> https://patchwork.freedesktop.org/patch/306419/?series=61001&rev=1
> 
> Regards,
> Tony
> On 1/10/2020 5:05 PM, Ye, Tony wrote:
>>
>>
>> On 1/10/2020 11:54 AM, Chris Wilson wrote:
>>> Quoting Ye, Tony (2020-01-10 19:51:58)
>>>>
>>>>
>>>> On 1/10/2020 10:28 AM, Chris Wilson wrote:
>>>>> Quoting Robert M. Fosha (2020-01-10 17:41:46)
>>>>>> +static bool
>>>>>> +check_huc_enabled(int fd)
>>>>>> +{
>>>>>> +       int dir;
>>>>>> +       dir = igt_sysfs_open_parameters(fd);
>>>>>> +
>>>>>> +       if (dir < 0)
>>>>>> +               return 0;
>>>>>> +
>>>>>> +       if (igt_sysfs_get_u32(dir, "enable_guc") & 2)
>>>>>> +               return 1;
>>>>>> +       else
>>>>>> +               return 0;
>>>>>
>>>>> No. If you have this in your userspace, please immediately remove it,
>>>>> and backport that to any and all stable branches and releases.
>>>>> -Chris
>>>>
>>>> The code is to skip the test when HuC is disabled by the enable_guc
>>>> module parameter. If HuC is disabled by the enable_guc param, then skip
>>>> the test. If the HuC failed to load due to a real error, then fail the
>>>> test.
>>>>
>>>> Could you suggest how to handle HUC_STATUS failure properly without 
>>>> this
>>>> code?
>>>
>>> Look at the error code from querying HUC_STATUS.
>>> -Chris
>>
>> Agree that the check should be done via uAPI instead of the sysfs. 
>> Thanks for the feedback.
>> Tony
>>>
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [igt-dev] [PATCH i-g-t v5] tests/i915/gem_huc_copy: Enable a HuC copy test
  2020-01-10 17:41     ` [igt-dev] [PATCH i-g-t v4] " Robert M. Fosha
  2020-01-10 18:28       ` Chris Wilson
@ 2020-04-14 21:24       ` Robert M. Fosha
  2020-05-08 16:31         ` Argenziano, Antonio
  1 sibling, 1 reply; 25+ messages in thread
From: Robert M. Fosha @ 2020-04-14 21:24 UTC (permalink / raw)
  To: igt-dev; +Cc: Chris Wilson, Sally Qi

From: Sally Qi <feng.qi@intel.com>

This test case loads the HuC copy firmware to copy the content of
the source buffer to the destination buffer.

v2: (Tony Ye)
 * Restructured some functions and files.
 * Defined the copy buffer size as 4K explicitly as the HuC Copy kernel
   always copy 4K bytes from src buffer to dst buffer.

v3: (Feng Qi, Antonio Argenziano, Tony Ye)
 * Restructured some functions as igt requested, exclude libdrm function call.
 * Remove huc function wrappers
 * Random initialize source input buffer

v4: (Robert Fosha)
 * Fix autotools build failure.

v5: (Feng Qi, Tony Ye)
 * Released all bo buffer after huc copying.
 * Restructured huc_copy() function.

v6: (Feng Qi)
 * Fixed the function of huc enabling and status check
 * Added huc_copy to fast feedback testlist

v7: (Tony Ye, Feng Qi, Robert Fosha, Chris Wilson, Michal Wajdeczko)
 * Check error with HUC_STATUS ioctl instead of debugfs

Signed-off-by: Feng Qi <feng.qi@intel.com>
Signed-off-by: Tony Ye <tony.ye@intel.com>
Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Antonio Argenziano <antonio.argenziano@intel.com>
---
 lib/Makefile.sources                  |   2 +
 lib/huc_copy.c                        | 107 +++++++++++++++++++++
 lib/huc_copy.h                        |  50 ++++++++++
 lib/intel_batchbuffer.c               |  20 ++++
 lib/intel_batchbuffer.h               |  20 ++++
 lib/meson.build                       |   1 +
 tests/Makefile.sources                |   3 +
 tests/i915/gem_huc_copy.c             | 130 ++++++++++++++++++++++++++
 tests/intel-ci/fast-feedback.testlist |   1 +
 tests/meson.build                     |   1 +
 10 files changed, 335 insertions(+)
 create mode 100644 lib/huc_copy.c
 create mode 100644 lib/huc_copy.h
 create mode 100644 tests/i915/gem_huc_copy.c

diff --git a/lib/Makefile.sources b/lib/Makefile.sources
index 1e2c88ae..a882b0e7 100644
--- a/lib/Makefile.sources
+++ b/lib/Makefile.sources
@@ -84,6 +84,8 @@ lib_source_list =	 	\
 	ioctl_wrappers.h	\
 	media_fill.c		\
 	media_fill.h            \
+	huc_copy.c		\
+	huc_copy.h		\
 	media_spin.h		\
 	media_spin.c		\
 	gpgpu_fill.h		\
diff --git a/lib/huc_copy.c b/lib/huc_copy.c
new file mode 100644
index 00000000..c3dece9f
--- /dev/null
+++ b/lib/huc_copy.c
@@ -0,0 +1,107 @@
+/*
+ * Copyright © 2019 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ *
+ */
+
+#include <i915_drm.h>
+#include "huc_copy.h"
+
+static void
+gen9_emit_huc_virtual_addr_state(struct drm_i915_gem_exec_object2 *src,
+		struct drm_i915_gem_exec_object2 *dst,
+		struct drm_i915_gem_relocation_entry *reloc_src,
+		struct drm_i915_gem_relocation_entry *reloc_dst,
+		uint32_t *buf,
+		int *i)
+{
+	buf[(*i)++] = HUC_VIRTUAL_ADDR_STATE;
+
+	for (int j = 0; j < HUC_VIRTUAL_ADDR_REGION_NUM; j++) {
+		if (j == HUC_VIRTUAL_ADDR_REGION_SRC) {
+			buf[(*i)++] = src->offset;
+
+			reloc_src->target_handle = src->handle;
+			reloc_src->delta = 0;
+			reloc_src->offset = (*i - 1) * sizeof(buf[0]);
+			reloc_src->read_domains = 0;
+			reloc_src->write_domain = 0;
+		} else if (j == HUC_VIRTUAL_ADDR_REGION_DST) {
+			buf[(*i)++] = dst->offset;
+
+			reloc_dst->target_handle = dst->handle;
+			reloc_dst->delta = 0;
+			reloc_dst->offset = (*i - 1) * sizeof(buf[0]);
+			reloc_dst->read_domains = 0;
+			reloc_dst->write_domain = I915_GEM_DOMAIN_RENDER;
+		} else {
+			buf[(*i)++] = 0;
+		}
+		buf[(*i)++] = 0;
+		buf[(*i)++] = 0;
+	}
+}
+
+void
+gen9_huc_copyfunc(int fd,
+		struct drm_i915_gem_exec_object2 *obj,
+		int n_bo)
+{
+	struct drm_i915_gem_relocation_entry reloc[2];
+	struct drm_i915_gem_execbuffer2 execbuf;
+	int i = 0;
+	uint32_t buf[63];
+
+	/* 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;
+
+	memset(reloc, 0, sizeof(reloc));
+	gen9_emit_huc_virtual_addr_state(&obj[0], &obj[1], &reloc[0], &reloc[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));
+	obj[2].relocation_count = 2;
+	obj[2].relocs_ptr = to_user_pointer(reloc);
+
+	memset(&execbuf, 0, sizeof(execbuf));
+	execbuf.buffers_ptr = to_user_pointer(obj);
+	execbuf.buffer_count = n_bo;
+	execbuf.flags = I915_EXEC_BSD;
+
+	gem_execbuf(fd, &execbuf);
+}
diff --git a/lib/huc_copy.h b/lib/huc_copy.h
new file mode 100644
index 00000000..088f7954
--- /dev/null
+++ b/lib/huc_copy.h
@@ -0,0 +1,50 @@
+/*
+ * Copyright © 2019 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ *
+ */
+
+#ifndef HUC_COPY_H
+#define HUC_COPY_H
+
+#include <stdint.h>
+#include <string.h>
+#include "ioctl_wrappers.h"
+#include "intel_reg.h"
+
+#define PARALLEL_VIDEO_PIPE		(0x3<<29)
+#define MFX_WAIT			(PARALLEL_VIDEO_PIPE|(0x1<<27)|(0x1<<8))
+
+#define HUC_IMEM_STATE			(PARALLEL_VIDEO_PIPE|(0x2<<27)|(0xb<<23)|(0x1<<16)|0x3)
+#define HUC_PIPE_MODE_SELECT		(PARALLEL_VIDEO_PIPE|(0x2<<27)|(0xb<<23)|0x1)
+#define HUC_START			(PARALLEL_VIDEO_PIPE|(0x2<<27)|(0xb<<23)|(0x21<<16))
+#define HUC_VIRTUAL_ADDR_STATE		(PARALLEL_VIDEO_PIPE|(0x2<<27)|(0xb<<23)|(0x4<<16)|0x2f)
+
+#define HUC_VIRTUAL_ADDR_REGION_NUM	16
+#define HUC_VIRTUAL_ADDR_REGION_SRC	0
+#define HUC_VIRTUAL_ADDR_REGION_DST	14
+
+void
+gen9_huc_copyfunc(int fd,
+		struct drm_i915_gem_exec_object2 *obj,
+		int n_bo);
+
+#endif /* HUC_COPY_H */
diff --git a/lib/intel_batchbuffer.c b/lib/intel_batchbuffer.c
index f1a45b47..93ac4546 100644
--- a/lib/intel_batchbuffer.c
+++ b/lib/intel_batchbuffer.c
@@ -45,6 +45,7 @@
 #include "gpgpu_fill.h"
 #include "igt_aux.h"
 #include "i830_reg.h"
+#include "huc_copy.h"
 
 #include <i915_drm.h>
 
@@ -1171,3 +1172,22 @@ igt_media_spinfunc_t igt_get_media_spinfunc(int devid)
 
 	return spin;
 }
+
+/**
+ * igt_get_huc_copyfunc:
+ * @devid: pci device id
+ *
+ * Returns:
+ *
+ * The platform-specific huc copy function pointer for the device specified
+ * with @devid. Will return NULL when no media spin 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))
+		copy = gen9_huc_copyfunc;
+
+	return copy;
+}
diff --git a/lib/intel_batchbuffer.h b/lib/intel_batchbuffer.h
index 442f3a18..a3d4ec36 100644
--- a/lib/intel_batchbuffer.h
+++ b/lib/intel_batchbuffer.h
@@ -422,4 +422,24 @@ typedef void (*igt_media_spinfunc_t)(struct intel_batchbuffer *batch,
 
 igt_media_spinfunc_t igt_get_media_spinfunc(int devid);
 
+/**
+ * igt_huc_copyfunc_t:
+ * @fd: drm fd
+ * @obj: drm_i915_gem_exec_object2 buffer array
+ *       obj[0] is source buffer
+ *       obj[1] is destination buffer
+ *       obj[2] is execution buffer
+ * @n_bo: the size of @obj array
+ *
+ * This is the type of the per-platform huc copy functions.
+ *
+ * The huc copy function emits a batchbuffer to the VDBOX engine to
+ * invoke the HuC Copy kernel to copy 4K bytes from the source buffer
+ * to the destination buffer.
+ */
+typedef void (*igt_huc_copyfunc_t)(int fd,
+		struct drm_i915_gem_exec_object2 *obj,
+		int n_bo);
+
+igt_huc_copyfunc_t	igt_get_huc_copyfunc(int devid);
 #endif
diff --git a/lib/meson.build b/lib/meson.build
index e2060430..3f8f42f4 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -1,5 +1,6 @@
 lib_sources = [
 	'drmtest.c',
+	'huc_copy.c',
 	'i915/gem_context.c',
 	'i915/gem_engine_topology.c',
 	'i915/gem_scheduler.c',
diff --git a/tests/Makefile.sources b/tests/Makefile.sources
index 4e44c98c..ec94d25b 100644
--- a/tests/Makefile.sources
+++ b/tests/Makefile.sources
@@ -314,6 +314,9 @@ gem_media_fill_SOURCES = i915/gem_media_fill.c
 TESTS_progs += gem_media_vme
 gem_media_vme_SOURCES = i915/gem_media_vme.c
 
+TESTS_progs += gem_huc_copy
+gem_huc_copy_SOURCES = i915/gem_huc_copy.c
+
 TESTS_progs += gem_mmap
 gem_mmap_SOURCES = i915/gem_mmap.c
 
diff --git a/tests/i915/gem_huc_copy.c b/tests/i915/gem_huc_copy.c
new file mode 100644
index 00000000..06a9129b
--- /dev/null
+++ b/tests/i915/gem_huc_copy.c
@@ -0,0 +1,130 @@
+/*
+ * Copyright © 2019 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+#include "igt.h"
+#include <stdbool.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <sys/ioctl.h>
+#include <stdio.h>
+#include <string.h>
+#include <fcntl.h>
+#include <inttypes.h>
+#include <errno.h>
+#include <sys/stat.h>
+#include <sys/time.h>
+#include "drm.h"
+#include "igt_sysfs.c"
+
+IGT_TEST_DESCRIPTION("A very simple workload for the HuC.");
+
+#define HUC_COPY_DATA_BUF_SIZE	4096
+
+static void
+compare_huc_copy_result(int drm_fd, uint32_t src_handle, uint32_t dst_handle)
+{
+	char src_output[HUC_COPY_DATA_BUF_SIZE];
+	char dst_output[HUC_COPY_DATA_BUF_SIZE];
+
+	gem_read(drm_fd, src_handle, 0, src_output, HUC_COPY_DATA_BUF_SIZE);
+	gem_read(drm_fd, dst_handle, 0, dst_output, HUC_COPY_DATA_BUF_SIZE);
+
+	for (int i = 0; i < HUC_COPY_DATA_BUF_SIZE; i++)
+		igt_assert_f(src_output[i] == dst_output[i],
+			     "Exepected %c, found %c at %4d.\n",
+			     src_output[i], dst_output[i], i);
+}
+
+static int get_huc_status(int fd)
+{
+	int status = 0;
+	drm_i915_getparam_t gp = {
+		.param = I915_PARAM_HUC_STATUS,
+		.value = &status,
+	};
+
+	if (igt_ioctl(fd, DRM_IOCTL_I915_GETPARAM, &gp))
+		return -errno;
+
+	errno = 0;
+	return status;
+}
+
+igt_main
+{
+	int drm_fd = -1;
+	uint32_t devid;
+	igt_huc_copyfunc_t huc_copy;
+
+	igt_fixture {
+		int status;
+
+		drm_fd = drm_open_driver(DRIVER_INTEL);
+		igt_require_gem(drm_fd);
+		devid = intel_get_drm_devid(drm_fd);
+		huc_copy = igt_get_huc_copyfunc(devid);
+
+		igt_require_f(huc_copy, "no huc_copy function\n");
+		status = get_huc_status(drm_fd);
+		igt_skip_on_f(status == -ENODEV,
+			      "HuC is not present on this platform!\n");
+		igt_skip_on_f(status == -EOPNOTSUPP,
+			      "HuC firmware is disabled!\n");
+		igt_fail_on_f(status < 0, "HuC firmware loading error: %i, %s\n",
+			      -status, strerror(-status));
+		igt_fail_on_f(status == 0, "HuC firmware is not running!\n");
+	}
+
+	igt_describe("Make sure that Huc firmware works"
+		     "by copying a char array using Huc"
+		     "and verifying the copied result");
+
+	igt_subtest("huc-copy") {
+		char inputs[HUC_COPY_DATA_BUF_SIZE];
+		struct drm_i915_gem_exec_object2 obj[3];
+
+		/* Initialize src buffer randomly */
+		srand(time(NULL));
+		for (int i = 0; i < HUC_COPY_DATA_BUF_SIZE; i++)
+			inputs[i] = (char) (rand() % 256);
+
+		memset(obj, 0, sizeof(obj));
+		/* source buffer object for storing input */
+		obj[0].handle = gem_create(drm_fd, HUC_COPY_DATA_BUF_SIZE);
+		/* destination buffer object to receive input */
+		obj[1].handle = gem_create(drm_fd, HUC_COPY_DATA_BUF_SIZE);
+		/* execution buffer object */
+		obj[2].handle = gem_create(drm_fd, 4096);
+
+		gem_write(drm_fd, obj[0].handle, 0, inputs, HUC_COPY_DATA_BUF_SIZE);
+
+		huc_copy(drm_fd, obj, 3);
+		compare_huc_copy_result(drm_fd, obj[0].handle, obj[1].handle);
+
+		gem_close(drm_fd, obj[0].handle);
+		gem_close(drm_fd, obj[1].handle);
+		gem_close(drm_fd, obj[2].handle);
+	}
+
+	igt_fixture
+		close(drm_fd);
+}
diff --git a/tests/intel-ci/fast-feedback.testlist b/tests/intel-ci/fast-feedback.testlist
index 2ccad438..f332d8ec 100644
--- a/tests/intel-ci/fast-feedback.testlist
+++ b/tests/intel-ci/fast-feedback.testlist
@@ -30,6 +30,7 @@ igt@gem_flink_basic@bad-open
 igt@gem_flink_basic@basic
 igt@gem_flink_basic@double-flink
 igt@gem_flink_basic@flink-lifetime
+igt@gem_huc_copy@huc_copy
 igt@gem_linear_blits@basic
 igt@gem_mmap@basic
 igt@gem_mmap_gtt@basic
diff --git a/tests/meson.build b/tests/meson.build
index e882f4dc..a4934a85 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -163,6 +163,7 @@ i915_progs = [
 	'gem_gtt_cpu_tlb',
 	'gem_gtt_hog',
 	'gem_gtt_speed',
+	'gem_huc_copy',
 	'gem_linear_blits',
 	'gem_lut_handle',
 	'gem_madvise',
-- 
2.21.0.5.gaeb582a983

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

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

* [igt-dev] ✓ Fi.CI.BAT: success for tests/i915/gem_huc_copy: Enable a HuC copy test (rev5)
  2019-12-19 23:50 [igt-dev] [PATCH i-g-t] tests/i915/gem_huc_copy: Enable a HuC copy test Robert M. Fosha
                   ` (9 preceding siblings ...)
  2020-01-14 10:10 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
@ 2020-04-14 22:07 ` Patchwork
  2020-04-15 12:30 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
  2020-06-18 16:41 ` [igt-dev] [PATCH i-g-t v6] tests/i915/gem_huc_copy: Enable a HuC copy test Robert M. Fosha
  12 siblings, 0 replies; 25+ messages in thread
From: Patchwork @ 2020-04-14 22:07 UTC (permalink / raw)
  To: Robert M. Fosha; +Cc: igt-dev

== Series Details ==

Series: tests/i915/gem_huc_copy: Enable a HuC copy test (rev5)
URL   : https://patchwork.freedesktop.org/series/71194/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_8298 -> IGTPW_4463
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

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

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

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

### IGT changes ###

#### Possible regressions ####

  * {igt@gem_huc_copy@huc_copy} (NEW):
    - fi-cml-u2:          NOTRUN -> [SKIP][1]
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4463/fi-cml-u2/igt@gem_huc_copy@huc_copy.html
    - {fi-tgl-u}:         NOTRUN -> [SKIP][2]
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4463/fi-tgl-u/igt@gem_huc_copy@huc_copy.html
    - fi-icl-guc:         NOTRUN -> [SKIP][3]
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4463/fi-icl-guc/igt@gem_huc_copy@huc_copy.html
    - {fi-ehl-1}:         NOTRUN -> [SKIP][4]
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4463/fi-ehl-1/igt@gem_huc_copy@huc_copy.html
    - fi-icl-dsi:         NOTRUN -> [SKIP][5]
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4463/fi-icl-dsi/igt@gem_huc_copy@huc_copy.html
    - fi-tgl-y:           NOTRUN -> [SKIP][6]
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4463/fi-tgl-y/igt@gem_huc_copy@huc_copy.html
    - fi-icl-u2:          NOTRUN -> [SKIP][7]
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4463/fi-icl-u2/igt@gem_huc_copy@huc_copy.html
    - fi-icl-y:           NOTRUN -> [SKIP][8]
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4463/fi-icl-y/igt@gem_huc_copy@huc_copy.html
    - {fi-tgl-dsi}:       NOTRUN -> [SKIP][9]
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4463/fi-tgl-dsi/igt@gem_huc_copy@huc_copy.html
    - fi-cml-s:           NOTRUN -> [SKIP][10]
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4463/fi-cml-s/igt@gem_huc_copy@huc_copy.html

  
New tests
---------

  New tests have been introduced between CI_DRM_8298 and IGTPW_4463:

### New IGT tests (1) ###

  * igt@gem_huc_copy@huc_copy:
    - Statuses : 43 skip(s)
    - Exec time: [0.0] s

  

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

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

### IGT changes ###

#### Warnings ####

  * igt@i915_pm_rpm@module-reload:
    - fi-kbl-x1275:       [SKIP][11] ([fdo#109271]) -> [FAIL][12] ([i915#62] / [i915#95])
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8298/fi-kbl-x1275/igt@i915_pm_rpm@module-reload.html
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4463/fi-kbl-x1275/igt@i915_pm_rpm@module-reload.html

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

  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [i915#62]: https://gitlab.freedesktop.org/drm/intel/issues/62
  [i915#95]: https://gitlab.freedesktop.org/drm/intel/issues/95


Participating hosts (48 -> 44)
------------------------------

  Missing    (4): fi-byt-clapper fi-byt-squawks fi-bsw-cyan fi-hsw-4200u 


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

  * CI: CI-20190529 -> None
  * IGT: IGT_5589 -> IGTPW_4463

  CI-20190529: 20190529
  CI_DRM_8298: 17f82f0c2857d0b442adbdb62eb44b61d0f5b775 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_4463: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4463/index.html
  IGT_5589: 31962324ac86f029e2841e56e97c42cf9d572956 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools



== Testlist changes ==

+igt@gem_huc_copy@huc-copy

== Logs ==

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

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

* [igt-dev] ✓ Fi.CI.IGT: success for tests/i915/gem_huc_copy: Enable a HuC copy test (rev5)
  2019-12-19 23:50 [igt-dev] [PATCH i-g-t] tests/i915/gem_huc_copy: Enable a HuC copy test Robert M. Fosha
                   ` (10 preceding siblings ...)
  2020-04-14 22:07 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/i915/gem_huc_copy: Enable a HuC copy test (rev5) Patchwork
@ 2020-04-15 12:30 ` Patchwork
  2020-06-18 16:41 ` [igt-dev] [PATCH i-g-t v6] tests/i915/gem_huc_copy: Enable a HuC copy test Robert M. Fosha
  12 siblings, 0 replies; 25+ messages in thread
From: Patchwork @ 2020-04-15 12:30 UTC (permalink / raw)
  To: Robert M. Fosha; +Cc: igt-dev

== Series Details ==

Series: tests/i915/gem_huc_copy: Enable a HuC copy test (rev5)
URL   : https://patchwork.freedesktop.org/series/71194/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_8298_full -> IGTPW_4463_full
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

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

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

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

### IGT changes ###

#### Possible regressions ####

  * {igt@gem_huc_copy@huc-copy} (NEW):
    - shard-iclb:         NOTRUN -> [SKIP][1]
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4463/shard-iclb3/igt@gem_huc_copy@huc-copy.html

  
New tests
---------

  New tests have been introduced between CI_DRM_8298_full and IGTPW_4463_full:

### New IGT tests (1) ###

  * igt@gem_huc_copy@huc-copy:
    - Statuses : 1 pass(s) 6 skip(s)
    - Exec time: [0.0, 0.00] s

  

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

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

### IGT changes ###

#### Issues hit ####

  * igt@gem_workarounds@suspend-resume-fd:
    - shard-kbl:          [PASS][2] -> [DMESG-WARN][3] ([i915#180]) +2 similar issues
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8298/shard-kbl1/igt@gem_workarounds@suspend-resume-fd.html
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4463/shard-kbl6/igt@gem_workarounds@suspend-resume-fd.html

  * igt@i915_pm_rpm@modeset-lpsp-stress-no-wait:
    - shard-iclb:         [PASS][4] -> [SKIP][5] ([i915#1316] / [i915#579])
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8298/shard-iclb1/igt@i915_pm_rpm@modeset-lpsp-stress-no-wait.html
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4463/shard-iclb2/igt@i915_pm_rpm@modeset-lpsp-stress-no-wait.html
    - shard-tglb:         [PASS][6] -> [SKIP][7] ([i915#1316] / [i915#579])
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8298/shard-tglb1/igt@i915_pm_rpm@modeset-lpsp-stress-no-wait.html
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4463/shard-tglb2/igt@i915_pm_rpm@modeset-lpsp-stress-no-wait.html

  * igt@kms_big_fb@linear-32bpp-rotate-0:
    - shard-kbl:          [PASS][8] -> [FAIL][9] ([i915#1119] / [i915#93] / [i915#95])
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8298/shard-kbl7/igt@kms_big_fb@linear-32bpp-rotate-0.html
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4463/shard-kbl3/igt@kms_big_fb@linear-32bpp-rotate-0.html
    - shard-apl:          [PASS][10] -> [FAIL][11] ([i915#1119] / [i915#95])
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8298/shard-apl6/igt@kms_big_fb@linear-32bpp-rotate-0.html
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4463/shard-apl4/igt@kms_big_fb@linear-32bpp-rotate-0.html

  * igt@kms_cursor_crc@pipe-a-cursor-128x42-onscreen:
    - shard-kbl:          [PASS][12] -> [FAIL][13] ([i915#54] / [i915#93] / [i915#95])
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8298/shard-kbl6/igt@kms_cursor_crc@pipe-a-cursor-128x42-onscreen.html
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4463/shard-kbl6/igt@kms_cursor_crc@pipe-a-cursor-128x42-onscreen.html

  * igt@kms_cursor_crc@pipe-a-cursor-256x256-sliding:
    - shard-apl:          [PASS][14] -> [FAIL][15] ([i915#54] / [i915#95]) +1 similar issue
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8298/shard-apl4/igt@kms_cursor_crc@pipe-a-cursor-256x256-sliding.html
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4463/shard-apl7/igt@kms_cursor_crc@pipe-a-cursor-256x256-sliding.html

  * igt@kms_cursor_crc@pipe-b-cursor-64x64-sliding:
    - shard-apl:          [PASS][16] -> [FAIL][17] ([i915#54])
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8298/shard-apl1/igt@kms_cursor_crc@pipe-b-cursor-64x64-sliding.html
   [17]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4463/shard-apl6/igt@kms_cursor_crc@pipe-b-cursor-64x64-sliding.html
    - shard-kbl:          [PASS][18] -> [FAIL][19] ([i915#54])
   [18]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8298/shard-kbl6/igt@kms_cursor_crc@pipe-b-cursor-64x64-sliding.html
   [19]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4463/shard-kbl7/igt@kms_cursor_crc@pipe-b-cursor-64x64-sliding.html

  * igt@kms_cursor_legacy@flip-vs-cursor-crc-atomic:
    - shard-kbl:          [PASS][20] -> [FAIL][21] ([i915#1566] / [i915#93] / [i915#95])
   [20]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8298/shard-kbl3/igt@kms_cursor_legacy@flip-vs-cursor-crc-atomic.html
   [21]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4463/shard-kbl6/igt@kms_cursor_legacy@flip-vs-cursor-crc-atomic.html

  * igt@kms_draw_crc@draw-method-rgb565-mmap-gtt-ytiled:
    - shard-glk:          [PASS][22] -> [FAIL][23] ([i915#52] / [i915#54]) +5 similar issues
   [22]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8298/shard-glk9/igt@kms_draw_crc@draw-method-rgb565-mmap-gtt-ytiled.html
   [23]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4463/shard-glk9/igt@kms_draw_crc@draw-method-rgb565-mmap-gtt-ytiled.html

  * igt@kms_draw_crc@draw-method-rgb565-pwrite-untiled:
    - shard-glk:          [PASS][24] -> [FAIL][25] ([i915#177] / [i915#52] / [i915#54])
   [24]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8298/shard-glk7/igt@kms_draw_crc@draw-method-rgb565-pwrite-untiled.html
   [25]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4463/shard-glk8/igt@kms_draw_crc@draw-method-rgb565-pwrite-untiled.html

  * igt@kms_flip@flip-vs-suspend-interruptible:
    - shard-apl:          [PASS][26] -> [DMESG-WARN][27] ([i915#180])
   [26]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8298/shard-apl2/igt@kms_flip@flip-vs-suspend-interruptible.html
   [27]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4463/shard-apl4/igt@kms_flip@flip-vs-suspend-interruptible.html

  * igt@kms_frontbuffer_tracking@fbcpsr-badstride:
    - shard-tglb:         [PASS][28] -> [SKIP][29] ([i915#668]) +6 similar issues
   [28]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8298/shard-tglb1/igt@kms_frontbuffer_tracking@fbcpsr-badstride.html
   [29]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4463/shard-tglb6/igt@kms_frontbuffer_tracking@fbcpsr-badstride.html

  * igt@kms_plane_cursor@pipe-a-overlay-size-256:
    - shard-kbl:          [PASS][30] -> [FAIL][31] ([i915#1559] / [i915#93] / [i915#95])
   [30]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8298/shard-kbl4/igt@kms_plane_cursor@pipe-a-overlay-size-256.html
   [31]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4463/shard-kbl6/igt@kms_plane_cursor@pipe-a-overlay-size-256.html
    - shard-apl:          [PASS][32] -> [FAIL][33] ([i915#1559] / [i915#95])
   [32]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8298/shard-apl3/igt@kms_plane_cursor@pipe-a-overlay-size-256.html
   [33]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4463/shard-apl8/igt@kms_plane_cursor@pipe-a-overlay-size-256.html

  * igt@kms_psr@no_drrs:
    - shard-iclb:         [PASS][34] -> [FAIL][35] ([i915#173])
   [34]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8298/shard-iclb3/igt@kms_psr@no_drrs.html
   [35]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4463/shard-iclb1/igt@kms_psr@no_drrs.html

  
#### Possible fixes ####

  * igt@i915_pm_rpm@dpms-lpsp:
    - shard-iclb:         [SKIP][36] ([i915#1316] / [i915#579]) -> [PASS][37] +1 similar issue
   [36]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8298/shard-iclb2/igt@i915_pm_rpm@dpms-lpsp.html
   [37]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4463/shard-iclb1/igt@i915_pm_rpm@dpms-lpsp.html
    - shard-tglb:         [SKIP][38] ([i915#1316] / [i915#579]) -> [PASS][39] +1 similar issue
   [38]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8298/shard-tglb5/igt@i915_pm_rpm@dpms-lpsp.html
   [39]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4463/shard-tglb3/igt@i915_pm_rpm@dpms-lpsp.html

  * igt@i915_pm_rpm@sysfs-read:
    - shard-glk:          [SKIP][40] ([fdo#109271]) -> [PASS][41] +1 similar issue
   [40]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8298/shard-glk2/igt@i915_pm_rpm@sysfs-read.html
   [41]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4463/shard-glk8/igt@i915_pm_rpm@sysfs-read.html

  * igt@kms_cursor_crc@pipe-a-cursor-128x42-offscreen:
    - shard-kbl:          [FAIL][42] ([i915#54] / [i915#93] / [i915#95]) -> [PASS][43]
   [42]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8298/shard-kbl7/igt@kms_cursor_crc@pipe-a-cursor-128x42-offscreen.html
   [43]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4463/shard-kbl2/igt@kms_cursor_crc@pipe-a-cursor-128x42-offscreen.html

  * igt@kms_draw_crc@draw-method-rgb565-render-untiled:
    - shard-glk:          [FAIL][44] ([i915#52] / [i915#54]) -> [PASS][45] +2 similar issues
   [44]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8298/shard-glk6/igt@kms_draw_crc@draw-method-rgb565-render-untiled.html
   [45]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4463/shard-glk9/igt@kms_draw_crc@draw-method-rgb565-render-untiled.html

  * igt@kms_draw_crc@draw-method-xrgb8888-pwrite-untiled:
    - shard-kbl:          [FAIL][46] ([i915#177] / [i915#52] / [i915#54] / [i915#93] / [i915#95]) -> [PASS][47]
   [46]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8298/shard-kbl6/igt@kms_draw_crc@draw-method-xrgb8888-pwrite-untiled.html
   [47]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4463/shard-kbl1/igt@kms_draw_crc@draw-method-xrgb8888-pwrite-untiled.html
    - shard-apl:          [FAIL][48] ([i915#52] / [i915#54] / [i915#95]) -> [PASS][49]
   [48]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8298/shard-apl1/igt@kms_draw_crc@draw-method-xrgb8888-pwrite-untiled.html
   [49]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4463/shard-apl1/igt@kms_draw_crc@draw-method-xrgb8888-pwrite-untiled.html

  * igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a:
    - shard-kbl:          [DMESG-WARN][50] ([i915#180]) -> [PASS][51]
   [50]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8298/shard-kbl7/igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a.html
   [51]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4463/shard-kbl4/igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a.html

  * igt@kms_plane_alpha_blend@pipe-a-coverage-7efc:
    - shard-apl:          [FAIL][52] ([fdo#108145] / [i915#265] / [i915#95]) -> [PASS][53]
   [52]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8298/shard-apl6/igt@kms_plane_alpha_blend@pipe-a-coverage-7efc.html
   [53]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4463/shard-apl2/igt@kms_plane_alpha_blend@pipe-a-coverage-7efc.html

  * igt@kms_psr@psr2_primary_mmap_gtt:
    - shard-iclb:         [SKIP][54] ([fdo#109441]) -> [PASS][55] +1 similar issue
   [54]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8298/shard-iclb6/igt@kms_psr@psr2_primary_mmap_gtt.html
   [55]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4463/shard-iclb2/igt@kms_psr@psr2_primary_mmap_gtt.html

  * igt@kms_vblank@pipe-a-ts-continuation-dpms-rpm:
    - shard-tglb:         [SKIP][56] ([fdo#112015]) -> [PASS][57]
   [56]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8298/shard-tglb5/igt@kms_vblank@pipe-a-ts-continuation-dpms-rpm.html
   [57]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4463/shard-tglb6/igt@kms_vblank@pipe-a-ts-continuation-dpms-rpm.html
    - shard-hsw:          [SKIP][58] ([fdo#109271]) -> [PASS][59] +1 similar issue
   [58]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8298/shard-hsw7/igt@kms_vblank@pipe-a-ts-continuation-dpms-rpm.html
   [59]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4463/shard-hsw7/igt@kms_vblank@pipe-a-ts-continuation-dpms-rpm.html
    - shard-iclb:         [SKIP][60] ([fdo#109278]) -> [PASS][61]
   [60]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8298/shard-iclb2/igt@kms_vblank@pipe-a-ts-continuation-dpms-rpm.html
   [61]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4463/shard-iclb4/igt@kms_vblank@pipe-a-ts-continuation-dpms-rpm.html

  * igt@kms_vblank@pipe-b-ts-continuation-suspend:
    - shard-apl:          [DMESG-WARN][62] ([i915#180]) -> [PASS][63] +2 similar issues
   [62]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8298/shard-apl4/igt@kms_vblank@pipe-b-ts-continuation-suspend.html
   [63]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4463/shard-apl6/igt@kms_vblank@pipe-b-ts-continuation-suspend.html

  
#### Warnings ####

  * igt@kms_fbcon_fbt@fbc-suspend:
    - shard-kbl:          [DMESG-FAIL][64] ([i915#180] / [i915#95]) -> [FAIL][65] ([i915#93] / [i915#95])
   [64]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8298/shard-kbl6/igt@kms_fbcon_fbt@fbc-suspend.html
   [65]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4463/shard-kbl1/igt@kms_fbcon_fbt@fbc-suspend.html

  * igt@kms_plane_alpha_blend@pipe-b-constant-alpha-max:
    - shard-apl:          [FAIL][66] ([fdo#108145] / [i915#265] / [i915#95]) -> [FAIL][67] ([fdo#108145] / [i915#265])
   [66]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8298/shard-apl1/igt@kms_plane_alpha_blend@pipe-b-constant-alpha-max.html
   [67]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4463/shard-apl3/igt@kms_plane_alpha_blend@pipe-b-constant-alpha-max.html
    - shard-kbl:          [FAIL][68] ([fdo#108145] / [i915#265] / [i915#93] / [i915#95]) -> [FAIL][69] ([fdo#108145] / [i915#265])
   [68]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8298/shard-kbl7/igt@kms_plane_alpha_blend@pipe-b-constant-alpha-max.html
   [69]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4463/shard-kbl7/igt@kms_plane_alpha_blend@pipe-b-constant-alpha-max.html

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

  [fdo#108145]: https://bugs.freedesktop.org/show_bug.cgi?id=108145
  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [fdo#109278]: https://bugs.freedesktop.org/show_bug.cgi?id=109278
  [fdo#109441]: https://bugs.freedesktop.org/show_bug.cgi?id=109441
  [fdo#112015]: https://bugs.freedesktop.org/show_bug.cgi?id=112015
  [i915#1119]: https://gitlab.freedesktop.org/drm/intel/issues/1119
  [i915#1316]: https://gitlab.freedesktop.org/drm/intel/issues/1316
  [i915#1542]: https://gitlab.freedesktop.org/drm/intel/issues/1542
  [i915#1559]: https://gitlab.freedesktop.org/drm/intel/issues/1559
  [i915#1566]: https://gitlab.freedesktop.org/drm/intel/issues/1566
  [i915#173]: https://gitlab.freedesktop.org/drm/intel/issues/173
  [i915#177]: https://gitlab.freedesktop.org/drm/intel/issues/177
  [i915#180]: https://gitlab.freedesktop.org/drm/intel/issues/180
  [i915#265]: https://gitlab.freedesktop.org/drm/intel/issues/265
  [i915#52]: https://gitlab.freedesktop.org/drm/intel/issues/52
  [i915#54]: https://gitlab.freedesktop.org/drm/intel/issues/54
  [i915#579]: https://gitlab.freedesktop.org/drm/intel/issues/579
  [i915#668]: https://gitlab.freedesktop.org/drm/intel/issues/668
  [i915#93]: https://gitlab.freedesktop.org/drm/intel/issues/93
  [i915#95]: https://gitlab.freedesktop.org/drm/intel/issues/95


Participating hosts (10 -> 8)
------------------------------

  Missing    (2): pig-skl-6260u pig-glk-j5005 


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

  * CI: CI-20190529 -> None
  * IGT: IGT_5589 -> IGTPW_4463
  * Piglit: piglit_4509 -> None

  CI-20190529: 20190529
  CI_DRM_8298: 17f82f0c2857d0b442adbdb62eb44b61d0f5b775 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_4463: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4463/index.html
  IGT_5589: 31962324ac86f029e2841e56e97c42cf9d572956 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit

== Logs ==

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

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

* Re: [igt-dev] [PATCH i-g-t v5] tests/i915/gem_huc_copy: Enable a HuC copy test
  2020-04-14 21:24       ` [igt-dev] [PATCH i-g-t v5] " Robert M. Fosha
@ 2020-05-08 16:31         ` Argenziano, Antonio
  0 siblings, 0 replies; 25+ messages in thread
From: Argenziano, Antonio @ 2020-05-08 16:31 UTC (permalink / raw)
  To: Robert M. Fosha, igt-dev; +Cc: Chris Wilson, Sally Qi


On 4/14/2020 2:24 PM, Robert M. Fosha wrote:
> From: Sally Qi <feng.qi@intel.com>
>
> This test case loads the HuC copy firmware to copy the content of
> the source buffer to the destination buffer.
>
> v2: (Tony Ye)
>   * Restructured some functions and files.
>   * Defined the copy buffer size as 4K explicitly as the HuC Copy kernel
>     always copy 4K bytes from src buffer to dst buffer.
>
> v3: (Feng Qi, Antonio Argenziano, Tony Ye)
>   * Restructured some functions as igt requested, exclude libdrm function call.
>   * Remove huc function wrappers
>   * Random initialize source input buffer
>
> v4: (Robert Fosha)
>   * Fix autotools build failure.
>
> v5: (Feng Qi, Tony Ye)
>   * Released all bo buffer after huc copying.
>   * Restructured huc_copy() function.
>
> v6: (Feng Qi)
>   * Fixed the function of huc enabling and status check
>   * Added huc_copy to fast feedback testlist
>
> v7: (Tony Ye, Feng Qi, Robert Fosha, Chris Wilson, Michal Wajdeczko)
>   * Check error with HUC_STATUS ioctl instead of debugfs
>
> Signed-off-by: Feng Qi <feng.qi@intel.com>
> Signed-off-by: Tony Ye <tony.ye@intel.com>
> Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Acked-by: Antonio Argenziano <antonio.argenziano@intel.com>
> ---
>   lib/Makefile.sources                  |   2 +
>   lib/huc_copy.c                        | 107 +++++++++++++++++++++
>   lib/huc_copy.h                        |  50 ++++++++++
>   lib/intel_batchbuffer.c               |  20 ++++
>   lib/intel_batchbuffer.h               |  20 ++++
>   lib/meson.build                       |   1 +
>   tests/Makefile.sources                |   3 +
>   tests/i915/gem_huc_copy.c             | 130 ++++++++++++++++++++++++++
>   tests/intel-ci/fast-feedback.testlist |   1 +
>   tests/meson.build                     |   1 +
>   10 files changed, 335 insertions(+)
>   create mode 100644 lib/huc_copy.c
>   create mode 100644 lib/huc_copy.h
>   create mode 100644 tests/i915/gem_huc_copy.c
>
> diff --git a/lib/Makefile.sources b/lib/Makefile.sources
> index 1e2c88ae..a882b0e7 100644
> --- a/lib/Makefile.sources
> +++ b/lib/Makefile.sources
> @@ -84,6 +84,8 @@ lib_source_list =	 	\
>   	ioctl_wrappers.h	\
>   	media_fill.c		\
>   	media_fill.h            \
> +	huc_copy.c		\
> +	huc_copy.h		\
>   	media_spin.h		\
>   	media_spin.c		\
>   	gpgpu_fill.h		\
> diff --git a/lib/huc_copy.c b/lib/huc_copy.c
> new file mode 100644
> index 00000000..c3dece9f
> --- /dev/null
> +++ b/lib/huc_copy.c
> @@ -0,0 +1,107 @@
> +/*
> + * Copyright © 2019 Intel Corporation
> + *
> + * Permission is hereby granted, free of charge, to any person obtaining a
> + * copy of this software and associated documentation files (the "Software"),
> + * to deal in the Software without restriction, including without limitation
> + * the rights to use, copy, modify, merge, publish, distribute, sublicense,
> + * and/or sell copies of the Software, and to permit persons to whom the
> + * Software is furnished to do so, subject to the following conditions:
> + *
> + * The above copyright notice and this permission notice (including the next
> + * paragraph) shall be included in all copies or substantial portions of the
> + * Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
> + * IN THE SOFTWARE.
> + *
> + */
> +
> +#include <i915_drm.h>
> +#include "huc_copy.h"
> +
> +static void
> +gen9_emit_huc_virtual_addr_state(struct drm_i915_gem_exec_object2 *src,
> +		struct drm_i915_gem_exec_object2 *dst,
> +		struct drm_i915_gem_relocation_entry *reloc_src,
> +		struct drm_i915_gem_relocation_entry *reloc_dst,
> +		uint32_t *buf,
> +		int *i)
> +{
> +	buf[(*i)++] = HUC_VIRTUAL_ADDR_STATE;
> +
> +	for (int j = 0; j < HUC_VIRTUAL_ADDR_REGION_NUM; j++) {
> +		if (j == HUC_VIRTUAL_ADDR_REGION_SRC) {
> +			buf[(*i)++] = src->offset;
> +
> +			reloc_src->target_handle = src->handle;
> +			reloc_src->delta = 0;
> +			reloc_src->offset = (*i - 1) * sizeof(buf[0]);
> +			reloc_src->read_domains = 0;
> +			reloc_src->write_domain = 0;
> +		} else if (j == HUC_VIRTUAL_ADDR_REGION_DST) {
> +			buf[(*i)++] = dst->offset;
> +
> +			reloc_dst->target_handle = dst->handle;
> +			reloc_dst->delta = 0;
> +			reloc_dst->offset = (*i - 1) * sizeof(buf[0]);
> +			reloc_dst->read_domains = 0;
> +			reloc_dst->write_domain = I915_GEM_DOMAIN_RENDER;
> +		} else {
> +			buf[(*i)++] = 0;
> +		}
> +		buf[(*i)++] = 0;
> +		buf[(*i)++] = 0;
> +	}
> +}
> +
> +void
> +gen9_huc_copyfunc(int fd,
> +		struct drm_i915_gem_exec_object2 *obj,
> +		int n_bo)


Not sure you really need 'n_bo', it is always assumed to be 3 no matter 
what. If you really want to keep it I think you should check it == 3.


> +{
> +	struct drm_i915_gem_relocation_entry reloc[2];
> +	struct drm_i915_gem_execbuffer2 execbuf;
> +	int i = 0;
> +	uint32_t buf[63];
> +
> +	/* 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;
> +
> +	memset(reloc, 0, sizeof(reloc));
> +	gen9_emit_huc_virtual_addr_state(&obj[0], &obj[1], &reloc[0], &reloc[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));
> +	obj[2].relocation_count = 2;
> +	obj[2].relocs_ptr = to_user_pointer(reloc);
> +
> +	memset(&execbuf, 0, sizeof(execbuf));
> +	execbuf.buffers_ptr = to_user_pointer(obj);
> +	execbuf.buffer_count = n_bo;
> +	execbuf.flags = I915_EXEC_BSD;
> +
> +	gem_execbuf(fd, &execbuf);
> +}
> diff --git a/lib/huc_copy.h b/lib/huc_copy.h
> new file mode 100644
> index 00000000..088f7954
> --- /dev/null
> +++ b/lib/huc_copy.h
> @@ -0,0 +1,50 @@
> +/*
> + * Copyright © 2019 Intel Corporation
> + *
> + * Permission is hereby granted, free of charge, to any person obtaining a
> + * copy of this software and associated documentation files (the "Software"),
> + * to deal in the Software without restriction, including without limitation
> + * the rights to use, copy, modify, merge, publish, distribute, sublicense,
> + * and/or sell copies of the Software, and to permit persons to whom the
> + * Software is furnished to do so, subject to the following conditions:
> + *
> + * The above copyright notice and this permission notice (including the next
> + * paragraph) shall be included in all copies or substantial portions of the
> + * Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
> + * IN THE SOFTWARE.
> + *
> + */
> +
> +#ifndef HUC_COPY_H
> +#define HUC_COPY_H
> +
> +#include <stdint.h>
> +#include <string.h>
> +#include "ioctl_wrappers.h"
> +#include "intel_reg.h"
> +
> +#define PARALLEL_VIDEO_PIPE		(0x3<<29)
> +#define MFX_WAIT			(PARALLEL_VIDEO_PIPE|(0x1<<27)|(0x1<<8))
> +
> +#define HUC_IMEM_STATE			(PARALLEL_VIDEO_PIPE|(0x2<<27)|(0xb<<23)|(0x1<<16)|0x3)
> +#define HUC_PIPE_MODE_SELECT		(PARALLEL_VIDEO_PIPE|(0x2<<27)|(0xb<<23)|0x1)
> +#define HUC_START			(PARALLEL_VIDEO_PIPE|(0x2<<27)|(0xb<<23)|(0x21<<16))
> +#define HUC_VIRTUAL_ADDR_STATE		(PARALLEL_VIDEO_PIPE|(0x2<<27)|(0xb<<23)|(0x4<<16)|0x2f)
> +
> +#define HUC_VIRTUAL_ADDR_REGION_NUM	16
> +#define HUC_VIRTUAL_ADDR_REGION_SRC	0
> +#define HUC_VIRTUAL_ADDR_REGION_DST	14
> +
> +void
> +gen9_huc_copyfunc(int fd,
> +		struct drm_i915_gem_exec_object2 *obj,
> +		int n_bo);
> +
> +#endif /* HUC_COPY_H */
> diff --git a/lib/intel_batchbuffer.c b/lib/intel_batchbuffer.c
> index f1a45b47..93ac4546 100644
> --- a/lib/intel_batchbuffer.c
> +++ b/lib/intel_batchbuffer.c
> @@ -45,6 +45,7 @@
>   #include "gpgpu_fill.h"
>   #include "igt_aux.h"
>   #include "i830_reg.h"
> +#include "huc_copy.h"
>   
>   #include <i915_drm.h>
>   
> @@ -1171,3 +1172,22 @@ igt_media_spinfunc_t igt_get_media_spinfunc(int devid)
>   
>   	return spin;
>   }
> +
> +/**
> + * igt_get_huc_copyfunc:
> + * @devid: pci device id
> + *
> + * Returns:
> + *
> + * The platform-specific huc copy function pointer for the device specified
> + * with @devid. Will return NULL when no media spin 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))
> +		copy = gen9_huc_copyfunc;
> +
> +	return copy;
> +}
> diff --git a/lib/intel_batchbuffer.h b/lib/intel_batchbuffer.h
> index 442f3a18..a3d4ec36 100644
> --- a/lib/intel_batchbuffer.h
> +++ b/lib/intel_batchbuffer.h
> @@ -422,4 +422,24 @@ typedef void (*igt_media_spinfunc_t)(struct intel_batchbuffer *batch,
>   
>   igt_media_spinfunc_t igt_get_media_spinfunc(int devid);
>   
> +/**
> + * igt_huc_copyfunc_t:
> + * @fd: drm fd
> + * @obj: drm_i915_gem_exec_object2 buffer array
> + *       obj[0] is source buffer
> + *       obj[1] is destination buffer
> + *       obj[2] is execution buffer
> + * @n_bo: the size of @obj array
> + *
> + * This is the type of the per-platform huc copy functions.
> + *
> + * The huc copy function emits a batchbuffer to the VDBOX engine to
> + * invoke the HuC Copy kernel to copy 4K bytes from the source buffer
> + * to the destination buffer.
> + */
> +typedef void (*igt_huc_copyfunc_t)(int fd,
> +		struct drm_i915_gem_exec_object2 *obj,
> +		int n_bo);
> +
> +igt_huc_copyfunc_t	igt_get_huc_copyfunc(int devid);
>   #endif
> diff --git a/lib/meson.build b/lib/meson.build
> index e2060430..3f8f42f4 100644
> --- a/lib/meson.build
> +++ b/lib/meson.build
> @@ -1,5 +1,6 @@
>   lib_sources = [
>   	'drmtest.c',
> +	'huc_copy.c',
>   	'i915/gem_context.c',
>   	'i915/gem_engine_topology.c',
>   	'i915/gem_scheduler.c',
> diff --git a/tests/Makefile.sources b/tests/Makefile.sources
> index 4e44c98c..ec94d25b 100644
> --- a/tests/Makefile.sources
> +++ b/tests/Makefile.sources
> @@ -314,6 +314,9 @@ gem_media_fill_SOURCES = i915/gem_media_fill.c
>   TESTS_progs += gem_media_vme
>   gem_media_vme_SOURCES = i915/gem_media_vme.c
>   
> +TESTS_progs += gem_huc_copy
> +gem_huc_copy_SOURCES = i915/gem_huc_copy.c
> +
>   TESTS_progs += gem_mmap
>   gem_mmap_SOURCES = i915/gem_mmap.c
>   
> diff --git a/tests/i915/gem_huc_copy.c b/tests/i915/gem_huc_copy.c
> new file mode 100644
> index 00000000..06a9129b
> --- /dev/null
> +++ b/tests/i915/gem_huc_copy.c
> @@ -0,0 +1,130 @@
> +/*
> + * Copyright © 2019 Intel Corporation
> + *
> + * Permission is hereby granted, free of charge, to any person obtaining a
> + * copy of this software and associated documentation files (the "Software"),
> + * to deal in the Software without restriction, including without limitation
> + * the rights to use, copy, modify, merge, publish, distribute, sublicense,
> + * and/or sell copies of the Software, and to permit persons to whom the
> + * Software is furnished to do so, subject to the following conditions:
> + *
> + * The above copyright notice and this permission notice (including the next
> + * paragraph) shall be included in all copies or substantial portions of the
> + * Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
> + * IN THE SOFTWARE.
> + */
> +#include "igt.h"
> +#include <stdbool.h>
> +#include <unistd.h>
> +#include <stdlib.h>
> +#include <sys/ioctl.h>
> +#include <stdio.h>
> +#include <string.h>
> +#include <fcntl.h>
> +#include <inttypes.h>
> +#include <errno.h>
> +#include <sys/stat.h>
> +#include <sys/time.h>
> +#include "drm.h"
> +#include "igt_sysfs.c"
> +
> +IGT_TEST_DESCRIPTION("A very simple workload for the HuC.");
> +
> +#define HUC_COPY_DATA_BUF_SIZE	4096
> +
> +static void
> +compare_huc_copy_result(int drm_fd, uint32_t src_handle, uint32_t dst_handle)
> +{
> +	char src_output[HUC_COPY_DATA_BUF_SIZE];
> +	char dst_output[HUC_COPY_DATA_BUF_SIZE];
> +
> +	gem_read(drm_fd, src_handle, 0, src_output, HUC_COPY_DATA_BUF_SIZE);
> +	gem_read(drm_fd, dst_handle, 0, dst_output, HUC_COPY_DATA_BUF_SIZE);
> +
> +	for (int i = 0; i < HUC_COPY_DATA_BUF_SIZE; i++)
> +		igt_assert_f(src_output[i] == dst_output[i],
> +			     "Exepected %c, found %c at %4d.\n",
> +			     src_output[i], dst_output[i], i);
> +}
> +
> +static int get_huc_status(int fd)
> +{
> +	int status = 0;
> +	drm_i915_getparam_t gp = {
> +		.param = I915_PARAM_HUC_STATUS,
> +		.value = &status,
> +	};
> +
> +	if (igt_ioctl(fd, DRM_IOCTL_I915_GETPARAM, &gp))
> +		return -errno;
> +
> +	errno = 0;
> +	return status;
> +}
> +
> +igt_main
> +{
> +	int drm_fd = -1;
> +	uint32_t devid;
> +	igt_huc_copyfunc_t huc_copy;
> +
> +	igt_fixture {
> +		int status;
> +
> +		drm_fd = drm_open_driver(DRIVER_INTEL);
> +		igt_require_gem(drm_fd);
> +		devid = intel_get_drm_devid(drm_fd);
> +		huc_copy = igt_get_huc_copyfunc(devid);
> +
> +		igt_require_f(huc_copy, "no huc_copy function\n");
> +		status = get_huc_status(drm_fd);
> +		igt_skip_on_f(status == -ENODEV,
> +			      "HuC is not present on this platform!\n");
> +		igt_skip_on_f(status == -EOPNOTSUPP,
> +			      "HuC firmware is disabled!\n");
> +		igt_fail_on_f(status < 0, "HuC firmware loading error: %i, %s\n",
> +			      -status, strerror(-status));
> +		igt_fail_on_f(status == 0, "HuC firmware is not running!\n");


Couple of things here:

1. Not convinced that failing in the fixture is ever a good idea, it 
will cause a lot of failures but possibly be linked to one single failure.

2. Is the value of status an error condition? Why is that? I would 
expect a HuC loading test to tell me in what conditions it expects the 
firmware to be loaded and running and when it expect it not to be loaded.


Antonio


> +	}
> +
> +	igt_describe("Make sure that Huc firmware works"
> +		     "by copying a char array using Huc"
> +		     "and verifying the copied result");
> +
> +	igt_subtest("huc-copy") {
> +		char inputs[HUC_COPY_DATA_BUF_SIZE];
> +		struct drm_i915_gem_exec_object2 obj[3];
> +
> +		/* Initialize src buffer randomly */
> +		srand(time(NULL));
> +		for (int i = 0; i < HUC_COPY_DATA_BUF_SIZE; i++)
> +			inputs[i] = (char) (rand() % 256);
> +
> +		memset(obj, 0, sizeof(obj));
> +		/* source buffer object for storing input */
> +		obj[0].handle = gem_create(drm_fd, HUC_COPY_DATA_BUF_SIZE);
> +		/* destination buffer object to receive input */
> +		obj[1].handle = gem_create(drm_fd, HUC_COPY_DATA_BUF_SIZE);
> +		/* execution buffer object */
> +		obj[2].handle = gem_create(drm_fd, 4096);
> +
> +		gem_write(drm_fd, obj[0].handle, 0, inputs, HUC_COPY_DATA_BUF_SIZE);
> +
> +		huc_copy(drm_fd, obj, 3);
> +		compare_huc_copy_result(drm_fd, obj[0].handle, obj[1].handle);
> +
> +		gem_close(drm_fd, obj[0].handle);
> +		gem_close(drm_fd, obj[1].handle);
> +		gem_close(drm_fd, obj[2].handle);
> +	}
> +
> +	igt_fixture
> +		close(drm_fd);
> +}
> diff --git a/tests/intel-ci/fast-feedback.testlist b/tests/intel-ci/fast-feedback.testlist
> index 2ccad438..f332d8ec 100644
> --- a/tests/intel-ci/fast-feedback.testlist
> +++ b/tests/intel-ci/fast-feedback.testlist
> @@ -30,6 +30,7 @@ igt@gem_flink_basic@bad-open
>   igt@gem_flink_basic@basic
>   igt@gem_flink_basic@double-flink
>   igt@gem_flink_basic@flink-lifetime
> +igt@gem_huc_copy@huc_copy
>   igt@gem_linear_blits@basic
>   igt@gem_mmap@basic
>   igt@gem_mmap_gtt@basic
> diff --git a/tests/meson.build b/tests/meson.build
> index e882f4dc..a4934a85 100644
> --- a/tests/meson.build
> +++ b/tests/meson.build
> @@ -163,6 +163,7 @@ i915_progs = [
>   	'gem_gtt_cpu_tlb',
>   	'gem_gtt_hog',
>   	'gem_gtt_speed',
> +	'gem_huc_copy',
>   	'gem_linear_blits',
>   	'gem_lut_handle',
>   	'gem_madvise',
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [igt-dev] [PATCH i-g-t v6] tests/i915/gem_huc_copy: Enable a HuC copy test
  2019-12-19 23:50 [igt-dev] [PATCH i-g-t] tests/i915/gem_huc_copy: Enable a HuC copy test Robert M. Fosha
                   ` (11 preceding siblings ...)
  2020-04-15 12:30 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
@ 2020-06-18 16:41 ` Robert M. Fosha
  2020-06-23 17:36   ` Argenziano, Antonio
  12 siblings, 1 reply; 25+ messages in thread
From: Robert M. Fosha @ 2020-06-18 16:41 UTC (permalink / raw)
  To: igt-dev; +Cc: Chris Wilson, Sally Qi

From: Sally Qi <feng.qi@intel.com>

This test case loads the HuC copy firmware to copy the content of
the source buffer to the destination buffer.

v2: (Tony Ye)
 * Restructured some functions and files.
 * Defined the copy buffer size as 4K explicitly as the HuC Copy kernel
   always copy 4K bytes from src buffer to dst buffer.

v3: (Feng Qi, Antonio Argenziano, Tony Ye)
 * Restructured some functions as igt requested, exclude libdrm function call.
 * Remove huc function wrappers
 * Random initialize source input buffer

v4: (Robert Fosha)
 * Fix autotools build failure.

v5: (Feng Qi, Tony Ye)
 * Released all bo buffer after huc copying.
 * Restructured huc_copy() function.

v6: (Feng Qi)
 * Fixed the function of huc enabling and status check
 * Added huc_copy to fast feedback testlist

v7: (Tony Ye, Feng Qi, Robert Fosha, Chris Wilson, Michal Wajdeczko)
 * Check error with HUC_STATUS ioctl instead of debugfs

v8: (Antonio Argenziano)
 * Remove unnecessary variable.
 * Add huc_load subtest.
 * Move failure checks out of igt_fixture.
 * get_huc_status() returns errno and then status as a parameter

Signed-off-by: Feng Qi <feng.qi@intel.com>
Signed-off-by: Tony Ye <tony.ye@intel.com>
Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Antonio Argenziano <antonio.argenziano@intel.com>
---
 lib/Makefile.sources                  |   2 +
 lib/huc_copy.c                        | 106 +++++++++++++++++++
 lib/huc_copy.h                        |  49 +++++++++
 lib/intel_batchbuffer.c               |  20 ++++
 lib/intel_batchbuffer.h               |  18 ++++
 lib/meson.build                       |   1 +
 tests/Makefile.sources                |   3 +
 tests/i915/gem_huc_copy.c             | 142 ++++++++++++++++++++++++++
 tests/intel-ci/fast-feedback.testlist |   2 +
 tests/meson.build                     |   1 +
 10 files changed, 344 insertions(+)
 create mode 100644 lib/huc_copy.c
 create mode 100644 lib/huc_copy.h
 create mode 100644 tests/i915/gem_huc_copy.c

diff --git a/lib/Makefile.sources b/lib/Makefile.sources
index 09aedb40..e87a66cc 100644
--- a/lib/Makefile.sources
+++ b/lib/Makefile.sources
@@ -88,6 +88,8 @@ lib_source_list =	 	\
 	ioctl_wrappers.h	\
 	media_fill.c		\
 	media_fill.h            \
+	huc_copy.c		\
+	huc_copy.h		\
 	media_spin.h		\
 	media_spin.c		\
 	gpgpu_fill.h		\
diff --git a/lib/huc_copy.c b/lib/huc_copy.c
new file mode 100644
index 00000000..bc98b1f9
--- /dev/null
+++ b/lib/huc_copy.c
@@ -0,0 +1,106 @@
+/*
+ * Copyright © 2019 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ *
+ */
+
+#include <i915_drm.h>
+#include "huc_copy.h"
+
+static void
+gen9_emit_huc_virtual_addr_state(struct drm_i915_gem_exec_object2 *src,
+		struct drm_i915_gem_exec_object2 *dst,
+		struct drm_i915_gem_relocation_entry *reloc_src,
+		struct drm_i915_gem_relocation_entry *reloc_dst,
+		uint32_t *buf,
+		int *i)
+{
+	buf[(*i)++] = HUC_VIRTUAL_ADDR_STATE;
+
+	for (int j = 0; j < HUC_VIRTUAL_ADDR_REGION_NUM; j++) {
+		if (j == HUC_VIRTUAL_ADDR_REGION_SRC) {
+			buf[(*i)++] = src->offset;
+
+			reloc_src->target_handle = src->handle;
+			reloc_src->delta = 0;
+			reloc_src->offset = (*i - 1) * sizeof(buf[0]);
+			reloc_src->read_domains = 0;
+			reloc_src->write_domain = 0;
+		} else if (j == HUC_VIRTUAL_ADDR_REGION_DST) {
+			buf[(*i)++] = dst->offset;
+
+			reloc_dst->target_handle = dst->handle;
+			reloc_dst->delta = 0;
+			reloc_dst->offset = (*i - 1) * sizeof(buf[0]);
+			reloc_dst->read_domains = 0;
+			reloc_dst->write_domain = I915_GEM_DOMAIN_RENDER;
+		} else {
+			buf[(*i)++] = 0;
+		}
+		buf[(*i)++] = 0;
+		buf[(*i)++] = 0;
+	}
+}
+
+void
+gen9_huc_copyfunc(int fd,
+		struct drm_i915_gem_exec_object2 *obj)
+{
+	struct drm_i915_gem_relocation_entry reloc[2];
+	struct drm_i915_gem_execbuffer2 execbuf;
+	int i = 0;
+	uint32_t buf[63];
+
+	/* 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;
+
+	memset(reloc, 0, sizeof(reloc));
+	gen9_emit_huc_virtual_addr_state(&obj[0], &obj[1], &reloc[0], &reloc[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));
+	obj[2].relocation_count = 2;
+	obj[2].relocs_ptr = to_user_pointer(reloc);
+
+	memset(&execbuf, 0, sizeof(execbuf));
+	execbuf.buffers_ptr = to_user_pointer(obj);
+	execbuf.buffer_count = 3;
+	execbuf.flags = I915_EXEC_BSD;
+
+	gem_execbuf(fd, &execbuf);
+}
diff --git a/lib/huc_copy.h b/lib/huc_copy.h
new file mode 100644
index 00000000..ac31d800
--- /dev/null
+++ b/lib/huc_copy.h
@@ -0,0 +1,49 @@
+/*
+ * Copyright © 2019 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ *
+ */
+
+#ifndef HUC_COPY_H
+#define HUC_COPY_H
+
+#include <stdint.h>
+#include <string.h>
+#include "ioctl_wrappers.h"
+#include "intel_reg.h"
+
+#define PARALLEL_VIDEO_PIPE		(0x3<<29)
+#define MFX_WAIT			(PARALLEL_VIDEO_PIPE|(0x1<<27)|(0x1<<8))
+
+#define HUC_IMEM_STATE			(PARALLEL_VIDEO_PIPE|(0x2<<27)|(0xb<<23)|(0x1<<16)|0x3)
+#define HUC_PIPE_MODE_SELECT		(PARALLEL_VIDEO_PIPE|(0x2<<27)|(0xb<<23)|0x1)
+#define HUC_START			(PARALLEL_VIDEO_PIPE|(0x2<<27)|(0xb<<23)|(0x21<<16))
+#define HUC_VIRTUAL_ADDR_STATE		(PARALLEL_VIDEO_PIPE|(0x2<<27)|(0xb<<23)|(0x4<<16)|0x2f)
+
+#define HUC_VIRTUAL_ADDR_REGION_NUM	16
+#define HUC_VIRTUAL_ADDR_REGION_SRC	0
+#define HUC_VIRTUAL_ADDR_REGION_DST	14
+
+void
+gen9_huc_copyfunc(int fd,
+		struct drm_i915_gem_exec_object2 *obj);
+
+#endif /* HUC_COPY_H */
diff --git a/lib/intel_batchbuffer.c b/lib/intel_batchbuffer.c
index 2a882627..808d3b5a 100644
--- a/lib/intel_batchbuffer.c
+++ b/lib/intel_batchbuffer.c
@@ -48,6 +48,7 @@
 #include "igt_aux.h"
 #include "igt_rand.h"
 #include "i830_reg.h"
+#include "huc_copy.h"
 
 #include <i915_drm.h>
 
@@ -1711,3 +1712,22 @@ bool intel_bb_object_offset_to_buf(struct intel_bb *ibb, struct intel_buf *buf)
 
 	return true;
 }
+
+/**
+ * igt_get_huc_copyfunc:
+ * @devid: pci device id
+ *
+ * Returns:
+ *
+ * The platform-specific huc copy function pointer for the device specified
+ * with @devid. Will return NULL when no media spin 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))
+		copy = gen9_huc_copyfunc;
+
+	return copy;
+}
diff --git a/lib/intel_batchbuffer.h b/lib/intel_batchbuffer.h
index 0649fc22..68db0281 100644
--- a/lib/intel_batchbuffer.h
+++ b/lib/intel_batchbuffer.h
@@ -529,4 +529,22 @@ void intel_bb_exec_with_context(struct intel_bb *ibb, uint32_t end_offset,
 uint64_t intel_bb_get_object_offset(struct intel_bb *ibb, uint32_t handle);
 bool intel_bb_object_offset_to_buf(struct intel_bb *ibb, struct intel_buf *buf);
 
+/**
+ * igt_huc_copyfunc_t:
+ * @fd: drm fd
+ * @obj: drm_i915_gem_exec_object2 buffer array
+ *       obj[0] is source buffer
+ *       obj[1] is destination buffer
+ *       obj[2] is execution buffer
+ *
+ * This is the type of the per-platform huc copy functions.
+ *
+ * The huc copy function emits a batchbuffer to the VDBOX engine to
+ * invoke the HuC Copy kernel to copy 4K bytes from the source buffer
+ * to the destination buffer.
+ */
+typedef void (*igt_huc_copyfunc_t)(int fd,
+		struct drm_i915_gem_exec_object2 *obj);
+
+igt_huc_copyfunc_t	igt_get_huc_copyfunc(int devid);
 #endif
diff --git a/lib/meson.build b/lib/meson.build
index 6cf78663..09481101 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -1,5 +1,6 @@
 lib_sources = [
 	'drmtest.c',
+	'huc_copy.c',
 	'i915/gem.c',
 	'i915/gem_context.c',
 	'i915/gem_engine_topology.c',
diff --git a/tests/Makefile.sources b/tests/Makefile.sources
index eaa6c0d0..d80c031e 100644
--- a/tests/Makefile.sources
+++ b/tests/Makefile.sources
@@ -319,6 +319,9 @@ gem_media_fill_SOURCES = i915/gem_media_fill.c
 TESTS_progs += gem_media_vme
 gem_media_vme_SOURCES = i915/gem_media_vme.c
 
+TESTS_progs += gem_huc_copy
+gem_huc_copy_SOURCES = i915/gem_huc_copy.c
+
 TESTS_progs += gem_mmap
 gem_mmap_SOURCES = i915/gem_mmap.c
 
diff --git a/tests/i915/gem_huc_copy.c b/tests/i915/gem_huc_copy.c
new file mode 100644
index 00000000..0c2d112d
--- /dev/null
+++ b/tests/i915/gem_huc_copy.c
@@ -0,0 +1,142 @@
+/*
+ * Copyright © 2019 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+#include "igt.h"
+#include <stdbool.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <sys/ioctl.h>
+#include <stdio.h>
+#include <string.h>
+#include <fcntl.h>
+#include <inttypes.h>
+#include <errno.h>
+#include <sys/stat.h>
+#include <sys/time.h>
+#include "drm.h"
+#include "i915/gem.h"
+
+IGT_TEST_DESCRIPTION("A very simple workload for the HuC.");
+
+#define HUC_COPY_DATA_BUF_SIZE	4096
+
+static void
+compare_huc_copy_result(int drm_fd, uint32_t src_handle, uint32_t dst_handle)
+{
+	char src_output[HUC_COPY_DATA_BUF_SIZE];
+	char dst_output[HUC_COPY_DATA_BUF_SIZE];
+
+	gem_read(drm_fd, src_handle, 0, src_output, HUC_COPY_DATA_BUF_SIZE);
+	gem_read(drm_fd, dst_handle, 0, dst_output, HUC_COPY_DATA_BUF_SIZE);
+
+	for (int i = 0; i < HUC_COPY_DATA_BUF_SIZE; i++)
+		igt_assert_f(src_output[i] == dst_output[i],
+			     "Exepected %c, found %c at %4d.\n",
+			     src_output[i], dst_output[i], i);
+}
+
+static int get_huc_status(int fd, int *status)
+{
+	drm_i915_getparam_t gp = {
+		.param = I915_PARAM_HUC_STATUS,
+		.value = status,
+	};
+
+	if (igt_ioctl(fd, DRM_IOCTL_I915_GETPARAM, &gp))
+		return -errno;
+
+	errno = 0;
+	return errno;
+}
+
+static void test_huc_load(int fd)
+{
+	int err;
+	int status = 0;
+
+	err = get_huc_status(fd, &status);
+	igt_skip_on_f(err == -ENODEV,
+		      "HuC is not present on this platform!\n");
+	igt_skip_on_f(err == -EOPNOTSUPP,
+		      "HuC firmware is disabled!\n");
+	igt_fail_on_f(err < 0, "HuC firmware loading error: %i, %s\n",
+		      -err, strerror(-err));
+	igt_fail_on_f(status == 0, "HuC firmware is not running!\n");
+}
+
+igt_main
+{
+	int drm_fd = -1;
+	uint32_t devid;
+	igt_huc_copyfunc_t huc_copy;
+
+	igt_fixture {
+		drm_fd = drm_open_driver(DRIVER_INTEL);
+		igt_require_gem(drm_fd);
+		devid = intel_get_drm_devid(drm_fd);
+		huc_copy = igt_get_huc_copyfunc(devid);
+
+		igt_require_f(huc_copy, "no huc_copy function\n");
+	}
+
+	igt_describe("Make sure that Huc has loaded"
+		     "successfully if enabled and"
+		     "present");
+
+	igt_subtest("huc-load")
+		test_huc_load(drm_fd);
+
+	igt_describe("Make sure that Huc firmware works"
+		     "by copying a char array using Huc"
+		     "and verifying the copied result");
+
+	igt_subtest("huc-copy") {
+		char inputs[HUC_COPY_DATA_BUF_SIZE];
+		struct drm_i915_gem_exec_object2 obj[3];
+
+		test_huc_load(drm_fd);
+		/* Initialize src buffer randomly */
+		srand(time(NULL));
+		for (int i = 0; i < HUC_COPY_DATA_BUF_SIZE; i++)
+			inputs[i] = (char) (rand() % 256);
+
+		memset(obj, 0, sizeof(obj));
+		/* source buffer object for storing input */
+		obj[0].handle = gem_create(drm_fd, HUC_COPY_DATA_BUF_SIZE);
+		/* destination buffer object to receive input */
+		obj[1].handle = gem_create(drm_fd, HUC_COPY_DATA_BUF_SIZE);
+		/* execution buffer object */
+		obj[2].handle = gem_create(drm_fd, 4096);
+
+		gem_write(drm_fd, obj[0].handle, 0, inputs, HUC_COPY_DATA_BUF_SIZE);
+
+		huc_copy(drm_fd, obj);
+		compare_huc_copy_result(drm_fd, obj[0].handle, obj[1].handle);
+
+		gem_close(drm_fd, obj[0].handle);
+		gem_close(drm_fd, obj[1].handle);
+		gem_close(drm_fd, obj[2].handle);
+	}
+
+	igt_fixture
+		close(drm_fd);
+}
diff --git a/tests/intel-ci/fast-feedback.testlist b/tests/intel-ci/fast-feedback.testlist
index 04f6affc..b23a884d 100644
--- a/tests/intel-ci/fast-feedback.testlist
+++ b/tests/intel-ci/fast-feedback.testlist
@@ -28,6 +28,8 @@ igt@gem_flink_basic@bad-open
 igt@gem_flink_basic@basic
 igt@gem_flink_basic@double-flink
 igt@gem_flink_basic@flink-lifetime
+igt@gem_huc_copy@huc_copy
+igt@gem_huc_copy@huc_load
 igt@gem_linear_blits@basic
 igt@gem_mmap@basic
 igt@gem_mmap_gtt@basic
diff --git a/tests/meson.build b/tests/meson.build
index e69bdb7d..5733d1e9 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -166,6 +166,7 @@ i915_progs = [
 	'gem_gtt_cpu_tlb',
 	'gem_gtt_hog',
 	'gem_gtt_speed',
+	'gem_huc_copy',
 	'gem_linear_blits',
 	'gem_lut_handle',
 	'gem_madvise',
-- 
2.21.0.5.gaeb582a983

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

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

* Re: [igt-dev] [PATCH i-g-t v6] tests/i915/gem_huc_copy: Enable a HuC copy test
  2020-06-18 16:41 ` [igt-dev] [PATCH i-g-t v6] tests/i915/gem_huc_copy: Enable a HuC copy test Robert M. Fosha
@ 2020-06-23 17:36   ` Argenziano, Antonio
  0 siblings, 0 replies; 25+ messages in thread
From: Argenziano, Antonio @ 2020-06-23 17:36 UTC (permalink / raw)
  To: Robert M. Fosha, igt-dev; +Cc: Chris Wilson, Sally Qi


On 6/18/2020 9:41 AM, Robert M. Fosha wrote:
> From: Sally Qi <feng.qi@intel.com>
>
> This test case loads the HuC copy firmware to copy the content of
> the source buffer to the destination buffer.
>
> v2: (Tony Ye)
>   * Restructured some functions and files.
>   * Defined the copy buffer size as 4K explicitly as the HuC Copy kernel
>     always copy 4K bytes from src buffer to dst buffer.
>
> v3: (Feng Qi, Antonio Argenziano, Tony Ye)
>   * Restructured some functions as igt requested, exclude libdrm function call.
>   * Remove huc function wrappers
>   * Random initialize source input buffer
>
> v4: (Robert Fosha)
>   * Fix autotools build failure.
>
> v5: (Feng Qi, Tony Ye)
>   * Released all bo buffer after huc copying.
>   * Restructured huc_copy() function.
>
> v6: (Feng Qi)
>   * Fixed the function of huc enabling and status check
>   * Added huc_copy to fast feedback testlist
>
> v7: (Tony Ye, Feng Qi, Robert Fosha, Chris Wilson, Michal Wajdeczko)
>   * Check error with HUC_STATUS ioctl instead of debugfs
>
> v8: (Antonio Argenziano)
>   * Remove unnecessary variable.
>   * Add huc_load subtest.
>   * Move failure checks out of igt_fixture.
>   * get_huc_status() returns errno and then status as a parameter
>
> Signed-off-by: Feng Qi <feng.qi@intel.com>
> Signed-off-by: Tony Ye <tony.ye@intel.com>
> Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Antonio Argenziano <antonio.argenziano@intel.com>
> ---
>   lib/Makefile.sources                  |   2 +
>   lib/huc_copy.c                        | 106 +++++++++++++++++++
>   lib/huc_copy.h                        |  49 +++++++++
>   lib/intel_batchbuffer.c               |  20 ++++
>   lib/intel_batchbuffer.h               |  18 ++++
>   lib/meson.build                       |   1 +
>   tests/Makefile.sources                |   3 +
>   tests/i915/gem_huc_copy.c             | 142 ++++++++++++++++++++++++++
>   tests/intel-ci/fast-feedback.testlist |   2 +
>   tests/meson.build                     |   1 +
>   10 files changed, 344 insertions(+)
>   create mode 100644 lib/huc_copy.c
>   create mode 100644 lib/huc_copy.h
>   create mode 100644 tests/i915/gem_huc_copy.c
>
> diff --git a/lib/Makefile.sources b/lib/Makefile.sources
> index 09aedb40..e87a66cc 100644
> --- a/lib/Makefile.sources
> +++ b/lib/Makefile.sources
> @@ -88,6 +88,8 @@ lib_source_list =	 	\
>   	ioctl_wrappers.h	\
>   	media_fill.c		\
>   	media_fill.h            \
> +	huc_copy.c		\
> +	huc_copy.h		\
>   	media_spin.h		\
>   	media_spin.c		\
>   	gpgpu_fill.h		\
> diff --git a/lib/huc_copy.c b/lib/huc_copy.c
> new file mode 100644
> index 00000000..bc98b1f9
> --- /dev/null
> +++ b/lib/huc_copy.c
> @@ -0,0 +1,106 @@
> +/*
> + * Copyright © 2019 Intel Corporation
> + *
> + * Permission is hereby granted, free of charge, to any person obtaining a
> + * copy of this software and associated documentation files (the "Software"),
> + * to deal in the Software without restriction, including without limitation
> + * the rights to use, copy, modify, merge, publish, distribute, sublicense,
> + * and/or sell copies of the Software, and to permit persons to whom the
> + * Software is furnished to do so, subject to the following conditions:
> + *
> + * The above copyright notice and this permission notice (including the next
> + * paragraph) shall be included in all copies or substantial portions of the
> + * Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
> + * IN THE SOFTWARE.
> + *
> + */
> +
> +#include <i915_drm.h>
> +#include "huc_copy.h"
> +
> +static void
> +gen9_emit_huc_virtual_addr_state(struct drm_i915_gem_exec_object2 *src,
> +		struct drm_i915_gem_exec_object2 *dst,
> +		struct drm_i915_gem_relocation_entry *reloc_src,
> +		struct drm_i915_gem_relocation_entry *reloc_dst,
> +		uint32_t *buf,
> +		int *i)
> +{
> +	buf[(*i)++] = HUC_VIRTUAL_ADDR_STATE;
> +
> +	for (int j = 0; j < HUC_VIRTUAL_ADDR_REGION_NUM; j++) {
> +		if (j == HUC_VIRTUAL_ADDR_REGION_SRC) {
> +			buf[(*i)++] = src->offset;
> +
> +			reloc_src->target_handle = src->handle;
> +			reloc_src->delta = 0;
> +			reloc_src->offset = (*i - 1) * sizeof(buf[0]);
> +			reloc_src->read_domains = 0;
> +			reloc_src->write_domain = 0;
> +		} else if (j == HUC_VIRTUAL_ADDR_REGION_DST) {
> +			buf[(*i)++] = dst->offset;
> +
> +			reloc_dst->target_handle = dst->handle;
> +			reloc_dst->delta = 0;
> +			reloc_dst->offset = (*i - 1) * sizeof(buf[0]);
> +			reloc_dst->read_domains = 0;
> +			reloc_dst->write_domain = I915_GEM_DOMAIN_RENDER;
> +		} else {
> +			buf[(*i)++] = 0;
> +		}
> +		buf[(*i)++] = 0;
> +		buf[(*i)++] = 0;
> +	}
> +}
> +
> +void
> +gen9_huc_copyfunc(int fd,
> +		struct drm_i915_gem_exec_object2 *obj)
> +{
> +	struct drm_i915_gem_relocation_entry reloc[2];
> +	struct drm_i915_gem_execbuffer2 execbuf;
> +	int i = 0;
> +	uint32_t buf[63];
> +
> +	/* 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;
> +
> +	memset(reloc, 0, sizeof(reloc));
> +	gen9_emit_huc_virtual_addr_state(&obj[0], &obj[1], &reloc[0], &reloc[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));
> +	obj[2].relocation_count = 2;
> +	obj[2].relocs_ptr = to_user_pointer(reloc);
> +
> +	memset(&execbuf, 0, sizeof(execbuf));
> +	execbuf.buffers_ptr = to_user_pointer(obj);
> +	execbuf.buffer_count = 3;
> +	execbuf.flags = I915_EXEC_BSD;
> +
> +	gem_execbuf(fd, &execbuf);
> +}
> diff --git a/lib/huc_copy.h b/lib/huc_copy.h
> new file mode 100644
> index 00000000..ac31d800
> --- /dev/null
> +++ b/lib/huc_copy.h
> @@ -0,0 +1,49 @@
> +/*
> + * Copyright © 2019 Intel Corporation
> + *
> + * Permission is hereby granted, free of charge, to any person obtaining a
> + * copy of this software and associated documentation files (the "Software"),
> + * to deal in the Software without restriction, including without limitation
> + * the rights to use, copy, modify, merge, publish, distribute, sublicense,
> + * and/or sell copies of the Software, and to permit persons to whom the
> + * Software is furnished to do so, subject to the following conditions:
> + *
> + * The above copyright notice and this permission notice (including the next
> + * paragraph) shall be included in all copies or substantial portions of the
> + * Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
> + * IN THE SOFTWARE.
> + *
> + */
> +
> +#ifndef HUC_COPY_H
> +#define HUC_COPY_H
> +
> +#include <stdint.h>
> +#include <string.h>
> +#include "ioctl_wrappers.h"
> +#include "intel_reg.h"
> +
> +#define PARALLEL_VIDEO_PIPE		(0x3<<29)
> +#define MFX_WAIT			(PARALLEL_VIDEO_PIPE|(0x1<<27)|(0x1<<8))
> +
> +#define HUC_IMEM_STATE			(PARALLEL_VIDEO_PIPE|(0x2<<27)|(0xb<<23)|(0x1<<16)|0x3)
> +#define HUC_PIPE_MODE_SELECT		(PARALLEL_VIDEO_PIPE|(0x2<<27)|(0xb<<23)|0x1)
> +#define HUC_START			(PARALLEL_VIDEO_PIPE|(0x2<<27)|(0xb<<23)|(0x21<<16))
> +#define HUC_VIRTUAL_ADDR_STATE		(PARALLEL_VIDEO_PIPE|(0x2<<27)|(0xb<<23)|(0x4<<16)|0x2f)
> +
> +#define HUC_VIRTUAL_ADDR_REGION_NUM	16
> +#define HUC_VIRTUAL_ADDR_REGION_SRC	0
> +#define HUC_VIRTUAL_ADDR_REGION_DST	14
> +
> +void
> +gen9_huc_copyfunc(int fd,
> +		struct drm_i915_gem_exec_object2 *obj);
> +
> +#endif /* HUC_COPY_H */
> diff --git a/lib/intel_batchbuffer.c b/lib/intel_batchbuffer.c
> index 2a882627..808d3b5a 100644
> --- a/lib/intel_batchbuffer.c
> +++ b/lib/intel_batchbuffer.c
> @@ -48,6 +48,7 @@
>   #include "igt_aux.h"
>   #include "igt_rand.h"
>   #include "i830_reg.h"
> +#include "huc_copy.h"
>   
>   #include <i915_drm.h>
>   
> @@ -1711,3 +1712,22 @@ bool intel_bb_object_offset_to_buf(struct intel_bb *ibb, struct intel_buf *buf)
>   
>   	return true;
>   }
> +
> +/**
> + * igt_get_huc_copyfunc:
> + * @devid: pci device id
> + *
> + * Returns:
> + *
> + * The platform-specific huc copy function pointer for the device specified
> + * with @devid. Will return NULL when no media spin 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))
> +		copy = gen9_huc_copyfunc;
> +
> +	return copy;
> +}
> diff --git a/lib/intel_batchbuffer.h b/lib/intel_batchbuffer.h
> index 0649fc22..68db0281 100644
> --- a/lib/intel_batchbuffer.h
> +++ b/lib/intel_batchbuffer.h
> @@ -529,4 +529,22 @@ void intel_bb_exec_with_context(struct intel_bb *ibb, uint32_t end_offset,
>   uint64_t intel_bb_get_object_offset(struct intel_bb *ibb, uint32_t handle);
>   bool intel_bb_object_offset_to_buf(struct intel_bb *ibb, struct intel_buf *buf);
>   
> +/**
> + * igt_huc_copyfunc_t:
> + * @fd: drm fd
> + * @obj: drm_i915_gem_exec_object2 buffer array
> + *       obj[0] is source buffer
> + *       obj[1] is destination buffer
> + *       obj[2] is execution buffer
> + *
> + * This is the type of the per-platform huc copy functions.
> + *
> + * The huc copy function emits a batchbuffer to the VDBOX engine to
> + * invoke the HuC Copy kernel to copy 4K bytes from the source buffer
> + * to the destination buffer.
> + */
> +typedef void (*igt_huc_copyfunc_t)(int fd,
> +		struct drm_i915_gem_exec_object2 *obj);
> +
> +igt_huc_copyfunc_t	igt_get_huc_copyfunc(int devid);
>   #endif
> diff --git a/lib/meson.build b/lib/meson.build
> index 6cf78663..09481101 100644
> --- a/lib/meson.build
> +++ b/lib/meson.build
> @@ -1,5 +1,6 @@
>   lib_sources = [
>   	'drmtest.c',
> +	'huc_copy.c',
>   	'i915/gem.c',
>   	'i915/gem_context.c',
>   	'i915/gem_engine_topology.c',
> diff --git a/tests/Makefile.sources b/tests/Makefile.sources
> index eaa6c0d0..d80c031e 100644
> --- a/tests/Makefile.sources
> +++ b/tests/Makefile.sources
> @@ -319,6 +319,9 @@ gem_media_fill_SOURCES = i915/gem_media_fill.c
>   TESTS_progs += gem_media_vme
>   gem_media_vme_SOURCES = i915/gem_media_vme.c
>   
> +TESTS_progs += gem_huc_copy
> +gem_huc_copy_SOURCES = i915/gem_huc_copy.c
> +
>   TESTS_progs += gem_mmap
>   gem_mmap_SOURCES = i915/gem_mmap.c
>   
> diff --git a/tests/i915/gem_huc_copy.c b/tests/i915/gem_huc_copy.c
> new file mode 100644
> index 00000000..0c2d112d
> --- /dev/null
> +++ b/tests/i915/gem_huc_copy.c
> @@ -0,0 +1,142 @@
> +/*
> + * Copyright © 2019 Intel Corporation
> + *
> + * Permission is hereby granted, free of charge, to any person obtaining a
> + * copy of this software and associated documentation files (the "Software"),
> + * to deal in the Software without restriction, including without limitation
> + * the rights to use, copy, modify, merge, publish, distribute, sublicense,
> + * and/or sell copies of the Software, and to permit persons to whom the
> + * Software is furnished to do so, subject to the following conditions:
> + *
> + * The above copyright notice and this permission notice (including the next
> + * paragraph) shall be included in all copies or substantial portions of the
> + * Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
> + * IN THE SOFTWARE.
> + */
> +#include "igt.h"
> +#include <stdbool.h>
> +#include <unistd.h>
> +#include <stdlib.h>
> +#include <sys/ioctl.h>
> +#include <stdio.h>
> +#include <string.h>
> +#include <fcntl.h>
> +#include <inttypes.h>
> +#include <errno.h>
> +#include <sys/stat.h>
> +#include <sys/time.h>
> +#include "drm.h"
> +#include "i915/gem.h"
> +
> +IGT_TEST_DESCRIPTION("A very simple workload for the HuC.");
> +
> +#define HUC_COPY_DATA_BUF_SIZE	4096
> +
> +static void
> +compare_huc_copy_result(int drm_fd, uint32_t src_handle, uint32_t dst_handle)
> +{
> +	char src_output[HUC_COPY_DATA_BUF_SIZE];
> +	char dst_output[HUC_COPY_DATA_BUF_SIZE];
> +
> +	gem_read(drm_fd, src_handle, 0, src_output, HUC_COPY_DATA_BUF_SIZE);
> +	gem_read(drm_fd, dst_handle, 0, dst_output, HUC_COPY_DATA_BUF_SIZE);
> +
> +	for (int i = 0; i < HUC_COPY_DATA_BUF_SIZE; i++)
> +		igt_assert_f(src_output[i] == dst_output[i],
> +			     "Exepected %c, found %c at %4d.\n",
> +			     src_output[i], dst_output[i], i);
> +}
> +
> +static int get_huc_status(int fd, int *status)
> +{
> +	drm_i915_getparam_t gp = {
> +		.param = I915_PARAM_HUC_STATUS,
> +		.value = status,
> +	};
> +
> +	if (igt_ioctl(fd, DRM_IOCTL_I915_GETPARAM, &gp))
> +		return -errno;
> +
> +	errno = 0;
> +	return errno;
> +}
> +
> +static void test_huc_load(int fd)
> +{
> +	int err;
> +	int status = 0;
> +
> +	err = get_huc_status(fd, &status);
> +	igt_skip_on_f(err == -ENODEV,
> +		      "HuC is not present on this platform!\n");
> +	igt_skip_on_f(err == -EOPNOTSUPP,
> +		      "HuC firmware is disabled!\n");
> +	igt_fail_on_f(err < 0, "HuC firmware loading error: %i, %s\n",
> +		      -err, strerror(-err));
> +	igt_fail_on_f(status == 0, "HuC firmware is not running!\n");
> +}
> +
> +igt_main
> +{
> +	int drm_fd = -1;
> +	uint32_t devid;
> +	igt_huc_copyfunc_t huc_copy;
> +
> +	igt_fixture {
> +		drm_fd = drm_open_driver(DRIVER_INTEL);
> +		igt_require_gem(drm_fd);
> +		devid = intel_get_drm_devid(drm_fd);
> +		huc_copy = igt_get_huc_copyfunc(devid);
> +
> +		igt_require_f(huc_copy, "no huc_copy function\n");
> +	}
> +
> +	igt_describe("Make sure that Huc has loaded"
> +		     "successfully if enabled and"
> +		     "present");
> +
> +	igt_subtest("huc-load")
> +		test_huc_load(drm_fd);


I think this ^ subtest might need still a bit of refinement in order to 
not rely too much on the kernel return code. Can we split it out so we 
can merge huc-copy and continue discussing this on another patch?


Rest LGTM,

Acked-by: Antonio Argenziano <antonio.argenziano@intel.com>


> +
> +	igt_describe("Make sure that Huc firmware works"
> +		     "by copying a char array using Huc"
> +		     "and verifying the copied result");
> +
> +	igt_subtest("huc-copy") {
> +		char inputs[HUC_COPY_DATA_BUF_SIZE];
> +		struct drm_i915_gem_exec_object2 obj[3];
> +
> +		test_huc_load(drm_fd);
> +		/* Initialize src buffer randomly */
> +		srand(time(NULL));
> +		for (int i = 0; i < HUC_COPY_DATA_BUF_SIZE; i++)
> +			inputs[i] = (char) (rand() % 256);
> +
> +		memset(obj, 0, sizeof(obj));
> +		/* source buffer object for storing input */
> +		obj[0].handle = gem_create(drm_fd, HUC_COPY_DATA_BUF_SIZE);
> +		/* destination buffer object to receive input */
> +		obj[1].handle = gem_create(drm_fd, HUC_COPY_DATA_BUF_SIZE);
> +		/* execution buffer object */
> +		obj[2].handle = gem_create(drm_fd, 4096);
> +
> +		gem_write(drm_fd, obj[0].handle, 0, inputs, HUC_COPY_DATA_BUF_SIZE);
> +
> +		huc_copy(drm_fd, obj);
> +		compare_huc_copy_result(drm_fd, obj[0].handle, obj[1].handle);
> +
> +		gem_close(drm_fd, obj[0].handle);
> +		gem_close(drm_fd, obj[1].handle);
> +		gem_close(drm_fd, obj[2].handle);
> +	}
> +
> +	igt_fixture
> +		close(drm_fd);
> +}
> diff --git a/tests/intel-ci/fast-feedback.testlist b/tests/intel-ci/fast-feedback.testlist
> index 04f6affc..b23a884d 100644
> --- a/tests/intel-ci/fast-feedback.testlist
> +++ b/tests/intel-ci/fast-feedback.testlist
> @@ -28,6 +28,8 @@ igt@gem_flink_basic@bad-open
>   igt@gem_flink_basic@basic
>   igt@gem_flink_basic@double-flink
>   igt@gem_flink_basic@flink-lifetime
> +igt@gem_huc_copy@huc_copy
> +igt@gem_huc_copy@huc_load
>   igt@gem_linear_blits@basic
>   igt@gem_mmap@basic
>   igt@gem_mmap_gtt@basic
> diff --git a/tests/meson.build b/tests/meson.build
> index e69bdb7d..5733d1e9 100644
> --- a/tests/meson.build
> +++ b/tests/meson.build
> @@ -166,6 +166,7 @@ i915_progs = [
>   	'gem_gtt_cpu_tlb',
>   	'gem_gtt_hog',
>   	'gem_gtt_speed',
> +	'gem_huc_copy',
>   	'gem_linear_blits',
>   	'gem_lut_handle',
>   	'gem_madvise',
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

end of thread, other threads:[~2020-06-23 17:36 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-19 23:50 [igt-dev] [PATCH i-g-t] tests/i915/gem_huc_copy: Enable a HuC copy test Robert M. Fosha
2019-12-20  0:34 ` [igt-dev] ✗ GitLab.Pipeline: warning for " Patchwork
2019-12-20  0:58 ` [igt-dev] ✓ Fi.CI.BAT: success " Patchwork
2019-12-20 22:11 ` [igt-dev] [PATCH i-g-t] " Antonio Argenziano
2019-12-20 22:41 ` [igt-dev] [PATCH i-g-t v2] " Robert M. Fosha
2019-12-23 22:19   ` [igt-dev] [PATCH i-g-t v3] " Robert M. Fosha
2020-01-10 17:41     ` [igt-dev] [PATCH i-g-t v4] " Robert M. Fosha
2020-01-10 18:28       ` Chris Wilson
2020-01-10 19:51         ` Ye, Tony
2020-01-10 19:54           ` Chris Wilson
2020-01-11  1:05             ` Ye, Tony
2020-01-16 23:56               ` Ye, Tony
2020-01-16 23:59                 ` Ye, Tony
2020-04-14 21:24       ` [igt-dev] [PATCH i-g-t v5] " Robert M. Fosha
2020-05-08 16:31         ` Argenziano, Antonio
2019-12-20 23:19 ` [igt-dev] ✗ GitLab.Pipeline: failure for tests/i915/gem_huc_copy: Enable a HuC copy test (rev2) Patchwork
2019-12-21  0:38 ` [igt-dev] ✗ Fi.CI.BAT: " Patchwork
2019-12-21  3:18 ` [igt-dev] ✓ Fi.CI.IGT: success for tests/i915/gem_huc_copy: Enable a HuC copy test Patchwork
2019-12-23 23:28 ` [igt-dev] ✗ Fi.CI.BAT: failure for tests/i915/gem_huc_copy: Enable a HuC copy test (rev3) Patchwork
2020-01-10 19:14 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/i915/gem_huc_copy: Enable a HuC copy test (rev4) Patchwork
2020-01-14 10:10 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2020-04-14 22:07 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/i915/gem_huc_copy: Enable a HuC copy test (rev5) Patchwork
2020-04-15 12:30 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2020-06-18 16:41 ` [igt-dev] [PATCH i-g-t v6] tests/i915/gem_huc_copy: Enable a HuC copy test Robert M. Fosha
2020-06-23 17:36   ` Argenziano, Antonio

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.