'\" t .\" Title: drm_gem_mmap_obj .\" Author: .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: May 2018 .\" Manual: DRM Core .\" Source: Kernel Hackers Manual 3.16.56 .\" Language: English .\" .TH "DRM_GEM_MMAP_OBJ" "9" "May 2018" "Kernel Hackers Manual 3\&.16\&" "DRM Core" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" drm_gem_mmap_obj \- memory map a GEM object .SH "SYNOPSIS" .HP \w'int\ drm_gem_mmap_obj('u .BI "int drm_gem_mmap_obj(struct\ drm_gem_object\ *\ " "obj" ", unsigned\ long\ " "obj_size" ", struct\ vm_area_struct\ *\ " "vma" ");" .SH "ARGUMENTS" .PP \fIobj\fR .RS 4 the GEM object to map .RE .PP \fIobj_size\fR .RS 4 the object size to be mapped, in bytes .RE .PP \fIvma\fR .RS 4 VMA for the area to be mapped .RE .SH "DESCRIPTION" .PP 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\&. .PP 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 \fBdrm_gem_mmap\fR function\&. .PP \fBdrm_gem_mmap_obj\fR assumes the user is granted access to the buffer while \fBdrm_gem_mmap\fR prevents unprivileged users from mapping random objects\&. So callers must verify access restrictions before calling this helper\&. .SH "NOTE" .PP This function has to be protected with dev\->struct_mutex .PP Return 0 or success or \-EINVAL if the object size is smaller than the VMA size, or if no gem_vm_ops are provided\&. .SH "AUTHORS" .PP \fBJesse Barnes\fR <\&jesse.barnes@intel.com\&> .br Intel Corporation, .RS 4 Initial version .RE .PP \fBLaurent Pinchart\fR <\&laurent.pinchart@ideasonboard.com\&> .br Ideas on board SPRL, .RS 4 Driver internals .RE .PP \fBDaniel Vetter\fR <\&daniel.vetter@ffwll.ch\&> .br Intel Corporation, .RS 4 Contributions all over the place .RE .SH "COPYRIGHT" .br