* [PATCH i-g-t] i915: Mark up a few more tests that only target GGTT
@ 2019-11-12 15:47 Chris Wilson
2019-11-12 15:47 ` [Intel-gfx] " Chris Wilson
2019-11-12 18:17 ` Antonio Argenziano
0 siblings, 2 replies; 8+ messages in thread
From: Chris Wilson @ 2019-11-12 15:47 UTC (permalink / raw)
To: intel-gfx; +Cc: igt-dev
If a test is only targeting the GGTT API and its corner cases, it can
only run if we have a mappable aperture.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Antonio Argenziano <antonio.argenziano@intel.com>
---
lib/i915/gem_mman.c | 19 +++++++++++++++++++
lib/i915/gem_mman.h | 3 +++
tests/i915/gem_gtt_cpu_tlb.c | 1 +
tests/i915/gem_gtt_hog.c | 1 +
tests/i915/gem_gtt_speed.c | 2 ++
tests/i915/gem_mmap_gtt.c | 5 +----
tests/i915/gem_tiled_swapping.c | 1 +
7 files changed, 28 insertions(+), 4 deletions(-)
diff --git a/lib/i915/gem_mman.c b/lib/i915/gem_mman.c
index 3cf9a6bbd..76d0be82e 100644
--- a/lib/i915/gem_mman.c
+++ b/lib/i915/gem_mman.c
@@ -252,3 +252,22 @@ void *gem_mmap__cpu(int fd, uint32_t handle, uint64_t offset, uint64_t size, uns
igt_assert(ptr);
return ptr;
}
+
+bool gem_has_ggtt(int i915)
+{
+ struct drm_i915_gem_mmap_gtt arg = {};
+ int err;
+
+ err = 0;
+ if (ioctl(i915, DRM_IOCTL_I915_GEM_MMAP_GTT, &arg))
+ err = errno;
+ errno = 0;
+
+ return errno != ENODEV;
+}
+
+void gem_require_ggtt(int i915)
+{
+ igt_require_f(gem_has_ggtt(i915),
+ "HW & kernel support for indirect detiling aperture\n");
+}
diff --git a/lib/i915/gem_mman.h b/lib/i915/gem_mman.h
index f7242ed77..67891c8de 100644
--- a/lib/i915/gem_mman.h
+++ b/lib/i915/gem_mman.h
@@ -35,6 +35,9 @@ void *gem_mmap__wc(int fd, uint32_t handle, uint64_t offset, uint64_t size, unsi
#define I915_GEM_DOMAIN_WC 0x80
#endif
+bool gem_has_ggtt(int i915);
+void gem_require_ggtt(int i915);
+
void *__gem_mmap__gtt(int fd, uint32_t handle, uint64_t size, unsigned prot);
void *__gem_mmap__cpu(int fd, uint32_t handle, uint64_t offset, uint64_t size, unsigned prot);
void *__gem_mmap__wc(int fd, uint32_t handle, uint64_t offset, uint64_t size, unsigned prot);
diff --git a/tests/i915/gem_gtt_cpu_tlb.c b/tests/i915/gem_gtt_cpu_tlb.c
index cf3c543df..a4cbb1034 100644
--- a/tests/i915/gem_gtt_cpu_tlb.c
+++ b/tests/i915/gem_gtt_cpu_tlb.c
@@ -79,6 +79,7 @@ igt_simple_main
igt_skip_on_simulation();
fd = drm_open_driver(DRIVER_INTEL);
+ gem_require_ggtt(fd);
handle = gem_create(fd, OBJ_SIZE);
diff --git a/tests/i915/gem_gtt_hog.c b/tests/i915/gem_gtt_hog.c
index ca730649c..7a6273936 100644
--- a/tests/i915/gem_gtt_hog.c
+++ b/tests/i915/gem_gtt_hog.c
@@ -161,6 +161,7 @@ igt_simple_main
/* check for an intel gpu before goint nuts. */
int fd = drm_open_driver(DRIVER_INTEL);
igt_require_gem(fd);
+ gem_require_ggtt(fd);
close(fd);
igt_skip_on_simulation();
diff --git a/tests/i915/gem_gtt_speed.c b/tests/i915/gem_gtt_speed.c
index dfa7216cc..0cdd51dc3 100644
--- a/tests/i915/gem_gtt_speed.c
+++ b/tests/i915/gem_gtt_speed.c
@@ -124,7 +124,9 @@ igt_simple_main_args("s:", NULL, help_str, opt_handler, NULL)
buf = malloc(size);
memset(buf, 0, size);
+
fd = drm_open_driver(DRIVER_INTEL);
+ gem_require_ggtt(fd);
handle = gem_create(fd, size);
igt_assert(handle);
diff --git a/tests/i915/gem_mmap_gtt.c b/tests/i915/gem_mmap_gtt.c
index ac25f13e2..d31c73ed4 100644
--- a/tests/i915/gem_mmap_gtt.c
+++ b/tests/i915/gem_mmap_gtt.c
@@ -1020,8 +1020,6 @@ igt_main
OBJECT_SIZE = 1 * 1024 * 1024;
igt_fixture {
- struct drm_i915_gem_mmap_gtt arg = {};
-
fd = drm_open_driver(DRIVER_INTEL);
/*
@@ -1029,8 +1027,7 @@ igt_main
* detiling access from untrusted userspace to the objects,
* the kernel does an early rejection of the mmap_gtt ioctl.
*/
- igt_require_f(mmap_ioctl(fd, &arg) != -ENODEV,
- "HW & kernel support for indirect detiling aperture\n");
+ gem_require_ggtt(fd);
}
igt_subtest("bad-object") {
diff --git a/tests/i915/gem_tiled_swapping.c b/tests/i915/gem_tiled_swapping.c
index 1b70c1e51..3a95c9469 100644
--- a/tests/i915/gem_tiled_swapping.c
+++ b/tests/i915/gem_tiled_swapping.c
@@ -175,6 +175,7 @@ igt_main
current_tiling_mode = I915_TILING_X;
fd = drm_open_driver(DRIVER_INTEL);
+ gem_require_ggtt(fd);
intel_purge_vm_caches(fd);
check_memory_layout(fd);
--
2.24.0
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [Intel-gfx] [PATCH i-g-t] i915: Mark up a few more tests that only target GGTT
2019-11-12 15:47 [PATCH i-g-t] i915: Mark up a few more tests that only target GGTT Chris Wilson
@ 2019-11-12 15:47 ` Chris Wilson
2019-11-12 18:17 ` Antonio Argenziano
1 sibling, 0 replies; 8+ messages in thread
From: Chris Wilson @ 2019-11-12 15:47 UTC (permalink / raw)
To: intel-gfx; +Cc: igt-dev
If a test is only targeting the GGTT API and its corner cases, it can
only run if we have a mappable aperture.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Antonio Argenziano <antonio.argenziano@intel.com>
---
lib/i915/gem_mman.c | 19 +++++++++++++++++++
lib/i915/gem_mman.h | 3 +++
tests/i915/gem_gtt_cpu_tlb.c | 1 +
tests/i915/gem_gtt_hog.c | 1 +
tests/i915/gem_gtt_speed.c | 2 ++
tests/i915/gem_mmap_gtt.c | 5 +----
tests/i915/gem_tiled_swapping.c | 1 +
7 files changed, 28 insertions(+), 4 deletions(-)
diff --git a/lib/i915/gem_mman.c b/lib/i915/gem_mman.c
index 3cf9a6bbd..76d0be82e 100644
--- a/lib/i915/gem_mman.c
+++ b/lib/i915/gem_mman.c
@@ -252,3 +252,22 @@ void *gem_mmap__cpu(int fd, uint32_t handle, uint64_t offset, uint64_t size, uns
igt_assert(ptr);
return ptr;
}
+
+bool gem_has_ggtt(int i915)
+{
+ struct drm_i915_gem_mmap_gtt arg = {};
+ int err;
+
+ err = 0;
+ if (ioctl(i915, DRM_IOCTL_I915_GEM_MMAP_GTT, &arg))
+ err = errno;
+ errno = 0;
+
+ return errno != ENODEV;
+}
+
+void gem_require_ggtt(int i915)
+{
+ igt_require_f(gem_has_ggtt(i915),
+ "HW & kernel support for indirect detiling aperture\n");
+}
diff --git a/lib/i915/gem_mman.h b/lib/i915/gem_mman.h
index f7242ed77..67891c8de 100644
--- a/lib/i915/gem_mman.h
+++ b/lib/i915/gem_mman.h
@@ -35,6 +35,9 @@ void *gem_mmap__wc(int fd, uint32_t handle, uint64_t offset, uint64_t size, unsi
#define I915_GEM_DOMAIN_WC 0x80
#endif
+bool gem_has_ggtt(int i915);
+void gem_require_ggtt(int i915);
+
void *__gem_mmap__gtt(int fd, uint32_t handle, uint64_t size, unsigned prot);
void *__gem_mmap__cpu(int fd, uint32_t handle, uint64_t offset, uint64_t size, unsigned prot);
void *__gem_mmap__wc(int fd, uint32_t handle, uint64_t offset, uint64_t size, unsigned prot);
diff --git a/tests/i915/gem_gtt_cpu_tlb.c b/tests/i915/gem_gtt_cpu_tlb.c
index cf3c543df..a4cbb1034 100644
--- a/tests/i915/gem_gtt_cpu_tlb.c
+++ b/tests/i915/gem_gtt_cpu_tlb.c
@@ -79,6 +79,7 @@ igt_simple_main
igt_skip_on_simulation();
fd = drm_open_driver(DRIVER_INTEL);
+ gem_require_ggtt(fd);
handle = gem_create(fd, OBJ_SIZE);
diff --git a/tests/i915/gem_gtt_hog.c b/tests/i915/gem_gtt_hog.c
index ca730649c..7a6273936 100644
--- a/tests/i915/gem_gtt_hog.c
+++ b/tests/i915/gem_gtt_hog.c
@@ -161,6 +161,7 @@ igt_simple_main
/* check for an intel gpu before goint nuts. */
int fd = drm_open_driver(DRIVER_INTEL);
igt_require_gem(fd);
+ gem_require_ggtt(fd);
close(fd);
igt_skip_on_simulation();
diff --git a/tests/i915/gem_gtt_speed.c b/tests/i915/gem_gtt_speed.c
index dfa7216cc..0cdd51dc3 100644
--- a/tests/i915/gem_gtt_speed.c
+++ b/tests/i915/gem_gtt_speed.c
@@ -124,7 +124,9 @@ igt_simple_main_args("s:", NULL, help_str, opt_handler, NULL)
buf = malloc(size);
memset(buf, 0, size);
+
fd = drm_open_driver(DRIVER_INTEL);
+ gem_require_ggtt(fd);
handle = gem_create(fd, size);
igt_assert(handle);
diff --git a/tests/i915/gem_mmap_gtt.c b/tests/i915/gem_mmap_gtt.c
index ac25f13e2..d31c73ed4 100644
--- a/tests/i915/gem_mmap_gtt.c
+++ b/tests/i915/gem_mmap_gtt.c
@@ -1020,8 +1020,6 @@ igt_main
OBJECT_SIZE = 1 * 1024 * 1024;
igt_fixture {
- struct drm_i915_gem_mmap_gtt arg = {};
-
fd = drm_open_driver(DRIVER_INTEL);
/*
@@ -1029,8 +1027,7 @@ igt_main
* detiling access from untrusted userspace to the objects,
* the kernel does an early rejection of the mmap_gtt ioctl.
*/
- igt_require_f(mmap_ioctl(fd, &arg) != -ENODEV,
- "HW & kernel support for indirect detiling aperture\n");
+ gem_require_ggtt(fd);
}
igt_subtest("bad-object") {
diff --git a/tests/i915/gem_tiled_swapping.c b/tests/i915/gem_tiled_swapping.c
index 1b70c1e51..3a95c9469 100644
--- a/tests/i915/gem_tiled_swapping.c
+++ b/tests/i915/gem_tiled_swapping.c
@@ -175,6 +175,7 @@ igt_main
current_tiling_mode = I915_TILING_X;
fd = drm_open_driver(DRIVER_INTEL);
+ gem_require_ggtt(fd);
intel_purge_vm_caches(fd);
check_memory_layout(fd);
--
2.24.0
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH i-g-t] i915: Mark up a few more tests that only target GGTT
2019-11-12 15:47 [PATCH i-g-t] i915: Mark up a few more tests that only target GGTT Chris Wilson
2019-11-12 15:47 ` [Intel-gfx] " Chris Wilson
@ 2019-11-12 18:17 ` Antonio Argenziano
2019-11-12 18:17 ` [Intel-gfx] " Antonio Argenziano
2019-11-12 18:21 ` Chris Wilson
1 sibling, 2 replies; 8+ messages in thread
From: Antonio Argenziano @ 2019-11-12 18:17 UTC (permalink / raw)
To: Chris Wilson, intel-gfx; +Cc: igt-dev
On 12/11/19 07:47, Chris Wilson wrote:
> If a test is only targeting the GGTT API and its corner cases, it can
> only run if we have a mappable aperture.
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Antonio Argenziano <antonio.argenziano@intel.com>
> ---
> lib/i915/gem_mman.c | 19 +++++++++++++++++++
> lib/i915/gem_mman.h | 3 +++
> tests/i915/gem_gtt_cpu_tlb.c | 1 +
> tests/i915/gem_gtt_hog.c | 1 +
> tests/i915/gem_gtt_speed.c | 2 ++
> tests/i915/gem_mmap_gtt.c | 5 +----
> tests/i915/gem_tiled_swapping.c | 1 +
> 7 files changed, 28 insertions(+), 4 deletions(-)
>
> diff --git a/lib/i915/gem_mman.c b/lib/i915/gem_mman.c
> index 3cf9a6bbd..76d0be82e 100644
> --- a/lib/i915/gem_mman.c
> +++ b/lib/i915/gem_mman.c
> @@ -252,3 +252,22 @@ void *gem_mmap__cpu(int fd, uint32_t handle, uint64_t offset, uint64_t size, uns
> igt_assert(ptr);
> return ptr;
> }
> +
> +bool gem_has_ggtt(int i915)
nit: I would put mapping or map or something in the name to make it
clear that the mapping is not accessible but, your call :).
The patch looks good to me but IGT is quite different than the last time
I played around with it so:
Acked-by: Antonio Argenziano <antonio.argenziano@intel.com>
> +{
> + struct drm_i915_gem_mmap_gtt arg = {};
> + int err;
> +
> + err = 0;
> + if (ioctl(i915, DRM_IOCTL_I915_GEM_MMAP_GTT, &arg))
> + err = errno;
> + errno = 0;
> +
> + return errno != ENODEV;
> +}
> +
> +void gem_require_ggtt(int i915)
> +{
> + igt_require_f(gem_has_ggtt(i915),
> + "HW & kernel support for indirect detiling aperture\n");
> +}
> diff --git a/lib/i915/gem_mman.h b/lib/i915/gem_mman.h
> index f7242ed77..67891c8de 100644
> --- a/lib/i915/gem_mman.h
> +++ b/lib/i915/gem_mman.h
> @@ -35,6 +35,9 @@ void *gem_mmap__wc(int fd, uint32_t handle, uint64_t offset, uint64_t size, unsi
> #define I915_GEM_DOMAIN_WC 0x80
> #endif
>
> +bool gem_has_ggtt(int i915);
> +void gem_require_ggtt(int i915);
> +
> void *__gem_mmap__gtt(int fd, uint32_t handle, uint64_t size, unsigned prot);
> void *__gem_mmap__cpu(int fd, uint32_t handle, uint64_t offset, uint64_t size, unsigned prot);
> void *__gem_mmap__wc(int fd, uint32_t handle, uint64_t offset, uint64_t size, unsigned prot);
> diff --git a/tests/i915/gem_gtt_cpu_tlb.c b/tests/i915/gem_gtt_cpu_tlb.c
> index cf3c543df..a4cbb1034 100644
> --- a/tests/i915/gem_gtt_cpu_tlb.c
> +++ b/tests/i915/gem_gtt_cpu_tlb.c
> @@ -79,6 +79,7 @@ igt_simple_main
> igt_skip_on_simulation();
>
> fd = drm_open_driver(DRIVER_INTEL);
> + gem_require_ggtt(fd);
>
> handle = gem_create(fd, OBJ_SIZE);
>
> diff --git a/tests/i915/gem_gtt_hog.c b/tests/i915/gem_gtt_hog.c
> index ca730649c..7a6273936 100644
> --- a/tests/i915/gem_gtt_hog.c
> +++ b/tests/i915/gem_gtt_hog.c
> @@ -161,6 +161,7 @@ igt_simple_main
> /* check for an intel gpu before goint nuts. */
> int fd = drm_open_driver(DRIVER_INTEL);
> igt_require_gem(fd);
> + gem_require_ggtt(fd);
> close(fd);
>
> igt_skip_on_simulation();
> diff --git a/tests/i915/gem_gtt_speed.c b/tests/i915/gem_gtt_speed.c
> index dfa7216cc..0cdd51dc3 100644
> --- a/tests/i915/gem_gtt_speed.c
> +++ b/tests/i915/gem_gtt_speed.c
> @@ -124,7 +124,9 @@ igt_simple_main_args("s:", NULL, help_str, opt_handler, NULL)
>
> buf = malloc(size);
> memset(buf, 0, size);
> +
> fd = drm_open_driver(DRIVER_INTEL);
> + gem_require_ggtt(fd);
>
> handle = gem_create(fd, size);
> igt_assert(handle);
> diff --git a/tests/i915/gem_mmap_gtt.c b/tests/i915/gem_mmap_gtt.c
> index ac25f13e2..d31c73ed4 100644
> --- a/tests/i915/gem_mmap_gtt.c
> +++ b/tests/i915/gem_mmap_gtt.c
> @@ -1020,8 +1020,6 @@ igt_main
> OBJECT_SIZE = 1 * 1024 * 1024;
>
> igt_fixture {
> - struct drm_i915_gem_mmap_gtt arg = {};
> -
> fd = drm_open_driver(DRIVER_INTEL);
>
> /*
> @@ -1029,8 +1027,7 @@ igt_main
> * detiling access from untrusted userspace to the objects,
> * the kernel does an early rejection of the mmap_gtt ioctl.
> */
> - igt_require_f(mmap_ioctl(fd, &arg) != -ENODEV,
> - "HW & kernel support for indirect detiling aperture\n");
> + gem_require_ggtt(fd);
> }
>
> igt_subtest("bad-object") {
> diff --git a/tests/i915/gem_tiled_swapping.c b/tests/i915/gem_tiled_swapping.c
> index 1b70c1e51..3a95c9469 100644
> --- a/tests/i915/gem_tiled_swapping.c
> +++ b/tests/i915/gem_tiled_swapping.c
> @@ -175,6 +175,7 @@ igt_main
> current_tiling_mode = I915_TILING_X;
>
> fd = drm_open_driver(DRIVER_INTEL);
> + gem_require_ggtt(fd);
>
> intel_purge_vm_caches(fd);
> check_memory_layout(fd);
>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Intel-gfx] [PATCH i-g-t] i915: Mark up a few more tests that only target GGTT
2019-11-12 18:17 ` Antonio Argenziano
@ 2019-11-12 18:17 ` Antonio Argenziano
2019-11-12 18:21 ` Chris Wilson
1 sibling, 0 replies; 8+ messages in thread
From: Antonio Argenziano @ 2019-11-12 18:17 UTC (permalink / raw)
To: Chris Wilson, intel-gfx; +Cc: igt-dev
On 12/11/19 07:47, Chris Wilson wrote:
> If a test is only targeting the GGTT API and its corner cases, it can
> only run if we have a mappable aperture.
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Antonio Argenziano <antonio.argenziano@intel.com>
> ---
> lib/i915/gem_mman.c | 19 +++++++++++++++++++
> lib/i915/gem_mman.h | 3 +++
> tests/i915/gem_gtt_cpu_tlb.c | 1 +
> tests/i915/gem_gtt_hog.c | 1 +
> tests/i915/gem_gtt_speed.c | 2 ++
> tests/i915/gem_mmap_gtt.c | 5 +----
> tests/i915/gem_tiled_swapping.c | 1 +
> 7 files changed, 28 insertions(+), 4 deletions(-)
>
> diff --git a/lib/i915/gem_mman.c b/lib/i915/gem_mman.c
> index 3cf9a6bbd..76d0be82e 100644
> --- a/lib/i915/gem_mman.c
> +++ b/lib/i915/gem_mman.c
> @@ -252,3 +252,22 @@ void *gem_mmap__cpu(int fd, uint32_t handle, uint64_t offset, uint64_t size, uns
> igt_assert(ptr);
> return ptr;
> }
> +
> +bool gem_has_ggtt(int i915)
nit: I would put mapping or map or something in the name to make it
clear that the mapping is not accessible but, your call :).
The patch looks good to me but IGT is quite different than the last time
I played around with it so:
Acked-by: Antonio Argenziano <antonio.argenziano@intel.com>
> +{
> + struct drm_i915_gem_mmap_gtt arg = {};
> + int err;
> +
> + err = 0;
> + if (ioctl(i915, DRM_IOCTL_I915_GEM_MMAP_GTT, &arg))
> + err = errno;
> + errno = 0;
> +
> + return errno != ENODEV;
> +}
> +
> +void gem_require_ggtt(int i915)
> +{
> + igt_require_f(gem_has_ggtt(i915),
> + "HW & kernel support for indirect detiling aperture\n");
> +}
> diff --git a/lib/i915/gem_mman.h b/lib/i915/gem_mman.h
> index f7242ed77..67891c8de 100644
> --- a/lib/i915/gem_mman.h
> +++ b/lib/i915/gem_mman.h
> @@ -35,6 +35,9 @@ void *gem_mmap__wc(int fd, uint32_t handle, uint64_t offset, uint64_t size, unsi
> #define I915_GEM_DOMAIN_WC 0x80
> #endif
>
> +bool gem_has_ggtt(int i915);
> +void gem_require_ggtt(int i915);
> +
> void *__gem_mmap__gtt(int fd, uint32_t handle, uint64_t size, unsigned prot);
> void *__gem_mmap__cpu(int fd, uint32_t handle, uint64_t offset, uint64_t size, unsigned prot);
> void *__gem_mmap__wc(int fd, uint32_t handle, uint64_t offset, uint64_t size, unsigned prot);
> diff --git a/tests/i915/gem_gtt_cpu_tlb.c b/tests/i915/gem_gtt_cpu_tlb.c
> index cf3c543df..a4cbb1034 100644
> --- a/tests/i915/gem_gtt_cpu_tlb.c
> +++ b/tests/i915/gem_gtt_cpu_tlb.c
> @@ -79,6 +79,7 @@ igt_simple_main
> igt_skip_on_simulation();
>
> fd = drm_open_driver(DRIVER_INTEL);
> + gem_require_ggtt(fd);
>
> handle = gem_create(fd, OBJ_SIZE);
>
> diff --git a/tests/i915/gem_gtt_hog.c b/tests/i915/gem_gtt_hog.c
> index ca730649c..7a6273936 100644
> --- a/tests/i915/gem_gtt_hog.c
> +++ b/tests/i915/gem_gtt_hog.c
> @@ -161,6 +161,7 @@ igt_simple_main
> /* check for an intel gpu before goint nuts. */
> int fd = drm_open_driver(DRIVER_INTEL);
> igt_require_gem(fd);
> + gem_require_ggtt(fd);
> close(fd);
>
> igt_skip_on_simulation();
> diff --git a/tests/i915/gem_gtt_speed.c b/tests/i915/gem_gtt_speed.c
> index dfa7216cc..0cdd51dc3 100644
> --- a/tests/i915/gem_gtt_speed.c
> +++ b/tests/i915/gem_gtt_speed.c
> @@ -124,7 +124,9 @@ igt_simple_main_args("s:", NULL, help_str, opt_handler, NULL)
>
> buf = malloc(size);
> memset(buf, 0, size);
> +
> fd = drm_open_driver(DRIVER_INTEL);
> + gem_require_ggtt(fd);
>
> handle = gem_create(fd, size);
> igt_assert(handle);
> diff --git a/tests/i915/gem_mmap_gtt.c b/tests/i915/gem_mmap_gtt.c
> index ac25f13e2..d31c73ed4 100644
> --- a/tests/i915/gem_mmap_gtt.c
> +++ b/tests/i915/gem_mmap_gtt.c
> @@ -1020,8 +1020,6 @@ igt_main
> OBJECT_SIZE = 1 * 1024 * 1024;
>
> igt_fixture {
> - struct drm_i915_gem_mmap_gtt arg = {};
> -
> fd = drm_open_driver(DRIVER_INTEL);
>
> /*
> @@ -1029,8 +1027,7 @@ igt_main
> * detiling access from untrusted userspace to the objects,
> * the kernel does an early rejection of the mmap_gtt ioctl.
> */
> - igt_require_f(mmap_ioctl(fd, &arg) != -ENODEV,
> - "HW & kernel support for indirect detiling aperture\n");
> + gem_require_ggtt(fd);
> }
>
> igt_subtest("bad-object") {
> diff --git a/tests/i915/gem_tiled_swapping.c b/tests/i915/gem_tiled_swapping.c
> index 1b70c1e51..3a95c9469 100644
> --- a/tests/i915/gem_tiled_swapping.c
> +++ b/tests/i915/gem_tiled_swapping.c
> @@ -175,6 +175,7 @@ igt_main
> current_tiling_mode = I915_TILING_X;
>
> fd = drm_open_driver(DRIVER_INTEL);
> + gem_require_ggtt(fd);
>
> intel_purge_vm_caches(fd);
> check_memory_layout(fd);
>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH i-g-t] i915: Mark up a few more tests that only target GGTT
2019-11-12 18:17 ` Antonio Argenziano
2019-11-12 18:17 ` [Intel-gfx] " Antonio Argenziano
@ 2019-11-12 18:21 ` Chris Wilson
2019-11-12 18:21 ` [Intel-gfx] " Chris Wilson
2019-11-12 18:23 ` Antonio Argenziano
1 sibling, 2 replies; 8+ messages in thread
From: Chris Wilson @ 2019-11-12 18:21 UTC (permalink / raw)
To: Antonio Argenziano, intel-gfx; +Cc: igt-dev
Quoting Antonio Argenziano (2019-11-12 18:17:41)
>
>
> On 12/11/19 07:47, Chris Wilson wrote:
> > If a test is only targeting the GGTT API and its corner cases, it can
> > only run if we have a mappable aperture.
> >
> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > Cc: Antonio Argenziano <antonio.argenziano@intel.com>
> > ---
> > lib/i915/gem_mman.c | 19 +++++++++++++++++++
> > lib/i915/gem_mman.h | 3 +++
> > tests/i915/gem_gtt_cpu_tlb.c | 1 +
> > tests/i915/gem_gtt_hog.c | 1 +
> > tests/i915/gem_gtt_speed.c | 2 ++
> > tests/i915/gem_mmap_gtt.c | 5 +----
> > tests/i915/gem_tiled_swapping.c | 1 +
> > 7 files changed, 28 insertions(+), 4 deletions(-)
> >
> > diff --git a/lib/i915/gem_mman.c b/lib/i915/gem_mman.c
> > index 3cf9a6bbd..76d0be82e 100644
> > --- a/lib/i915/gem_mman.c
> > +++ b/lib/i915/gem_mman.c
> > @@ -252,3 +252,22 @@ void *gem_mmap__cpu(int fd, uint32_t handle, uint64_t offset, uint64_t size, uns
> > igt_assert(ptr);
> > return ptr;
> > }
> > +
> > +bool gem_has_ggtt(int i915)
>
> nit: I would put mapping or map or something in the name to make it
> clear that the mapping is not accessible but, your call :).
I could go with has_ggtt_aperture()? Or has_mappable_ggtt()?
Both have their merits. Leaning towards has_mappable_ggtt.
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Intel-gfx] [PATCH i-g-t] i915: Mark up a few more tests that only target GGTT
2019-11-12 18:21 ` Chris Wilson
@ 2019-11-12 18:21 ` Chris Wilson
2019-11-12 18:23 ` Antonio Argenziano
1 sibling, 0 replies; 8+ messages in thread
From: Chris Wilson @ 2019-11-12 18:21 UTC (permalink / raw)
To: Antonio Argenziano, intel-gfx; +Cc: igt-dev
Quoting Antonio Argenziano (2019-11-12 18:17:41)
>
>
> On 12/11/19 07:47, Chris Wilson wrote:
> > If a test is only targeting the GGTT API and its corner cases, it can
> > only run if we have a mappable aperture.
> >
> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > Cc: Antonio Argenziano <antonio.argenziano@intel.com>
> > ---
> > lib/i915/gem_mman.c | 19 +++++++++++++++++++
> > lib/i915/gem_mman.h | 3 +++
> > tests/i915/gem_gtt_cpu_tlb.c | 1 +
> > tests/i915/gem_gtt_hog.c | 1 +
> > tests/i915/gem_gtt_speed.c | 2 ++
> > tests/i915/gem_mmap_gtt.c | 5 +----
> > tests/i915/gem_tiled_swapping.c | 1 +
> > 7 files changed, 28 insertions(+), 4 deletions(-)
> >
> > diff --git a/lib/i915/gem_mman.c b/lib/i915/gem_mman.c
> > index 3cf9a6bbd..76d0be82e 100644
> > --- a/lib/i915/gem_mman.c
> > +++ b/lib/i915/gem_mman.c
> > @@ -252,3 +252,22 @@ void *gem_mmap__cpu(int fd, uint32_t handle, uint64_t offset, uint64_t size, uns
> > igt_assert(ptr);
> > return ptr;
> > }
> > +
> > +bool gem_has_ggtt(int i915)
>
> nit: I would put mapping or map or something in the name to make it
> clear that the mapping is not accessible but, your call :).
I could go with has_ggtt_aperture()? Or has_mappable_ggtt()?
Both have their merits. Leaning towards has_mappable_ggtt.
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH i-g-t] i915: Mark up a few more tests that only target GGTT
2019-11-12 18:21 ` Chris Wilson
2019-11-12 18:21 ` [Intel-gfx] " Chris Wilson
@ 2019-11-12 18:23 ` Antonio Argenziano
2019-11-12 18:23 ` [Intel-gfx] " Antonio Argenziano
1 sibling, 1 reply; 8+ messages in thread
From: Antonio Argenziano @ 2019-11-12 18:23 UTC (permalink / raw)
To: Chris Wilson, intel-gfx; +Cc: igt-dev
On 12/11/19 10:21, Chris Wilson wrote:
> Quoting Antonio Argenziano (2019-11-12 18:17:41)
>>
>>
>> On 12/11/19 07:47, Chris Wilson wrote:
>>> If a test is only targeting the GGTT API and its corner cases, it can
>>> only run if we have a mappable aperture.
>>>
>>> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
>>> Cc: Antonio Argenziano <antonio.argenziano@intel.com>
>>> ---
>>> lib/i915/gem_mman.c | 19 +++++++++++++++++++
>>> lib/i915/gem_mman.h | 3 +++
>>> tests/i915/gem_gtt_cpu_tlb.c | 1 +
>>> tests/i915/gem_gtt_hog.c | 1 +
>>> tests/i915/gem_gtt_speed.c | 2 ++
>>> tests/i915/gem_mmap_gtt.c | 5 +----
>>> tests/i915/gem_tiled_swapping.c | 1 +
>>> 7 files changed, 28 insertions(+), 4 deletions(-)
>>>
>>> diff --git a/lib/i915/gem_mman.c b/lib/i915/gem_mman.c
>>> index 3cf9a6bbd..76d0be82e 100644
>>> --- a/lib/i915/gem_mman.c
>>> +++ b/lib/i915/gem_mman.c
>>> @@ -252,3 +252,22 @@ void *gem_mmap__cpu(int fd, uint32_t handle, uint64_t offset, uint64_t size, uns
>>> igt_assert(ptr);
>>> return ptr;
>>> }
>>> +
>>> +bool gem_has_ggtt(int i915)
>>
>> nit: I would put mapping or map or something in the name to make it
>> clear that the mapping is not accessible but, your call :).
>
> I could go with has_ggtt_aperture()? Or has_mappable_ggtt()?
> Both have their merits. Leaning towards has_mappable_ggtt.
+1 has_mappable_ggtt.
> -Chris
>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Intel-gfx] [PATCH i-g-t] i915: Mark up a few more tests that only target GGTT
2019-11-12 18:23 ` Antonio Argenziano
@ 2019-11-12 18:23 ` Antonio Argenziano
0 siblings, 0 replies; 8+ messages in thread
From: Antonio Argenziano @ 2019-11-12 18:23 UTC (permalink / raw)
To: Chris Wilson, intel-gfx; +Cc: igt-dev
On 12/11/19 10:21, Chris Wilson wrote:
> Quoting Antonio Argenziano (2019-11-12 18:17:41)
>>
>>
>> On 12/11/19 07:47, Chris Wilson wrote:
>>> If a test is only targeting the GGTT API and its corner cases, it can
>>> only run if we have a mappable aperture.
>>>
>>> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
>>> Cc: Antonio Argenziano <antonio.argenziano@intel.com>
>>> ---
>>> lib/i915/gem_mman.c | 19 +++++++++++++++++++
>>> lib/i915/gem_mman.h | 3 +++
>>> tests/i915/gem_gtt_cpu_tlb.c | 1 +
>>> tests/i915/gem_gtt_hog.c | 1 +
>>> tests/i915/gem_gtt_speed.c | 2 ++
>>> tests/i915/gem_mmap_gtt.c | 5 +----
>>> tests/i915/gem_tiled_swapping.c | 1 +
>>> 7 files changed, 28 insertions(+), 4 deletions(-)
>>>
>>> diff --git a/lib/i915/gem_mman.c b/lib/i915/gem_mman.c
>>> index 3cf9a6bbd..76d0be82e 100644
>>> --- a/lib/i915/gem_mman.c
>>> +++ b/lib/i915/gem_mman.c
>>> @@ -252,3 +252,22 @@ void *gem_mmap__cpu(int fd, uint32_t handle, uint64_t offset, uint64_t size, uns
>>> igt_assert(ptr);
>>> return ptr;
>>> }
>>> +
>>> +bool gem_has_ggtt(int i915)
>>
>> nit: I would put mapping or map or something in the name to make it
>> clear that the mapping is not accessible but, your call :).
>
> I could go with has_ggtt_aperture()? Or has_mappable_ggtt()?
> Both have their merits. Leaning towards has_mappable_ggtt.
+1 has_mappable_ggtt.
> -Chris
>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2019-11-12 18:23 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-12 15:47 [PATCH i-g-t] i915: Mark up a few more tests that only target GGTT Chris Wilson
2019-11-12 15:47 ` [Intel-gfx] " Chris Wilson
2019-11-12 18:17 ` Antonio Argenziano
2019-11-12 18:17 ` [Intel-gfx] " Antonio Argenziano
2019-11-12 18:21 ` Chris Wilson
2019-11-12 18:21 ` [Intel-gfx] " Chris Wilson
2019-11-12 18:23 ` Antonio Argenziano
2019-11-12 18:23 ` [Intel-gfx] " Antonio Argenziano
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).