summaryrefslogtreecommitdiff
path: root/tests/i915
diff options
context:
space:
mode:
authorRob Clark <robdclark@chromium.org>2022-05-21 10:57:02 -0700
committerRob Clark <robdclark@chromium.org>2022-05-31 14:05:16 -0700
commit5857938d4d3539deb43ecb03604b7c664b75e57d (patch)
treecdf66e4b2ed29d192503e81291dd35cf0ae38fbc /tests/i915
parent9ce1c981ab12b2036cce6eeaa725e724c8e51668 (diff)
igt: Promote/rename OS helpers
Promote intel_os.c helpers to igt_os.c, so that I can re-use them for some additional msm tests. Just big churny rename, no functional change. Signed-off-by: Rob Clark <robdclark@chromium.org> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
Diffstat (limited to 'tests/i915')
-rw-r--r--tests/i915/gem_busy.c2
-rw-r--r--tests/i915/gem_concurrent_all.c8
-rw-r--r--tests/i915/gem_create.c2
-rw-r--r--tests/i915/gem_ctx_create.c4
-rw-r--r--tests/i915/gem_ctx_exec.c2
-rw-r--r--tests/i915/gem_evict_alignment.c4
-rw-r--r--tests/i915/gem_evict_everything.c8
-rw-r--r--tests/i915/gem_exec_alignment.c8
-rw-r--r--tests/i915/gem_exec_await.c2
-rw-r--r--tests/i915/gem_exec_big.c6
-rw-r--r--tests/i915/gem_exec_capture.c8
-rw-r--r--tests/i915/gem_exec_gttfill.c2
-rw-r--r--tests/i915/gem_exec_params.c2
-rw-r--r--tests/i915/gem_exec_reloc.c2
-rw-r--r--tests/i915/gem_linear_blits.c2
-rw-r--r--tests/i915/gem_lmem_swapping.c6
-rw-r--r--tests/i915/gem_mmap.c4
-rw-r--r--tests/i915/gem_mmap_gtt.c6
-rw-r--r--tests/i915/gem_mmap_offset.c2
-rw-r--r--tests/i915/gem_ppgtt.c4
-rw-r--r--tests/i915/gem_pwrite.c8
-rw-r--r--tests/i915/gem_render_linear_blits.c10
-rw-r--r--tests/i915/gem_render_tiled_blits.c10
-rw-r--r--tests/i915/gem_shrink.c6
-rw-r--r--tests/i915/gem_softpin.c4
-rw-r--r--tests/i915/gem_tiled_blits.c2
-rw-r--r--tests/i915/gem_tiled_fence_blits.c2
-rw-r--r--tests/i915/gem_tiled_pread_pwrite.c2
-rw-r--r--tests/i915/gem_tiled_swapping.c20
-rw-r--r--tests/i915/gem_userptr_blits.c20
-rw-r--r--tests/i915/gen3_mixed_blits.c2
-rw-r--r--tests/i915/gen3_render_linear_blits.c2
-rw-r--r--tests/i915/gen3_render_mixed_blits.c2
-rw-r--r--tests/i915/gen3_render_tiledx_blits.c2
-rw-r--r--tests/i915/gen3_render_tiledy_blits.c2
-rw-r--r--tests/i915/gen7_exec_parse.c2
-rw-r--r--tests/i915/gen9_exec_parse.c6
-rw-r--r--tests/i915/i915_suspend.c6
-rw-r--r--tests/i915/kms_big_fb.c2
39 files changed, 97 insertions, 97 deletions
diff --git a/tests/i915/gem_busy.c b/tests/i915/gem_busy.c
index b8a61084..603691f2 100644
--- a/tests/i915/gem_busy.c
+++ b/tests/i915/gem_busy.c
@@ -253,7 +253,7 @@ static void close_race(int fd, const intel_ctx_t *ctx)
int i;
igt_require(ncpus > 1);
- intel_require_memory(nhandles, 4096, CHECK_RAM);
+ igt_require_memory(nhandles, 4096, CHECK_RAM);
/*
* One thread spawning work and randomly closing handles.
diff --git a/tests/i915/gem_concurrent_all.c b/tests/i915/gem_concurrent_all.c
index 2b1788e1..25b7daf8 100644
--- a/tests/i915/gem_concurrent_all.c
+++ b/tests/i915/gem_concurrent_all.c
@@ -375,7 +375,7 @@ static void create_dmabuf_require(const struct create *create, unsigned count)
close(args.fd);
}
igt_require(has_dmabuf);
- intel_require_files(2*count);
+ igt_require_files(2*count);
}
struct dmabuf {
@@ -1765,7 +1765,7 @@ num_buffers(uint64_t max,
if (c->require)
c->require(c, n);
- intel_require_memory(2*n, size, allow_mem);
+ igt_require_memory(2*n, size, allow_mem);
return n;
}
@@ -1986,8 +1986,8 @@ igt_main
c->name, s->name, "swap");
igt_subtest_group {
igt_fixture {
- if (intel_get_avail_ram_mb() > gem_mappable_aperture_size(fd)/(1024*1024)) {
- pin_sz = intel_get_avail_ram_mb() - gem_mappable_aperture_size(fd)/(1024*1024);
+ if (igt_get_avail_ram_mb() > gem_mappable_aperture_size(fd)/(1024*1024)) {
+ pin_sz = igt_get_avail_ram_mb() - gem_mappable_aperture_size(fd)/(1024*1024);
igt_debug("Pinning %lld MiB\n", (long long)pin_sz);
pin_sz *= 1024 * 1024;
diff --git a/tests/i915/gem_create.c b/tests/i915/gem_create.c
index 31fd6526..b61c594b 100644
--- a/tests/i915/gem_create.c
+++ b/tests/i915/gem_create.c
@@ -224,7 +224,7 @@ static void always_clear(int i915, int timeout)
struct thread_clear arg = {
.i915 = i915,
.timeout = timeout,
- .max = intel_get_avail_ram_mb() << (20 - 12), /* in pages */
+ .max = igt_get_avail_ram_mb() << (20 - 12), /* in pages */
};
const int ncpus = sysconf(_SC_NPROCESSORS_ONLN);
unsigned long checked;
diff --git a/tests/i915/gem_ctx_create.c b/tests/i915/gem_ctx_create.c
index 814beb4a..39f070af 100644
--- a/tests/i915/gem_ctx_create.c
+++ b/tests/i915/gem_ctx_create.c
@@ -283,9 +283,9 @@ static unsigned context_size(int fd)
static uint64_t total_avail_mem(unsigned mode)
{
- uint64_t total = intel_get_avail_ram_mb();
+ uint64_t total = igt_get_avail_ram_mb();
if (mode & CHECK_SWAP)
- total += intel_get_total_swap_mb();
+ total += igt_get_total_swap_mb();
return total << 20;
}
diff --git a/tests/i915/gem_ctx_exec.c b/tests/i915/gem_ctx_exec.c
index 1f3d1a44..3d94f01d 100644
--- a/tests/i915/gem_ctx_exec.c
+++ b/tests/i915/gem_ctx_exec.c
@@ -77,7 +77,7 @@ static void big_exec(int fd, uint32_t handle, int ring)
int i;
/* Make sure we only fill half of RAM with gem objects. */
- igt_require(intel_get_total_ram_mb() * 1024 / 2 > num_buffers * 4);
+ igt_require(igt_get_total_ram_mb() * 1024 / 2 > num_buffers * 4);
gem_exec = calloc(num_buffers + 1, sizeof(*gem_exec));
igt_assert(gem_exec);
diff --git a/tests/i915/gem_evict_alignment.c b/tests/i915/gem_evict_alignment.c
index 4a05f7cd..0b560ab0 100644
--- a/tests/i915/gem_evict_alignment.c
+++ b/tests/i915/gem_evict_alignment.c
@@ -135,7 +135,7 @@ static void minor_evictions(int fd, uint64_t size, uint64_t count)
uint64_t n, m, alignment;
int pass, fail;
- intel_require_memory(2 * count, size, CHECK_RAM);
+ igt_require_memory(2 * count, size, CHECK_RAM);
bo = malloc(3*count*sizeof(*bo));
igt_assert(bo);
@@ -166,7 +166,7 @@ static void major_evictions(int fd, uint64_t size, uint64_t count)
int loop;
uint32_t *bo;
- intel_require_memory(count, size, CHECK_RAM);
+ igt_require_memory(count, size, CHECK_RAM);
bo = malloc(count*sizeof(*bo));
igt_assert(bo);
diff --git a/tests/i915/gem_evict_everything.c b/tests/i915/gem_evict_everything.c
index 37343b53..120f8907 100644
--- a/tests/i915/gem_evict_everything.c
+++ b/tests/i915/gem_evict_everything.c
@@ -144,8 +144,8 @@ static void test_forking_evictions(int fd, uint64_t size, uint64_t count,
{
uint64_t trash_count;
- trash_count = intel_get_total_ram_mb() * 11 / 10;
- intel_require_memory(trash_count, size, CHECK_RAM | CHECK_SWAP);
+ trash_count = igt_get_total_ram_mb() * 11 / 10;
+ igt_require_memory(trash_count, size, CHECK_RAM | CHECK_SWAP);
forking_evictions(fd, &fault_ops, size, count, trash_count, flags);
}
@@ -159,8 +159,8 @@ static void test_swapping_evictions(int fd, uint64_t size, uint64_t count)
{
int trash_count;
- trash_count = intel_get_total_ram_mb() * 11 / 10;
- intel_require_memory(trash_count, size, CHECK_RAM | CHECK_SWAP);
+ trash_count = igt_get_total_ram_mb() * 11 / 10;
+ igt_require_memory(trash_count, size, CHECK_RAM | CHECK_SWAP);
swapping_evictions(fd, &fault_ops, size, count, trash_count);
}
diff --git a/tests/i915/gem_exec_alignment.c b/tests/i915/gem_exec_alignment.c
index c88fc327..3e5f9d52 100644
--- a/tests/i915/gem_exec_alignment.c
+++ b/tests/i915/gem_exec_alignment.c
@@ -166,13 +166,13 @@ naughty_child(int i915, int link, uint32_t shared, unsigned int flags)
if (!gem_uses_full_ppgtt(i915))
gtt_size /= 2; /* We have to *share* our GTT! */
- ram_size = min_t(uint64_t, intel_get_total_ram_mb(), 4096);
+ ram_size = min_t(uint64_t, igt_get_total_ram_mb(), 4096);
ram_size *= 1024 * 1024;
count = min(gtt_size, ram_size) / 16384;
if (count > file_max()) /* vfs cap */
count = file_max();
- intel_require_memory(count, 4096, CHECK_RAM);
+ igt_require_memory(count, 4096, CHECK_RAM);
flags = 0;
if ((gtt_size - 1) >> 32)
@@ -376,13 +376,13 @@ setup_many(int i915, unsigned long *out)
if (!gem_uses_full_ppgtt(i915))
gtt_size /= 2; /* We have to *share* our GTT! */
- ram_size = min_t(uint64_t, intel_get_total_ram_mb(), 4096);
+ ram_size = min_t(uint64_t, igt_get_total_ram_mb(), 4096);
ram_size *= 1024 * 1024;
count = min(gtt_size, ram_size) / 16384;
if (count > file_max()) /* vfs cap */
count = file_max();
- intel_require_memory(count, 4096, CHECK_RAM);
+ igt_require_memory(count, 4096, CHECK_RAM);
obj = calloc(sizeof(*obj), count);
igt_assert(obj);
diff --git a/tests/i915/gem_exec_await.c b/tests/i915/gem_exec_await.c
index fe176595..4935cf39 100644
--- a/tests/i915/gem_exec_await.c
+++ b/tests/i915/gem_exec_await.c
@@ -88,7 +88,7 @@ static void wide(int fd, const intel_ctx_t *ctx, int ring_size,
exec = calloc(nengine, sizeof(*exec));
igt_assert(exec);
- intel_require_memory(nengine*(2 + ring_size), 4096, CHECK_RAM);
+ igt_require_memory(nengine*(2 + ring_size), 4096, CHECK_RAM);
obj = calloc(nengine*ring_size + 1, sizeof(*obj));
igt_assert(obj);
diff --git a/tests/i915/gem_exec_big.c b/tests/i915/gem_exec_big.c
index 2f47de39..4619bda8 100644
--- a/tests/i915/gem_exec_big.c
+++ b/tests/i915/gem_exec_big.c
@@ -221,7 +221,7 @@ static void exhaustive(int fd)
max = 3 * gem_aperture_size(fd) / 4;
ggtt_max = 3 * gem_global_aperture_size(fd) / 4;
- intel_require_memory(1, max, CHECK_RAM);
+ igt_require_memory(1, max, CHECK_RAM);
for (batch_size = 4096; batch_size <= max; ) {
uint32_t handle;
@@ -278,7 +278,7 @@ static void single(int i915)
uint32_t handle;
void *ptr;
- batch_size = (intel_get_avail_ram_mb() / 2) << 20; /* XXX CI slack? */
+ batch_size = (igt_get_avail_ram_mb() / 2) << 20; /* XXX CI slack? */
limit = gem_aperture_size(i915) - (256 << 10); /* low pages reserved */
if (!gem_uses_full_ppgtt(i915))
limit = 3 * limit / 4;
@@ -289,7 +289,7 @@ static void single(int i915)
batch_size >> 20,
gem_uses_full_ppgtt(i915) ? "" : "shared ",
gem_aperture_size(i915) >> 20);
- intel_require_memory(1, batch_size, CHECK_RAM);
+ igt_require_memory(1, batch_size, CHECK_RAM);
handle = gem_create(i915, batch_size);
gem_write(i915, handle, 0, &bbe, sizeof(bbe));
diff --git a/tests/i915/gem_exec_capture.c b/tests/i915/gem_exec_capture.c
index 60f8df04..89534146 100644
--- a/tests/i915/gem_exec_capture.c
+++ b/tests/i915/gem_exec_capture.c
@@ -597,14 +597,14 @@ static void many(int fd, int dir, uint64_t size, unsigned int flags)
find_first_available_engine(fd, ctx, e, saved_engine);
gtt = gem_aperture_size(fd) / size;
- ram = (intel_get_avail_ram_mb() << 20) / size;
+ ram = (igt_get_avail_ram_mb() << 20) / size;
igt_debug("Available objects in GTT:%"PRIu64", RAM:%"PRIu64"\n",
gtt, ram);
count = min(gtt, ram) / 4;
igt_require(count > 1);
- intel_require_memory(count, size, CHECK_RAM);
+ igt_require_memory(count, size, CHECK_RAM);
ahnd = get_reloc_ahnd(fd, ctx->id);
offsets = __captureN(fd, dir, ahnd, ctx, e, size, count, flags, NULL);
@@ -646,7 +646,7 @@ static void prioinv(int fd, int dir, const intel_ctx_t *ctx,
igt_require(gem_gpu_reset_type(fd) > 1);
gtt = gem_aperture_size(fd) / size;
- ram = (intel_get_avail_ram_mb() << 20) / size;
+ ram = (igt_get_avail_ram_mb() << 20) / size;
igt_debug("Available objects in GTT:%"PRIu64", RAM:%"PRIu64"\n",
gtt, ram);
@@ -654,7 +654,7 @@ static void prioinv(int fd, int dir, const intel_ctx_t *ctx,
count = min(count, 256ul); /* Keep the duration within reason */
igt_require(count > 1);
- intel_require_memory(count, size, CHECK_RAM);
+ igt_require_memory(count, size, CHECK_RAM);
saved_engine = configure_hangs(fd, e, ctx->id);
diff --git a/tests/i915/gem_exec_gttfill.c b/tests/i915/gem_exec_gttfill.c
index 4557142d..80634304 100644
--- a/tests/i915/gem_exec_gttfill.c
+++ b/tests/i915/gem_exec_gttfill.c
@@ -158,7 +158,7 @@ static void fillgtt(int fd, const intel_ctx_t *ctx, unsigned ring, int timeout)
count = size / BATCH_SIZE + 1;
igt_debug("Using %'d batches to fill %'llu aperture on %d engines\n",
count, (long long)size, nengine);
- intel_require_memory(count, BATCH_SIZE, CHECK_RAM);
+ igt_require_memory(count, BATCH_SIZE, CHECK_RAM);
intel_detect_and_clear_missed_interrupts(fd);
igt_nsec_elapsed(&tv);
diff --git a/tests/i915/gem_exec_params.c b/tests/i915/gem_exec_params.c
index da36af74..618635ec 100644
--- a/tests/i915/gem_exec_params.c
+++ b/tests/i915/gem_exec_params.c
@@ -346,7 +346,7 @@ static void test_larger_than_life_batch(int fd)
* checking to that subset of machines.
*/
igt_require(size < gem_aperture_size(fd));
- intel_require_memory(2, size, CHECK_RAM); /* batch + shadow */
+ igt_require_memory(2, size, CHECK_RAM); /* batch + shadow */
exec.handle = batch_create_size(fd, size);
diff --git a/tests/i915/gem_exec_reloc.c b/tests/i915/gem_exec_reloc.c
index 03d65dc6..1f5d13e4 100644
--- a/tests/i915/gem_exec_reloc.c
+++ b/tests/i915/gem_exec_reloc.c
@@ -134,7 +134,7 @@ static void from_mmap(int fd, uint64_t size, enum mode mode)
/* Worst case is that the kernel has to copy the entire incoming
* reloc[], so double the memory requirements.
*/
- intel_require_memory(2, size, CHECK_RAM);
+ igt_require_memory(2, size, CHECK_RAM);
memset(&obj, 0, sizeof(obj));
obj.handle = gem_create(fd, 4096);
diff --git a/tests/i915/gem_linear_blits.c b/tests/i915/gem_linear_blits.c
index 9f049863..1fd5b733 100644
--- a/tests/i915/gem_linear_blits.c
+++ b/tests/i915/gem_linear_blits.c
@@ -252,7 +252,7 @@ igt_main
count = 3 + count / (1024*1024);
igt_require(count > 1);
- intel_require_memory(count, sizeof(linear), CHECK_RAM);
+ igt_require_memory(count, sizeof(linear), CHECK_RAM);
igt_debug("Using %'"PRIu64" 1MiB buffers\n", count);
count = (count + ncpus - 1) / ncpus;
diff --git a/tests/i915/gem_lmem_swapping.c b/tests/i915/gem_lmem_swapping.c
index 5d93e9da..21c2bf72 100644
--- a/tests/i915/gem_lmem_swapping.c
+++ b/tests/i915/gem_lmem_swapping.c
@@ -476,7 +476,7 @@ static void fill_params(int i915, struct params *params,
bool do_oom_test)
{
const int swap_mb = /* For lmem, swap is total of smem + swap. */
- intel_get_total_ram_mb() + intel_get_total_swap_mb();
+ igt_get_total_ram_mb() + igt_get_total_swap_mb();
const unsigned int size = 1 << 20;
const int max_swap_pct = 75;
/*
@@ -631,8 +631,8 @@ static void test_smem_oom(int i915,
const intel_ctx_t *ctx,
struct drm_i915_memory_region_info *region)
{
- const uint64_t smem_size = intel_get_total_ram_mb() +
- intel_get_total_swap_mb();
+ const uint64_t smem_size = igt_get_total_ram_mb() +
+ igt_get_total_swap_mb();
const unsigned int alloc = 256 * 1024 * 1024;
const unsigned int num_alloc = 1 + smem_size / (alloc >> 20);
struct igt_helper_process smem_proc = {};
diff --git a/tests/i915/gem_mmap.c b/tests/i915/gem_mmap.c
index 297ae3ad..61f862a8 100644
--- a/tests/i915/gem_mmap.c
+++ b/tests/i915/gem_mmap.c
@@ -66,13 +66,13 @@ test_huge_bo(int huge)
huge_object_size = gem_aperture_size(fd) + PAGE_SIZE;
break;
case 2:
- huge_object_size = (intel_get_total_ram_mb() + 1) << 20;
+ huge_object_size = (igt_get_total_ram_mb() + 1) << 20;
check |= CHECK_SWAP;
break;
default:
return;
}
- intel_require_memory(1, huge_object_size, check);
+ igt_require_memory(1, huge_object_size, check);
last_offset = huge_object_size - PAGE_SIZE;
diff --git a/tests/i915/gem_mmap_gtt.c b/tests/i915/gem_mmap_gtt.c
index 92bbb5d2..6db82229 100644
--- a/tests/i915/gem_mmap_gtt.c
+++ b/tests/i915/gem_mmap_gtt.c
@@ -946,7 +946,7 @@ test_huge_bo(int fd, int huge, int tiling)
size = gem_global_aperture_size(fd) + PAGE_SIZE;
break;
}
- intel_require_memory(1, size, CHECK_RAM);
+ igt_require_memory(1, size, CHECK_RAM);
last_offset = size - PAGE_SIZE;
@@ -1033,11 +1033,11 @@ test_huge_copy(int fd, int huge, int tiling_a, int tiling_b, int ncpus)
huge_object_size = gem_global_aperture_size(fd) + PAGE_SIZE;
break;
default:
- huge_object_size = (intel_get_total_ram_mb() << 19) + PAGE_SIZE;
+ huge_object_size = (igt_get_total_ram_mb() << 19) + PAGE_SIZE;
mode |= CHECK_SWAP;
break;
}
- intel_require_memory(2*ncpus, huge_object_size, mode);
+ igt_require_memory(2*ncpus, huge_object_size, mode);
igt_fork(child, ncpus) {
uint64_t valid_size = huge_object_size;
diff --git a/tests/i915/gem_mmap_offset.c b/tests/i915/gem_mmap_offset.c
index abb6ee4e..5e6b19eb 100644
--- a/tests/i915/gem_mmap_offset.c
+++ b/tests/i915/gem_mmap_offset.c
@@ -599,7 +599,7 @@ static void always_clear(int i915, int timeout)
struct thread_clear arg = {
.i915 = i915,
.timeout = timeout,
- .max = intel_get_avail_ram_mb() << (20 - 12), /* in pages */
+ .max = igt_get_avail_ram_mb() << (20 - 12), /* in pages */
};
const int ncpus = sysconf(_SC_NPROCESSORS_ONLN);
unsigned long checked;
diff --git a/tests/i915/gem_ppgtt.c b/tests/i915/gem_ppgtt.c
index 4c9691e3..0a06e9ec 100644
--- a/tests/i915/gem_ppgtt.c
+++ b/tests/i915/gem_ppgtt.c
@@ -284,7 +284,7 @@ igt_main
uint64_t mem_per_test;
mem_per_test = SIZE;
- intel_require_memory(nchild + 1, mem_per_test, CHECK_RAM);
+ igt_require_memory(nchild + 1, mem_per_test, CHECK_RAM);
rcs = calloc(sizeof(*rcs), nchild);
igt_assert(rcs);
@@ -311,7 +311,7 @@ igt_main
igt_require(has_contexts());
mem_per_test = SIZE + mem_per_ctx;
- intel_require_memory(1 + nchild, mem_per_test, CHECK_RAM);
+ igt_require_memory(1 + nchild, mem_per_test, CHECK_RAM);
rcs = calloc(sizeof(*rcs), nchild);
igt_assert(rcs);
diff --git a/tests/i915/gem_pwrite.c b/tests/i915/gem_pwrite.c
index e8e8c7ad..6e3f833c 100644
--- a/tests/i915/gem_pwrite.c
+++ b/tests/i915/gem_pwrite.c
@@ -139,7 +139,7 @@ static void test_big_cpu(int fd, int scale, unsigned flags)
size = gem_aperture_size(fd) + 4096;
break;
}
- intel_require_memory(1, size, CHECK_RAM);
+ igt_require_memory(1, size, CHECK_RAM);
handle = gem_create(fd, size);
gem_set_domain(fd, handle, I915_GEM_DOMAIN_CPU, I915_GEM_DOMAIN_CPU);
@@ -201,7 +201,7 @@ static void test_big_gtt(int fd, int scale, unsigned flags)
size = gem_aperture_size(fd) + 4096;
break;
}
- intel_require_memory(1, size, CHECK_RAM);
+ igt_require_memory(1, size, CHECK_RAM);
handle = gem_create(fd, size);
gem_set_domain(fd, handle, I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT);
@@ -256,9 +256,9 @@ static void test_random(int fd)
gem_require_mmap_wc(fd);
- size = min(intel_get_total_ram_mb() / 2,
+ size = min(igt_get_total_ram_mb() / 2,
gem_mappable_aperture_size(fd) + 4096);
- intel_require_memory(1, size, CHECK_RAM);
+ igt_require_memory(1, size, CHECK_RAM);
handle = gem_create(fd, size);
map = gem_mmap__wc(fd, handle, 0, size, PROT_WRITE);
diff --git a/tests/i915/gem_render_linear_blits.c b/tests/i915/gem_render_linear_blits.c
index 8e646127..d40593c6 100644
--- a/tests/i915/gem_render_linear_blits.c
+++ b/tests/i915/gem_render_linear_blits.c
@@ -176,7 +176,7 @@ igt_main
igt_subtest("aperture-thrash") {
count = 3 * gem_aperture_size(fd) / SIZE / 2;
- intel_require_memory(count, SIZE, CHECK_RAM);
+ igt_require_memory(count, SIZE, CHECK_RAM);
run_test(fd, count);
}
@@ -184,17 +184,17 @@ igt_main
igt_fork_shrink_helper(fd);
count = 3 * gem_aperture_size(fd) / SIZE / 2;
- intel_require_memory(count, SIZE, CHECK_RAM);
+ igt_require_memory(count, SIZE, CHECK_RAM);
run_test(fd, count);
igt_stop_shrink_helper();
}
igt_subtest("swap-thrash") {
- uint64_t swap_mb = intel_get_total_swap_mb();
+ uint64_t swap_mb = igt_get_total_swap_mb();
igt_require(swap_mb > 0);
- count = ((intel_get_avail_ram_mb() + (swap_mb / 2)) * 1024*1024) / SIZE;
- intel_require_memory(count, SIZE, CHECK_RAM | CHECK_SWAP);
+ count = ((igt_get_avail_ram_mb() + (swap_mb / 2)) * 1024*1024) / SIZE;
+ igt_require_memory(count, SIZE, CHECK_RAM | CHECK_SWAP);
run_test(fd, count);
}
}
diff --git a/tests/i915/gem_render_tiled_blits.c b/tests/i915/gem_render_tiled_blits.c
index 187714d6..13c1f37a 100644
--- a/tests/i915/gem_render_tiled_blits.c
+++ b/tests/i915/gem_render_tiled_blits.c
@@ -211,7 +211,7 @@ igt_main
igt_subtest("aperture-thrash") {
count = 3 * gem_aperture_size(fd) / SIZE / 2;
- intel_require_memory(count, SIZE, CHECK_RAM);
+ igt_require_memory(count, SIZE, CHECK_RAM);
run_test(fd, count);
}
@@ -219,17 +219,17 @@ igt_main
igt_fork_shrink_helper(fd);
count = 3 * gem_aperture_size(fd) / SIZE / 2;
- intel_require_memory(count, SIZE, CHECK_RAM);
+ igt_require_memory(count, SIZE, CHECK_RAM);
run_test(fd, count);
igt_stop_shrink_helper();
}
igt_subtest("swap-thrash") {
- uint64_t swap_mb = intel_get_total_swap_mb();
+ uint64_t swap_mb = igt_get_total_swap_mb();
igt_require(swap_mb > 0);
- count = ((intel_get_avail_ram_mb() + (swap_mb / 2)) * 1024*1024) / SIZE;
- intel_require_memory(count, SIZE, CHECK_RAM | CHECK_SWAP);
+ count = ((igt_get_avail_ram_mb() + (swap_mb / 2)) * 1024*1024) / SIZE;
+ igt_require_memory(count, SIZE, CHECK_RAM | CHECK_SWAP);
run_test(fd, count);
}
}
diff --git a/tests/i915/gem_shrink.c b/tests/i915/gem_shrink.c
index 729ddd7e..49df35c2 100644
--- a/tests/i915/gem_shrink.c
+++ b/tests/i915/gem_shrink.c
@@ -436,7 +436,7 @@ igt_main
igt_fixture {
const int ncpus = sysconf(_SC_NPROCESSORS_ONLN);
- uint64_t mem_size = intel_get_total_ram_mb();
+ uint64_t mem_size = igt_get_total_ram_mb();
int fd;
fd = drm_open_driver(DRIVER_INTEL);
@@ -455,8 +455,8 @@ igt_main
igt_info("Using %d processes and %'"PRIu64"MiB per process\n",
num_processes, alloc_size);
- intel_require_memory(num_processes, alloc_size,
- CHECK_SWAP | CHECK_RAM);
+ igt_require_memory(num_processes, alloc_size,
+ CHECK_SWAP | CHECK_RAM);
close(fd);
}
diff --git a/tests/i915/gem_softpin.c b/tests/i915/gem_softpin.c
index 00912fd3..489d528f 100644
--- a/tests/i915/gem_softpin.c
+++ b/tests/i915/gem_softpin.c
@@ -993,7 +993,7 @@ static void test_allocator_evict(int fd, const intel_ctx_t *ctx,
INTEL_ALLOCATOR_RELOC,
ALLOC_STRATEGY_NONE, 0);
- intel_require_memory(count, BATCH_SIZE, CHECK_RAM);
+ igt_require_memory(count, BATCH_SIZE, CHECK_RAM);
intel_detect_and_clear_missed_interrupts(fd);
igt_nsec_elapsed(&tv);
@@ -1116,7 +1116,7 @@ static void evict_single_offset(int fd, const intel_ctx_t *ctx, int timeout)
"%d engines (timeout: %d)\n", count, BATCH_SIZE >> 20,
(long long)size >> 20, nengine, timeout);
- intel_require_memory(count, BATCH_SIZE, CHECK_RAM);
+ igt_require_memory(count, BATCH_SIZE, CHECK_RAM);
intel_detect_and_clear_missed_interrupts(fd);
memset(&execbuf, 0, sizeof(execbuf));
diff --git a/tests/i915/gem_tiled_blits.c b/tests/i915/gem_tiled_blits.c
index c93d04d6..d6c91e6f 100644
--- a/tests/i915/gem_tiled_blits.c
+++ b/tests/i915/gem_tiled_blits.c
@@ -186,7 +186,7 @@ igt_main
count = MAX_32b;
count = 3 + count / (1024 * 1024);
igt_require(count > 1);
- intel_require_memory(count, 1024 * 1024 , CHECK_RAM);
+ igt_require_memory(count, 1024 * 1024 , CHECK_RAM);
igt_debug("Using %'"PRIu64" 1MiB buffers\n", count);
count = (count + ncpus - 1) / ncpus;
diff --git a/tests/i915/gem_tiled_fence_blits.c b/tests/i915/gem_tiled_fence_blits.c
index dc0ffc1e..0b69c0de 100644
--- a/tests/i915/gem_tiled_fence_blits.c
+++ b/tests/i915/gem_tiled_fence_blits.c
@@ -260,7 +260,7 @@ igt_main
end = count;
count = 3 + count / (1024 * 1024);
igt_require(count > 1);
- intel_require_memory(count, 1024 * 1024 , CHECK_RAM);
+ igt_require_memory(count, 1024 * 1024 , CHECK_RAM);
igt_debug("Using %'"PRIu64" 1MiB buffers\n", count);
count = (count + ncpus - 1) / ncpus;
diff --git a/tests/i915/gem_tiled_pread_pwrite.c b/tests/i915/gem_tiled_pread_pwrite.c
index f77cd3bd..2d21dfb7 100644
--- a/tests/i915/gem_tiled_pread_pwrite.c
+++ b/tests/i915/gem_tiled_pread_pwrite.c
@@ -117,7 +117,7 @@ igt_simple_main
gem_require_pread_pwrite(fd);
count = gem_available_fences(fd) + 1;
- intel_require_memory(2 * count, sizeof(linear), CHECK_RAM);
+ igt_require_memory(2 * count, sizeof(linear), CHECK_RAM);
for (int i = 0; i < count; i++) {
uint32_t handle, handle_target;
diff --git a/tests/i915/gem_tiled_swapping.c b/tests/i915/gem_tiled_swapping.c
index d66b6ca7..f4bdce73 100644
--- a/tests/i915/gem_tiled_swapping.c
+++ b/tests/i915/gem_tiled_swapping.c
@@ -177,27 +177,27 @@ igt_main
fd = drm_open_driver(DRIVER_INTEL);
gem_require_mappable_ggtt(fd);
- intel_purge_vm_caches(fd);
+ igt_purge_vm_caches(fd);
check_memory_layout(fd);
/* lock RAM, leaving only 512MB available */
- count = intel_get_total_ram_mb() - intel_get_avail_ram_mb();
+ count = igt_get_total_ram_mb() - igt_get_avail_ram_mb();
count = max(count + 64, AVAIL_RAM);
- count = intel_get_total_ram_mb() - count;
+ count = igt_get_total_ram_mb() - count;
lock_size = max_t(long, 0, count);
igt_info("Mlocking %zdMiB of %ld/%ldMiB\n",
lock_size,
- (long)intel_get_avail_ram_mb(),
- (long)intel_get_total_ram_mb());
+ (long)igt_get_avail_ram_mb(),
+ (long)igt_get_total_ram_mb());
igt_lock_mem(lock_size);
/* need slightly more than available memory */
- count = intel_get_avail_ram_mb() + 128;
+ count = igt_get_avail_ram_mb() + 128;
igt_info("Using %lu 1MiB objects (available RAM: %ld/%ld, swap: %ld)\n",
count,
- (long)intel_get_avail_ram_mb(),
- (long)intel_get_total_ram_mb(),
- (long)intel_get_total_swap_mb());
+ (long)igt_get_avail_ram_mb(),
+ (long)igt_get_total_ram_mb(),
+ (long)igt_get_total_swap_mb());
bo_handles = calloc(count, sizeof(uint32_t));
igt_assert(bo_handles);
@@ -206,7 +206,7 @@ igt_main
threads = calloc(num_threads, sizeof(struct thread));
igt_assert(threads);
- intel_require_memory(count, 1024*1024, CHECK_RAM | CHECK_SWAP);
+ igt_require_memory(count, 1024*1024, CHECK_RAM | CHECK_SWAP);
for (n = 0; n < count; n++) {
bo_handles[n] = create_bo(fd);
diff --git a/tests/i915/gem_userptr_blits.c b/tests/i915/gem_userptr_blits.c
index ec3f2755..1343b109 100644
--- a/tests/i915/gem_userptr_blits.c
+++ b/tests/i915/gem_userptr_blits.c
@@ -1541,7 +1541,7 @@ static int test_coherency(int fd, int count)
int i, ret;
igt_info("Using 2x%d 1MiB buffers\n", count);
- intel_require_memory(2*count, sizeof(linear), CHECK_RAM);
+ igt_require_memory(2*count, sizeof(linear), CHECK_RAM);
ret = posix_memalign((void **)&memory, PAGE_SIZE, count*sizeof(linear));
igt_assert(ret == 0 && memory);
@@ -1641,7 +1641,7 @@ static int can_swap(void)
else
as = 256 * 1024; /* Just a big number */
- ram = intel_get_total_ram_mb();
+ ram = igt_get_total_ram_mb();
if ((as - 128) < (ram - 256))
return 0;
@@ -1688,7 +1688,7 @@ static void test_forking_evictions(int fd, int size, int count,
igt_require(forked_userptr(fd));
- trash_count = intel_get_total_ram_mb() * 11 / 10;
+ trash_count = igt_get_total_ram_mb() * 11 / 10;
/* Use the fact test will spawn a number of child
* processes meaning swapping will be triggered system
* wide even if one process on it's own can't do it.
@@ -1716,7 +1716,7 @@ static void test_swapping_evictions(int fd, int size, int count)
igt_skip_on_f(!can_swap(),
"Not enough process address space for swapping tests.\n");
- trash_count = intel_get_total_ram_mb() * 11 / 10;
+ trash_count = igt_get_total_ram_mb() * 11 / 10;
swapping_evictions(fd, &fault_ops, size, count, trash_count);
reset_handle_ptr();
@@ -1934,7 +1934,7 @@ static void test_stress_purge(int fd, int timeout)
gem_set_domain(fd, handle,
I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT);
- intel_purge_vm_caches(fd);
+ igt_purge_vm_caches(fd);
gem_close(fd, handle);
}
@@ -2341,11 +2341,11 @@ igt_main_args("c:", NULL, help_str, opt_handler, NULL)
if (count == 0)
count = 2 * aperture_size / (1024*1024) / 3;
- total_ram = intel_get_total_ram_mb();
+ total_ram = igt_get_total_ram_mb();
igt_info("Total RAM is %'llu MiB\n", (long long)total_ram);
if (count > total_ram * 3 / 4) {
- count = intel_get_total_ram_mb() * 3 / 4;
+ count = igt_get_total_ram_mb() * 3 / 4;
igt_info("Not enough RAM to run test, reducing buffer count.\n");
}
}
@@ -2463,7 +2463,7 @@ igt_main_args("c:", NULL, help_str, opt_handler, NULL)
size = sizeof(linear);
count = 2 * gem_aperture_size(fd) / (1024*1024) / 3;
if (count > total_ram * 3 / 4)
- count = intel_get_total_ram_mb() * 3 / 4;
+ count = igt_get_total_ram_mb() * 3 / 4;
}
igt_fork_signal_helper();
@@ -2494,7 +2494,7 @@ igt_main_args("c:", NULL, help_str, opt_handler, NULL)
size = sizeof(linear);
count = 2 * gem_aperture_size(fd) / (1024*1024) / 3;
if (count > total_ram * 3 / 4)
- count = intel_get_total_ram_mb() * 3 / 4;
+ count = igt_get_total_ram_mb() * 3 / 4;
}
igt_subtest("process-exit")
@@ -2589,7 +2589,7 @@ igt_main_args("c:", NULL, help_str, opt_handler, NULL)
size = 1024 * 1024;
count = 2 * gem_aperture_size(fd) / (1024*1024) / 3;
if (count > total_ram * 3 / 4)
- count = intel_get_total_ram_mb() * 3 / 4;
+ count = igt_get_total_ram_mb() * 3 / 4;
}
igt_fork_signal_helper();
diff --git a/tests/i915/gen3_mixed_blits.c b/tests/i915/gen3_mixed_blits.c
index 184effec..242b9985 100644
--- a/tests/i915/gen3_mixed_blits.c
+++ b/tests/i915/gen3_mixed_blits.c
@@ -456,7 +456,7 @@ igt_simple_main
igt_require_gem(fd);
count = 3 + gem_aperture_size(fd) / (1024 * 1024);
- intel_require_memory(count, 1024*1024, CHECK_RAM);
+ igt_require_memory(count, 1024*1024, CHECK_RAM);
handle = malloc(sizeof(uint32_t)*count*3);
tiling = handle + count;
diff --git a/tests/i915/gen3_render_linear_blits.c b/tests/i915/gen3_render_linear_blits.c
index f01df69e..9c6b4c70 100644
--- a/tests/i915/gen3_render_linear_blits.c
+++ b/tests/i915/gen3_render_linear_blits.c
@@ -328,7 +328,7 @@ igt_simple_main
igt_require_gem(fd);
count = 3 + gem_aperture_size(fd) / (1024 * 1024);
- intel_require_memory(count, 1024*1024, CHECK_RAM);
+ igt_require_memory(count, 1024*1024, CHECK_RAM);
handle = malloc(sizeof(uint32_t)*count*2);
start_val = handle + count;
diff --git a/tests/i915/gen3_render_mixed_blits.c b/tests/i915/gen3_render_mixed_blits.c
index 9ebb93be..1393055f 100644
--- a/tests/i915/gen3_render_mixed_blits.c
+++ b/tests/i915/gen3_render_mixed_blits.c
@@ -349,7 +349,7 @@ igt_simple_main
igt_require_gem(fd);
count = 3 + gem_aperture_size(fd) / (1024 * 1024);
- intel_require_memory(count, 1024*1024, CHECK_RAM);
+ igt_require_memory(count, 1024*1024, CHECK_RAM);
handle = malloc(sizeof(uint32_t)*count*3);
tiling = handle + count;
diff --git a/tests/i915/gen3_render_tiledx_blits.c b/tests/i915/gen3_render_tiledx_blits.c
index b8aa0edc..ece86749 100644
--- a/tests/i915/gen3_render_tiledx_blits.c
+++ b/tests/i915/gen3_render_tiledx_blits.c
@@ -336,7 +336,7 @@ igt_simple_main
igt_require_gem(fd);
count = 3 + gem_aperture_size(fd) / (1024 * 1024);
- intel_require_memory(count, 1024*1024, CHECK_RAM);
+ igt_require_memory(count, 1024*1024, CHECK_RAM);
handle = malloc(sizeof(uint32_t)*count*2);
start_val = handle + count;
diff --git a/tests/i915/gen3_render_tiledy_blits.c b/tests/i915/gen3_render_tiledy_blits.c
index 2d1b2d8e..30097be6 100644
--- a/tests/i915/gen3_render_tiledy_blits.c
+++ b/tests/i915/gen3_render_tiledy_blits.c
@@ -336,7 +336,7 @@ igt_simple_main
igt_require_gem(fd);
count = 3 + gem_aperture_size(fd) / (1024 * 1024);
- intel_require_memory(count, 1024*1024, CHECK_RAM);
+ igt_require_memory(count, 1024*1024, CHECK_RAM);
handle = malloc(sizeof(uint32_t)*count*2);
start_val = handle + count;
diff --git a/tests/i915/gen7_exec_parse.c b/tests/i915/gen7_exec_parse.c
index 67324061..c83a7911 100644
--- a/tests/i915/gen7_exec_parse.c
+++ b/tests/i915/gen7_exec_parse.c
@@ -337,7 +337,7 @@ static void test_allocations(int fd)
struct drm_i915_gem_exec_object2 obj[17];
unsigned long count;
- intel_require_memory(2, 1ull<<(12 + ARRAY_SIZE(obj)), CHECK_RAM);
+ igt_require_memory(2, 1ull<<(12 + ARRAY_SIZE(obj)), CHECK_RAM);
memset(obj, 0, sizeof(obj));
for (int i = 0; i < ARRAY_SIZE(obj); i++) {
diff --git a/tests/i915/gen9_exec_parse.c b/tests/i915/gen9_exec_parse.c
index b35f2cb4..fa61693c 100644
--- a/tests/i915/gen9_exec_parse.c
+++ b/tests/i915/gen9_exec_parse.c
@@ -596,8 +596,8 @@ static void test_bb_large(int i915)
int i;
for (i = 0; i < ARRAY_SIZE(sizes); i++) {
- if (!__intel_check_memory(2, sizes[i], CHECK_RAM,
- &required, &total))
+ if (!__igt_check_memory(2, sizes[i], CHECK_RAM,
+ &required, &total))
break;
igt_debug("Using object size %#x\n", sizes[i]);
@@ -632,7 +632,7 @@ static void test_bb_oversize(int i915)
.flags = I915_EXEC_BLT,
};
- intel_require_memory(2, 8ull << 30, CHECK_RAM);
+ igt_require_memory(2, 8ull << 30, CHECK_RAM);
gem_write(i915, obj.handle, (4ull << 30) - sizeof(bbe),
&bbe, sizeof(bbe));
diff --git a/tests/i915/i915_suspend.c b/tests/i915/i915_suspend.c
index 1c464f7a..23e451d3 100644
--- a/tests/i915/i915_suspend.c
+++ b/tests/i915/i915_suspend.c
@@ -175,12 +175,12 @@ test_shrink(int fd, unsigned int mode)
void *mem;
gem_quiescent_gpu(fd);
- intel_purge_vm_caches(fd);
+ igt_purge_vm_caches(fd);
- mem = intel_get_total_pinnable_mem(&size);
+ mem = igt_get_total_pinnable_mem(&size);
igt_assert(mem != MAP_FAILED);
- intel_purge_vm_caches(fd);
+ igt_purge_vm_caches(fd);
igt_system_suspend_autoresume(mode, SUSPEND_TEST_NONE);
munmap(mem, size);
diff --git a/tests/i915/kms_big_fb.c b/tests/i915/kms_big_fb.c
index 7a850401..91ad3b4d 100644
--- a/tests/i915/kms_big_fb.c
+++ b/tests/i915/kms_big_fb.c
@@ -841,7 +841,7 @@ igt_main
igt_info("Max driver framebuffer size %dx%d\n",
data.max_fb_width, data.max_fb_height);
- data.ram_size = intel_get_total_ram_mb() << 20;
+ data.ram_size = igt_get_total_ram_mb() << 20;
data.aper_size = gem_aperture_size(data.drm_fd);
data.mappable_size = gem_mappable_aperture_size(data.drm_fd);