lkml.org 
[lkml]   [2022]   [Aug]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v2 2/3] drm/prime: Wire up mmap_info support
Date
From: Rob Clark <robdclark@chromium.org>

Just plumbing the thing thru an extra layer.

Signed-off-by: Rob Clark <robdclark@chromium.org>
---
drivers/gpu/drm/drm_prime.c | 3 +++
include/drm/drm_gem.h | 11 +++++++++++
2 files changed, 14 insertions(+)

diff --git a/drivers/gpu/drm/drm_prime.c b/drivers/gpu/drm/drm_prime.c
index e3f09f18110c..4457fedde1ec 100644
--- a/drivers/gpu/drm/drm_prime.c
+++ b/drivers/gpu/drm/drm_prime.c
@@ -888,6 +888,9 @@ struct dma_buf *drm_gem_prime_export(struct drm_gem_object *obj,
.resv = obj->resv,
};

+ if (obj->funcs && obj->funcs->map_info)
+ exp_info.map_info = obj->funcs->map_info(obj);
+
return drm_gem_dmabuf_export(dev, &exp_info);
}
EXPORT_SYMBOL(drm_gem_prime_export);
diff --git a/include/drm/drm_gem.h b/include/drm/drm_gem.h
index f28a48a6f846..a573ebfc529a 100644
--- a/include/drm/drm_gem.h
+++ b/include/drm/drm_gem.h
@@ -172,6 +172,17 @@ struct drm_gem_object_funcs {
* This is optional but necessary for mmap support.
*/
const struct vm_operations_struct *vm_ops;
+
+ /**
+ * @map_info:
+ *
+ * Return dma_buf_map_info indicating the coherency of an exported
+ * dma-buf.
+ *
+ * This callback is optional. If not provided, exported dma-bufs are
+ * assumed to be DMA_BUF_MAP_INCOHERENT.
+ */
+ enum dma_buf_map_info (*map_info)(struct drm_gem_object *obj);
};

/**
--
2.36.1
\
 
 \ /
  Last update: 2022-09-17 16:27    [W:0.132 / U:0.532 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site