dma-buf: Flag vmap'ed memory as system or I/O memory
Subsystems (13)
Thomas Zimmermann
maintainerv3 cover dma-buf: Flag vmap'ed memory as system or I/O memory
Dma-buf provides vmap() and vunmap() for retriving and releasing mappings of dma-buf memory in kernel address space. The functions operate with plain addresses and the assumption is that the memory can be accessed with load and store operations. This is not the case on some architectures (e.g., sparc64) where I/O memory can only be accessed with dedicated instructions.
This patchset introduces struct dma_buf_map, which contains the address of a buffer and a flag that tells whether system- or I/O-memory instructions are required.
Some background: updating the DRM framebuffer console on sparc64 makes the kernel panic. This is because the framebuffer memory cannot be accessed with system-memory instructions. We currently employ a workaround in DRM to address this specific problem. [1]
To resolve the problem, we'd like to address it at the most common point, which is the dma-buf framework. The dma-buf mapping ideally knows if I/O instructions are required and exports this information to it's users. The new structure struct dma_buf_map stores the buffer address and a flag that signals I/O memory. Affected users of the buffer (e.g., drivers, frameworks) can then access the memory accordingly.
This patchset only introduces struct dma_buf_map, and updates struct dma_buf and it's interfaces. Further patches can update dma-buf users. For example, there's a prototype patchset for DRM that fixes the framebuffer problem. [2]
Further work: TTM, one of DRM's memory managers, already exports an is_iomem flag of its own. It could later be switched over to exporting struct dma_buf_map, thus simplifying some code. Several DRM drivers expect their fbdev console to operate on I/O memory. These could possibly be switched over to the generic fbdev emulation, as soon as the generic code uses struct dma_buf_map.
v3:
* update fastrpc driver (kernel test robot)
* expand documentation (Daniel)
* move documentation into separate patch
v2:
* always clear map parameter in dma_buf_vmap() (Daniel)
* include dma-buf-heaps and i915 selftests (kernel test robot)
* initialize cma_obj before using it in drm_gem_cma_free_object() (kernel test robot)
[1] https://lore.kernel.org/dri-devel/[email protected]/
[2] https://lore.kernel.org/dri-devel/[email protected]/
Thomas Zimmermann (4):
dma-buf: Add struct dma-buf-map for storing struct dma_buf.vaddr_ptr
dma-buf: Use struct dma_buf_map in dma_buf_vmap() interfaces
dma-buf: Use struct dma_buf_map in dma_buf_vunmap() interfaces
dma-buf: Document struct dma_buf_map
Documentation/driver-api/dma-buf.rst | 9 + drivers/dma-buf/dma-buf.c | 42 ++-- drivers/dma-buf/heaps/heap-helpers.c | 10 +- drivers/gpu/drm/drm_gem_cma_helper.c | 20 +- drivers/gpu/drm/drm_gem_shmem_helper.c | 17 +- drivers/gpu/drm/drm_prime.c | 15 +- drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c | 13 +- drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c | 13 +- .../drm/i915/gem/selftests/i915_gem_dmabuf.c | 18 +- .../gpu/drm/i915/gem/selftests/mock_dmabuf.c | 14 +- drivers/gpu/drm/tegra/gem.c | 23 ++- .../common/videobuf2/videobuf2-dma-contig.c | 17 +- .../media/common/videobuf2/videobuf2-dma-sg.c | 19 +- .../common/videobuf2/videobuf2-vmalloc.c | 21 +- drivers/misc/fastrpc.c | 6 +- include/drm/drm_prime.h | 5 +- include/linux/dma-buf-map.h | 193 ++++++++++++++++++ include/linux/dma-buf.h | 11 +- 18 files changed, 372 insertions(+), 94 deletions(-) create mode 100644 include/linux/dma-buf-map.h
--
2.28.0
Thomas Zimmermann
maintainerPATCH v3 1/4 dma-buf: Add struct dma-buf-map for storing struct dma_buf.vaddr_ptr
The new type struct dma_buf_map represents a mapping of dma-buf memory into kernel space. It contains a flag, is_iomem, that signals users to access the mapped memory with I/O operations instead of regular loads and stores.
It was assumed that DMA buffer memory can be accessed with regular load and store operations. Some architectures, such as sparc64, require the use of I/O operations to access dma-map buffers that are located in I/O memory. Providing struct dma_buf_map allows drivers to implement this. This was specifically a problem when refreshing the graphics framebuffer on such systems. [1]
As the first step, struct dma_buf stores an instance of struct dma_buf_map internally. Afterwards, dma-buf's vmap and vunmap interfaces are be converted. Finally, affected drivers can be fixed.
v3:
* moved documentation into separate patch
* test for NULL pointers with !<ptr>
[1] https://lore.kernel.org/dri-devel/[email protected]/
--- drivers/dma-buf/dma-buf.c | 14 +++---- include/linux/dma-buf-map.h | 82 +++++++++++++++++++++++++++++++++++++ include/linux/dma-buf.h | 3 +- 3 files changed, 91 insertions(+), 8 deletions(-) create mode 100644 include/linux/dma-buf-map.h
drivers/dma-buf/dma-buf.c +7 -7
@@ -1207,12 +1207,12 @@ void *dma_buf_vmap(struct dma_buf *dmabuf)mutex_lock (&dmabuf->lock);if (dmabuf->vmapping_counter) { dmabuf->vmapping_counter++; -BUG_ON (!dmabuf->vmap_ptr); - ptr = dmabuf->vmap_ptr; +BUG_ON (dma_buf_map_is_null (&dmabuf->vmap_ptr)); + ptr = dmabuf->vmap_ptr.vaddr; goto out_unlock; } -BUG_ON (dmabuf->vmap_ptr); +BUG_ON (dma_buf_map_is_set (&dmabuf->vmap_ptr)); ptr = dmabuf->ops->vmap (dmabuf);if (WARN_ON_ONCE (IS_ERR (ptr)))
@@ -1220,7 +1220,7 @@ void *dma_buf_vmap(struct dma_buf *dmabuf)if (!ptr) goto out_unlock; - dmabuf->vmap_ptr = ptr; + dmabuf->vmap_ptr.vaddr = ptr; dmabuf->vmapping_counter =1 ; out_unlock:
@@ -1239,15 +1239,15 @@ void dma_buf_vunmap(struct dma_buf *dmabuf, void *vaddr)if (WARN_ON (!dmabuf))return ; -BUG_ON (!dmabuf->vmap_ptr); +BUG_ON (dma_buf_map_is_null (&dmabuf->vmap_ptr));BUG_ON (dmabuf->vmapping_counter ==0 ); -BUG_ON (dmabuf->vmap_ptr != vaddr); +BUG_ON (!dma_buf_map_is_vaddr (&dmabuf->vmap_ptr, vaddr));mutex_lock (&dmabuf->lock);if (--dmabuf->vmapping_counter ==0 ) {if (dmabuf->ops->vunmap) dmabuf->ops->vunmap (dmabuf, vaddr); - dmabuf->vmap_ptr =NULL ; +dma_buf_map_clear (&dmabuf->vmap_ptr); }mutex_unlock (&dmabuf->lock); }
include/linux/dma-buf-map.h new file +82 -0
82 lines not on this page · raw message
include/linux/dma-buf.h +2 -1
@@ -13,6 +13,7 @@#ifndef __DMA_BUF_H__#define __DMA_BUF_H__ +#include <linux/dma-buf-map.h> #include <linux/file.h> #include <linux/err.h> #include <linux/scatterlist.h>
@@ -309,7 +310,7 @@ struct dma_buf {const struct dma_buf_ops *ops;struct mutex lock;unsigned vmapping_counter; -void *vmap_ptr; +struct dma_buf_map vmap_ptr;const char *exp_name;const char *name;spinlock_t name_lock;
Signature · 1 line
2.28.0
Thomas Zimmermann
maintainerPATCH v3 2/4 dma-buf: Use struct dma_buf_map in dma_buf_vmap() interfaces
In reply to Thomas ZimmermannThis patch updates dma_buf_vmap() and dma-buf's vmap callback to use struct dma_buf_map.
The interfaces used to return a buffer address. This address now gets stored in an instance of the structure that is given as an additional argument. The functions return an errno code on errors.
Users of the functions are updated accordingly. This is only an interface change. It is currently expected that dma-buf memory can be accessed with system memory load/store operations.
v3:
* update fastrpc driver (kernel test robot)
v2:
* always clear map parameter in dma_buf_vmap() (Daniel)
* include dma-buf-heaps and i915 selftests (kernel test robot)
--- drivers/dma-buf/dma-buf.c | 28 +++++++++++-------- drivers/dma-buf/heaps/heap-helpers.c | 8 ++++-- drivers/gpu/drm/drm_gem_cma_helper.c | 13 +++++---- drivers/gpu/drm/drm_gem_shmem_helper.c | 14 ++++++---- drivers/gpu/drm/drm_prime.c | 9 ++++-- drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c | 8 +++++- drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c | 11 ++++++-- .../drm/i915/gem/selftests/i915_gem_dmabuf.c | 12 ++++++-- .../gpu/drm/i915/gem/selftests/mock_dmabuf.c | 10 +++++-- drivers/gpu/drm/tegra/gem.c | 18 ++++++++---- .../common/videobuf2/videobuf2-dma-contig.c | 14 +++++++--- .../media/common/videobuf2/videobuf2-dma-sg.c | 16 +++++++---- .../common/videobuf2/videobuf2-vmalloc.c | 15 +++++++--- drivers/misc/fastrpc.c | 6 ++-- include/drm/drm_prime.h | 3 +- include/linux/dma-buf-map.h | 13 +++++++++ include/linux/dma-buf.h | 6 ++-- 17 files changed, 143 insertions(+), 61 deletions(-)
drivers/dma-buf/dma-buf.c +16 -12
@@ -1186,46 +1186,50 @@ EXPORT_SYMBOL_GPL(dma_buf_mmap);* dma_buf_vmap - Create virtual mapping for the buffer object into kernel * address space. Same restrictions as for vmap and friends apply. * @dmabuf: [in] buffer to vmap +* @map: [out] returns the vmap pointer * * This call may fail due to lack of virtual mapping address space. * These calls are optional in drivers. The intended use for them * is for mapping objects linear in kernel space for high use objects. * Please attempt to use kmap/kunmap before thinking about these interfaces. * -* Returns NULL on error. +* Returns 0 on success, or a negative errno code otherwise. */ -void *dma_buf_vmap (struct dma_buf *dmabuf) +int dma_buf_vmap (struct dma_buf *dmabuf,struct dma_buf_map *map) { -void *ptr; +struct dma_buf_map ptr; +int ret =0 ; + +dma_buf_map_clear (map);if (WARN_ON (!dmabuf)) -return NULL ; +return -EINVAL ;if (!dmabuf->ops->vmap) -return NULL ; +return -EINVAL ;mutex_lock (&dmabuf->lock);if (dmabuf->vmapping_counter) { dmabuf->vmapping_counter++;BUG_ON (dma_buf_map_is_null (&dmabuf->vmap_ptr)); - ptr = dmabuf->vmap_ptr.vaddr; + *map = dmabuf->vmap_ptr; goto out_unlock; }BUG_ON (dma_buf_map_is_set (&dmabuf->vmap_ptr)); - ptr = dmabuf->ops->vmap (dmabuf); -if (WARN_ON_ONCE (IS_ERR (ptr))) - ptr =NULL ; -if (!ptr) + ret = dmabuf->ops->vmap (dmabuf, &ptr); +if (WARN_ON_ONCE (ret)) goto out_unlock; - dmabuf->vmap_ptr.vaddr = ptr; + dmabuf->vmap_ptr = ptr; dmabuf->vmapping_counter =1 ; + *map = dmabuf->vmap_ptr; + out_unlock:mutex_unlock (&dmabuf->lock); -return ptr; +return ret; }EXPORT_SYMBOL_GPL (dma_buf_vmap);
drivers/dma-buf/heaps/heap-helpers.c +6 -2
@@ -235,7 +235,7 @@ static int dma_heap_dma_buf_end_cpu_access(struct dma_buf *dmabuf,return 0 ; } -static void *dma_heap_dma_buf_vmap (struct dma_buf *dmabuf) +static int dma_heap_dma_buf_vmap (struct dma_buf *dmabuf,struct dma_buf_map *map) {struct heap_helper_buffer *buffer = dmabuf->priv;void *vaddr;
@@ -244,7 +244,11 @@ static void *dma_heap_dma_buf_vmap(struct dma_buf *dmabuf) vaddr =dma_heap_buffer_vmap_get (buffer);mutex_unlock (&buffer->lock); -return vaddr; +if (!vaddr) +return -ENOMEM ; +dma_buf_map_set_vaddr (map, vaddr); + +return 0 ; }static void dma_heap_dma_buf_vunmap (struct dma_buf *dmabuf,void *vaddr)
drivers/gpu/drm/drm_gem_cma_helper.c +7 -6
@@ -617,22 +617,23 @@ drm_gem_cma_prime_import_sg_table_vmap(struct drm_device *dev, {struct drm_gem_cma_object *cma_obj;struct drm_gem_object *obj; -void *vaddr; +struct dma_buf_map map; +int ret; - vaddr =dma_buf_vmap (attach->dmabuf); -if (!vaddr) { + ret =dma_buf_vmap (attach->dmabuf, &map); +if (ret) {DRM_ERROR ("Failed to vmap PRIME buffer\n" ); -return ERR_PTR (-ENOMEM ); +return ERR_PTR (ret); } obj =drm_gem_cma_prime_import_sg_table (dev, attach, sgt);if (IS_ERR (obj)) { -dma_buf_vunmap (attach->dmabuf, vaddr); +dma_buf_vunmap (attach->dmabuf, map.vaddr);return obj; } cma_obj =to_drm_gem_cma_obj (obj); - cma_obj->vaddr = vaddr; + cma_obj->vaddr = map.vaddr;return obj; }
drivers/gpu/drm/drm_gem_shmem_helper.c +9 -5
@@ -261,13 +261,16 @@ EXPORT_SYMBOL(drm_gem_shmem_unpin);static void *drm_gem_shmem_vmap_locked (struct drm_gem_shmem_object *shmem) {struct drm_gem_object *obj = &shmem->base; -int ret; +struct dma_buf_map map; +int ret =0 ;if (shmem->vmap_use_count++ >0 )return shmem->vaddr;if (obj->import_attach) { - shmem->vaddr =dma_buf_vmap (obj->import_attach->dmabuf); + ret =dma_buf_vmap (obj->import_attach->dmabuf, &map); +if (!ret) + shmem->vaddr = map.vaddr; }else {pgprot_t prot =PAGE_KERNEL ;
@@ -279,11 +282,12 @@ static void *drm_gem_shmem_vmap_locked(struct drm_gem_shmem_object *shmem) prot =pgprot_writecombine (prot); shmem->vaddr =vmap (shmem->pages, obj->size >>PAGE_SHIFT ,VM_MAP , prot); +if (!shmem->vaddr) + ret = -ENOMEM ; } -if (!shmem->vaddr) { -DRM_DEBUG_KMS ("Failed to vmap pages\n" ); - ret = -ENOMEM ; +if (ret) { +DRM_DEBUG_KMS ("Failed to vmap pages, error %d\n" , ret); goto err_put_pages; }
drivers/gpu/drm/drm_prime.c +6 -3
@@ -663,22 +663,25 @@ EXPORT_SYMBOL(drm_gem_unmap_dma_buf);/** * drm_gem_dmabuf_vmap - dma_buf vmap implementation for GEM * @dma_buf: buffer to be mapped +* @map: the virtual address of the buffer * * Sets up a kernel virtual mapping. This can be used as the &dma_buf_ops.vmap * callback. Calls into &drm_gem_object_funcs.vmap for device specific handling. * * Returns the kernel virtual address or NULL on failure. */ -void *drm_gem_dmabuf_vmap (struct dma_buf *dma_buf) +int drm_gem_dmabuf_vmap (struct dma_buf *dma_buf,struct dma_buf_map *map) {struct drm_gem_object *obj = dma_buf->priv;void *vaddr; vaddr =drm_gem_vmap (obj);if (IS_ERR (vaddr)) - vaddr =NULL ; +return PTR_ERR (vaddr); -return vaddr; +dma_buf_map_set_vaddr (map, vaddr); + +return 0 ; }EXPORT_SYMBOL (drm_gem_dmabuf_vmap);
drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c +7 -1
@@ -85,9 +85,15 @@ static void etnaviv_gem_prime_release(struct etnaviv_gem_object *etnaviv_obj)static void *etnaviv_gem_prime_vmap_impl (struct etnaviv_gem_object *etnaviv_obj) { +struct dma_buf_map map; +int ret; +lockdep_assert_held (&etnaviv_obj->lock); -return dma_buf_vmap (etnaviv_obj->base.import_attach->dmabuf); + ret =dma_buf_vmap (etnaviv_obj->base.import_attach->dmabuf, &map); +if (ret) +return NULL ; +return map.vaddr; } static int etnaviv_gem_prime_mmap_obj(struct etnaviv_gem_object *etnaviv_obj,
drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c +9 -2
@@ -77,11 +77,18 @@ static void i915_gem_unmap_dma_buf(struct dma_buf_attachment *attachment,i915_gem_object_unpin_pages (obj); } -static void *i915_gem_dmabuf_vmap (struct dma_buf *dma_buf) +static int i915_gem_dmabuf_vmap (struct dma_buf *dma_buf,struct dma_buf_map *map) {struct drm_i915_gem_object *obj =dma_buf_to_obj (dma_buf); +void *vaddr; -return i915_gem_object_pin_map (obj,I915_MAP_WB ); + vaddr =i915_gem_object_pin_map (obj,I915_MAP_WB ); +if (IS_ERR (vaddr)) +return PTR_ERR (vaddr); + +dma_buf_map_set_vaddr (map, vaddr); + +return 0 ; }static void i915_gem_dmabuf_vunmap (struct dma_buf *dma_buf,void *vaddr)
drivers/gpu/drm/i915/gem/selftests/i915_gem_dmabuf.c +9 -3
@@ -82,6 +82,7 @@ static int igt_dmabuf_import(void *arg)struct drm_i915_gem_object *obj;struct dma_buf *dmabuf;void *obj_map, *dma_map; +struct dma_buf_map map;u32 pattern[] = {0 ,0xaa ,0xcc ,0x55 ,0xff };int err, i;
@@ -110,7 +111,8 @@ static int igt_dmabuf_import(void *arg) goto out_obj; } - dma_map =dma_buf_vmap (dmabuf); + err =dma_buf_vmap (dmabuf, &map); + dma_map = err ?NULL : map.vaddr;if (!dma_map) {pr_err ("dma_buf_vmap failed\n" ); err = -ENOMEM ;
@@ -163,6 +165,7 @@ static int igt_dmabuf_import_ownership(void *arg)struct drm_i915_private *i915 = arg;struct drm_i915_gem_object *obj;struct dma_buf *dmabuf; +struct dma_buf_map map;void *ptr;int err;
@@ -170,7 +173,8 @@ static int igt_dmabuf_import_ownership(void *arg)if (IS_ERR (dmabuf))return PTR_ERR (dmabuf); - ptr =dma_buf_vmap (dmabuf); + err =dma_buf_vmap (dmabuf, &map); + ptr = err ?NULL : map.vaddr;if (!ptr) {pr_err ("dma_buf_vmap failed\n" ); err = -ENOMEM ;
@@ -212,6 +216,7 @@ static int igt_dmabuf_export_vmap(void *arg)struct drm_i915_private *i915 = arg;struct drm_i915_gem_object *obj;struct dma_buf *dmabuf; +struct dma_buf_map map;void *ptr;int err;
@@ -228,7 +233,8 @@ static int igt_dmabuf_export_vmap(void *arg) }i915_gem_object_put (obj); - ptr =dma_buf_vmap (dmabuf); + err =dma_buf_vmap (dmabuf, &map); + ptr = err ?NULL : map.vaddr;if (!ptr) {pr_err ("dma_buf_vmap failed\n" ); err = -ENOMEM ;
drivers/gpu/drm/i915/gem/selftests/mock_dmabuf.c +8 -2
@@ -61,11 +61,17 @@ static void mock_dmabuf_release(struct dma_buf *dma_buf)kfree (mock); } -static void *mock_dmabuf_vmap (struct dma_buf *dma_buf) +static int mock_dmabuf_vmap (struct dma_buf *dma_buf,struct dma_buf_map *map) {struct mock_dmabuf *mock =to_mock (dma_buf); +void *vaddr; -return vm_map_ram (mock->pages, mock->npages,0 ); + vaddr =vm_map_ram (mock->pages, mock->npages,0 ); +if (!vaddr) +return -ENOMEM ; +dma_buf_map_set_vaddr (map, vaddr); + +return 0 ; }static void mock_dmabuf_vunmap (struct dma_buf *dma_buf,void *vaddr)
drivers/gpu/drm/tegra/gem.c +12 -6
@@ -132,14 +132,18 @@ static void tegra_bo_unpin(struct device *dev, struct sg_table *sgt)static void *tegra_bo_mmap (struct host1x_bo *bo) {struct tegra_bo *obj =host1x_to_tegra_bo (bo); +struct dma_buf_map map; +int ret; -if (obj->vaddr) +if (obj->vaddr) {return obj->vaddr; -else if (obj->gem.import_attach) -return dma_buf_vmap (obj->gem.import_attach->dmabuf); -else + }else if (obj->gem.import_attach) { + ret =dma_buf_vmap (obj->gem.import_attach->dmabuf, &map); +return ret ?NULL : map.vaddr; + }else {return vmap (obj->pages, obj->num_pages,VM_MAP ,pgprot_writecombine (PAGE_KERNEL )); + } }static void tegra_bo_munmap (struct host1x_bo *bo,void *addr)
@@ -642,12 +646,14 @@ static int tegra_gem_prime_mmap(struct dma_buf *buf, struct vm_area_struct *vma)return __tegra_gem_mmap (gem, vma); } -static void *tegra_gem_prime_vmap (struct dma_buf *buf) +static int tegra_gem_prime_vmap (struct dma_buf *buf,struct dma_buf_map *map) {struct drm_gem_object *gem = buf->priv;struct tegra_bo *bo =to_tegra_bo (gem); -return bo->vaddr; +dma_buf_map_set_vaddr (map, bo->vaddr); + +return 0 ; }static void tegra_gem_prime_vunmap (struct dma_buf *buf,void *vaddr)
drivers/media/common/videobuf2/videobuf2-dma-contig.c +10 -4
@@ -81,9 +81,13 @@ static void *vb2_dc_cookie(void *buf_priv)static void *vb2_dc_vaddr (void *buf_priv) {struct vb2_dc_buf *buf = buf_priv; +struct dma_buf_map map; +int ret; -if (!buf->vaddr && buf->db_attach) - buf->vaddr =dma_buf_vmap (buf->db_attach->dmabuf); +if (!buf->vaddr && buf->db_attach) { + ret =dma_buf_vmap (buf->db_attach->dmabuf, &map); + buf->vaddr = ret ?NULL : map.vaddr; + }return buf->vaddr; }
@@ -365,11 +369,13 @@ vb2_dc_dmabuf_ops_end_cpu_access(struct dma_buf *dbuf,return 0 ; } -static void *vb2_dc_dmabuf_ops_vmap (struct dma_buf *dbuf) +static int vb2_dc_dmabuf_ops_vmap (struct dma_buf *dbuf,struct dma_buf_map *map) {struct vb2_dc_buf *buf = dbuf->priv; -return buf->vaddr; +dma_buf_map_set_vaddr (map, buf->vaddr); + +return 0 ; } static int vb2_dc_dmabuf_ops_mmap(struct dma_buf *dbuf,
drivers/media/common/videobuf2/videobuf2-dma-sg.c +11 -5
@@ -300,14 +300,18 @@ static void vb2_dma_sg_put_userptr(void *buf_priv)static void *vb2_dma_sg_vaddr (void *buf_priv) {struct vb2_dma_sg_buf *buf = buf_priv; +struct dma_buf_map map; +int ret;BUG_ON (!buf);if (!buf->vaddr) { -if (buf->db_attach) - buf->vaddr =dma_buf_vmap (buf->db_attach->dmabuf); -else +if (buf->db_attach) { + ret =dma_buf_vmap (buf->db_attach->dmabuf, &map); + buf->vaddr = ret ?NULL : map.vaddr; + }else { buf->vaddr =vm_map_ram (buf->pages, buf->num_pages,-1 ); + } }/* add offset in case userptr is not page-aligned */
@@ -489,11 +493,13 @@ vb2_dma_sg_dmabuf_ops_end_cpu_access(struct dma_buf *dbuf,return 0 ; } -static void *vb2_dma_sg_dmabuf_ops_vmap (struct dma_buf *dbuf) +static int vb2_dma_sg_dmabuf_ops_vmap (struct dma_buf *dbuf,struct dma_buf_map *map) {struct vb2_dma_sg_buf *buf = dbuf->priv; -return vb2_dma_sg_vaddr (buf); +dma_buf_map_set_vaddr (map, buf->vaddr); + +return 0 ; } static int vb2_dma_sg_dmabuf_ops_mmap(struct dma_buf *dbuf,
drivers/media/common/videobuf2/videobuf2-vmalloc.c +11 -4
@@ -318,11 +318,13 @@ static void vb2_vmalloc_dmabuf_ops_release(struct dma_buf *dbuf)vb2_vmalloc_put (dbuf->priv); } -static void *vb2_vmalloc_dmabuf_ops_vmap (struct dma_buf *dbuf) +static int vb2_vmalloc_dmabuf_ops_vmap (struct dma_buf *dbuf,struct dma_buf_map *map) {struct vb2_vmalloc_buf *buf = dbuf->priv; -return buf->vaddr; +dma_buf_map_set_vaddr (map, buf->vaddr); + +return 0 ; } static int vb2_vmalloc_dmabuf_ops_mmap(struct dma_buf *dbuf,
@@ -374,10 +376,15 @@ static struct dma_buf *vb2_vmalloc_get_dmabuf(void *buf_priv, unsigned long flagstatic int vb2_vmalloc_map_dmabuf (void *mem_priv) {struct vb2_vmalloc_buf *buf = mem_priv; +struct dma_buf_map map; +int ret; - buf->vaddr =dma_buf_vmap (buf->dbuf); + ret =dma_buf_vmap (buf->dbuf, &map); +if (ret) +return -EFAULT ; + buf->vaddr = map.vaddr; -return buf->vaddr ?0 : -EFAULT ; +return 0 ; }static void vb2_vmalloc_unmap_dmabuf (void *mem_priv)
drivers/misc/fastrpc.c +4 -2
@@ -581,11 +581,13 @@ static void fastrpc_dma_buf_detatch(struct dma_buf *dmabuf,kfree (a); } -static void *fastrpc_vmap (struct dma_buf *dmabuf) +static int fastrpc_vmap (struct dma_buf *dmabuf,struct dma_buf_map *map) {struct fastrpc_buf *buf = dmabuf->priv; -return buf->virt; +dma_buf_map_set_vaddr (map, buf->virt); + +return 0 ; } static int fastrpc_mmap(struct dma_buf *dmabuf,
include/drm/drm_prime.h +2 -1
@@ -54,6 +54,7 @@ struct device;struct dma_buf_export_info ;struct dma_buf ;struct dma_buf_attachment ; +struct dma_buf_map ;enum dma_data_direction ;
@@ -82,7 +83,7 @@ struct sg_table *drm_gem_map_dma_buf(struct dma_buf_attachment *attach,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); +int drm_gem_dmabuf_vmap (struct dma_buf *dma_buf,struct dma_buf_map *map);void drm_gem_dmabuf_vunmap (struct dma_buf *dma_buf,void *vaddr);int drm_gem_prime_mmap (struct drm_gem_object *obj,struct vm_area_struct *vma);
include/linux/dma-buf-map.h +13 -0
@@ -23,6 +23,19 @@ struct dma_buf_map {bool is_iomem; }; +/** +* dma_buf_map_set_vaddr - Sets a dma-buf mapping structure to an address in system memory +* @map: The dma-buf mapping structure +* @vaddr: A system-memory address +* +* Sets the address and clears the I/O-memory flag. +*/ +static inline void dma_buf_map_set_vaddr (struct dma_buf_map *map,void *vaddr) +{ + map->vaddr = vaddr; + map->is_iomem = false; +} +/* API transition helper */ static inline bool dma_buf_map_is_vaddr (const struct dma_buf_map *map,const void *vaddr) {
include/linux/dma-buf.h +3 -3
@@ -266,7 +266,7 @@ struct dma_buf_ops {*/ int (*mmap)(struct dma_buf *,struct vm_area_struct *vma); -void *(*vmap)(struct dma_buf *); +int (*vmap)(struct dma_buf *dmabuf,struct dma_buf_map *map);void (*vunmap)(struct dma_buf *,void *vaddr); };
@@ -503,6 +503,6 @@ int dma_buf_end_cpu_access(struct dma_buf *dma_buf,int dma_buf_mmap (struct dma_buf *,struct vm_area_struct *,unsigned long ); -void *dma_buf_vmap (struct dma_buf *); -void dma_buf_vunmap (struct dma_buf *,void *vaddr); +int dma_buf_vmap (struct dma_buf *dmabuf,struct dma_buf_map *map); +void dma_buf_vunmap (struct dma_buf *dmabuf,void *vaddr);#endif /* __DMA_BUF_H__ */
Signature · 1 line
2.28.0
Thomas Zimmermann
maintainerPATCH v3 3/4 dma-buf: Use struct dma_buf_map in dma_buf_vunmap() interfaces
In reply to Thomas ZimmermannThis patch updates dma_buf_vunmap() and dma-buf's vunmap callback to use struct dma_buf_map. The interfaces used to receive a buffer address. This address is now given in an instance of the structure.
Users of the functions are updated accordingly. This is only an interface change. It is currently expected that dma-buf memory can be accessed with system memory load/store operations.
v2:
* include dma-buf-heaps and i915 selftests (kernel test robot)
* initialize cma_obj before using it in drm_gem_cma_free_object() (kernel test robot)
--- drivers/dma-buf/dma-buf.c | 8 ++--- drivers/dma-buf/heaps/heap-helpers.c | 2 +- drivers/gpu/drm/drm_gem_cma_helper.c | 9 +++--- drivers/gpu/drm/drm_gem_shmem_helper.c | 3 +- drivers/gpu/drm/drm_prime.c | 6 ++-- drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c | 5 +-- drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c | 2 +- .../drm/i915/gem/selftests/i915_gem_dmabuf.c | 6 ++-- .../gpu/drm/i915/gem/selftests/mock_dmabuf.c | 4 +-- drivers/gpu/drm/tegra/gem.c | 5 +-- .../common/videobuf2/videobuf2-dma-contig.c | 3 +- .../media/common/videobuf2/videobuf2-dma-sg.c | 3 +- .../common/videobuf2/videobuf2-vmalloc.c | 6 ++-- include/drm/drm_prime.h | 2 +- include/linux/dma-buf-map.h | 32 +++++++++++++++++-- include/linux/dma-buf.h | 4 +-- 16 files changed, 66 insertions(+), 34 deletions(-)
drivers/dma-buf/dma-buf.c +4 -4
@@ -1236,21 +1236,21 @@ EXPORT_SYMBOL_GPL(dma_buf_vmap);/** * dma_buf_vunmap - Unmap a vmap obtained by dma_buf_vmap. * @dmabuf: [in] buffer to vunmap -* @vaddr: [in] vmap to vunmap +* @map: [in] vmap pointer to vunmap */ -void dma_buf_vunmap (struct dma_buf *dmabuf,void *vaddr) +void dma_buf_vunmap (struct dma_buf *dmabuf,struct dma_buf_map *map) {if (WARN_ON (!dmabuf))return ;BUG_ON (dma_buf_map_is_null (&dmabuf->vmap_ptr));BUG_ON (dmabuf->vmapping_counter ==0 ); -BUG_ON (!dma_buf_map_is_vaddr (&dmabuf->vmap_ptr, vaddr)); +BUG_ON (!dma_buf_map_is_equal (&dmabuf->vmap_ptr, map));mutex_lock (&dmabuf->lock);if (--dmabuf->vmapping_counter ==0 ) {if (dmabuf->ops->vunmap) - dmabuf->ops->vunmap (dmabuf, vaddr); + dmabuf->ops->vunmap (dmabuf, map);dma_buf_map_clear (&dmabuf->vmap_ptr); }mutex_unlock (&dmabuf->lock);
drivers/dma-buf/heaps/heap-helpers.c +1 -1
@@ -251,7 +251,7 @@ static int dma_heap_dma_buf_vmap(struct dma_buf *dmabuf, struct dma_buf_map *mapreturn 0 ; } -static void dma_heap_dma_buf_vunmap (struct dma_buf *dmabuf,void *vaddr) +static void dma_heap_dma_buf_vunmap (struct dma_buf *dmabuf,struct dma_buf_map *map) {struct heap_helper_buffer *buffer = dmabuf->priv;
drivers/gpu/drm/drm_gem_cma_helper.c +4 -5
@@ -175,13 +175,12 @@ drm_gem_cma_create_with_handle(struct drm_file *file_priv,*/ void drm_gem_cma_free_object (struct drm_gem_object *gem_obj) { -struct drm_gem_cma_object *cma_obj; - - cma_obj =to_drm_gem_cma_obj (gem_obj); +struct drm_gem_cma_object *cma_obj =to_drm_gem_cma_obj (gem_obj); +struct dma_buf_map map =DMA_BUF_MAP_INIT_VADDR (cma_obj->vaddr);if (gem_obj->import_attach) {if (cma_obj->vaddr) -dma_buf_vunmap (gem_obj->import_attach->dmabuf, cma_obj->vaddr); +dma_buf_vunmap (gem_obj->import_attach->dmabuf, &map);drm_prime_gem_destroy (gem_obj, cma_obj->sgt); }else if (cma_obj->vaddr) { dma_free_wc(gem_obj->dev->dev, cma_obj->base.size,
@@ -628,7 +627,7 @@ drm_gem_cma_prime_import_sg_table_vmap(struct drm_device *dev, obj =drm_gem_cma_prime_import_sg_table (dev, attach, sgt);if (IS_ERR (obj)) { -dma_buf_vunmap (attach->dmabuf, map.vaddr); +dma_buf_vunmap (attach->dmabuf, &map);return obj; }
drivers/gpu/drm/drm_gem_shmem_helper.c +2 -1
@@ -337,6 +337,7 @@ EXPORT_SYMBOL(drm_gem_shmem_vmap);static void drm_gem_shmem_vunmap_locked (struct drm_gem_shmem_object *shmem) {struct drm_gem_object *obj = &shmem->base; +struct dma_buf_map map =DMA_BUF_MAP_INIT_VADDR (shmem->vaddr);if (WARN_ON_ONCE (!shmem->vmap_use_count))return ;
@@ -345,7 +346,7 @@ static void drm_gem_shmem_vunmap_locked(struct drm_gem_shmem_object *shmem)return ;if (obj->import_attach) -dma_buf_vunmap (obj->import_attach->dmabuf, shmem->vaddr); +dma_buf_vunmap (obj->import_attach->dmabuf, &map);else vunmap (shmem->vaddr);
drivers/gpu/drm/drm_prime.c +3 -3
@@ -688,16 +688,16 @@ 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 +* @map: the virtual address of the buffer * * Releases a kernel virtual mapping. This can be used as the * &dma_buf_ops.vunmap callback. Calls into &drm_gem_object_funcs.vunmap for device specific handling. */ -void drm_gem_dmabuf_vunmap (struct dma_buf *dma_buf,void *vaddr) +void drm_gem_dmabuf_vunmap (struct dma_buf *dma_buf,struct dma_buf_map *map) {struct drm_gem_object *obj = dma_buf->priv; -drm_gem_vunmap (obj, vaddr); +drm_gem_vunmap (obj, map->vaddr); }EXPORT_SYMBOL (drm_gem_dmabuf_vunmap);
drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c +3 -2
@@ -70,9 +70,10 @@ void etnaviv_gem_prime_unpin(struct drm_gem_object *obj)static void etnaviv_gem_prime_release (struct etnaviv_gem_object *etnaviv_obj) { +struct dma_buf_map map =DMA_BUF_MAP_INIT_VADDR (etnaviv_obj->vaddr); +if (etnaviv_obj->vaddr) -dma_buf_vunmap (etnaviv_obj->base.import_attach->dmabuf, - etnaviv_obj->vaddr); +dma_buf_vunmap (etnaviv_obj->base.import_attach->dmabuf, &map);/* Don't drop the pages for imported dmabuf, as they are not * ours, just free the array we allocated:
drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c +1 -1
@@ -91,7 +91,7 @@ static int i915_gem_dmabuf_vmap(struct dma_buf *dma_buf, struct dma_buf_map *mapreturn 0 ; } -static void i915_gem_dmabuf_vunmap (struct dma_buf *dma_buf,void *vaddr) +static void i915_gem_dmabuf_vunmap (struct dma_buf *dma_buf,struct dma_buf_map *map) {struct drm_i915_gem_object *obj =dma_buf_to_obj (dma_buf);
drivers/gpu/drm/i915/gem/selftests/i915_gem_dmabuf.c +3 -3
@@ -152,7 +152,7 @@ static int igt_dmabuf_import(void *arg) err =0 ; out_dma_map: -dma_buf_vunmap (dmabuf, dma_map); +dma_buf_vunmap (dmabuf, &map); out_obj:i915_gem_object_put (obj); out_dmabuf:
@@ -182,7 +182,7 @@ static int igt_dmabuf_import_ownership(void *arg) }memset (ptr,0xc5 ,PAGE_SIZE ); -dma_buf_vunmap (dmabuf, ptr); +dma_buf_vunmap (dmabuf, &map); obj =to_intel_bo (i915_gem_prime_import (&i915->drm, dmabuf));if (IS_ERR (obj)) {
@@ -250,7 +250,7 @@ static int igt_dmabuf_export_vmap(void *arg)memset (ptr,0xc5 , dmabuf->size); err =0 ; -dma_buf_vunmap (dmabuf, ptr); +dma_buf_vunmap (dmabuf, &map); out:dma_buf_put (dmabuf);return err;
drivers/gpu/drm/i915/gem/selftests/mock_dmabuf.c +2 -2
@@ -74,11 +74,11 @@ static int mock_dmabuf_vmap(struct dma_buf *dma_buf, struct dma_buf_map *map)return 0 ; } -static void mock_dmabuf_vunmap (struct dma_buf *dma_buf,void *vaddr) +static void mock_dmabuf_vunmap (struct dma_buf *dma_buf,struct dma_buf_map *map) {struct mock_dmabuf *mock =to_mock (dma_buf); -vm_unmap_ram (vaddr, mock->npages); +vm_unmap_ram (map->vaddr, mock->npages); }static int mock_dmabuf_mmap (struct dma_buf *dma_buf,struct vm_area_struct *vma)
drivers/gpu/drm/tegra/gem.c +3 -2
@@ -149,11 +149,12 @@ static void *tegra_bo_mmap(struct host1x_bo *bo)static void tegra_bo_munmap (struct host1x_bo *bo,void *addr) {struct tegra_bo *obj =host1x_to_tegra_bo (bo); +struct dma_buf_map map =DMA_BUF_MAP_INIT_VADDR (addr);if (obj->vaddr)return ;else if (obj->gem.import_attach) -dma_buf_vunmap (obj->gem.import_attach->dmabuf, addr); +dma_buf_vunmap (obj->gem.import_attach->dmabuf, &map);else vunmap (addr); }
@@ -656,7 +657,7 @@ static int tegra_gem_prime_vmap(struct dma_buf *buf, struct dma_buf_map *map)return 0 ; } -static void tegra_gem_prime_vunmap (struct dma_buf *buf,void *vaddr) +static void tegra_gem_prime_vunmap (struct dma_buf *buf,struct dma_buf_map *map) { }
drivers/media/common/videobuf2/videobuf2-dma-contig.c +2 -1
@@ -648,6 +648,7 @@ static void vb2_dc_unmap_dmabuf(void *mem_priv) {struct vb2_dc_buf *buf = mem_priv;struct sg_table *sgt = buf->dma_sgt; +struct dma_buf_map map =DMA_BUF_MAP_INIT_VADDR (buf->vaddr);if (WARN_ON (!buf->db_attach)) {pr_err ("trying to unpin a not attached buffer\n" );
@@ -660,7 +661,7 @@ static void vb2_dc_unmap_dmabuf(void *mem_priv) }if (buf->vaddr) { -dma_buf_vunmap (buf->db_attach->dmabuf, buf->vaddr); +dma_buf_vunmap (buf->db_attach->dmabuf, &map); buf->vaddr =NULL ; }dma_buf_unmap_attachment (buf->db_attach, sgt, buf->dma_dir);
drivers/media/common/videobuf2/videobuf2-dma-sg.c +2 -1
@@ -580,6 +580,7 @@ static void vb2_dma_sg_unmap_dmabuf(void *mem_priv) {struct vb2_dma_sg_buf *buf = mem_priv;struct sg_table *sgt = buf->dma_sgt; +struct dma_buf_map map =DMA_BUF_MAP_INIT_VADDR (buf->vaddr);if (WARN_ON (!buf->db_attach)) {pr_err ("trying to unpin a not attached buffer\n" );
@@ -592,7 +593,7 @@ static void vb2_dma_sg_unmap_dmabuf(void *mem_priv) }if (buf->vaddr) { -dma_buf_vunmap (buf->db_attach->dmabuf, buf->vaddr); +dma_buf_vunmap (buf->db_attach->dmabuf, &map); buf->vaddr =NULL ; }dma_buf_unmap_attachment (buf->db_attach, sgt, buf->dma_dir);
drivers/media/common/videobuf2/videobuf2-vmalloc.c +4 -2
@@ -390,17 +390,19 @@ static int vb2_vmalloc_map_dmabuf(void *mem_priv)static void vb2_vmalloc_unmap_dmabuf (void *mem_priv) {struct vb2_vmalloc_buf *buf = mem_priv; +struct dma_buf_map map =DMA_BUF_MAP_INIT_VADDR (buf->vaddr); -dma_buf_vunmap (buf->dbuf, buf->vaddr); +dma_buf_vunmap (buf->dbuf, &map); buf->vaddr =NULL ; }static void vb2_vmalloc_detach_dmabuf (void *mem_priv) {struct vb2_vmalloc_buf *buf = mem_priv; +struct dma_buf_map map =DMA_BUF_MAP_INIT_VADDR (buf->vaddr);if (buf->vaddr) -dma_buf_vunmap (buf->dbuf, buf->vaddr); +dma_buf_vunmap (buf->dbuf, &map);kfree (buf); }
include/drm/drm_prime.h +1 -1
@@ -84,7 +84,7 @@ void drm_gem_unmap_dma_buf(struct dma_buf_attachment *attach,struct sg_table *sgt, enum dma_data_direction dir);int drm_gem_dmabuf_vmap (struct dma_buf *dma_buf,struct dma_buf_map *map); -void drm_gem_dmabuf_vunmap (struct dma_buf *dma_buf,void *vaddr); +void drm_gem_dmabuf_vunmap (struct dma_buf *dma_buf,struct dma_buf_map *map);int drm_gem_prime_mmap (struct drm_gem_object *obj,struct vm_area_struct *vma);int drm_gem_dmabuf_mmap (struct dma_buf *dma_buf,struct vm_area_struct *vma);
include/linux/dma-buf-map.h +29 -3
@@ -23,6 +23,16 @@ struct dma_buf_map {bool is_iomem; }; +/** +* DMA_BUF_MAP_INIT_VADDR - Initializes struct dma_buf_map to an address in system memory +* @vaddr: A system-memory address +*/ +#define DMA_BUF_MAP_INIT_VADDR (vaddr_) \ + { \ + .vaddr = (vaddr_), \ + .is_iomem = false, \ + } +/** * dma_buf_map_set_vaddr - Sets a dma-buf mapping structure to an address in system memory * @map: The dma-buf mapping structure
@@ -36,10 +46,26 @@ static inline void dma_buf_map_set_vaddr(struct dma_buf_map *map, void *vaddr) map->is_iomem = false; } -/* API transition helper */ -static inline bool dma_buf_map_is_vaddr (const struct dma_buf_map *map,const void *vaddr) +/** +* dma_buf_map_is_equal - Compares two dma-buf mapping structures for equality +* @lhs: The dma-buf mapping structure +* @rhs: A dma-buf mapping structure to compare with +* +* Two dma-buf mapping structures are equal if they both refer to the same type of memory +* and to the same address within that memory. +* +* Returns: +* True is both structures are equal, or false otherwise. +*/ +static inline bool dma_buf_map_is_equal (const struct dma_buf_map *lhs, +const struct dma_buf_map *rhs) { -return !map->is_iomem && (map->vaddr == vaddr); +if (lhs->is_iomem != rhs->is_iomem) +return false; +else if (lhs->is_iomem) +return lhs->vaddr_iomem == rhs->vaddr_iomem; +else +return lhs->vaddr == rhs->vaddr; }/**
include/linux/dma-buf.h +2 -2
@@ -267,7 +267,7 @@ struct dma_buf_ops {int (*mmap)(struct dma_buf *,struct vm_area_struct *vma);int (*vmap)(struct dma_buf *dmabuf,struct dma_buf_map *map); -void (*vunmap)(struct dma_buf *,void *vaddr); +void (*vunmap)(struct dma_buf *dmabuf,struct dma_buf_map *map); };/**
@@ -504,5 +504,5 @@ int dma_buf_end_cpu_access(struct dma_buf *dma_buf,int dma_buf_mmap (struct dma_buf *,struct vm_area_struct *,unsigned long );int dma_buf_vmap (struct dma_buf *dmabuf,struct dma_buf_map *map); -void dma_buf_vunmap (struct dma_buf *dmabuf,void *vaddr); +void dma_buf_vunmap (struct dma_buf *dmabuf,struct dma_buf_map *map);#endif /* __DMA_BUF_H__ */
Signature · 1 line
2.28.0
Thomas Zimmermann
maintainerPATCH v3 4/4 dma-buf: Document struct dma_buf_map
In reply to Thomas ZimmermannThis patch adds struct dma_buf_map and its helpers to the documentation. A short tutorial is included.
v3:
* update documentation in a separate patch
* expand docs (Daniel)
* carry-over acks from patch 1
--- Documentation/driver-api/dma-buf.rst | 9 ++++ include/linux/dma-buf-map.h | 72 ++++++++++++++++++++++++++++ 2 files changed, 81 insertions(+)
Documentation/driver-api/dma-buf.rst +9 -0
@@ -115,6 +115,15 @@ Kernel Functions and Structures Reference .. kernel-doc:: include/linux/dma-buf.h :internal: +Buffer Mapping Helpers +~~~~~~~~~~~~~~~~~~~~~~ + +.. kernel-doc:: include/linux/dma-buf-map.h + :doc: overview + +.. kernel-doc:: include/linux/dma-buf-map.h + :internal: + Reservation Objects -------------------
include/linux/dma-buf-map.h +72 -0
78 lines not on this page · raw message
Signature · 1 line
2.28.0
Patchwork
CI[Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for dma-buf: Flag vmap'ed memory as system or I/O memory (rev3)
In reply to Thomas Zimmermann== Series Details ==
== Series Details ==
Series: dma-buf: Flag vmap'ed memory as system or I/O memory (rev3)
URL : https://patchwork.freedesktop.org/series/81647/
State : warning
== Summary ==
$ dim checkpatch origin/drm-tip c94eaf86e18e dma-buf: Add struct dma-buf-map for storing struct dma_buf.vaddr_ptr -:47: WARNING:AVOID_BUG: Avoid crashing the kernel - try using WARN_ON & recovery code rather than BUG() or BUG_ON() #47: FILE: drivers/dma-buf/dma-buf.c:1212: + BUG_ON(dma_buf_map_is_null(&dmabuf->vmap_ptr));
-:53: WARNING:AVOID_BUG: Avoid crashing the kernel - try using WARN_ON & recovery code rather than BUG() or BUG_ON() #53: FILE: drivers/dma-buf/dma-buf.c:1217:
+ BUG_ON(dma_buf_map_is_set(&dmabuf->vmap_ptr));
-:71: WARNING:AVOID_BUG: Avoid crashing the kernel - try using WARN_ON & recovery code rather than BUG() or BUG_ON() #71: FILE: drivers/dma-buf/dma-buf.c:1244:
+ BUG_ON(dma_buf_map_is_null(&dmabuf->vmap_ptr));
-:74: WARNING:AVOID_BUG: Avoid crashing the kernel - try using WARN_ON & recovery code rather than BUG() or BUG_ON() #74: FILE: drivers/dma-buf/dma-buf.c:1246:
+ BUG_ON(!dma_buf_map_is_vaddr(&dmabuf->vmap_ptr, vaddr));
-:86: WARNING:FILE_PATH_CHANGES: added, moved or deleted file(s), does MAINTAINERS need updating? #86:
new file mode 100644
total: 0 errors, 5 warnings, 0 checks, 138 lines checked55973e093508 dma-buf: Use struct dma_buf_map in dma_buf_vmap() interfacesc929afc2d68f dma-buf: Use struct dma_buf_map in dma_buf_vunmap() interfaces
-:48: WARNING:AVOID_BUG: Avoid crashing the kernel - try using WARN_ON & recovery code rather than BUG() or BUG_ON() #48: FILE: drivers/dma-buf/dma-buf.c:1250:
+ BUG_ON(!dma_buf_map_is_equal(&dmabuf->vmap_ptr, map));
total: 0 errors, 1 warnings, 0 checks, 287 lines checked 993652ae5805 dma-buf: Document struct dma_buf_map
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI[Intel-gfx] ✗ Fi.CI.SPARSE: warning for dma-buf: Flag vmap'ed memory as system or I/O memory (rev3)
In reply to Thomas Zimmermann== Series Details ==
== Series Details ==
Series: dma-buf: Flag vmap'ed memory as system or I/O memory (rev3)
URL : https://patchwork.freedesktop.org/series/81647/
State : warning
== Summary ==
$ dim sparse --fast origin/drm-tip Sparse version: v0.6.2 Fast mode used, each commit won't be checked separately. - +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:1019:47: expected unsigned int [addressable] [usertype] ulClockParams +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:1019:47: got restricted __le32 [usertype] +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:1019:47: warning: incorrect type in assignment (different base types) +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:1028:50: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:1029:49: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:1037:47: warning: too many warnings +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:184:44: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:283:14: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:320:14: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:323:14: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:326:14: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:329:18: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:330:26: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:338:30: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:340:38: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:342:30: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:346:30: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:348:30: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:353:33: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:367:43: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:369:38: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:374:67: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:375:53: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:378:66: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:389:80: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:395:57: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:402:69: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:403:53: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:406:66: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:414:66: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:423:69: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:424:69: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:473:30: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:476:45: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:477:45: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:484:54: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:52:28: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:531:35: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:53:29: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:533:25: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:54:26: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:55:27: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:56:25: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:57:26: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:577:21: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:581:25: warning: cast to restricted __le32 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:58:25: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:583:21: warning: cast to restricted __le32 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:586:25: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:590:25: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:59:26: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:598:21: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:600:21: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:617:25: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:621:21: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:623:21: warning: cast to restricted __le32 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:630:21: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:632:21: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:644:25: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:648:21: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:650:21: warning: cast to restricted __le32 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:657:21: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:659:21: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:662:21: warning: cast to restricted __le32 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:664:21: warning: cast to restricted __le32 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:676:25: warning: cast to restricted __le32 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:688:25: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:691:47: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:697:25: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:796:46: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:797:40: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:800:46: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:801:40: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:804:46: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:805:40: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:812:46: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:813:40: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:816:46: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:817:40: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:820:46: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:821:40: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:828:46: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:829:40: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:832:46: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:833:40: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:836:46: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:837:40: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:844:46: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:845:40: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:848:46: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:849:40: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:852:46: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:853:40: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:916:47: warning: cast to restricted __le32 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:918:49: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:920:52: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:934:47: warning: cast to restricted __le32 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:936:49: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:938:52: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:956:47: warning: cast to restricted __le32 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:958:49: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:960:52: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c:328:34: warning: cast to restricted __le32 +drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c:365:34: warning: cast to restricted __le32 +drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c:395:25: warning: cast to restricted __le32 +drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c:397:25: warning: cast to restricted __le32 +drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c:404:25: warning: cast to restricted __le32 +drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c:418:40: warning: cast to restricted __le32 +drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c:441:40: warning: cast to restricted __le32 +drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c:44:21: warning: cast to restricted __le32 +drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c:482:53: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c:486:33: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c:489:61: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c:490:64: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c:492:54: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c:518:17: warning: cast to restricted __le32 +drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c:521:21: warning: cast to restricted __le32 +drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c:64:25: warning: cast to restricted __le32 +drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c:80:17: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c:80:17: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c:80:17: warning: cast to restricted __le32 +drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c:85:30: warning: cast to restricted __le32 +drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c:86:24: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c:98:39: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c:222:29: warning: cast to restricted __le32 +drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c:226:37: warning: cast to restricted __le32 +drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c:226:37: warning: cast to restricted __le32 +drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c:226:37: warning: cast to restricted __le32 +drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c:227:37: warning: cast to restricted __le32 +drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c:233:43: warning: cast to restricted __le32 +drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c:236:44: warning: cast to restricted __le32 +drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c:239:51: warning: cast to restricted __le32 +drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c:458:41: warning: cast to restricted __le32 +drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c:458:41: warning: cast to restricted __le32 +drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c:458:41: warning: cast to restricted __le32 +drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c:464:39: warning: cast to restricted __le32 +drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c:465:30: warning: cast to restricted __le32 +drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c:466:39: warning: cast to restricted __le32 +drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c:468:24: warning: cast to restricted __le32 +drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c:140:26: expected unsigned long long [usertype] *chunk_array_user +drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c:140:26: got void [noderef] __user * +drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c:140:26: warning: incorrect type in assignment (different address spaces) +drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c:141:41: expected void const [noderef] __user *from +drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c:141:41: got unsigned long long [usertype] *chunk_array_user +drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c:141:41: warning: incorrect type in argument 2 (different address spaces) +drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c:160:27: expected struct drm_amdgpu_cs_chunk [noderef] __user **chunk_ptr +drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c:160:27: got void [noderef] __user * +drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c:160:27: warning: incorrect type in assignment (different address spaces) +drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c:161:49: expected void const [noderef] __user *from +drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c:161:49: got struct drm_amdgpu_cs_chunk [noderef] __user **chunk_ptr +drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c:161:49: warning: incorrect type in argument 2 (different address spaces) +drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c:1624:21: expected struct drm_amdgpu_fence *fences_user +drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c:1624:21: got void [noderef] __user * +drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c:1624:21: warning: incorrect type in assignment (different address spaces) +drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c:1625:36: expected void const [noderef] __user *from +drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c:1625:36: got struct drm_amdgpu_fence *fences_user +drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c:1625:36: warning: incorrect type in argument 2 (different address spaces) +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:1364:25: error: incompatible types in comparison expression (different address spaces): +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:1364:25: struct dma_fence * +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:1364:25: struct dma_fence [noderef] __rcu * +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:1365:17: error: incompatible types in comparison expression (different address spaces): +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:1365:17: struct dma_fence * +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:1365:17: struct dma_fence [noderef] __rcu * +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:1424:17: error: incompatible types in comparison expression (different address spaces): +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:1424:17: struct dma_fence * +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:1424:17: struct dma_fence [noderef] __rcu * +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:143:17: expected restricted __poll_t ( *poll )( ... ) +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:143:17: got unsigned int ( * )( ... ) +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:143:17: warning: incorrect type in initializer (different base types) +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:266:29: expected void const volatile [noderef] __user *ptr +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:266:29: got unsigned int [usertype] * +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:266:29: warning: cast removes address space '__user' of expression +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:266:29: warning: cast removes address space '__user' of expression +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:266:29: warning: cast removes address space '__user' of expression +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:266:29: warning: cast removes address space '__user' of expression +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:266:29: warning: cast removes address space '__user' of expression +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:266:29: warning: cast removes address space '__user' of expression +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:266:29: warning: cast removes address space '__user' of expression +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:266:29: warning: cast removes address space '__user' of expression +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:266:29: warning: cast removes address space '__user' of expression +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:266:29: warning: cast removes address space '__user' of expression +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:266:29: warning: cast removes address space '__user' of expression +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:266:29: warning: cast removes address space '__user' of expression +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:266:29: warning: cast removes address space '__user' of expression +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:266:29: warning: incorrect type in argument 1 (different address spaces) +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:268:29: expected void const volatile [noderef] __user *ptr +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:268:29: got unsigned int [usertype] * +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:268:29: warning: cast removes address space '__user' of expression +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:268:29: warning: cast removes address space '__user' of expression +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:268:29: warning: cast removes address space '__user' of expression +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:268:29: warning: cast removes address space '__user' of expression +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:268:29: warning: cast removes address space '__user' of expression +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:268:29: warning: cast removes address space '__user' of expression +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:268:29: warning: cast removes address space '__user' of expression +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:268:29: warning: cast removes address space '__user' of expression +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:268:29: warning: incorrect type in argument 1 (different address spaces) +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:359:21: expected void const volatile [noderef] __user *ptr +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:359:21: got unsigned int [usertype] * +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:359:21: warning: cast removes address space '__user' of expression +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:359:21: warning: cast removes address space '__user' of expression +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:359:21: warning: cast removes address space '__user' of expression +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:359:21: warning: cast removes address space '__user' of expression +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:359:21: warning: cast removes address space '__user' of expression +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:359:21: warning: cast removes address space '__user' of expression +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:359:21: warning: cast removes address space '__user' of expression +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:359:21: warning: cast removes address space '__user' of expression +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:359:21: warning: cast removes address space '__user' of expression +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:359:21: warning: cast removes address space '__user' of expression +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:359:21: warning: cast removes address space '__user' of expression +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:359:21: warning: cast removes address space '__user' of expression +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:359:21: warning: cast removes address space '__user' of expression +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:359:21: warning: incorrect type in argument 1 (different address spaces) +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:417:21: expected void const volatile [noderef] __user *ptr +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:417:21: got unsigned int [usertype] * +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:417:21: warning: cast removes address space '__user' of expression +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:417:21: warning: cast removes address space '__user' of expression +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:417:21: warning: cast removes address space '__user' of expression +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:417:21: warning: cast removes address space '__user' of expression +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:417:21: warning: cast removes address space '__user' of expression +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:417:21: warning: cast removes address space '__user' of expression +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:417:21: warning: cast removes address space '__user' of expression +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:417:21: warning: cast removes address space '__user' of expression +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:417:21: warning: incorrect type in argument 1 (different address spaces) +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:478:21: expected void const volatile [noderef] __user *ptr +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:478:21: got unsigned int [usertype] * +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:478:21: warning: cast removes address space '__user' of expression +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:478:21: warning: cast removes address space '__user' of expression +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:478:21: warning: cast removes address space '__user' of expression +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:478:21: warning: cast removes address space '__user' of expression +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:478:21: warning: cast removes address space '__user' of expression +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:478:21: warning: cast removes address space '__user' of expression +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:478:21: warning: cast removes address space '__user' of expression +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:478:21: warning: cast removes address space '__user' of expression +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:478:21: warning: cast removes address space '__user' of expression +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:478:21: warning: cast removes address space '__user' of expression +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:478:21: warning: cast removes address space '__user' of expression +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:478:21: warning: cast removes address space '__user' of expression +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:478:21: warning: cast removes address space '__user' of expression +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:478:21: warning: incorrect type in argument 1 (different address spaces) +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:536:21: expected void const volatile [noderef] __user *ptr +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:536:21: got unsigned int [usertype] * +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:536:21: warning: cast removes address space '__user' of expression +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:536:21: warning: cast removes address space '__user' of expression +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:536:21: warning: cast removes address space '__user' of expression +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:536:21: warning: cast removes address space '__user' of expression +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:536:21: warning: cast removes address space '__user' of expression +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:536:21: warning: cast removes address space '__user' of expression +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:536:21: warning: cast removes address space '__user' of expression +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:536:21: warning: cast removes address space '__user' of expression +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:536:21: warning: incorrect type in argument 1 (different address spaces) +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:597:21: expected void const volatile [noderef] __user *ptr +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:597:21: got unsigned int [usertype] * +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:597:21: warning: cast removes address space '__user' of expression +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:597:21: warning: cast removes address space '__user' of expression +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:597:21: warning: cast removes address space '__user' of expression +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:597:21: warning: cast removes address space '__user' of expression +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:597:21: warning: cast removes address space '__user' of expression +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:597:21: warning: cast removes address space '__user' of expression +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:597:21: warning: cast removes address space '__user' of expression +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:597:21: warning: cast removes address space '__user' of expression +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:597:21: warning: cast removes address space '__user' of expression +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:597:21: warning: cast removes address space '__user' of expression +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:597:21: warning: cast removes address space '__user' of expression +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:597:21: warning: cast removes address space '__user' of expression +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:597:21: warning: cast removes address space '__user' of expression +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:597:21: warning: incorrect type in argument 1 (different address spaces) +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:655:21: expected void const volatile [noderef] __user *ptr +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:655:21: got unsigned int [usertype] * +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:655:21: warning: cast removes address space '__user' of expression +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:655:21: warning: cast removes address space '__user' of expression +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:655:21: warning: cast removes address space '__user' of expression +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:655:21: warning: cast removes address space '__user' of expression +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:655:21: warning: cast removes address space '__user' of expression +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:655:21: warning: cast removes address space '__user' of expression +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:655:21: warning: cast removes address space '__user' of expression +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:655:21: warning: cast removes address space '__user' of expression +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:655:21: warning: incorrect type in argument 1 (different address spaces) +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:752:21: expected void const volatile [noderef] __user *ptr +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:752:21: got unsigned int [usertype] * +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:752:21: warning: cast removes address space '__user' of expression +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:752:21: warning: cast removes address space '__user' of expression +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:752:21: warning: cast removes address space '__user' of expression +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:752:21: warning: cast removes address space '__user' of expression +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:752:21: warning: cast removes address space '__user' of expression +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:752:21: warning: incorrect type in argument 1 (different address spaces) +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:752:21: warning: too many warnings +drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:1735:65: warning: cast to restricted __le32 +drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:1743:55: warning: cast to restricted __le32 +drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:1744:50: warning: cast to restricted __le32 +drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:1745:50: warning: cast to restricted __le32 +drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:1746:56: warning: cast to restricted __le32 +drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:1748:25: warning: cast to restricted __le32 +drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:1749:45: warning: cast to restricted __le32 +drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:1750:51: warning: cast to restricted __le32 +drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:1751:55: warning: cast to restricted __le32 +drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:1752:57: warning: cast to restricted __le32 +drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:1754:25: warning: cast to restricted __le32 +drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:1755:53: warning: cast to restricted __le32 +drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:1757:25: warning: cast to restricted __le32 +drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:1759:25: warning: cast to restricted __le32 +drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:1760:46: warning: cast to restricted __le32 +drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:1764:73: warning: cast to restricted __le32 +drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:1766:33: warning: cast to restricted __le32 +drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:1768:33: warning: cast to restricted _
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI[Intel-gfx] ✓ Fi.CI.BAT: success for dma-buf: Flag vmap'ed memory as system or I/O memory (rev3)
In reply to Thomas Zimmermann== Series Details ==
== Series Details ==
Series: dma-buf: Flag vmap'ed memory as system or I/O memory (rev3)
URL : https://patchwork.freedesktop.org/series/81647/
State : success
== Summary ==
CI Bug Log - changes from CI_DRM_9056 -> Patchwork_18572
====================================================
Summary
-------
**SUCCESS**
No regressions found.
External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18572/index.html
Possible new issues
-------------------
Here are the unknown changes that may have been introduced in Patchwork_18572:
### IGT changes ###
#### Suppressed ####
The following results come from untrusted machines, tests, or statuses. They do not affect the overall result.
* igt@i915_selftest@live@gt_lrc:
- {fi-tgl-dsi}: [DMESG-FAIL][1] ([i915#2373]) -> [DMESG-FAIL][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9056/fi-tgl-dsi/igt@i915_selftest@live@gt_lrc.html
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18572/fi-tgl-dsi/igt@i915_selftest@live@gt_lrc.html
Known issues
------------
Here are the changes found in Patchwork_18572 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic:
- fi-kbl-r: [PASS][3] -> [DMESG-WARN][4] ([i915#1982])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9056/fi-kbl-r/igt@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18572/fi-kbl-r/igt@[email protected]
* igt@kms_cursor_legacy@basic-flip-before-cursor-atomic:
- fi-icl-u2: [PASS][5] -> [DMESG-WARN][6] ([i915#1982])
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9056/fi-icl-u2/igt@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18572/fi-icl-u2/igt@[email protected]
* igt@vgem_basic@unload:
- fi-skl-guc: [PASS][7] -> [DMESG-WARN][8] ([i915#2203])
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9056/fi-skl-guc/igt@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18572/fi-skl-guc/igt@[email protected]
#### Possible fixes ####
* igt@i915_pm_rpm@basic-pci-d3-state:
- fi-byt-j1900: [DMESG-WARN][9] ([i915#1982]) -> [PASS][10]
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9056/fi-byt-j1900/igt@[email protected]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18572/fi-byt-j1900/igt@[email protected]
* igt@kms_busy@basic@flip:
- {fi-tgl-dsi}: [DMESG-WARN][11] ([i915#1982]) -> [PASS][12]
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9056/fi-tgl-dsi/igt@kms_busy@[email protected]
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18572/fi-tgl-dsi/igt@kms_busy@[email protected]
* igt@kms_flip@basic-flip-vs-wf_vblank@b-edp1:
- fi-icl-u2: [DMESG-WARN][13] ([i915#1982]) -> [PASS][14]
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9056/fi-icl-u2/igt@kms_flip@[email protected]
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18572/fi-icl-u2/igt@kms_flip@[email protected]
#### Warnings ####
* igt@i915_pm_rpm@module-reload:
- fi-kbl-x1275: [DMESG-FAIL][15] ([i915#62]) -> [DMESG-FAIL][16] ([i915#62] / [i915#95])
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9056/fi-kbl-x1275/igt@[email protected]
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18572/fi-kbl-x1275/igt@[email protected]
- fi-skl-6700k2: [DMESG-WARN][17] ([i915#2203]) -> [INCOMPLETE][18] ([i915#151] / [i915#2203])
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9056/fi-skl-6700k2/igt@[email protected]
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18572/fi-skl-6700k2/igt@[email protected]
* igt@kms_cursor_legacy@basic-busy-flip-before-cursor-legacy:
- fi-kbl-x1275: [DMESG-WARN][19] ([i915#62] / [i915#92]) -> [DMESG-WARN][20] ([i915#62] / [i915#92] / [i915#95]) +3 similar issues
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9056/fi-kbl-x1275/igt@[email protected]
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18572/fi-kbl-x1275/igt@[email protected]
* igt@kms_force_connector_basic@prune-stale-modes:
- fi-kbl-x1275: [DMESG-WARN][21] ([i915#62] / [i915#92] / [i915#95]) -> [DMESG-WARN][22] ([i915#62] / [i915#92]) +4 similar issues
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9056/fi-kbl-x1275/igt@[email protected]
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18572/fi-kbl-x1275/igt@[email protected]
* igt@vgem_basic@unload:
- fi-kbl-x1275: [DMESG-WARN][23] ([i915#62] / [i915#92]) -> [DMESG-WARN][24] ([i915#95])
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9056/fi-kbl-x1275/igt@[email protected]
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18572/fi-kbl-x1275/igt@[email protected]
{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).
[i915#151]: https://gitlab.freedesktop.org/drm/intel/issues/151
[i915#1982]: https://gitlab.freedesktop.org/drm/intel/issues/1982
[i915#2203]: https://gitlab.freedesktop.org/drm/intel/issues/2203
[i915#2373]: https://gitlab.freedesktop.org/drm/intel/issues/2373
[i915#62]: https://gitlab.freedesktop.org/drm/intel/issues/62
[i915#92]: https://gitlab.freedesktop.org/drm/intel/issues/92
[i915#95]: https://gitlab.freedesktop.org/drm/intel/issues/95
Participating hosts (46 -> 39)
------------------------------
Missing (7): fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-ctg-p8600 fi-byt-clapper fi-bdw-samus
Build changes
-------------
* Linux: CI_DRM_9056 -> Patchwork_18572
CI-20190529: 20190529
CI_DRM_9056: 637f215bda901249b97da25ee2983f72cc12e1c5 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_5788: a7520973a210b7268c3039902789f433ee0f5ef7 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_18572: 993652ae5805d3b85fd6a344cc9b963821525e46 @ git://anongit.freedesktop.org/gfx-ci/linux
== Linux commits ==
993652ae5805 dma-buf: Document struct dma_buf_mapc929afc2d68f dma-buf: Use struct dma_buf_map in dma_buf_vunmap() interfaces 55973e093508 dma-buf: Use struct dma_buf_map in dma_buf_vmap() interfaces c94eaf86e18e dma-buf: Add struct dma-buf-map for storing struct dma_buf.vaddr_ptr
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18572/index.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI[Intel-gfx] ✗ Fi.CI.IGT: failure for dma-buf: Flag vmap'ed memory as system or I/O memory (rev3)
In reply to Thomas Zimmermann== Series Details ==
== Series Details ==
Series: dma-buf: Flag vmap'ed memory as system or I/O memory (rev3)
URL : https://patchwork.freedesktop.org/series/81647/
State : failure
== Summary ==
CI Bug Log - changes from CI_DRM_9056_full -> Patchwork_18572_full
====================================================
Summary
-------
**FAILURE**
Serious unknown changes coming with Patchwork_18572_full absolutely need to be verified manually.
If you think the reported changes have nothing to do with the changes introduced in Patchwork_18572_full, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.
Possible new issues
-------------------
Here are the unknown changes that may have been introduced in Patchwork_18572_full:
### Piglit changes ###
#### Possible regressions ####
* spec@arb_texture_multisample@texelfetch@2-gs-isampler2dms (NEW):
- pig-snb-2600: NOTRUN -> [FAIL][1]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18572/pig-snb-2600/spec@arb_texture_multisample@[email protected]
New tests
---------
New tests have been introduced between CI_DRM_9056_full and Patchwork_18572_full:
### New Piglit tests (1) ###
* spec@arb_texture_multisample@texelfetch@2-gs-isampler2dms:
- Statuses : 1 fail(s)
- Exec time: [0.14] s
Known issues
------------
Here are the changes found in Patchwork_18572_full that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@gem_exec_reloc@basic-many-active@vcs0:
- shard-glk: [PASS][2] -> [FAIL][3] ([i915#2389]) +1 similar issue
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9056/shard-glk6/igt@gem_exec_reloc@[email protected]
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18572/shard-glk7/igt@gem_exec_reloc@[email protected]
* igt@gem_mmap_offset@blt-coherency:
- shard-glk: [PASS][4] -> [FAIL][5] ([i915#2328])
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9056/shard-glk8/igt@[email protected]
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18572/shard-glk4/igt@[email protected]
* igt@gem_softpin@noreloc-s3:
- shard-apl: [PASS][6] -> [INCOMPLETE][7] ([i915#1635])
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9056/shard-apl8/igt@[email protected]
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18572/shard-apl8/igt@[email protected]
* igt@gen9_exec_parse@allowed-single:
- shard-skl: [PASS][8] -> [DMESG-WARN][9] ([i915#1436] / [i915#716])
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9056/shard-skl9/igt@[email protected]
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18572/shard-skl7/igt@[email protected]
* igt@i915_pm_dc@dc6-psr:
- shard-iclb: [PASS][10] -> [FAIL][11] ([i915#454])
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9056/shard-iclb2/igt@[email protected]
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18572/shard-iclb4/igt@[email protected]
* igt@i915_pm_rpm@system-suspend-modeset:
- shard-kbl: [PASS][12] -> [DMESG-WARN][13] ([i915#165])
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9056/shard-kbl4/igt@[email protected]
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18572/shard-kbl4/igt@[email protected]
* igt@kms_flip@2x-wf_vblank-ts-check-interruptible@ab-vga1-hdmi-a1:
- shard-hsw: [PASS][14] -> [DMESG-WARN][15] ([i915#1982])
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9056/shard-hsw4/igt@kms_flip@[email protected]
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18572/shard-hsw1/igt@kms_flip@[email protected]
* igt@kms_flip@flip-vs-suspend@a-edp1:
- shard-skl: [PASS][16] -> [DMESG-WARN][17] ([i915#1982]) +7 similar issues
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9056/shard-skl2/igt@kms_flip@[email protected]
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18572/shard-skl4/igt@kms_flip@[email protected]
* igt@kms_frontbuffer_tracking@fbc-1p-primscrn-pri-indfb-draw-mmap-gtt:
- shard-tglb: [PASS][18] -> [DMESG-WARN][19] ([i915#1982])
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9056/shard-tglb3/igt@kms_frontbuffer_tracking@fbc-1p-primscrn-pri-indfb-draw-mmap-gtt.html
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18572/shard-tglb5/igt@kms_frontbuffer_tracking@fbc-1p-primscrn-pri-indfb-draw-mmap-gtt.html
* igt@kms_frontbuffer_tracking@fbc-suspend:
- shard-kbl: [PASS][20] -> [DMESG-WARN][21] ([i915#180]) +1 similar issue
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9056/shard-kbl6/igt@[email protected]
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18572/shard-kbl6/igt@[email protected]
* igt@kms_hdr@bpc-switch-dpms:
- shard-skl: [PASS][22] -> [FAIL][23] ([i915#1188])
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9056/shard-skl6/igt@[email protected]
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18572/shard-skl5/igt@[email protected]
* igt@kms_plane_alpha_blend@pipe-b-coverage-7efc:
- shard-skl: [PASS][24] -> [DMESG-FAIL][25] ([fdo#108145] / [i915#1982])
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9056/shard-skl5/igt@[email protected]
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18572/shard-skl6/igt@[email protected]
* igt@kms_plane_alpha_blend@pipe-c-coverage-7efc:
- shard-skl: [PASS][26] -> [FAIL][27] ([fdo#108145] / [i915#265]) +1 similar issue
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9056/shard-skl3/igt@[email protected]
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18572/shard-skl8/igt@[email protected]
* igt@kms_plane_lowres@pipe-c-tiling-yf:
- shard-glk: [PASS][28] -> [FAIL][29] ([i915#899])
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9056/shard-glk5/igt@[email protected]
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18572/shard-glk2/igt@[email protected]
* igt@kms_psr@psr2_cursor_plane_onoff:
- shard-iclb: [PASS][30] -> [SKIP][31] ([fdo#109441]) +2 similar issues
[30]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9056/shard-iclb2/igt@kms_psr@psr2_cursor_plane_onoff.html
[31]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18572/shard-iclb8/igt@kms_psr@psr2_cursor_plane_onoff.html
* igt@kms_vblank@pipe-b-query-forked-busy-hang:
- shard-apl: [PASS][32] -> [DMESG-WARN][33] ([i915#1635] / [i915#1982]) +1 similar issue
[32]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9056/shard-apl8/igt@[email protected]
[33]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18572/shard-apl4/igt@[email protected]
#### Possible fixes ####
* igt@debugfs_test@read_all_entries_display_off:
- shard-skl: [DMESG-WARN][34] ([i915#1982]) -> [PASS][35] +2 similar issues
[34]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9056/shard-skl6/igt@debugfs_test@read_all_entries_display_off.html
[35]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18572/shard-skl1/igt@debugfs_test@read_all_entries_display_off.html
* igt@gem_ctx_persistence@processes:
- shard-iclb: [FAIL][36] -> [PASS][37]
[36]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9056/shard-iclb7/igt@[email protected]
[37]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18572/shard-iclb4/igt@[email protected]
* igt@gem_exec_gttfill@engines@rcs0:
- shard-glk: [DMESG-WARN][38] ([i915#118] / [i915#95]) -> [PASS][39]
[38]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9056/shard-glk2/igt@gem_exec_gttfill@[email protected]
[39]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18572/shard-glk8/igt@gem_exec_gttfill@[email protected]
* igt@gem_userptr_blits@sync-unmap-cycles:
- shard-skl: [TIMEOUT][40] ([i915#1958] / [i915#2424]) -> [PASS][41]
[40]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9056/shard-skl10/igt@[email protected]
[41]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18572/shard-skl3/igt@[email protected]
* igt@i915_pm_rc6_residency@rc6-idle:
- shard-hsw: [WARN][42] ([i915#1519]) -> [PASS][43]
[42]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9056/shard-hsw6/igt@[email protected]
[43]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18572/shard-hsw8/igt@[email protected]
* igt@kms_big_fb@linear-8bpp-rotate-0:
- shard-hsw: [INCOMPLETE][44] -> [PASS][45]
[44]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9056/shard-hsw1/igt@[email protected]
[45]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18572/shard-hsw2/igt@[email protected]
* igt@kms_big_fb@yf-tiled-16bpp-rotate-0:
- shard-kbl: [DMESG-WARN][46] ([i915#1982]) -> [PASS][47]
[46]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9056/shard-kbl4/igt@[email protected]
[47]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18572/shard-kbl4/igt@[email protected]
* igt@kms_cursor_crc@pipe-c-cursor-suspend:
- shard-kbl: [DMESG-WARN][48] ([i915#180]) -> [PASS][49] +1 similar issue
[48]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9056/shard-kbl4/igt@[email protected]
[49]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18572/shard-kbl2/igt@[email protected]
* igt@kms_flip@flip-vs-suspend@b-edp1:
- shard-skl: [INCOMPLETE][50] ([i915#198]) -> [PASS][51]
[50]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9056/shard-skl2/igt@kms_flip@[email protected]
[51]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18572/shard-skl4/igt@kms_flip@[email protected]
* igt@kms_frontbuffer_tracking@fbc-1p-primscrn-cur-indfb-draw-pwrite:
- shard-tglb: [DMESG-WARN][52] ([i915#1982]) -> [PASS][53] +4 similar issues
[52]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9056/shard-tglb6/igt@kms_frontbuffer_tracking@fbc-1p-primscrn-cur-indfb-draw-pwrite.html
[53]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18572/shard-tglb5/igt@kms_frontbuffer_tracking@fbc-1p-primscrn-cur-indfb-draw-pwrite.html
* igt@kms_plane_alpha_blend@pipe-a-constant-alpha-min:
- shard-skl: [FAIL][54] ([fdo#108145] / [i915#265]) -> [PASS][55] +1 similar issue
[54]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9056/shard-skl8/igt@[email protected]
[55]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18572/shard-skl7/igt@[email protected]
* igt@kms_psr@psr2_cursor_render:
- shard-iclb: [SKIP][56] ([fdo#109441]) -> [PASS][57] +2 similar issues
[56]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9056/shard-iclb5/igt@kms_psr@psr2_cursor_render.html
[57]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18572/shard-iclb2/igt@kms_psr@psr2_cursor_render.html
#### Warnings ####
* igt@kms_content_protection@atomic:
- shard-apl: [TIMEOUT][58] ([i915#1319] / [i915#1635] / [i915#1958]) -> [FAIL][59] ([fdo#110321] / [fdo#110336] / [i915#1635])
[58]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9056/shard-apl4/igt@[email protected]
[59]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18572/shard-apl6/igt@[email protected]
* igt@kms_content_protection@atomic-dpms:
- shard-apl: [TIMEOUT][60] ([i915#1319] / [i915#1635] / [i915#1958]) -> [TIMEOUT][61] ([i915#1319] / [i915#1635])
[60]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9056/shard-apl6/igt@[email protected]
[61]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18572/shard-apl7/igt@[email protected]
[fdo#108145]: https://bugs.freedesktop.org/show_bug.cgi?id=108145
[fdo#109441]: https://bugs.freedesktop.org/show_bug.cgi?id=109441
[fdo#110321]: https://bugs.freedesktop.org/show_bug.cgi?id=110321
[fdo#110336]: https://bugs.freedesktop.org/show_bug.cgi?id=110336
[i915#118]: https://gitlab.freedesktop.org/drm/intel/issues/118
[i915#1188]: https://gitlab.freedesktop.org/drm/intel/issues/1188
[i915#1319]: https://gitlab.freedesktop.org/drm/intel/issues/1319
[i915#1436]: https://gitlab.freedesktop.org/drm/intel/issues/1436
[i915#1519]: https://gitlab.freedesktop.org/drm/intel/issues/1519
[i915#1635]: https://gitlab.freedesktop.org/drm/intel/issues/1635
[i915#165]: https://gitlab.freedesktop.org/drm/intel/issues/165
[i915#180]: https://gitlab.freedesktop.org/drm/intel/issues/180
[i915#1958]: https://gitlab.freedesktop.org/drm/intel/issues/1958
[i915#198]: https://gitlab.freedesktop.org/drm/intel/issues/198
[i915#1982]: https://gitlab.freedesktop.org/drm/intel/issues/1982
[i915#2328]: https://gitlab.freedesktop.org/drm/intel/issues/2328
[i915#2389]: https://gitlab.freedesktop.org/drm/intel/issues/2389
[i915#2424]: https://gitlab.freedesktop.org/drm/intel/issues/2424
[i915#265]: https://gitlab.freedesktop.org/drm/intel/issues/265
[i915#454]: https://gitlab.freedesktop.org/drm/intel/issues/454
[i915#716]: https://gitlab.freedesktop.org/drm/intel/issues/716
[i915#899]: https://gitlab.freedesktop.org/drm/intel/issues/899
[i915#95]: https://gitlab.freedesktop.org/drm/intel/issues/95
Participating hosts (11 -> 12)
------------------------------
Additional (1): pig-snb-2600
Build changes
-------------
* Linux: CI_DRM_9056 -> Patchwork_18572
CI-20190529: 20190529
CI_DRM_9056: 637f215bda901249b97da25ee2983f72cc12e1c5 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_5788: a7520973a210b7268c3039902789f433ee0f5ef7 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_18572: 993652ae5805d3b85fd6a344cc9b963821525e46 @ git://anongit.freedesktop.org/gfx-ci/linux
piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18572/index.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Hi Thomas,
Quoted 64 lines · Thomas Zimmermann
Dma-buf provides
vmap()andvunmap()for retriving and releasing mappings of dma-buf memory in kernel address space. The functions operate with plain addresses and the assumption is that the memory can be accessed with load and store operations. This is not the case on some architectures (e.g., sparc64) where I/O memory can only be accessed with dedicated instructions.This patchset introduces struct
dma_buf_map, which contains the address of a buffer and a flag that tells whether system- or I/O-memory instructions are required.Some background: updating the DRM framebuffer console on sparc64 makes the kernel panic. This is because the framebuffer memory cannot be accessed with system-memory instructions. We currently employ a workaround in DRM to address this specific problem. [1]
To resolve the problem, we'd like to address it at the most common point, which is the dma-buf framework. The dma-buf mapping ideally knows if I/O instructions are required and exports this information to it's users. The new structure struct
dma_buf_mapstores the buffer address and a flag that signals I/O memory. Affected users of the buffer (e.g., drivers, frameworks) can then access the memory accordingly.This patchset only introduces struct
dma_buf_map, and updates structdma_bufand it's interfaces. Further patches can update dma-buf users. For example, there's a prototype patchset for DRM that fixes the framebuffer problem. [2]Further work: TTM, one of DRM's memory managers, already exports an
is_iomemflag of its own. It could later be switched over to exporting structdma_buf_map, thus simplifying some code. Several DRM drivers expect their fbdev console to operate on I/O memory. These could possibly be switched over to the generic fbdev emulation, as soon as the generic code uses structdma_buf_map.v3:
* update fastrpc driver (kernel test robot)
* expand documentation (Daniel)
* move documentation into separate patch
v2:
* always clear map parameter indma_buf_vmap()(Daniel)
* include dma-buf-heaps and i915 selftests (kernel test robot)
* initializecma_objbefore using it indrm_gem_cma_free_object()(kernel test robot)[1] https://lore.kernel.org/dri-devel/[email protected]/
[2] https://lore.kernel.org/dri-devel/[email protected]/Thomas Zimmermann (4):
dma-buf: Add struct dma-buf-map for storing struct dma_buf.vaddr_ptr
dma-buf: Use structdma_buf_mapindma_buf_vmap()interfaces
dma-buf: Use structdma_buf_mapindma_buf_vunmap()interfaces
dma-buf: Document structdma_buf_mapDocumentation/driver-api/dma-buf.rst | 9 + drivers/dma-buf/dma-buf.c | 42 ++-- drivers/dma-buf/heaps/heap-helpers.c | 10 +- drivers/gpu/drm/drm_gem_cma_helper.c | 20 +- drivers/gpu/drm/drm_gem_shmem_helper.c | 17 +- drivers/gpu/drm/drm_prime.c | 15 +- drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c | 13 +- drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c | 13 +- .../drm/i915/gem/selftests/i915_gem_dmabuf.c | 18 +- .../gpu/drm/i915/gem/selftests/mock_dmabuf.c | 14 +- drivers/gpu/drm/tegra/gem.c | 23 ++- .../common/videobuf2/videobuf2-dma-contig.c | 17 +-
Quoted 8 lines
.../media/common/videobuf2/videobuf2-dma-sg.c | 19 +- .../common/videobuf2/videobuf2-vmalloc.c | 21 +- drivers/misc/fastrpc.c | 6 +- include/drm/drm_prime.h | 5 +- include/linux/dma-buf-map.h | 193 ++++++++++++++++++ include/linux/dma-buf.h | 11 +- 18 files changed, 372 insertions(+), 94 deletions(-) create mode 100644 include/linux/dma-buf-map.h
For drivers/media/common/videobuf2 changes:
Best regards,
Tomasz
Hi Thomas.
Sorry for chiming in late here, have been offline for a while.
Quoted 9 lines · Thomas Zimmermann
Dma-buf provides
vmap()andvunmap()for retriving and releasing mappings of dma-buf memory in kernel address space. The functions operate with plain addresses and the assumption is that the memory can be accessed with load and store operations. This is not the case on some architectures (e.g., sparc64) where I/O memory can only be accessed with dedicated instructions.This patchset introduces struct
dma_buf_map, which contains the address of a buffer and a flag that tells whether system- or I/O-memory instructions are required.
The whole idea with a struct that can represent both a pointer to system memory and io memory is very nice.
dma-buf is one user of this but we may/will see other users. So the naming seems of as this should be a concept independent of dma-buf.
And then the struct definition and all the helpers should be moved away from dma-buf.
Maybe something like this:
struct simap {
union {
void __iomem *vaddr_iomem;
void *vaddr;
};
bool is_iomem;
};Where simap is a shorthand for system_iomem_map
And it could al be stuffed into a include/linux/simap.h file.
Not totally sold on the simap name - but wanted to come up with something.
With this approach users do not have to pull in dma-buf to use it and users will not confuse that this is only for dma-buf usage.
I am sorry for being late with the feedback.
Sam
Quoted 63 lines
Some background: updating the DRM framebuffer console on sparc64 makes the kernel panic. This is because the framebuffer memory cannot be accessed with system-memory instructions. We currently employ a workaround in DRM to address this specific problem. [1]
To resolve the problem, we'd like to address it at the most common point, which is the dma-buf framework. The dma-buf mapping ideally knows if I/O instructions are required and exports this information to it's users. The new structure struct
dma_buf_mapstores the buffer address and a flag that signals I/O memory. Affected users of the buffer (e.g., drivers, frameworks) can then access the memory accordingly.This patchset only introduces struct
dma_buf_map, and updates structdma_bufand it's interfaces. Further patches can update dma-buf users. For example, there's a prototype patchset for DRM that fixes the framebuffer problem. [2]Further work: TTM, one of DRM's memory managers, already exports an
is_iomemflag of its own. It could later be switched over to exporting structdma_buf_map, thus simplifying some code. Several DRM drivers expect their fbdev console to operate on I/O memory. These could possibly be switched over to the generic fbdev emulation, as soon as the generic code uses structdma_buf_map.v3:
* update fastrpc driver (kernel test robot)
* expand documentation (Daniel)
* move documentation into separate patch
v2:
* always clear map parameter indma_buf_vmap()(Daniel)
* include dma-buf-heaps and i915 selftests (kernel test robot)
* initializecma_objbefore using it indrm_gem_cma_free_object()(kernel test robot)[1] https://lore.kernel.org/dri-devel/[email protected]/
[2] https://lore.kernel.org/dri-devel/[email protected]/Thomas Zimmermann (4):
dma-buf: Add struct dma-buf-map for storing struct dma_buf.vaddr_ptr
dma-buf: Use structdma_buf_mapindma_buf_vmap()interfaces
dma-buf: Use structdma_buf_mapindma_buf_vunmap()interfaces
dma-buf: Document structdma_buf_mapDocumentation/driver-api/dma-buf.rst | 9 + drivers/dma-buf/dma-buf.c | 42 ++-- drivers/dma-buf/heaps/heap-helpers.c | 10 +- drivers/gpu/drm/drm_gem_cma_helper.c | 20 +- drivers/gpu/drm/drm_gem_shmem_helper.c | 17 +- drivers/gpu/drm/drm_prime.c | 15 +- drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c | 13 +- drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c | 13 +- .../drm/i915/gem/selftests/i915_gem_dmabuf.c | 18 +- .../gpu/drm/i915/gem/selftests/mock_dmabuf.c | 14 +- drivers/gpu/drm/tegra/gem.c | 23 ++- .../common/videobuf2/videobuf2-dma-contig.c | 17 +- .../media/common/videobuf2/videobuf2-dma-sg.c | 19 +- .../common/videobuf2/videobuf2-vmalloc.c | 21 +- drivers/misc/fastrpc.c | 6 +- include/drm/drm_prime.h | 5 +- include/linux/dma-buf-map.h | 193 ++++++++++++++++++ include/linux/dma-buf.h | 11 +- 18 files changed, 372 insertions(+), 94 deletions(-) create mode 100644 include/linux/dma-buf-map.h
Quoted 2 lines
--
2.28.0
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Thomas Zimmermann
maintainerHi Sam
Am 26.09.20 um 09:13 schrieb Sam Ravnborg:
Quoted 33 lines
Hi Thomas.
Sorry for chiming in late here, have been offline for a while.
Quoted 9 lines · Thomas Zimmermann
Dma-buf provides
vmap()andvunmap()for retriving and releasing mappings of dma-buf memory in kernel address space. The functions operate with plain addresses and the assumption is that the memory can be accessed with load and store operations. This is not the case on some architectures (e.g., sparc64) where I/O memory can only be accessed with dedicated instructions.This patchset introduces struct
dma_buf_map, which contains the address of a buffer and a flag that tells whether system- or I/O-memory instructions are required.The whole idea with a struct that can represent both a pointer to system memory and io memory is very nice.
dma-buf is one user of this but we may/will see other users. So the naming seems of as this should be a concept independent of dma-buf.And then the struct definition and all the helpers should be moved away from dma-buf.
Maybe something like this:
struct simap { union { void __iomem *vaddr_iomem; void *vaddr; }; bool is_iomem; };
Quoted 5 lines
Where simap is a shorthand for
system_iomem_map
And it could al be stuffed into ainclude/linux/simap.hfile.Not totally sold on the simap name - but wanted to come up with something.
Yes. Others, myself included, have suggested to use a name that does not imply a connection to the dma-buf framework, but no one has come up with
a good name.
I strongly dislike simap, as it's entirely non-obvious what it does. dma-buf-map is not actually wrong. The structures represents the mapping of a dma-able buffer in most cases.
Quoted 3 lines
With this approach users do not have to pull in dma-buf to use it and users will not confuse that this is only for dma-buf usage.
There's no need to enable dma-buf. It's all in the header file without dependencies on dma-buf. It's really just the name.
But there's something else to take into account. The whole issue here is that the buffer is disconnected from its originating driver, so we don't know which kind of memory ops we have to use. Thinking about it, I realized that no one else seemed to have this problem until now. Otherwise there would be a solution already. So maybe the dma-buf framework *is* the native use case for this data structure.
Anyway, if a better name than dma-buf-map comes in, I'm willing to rename the thing. Otherwise I intend to merge the patchset by the end of the week.
Best regards
Thomas
Quoted 76 lines
I am sorry for being late with the feedback.
Sam
Quoted 63 lines
Some background: updating the DRM framebuffer console on sparc64 makes the kernel panic. This is because the framebuffer memory cannot be accessed with system-memory instructions. We currently employ a workaround in DRM to address this specific problem. [1]
To resolve the problem, we'd like to address it at the most common point, which is the dma-buf framework. The dma-buf mapping ideally knows if I/O instructions are required and exports this information to it's users. The new structure struct
dma_buf_mapstores the buffer address and a flag that signals I/O memory. Affected users of the buffer (e.g., drivers, frameworks) can then access the memory accordingly.This patchset only introduces struct
dma_buf_map, and updates structdma_bufand it's interfaces. Further patches can update dma-buf users. For example, there's a prototype patchset for DRM that fixes the framebuffer problem. [2]Further work: TTM, one of DRM's memory managers, already exports an
is_iomemflag of its own. It could later be switched over to exporting structdma_buf_map, thus simplifying some code. Several DRM drivers expect their fbdev console to operate on I/O memory. These could possibly be switched over to the generic fbdev emulation, as soon as the generic code uses structdma_buf_map.v3:
* update fastrpc driver (kernel test robot)
* expand documentation (Daniel)
* move documentation into separate patch
v2:
* always clear map parameter indma_buf_vmap()(Daniel)
* include dma-buf-heaps and i915 selftests (kernel test robot)
* initializecma_objbefore using it indrm_gem_cma_free_object()(kernel test robot)[1] https://lore.kernel.org/dri-devel/[email protected]/
[2] https://lore.kernel.org/dri-devel/[email protected]/Thomas Zimmermann (4):
dma-buf: Add struct dma-buf-map for storing struct dma_buf.vaddr_ptr
dma-buf: Use structdma_buf_mapindma_buf_vmap()interfaces
dma-buf: Use structdma_buf_mapindma_buf_vunmap()interfaces
dma-buf: Document structdma_buf_mapDocumentation/driver-api/dma-buf.rst | 9 + drivers/dma-buf/dma-buf.c | 42 ++-- drivers/dma-buf/heaps/heap-helpers.c | 10 +- drivers/gpu/drm/drm_gem_cma_helper.c | 20 +- drivers/gpu/drm/drm_gem_shmem_helper.c | 17 +- drivers/gpu/drm/drm_prime.c | 15 +- drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c | 13 +- drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c | 13 +- .../drm/i915/gem/selftests/i915_gem_dmabuf.c | 18 +- .../gpu/drm/i915/gem/selftests/mock_dmabuf.c | 14 +- drivers/gpu/drm/tegra/gem.c | 23 ++- .../common/videobuf2/videobuf2-dma-contig.c | 17 +- .../media/common/videobuf2/videobuf2-dma-sg.c | 19 +- .../common/videobuf2/videobuf2-vmalloc.c | 21 +- drivers/misc/fastrpc.c | 6 +- include/drm/drm_prime.h | 5 +- include/linux/dma-buf-map.h | 193 ++++++++++++++++++ include/linux/dma-buf.h | 11 +- 18 files changed, 372 insertions(+), 94 deletions(-) create mode 100644 include/linux/dma-buf-map.hQuoted 2 lines
--
2.28.0_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 6 lines
Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Maxfeldstr. 5, 90409 Nürnberg, Germany (HRB 36809, AG Nürnberg) Geschäftsführer: Felix Imendörffer
Sam Ravnborg
Acked-byHi Thomas.
Quoted 30 lines
Quoted 9 lines
struct simap { union { void __iomem *vaddr_iomem; void *vaddr; }; bool is_iomem; };Quoted 5 lines
Where simap is a shorthand for
system_iomem_map
And it could al be stuffed into ainclude/linux/simap.hfile.Not totally sold on the simap name - but wanted to come up with something.
Yes. Others, myself included, have suggested to use a name that does not imply a connection to the dma-buf framework, but no one has come up with
a good name.I strongly dislike simap, as it's entirely non-obvious what it does. dma-buf-map is not actually wrong. The structures represents the mapping of a dma-able buffer in most cases.
Quoted 3 lines
With this approach users do not have to pull in dma-buf to use it and users will not confuse that this is only for dma-buf usage.
There's no need to enable dma-buf. It's all in the header file without dependencies on dma-buf. It's really just the name.
Quoted 6 lines
But there's something else to take into account. The whole issue here is that the buffer is disconnected from its originating driver, so we don't know which kind of memory ops we have to use. Thinking about it, I realized that no one else seemed to have this problem until now. Otherwise there would be a solution already. So maybe the dma-buf framework *is* the native use case for this data structure.
We have at least:linux/fb.h:
union {
char __iomem *screen_base; /* Virtual address */
char *screen_buffer;
};Which solve more or less the same problem.
Quoted 3 lines
Anyway, if a better name than dma-buf-map comes in, I'm willing to rename the thing. Otherwise I intend to merge the patchset by the end of the week.
Well, the main thing is that I think this shoud be moved away from dma-buf. But if indeed dma-buf is the only relevant user in drm then I am totally fine with the current naming.
One alternative named that popped up in my head: struct sys_io_map {} But again, if this is kept in dma-buf then I am fine with the current naming.
In other words, if you continue to think this is mostly a dma-buf thing all three patches are:
Sam
Christian König
maintainerAm 27.09.20 um 21:16 schrieb Sam Ravnborg:
Quoted 34 lines
Hi Thomas.
Quoted 26 lines
Quoted 8 lines
struct simap { union { void __iomem *vaddr_iomem; void *vaddr; }; bool is_iomem; };Quoted 5 lines
Where simap is a shorthand for
system_iomem_map
And it could al be stuffed into ainclude/linux/simap.hfile.Not totally sold on the simap name - but wanted to come up with something.
Yes. Others, myself included, have suggested to use a name that does not imply a connection to the dma-buf framework, but no one has come up with
a good name.I strongly dislike simap, as it's entirely non-obvious what it does. dma-buf-map is not actually wrong. The structures represents the mapping of a dma-able buffer in most cases.
Quoted 2 lines
With this approach users do not have to pull in dma-buf to use it and users will not confuse that this is only for dma-buf usage.
There's no need to enable dma-buf. It's all in the header file without dependencies on dma-buf. It's really just the name.
Quoted 6 lines
But there's something else to take into account. The whole issue here is that the buffer is disconnected from its originating driver, so we don't know which kind of memory ops we have to use. Thinking about it, I realized that no one else seemed to have this problem until now. Otherwise there would be a solution already. So maybe the dma-buf framework *is* the native use case for this data structure.
Quoted 8 lines
We have at least:
linux/fb.h:union { char __iomem *screen_base; /* Virtual address */ char *screen_buffer; };Which solve more or less the same problem.
I also already noted that in TTM we have exactly the same problem and a whole bunch of helpers to allow operations on those pointers.
Christian.
Quoted 13 lines
Quoted 5 lines
Anyway, if a better name than dma-buf-map comes in, I'm willing to rename the thing. Otherwise I intend to merge the patchset by the end of the week.
Well, the main thing is that I think this shoud be moved away from dma-buf. But if indeed dma-buf is the only relevant user in drm then I am totally fine with the current naming.
One alternative named that popped up in my head: struct
sys_io_map{} But again, if this is kept in dma-buf then I am fine with the current naming.
Quoted 5 lines
In other words, if you continue to think this is mostly a dma-buf thing all three patches are:
Acked-by Sam Ravnborg <[email protected]>Sam
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Thomas Zimmermann
maintainerHi
Am 28.09.20 um 08:50 schrieb Christian König:
Quoted 43 lines
Am 27.09.20 um 21:16 schrieb Sam Ravnborg:
Quoted 42 lines
Hi Thomas.
Quoted 26 lines
Quoted 8 lines
struct simap {
union {
void__iomem*vaddr_iomem;
void *vaddr;
};
boolis_iomem;
};Quoted 5 lines
Where simap is a shorthand for
system_iomem_map
And it could al be stuffed into ainclude/linux/simap.hfile.Not totally sold on the simap name - but wanted to come up with something.
Yes. Others, myself included, have suggested to use a name that does not imply a connection to the dma-buf framework, but no one has come up with a good name.
I strongly dislike simap, as it's entirely non-obvious what it does. dma-buf-map is not actually wrong. The structures represents the mapping of a dma-able buffer in most cases.
Quoted 2 lines
With this approach users do not have to pull in dma-buf to use it and users will not confuse that this is only for dma-buf usage.
There's no need to enable dma-buf. It's all in the header file without dependencies on dma-buf. It's really just the name.
Quoted 6 lines
But there's something else to take into account. The whole issue here is that the buffer is disconnected from its originating driver, so we don't know which kind of memory ops we have to use. Thinking about it, I realized that no one else seemed to have this problem until now. Otherwise there would be a solution already. So maybe the dma-buf framework *is* the native use case for this data structure.
We have at least:
linux/fb.h:
union {
char__iomem*screen_base; /* Virtual address */ char*screen_buffer;
};Which solve more or less the same problem.
I thought this was for convenience. The important is_iomem bit is missing.
Quoted 3 lines
I also already noted that in TTM we have exactly the same problem and a whole bunch of helpers to allow operations on those pointers.
How do you call this within TTM?
The data structure represents a pointer to either system or I/O memory, but not necessatrily device memory. It contains raw data. That would give something like
struct databuf_map
struct databuf_ptr
struct dbuf_map
struct dbuf_ptr
My favorite would be dbuf_ptr. It's short and the API names would make
sense: dbuf_ptr_clear() for clearing, dbuf_ptr_set_vaddr() to set an address, dbuf_ptr_incr() to increment, etc. Also, the _ptr indicates that it's a single address; not an offset with length.
Best regards
Thomas
Quoted 26 lines
Christian.
Quoted 13 lines
Quoted 3 lines
Anyway, if a better name than dma-buf-map comes in, I'm willing to rename the thing. Otherwise I intend to merge the patchset by the end of the week.
Well, the main thing is that I think this shoud be moved away from dma-buf. But if indeed dma-buf is the only relevant user in drm then I am totally fine with the current naming.
One alternative named that popped up in my head: struct
sys_io_map{} But again, if this is kept in dma-buf then I am fine with the current naming.Quoted 5 lines
In other words, if you continue to think this is mostly a dma-buf thing all three patches are:
Acked-by Sam Ravnborg <[email protected]>Sam
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 6 lines
Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Maxfeldstr. 5, 90409 Nürnberg, Germany (HRB 36809, AG Nürnberg) Geschäftsführer: Felix Imendörffer
Christian König
maintainerAm 28.09.20 um 09:37 schrieb Thomas Zimmermann:
Quoted 45 lines
Hi
Am 28.09.20 um 08:50 schrieb Christian König:
Quoted 42 lines
Am 27.09.20 um 21:16 schrieb Sam Ravnborg:
Quoted 41 lines
Hi Thomas.
Quoted 26 lines
Quoted 8 lines
struct simap {
union {
void__iomem*vaddr_iomem;
void *vaddr;
};
boolis_iomem;
};Quoted 5 lines
Where simap is a shorthand for
system_iomem_map
And it could al be stuffed into ainclude/linux/simap.hfile.Not totally sold on the simap name - but wanted to come up with something.
Yes. Others, myself included, have suggested to use a name that does not imply a connection to the dma-buf framework, but no one has come up with
a good name.I strongly dislike simap, as it's entirely non-obvious what it does. dma-buf-map is not actually wrong. The structures represents the mapping of a dma-able buffer in most cases.
Quoted 2 lines
With this approach users do not have to pull in dma-buf to use it and users will not confuse that this is only for dma-buf usage.
There's no need to enable dma-buf. It's all in the header file without dependencies on dma-buf. It's really just the name.
Quoted 6 lines
But there's something else to take into account. The whole issue here is that the buffer is disconnected from its originating driver, so we don't know which kind of memory ops we have to use. Thinking about it, I realized that no one else seemed to have this problem until now. Otherwise there would be a solution already. So maybe the dma-buf framework *is* the native use case for this data structure.
We have at least:
linux/fb.h:
union {
char__iomem*screen_base; /* Virtual address */ char*screen_buffer;
};
Quoted 6 lines
Quoted 1 line
Quoted 1 line
Which solve more or less the same problem.
I thought this was for convenience. The important
is_iomembit is missing.Quoted 2 lines
I also already noted that in TTM we have exactly the same problem and a whole bunch of helpers to allow operations on those pointers.
How do you call this within TTM?
ttm_bus_placement, but I really don't like that name.
Quoted 10 lines
The data structure represents a pointer to either system or I/O memory, but not necessatrily device memory. It contains raw data. That would give something like
struct
databuf_map
structdatabuf_ptr
structdbuf_map
structdbuf_ptr
Quoted 4 lines
My favorite would be
dbuf_ptr. It's short and the API names would make
sense:dbuf_ptr_clear()for clearing,dbuf_ptr_set_vaddr()to set an address,dbuf_ptr_incr()to increment, etc. Also, the_ptrindicates that it's a single address; not an offset with length.
Puh, no idea. All of that doesn't sound like it 100% hits the underlying meaning of the structure.
Christian.
Quoted 27 lines
Best regards
ThomasQuoted 23 lines
Christian.
Quoted 12 lines
Quoted 4 lines
Anyway, if a better name than dma-buf-map comes in, I'm willing to rename the thing. Otherwise I intend to merge the patchset by the end of the week.
Well, the main thing is that I think this shoud be moved away from dma-buf. But if indeed dma-buf is the only relevant user in drm then I am totally fine with the current naming.
One alternative named that popped up in my head: struct
sys_io_map{} But again, if this is kept in dma-buf then I am fine with the current naming.Quoted 5 lines
In other words, if you continue to think this is mostly a dma-buf thing all three patches are:
Acked-by Sam Ravnborg <[email protected]>Sam
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 65 lines · Christian König
Am 28.09.20 um 09:37 schrieb Thomas Zimmermann:
Quoted 45 lines
Hi
Am 28.09.20 um 08:50 schrieb Christian König:
Quoted 42 lines
Am 27.09.20 um 21:16 schrieb Sam Ravnborg:
Quoted 41 lines
Hi Thomas.
Quoted 26 lines
Quoted 8 lines
struct simap {
union {
void__iomem*vaddr_iomem;
void *vaddr;
};
boolis_iomem;
};Quoted 5 lines
Where simap is a shorthand for
system_iomem_map
And it could al be stuffed into ainclude/linux/simap.hfile.Not totally sold on the simap name - but wanted to come up with something.
Yes. Others, myself included, have suggested to use a name that does not imply a connection to the dma-buf framework, but no one has come up with
a good name.I strongly dislike simap, as it's entirely non-obvious what it does. dma-buf-map is not actually wrong. The structures represents the mapping of a dma-able buffer in most cases.
Quoted 2 lines
With this approach users do not have to pull in dma-buf to use it and users will not confuse that this is only for dma-buf usage.
There's no need to enable dma-buf. It's all in the header file without dependencies on dma-buf. It's really just the name.
Quoted 6 lines
But there's something else to take into account. The whole issue here is that the buffer is disconnected from its originating driver, so we don't know which kind of memory ops we have to use. Thinking about it, I realized that no one else seemed to have this problem until now. Otherwise there would be a solution already. So maybe the dma-buf framework *is* the native use case for this data structure.
We have at least:
linux/fb.h:
union {
char__iomem*screen_base; /* Virtual address */ char*screen_buffer;
};Quoted 6 lines
Quoted 1 line
Quoted 1 line
Which solve more or less the same problem.
I thought this was for convenience. The important
is_iomembit is missing.Quoted 2 lines
I also already noted that in TTM we have exactly the same problem and a whole bunch of helpers to allow operations on those pointers.
How do you call this within TTM?
ttm_bus_placement, but I really don't like that name.Quoted 10 lines
The data structure represents a pointer to either system or I/O memory, but not necessatrily device memory. It contains raw data. That would give something like
struct
databuf_map
structdatabuf_ptr
structdbuf_map
structdbuf_ptr
Quoted 7 lines
Quoted 4 lines
My favorite would be
dbuf_ptr. It's short and the API names would make
sense:dbuf_ptr_clear()for clearing,dbuf_ptr_set_vaddr()to set an address,dbuf_ptr_incr()to increment, etc. Also, the_ptrindicates that it's a single address; not an offset with length.Puh, no idea. All of that doesn't sound like it 100% hits the underlying meaning of the structure.
Imo first let's merge this and then second with more users we might come up with a better name. And cocci is fairly good at large-scale rename, to the point where we manged to rename struct fence to struct dma_fence.
Also this entire thread here imo shows that we haven't yet figured out the perfect name anyway, and I don't think it's worth it to hold this up because of this bikeshed :-)
Cheers, Daniel
Quoted 30 lines
Christian.
Quoted 26 lines
Best regards
ThomasQuoted 22 lines
Christian.
Quoted 11 lines
Quoted 3 lines
Anyway, if a better name than dma-buf-map comes in, I'm willing to rename the thing. Otherwise I intend to merge the patchset by the end of the week.
Well, the main thing is that I think this shoud be moved away from dma-buf. But if indeed dma-buf is the only relevant user in drm then I am totally fine with the current naming.
One alternative named that popped up in my head: struct
sys_io_map{} But again, if this is kept in dma-buf then I am fine with the current naming.Quoted 5 lines
In other words, if you continue to think this is mostly a dma-buf thing all three patches are:
Acked-by Sam Ravnborg <[email protected]>Sam
_______________________________________________
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 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Christian König
maintainerAm 29.09.20 um 11:14 schrieb Daniel Vetter:
Quoted 68 lines · Christian König
Quoted 67 lines
Am 28.09.20 um 09:37 schrieb Thomas Zimmermann:
Quoted 45 lines
Hi
Am 28.09.20 um 08:50 schrieb Christian König:
Quoted 42 lines
Am 27.09.20 um 21:16 schrieb Sam Ravnborg:
Quoted 41 lines
Hi Thomas.
Quoted 26 lines
Quoted 8 lines
struct simap {
union {
void__iomem*vaddr_iomem;
void *vaddr;
};
boolis_iomem;
};Quoted 5 lines
Where simap is a shorthand for
system_iomem_map
And it could al be stuffed into ainclude/linux/simap.hfile.Not totally sold on the simap name - but wanted to come up with something.
Yes. Others, myself included, have suggested to use a name that does not imply a connection to the dma-buf framework, but no one has come up with
a good name.I strongly dislike simap, as it's entirely non-obvious what it does. dma-buf-map is not actually wrong. The structures represents the mapping of a dma-able buffer in most cases.
Quoted 2 lines
With this approach users do not have to pull in dma-buf to use it and users will not confuse that this is only for dma-buf usage.
There's no need to enable dma-buf. It's all in the header file without dependencies on dma-buf. It's really just the name.
Quoted 6 lines
But there's something else to take into account. The whole issue here is that the buffer is disconnected from its originating driver, so we don't know which kind of memory ops we have to use. Thinking about it, I realized that no one else seemed to have this problem until now. Otherwise there would be a solution already. So maybe the dma-buf framework *is* the native use case for this data structure.
We have at least:
linux/fb.h:
union {
char__iomem*screen_base; /* Virtual address */ char*screen_buffer;
};Quoted 6 lines
Quoted 1 line
Quoted 1 line
Which solve more or less the same problem.
I thought this was for convenience. The important
is_iomembit is missing.Quoted 2 lines
I also already noted that in TTM we have exactly the same problem and a whole bunch of helpers to allow operations on those pointers.
How do you call this within TTM?
ttm_bus_placement, but I really don't like that name.Quoted 13 lines
The data structure represents a pointer to either system or I/O memory, but not necessatrily device memory. It contains raw data. That would give something like
struct
databuf_map
structdatabuf_ptr
structdbuf_map
structdbuf_ptrMy favorite would be
dbuf_ptr. It's short and the API names would make
sense:dbuf_ptr_clear()for clearing,dbuf_ptr_set_vaddr()to set an address,dbuf_ptr_incr()to increment, etc. Also, the_ptrindicates that it's a single address; not an offset with length.
Quoted 5 lines
Quoted 2 lines
Puh, no idea. All of that doesn't sound like it 100% hits the underlying meaning of the structure.
Imo first let's merge this and then second with more users we might come up with a better name. And cocci is fairly good at large-scale rename, to the point where we manged to rename struct fence to struct
dma_fence.
Agreed, renaming things later on is easy if somebody comes up with something better.
But blocking a necessary technical change just because of the naming is usually not a good idea.
Christian.
Quoted 34 lines
Also this entire thread here imo shows that we haven't yet figured out the perfect name anyway, and I don't think it's worth it to hold this up because of this bikeshed :-)
Cheers, Daniel
Quoted 27 lines
Christian.
Quoted 25 lines
Best regards
ThomasQuoted 22 lines
Christian.
Quoted 11 lines
Quoted 3 lines
Anyway, if a better name than dma-buf-map comes in, I'm willing to rename the thing. Otherwise I intend to merge the patchset by the end of the week.
Well, the main thing is that I think this shoud be moved away from dma-buf. But if indeed dma-buf is the only relevant user in drm then I am totally fine with the current naming.
One alternative named that popped up in my head: struct
sys_io_map{} But again, if this is kept in dma-buf then I am fine with the current naming.Quoted 5 lines
In other words, if you continue to think this is mostly a dma-buf thing all three patches are:
Acked-by Sam Ravnborg <[email protected]>Sam
_______________________________________________
dri-devel mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Fdri-devel&data=02%7C01%7Cchristian.koenig%40amd.com%7C71c630a7ca1d48476eed08d864581e4f%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637369676925032848&sdata=CsekzASvj2lY%2B74FIiLc9B5QG7AHma8B2M5y8Cassj4%3D&reserved=0
Thomas Zimmermann
maintainerAm 29.09.20 um 13:09 schrieb Christian König:
Quoted 84 lines
Am 29.09.20 um 11:14 schrieb Daniel Vetter:
Quoted 77 lines · Christian König
Quoted 76 lines
Am 28.09.20 um 09:37 schrieb Thomas Zimmermann:
Quoted 52 lines
Hi
Am 28.09.20 um 08:50 schrieb Christian König:
Quoted 49 lines
Am 27.09.20 um 21:16 schrieb Sam Ravnborg:
Quoted 48 lines
Hi Thomas.
Quoted 31 lines
Quoted 8 lines
struct simap {
union {
void__iomem*vaddr_iomem;
void *vaddr;
};
boolis_iomem;
};Quoted 5 lines
Where simap is a shorthand for
system_iomem_map
And it could al be stuffed into ainclude/linux/simap.hfile.Not totally sold on the simap name - but wanted to come up with something.
Yes. Others, myself included, have suggested to use a name that does not
imply a connection to the dma-buf framework, but no one has come up with
a good name.I strongly dislike simap, as it's entirely non-obvious what it does. dma-buf-map is not actually wrong. The structures represents the mapping
of a dma-able buffer in most cases.Quoted 3 lines
With this approach users do not have to pull in dma-buf to use it and
users will not confuse that this is only for dma-buf usage.There's no need to enable dma-buf. It's all in the header file without
dependencies on dma-buf. It's really just the name.Quoted 8 lines
But there's something else to take into account. The whole issue here is
that the buffer is disconnected from its originating driver, so we don't
know which kind of memory ops we have to use. Thinking about it, I realized that no one else seemed to have this problem until now. Otherwise there would be a solution already. So maybe the dma-buf framework *is* the native use case for this data structure.We have at least:
linux/fb.h:
union {
char__iomem*screen_base; /* Virtual address */ char*screen_buffer;
};Quoted 8 lines
Quoted 1 line
Quoted 1 line
Which solve more or less the same problem.
I thought this was for convenience. The important
is_iomembit is missing.Quoted 3 lines
I also already noted that in TTM we have exactly the same problem and a
whole bunch of helpers to allow operations on those pointers.How do you call this within TTM?
ttm_bus_placement, but I really don't like that name.Quoted 13 lines
The data structure represents a pointer to either system or I/O memory, but not necessatrily device memory. It contains raw data. That would give something like
struct
databuf_map
structdatabuf_ptr
structdbuf_map
structdbuf_ptrMy favorite would be
dbuf_ptr. It's short and the API names would make
sense:dbuf_ptr_clear()for clearing,dbuf_ptr_set_vaddr()to set an address,dbuf_ptr_incr()to increment, etc. Also, the_ptrindicates that it's a single address; not an offset with length.Quoted 5 lines
Quoted 2 lines
Puh, no idea. All of that doesn't sound like it 100% hits the underlying meaning of the structure.
Imo first let's merge this and then second with more users we might come up with a better name. And cocci is fairly good at large-scale rename, to the point where we manged to rename struct fence to struct
dma_fence.
Quoted 5 lines
Agreed, renaming things later on is easy if somebody comes up with something better.
But blocking a necessary technical change just because of the naming is usually not a good idea.
OK, merged now.
Best regards
Thomas
Quoted 45 lines
Christian.
Quoted 37 lines
Also this entire thread here imo shows that we haven't yet figured out the
perfect name anyway, and I don't think it's worth it to hold this up because of this bikeshed :-)Cheers, Daniel
Quoted 29 lines
Christian.
Quoted 27 lines
Best regards
ThomasQuoted 24 lines
Christian.
Quoted 12 lines
Quoted 4 lines
Anyway, if a better name than dma-buf-map comes in, I'm willing to rename the thing. Otherwise I intend to merge the patchset by the end of
the week.Well, the main thing is that I think this shoud be moved away from dma-buf. But if indeed dma-buf is the only relevant user in drm then I am totally fine with the current naming.
One alternative named that popped up in my head: struct
sys_io_map{} But again, if this is kept in dma-buf then I am fine with the current naming.Quoted 5 lines
In other words, if you continue to think this is mostly a dma-buf thing all three patches are:
Acked-by Sam Ravnborg <[email protected]>Sam
_______________________________________________
dri-devel mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Fdri-devel&data=02%7C01%7Cchristian.koenig%40amd.com%7C71c630a7ca1d48476eed08d864581e4f%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637369676925032848&sdata=CsekzASvj2lY%2B74FIiLc9B5QG7AHma8B2M5y8Cassj4%3D&reserved=0_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 6 lines
Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Maxfeldstr. 5, 90409 Nürnberg, Germany (HRB 36809, AG Nürnberg) Geschäftsführer: Felix Imendörffer
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx