* [PATCH v2 1/1] drm: add kernel doc for exported gem dmabuf_ops
@ 2018-01-18 21:44 Samuel Li
[not found] ` <1516311860-24949-1-git-send-email-Samuel.Li-5C7GfCeVMHo@public.gmane.org>
0 siblings, 1 reply; 8+ messages in thread
From: Samuel Li @ 2018-01-18 21:44 UTC (permalink / raw)
To: amd-gfx, dri-devel; +Cc: Samuel Li
Signed-off-by: Samuel Li <Samuel.Li@amd.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
drivers/gpu/drm/drm_prime.c | 88 +++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 88 insertions(+)
diff --git a/drivers/gpu/drm/drm_prime.c b/drivers/gpu/drm/drm_prime.c
index ca09ce7..e82a976 100644
--- a/drivers/gpu/drm/drm_prime.c
+++ b/drivers/gpu/drm/drm_prime.c
@@ -73,6 +73,9 @@
* Drivers should detect this situation and return back the gem object
* from the dma-buf private. Prime will do this automatically for drivers that
* use the drm_gem_prime_{import,export} helpers.
+ *
+ * GEM struct &dma_buf_ops symbols are now exported. They can be resued by
+ * drivers which implement GEM interface.
*/
struct drm_prime_member {
@@ -180,6 +183,18 @@ static int drm_prime_lookup_buf_handle(struct drm_prime_file_private *prime_fpri
return -ENOENT;
}
+/**
+ * drm_gem_map_attach - dma_buf attach implementation for GEM
+ * @dma_buf: buffer to attach device to
+ * @target_dev: not used
+ * @attach: buffer attachment data
+ *
+ * Allocates &drm_prime_attachment and calls &drm_driver.gem_prime_pin for
+ * device specific attachment. This can be used as the &dma_buf_ops.attach
+ * callback.
+ *
+ * Returns 0 on success, negative error code on failure.
+ */
int drm_gem_map_attach(struct dma_buf *dma_buf, struct device *target_dev,
struct dma_buf_attachment *attach)
{
@@ -201,6 +216,14 @@ int drm_gem_map_attach(struct dma_buf *dma_buf, struct device *target_dev,
}
EXPORT_SYMBOL(drm_gem_map_attach);
+/**
+ * drm_gem_map_detach - dma_buf detach implementation for GEM
+ * @dma_buf: buffer to detach from
+ * @attach: attachment to be detached
+ *
+ * Cleans up &dma_buf_attachment. This can be used as the &dma_buf_ops.detach
+ * callback.
+ */
void drm_gem_map_detach(struct dma_buf *dma_buf,
struct dma_buf_attachment *attach)
{
@@ -255,6 +278,18 @@ void drm_prime_remove_buf_handle_locked(struct drm_prime_file_private *prime_fpr
}
}
+/**
+ * drm_gem_map_dma_buf - map_dma_buf implementation for GEM
+ * @attach: attachment whose scatterlist is to be returned
+ * @dir: direction of DMA transfer
+ *
+ * Calls &drm_driver.gem_prime_get_sg_table and then maps the scatterlist. This
+ * can be used as the &dma_buf_ops.map_dma_buf callback.
+ *
+ * Returns sg_table containing the scatterlist to be returned; returns ERR_PTR
+ * on error. May return -EINTR if it is interrupted by a signal.
+ */
+
struct sg_table *drm_gem_map_dma_buf(struct dma_buf_attachment *attach,
enum dma_data_direction dir)
{
@@ -294,6 +329,12 @@ struct sg_table *drm_gem_map_dma_buf(struct dma_buf_attachment *attach,
}
EXPORT_SYMBOL(drm_gem_map_dma_buf);
+/**
+ * drm_gem_unmap_dma_buf - unmap_dma_buf implementation for GEM
+ *
+ * Not implemented. The unmap is done at drm_gem_map_detach(). This can be
+ * used as the &dma_buf_ops.unmap_dma_buf callback.
+ */
void drm_gem_unmap_dma_buf(struct dma_buf_attachment *attach,
struct sg_table *sgt,
enum dma_data_direction dir)
@@ -351,6 +392,15 @@ void drm_gem_dmabuf_release(struct dma_buf *dma_buf)
}
EXPORT_SYMBOL(drm_gem_dmabuf_release);
+/**
+ * drm_gem_dmabuf_vmap - dma_buf vmap implementation for GEM
+ * @dma_buf: buffer to be mapped
+ *
+ * Sets up a kernel virtual mapping. This can be used as the &dma_buf_ops.vmap
+ * callback.
+ *
+ * Returns the kernel virtual address.
+ */
void *drm_gem_dmabuf_vmap(struct dma_buf *dma_buf)
{
struct drm_gem_object *obj = dma_buf->priv;
@@ -360,6 +410,14 @@ void *drm_gem_dmabuf_vmap(struct dma_buf *dma_buf)
}
EXPORT_SYMBOL(drm_gem_dmabuf_vmap);
+/**
+ * drm_gem_dmabuf_vunmap - dma_buf vunmap implementation for GEM
+ * @dma_buf: buffer to be unmapped
+ * @vaddr: the virtual address of the buffer
+ *
+ * Releases a kernel virtual mapping. This can be used as the
+ * &dma_buf_ops.vunmap callback.
+ */
void drm_gem_dmabuf_vunmap(struct dma_buf *dma_buf, void *vaddr)
{
struct drm_gem_object *obj = dma_buf->priv;
@@ -369,6 +427,11 @@ void drm_gem_dmabuf_vunmap(struct dma_buf *dma_buf, void *vaddr)
}
EXPORT_SYMBOL(drm_gem_dmabuf_vunmap);
+/**
+ * drm_gem_dmabuf_kmap_atomic - map_atomic implementation for GEM
+ *
+ * Not implemented. This can be used as the &dma_buf_ops.map_atomic callback.
+ */
void *drm_gem_dmabuf_kmap_atomic(struct dma_buf *dma_buf,
unsigned long page_num)
{
@@ -376,6 +439,11 @@ void *drm_gem_dmabuf_kmap_atomic(struct dma_buf *dma_buf,
}
EXPORT_SYMBOL(drm_gem_dmabuf_kmap_atomic);
+/**
+ * drm_gem_dmabuf_kunmap_atomic - unmap_atomic implementation for GEM
+ *
+ * Not implemented. This can be used as the &dma_buf_ops.unmap_atomic callback.
+ */
void drm_gem_dmabuf_kunmap_atomic(struct dma_buf *dma_buf,
unsigned long page_num, void *addr)
{
@@ -383,12 +451,22 @@ void drm_gem_dmabuf_kunmap_atomic(struct dma_buf *dma_buf,
}
EXPORT_SYMBOL(drm_gem_dmabuf_kunmap_atomic);
+/**
+ * drm_gem_dmabuf_kmap - map implementation for GEM
+ *
+ * Not implemented. This can be used as the &dma_buf_ops.map callback.
+ */
void *drm_gem_dmabuf_kmap(struct dma_buf *dma_buf, unsigned long page_num)
{
return NULL;
}
EXPORT_SYMBOL(drm_gem_dmabuf_kmap);
+/**
+ * drm_gem_dmabuf_kunmap - unmap implementation for GEM
+ *
+ * Not implemented. This can be used as the &dma_buf_ops.unmap callback.
+ */
void drm_gem_dmabuf_kunmap(struct dma_buf *dma_buf, unsigned long page_num,
void *addr)
{
@@ -396,6 +474,16 @@ void drm_gem_dmabuf_kunmap(struct dma_buf *dma_buf, unsigned long page_num,
}
EXPORT_SYMBOL(drm_gem_dmabuf_kunmap);
+/**
+ * drm_gem_dmabuf_mmap - dma_buf mmap implementation for GEM
+ * @dma_buf: buffer to be mapped
+ * @vma: virtual address range
+ *
+ * Provides memory mapping for the buffer. This can be used as the
+ * &dma_buf_ops.mmap callback.
+ *
+ * Returns 0 on success or a negative error code on failure.
+ */
int drm_gem_dmabuf_mmap(struct dma_buf *dma_buf, struct vm_area_struct *vma)
{
struct drm_gem_object *obj = dma_buf->priv;
--
2.7.4
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 8+ messages in thread[parent not found: <1516311860-24949-1-git-send-email-Samuel.Li-5C7GfCeVMHo@public.gmane.org>]
* Re: [PATCH v2 1/1] drm: add kernel doc for exported gem dmabuf_ops [not found] ` <1516311860-24949-1-git-send-email-Samuel.Li-5C7GfCeVMHo@public.gmane.org> @ 2018-01-19 8:51 ` Christian König 2018-01-30 9:32 ` Daniel Vetter 0 siblings, 1 reply; 8+ messages in thread From: Christian König @ 2018-01-19 8:51 UTC (permalink / raw) To: Samuel Li, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW Am 18.01.2018 um 22:44 schrieb Samuel Li: > Signed-off-by: Samuel Li <Samuel.Li@amd.com> > Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Reviewed-by: Christian König <christian.koenig@amd.com> > --- > drivers/gpu/drm/drm_prime.c | 88 +++++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 88 insertions(+) > > diff --git a/drivers/gpu/drm/drm_prime.c b/drivers/gpu/drm/drm_prime.c > index ca09ce7..e82a976 100644 > --- a/drivers/gpu/drm/drm_prime.c > +++ b/drivers/gpu/drm/drm_prime.c > @@ -73,6 +73,9 @@ > * Drivers should detect this situation and return back the gem object > * from the dma-buf private. Prime will do this automatically for drivers that > * use the drm_gem_prime_{import,export} helpers. > + * > + * GEM struct &dma_buf_ops symbols are now exported. They can be resued by > + * drivers which implement GEM interface. > */ > > struct drm_prime_member { > @@ -180,6 +183,18 @@ static int drm_prime_lookup_buf_handle(struct drm_prime_file_private *prime_fpri > return -ENOENT; > } > > +/** > + * drm_gem_map_attach - dma_buf attach implementation for GEM > + * @dma_buf: buffer to attach device to > + * @target_dev: not used > + * @attach: buffer attachment data > + * > + * Allocates &drm_prime_attachment and calls &drm_driver.gem_prime_pin for > + * device specific attachment. This can be used as the &dma_buf_ops.attach > + * callback. > + * > + * Returns 0 on success, negative error code on failure. > + */ > int drm_gem_map_attach(struct dma_buf *dma_buf, struct device *target_dev, > struct dma_buf_attachment *attach) > { > @@ -201,6 +216,14 @@ int drm_gem_map_attach(struct dma_buf *dma_buf, struct device *target_dev, > } > EXPORT_SYMBOL(drm_gem_map_attach); > > +/** > + * drm_gem_map_detach - dma_buf detach implementation for GEM > + * @dma_buf: buffer to detach from > + * @attach: attachment to be detached > + * > + * Cleans up &dma_buf_attachment. This can be used as the &dma_buf_ops.detach > + * callback. > + */ > void drm_gem_map_detach(struct dma_buf *dma_buf, > struct dma_buf_attachment *attach) > { > @@ -255,6 +278,18 @@ void drm_prime_remove_buf_handle_locked(struct drm_prime_file_private *prime_fpr > } > } > > +/** > + * drm_gem_map_dma_buf - map_dma_buf implementation for GEM > + * @attach: attachment whose scatterlist is to be returned > + * @dir: direction of DMA transfer > + * > + * Calls &drm_driver.gem_prime_get_sg_table and then maps the scatterlist. This > + * can be used as the &dma_buf_ops.map_dma_buf callback. > + * > + * Returns sg_table containing the scatterlist to be returned; returns ERR_PTR > + * on error. May return -EINTR if it is interrupted by a signal. > + */ > + > struct sg_table *drm_gem_map_dma_buf(struct dma_buf_attachment *attach, > enum dma_data_direction dir) > { > @@ -294,6 +329,12 @@ struct sg_table *drm_gem_map_dma_buf(struct dma_buf_attachment *attach, > } > EXPORT_SYMBOL(drm_gem_map_dma_buf); > > +/** > + * drm_gem_unmap_dma_buf - unmap_dma_buf implementation for GEM > + * > + * Not implemented. The unmap is done at drm_gem_map_detach(). This can be > + * used as the &dma_buf_ops.unmap_dma_buf callback. > + */ > void drm_gem_unmap_dma_buf(struct dma_buf_attachment *attach, > struct sg_table *sgt, > enum dma_data_direction dir) > @@ -351,6 +392,15 @@ void drm_gem_dmabuf_release(struct dma_buf *dma_buf) > } > EXPORT_SYMBOL(drm_gem_dmabuf_release); > > +/** > + * drm_gem_dmabuf_vmap - dma_buf vmap implementation for GEM > + * @dma_buf: buffer to be mapped > + * > + * Sets up a kernel virtual mapping. This can be used as the &dma_buf_ops.vmap > + * callback. > + * > + * Returns the kernel virtual address. > + */ > void *drm_gem_dmabuf_vmap(struct dma_buf *dma_buf) > { > struct drm_gem_object *obj = dma_buf->priv; > @@ -360,6 +410,14 @@ void *drm_gem_dmabuf_vmap(struct dma_buf *dma_buf) > } > EXPORT_SYMBOL(drm_gem_dmabuf_vmap); > > +/** > + * drm_gem_dmabuf_vunmap - dma_buf vunmap implementation for GEM > + * @dma_buf: buffer to be unmapped > + * @vaddr: the virtual address of the buffer > + * > + * Releases a kernel virtual mapping. This can be used as the > + * &dma_buf_ops.vunmap callback. > + */ > void drm_gem_dmabuf_vunmap(struct dma_buf *dma_buf, void *vaddr) > { > struct drm_gem_object *obj = dma_buf->priv; > @@ -369,6 +427,11 @@ void drm_gem_dmabuf_vunmap(struct dma_buf *dma_buf, void *vaddr) > } > EXPORT_SYMBOL(drm_gem_dmabuf_vunmap); > > +/** > + * drm_gem_dmabuf_kmap_atomic - map_atomic implementation for GEM > + * > + * Not implemented. This can be used as the &dma_buf_ops.map_atomic callback. > + */ > void *drm_gem_dmabuf_kmap_atomic(struct dma_buf *dma_buf, > unsigned long page_num) > { > @@ -376,6 +439,11 @@ void *drm_gem_dmabuf_kmap_atomic(struct dma_buf *dma_buf, > } > EXPORT_SYMBOL(drm_gem_dmabuf_kmap_atomic); > > +/** > + * drm_gem_dmabuf_kunmap_atomic - unmap_atomic implementation for GEM > + * > + * Not implemented. This can be used as the &dma_buf_ops.unmap_atomic callback. > + */ > void drm_gem_dmabuf_kunmap_atomic(struct dma_buf *dma_buf, > unsigned long page_num, void *addr) > { > @@ -383,12 +451,22 @@ void drm_gem_dmabuf_kunmap_atomic(struct dma_buf *dma_buf, > } > EXPORT_SYMBOL(drm_gem_dmabuf_kunmap_atomic); > > +/** > + * drm_gem_dmabuf_kmap - map implementation for GEM > + * > + * Not implemented. This can be used as the &dma_buf_ops.map callback. > + */ > void *drm_gem_dmabuf_kmap(struct dma_buf *dma_buf, unsigned long page_num) > { > return NULL; > } > EXPORT_SYMBOL(drm_gem_dmabuf_kmap); > > +/** > + * drm_gem_dmabuf_kunmap - unmap implementation for GEM > + * > + * Not implemented. This can be used as the &dma_buf_ops.unmap callback. > + */ > void drm_gem_dmabuf_kunmap(struct dma_buf *dma_buf, unsigned long page_num, > void *addr) > { > @@ -396,6 +474,16 @@ void drm_gem_dmabuf_kunmap(struct dma_buf *dma_buf, unsigned long page_num, > } > EXPORT_SYMBOL(drm_gem_dmabuf_kunmap); > > +/** > + * drm_gem_dmabuf_mmap - dma_buf mmap implementation for GEM > + * @dma_buf: buffer to be mapped > + * @vma: virtual address range > + * > + * Provides memory mapping for the buffer. This can be used as the > + * &dma_buf_ops.mmap callback. > + * > + * Returns 0 on success or a negative error code on failure. > + */ > int drm_gem_dmabuf_mmap(struct dma_buf *dma_buf, struct vm_area_struct *vma) > { > struct drm_gem_object *obj = dma_buf->priv; _______________________________________________ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2 1/1] drm: add kernel doc for exported gem dmabuf_ops 2018-01-19 8:51 ` Christian König @ 2018-01-30 9:32 ` Daniel Vetter 2018-01-30 16:01 ` Li, Samuel 0 siblings, 1 reply; 8+ messages in thread From: Daniel Vetter @ 2018-01-30 9:32 UTC (permalink / raw) To: christian.koenig; +Cc: dri-devel, amd-gfx, Samuel Li On Fri, Jan 19, 2018 at 09:51:20AM +0100, Christian König wrote: > Am 18.01.2018 um 22:44 schrieb Samuel Li: > > Signed-off-by: Samuel Li <Samuel.Li@amd.com> > > Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Thanks for updating the docs. > > Reviewed-by: Christian König <christian.koenig@amd.com> I'm assuming you'll als push this one. -Daniel > > > --- > > drivers/gpu/drm/drm_prime.c | 88 +++++++++++++++++++++++++++++++++++++++++++++ > > 1 file changed, 88 insertions(+) > > > > diff --git a/drivers/gpu/drm/drm_prime.c b/drivers/gpu/drm/drm_prime.c > > index ca09ce7..e82a976 100644 > > --- a/drivers/gpu/drm/drm_prime.c > > +++ b/drivers/gpu/drm/drm_prime.c > > @@ -73,6 +73,9 @@ > > * Drivers should detect this situation and return back the gem object > > * from the dma-buf private. Prime will do this automatically for drivers that > > * use the drm_gem_prime_{import,export} helpers. > > + * > > + * GEM struct &dma_buf_ops symbols are now exported. They can be resued by > > + * drivers which implement GEM interface. > > */ > > struct drm_prime_member { > > @@ -180,6 +183,18 @@ static int drm_prime_lookup_buf_handle(struct drm_prime_file_private *prime_fpri > > return -ENOENT; > > } > > +/** > > + * drm_gem_map_attach - dma_buf attach implementation for GEM > > + * @dma_buf: buffer to attach device to > > + * @target_dev: not used > > + * @attach: buffer attachment data > > + * > > + * Allocates &drm_prime_attachment and calls &drm_driver.gem_prime_pin for > > + * device specific attachment. This can be used as the &dma_buf_ops.attach > > + * callback. > > + * > > + * Returns 0 on success, negative error code on failure. > > + */ > > int drm_gem_map_attach(struct dma_buf *dma_buf, struct device *target_dev, > > struct dma_buf_attachment *attach) > > { > > @@ -201,6 +216,14 @@ int drm_gem_map_attach(struct dma_buf *dma_buf, struct device *target_dev, > > } > > EXPORT_SYMBOL(drm_gem_map_attach); > > +/** > > + * drm_gem_map_detach - dma_buf detach implementation for GEM > > + * @dma_buf: buffer to detach from > > + * @attach: attachment to be detached > > + * > > + * Cleans up &dma_buf_attachment. This can be used as the &dma_buf_ops.detach > > + * callback. > > + */ > > void drm_gem_map_detach(struct dma_buf *dma_buf, > > struct dma_buf_attachment *attach) > > { > > @@ -255,6 +278,18 @@ void drm_prime_remove_buf_handle_locked(struct drm_prime_file_private *prime_fpr > > } > > } > > +/** > > + * drm_gem_map_dma_buf - map_dma_buf implementation for GEM > > + * @attach: attachment whose scatterlist is to be returned > > + * @dir: direction of DMA transfer > > + * > > + * Calls &drm_driver.gem_prime_get_sg_table and then maps the scatterlist. This > > + * can be used as the &dma_buf_ops.map_dma_buf callback. > > + * > > + * Returns sg_table containing the scatterlist to be returned; returns ERR_PTR > > + * on error. May return -EINTR if it is interrupted by a signal. > > + */ > > + > > struct sg_table *drm_gem_map_dma_buf(struct dma_buf_attachment *attach, > > enum dma_data_direction dir) > > { > > @@ -294,6 +329,12 @@ struct sg_table *drm_gem_map_dma_buf(struct dma_buf_attachment *attach, > > } > > EXPORT_SYMBOL(drm_gem_map_dma_buf); > > +/** > > + * drm_gem_unmap_dma_buf - unmap_dma_buf implementation for GEM > > + * > > + * Not implemented. The unmap is done at drm_gem_map_detach(). This can be > > + * used as the &dma_buf_ops.unmap_dma_buf callback. > > + */ > > void drm_gem_unmap_dma_buf(struct dma_buf_attachment *attach, > > struct sg_table *sgt, > > enum dma_data_direction dir) > > @@ -351,6 +392,15 @@ void drm_gem_dmabuf_release(struct dma_buf *dma_buf) > > } > > EXPORT_SYMBOL(drm_gem_dmabuf_release); > > +/** > > + * drm_gem_dmabuf_vmap - dma_buf vmap implementation for GEM > > + * @dma_buf: buffer to be mapped > > + * > > + * Sets up a kernel virtual mapping. This can be used as the &dma_buf_ops.vmap > > + * callback. > > + * > > + * Returns the kernel virtual address. > > + */ > > void *drm_gem_dmabuf_vmap(struct dma_buf *dma_buf) > > { > > struct drm_gem_object *obj = dma_buf->priv; > > @@ -360,6 +410,14 @@ void *drm_gem_dmabuf_vmap(struct dma_buf *dma_buf) > > } > > EXPORT_SYMBOL(drm_gem_dmabuf_vmap); > > +/** > > + * drm_gem_dmabuf_vunmap - dma_buf vunmap implementation for GEM > > + * @dma_buf: buffer to be unmapped > > + * @vaddr: the virtual address of the buffer > > + * > > + * Releases a kernel virtual mapping. This can be used as the > > + * &dma_buf_ops.vunmap callback. > > + */ > > void drm_gem_dmabuf_vunmap(struct dma_buf *dma_buf, void *vaddr) > > { > > struct drm_gem_object *obj = dma_buf->priv; > > @@ -369,6 +427,11 @@ void drm_gem_dmabuf_vunmap(struct dma_buf *dma_buf, void *vaddr) > > } > > EXPORT_SYMBOL(drm_gem_dmabuf_vunmap); > > +/** > > + * drm_gem_dmabuf_kmap_atomic - map_atomic implementation for GEM > > + * > > + * Not implemented. This can be used as the &dma_buf_ops.map_atomic callback. > > + */ > > void *drm_gem_dmabuf_kmap_atomic(struct dma_buf *dma_buf, > > unsigned long page_num) > > { > > @@ -376,6 +439,11 @@ void *drm_gem_dmabuf_kmap_atomic(struct dma_buf *dma_buf, > > } > > EXPORT_SYMBOL(drm_gem_dmabuf_kmap_atomic); > > +/** > > + * drm_gem_dmabuf_kunmap_atomic - unmap_atomic implementation for GEM > > + * > > + * Not implemented. This can be used as the &dma_buf_ops.unmap_atomic callback. > > + */ > > void drm_gem_dmabuf_kunmap_atomic(struct dma_buf *dma_buf, > > unsigned long page_num, void *addr) > > { > > @@ -383,12 +451,22 @@ void drm_gem_dmabuf_kunmap_atomic(struct dma_buf *dma_buf, > > } > > EXPORT_SYMBOL(drm_gem_dmabuf_kunmap_atomic); > > +/** > > + * drm_gem_dmabuf_kmap - map implementation for GEM > > + * > > + * Not implemented. This can be used as the &dma_buf_ops.map callback. > > + */ > > void *drm_gem_dmabuf_kmap(struct dma_buf *dma_buf, unsigned long page_num) > > { > > return NULL; > > } > > EXPORT_SYMBOL(drm_gem_dmabuf_kmap); > > +/** > > + * drm_gem_dmabuf_kunmap - unmap implementation for GEM > > + * > > + * Not implemented. This can be used as the &dma_buf_ops.unmap callback. > > + */ > > void drm_gem_dmabuf_kunmap(struct dma_buf *dma_buf, unsigned long page_num, > > void *addr) > > { > > @@ -396,6 +474,16 @@ void drm_gem_dmabuf_kunmap(struct dma_buf *dma_buf, unsigned long page_num, > > } > > EXPORT_SYMBOL(drm_gem_dmabuf_kunmap); > > +/** > > + * drm_gem_dmabuf_mmap - dma_buf mmap implementation for GEM > > + * @dma_buf: buffer to be mapped > > + * @vma: virtual address range > > + * > > + * Provides memory mapping for the buffer. This can be used as the > > + * &dma_buf_ops.mmap callback. > > + * > > + * Returns 0 on success or a negative error code on failure. > > + */ > > int drm_gem_dmabuf_mmap(struct dma_buf *dma_buf, struct vm_area_struct *vma) > > { > > struct drm_gem_object *obj = dma_buf->priv; > > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel ^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: [PATCH v2 1/1] drm: add kernel doc for exported gem dmabuf_ops 2018-01-30 9:32 ` Daniel Vetter @ 2018-01-30 16:01 ` Li, Samuel 2018-02-20 15:12 ` Daniel Vetter 0 siblings, 1 reply; 8+ messages in thread From: Li, Samuel @ 2018-01-30 16:01 UTC (permalink / raw) To: Daniel Vetter, Koenig, Christian Cc: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Alex helped push this into drm-tip, https://cgit.freedesktop.org/drm/drm-tip/commit/drivers/gpu/drm?id=f7a71b0cf9e36c1b0edbfe89ce028a01164b864d Thanks, Samuel Li > -----Original Message----- > From: Daniel Vetter [mailto:daniel.vetter@ffwll.ch] On Behalf Of Daniel > Vetter > Sent: Tuesday, January 30, 2018 4:33 AM > To: Koenig, Christian <Christian.Koenig@amd.com> > Cc: Li, Samuel <Samuel.Li@amd.com>; amd-gfx@lists.freedesktop.org; dri- > devel@lists.freedesktop.org > Subject: Re: [PATCH v2 1/1] drm: add kernel doc for exported gem > dmabuf_ops > > On Fri, Jan 19, 2018 at 09:51:20AM +0100, Christian König wrote: > > Am 18.01.2018 um 22:44 schrieb Samuel Li: > > > Signed-off-by: Samuel Li <Samuel.Li@amd.com> > > > Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> > > Thanks for updating the docs. > > > > Reviewed-by: Christian König <christian.koenig@amd.com> > > I'm assuming you'll als push this one. > -Daniel > > > > > > --- > > > drivers/gpu/drm/drm_prime.c | 88 > +++++++++++++++++++++++++++++++++++++++++++++ > > > 1 file changed, 88 insertions(+) > > > > > > diff --git a/drivers/gpu/drm/drm_prime.c > > > b/drivers/gpu/drm/drm_prime.c index ca09ce7..e82a976 100644 > > > --- a/drivers/gpu/drm/drm_prime.c > > > +++ b/drivers/gpu/drm/drm_prime.c > > > @@ -73,6 +73,9 @@ > > > * Drivers should detect this situation and return back the gem object > > > * from the dma-buf private. Prime will do this automatically for drivers > that > > > * use the drm_gem_prime_{import,export} helpers. > > > + * > > > + * GEM struct &dma_buf_ops symbols are now exported. They can be > > > + resued by > > > + * drivers which implement GEM interface. > > > */ > > > struct drm_prime_member { > > > @@ -180,6 +183,18 @@ static int drm_prime_lookup_buf_handle(struct > drm_prime_file_private *prime_fpri > > > return -ENOENT; > > > } > > > +/** > > > + * drm_gem_map_attach - dma_buf attach implementation for GEM > > > + * @dma_buf: buffer to attach device to > > > + * @target_dev: not used > > > + * @attach: buffer attachment data > > > + * > > > + * Allocates &drm_prime_attachment and calls > > > +&drm_driver.gem_prime_pin for > > > + * device specific attachment. This can be used as the > > > +&dma_buf_ops.attach > > > + * callback. > > > + * > > > + * Returns 0 on success, negative error code on failure. > > > + */ > > > int drm_gem_map_attach(struct dma_buf *dma_buf, struct device > *target_dev, > > > struct dma_buf_attachment *attach) > > > { > > > @@ -201,6 +216,14 @@ int drm_gem_map_attach(struct dma_buf > *dma_buf, struct device *target_dev, > > > } > > > EXPORT_SYMBOL(drm_gem_map_attach); > > > +/** > > > + * drm_gem_map_detach - dma_buf detach implementation for GEM > > > + * @dma_buf: buffer to detach from > > > + * @attach: attachment to be detached > > > + * > > > + * Cleans up &dma_buf_attachment. This can be used as the > > > +&dma_buf_ops.detach > > > + * callback. > > > + */ > > > void drm_gem_map_detach(struct dma_buf *dma_buf, > > > struct dma_buf_attachment *attach) > > > { > > > @@ -255,6 +278,18 @@ void > drm_prime_remove_buf_handle_locked(struct drm_prime_file_private > *prime_fpr > > > } > > > } > > > +/** > > > + * drm_gem_map_dma_buf - map_dma_buf implementation for GEM > > > + * @attach: attachment whose scatterlist is to be returned > > > + * @dir: direction of DMA transfer > > > + * > > > + * Calls &drm_driver.gem_prime_get_sg_table and then maps the > > > +scatterlist. This > > > + * can be used as the &dma_buf_ops.map_dma_buf callback. > > > + * > > > + * Returns sg_table containing the scatterlist to be returned; > > > +returns ERR_PTR > > > + * on error. May return -EINTR if it is interrupted by a signal. > > > + */ > > > + > > > struct sg_table *drm_gem_map_dma_buf(struct dma_buf_attachment > *attach, > > > enum dma_data_direction dir) > > > { > > > @@ -294,6 +329,12 @@ struct sg_table *drm_gem_map_dma_buf(struct > dma_buf_attachment *attach, > > > } > > > EXPORT_SYMBOL(drm_gem_map_dma_buf); > > > +/** > > > + * drm_gem_unmap_dma_buf - unmap_dma_buf implementation for > GEM > > > + * > > > + * Not implemented. The unmap is done at drm_gem_map_detach(). > > > +This can be > > > + * used as the &dma_buf_ops.unmap_dma_buf callback. > > > + */ > > > void drm_gem_unmap_dma_buf(struct dma_buf_attachment *attach, > > > struct sg_table *sgt, > > > enum dma_data_direction dir) @@ -351,6 +392,15 > @@ void > > > drm_gem_dmabuf_release(struct dma_buf *dma_buf) > > > } > > > EXPORT_SYMBOL(drm_gem_dmabuf_release); > > > +/** > > > + * drm_gem_dmabuf_vmap - dma_buf vmap implementation for GEM > > > + * @dma_buf: buffer to be mapped > > > + * > > > + * Sets up a kernel virtual mapping. This can be used as the > > > +&dma_buf_ops.vmap > > > + * callback. > > > + * > > > + * Returns the kernel virtual address. > > > + */ > > > void *drm_gem_dmabuf_vmap(struct dma_buf *dma_buf) > > > { > > > struct drm_gem_object *obj = dma_buf->priv; @@ -360,6 +410,14 > @@ > > > void *drm_gem_dmabuf_vmap(struct dma_buf *dma_buf) > > > } > > > EXPORT_SYMBOL(drm_gem_dmabuf_vmap); > > > +/** > > > + * drm_gem_dmabuf_vunmap - dma_buf vunmap implementation for > GEM > > > + * @dma_buf: buffer to be unmapped > > > + * @vaddr: the virtual address of the buffer > > > + * > > > + * Releases a kernel virtual mapping. This can be used as the > > > + * &dma_buf_ops.vunmap callback. > > > + */ > > > void drm_gem_dmabuf_vunmap(struct dma_buf *dma_buf, void > *vaddr) > > > { > > > struct drm_gem_object *obj = dma_buf->priv; @@ -369,6 +427,11 > @@ > > > void drm_gem_dmabuf_vunmap(struct dma_buf *dma_buf, void *vaddr) > > > } > > > EXPORT_SYMBOL(drm_gem_dmabuf_vunmap); > > > +/** > > > + * drm_gem_dmabuf_kmap_atomic - map_atomic implementation for > GEM > > > + * > > > + * Not implemented. This can be used as the > &dma_buf_ops.map_atomic callback. > > > + */ > > > void *drm_gem_dmabuf_kmap_atomic(struct dma_buf *dma_buf, > > > unsigned long page_num) > > > { > > > @@ -376,6 +439,11 @@ void *drm_gem_dmabuf_kmap_atomic(struct > dma_buf *dma_buf, > > > } > > > EXPORT_SYMBOL(drm_gem_dmabuf_kmap_atomic); > > > +/** > > > + * drm_gem_dmabuf_kunmap_atomic - unmap_atomic > implementation for > > > +GEM > > > + * > > > + * Not implemented. This can be used as the > &dma_buf_ops.unmap_atomic callback. > > > + */ > > > void drm_gem_dmabuf_kunmap_atomic(struct dma_buf *dma_buf, > > > unsigned long page_num, void *addr) > > > { > > > @@ -383,12 +451,22 @@ void drm_gem_dmabuf_kunmap_atomic(struct > dma_buf *dma_buf, > > > } > > > EXPORT_SYMBOL(drm_gem_dmabuf_kunmap_atomic); > > > +/** > > > + * drm_gem_dmabuf_kmap - map implementation for GEM > > > + * > > > + * Not implemented. This can be used as the &dma_buf_ops.map > callback. > > > + */ > > > void *drm_gem_dmabuf_kmap(struct dma_buf *dma_buf, unsigned > long page_num) > > > { > > > return NULL; > > > } > > > EXPORT_SYMBOL(drm_gem_dmabuf_kmap); > > > +/** > > > + * drm_gem_dmabuf_kunmap - unmap implementation for GEM > > > + * > > > + * Not implemented. This can be used as the &dma_buf_ops.unmap > callback. > > > + */ > > > void drm_gem_dmabuf_kunmap(struct dma_buf *dma_buf, unsigned > long page_num, > > > void *addr) > > > { > > > @@ -396,6 +474,16 @@ void drm_gem_dmabuf_kunmap(struct > dma_buf *dma_buf, unsigned long page_num, > > > } > > > EXPORT_SYMBOL(drm_gem_dmabuf_kunmap); > > > +/** > > > + * drm_gem_dmabuf_mmap - dma_buf mmap implementation for > GEM > > > + * @dma_buf: buffer to be mapped > > > + * @vma: virtual address range > > > + * > > > + * Provides memory mapping for the buffer. This can be used as the > > > + * &dma_buf_ops.mmap callback. > > > + * > > > + * Returns 0 on success or a negative error code on failure. > > > + */ > > > int drm_gem_dmabuf_mmap(struct dma_buf *dma_buf, struct > vm_area_struct *vma) > > > { > > > struct drm_gem_object *obj = dma_buf->priv; > > > > _______________________________________________ > > dri-devel mailing list > > dri-devel@lists.freedesktop.org > > https://lists.freedesktop.org/mailman/listinfo/dri-devel > > -- > Daniel Vetter > Software Engineer, Intel Corporation > http://blog.ffwll.ch _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2 1/1] drm: add kernel doc for exported gem dmabuf_ops 2018-01-30 16:01 ` Li, Samuel @ 2018-02-20 15:12 ` Daniel Vetter 2018-02-20 15:46 ` Li, Samuel 0 siblings, 1 reply; 8+ messages in thread From: Daniel Vetter @ 2018-02-20 15:12 UTC (permalink / raw) To: Li, Samuel Cc: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, Koenig, Christian On Tue, Jan 30, 2018 at 04:01:23PM +0000, Li, Samuel wrote: > > Alex helped push this into drm-tip, > https://cgit.freedesktop.org/drm/drm-tip/commit/drivers/gpu/drm?id=f7a71b0cf9e36c1b0edbfe89ce028a01164b864d > > Thanks, > Samuel Li > > > > -----Original Message----- > > From: Daniel Vetter [mailto:daniel.vetter@ffwll.ch] On Behalf Of Daniel > > Vetter > > Sent: Tuesday, January 30, 2018 4:33 AM > > To: Koenig, Christian <Christian.Koenig@amd.com> > > Cc: Li, Samuel <Samuel.Li@amd.com>; amd-gfx@lists.freedesktop.org; dri- > > devel@lists.freedesktop.org > > Subject: Re: [PATCH v2 1/1] drm: add kernel doc for exported gem > > dmabuf_ops > > > > On Fri, Jan 19, 2018 at 09:51:20AM +0100, Christian König wrote: > > > Am 18.01.2018 um 22:44 schrieb Samuel Li: > > > > Signed-off-by: Samuel Li <Samuel.Li@amd.com> > > > > Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> > > > > Thanks for updating the docs. > > > > > > Reviewed-by: Christian König <christian.koenig@amd.com> > > > > I'm assuming you'll als push this one. I just noticed that fairly obviously this wasn't tested when writing: ./drivers/gpu/drm/drm_prime.c:342: warning: Function parameter or member 'attach' not described in 'drm_gem_unmap_dma_buf' ./drivers/gpu/drm/drm_prime.c:342: warning: Function parameter or member 'sgt' not described in 'drm_gem_unmap_dma_buf' ./drivers/gpu/drm/drm_prime.c:342: warning: Function parameter or member 'dir' not described in 'drm_gem_unmap_dma_buf' ./drivers/gpu/drm/drm_prime.c:438: warning: Function parameter or member 'dma_buf' not described in 'drm_gem_dmabuf_kmap_atomic' ./drivers/gpu/drm/drm_prime.c:438: warning: Function parameter or member 'page_num' not described in 'drm_gem_dmabuf_kmap_atomic' ./drivers/gpu/drm/drm_prime.c:450: warning: Function parameter or member 'dma_buf' not described in 'drm_gem_dmabuf_kunmap_atomic' ./drivers/gpu/drm/drm_prime.c:450: warning: Function parameter or member 'page_num' not described in 'drm_gem_dmabuf_kunmap_atomic' ./drivers/gpu/drm/drm_prime.c:450: warning: Function parameter or member 'addr' not described in 'drm_gem_dmabuf_kunmap_atomic' ./drivers/gpu/drm/drm_prime.c:461: warning: Function parameter or member 'dma_buf' not described in 'drm_gem_dmabuf_kmap' ./drivers/gpu/drm/drm_prime.c:461: warning: Function parameter or member 'page_num' not described in 'drm_gem_dmabuf_kmap' ./drivers/gpu/drm/drm_prime.c:473: warning: Function parameter or member 'dma_buf' not described in 'drm_gem_dmabuf_kunmap' ./drivers/gpu/drm/drm_prime.c:473: warning: Function parameter or member 'page_num' not described in 'drm_gem_dmabuf_kunmap' ./drivers/gpu/drm/drm_prime.c:473: warning: Function parameter or member 'addr' not described in 'drm_gem_dmabuf_kunmap' Samuel, can you pls build docs using $ make htmldocs and fix up the fallout and submit a patch? Thanks, Daniel > > -Daniel > > > > > > > > > --- > > > > drivers/gpu/drm/drm_prime.c | 88 > > +++++++++++++++++++++++++++++++++++++++++++++ > > > > 1 file changed, 88 insertions(+) > > > > > > > > diff --git a/drivers/gpu/drm/drm_prime.c > > > > b/drivers/gpu/drm/drm_prime.c index ca09ce7..e82a976 100644 > > > > --- a/drivers/gpu/drm/drm_prime.c > > > > +++ b/drivers/gpu/drm/drm_prime.c > > > > @@ -73,6 +73,9 @@ > > > > * Drivers should detect this situation and return back the gem object > > > > * from the dma-buf private. Prime will do this automatically for drivers > > that > > > > * use the drm_gem_prime_{import,export} helpers. > > > > + * > > > > + * GEM struct &dma_buf_ops symbols are now exported. They can be > > > > + resued by > > > > + * drivers which implement GEM interface. > > > > */ > > > > struct drm_prime_member { > > > > @@ -180,6 +183,18 @@ static int drm_prime_lookup_buf_handle(struct > > drm_prime_file_private *prime_fpri > > > > return -ENOENT; > > > > } > > > > +/** > > > > + * drm_gem_map_attach - dma_buf attach implementation for GEM > > > > + * @dma_buf: buffer to attach device to > > > > + * @target_dev: not used > > > > + * @attach: buffer attachment data > > > > + * > > > > + * Allocates &drm_prime_attachment and calls > > > > +&drm_driver.gem_prime_pin for > > > > + * device specific attachment. This can be used as the > > > > +&dma_buf_ops.attach > > > > + * callback. > > > > + * > > > > + * Returns 0 on success, negative error code on failure. > > > > + */ > > > > int drm_gem_map_attach(struct dma_buf *dma_buf, struct device > > *target_dev, > > > > struct dma_buf_attachment *attach) > > > > { > > > > @@ -201,6 +216,14 @@ int drm_gem_map_attach(struct dma_buf > > *dma_buf, struct device *target_dev, > > > > } > > > > EXPORT_SYMBOL(drm_gem_map_attach); > > > > +/** > > > > + * drm_gem_map_detach - dma_buf detach implementation for GEM > > > > + * @dma_buf: buffer to detach from > > > > + * @attach: attachment to be detached > > > > + * > > > > + * Cleans up &dma_buf_attachment. This can be used as the > > > > +&dma_buf_ops.detach > > > > + * callback. > > > > + */ > > > > void drm_gem_map_detach(struct dma_buf *dma_buf, > > > > struct dma_buf_attachment *attach) > > > > { > > > > @@ -255,6 +278,18 @@ void > > drm_prime_remove_buf_handle_locked(struct drm_prime_file_private > > *prime_fpr > > > > } > > > > } > > > > +/** > > > > + * drm_gem_map_dma_buf - map_dma_buf implementation for GEM > > > > + * @attach: attachment whose scatterlist is to be returned > > > > + * @dir: direction of DMA transfer > > > > + * > > > > + * Calls &drm_driver.gem_prime_get_sg_table and then maps the > > > > +scatterlist. This > > > > + * can be used as the &dma_buf_ops.map_dma_buf callback. > > > > + * > > > > + * Returns sg_table containing the scatterlist to be returned; > > > > +returns ERR_PTR > > > > + * on error. May return -EINTR if it is interrupted by a signal. > > > > + */ > > > > + > > > > struct sg_table *drm_gem_map_dma_buf(struct dma_buf_attachment > > *attach, > > > > enum dma_data_direction dir) > > > > { > > > > @@ -294,6 +329,12 @@ struct sg_table *drm_gem_map_dma_buf(struct > > dma_buf_attachment *attach, > > > > } > > > > EXPORT_SYMBOL(drm_gem_map_dma_buf); > > > > +/** > > > > + * drm_gem_unmap_dma_buf - unmap_dma_buf implementation for > > GEM > > > > + * > > > > + * Not implemented. The unmap is done at drm_gem_map_detach(). > > > > +This can be > > > > + * used as the &dma_buf_ops.unmap_dma_buf callback. > > > > + */ > > > > void drm_gem_unmap_dma_buf(struct dma_buf_attachment *attach, > > > > struct sg_table *sgt, > > > > enum dma_data_direction dir) @@ -351,6 +392,15 > > @@ void > > > > drm_gem_dmabuf_release(struct dma_buf *dma_buf) > > > > } > > > > EXPORT_SYMBOL(drm_gem_dmabuf_release); > > > > +/** > > > > + * drm_gem_dmabuf_vmap - dma_buf vmap implementation for GEM > > > > + * @dma_buf: buffer to be mapped > > > > + * > > > > + * Sets up a kernel virtual mapping. This can be used as the > > > > +&dma_buf_ops.vmap > > > > + * callback. > > > > + * > > > > + * Returns the kernel virtual address. > > > > + */ > > > > void *drm_gem_dmabuf_vmap(struct dma_buf *dma_buf) > > > > { > > > > struct drm_gem_object *obj = dma_buf->priv; @@ -360,6 +410,14 > > @@ > > > > void *drm_gem_dmabuf_vmap(struct dma_buf *dma_buf) > > > > } > > > > EXPORT_SYMBOL(drm_gem_dmabuf_vmap); > > > > +/** > > > > + * drm_gem_dmabuf_vunmap - dma_buf vunmap implementation for > > GEM > > > > + * @dma_buf: buffer to be unmapped > > > > + * @vaddr: the virtual address of the buffer > > > > + * > > > > + * Releases a kernel virtual mapping. This can be used as the > > > > + * &dma_buf_ops.vunmap callback. > > > > + */ > > > > void drm_gem_dmabuf_vunmap(struct dma_buf *dma_buf, void > > *vaddr) > > > > { > > > > struct drm_gem_object *obj = dma_buf->priv; @@ -369,6 +427,11 > > @@ > > > > void drm_gem_dmabuf_vunmap(struct dma_buf *dma_buf, void *vaddr) > > > > } > > > > EXPORT_SYMBOL(drm_gem_dmabuf_vunmap); > > > > +/** > > > > + * drm_gem_dmabuf_kmap_atomic - map_atomic implementation for > > GEM > > > > + * > > > > + * Not implemented. This can be used as the > > &dma_buf_ops.map_atomic callback. > > > > + */ > > > > void *drm_gem_dmabuf_kmap_atomic(struct dma_buf *dma_buf, > > > > unsigned long page_num) > > > > { > > > > @@ -376,6 +439,11 @@ void *drm_gem_dmabuf_kmap_atomic(struct > > dma_buf *dma_buf, > > > > } > > > > EXPORT_SYMBOL(drm_gem_dmabuf_kmap_atomic); > > > > +/** > > > > + * drm_gem_dmabuf_kunmap_atomic - unmap_atomic > > implementation for > > > > +GEM > > > > + * > > > > + * Not implemented. This can be used as the > > &dma_buf_ops.unmap_atomic callback. > > > > + */ > > > > void drm_gem_dmabuf_kunmap_atomic(struct dma_buf *dma_buf, > > > > unsigned long page_num, void *addr) > > > > { > > > > @@ -383,12 +451,22 @@ void drm_gem_dmabuf_kunmap_atomic(struct > > dma_buf *dma_buf, > > > > } > > > > EXPORT_SYMBOL(drm_gem_dmabuf_kunmap_atomic); > > > > +/** > > > > + * drm_gem_dmabuf_kmap - map implementation for GEM > > > > + * > > > > + * Not implemented. This can be used as the &dma_buf_ops.map > > callback. > > > > + */ > > > > void *drm_gem_dmabuf_kmap(struct dma_buf *dma_buf, unsigned > > long page_num) > > > > { > > > > return NULL; > > > > } > > > > EXPORT_SYMBOL(drm_gem_dmabuf_kmap); > > > > +/** > > > > + * drm_gem_dmabuf_kunmap - unmap implementation for GEM > > > > + * > > > > + * Not implemented. This can be used as the &dma_buf_ops.unmap > > callback. > > > > + */ > > > > void drm_gem_dmabuf_kunmap(struct dma_buf *dma_buf, unsigned > > long page_num, > > > > void *addr) > > > > { > > > > @@ -396,6 +474,16 @@ void drm_gem_dmabuf_kunmap(struct > > dma_buf *dma_buf, unsigned long page_num, > > > > } > > > > EXPORT_SYMBOL(drm_gem_dmabuf_kunmap); > > > > +/** > > > > + * drm_gem_dmabuf_mmap - dma_buf mmap implementation for > > GEM > > > > + * @dma_buf: buffer to be mapped > > > > + * @vma: virtual address range > > > > + * > > > > + * Provides memory mapping for the buffer. This can be used as the > > > > + * &dma_buf_ops.mmap callback. > > > > + * > > > > + * Returns 0 on success or a negative error code on failure. > > > > + */ > > > > int drm_gem_dmabuf_mmap(struct dma_buf *dma_buf, struct > > vm_area_struct *vma) > > > > { > > > > struct drm_gem_object *obj = dma_buf->priv; > > > > > > _______________________________________________ > > > dri-devel mailing list > > > dri-devel@lists.freedesktop.org > > > https://lists.freedesktop.org/mailman/listinfo/dri-devel > > > > -- > > Daniel Vetter > > Software Engineer, Intel Corporation > > http://blog.ffwll.ch -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel ^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: [PATCH v2 1/1] drm: add kernel doc for exported gem dmabuf_ops 2018-02-20 15:12 ` Daniel Vetter @ 2018-02-20 15:46 ` Li, Samuel [not found] ` <BY1PR12MB0504572A89B32F384FA73645F5CF0-PicGAnIBOoZIlHzfMOeg3gdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org> 0 siblings, 1 reply; 8+ messages in thread From: Li, Samuel @ 2018-02-20 15:46 UTC (permalink / raw) To: Daniel Vetter Cc: dri-devel@lists.freedesktop.org, Koenig, Christian, amd-gfx@lists.freedesktop.org > ./drivers/gpu/drm/drm_prime.c:342: warning: Function parameter or > member 'attach' not described in 'drm_gem_unmap_dma_buf' > ./drivers/gpu/drm/drm_prime.c:342: warning: Function parameter or > member 'sgt' not described in 'drm_gem_unmap_dma_buf' > ./drivers/gpu/drm/drm_prime.c:342: warning: Function parameter or > member 'dir' not described in 'drm_gem_unmap_dma_buf' ... Actually I tested. Those parameters are left out on purpose since they are empty functions so far. Regards, Samuel Li > -----Original Message----- > From: Daniel Vetter [mailto:daniel.vetter@ffwll.ch] On Behalf Of Daniel > Vetter > Sent: Tuesday, February 20, 2018 10:13 AM > To: Li, Samuel <Samuel.Li@amd.com> > Cc: Daniel Vetter <daniel@ffwll.ch>; Koenig, Christian > <Christian.Koenig@amd.com>; amd-gfx@lists.freedesktop.org; dri- > devel@lists.freedesktop.org > Subject: Re: [PATCH v2 1/1] drm: add kernel doc for exported gem > dmabuf_ops > > On Tue, Jan 30, 2018 at 04:01:23PM +0000, Li, Samuel wrote: > > > > Alex helped push this into drm-tip, > > https://cgit.freedesktop.org/drm/drm- > tip/commit/drivers/gpu/drm?id=f7a > > 71b0cf9e36c1b0edbfe89ce028a01164b864d > > > > Thanks, > > Samuel Li > > > > > > > -----Original Message----- > > > From: Daniel Vetter [mailto:daniel.vetter@ffwll.ch] On Behalf Of > > > Daniel Vetter > > > Sent: Tuesday, January 30, 2018 4:33 AM > > > To: Koenig, Christian <Christian.Koenig@amd.com> > > > Cc: Li, Samuel <Samuel.Li@amd.com>; amd-gfx@lists.freedesktop.org; > > > dri- devel@lists.freedesktop.org > > > Subject: Re: [PATCH v2 1/1] drm: add kernel doc for exported gem > > > dmabuf_ops > > > > > > On Fri, Jan 19, 2018 at 09:51:20AM +0100, Christian König wrote: > > > > Am 18.01.2018 um 22:44 schrieb Samuel Li: > > > > > Signed-off-by: Samuel Li <Samuel.Li@amd.com> > > > > > Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> > > > > > > Thanks for updating the docs. > > > > > > > > Reviewed-by: Christian König <christian.koenig@amd.com> > > > > > > I'm assuming you'll als push this one. > > I just noticed that fairly obviously this wasn't tested when writing: > > ./drivers/gpu/drm/drm_prime.c:342: warning: Function parameter or > member 'attach' not described in 'drm_gem_unmap_dma_buf' > ./drivers/gpu/drm/drm_prime.c:342: warning: Function parameter or > member 'sgt' not described in 'drm_gem_unmap_dma_buf' > ./drivers/gpu/drm/drm_prime.c:342: warning: Function parameter or > member 'dir' not described in 'drm_gem_unmap_dma_buf' > ./drivers/gpu/drm/drm_prime.c:438: warning: Function parameter or > member 'dma_buf' not described in 'drm_gem_dmabuf_kmap_atomic' > ./drivers/gpu/drm/drm_prime.c:438: warning: Function parameter or > member 'page_num' not described in 'drm_gem_dmabuf_kmap_atomic' > ./drivers/gpu/drm/drm_prime.c:450: warning: Function parameter or > member 'dma_buf' not described in 'drm_gem_dmabuf_kunmap_atomic' > ./drivers/gpu/drm/drm_prime.c:450: warning: Function parameter or > member 'page_num' not described in 'drm_gem_dmabuf_kunmap_atomic' > ./drivers/gpu/drm/drm_prime.c:450: warning: Function parameter or > member 'addr' not described in 'drm_gem_dmabuf_kunmap_atomic' > ./drivers/gpu/drm/drm_prime.c:461: warning: Function parameter or > member 'dma_buf' not described in 'drm_gem_dmabuf_kmap' > ./drivers/gpu/drm/drm_prime.c:461: warning: Function parameter or > member 'page_num' not described in 'drm_gem_dmabuf_kmap' > ./drivers/gpu/drm/drm_prime.c:473: warning: Function parameter or > member 'dma_buf' not described in 'drm_gem_dmabuf_kunmap' > ./drivers/gpu/drm/drm_prime.c:473: warning: Function parameter or > member 'page_num' not described in 'drm_gem_dmabuf_kunmap' > ./drivers/gpu/drm/drm_prime.c:473: warning: Function parameter or > member 'addr' not described in 'drm_gem_dmabuf_kunmap' > > Samuel, can you pls build docs using > > $ make htmldocs > > and fix up the fallout and submit a patch? > > Thanks, Daniel > > > > -Daniel > > > > > > > > > > > > --- > > > > > drivers/gpu/drm/drm_prime.c | 88 > > > +++++++++++++++++++++++++++++++++++++++++++++ > > > > > 1 file changed, 88 insertions(+) > > > > > > > > > > diff --git a/drivers/gpu/drm/drm_prime.c > > > > > b/drivers/gpu/drm/drm_prime.c index ca09ce7..e82a976 100644 > > > > > --- a/drivers/gpu/drm/drm_prime.c > > > > > +++ b/drivers/gpu/drm/drm_prime.c > > > > > @@ -73,6 +73,9 @@ > > > > > * Drivers should detect this situation and return back the gem object > > > > > * from the dma-buf private. Prime will do this automatically > > > > > for drivers > > > that > > > > > * use the drm_gem_prime_{import,export} helpers. > > > > > + * > > > > > + * GEM struct &dma_buf_ops symbols are now exported. They can > > > > > + be resued by > > > > > + * drivers which implement GEM interface. > > > > > */ > > > > > struct drm_prime_member { > > > > > @@ -180,6 +183,18 @@ static int > > > > > drm_prime_lookup_buf_handle(struct > > > drm_prime_file_private *prime_fpri > > > > > return -ENOENT; > > > > > } > > > > > +/** > > > > > + * drm_gem_map_attach - dma_buf attach implementation for GEM > > > > > + * @dma_buf: buffer to attach device to > > > > > + * @target_dev: not used > > > > > + * @attach: buffer attachment data > > > > > + * > > > > > + * Allocates &drm_prime_attachment and calls > > > > > +&drm_driver.gem_prime_pin for > > > > > + * device specific attachment. This can be used as the > > > > > +&dma_buf_ops.attach > > > > > + * callback. > > > > > + * > > > > > + * Returns 0 on success, negative error code on failure. > > > > > + */ > > > > > int drm_gem_map_attach(struct dma_buf *dma_buf, struct device > > > *target_dev, > > > > > struct dma_buf_attachment *attach) > > > > > { > > > > > @@ -201,6 +216,14 @@ int drm_gem_map_attach(struct dma_buf > > > *dma_buf, struct device *target_dev, > > > > > } > > > > > EXPORT_SYMBOL(drm_gem_map_attach); > > > > > +/** > > > > > + * drm_gem_map_detach - dma_buf detach implementation for > GEM > > > > > + * @dma_buf: buffer to detach from > > > > > + * @attach: attachment to be detached > > > > > + * > > > > > + * Cleans up &dma_buf_attachment. This can be used as the > > > > > +&dma_buf_ops.detach > > > > > + * callback. > > > > > + */ > > > > > void drm_gem_map_detach(struct dma_buf *dma_buf, > > > > > struct dma_buf_attachment *attach) > > > > > { > > > > > @@ -255,6 +278,18 @@ void > > > drm_prime_remove_buf_handle_locked(struct drm_prime_file_private > > > *prime_fpr > > > > > } > > > > > } > > > > > +/** > > > > > + * drm_gem_map_dma_buf - map_dma_buf implementation for > GEM > > > > > + * @attach: attachment whose scatterlist is to be returned > > > > > + * @dir: direction of DMA transfer > > > > > + * > > > > > + * Calls &drm_driver.gem_prime_get_sg_table and then maps the > > > > > +scatterlist. This > > > > > + * can be used as the &dma_buf_ops.map_dma_buf callback. > > > > > + * > > > > > + * Returns sg_table containing the scatterlist to be returned; > > > > > +returns ERR_PTR > > > > > + * on error. May return -EINTR if it is interrupted by a signal. > > > > > + */ > > > > > + > > > > > struct sg_table *drm_gem_map_dma_buf(struct > dma_buf_attachment > > > *attach, > > > > > enum dma_data_direction dir) > > > > > { > > > > > @@ -294,6 +329,12 @@ struct sg_table > *drm_gem_map_dma_buf(struct > > > dma_buf_attachment *attach, > > > > > } > > > > > EXPORT_SYMBOL(drm_gem_map_dma_buf); > > > > > +/** > > > > > + * drm_gem_unmap_dma_buf - unmap_dma_buf implementation > for > > > GEM > > > > > + * > > > > > + * Not implemented. The unmap is done at > drm_gem_map_detach(). > > > > > +This can be > > > > > + * used as the &dma_buf_ops.unmap_dma_buf callback. > > > > > + */ > > > > > void drm_gem_unmap_dma_buf(struct dma_buf_attachment > *attach, > > > > > struct sg_table *sgt, > > > > > enum dma_data_direction dir) @@ -351,6 > +392,15 > > > @@ void > > > > > drm_gem_dmabuf_release(struct dma_buf *dma_buf) > > > > > } > > > > > EXPORT_SYMBOL(drm_gem_dmabuf_release); > > > > > +/** > > > > > + * drm_gem_dmabuf_vmap - dma_buf vmap implementation for > GEM > > > > > + * @dma_buf: buffer to be mapped > > > > > + * > > > > > + * Sets up a kernel virtual mapping. This can be used as the > > > > > +&dma_buf_ops.vmap > > > > > + * callback. > > > > > + * > > > > > + * Returns the kernel virtual address. > > > > > + */ > > > > > void *drm_gem_dmabuf_vmap(struct dma_buf *dma_buf) > > > > > { > > > > > struct drm_gem_object *obj = dma_buf->priv; @@ -360,6 > +410,14 > > > @@ > > > > > void *drm_gem_dmabuf_vmap(struct dma_buf *dma_buf) > > > > > } > > > > > EXPORT_SYMBOL(drm_gem_dmabuf_vmap); > > > > > +/** > > > > > + * drm_gem_dmabuf_vunmap - dma_buf vunmap implementation > for > > > GEM > > > > > + * @dma_buf: buffer to be unmapped > > > > > + * @vaddr: the virtual address of the buffer > > > > > + * > > > > > + * Releases a kernel virtual mapping. This can be used as the > > > > > + * &dma_buf_ops.vunmap callback. > > > > > + */ > > > > > void drm_gem_dmabuf_vunmap(struct dma_buf *dma_buf, void > > > *vaddr) > > > > > { > > > > > struct drm_gem_object *obj = dma_buf->priv; @@ -369,6 > +427,11 > > > @@ > > > > > void drm_gem_dmabuf_vunmap(struct dma_buf *dma_buf, void > *vaddr) > > > > > } > > > > > EXPORT_SYMBOL(drm_gem_dmabuf_vunmap); > > > > > +/** > > > > > + * drm_gem_dmabuf_kmap_atomic - map_atomic implementation > for > > > GEM > > > > > + * > > > > > + * Not implemented. This can be used as the > > > &dma_buf_ops.map_atomic callback. > > > > > + */ > > > > > void *drm_gem_dmabuf_kmap_atomic(struct dma_buf *dma_buf, > > > > > unsigned long page_num) > > > > > { > > > > > @@ -376,6 +439,11 @@ void > *drm_gem_dmabuf_kmap_atomic(struct > > > dma_buf *dma_buf, > > > > > } > > > > > EXPORT_SYMBOL(drm_gem_dmabuf_kmap_atomic); > > > > > +/** > > > > > + * drm_gem_dmabuf_kunmap_atomic - unmap_atomic > > > implementation for > > > > > +GEM > > > > > + * > > > > > + * Not implemented. This can be used as the > > > &dma_buf_ops.unmap_atomic callback. > > > > > + */ > > > > > void drm_gem_dmabuf_kunmap_atomic(struct dma_buf *dma_buf, > > > > > unsigned long page_num, void > *addr) > > > > > { > > > > > @@ -383,12 +451,22 @@ void > drm_gem_dmabuf_kunmap_atomic(struct > > > dma_buf *dma_buf, > > > > > } > > > > > EXPORT_SYMBOL(drm_gem_dmabuf_kunmap_atomic); > > > > > +/** > > > > > + * drm_gem_dmabuf_kmap - map implementation for GEM > > > > > + * > > > > > + * Not implemented. This can be used as the &dma_buf_ops.map > > > callback. > > > > > + */ > > > > > void *drm_gem_dmabuf_kmap(struct dma_buf *dma_buf, > unsigned > > > long page_num) > > > > > { > > > > > return NULL; > > > > > } > > > > > EXPORT_SYMBOL(drm_gem_dmabuf_kmap); > > > > > +/** > > > > > + * drm_gem_dmabuf_kunmap - unmap implementation for GEM > > > > > + * > > > > > + * Not implemented. This can be used as the &dma_buf_ops.unmap > > > callback. > > > > > + */ > > > > > void drm_gem_dmabuf_kunmap(struct dma_buf *dma_buf, > unsigned > > > long page_num, > > > > > void *addr) > > > > > { > > > > > @@ -396,6 +474,16 @@ void drm_gem_dmabuf_kunmap(struct > > > dma_buf *dma_buf, unsigned long page_num, > > > > > } > > > > > EXPORT_SYMBOL(drm_gem_dmabuf_kunmap); > > > > > +/** > > > > > + * drm_gem_dmabuf_mmap - dma_buf mmap implementation for > > > GEM > > > > > + * @dma_buf: buffer to be mapped > > > > > + * @vma: virtual address range > > > > > + * > > > > > + * Provides memory mapping for the buffer. This can be used as > > > > > + the > > > > > + * &dma_buf_ops.mmap callback. > > > > > + * > > > > > + * Returns 0 on success or a negative error code on failure. > > > > > + */ > > > > > int drm_gem_dmabuf_mmap(struct dma_buf *dma_buf, struct > > > vm_area_struct *vma) > > > > > { > > > > > struct drm_gem_object *obj = dma_buf->priv; > > > > > > > > _______________________________________________ > > > > dri-devel mailing list > > > > dri-devel@lists.freedesktop.org > > > > https://lists.freedesktop.org/mailman/listinfo/dri-devel > > > > > > -- > > > Daniel Vetter > > > Software Engineer, Intel Corporation http://blog.ffwll.ch > > -- > Daniel Vetter > Software Engineer, Intel Corporation > http://blog.ffwll.ch _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel ^ permalink raw reply [flat|nested] 8+ messages in thread
[parent not found: <BY1PR12MB0504572A89B32F384FA73645F5CF0-PicGAnIBOoZIlHzfMOeg3gdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>]
* Re: [PATCH v2 1/1] drm: add kernel doc for exported gem dmabuf_ops [not found] ` <BY1PR12MB0504572A89B32F384FA73645F5CF0-PicGAnIBOoZIlHzfMOeg3gdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org> @ 2018-02-20 16:23 ` Daniel Vetter [not found] ` <20180220162326.GY22199-dv86pmgwkMBes7Z6vYuT8azUEOm+Xw19@public.gmane.org> 0 siblings, 1 reply; 8+ messages in thread From: Daniel Vetter @ 2018-02-20 16:23 UTC (permalink / raw) To: Li, Samuel Cc: dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org, Koenig, Christian, Daniel Vetter On Tue, Feb 20, 2018 at 03:46:51PM +0000, Li, Samuel wrote: > > ./drivers/gpu/drm/drm_prime.c:342: warning: Function parameter or > > member 'attach' not described in 'drm_gem_unmap_dma_buf' > > ./drivers/gpu/drm/drm_prime.c:342: warning: Function parameter or > > member 'sgt' not described in 'drm_gem_unmap_dma_buf' > > ./drivers/gpu/drm/drm_prime.c:342: warning: Function parameter or > > member 'dir' not described in 'drm_gem_unmap_dma_buf' > ... > > Actually I tested. Those parameters are left out on purpose since they are empty functions so far. Can you pls add dummy explanations? I know it's somewhat silly, but when there's lots of warnings it's much harder to spot new ones. Docs are sometimes just plain boring rote work :-/ Thanks, Daniel > > Regards, > Samuel Li > > > -----Original Message----- > > From: Daniel Vetter [mailto:daniel.vetter@ffwll.ch] On Behalf Of Daniel > > Vetter > > Sent: Tuesday, February 20, 2018 10:13 AM > > To: Li, Samuel <Samuel.Li@amd.com> > > Cc: Daniel Vetter <daniel@ffwll.ch>; Koenig, Christian > > <Christian.Koenig@amd.com>; amd-gfx@lists.freedesktop.org; dri- > > devel@lists.freedesktop.org > > Subject: Re: [PATCH v2 1/1] drm: add kernel doc for exported gem > > dmabuf_ops > > > > On Tue, Jan 30, 2018 at 04:01:23PM +0000, Li, Samuel wrote: > > > > > > Alex helped push this into drm-tip, > > > https://cgit.freedesktop.org/drm/drm- > > tip/commit/drivers/gpu/drm?id=f7a > > > 71b0cf9e36c1b0edbfe89ce028a01164b864d > > > > > > Thanks, > > > Samuel Li > > > > > > > > > > -----Original Message----- > > > > From: Daniel Vetter [mailto:daniel.vetter@ffwll.ch] On Behalf Of > > > > Daniel Vetter > > > > Sent: Tuesday, January 30, 2018 4:33 AM > > > > To: Koenig, Christian <Christian.Koenig@amd.com> > > > > Cc: Li, Samuel <Samuel.Li@amd.com>; amd-gfx@lists.freedesktop.org; > > > > dri- devel@lists.freedesktop.org > > > > Subject: Re: [PATCH v2 1/1] drm: add kernel doc for exported gem > > > > dmabuf_ops > > > > > > > > On Fri, Jan 19, 2018 at 09:51:20AM +0100, Christian König wrote: > > > > > Am 18.01.2018 um 22:44 schrieb Samuel Li: > > > > > > Signed-off-by: Samuel Li <Samuel.Li@amd.com> > > > > > > Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> > > > > > > > > Thanks for updating the docs. > > > > > > > > > > Reviewed-by: Christian König <christian.koenig@amd.com> > > > > > > > > I'm assuming you'll als push this one. > > > > I just noticed that fairly obviously this wasn't tested when writing: > > > > ./drivers/gpu/drm/drm_prime.c:342: warning: Function parameter or > > member 'attach' not described in 'drm_gem_unmap_dma_buf' > > ./drivers/gpu/drm/drm_prime.c:342: warning: Function parameter or > > member 'sgt' not described in 'drm_gem_unmap_dma_buf' > > ./drivers/gpu/drm/drm_prime.c:342: warning: Function parameter or > > member 'dir' not described in 'drm_gem_unmap_dma_buf' > > ./drivers/gpu/drm/drm_prime.c:438: warning: Function parameter or > > member 'dma_buf' not described in 'drm_gem_dmabuf_kmap_atomic' > > ./drivers/gpu/drm/drm_prime.c:438: warning: Function parameter or > > member 'page_num' not described in 'drm_gem_dmabuf_kmap_atomic' > > ./drivers/gpu/drm/drm_prime.c:450: warning: Function parameter or > > member 'dma_buf' not described in 'drm_gem_dmabuf_kunmap_atomic' > > ./drivers/gpu/drm/drm_prime.c:450: warning: Function parameter or > > member 'page_num' not described in 'drm_gem_dmabuf_kunmap_atomic' > > ./drivers/gpu/drm/drm_prime.c:450: warning: Function parameter or > > member 'addr' not described in 'drm_gem_dmabuf_kunmap_atomic' > > ./drivers/gpu/drm/drm_prime.c:461: warning: Function parameter or > > member 'dma_buf' not described in 'drm_gem_dmabuf_kmap' > > ./drivers/gpu/drm/drm_prime.c:461: warning: Function parameter or > > member 'page_num' not described in 'drm_gem_dmabuf_kmap' > > ./drivers/gpu/drm/drm_prime.c:473: warning: Function parameter or > > member 'dma_buf' not described in 'drm_gem_dmabuf_kunmap' > > ./drivers/gpu/drm/drm_prime.c:473: warning: Function parameter or > > member 'page_num' not described in 'drm_gem_dmabuf_kunmap' > > ./drivers/gpu/drm/drm_prime.c:473: warning: Function parameter or > > member 'addr' not described in 'drm_gem_dmabuf_kunmap' > > > > Samuel, can you pls build docs using > > > > $ make htmldocs > > > > and fix up the fallout and submit a patch? > > > > Thanks, Daniel > > > > > > -Daniel > > > > > > > > > > > > > > > --- > > > > > > drivers/gpu/drm/drm_prime.c | 88 > > > > +++++++++++++++++++++++++++++++++++++++++++++ > > > > > > 1 file changed, 88 insertions(+) > > > > > > > > > > > > diff --git a/drivers/gpu/drm/drm_prime.c > > > > > > b/drivers/gpu/drm/drm_prime.c index ca09ce7..e82a976 100644 > > > > > > --- a/drivers/gpu/drm/drm_prime.c > > > > > > +++ b/drivers/gpu/drm/drm_prime.c > > > > > > @@ -73,6 +73,9 @@ > > > > > > * Drivers should detect this situation and return back the gem object > > > > > > * from the dma-buf private. Prime will do this automatically > > > > > > for drivers > > > > that > > > > > > * use the drm_gem_prime_{import,export} helpers. > > > > > > + * > > > > > > + * GEM struct &dma_buf_ops symbols are now exported. They can > > > > > > + be resued by > > > > > > + * drivers which implement GEM interface. > > > > > > */ > > > > > > struct drm_prime_member { > > > > > > @@ -180,6 +183,18 @@ static int > > > > > > drm_prime_lookup_buf_handle(struct > > > > drm_prime_file_private *prime_fpri > > > > > > return -ENOENT; > > > > > > } > > > > > > +/** > > > > > > + * drm_gem_map_attach - dma_buf attach implementation for GEM > > > > > > + * @dma_buf: buffer to attach device to > > > > > > + * @target_dev: not used > > > > > > + * @attach: buffer attachment data > > > > > > + * > > > > > > + * Allocates &drm_prime_attachment and calls > > > > > > +&drm_driver.gem_prime_pin for > > > > > > + * device specific attachment. This can be used as the > > > > > > +&dma_buf_ops.attach > > > > > > + * callback. > > > > > > + * > > > > > > + * Returns 0 on success, negative error code on failure. > > > > > > + */ > > > > > > int drm_gem_map_attach(struct dma_buf *dma_buf, struct device > > > > *target_dev, > > > > > > struct dma_buf_attachment *attach) > > > > > > { > > > > > > @@ -201,6 +216,14 @@ int drm_gem_map_attach(struct dma_buf > > > > *dma_buf, struct device *target_dev, > > > > > > } > > > > > > EXPORT_SYMBOL(drm_gem_map_attach); > > > > > > +/** > > > > > > + * drm_gem_map_detach - dma_buf detach implementation for > > GEM > > > > > > + * @dma_buf: buffer to detach from > > > > > > + * @attach: attachment to be detached > > > > > > + * > > > > > > + * Cleans up &dma_buf_attachment. This can be used as the > > > > > > +&dma_buf_ops.detach > > > > > > + * callback. > > > > > > + */ > > > > > > void drm_gem_map_detach(struct dma_buf *dma_buf, > > > > > > struct dma_buf_attachment *attach) > > > > > > { > > > > > > @@ -255,6 +278,18 @@ void > > > > drm_prime_remove_buf_handle_locked(struct drm_prime_file_private > > > > *prime_fpr > > > > > > } > > > > > > } > > > > > > +/** > > > > > > + * drm_gem_map_dma_buf - map_dma_buf implementation for > > GEM > > > > > > + * @attach: attachment whose scatterlist is to be returned > > > > > > + * @dir: direction of DMA transfer > > > > > > + * > > > > > > + * Calls &drm_driver.gem_prime_get_sg_table and then maps the > > > > > > +scatterlist. This > > > > > > + * can be used as the &dma_buf_ops.map_dma_buf callback. > > > > > > + * > > > > > > + * Returns sg_table containing the scatterlist to be returned; > > > > > > +returns ERR_PTR > > > > > > + * on error. May return -EINTR if it is interrupted by a signal. > > > > > > + */ > > > > > > + > > > > > > struct sg_table *drm_gem_map_dma_buf(struct > > dma_buf_attachment > > > > *attach, > > > > > > enum dma_data_direction dir) > > > > > > { > > > > > > @@ -294,6 +329,12 @@ struct sg_table > > *drm_gem_map_dma_buf(struct > > > > dma_buf_attachment *attach, > > > > > > } > > > > > > EXPORT_SYMBOL(drm_gem_map_dma_buf); > > > > > > +/** > > > > > > + * drm_gem_unmap_dma_buf - unmap_dma_buf implementation > > for > > > > GEM > > > > > > + * > > > > > > + * Not implemented. The unmap is done at > > drm_gem_map_detach(). > > > > > > +This can be > > > > > > + * used as the &dma_buf_ops.unmap_dma_buf callback. > > > > > > + */ > > > > > > void drm_gem_unmap_dma_buf(struct dma_buf_attachment > > *attach, > > > > > > struct sg_table *sgt, > > > > > > enum dma_data_direction dir) @@ -351,6 > > +392,15 > > > > @@ void > > > > > > drm_gem_dmabuf_release(struct dma_buf *dma_buf) > > > > > > } > > > > > > EXPORT_SYMBOL(drm_gem_dmabuf_release); > > > > > > +/** > > > > > > + * drm_gem_dmabuf_vmap - dma_buf vmap implementation for > > GEM > > > > > > + * @dma_buf: buffer to be mapped > > > > > > + * > > > > > > + * Sets up a kernel virtual mapping. This can be used as the > > > > > > +&dma_buf_ops.vmap > > > > > > + * callback. > > > > > > + * > > > > > > + * Returns the kernel virtual address. > > > > > > + */ > > > > > > void *drm_gem_dmabuf_vmap(struct dma_buf *dma_buf) > > > > > > { > > > > > > struct drm_gem_object *obj = dma_buf->priv; @@ -360,6 > > +410,14 > > > > @@ > > > > > > void *drm_gem_dmabuf_vmap(struct dma_buf *dma_buf) > > > > > > } > > > > > > EXPORT_SYMBOL(drm_gem_dmabuf_vmap); > > > > > > +/** > > > > > > + * drm_gem_dmabuf_vunmap - dma_buf vunmap implementation > > for > > > > GEM > > > > > > + * @dma_buf: buffer to be unmapped > > > > > > + * @vaddr: the virtual address of the buffer > > > > > > + * > > > > > > + * Releases a kernel virtual mapping. This can be used as the > > > > > > + * &dma_buf_ops.vunmap callback. > > > > > > + */ > > > > > > void drm_gem_dmabuf_vunmap(struct dma_buf *dma_buf, void > > > > *vaddr) > > > > > > { > > > > > > struct drm_gem_object *obj = dma_buf->priv; @@ -369,6 > > +427,11 > > > > @@ > > > > > > void drm_gem_dmabuf_vunmap(struct dma_buf *dma_buf, void > > *vaddr) > > > > > > } > > > > > > EXPORT_SYMBOL(drm_gem_dmabuf_vunmap); > > > > > > +/** > > > > > > + * drm_gem_dmabuf_kmap_atomic - map_atomic implementation > > for > > > > GEM > > > > > > + * > > > > > > + * Not implemented. This can be used as the > > > > &dma_buf_ops.map_atomic callback. > > > > > > + */ > > > > > > void *drm_gem_dmabuf_kmap_atomic(struct dma_buf *dma_buf, > > > > > > unsigned long page_num) > > > > > > { > > > > > > @@ -376,6 +439,11 @@ void > > *drm_gem_dmabuf_kmap_atomic(struct > > > > dma_buf *dma_buf, > > > > > > } > > > > > > EXPORT_SYMBOL(drm_gem_dmabuf_kmap_atomic); > > > > > > +/** > > > > > > + * drm_gem_dmabuf_kunmap_atomic - unmap_atomic > > > > implementation for > > > > > > +GEM > > > > > > + * > > > > > > + * Not implemented. This can be used as the > > > > &dma_buf_ops.unmap_atomic callback. > > > > > > + */ > > > > > > void drm_gem_dmabuf_kunmap_atomic(struct dma_buf *dma_buf, > > > > > > unsigned long page_num, void > > *addr) > > > > > > { > > > > > > @@ -383,12 +451,22 @@ void > > drm_gem_dmabuf_kunmap_atomic(struct > > > > dma_buf *dma_buf, > > > > > > } > > > > > > EXPORT_SYMBOL(drm_gem_dmabuf_kunmap_atomic); > > > > > > +/** > > > > > > + * drm_gem_dmabuf_kmap - map implementation for GEM > > > > > > + * > > > > > > + * Not implemented. This can be used as the &dma_buf_ops.map > > > > callback. > > > > > > + */ > > > > > > void *drm_gem_dmabuf_kmap(struct dma_buf *dma_buf, > > unsigned > > > > long page_num) > > > > > > { > > > > > > return NULL; > > > > > > } > > > > > > EXPORT_SYMBOL(drm_gem_dmabuf_kmap); > > > > > > +/** > > > > > > + * drm_gem_dmabuf_kunmap - unmap implementation for GEM > > > > > > + * > > > > > > + * Not implemented. This can be used as the &dma_buf_ops.unmap > > > > callback. > > > > > > + */ > > > > > > void drm_gem_dmabuf_kunmap(struct dma_buf *dma_buf, > > unsigned > > > > long page_num, > > > > > > void *addr) > > > > > > { > > > > > > @@ -396,6 +474,16 @@ void drm_gem_dmabuf_kunmap(struct > > > > dma_buf *dma_buf, unsigned long page_num, > > > > > > } > > > > > > EXPORT_SYMBOL(drm_gem_dmabuf_kunmap); > > > > > > +/** > > > > > > + * drm_gem_dmabuf_mmap - dma_buf mmap implementation for > > > > GEM > > > > > > + * @dma_buf: buffer to be mapped > > > > > > + * @vma: virtual address range > > > > > > + * > > > > > > + * Provides memory mapping for the buffer. This can be used as > > > > > > + the > > > > > > + * &dma_buf_ops.mmap callback. > > > > > > + * > > > > > > + * Returns 0 on success or a negative error code on failure. > > > > > > + */ > > > > > > int drm_gem_dmabuf_mmap(struct dma_buf *dma_buf, struct > > > > vm_area_struct *vma) > > > > > > { > > > > > > struct drm_gem_object *obj = dma_buf->priv; > > > > > > > > > > _______________________________________________ > > > > > dri-devel mailing list > > > > > dri-devel@lists.freedesktop.org > > > > > https://lists.freedesktop.org/mailman/listinfo/dri-devel > > > > > > > > -- > > > > Daniel Vetter > > > > Software Engineer, Intel Corporation http://blog.ffwll.ch > > > > -- > > Daniel Vetter > > Software Engineer, Intel Corporation > > http://blog.ffwll.ch -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx ^ permalink raw reply [flat|nested] 8+ messages in thread
[parent not found: <20180220162326.GY22199-dv86pmgwkMBes7Z6vYuT8azUEOm+Xw19@public.gmane.org>]
* RE: [PATCH v2 1/1] drm: add kernel doc for exported gem dmabuf_ops [not found] ` <20180220162326.GY22199-dv86pmgwkMBes7Z6vYuT8azUEOm+Xw19@public.gmane.org> @ 2018-02-20 16:25 ` Li, Samuel 0 siblings, 0 replies; 8+ messages in thread From: Li, Samuel @ 2018-02-20 16:25 UTC (permalink / raw) To: Daniel Vetter Cc: dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org, Koenig, Christian, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org OK, I can do that. Regards, Samuel Li > -----Original Message----- > From: Daniel Vetter [mailto:daniel.vetter@ffwll.ch] On Behalf Of Daniel > Vetter > Sent: Tuesday, February 20, 2018 11:23 AM > To: Li, Samuel <Samuel.Li@amd.com> > Cc: Daniel Vetter <daniel@ffwll.ch>; Koenig, Christian > <Christian.Koenig@amd.com>; amd-gfx@lists.freedesktop.org; dri- > devel@lists.freedesktop.org > Subject: Re: [PATCH v2 1/1] drm: add kernel doc for exported gem > dmabuf_ops > > On Tue, Feb 20, 2018 at 03:46:51PM +0000, Li, Samuel wrote: > > > ./drivers/gpu/drm/drm_prime.c:342: warning: Function parameter or > > > member 'attach' not described in 'drm_gem_unmap_dma_buf' > > > ./drivers/gpu/drm/drm_prime.c:342: warning: Function parameter or > > > member 'sgt' not described in 'drm_gem_unmap_dma_buf' > > > ./drivers/gpu/drm/drm_prime.c:342: warning: Function parameter or > > > member 'dir' not described in 'drm_gem_unmap_dma_buf' > > ... > > > > Actually I tested. Those parameters are left out on purpose since they are > empty functions so far. > > Can you pls add dummy explanations? I know it's somewhat silly, but when > there's lots of warnings it's much harder to spot new ones. Docs are > sometimes just plain boring rote work :-/ > > Thanks, Daniel > > > > > Regards, > > Samuel Li > > > > > -----Original Message----- > > > From: Daniel Vetter [mailto:daniel.vetter@ffwll.ch] On Behalf Of > > > Daniel Vetter > > > Sent: Tuesday, February 20, 2018 10:13 AM > > > To: Li, Samuel <Samuel.Li@amd.com> > > > Cc: Daniel Vetter <daniel@ffwll.ch>; Koenig, Christian > > > <Christian.Koenig@amd.com>; amd-gfx@lists.freedesktop.org; dri- > > > devel@lists.freedesktop.org > > > Subject: Re: [PATCH v2 1/1] drm: add kernel doc for exported gem > > > dmabuf_ops > > > > > > On Tue, Jan 30, 2018 at 04:01:23PM +0000, Li, Samuel wrote: > > > > > > > > Alex helped push this into drm-tip, > > > > https://cgit.freedesktop.org/drm/drm- > > > tip/commit/drivers/gpu/drm?id=f7a > > > > 71b0cf9e36c1b0edbfe89ce028a01164b864d > > > > > > > > Thanks, > > > > Samuel Li > > > > > > > > > > > > > -----Original Message----- > > > > > From: Daniel Vetter [mailto:daniel.vetter@ffwll.ch] On Behalf Of > > > > > Daniel Vetter > > > > > Sent: Tuesday, January 30, 2018 4:33 AM > > > > > To: Koenig, Christian <Christian.Koenig@amd.com> > > > > > Cc: Li, Samuel <Samuel.Li@amd.com>; > > > > > amd-gfx@lists.freedesktop.org; > > > > > dri- devel@lists.freedesktop.org > > > > > Subject: Re: [PATCH v2 1/1] drm: add kernel doc for exported gem > > > > > dmabuf_ops > > > > > > > > > > On Fri, Jan 19, 2018 at 09:51:20AM +0100, Christian König wrote: > > > > > > Am 18.01.2018 um 22:44 schrieb Samuel Li: > > > > > > > Signed-off-by: Samuel Li <Samuel.Li@amd.com> > > > > > > > Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> > > > > > > > > > > Thanks for updating the docs. > > > > > > > > > > > > Reviewed-by: Christian König <christian.koenig@amd.com> > > > > > > > > > > I'm assuming you'll als push this one. > > > > > > I just noticed that fairly obviously this wasn't tested when writing: > > > > > > ./drivers/gpu/drm/drm_prime.c:342: warning: Function parameter or > > > member 'attach' not described in 'drm_gem_unmap_dma_buf' > > > ./drivers/gpu/drm/drm_prime.c:342: warning: Function parameter or > > > member 'sgt' not described in 'drm_gem_unmap_dma_buf' > > > ./drivers/gpu/drm/drm_prime.c:342: warning: Function parameter or > > > member 'dir' not described in 'drm_gem_unmap_dma_buf' > > > ./drivers/gpu/drm/drm_prime.c:438: warning: Function parameter or > > > member 'dma_buf' not described in 'drm_gem_dmabuf_kmap_atomic' > > > ./drivers/gpu/drm/drm_prime.c:438: warning: Function parameter or > > > member 'page_num' not described in 'drm_gem_dmabuf_kmap_atomic' > > > ./drivers/gpu/drm/drm_prime.c:450: warning: Function parameter or > > > member 'dma_buf' not described in > 'drm_gem_dmabuf_kunmap_atomic' > > > ./drivers/gpu/drm/drm_prime.c:450: warning: Function parameter or > > > member 'page_num' not described in > 'drm_gem_dmabuf_kunmap_atomic' > > > ./drivers/gpu/drm/drm_prime.c:450: warning: Function parameter or > > > member 'addr' not described in 'drm_gem_dmabuf_kunmap_atomic' > > > ./drivers/gpu/drm/drm_prime.c:461: warning: Function parameter or > > > member 'dma_buf' not described in 'drm_gem_dmabuf_kmap' > > > ./drivers/gpu/drm/drm_prime.c:461: warning: Function parameter or > > > member 'page_num' not described in 'drm_gem_dmabuf_kmap' > > > ./drivers/gpu/drm/drm_prime.c:473: warning: Function parameter or > > > member 'dma_buf' not described in 'drm_gem_dmabuf_kunmap' > > > ./drivers/gpu/drm/drm_prime.c:473: warning: Function parameter or > > > member 'page_num' not described in 'drm_gem_dmabuf_kunmap' > > > ./drivers/gpu/drm/drm_prime.c:473: warning: Function parameter or > > > member 'addr' not described in 'drm_gem_dmabuf_kunmap' > > > > > > Samuel, can you pls build docs using > > > > > > $ make htmldocs > > > > > > and fix up the fallout and submit a patch? > > > > > > Thanks, Daniel > > > > > > > > -Daniel > > > > > > > > > > > > > > > > > > --- > > > > > > > drivers/gpu/drm/drm_prime.c | 88 > > > > > +++++++++++++++++++++++++++++++++++++++++++++ > > > > > > > 1 file changed, 88 insertions(+) > > > > > > > > > > > > > > diff --git a/drivers/gpu/drm/drm_prime.c > > > > > > > b/drivers/gpu/drm/drm_prime.c index ca09ce7..e82a976 100644 > > > > > > > --- a/drivers/gpu/drm/drm_prime.c > > > > > > > +++ b/drivers/gpu/drm/drm_prime.c > > > > > > > @@ -73,6 +73,9 @@ > > > > > > > * Drivers should detect this situation and return back the gem > object > > > > > > > * from the dma-buf private. Prime will do this > > > > > > > automatically for drivers > > > > > that > > > > > > > * use the drm_gem_prime_{import,export} helpers. > > > > > > > + * > > > > > > > + * GEM struct &dma_buf_ops symbols are now exported. They > > > > > > > + can be resued by > > > > > > > + * drivers which implement GEM interface. > > > > > > > */ > > > > > > > struct drm_prime_member { > > > > > > > @@ -180,6 +183,18 @@ static int > > > > > > > drm_prime_lookup_buf_handle(struct > > > > > drm_prime_file_private *prime_fpri > > > > > > > return -ENOENT; > > > > > > > } > > > > > > > +/** > > > > > > > + * drm_gem_map_attach - dma_buf attach implementation for > > > > > > > +GEM > > > > > > > + * @dma_buf: buffer to attach device to > > > > > > > + * @target_dev: not used > > > > > > > + * @attach: buffer attachment data > > > > > > > + * > > > > > > > + * Allocates &drm_prime_attachment and calls > > > > > > > +&drm_driver.gem_prime_pin for > > > > > > > + * device specific attachment. This can be used as the > > > > > > > +&dma_buf_ops.attach > > > > > > > + * callback. > > > > > > > + * > > > > > > > + * Returns 0 on success, negative error code on failure. > > > > > > > + */ > > > > > > > int drm_gem_map_attach(struct dma_buf *dma_buf, struct > > > > > > > device > > > > > *target_dev, > > > > > > > struct dma_buf_attachment *attach) > > > > > > > { > > > > > > > @@ -201,6 +216,14 @@ int drm_gem_map_attach(struct > dma_buf > > > > > *dma_buf, struct device *target_dev, > > > > > > > } > > > > > > > EXPORT_SYMBOL(drm_gem_map_attach); > > > > > > > +/** > > > > > > > + * drm_gem_map_detach - dma_buf detach implementation for > > > GEM > > > > > > > + * @dma_buf: buffer to detach from > > > > > > > + * @attach: attachment to be detached > > > > > > > + * > > > > > > > + * Cleans up &dma_buf_attachment. This can be used as the > > > > > > > +&dma_buf_ops.detach > > > > > > > + * callback. > > > > > > > + */ > > > > > > > void drm_gem_map_detach(struct dma_buf *dma_buf, > > > > > > > struct dma_buf_attachment *attach) > > > > > > > { > > > > > > > @@ -255,6 +278,18 @@ void > > > > > drm_prime_remove_buf_handle_locked(struct > drm_prime_file_private > > > > > *prime_fpr > > > > > > > } > > > > > > > } > > > > > > > +/** > > > > > > > + * drm_gem_map_dma_buf - map_dma_buf implementation > for > > > GEM > > > > > > > + * @attach: attachment whose scatterlist is to be returned > > > > > > > + * @dir: direction of DMA transfer > > > > > > > + * > > > > > > > + * Calls &drm_driver.gem_prime_get_sg_table and then maps > > > > > > > +the scatterlist. This > > > > > > > + * can be used as the &dma_buf_ops.map_dma_buf callback. > > > > > > > + * > > > > > > > + * Returns sg_table containing the scatterlist to be > > > > > > > +returned; returns ERR_PTR > > > > > > > + * on error. May return -EINTR if it is interrupted by a signal. > > > > > > > + */ > > > > > > > + > > > > > > > struct sg_table *drm_gem_map_dma_buf(struct > > > dma_buf_attachment > > > > > *attach, > > > > > > > enum dma_data_direction dir) > > > > > > > { > > > > > > > @@ -294,6 +329,12 @@ struct sg_table > > > *drm_gem_map_dma_buf(struct > > > > > dma_buf_attachment *attach, > > > > > > > } > > > > > > > EXPORT_SYMBOL(drm_gem_map_dma_buf); > > > > > > > +/** > > > > > > > + * drm_gem_unmap_dma_buf - unmap_dma_buf > implementation > > > for > > > > > GEM > > > > > > > + * > > > > > > > + * Not implemented. The unmap is done at > > > drm_gem_map_detach(). > > > > > > > +This can be > > > > > > > + * used as the &dma_buf_ops.unmap_dma_buf callback. > > > > > > > + */ > > > > > > > void drm_gem_unmap_dma_buf(struct dma_buf_attachment > > > *attach, > > > > > > > struct sg_table *sgt, > > > > > > > enum dma_data_direction dir) @@ -351,6 > > > +392,15 > > > > > @@ void > > > > > > > drm_gem_dmabuf_release(struct dma_buf *dma_buf) > > > > > > > } > > > > > > > EXPORT_SYMBOL(drm_gem_dmabuf_release); > > > > > > > +/** > > > > > > > + * drm_gem_dmabuf_vmap - dma_buf vmap implementation > for > > > GEM > > > > > > > + * @dma_buf: buffer to be mapped > > > > > > > + * > > > > > > > + * Sets up a kernel virtual mapping. This can be used as > > > > > > > +the &dma_buf_ops.vmap > > > > > > > + * callback. > > > > > > > + * > > > > > > > + * Returns the kernel virtual address. > > > > > > > + */ > > > > > > > void *drm_gem_dmabuf_vmap(struct dma_buf *dma_buf) > > > > > > > { > > > > > > > struct drm_gem_object *obj = dma_buf->priv; @@ -360,6 > > > +410,14 > > > > > @@ > > > > > > > void *drm_gem_dmabuf_vmap(struct dma_buf *dma_buf) > > > > > > > } > > > > > > > EXPORT_SYMBOL(drm_gem_dmabuf_vmap); > > > > > > > +/** > > > > > > > + * drm_gem_dmabuf_vunmap - dma_buf vunmap > implementation > > > for > > > > > GEM > > > > > > > + * @dma_buf: buffer to be unmapped > > > > > > > + * @vaddr: the virtual address of the buffer > > > > > > > + * > > > > > > > + * Releases a kernel virtual mapping. This can be used as > > > > > > > + the > > > > > > > + * &dma_buf_ops.vunmap callback. > > > > > > > + */ > > > > > > > void drm_gem_dmabuf_vunmap(struct dma_buf *dma_buf, > void > > > > > *vaddr) > > > > > > > { > > > > > > > struct drm_gem_object *obj = dma_buf->priv; @@ -369,6 > > > +427,11 > > > > > @@ > > > > > > > void drm_gem_dmabuf_vunmap(struct dma_buf *dma_buf, void > > > *vaddr) > > > > > > > } > > > > > > > EXPORT_SYMBOL(drm_gem_dmabuf_vunmap); > > > > > > > +/** > > > > > > > + * drm_gem_dmabuf_kmap_atomic - map_atomic > implementation > > > for > > > > > GEM > > > > > > > + * > > > > > > > + * Not implemented. This can be used as the > > > > > &dma_buf_ops.map_atomic callback. > > > > > > > + */ > > > > > > > void *drm_gem_dmabuf_kmap_atomic(struct dma_buf > *dma_buf, > > > > > > > unsigned long page_num) > > > > > > > { > > > > > > > @@ -376,6 +439,11 @@ void > > > *drm_gem_dmabuf_kmap_atomic(struct > > > > > dma_buf *dma_buf, > > > > > > > } > > > > > > > EXPORT_SYMBOL(drm_gem_dmabuf_kmap_atomic); > > > > > > > +/** > > > > > > > + * drm_gem_dmabuf_kunmap_atomic - unmap_atomic > > > > > implementation for > > > > > > > +GEM > > > > > > > + * > > > > > > > + * Not implemented. This can be used as the > > > > > &dma_buf_ops.unmap_atomic callback. > > > > > > > + */ > > > > > > > void drm_gem_dmabuf_kunmap_atomic(struct dma_buf > *dma_buf, > > > > > > > unsigned long page_num, void > > > *addr) > > > > > > > { > > > > > > > @@ -383,12 +451,22 @@ void > > > drm_gem_dmabuf_kunmap_atomic(struct > > > > > dma_buf *dma_buf, > > > > > > > } > > > > > > > EXPORT_SYMBOL(drm_gem_dmabuf_kunmap_atomic); > > > > > > > +/** > > > > > > > + * drm_gem_dmabuf_kmap - map implementation for GEM > > > > > > > + * > > > > > > > + * Not implemented. This can be used as the > > > > > > > +&dma_buf_ops.map > > > > > callback. > > > > > > > + */ > > > > > > > void *drm_gem_dmabuf_kmap(struct dma_buf *dma_buf, > > > unsigned > > > > > long page_num) > > > > > > > { > > > > > > > return NULL; > > > > > > > } > > > > > > > EXPORT_SYMBOL(drm_gem_dmabuf_kmap); > > > > > > > +/** > > > > > > > + * drm_gem_dmabuf_kunmap - unmap implementation for > GEM > > > > > > > + * > > > > > > > + * Not implemented. This can be used as the > > > > > > > +&dma_buf_ops.unmap > > > > > callback. > > > > > > > + */ > > > > > > > void drm_gem_dmabuf_kunmap(struct dma_buf *dma_buf, > > > unsigned > > > > > long page_num, > > > > > > > void *addr) > > > > > > > { > > > > > > > @@ -396,6 +474,16 @@ void drm_gem_dmabuf_kunmap(struct > > > > > dma_buf *dma_buf, unsigned long page_num, > > > > > > > } > > > > > > > EXPORT_SYMBOL(drm_gem_dmabuf_kunmap); > > > > > > > +/** > > > > > > > + * drm_gem_dmabuf_mmap - dma_buf mmap implementation > for > > > > > GEM > > > > > > > + * @dma_buf: buffer to be mapped > > > > > > > + * @vma: virtual address range > > > > > > > + * > > > > > > > + * Provides memory mapping for the buffer. This can be used > > > > > > > + as the > > > > > > > + * &dma_buf_ops.mmap callback. > > > > > > > + * > > > > > > > + * Returns 0 on success or a negative error code on failure. > > > > > > > + */ > > > > > > > int drm_gem_dmabuf_mmap(struct dma_buf *dma_buf, struct > > > > > vm_area_struct *vma) > > > > > > > { > > > > > > > struct drm_gem_object *obj = dma_buf->priv; > > > > > > > > > > > > _______________________________________________ > > > > > > dri-devel mailing list > > > > > > dri-devel@lists.freedesktop.org > > > > > > https://lists.freedesktop.org/mailman/listinfo/dri-devel > > > > > > > > > > -- > > > > > Daniel Vetter > > > > > Software Engineer, Intel Corporation http://blog.ffwll.ch > > > > > > -- > > > Daniel Vetter > > > Software Engineer, Intel Corporation http://blog.ffwll.ch > > -- > Daniel Vetter > Software Engineer, Intel Corporation > http://blog.ffwll.ch _______________________________________________ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2018-02-20 16:25 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-18 21:44 [PATCH v2 1/1] drm: add kernel doc for exported gem dmabuf_ops Samuel Li
[not found] ` <1516311860-24949-1-git-send-email-Samuel.Li-5C7GfCeVMHo@public.gmane.org>
2018-01-19 8:51 ` Christian König
2018-01-30 9:32 ` Daniel Vetter
2018-01-30 16:01 ` Li, Samuel
2018-02-20 15:12 ` Daniel Vetter
2018-02-20 15:46 ` Li, Samuel
[not found] ` <BY1PR12MB0504572A89B32F384FA73645F5CF0-PicGAnIBOoZIlHzfMOeg3gdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2018-02-20 16:23 ` Daniel Vetter
[not found] ` <20180220162326.GY22199-dv86pmgwkMBes7Z6vYuT8azUEOm+Xw19@public.gmane.org>
2018-02-20 16:25 ` Li, Samuel
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.