@@ -784,6 +784,17 @@ int drm_gem_dmabuf_mmap(struct dma_buf *dma_buf, struct vm_area_struct *vma)
}
EXPORT_SYMBOL(drm_gem_dmabuf_mmap);
+static int drm_gem_dmabuf_mmap_info(struct dma_buf *dma_buf)
+{
+ struct drm_gem_object *obj = dma_buf->priv;
+ struct drm_device *dev = obj->dev;
+
+ if (!dev->driver->gem_prime_mmap_info)
+ return -ENOSYS;
+
+ return dev->driver->gem_prime_mmap_info(obj);
+}
+
static const struct dma_buf_ops drm_gem_prime_dmabuf_ops = {
.cache_sgt_mapping = true,
.attach = drm_gem_map_attach,
@@ -792,6 +803,7 @@ static const struct dma_buf_ops drm_gem_prime_dmabuf_ops = {
.unmap_dma_buf = drm_gem_unmap_dma_buf,
.release = drm_gem_dmabuf_release,
.mmap = drm_gem_dmabuf_mmap,
+ .mmap_info = drm_gem_dmabuf_mmap_info,
.vmap = drm_gem_dmabuf_vmap,
.vunmap = drm_gem_dmabuf_vunmap,
};
@@ -355,6 +355,13 @@ struct drm_driver {
*/
int (*gem_prime_mmap)(struct drm_gem_object *obj, struct vm_area_struct *vma);
+ /**
+ * @gem_prim_mmap_info:
+ *
+ * Get info about mmap setup by gem_prime_mmap. See dma_buf_ops:mmap_info.
+ */
+ int (*gem_prime_mmap_info)(struct drm_gem_object *obj);
+
/**
* @dumb_create:
*