summaryrefslogtreecommitdiff
path: root/tests/gem_bad_reloc.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2016-02-05 18:35:21 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2016-02-18 10:30:56 +0000
commit391b32c3822993a6dd5874d2898b0c16b8eb9d03 (patch)
tree630469f4b2578ef87f085fdab6dc1b75f6b69138 /tests/gem_bad_reloc.c
parente85c530eab9ef20b2708ff36bfc6f6fa3990e1f4 (diff)
igt: Report the global GTT size
For many tests, the relevant aperture is not the ppGTT but the internal global GTT managed by the kernel. Use this limit appropriately. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'tests/gem_bad_reloc.c')
-rw-r--r--tests/gem_bad_reloc.c19
1 files changed, 1 insertions, 18 deletions
diff --git a/tests/gem_bad_reloc.c b/tests/gem_bad_reloc.c
index a9146e27..9157d229 100644
--- a/tests/gem_bad_reloc.c
+++ b/tests/gem_bad_reloc.c
@@ -44,23 +44,6 @@ IGT_TEST_DESCRIPTION("Simulates SNA behaviour using negative self-relocations"
#define USE_LUT (1 << 12)
-static uint64_t get_page_table_size(int fd)
-{
- int val = gem_gtt_type(fd);
-
- switch (val) {
- case 0:
- case 1:
- return gem_aperture_size(fd);
- case 2:
- return 1ULL << 32;
- case 3:
- return 1ULL << 48;
- }
-
- return 0;
-}
-
/* Simulates SNA behaviour using negative self-relocations for
* STATE_BASE_ADDRESS command packets. If they wrap around (to values greater
* than the total size of the GTT), the GPU will hang.
@@ -71,7 +54,7 @@ static int negative_reloc(int fd, unsigned flags)
struct drm_i915_gem_execbuffer2 execbuf;
struct drm_i915_gem_exec_object2 gem_exec[2];
struct drm_i915_gem_relocation_entry gem_reloc[1000];
- uint64_t gtt_max = get_page_table_size(fd);
+ uint64_t gtt_max = gem_aperture_size(fd);
uint32_t buf[1024] = {MI_BATCH_BUFFER_END};
int i;