What type of offset is provided by nvidia_get_gem_map_offset? #249
-
When going through the uapi headers I saw the drm_nvidia_gem_map_offset_params definition:
What does "fake" mean in this context? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
For a number of reasons, it's not feasible to map memory pages from a drm 'gem' object into a process's virtual memory space while inside of an ioctl handler. So instead, applications have to use the The core drm code in the kernel does something similar. See |
Beta Was this translation helpful? Give feedback.
For a number of reasons, it's not feasible to map memory pages from a drm 'gem' object into a process's virtual memory space while inside of an ioctl handler. So instead, applications have to use the
mmap
syscall to actually map pages. Applications choose which gem object to map by using an ioctl, and then pass the returned "fake offset" value as theoff
parameter to themmap
syscall. The drm driver then uses this offset value to look up the gem object to map.The core drm code in the kernel does something similar. See
drm_gem_create_mmap_offset_size
in the kernel.