summaryrefslogtreecommitdiff
path: root/tests/i915/gem_tiled_pread_pwrite.c
diff options
context:
space:
mode:
authorAshutosh Dixit <ashutosh.dixit@intel.com>2021-03-15 15:53:56 -0700
committerAshutosh Dixit <ashutosh.dixit@intel.com>2021-03-17 15:24:36 -0700
commitad5eb02eb3f10a41d0f1feba7efc02db87cd06b8 (patch)
tree95ddc30b5588748c68f6f81f6f01ef6617fd258b /tests/i915/gem_tiled_pread_pwrite.c
parentb3eff02d5400944dd7b14896037bc9bbf362343e (diff)
lib/ioctl_wrappers: Keep IGT working without pread/pwrite ioctls
The general direction at this time is to phase out pread/write ioctls and not support them in future products. This means IGT must handle the absence of these ioctls. This patch does this by modifying gem_read() and gem_write() to do the read/write using the pread/pwrite ioctls first but when these ioctls are unavailable fall back to doing the read/write using a combination of mmap and memcpy. Callers who must absolutely use the pread/pwrite ioctls (such as tests which test these ioctls or must otherwise only use the pread/pwrite ioctls) must use gem_require_pread_pwrite() to skip when these ioctls are not available. v1: Removed __gem_pread, gem_pread, __gem_pwrite and gem_pwrite introduced previously since they are not necessary, gem_require_pread_pwrite is sufficient v2: Fix CI failures in gem_advise and gen9_exec_parse by introducing gem_require_pread_pwrite v3: Skip mmap for 0 length read/write's v4: Remove redundant igt_assert's v5: Re-run v6: s/EOPNOTSUPP/-EOPNOTSUPP/ v7: Rebase on latest master, skip gem_exec_parallel@userptr with gem_require_pread_pwrite v8: Re-run v9: Rebase Acked-by: Dave Airlie <airlied@redhat.com> Acked-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Reviewed-by: Zbigniew KempczyƄski <zbigniew.kempczynski@intel.com> Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
Diffstat (limited to 'tests/i915/gem_tiled_pread_pwrite.c')
-rw-r--r--tests/i915/gem_tiled_pread_pwrite.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/tests/i915/gem_tiled_pread_pwrite.c b/tests/i915/gem_tiled_pread_pwrite.c
index b73fa126..ef1e1b3c 100644
--- a/tests/i915/gem_tiled_pread_pwrite.c
+++ b/tests/i915/gem_tiled_pread_pwrite.c
@@ -114,6 +114,7 @@ igt_simple_main
fd = drm_open_driver(DRIVER_INTEL);
igt_require(gem_available_fences(fd) > 0);
+ gem_require_pread_pwrite(fd);
count = gem_available_fences(fd) + 1;
intel_require_memory(2 * count, sizeof(linear), CHECK_RAM);