summaryrefslogtreecommitdiff
path: root/tests/i915/gem_exec_big.c
diff options
context:
space:
mode:
authorMatthew Auld <matthew.auld@intel.com>2020-01-24 16:41:31 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2020-01-24 18:40:04 +0000
commitfd6896567f7d612c76207970376d4f1e634ded55 (patch)
tree1ead74d774dde0b0bc2d1e4c19405857d47da1cf /tests/i915/gem_exec_big.c
parent1ebaa38a10ad25371eb9f79db50686e3c1467a4e (diff)
i915/tests/gem_exec_big: prefer PROT_WRITE
Technically mmap__cpu and mmap__wc just ignore the prot value, so it doesn't really matter, but the intention is to have write access to the ptr, so make that clear. Also if the underlying mmap__wc were to at some point use mmap_offset where the prot is not ignored then we won't have any surprises. Signed-off-by: Matthew Auld <matthew.auld@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> 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_big.c')
-rw-r--r--tests/i915/gem_exec_big.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/i915/gem_exec_big.c b/tests/i915/gem_exec_big.c
index c06ee995..a5869330 100644
--- a/tests/i915/gem_exec_big.c
+++ b/tests/i915/gem_exec_big.c
@@ -217,9 +217,9 @@ static void exhaustive(int fd)
gem_write(fd, handle, 0, batch, sizeof(batch));
if (!FORCE_PREAD_PWRITE && gem_has_llc(fd))
- ptr = __gem_mmap__cpu(fd, handle, 0, batch_size, PROT_READ);
+ ptr = __gem_mmap__cpu(fd, handle, 0, batch_size, PROT_WRITE);
else if (!FORCE_PREAD_PWRITE && gem_mmap__has_wc(fd))
- ptr = __gem_mmap__wc(fd, handle, 0, batch_size, PROT_READ);
+ ptr = __gem_mmap__wc(fd, handle, 0, batch_size, PROT_WRITE);
else
ptr = NULL;
@@ -281,9 +281,9 @@ static void single(int i915)
gem_write(i915, handle, 0, &bbe, sizeof(bbe));
if (!FORCE_PREAD_PWRITE && gem_has_llc(i915))
- ptr = __gem_mmap__cpu(i915, handle, 0, batch_size, PROT_READ);
+ ptr = __gem_mmap__cpu(i915, handle, 0, batch_size, PROT_WRITE);
else if (!FORCE_PREAD_PWRITE && gem_mmap__has_wc(i915))
- ptr = __gem_mmap__wc(i915, handle, 0, batch_size, PROT_READ);
+ ptr = __gem_mmap__wc(i915, handle, 0, batch_size, PROT_WRITE);
else
ptr = NULL;