public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t] i915/gem_pread/pwrite: Skip gtt test on self for missing mappable gtt
@ 2019-11-14 17:08 Zbigniew Kempczyński
  2019-11-14 17:12 ` Chris Wilson
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Zbigniew Kempczyński @ 2019-11-14 17:08 UTC (permalink / raw)
  To: igt-dev

Some tests are designed to use GGTT API which should be skipped
when HW doesn't support mappable aperture.

Gem pread / pwrite "self" test is one of them.

Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
---
 tests/i915/gem_pread.c  | 3 ++-
 tests/i915/gem_pwrite.c | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/tests/i915/gem_pread.c b/tests/i915/gem_pread.c
index 0d3e10b8..5b926ab0 100644
--- a/tests/i915/gem_pread.c
+++ b/tests/i915/gem_pread.c
@@ -52,13 +52,14 @@ static void *wrap_gem_mmap__gtt(int i915, uint32_t handle,
 
 static void pread_self(int i915)
 {
+	int start = gem_has_mappable_ggtt(i915) ? 0 : 1;
 	static const mmap_fn_t mmap_fn[] = {
 		wrap_gem_mmap__gtt,
 		gem_mmap__cpu,
 		gem_mmap__wc,
 		NULL
 	};
-	for (const mmap_fn_t *fn = mmap_fn; *fn; fn++) {
+	for (const mmap_fn_t *fn = mmap_fn + start; *fn; fn++) {
 		uint32_t handle = gem_create(i915, MiB(4));
 		void *ptr = (*fn)(i915, handle, 0, MiB(4), PROT_WRITE);
 
diff --git a/tests/i915/gem_pwrite.c b/tests/i915/gem_pwrite.c
index 37e97879..69f823d5 100644
--- a/tests/i915/gem_pwrite.c
+++ b/tests/i915/gem_pwrite.c
@@ -52,13 +52,14 @@ static void *wrap_gem_mmap__gtt(int i915, uint32_t handle,
 
 static void pwrite_self(int i915)
 {
+	int start = gem_has_mappable_ggtt(i915) ? 0 : 1;
 	static const mmap_fn_t mmap_fn[] = {
 		wrap_gem_mmap__gtt,
 		gem_mmap__cpu,
 		gem_mmap__wc,
 		NULL
 	};
-	for (const mmap_fn_t *fn = mmap_fn; *fn; fn++) {
+	for (const mmap_fn_t *fn = mmap_fn + start; *fn; fn++) {
 		uint32_t handle = gem_create(i915, MiB(4));
 		void *ptr = (*fn)(i915, handle, 0, MiB(4), PROT_READ);
 
-- 
2.23.0

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

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

end of thread, other threads:[~2019-11-15 18:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-11-14 17:08 [igt-dev] [PATCH i-g-t] i915/gem_pread/pwrite: Skip gtt test on self for missing mappable gtt Zbigniew Kempczyński
2019-11-14 17:12 ` Chris Wilson
2019-11-14 17:46 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2019-11-15 18:37 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork

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