drm: export gem dmabuf_ops for drivers to reuse
Subsystems (2)
PATCH 2/3 drm: export gem dmabuf_ops for drivers to reuse
--- drivers/gpu/drm/drm_prime.c | 53 ++++++++++++++++++++++++++------------------- include/drm/drm_prime.h | 22 +++++++++++++++++++ 2 files changed, 53 insertions(+), 22 deletions(-)
drivers/gpu/drm/drm_prime.c +31 -22
@@ -180,9 +180,8 @@ static int drm_prime_lookup_buf_handle(struct drm_prime_file_private *prime_fprireturn -ENOENT ; } -static int drm_gem_map_attach (struct dma_buf *dma_buf, -struct device *target_dev, -struct dma_buf_attachment *attach) +int drm_gem_map_attach (struct dma_buf *dma_buf,struct device *target_dev, +struct dma_buf_attachment *attach) {struct drm_prime_attachment *prime_attach;struct drm_gem_object *obj = dma_buf->priv;
@@ -200,9 +199,10 @@ static int drm_gem_map_attach(struct dma_buf *dma_buf,return dev->driver->gem_prime_pin (obj); } +EXPORT_SYMBOL (drm_gem_map_attach); -static void drm_gem_map_detach (struct dma_buf *dma_buf, -struct dma_buf_attachment *attach) +void drm_gem_map_detach (struct dma_buf *dma_buf, +struct dma_buf_attachment *attach) {struct drm_prime_attachment *prime_attach = attach->priv;struct drm_gem_object *obj = dma_buf->priv;
@@ -227,6 +227,7 @@ static void drm_gem_map_detach(struct dma_buf *dma_buf,kfree (prime_attach); attach->priv =NULL ; } +EXPORT_SYMBOL (drm_gem_map_detach);void drm_prime_remove_buf_handle_locked (struct drm_prime_file_private *prime_fpriv,struct dma_buf *dma_buf)
@@ -253,8 +254,8 @@ void drm_prime_remove_buf_handle_locked(struct drm_prime_file_private *prime_fpr } } -static struct sg_table *drm_gem_map_dma_buf (struct dma_buf_attachment *attach, -enum dma_data_direction dir) +struct sg_table *drm_gem_map_dma_buf (struct dma_buf_attachment *attach, +enum dma_data_direction dir) {struct drm_prime_attachment *prime_attach = attach->priv;struct drm_gem_object *obj = attach->dmabuf->priv;
@@ -289,13 +290,15 @@ static struct sg_table *drm_gem_map_dma_buf(struct dma_buf_attachment *attach,return sgt; } +EXPORT_SYMBOL (drm_gem_map_dma_buf); -static void drm_gem_unmap_dma_buf (struct dma_buf_attachment *attach, -struct sg_table *sgt, -enum dma_data_direction dir) +void drm_gem_unmap_dma_buf (struct dma_buf_attachment *attach, +struct sg_table *sgt, +enum dma_data_direction dir) {/* nothing to be done here */ } +EXPORT_SYMBOL (drm_gem_unmap_dma_buf);/** * drm_gem_dmabuf_export - dma_buf export implementation for GEM
@@ -346,47 +349,52 @@ void drm_gem_dmabuf_release(struct dma_buf *dma_buf) }EXPORT_SYMBOL (drm_gem_dmabuf_release); -static void *drm_gem_dmabuf_vmap (struct dma_buf *dma_buf) +void *drm_gem_dmabuf_vmap (struct dma_buf *dma_buf) {struct drm_gem_object *obj = dma_buf->priv;struct drm_device *dev = obj->dev;return dev->driver->gem_prime_vmap (obj); } +EXPORT_SYMBOL (drm_gem_dmabuf_vmap); -static void drm_gem_dmabuf_vunmap (struct dma_buf *dma_buf,void *vaddr) +void drm_gem_dmabuf_vunmap (struct dma_buf *dma_buf,void *vaddr) {struct drm_gem_object *obj = dma_buf->priv;struct drm_device *dev = obj->dev; dev->driver->gem_prime_vunmap (obj, vaddr); } +EXPORT_SYMBOL (drm_gem_dmabuf_vunmap); -static void *drm_gem_dmabuf_kmap_atomic (struct dma_buf *dma_buf, -unsigned long page_num) +void *drm_gem_dmabuf_kmap_atomic (struct dma_buf *dma_buf, +unsigned long page_num) {return NULL ; } +EXPORT_SYMBOL (drm_gem_dmabuf_kmap_atomic); -static void drm_gem_dmabuf_kunmap_atomic (struct dma_buf *dma_buf, -unsigned long page_num,void *addr) +void drm_gem_dmabuf_kunmap_atomic (struct dma_buf *dma_buf, +unsigned long page_num,void *addr) { } -static void *drm_gem_dmabuf_kmap (struct dma_buf *dma_buf, -unsigned long page_num) +EXPORT_SYMBOL (drm_gem_dmabuf_kunmap_atomic); + +void *drm_gem_dmabuf_kmap (struct dma_buf *dma_buf,unsigned long page_num) {return NULL ; } +EXPORT_SYMBOL (drm_gem_dmabuf_kmap); -static void drm_gem_dmabuf_kunmap (struct dma_buf *dma_buf, -unsigned long page_num,void *addr) +void drm_gem_dmabuf_kunmap (struct dma_buf *dma_buf,unsigned long page_num, +void *addr) { } +EXPORT_SYMBOL (drm_gem_dmabuf_kunmap); -static int drm_gem_dmabuf_mmap (struct dma_buf *dma_buf, -struct vm_area_struct *vma) +int drm_gem_dmabuf_mmap (struct dma_buf *dma_buf,struct vm_area_struct *vma) {struct drm_gem_object *obj = dma_buf->priv;struct drm_device *dev = obj->dev;
@@ -396,6 +404,7 @@ static int drm_gem_dmabuf_mmap(struct dma_buf *dma_buf,return dev->driver->gem_prime_mmap (obj, vma); } +EXPORT_SYMBOL (drm_gem_dmabuf_mmap);static const struct dma_buf_ops drm_gem_prime_dmabuf_ops = { .attach = drm_gem_map_attach,
include/drm/drm_prime.h +22 -0
@@ -54,6 +54,9 @@ struct device;struct dma_buf_export_info ;struct dma_buf ; +struct dma_buf_attachment ; + +enum dma_data_direction ;struct drm_device ;struct drm_gem_object ;
@@ -79,6 +82,25 @@ int drm_gem_prime_fd_to_handle(struct drm_device *dev,struct dma_buf *drm_gem_dmabuf_export (struct drm_device *dev,struct dma_buf_export_info *exp_info);void drm_gem_dmabuf_release (struct dma_buf *dma_buf); +int drm_gem_map_attach (struct dma_buf *dma_buf,struct device *target_dev, +struct dma_buf_attachment *attach); +void drm_gem_map_detach (struct dma_buf *dma_buf, +struct dma_buf_attachment *attach); +struct sg_table *drm_gem_map_dma_buf (struct dma_buf_attachment *attach, +enum dma_data_direction dir); +void drm_gem_unmap_dma_buf (struct dma_buf_attachment *attach, +struct sg_table *sgt, +enum dma_data_direction dir); +void *drm_gem_dmabuf_vmap (struct dma_buf *dma_buf); +void drm_gem_dmabuf_vunmap (struct dma_buf *dma_buf,void *vaddr); +void *drm_gem_dmabuf_kmap_atomic (struct dma_buf *dma_buf, +unsigned long page_num); +void drm_gem_dmabuf_kunmap_atomic (struct dma_buf *dma_buf, +unsigned long page_num,void *addr); +void *drm_gem_dmabuf_kmap (struct dma_buf *dma_buf,unsigned long page_num); +void drm_gem_dmabuf_kunmap (struct dma_buf *dma_buf,unsigned long page_num, +void *addr); +int drm_gem_dmabuf_mmap (struct dma_buf *dma_buf,struct vm_area_struct *vma);int drm_prime_sg_to_page_addr_arrays (struct sg_table *sgt,struct page **pages,dma_addr_t *addrs,int max_pages);
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Am 04.01.2018 um 22:12 schrieb Samuel Li:
Quoted 2 lines
Change-Id I03c22a890d2305f3243d88019d1a28bddd4ddda7Signed-off-by Samuel Li <[email protected]>
Quoted 175 lines
--- drivers/gpu/drm/drm_prime.c | 53 ++++++++++++++++++++++++++------------------- include/drm/drm_prime.h | 22 +++++++++++++++++++ 2 files changed, 53 insertions(+), 22 deletions(-)drivers/gpu/drm/drm_prime.c +31
-22@@ -180,9 +180,8 @@ static int drm_prime_lookup_buf_handle(struct drm_prime_file_private *prime_fprireturn -ENOENT ; } -static int drm_gem_map_attach (struct dma_buf *dma_buf, -struct device *target_dev, -struct dma_buf_attachment *attach) +int drm_gem_map_attach (struct dma_buf *dma_buf,struct device *target_dev, +struct dma_buf_attachment *attach) {struct drm_prime_attachment *prime_attach;struct drm_gem_object *obj = dma_buf->priv;@@ -200,9 +199,10 @@ static int drm_gem_map_attach(struct dma_buf *dma_buf,return dev->driver->gem_prime_pin (obj); } +EXPORT_SYMBOL (drm_gem_map_attach); -static void drm_gem_map_detach (struct dma_buf *dma_buf, -struct dma_buf_attachment *attach) +void drm_gem_map_detach (struct dma_buf *dma_buf, +struct dma_buf_attachment *attach) {struct drm_prime_attachment *prime_attach = attach->priv;struct drm_gem_object *obj = dma_buf->priv;@@ -227,6 +227,7 @@ static void drm_gem_map_detach(struct dma_buf *dma_buf,kfree (prime_attach); attach->priv =NULL ; } +EXPORT_SYMBOL (drm_gem_map_detach);void drm_prime_remove_buf_handle_locked (struct drm_prime_file_private *prime_fpriv,struct dma_buf *dma_buf)@@ -253,8 +254,8 @@ void drm_prime_remove_buf_handle_locked(struct drm_prime_file_private *prime_fpr } } -static struct sg_table *drm_gem_map_dma_buf (struct dma_buf_attachment *attach, -enum dma_data_direction dir) +struct sg_table *drm_gem_map_dma_buf (struct dma_buf_attachment *attach, +enum dma_data_direction dir) {struct drm_prime_attachment *prime_attach = attach->priv;struct drm_gem_object *obj = attach->dmabuf->priv;@@ -289,13 +290,15 @@ static struct sg_table *drm_gem_map_dma_buf(struct dma_buf_attachment *attach,return sgt; } +EXPORT_SYMBOL (drm_gem_map_dma_buf); -static void drm_gem_unmap_dma_buf (struct dma_buf_attachment *attach, -struct sg_table *sgt, -enum dma_data_direction dir) +void drm_gem_unmap_dma_buf (struct dma_buf_attachment *attach, +struct sg_table *sgt, +enum dma_data_direction dir) {/* nothing to be done here */ } +EXPORT_SYMBOL (drm_gem_unmap_dma_buf);/** * drm_gem_dmabuf_export - dma_buf export implementation for GEM @@ -346,47 +349,52 @@ void drm_gem_dmabuf_release(struct dma_buf *dma_buf) }EXPORT_SYMBOL (drm_gem_dmabuf_release); -static void *drm_gem_dmabuf_vmap (struct dma_buf *dma_buf) +void *drm_gem_dmabuf_vmap (struct dma_buf *dma_buf) {struct drm_gem_object *obj = dma_buf->priv;struct drm_device *dev = obj->dev;return dev->driver->gem_prime_vmap (obj); } +EXPORT_SYMBOL (drm_gem_dmabuf_vmap); -static void drm_gem_dmabuf_vunmap (struct dma_buf *dma_buf,void *vaddr) +void drm_gem_dmabuf_vunmap (struct dma_buf *dma_buf,void *vaddr) {struct drm_gem_object *obj = dma_buf->priv;struct drm_device *dev = obj->dev; dev->driver->gem_prime_vunmap (obj, vaddr); } +EXPORT_SYMBOL (drm_gem_dmabuf_vunmap); -static void *drm_gem_dmabuf_kmap_atomic (struct dma_buf *dma_buf, -unsigned long page_num) +void *drm_gem_dmabuf_kmap_atomic (struct dma_buf *dma_buf, +unsigned long page_num) {return NULL ; } +EXPORT_SYMBOL (drm_gem_dmabuf_kmap_atomic); -static void drm_gem_dmabuf_kunmap_atomic (struct dma_buf *dma_buf, -unsigned long page_num,void *addr) +void drm_gem_dmabuf_kunmap_atomic (struct dma_buf *dma_buf, +unsigned long page_num,void *addr) { } -static void *drm_gem_dmabuf_kmap (struct dma_buf *dma_buf, -unsigned long page_num) +EXPORT_SYMBOL (drm_gem_dmabuf_kunmap_atomic); + +void *drm_gem_dmabuf_kmap (struct dma_buf *dma_buf,unsigned long page_num) {return NULL ; } +EXPORT_SYMBOL (drm_gem_dmabuf_kmap); -static void drm_gem_dmabuf_kunmap (struct dma_buf *dma_buf, -unsigned long page_num,void *addr) +void drm_gem_dmabuf_kunmap (struct dma_buf *dma_buf,unsigned long page_num, +void *addr) { } +EXPORT_SYMBOL (drm_gem_dmabuf_kunmap); -static int drm_gem_dmabuf_mmap (struct dma_buf *dma_buf, -struct vm_area_struct *vma) +int drm_gem_dmabuf_mmap (struct dma_buf *dma_buf,struct vm_area_struct *vma) {struct drm_gem_object *obj = dma_buf->priv;struct drm_device *dev = obj->dev;@@ -396,6 +404,7 @@ static int drm_gem_dmabuf_mmap(struct dma_buf *dma_buf,return dev->driver->gem_prime_mmap (obj, vma); } +EXPORT_SYMBOL (drm_gem_dmabuf_mmap);static const struct dma_buf_ops drm_gem_prime_dmabuf_ops = { .attach = drm_gem_map_attach,include/drm/drm_prime.h +15
-0@@ -54,6 +54,9 @@ struct device;struct dma_buf_export_info ;struct dma_buf ; +struct dma_buf_attachment ; + +enum dma_data_direction ;struct drm_device ;struct drm_gem_object ;@@ -79,6 +82,25 @@ int drm_gem_prime_fd_to_handle(struct drm_device *dev,struct dma_buf *drm_gem_dmabuf_export (struct drm_device *dev,struct dma_buf_export_info *exp_info);void drm_gem_dmabuf_release (struct dma_buf *dma_buf); +int drm_gem_map_attach (struct dma_buf *dma_buf,struct device *target_dev, +struct dma_buf_attachment *attach); +void drm_gem_map_detach (struct dma_buf *dma_buf, +struct dma_buf_attachment *attach); +struct sg_table *drm_gem_map_dma_buf (struct dma_buf_attachment *attach, +enum dma_data_direction dir); +void drm_gem_unmap_dma_buf (struct dma_buf_attachment *attach, +struct sg_table *sgt, +enum dma_data_direction dir); +void *drm_gem_dmabuf_vmap (struct dma_buf *dma_buf); +void drm_gem_dmabuf_vunmap (struct dma_buf *dma_buf,void *vaddr); +void *drm_gem_dmabuf_kmap_atomic(struct dma_buf *dma_buf,
include/drm/drm_prime.h int drm_gem_prime_fd_to_handle(struct drm_device *dev, · line 106
Quoted 10 lines
include/drm/drm_prime.h +7
-0+ unsigned long page_num); +void drm_gem_dmabuf_kunmap_atomic (struct dma_buf *dma_buf, +unsigned long page_num,void *addr); +void *drm_gem_dmabuf_kmap (struct dma_buf *dma_buf,unsigned long page_num); +void drm_gem_dmabuf_kunmap (struct dma_buf *dma_buf,unsigned long page_num, +void *addr); +int drm_gem_dmabuf_mmap (struct dma_buf *dma_buf,struct vm_area_struct *vma);int drm_prime_sg_to_page_addr_arrays (struct sg_table *sgt,struct page **pages,dma_addr_t *addrs,int max_pages);
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 5 lines · Christian König
Am 04.01.2018 um 22:12 schrieb Samuel Li:
Quoted 2 lines
Change-Id I03c22a890d2305f3243d88019d1a28bddd4ddda7Signed-off-by Samuel Li <[email protected]>Reviewed-by Christian König <[email protected]>
Want to push to drm-misc or some other plan with this? -Daniel
Quoted 168 lines
Quoted 153 lines
--- drivers/gpu/drm/drm_prime.c | 53 ++++++++++++++++++++++++++------------------- include/drm/drm_prime.h | 22 +++++++++++++++++++ 2 files changed, 53 insertions(+), 22 deletions(-)drivers/gpu/drm/drm_prime.c +31
-22@@ -180,9 +180,8 @@ static int drm_prime_lookup_buf_handle(struct drm_prime_file_private *prime_fprireturn -ENOENT ; } -static int drm_gem_map_attach (struct dma_buf *dma_buf, -struct device *target_dev, -struct dma_buf_attachment *attach) +int drm_gem_map_attach (struct dma_buf *dma_buf,struct device *target_dev, +struct dma_buf_attachment *attach) {struct drm_prime_attachment *prime_attach;struct drm_gem_object *obj = dma_buf->priv;@@ -200,9 +199,10 @@ static int drm_gem_map_attach(struct dma_buf *dma_buf,return dev->driver->gem_prime_pin (obj); } +EXPORT_SYMBOL (drm_gem_map_attach); -static void drm_gem_map_detach (struct dma_buf *dma_buf, -struct dma_buf_attachment *attach) +void drm_gem_map_detach (struct dma_buf *dma_buf, +struct dma_buf_attachment *attach) {struct drm_prime_attachment *prime_attach = attach->priv;struct drm_gem_object *obj = dma_buf->priv;@@ -227,6 +227,7 @@ static void drm_gem_map_detach(struct dma_buf *dma_buf,kfree (prime_attach); attach->priv =NULL ; } +EXPORT_SYMBOL (drm_gem_map_detach);void drm_prime_remove_buf_handle_locked (struct drm_prime_file_private *prime_fpriv,struct dma_buf *dma_buf)@@ -253,8 +254,8 @@ void drm_prime_remove_buf_handle_locked(struct drm_prime_file_private *prime_fpr } } -static struct sg_table *drm_gem_map_dma_buf (struct dma_buf_attachment *attach, -enum dma_data_direction dir) +struct sg_table *drm_gem_map_dma_buf (struct dma_buf_attachment *attach, +enum dma_data_direction dir) {struct drm_prime_attachment *prime_attach = attach->priv;struct drm_gem_object *obj = attach->dmabuf->priv;@@ -289,13 +290,15 @@ static struct sg_table *drm_gem_map_dma_buf(struct dma_buf_attachment *attach,return sgt; } +EXPORT_SYMBOL (drm_gem_map_dma_buf); -static void drm_gem_unmap_dma_buf (struct dma_buf_attachment *attach, -struct sg_table *sgt, -enum dma_data_direction dir) +void drm_gem_unmap_dma_buf (struct dma_buf_attachment *attach, +struct sg_table *sgt, +enum dma_data_direction dir) {/* nothing to be done here */ } +EXPORT_SYMBOL (drm_gem_unmap_dma_buf);/** * drm_gem_dmabuf_export - dma_buf export implementation for GEM @@ -346,47 +349,52 @@ void drm_gem_dmabuf_release(struct dma_buf *dma_buf) }EXPORT_SYMBOL (drm_gem_dmabuf_release); -static void *drm_gem_dmabuf_vmap (struct dma_buf *dma_buf) +void *drm_gem_dmabuf_vmap (struct dma_buf *dma_buf) {struct drm_gem_object *obj = dma_buf->priv;struct drm_device *dev = obj->dev;return dev->driver->gem_prime_vmap (obj); } +EXPORT_SYMBOL (drm_gem_dmabuf_vmap); -static void drm_gem_dmabuf_vunmap (struct dma_buf *dma_buf,void *vaddr) +void drm_gem_dmabuf_vunmap (struct dma_buf *dma_buf,void *vaddr) {struct drm_gem_object *obj = dma_buf->priv;struct drm_device *dev = obj->dev; dev->driver->gem_prime_vunmap (obj, vaddr); } +EXPORT_SYMBOL (drm_gem_dmabuf_vunmap); -static void *drm_gem_dmabuf_kmap_atomic (struct dma_buf *dma_buf, -unsigned long page_num) +void *drm_gem_dmabuf_kmap_atomic (struct dma_buf *dma_buf, +unsigned long page_num) {return NULL ; } +EXPORT_SYMBOL (drm_gem_dmabuf_kmap_atomic); -static void drm_gem_dmabuf_kunmap_atomic (struct dma_buf *dma_buf, -unsigned long page_num,void *addr) +void drm_gem_dmabuf_kunmap_atomic (struct dma_buf *dma_buf, +unsigned long page_num,void *addr) { } -static void *drm_gem_dmabuf_kmap (struct dma_buf *dma_buf, -unsigned long page_num) +EXPORT_SYMBOL (drm_gem_dmabuf_kunmap_atomic); + +void *drm_gem_dmabuf_kmap (struct dma_buf *dma_buf,unsigned long page_num) {return NULL ; } +EXPORT_SYMBOL (drm_gem_dmabuf_kmap); -static void drm_gem_dmabuf_kunmap (struct dma_buf *dma_buf, -unsigned long page_num,void *addr) +void drm_gem_dmabuf_kunmap (struct dma_buf *dma_buf,unsigned long page_num, +void *addr) { } +EXPORT_SYMBOL (drm_gem_dmabuf_kunmap); -static int drm_gem_dmabuf_mmap (struct dma_buf *dma_buf, -struct vm_area_struct *vma) +int drm_gem_dmabuf_mmap (struct dma_buf *dma_buf,struct vm_area_struct *vma) {struct drm_gem_object *obj = dma_buf->priv;struct drm_device *dev = obj->dev;@@ -396,6 +404,7 @@ static int drm_gem_dmabuf_mmap(struct dma_buf *dma_buf,return dev->driver->gem_prime_mmap (obj, vma); } +EXPORT_SYMBOL (drm_gem_dmabuf_mmap);static const struct dma_buf_ops drm_gem_prime_dmabuf_ops = { .attach = drm_gem_map_attach,include/drm/drm_prime.h +14
-0@@ -54,6 +54,9 @@ struct device;struct dma_buf_export_info ;struct dma_buf ; +struct dma_buf_attachment ; + +enum dma_data_direction ;struct drm_device ;struct drm_gem_object ;@@ -79,6 +82,25 @@ int drm_gem_prime_fd_to_handle(struct drm_device *dev,struct dma_buf *drm_gem_dmabuf_export (struct drm_device *dev,struct dma_buf_export_info *exp_info);void drm_gem_dmabuf_release (struct dma_buf *dma_buf); +int drm_gem_map_attach (struct dma_buf *dma_buf,struct device *target_dev, +struct dma_buf_attachment *attach); +void drm_gem_map_detach (struct dma_buf *dma_buf, +struct dma_buf_attachment *attach); +struct sg_table *drm_gem_map_dma_buf (struct dma_buf_attachment *attach, +enum dma_data_direction dir); +void drm_gem_unmap_dma_buf (struct dma_buf_attachment *attach, +struct sg_table *sgt, +enum dma_data_direction dir); +void *drm_gem_dmabuf_vmap (struct dma_buf *dma_buf); +void drm_gem_dmabuf_vunmap (struct dma_buf *dma_buf,void *vaddr);include/drm/drm_prime.h int drm_gem_prime_fd_to_handle(struct drm_device *dev, · line 105
Quoted 10 lines
include/drm/drm_prime.h +8
-0+void *drm_gem_dmabuf_kmap_atomic (struct dma_buf *dma_buf, +unsigned long page_num); +void drm_gem_dmabuf_kunmap_atomic (struct dma_buf *dma_buf, +unsigned long page_num,void *addr); +void *drm_gem_dmabuf_kmap (struct dma_buf *dma_buf,unsigned long page_num); +void drm_gem_dmabuf_kunmap (struct dma_buf *dma_buf,unsigned long page_num, +void *addr); +int drm_gem_dmabuf_mmap (struct dma_buf *dma_buf,struct vm_area_struct *vma);int drm_prime_sg_to_page_addr_arrays (struct sg_table *sgt,struct page **pages,dma_addr_t *addrs,int max_pages);_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Yes, please hush this for me.
Regards,
Samuel Li
Quoted 216 lines
-----Original Message-----
From: Daniel Vetter [mailto:[email protected]] On Behalf Of Daniel Vetter
Sent: Tuesday, January 09, 2018 4:22 AM
To: Koenig, Christian <[email protected]>
Cc: Li, Samuel <[email protected]>; [email protected]; amd- [email protected]
Subject: Re: [PATCH 2/3] drm: export gemdmabuf_opsfor drivers to reuseQuoted 5 lines · Christian König
Am 04.01.2018 um 22:12 schrieb Samuel Li:
Quoted 2 lines
Change-Id I03c22a890d2305f3243d88019d1a28bddd4ddda7Signed-off-by Samuel Li <[email protected]>Reviewed-by Christian König <[email protected]>Want to push to drm-misc or some other plan with this? -Daniel
Quoted 3 lines
Quoted 3 lines
--- drivers/gpu/drm/drm_prime.c | 53 ++++++++++++++++++++++++++-------------------
Quoted 8 lines
drivers/gpu/drm/drm_prime.c static int drm_prime_lookup_buf_handle(struct
Quoted 8 lines
include/drm/drm_prime.h | 22 +++++++++++++++++++ 2 files changed, 53 insertions(+), 22 deletions(-)(quoted diff) +0
-0
b/drivers/gpu/drm/drm_prime.cindex 8de93a2..68a69e9 100644drivers/gpu/drm/drm_prime.c +0
-0@@ -180,9 +180,8 @@ static int drm_prime_lookup_buf_handle(struct
drm_prime_file_private*prime_fpriQuoted 6 lines
drivers/gpu/drm/drm_prime.c static int drm_prime_lookup_buf_handle(struct drm_prime_file_private *prime_fpri
Quoted 6 lines
drivers/gpu/drm/drm_prime.c +1
-3return -ENOENT ; } -static int drm_gem_map_attach (struct dma_buf *dma_buf, -struct device *target_dev, -struct dma_buf_attachment *attach) +int drm_gem_map_attach(struct dma_buf *dma_buf, struct device
*target_dev,Quoted 4 lines
drivers/gpu/drm/drm_prime.c static int drm_prime_lookup_buf_handle(struct drm_prime_file_private *prime_fpri
Quoted 4 lines
drivers/gpu/drm/drm_prime.c +1
-0+ struct dma_buf_attachment *attach) {struct drm_prime_attachment *prime_attach; struct drm_gem_object *obj = dma_buf->priv; @@ -200,9 +199,10@@
Quoted 11 lines
drivers/gpu/drm/drm_prime.c static int drm_gem_map_attach(struct dma_buf *dma_buf,
Quoted 11 lines
drivers/gpu/drm/drm_prime.c +0
-0static int drm_gem_map_attach(struct dma_buf *dma_buf,return dev->driver->gem_prime_pin(obj); }drivers/gpu/drm/drm_prime.c +3
-2+EXPORT_SYMBOL (drm_gem_map_attach); -static void drm_gem_map_detach (struct dma_buf *dma_buf, -struct dma_buf_attachment *attach) +void drm_gem_map_detach (struct dma_buf *dma_buf, +struct dma_buf_attachment *attach) {struct drm_prime_attachment *prime_attach = attach->priv; struct drm_gem_object *obj = dma_buf->priv; @@ -227,6 +227,7@@
Quoted 6 lines
Quoted 6 lines
static void drm_gem_map_detach(struct
dma_buf*dma_buf,
kfree(prime_attach);
attach->priv= NULL;
}
+EXPORT_SYMBOL(drm_gem_map_detach);
void drm_prime_remove_buf_handle_locked(struct
drm_prime_file_private*prime_fpriv,Quoted 2 lines
drivers/gpu/drm/drm_prime.c void
Quoted 2 lines
struct
dma_buf*dma_buf)drivers/gpu/drm/drm_prime.c +0
-0@@ -253,8 +254,8 @@ voiddrm_prime_remove_buf_handle_locked(struct
drm_prime_file_private*prime_fprQuoted 3 lines
drivers/gpu/drm/drm_prime.c void · line 255
Quoted 3 lines
drivers/gpu/drm/drm_prime.c +0
-1} } -static struct sg_table *drm_gem_map_dma_buf(struct
dma_buf_attachment*attach,Quoted 2 lines
drivers/gpu/drm/drm_prime.c void · line 256
Quoted 2 lines
drivers/gpu/drm/drm_prime.c +1
-1- enum dma_data_direction dir) +struct sg_table *drm_gem_map_dma_buf(struct dma_buf_attachment*attach,
Quoted 5 lines
drivers/gpu/drm/drm_prime.c void drm_prime_remove_buf_handle_locked(struct drm_prime_file_private *prime_fpr
Quoted 5 lines
drivers/gpu/drm/drm_prime.c +2
-0+ enum dma_data_direction dir) {struct drm_prime_attachment *prime_attach = attach->priv; struct drm_gem_object *obj = attach->dmabuf->priv; @@ -289,13 +290,15 @@ static struct sg_table *drm_gem_map_dma_buf(struct
dma_buf_attachment*attach,Quoted 4 lines
drivers/gpu/drm/drm_prime.c static struct sg_table *drm_gem_map_dma_buf(struct dma_buf_attachment *attach,
Quoted 4 lines
drivers/gpu/drm/drm_prime.c +1
-1return sgt; } +EXPORT_SYMBOL (drm_gem_map_dma_buf); -static void drm_gem_unmap_dma_buf(struct dma_buf_attachment*attach,
Quoted 11 lines
drivers/gpu/drm/drm_prime.c static struct sg_table *drm_gem_map_dma_buf(struct dma_buf_attachment *attach,
Quoted 11 lines
drivers/gpu/drm/drm_prime.c +4
-2- struct sg_table *sgt, - enum dma_data_direction dir) +void drm_gem_unmap_dma_buf (struct dma_buf_attachment *attach, +struct sg_table *sgt, +enum dma_data_direction dir) {/* nothing to be done here */ } +EXPORT_SYMBOL (drm_gem_unmap_dma_buf);/** * drm_gem_dmabuf_export - dma_buf export implementation for GEM
Quoted 1 line
drivers/gpu/drm/drm_prime.c void drm_gem_dmabuf_release(struct
Quoted 1 line
drivers/gpu/drm/drm_prime.c +0
-0@@ -346,47 +349,52 @@ void drm_gem_dmabuf_release(struct
dma_buf*dma_buf)Quoted 5 lines
Quoted 5 lines
drivers/gpu/drm/drm_prime.c +1
-1}EXPORT_SYMBOL (drm_gem_dmabuf_release); -static void *drm_gem_dmabuf_vmap (struct dma_buf *dma_buf) +void *drm_gem_dmabuf_vmap (struct dma_buf *dma_buf) {Quoted 8 lines
drivers/gpu/drm/drm_prime.c void drm_gem_dmabuf_release(struct dma_buf *dma_buf)
Quoted 8 lines
drivers/gpu/drm/drm_prime.c +2
-1struct drm_gem_object *obj = dma_buf->priv;struct drm_device *dev = obj->dev;return dev->driver->gem_prime_vmap (obj); } +EXPORT_SYMBOL (drm_gem_dmabuf_vmap); -static void drm_gem_dmabuf_vunmap (struct dma_buf *dma_buf,void *vaddr) +void drm_gem_dmabuf_vunmap(struct dma_buf *dma_buf, void*vaddr)
Quoted 7 lines
drivers/gpu/drm/drm_prime.c void drm_gem_dmabuf_release(struct dma_buf *dma_buf)
Quoted 7 lines
drivers/gpu/drm/drm_prime.c +1
-1{struct drm_gem_object *obj = dma_buf->priv;struct drm_device *dev = obj->dev; dev->driver->gem_prime_vunmap (obj, vaddr); } +EXPORT_SYMBOL (drm_gem_dmabuf_vunmap); -static void *drm_gem_dmabuf_kmap_atomic(struct dma_buf
*dma_buf,Quoted 8 lines
drivers/gpu/drm/drm_prime.c void drm_gem_dmabuf_release(struct dma_buf *dma_buf)
Quoted 8 lines
drivers/gpu/drm/drm_prime.c +3
-2- unsigned long page_num) +void *drm_gem_dmabuf_kmap_atomic (struct dma_buf *dma_buf, +unsigned long page_num) {return NULL ; } +EXPORT_SYMBOL (drm_gem_dmabuf_kmap_atomic); -static void drm_gem_dmabuf_kunmap_atomic(struct dma_buf
*dma_buf,Quoted 10 lines
drivers/gpu/drm/drm_prime.c void drm_gem_dmabuf_release(struct dma_buf *dma_buf)
Quoted 10 lines
drivers/gpu/drm/drm_prime.c +5
-3- unsigned long page_num, void *addr) +void drm_gem_dmabuf_kunmap_atomic (struct dma_buf *dma_buf, +unsigned long page_num,void *addr) { } -static void *drm_gem_dmabuf_kmap (struct dma_buf *dma_buf, -unsigned long page_num) +EXPORT_SYMBOL (drm_gem_dmabuf_kunmap_atomic); + +void *drm_gem_dmabuf_kmap(struct dma_buf *dma_buf, unsignedlong
Quoted 8 lines
drivers/gpu/drm/drm_prime.c void drm_gem_dmabuf_release(struct dma_buf *dma_buf)
Quoted 8 lines
drivers/gpu/drm/drm_prime.c +3
-2+page_num) {return NULL ; } +EXPORT_SYMBOL (drm_gem_dmabuf_kmap); -static void drm_gem_dmabuf_kunmap (struct dma_buf *dma_buf, -unsigned long page_num,void *addr) +void drm_gem_dmabuf_kunmap(struct dma_buf *dma_buf, unsignedlong
page_num,Quoted 22 lines
Quoted 22 lines
drivers/gpu/drm/drm_prime.c +5
-2+ void *addr) { } +EXPORT_SYMBOL (drm_gem_dmabuf_kunmap); -static int drm_gem_dmabuf_mmap (struct dma_buf *dma_buf, -struct vm_area_struct *vma) +int drm_gem_dmabuf_mmap (struct dma_buf *dma_buf,struct +vm_area_struct *vma) {struct drm_gem_object *obj = dma_buf->priv; struct drm_device *dev = obj->dev; @@ -396,6 +404,7 @@ static intdrm_gem_dmabuf_mmap (struct dma_buf *dma_buf, return dev->driver->gem_prime_mmap(obj, vma); } +EXPORT_SYMBOL (drm_gem_dmabuf_mmap);static const struct dma_buf_ops drm_gem_prime_dmabuf_ops = { .attach = drm_gem_map_attach,include/drm/drm_prime.h index renamed from include/drm/drm_prime.h +0
-09cd9e36..4d5f5d6 100644
include/drm/drm_prime.h +0
-0@@ -54,6 +54,9 @@ struct device;Quoted 8 lines
include/drm/drm_prime.h int drm_gem_prime_fd_to_handle(struct
Quoted 8 lines
include/drm/drm_prime.h +3
-0struct dma_buf_export_info ;struct dma_buf ; +struct dma_buf_attachment ; + +enum dma_data_direction ;struct drm_device ;struct drm_gem_object ;@@ -79,6 +82,25 @@ int drm_gem_prime_fd_to_handle(struct
drm_device*dev,Quoted 4 lines
include/drm/drm_prime.h int drm_gem_prime_fd_to_handle(struct drm_device *dev,
Quoted 4 lines
include/drm/drm_prime.h +1
-0struct dma_buf *drm_gem_dmabuf_export (struct drm_device *dev,struct dma_buf_export_info *exp_info);void drm_gem_dmabuf_release (struct dma_buf *dma_buf); +int drm_gem_map_attach(struct dma_buf *dma_buf, struct device
*target_dev,Quoted 10 lines
include/drm/drm_prime.h int drm_gem_prime_fd_to_handle(struct · line 95
Quoted 10 lines
include/drm/drm_prime.h +10
-0+ struct dma_buf_attachment *attach); void +drm_gem_map_detach (struct dma_buf *dma_buf, +struct dma_buf_attachment *attach);struct sg_table +*drm_gem_map_dma_buf (struct dma_buf_attachment *attach, +enum dma_data_direction dir);void +drm_gem_unmap_dma_buf (struct dma_buf_attachment *attach, +struct sg_table *sgt, +enum dma_data_direction dir);void +*drm_gem_dmabuf_vmap (struct dma_buf *dma_buf);void +drm_gem_dmabuf_vunmap (struct dma_buf *dma_buf,void *vaddr);void
Quoted 6 lines
include/drm/drm_prime.h int drm_gem_prime_fd_to_handle(struct · line 101
Quoted 6 lines
include/drm/drm_prime.h +6
-0+*drm_gem_dmabuf_kmap_atomic(struct dma_buf *dma_buf, + unsigned long page_num); +void drm_gem_dmabuf_kunmap_atomic (struct dma_buf *dma_buf, +unsigned long page_num,void *addr);void +*drm_gem_dmabuf_kmap (struct dma_buf *dma_buf,unsigned long +page_num); void drm_gem_dmabuf_kunmap(struct dma_buf
*dma_buf, unsigned longpage_num,Quoted 4 lines
include/drm/drm_prime.h int drm_gem_prime_fd_to_handle(struct · line 105
Quoted 4 lines
include/drm/drm_prime.h +3
-0+ void *addr); +int drm_gem_dmabuf_mmap (struct dma_buf *dma_buf,struct +vm_area_struct *vma); int drm_prime_sg_to_page_addr_arrays(struct sg_table *sgt, structpage **pages,
Quoted 6 lines
include/drm/drm_prime.h int drm_gem_prime_fd_to_handle(struct drm_device *dev, · line 106
Quoted 1 line
include/drm/drm_prime.h +0
-0dma_addr_t *addrs, int max_pages);_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 4 lines
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
I'll can push this and a few other misc patches today.
Alex
________________________________
From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of Li, Samuel <[email protected]>
Sent: Tuesday, January 9, 2018 10:20 AM
To: Daniel Vetter; Koenig, Christian
Cc: [email protected]; [email protected]
Subject: RE: [PATCH 2/3] drm: export gem dmabuf_ops for drivers to reuse
Yes, please hush this for me.
Regards,
Samuel Li
Quoted 216 lines
-----Original Message-----
From: Daniel Vetter [mailto:daniel.vetter-/[email protected]] On Behalf Of Daniel
Vetter
Sent: Tuesday, January 09, 2018 4:22 AM
To: Koenig, Christian <[email protected]>
Cc: Li, Samuel <[email protected]>; [email protected]; amd- [email protected]
Subject: Re: [PATCH 2/3] drm: export gemdmabuf_opsfor drivers to reuseQuoted 5 lines · Christian König
Am 04.01.2018 um 22:12 schrieb Samuel Li:
Quoted 2 lines
Change-Id I03c22a890d2305f3243d88019d1a28bddd4ddda7Signed-off-by Samuel Li <[email protected]>Reviewed-by Christian König <[email protected]>Want to push to drm-misc or some other plan with this? -Daniel
Quoted 3 lines
Quoted 3 lines
--- drivers/gpu/drm/drm_prime.c | 53 ++++++++++++++++++++++++++-------------------
Quoted 8 lines
drivers/gpu/drm/drm_prime.c static int drm_prime_lookup_buf_handle(struct
Quoted 8 lines
include/drm/drm_prime.h | 22 +++++++++++++++++++ 2 files changed, 53 insertions(+), 22 deletions(-)(quoted diff) +0
-0
b/drivers/gpu/drm/drm_prime.cindex 8de93a2..68a69e9 100644drivers/gpu/drm/drm_prime.c +0
-0@@ -180,9 +180,8 @@ static int drm_prime_lookup_buf_handle(struct
drm_prime_file_private*prime_fpriQuoted 6 lines
drivers/gpu/drm/drm_prime.c static int drm_prime_lookup_buf_handle(struct · line 182
Quoted 6 lines
drivers/gpu/drm/drm_prime.c +1
-3return -ENOENT ; } -static int drm_gem_map_attach (struct dma_buf *dma_buf, -struct device *target_dev, -struct dma_buf_attachment *attach) +int drm_gem_map_attach(struct dma_buf *dma_buf, struct device
*target_dev,Quoted 4 lines
drivers/gpu/drm/drm_prime.c static int drm_prime_lookup_buf_handle(struct · line 186
Quoted 4 lines
drivers/gpu/drm/drm_prime.c +1
-0+ struct dma_buf_attachment *attach) {struct drm_prime_attachment *prime_attach; struct drm_gem_object *obj = dma_buf->priv; @@ -200,9 +199,10@@
Quoted 11 lines
drivers/gpu/drm/drm_prime.c
Quoted 11 lines
drivers/gpu/drm/drm_prime.c +0
-0static int drm_gem_map_attach(struct dma_buf *dma_buf,return dev->driver->gem_prime_pin(obj); }drivers/gpu/drm/drm_prime.c +3
-2+EXPORT_SYMBOL (drm_gem_map_attach); -static void drm_gem_map_detach (struct dma_buf *dma_buf, -struct dma_buf_attachment *attach) +void drm_gem_map_detach (struct dma_buf *dma_buf, +struct dma_buf_attachment *attach) {struct drm_prime_attachment *prime_attach = attach->priv; struct drm_gem_object *obj = dma_buf->priv; @@ -227,6 +227,7@@
Quoted 6 lines
Quoted 6 lines
static void drm_gem_map_detach(struct
dma_buf*dma_buf,kfree(prime_attach); attach->priv = NULL;}
+EXPORT_SYMBOL(drm_gem_map_detach);
void drm_prime_remove_buf_handle_locked(struct
drm_prime_file_private*prime_fpriv,Quoted 2 lines
drivers/gpu/drm/drm_prime.c void
Quoted 2 lines
struct
dma_buf*dma_buf)drivers/gpu/drm/drm_prime.c +0
-0@@ -253,8 +254,8 @@ voiddrm_prime_remove_buf_handle_locked(struct
drm_prime_file_private*prime_fprQuoted 3 lines
drivers/gpu/drm/drm_prime.c void · line 255
Quoted 3 lines
drivers/gpu/drm/drm_prime.c +0
-1} } -static struct sg_table *drm_gem_map_dma_buf(struct
dma_buf_attachment*attach,Quoted 2 lines
drivers/gpu/drm/drm_prime.c void · line 256
Quoted 2 lines
drivers/gpu/drm/drm_prime.c +1
-1- enum dma_data_direction dir) +struct sg_table *drm_gem_map_dma_buf(struct dma_buf_attachment*attach,
Quoted 5 lines
drivers/gpu/drm/drm_prime.c void · line 261
Quoted 5 lines
drivers/gpu/drm/drm_prime.c +2
-0+ enum dma_data_direction dir) {struct drm_prime_attachment *prime_attach = attach->priv; struct drm_gem_object *obj = attach->dmabuf->priv; @@ -289,13 +290,15 @@ static struct sg_table *drm_gem_map_dma_buf(struct
dma_buf_attachment*attach,Quoted 4 lines
drivers/gpu/drm/drm_prime.c void
Quoted 4 lines
drivers/gpu/drm/drm_prime.c +1
-1return sgt; } +EXPORT_SYMBOL (drm_gem_map_dma_buf); -static void drm_gem_unmap_dma_buf(struct dma_buf_attachment*attach,
Quoted 11 lines
drivers/gpu/drm/drm_prime.c
Quoted 11 lines
drivers/gpu/drm/drm_prime.c +4
-2- struct sg_table *sgt, - enum dma_data_direction dir) +void drm_gem_unmap_dma_buf (struct dma_buf_attachment *attach, +struct sg_table *sgt, +enum dma_data_direction dir) {/* nothing to be done here */ } +EXPORT_SYMBOL (drm_gem_unmap_dma_buf);/** * drm_gem_dmabuf_export - dma_buf export implementation for GEM
Quoted 1 line
drivers/gpu/drm/drm_prime.c void drm_gem_dmabuf_release(struct
Quoted 1 line
drivers/gpu/drm/drm_prime.c +0
-0@@ -346,47 +349,52 @@ void drm_gem_dmabuf_release(struct
dma_buf*dma_buf)Quoted 5 lines
Quoted 5 lines
drivers/gpu/drm/drm_prime.c +1
-1}EXPORT_SYMBOL (drm_gem_dmabuf_release); -static void *drm_gem_dmabuf_vmap (struct dma_buf *dma_buf) +void *drm_gem_dmabuf_vmap (struct dma_buf *dma_buf) {Quoted 8 lines
drivers/gpu/drm/drm_prime.c void drm_gem_dmabuf_release(struct · line 359
Quoted 8 lines
drivers/gpu/drm/drm_prime.c +2
-1struct drm_gem_object *obj = dma_buf->priv;struct drm_device *dev = obj->dev;return dev->driver->gem_prime_vmap (obj); } +EXPORT_SYMBOL (drm_gem_dmabuf_vmap); -static void drm_gem_dmabuf_vunmap (struct dma_buf *dma_buf,void *vaddr) +void drm_gem_dmabuf_vunmap(struct dma_buf *dma_buf, void*vaddr)
Quoted 7 lines
drivers/gpu/drm/drm_prime.c void drm_gem_dmabuf_release(struct · line 361
Quoted 7 lines
drivers/gpu/drm/drm_prime.c +1
-1{struct drm_gem_object *obj = dma_buf->priv;struct drm_device *dev = obj->dev; dev->driver->gem_prime_vunmap (obj, vaddr); } +EXPORT_SYMBOL (drm_gem_dmabuf_vunmap); -static void *drm_gem_dmabuf_kmap_atomic(struct dma_buf
*dma_buf,Quoted 8 lines
drivers/gpu/drm/drm_prime.c void drm_gem_dmabuf_release(struct · line 366
Quoted 8 lines
drivers/gpu/drm/drm_prime.c +3
-2- unsigned long page_num) +void *drm_gem_dmabuf_kmap_atomic (struct dma_buf *dma_buf, +unsigned long page_num) {return NULL ; } +EXPORT_SYMBOL (drm_gem_dmabuf_kmap_atomic); -static void drm_gem_dmabuf_kunmap_atomic(struct dma_buf
*dma_buf,Quoted 10 lines
drivers/gpu/drm/drm_prime.c void drm_gem_dmabuf_release(struct · line 378
Quoted 10 lines
drivers/gpu/drm/drm_prime.c +5
-3- unsigned long page_num, void *addr) +void drm_gem_dmabuf_kunmap_atomic (struct dma_buf *dma_buf, +unsigned long page_num,void *addr) { } -static void *drm_gem_dmabuf_kmap (struct dma_buf *dma_buf, -unsigned long page_num) +EXPORT_SYMBOL (drm_gem_dmabuf_kunmap_atomic); + +void *drm_gem_dmabuf_kmap(struct dma_buf *dma_buf, unsignedlong
Quoted 8 lines
drivers/gpu/drm/drm_prime.c void drm_gem_dmabuf_release(struct · line 384
Quoted 8 lines
drivers/gpu/drm/drm_prime.c +3
-2+page_num) {return NULL ; } +EXPORT_SYMBOL (drm_gem_dmabuf_kmap); -static void drm_gem_dmabuf_kunmap (struct dma_buf *dma_buf, -unsigned long page_num,void *addr) +void drm_gem_dmabuf_kunmap(struct dma_buf *dma_buf, unsignedlong
page_num,Quoted 22 lines
Quoted 22 lines
drivers/gpu/drm/drm_prime.c +5
-2+ void *addr) { } +EXPORT_SYMBOL (drm_gem_dmabuf_kunmap); -static int drm_gem_dmabuf_mmap (struct dma_buf *dma_buf, -struct vm_area_struct *vma) +int drm_gem_dmabuf_mmap (struct dma_buf *dma_buf,struct +vm_area_struct *vma) {struct drm_gem_object *obj = dma_buf->priv; struct drm_device *dev = obj->dev; @@ -396,6 +404,7 @@ static intdrm_gem_dmabuf_mmap (struct dma_buf *dma_buf, return dev->driver->gem_prime_mmap(obj, vma); } +EXPORT_SYMBOL (drm_gem_dmabuf_mmap);static const struct dma_buf_ops drm_gem_prime_dmabuf_ops = { .attach = drm_gem_map_attach,include/drm/drm_prime.h index renamed from include/drm/drm_prime.h +0
-09cd9e36..4d5f5d6 100644
include/drm/drm_prime.h +0
-0@@ -54,6 +54,9 @@ struct device;Quoted 8 lines
include/drm/drm_prime.h int drm_gem_prime_fd_to_handle(struct
Quoted 8 lines
include/drm/drm_prime.h +3
-0struct dma_buf_export_info ;struct dma_buf ; +struct dma_buf_attachment ; + +enum dma_data_direction ;struct drm_device ;struct drm_gem_object ;@@ -79,6 +82,25 @@ int drm_gem_prime_fd_to_handle(struct
drm_device*dev,Quoted 4 lines
include/drm/drm_prime.h int drm_gem_prime_fd_to_handle(struct · line 85
Quoted 4 lines
include/drm/drm_prime.h +1
-0struct dma_buf *drm_gem_dmabuf_export (struct drm_device *dev,struct dma_buf_export_info *exp_info);void drm_gem_dmabuf_release (struct dma_buf *dma_buf); +int drm_gem_map_attach(struct dma_buf *dma_buf, struct device
*target_dev,Quoted 10 lines
include/drm/drm_prime.h int drm_gem_prime_fd_to_handle(struct · line 95
Quoted 10 lines
include/drm/drm_prime.h +10
-0+ struct dma_buf_attachment *attach); void +drm_gem_map_detach (struct dma_buf *dma_buf, +struct dma_buf_attachment *attach);struct sg_table +*drm_gem_map_dma_buf (struct dma_buf_attachment *attach, +enum dma_data_direction dir);void +drm_gem_unmap_dma_buf (struct dma_buf_attachment *attach, +struct sg_table *sgt, +enum dma_data_direction dir);void +*drm_gem_dmabuf_vmap (struct dma_buf *dma_buf);void +drm_gem_dmabuf_vunmap (struct dma_buf *dma_buf,void *vaddr);void
Quoted 6 lines
include/drm/drm_prime.h int drm_gem_prime_fd_to_handle(struct · line 101
Quoted 6 lines
include/drm/drm_prime.h +6
-0+*drm_gem_dmabuf_kmap_atomic(struct dma_buf *dma_buf, + unsigned long page_num); +void drm_gem_dmabuf_kunmap_atomic (struct dma_buf *dma_buf, +unsigned long page_num,void *addr);void +*drm_gem_dmabuf_kmap (struct dma_buf *dma_buf,unsigned long +page_num); void drm_gem_dmabuf_kunmap(struct dma_buf
*dma_buf, unsigned longpage_num,Quoted 4 lines
include/drm/drm_prime.h int drm_gem_prime_fd_to_handle(struct · line 105
Quoted 4 lines
include/drm/drm_prime.h +3
-0+ void *addr); +int drm_gem_dmabuf_mmap (struct dma_buf *dma_buf,struct +vm_area_struct *vma); int drm_prime_sg_to_page_addr_arrays(struct sg_table *sgt, structpage **pages,
Quoted 6 lines
include/drm/drm_prime.h int drm_gem_prime_fd_to_handle(struct · line 106
Quoted 1 line
include/drm/drm_prime.h +0
-0dma_addr_t *addrs, int max_pages);_______________________________________________
dri-devel mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 4 lines
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
amd-gfx mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Alex Deucher
AppliedQuoted 2 lines · Alexander
I'll can push this and a few other misc patches today.
Pushed to drm-misc-next.
Thanks,
Alex
Quoted 242 lines
Alex
________________________________
From: amd-gfx <[email protected]> on behalf of Li, Samuel <[email protected]>
Sent: Tuesday, January 9, 2018 10:20 AM
To: Daniel Vetter; Koenig, Christian
Cc: [email protected]; [email protected]
Subject: RE: [PATCH 2/3] drm: export gemdmabuf_opsfor drivers to reuseYes, please hush this for me.
Regards,
Samuel LiQuoted 217 lines
-----Original Message-----
From: Daniel Vetter [mailto:[email protected]] On Behalf Of Daniel Vetter
Sent: Tuesday, January 09, 2018 4:22 AM
To: Koenig, Christian <[email protected]>
Cc: Li, Samuel <[email protected]>; [email protected]; amd- [email protected]
Subject: Re: [PATCH 2/3] drm: export gemdmabuf_opsfor drivers to reuseQuoted 5 lines · Christian König
Am 04.01.2018 um 22:12 schrieb Samuel Li:
Quoted 2 lines
Change-Id I03c22a890d2305f3243d88019d1a28bddd4ddda7Signed-off-by Samuel Li <[email protected]>Reviewed-by Christian König <[email protected]>Want to push to drm-misc or some other plan with this? -Daniel
Quoted 3 lines
Quoted 3 lines
--- drivers/gpu/drm/drm_prime.c | 53 ++++++++++++++++++++++++++-------------------
Quoted 8 lines
drivers/gpu/drm/drm_prime.c static int drm_prime_lookup_buf_handle(struct
Quoted 8 lines
include/drm/drm_prime.h | 22 +++++++++++++++++++ 2 files changed, 53 insertions(+), 22 deletions(-)(quoted diff) +0
-0
b/drivers/gpu/drm/drm_prime.cindex 8de93a2..68a69e9 100644drivers/gpu/drm/drm_prime.c +0
-0@@ -180,9 +180,8 @@ static int drm_prime_lookup_buf_handle(struct
drm_prime_file_private*prime_fpriQuoted 6 lines
drivers/gpu/drm/drm_prime.c static int drm_prime_lookup_buf_handle(struct · line 182
Quoted 6 lines
drivers/gpu/drm/drm_prime.c +1
-3return -ENOENT ; } -static int drm_gem_map_attach (struct dma_buf *dma_buf, -struct device *target_dev, -struct dma_buf_attachment *attach) +int drm_gem_map_attach(struct dma_buf *dma_buf, struct device
*target_dev,Quoted 4 lines
drivers/gpu/drm/drm_prime.c static int drm_prime_lookup_buf_handle(struct · line 186
Quoted 4 lines
drivers/gpu/drm/drm_prime.c +1
-0+ struct dma_buf_attachment *attach) {struct drm_prime_attachment *prime_attach; struct drm_gem_object *obj = dma_buf->priv; @@ -200,9 +199,10@@
Quoted 11 lines
drivers/gpu/drm/drm_prime.c
Quoted 11 lines
drivers/gpu/drm/drm_prime.c +0
-0static int drm_gem_map_attach(struct dma_buf *dma_buf,return dev->driver->gem_prime_pin(obj); }drivers/gpu/drm/drm_prime.c +3
-2+EXPORT_SYMBOL (drm_gem_map_attach); -static void drm_gem_map_detach (struct dma_buf *dma_buf, -struct dma_buf_attachment *attach) +void drm_gem_map_detach (struct dma_buf *dma_buf, +struct dma_buf_attachment *attach) {struct drm_prime_attachment *prime_attach = attach->priv; struct drm_gem_object *obj = dma_buf->priv; @@ -227,6 +227,7@@
Quoted 6 lines
Quoted 6 lines
static void drm_gem_map_detach(struct
dma_buf*dma_buf,kfree(prime_attach); attach->priv = NULL;}
+EXPORT_SYMBOL(drm_gem_map_detach);
void drm_prime_remove_buf_handle_locked(struct
drm_prime_file_private*prime_fpriv,Quoted 2 lines
drivers/gpu/drm/drm_prime.c void
Quoted 2 lines
struct
dma_buf*dma_buf)drivers/gpu/drm/drm_prime.c +0
-0@@ -253,8 +254,8 @@ voiddrm_prime_remove_buf_handle_locked(struct
drm_prime_file_private*prime_fprQuoted 3 lines
drivers/gpu/drm/drm_prime.c void · line 255
Quoted 3 lines
drivers/gpu/drm/drm_prime.c +0
-1} } -static struct sg_table *drm_gem_map_dma_buf(struct
dma_buf_attachment*attach,Quoted 2 lines
drivers/gpu/drm/drm_prime.c void · line 256
Quoted 2 lines
drivers/gpu/drm/drm_prime.c +1
-1- enum dma_data_direction dir) +struct sg_table *drm_gem_map_dma_buf(struct dma_buf_attachment*attach,
Quoted 5 lines
drivers/gpu/drm/drm_prime.c void · line 261
Quoted 5 lines
drivers/gpu/drm/drm_prime.c +2
-0+ enum dma_data_direction dir) {struct drm_prime_attachment *prime_attach = attach->priv; struct drm_gem_object *obj = attach->dmabuf->priv; @@ -289,13 +290,15 @@ static struct sg_table *drm_gem_map_dma_buf(struct
dma_buf_attachment*attach,Quoted 4 lines
drivers/gpu/drm/drm_prime.c void
Quoted 4 lines
drivers/gpu/drm/drm_prime.c +1
-1return sgt; } +EXPORT_SYMBOL (drm_gem_map_dma_buf); -static void drm_gem_unmap_dma_buf(struct dma_buf_attachment*attach,
Quoted 11 lines
drivers/gpu/drm/drm_prime.c
Quoted 11 lines
drivers/gpu/drm/drm_prime.c +4
-2- struct sg_table *sgt, - enum dma_data_direction dir) +void drm_gem_unmap_dma_buf (struct dma_buf_attachment *attach, +struct sg_table *sgt, +enum dma_data_direction dir) {/* nothing to be done here */ } +EXPORT_SYMBOL (drm_gem_unmap_dma_buf);/** * drm_gem_dmabuf_export - dma_buf export implementation for GEM
Quoted 1 line
drivers/gpu/drm/drm_prime.c void drm_gem_dmabuf_release(struct
Quoted 1 line
drivers/gpu/drm/drm_prime.c +0
-0@@ -346,47 +349,52 @@ void drm_gem_dmabuf_release(struct
dma_buf*dma_buf)Quoted 5 lines
Quoted 5 lines
drivers/gpu/drm/drm_prime.c +1
-1}EXPORT_SYMBOL (drm_gem_dmabuf_release); -static void *drm_gem_dmabuf_vmap (struct dma_buf *dma_buf) +void *drm_gem_dmabuf_vmap (struct dma_buf *dma_buf) {Quoted 8 lines
drivers/gpu/drm/drm_prime.c void drm_gem_dmabuf_release(struct · line 359
Quoted 8 lines
drivers/gpu/drm/drm_prime.c +2
-1struct drm_gem_object *obj = dma_buf->priv;struct drm_device *dev = obj->dev;return dev->driver->gem_prime_vmap (obj); } +EXPORT_SYMBOL (drm_gem_dmabuf_vmap); -static void drm_gem_dmabuf_vunmap (struct dma_buf *dma_buf,void *vaddr) +void drm_gem_dmabuf_vunmap(struct dma_buf *dma_buf, void*vaddr)
Quoted 7 lines
drivers/gpu/drm/drm_prime.c void drm_gem_dmabuf_release(struct · line 361
Quoted 7 lines
drivers/gpu/drm/drm_prime.c +1
-1{struct drm_gem_object *obj = dma_buf->priv;struct drm_device *dev = obj->dev; dev->driver->gem_prime_vunmap (obj, vaddr); } +EXPORT_SYMBOL (drm_gem_dmabuf_vunmap); -static void *drm_gem_dmabuf_kmap_atomic(struct dma_buf
*dma_buf,Quoted 8 lines
drivers/gpu/drm/drm_prime.c void drm_gem_dmabuf_release(struct · line 366
Quoted 8 lines
drivers/gpu/drm/drm_prime.c +3
-2- unsigned long page_num) +void *drm_gem_dmabuf_kmap_atomic (struct dma_buf *dma_buf, +unsigned long page_num) {return NULL ; } +EXPORT_SYMBOL (drm_gem_dmabuf_kmap_atomic); -static void drm_gem_dmabuf_kunmap_atomic(struct dma_buf
*dma_buf,Quoted 10 lines
drivers/gpu/drm/drm_prime.c void drm_gem_dmabuf_release(struct · line 378
Quoted 10 lines
drivers/gpu/drm/drm_prime.c +5
-3- unsigned long page_num, void *addr) +void drm_gem_dmabuf_kunmap_atomic (struct dma_buf *dma_buf, +unsigned long page_num,void *addr) { } -static void *drm_gem_dmabuf_kmap (struct dma_buf *dma_buf, -unsigned long page_num) +EXPORT_SYMBOL (drm_gem_dmabuf_kunmap_atomic); + +void *drm_gem_dmabuf_kmap(struct dma_buf *dma_buf, unsignedlong
Quoted 8 lines
drivers/gpu/drm/drm_prime.c void drm_gem_dmabuf_release(struct · line 384
Quoted 8 lines
drivers/gpu/drm/drm_prime.c +3
-2+page_num) {return NULL ; } +EXPORT_SYMBOL (drm_gem_dmabuf_kmap); -static void drm_gem_dmabuf_kunmap (struct dma_buf *dma_buf, -unsigned long page_num,void *addr) +void drm_gem_dmabuf_kunmap(struct dma_buf *dma_buf, unsignedlong
page_num,Quoted 22 lines
Quoted 22 lines
drivers/gpu/drm/drm_prime.c +5
-2+ void *addr) { } +EXPORT_SYMBOL (drm_gem_dmabuf_kunmap); -static int drm_gem_dmabuf_mmap (struct dma_buf *dma_buf, -struct vm_area_struct *vma) +int drm_gem_dmabuf_mmap (struct dma_buf *dma_buf,struct +vm_area_struct *vma) {struct drm_gem_object *obj = dma_buf->priv; struct drm_device *dev = obj->dev; @@ -396,6 +404,7 @@ static intdrm_gem_dmabuf_mmap (struct dma_buf *dma_buf, return dev->driver->gem_prime_mmap(obj, vma); } +EXPORT_SYMBOL (drm_gem_dmabuf_mmap);static const struct dma_buf_ops drm_gem_prime_dmabuf_ops = { .attach = drm_gem_map_attach,include/drm/drm_prime.h index renamed from include/drm/drm_prime.h +0
-09cd9e36..4d5f5d6 100644
include/drm/drm_prime.h +0
-0@@ -54,6 +54,9 @@ struct device;Quoted 8 lines
include/drm/drm_prime.h int drm_gem_prime_fd_to_handle(struct
Quoted 8 lines
include/drm/drm_prime.h +3
-0struct dma_buf_export_info ;struct dma_buf ; +struct dma_buf_attachment ; + +enum dma_data_direction ;struct drm_device ;struct drm_gem_object ;@@ -79,6 +82,25 @@ int drm_gem_prime_fd_to_handle(struct
drm_device*dev,Quoted 5 lines
include/drm/drm_prime.h int drm_gem_prime_fd_to_handle(struct · line 86
Quoted 5 lines
include/drm/drm_prime.h +1
-0struct dma_buf *drm_gem_dmabuf_export (struct drm_device *dev,struct dma_buf_export_info *exp_info);void drm_gem_dmabuf_release (struct dma_buf *dma_buf); +int drm_gem_map_attach(struct dma_buf *dma_buf, struct device
*target_dev,Quoted 10 lines
include/drm/drm_prime.h int drm_gem_prime_fd_to_handle(struct · line 96
Quoted 10 lines
include/drm/drm_prime.h +10
-0+ struct dma_buf_attachment *attach); void +drm_gem_map_detach (struct dma_buf *dma_buf, +struct dma_buf_attachment *attach);struct sg_table +*drm_gem_map_dma_buf (struct dma_buf_attachment *attach, +enum dma_data_direction dir);void +drm_gem_unmap_dma_buf (struct dma_buf_attachment *attach, +struct sg_table *sgt, +enum dma_data_direction dir);void +*drm_gem_dmabuf_vmap (struct dma_buf *dma_buf);void +drm_gem_dmabuf_vunmap (struct dma_buf *dma_buf,void *vaddr);void
Quoted 6 lines
include/drm/drm_prime.h int drm_gem_prime_fd_to_handle(struct · line 102
Quoted 6 lines
include/drm/drm_prime.h +6
-0+*drm_gem_dmabuf_kmap_atomic(struct dma_buf *dma_buf, + unsigned long page_num); +void drm_gem_dmabuf_kunmap_atomic (struct dma_buf *dma_buf, +unsigned long page_num,void *addr);void +*drm_gem_dmabuf_kmap (struct dma_buf *dma_buf,unsigned long +page_num); void drm_gem_dmabuf_kunmap(struct dma_buf
*dma_buf, unsigned longpage_num,Quoted 4 lines
include/drm/drm_prime.h int drm_gem_prime_fd_to_handle(struct · line 106
Quoted 4 lines
include/drm/drm_prime.h +3
-0+ void *addr); +int drm_gem_dmabuf_mmap (struct dma_buf *dma_buf,struct +vm_area_struct *vma); int drm_prime_sg_to_page_addr_arrays(struct sg_table *sgt, structpage **pages,
Quoted 6 lines
Quoted 1 line
dma_addr_t *addrs, int max_pages);_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-develQuoted 4 lines
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Quoted 5 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 6 lines · Alex Deucher
Quoted 2 lines · Alexander
I'll can push this and a few other misc patches today.
Pushed to drm-misc-next.
One thing I just noticed: Some kerneldoc for the newly exported functions and maybe a small update to the intro section to explain what to do with this would be neat.
-Daniel
Quoted 253 lines
Thanks,
Alex
Quoted 247 lines
Alex
________________________________
From: amd-gfx <[email protected]> on behalf of Li, Samuel <[email protected]>
Sent: Tuesday, January 9, 2018 10:20 AM
To: Daniel Vetter; Koenig, Christian
Cc: [email protected]; [email protected]
Subject: RE: [PATCH 2/3] drm: export gemdmabuf_opsfor drivers to reuseYes, please hush this for me.
Regards,
Samuel LiQuoted 217 lines
-----Original Message-----
From: Daniel Vetter [mailto:[email protected]] On Behalf Of Daniel Vetter
Sent: Tuesday, January 09, 2018 4:22 AM
To: Koenig, Christian <[email protected]>
Cc: Li, Samuel <[email protected]>; [email protected]; amd- [email protected]
Subject: Re: [PATCH 2/3] drm: export gemdmabuf_opsfor drivers to reuseQuoted 5 lines · Christian König
Am 04.01.2018 um 22:12 schrieb Samuel Li:
Quoted 2 lines
Change-Id I03c22a890d2305f3243d88019d1a28bddd4ddda7Signed-off-by Samuel Li <[email protected]>Reviewed-by Christian König <[email protected]>Want to push to drm-misc or some other plan with this? -Daniel
Quoted 3 lines
Quoted 3 lines
--- drivers/gpu/drm/drm_prime.c | 53 ++++++++++++++++++++++++++-------------------
Quoted 8 lines
drivers/gpu/drm/drm_prime.c static int drm_prime_lookup_buf_handle(struct
Quoted 8 lines
include/drm/drm_prime.h | 22 +++++++++++++++++++ 2 files changed, 53 insertions(+), 22 deletions(-)(quoted diff) +0
-0
b/drivers/gpu/drm/drm_prime.cindex 8de93a2..68a69e9 100644drivers/gpu/drm/drm_prime.c +0
-0@@ -180,9 +180,8 @@ static int drm_prime_lookup_buf_handle(struct
drm_prime_file_private*prime_fpriQuoted 6 lines
drivers/gpu/drm/drm_prime.c static int drm_prime_lookup_buf_handle(struct · line 182
Quoted 6 lines
drivers/gpu/drm/drm_prime.c +1
-3return -ENOENT ; } -static int drm_gem_map_attach (struct dma_buf *dma_buf, -struct device *target_dev, -struct dma_buf_attachment *attach) +int drm_gem_map_attach(struct dma_buf *dma_buf, struct device
*target_dev,Quoted 4 lines
drivers/gpu/drm/drm_prime.c static int drm_prime_lookup_buf_handle(struct · line 186
Quoted 4 lines
drivers/gpu/drm/drm_prime.c +1
-0+ struct dma_buf_attachment *attach) {struct drm_prime_attachment *prime_attach; struct drm_gem_object *obj = dma_buf->priv; @@ -200,9 +199,10@@
Quoted 11 lines
drivers/gpu/drm/drm_prime.c
Quoted 11 lines
drivers/gpu/drm/drm_prime.c +0
-0static int drm_gem_map_attach(struct dma_buf *dma_buf,return dev->driver->gem_prime_pin(obj); }drivers/gpu/drm/drm_prime.c +3
-2+EXPORT_SYMBOL (drm_gem_map_attach); -static void drm_gem_map_detach (struct dma_buf *dma_buf, -struct dma_buf_attachment *attach) +void drm_gem_map_detach (struct dma_buf *dma_buf, +struct dma_buf_attachment *attach) {struct drm_prime_attachment *prime_attach = attach->priv; struct drm_gem_object *obj = dma_buf->priv; @@ -227,6 +227,7@@
Quoted 6 lines
Quoted 6 lines
static void drm_gem_map_detach(struct
dma_buf*dma_buf,kfree(prime_attach); attach->priv = NULL;}
+EXPORT_SYMBOL(drm_gem_map_detach);
void drm_prime_remove_buf_handle_locked(struct
drm_prime_file_private*prime_fpriv,Quoted 2 lines
drivers/gpu/drm/drm_prime.c void
Quoted 2 lines
struct
dma_buf*dma_buf)drivers/gpu/drm/drm_prime.c +0
-0@@ -253,8 +254,8 @@ voiddrm_prime_remove_buf_handle_locked(struct
drm_prime_file_private*prime_fprQuoted 3 lines
drivers/gpu/drm/drm_prime.c void · line 255
Quoted 3 lines
drivers/gpu/drm/drm_prime.c +0
-1} } -static struct sg_table *drm_gem_map_dma_buf(struct
dma_buf_attachment*attach,Quoted 2 lines
drivers/gpu/drm/drm_prime.c void · line 256
Quoted 2 lines
drivers/gpu/drm/drm_prime.c +1
-1- enum dma_data_direction dir) +struct sg_table *drm_gem_map_dma_buf(struct dma_buf_attachment*attach,
Quoted 5 lines
drivers/gpu/drm/drm_prime.c void · line 261
Quoted 5 lines
drivers/gpu/drm/drm_prime.c +2
-0+ enum dma_data_direction dir) {struct drm_prime_attachment *prime_attach = attach->priv; struct drm_gem_object *obj = attach->dmabuf->priv; @@ -289,13 +290,15 @@ static struct sg_table *drm_gem_map_dma_buf(struct
dma_buf_attachment*attach,Quoted 4 lines
drivers/gpu/drm/drm_prime.c void
Quoted 4 lines
drivers/gpu/drm/drm_prime.c +1
-1return sgt; } +EXPORT_SYMBOL (drm_gem_map_dma_buf); -static void drm_gem_unmap_dma_buf(struct dma_buf_attachment*attach,
Quoted 11 lines
drivers/gpu/drm/drm_prime.c
Quoted 11 lines
drivers/gpu/drm/drm_prime.c +4
-2- struct sg_table *sgt, - enum dma_data_direction dir) +void drm_gem_unmap_dma_buf (struct dma_buf_attachment *attach, +struct sg_table *sgt, +enum dma_data_direction dir) {/* nothing to be done here */ } +EXPORT_SYMBOL (drm_gem_unmap_dma_buf);/** * drm_gem_dmabuf_export - dma_buf export implementation for GEM
Quoted 1 line
drivers/gpu/drm/drm_prime.c void drm_gem_dmabuf_release(struct
Quoted 1 line
drivers/gpu/drm/drm_prime.c +0
-0@@ -346,47 +349,52 @@ void drm_gem_dmabuf_release(struct
dma_buf*dma_buf)Quoted 5 lines
Quoted 5 lines
drivers/gpu/drm/drm_prime.c +1
-1}EXPORT_SYMBOL (drm_gem_dmabuf_release); -static void *drm_gem_dmabuf_vmap (struct dma_buf *dma_buf) +void *drm_gem_dmabuf_vmap (struct dma_buf *dma_buf) {Quoted 8 lines
drivers/gpu/drm/drm_prime.c void drm_gem_dmabuf_release(struct · line 359
Quoted 8 lines
drivers/gpu/drm/drm_prime.c +2
-1struct drm_gem_object *obj = dma_buf->priv;struct drm_device *dev = obj->dev;return dev->driver->gem_prime_vmap (obj); } +EXPORT_SYMBOL (drm_gem_dmabuf_vmap); -static void drm_gem_dmabuf_vunmap (struct dma_buf *dma_buf,void *vaddr) +void drm_gem_dmabuf_vunmap(struct dma_buf *dma_buf, void*vaddr)
Quoted 7 lines
drivers/gpu/drm/drm_prime.c void drm_gem_dmabuf_release(struct · line 361
Quoted 7 lines
drivers/gpu/drm/drm_prime.c +1
-1{struct drm_gem_object *obj = dma_buf->priv;struct drm_device *dev = obj->dev; dev->driver->gem_prime_vunmap (obj, vaddr); } +EXPORT_SYMBOL (drm_gem_dmabuf_vunmap); -static void *drm_gem_dmabuf_kmap_atomic(struct dma_buf
*dma_buf,Quoted 8 lines
drivers/gpu/drm/drm_prime.c void drm_gem_dmabuf_release(struct · line 366
Quoted 8 lines
drivers/gpu/drm/drm_prime.c +3
-2- unsigned long page_num) +void *drm_gem_dmabuf_kmap_atomic (struct dma_buf *dma_buf, +unsigned long page_num) {return NULL ; } +EXPORT_SYMBOL (drm_gem_dmabuf_kmap_atomic); -static void drm_gem_dmabuf_kunmap_atomic(struct dma_buf
*dma_buf,Quoted 10 lines
drivers/gpu/drm/drm_prime.c void drm_gem_dmabuf_release(struct · line 378
Quoted 10 lines
drivers/gpu/drm/drm_prime.c +5
-3- unsigned long page_num, void *addr) +void drm_gem_dmabuf_kunmap_atomic (struct dma_buf *dma_buf, +unsigned long page_num,void *addr) { } -static void *drm_gem_dmabuf_kmap (struct dma_buf *dma_buf, -unsigned long page_num) +EXPORT_SYMBOL (drm_gem_dmabuf_kunmap_atomic); + +void *drm_gem_dmabuf_kmap(struct dma_buf *dma_buf, unsignedlong
Quoted 8 lines
drivers/gpu/drm/drm_prime.c void drm_gem_dmabuf_release(struct · line 384
Quoted 8 lines
drivers/gpu/drm/drm_prime.c +3
-2+page_num) {return NULL ; } +EXPORT_SYMBOL (drm_gem_dmabuf_kmap); -static void drm_gem_dmabuf_kunmap (struct dma_buf *dma_buf, -unsigned long page_num,void *addr) +void drm_gem_dmabuf_kunmap(struct dma_buf *dma_buf, unsignedlong
page_num,Quoted 22 lines
Quoted 22 lines
drivers/gpu/drm/drm_prime.c +5
-2+ void *addr) { } +EXPORT_SYMBOL (drm_gem_dmabuf_kunmap); -static int drm_gem_dmabuf_mmap (struct dma_buf *dma_buf, -struct vm_area_struct *vma) +int drm_gem_dmabuf_mmap (struct dma_buf *dma_buf,struct +vm_area_struct *vma) {struct drm_gem_object *obj = dma_buf->priv; struct drm_device *dev = obj->dev; @@ -396,6 +404,7 @@ static intdrm_gem_dmabuf_mmap (struct dma_buf *dma_buf, return dev->driver->gem_prime_mmap(obj, vma); } +EXPORT_SYMBOL (drm_gem_dmabuf_mmap);static const struct dma_buf_ops drm_gem_prime_dmabuf_ops = { .attach = drm_gem_map_attach,include/drm/drm_prime.h index renamed from include/drm/drm_prime.h +0
-09cd9e36..4d5f5d6 100644
include/drm/drm_prime.h +0
-0@@ -54,6 +54,9 @@ struct device;Quoted 8 lines
include/drm/drm_prime.h int drm_gem_prime_fd_to_handle(struct
Quoted 8 lines
include/drm/drm_prime.h +3
-0struct dma_buf_export_info ;struct dma_buf ; +struct dma_buf_attachment ; + +enum dma_data_direction ;struct drm_device ;struct drm_gem_object ;@@ -79,6 +82,25 @@ int drm_gem_prime_fd_to_handle(struct
drm_device*dev,Quoted 5 lines
include/drm/drm_prime.h int drm_gem_prime_fd_to_handle(struct · line 86
Quoted 5 lines
include/drm/drm_prime.h +1
-0struct dma_buf *drm_gem_dmabuf_export (struct drm_device *dev,struct dma_buf_export_info *exp_info);void drm_gem_dmabuf_release (struct dma_buf *dma_buf); +int drm_gem_map_attach(struct dma_buf *dma_buf, struct device
*target_dev,Quoted 10 lines
include/drm/drm_prime.h int drm_gem_prime_fd_to_handle(struct · line 96
Quoted 10 lines
include/drm/drm_prime.h +10
-0+ struct dma_buf_attachment *attach); void +drm_gem_map_detach (struct dma_buf *dma_buf, +struct dma_buf_attachment *attach);struct sg_table +*drm_gem_map_dma_buf (struct dma_buf_attachment *attach, +enum dma_data_direction dir);void +drm_gem_unmap_dma_buf (struct dma_buf_attachment *attach, +struct sg_table *sgt, +enum dma_data_direction dir);void +*drm_gem_dmabuf_vmap (struct dma_buf *dma_buf);void +drm_gem_dmabuf_vunmap (struct dma_buf *dma_buf,void *vaddr);void
Quoted 6 lines
include/drm/drm_prime.h int drm_gem_prime_fd_to_handle(struct · line 102
Quoted 6 lines
include/drm/drm_prime.h +6
-0+*drm_gem_dmabuf_kmap_atomic(struct dma_buf *dma_buf, + unsigned long page_num); +void drm_gem_dmabuf_kunmap_atomic (struct dma_buf *dma_buf, +unsigned long page_num,void *addr);void +*drm_gem_dmabuf_kmap (struct dma_buf *dma_buf,unsigned long +page_num); void drm_gem_dmabuf_kunmap(struct dma_buf
*dma_buf, unsigned longpage_num,Quoted 4 lines
include/drm/drm_prime.h int drm_gem_prime_fd_to_handle(struct · line 106
Quoted 4 lines
include/drm/drm_prime.h +3
-0+ void *addr); +int drm_gem_dmabuf_mmap (struct dma_buf *dma_buf,struct +vm_area_struct *vma); int drm_prime_sg_to_page_addr_arrays(struct sg_table *sgt, structpage **pages,
Quoted 6 lines
Quoted 1 line
dma_addr_t *addrs, int max_pages);_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-develQuoted 4 lines
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
OK. I'll do it.
Samuel Li
Quoted 300 lines
-----Original Message-----
From: Daniel Vetter [mailto:[email protected]] On Behalf Of Daniel Vetter
Sent: Wednesday, January 10, 2018 3:17 AM
To: Alex Deucher <[email protected]>
Cc: Deucher, Alexander <[email protected]>; Li, Samuel <[email protected]>; Daniel Vetter <[email protected]>; Koenig, Christian <[email protected]>; [email protected]; amd- [email protected]
Subject: Re: [PATCH 2/3] drm: export gemdmabuf_opsfor drivers to reuseQuoted 6 lines · Alex Deucher
Quoted 2 lines · Alexander
I'll can push this and a few other misc patches today.
Pushed to drm-misc-next.
One thing I just noticed: Some kerneldoc for the newly exported functions and maybe a small update to the intro section to explain what to do with this would be neat.
-DanielQuoted 58 lines
Thanks,
Alex
Quoted 52 lines
Alex
________________________________
From: amd-gfx <[email protected]> on behalf of Li, Samuel <[email protected]>
Sent: Tuesday, January 9, 2018 10:20 AM
To: Daniel Vetter; Koenig, Christian
Cc: [email protected]; [email protected]
Subject: RE: [PATCH 2/3] drm: export gemdmabuf_opsfor drivers to reuseYes, please hush this for me.
Regards,
Samuel LiQuoted 35 lines
-----Original Message-----
From: Daniel Vetter [mailto:[email protected]] On Behalf Of Daniel Vetter
Sent: Tuesday, January 09, 2018 4:22 AM
To: Koenig, Christian <[email protected]>
Cc: Li, Samuel <[email protected]>; [email protected]; amd- [email protected]
Subject: Re: [PATCH 2/3] drm: export gemdmabuf_opsfor drivers to reuseQuoted 5 lines · Christian König
Am 04.01.2018 um 22:12 schrieb Samuel Li:
Quoted 2 lines
Change-Id I03c22a890d2305f3243d88019d1a28bddd4ddda7Signed-off-by Samuel Li <[email protected]>Reviewed-by Christian König <[email protected]>Want to push to drm-misc or some other plan with this? -Daniel
Quoted 4 lines
Quoted 4 lines
--- drivers/gpu/drm/drm_prime.c | 53++++++++++++++++++++++++++---
----------------
Quoted 9 lines
Quoted 9 lines
include/drm/drm_prime.h | 22 +++++++++++++++++++ 2 files changed, 53 insertions(+), 22 deletions(-)(quoted diff) +0
-0
b/drivers/gpu/drm/drm_prime.cindex 8de93a2..68a69e9 100644drivers/gpu/drm/drm_prime.c +0
-0@@ -180,9 +180,8 @@ static intdrm_prime_lookup_buf_handle(struct
drm_prime_file_private*prime_fpriQuoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
drivers/gpu/drm/drm_prime.c
Quoted 6 lines
return -ENOENT; }drivers/gpu/drm/drm_prime.c +1
-3-static int drm_gem_map_attach (struct dma_buf *dma_buf, -struct device *target_dev, -struct dma_buf_attachment *attach) +int drm_gem_map_attach(struct dma_buf *dma_buf, structdevice
Quoted 25 lines
Quoted 25 lines
Quoted 25 lines
*target_dev,Quoted 5 lines
Quoted 5 lines
+ struct
dma_buf_attachment*attach){ struct drm_prime_attachment *prime_attach; struct drm_gem_object *obj = dma_buf->priv; @@ -200,9+199,10
@@
Quoted 11 lines
drivers/gpu/drm/drm_prime.c
Quoted 11 lines
static int drm_gem_map_attach(struct
dma_buf*dma_buf,
returndev->driver->gem_prime_pin(obj);
}drivers/gpu/drm/drm_prime.c +3
-2+EXPORT_SYMBOL (drm_gem_map_attach); -static void drm_gem_map_detach (struct dma_buf *dma_buf, -struct dma_buf_attachment *attach) +void drm_gem_map_detach (struct dma_buf *dma_buf, +struct dma_buf_attachment *attach) {struct drm_prime_attachment *prime_attach = attach->priv; struct drm_gem_object *obj = dma_buf->priv; @@ -227,6 +227,7@@
Quoted 6 lines
Quoted 6 lines
static void drm_gem_map_detach(struct
dma_buf*dma_buf,kfree(prime_attach); attach->priv = NULL;}
+EXPORT_SYMBOL(drm_gem_map_detach);
void drm_prime_remove_buf_handle_locked(structQuoted 4 lines
Quoted 4 lines
Quoted 4 lines
drm_prime_file_private*prime_fpriv,Quoted 2 lines
Quoted 2 lines
struct
dma_buf*dma_buf) @@
-253,8 +254,8 @@ voiddrm_prime_remove_buf_handle_locked(struct
drm_prime_file_privateQuoted 7 lines
Quoted 7 lines
Quoted 7 lines
*prime_fprQuoted 3 lines
Quoted 3 lines
}}
-static structsg_table*drm_gem_map_dma_buf(struct
dma_buf_attachment*attach,Quoted 2 lines
Quoted 2 lines
drivers/gpu/drm/drm_prime.c +1
-1- enum dma_data_direction dir) +struct sg_table *drm_gem_map_dma_buf(struct
dma_buf_attachmentQuoted 7 lines
Quoted 7 lines
Quoted 7 lines
*attach,
Quoted 6 lines
Quoted 6 lines
+ enum
dma_data_directiondir){ struct drm_prime_attachment *prime_attach = attach->priv; struct drm_gem_object *obj = attach->dmabuf->priv; @@-289,13
+290,15 @@ static structsg_table*drm_gem_map_dma_buf(structQuoted 5 lines
Quoted 5 lines
Quoted 5 lines
dma_buf_attachment*attach,Quoted 4 lines
drivers/gpu/drm/drm_prime.c
Quoted 4 lines
return sgt; }drivers/gpu/drm/drm_prime.c +1
-1+EXPORT_SYMBOL (drm_gem_map_dma_buf); -static void drm_gem_unmap_dma_buf(struct
dma_buf_attachmentQuoted 4 lines
Quoted 4 lines
Quoted 4 lines
*attach,
Quoted 3 lines
Quoted 3 lines
drivers/gpu/drm/drm_prime.c +1
-2-struct sg_table *sgt, - enum dma_data_direction dir) +void drm_gem_unmap_dma_buf(struct dma_buf_attachment*attach,
Quoted 43 lines
Quoted 43 lines
Quoted 43 lines
Quoted 8 lines
drivers/gpu/drm/drm_prime.c
Quoted 8 lines
drivers/gpu/drm/drm_prime.c +3
-0+ struct sg_table *sgt, + enum dma_data_direction dir) {/* nothing to be done here */ } +EXPORT_SYMBOL (drm_gem_unmap_dma_buf);/** * drm_gem_dmabuf_export - dma_buf export implementation for GEM
Quoted 1 line
drivers/gpu/drm/drm_prime.c void drm_gem_dmabuf_release(struct
Quoted 1 line
drivers/gpu/drm/drm_prime.c +0
-0@@ -346,47 +349,52 @@ void drm_gem_dmabuf_release(struct
dma_buf*dma_buf)Quoted 6 lines
Quoted 6 lines
drivers/gpu/drm/drm_prime.c +1
-1}EXPORT_SYMBOL (drm_gem_dmabuf_release); -static void *drm_gem_dmabuf_vmap (struct dma_buf *dma_buf) +void *drm_gem_dmabuf_vmap (struct dma_buf *dma_buf) {struct drm_gem_object *obj = dma_buf->priv;Quoted 8 lines
Quoted 8 lines
drivers/gpu/drm/drm_prime.c +1
-1struct drm_device *dev = obj->dev;return dev->driver->gem_prime_vmap (obj); } +EXPORT_SYMBOL (drm_gem_dmabuf_vmap); -static void drm_gem_dmabuf_vunmap(struct dma_buf *dma_buf,void
*vaddr)
+void drm_gem_dmabuf_vunmap(structdma_buf*dma_buf, void*vaddr)
Quoted 7 lines
drivers/gpu/drm/drm_prime.c
Quoted 7 lines
{ struct drm_gem_object *obj = dma_buf->priv; struct drm_device *dev = obj->dev; dev->driver->gem_prime_vunmap(obj, vaddr); }drivers/gpu/drm/drm_prime.c +1
-1+EXPORT_SYMBOL (drm_gem_dmabuf_vunmap); -static void *drm_gem_dmabuf_kmap_atomic(struct dma_buf
*dma_buf,Quoted 8 lines
drivers/gpu/drm/drm_prime.c
Quoted 8 lines
drivers/gpu/drm/drm_prime.c +3
-2- unsigned long page_num) +void *drm_gem_dmabuf_kmap_atomic (struct dma_buf *dma_buf, +unsigned long page_num) {return NULL ; } +EXPORT_SYMBOL (drm_gem_dmabuf_kmap_atomic); -static void drm_gem_dmabuf_kunmap_atomic(struct dma_buf
*dma_buf,Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
drivers/gpu/drm/drm_prime.c
Quoted 2 lines
drivers/gpu/drm/drm_prime.c +1
-1- unsigned long page_num, void *addr) +void drm_gem_dmabuf_kunmap_atomic(struct dma_buf
*dma_buf,Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
drivers/gpu/drm/drm_prime.c
Quoted 8 lines
drivers/gpu/drm/drm_prime.c +4
-2+ unsigned long page_num, void *addr) { } -static void *drm_gem_dmabuf_kmap (struct dma_buf *dma_buf, -unsigned long page_num) +EXPORT_SYMBOL (drm_gem_dmabuf_kunmap_atomic ); + +void *drm_gem_dmabuf_kmap(struct dma_buf *dma_buf,unsigned
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
long
Quoted 8 lines
drivers/gpu/drm/drm_prime.c
Quoted 8 lines
drivers/gpu/drm/drm_prime.c +3
-2+page_num) {return NULL ; } +EXPORT_SYMBOL (drm_gem_dmabuf_kmap); -static void drm_gem_dmabuf_kunmap (struct dma_buf *dma_buf, -unsigned long page_num,void *addr) +void drm_gem_dmabuf_kunmap(struct dma_buf *dma_buf,unsigned
Quoted 32 lines
Quoted 32 lines
Quoted 32 lines
long
page_num,Quoted 22 lines
Quoted 22 lines
drivers/gpu/drm/drm_prime.c +4
-2+ void *addr) { } +EXPORT_SYMBOL (drm_gem_dmabuf_kunmap); -static int drm_gem_dmabuf_mmap (struct dma_buf *dma_buf, -struct vm_area_struct *vma) +int drm_gem_dmabuf_mmap (struct dma_buf *dma_buf,struct +vm_area_struct *vma) {struct drm_gem_object *obj = dma_buf->priv; struct drm_device *dev = obj->dev; @@ -396,6 +404,7 @@static int drm_gem_dmabuf_mmap(struct
dma_buf*dma_buf,
returndev->driver->gem_prime_mmap(obj, vma);
}
+EXPORT_SYMBOL(drm_gem_dmabuf_mmap);static const struct dma_buf_ops drm_gem_prime_dmabuf_ops = { .attach = drm_gem_map_attach, diff --git
a/include/drm/drm_prime.hb/include/drm/drm_prime.hindex 9cd9e36..4d5f5d6 100644include/drm/drm_prime.h +0
-0@@ -54,6 +54,9 @@ struct device;Quoted 8 lines
include/drm/drm_prime.h int drm_gem_prime_fd_to_handle(struct
Quoted 8 lines
include/drm/drm_prime.h +3
-0struct dma_buf_export_info ;struct dma_buf ; +struct dma_buf_attachment ; + +enum dma_data_direction ;struct drm_device ;struct drm_gem_object ;@@ -79,6 +82,25 @@ int drm_gem_prime_fd_to_handle(struct
drm_device*dev,Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
include/drm/drm_prime.h int drm_gem_prime_fd_to_handle(struct · line 82
Quoted 1 line
include/drm/drm_prime.h +0
-0struct dma_buf *drm_gem_dmabuf_export(struct drm_device*dev,
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
include/drm/drm_prime.h int drm_gem_prime_fd_to_handle(struct · line 86
Quoted 4 lines
include/drm/drm_prime.h +1
-0struct dma_buf_export_info *exp_info);void drm_gem_dmabuf_release (struct dma_buf *dma_buf); +int drm_gem_map_attach(struct dma_buf *dma_buf, structdevice
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
*target_dev,Quoted 4 lines
include/drm/drm_prime.h int drm_gem_prime_fd_to_handle(struct · line 90
Quoted 4 lines
include/drm/drm_prime.h +4
-0+ struct dma_buf_attachment *attach); void +drm_gem_map_detach (struct dma_buf *dma_buf, +struct dma_buf_attachment *attach);struct +sg_table *drm_gem_map_dma_buf(struct dma_buf_attachment*attach,
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
include/drm/drm_prime.h int drm_gem_prime_fd_to_handle(struct · line 92
Quoted 2 lines
include/drm/drm_prime.h +2
-0+ enum dma_data_direction dir); +void drm_gem_unmap_dma_buf(struct dma_buf_attachment*attach,
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
include/drm/drm_prime.h int drm_gem_prime_fd_to_handle(struct · line 96
Quoted 4 lines
include/drm/drm_prime.h +4
-0+struct sg_table *sgt, + enum dma_data_direction dir); void +*drm_gem_dmabuf_vmap (struct dma_buf *dma_buf);void +drm_gem_dmabuf_vunmap(struct dma_buf *dma_buf, void*vaddr);
Quoted 31 lines
Quoted 31 lines
Quoted 18 lines
void
Quoted 7 lines
include/drm/drm_prime.h int drm_gem_prime_fd_to_handle(struct · line 103
Quoted 7 lines
include/drm/drm_prime.h +7
-0+*drm_gem_dmabuf_kmap_atomic(struct dma_buf *dma_buf, + unsigned long page_num); void +drm_gem_dmabuf_kunmap_atomic (struct dma_buf *dma_buf, +unsigned long page_num,void +*addr);void *drm_gem_dmabuf_kmap (struct dma_buf *dma_buf, +unsigned long page_num);void drm_gem_dmabuf_kunmap (struct +dma_buf
*dma_buf, unsigned longpage_num,Quoted 5 lines
Quoted 5 lines
include/drm/drm_prime.h +3
-0+ void *addr); int +drm_gem_dmabuf_mmap (struct dma_buf *dma_buf,struct +vm_area_struct *vma); int drm_prime_sg_to_page_addr_arrays(struct sg_table *sgt,struct
page **pages,
Quoted 3 lines
Quoted 2 lines
dma_addr_t*addrs, intmax_pages);Quoted 8 lines
Quoted 4 lines
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel--
Daniel Vetter
Software Engineer, Intel Corporation http://blog.ffwll.ch_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfxQuoted 5 lines
Quoted 5 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Quoted 4 lines
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel