]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915/gem: Fix the mman selftest
authorThomas Hellström <thomas.hellstrom@linux.intel.com>
Tue, 31 Aug 2021 12:29:31 +0000 (14:29 +0200)
committerThomas Hellström <thomas.hellstrom@linux.intel.com>
Thu, 2 Sep 2021 12:43:14 +0000 (14:43 +0200)
commit830b1efd7bd56a45e24717b524488895bec18821
tree3a4d1db632cb6d4df1c1b71192109cd72d83e590
parentc0d17c4ad7011c46e3be393515171ce5164da097
drm/i915/gem: Fix the mman selftest

Using the I915_MMAP_TYPE_FIXED mmap type requires the TTM backend, so
for that mmap type, use __i915_gem_object_create_user() instead of
i915_gem_object_create_internal(), as we really want to tests objects
mmap-able by user-space.

This also means that the out-of-space error happens at object creation
and returns -ENXIO rather than -ENOSPC, so fix the code up to expect
that on out-of-offset-space errors.

Finally only use I915_MMAP_TYPE_FIXED for LMEM and SMEM for now if
testing on LMEM-capable devices. For stolen LMEM, we still take the
same path as for integrated, as that haven't been moved over to TTM yet,
and user-space should not be able to create out of stolen LMEM anyway.

v2:
 - Check the presence of the obj->ops->mmap_offset callback rather than
   hardcoding the supported mmap regions in can_mmap() (Maarten Lankhorst)

Fixes: 2e4d96dd1ef7 ("drm/i915: Add TTM offset argument to mmap.")
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210831122931.157536-1-thomas.hellstrom@linux.intel.com
drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c