diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2017-09-12 16:10:56 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2018-01-16 15:12:54 +0000 |
commit | 5f5b4a65e672bd10a4422cc1cb3c466659c52db8 (patch) | |
tree | 04e86f8c752b4fdcc07ea4b57c21d1969e25cce7 | |
parent | 7b685d5790c1770eeac43c17d6b207a6df602985 (diff) |
igt/gem_linear_blits: Compute GTT size using 4G limit
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.
v2: gem_tiled_fenced_blits as well
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
-rw-r--r-- | tests/gem_linear_blits.c | 18 | ||||
-rw-r--r-- | tests/gem_tiled_blits.c | 16 | ||||
-rw-r--r-- | tests/gem_tiled_fence_blits.c | 11 |
3 files changed, 35 insertions, 10 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); diff --git a/tests/gem_tiled_fence_blits.c b/tests/gem_tiled_fence_blits.c index eb6473bc..51f672fd 100644 --- a/tests/gem_tiled_fence_blits.c +++ b/tests/gem_tiled_fence_blits.c @@ -160,9 +160,11 @@ static void run_test (int fd, int count) drm_intel_bufmgr_destroy(bufmgr); } +#define MAX_32b ((1ull << 32) - 4096) + igt_main { - int fd, count; + int fd; igt_fixture { fd = drm_open_driver(DRIVER_INTEL); @@ -177,7 +179,12 @@ igt_main igt_skip_on_simulation(); igt_subtest("normal") { - count = 3 * gem_aperture_size(fd) / (bo_size) / 2; + uint64_t count; + + count = gem_aperture_size(fd); + if (count >> 32) + count = MAX_32b; + count = 3 * count / bo_size / 2; intel_require_memory(count, bo_size, CHECK_RAM); run_test(fd, count); } |