Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0-or-later
0002 /*
0003  * drm gem CMA (contiguous memory allocator) helper functions
0004  *
0005  * Copyright (C) 2012 Sascha Hauer, Pengutronix
0006  *
0007  * Based on Samsung Exynos code
0008  *
0009  * Copyright (c) 2011 Samsung Electronics Co., Ltd.
0010  */
0011 
0012 #include <linux/dma-buf.h>
0013 #include <linux/dma-mapping.h>
0014 #include <linux/export.h>
0015 #include <linux/mm.h>
0016 #include <linux/module.h>
0017 #include <linux/mutex.h>
0018 #include <linux/slab.h>
0019 
0020 #include <drm/drm.h>
0021 #include <drm/drm_device.h>
0022 #include <drm/drm_drv.h>
0023 #include <drm/drm_gem_cma_helper.h>
0024 #include <drm/drm_vma_manager.h>
0025 
0026 /**
0027  * DOC: cma helpers
0028  *
0029  * The DRM GEM/CMA helpers are a means to provide buffer objects that are
0030  * presented to the device as a contiguous chunk of memory. This is useful
0031  * for devices that do not support scatter-gather DMA (either directly or
0032  * by using an intimately attached IOMMU).
0033  *
0034  * Despite the name, the DRM GEM/CMA helpers are not hardwired to use the
0035  * Contiguous Memory Allocator (CMA).
0036  *
0037  * For devices that access the memory bus through an (external) IOMMU then
0038  * the buffer objects are allocated using a traditional page-based
0039  * allocator and may be scattered through physical memory. However they
0040  * are contiguous in the IOVA space so appear contiguous to devices using
0041  * them.
0042  *
0043  * For other devices then the helpers rely on CMA to provide buffer
0044  * objects that are physically contiguous in memory.
0045  *
0046  * For GEM callback helpers in struct &drm_gem_object functions, see likewise
0047  * named functions with an _object_ infix (e.g., drm_gem_cma_object_vmap() wraps
0048  * drm_gem_cma_vmap()). These helpers perform the necessary type conversion.
0049  */
0050 
0051 static const struct drm_gem_object_funcs drm_gem_cma_default_funcs = {
0052     .free = drm_gem_cma_object_free,
0053     .print_info = drm_gem_cma_object_print_info,
0054     .get_sg_table = drm_gem_cma_object_get_sg_table,
0055     .vmap = drm_gem_cma_object_vmap,
0056     .mmap = drm_gem_cma_object_mmap,
0057     .vm_ops = &drm_gem_cma_vm_ops,
0058 };
0059 
0060 /**
0061  * __drm_gem_cma_create - Create a GEM CMA object without allocating memory
0062  * @drm: DRM device
0063  * @size: size of the object to allocate
0064  * @private: true if used for internal purposes
0065  *
0066  * This function creates and initializes a GEM CMA object of the given size,
0067  * but doesn't allocate any memory to back the object.
0068  *
0069  * Returns:
0070  * A struct drm_gem_cma_object * on success or an ERR_PTR()-encoded negative
0071  * error code on failure.
0072  */
0073 static struct drm_gem_cma_object *
0074 __drm_gem_cma_create(struct drm_device *drm, size_t size, bool private)
0075 {
0076     struct drm_gem_cma_object *cma_obj;
0077     struct drm_gem_object *gem_obj;
0078     int ret = 0;
0079 
0080     if (drm->driver->gem_create_object) {
0081         gem_obj = drm->driver->gem_create_object(drm, size);
0082         if (IS_ERR(gem_obj))
0083             return ERR_CAST(gem_obj);
0084         cma_obj = to_drm_gem_cma_obj(gem_obj);
0085     } else {
0086         cma_obj = kzalloc(sizeof(*cma_obj), GFP_KERNEL);
0087         if (!cma_obj)
0088             return ERR_PTR(-ENOMEM);
0089         gem_obj = &cma_obj->base;
0090     }
0091 
0092     if (!gem_obj->funcs)
0093         gem_obj->funcs = &drm_gem_cma_default_funcs;
0094 
0095     if (private) {
0096         drm_gem_private_object_init(drm, gem_obj, size);
0097 
0098         /* Always use writecombine for dma-buf mappings */
0099         cma_obj->map_noncoherent = false;
0100     } else {
0101         ret = drm_gem_object_init(drm, gem_obj, size);
0102     }
0103     if (ret)
0104         goto error;
0105 
0106     ret = drm_gem_create_mmap_offset(gem_obj);
0107     if (ret) {
0108         drm_gem_object_release(gem_obj);
0109         goto error;
0110     }
0111 
0112     return cma_obj;
0113 
0114 error:
0115     kfree(cma_obj);
0116     return ERR_PTR(ret);
0117 }
0118 
0119 /**
0120  * drm_gem_cma_create - allocate an object with the given size
0121  * @drm: DRM device
0122  * @size: size of the object to allocate
0123  *
0124  * This function creates a CMA GEM object and allocates memory as backing store.
0125  * The allocated memory will occupy a contiguous chunk of bus address space.
0126  *
0127  * For devices that are directly connected to the memory bus then the allocated
0128  * memory will be physically contiguous. For devices that access through an
0129  * IOMMU, then the allocated memory is not expected to be physically contiguous
0130  * because having contiguous IOVAs is sufficient to meet a devices DMA
0131  * requirements.
0132  *
0133  * Returns:
0134  * A struct drm_gem_cma_object * on success or an ERR_PTR()-encoded negative
0135  * error code on failure.
0136  */
0137 struct drm_gem_cma_object *drm_gem_cma_create(struct drm_device *drm,
0138                           size_t size)
0139 {
0140     struct drm_gem_cma_object *cma_obj;
0141     int ret;
0142 
0143     size = round_up(size, PAGE_SIZE);
0144 
0145     cma_obj = __drm_gem_cma_create(drm, size, false);
0146     if (IS_ERR(cma_obj))
0147         return cma_obj;
0148 
0149     if (cma_obj->map_noncoherent) {
0150         cma_obj->vaddr = dma_alloc_noncoherent(drm->dev, size,
0151                                &cma_obj->paddr,
0152                                DMA_TO_DEVICE,
0153                                GFP_KERNEL | __GFP_NOWARN);
0154     } else {
0155         cma_obj->vaddr = dma_alloc_wc(drm->dev, size, &cma_obj->paddr,
0156                           GFP_KERNEL | __GFP_NOWARN);
0157     }
0158     if (!cma_obj->vaddr) {
0159         drm_dbg(drm, "failed to allocate buffer with size %zu\n",
0160              size);
0161         ret = -ENOMEM;
0162         goto error;
0163     }
0164 
0165     return cma_obj;
0166 
0167 error:
0168     drm_gem_object_put(&cma_obj->base);
0169     return ERR_PTR(ret);
0170 }
0171 EXPORT_SYMBOL_GPL(drm_gem_cma_create);
0172 
0173 /**
0174  * drm_gem_cma_create_with_handle - allocate an object with the given size and
0175  *     return a GEM handle to it
0176  * @file_priv: DRM file-private structure to register the handle for
0177  * @drm: DRM device
0178  * @size: size of the object to allocate
0179  * @handle: return location for the GEM handle
0180  *
0181  * This function creates a CMA GEM object, allocating a chunk of memory as
0182  * backing store. The GEM object is then added to the list of object associated
0183  * with the given file and a handle to it is returned.
0184  *
0185  * The allocated memory will occupy a contiguous chunk of bus address space.
0186  * See drm_gem_cma_create() for more details.
0187  *
0188  * Returns:
0189  * A struct drm_gem_cma_object * on success or an ERR_PTR()-encoded negative
0190  * error code on failure.
0191  */
0192 static struct drm_gem_cma_object *
0193 drm_gem_cma_create_with_handle(struct drm_file *file_priv,
0194                    struct drm_device *drm, size_t size,
0195                    uint32_t *handle)
0196 {
0197     struct drm_gem_cma_object *cma_obj;
0198     struct drm_gem_object *gem_obj;
0199     int ret;
0200 
0201     cma_obj = drm_gem_cma_create(drm, size);
0202     if (IS_ERR(cma_obj))
0203         return cma_obj;
0204 
0205     gem_obj = &cma_obj->base;
0206 
0207     /*
0208      * allocate a id of idr table where the obj is registered
0209      * and handle has the id what user can see.
0210      */
0211     ret = drm_gem_handle_create(file_priv, gem_obj, handle);
0212     /* drop reference from allocate - handle holds it now. */
0213     drm_gem_object_put(gem_obj);
0214     if (ret)
0215         return ERR_PTR(ret);
0216 
0217     return cma_obj;
0218 }
0219 
0220 /**
0221  * drm_gem_cma_free - free resources associated with a CMA GEM object
0222  * @cma_obj: CMA GEM object to free
0223  *
0224  * This function frees the backing memory of the CMA GEM object, cleans up the
0225  * GEM object state and frees the memory used to store the object itself.
0226  * If the buffer is imported and the virtual address is set, it is released.
0227  */
0228 void drm_gem_cma_free(struct drm_gem_cma_object *cma_obj)
0229 {
0230     struct drm_gem_object *gem_obj = &cma_obj->base;
0231     struct iosys_map map = IOSYS_MAP_INIT_VADDR(cma_obj->vaddr);
0232 
0233     if (gem_obj->import_attach) {
0234         if (cma_obj->vaddr)
0235             dma_buf_vunmap(gem_obj->import_attach->dmabuf, &map);
0236         drm_prime_gem_destroy(gem_obj, cma_obj->sgt);
0237     } else if (cma_obj->vaddr) {
0238         if (cma_obj->map_noncoherent)
0239             dma_free_noncoherent(gem_obj->dev->dev, cma_obj->base.size,
0240                          cma_obj->vaddr, cma_obj->paddr,
0241                          DMA_TO_DEVICE);
0242         else
0243             dma_free_wc(gem_obj->dev->dev, cma_obj->base.size,
0244                     cma_obj->vaddr, cma_obj->paddr);
0245     }
0246 
0247     drm_gem_object_release(gem_obj);
0248 
0249     kfree(cma_obj);
0250 }
0251 EXPORT_SYMBOL_GPL(drm_gem_cma_free);
0252 
0253 /**
0254  * drm_gem_cma_dumb_create_internal - create a dumb buffer object
0255  * @file_priv: DRM file-private structure to create the dumb buffer for
0256  * @drm: DRM device
0257  * @args: IOCTL data
0258  *
0259  * This aligns the pitch and size arguments to the minimum required. This is
0260  * an internal helper that can be wrapped by a driver to account for hardware
0261  * with more specific alignment requirements. It should not be used directly
0262  * as their &drm_driver.dumb_create callback.
0263  *
0264  * Returns:
0265  * 0 on success or a negative error code on failure.
0266  */
0267 int drm_gem_cma_dumb_create_internal(struct drm_file *file_priv,
0268                      struct drm_device *drm,
0269                      struct drm_mode_create_dumb *args)
0270 {
0271     unsigned int min_pitch = DIV_ROUND_UP(args->width * args->bpp, 8);
0272     struct drm_gem_cma_object *cma_obj;
0273 
0274     if (args->pitch < min_pitch)
0275         args->pitch = min_pitch;
0276 
0277     if (args->size < args->pitch * args->height)
0278         args->size = args->pitch * args->height;
0279 
0280     cma_obj = drm_gem_cma_create_with_handle(file_priv, drm, args->size,
0281                          &args->handle);
0282     return PTR_ERR_OR_ZERO(cma_obj);
0283 }
0284 EXPORT_SYMBOL_GPL(drm_gem_cma_dumb_create_internal);
0285 
0286 /**
0287  * drm_gem_cma_dumb_create - create a dumb buffer object
0288  * @file_priv: DRM file-private structure to create the dumb buffer for
0289  * @drm: DRM device
0290  * @args: IOCTL data
0291  *
0292  * This function computes the pitch of the dumb buffer and rounds it up to an
0293  * integer number of bytes per pixel. Drivers for hardware that doesn't have
0294  * any additional restrictions on the pitch can directly use this function as
0295  * their &drm_driver.dumb_create callback.
0296  *
0297  * For hardware with additional restrictions, drivers can adjust the fields
0298  * set up by userspace and pass the IOCTL data along to the
0299  * drm_gem_cma_dumb_create_internal() function.
0300  *
0301  * Returns:
0302  * 0 on success or a negative error code on failure.
0303  */
0304 int drm_gem_cma_dumb_create(struct drm_file *file_priv,
0305                 struct drm_device *drm,
0306                 struct drm_mode_create_dumb *args)
0307 {
0308     struct drm_gem_cma_object *cma_obj;
0309 
0310     args->pitch = DIV_ROUND_UP(args->width * args->bpp, 8);
0311     args->size = args->pitch * args->height;
0312 
0313     cma_obj = drm_gem_cma_create_with_handle(file_priv, drm, args->size,
0314                          &args->handle);
0315     return PTR_ERR_OR_ZERO(cma_obj);
0316 }
0317 EXPORT_SYMBOL_GPL(drm_gem_cma_dumb_create);
0318 
0319 const struct vm_operations_struct drm_gem_cma_vm_ops = {
0320     .open = drm_gem_vm_open,
0321     .close = drm_gem_vm_close,
0322 };
0323 EXPORT_SYMBOL_GPL(drm_gem_cma_vm_ops);
0324 
0325 #ifndef CONFIG_MMU
0326 /**
0327  * drm_gem_cma_get_unmapped_area - propose address for mapping in noMMU cases
0328  * @filp: file object
0329  * @addr: memory address
0330  * @len: buffer size
0331  * @pgoff: page offset
0332  * @flags: memory flags
0333  *
0334  * This function is used in noMMU platforms to propose address mapping
0335  * for a given buffer.
0336  * It's intended to be used as a direct handler for the struct
0337  * &file_operations.get_unmapped_area operation.
0338  *
0339  * Returns:
0340  * mapping address on success or a negative error code on failure.
0341  */
0342 unsigned long drm_gem_cma_get_unmapped_area(struct file *filp,
0343                         unsigned long addr,
0344                         unsigned long len,
0345                         unsigned long pgoff,
0346                         unsigned long flags)
0347 {
0348     struct drm_gem_cma_object *cma_obj;
0349     struct drm_gem_object *obj = NULL;
0350     struct drm_file *priv = filp->private_data;
0351     struct drm_device *dev = priv->minor->dev;
0352     struct drm_vma_offset_node *node;
0353 
0354     if (drm_dev_is_unplugged(dev))
0355         return -ENODEV;
0356 
0357     drm_vma_offset_lock_lookup(dev->vma_offset_manager);
0358     node = drm_vma_offset_exact_lookup_locked(dev->vma_offset_manager,
0359                           pgoff,
0360                           len >> PAGE_SHIFT);
0361     if (likely(node)) {
0362         obj = container_of(node, struct drm_gem_object, vma_node);
0363         /*
0364          * When the object is being freed, after it hits 0-refcnt it
0365          * proceeds to tear down the object. In the process it will
0366          * attempt to remove the VMA offset and so acquire this
0367          * mgr->vm_lock.  Therefore if we find an object with a 0-refcnt
0368          * that matches our range, we know it is in the process of being
0369          * destroyed and will be freed as soon as we release the lock -
0370          * so we have to check for the 0-refcnted object and treat it as
0371          * invalid.
0372          */
0373         if (!kref_get_unless_zero(&obj->refcount))
0374             obj = NULL;
0375     }
0376 
0377     drm_vma_offset_unlock_lookup(dev->vma_offset_manager);
0378 
0379     if (!obj)
0380         return -EINVAL;
0381 
0382     if (!drm_vma_node_is_allowed(node, priv)) {
0383         drm_gem_object_put(obj);
0384         return -EACCES;
0385     }
0386 
0387     cma_obj = to_drm_gem_cma_obj(obj);
0388 
0389     drm_gem_object_put(obj);
0390 
0391     return cma_obj->vaddr ? (unsigned long)cma_obj->vaddr : -EINVAL;
0392 }
0393 EXPORT_SYMBOL_GPL(drm_gem_cma_get_unmapped_area);
0394 #endif
0395 
0396 /**
0397  * drm_gem_cma_print_info() - Print &drm_gem_cma_object info for debugfs
0398  * @cma_obj: CMA GEM object
0399  * @p: DRM printer
0400  * @indent: Tab indentation level
0401  *
0402  * This function prints paddr and vaddr for use in e.g. debugfs output.
0403  */
0404 void drm_gem_cma_print_info(const struct drm_gem_cma_object *cma_obj,
0405                 struct drm_printer *p, unsigned int indent)
0406 {
0407     drm_printf_indent(p, indent, "paddr=%pad\n", &cma_obj->paddr);
0408     drm_printf_indent(p, indent, "vaddr=%p\n", cma_obj->vaddr);
0409 }
0410 EXPORT_SYMBOL(drm_gem_cma_print_info);
0411 
0412 /**
0413  * drm_gem_cma_get_sg_table - provide a scatter/gather table of pinned
0414  *     pages for a CMA GEM object
0415  * @cma_obj: CMA GEM object
0416  *
0417  * This function exports a scatter/gather table by calling the standard
0418  * DMA mapping API.
0419  *
0420  * Returns:
0421  * A pointer to the scatter/gather table of pinned pages or NULL on failure.
0422  */
0423 struct sg_table *drm_gem_cma_get_sg_table(struct drm_gem_cma_object *cma_obj)
0424 {
0425     struct drm_gem_object *obj = &cma_obj->base;
0426     struct sg_table *sgt;
0427     int ret;
0428 
0429     sgt = kzalloc(sizeof(*sgt), GFP_KERNEL);
0430     if (!sgt)
0431         return ERR_PTR(-ENOMEM);
0432 
0433     ret = dma_get_sgtable(obj->dev->dev, sgt, cma_obj->vaddr,
0434                   cma_obj->paddr, obj->size);
0435     if (ret < 0)
0436         goto out;
0437 
0438     return sgt;
0439 
0440 out:
0441     kfree(sgt);
0442     return ERR_PTR(ret);
0443 }
0444 EXPORT_SYMBOL_GPL(drm_gem_cma_get_sg_table);
0445 
0446 /**
0447  * drm_gem_cma_prime_import_sg_table - produce a CMA GEM object from another
0448  *     driver's scatter/gather table of pinned pages
0449  * @dev: device to import into
0450  * @attach: DMA-BUF attachment
0451  * @sgt: scatter/gather table of pinned pages
0452  *
0453  * This function imports a scatter/gather table exported via DMA-BUF by
0454  * another driver. Imported buffers must be physically contiguous in memory
0455  * (i.e. the scatter/gather table must contain a single entry). Drivers that
0456  * use the CMA helpers should set this as their
0457  * &drm_driver.gem_prime_import_sg_table callback.
0458  *
0459  * Returns:
0460  * A pointer to a newly created GEM object or an ERR_PTR-encoded negative
0461  * error code on failure.
0462  */
0463 struct drm_gem_object *
0464 drm_gem_cma_prime_import_sg_table(struct drm_device *dev,
0465                   struct dma_buf_attachment *attach,
0466                   struct sg_table *sgt)
0467 {
0468     struct drm_gem_cma_object *cma_obj;
0469 
0470     /* check if the entries in the sg_table are contiguous */
0471     if (drm_prime_get_contiguous_size(sgt) < attach->dmabuf->size)
0472         return ERR_PTR(-EINVAL);
0473 
0474     /* Create a CMA GEM buffer. */
0475     cma_obj = __drm_gem_cma_create(dev, attach->dmabuf->size, true);
0476     if (IS_ERR(cma_obj))
0477         return ERR_CAST(cma_obj);
0478 
0479     cma_obj->paddr = sg_dma_address(sgt->sgl);
0480     cma_obj->sgt = sgt;
0481 
0482     DRM_DEBUG_PRIME("dma_addr = %pad, size = %zu\n", &cma_obj->paddr, attach->dmabuf->size);
0483 
0484     return &cma_obj->base;
0485 }
0486 EXPORT_SYMBOL_GPL(drm_gem_cma_prime_import_sg_table);
0487 
0488 /**
0489  * drm_gem_cma_vmap - map a CMA GEM object into the kernel's virtual
0490  *     address space
0491  * @cma_obj: CMA GEM object
0492  * @map: Returns the kernel virtual address of the CMA GEM object's backing
0493  *       store.
0494  *
0495  * This function maps a buffer into the kernel's virtual address space.
0496  * Since the CMA buffers are already mapped into the kernel virtual address
0497  * space this simply returns the cached virtual address.
0498  *
0499  * Returns:
0500  * 0 on success, or a negative error code otherwise.
0501  */
0502 int drm_gem_cma_vmap(struct drm_gem_cma_object *cma_obj,
0503              struct iosys_map *map)
0504 {
0505     iosys_map_set_vaddr(map, cma_obj->vaddr);
0506 
0507     return 0;
0508 }
0509 EXPORT_SYMBOL_GPL(drm_gem_cma_vmap);
0510 
0511 /**
0512  * drm_gem_cma_mmap - memory-map an exported CMA GEM object
0513  * @cma_obj: CMA GEM object
0514  * @vma: VMA for the area to be mapped
0515  *
0516  * This function maps a buffer into a userspace process's address space.
0517  * In addition to the usual GEM VMA setup it immediately faults in the entire
0518  * object instead of using on-demand faulting.
0519  *
0520  * Returns:
0521  * 0 on success or a negative error code on failure.
0522  */
0523 int drm_gem_cma_mmap(struct drm_gem_cma_object *cma_obj, struct vm_area_struct *vma)
0524 {
0525     struct drm_gem_object *obj = &cma_obj->base;
0526     int ret;
0527 
0528     /*
0529      * Clear the VM_PFNMAP flag that was set by drm_gem_mmap(), and set the
0530      * vm_pgoff (used as a fake buffer offset by DRM) to 0 as we want to map
0531      * the whole buffer.
0532      */
0533     vma->vm_pgoff -= drm_vma_node_start(&obj->vma_node);
0534     vma->vm_flags &= ~VM_PFNMAP;
0535     vma->vm_flags |= VM_DONTEXPAND;
0536 
0537     if (cma_obj->map_noncoherent) {
0538         vma->vm_page_prot = vm_get_page_prot(vma->vm_flags);
0539 
0540         ret = dma_mmap_pages(cma_obj->base.dev->dev,
0541                      vma, vma->vm_end - vma->vm_start,
0542                      virt_to_page(cma_obj->vaddr));
0543     } else {
0544         ret = dma_mmap_wc(cma_obj->base.dev->dev, vma, cma_obj->vaddr,
0545                   cma_obj->paddr, vma->vm_end - vma->vm_start);
0546     }
0547     if (ret)
0548         drm_gem_vm_close(vma);
0549 
0550     return ret;
0551 }
0552 EXPORT_SYMBOL_GPL(drm_gem_cma_mmap);
0553 
0554 /**
0555  * drm_gem_cma_prime_import_sg_table_vmap - PRIME import another driver's
0556  *  scatter/gather table and get the virtual address of the buffer
0557  * @dev: DRM device
0558  * @attach: DMA-BUF attachment
0559  * @sgt: Scatter/gather table of pinned pages
0560  *
0561  * This function imports a scatter/gather table using
0562  * drm_gem_cma_prime_import_sg_table() and uses dma_buf_vmap() to get the kernel
0563  * virtual address. This ensures that a CMA GEM object always has its virtual
0564  * address set. This address is released when the object is freed.
0565  *
0566  * This function can be used as the &drm_driver.gem_prime_import_sg_table
0567  * callback. The &DRM_GEM_CMA_DRIVER_OPS_VMAP macro provides a shortcut to set
0568  * the necessary DRM driver operations.
0569  *
0570  * Returns:
0571  * A pointer to a newly created GEM object or an ERR_PTR-encoded negative
0572  * error code on failure.
0573  */
0574 struct drm_gem_object *
0575 drm_gem_cma_prime_import_sg_table_vmap(struct drm_device *dev,
0576                        struct dma_buf_attachment *attach,
0577                        struct sg_table *sgt)
0578 {
0579     struct drm_gem_cma_object *cma_obj;
0580     struct drm_gem_object *obj;
0581     struct iosys_map map;
0582     int ret;
0583 
0584     ret = dma_buf_vmap(attach->dmabuf, &map);
0585     if (ret) {
0586         DRM_ERROR("Failed to vmap PRIME buffer\n");
0587         return ERR_PTR(ret);
0588     }
0589 
0590     obj = drm_gem_cma_prime_import_sg_table(dev, attach, sgt);
0591     if (IS_ERR(obj)) {
0592         dma_buf_vunmap(attach->dmabuf, &map);
0593         return obj;
0594     }
0595 
0596     cma_obj = to_drm_gem_cma_obj(obj);
0597     cma_obj->vaddr = map.vaddr;
0598 
0599     return obj;
0600 }
0601 EXPORT_SYMBOL(drm_gem_cma_prime_import_sg_table_vmap);
0602 
0603 MODULE_DESCRIPTION("DRM CMA memory-management helpers");
0604 MODULE_IMPORT_NS(DMA_BUF);
0605 MODULE_LICENSE("GPL");