summaryrefslogtreecommitdiff
path: root/tests/i915/gem_exec_reloc.c
diff options
context:
space:
mode:
authorAntonio Argenziano <antonio.argenziano@intel.com>2020-01-29 11:29:13 -0800
committerChris Wilson <chris@chris-wilson.co.uk>2020-01-29 21:11:02 +0000
commitc4cc49f31077dc89e403abc3c45bc3c99b182a6a (patch)
tree13638fc67d9a500232c3196f7807ab39b17915a2 /tests/i915/gem_exec_reloc.c
parent21f4d0f72c0a3519270712565b2fe688157fc18b (diff)
i915/gem_exec_reloc: Require mappable gtt when necessary
The test loops across several mappings so, when explicitly asking for a GTT mapping it has to make sure such mapping is available. Signed-off-by: Antonio Argenziano <antonio.argenziano@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Vinay Belgaumkar <vinay.belgaumkar@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'tests/i915/gem_exec_reloc.c')
-rw-r--r--tests/i915/gem_exec_reloc.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/i915/gem_exec_reloc.c b/tests/i915/gem_exec_reloc.c
index ef995a67..bc904a0a 100644
--- a/tests/i915/gem_exec_reloc.c
+++ b/tests/i915/gem_exec_reloc.c
@@ -110,6 +110,9 @@ static void from_mmap(int fd, uint64_t size, enum mode mode)
uint64_t max, i;
int retry = 2;
+ if ((mode & ~RO) == GTT)
+ gem_require_mappable_ggtt(fd);
+
/* Worst case is that the kernel has to copy the entire incoming
* reloc[], so double the memory requirements.
*/
@@ -387,6 +390,9 @@ static void basic_reloc(int fd, unsigned before, unsigned after, unsigned flags)
const uint32_t bbe = MI_BATCH_BUFFER_END;
unsigned int reloc_offset;
+ if ((before | after) & I915_GEM_DOMAIN_GTT)
+ gem_require_mappable_ggtt(fd);
+
memset(&obj, 0, sizeof(obj));
obj.handle = gem_create(fd, OBJSZ);
obj.relocs_ptr = to_user_pointer(&reloc);