diff options
Diffstat (limited to 'dma_buf_export.patch')
-rw-r--r-- | dma_buf_export.patch | 116 |
1 files changed, 0 insertions, 116 deletions
diff --git a/dma_buf_export.patch b/dma_buf_export.patch deleted file mode 100644 index 5fb4f5490af7..000000000000 --- a/dma_buf_export.patch +++ /dev/null @@ -1,116 +0,0 @@ ---- a/linux/include/linux/dma-buf.h -+++ b/linux/include/linux/dma-buf.h -@@ -163,6 +163,33 @@ struct dma_buf_attachment { - }; - - /** -+ * struct dma_buf_export_info - holds information needed to export a dma_buf -+ * @exp_name: name of the exporting module - useful for debugging. -+ * @ops: Attach allocator-defined dma buf ops to the new buffer -+ * @size: Size of the buffer -+ * @flags: mode flags for the file -+ * @resv: reservation-object, NULL to allocate default one -+ * @priv: Attach private data of allocator to this buffer -+ * -+ * This structure holds the information required to export the buffer. Used -+ * with dma_buf_export() only. -+ */ -+struct dma_buf_export_info { -+ const char *exp_name; -+ const struct dma_buf_ops *ops; -+ size_t size; -+ int flags; -+ struct reservation_object *resv; -+ void *priv; -+}; -+ -+/** -+ * helper macro for exporters; zeros and fills in most common values -+ */ -+#define DEFINE_DMA_BUF_EXPORT_INFO(a) \ -+ struct dma_buf_export_info a = { .exp_name = KBUILD_MODNAME } -+ -+/** - * get_dma_buf - convenience wrapper for get_file. - * @dmabuf: [in] pointer to dma_buf - * -@@ -181,12 +208,7 @@ struct dma_buf_attachment *dma_buf_attac - void dma_buf_detach(struct dma_buf *dmabuf, - struct dma_buf_attachment *dmabuf_attach); - --struct dma_buf *dma_buf_export_named(void *priv, const struct dma_buf_ops *ops, -- size_t size, int flags, const char *, -- struct reservation_object *); -- --#define dma_buf_export(priv, ops, size, flags, resv) \ -- dma_buf_export_named(priv, ops, size, flags, KBUILD_MODNAME, resv) -+struct dma_buf *dma_buf_export(const struct dma_buf_export_info *exp_info); - - int dma_buf_fd(struct dma_buf *dmabuf, int flags); - struct dma_buf *dma_buf_get(int fd); ---- a/linux/drivers/media/v4l2-core/videobuf2-dma-contig.c -+++ b/linux/drivers/media/v4l2-core/videobuf2-dma-contig.c -@@ -402,6 +402,12 @@ static struct dma_buf *vb2_dc_get_dmabuf - { - struct vb2_dc_buf *buf = buf_priv; - struct dma_buf *dbuf; -+ DEFINE_DMA_BUF_EXPORT_INFO(exp_info); -+ -+ exp_info.ops = &vb2_dc_dmabuf_ops; -+ exp_info.size = buf->size; -+ exp_info.flags = flags; -+ exp_info.priv = buf; - - if (!buf->sgt_base) - buf->sgt_base = vb2_dc_get_base_sgt(buf); -@@ -409,7 +415,7 @@ static struct dma_buf *vb2_dc_get_dmabuf - if (WARN_ON(!buf->sgt_base)) - return NULL; - -- dbuf = dma_buf_export(buf, &vb2_dc_dmabuf_ops, buf->size, flags, NULL); -+ dbuf = dma_buf_export(&exp_info); - if (IS_ERR(dbuf)) - return NULL; - ---- a/linux/drivers/media/v4l2-core/videobuf2-dma-sg.c -+++ b/linux/drivers/media/v4l2-core/videobuf2-dma-sg.c -@@ -583,11 +583,17 @@ static struct dma_buf *vb2_dma_sg_get_dm - { - struct vb2_dma_sg_buf *buf = buf_priv; - struct dma_buf *dbuf; -+ DEFINE_DMA_BUF_EXPORT_INFO(exp_info); -+ -+ exp_info.ops = &vb2_dma_sg_dmabuf_ops; -+ exp_info.size = buf->size; -+ exp_info.flags = flags; -+ exp_info.priv = buf; - - if (WARN_ON(!buf->dma_sgt)) - return NULL; - -- dbuf = dma_buf_export(buf, &vb2_dma_sg_dmabuf_ops, buf->size, flags, NULL); -+ dbuf = dma_buf_export(&exp_info); - if (IS_ERR(dbuf)) - return NULL; - ---- a/linux/drivers/media/v4l2-core/videobuf2-vmalloc.c -+++ b/linux/drivers/media/v4l2-core/videobuf2-vmalloc.c -@@ -367,11 +367,17 @@ static struct dma_buf *vb2_vmalloc_get_d - { - struct vb2_vmalloc_buf *buf = buf_priv; - struct dma_buf *dbuf; -+ DEFINE_DMA_BUF_EXPORT_INFO(exp_info); -+ -+ exp_info.ops = &vb2_vmalloc_dmabuf_ops; -+ exp_info.size = buf->size; -+ exp_info.flags = flags; -+ exp_info.priv = buf; - - if (WARN_ON(!buf->vaddr)) - return NULL; - -- dbuf = dma_buf_export(buf, &vb2_vmalloc_dmabuf_ops, buf->size, flags, NULL); -+ dbuf = dma_buf_export(&exp_info); - if (IS_ERR(dbuf)) - return NULL; - |