summaryrefslogtreecommitdiff
path: root/tests/i915/gem_mmap.c
diff options
context:
space:
mode:
authorMaarten Lankhorst <maarten.lankhorst@linux.intel.com>2021-06-24 11:14:14 +0200
committerAshutosh Dixit <ashutosh.dixit@intel.com>2021-06-24 11:17:53 -0700
commita306810ebbc8984bde38a57ef0c33eea394f4e18 (patch)
tree1fb0c1e67f451d2b096d432532818d6d4afefacd /tests/i915/gem_mmap.c
parenta2e8c890845b6441d7b01f8afefa94a6fa4ee9e4 (diff)
i915: Handle the case where legacy mmap is not available, v2.
We will remove support for the legacy mmap ioctl, so handle that case without rewriting all tests. When the gem_mmap ioctl is not available, transparently fallback to mmap_offset. Changes since v1: - Skip gem_tiled_wc too, as it requires on legacy mmap behavior. (Ashutosh) - Remove fallback for __gem_mmap__gtt, it's already mmap_offset. (Ashutosh) Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
Diffstat (limited to 'tests/i915/gem_mmap.c')
-rw-r--r--tests/i915/gem_mmap.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/i915/gem_mmap.c b/tests/i915/gem_mmap.c
index d12a4c0b..a77c0ad6 100644
--- a/tests/i915/gem_mmap.c
+++ b/tests/i915/gem_mmap.c
@@ -154,8 +154,10 @@ igt_main
uint8_t buf[OBJECT_SIZE];
uint8_t *addr;
- igt_fixture
+ igt_fixture {
fd = drm_open_driver(DRIVER_INTEL);
+ igt_require(gem_has_legacy_mmap(fd));
+ }
igt_subtest("bad-object") {
uint32_t real_handle = gem_create(fd, 4096);