All of lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t v2 1/6] kms_content_protection: Fix log bug on 32-bit platforms.
@ 2018-11-15 18:57 Eric Anholt
  2018-11-15 18:57 ` [igt-dev] [PATCH i-g-t v2 2/6] meson: Drop -Wdeclaration-after-statement Eric Anholt
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: Eric Anholt @ 2018-11-15 18:57 UTC (permalink / raw)
  To: igt-dev

long is different between 32 and 64 and should basically never be
used.  Fixes compiler warning about passing the wrong type.

v2: Use the PRId64 macros instead of long long.

Signed-off-by: Eric Anholt <eric@anholt.net>
---
 tests/kms_content_protection.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tests/kms_content_protection.c b/tests/kms_content_protection.c
index 801eff66c272..ef90ed4c1792 100644
--- a/tests/kms_content_protection.c
+++ b/tests/kms_content_protection.c
@@ -89,7 +89,8 @@ wait_for_prop_value(igt_output_t *output, uint64_t expected,
 			return true;
 		usleep(1000);
 	}
-	igt_info("prop_value mismatch %ld != %ld\n", val, expected);
+	igt_info("prop_value mismatch %" PRId64 " != %" PRId64 "\n",
+		 val, expected);
 
 	return false;
 }
-- 
2.19.1

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

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

* [igt-dev] [PATCH i-g-t v2 2/6] meson: Drop -Wdeclaration-after-statement.
  2018-11-15 18:57 [igt-dev] [PATCH i-g-t v2 1/6] kms_content_protection: Fix log bug on 32-bit platforms Eric Anholt
@ 2018-11-15 18:57 ` Eric Anholt
  2018-11-15 18:57 ` [igt-dev] [PATCH i-g-t v2 3/6] v3d: Import the V3D DRM UAPI header Eric Anholt
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Eric Anholt @ 2018-11-15 18:57 UTC (permalink / raw)
  To: igt-dev

Being able to move declarations later is very useful in making clear,
concise code.

Signed-off-by: Eric Anholt <eric@anholt.net>
---
 meson.build | 1 -
 1 file changed, 1 deletion(-)

diff --git a/meson.build b/meson.build
index 469723dc4633..c5aab78716d5 100644
--- a/meson.build
+++ b/meson.build
@@ -11,7 +11,6 @@ cc = meson.get_compiler('c')
 
 cc_args = [
 	'-Wbad-function-cast',
-	'-Wdeclaration-after-statement',
 	'-Wformat=2',
 # igt_assert(0) in switch statements triggers a bunch of this.
 	'-Wimplicit-fallthrough=0',
-- 
2.19.1

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

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

* [igt-dev] [PATCH i-g-t v2 3/6] v3d: Import the V3D DRM UAPI header.
  2018-11-15 18:57 [igt-dev] [PATCH i-g-t v2 1/6] kms_content_protection: Fix log bug on 32-bit platforms Eric Anholt
  2018-11-15 18:57 ` [igt-dev] [PATCH i-g-t v2 2/6] meson: Drop -Wdeclaration-after-statement Eric Anholt
@ 2018-11-15 18:57 ` Eric Anholt
  2018-11-15 18:57 ` [igt-dev] [PATCH i-g-t v2 4/6] v3d: Add a helper library Eric Anholt
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Eric Anholt @ 2018-11-15 18:57 UTC (permalink / raw)
  To: igt-dev

Copied from make headers_install at drm-misc-next 783195ec1cad
("drm/syncobj: disable the timeline UAPI for now v2")

Signed-off-by: Eric Anholt <eric@anholt.net>
---
 include/drm-uapi/v3d_drm.h | 204 +++++++++++++++++++++++++++++++++++++
 1 file changed, 204 insertions(+)
 create mode 100644 include/drm-uapi/v3d_drm.h

diff --git a/include/drm-uapi/v3d_drm.h b/include/drm-uapi/v3d_drm.h
new file mode 100644
index 000000000000..f446656d00b1
--- /dev/null
+++ b/include/drm-uapi/v3d_drm.h
@@ -0,0 +1,204 @@
+/*
+ * Copyright © 2014-2018 Broadcom
+ *
+ * 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 _V3D_DRM_H_
+#define _V3D_DRM_H_
+
+#include "drm.h"
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+#define DRM_V3D_SUBMIT_CL                         0x00
+#define DRM_V3D_WAIT_BO                           0x01
+#define DRM_V3D_CREATE_BO                         0x02
+#define DRM_V3D_MMAP_BO                           0x03
+#define DRM_V3D_GET_PARAM                         0x04
+#define DRM_V3D_GET_BO_OFFSET                     0x05
+
+#define DRM_IOCTL_V3D_SUBMIT_CL           DRM_IOWR(DRM_COMMAND_BASE + DRM_V3D_SUBMIT_CL, struct drm_v3d_submit_cl)
+#define DRM_IOCTL_V3D_WAIT_BO             DRM_IOWR(DRM_COMMAND_BASE + DRM_V3D_WAIT_BO, struct drm_v3d_wait_bo)
+#define DRM_IOCTL_V3D_CREATE_BO           DRM_IOWR(DRM_COMMAND_BASE + DRM_V3D_CREATE_BO, struct drm_v3d_create_bo)
+#define DRM_IOCTL_V3D_MMAP_BO             DRM_IOWR(DRM_COMMAND_BASE + DRM_V3D_MMAP_BO, struct drm_v3d_mmap_bo)
+#define DRM_IOCTL_V3D_GET_PARAM           DRM_IOWR(DRM_COMMAND_BASE + DRM_V3D_GET_PARAM, struct drm_v3d_get_param)
+#define DRM_IOCTL_V3D_GET_BO_OFFSET       DRM_IOWR(DRM_COMMAND_BASE + DRM_V3D_GET_BO_OFFSET, struct drm_v3d_get_bo_offset)
+
+/**
+ * struct drm_v3d_submit_cl - ioctl argument for submitting commands to the 3D
+ * engine.
+ *
+ * This asks the kernel to have the GPU execute an optional binner
+ * command list, and a render command list.
+ */
+struct drm_v3d_submit_cl {
+	/* Pointer to the binner command list.
+	 *
+	 * This is the first set of commands executed, which runs the
+	 * coordinate shader to determine where primitives land on the screen,
+	 * then writes out the state updates and draw calls necessary per tile
+	 * to the tile allocation BO.
+	 *
+	 * This BCL will block on any previous BCL submitted on the
+	 * same FD, but not on any RCL or BCLs submitted by other
+	 * clients -- that is left up to the submitter to control
+	 * using in_sync_bcl if necessary.
+	 */
+	__u32 bcl_start;
+
+	 /** End address of the BCL (first byte after the BCL) */
+	__u32 bcl_end;
+
+	/* Offset of the render command list.
+	 *
+	 * This is the second set of commands executed, which will either
+	 * execute the tiles that have been set up by the BCL, or a fixed set
+	 * of tiles (in the case of RCL-only blits).
+	 *
+	 * This RCL will block on this submit's BCL, and any previous
+	 * RCL submitted on the same FD, but not on any RCL or BCLs
+	 * submitted by other clients -- that is left up to the
+	 * submitter to control using in_sync_rcl if necessary.
+	 */
+	__u32 rcl_start;
+
+	 /** End address of the RCL (first byte after the RCL) */
+	__u32 rcl_end;
+
+	/** An optional sync object to wait on before starting the BCL. */
+	__u32 in_sync_bcl;
+	/** An optional sync object to wait on before starting the RCL. */
+	__u32 in_sync_rcl;
+	/** An optional sync object to place the completion fence in. */
+	__u32 out_sync;
+
+	/* Offset of the tile alloc memory
+	 *
+	 * This is optional on V3D 3.3 (where the CL can set the value) but
+	 * required on V3D 4.1.
+	 */
+	__u32 qma;
+
+	/** Size of the tile alloc memory. */
+	__u32 qms;
+
+	/** Offset of the tile state data array. */
+	__u32 qts;
+
+	/* Pointer to a u32 array of the BOs that are referenced by the job.
+	 */
+	__u64 bo_handles;
+
+	/* Number of BO handles passed in (size is that times 4). */
+	__u32 bo_handle_count;
+
+	/* Pad, must be zero-filled. */
+	__u32 pad;
+};
+
+/**
+ * struct drm_v3d_wait_bo - ioctl argument for waiting for
+ * completion of the last DRM_V3D_SUBMIT_CL on a BO.
+ *
+ * This is useful for cases where multiple processes might be
+ * rendering to a BO and you want to wait for all rendering to be
+ * completed.
+ */
+struct drm_v3d_wait_bo {
+	__u32 handle;
+	__u32 pad;
+	__u64 timeout_ns;
+};
+
+/**
+ * struct drm_v3d_create_bo - ioctl argument for creating V3D BOs.
+ *
+ * There are currently no values for the flags argument, but it may be
+ * used in a future extension.
+ */
+struct drm_v3d_create_bo {
+	__u32 size;
+	__u32 flags;
+	/** Returned GEM handle for the BO. */
+	__u32 handle;
+	/**
+	 * Returned offset for the BO in the V3D address space.  This offset
+	 * is private to the DRM fd and is valid for the lifetime of the GEM
+	 * handle.
+	 *
+	 * This offset value will always be nonzero, since various HW
+	 * units treat 0 specially.
+	 */
+	__u32 offset;
+};
+
+/**
+ * struct drm_v3d_mmap_bo - ioctl argument for mapping V3D BOs.
+ *
+ * This doesn't actually perform an mmap.  Instead, it returns the
+ * offset you need to use in an mmap on the DRM device node.  This
+ * means that tools like valgrind end up knowing about the mapped
+ * memory.
+ *
+ * There are currently no values for the flags argument, but it may be
+ * used in a future extension.
+ */
+struct drm_v3d_mmap_bo {
+	/** Handle for the object being mapped. */
+	__u32 handle;
+	__u32 flags;
+	/** offset into the drm node to use for subsequent mmap call. */
+	__u64 offset;
+};
+
+enum drm_v3d_param {
+	DRM_V3D_PARAM_V3D_UIFCFG,
+	DRM_V3D_PARAM_V3D_HUB_IDENT1,
+	DRM_V3D_PARAM_V3D_HUB_IDENT2,
+	DRM_V3D_PARAM_V3D_HUB_IDENT3,
+	DRM_V3D_PARAM_V3D_CORE0_IDENT0,
+	DRM_V3D_PARAM_V3D_CORE0_IDENT1,
+	DRM_V3D_PARAM_V3D_CORE0_IDENT2,
+};
+
+struct drm_v3d_get_param {
+	__u32 param;
+	__u32 pad;
+	__u64 value;
+};
+
+/**
+ * Returns the offset for the BO in the V3D address space for this DRM fd.
+ * This is the same value returned by drm_v3d_create_bo, if that was called
+ * from this DRM fd.
+ */
+struct drm_v3d_get_bo_offset {
+	__u32 handle;
+	__u32 offset;
+};
+
+#if defined(__cplusplus)
+}
+#endif
+
+#endif /* _V3D_DRM_H_ */
-- 
2.19.1

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

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

* [igt-dev] [PATCH i-g-t v2 4/6] v3d: Add a helper library
  2018-11-15 18:57 [igt-dev] [PATCH i-g-t v2 1/6] kms_content_protection: Fix log bug on 32-bit platforms Eric Anholt
  2018-11-15 18:57 ` [igt-dev] [PATCH i-g-t v2 2/6] meson: Drop -Wdeclaration-after-statement Eric Anholt
  2018-11-15 18:57 ` [igt-dev] [PATCH i-g-t v2 3/6] v3d: Import the V3D DRM UAPI header Eric Anholt
@ 2018-11-15 18:57 ` Eric Anholt
  2018-11-15 18:57 ` [igt-dev] [PATCH i-g-t v2 5/6] v3d_*: Add new tests for the V3D UABI Eric Anholt
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Eric Anholt @ 2018-11-15 18:57 UTC (permalink / raw)
  To: igt-dev

Just a few little ioctl wrappers that v3d tests will use.

v2: Move the struct above the prototypes.

Signed-off-by: Eric Anholt <eric@anholt.net>
---
 lib/Makefile.sources |   2 +
 lib/drmtest.c        |   3 +
 lib/drmtest.h        |   1 +
 lib/igt_v3d.c        | 130 +++++++++++++++++++++++++++++++++++++++++++
 lib/igt_v3d.h        |  46 +++++++++++++++
 lib/meson.build      |   1 +
 6 files changed, 183 insertions(+)
 create mode 100644 lib/igt_v3d.c
 create mode 100644 lib/igt_v3d.h

diff --git a/lib/Makefile.sources b/lib/Makefile.sources
index e98989ff8ed9..808b9617eca2 100644
--- a/lib/Makefile.sources
+++ b/lib/Makefile.sources
@@ -107,6 +107,8 @@ lib_source_list =	 	\
 	igt_syncobj.h		\
 	igt_psr.c		\
 	igt_psr.h		\
+	igt_v3d.c		\
+	igt_v3d.h		\
 	$(NULL)
 
 .PHONY: version.h.tmp
diff --git a/lib/drmtest.c b/lib/drmtest.c
index fee9d33ad2a5..d2aa1c19154f 100644
--- a/lib/drmtest.c
+++ b/lib/drmtest.c
@@ -202,6 +202,7 @@ static const struct module {
 } modules[] = {
 	{ DRIVER_AMDGPU, "amdgpu" },
 	{ DRIVER_INTEL, "i915", modprobe_i915 },
+	{ DRIVER_V3D, "v3d" },
 	{ DRIVER_VC4, "vc4" },
 	{ DRIVER_VGEM, "vgem" },
 	{ DRIVER_VIRTIO, "virtio-gpu" },
@@ -340,6 +341,8 @@ static const char *chipset_to_str(int chipset)
 	switch (chipset) {
 	case DRIVER_INTEL:
 		return "intel";
+	case DRIVER_V3D:
+		return "v3d";
 	case DRIVER_VC4:
 		return "vc4";
 	case DRIVER_VGEM:
diff --git a/lib/drmtest.h b/lib/drmtest.h
index 949865ee54dd..96ee517e2ec1 100644
--- a/lib/drmtest.h
+++ b/lib/drmtest.h
@@ -43,6 +43,7 @@
 #define DRIVER_VGEM	(1 << 2)
 #define DRIVER_VIRTIO	(1 << 3)
 #define DRIVER_AMDGPU	(1 << 4)
+#define DRIVER_V3D	(1 << 5)
 /*
  * Exclude DRVER_VGEM from DRIVER_ANY since if you run on a system
  * with vgem as well as a supported driver, you can end up with a
diff --git a/lib/igt_v3d.c b/lib/igt_v3d.c
new file mode 100644
index 000000000000..1a5ede1bd5fc
--- /dev/null
+++ b/lib/igt_v3d.c
@@ -0,0 +1,130 @@
+/*
+ * Copyright © 2016 Broadcom
+ *
+ * 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 <assert.h>
+#include <string.h>
+#include <signal.h>
+#include <errno.h>
+#include <sys/mman.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/ioctl.h>
+#include <fcntl.h>
+
+#include "drmtest.h"
+#include "igt_aux.h"
+#include "igt_core.h"
+#include "igt_v3d.h"
+#include "ioctl_wrappers.h"
+#include "intel_reg.h"
+#include "intel_chipset.h"
+#include "v3d_drm.h"
+
+#if NEW_CONTEXT_PARAM_NO_ERROR_CAPTURE_API
+#define LOCAL_CONTEXT_PARAM_NO_ERROR_CAPTURE 0x4
+#endif
+
+/**
+ * SECTION:igt_v3d
+ * @short_description: V3D support library
+ * @title: V3D
+ * @include: igt.h
+ *
+ * This library provides various auxiliary helper functions for writing V3D
+ * tests.
+ */
+
+struct v3d_bo *
+igt_v3d_create_bo(int fd, size_t size)
+{
+	struct v3d_bo *bo = calloc(1, sizeof(*bo));
+
+	struct drm_v3d_create_bo create = {
+		.size = size,
+	};
+
+	do_ioctl(fd, DRM_IOCTL_V3D_CREATE_BO, &create);
+
+	bo->handle = create.handle;
+	bo->offset = create.offset;
+	bo->size = size;
+
+	return bo;
+}
+
+void
+igt_v3d_free_bo(int fd, struct v3d_bo *bo)
+{
+	if (bo->map)
+		munmap(bo->map, bo->size);
+	gem_close(fd, bo->handle);
+	free(bo);
+}
+
+uint32_t
+igt_v3d_get_bo_offset(int fd, uint32_t handle)
+{
+	struct drm_v3d_get_bo_offset get = {
+		.handle = handle,
+	};
+
+	do_ioctl(fd, DRM_IOCTL_V3D_GET_BO_OFFSET, &get);
+
+	return get.offset;
+}
+
+uint32_t
+igt_v3d_get_param(int fd, enum drm_v3d_param param)
+{
+	struct drm_v3d_get_param get = {
+		.param = param,
+	};
+
+	do_ioctl(fd, DRM_IOCTL_V3D_GET_PARAM, &get);
+
+	return get.value;
+}
+
+void *
+igt_v3d_mmap_bo(int fd, uint32_t handle, uint32_t size, unsigned prot)
+{
+	struct drm_v3d_mmap_bo mmap_bo = {
+		.handle = handle,
+	};
+	void *ptr;
+
+	do_ioctl(fd, DRM_IOCTL_V3D_MMAP_BO, &mmap_bo);
+
+	ptr = mmap(0, size, prot, MAP_SHARED, fd, mmap_bo.offset);
+	if (ptr == MAP_FAILED)
+		return NULL;
+	else
+		return ptr;
+}
+
+void igt_v3d_bo_mmap(int fd, struct v3d_bo *bo)
+{
+	bo->map = igt_v3d_mmap_bo(fd, bo->handle, bo->size,
+				  PROT_READ | PROT_WRITE);
+	igt_assert(bo->map);
+}
diff --git a/lib/igt_v3d.h b/lib/igt_v3d.h
new file mode 100644
index 000000000000..2042995103cc
--- /dev/null
+++ b/lib/igt_v3d.h
@@ -0,0 +1,46 @@
+/*
+ * Copyright © 2016 Broadcom
+ *
+ * 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 IGT_V3D_H
+#define IGT_V3D_H
+
+#include "v3d_drm.h"
+
+struct v3d_bo {
+	int handle;
+	uint32_t offset;
+	uint32_t size;
+	void *map;
+};
+
+struct v3d_bo *igt_v3d_create_bo(int fd, size_t size);
+void igt_v3d_free_bo(int fd, struct v3d_bo *bo);
+
+/* IOCTL wrappers */
+uint32_t igt_v3d_get_bo_offset(int fd, uint32_t handle);
+uint32_t igt_v3d_get_param(int fd, enum drm_v3d_param param);
+void *igt_v3d_mmap_bo(int fd, uint32_t handle, uint32_t size, unsigned prot);
+
+void igt_v3d_bo_mmap(int fd, struct v3d_bo *bo);
+
+#endif /* IGT_V3D_H */
diff --git a/lib/meson.build b/lib/meson.build
index 8961ca494af8..19f5d51ceead 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -48,6 +48,7 @@ lib_sources = [
 	'igt_dummyload.c',
 	'uwildmat/uwildmat.c',
 	'igt_kmod.c',
+	'igt_v3d.c',
 	'igt_vc4.c',
 	'igt_psr.c',
 ]
-- 
2.19.1

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

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

* [igt-dev] [PATCH i-g-t v2 5/6] v3d_*: Add new tests for the V3D UABI.
  2018-11-15 18:57 [igt-dev] [PATCH i-g-t v2 1/6] kms_content_protection: Fix log bug on 32-bit platforms Eric Anholt
                   ` (2 preceding siblings ...)
  2018-11-15 18:57 ` [igt-dev] [PATCH i-g-t v2 4/6] v3d: Add a helper library Eric Anholt
@ 2018-11-15 18:57 ` Eric Anholt
  2018-11-15 18:57 ` [igt-dev] [PATCH i-g-t v2 6/6] v3d: Add tests for hanging V3D using an RCL Eric Anholt
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Eric Anholt @ 2018-11-15 18:57 UTC (permalink / raw)
  To: igt-dev

These are basic non-rendering tests of the UABI.

Signed-off-by: Eric Anholt <eric@anholt.net>
---
 lib/igt_v3d.c             |  4 --
 tests/Makefile.am         |  2 +
 tests/Makefile.sources    |  6 +++
 tests/meson.build         |  3 ++
 tests/v3d_ci/README       | 26 +++++++++++++
 tests/v3d_ci/v3d.testlist |  6 +++
 tests/v3d_get_bo_offset.c | 78 ++++++++++++++++++++++++++++++++++++++
 tests/v3d_get_param.c     | 80 +++++++++++++++++++++++++++++++++++++++
 tests/v3d_mmap.c          | 55 +++++++++++++++++++++++++++
 9 files changed, 256 insertions(+), 4 deletions(-)
 create mode 100644 tests/v3d_ci/README
 create mode 100644 tests/v3d_ci/v3d.testlist
 create mode 100644 tests/v3d_get_bo_offset.c
 create mode 100644 tests/v3d_get_param.c
 create mode 100644 tests/v3d_mmap.c

diff --git a/lib/igt_v3d.c b/lib/igt_v3d.c
index 1a5ede1bd5fc..619c072c0e47 100644
--- a/lib/igt_v3d.c
+++ b/lib/igt_v3d.c
@@ -40,10 +40,6 @@
 #include "intel_chipset.h"
 #include "v3d_drm.h"
 
-#if NEW_CONTEXT_PARAM_NO_ERROR_CAPTURE_API
-#define LOCAL_CONTEXT_PARAM_NO_ERROR_CAPTURE 0x4
-#endif
-
 /**
  * SECTION:igt_v3d
  * @short_description: V3D support library
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 3d1ce0bc1af8..a6b2ba51ea4f 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -14,6 +14,8 @@ if BUILD_VC4
     TESTS_progs += $(VC4_TESTS)
 endif
 
+TESTS_progs += $(V3D_TESTS)
+
 if HAVE_CHAMELIUM
 TESTS_progs += \
 	kms_chamelium \
diff --git a/tests/Makefile.sources b/tests/Makefile.sources
index d007ebc74ab9..3ed60e7c30c7 100644
--- a/tests/Makefile.sources
+++ b/tests/Makefile.sources
@@ -15,6 +15,12 @@ VC4_TESTS = \
 	vc4_wait_seqno \
 	$(NULL)
 
+V3D_TESTS = \
+	v3d_get_bo_offset \
+	v3d_get_param \
+	v3d_mmap \
+	$(NULL)
+
 AMDGPU_TESTS = \
 	amdgpu/amd_basic \
 	amdgpu/amd_cs_nop \
diff --git a/tests/meson.build b/tests/meson.build
index 3020f7984d7a..4472536aef65 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -85,6 +85,9 @@ test_progs = [
 	'syncobj_wait',
 	'template',
 	'tools_test',
+	'v3d_get_bo_offset',
+	'v3d_get_param',
+	'v3d_mmap',
 	'vc4_create_bo',
 	'vc4_dmabuf_poll',
 	'vc4_label_bo',
diff --git a/tests/v3d_ci/README b/tests/v3d_ci/README
new file mode 100644
index 000000000000..e03c552fb972
--- /dev/null
+++ b/tests/v3d_ci/README
@@ -0,0 +1,26 @@
+This directory contains test lists to be used for v3d's DRM support. The files
+are passed to piglit with the --test-list parameter directly.
+
+The test lists are contained in the IGT repository for several
+reasons:
+
+- The lists stay synchronized with the IGT codebase.
+- Public availability. Kernel developers can see what tests are run,
+  and can see what changes are done to the set, when, and why.
+- Explicit test lists in general make it possible to implement a new
+  test without having it run by everyone else before the tests and / or setup
+  are ready for it.
+
+Changing the test lists should only happen with approval from the v3d
+maintainer, Eric Anholt (eric@anholt.net).
+
+============
+v3d.testlist
+============
+
+This test list is meant as a general test suite without any time
+restriction for the v3d DRM driver, combining generic DRM and KMS
+tests.  As a reminder, you can run this with the meson build using:
+
+./build/runner/igt_runner --test-list tests/v3d_ci/v3d.testlist \
+  build/tests -o results
diff --git a/tests/v3d_ci/v3d.testlist b/tests/v3d_ci/v3d.testlist
new file mode 100644
index 000000000000..b55e8e571d7d
--- /dev/null
+++ b/tests/v3d_ci/v3d.testlist
@@ -0,0 +1,6 @@
+igt@v3d_get_bo_offset@create-get-offsets
+igt@v3d_get_bo_offset@get-bad-handle
+igt@v3d_get_param@base-params
+igt@v3d_get_param@get-bad-param
+igt@v3d_get_param@get-bad-flags
+igt@v3d_mmap@mmap-bad-handle
diff --git a/tests/v3d_get_bo_offset.c b/tests/v3d_get_bo_offset.c
new file mode 100644
index 000000000000..0923dc85f0d0
--- /dev/null
+++ b/tests/v3d_get_bo_offset.c
@@ -0,0 +1,78 @@
+/*
+ * Copyright © 2017 Broadcom
+ *
+ * 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 "igt_v3d.h"
+#include <unistd.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <fcntl.h>
+#include <inttypes.h>
+#include <errno.h>
+#include <sys/stat.h>
+#include <sys/ioctl.h>
+#include <poll.h>
+#include "v3d_drm.h"
+#include "igt_v3d.h"
+
+igt_main
+{
+	int fd;
+
+	igt_fixture
+		fd = drm_open_driver(DRIVER_V3D);
+
+	igt_subtest("create-get-offsets") {
+		struct v3d_bo *bos[2] = {
+			igt_v3d_create_bo(fd, 4096),
+			igt_v3d_create_bo(fd, 4096),
+		};
+		uint32_t offsets[2] = {
+			igt_v3d_get_bo_offset(fd, bos[0]->handle),
+			igt_v3d_get_bo_offset(fd, bos[1]->handle),
+		};
+
+		igt_assert_neq(bos[0]->handle, bos[1]->handle);
+		igt_assert_neq(bos[0]->offset, bos[1]->offset);
+		igt_assert_eq(bos[0]->offset, offsets[0]);
+		igt_assert_eq(bos[1]->offset, offsets[1]);
+
+		/* 0 is an invalid offset for BOs to be placed at. */
+		igt_assert_neq(bos[0]->offset, 0);
+		igt_assert_neq(bos[1]->offset, 0);
+
+		igt_v3d_free_bo(fd, bos[0]);
+		igt_v3d_free_bo(fd, bos[1]);
+	}
+
+	igt_subtest("get-bad-handle") {
+		struct drm_v3d_get_bo_offset get = {
+			.handle = 0xd0d0d0d0,
+		};
+		do_ioctl_err(fd, DRM_IOCTL_V3D_GET_BO_OFFSET, &get, ENOENT);
+	}
+
+	igt_fixture
+		close(fd);
+}
diff --git a/tests/v3d_get_param.c b/tests/v3d_get_param.c
new file mode 100644
index 000000000000..76563406c0a1
--- /dev/null
+++ b/tests/v3d_get_param.c
@@ -0,0 +1,80 @@
+/*
+ * Copyright © 2017 Broadcom
+ *
+ * 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 "igt_v3d.h"
+#include <unistd.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <fcntl.h>
+#include <inttypes.h>
+#include <errno.h>
+#include <sys/stat.h>
+#include <sys/ioctl.h>
+#include <poll.h>
+#include "v3d_drm.h"
+#include "igt_v3d.h"
+
+igt_main
+{
+	int fd;
+
+	igt_fixture
+		fd = drm_open_driver(DRIVER_V3D);
+
+	igt_subtest("base-params") {
+		enum drm_v3d_param last_base_param =
+			DRM_V3D_PARAM_V3D_CORE0_IDENT2;
+
+		uint32_t results[last_base_param];
+
+		for (int i = 0; i < ARRAY_SIZE(results); i++)
+			results[i] = igt_v3d_get_param(fd, i);
+
+		/* HUB TVER field */
+		igt_assert_lte(3, results[DRM_V3D_PARAM_V3D_HUB_IDENT1] & 0xf);
+
+		/* CORE's ident, has VER field but also an ID. */
+		igt_assert_eq(results[DRM_V3D_PARAM_V3D_CORE0_IDENT0] & 0xffffff,
+			      0x443356 /* "V3D" */);
+	}
+
+	igt_subtest("get-bad-param") {
+		struct drm_v3d_get_param get = {
+			.param = 0xd0d0d0d0,
+		};
+		do_ioctl_err(fd, DRM_IOCTL_V3D_GET_PARAM, &get, EINVAL);
+	}
+
+	igt_subtest("get-bad-flags") {
+		struct drm_v3d_get_param get = {
+			.param = DRM_V3D_PARAM_V3D_HUB_IDENT1,
+			.pad = 1,
+		};
+		do_ioctl_err(fd, DRM_IOCTL_V3D_GET_PARAM, &get, EINVAL);
+	}
+
+	igt_fixture
+		close(fd);
+}
diff --git a/tests/v3d_mmap.c b/tests/v3d_mmap.c
new file mode 100644
index 000000000000..a6fe7e5a7322
--- /dev/null
+++ b/tests/v3d_mmap.c
@@ -0,0 +1,55 @@
+/*
+ * Copyright © 2017 Broadcom
+ *
+ * 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 "igt_v3d.h"
+#include <unistd.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <fcntl.h>
+#include <inttypes.h>
+#include <errno.h>
+#include <sys/stat.h>
+#include <sys/ioctl.h>
+#include <poll.h>
+#include "v3d_drm.h"
+#include "igt_v3d.h"
+
+igt_main
+{
+	int fd;
+
+	igt_fixture
+		fd = drm_open_driver(DRIVER_V3D);
+
+	igt_subtest("mmap-bad-handle") {
+		struct drm_v3d_mmap_bo get = {
+			.handle = 0xd0d0d0d0,
+		};
+		do_ioctl_err(fd, DRM_IOCTL_V3D_MMAP_BO, &get, ENOENT);
+	}
+
+	igt_fixture
+		close(fd);
+}
-- 
2.19.1

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

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

* [igt-dev] [PATCH i-g-t v2 6/6] v3d: Add tests for hanging V3D using an RCL.
  2018-11-15 18:57 [igt-dev] [PATCH i-g-t v2 1/6] kms_content_protection: Fix log bug on 32-bit platforms Eric Anholt
                   ` (3 preceding siblings ...)
  2018-11-15 18:57 ` [igt-dev] [PATCH i-g-t v2 5/6] v3d_*: Add new tests for the V3D UABI Eric Anholt
@ 2018-11-15 18:57 ` Eric Anholt
  2018-11-15 19:41 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,v2,1/6] kms_content_protection: Fix log bug on 32-bit platforms Patchwork
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Eric Anholt @ 2018-11-15 18:57 UTC (permalink / raw)
  To: igt-dev

drm-misc-next recently regressed GPU hang recovery, and these
reproduce those bugs.

Signed-off-by: Eric Anholt <eric@anholt.net>
---
 lib/igt_v3d.c                        | 126 +++++++++++++++++++++++++++
 lib/igt_v3d.h                        |  38 ++++++++
 tests/meson.build                    |   1 +
 tests/v3d_ci/v3d.testlist            |   2 +
 lib/igt_v3d.h => tests/v3d_cl_hang.c |  61 +++++++++----
 5 files changed, 211 insertions(+), 17 deletions(-)
 copy lib/igt_v3d.h => tests/v3d_cl_hang.c (56%)

diff --git a/lib/igt_v3d.c b/lib/igt_v3d.c
index 619c072c0e47..9a9f32e0ced4 100644
--- a/lib/igt_v3d.c
+++ b/lib/igt_v3d.c
@@ -124,3 +124,129 @@ void igt_v3d_bo_mmap(int fd, struct v3d_bo *bo)
 				  PROT_READ | PROT_WRITE);
 	igt_assert(bo->map);
 }
+
+void *
+igt_v3d_wait_bo(int fd, uint32_t handle)
+{
+	struct drm_v3d_wait_bo wait_bo = {
+		.handle = handle,
+		.timeout_ns = ~0ull,
+	};
+
+	do_ioctl(fd, DRM_IOCTL_V3D_WAIT_BO, &wait_bo);
+
+	return 0;
+}
+
+void igt_v3d_bo_wait(int fd, struct v3d_bo *bo)
+{
+	igt_v3d_wait_bo(fd, bo->handle);
+}
+
+struct v3d_cl *
+igt_v3d_cl_create(int fd, size_t size)
+{
+	struct v3d_cl *cl = calloc(1, sizeof(*cl));
+
+	cl->fd = fd;
+	cl->bo = igt_v3d_create_bo(fd, size);
+	v3d_cl_reference_bo(cl, cl->bo);
+
+	igt_v3d_bo_mmap(fd, cl->bo);
+	cl->next = cl->bo->map;
+
+	return cl;
+}
+
+/** Creates a simple CL consisting of a single NOP instruction. */
+struct v3d_cl *
+igt_v3d_cl_create_nop(int fd)
+{
+	struct v3d_cl *cl = igt_v3d_cl_create(fd, 1);
+        uint8_t nop_opcode = 1;
+
+	memcpy(cl->next, &nop_opcode, 1);
+	cl->next++;
+
+	return cl;
+}
+
+/**
+ * Creates a simple CL consisting of an infinite loop branching to itself.
+ */
+struct v3d_cl *
+igt_v3d_cl_create_infinite_loop(int fd)
+{
+	struct v3d_cl *cl = igt_v3d_cl_create(fd, 5);
+        uint8_t branch_opcode = 16;
+
+	memcpy(cl->next, &branch_opcode, 1);
+	cl->next++;
+
+	memcpy(cl->next, &cl->bo->offset, 4);
+	cl->next += 4;
+
+	return cl;
+}
+
+void
+igt_v3d_cl_free(struct v3d_cl *cl)
+{
+	igt_v3d_free_bo(cl->fd, cl->bo);
+	free(cl);
+}
+
+void
+igt_v3d_submit_cl(int fd, struct drm_v3d_submit_cl *submit)
+{
+	do_ioctl(fd, DRM_IOCTL_V3D_SUBMIT_CL, submit);
+}
+
+void
+igt_v3d_submit_rcl(struct v3d_cl *rcl)
+{
+	struct drm_v3d_submit_cl submit = {
+		.rcl_start = rcl->bo->offset,
+		.rcl_end = rcl->bo->offset + cl_offset(rcl),
+		.bo_handles = (uintptr_t)rcl->handles,
+		.bo_handle_count = rcl->handle_count,
+	};
+	igt_v3d_submit_cl(rcl->fd, &submit);
+}
+
+static bool
+handle_in_list(uint32_t *handles, int handle_count, int handle)
+{
+	for (int i = 0; i < handle_count; i++) {
+		if (handles[i] == handle)
+			return true;
+	}
+	return false;
+}
+
+void
+igt_v3d_submit_bcl_and_rcl(struct v3d_cl *bcl, struct v3d_cl *rcl)
+{
+	uint32_t handles[32];
+	int handle_count = 0;
+
+	/* Merge the two incoming handle lists. */
+	igt_assert(rcl->handle_count + bcl->handle_count <= ARRAY_SIZE(handles));
+	for (int i = 0; i < rcl->handle_count; i++)
+		handles[handle_count++] = rcl->handles[i];
+
+	for (int i = 0; i < bcl->handle_count; i++) {
+		if (!handle_in_list(handles, handle_count, bcl->handles[i]))
+			handles[handle_count++] = bcl->handles[i];
+	}
+
+	struct drm_v3d_submit_cl submit = {
+		.rcl_start = rcl->bo->offset,
+		.rcl_end = rcl->bo->offset + cl_offset(rcl),
+		.bcl_start = bcl->bo->offset,
+		.bcl_end = bcl->bo->offset + cl_offset(bcl),
+		.bo_handles = (uintptr_t)handles,
+		.bo_handle_count = handle_count,
+	};
+	igt_v3d_submit_cl(rcl->fd, &submit);
+}
diff --git a/lib/igt_v3d.h b/lib/igt_v3d.h
index 2042995103cc..7ddbee36a547 100644
--- a/lib/igt_v3d.h
+++ b/lib/igt_v3d.h
@@ -33,6 +33,15 @@ struct v3d_bo {
 	void *map;
 };
 
+struct v3d_cl {
+	int fd;
+	struct v3d_bo *bo;
+	void *next;
+
+	uint32_t handles[32];
+	uint32_t handle_count;
+};
+
 struct v3d_bo *igt_v3d_create_bo(int fd, size_t size);
 void igt_v3d_free_bo(int fd, struct v3d_bo *bo);
 
@@ -40,7 +49,36 @@ void igt_v3d_free_bo(int fd, struct v3d_bo *bo);
 uint32_t igt_v3d_get_bo_offset(int fd, uint32_t handle);
 uint32_t igt_v3d_get_param(int fd, enum drm_v3d_param param);
 void *igt_v3d_mmap_bo(int fd, uint32_t handle, uint32_t size, unsigned prot);
+void *igt_v3d_wait_bo(int fd, uint32_t handle);
+void igt_v3d_submit_cl(int fd, struct drm_v3d_submit_cl *submit);
+void igt_v3d_submit_rcl(struct v3d_cl *rcl);
+void igt_v3d_submit_bcl_and_rcl(struct v3d_cl *bcl, struct v3d_cl *rcl);
 
 void igt_v3d_bo_mmap(int fd, struct v3d_bo *bo);
+void igt_v3d_bo_wait(int fd, struct v3d_bo *bo);
+
+static inline void v3d_cl_reference_bo(struct v3d_cl *cl,
+				       const struct v3d_bo *bo)
+{
+	if (!bo)
+		return;
+
+	for (int i = 0; i < cl->handle_count; i++) {
+		if (cl->handles[i] == bo->handle)
+			return;
+	}
+
+	cl->handles[cl->handle_count++] = bo->handle;
+}
+
+static inline uint32_t cl_offset(struct v3d_cl *cl)
+{
+	return (char *)cl->next - (char *)cl->bo->map;
+}
+
+struct v3d_cl *igt_v3d_cl_create(int fd, size_t size);
+struct v3d_cl *igt_v3d_cl_create_infinite_loop(int fd);
+struct v3d_cl *igt_v3d_cl_create_nop(int fd);
+void igt_v3d_cl_free(struct v3d_cl *cl);
 
 #endif /* IGT_V3D_H */
diff --git a/tests/meson.build b/tests/meson.build
index 4472536aef65..ec8ad1421b61 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -88,6 +88,7 @@ test_progs = [
 	'v3d_get_bo_offset',
 	'v3d_get_param',
 	'v3d_mmap',
+	'v3d_cl_hang',
 	'vc4_create_bo',
 	'vc4_dmabuf_poll',
 	'vc4_label_bo',
diff --git a/tests/v3d_ci/v3d.testlist b/tests/v3d_ci/v3d.testlist
index b55e8e571d7d..bf625f788f79 100644
--- a/tests/v3d_ci/v3d.testlist
+++ b/tests/v3d_ci/v3d.testlist
@@ -1,3 +1,5 @@
+igt@v3d_cl_hang@rcl-infinite-loop
+igt@v3d_cl_hang@bcl-infinite-loop
 igt@v3d_get_bo_offset@create-get-offsets
 igt@v3d_get_bo_offset@get-bad-handle
 igt@v3d_get_param@base-params
diff --git a/lib/igt_v3d.h b/tests/v3d_cl_hang.c
similarity index 56%
copy from lib/igt_v3d.h
copy to tests/v3d_cl_hang.c
index 2042995103cc..6ecc337c2432 100644
--- a/lib/igt_v3d.h
+++ b/tests/v3d_cl_hang.c
@@ -21,26 +21,53 @@
  * IN THE SOFTWARE.
  */
 
-#ifndef IGT_V3D_H
-#define IGT_V3D_H
-
+#include "igt.h"
+#include "igt_v3d.h"
+#include <unistd.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <fcntl.h>
+#include <inttypes.h>
+#include <errno.h>
+#include <sys/stat.h>
+#include <sys/ioctl.h>
 #include "v3d_drm.h"
 
-struct v3d_bo {
-	int handle;
-	uint32_t offset;
-	uint32_t size;
-	void *map;
-};
+igt_main
+{
+	int fd;
+
+	igt_fixture {
+		fd = drm_open_driver(DRIVER_V3D);
+	}
+
+	igt_subtest("rcl-infinite-loop") {
+		struct v3d_cl *hang = igt_v3d_cl_create_infinite_loop(fd);
+		struct v3d_cl *nop = igt_v3d_cl_create_nop(fd);
+
+		igt_v3d_submit_rcl(hang);
+
+		igt_v3d_submit_rcl(nop);
+		igt_v3d_bo_wait(fd, nop->bo);
+
+		igt_v3d_cl_free(hang);
+		igt_v3d_cl_free(nop);
+	}
+
+	igt_subtest("bcl-infinite-loop") {
+		struct v3d_cl *hang = igt_v3d_cl_create_infinite_loop(fd);
+		struct v3d_cl *nop = igt_v3d_cl_create_nop(fd);
 
-struct v3d_bo *igt_v3d_create_bo(int fd, size_t size);
-void igt_v3d_free_bo(int fd, struct v3d_bo *bo);
+		igt_v3d_submit_bcl_and_rcl(hang, nop);
 
-/* IOCTL wrappers */
-uint32_t igt_v3d_get_bo_offset(int fd, uint32_t handle);
-uint32_t igt_v3d_get_param(int fd, enum drm_v3d_param param);
-void *igt_v3d_mmap_bo(int fd, uint32_t handle, uint32_t size, unsigned prot);
+		igt_v3d_submit_rcl(nop);
+		igt_v3d_bo_wait(fd, nop->bo);
 
-void igt_v3d_bo_mmap(int fd, struct v3d_bo *bo);
+		igt_v3d_cl_free(hang);
+		igt_v3d_cl_free(nop);
+	}
 
-#endif /* IGT_V3D_H */
+	igt_fixture
+		close(fd);
+}
-- 
2.19.1

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

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

* [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,v2,1/6] kms_content_protection: Fix log bug on 32-bit platforms.
  2018-11-15 18:57 [igt-dev] [PATCH i-g-t v2 1/6] kms_content_protection: Fix log bug on 32-bit platforms Eric Anholt
                   ` (4 preceding siblings ...)
  2018-11-15 18:57 ` [igt-dev] [PATCH i-g-t v2 6/6] v3d: Add tests for hanging V3D using an RCL Eric Anholt
@ 2018-11-15 19:41 ` Patchwork
  2018-11-15 20:39 ` [igt-dev] [PATCH i-g-t v2 1/6] " Ville Syrjälä
  2018-11-15 21:35 ` [igt-dev] ✓ Fi.CI.IGT: success for series starting with [i-g-t,v2,1/6] " Patchwork
  7 siblings, 0 replies; 9+ messages in thread
From: Patchwork @ 2018-11-15 19:41 UTC (permalink / raw)
  To: Eric Anholt; +Cc: igt-dev

== Series Details ==

Series: series starting with [i-g-t,v2,1/6] kms_content_protection: Fix log bug on 32-bit platforms.
URL   : https://patchwork.freedesktop.org/series/52556/
State : success

== Summary ==

= CI Bug Log - changes from IGT_4715 -> IGTPW_2067 =

== Summary - SUCCESS ==

  No regressions found.

  External URL: https://patchwork.freedesktop.org/api/1.0/series/52556/revisions/1/mbox/

== Known issues ==

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

  === IGT changes ===

    ==== Issues hit ====

    igt@drv_module_reload@basic-reload:
      fi-blb-e6850:       PASS -> INCOMPLETE (fdo#107718)

    igt@gem_ctx_create@basic-files:
      fi-bsw-n3050:       PASS -> FAIL (fdo#108656)
      fi-icl-u2:          PASS -> DMESG-WARN (fdo#107724)
      fi-bsw-kefka:       PASS -> FAIL (fdo#108656)

    
    ==== Possible fixes ====

    igt@drv_selftest@live_execlists:
      fi-apl-guc:         INCOMPLETE (fdo#108622, fdo#103927) -> PASS

    igt@gem_exec_suspend@basic-s3:
      fi-icl-u2:          DMESG-WARN (fdo#107724) -> PASS

    igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a:
      fi-byt-clapper:     FAIL (fdo#103191, fdo#107362) -> PASS +1

    
  fdo#103191 https://bugs.freedesktop.org/show_bug.cgi?id=103191
  fdo#103927 https://bugs.freedesktop.org/show_bug.cgi?id=103927
  fdo#107362 https://bugs.freedesktop.org/show_bug.cgi?id=107362
  fdo#107718 https://bugs.freedesktop.org/show_bug.cgi?id=107718
  fdo#107724 https://bugs.freedesktop.org/show_bug.cgi?id=107724
  fdo#108622 https://bugs.freedesktop.org/show_bug.cgi?id=108622
  fdo#108656 https://bugs.freedesktop.org/show_bug.cgi?id=108656


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

  Missing    (7): fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-ctg-p8600 fi-cfl-s3 fi-icl-u 


== Build changes ==

    * IGT: IGT_4715 -> IGTPW_2067

  CI_DRM_5141: fcdadbabc3216aa16c6d8236d55c5e5c8261cc91 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_2067: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2067/
  IGT_4715: 111593c49d812a4f4ff9ab0ef053a3ab88a6f73f @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools



== Testlist changes ==

+igt@v3d_cl_hang@bcl-infinite-loop
+igt@v3d_cl_hang@rcl-infinite-loop
+igt@v3d_get_bo_offset@create-get-offsets
+igt@v3d_get_bo_offset@get-bad-handle
+igt@v3d_get_param@base-params
+igt@v3d_get_param@get-bad-flags
+igt@v3d_get_param@get-bad-param
+igt@v3d_mmap@mmap-bad-handle

== Logs ==

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

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

* Re: [igt-dev] [PATCH i-g-t v2 1/6] kms_content_protection: Fix log bug on 32-bit platforms.
  2018-11-15 18:57 [igt-dev] [PATCH i-g-t v2 1/6] kms_content_protection: Fix log bug on 32-bit platforms Eric Anholt
                   ` (5 preceding siblings ...)
  2018-11-15 19:41 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,v2,1/6] kms_content_protection: Fix log bug on 32-bit platforms Patchwork
@ 2018-11-15 20:39 ` Ville Syrjälä
  2018-11-15 21:35 ` [igt-dev] ✓ Fi.CI.IGT: success for series starting with [i-g-t,v2,1/6] " Patchwork
  7 siblings, 0 replies; 9+ messages in thread
From: Ville Syrjälä @ 2018-11-15 20:39 UTC (permalink / raw)
  To: Eric Anholt; +Cc: igt-dev

On Thu, Nov 15, 2018 at 10:57:32AM -0800, Eric Anholt wrote:
> long is different between 32 and 64 and should basically never be
> used.  Fixes compiler warning about passing the wrong type.
> 
> v2: Use the PRId64 macros instead of long long.
> 
> Signed-off-by: Eric Anholt <eric@anholt.net>

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

> ---
>  tests/kms_content_protection.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/kms_content_protection.c b/tests/kms_content_protection.c
> index 801eff66c272..ef90ed4c1792 100644
> --- a/tests/kms_content_protection.c
> +++ b/tests/kms_content_protection.c
> @@ -89,7 +89,8 @@ wait_for_prop_value(igt_output_t *output, uint64_t expected,
>  			return true;
>  		usleep(1000);
>  	}
> -	igt_info("prop_value mismatch %ld != %ld\n", val, expected);
> +	igt_info("prop_value mismatch %" PRId64 " != %" PRId64 "\n",
> +		 val, expected);
>  
>  	return false;
>  }
> -- 
> 2.19.1
> 
> _______________________________________________
> igt-dev mailing list
> igt-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/igt-dev

-- 
Ville Syrjälä
Intel
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [igt-dev] ✓ Fi.CI.IGT: success for series starting with [i-g-t,v2,1/6] kms_content_protection: Fix log bug on 32-bit platforms.
  2018-11-15 18:57 [igt-dev] [PATCH i-g-t v2 1/6] kms_content_protection: Fix log bug on 32-bit platforms Eric Anholt
                   ` (6 preceding siblings ...)
  2018-11-15 20:39 ` [igt-dev] [PATCH i-g-t v2 1/6] " Ville Syrjälä
@ 2018-11-15 21:35 ` Patchwork
  7 siblings, 0 replies; 9+ messages in thread
From: Patchwork @ 2018-11-15 21:35 UTC (permalink / raw)
  To: Eric Anholt; +Cc: igt-dev

== Series Details ==

Series: series starting with [i-g-t,v2,1/6] kms_content_protection: Fix log bug on 32-bit platforms.
URL   : https://patchwork.freedesktop.org/series/52556/
State : success

== Summary ==

= CI Bug Log - changes from IGT_4715_full -> IGTPW_2067_full =

== Summary - WARNING ==

  Minor unknown changes coming with IGTPW_2067_full need to be verified
  manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in IGTPW_2067_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://patchwork.freedesktop.org/api/1.0/series/52556/revisions/1/mbox/

== Possible new issues ==

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

  === IGT changes ===

    ==== Warnings ====

    igt@perf_pmu@rc6:
      shard-kbl:          PASS -> SKIP

    igt@tools_test@tools_test:
      shard-snb:          PASS -> SKIP +1

    
== Known issues ==

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

  === IGT changes ===

    ==== Issues hit ====

    igt@gem_ctx_isolation@vcs1-s3:
      shard-kbl:          PASS -> INCOMPLETE (fdo#103665)

    igt@gem_exec_await@wide-all:
      shard-glk:          PASS -> INCOMPLETE (k.org#198133, fdo#103359)

    igt@gem_userptr_blits@map-fixed-invalidate-busy-gup:
      shard-snb:          PASS -> INCOMPLETE (fdo#105411)

    igt@kms_busy@extended-pageflip-modeset-hang-oldfb-render-c:
      shard-glk:          PASS -> DMESG-WARN (fdo#107956)

    igt@kms_ccs@pipe-a-crc-sprite-planes-basic:
      shard-glk:          PASS -> FAIL (fdo#108145)

    igt@kms_color@pipe-a-legacy-gamma:
      shard-kbl:          PASS -> FAIL (fdo#108145, fdo#104782)
      shard-apl:          PASS -> FAIL (fdo#108145, fdo#104782)

    igt@kms_cursor_crc@cursor-256x85-onscreen:
      shard-apl:          NOTRUN -> FAIL (fdo#103232)

    igt@kms_cursor_crc@cursor-256x85-sliding:
      shard-kbl:          PASS -> FAIL (fdo#103232)

    igt@kms_cursor_crc@cursor-64x21-sliding:
      shard-apl:          PASS -> FAIL (fdo#103232) +3

    igt@kms_cursor_crc@cursor-64x64-sliding:
      shard-glk:          PASS -> FAIL (fdo#103232) +5

    igt@kms_frontbuffer_tracking@fbc-1p-primscrn-cur-indfb-move:
      shard-kbl:          PASS -> FAIL (fdo#103167) +1

    igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-mmap-gtt:
      shard-apl:          PASS -> FAIL (fdo#103167) +4

    igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-fullscreen:
      shard-glk:          PASS -> FAIL (fdo#103167) +7

    igt@kms_plane_multiple@atomic-pipe-a-tiling-y:
      shard-glk:          PASS -> FAIL (fdo#103166) +2

    igt@kms_setmode@basic:
      shard-hsw:          PASS -> FAIL (fdo#99912)

    
    ==== Possible fixes ====

    igt@gem_eio@in-flight-suspend:
      shard-kbl:          INCOMPLETE (fdo#106702, fdo#103665) -> PASS

    igt@gem_ppgtt@blt-vs-render-ctx0:
      shard-kbl:          INCOMPLETE (fdo#106023, fdo#106887, fdo#103665) -> PASS

    igt@gem_tiled_blits@normal:
      shard-apl:          INCOMPLETE (fdo#103927) -> PASS

    igt@kms_available_modes_crc@available_mode_test_crc:
      shard-apl:          FAIL (fdo#106641) -> PASS

    igt@kms_busy@extended-modeset-hang-newfb-render-b:
      shard-kbl:          DMESG-WARN (fdo#107956) -> PASS

    igt@kms_color@pipe-b-degamma:
      shard-apl:          FAIL (fdo#104782) -> PASS

    igt@kms_cursor_crc@cursor-256x256-dpms:
      shard-glk:          FAIL (fdo#103232) -> PASS +4

    igt@kms_cursor_crc@cursor-256x256-suspend:
      shard-apl:          FAIL (fdo#103232, fdo#103191) -> PASS

    igt@kms_cursor_crc@cursor-256x85-random:
      shard-apl:          FAIL (fdo#103232) -> PASS +1

    igt@kms_cursor_legacy@2x-nonblocking-modeset-vs-cursor-atomic:
      shard-glk:          FAIL (fdo#106509, fdo#105454) -> PASS

    igt@kms_flip@dpms-vs-vblank-race-interruptible:
      shard-glk:          FAIL (fdo#103060) -> PASS

    igt@kms_frontbuffer_tracking@fbc-1p-indfb-fliptrack:
      shard-snb:          INCOMPLETE (fdo#105411) -> PASS

    igt@kms_frontbuffer_tracking@fbc-1p-primscrn-cur-indfb-draw-blt:
      shard-glk:          FAIL (fdo#103167) -> PASS
      shard-apl:          FAIL (fdo#103167) -> PASS +2

    igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-move:
      shard-kbl:          FAIL (fdo#103167) -> PASS +1

    igt@kms_plane_alpha_blend@pipe-c-constant-alpha-max:
      shard-glk:          FAIL (fdo#108145) -> PASS

    igt@kms_plane_multiple@atomic-pipe-b-tiling-x:
      shard-glk:          FAIL (fdo#103166) -> PASS +2

    igt@kms_plane_multiple@atomic-pipe-c-tiling-yf:
      shard-apl:          FAIL (fdo#103166) -> PASS +4
      shard-kbl:          FAIL (fdo#103166) -> PASS +2

    igt@kms_setmode@basic:
      shard-kbl:          FAIL (fdo#99912) -> PASS

    
  fdo#103060 https://bugs.freedesktop.org/show_bug.cgi?id=103060
  fdo#103166 https://bugs.freedesktop.org/show_bug.cgi?id=103166
  fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167
  fdo#103191 https://bugs.freedesktop.org/show_bug.cgi?id=103191
  fdo#103232 https://bugs.freedesktop.org/show_bug.cgi?id=103232
  fdo#103359 https://bugs.freedesktop.org/show_bug.cgi?id=103359
  fdo#103665 https://bugs.freedesktop.org/show_bug.cgi?id=103665
  fdo#103927 https://bugs.freedesktop.org/show_bug.cgi?id=103927
  fdo#104782 https://bugs.freedesktop.org/show_bug.cgi?id=104782
  fdo#105411 https://bugs.freedesktop.org/show_bug.cgi?id=105411
  fdo#105454 https://bugs.freedesktop.org/show_bug.cgi?id=105454
  fdo#106023 https://bugs.freedesktop.org/show_bug.cgi?id=106023
  fdo#106509 https://bugs.freedesktop.org/show_bug.cgi?id=106509
  fdo#106641 https://bugs.freedesktop.org/show_bug.cgi?id=106641
  fdo#106702 https://bugs.freedesktop.org/show_bug.cgi?id=106702
  fdo#106887 https://bugs.freedesktop.org/show_bug.cgi?id=106887
  fdo#107956 https://bugs.freedesktop.org/show_bug.cgi?id=107956
  fdo#108145 https://bugs.freedesktop.org/show_bug.cgi?id=108145
  fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912
  k.org#198133 https://bugzilla.kernel.org/show_bug.cgi?id=198133


== Participating hosts (6 -> 5) ==

  Missing    (1): shard-skl 


== Build changes ==

    * IGT: IGT_4715 -> IGTPW_2067

  CI_DRM_5141: fcdadbabc3216aa16c6d8236d55c5e5c8261cc91 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_2067: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2067/
  IGT_4715: 111593c49d812a4f4ff9ab0ef053a3ab88a6f73f @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Logs ==

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

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

end of thread, other threads:[~2018-11-15 21:35 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-15 18:57 [igt-dev] [PATCH i-g-t v2 1/6] kms_content_protection: Fix log bug on 32-bit platforms Eric Anholt
2018-11-15 18:57 ` [igt-dev] [PATCH i-g-t v2 2/6] meson: Drop -Wdeclaration-after-statement Eric Anholt
2018-11-15 18:57 ` [igt-dev] [PATCH i-g-t v2 3/6] v3d: Import the V3D DRM UAPI header Eric Anholt
2018-11-15 18:57 ` [igt-dev] [PATCH i-g-t v2 4/6] v3d: Add a helper library Eric Anholt
2018-11-15 18:57 ` [igt-dev] [PATCH i-g-t v2 5/6] v3d_*: Add new tests for the V3D UABI Eric Anholt
2018-11-15 18:57 ` [igt-dev] [PATCH i-g-t v2 6/6] v3d: Add tests for hanging V3D using an RCL Eric Anholt
2018-11-15 19:41 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,v2,1/6] kms_content_protection: Fix log bug on 32-bit platforms Patchwork
2018-11-15 20:39 ` [igt-dev] [PATCH i-g-t v2 1/6] " Ville Syrjälä
2018-11-15 21:35 ` [igt-dev] ✓ Fi.CI.IGT: success for series starting with [i-g-t,v2,1/6] " Patchwork

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