summaryrefslogtreecommitdiff
path: root/tests/gem_tiled_blits.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/gem_tiled_blits.c')
-rw-r--r--tests/gem_tiled_blits.c16
1 files changed, 12 insertions, 4 deletions
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);