Both gem_linear_blits and gem_tiled_blit do not request the full 48b
GTT layout for their objects, restricting themselves to 4G. The
underlying test that they trigger eviction is unaffected by this
restriction, so we can simply reduce their memory requirements to fill
the low 4G GTT space and so allow them to run on 48b machines.

Signed-off-by: Chris Wilson <[email protected]>
---
 tests/gem_linear_blits.c | 18 ++++++++++++++----
 tests/gem_tiled_blits.c  | 16 ++++++++++++----
 2 files changed, 26 insertions(+), 8 deletions(-)

diff --git a/tests/gem_linear_blits.c b/tests/gem_linear_blits.c
index eccfbcdd..8297416c 100644
--- a/tests/gem_linear_blits.c
+++ b/tests/gem_linear_blits.c
@@ -215,6 +215,8 @@ static void run_test(int fd, int count)
        free(handle);
 }
 
+#define MAX_32b ((1ull << 32) - 4096)
+
 int main(int argc, char **argv)
 {
        int fd = 0;
@@ -230,20 +232,28 @@ int main(int argc, char **argv)
                run_test(fd, 2);
 
        igt_subtest("normal") {
-               int count;
+               uint64_t count;
 
-               count = 3 * gem_aperture_size(fd) / (1024*1024) / 2;
+               count = gem_aperture_size(fd);
+               if (count >> 32)
+                       count = MAX_32b;
+               count = 3 * count / (1024*1024) / 2;
                igt_require(count > 1);
                intel_require_memory(count, sizeof(linear), CHECK_RAM);
+
                run_test(fd, count);
        }
 
        igt_subtest("interruptible") {
-               int count;
+               uint64_t count;
 
-               count = 3 * gem_aperture_size(fd) / (1024*1024) / 2;
+               count = gem_aperture_size(fd);
+               if (count >> 32)
+                       count = MAX_32b;
+               count = 3 * count / (1024*1024) / 2;
                igt_require(count > 1);
                intel_require_memory(count, sizeof(linear), CHECK_RAM);
+
                igt_fork_signal_helper();
                run_test(fd, count);
                igt_stop_signal_helper();
diff --git a/tests/gem_tiled_blits.c b/tests/gem_tiled_blits.c
index 7dcfc962..a81226a1 100644
--- a/tests/gem_tiled_blits.c
+++ b/tests/gem_tiled_blits.c
@@ -192,6 +192,8 @@ static void run_test(int count)
        free(bo);
 }
 
+#define MAX_32b ((1ull << 32) - 4096)
+
 int fd;
 
 int main(int argc, char **argv)
@@ -212,9 +214,12 @@ int main(int argc, char **argv)
                run_test(2);
 
        igt_subtest("normal") {
-               int count;
+               uint64_t count;
 
-               count = 3 * gem_aperture_size(fd) / (1024*1024) / 2;
+               count = gem_aperture_size(fd);
+               if (count >> 32)
+                       count = MAX_32b;
+               count = 3 * count / (1024*1024) / 2;
                count += (count & 1) == 0;
                intel_require_memory(count, 1024*1024, CHECK_RAM);
 
@@ -222,9 +227,12 @@ int main(int argc, char **argv)
        }
 
        igt_subtest("interruptible") {
-               int count;
+               uint64_t count;
 
-               count = 3 * gem_aperture_size(fd) / (1024*1024) / 2;
+               count = gem_aperture_size(fd);
+               if (count >> 32)
+                       count = MAX_32b;
+               count = 3 * count / (1024*1024) / 2;
                count += (count & 1) == 0;
                intel_require_memory(count, 1024*1024, CHECK_RAM);
 
-- 
2.14.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reply via email to