drm_gem_mmap_obj — memory map a GEM object
int drm_gem_mmap_obj ( | struct drm_gem_object * obj, |
| unsigned long obj_size, | |
struct vm_area_struct * vma); |
objthe GEM object to map
obj_sizethe object size to be mapped, in bytes
vmaVMA for the area to be mapped
Set up the VMA to prepare mapping of the GEM object using the gem_vm_ops provided by the driver. Depending on their requirements, drivers can either provide a fault handler in their gem_vm_ops (in which case any accesses to the object will be trapped, to perform migration, GTT binding, surface register allocation, or performance monitoring), or mmap the buffer memory synchronously after calling drm_gem_mmap_obj.
This function is mainly intended to implement the DMABUF mmap operation, when
the GEM object is not looked up based on its fake offset. To implement the
DRM mmap operation, drivers should use the drm_gem_mmap function.
drm_gem_mmap_obj assumes the user is granted access to the buffer while
drm_gem_mmap prevents unprivileged users from mapping random objects. So
callers must verify access restrictions before calling this helper.