linux/include/uapi/drm
Chris Wilson b65a948973 drm/i915/userptr: Probe existence of backing struct pages upon creation
Jason Ekstrand requested a more efficient method than userptr+set-domain
to determine if the userptr object was backed by a complete set of pages
upon creation. To be more efficient than simply populating the userptr
using get_user_pages() (as done by the call to set-domain or execbuf),
we can walk the tree of vm_area_struct and check for gaps or vma not
backed by struct page (VM_PFNMAP). The question is how to handle
VM_MIXEDMAP which may be either struct page or pfn backed...

With discrete we are going to drop support for set_domain(), so offering
a way to probe the pages, without having to resort to dummy batches has
been requested.

v2:
- add new query param for the PROBE flag, so userspace can easily
  check if the kernel supports it(Jason).
- use mmap_read_{lock, unlock}.
- add some kernel-doc.
v3:
- In the docs also mention that PROBE doesn't guarantee that the pages
  will remain valid by the time they are actually used(Tvrtko).
- Add a small comment for the hole finding logic(Jason).
- Move the param next to all the other params which just return true.

Testcase: igt/gem_userptr_blits/probe
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Kenneth Graunke <kenneth@whitecape.org>
Cc: Jason Ekstrand <jason@jlekstrand.net>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Ramalingam C <ramalingam.c@intel.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210723113405.427004-1-matthew.auld@intel.com
2021-08-05 11:34:00 +02:00
..
amdgpu_drm.h drm/amdgpu: add uapi to define yellow carp series 2021-06-04 16:03:05 -04:00
armada_drm.h License cleanup: add SPDX license identifier to uapi header files with a license 2017-11-02 11:20:11 +01:00
drm_fourcc.h drm/fourcc: Add 16 bpc fixed point framebuffer formats. 2021-05-27 15:00:47 -04:00
drm_mode.h drm/connector: demote connector force-probes for non-master clients 2021-05-03 12:08:37 +02:00
drm_sarea.h drm: add extern C guard for the UAPI headers 2016-05-13 13:57:17 +01:00
drm.h drm: document minimum kernel version for DRM_CLIENT_CAP_* 2021-05-31 18:57:22 +02:00
etnaviv_drm.h drm/etnaviv: provide more ID values via GET_PARAM ioctl. 2021-01-22 12:33:57 +01:00
exynos_drm.h drm/exynos: Rename Exynos to lowercase 2020-01-21 09:09:42 +09:00
i810_drm.h License cleanup: add SPDX license identifier to uapi header files with no license 2017-11-02 11:19:54 +01:00
i915_drm.h drm/i915/userptr: Probe existence of backing struct pages upon creation 2021-08-05 11:34:00 +02:00
lima_drm.h drm/lima: support heap buffer creation 2020-01-27 22:01:09 +08:00
mga_drm.h drm/mga: add extern C guard for the UAPI header 2016-05-13 14:06:07 +01:00
msm_drm.h drm/msm: deprecate MSM_BO_UNCACHED (map as writecombine instead) 2021-06-23 07:32:14 -07:00
nouveau_drm.h drm/nouveau: support synchronous pushbuf submission 2020-01-29 15:49:56 +10:00
omap_drm.h Revert "drm/omap: add OMAP_BO flags to affect buffer allocation" 2019-10-23 10:41:41 -04:00
panfrost_drm.h drm/panfrost: Add AFBC_FEATURES parameter 2021-06-04 16:16:04 +01:00
qxl_drm.h drm/qxl: fix __user annotations 2017-06-23 10:06:31 +02:00
r128_drm.h drm/r128: add extern C guard for the UAPI header 2016-05-13 14:06:13 +01:00
radeon_drm.h drm/radeon: add extern C guard for the UAPI header 2016-05-13 14:06:14 +01:00
savage_drm.h drm/savage: add extern C guard for the UAPI header 2016-05-13 14:06:15 +01:00
sis_drm.h drm/sis: add extern C guard for the UAPI header 2016-05-13 14:06:16 +01:00
tegra_drm.h drm/tegra: Add kerneldoc for UAPI 2018-05-19 00:21:20 +02:00
v3d_drm.h drm/v3d: clean caches at the end of render jobs on request from user space 2019-09-19 12:57:44 -07:00
vc4_drm.h drm/vc4: Add a pad field to align drm_vc4_submit_cl to 64 bits. 2018-05-03 15:20:09 -07:00
vgem_drm.h drm/vgem: Attach sw fences to exported vGEM dma-buf (ioctl) 2016-07-18 08:54:55 +02:00
via_drm.h drm/via: add extern C guard for the UAPI header 2016-05-13 14:06:19 +01:00
virtgpu_drm.h drm/virtgpu api: cross-device feature 2020-09-29 11:23:18 +02:00
vmwgfx_drm.h drm/vmwgfx: Add SM5 param for userspace 2020-03-23 22:48:57 +01:00