Move all drivers to a common dma-buf locking convention
Subsystems (22)
v4 cover Move all drivers to a common dma-buf locking convention
Hello,
This series moves all drivers to a dynamic dma-buf locking specification. From now on all dma-buf importers are made responsible for holding dma-buf's reservation lock around all operations performed over dma-bufs in accordance to the locking specification. This allows us to utilize reservation lock more broadly around kernel without fearing of a potential deadlocks.
This patchset passes all i915 selftests. It was also tested using VirtIO, Panfrost, Lima, Tegra, udmabuf, AMDGPU and Nouveau drivers. I tested cases of display+GPU, display+V4L and GPU+V4L dma-buf sharing (where appropriate), which covers majority of kernel drivers since rest of the drivers share same or similar code paths.
Changelog:
v4: - Added dma_buf_mmap() to the "locking convention" documentation,
which was missed by accident in v3.
- Added acks from Christian König, Tomasz Figa and Hans Verkuil that they gave to couple v3 patches.
- Dropped the "_unlocked" postfix from function names that don't have the locked variant, as was requested by Christian König.
- Factored out the per-driver preparations into separate patches to ease reviewing of the changes, which is now doable without the global dma-buf functions renaming.
- Factored out the dynamic locking convention enforcements into separate patches which add the final dma_resv_assert_held(dmabuf->resv) to the dma-buf API functions.
v3: - Factored out dma_buf_mmap_unlocked() and attachment functions
into aseparate patches, like was suggested by Christian König.
- Corrected and factored out dma-buf locking documentation into a separate patch, like was suggested by Christian König.
- Intel driver dropped the reservation locking fews days ago from its BO-release code path, but we need that locking for the imported GEMs because in the end that code path unmaps the imported GEM. So I added back the locking needed by the imported GEMs, updating the "dma-buf attachment locking specification" patch appropriately.
- Tested Nouveau+Intel dma-buf import/export combo.
- Tested udmabuf import to i915/Nouveau/AMDGPU.
- Fixed few places in Etnaviv, Panfrost and Lima drivers that I missed to switch to locked dma-buf vmapping in the drm/gem: Take reservation lock for vmap/vunmap operations" patch. In a result invalidated the Christian's r-b that he gave to v2.
- Added locked dma-buf vmap/vunmap functions that are needed for fixing vmappping of Etnaviv, Panfrost and Lima drivers mentioned above. I actually had this change stashed for the drm-shmem shrinker patchset, but then realized that it's already needed by the dma-buf patches. Also improved my tests to better cover these code paths.
v2: - Changed locking specification to avoid problems with a cross-driver
ww locking, like was suggested by Christian König. Now the attach/detach callbacks are invoked without the held lock and exporter should take the lock.
- Added "locking convention" documentation that explains which dma-buf functions and callbacks are locked/unlocked for importers and exporters, which was requested by Christian König.
- Added ack from Tomasz Figa to the V4L patches that he gave to v1.
Dmitry Osipenko (21):
dma-buf: Add unlocked variant of vmapping functions
dma-buf: Add unlocked variant of attachment-mapping functions drm/gem: Take reservation lock for vmap/vunmap operations drm/prime: Prepare to dynamic dma-buf locking specification drm/armada: Prepare to dynamic dma-buf locking specification drm/i915: Prepare to dynamic dma-buf locking specification drm/omapdrm: Prepare to dynamic dma-buf locking specification drm/tegra: Prepare to dynamic dma-buf locking specification drm/etnaviv: Prepare to dynamic dma-buf locking specification RDMA/umem: Prepare to dynamic dma-buf locking specification
misc: fastrpc: Prepare to dynamic dma-buf locking specification xen/gntdev: Prepare to dynamic dma-buf locking specification
media: videobuf2: Prepare to dynamic dma-buf locking specification
media: tegra-vde: Prepare to dynamic dma-buf locking specification
dma-buf: Move dma_buf_vmap() to dynamic locking specification
dma-buf: Move dma_buf_attach() to dynamic locking specification
dma-buf: Move dma_buf_map_attachment() to dynamic locking
specification
dma-buf: Move dma_buf_mmap() to dynamic locking specification
dma-buf: Document dynamic locking convention
media: videobuf2: Stop using internal dma-buf lock
dma-buf: Remove obsoleted internal lock
Documentation/driver-api/dma-buf.rst | 6 + drivers/dma-buf/dma-buf.c | 211 +++++++++++++++--- drivers/gpu/drm/armada/armada_gem.c | 8 +- drivers/gpu/drm/drm_client.c | 4 +- drivers/gpu/drm/drm_gem.c | 24 ++ drivers/gpu/drm/drm_gem_dma_helper.c | 6 +- drivers/gpu/drm/drm_gem_framebuffer_helper.c | 6 +- drivers/gpu/drm/drm_gem_ttm_helper.c | 9 +- drivers/gpu/drm/drm_prime.c | 6 +- drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c | 2 +- drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c | 2 +- drivers/gpu/drm/i915/gem/i915_gem_object.c | 12 + .../drm/i915/gem/selftests/i915_gem_dmabuf.c | 16 +- drivers/gpu/drm/lima/lima_sched.c | 4 +- drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c | 4 +- drivers/gpu/drm/panfrost/panfrost_dump.c | 4 +- drivers/gpu/drm/panfrost/panfrost_perfcnt.c | 6 +- drivers/gpu/drm/qxl/qxl_object.c | 17 +- drivers/gpu/drm/qxl/qxl_prime.c | 4 +- drivers/gpu/drm/tegra/gem.c | 17 +- drivers/infiniband/core/umem_dmabuf.c | 7 +- .../common/videobuf2/videobuf2-dma-contig.c | 22 +- .../media/common/videobuf2/videobuf2-dma-sg.c | 19 +- .../common/videobuf2/videobuf2-vmalloc.c | 17 +- .../platform/nvidia/tegra-vde/dmabuf-cache.c | 6 +- drivers/misc/fastrpc.c | 6 +- drivers/xen/gntdev-dmabuf.c | 8 +- include/drm/drm_gem.h | 3 + include/linux/dma-buf.h | 17 +- 29 files changed, 318 insertions(+), 155 deletions(-)
Signature · 1 line
2.37.2
PATCH v4 1/21 dma-buf: Add unlocked variant of vmapping functions
Add unlocked variant of dma_buf_vmap/vunmap() that will be utilized by drivers that don't take the reservation lock explicitly.
--- drivers/dma-buf/dma-buf.c | 38 ++++++++++++++++++++++++++++++++++++++ include/linux/dma-buf.h | 2 ++ 2 files changed, 40 insertions(+)
drivers/dma-buf/dma-buf.c +38 -0
@@ -1424,6 +1424,28 @@ int dma_buf_vmap(struct dma_buf *dmabuf, struct iosys_map *map) }EXPORT_SYMBOL_NS_GPL (dma_buf_vmap,DMA_BUF ); +/** +* dma_buf_vmap_unlocked - 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 +* +* Unlocked version of dma_buf_vmap() +* +* Returns 0 on success, or a negative errno code otherwise. +*/ +int dma_buf_vmap_unlocked (struct dma_buf *dmabuf,struct iosys_map *map) +{ +int ret; + +dma_resv_lock (dmabuf->resv,NULL ); + ret =dma_buf_vmap (dmabuf, map); +dma_resv_unlock (dmabuf->resv); + +return ret; +} +EXPORT_SYMBOL_NS_GPL (dma_buf_vmap_unlocked,DMA_BUF ); +/** * dma_buf_vunmap - Unmap a vmap obtained by dma_buf_vmap. * @dmabuf: [in] buffer to vunmap
@@ -1448,6 +1470,22 @@ void dma_buf_vunmap(struct dma_buf *dmabuf, struct iosys_map *map) }EXPORT_SYMBOL_NS_GPL (dma_buf_vunmap,DMA_BUF ); +/** +* dma_buf_vunmap_unlocked - Unmap a vmap obtained by dma_buf_vmap. +* @dmabuf: [in] buffer to vunmap +* @map: [in] vmap pointer to vunmap +*/ +void dma_buf_vunmap_unlocked (struct dma_buf *dmabuf,struct iosys_map *map) +{ +if (WARN_ON (!dmabuf)) +return ; + +dma_resv_lock (dmabuf->resv,NULL ); +dma_buf_vunmap (dmabuf, map); +dma_resv_unlock (dmabuf->resv); +} +EXPORT_SYMBOL_NS_GPL (dma_buf_vunmap_unlocked,DMA_BUF ); +#ifdef CONFIG_DEBUG_FS static int dma_buf_debug_show (struct seq_file *s,void *unused) {
include/linux/dma-buf.h +2 -0
@@ -632,4 +632,6 @@ int dma_buf_mmap(struct dma_buf *, struct vm_area_struct *, unsigned long);int dma_buf_vmap (struct dma_buf *dmabuf,struct iosys_map *map);void dma_buf_vunmap (struct dma_buf *dmabuf,struct iosys_map *map); +int dma_buf_vmap_unlocked (struct dma_buf *dmabuf,struct iosys_map *map); +void dma_buf_vunmap_unlocked (struct dma_buf *dmabuf,struct iosys_map *map);#endif /* __DMA_BUF_H__ */
Signature · 1 line
2.37.2
PATCH v4 2/21 dma-buf: Add unlocked variant of attachment-mapping functions
In reply to Dmitry OsipenkoAdd unlocked variant of dma_buf_map/unmap_attachment() that will be used by drivers that don't take the reservation lock explicitly.
--- drivers/dma-buf/dma-buf.c | 53 +++++++++++++++++++++++++++++++++++++++ include/linux/dma-buf.h | 6 +++++ 2 files changed, 59 insertions(+)
drivers/dma-buf/dma-buf.c +53 -0
@@ -1099,6 +1099,34 @@ struct sg_table *dma_buf_map_attachment(struct dma_buf_attachment *attach, }EXPORT_SYMBOL_NS_GPL (dma_buf_map_attachment,DMA_BUF ); +/** +* dma_buf_map_attachment_unlocked - Returns the scatterlist table of the attachment; +* mapped into _device_ address space. Is a wrapper for map_dma_buf() of the +* dma_buf_ops. +* @attach: [in] attachment whose scatterlist is to be returned +* @direction: [in] direction of DMA transfer +* +* Unlocked variant of dma_buf_map_attachment(). +*/ +struct sg_table * +dma_buf_map_attachment_unlocked (struct dma_buf_attachment *attach, +enum dma_data_direction direction) +{ +struct sg_table *sg_table; + +might_sleep (); + +if (WARN_ON (!attach || !attach->dmabuf)) +return ERR_PTR (-EINVAL ); + +dma_resv_lock (attach->dmabuf->resv,NULL ); + sg_table =dma_buf_map_attachment (attach, direction); +dma_resv_unlock (attach->dmabuf->resv); + +return sg_table; +} +EXPORT_SYMBOL_NS_GPL (dma_buf_map_attachment_unlocked,DMA_BUF ); +/** * dma_buf_unmap_attachment - unmaps and decreases usecount of the buffer;might * deallocate the scatterlist associated. Is a wrapper for unmap_dma_buf() of
@@ -1135,6 +1163,31 @@ void dma_buf_unmap_attachment(struct dma_buf_attachment *attach, }EXPORT_SYMBOL_NS_GPL (dma_buf_unmap_attachment,DMA_BUF ); +/** +* dma_buf_unmap_attachment_unlocked - unmaps and decreases usecount of the buffer;might +* deallocate the scatterlist associated. Is a wrapper for unmap_dma_buf() of +* dma_buf_ops. +* @attach: [in] attachment to unmap buffer from +* @sg_table: [in] scatterlist info of the buffer to unmap +* @direction: [in] direction of DMA transfer +* +* Unlocked variant of dma_buf_unmap_attachment(). +*/ +void dma_buf_unmap_attachment_unlocked (struct dma_buf_attachment *attach, +struct sg_table *sg_table, +enum dma_data_direction direction) +{ +might_sleep (); + +if (WARN_ON (!attach || !attach->dmabuf || !sg_table)) +return ; + +dma_resv_lock (attach->dmabuf->resv,NULL ); +dma_buf_unmap_attachment (attach, sg_table, direction); +dma_resv_unlock (attach->dmabuf->resv); +} +EXPORT_SYMBOL_NS_GPL (dma_buf_unmap_attachment_unlocked,DMA_BUF ); +/** * dma_buf_move_notify - notify attachments that DMA-buf is moving *
include/linux/dma-buf.h +6 -0
@@ -627,6 +627,12 @@ int dma_buf_begin_cpu_access(struct dma_buf *dma_buf, enum dma_data_direction dir);int dma_buf_end_cpu_access (struct dma_buf *dma_buf,enum dma_data_direction dir); +struct sg_table * +dma_buf_map_attachment_unlocked (struct dma_buf_attachment *attach, +enum dma_data_direction direction); +void dma_buf_unmap_attachment_unlocked (struct dma_buf_attachment *attach, +struct sg_table *sg_table, +enum dma_data_direction direction);int dma_buf_mmap (struct dma_buf *,struct vm_area_struct *,unsigned long );
Signature · 1 line
2.37.2
PATCH v4 3/21 drm/gem: Take reservation lock for vmap/vunmap operations
In reply to Dmitry OsipenkoThe new common dma-buf locking convention will require buffer importers to hold the reservation lock around mapping operations. Make DRM GEM core to take the lock around the vmapping operations and update DRM drivers to use the locked functions for the case where DRM core now holds the lock. This patch prepares DRM core and drivers to the common dynamic dma-buf locking convention.
--- drivers/gpu/drm/drm_client.c | 4 ++-- drivers/gpu/drm/drm_gem.c | 24 ++++++++++++++++++++ drivers/gpu/drm/drm_gem_dma_helper.c | 6 ++--- drivers/gpu/drm/drm_gem_framebuffer_helper.c | 6 ++--- drivers/gpu/drm/drm_gem_ttm_helper.c | 9 +------- drivers/gpu/drm/lima/lima_sched.c | 4 ++-- drivers/gpu/drm/panfrost/panfrost_dump.c | 4 ++-- drivers/gpu/drm/panfrost/panfrost_perfcnt.c | 6 ++--- drivers/gpu/drm/qxl/qxl_object.c | 17 +++++++------- drivers/gpu/drm/qxl/qxl_prime.c | 4 ++-- include/drm/drm_gem.h | 3 +++ 11 files changed, 54 insertions(+), 33 deletions(-)
drivers/gpu/drm/drm_client.c +2 -2
@@ -323,7 +323,7 @@ drm_client_buffer_vmap(struct drm_client_buffer *buffer,* fd_install step out of the driver backend hooks, to make that * final step optional for internal users. */ - ret =drm_gem_vmap (buffer->gem, map); + ret =drm_gem_vmap_unlocked (buffer->gem, map);if (ret)return ret;
@@ -345,7 +345,7 @@ void drm_client_buffer_vunmap(struct drm_client_buffer *buffer) {struct iosys_map *map = &buffer->map; -drm_gem_vunmap (buffer->gem, map); +drm_gem_vunmap_unlocked (buffer->gem, map); }EXPORT_SYMBOL (drm_client_buffer_vunmap);
drivers/gpu/drm/drm_gem.c +24 -0
@@ -1156,6 +1156,8 @@ int drm_gem_vmap(struct drm_gem_object *obj, struct iosys_map *map) {int ret; +dma_resv_assert_held (obj->resv); +if (!obj->funcs->vmap)return -EOPNOTSUPP ;
@@ -1171,6 +1173,8 @@ EXPORT_SYMBOL(drm_gem_vmap);void drm_gem_vunmap (struct drm_gem_object *obj,struct iosys_map *map) { +dma_resv_assert_held (obj->resv); +if (iosys_map_is_null (map))return ;
@@ -1182,6 +1186,26 @@ void drm_gem_vunmap(struct drm_gem_object *obj, struct iosys_map *map) }EXPORT_SYMBOL (drm_gem_vunmap); +int drm_gem_vmap_unlocked (struct drm_gem_object *obj,struct iosys_map *map) +{ +int ret; + +dma_resv_lock (obj->resv,NULL ); + ret =drm_gem_vmap (obj, map); +dma_resv_unlock (obj->resv); + +return ret; +} +EXPORT_SYMBOL (drm_gem_vmap_unlocked); + +void drm_gem_vunmap_unlocked (struct drm_gem_object *obj,struct iosys_map *map) +{ +dma_resv_lock (obj->resv,NULL ); +drm_gem_vunmap (obj, map); +dma_resv_unlock (obj->resv); +} +EXPORT_SYMBOL (drm_gem_vunmap_unlocked); +/** * drm_gem_lock_reservations - Sets up the ww context and acquires * the lock on an array of GEM objects.
drivers/gpu/drm/drm_gem_dma_helper.c +3 -3
@@ -230,7 +230,7 @@ void drm_gem_dma_free(struct drm_gem_dma_object *dma_obj)if (gem_obj->import_attach) {if (dma_obj->vaddr) -dma_buf_vunmap (gem_obj->import_attach->dmabuf, &map); +dma_buf_vunmap_unlocked (gem_obj->import_attach->dmabuf, &map);drm_prime_gem_destroy (gem_obj, dma_obj->sgt); }else if (dma_obj->vaddr) {if (dma_obj->map_noncoherent)
@@ -581,7 +581,7 @@ drm_gem_dma_prime_import_sg_table_vmap(struct drm_device *dev,struct iosys_map map;int ret; - ret =dma_buf_vmap (attach->dmabuf, &map); + ret =dma_buf_vmap_unlocked (attach->dmabuf, &map);if (ret) {DRM_ERROR ("Failed to vmap PRIME buffer\n" );return ERR_PTR (ret);
@@ -589,7 +589,7 @@ drm_gem_dma_prime_import_sg_table_vmap(struct drm_device *dev, obj =drm_gem_dma_prime_import_sg_table (dev, attach, sgt);if (IS_ERR (obj)) { -dma_buf_vunmap (attach->dmabuf, &map); +dma_buf_vunmap_unlocked (attach->dmabuf, &map);return obj; }
drivers/gpu/drm/drm_gem_framebuffer_helper.c +3 -3
@@ -354,7 +354,7 @@ int drm_gem_fb_vmap(struct drm_framebuffer *fb, struct iosys_map *map, ret = -EINVAL ; goto err_drm_gem_vunmap; } - ret =drm_gem_vmap (obj, &map[i]); + ret =drm_gem_vmap_unlocked (obj, &map[i]);if (ret) goto err_drm_gem_vunmap; }
@@ -376,7 +376,7 @@ int drm_gem_fb_vmap(struct drm_framebuffer *fb, struct iosys_map *map, obj =drm_gem_fb_get_obj (fb, i);if (!obj)continue ; -drm_gem_vunmap (obj, &map[i]); +drm_gem_vunmap_unlocked (obj, &map[i]); }return ret; }
@@ -403,7 +403,7 @@ void drm_gem_fb_vunmap(struct drm_framebuffer *fb, struct iosys_map *map)continue ;if (iosys_map_is_null (&map[i]))continue ; -drm_gem_vunmap (obj, &map[i]); +drm_gem_vunmap_unlocked (obj, &map[i]); } }EXPORT_SYMBOL (drm_gem_fb_vunmap);
drivers/gpu/drm/drm_gem_ttm_helper.c +1 -8
@@ -64,13 +64,8 @@ int drm_gem_ttm_vmap(struct drm_gem_object *gem, struct iosys_map *map) {struct ttm_buffer_object *bo =drm_gem_ttm_of_gem (gem); -int ret; - -dma_resv_lock (gem->resv,NULL ); - ret =ttm_bo_vmap (bo, map); -dma_resv_unlock (gem->resv); -return ret; +return ttm_bo_vmap (bo, map); }EXPORT_SYMBOL (drm_gem_ttm_vmap);
@@ -87,9 +82,7 @@ void drm_gem_ttm_vunmap(struct drm_gem_object *gem, {struct ttm_buffer_object *bo =drm_gem_ttm_of_gem (gem); -dma_resv_lock (gem->resv,NULL );ttm_bo_vunmap (bo, map); -dma_resv_unlock (gem->resv); }EXPORT_SYMBOL (drm_gem_ttm_vunmap);
drivers/gpu/drm/lima/lima_sched.c +2 -2
@@ -371,7 +371,7 @@ static void lima_sched_build_error_task_list(struct lima_sched_task *task) }else { buffer_chunk->size =lima_bo_size (bo); - ret =drm_gem_shmem_vmap (&bo->base, &map); + ret =drm_gem_vmap_unlocked (&bo->base.base, &map);if (ret) {kvfree (et); goto out;
@@ -379,7 +379,7 @@ static void lima_sched_build_error_task_list(struct lima_sched_task *task)memcpy (buffer_chunk +1 , map.vaddr, buffer_chunk->size); -drm_gem_shmem_vunmap (&bo->base, &map); +drm_gem_vunmap_unlocked (&bo->base.base, &map); } buffer_chunk = (void *)(buffer_chunk +1 ) + buffer_chunk->size;
drivers/gpu/drm/panfrost/panfrost_dump.c +2 -2
@@ -209,7 +209,7 @@ void panfrost_core_dump(struct panfrost_job *job) goto dump_header; } - ret =drm_gem_shmem_vmap (&bo->base, &map); + ret =drm_gem_vmap_unlocked (&bo->base.base, &map);if (ret) {dev_err (pfdev->dev,"Panfrost Dump: couldn't map Buffer Object\n" ); iter.hdr->bomap.valid =0 ;
@@ -236,7 +236,7 @@ void panfrost_core_dump(struct panfrost_job *job) vaddr = map.vaddr;memcpy (iter.data, vaddr, bo->base.base.size); -drm_gem_shmem_vunmap (&bo->base, &map); +drm_gem_vunmap_unlocked (&bo->base.base, &map); iter.hdr->bomap.valid =cpu_to_le32 (1 );
drivers/gpu/drm/panfrost/panfrost_perfcnt.c +3 -3
@@ -106,7 +106,7 @@ static int panfrost_perfcnt_enable_locked(struct panfrost_device *pfdev, goto err_close_bo; } - ret =drm_gem_shmem_vmap (bo, &map); + ret =drm_gem_vmap_unlocked (&bo->base, &map);if (ret) goto err_put_mapping; perfcnt->buf = map.vaddr;
@@ -165,7 +165,7 @@ static int panfrost_perfcnt_enable_locked(struct panfrost_device *pfdev,return 0 ; err_vunmap: -drm_gem_shmem_vunmap (bo, &map); +drm_gem_vunmap_unlocked (&bo->base, &map); err_put_mapping:panfrost_gem_mapping_put (perfcnt->mapping); err_close_bo:
@@ -195,7 +195,7 @@ static int panfrost_perfcnt_disable_locked(struct panfrost_device *pfdev, GPU_PERFCNT_CFG_MODE(GPU_PERFCNT_CFG_MODE_OFF)); perfcnt->user =NULL ; -drm_gem_shmem_vunmap (&perfcnt->mapping->obj->base, &map); +drm_gem_vunmap_unlocked (&perfcnt->mapping->obj->base.base, &map); perfcnt->buf =NULL ;panfrost_gem_close (&perfcnt->mapping->obj->base.base, file_priv);panfrost_mmu_as_put (pfdev, perfcnt->mapping->mmu);
drivers/gpu/drm/qxl/qxl_object.c +9 -8
@@ -168,9 +168,16 @@ int qxl_bo_vmap_locked(struct qxl_bo *bo, struct iosys_map *map) bo->map_count++; goto out; } - r =ttm_bo_vmap (&bo->tbo, &bo->map); + + r =__qxl_bo_pin (bo);if (r)return r; + + r =ttm_bo_vmap (&bo->tbo, &bo->map); +if (r) { +__qxl_bo_unpin (bo); +return r; + } bo->map_count =1 ;/* TODO: Remove kptr in favor of map everywhere. */
@@ -192,12 +199,6 @@ int qxl_bo_vmap(struct qxl_bo *bo, struct iosys_map *map)if (r)return r; - r =__qxl_bo_pin (bo); -if (r) { -qxl_bo_unreserve (bo); -return r; - } - r =qxl_bo_vmap_locked (bo, map);qxl_bo_unreserve (bo);return r;
@@ -247,6 +248,7 @@ void qxl_bo_vunmap_locked(struct qxl_bo *bo)return ; bo->kptr =NULL ;ttm_bo_vunmap (&bo->tbo, &bo->map); +__qxl_bo_unpin (bo); }int qxl_bo_vunmap (struct qxl_bo *bo)
@@ -258,7 +260,6 @@ int qxl_bo_vunmap(struct qxl_bo *bo)return r;qxl_bo_vunmap_locked (bo); -__qxl_bo_unpin (bo);qxl_bo_unreserve (bo);return 0 ; }
drivers/gpu/drm/qxl/qxl_prime.c +2 -2
@@ -59,7 +59,7 @@ int qxl_gem_prime_vmap(struct drm_gem_object *obj, struct iosys_map *map)struct qxl_bo *bo =gem_to_qxl_bo (obj);int ret; - ret =qxl_bo_vmap (bo, map); + ret =qxl_bo_vmap_locked (bo, map);if (ret <0 )return ret;
@@ -71,5 +71,5 @@ void qxl_gem_prime_vunmap(struct drm_gem_object *obj, {struct qxl_bo *bo =gem_to_qxl_bo (obj); -qxl_bo_vunmap (bo); +qxl_bo_vunmap_locked (bo); }
include/drm/drm_gem.h +3 -0
@@ -420,4 +420,7 @@ void drm_gem_unlock_reservations(struct drm_gem_object **objs, int count,int drm_gem_dumb_map_offset (struct drm_file *file,struct drm_device *dev,u32 handle,u64 *offset); +int drm_gem_vmap_unlocked (struct drm_gem_object *obj,struct iosys_map *map); +void drm_gem_vunmap_unlocked (struct drm_gem_object *obj,struct iosys_map *map); +#endif /* __DRM_GEM_H__ */
Signature · 1 line
2.37.2
PATCH v4 4/21 drm/prime: Prepare to dynamic dma-buf locking specification
In reply to Dmitry OsipenkoPrepare DRM prime core to the common dynamic dma-buf locking convention by starting to use the unlocked versions of dma-buf API functions.
--- drivers/gpu/drm/drm_prime.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/drm_prime.c +3 -3
@@ -940,7 +940,7 @@ struct drm_gem_object *drm_gem_prime_import_dev(struct drm_device *dev,get_dma_buf (dma_buf); - sgt =dma_buf_map_attachment (attach,DMA_BIDIRECTIONAL ); + sgt =dma_buf_map_attachment_unlocked (attach,DMA_BIDIRECTIONAL );if (IS_ERR (sgt)) { ret =PTR_ERR (sgt); goto fail_detach;
@@ -958,7 +958,7 @@ struct drm_gem_object *drm_gem_prime_import_dev(struct drm_device *dev,return obj; fail_unmap: -dma_buf_unmap_attachment (attach, sgt,DMA_BIDIRECTIONAL ); +dma_buf_unmap_attachment_unlocked (attach, sgt,DMA_BIDIRECTIONAL ); fail_detach:dma_buf_detach (dma_buf, attach);dma_buf_put (dma_buf);
@@ -1056,7 +1056,7 @@ void drm_prime_gem_destroy(struct drm_gem_object *obj, struct sg_table *sg) attach = obj->import_attach;if (sg) -dma_buf_unmap_attachment (attach, sg,DMA_BIDIRECTIONAL ); +dma_buf_unmap_attachment_unlocked (attach, sg,DMA_BIDIRECTIONAL ); dma_buf = attach->dmabuf;dma_buf_detach (attach->dmabuf, attach);/* remove the reference */
Signature · 1 line
2.37.2
Re: [PATCH v4 04/21] drm/prime: Prepare to dynamic dma-buf locking specification
Am 31.08.22 um 17:37 schrieb Dmitry Osipenko:
Quoted 4 lines
Prepare DRM prime core to the common dynamic dma-buf locking convention by starting to use the unlocked versions of dma-buf API functions.
Signed-off-by Dmitry Osipenko <[email protected]>
Quoted 35 lines
--- drivers/gpu/drm/drm_prime.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)drivers/gpu/drm/drm_prime.c +3
-3@@ -940,7 +940,7 @@ struct drm_gem_object *drm_gem_prime_import_dev(struct drm_device *dev,get_dma_buf (dma_buf); - sgt =dma_buf_map_attachment (attach,DMA_BIDIRECTIONAL ); + sgt =dma_buf_map_attachment_unlocked (attach,DMA_BIDIRECTIONAL );if (IS_ERR (sgt)) { ret =PTR_ERR (sgt); goto fail_detach;@@ -958,7 +958,7 @@ struct drm_gem_object *drm_gem_prime_import_dev(struct drm_device *dev,return obj; fail_unmap: -dma_buf_unmap_attachment (attach, sgt,DMA_BIDIRECTIONAL ); +dma_buf_unmap_attachment_unlocked (attach, sgt,DMA_BIDIRECTIONAL ); fail_detach:dma_buf_detach (dma_buf, attach);dma_buf_put (dma_buf);@@ -1056,7 +1056,7 @@ void drm_prime_gem_destroy(struct drm_gem_object *obj, struct sg_table *sg) attach = obj->import_attach;if (sg) -dma_buf_unmap_attachment (attach, sg,DMA_BIDIRECTIONAL ); +dma_buf_unmap_attachment_unlocked (attach, sg,DMA_BIDIRECTIONAL ); dma_buf = attach->dmabuf;dma_buf_detach (attach->dmabuf, attach);/* remove the reference */
PATCH v4 5/21 drm/armada: Prepare to dynamic dma-buf locking specification
In reply to Dmitry OsipenkoPrepare Armada driver to the common dynamic dma-buf locking convention by starting to use the unlocked versions of dma-buf API functions.
--- drivers/gpu/drm/armada/armada_gem.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/armada/armada_gem.c +4 -4
@@ -66,8 +66,8 @@ void armada_gem_free_object(struct drm_gem_object *obj)if (dobj->obj.import_attach) {/* We only ever display imported data */ if (dobj->sgt) -dma_buf_unmap_attachment (dobj->obj.import_attach, - dobj->sgt,DMA_TO_DEVICE ); +dma_buf_unmap_attachment_unlocked (dobj->obj.import_attach, + dobj->sgt,DMA_TO_DEVICE );drm_prime_gem_destroy (&dobj->obj,NULL ); }
@@ -539,8 +539,8 @@ int armada_gem_map_import(struct armada_gem_object *dobj) {int ret; - dobj->sgt =dma_buf_map_attachment (dobj->obj.import_attach, -DMA_TO_DEVICE ); + dobj->sgt =dma_buf_map_attachment_unlocked (dobj->obj.import_attach, +DMA_TO_DEVICE );if (IS_ERR (dobj->sgt)) { ret =PTR_ERR (dobj->sgt); dobj->sgt =NULL ;
Signature · 1 line
2.37.2
Re: [PATCH v4 05/21] drm/armada: Prepare to dynamic dma-buf locking specification
Am 31.08.22 um 17:37 schrieb Dmitry Osipenko:
Quoted 4 lines
Prepare Armada driver to the common dynamic dma-buf locking convention by starting to use the unlocked versions of dma-buf API functions.
Signed-off-by Dmitry Osipenko <[email protected]>
Quoted 30 lines
--- drivers/gpu/drm/armada/armada_gem.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)drivers/gpu/drm/armada/armada_gem.c +4
-4@@ -66,8 +66,8 @@ void armada_gem_free_object(struct drm_gem_object *obj)if (dobj->obj.import_attach) {/* We only ever display imported data */ if (dobj->sgt) -dma_buf_unmap_attachment (dobj->obj.import_attach, - dobj->sgt,DMA_TO_DEVICE ); +dma_buf_unmap_attachment_unlocked (dobj->obj.import_attach, + dobj->sgt,DMA_TO_DEVICE );drm_prime_gem_destroy (&dobj->obj,NULL ); }@@ -539,8 +539,8 @@ int armada_gem_map_import(struct armada_gem_object *dobj) {int ret; - dobj->sgt =dma_buf_map_attachment (dobj->obj.import_attach, -DMA_TO_DEVICE ); + dobj->sgt =dma_buf_map_attachment_unlocked (dobj->obj.import_attach, +DMA_TO_DEVICE );if (IS_ERR (dobj->sgt)) { ret =PTR_ERR (dobj->sgt); dobj->sgt =NULL ;
PATCH v4 6/21 drm/i915: Prepare to dynamic dma-buf locking specification
In reply to Dmitry OsipenkoPrepare i915 driver to the common dynamic dma-buf locking convention by starting to use the unlocked versions of dma-buf API functions and handling cases where importer now holds the reservation lock.
--- drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c | 2 +- drivers/gpu/drm/i915/gem/i915_gem_object.c | 12 ++++++++++++ .../gpu/drm/i915/gem/selftests/i915_gem_dmabuf.c | 16 ++++++++-------- 3 files changed, 21 insertions(+), 9 deletions(-)
drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c +1 -1
@@ -72,7 +72,7 @@ static int i915_gem_dmabuf_vmap(struct dma_buf *dma_buf,struct drm_i915_gem_object *obj =dma_buf_to_obj (dma_buf);void *vaddr; - vaddr =i915_gem_object_pin_map_unlocked (obj,I915_MAP_WB ); + vaddr =i915_gem_object_pin_map (obj,I915_MAP_WB );if (IS_ERR (vaddr))return PTR_ERR (vaddr);
drivers/gpu/drm/i915/gem/i915_gem_object.c +12 -0
@@ -331,7 +331,19 @@ static void __i915_gem_free_objects(struct drm_i915_private *i915,continue ; } +/* +* dma_buf_unmap_attachment() requires reservation to be +* locked. The imported GEM shouldn't share reservation lock, +* so it's safe to take the lock. +*/ +if (obj->base.import_attach) +i915_gem_object_lock (obj,NULL ); +__i915_gem_object_pages_fini (obj); + +if (obj->base.import_attach) +i915_gem_object_unlock (obj); +__i915_gem_free_object (obj);/* But keep the pointer alive for RCU-protected lookups */
drivers/gpu/drm/i915/gem/selftests/i915_gem_dmabuf.c +8 -8
@@ -213,7 +213,7 @@ static int igt_dmabuf_import_same_driver(struct drm_i915_private *i915, goto out_import; } - st =dma_buf_map_attachment (import_attach,DMA_BIDIRECTIONAL ); + st =dma_buf_map_attachment_unlocked (import_attach,DMA_BIDIRECTIONAL );if (IS_ERR (st)) { err =PTR_ERR (st); goto out_detach;
@@ -226,7 +226,7 @@ static int igt_dmabuf_import_same_driver(struct drm_i915_private *i915, timeout = -ETIME ; } err = timeout >0 ?0 : timeout; -dma_buf_unmap_attachment (import_attach, st,DMA_BIDIRECTIONAL ); +dma_buf_unmap_attachment_unlocked (import_attach, st,DMA_BIDIRECTIONAL ); out_detach:dma_buf_detach (dmabuf, import_attach); out_import:
@@ -296,7 +296,7 @@ static int igt_dmabuf_import(void *arg) goto out_obj; } - err =dma_buf_vmap (dmabuf, &map); + err =dma_buf_vmap_unlocked (dmabuf, &map); dma_map = err ?NULL : map.vaddr;if (!dma_map) {pr_err ("dma_buf_vmap failed\n" );
@@ -337,7 +337,7 @@ static int igt_dmabuf_import(void *arg) err =0 ; out_dma_map: -dma_buf_vunmap (dmabuf, &map); +dma_buf_vunmap_unlocked (dmabuf, &map); out_obj:i915_gem_object_put (obj); out_dmabuf:
@@ -358,7 +358,7 @@ static int igt_dmabuf_import_ownership(void *arg)if (IS_ERR (dmabuf))return PTR_ERR (dmabuf); - err =dma_buf_vmap (dmabuf, &map); + err =dma_buf_vmap_unlocked (dmabuf, &map); ptr = err ?NULL : map.vaddr;if (!ptr) {pr_err ("dma_buf_vmap failed\n" );
@@ -367,7 +367,7 @@ static int igt_dmabuf_import_ownership(void *arg) }memset (ptr,0xc5 ,PAGE_SIZE ); -dma_buf_vunmap (dmabuf, &map); +dma_buf_vunmap_unlocked (dmabuf, &map); obj =to_intel_bo (i915_gem_prime_import (&i915->drm, dmabuf));if (IS_ERR (obj)) {
@@ -418,7 +418,7 @@ static int igt_dmabuf_export_vmap(void *arg) }i915_gem_object_put (obj); - err =dma_buf_vmap (dmabuf, &map); + err =dma_buf_vmap_unlocked (dmabuf, &map); ptr = err ?NULL : map.vaddr;if (!ptr) {pr_err ("dma_buf_vmap failed\n" );
@@ -435,7 +435,7 @@ static int igt_dmabuf_export_vmap(void *arg)memset (ptr,0xc5 , dmabuf->size); err =0 ; -dma_buf_vunmap (dmabuf, &map); +dma_buf_vunmap_unlocked (dmabuf, &map); out:dma_buf_put (dmabuf);return err;
Signature · 1 line
2.37.2
Re: [PATCH v4 06/21] drm/i915: Prepare to dynamic dma-buf locking specification
Am 31.08.22 um 17:37 schrieb Dmitry Osipenko:
Quoted 5 lines
Prepare i915 driver to the common dynamic dma-buf locking convention by starting to use the unlocked versions of dma-buf API functions and handling cases where importer now holds the reservation lock.
Signed-off-by Dmitry Osipenko <[email protected]>
Quoted 111 lines
--- drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c | 2 +- drivers/gpu/drm/i915/gem/i915_gem_object.c | 12 ++++++++++++ .../gpu/drm/i915/gem/selftests/i915_gem_dmabuf.c | 16 ++++++++-------- 3 files changed, 21 insertions(+), 9 deletions(-)drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c +1
-1@@ -72,7 +72,7 @@ static int i915_gem_dmabuf_vmap(struct dma_buf *dma_buf,struct drm_i915_gem_object *obj =dma_buf_to_obj (dma_buf);void *vaddr; - vaddr =i915_gem_object_pin_map_unlocked (obj,I915_MAP_WB ); + vaddr =i915_gem_object_pin_map (obj,I915_MAP_WB );if (IS_ERR (vaddr))return PTR_ERR (vaddr);drivers/gpu/drm/i915/gem/i915_gem_object.c +12
-0@@ -331,7 +331,19 @@ static void __i915_gem_free_objects(struct drm_i915_private *i915,continue ; } +/* +* dma_buf_unmap_attachment() requires reservation to be +* locked. The imported GEM shouldn't share reservation lock, +* so it's safe to take the lock. +*/ +if (obj->base.import_attach) +i915_gem_object_lock (obj,NULL ); +__i915_gem_object_pages_fini (obj); + +if (obj->base.import_attach) +i915_gem_object_unlock (obj); +__i915_gem_free_object (obj);/* But keep the pointer alive for RCU-protected lookups */ drivers/gpu/drm/i915/gem/selftests/i915_gem_dmabuf.c +7
-7@@ -213,7 +213,7 @@ static int igt_dmabuf_import_same_driver(struct drm_i915_private *i915, goto out_import; } - st =dma_buf_map_attachment (import_attach,DMA_BIDIRECTIONAL ); + st =dma_buf_map_attachment_unlocked (import_attach,DMA_BIDIRECTIONAL );if (IS_ERR (st)) { err =PTR_ERR (st); goto out_detach;@@ -226,7 +226,7 @@ static int igt_dmabuf_import_same_driver(struct drm_i915_private *i915, timeout = -ETIME ; } err = timeout >0 ?0 : timeout; -dma_buf_unmap_attachment (import_attach, st,DMA_BIDIRECTIONAL ); +dma_buf_unmap_attachment_unlocked (import_attach, st,DMA_BIDIRECTIONAL ); out_detach:dma_buf_detach (dmabuf, import_attach); out_import:@@ -296,7 +296,7 @@ static int igt_dmabuf_import(void *arg) goto out_obj; } - err =dma_buf_vmap (dmabuf, &map); + err =dma_buf_vmap_unlocked (dmabuf, &map); dma_map = err ?NULL : map.vaddr;if (!dma_map) {pr_err ("dma_buf_vmap failed\n" );@@ -337,7 +337,7 @@ static int igt_dmabuf_import(void *arg) err =0 ; out_dma_map: -dma_buf_vunmap (dmabuf, &map); +dma_buf_vunmap_unlocked (dmabuf, &map); out_obj:i915_gem_object_put (obj); out_dmabuf:@@ -358,7 +358,7 @@ static int igt_dmabuf_import_ownership(void *arg)if (IS_ERR (dmabuf))return PTR_ERR (dmabuf); - err =dma_buf_vmap (dmabuf, &map); + err =dma_buf_vmap_unlocked (dmabuf, &map); ptr = err ?NULL : map.vaddr;if (!ptr) {pr_err ("dma_buf_vmap failed\n" );@@ -367,7 +367,7 @@ static int igt_dmabuf_import_ownership(void *arg) }memset (ptr,0xc5 ,PAGE_SIZE ); -dma_buf_vunmap (dmabuf, &map); +dma_buf_vunmap_unlocked (dmabuf, &map); obj =to_intel_bo (i915_gem_prime_import (&i915->drm, dmabuf));if (IS_ERR (obj)) {@@ -418,7 +418,7 @@ static int igt_dmabuf_export_vmap(void *arg) }i915_gem_object_put (obj); - err =dma_buf_vmap (dmabuf, &map); + err =dma_buf_vmap_unlocked (dmabuf, &map); ptr = err ?NULL : map.vaddr;if (!ptr) {pr_err ("dma_buf_vmap failed\n" );
drivers/gpu/drm/i915/gem/selftests/i915_gem_dmabuf.c static int igt_dmabuf_export_vmap(void *arg) · line 441
Quoted 8 lines
drivers/gpu/drm/i915/gem/selftests/i915_gem_dmabuf.c +1
-1@@ -435,7 +435,7 @@ static int igt_dmabuf_export_vmap(void *arg)memset (ptr,0xc5 , dmabuf->size); err =0 ; -dma_buf_vunmap (dmabuf, &map); +dma_buf_vunmap_unlocked (dmabuf, &map); out:dma_buf_put (dmabuf);return err;
_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
Re: [PATCH v4 06/21] drm/i915: Prepare to dynamic dma-buf locking specification
Quoted 9 lines · Christian König
Am 31.08.22 um 17:37 schrieb Dmitry Osipenko:
Quoted 5 lines
Prepare i915 driver to the common dynamic dma-buf locking convention by starting to use the unlocked versions of dma-buf API functions and handling cases where importer now holds the reservation lock.
Signed-off-by Dmitry Osipenko <[email protected]>best if somebody from the Intel guys take a look as well.
+ Chris Wilson, who touched locks of __i915_gem_free_objects() recently
Quoted 117 lines
Quoted 116 lines
---
drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c | 2 +- drivers/gpu/drm/i915/gem/i915_gem_object.c | 12 ++++++++++++.../gpu/drm/i915/gem/selftests/i915_gem_dmabuf.c| 16 ++++++++--------3 files changed, 21 insertions(+), 9 deletions(-)drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c +1
-0@@ -72,7 +72,7 @@ static int i915_gem_dmabuf_vmap(struct dma_buf *dma_buf, struct drm_i915_gem_object *obj = dma_buf_to_obj(dma_buf); void *vaddr; - vaddr = i915_gem_object_pin_map_unlocked(obj, I915_MAP_WB); + vaddr = i915_gem_object_pin_map(obj, I915_MAP_WB); if (IS_ERR(vaddr)) return PTR_ERR(vaddr);diff --git
a/drivers/gpu/drm/i915/gem/i915_gem_object.cb/drivers/gpu/drm/i915/gem/i915_gem_object.cindex389e9f157ca5..7e2a9b02526c100644drivers/gpu/drm/i915/gem/i915_gem_object.c +0
-0@@ -331,7 +331,19 @@ static void __i915_gem_free_objects(struct drm_i915_private *i915, continue; }+ /*
+ *dma_buf_unmap_attachment()requires reservation to be + * locked. The imported GEM shouldn't share reservation lock, + * so it's safe to take the lock.
+ */
+ if (obj->base.import_attach)
+i915_gem_object_lock(obj, NULL);
+
__i915_gem_object_pages_fini(obj);drivers/gpu/drm/i915/gem/i915_gem_object.c +4
-0+ + if (obj->base.import_attach) + i915_gem_object_unlock(obj); +
__i915_gem_free_object(obj);
/* But keep the pointer alive for RCU-protected lookups */drivers/gpu/drm/i915/gem/selftests/i915_gem_dmabuf.c +1
-0@@ -213,7 +213,7 @@ static int igt_dmabuf_import_same_driver(structdrm_i915_private *i915, goto out_import; } - st = dma_buf_map_attachment(import_attach, DMA_BIDIRECTIONAL); + st = dma_buf_map_attachment_unlocked(import_attach,DMA_BIDIRECTIONAL ); if (IS_ERR(st)) {err =
PTR_ERR(st);
gotoout_detach;drivers/gpu/drm/i915/gem/selftests/i915_gem_dmabuf.c +1
-1@@ -226,7 +226,7 @@ static int igt_dmabuf_import_same_driver(structdrm_i915_private *i915, timeout = -ETIME; } err = timeout > 0 ? 0 : timeout; - dma_buf_unmap_attachment(import_attach, st, DMA_BIDIRECTIONAL); + dma_buf_unmap_attachment_unlocked(import_attach, st,DMA_BIDIRECTIONAL );
out_detach:
dma_buf_detach(dmabuf, import_attach);
out_import:drivers/gpu/drm/i915/gem/selftests/i915_gem_dmabuf.c +1
-0@@ -296,7 +296,7 @@ static int igt_dmabuf_import(void *arg) goto out_obj; } - err = dma_buf_vmap(dmabuf, &map); + err = dma_buf_vmap_unlocked(dmabuf, &map); dma_map = err ? NULL : map.vaddr; if (!dma_map) { pr_err("dma_buf_vmap failed\n");@@ -337,7 +337,7 @@ static int igt_dmabuf_import(void *arg) err = 0;
out_dma_map:
-dma_buf_vunmap(dmabuf, &map);
+dma_buf_vunmap_unlocked(dmabuf, &map);
out_obj:
i915_gem_object_put(obj);
out_dmabuf:drivers/gpu/drm/i915/gem/selftests/i915_gem_dmabuf.c +4
-2@@ -358,7 +358,7 @@ static int igt_dmabuf_import_ownership(void *arg) if (IS_ERR(dmabuf)) return PTR_ERR(dmabuf); - err = dma_buf_vmap(dmabuf, &map); + err = dma_buf_vmap_unlocked(dmabuf, &map); ptr = err ? NULL : map.vaddr; if (!ptr) { pr_err("dma_buf_vmap failed\n");@@ -367,7 +367,7 @@ static int igt_dmabuf_import_ownership(void *arg) } memset(ptr, 0xc5, PAGE_SIZE); - dma_buf_vunmap(dmabuf, &map); + dma_buf_vunmap_unlocked(dmabuf, &map); obj = to_intel_bo(i915_gem_prime_import(&i915->drm, dmabuf)); if (IS_ERR(obj)) {@@ -418,7 +418,7 @@ static int igt_dmabuf_export_vmap(void *arg) } i915_gem_object_put(obj); - err = dma_buf_vmap(dmabuf, &map); + err = dma_buf_vmap_unlocked(dmabuf, &map); ptr = err ? NULL : map.vaddr; if (!ptr) { pr_err("dma_buf_vmap failed\n");@@ -435,7 +435,7 @@ static int igt_dmabuf_export_vmap(void *arg) memset(ptr, 0xc5, dmabuf->size); err = 0; - dma_buf_vunmap(dmabuf, &map); + dma_buf_vunmap_unlocked(dmabuf, &map);out:
dma_buf_put(dmabuf);
return err;
Signature · 2 lines
Best regards, Dmitry
RE: [PATCH v4 06/21] drm/i915: Prepare to dynamic dma-buf locking specification
In reply to Dmitry OsipenkoQuoted 70 lines
-----Original Message-----
From: Dmitry Osipenko <[email protected]>
Sent: Wednesday, August 31, 2022 11:38 AM
To: David Airlie <[email protected]>; Gerd Hoffmann <[email protected]>; Gurchetan Singh <[email protected]>; Chia-I Wu <[email protected]>; Daniel Vetter <[email protected]>; Daniel Almeida <[email protected]>; Gert Wollny <[email protected]>; Gustavo Padovan <[email protected]>; Daniel Stone <[email protected]>; Tomeu Vizoso <[email protected]>; Maarten Lankhorst <[email protected]>; Maxime Ripard <[email protected]>; Thomas Zimmermann <[email protected]>; Rob Clark <[email protected]>; Sumit Semwal <[email protected]>; Christian König <[email protected]>; Pan, Xinhui <[email protected]>; Thierry Reding <[email protected]>; Tomasz Figa <[email protected]>; Marek Szyprowski <[email protected]>; Mauro Carvalho Chehab <[email protected]>; Alex Deucher <[email protected]>; Jani Nikula <[email protected]>; Joonas Lahtinen <[email protected]>; Vivi, Rodrigo <[email protected]>; Tvrtko Ursulin <[email protected]>; Thomas Hellström <[email protected]>; Qiang Yu <[email protected]>; Srinivas Kandagatla <[email protected]>; Amol Maheshwari <[email protected]>; Jason Gunthorpe <[email protected]>; Leon Romanovsky <[email protected]>; Gross, Jurgen <[email protected]>; Stefano Stabellini <[email protected]>; Oleksandr Tyshchenko <[email protected]>; Tomi Valkeinen <[email protected]>; Russell King <[email protected]>; Lucas Stach <[email protected]>; Christian Gmeiner <[email protected]>
Cc: [email protected]; [email protected]; Dmitry Osipenko <[email protected]>; [email protected]; linaro-mm- [email protected]; [email protected]; intel- [email protected]; [email protected]; [email protected] foundation.org; [email protected]; linux-arm- [email protected]
Subject: [PATCH v4 06/21] drm/i915: Prepare to dynamic dma-buf locking specificationPrepare i915 driver to the common dynamic dma-buf locking convention by starting to use the unlocked versions of dma-buf API functions and handling cases where importer now holds the reservation lock.
Signed-off-by Dmitry Osipenko <[email protected]>---
drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c | 2 +- drivers/gpu/drm/i915/gem/i915_gem_object.c | 12 ++++++++++++ .../gpu/drm/i915/gem/selftests/i915_gem_dmabuf.c | 16 ++++++++-------- 3 files changed, 21 insertions(+), 9 deletions(-)drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c +1
-1@@ -72,7 +72,7 @@ static int i915_gem_dmabuf_vmap(struct dma_buf *dma_buf, struct drm_i915_gem_object *obj = dma_buf_to_obj(dma_buf);void *vaddr; - vaddr =i915_gem_object_pin_map_unlocked (obj,I915_MAP_WB ); + vaddr =i915_gem_object_pin_map (obj,I915_MAP_WB );if (IS_ERR (vaddr))return PTR_ERR (vaddr);drivers/gpu/drm/i915/gem/i915_gem_object.c +0
-0@@ -331,7 +331,19 @@ static void __i915_gem_free_objects(struct drm_i915_private *i915,
drivers/gpu/drm/i915/gem/i915_gem_object.c static void __i915_gem_free_objects(struct · line 341
Quoted 10 lines
drivers/gpu/drm/i915/gem/i915_gem_object.c +7
-0continue ; } +/* +* dma_buf_unmap_attachment() requires reservation to be +* locked. The imported GEM shouldn't share reservation lock, +* so it's safe to take the lock. +*/ +if (obj->base.import_attach) +i915_gem_object_lock (obj,NULL );
There is a lot of stuff going here. Taking the lock may be premature...
drivers/gpu/drm/i915/gem/i915_gem_object.c static void __i915_gem_free_objects(struct drm_i915_private *i915, · line 342
Quoted 1 line
drivers/gpu/drm/i915/gem/i915_gem_object.c +0
-0__i915_gem_object_pages_fini (obj);
The i915_gem_dmabuf.c:i915_gem_object_put_pages_dmabuf is where unmap_attachment is actually called, would it make more sense to make do the locking there?
Mike
Quoted 92 lines
drivers/gpu/drm/i915/gem/i915_gem_object.c +4
-0+ +if (obj->base.import_attach) +i915_gem_object_unlock (obj); +__i915_gem_free_object (obj);/* But keep the pointer alive for RCU-protected lookups */drivers/gpu/drm/i915/gem/selftests/i915_gem_dmabuf.c +1
-1@@ -213,7 +213,7 @@ static int igt_dmabuf_import_same_driver(structdrm_i915_private *i915, goto out_import; } - st =dma_buf_map_attachment (import_attach, DMA_BIDIRECTIONAL); + st =dma_buf_map_attachment_unlocked (import_attach,DMA_BIDIRECTIONAL );if (IS_ERR(st)) { err = PTR_ERR(st); goto out_detach;drivers/gpu/drm/i915/gem/selftests/i915_gem_dmabuf.c +1
-1@@ -226,7 +226,7 @@ static int igt_dmabuf_import_same_driver(structdrm_i915_private *i915, timeout = -ETIME ; } err = timeout >0 ?0 : timeout; -dma_buf_unmap_attachment (import_attach, st, DMA_BIDIRECTIONAL); +dma_buf_unmap_attachment_unlocked (import_attach, st,DMA_BIDIRECTIONAL );
out_detach:dma_buf_detach(dmabuf, import_attach);
out_import:drivers/gpu/drm/i915/gem/selftests/i915_gem_dmabuf.c +1
-1@@ -296,7 +296,7 @@ static int igt_dmabuf_import(void *arg) goto out_obj; } - err =dma_buf_vmap (dmabuf, &map); + err =dma_buf_vmap_unlocked (dmabuf, &map); dma_map = err ?NULL : map.vaddr;if (!dma_map) {pr_err ("dma_buf_vmap failed\n" );@@ -337,7 +337,7 @@ static int igt_dmabuf_import(void *arg) err =0 ;
out_dma_map:drivers/gpu/drm/i915/gem/selftests/i915_gem_dmabuf.c +1
-1-dma_buf_vunmap (dmabuf, &map); +dma_buf_vunmap_unlocked (dmabuf, &map);
out_obj:i915_gem_object_put(obj);
out_dmabuf:drivers/gpu/drm/i915/gem/selftests/i915_gem_dmabuf.c +4
-4@@ -358,7 +358,7 @@ static int igt_dmabuf_import_ownership(void *arg)if (IS_ERR (dmabuf))return PTR_ERR (dmabuf); - err =dma_buf_vmap (dmabuf, &map); + err =dma_buf_vmap_unlocked (dmabuf, &map); ptr = err ?NULL : map.vaddr;if (!ptr) {pr_err ("dma_buf_vmap failed\n" );@@ -367,7 +367,7 @@ static int igt_dmabuf_import_ownership(void *arg) }memset (ptr,0xc5 ,PAGE_SIZE ); -dma_buf_vunmap (dmabuf, &map); +dma_buf_vunmap_unlocked (dmabuf, &map); obj =to_intel_bo (i915_gem_prime_import (&i915->drm, dmabuf));if (IS_ERR (obj)) {@@ -418,7 +418,7 @@ static int igt_dmabuf_export_vmap(void *arg) }i915_gem_object_put (obj); - err =dma_buf_vmap (dmabuf, &map); + err =dma_buf_vmap_unlocked (dmabuf, &map); ptr = err ?NULL : map.vaddr;if (!ptr) {pr_err ("dma_buf_vmap failed\n" );@@ -435,7 +435,7 @@ static int igt_dmabuf_export_vmap(void *arg)memset (ptr,0xc5 , dmabuf->size); err =0 ; -dma_buf_vunmap (dmabuf, &map); +dma_buf_vunmap_unlocked (dmabuf, &map);out:
dma_buf_put(dmabuf); return err;--
2.37.2
Dmitry Osipenko
maintainerRe: [PATCH v4 06/21] drm/i915: Prepare to dynamic dma-buf locking specification
01.09.2022 17:02, Ruhl, Michael J пишет:
...
Quoted 17 lines
Quoted 4 lines
drivers/gpu/drm/i915/gem/i915_gem_object.c +0
-0@@ -331,7 +331,19 @@ static void __i915_gem_free_objects(struct drm_i915_private *i915,drivers/gpu/drm/i915/gem/i915_gem_object.c static void __i915_gem_free_objects(struct · line 341
Quoted 10 lines
drivers/gpu/drm/i915/gem/i915_gem_object.c +7
-0continue ; } +/* +* dma_buf_unmap_attachment() requires reservation to be +* locked. The imported GEM shouldn't share reservation lock, +* so it's safe to take the lock. +*/ +if (obj->base.import_attach) +i915_gem_object_lock (obj,NULL );There is a lot of stuff going here. Taking the lock may be premature...
Quoted 5 lines
drivers/gpu/drm/i915/gem/i915_gem_object.c static void __i915_gem_free_objects(struct drm_i915_private *i915, · line 342
Quoted 1 line
drivers/gpu/drm/i915/gem/i915_gem_object.c +0
-0__i915_gem_object_pages_fini (obj);The i915_gem_dmabuf.c:i915_gem_object_put_pages_dmabuf is where
unmap_attachmentis actually called, would it make more sense to make do the locking there?
The __i915_gem_object_put_pages() is invoked with a held reservation lock, while freeing object is a special time when we know that GEM is unused.
The __i915_gem_free_objects() was taking the lock two weeks ago until the change made Chris Wilson [1] reached linux-next.
I don't think we can take the lock within i915_gem_object_put_pages_dmabuf(), it may/should deadlock other code paths.
Dmitry Osipenko
maintainerRe: [PATCH v4 06/21] drm/i915: Prepare to dynamic dma-buf locking specification
02.09.2022 13:31, Dmitry Osipenko пишет:
Quoted 29 lines
01.09.2022 17:02, Ruhl, Michael J пишет:
...Quoted 17 lines
Quoted 4 lines
drivers/gpu/drm/i915/gem/i915_gem_object.c +0
-0@@ -331,7 +331,19 @@ static void __i915_gem_free_objects(struct drm_i915_private *i915,drivers/gpu/drm/i915/gem/i915_gem_object.c static void __i915_gem_free_objects(struct · line 341
Quoted 10 lines
drivers/gpu/drm/i915/gem/i915_gem_object.c +7
-0continue ; } +/* +* dma_buf_unmap_attachment() requires reservation to be +* locked. The imported GEM shouldn't share reservation lock, +* so it's safe to take the lock. +*/ +if (obj->base.import_attach) +i915_gem_object_lock (obj,NULL );There is a lot of stuff going here. Taking the lock may be premature...
Quoted 5 lines
drivers/gpu/drm/i915/gem/i915_gem_object.c static void __i915_gem_free_objects(struct drm_i915_private *i915, · line 342
Quoted 1 line
drivers/gpu/drm/i915/gem/i915_gem_object.c +0
-0__i915_gem_object_pages_fini (obj);The i915_gem_dmabuf.c:i915_gem_object_put_pages_dmabuf is where
unmap_attachmentis actually called, would it make more sense to make do the locking there?The
__i915_gem_object_put_pages()is invoked with a held reservation lock, while freeing object is a special time when we know that GEM is unused.
Quoted 8 lines
The
__i915_gem_free_objects()was taking the lock two weeks ago until the change made Chris Wilson [1] reached linux-next.I don't think we can take the lock within
i915_gem_object_put_pages_dmabuf(), it may/should deadlock other code paths.
On the other hand, we can check whether the GEM's refcount number is zero in i915_gem_object_put_pages_dmabuf() and then take the lock if it's zero.
Also, seems it should be possible just to bail out from i915_gem_object_put_pages_dmabuf() if refcount=0. The further drm_prime_gem_destroy() will take care of unmapping. Perhaps this could be the best option, I'll give it a test.
RE: [PATCH v4 06/21] drm/i915: Prepare to dynamic dma-buf locking specification
Quoted 79 lines
-----Original Message-----
From: Dmitry Osipenko <[email protected]>
Sent: Friday, September 2, 2022 6:39 AM
To: Ruhl, Michael J <[email protected]>; Dmitry Osipenko <[email protected]>; Jani Nikula <[email protected]>; Joonas Lahtinen <[email protected]>; Vivi, Rodrigo <[email protected]>; Tvrtko Ursulin <[email protected]>; Thomas Hellström <[email protected]>; Christian König <[email protected]>; Chris Wilson <[email protected]>
Cc: [email protected]; [email protected]; linux- [email protected]; [email protected]; amd- [email protected]; [email protected]; [email protected]; [email protected]; linux- [email protected]; [email protected]; David Airlie <[email protected]>; Gerd Hoffmann <[email protected]>; Gurchetan Singh <[email protected]>; Chia-I Wu <[email protected]>; Daniel Vetter <[email protected]>; Daniel Almeida <[email protected]>; Gert Wollny <[email protected]>; Gustavo Padovan <[email protected]>; Daniel Stone <[email protected]>; Tomeu Vizoso <[email protected]>; Maarten Lankhorst <[email protected]>; Maxime Ripard <[email protected]>; Thomas Zimmermann <[email protected]>; Rob Clark <[email protected]>; Sumit Semwal <[email protected]>; Pan, Xinhui <[email protected]>; Thierry Reding <[email protected]>; Tomasz Figa <[email protected]>; Marek Szyprowski <[email protected]>; Mauro Carvalho Chehab <[email protected]>; Alex Deucher <[email protected]>; Qiang Yu <[email protected]>; Srinivas Kandagatla <[email protected]>; Amol Maheshwari <[email protected]>; Jason Gunthorpe <[email protected]>; Leon Romanovsky <[email protected]>; Gross, Jurgen <[email protected]>; Stefano Stabellini <[email protected]>; Oleksandr Tyshchenko <[email protected]>; Tomi Valkeinen <[email protected]>; Russell King <[email protected]>; Lucas Stach <[email protected]>; Christian Gmeiner <[email protected]>
Subject: Re: [PATCH v4 06/21] drm/i915: Prepare to dynamic dma-buf locking specification02.09.2022 13:31, Dmitry Osipenko пишет:
Quoted 29 lines
01.09.2022 17:02, Ruhl, Michael J пишет:
...Quoted 17 lines
Quoted 4 lines
drivers/gpu/drm/i915/gem/i915_gem_object.c +0
-0@@ -331,7 +331,19 @@ static void __i915_gem_free_objects(struct drm_i915_private *i915,drivers/gpu/drm/i915/gem/i915_gem_object.c static void __i915_gem_free_objects(struct · line 341
Quoted 10 lines
drivers/gpu/drm/i915/gem/i915_gem_object.c +7
-0continue ; } +/* +* dma_buf_unmap_attachment() requires reservation to be +* locked. The imported GEM shouldn't share reservation lock, +* so it's safe to take the lock. +*/ +if (obj->base.import_attach) +i915_gem_object_lock (obj,NULL );There is a lot of stuff going here. Taking the lock may be premature...
Quoted 5 lines
drivers/gpu/drm/i915/gem/i915_gem_object.c static void __i915_gem_free_objects(struct drm_i915_private *i915, · line 342
Quoted 1 line
drivers/gpu/drm/i915/gem/i915_gem_object.c +0
-0__i915_gem_object_pages_fini (obj);The i915_gem_dmabuf.c:i915_gem_object_put_pages_dmabuf is where
unmap_attachmentis actually called, would it make more sense to make do the locking there?The
__i915_gem_object_put_pages()is invoked with a held reservation lock, while freeing object is a special time when we know that GEM is unused.Quoted 5 lines
The
__i915_gem_free_objects()was taking the lock two weeks ago until the change made Chris Wilson [1] reached linux-next.[1]
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=2826d447fbd60e6a05e53d5f918bceb8c04e315c
Quoted 3 lines
I don't think we can take the lock within
i915_gem_object_put_pages_dmabuf(), it may/should deadlock other codepaths.
Quoted 8 lines
On the other hand, we can check whether the GEM's refcount number is zero in
i915_gem_object_put_pages_dmabuf()and then take the lock if it's zero.Also, seems it should be possible just to bail out from
i915_gem_object_put_pages_dmabuf()if refcount=0. The furtherdrm_prime_gem_destroy()will take care of unmapping. Perhaps this could be the best option, I'll give it a test.
i915_gem_object_put_pages() is uses the SG, and the usage for drm_prim_gem_destroy()
from __i915_gem_free_objects() doesn't use the SG because it has been "freed" already, I am not sure if that would work...
Hmm.. with that in mind, maybe moving the base.import_attach check to __i915_gem_object_put_pages with your attach check?
atomic_set(&obj->mm.pages_pin_count, 0); if (obj->base.import) i915_gem_object_lock(obj, NULL); __i915_gem_object_put_pages(obj); if (obj->base.import) i915_gem_object_unlock(obj, NULL); GEM_BUG_ON(i915_gem_object_has_pages(obj));
Pretty much one step up from the dmabuf interface, but we are guaranteed to not have any pinned pages?
The other caller of __i915_gem_object_pages_fini is the i915_ttm move_notify which should not conflict (export side, not import side).
Since it appears that not locking during the clean up is desirable, trying to make sure take the lock is taken at the last moment might be the right path?
M
Re: [PATCH v4 06/21] drm/i915: Prepare to dynamic dma-buf locking specification
Quoted 50 lines · Michael J
Quoted 41 lines
02.09.2022 13:31, Dmitry Osipenko пишет:
Quoted 29 lines
01.09.2022 17:02, Ruhl, Michael J пишет:
...Quoted 17 lines
Quoted 4 lines
drivers/gpu/drm/i915/gem/i915_gem_object.c +0
-0@@ -331,7 +331,19 @@ static void __i915_gem_free_objects(struct drm_i915_private *i915,drivers/gpu/drm/i915/gem/i915_gem_object.c static void __i915_gem_free_objects(struct · line 341
Quoted 10 lines
drivers/gpu/drm/i915/gem/i915_gem_object.c +7
-0continue ; } +/* +* dma_buf_unmap_attachment() requires reservation to be +* locked. The imported GEM shouldn't share reservation lock, +* so it's safe to take the lock. +*/ +if (obj->base.import_attach) +i915_gem_object_lock (obj,NULL );There is a lot of stuff going here. Taking the lock may be premature...
Quoted 5 lines
drivers/gpu/drm/i915/gem/i915_gem_object.c static void __i915_gem_free_objects(struct drm_i915_private *i915, · line 342
Quoted 1 line
drivers/gpu/drm/i915/gem/i915_gem_object.c +0
-0__i915_gem_object_pages_fini (obj);The i915_gem_dmabuf.c:i915_gem_object_put_pages_dmabuf is where
unmap_attachmentis actually called, would it make more sense to make do the locking there?The
__i915_gem_object_put_pages()is invoked with a held reservation lock, while freeing object is a special time when we know that GEM is unused.Quoted 5 lines
The
__i915_gem_free_objects()was taking the lock two weeks ago until the change made Chris Wilson [1] reached linux-next.[1]
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=2826d447fbd60e6a05e53d5f918bceb8c04e315c
Quoted 3 lines
I don't think we can take the lock within
i915_gem_object_put_pages_dmabuf(), it may/should deadlock other codepaths.
Quoted 8 lines
On the other hand, we can check whether the GEM's refcount number is zero in
i915_gem_object_put_pages_dmabuf()and then take the lock if it's zero.Also, seems it should be possible just to bail out from
i915_gem_object_put_pages_dmabuf()if refcount=0. The furtherdrm_prime_gem_destroy()will take care of unmapping. Perhaps this could be the best option, I'll give it a test.
Quoted 8 lines
i915_gem_object_put_pages()is uses the SG, and the usage fordrm_prim_gem_destroy()from
__i915_gem_free_objects()doesn't use the SG because it has been "freed" already, I am not sure if that would work...Hmm.. with that in mind, maybe moving the base.import_attach check to
__i915_gem_object_put_pageswith your attach check?
I see you meant __i915_gem_object_pages_fini() here.
Quoted 10 lines
atomic_set(&obj->mm.pages_pin_count, 0); if (obj->base.import) i915_gem_object_lock(obj, NULL); __i915_gem_object_put_pages(obj); if (obj->base.import) i915_gem_object_unlock(obj, NULL); GEM_BUG_ON(i915_gem_object_has_pages(obj));
Quoted 2 lines
Pretty much one step up from the dmabuf interface, but we are guaranteed to not have any pinned pages?
Importer shouldn't hold pages outside of dma-buf API, otherwise it should be a bug.
Quoted 5 lines
The other caller of
__i915_gem_object_pages_finiis thei915_ttmmove_notifywhich should not conflict (export side, not import side).Since it appears that not locking during the clean up is desirable, trying to make sure take the lock is taken at the last moment might be the right path?
Reducing the scope of locking usually is preferred more. Yours suggestion works okay, I couldn't spot any problems at least for a non-TTM code paths.
It's indeed a bit not nice that __i915_gem_object_pages_fini() is used by TTM, but should be safe for imported objects. Will be great if anyone from i915 maintainers could ack this variant.
Signature · 2 lines
Best regards, Dmitry
PATCH v4 7/21 drm/omapdrm: Prepare to dynamic dma-buf locking specification
In reply to Dmitry OsipenkoPrepare OMAP DRM driver to the common dynamic dma-buf locking convention by starting to use the unlocked versions of dma-buf API functions.
--- drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c +2 -2
@@ -125,7 +125,7 @@ struct drm_gem_object *omap_gem_prime_import(struct drm_device *dev,get_dma_buf (dma_buf); - sgt =dma_buf_map_attachment (attach,DMA_TO_DEVICE ); + sgt =dma_buf_map_attachment_unlocked (attach,DMA_TO_DEVICE );if (IS_ERR (sgt)) { ret =PTR_ERR (sgt); goto fail_detach;
@@ -142,7 +142,7 @@ struct drm_gem_object *omap_gem_prime_import(struct drm_device *dev,return obj; fail_unmap: -dma_buf_unmap_attachment (attach, sgt,DMA_TO_DEVICE ); +dma_buf_unmap_attachment_unlocked (attach, sgt,DMA_TO_DEVICE ); fail_detach:dma_buf_detach (dma_buf, attach);dma_buf_put (dma_buf);
Signature · 1 line
2.37.2
Re: [Linaro-mm-sig] [PATCH v4 07/21] drm/omapdrm: Prepare to dynamic dma-buf locking specification
Am 31.08.22 um 17:37 schrieb Dmitry Osipenko:
Quoted 4 lines
Prepare OMAP DRM driver to the common dynamic dma-buf locking convention by starting to use the unlocked versions of dma-buf API functions.
Signed-off-by Dmitry Osipenko <[email protected]>
Quoted 18 lines
--- drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c +1
-1@@ -125,7 +125,7 @@ struct drm_gem_object *omap_gem_prime_import(struct drm_device *dev,get_dma_buf (dma_buf); - sgt =dma_buf_map_attachment (attach,DMA_TO_DEVICE ); + sgt =dma_buf_map_attachment_unlocked (attach,DMA_TO_DEVICE );if (IS_ERR (sgt)) { ret =PTR_ERR (sgt); goto fail_detach;
drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c struct drm_gem_object *omap_gem_prime_import(struct drm_device *dev, · line 148
Quoted 8 lines
drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c +1
-1@@ -142,7 +142,7 @@ struct drm_gem_object *omap_gem_prime_import(struct drm_device *dev,return obj; fail_unmap: -dma_buf_unmap_attachment (attach, sgt,DMA_TO_DEVICE ); +dma_buf_unmap_attachment_unlocked (attach, sgt,DMA_TO_DEVICE ); fail_detach:dma_buf_detach (dma_buf, attach);dma_buf_put (dma_buf);
_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
PATCH v4 8/21 drm/tegra: Prepare to dynamic dma-buf locking specification
In reply to Dmitry OsipenkoPrepare Tegra DRM driver to the common dynamic dma-buf locking convention by starting to use the unlocked versions of dma-buf API functions.
--- drivers/gpu/drm/tegra/gem.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-)
drivers/gpu/drm/tegra/gem.c +9 -8
@@ -84,7 +84,7 @@ static struct host1x_bo_mapping *tegra_bo_pin(struct device *dev, struct host1x_ goto free; } - map->sgt =dma_buf_map_attachment (map->attach, direction); + map->sgt =dma_buf_map_attachment_unlocked (map->attach, direction);if (IS_ERR (map->sgt)) {dma_buf_detach (buf, map->attach); err =PTR_ERR (map->sgt);
@@ -160,7 +160,8 @@ static struct host1x_bo_mapping *tegra_bo_pin(struct device *dev, struct host1x_static void tegra_bo_unpin (struct host1x_bo_mapping *map) {if (map->attach) { -dma_buf_unmap_attachment (map->attach, map->sgt, map->direction); +dma_buf_unmap_attachment_unlocked (map->attach, map->sgt, + map->direction);dma_buf_detach (map->attach->dmabuf, map->attach); }else {dma_unmap_sgtable (map->dev, map->sgt, map->direction,0 );
@@ -181,7 +182,7 @@ static void *tegra_bo_mmap(struct host1x_bo *bo)if (obj->vaddr) {return obj->vaddr; }else if (obj->gem.import_attach) { - ret =dma_buf_vmap (obj->gem.import_attach->dmabuf, &map); + ret =dma_buf_vmap_unlocked (obj->gem.import_attach->dmabuf, &map);return ret ?NULL : map.vaddr; }else { return vmap(obj->pages, obj->num_pages, VM_MAP,
@@ -197,7 +198,7 @@ static void tegra_bo_munmap(struct host1x_bo *bo, void *addr)if (obj->vaddr)return ;else if (obj->gem.import_attach) -dma_buf_vunmap (obj->gem.import_attach->dmabuf, &map); +dma_buf_vunmap_unlocked (obj->gem.import_attach->dmabuf, &map);else vunmap (addr); }
@@ -461,7 +462,7 @@ static struct tegra_bo *tegra_bo_import(struct drm_device *drm,get_dma_buf (buf); - bo->sgt =dma_buf_map_attachment (attach,DMA_TO_DEVICE ); + bo->sgt =dma_buf_map_attachment_unlocked (attach,DMA_TO_DEVICE );if (IS_ERR (bo->sgt)) { err =PTR_ERR (bo->sgt); goto detach;
@@ -479,7 +480,7 @@ static struct tegra_bo *tegra_bo_import(struct drm_device *drm, detach:if (!IS_ERR_OR_NULL (bo->sgt)) -dma_buf_unmap_attachment (attach, bo->sgt,DMA_TO_DEVICE ); +dma_buf_unmap_attachment_unlocked (attach, bo->sgt,DMA_TO_DEVICE );dma_buf_detach (buf, attach);dma_buf_put (buf);
@@ -508,8 +509,8 @@ void tegra_bo_free_object(struct drm_gem_object *gem)tegra_bo_iommu_unmap (tegra, bo);if (gem->import_attach) { -dma_buf_unmap_attachment (gem->import_attach, bo->sgt, -DMA_TO_DEVICE ); +dma_buf_unmap_attachment_unlocked (gem->import_attach, bo->sgt, +DMA_TO_DEVICE );drm_prime_gem_destroy (gem,NULL ); }else {tegra_bo_free (gem->dev, bo);
Signature · 1 line
2.37.2
Re: [PATCH v4 08/21] drm/tegra: Prepare to dynamic dma-buf locking specification
Am 31.08.22 um 17:37 schrieb Dmitry Osipenko:
Quoted 4 lines
Prepare Tegra DRM driver to the common dynamic dma-buf locking convention by starting to use the unlocked versions of dma-buf API functions.
Signed-off-by Dmitry Osipenko <[email protected]>
Quoted 74 lines
--- drivers/gpu/drm/tegra/gem.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-)drivers/gpu/drm/tegra/gem.c +9
-8@@ -84,7 +84,7 @@ static struct host1x_bo_mapping *tegra_bo_pin(struct device *dev, struct host1x_ goto free; } - map->sgt =dma_buf_map_attachment (map->attach, direction); + map->sgt =dma_buf_map_attachment_unlocked (map->attach, direction);if (IS_ERR (map->sgt)) {dma_buf_detach (buf, map->attach); err =PTR_ERR (map->sgt);@@ -160,7 +160,8 @@ static struct host1x_bo_mapping *tegra_bo_pin(struct device *dev, struct host1x_static void tegra_bo_unpin (struct host1x_bo_mapping *map) {if (map->attach) { -dma_buf_unmap_attachment (map->attach, map->sgt, map->direction); +dma_buf_unmap_attachment_unlocked (map->attach, map->sgt, + map->direction);dma_buf_detach (map->attach->dmabuf, map->attach); }else {dma_unmap_sgtable (map->dev, map->sgt, map->direction,0 );@@ -181,7 +182,7 @@ static void *tegra_bo_mmap(struct host1x_bo *bo)if (obj->vaddr) {return obj->vaddr; }else if (obj->gem.import_attach) { - ret =dma_buf_vmap (obj->gem.import_attach->dmabuf, &map); + ret =dma_buf_vmap_unlocked (obj->gem.import_attach->dmabuf, &map);return ret ?NULL : map.vaddr; }else { return vmap(obj->pages, obj->num_pages, VM_MAP,@@ -197,7 +198,7 @@ static void tegra_bo_munmap(struct host1x_bo *bo, void *addr)if (obj->vaddr)return ;else if (obj->gem.import_attach) -dma_buf_vunmap (obj->gem.import_attach->dmabuf, &map); +dma_buf_vunmap_unlocked (obj->gem.import_attach->dmabuf, &map);else vunmap (addr); }@@ -461,7 +462,7 @@ static struct tegra_bo *tegra_bo_import(struct drm_device *drm,get_dma_buf (buf); - bo->sgt =dma_buf_map_attachment (attach,DMA_TO_DEVICE ); + bo->sgt =dma_buf_map_attachment_unlocked (attach,DMA_TO_DEVICE );if (IS_ERR (bo->sgt)) { err =PTR_ERR (bo->sgt); goto detach;@@ -479,7 +480,7 @@ static struct tegra_bo *tegra_bo_import(struct drm_device *drm, detach:if (!IS_ERR_OR_NULL (bo->sgt)) -dma_buf_unmap_attachment (attach, bo->sgt,DMA_TO_DEVICE ); +dma_buf_unmap_attachment_unlocked (attach, bo->sgt,DMA_TO_DEVICE );dma_buf_detach (buf, attach);dma_buf_put (buf);@@ -508,8 +509,8 @@ void tegra_bo_free_object(struct drm_gem_object *gem)tegra_bo_iommu_unmap (tegra, bo);if (gem->import_attach) { -dma_buf_unmap_attachment (gem->import_attach, bo->sgt, -DMA_TO_DEVICE ); +dma_buf_unmap_attachment_unlocked (gem->import_attach, bo->sgt, +DMA_TO_DEVICE );drm_prime_gem_destroy (gem,NULL ); }else {tegra_bo_free (gem->dev, bo);
PATCH v4 9/21 drm/etnaviv: Prepare to dynamic dma-buf locking specification
In reply to Dmitry OsipenkoPrepare Etnaviv driver to the common dynamic dma-buf locking convention by starting to use the unlocked versions of dma-buf API functions.
--- drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c +1 -1
@@ -65,7 +65,7 @@ static void etnaviv_gem_prime_release(struct etnaviv_gem_object *etnaviv_obj)struct iosys_map map =IOSYS_MAP_INIT_VADDR (etnaviv_obj->vaddr);if (etnaviv_obj->vaddr) -dma_buf_vunmap (etnaviv_obj->base.import_attach->dmabuf, &map); +dma_buf_vunmap_unlocked (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:
Signature · 1 line
2.37.2
Christian König
maintainerRe: [PATCH v4 09/21] drm/etnaviv: Prepare to dynamic dma-buf locking specification
Am 31.08.22 um 17:37 schrieb Dmitry Osipenko:
Quoted 4 lines
Prepare Etnaviv driver to the common dynamic dma-buf locking convention by starting to use the unlocked versions of dma-buf API functions.
Signed-off-by Dmitry Osipenko <[email protected]>
Interesting, where is the matching vmap()?
Anyway, this patch is Acked-by: Christian König <[email protected]>
Quoted 17 lines
--- drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c +1
-1@@ -65,7 +65,7 @@ static void etnaviv_gem_prime_release(struct etnaviv_gem_object *etnaviv_obj)struct iosys_map map =IOSYS_MAP_INIT_VADDR (etnaviv_obj->vaddr);if (etnaviv_obj->vaddr) -dma_buf_vunmap (etnaviv_obj->base.import_attach->dmabuf, &map); +dma_buf_vunmap_unlocked (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:
Re: [PATCH v4 09/21] drm/etnaviv: Prepare to dynamic dma-buf locking specification
Quoted 9 lines · Christian König
Am 31.08.22 um 17:37 schrieb Dmitry Osipenko:
Quoted 4 lines
Prepare Etnaviv driver to the common dynamic dma-buf locking convention by starting to use the unlocked versions of dma-buf API functions.
Signed-off-by Dmitry Osipenko <[email protected]>Interesting, where is the matching
vmap()?Anyway, this patch is Acked-by: Christian König <[email protected]>
Etnaviv maps GEM only once and then unmaps it when GEM is destroyed. The dma-buf vmapping should happen under the reservation lock, hence only the release function needs to be changed to the unlocked variant.
Lucas/Christian(Gmeiner), could you please check that I haven't missed anything?
Quoted 19 lines
Quoted 18 lines
---
drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c +1
-1@@ -65,7 +65,7 @@ static void etnaviv_gem_prime_release(struct etnaviv_gem_object *etnaviv_obj) struct iosys_map map = IOSYS_MAP_INIT_VADDR(etnaviv_obj->vaddr); if (etnaviv_obj->vaddr) - dma_buf_vunmap(etnaviv_obj->base.import_attach->dmabuf, &map); +dma_buf_vunmap_unlocked (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:
Signature · 2 lines
Best regards, Dmitry
Re: [PATCH v4 09/21] drm/etnaviv: Prepare to dynamic dma-buf locking specification
In reply to Christian KönigTo whoom it may belong: Deepest sorrow to inform you that my husband Helmut passed by on July 21. This access will be cleared in a view days. Irene
-------- Ursprüngliche Nachricht --------Von: Christian König <[email protected]> Datum: 01.09.22 08:50 (GMT+01:00) An: Dmitry Osipenko <[email protected]>, David Airlie <[email protected]>, Gerd Hoffmann <[email protected]>, Gurchetan Singh <[email protected]>, Chia-I Wu <[email protected]>, Daniel Vetter <[email protected]>, Daniel Almeida <[email protected]>, Gert Wollny <[email protected]>, Gustavo Padovan <[email protected]>, Daniel Stone <[email protected]>, Tomeu Vizoso <[email protected]>, Maarten Lankhorst <[email protected]>, Maxime Ripard <[email protected]>, Thomas Zimmermann <[email protected]>, Rob Clark <[email protected]>, Sumit Semwal <[email protected]>, "Pan, Xinhui" <[email protected]>, Thierry Reding <[email protected]>, Tomasz Figa <[email protected]>, Marek Szyprowski <[email protected]>, Mauro Carvalho Chehab <[email protected]>, Alex Deucher <[email protected]>, Jani Nikula <[email protected]>, Joonas Lahtinen <[email protected]>, Rodrigo Vivi <[email protected]>, Tvrtko Ursulin <[email protected]>, Thomas Hellström <[email protected]>, Qiang Yu <[email protected]>, Srinivas Kandagatla <[email protected]>, Amol Maheshwari <[email protected]>, Jason Gunthorpe <[email protected]>, Leon Romanovsky <[email protected]>, Juergen Gross <[email protected]>, Stefano Stabellini <[email protected]>, Oleksandr Tyshchenko <[email protected]>, Tomi Valkeinen <[email protected]>, Russell King <[email protected]>, Lucas Stach <[email protected]>, Christian Gmeiner <[email protected]> Cc: [email protected], [email protected], Dmitry Osipenko <[email protected]>, [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected] Betreff: Re: [PATCH v4 09/21] drm/etnaviv: Prepare to dynamic dma-buf locking
specification Am 31.08.22 um 17:37 schrieb Dmitry Osipenko:> Prepare Etnaviv driver to the common dynamic dma-buf locking convention> by starting to use the unlocked versions of dma-buf API functions.>> Signed-off-by: Dmitry Osipenko <[email protected]>Interesting, where is the matching vmap()?Anyway, this patch is Acked-by: Christian König <[email protected]>> ---> drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c | 2 +-> 1 file changed, 1 insertion(+), 1 deletion(-)>> diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c b/drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c> index 3fa2da149639..7031db145a77 100644> --- a/drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c> +++ b/drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c> @@ -65,7 +65,7 @@ static void etnaviv_gem_prime_release(struct etnaviv_gem_object *etnaviv_obj)> struct iosys_map map = IOSYS_MAP_INIT_VADDR(etnaviv_obj->vaddr);> > if (etnaviv_obj->vaddr)> - dma_buf_vunmap(etnaviv_obj->base.import_attach->dmabuf, &map);> + dma_buf_vunmap_unlocked(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:
Re: [PATCH v4 09/21] drm/etnaviv: Prepare to dynamic dma-buf locking specification
In reply to Christian KönigTo whoom it may belong: Deepest sorrow to inform you that my husband Helmut passed by on July 21. This access will be cleared in a view days. Irene
-------- Ursprüngliche Nachricht --------Von: Christian König <[email protected]> Datum: 01.09.22 08:50 (GMT+01:00) An: Dmitry Osipenko <[email protected]>, David Airlie <[email protected]>, Gerd Hoffmann <[email protected]>, Gurchetan Singh <[email protected]>, Chia-I Wu <[email protected]>, Daniel Vetter <[email protected]>, Daniel Almeida <[email protected]>, Gert Wollny <[email protected]>, Gustavo Padovan <[email protected]>, Daniel Stone <[email protected]>, Tomeu Vizoso <[email protected]>, Maarten Lankhorst <[email protected]>, Maxime Ripard <[email protected]>, Thomas Zimmermann <[email protected]>, Rob Clark <[email protected]>, Sumit Semwal <[email protected]>, "Pan, Xinhui" <[email protected]>, Thierry Reding <[email protected]>, Tomasz Figa <[email protected]>, Marek Szyprowski <[email protected]>, Mauro Carvalho Chehab <[email protected]>, Alex Deucher <[email protected]>, Jani Nikula <[email protected]>, Joonas Lahtinen <[email protected]>, Rodrigo Vivi <[email protected]>, Tvrtko Ursulin <[email protected]>, Thomas Hellström <[email protected]>, Qiang Yu <[email protected]>, Srinivas Kandagatla <[email protected]>, Amol Maheshwari <[email protected]>, Jason Gunthorpe <[email protected]>, Leon Romanovsky <[email protected]>, Juergen Gross <[email protected]>, Stefano Stabellini <[email protected]>, Oleksandr Tyshchenko <[email protected]>, Tomi Valkeinen <[email protected]>, Russell King <[email protected]>, Lucas Stach <[email protected]>, Christian Gmeiner <[email protected]> Cc: [email protected], [email protected], Dmitry Osipenko <[email protected]>, [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected] Betreff: Re: [PATCH v4 09/21] drm/etnaviv: Prepare to dynamic dma-buf locking
specification Am 31.08.22 um 17:37 schrieb Dmitry Osipenko:> Prepare Etnaviv driver to the common dynamic dma-buf locking convention> by starting to use the unlocked versions of dma-buf API functions.>> Signed-off-by: Dmitry Osipenko <[email protected]>Interesting, where is the matching vmap()?Anyway, this patch is Acked-by: Christian König <[email protected]>> ---> drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c | 2 +-> 1 file changed, 1 insertion(+), 1 deletion(-)>> diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c b/drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c> index 3fa2da149639..7031db145a77 100644> --- a/drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c> +++ b/drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c> @@ -65,7 +65,7 @@ static void etnaviv_gem_prime_release(struct etnaviv_gem_object *etnaviv_obj)> struct iosys_map map = IOSYS_MAP_INIT_VADDR(etnaviv_obj->vaddr);> > if (etnaviv_obj->vaddr)> - dma_buf_vunmap(etnaviv_obj->base.import_attach->dmabuf, &map);> + dma_buf_vunmap_unlocked(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:
Re: [Intel-gfx] [PATCH v4 09/21] drm/etnaviv: Prepare to dynamic dma-buf locking specification
In reply to Christian KönigTo whoom it may belong: Deepest sorrow to inform you that my husband Helmut passed by on July 21. This access will be cleared in a view days. Irene
-------- Ursprüngliche Nachricht --------Von: Christian König <[email protected]> Datum: 01.09.22 08:50 (GMT+01:00) An: Dmitry Osipenko <[email protected]>, David Airlie <[email protected]>, Gerd Hoffmann <[email protected]>, Gurchetan Singh <[email protected]>, Chia-I Wu <[email protected]>, Daniel Vetter <[email protected]>, Daniel Almeida <[email protected]>, Gert Wollny <[email protected]>, Gustavo Padovan <[email protected]>, Daniel Stone <[email protected]>, Tomeu Vizoso <[email protected]>, Maarten Lankhorst <[email protected]>, Maxime Ripard <[email protected]>, Thomas Zimmermann <[email protected]>, Rob Clark <[email protected]>, Sumit Semwal <[email protected]>, "Pan, Xinhui" <[email protected]>, Thierry Reding <[email protected]>, Tomasz Figa <[email protected]>, Marek Szyprowski <[email protected]>, Mauro Carvalho Chehab <[email protected]>, Alex Deucher <[email protected]>, Jani Nikula <[email protected]>, Joonas Lahtinen <[email protected]>, Rodrigo Vivi <[email protected]>, Tvrtko Ursulin <[email protected]>, Thomas Hellström <[email protected]>, Qiang Yu <[email protected]>, Srinivas Kandagatla <[email protected]>, Amol Maheshwari <[email protected]>, Jason Gunthorpe <[email protected]>, Leon Romanovsky <[email protected]>, Juergen Gross <[email protected]>, Stefano Stabellini <[email protected]>, Oleksandr Tyshchenko <[email protected]>, Tomi Valkeinen <[email protected]>, Russell King <[email protected]>, Lucas Stach <[email protected]>, Christian Gmeiner <[email protected]> Cc: [email protected], [email protected], Dmitry Osipenko <[email protected]>, [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected] Betreff: Re: [PATCH v4 09/21] drm/etnaviv: Prepare to dynamic dma-buf locking
specification Am 31.08.22 um 17:37 schrieb Dmitry Osipenko:> Prepare Etnaviv driver to the common dynamic dma-buf locking convention> by starting to use the unlocked versions of dma-buf API functions.>> Signed-off-by: Dmitry Osipenko <[email protected]>Interesting, where is the matching vmap()?Anyway, this patch is Acked-by: Christian König <[email protected]>> ---> drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c | 2 +-> 1 file changed, 1 insertion(+), 1 deletion(-)>> diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c b/drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c> index 3fa2da149639..7031db145a77 100644> --- a/drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c> +++ b/drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c> @@ -65,7 +65,7 @@ static void etnaviv_gem_prime_release(struct etnaviv_gem_object *etnaviv_obj)> struct iosys_map map = IOSYS_MAP_INIT_VADDR(etnaviv_obj->vaddr);> > if (etnaviv_obj->vaddr)> - dma_buf_vunmap(etnaviv_obj->base.import_attach->dmabuf, &map);> + dma_buf_vunmap_unlocked(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:
PATCH v4 10/21 RDMA/umem: Prepare to dynamic dma-buf locking specification
In reply to Dmitry OsipenkoPrepare InfiniBand drivers to the common dynamic dma-buf locking convention by starting to use the unlocked versions of dma-buf API functions.
--- drivers/infiniband/core/umem_dmabuf.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/infiniband/core/umem_dmabuf.c +4 -3
@@ -26,7 +26,8 @@ int ib_umem_dmabuf_map_pages(struct ib_umem_dmabuf *umem_dmabuf)if (umem_dmabuf->sgt) goto wait_fence; - sgt =dma_buf_map_attachment (umem_dmabuf->attach,DMA_BIDIRECTIONAL ); + sgt =dma_buf_map_attachment_unlocked (umem_dmabuf->attach, +DMA_BIDIRECTIONAL );if (IS_ERR (sgt))return PTR_ERR (sgt);
@@ -102,8 +103,8 @@ void ib_umem_dmabuf_unmap_pages(struct ib_umem_dmabuf *umem_dmabuf) umem_dmabuf->last_sg_trim =0 ; } -dma_buf_unmap_attachment (umem_dmabuf->attach, umem_dmabuf->sgt, -DMA_BIDIRECTIONAL ); +dma_buf_unmap_attachment_unlocked (umem_dmabuf->attach, umem_dmabuf->sgt, +DMA_BIDIRECTIONAL ); umem_dmabuf->sgt =NULL ; }
Signature · 1 line
2.37.2
Re: [PATCH v4 10/21] RDMA/umem: Prepare to dynamic dma-buf locking specification
Am 31.08.22 um 17:37 schrieb Dmitry Osipenko:
Quoted 5 lines
Prepare InfiniBand drivers to the common dynamic dma-buf locking convention by starting to use the unlocked versions of dma-buf API functions.
Signed-off-by Dmitry Osipenko <[email protected]>
Quoted 29 lines
--- drivers/infiniband/core/umem_dmabuf.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)drivers/infiniband/core/umem_dmabuf.c +4
-3@@ -26,7 +26,8 @@ int ib_umem_dmabuf_map_pages(struct ib_umem_dmabuf *umem_dmabuf)if (umem_dmabuf->sgt) goto wait_fence; - sgt =dma_buf_map_attachment (umem_dmabuf->attach,DMA_BIDIRECTIONAL ); + sgt =dma_buf_map_attachment_unlocked (umem_dmabuf->attach, +DMA_BIDIRECTIONAL );if (IS_ERR (sgt))return PTR_ERR (sgt);@@ -102,8 +103,8 @@ void ib_umem_dmabuf_unmap_pages(struct ib_umem_dmabuf *umem_dmabuf) umem_dmabuf->last_sg_trim =0 ; } -dma_buf_unmap_attachment (umem_dmabuf->attach, umem_dmabuf->sgt, -DMA_BIDIRECTIONAL ); +dma_buf_unmap_attachment_unlocked (umem_dmabuf->attach, umem_dmabuf->sgt, +DMA_BIDIRECTIONAL ); umem_dmabuf->sgt =NULL ; }
PATCH v4 11/21 misc: fastrpc: Prepare to dynamic dma-buf locking specification
In reply to Dmitry OsipenkoPrepare fastrpc to the common dynamic dma-buf locking convention by starting to use the unlocked versions of dma-buf API functions.
--- drivers/misc/fastrpc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/misc/fastrpc.c +3 -3
@@ -310,8 +310,8 @@ static void fastrpc_free_map(struct kref *ref)return ; } } -dma_buf_unmap_attachment (map->attach, map->table, -DMA_BIDIRECTIONAL ); +dma_buf_unmap_attachment_unlocked (map->attach, map->table, +DMA_BIDIRECTIONAL );dma_buf_detach (map->buf, map->attach);dma_buf_put (map->buf); }
@@ -726,7 +726,7 @@ static int fastrpc_map_create(struct fastrpc_user *fl, int fd, goto attach_err; } - map->table =dma_buf_map_attachment (map->attach,DMA_BIDIRECTIONAL ); + map->table =dma_buf_map_attachment_unlocked (map->attach,DMA_BIDIRECTIONAL );if (IS_ERR (map->table)) { err =PTR_ERR (map->table); goto map_err;
Signature · 1 line
2.37.2
Re: [PATCH v4 11/21] misc: fastrpc: Prepare to dynamic dma-buf locking specification
Am 31.08.22 um 17:37 schrieb Dmitry Osipenko:
Quoted 4 lines
Prepare fastrpc to the common dynamic dma-buf locking convention by starting to use the unlocked versions of dma-buf API functions.
Signed-off-by Dmitry Osipenko <[email protected]>
Quoted 28 lines
--- drivers/misc/fastrpc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)drivers/misc/fastrpc.c +3
-3@@ -310,8 +310,8 @@ static void fastrpc_free_map(struct kref *ref)return ; } } -dma_buf_unmap_attachment (map->attach, map->table, -DMA_BIDIRECTIONAL ); +dma_buf_unmap_attachment_unlocked (map->attach, map->table, +DMA_BIDIRECTIONAL );dma_buf_detach (map->buf, map->attach);dma_buf_put (map->buf); }@@ -726,7 +726,7 @@ static int fastrpc_map_create(struct fastrpc_user *fl, int fd, goto attach_err; } - map->table =dma_buf_map_attachment (map->attach,DMA_BIDIRECTIONAL ); + map->table =dma_buf_map_attachment_unlocked (map->attach,DMA_BIDIRECTIONAL );if (IS_ERR (map->table)) { err =PTR_ERR (map->table); goto map_err;
Re: [PATCH v4 11/21] misc: fastrpc: Prepare to dynamic dma-buf locking specification
In reply to Dmitry OsipenkoQuoted 5 lines · Dmitry Osipenko
Prepare fastrpc to the common dynamic dma-buf locking convention by starting to use the unlocked versions of dma-buf API functions.
Signed-off-by Dmitry Osipenko <[email protected]>---
LGTM,
Incase you plan to take it via another tree.
--srini
Quoted 27 lines
drivers/misc/fastrpc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)drivers/misc/fastrpc.c +3
-3@@ -310,8 +310,8 @@ static void fastrpc_free_map(struct kref *ref)return ; } } -dma_buf_unmap_attachment (map->attach, map->table, -DMA_BIDIRECTIONAL ); +dma_buf_unmap_attachment_unlocked (map->attach, map->table, +DMA_BIDIRECTIONAL );dma_buf_detach (map->buf, map->attach);dma_buf_put (map->buf); }@@ -726,7 +726,7 @@ static int fastrpc_map_create(struct fastrpc_user *fl, int fd, goto attach_err; } - map->table =dma_buf_map_attachment (map->attach,DMA_BIDIRECTIONAL ); + map->table =dma_buf_map_attachment_unlocked (map->attach,DMA_BIDIRECTIONAL );if (IS_ERR (map->table)) { err =PTR_ERR (map->table); goto map_err;
Re: [PATCH v4 11/21] misc: fastrpc: Prepare to dynamic dma-buf locking specification
In reply to Dmitry OsipenkoQuoted 5 lines · Dmitry Osipenko
Prepare fastrpc to the common dynamic dma-buf locking convention by starting to use the unlocked versions of dma-buf API functions.
Signed-off-by Dmitry Osipenko <[email protected]>---
LGTM,
Incase you plan to take it via another tree.
--srini
Quoted 27 lines
drivers/misc/fastrpc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)drivers/misc/fastrpc.c +3
-3@@ -310,8 +310,8 @@ static void fastrpc_free_map(struct kref *ref)return ; } } -dma_buf_unmap_attachment (map->attach, map->table, -DMA_BIDIRECTIONAL ); +dma_buf_unmap_attachment_unlocked (map->attach, map->table, +DMA_BIDIRECTIONAL );dma_buf_detach (map->buf, map->attach);dma_buf_put (map->buf); }@@ -726,7 +726,7 @@ static int fastrpc_map_create(struct fastrpc_user *fl, int fd, goto attach_err; } - map->table =dma_buf_map_attachment (map->attach,DMA_BIDIRECTIONAL ); + map->table =dma_buf_map_attachment_unlocked (map->attach,DMA_BIDIRECTIONAL );if (IS_ERR (map->table)) { err =PTR_ERR (map->table); goto map_err;
PATCH v4 12/21 xen/gntdev: Prepare to dynamic dma-buf locking specification
In reply to Dmitry OsipenkoPrepare gntdev driver to the common dynamic dma-buf locking convention by starting to use the unlocked versions of dma-buf API functions.
--- drivers/xen/gntdev-dmabuf.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/xen/gntdev-dmabuf.c +4 -4
@@ -600,7 +600,7 @@ dmabuf_imp_to_refs(struct gntdev_dmabuf_priv *priv, struct device *dev, gntdev_dmabuf->u.imp.attach = attach; - sgt =dma_buf_map_attachment (attach,DMA_BIDIRECTIONAL ); + sgt =dma_buf_map_attachment_unlocked (attach,DMA_BIDIRECTIONAL );if (IS_ERR (sgt)) { ret =ERR_CAST (sgt); goto fail_detach;
@@ -658,7 +658,7 @@ dmabuf_imp_to_refs(struct gntdev_dmabuf_priv *priv, struct device *dev, fail_end_access:dmabuf_imp_end_foreign_access (gntdev_dmabuf->u.imp.refs, count); fail_unmap: -dma_buf_unmap_attachment (attach, sgt,DMA_BIDIRECTIONAL ); +dma_buf_unmap_attachment_unlocked (attach, sgt,DMA_BIDIRECTIONAL ); fail_detach:dma_buf_detach (dma_buf, attach); fail_free_obj:
@@ -708,8 +708,8 @@ static int dmabuf_imp_release(struct gntdev_dmabuf_priv *priv, u32 fd) attach = gntdev_dmabuf->u.imp.attach;if (gntdev_dmabuf->u.imp.sgt) -dma_buf_unmap_attachment (attach, gntdev_dmabuf->u.imp.sgt, -DMA_BIDIRECTIONAL ); +dma_buf_unmap_attachment_unlocked (attach, gntdev_dmabuf->u.imp.sgt, +DMA_BIDIRECTIONAL ); dma_buf = attach->dmabuf;dma_buf_detach (attach->dmabuf, attach);dma_buf_put (dma_buf);
Signature · 1 line
2.37.2
Re: [PATCH v4 12/21] xen/gntdev: Prepare to dynamic dma-buf locking specification
Quoted 4 lines · Dmitry Osipenko
Prepare gntdev driver to the common dynamic dma-buf locking convention by starting to use the unlocked versions of dma-buf API functions.
Signed-off-by Dmitry Osipenko <[email protected]>
Juergen
_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
Re: [PATCH v4 12/21] xen/gntdev: Prepare to dynamic dma-buf locking specification
In reply to Dmitry OsipenkoAm 31.08.22 um 17:37 schrieb Dmitry Osipenko:
Quoted 4 lines
Prepare gntdev driver to the common dynamic dma-buf locking convention by starting to use the unlocked versions of dma-buf API functions.
Signed-off-by Dmitry Osipenko <[email protected]>
Quoted 37 lines
--- drivers/xen/gntdev-dmabuf.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)drivers/xen/gntdev-dmabuf.c +4
-4@@ -600,7 +600,7 @@ dmabuf_imp_to_refs(struct gntdev_dmabuf_priv *priv, struct device *dev, gntdev_dmabuf->u.imp.attach = attach; - sgt =dma_buf_map_attachment (attach,DMA_BIDIRECTIONAL ); + sgt =dma_buf_map_attachment_unlocked (attach,DMA_BIDIRECTIONAL );if (IS_ERR (sgt)) { ret =ERR_CAST (sgt); goto fail_detach;@@ -658,7 +658,7 @@ dmabuf_imp_to_refs(struct gntdev_dmabuf_priv *priv, struct device *dev, fail_end_access:dmabuf_imp_end_foreign_access (gntdev_dmabuf->u.imp.refs, count); fail_unmap: -dma_buf_unmap_attachment (attach, sgt,DMA_BIDIRECTIONAL ); +dma_buf_unmap_attachment_unlocked (attach, sgt,DMA_BIDIRECTIONAL ); fail_detach:dma_buf_detach (dma_buf, attach); fail_free_obj:@@ -708,8 +708,8 @@ static int dmabuf_imp_release(struct gntdev_dmabuf_priv *priv, u32 fd) attach = gntdev_dmabuf->u.imp.attach;if (gntdev_dmabuf->u.imp.sgt) -dma_buf_unmap_attachment (attach, gntdev_dmabuf->u.imp.sgt, -DMA_BIDIRECTIONAL ); +dma_buf_unmap_attachment_unlocked (attach, gntdev_dmabuf->u.imp.sgt, +DMA_BIDIRECTIONAL ); dma_buf = attach->dmabuf;dma_buf_detach (attach->dmabuf, attach);dma_buf_put (dma_buf);
PATCH v4 13/21 media: videobuf2: Prepare to dynamic dma-buf locking specification
In reply to Dmitry OsipenkoPrepare V4L2 memory allocators to the common dynamic dma-buf locking convention by starting to use the unlocked versions of dma-buf API functions.
--- drivers/media/common/videobuf2/videobuf2-dma-contig.c | 11 ++++++----- drivers/media/common/videobuf2/videobuf2-dma-sg.c | 8 ++++---- drivers/media/common/videobuf2/videobuf2-vmalloc.c | 6 +++--- 3 files changed, 13 insertions(+), 12 deletions(-)
drivers/media/common/videobuf2/videobuf2-dma-contig.c +6 -5
@@ -101,7 +101,7 @@ static void *vb2_dc_vaddr(struct vb2_buffer *vb, void *buf_priv)if (buf->db_attach) {struct iosys_map map; -if (!dma_buf_vmap (buf->db_attach->dmabuf, &map)) +if (!dma_buf_vmap_unlocked (buf->db_attach->dmabuf, &map)) buf->vaddr = map.vaddr;return buf->vaddr;
@@ -711,7 +711,7 @@ static int vb2_dc_map_dmabuf(void *mem_priv) }/* get the associated scatterlist for this buffer */ - sgt =dma_buf_map_attachment (buf->db_attach, buf->dma_dir); + sgt =dma_buf_map_attachment_unlocked (buf->db_attach, buf->dma_dir);if (IS_ERR (sgt)) {pr_err ("Error getting dmabuf scatterlist\n" );return -EINVAL ;
@@ -722,7 +722,8 @@ static int vb2_dc_map_dmabuf(void *mem_priv)if (contig_size < buf->size) {pr_err ("contiguous chunk is too small %lu/%lu\n" , contig_size, buf->size); -dma_buf_unmap_attachment (buf->db_attach, sgt, buf->dma_dir); +dma_buf_unmap_attachment_unlocked (buf->db_attach, sgt, + buf->dma_dir);return -EFAULT ; }
@@ -750,10 +751,10 @@ static void vb2_dc_unmap_dmabuf(void *mem_priv) }if (buf->vaddr) { -dma_buf_vunmap (buf->db_attach->dmabuf, &map); +dma_buf_vunmap_unlocked (buf->db_attach->dmabuf, &map); buf->vaddr =NULL ; } -dma_buf_unmap_attachment (buf->db_attach, sgt, buf->dma_dir); +dma_buf_unmap_attachment_unlocked (buf->db_attach, sgt, buf->dma_dir); buf->dma_addr =0 ; buf->dma_sgt =NULL ;
drivers/media/common/videobuf2/videobuf2-dma-sg.c +4 -4
@@ -309,7 +309,7 @@ static void *vb2_dma_sg_vaddr(struct vb2_buffer *vb, void *buf_priv)if (!buf->vaddr) {if (buf->db_attach) { - ret =dma_buf_vmap (buf->db_attach->dmabuf, &map); + ret =dma_buf_vmap_unlocked (buf->db_attach->dmabuf, &map); buf->vaddr = ret ?NULL : map.vaddr; }else { buf->vaddr =vm_map_ram (buf->pages, buf->num_pages,-1 );
@@ -565,7 +565,7 @@ static int vb2_dma_sg_map_dmabuf(void *mem_priv) }/* get the associated scatterlist for this buffer */ - sgt =dma_buf_map_attachment (buf->db_attach, buf->dma_dir); + sgt =dma_buf_map_attachment_unlocked (buf->db_attach, buf->dma_dir);if (IS_ERR (sgt)) {pr_err ("Error getting dmabuf scatterlist\n" );return -EINVAL ;
@@ -594,10 +594,10 @@ static void vb2_dma_sg_unmap_dmabuf(void *mem_priv) }if (buf->vaddr) { -dma_buf_vunmap (buf->db_attach->dmabuf, &map); +dma_buf_vunmap_unlocked (buf->db_attach->dmabuf, &map); buf->vaddr =NULL ; } -dma_buf_unmap_attachment (buf->db_attach, sgt, buf->dma_dir); +dma_buf_unmap_attachment_unlocked (buf->db_attach, sgt, buf->dma_dir); buf->dma_sgt =NULL ; }
drivers/media/common/videobuf2/videobuf2-vmalloc.c +3 -3
@@ -376,7 +376,7 @@ static int vb2_vmalloc_map_dmabuf(void *mem_priv)struct iosys_map map;int ret; - ret =dma_buf_vmap (buf->dbuf, &map); + ret =dma_buf_vmap_unlocked (buf->dbuf, &map);if (ret)return -EFAULT ; buf->vaddr = map.vaddr;
@@ -389,7 +389,7 @@ static void vb2_vmalloc_unmap_dmabuf(void *mem_priv)struct vb2_vmalloc_buf *buf = mem_priv;struct iosys_map map =IOSYS_MAP_INIT_VADDR (buf->vaddr); -dma_buf_vunmap (buf->dbuf, &map); +dma_buf_vunmap_unlocked (buf->dbuf, &map); buf->vaddr =NULL ; }
@@ -399,7 +399,7 @@ static void vb2_vmalloc_detach_dmabuf(void *mem_priv)struct iosys_map map =IOSYS_MAP_INIT_VADDR (buf->vaddr);if (buf->vaddr) -dma_buf_vunmap (buf->dbuf, &map); +dma_buf_vunmap_unlocked (buf->dbuf, &map);kfree (buf); }
Signature · 1 line
2.37.2
Re: [PATCH v4 13/21] media: videobuf2: Prepare to dynamic dma-buf locking specification
Am 31.08.22 um 17:37 schrieb Dmitry Osipenko:
Quoted 6 lines
Prepare V4L2 memory allocators to the common dynamic dma-buf locking convention by starting to use the unlocked versions of dma-buf API functions.
Acked-by Tomasz Figa <[email protected]>Signed-off-by Dmitry Osipenko <[email protected]>
Quoted 117 lines
--- drivers/media/common/videobuf2/videobuf2-dma-contig.c | 11 ++++++----- drivers/media/common/videobuf2/videobuf2-dma-sg.c | 8 ++++---- drivers/media/common/videobuf2/videobuf2-vmalloc.c | 6 +++--- 3 files changed, 13 insertions(+), 12 deletions(-)drivers/media/common/videobuf2/videobuf2-dma-contig.c +6
-5@@ -101,7 +101,7 @@ static void *vb2_dc_vaddr(struct vb2_buffer *vb, void *buf_priv)if (buf->db_attach) {struct iosys_map map; -if (!dma_buf_vmap (buf->db_attach->dmabuf, &map)) +if (!dma_buf_vmap_unlocked (buf->db_attach->dmabuf, &map)) buf->vaddr = map.vaddr;return buf->vaddr;@@ -711,7 +711,7 @@ static int vb2_dc_map_dmabuf(void *mem_priv) }/* get the associated scatterlist for this buffer */ - sgt =dma_buf_map_attachment (buf->db_attach, buf->dma_dir); + sgt =dma_buf_map_attachment_unlocked (buf->db_attach, buf->dma_dir);if (IS_ERR (sgt)) {pr_err ("Error getting dmabuf scatterlist\n" );return -EINVAL ;@@ -722,7 +722,8 @@ static int vb2_dc_map_dmabuf(void *mem_priv)if (contig_size < buf->size) {pr_err ("contiguous chunk is too small %lu/%lu\n" , contig_size, buf->size); -dma_buf_unmap_attachment (buf->db_attach, sgt, buf->dma_dir); +dma_buf_unmap_attachment_unlocked (buf->db_attach, sgt, + buf->dma_dir);return -EFAULT ; }@@ -750,10 +751,10 @@ static void vb2_dc_unmap_dmabuf(void *mem_priv) }if (buf->vaddr) { -dma_buf_vunmap (buf->db_attach->dmabuf, &map); +dma_buf_vunmap_unlocked (buf->db_attach->dmabuf, &map); buf->vaddr =NULL ; } -dma_buf_unmap_attachment (buf->db_attach, sgt, buf->dma_dir); +dma_buf_unmap_attachment_unlocked (buf->db_attach, sgt, buf->dma_dir); buf->dma_addr =0 ; buf->dma_sgt =NULL ;drivers/media/common/videobuf2/videobuf2-dma-sg.c +4
-4@@ -309,7 +309,7 @@ static void *vb2_dma_sg_vaddr(struct vb2_buffer *vb, void *buf_priv)if (!buf->vaddr) {if (buf->db_attach) { - ret =dma_buf_vmap (buf->db_attach->dmabuf, &map); + ret =dma_buf_vmap_unlocked (buf->db_attach->dmabuf, &map); buf->vaddr = ret ?NULL : map.vaddr; }else { buf->vaddr =vm_map_ram (buf->pages, buf->num_pages,-1 );@@ -565,7 +565,7 @@ static int vb2_dma_sg_map_dmabuf(void *mem_priv) }/* get the associated scatterlist for this buffer */ - sgt =dma_buf_map_attachment (buf->db_attach, buf->dma_dir); + sgt =dma_buf_map_attachment_unlocked (buf->db_attach, buf->dma_dir);if (IS_ERR (sgt)) {pr_err ("Error getting dmabuf scatterlist\n" );return -EINVAL ;@@ -594,10 +594,10 @@ static void vb2_dma_sg_unmap_dmabuf(void *mem_priv) }if (buf->vaddr) { -dma_buf_vunmap (buf->db_attach->dmabuf, &map); +dma_buf_vunmap_unlocked (buf->db_attach->dmabuf, &map); buf->vaddr =NULL ; } -dma_buf_unmap_attachment (buf->db_attach, sgt, buf->dma_dir); +dma_buf_unmap_attachment_unlocked (buf->db_attach, sgt, buf->dma_dir); buf->dma_sgt =NULL ; }drivers/media/common/videobuf2/videobuf2-vmalloc.c +3
-3@@ -376,7 +376,7 @@ static int vb2_vmalloc_map_dmabuf(void *mem_priv)struct iosys_map map;int ret; - ret =dma_buf_vmap (buf->dbuf, &map); + ret =dma_buf_vmap_unlocked (buf->dbuf, &map);if (ret)return -EFAULT ; buf->vaddr = map.vaddr;@@ -389,7 +389,7 @@ static void vb2_vmalloc_unmap_dmabuf(void *mem_priv)struct vb2_vmalloc_buf *buf = mem_priv;struct iosys_map map =IOSYS_MAP_INIT_VADDR (buf->vaddr); -dma_buf_vunmap (buf->dbuf, &map); +dma_buf_vunmap_unlocked (buf->dbuf, &map); buf->vaddr =NULL ; }@@ -399,7 +399,7 @@ static void vb2_vmalloc_detach_dmabuf(void *mem_priv)struct iosys_map map =IOSYS_MAP_INIT_VADDR (buf->vaddr);if (buf->vaddr) -dma_buf_vunmap (buf->dbuf, &map); +dma_buf_vunmap_unlocked (buf->dbuf, &map);kfree (buf); }
PATCH v4 14/21 media: tegra-vde: Prepare to dynamic dma-buf locking specification
In reply to Dmitry OsipenkoPrepare Tegra video decoder driver to the common dynamic dma-buf locking convention by starting to use the unlocked versions of dma-buf API functions.
--- drivers/media/platform/nvidia/tegra-vde/dmabuf-cache.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/media/platform/nvidia/tegra-vde/dmabuf-cache.c +3 -3
@@ -38,7 +38,7 @@ static void tegra_vde_release_entry(struct tegra_vde_cache_entry *entry)if (entry->vde->domain)tegra_vde_iommu_unmap (entry->vde, entry->iova); -dma_buf_unmap_attachment (entry->a, entry->sgt, entry->dma_dir); +dma_buf_unmap_attachment_unlocked (entry->a, entry->sgt, entry->dma_dir);dma_buf_detach (dmabuf, entry->a);dma_buf_put (dmabuf);
@@ -102,7 +102,7 @@ int tegra_vde_dmabuf_cache_map(struct tegra_vde *vde, goto err_unlock; } - sgt =dma_buf_map_attachment (attachment, dma_dir); + sgt =dma_buf_map_attachment_unlocked (attachment, dma_dir);if (IS_ERR (sgt)) {dev_err (dev,"Failed to get dmabufs sg_table\n" ); err =PTR_ERR (sgt);
@@ -152,7 +152,7 @@ int tegra_vde_dmabuf_cache_map(struct tegra_vde *vde, err_free:kfree (entry); err_unmap: -dma_buf_unmap_attachment (attachment, sgt, dma_dir); +dma_buf_unmap_attachment_unlocked (attachment, sgt, dma_dir); err_detach:dma_buf_detach (dmabuf, attachment); err_unlock:
Signature · 1 line
2.37.2
Re: [PATCH v4 14/21] media: tegra-vde: Prepare to dynamic dma-buf locking specification
Am 31.08.22 um 17:37 schrieb Dmitry Osipenko:
Quoted 5 lines
Prepare Tegra video decoder driver to the common dynamic dma-buf locking convention by starting to use the unlocked versions of dma-buf API functions.
Signed-off-by Dmitry Osipenko <[email protected]>
Quoted 35 lines
--- drivers/media/platform/nvidia/tegra-vde/dmabuf-cache.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)drivers/media/platform/nvidia/tegra-vde/dmabuf-cache.c +3
-3@@ -38,7 +38,7 @@ static void tegra_vde_release_entry(struct tegra_vde_cache_entry *entry)if (entry->vde->domain)tegra_vde_iommu_unmap (entry->vde, entry->iova); -dma_buf_unmap_attachment (entry->a, entry->sgt, entry->dma_dir); +dma_buf_unmap_attachment_unlocked (entry->a, entry->sgt, entry->dma_dir);dma_buf_detach (dmabuf, entry->a);dma_buf_put (dmabuf);@@ -102,7 +102,7 @@ int tegra_vde_dmabuf_cache_map(struct tegra_vde *vde, goto err_unlock; } - sgt =dma_buf_map_attachment (attachment, dma_dir); + sgt =dma_buf_map_attachment_unlocked (attachment, dma_dir);if (IS_ERR (sgt)) {dev_err (dev,"Failed to get dmabufs sg_table\n" ); err =PTR_ERR (sgt);@@ -152,7 +152,7 @@ int tegra_vde_dmabuf_cache_map(struct tegra_vde *vde, err_free:kfree (entry); err_unmap: -dma_buf_unmap_attachment (attachment, sgt, dma_dir); +dma_buf_unmap_attachment_unlocked (attachment, sgt, dma_dir); err_detach:dma_buf_detach (dmabuf, attachment); err_unlock:
PATCH v4 15/21 dma-buf: Move dma_buf_vmap() to dynamic locking specification
In reply to Dmitry OsipenkoMove dma_buf_vmap/vunmap_unlocked() functions to the dynamic locking specification by asserting that the reservation lock is held.
--- drivers/dma-buf/dma-buf.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/dma-buf/dma-buf.c +4 -0
@@ -1449,6 +1449,8 @@ int dma_buf_vmap(struct dma_buf *dmabuf, struct iosys_map *map)if (WARN_ON (!dmabuf))return -EINVAL ; +dma_resv_assert_held (dmabuf->resv); +if (!dmabuf->ops->vmap)return -EINVAL ;
@@ -1509,6 +1511,8 @@ void dma_buf_vunmap(struct dma_buf *dmabuf, struct iosys_map *map)if (WARN_ON (!dmabuf))return ; +dma_resv_assert_held (dmabuf->resv); +BUG_ON (iosys_map_is_null (&dmabuf->vmap_ptr));BUG_ON (dmabuf->vmapping_counter ==0 );BUG_ON (!iosys_map_is_equal (&dmabuf->vmap_ptr, map));
Signature · 1 line
2.37.2
PATCH v4 16/21 dma-buf: Move dma_buf_attach() to dynamic locking specification
In reply to Dmitry OsipenkoMove dma-buf attachment API functions to the dynamic locking specification by taking the reservation lock around the mapping operations. The strict locking convention prevents deadlock situations for dma-buf importers and exporters.
--- drivers/dma-buf/dma-buf.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-)
drivers/dma-buf/dma-buf.c +8 -12
@@ -858,8 +858,8 @@ dma_buf_dynamic_attach(struct dma_buf *dmabuf, struct device *dev, dma_buf_is_dynamic(dmabuf)) {struct sg_table *sgt; +dma_resv_lock (attach->dmabuf->resv,NULL );if (dma_buf_is_dynamic (attach->dmabuf)) { -dma_resv_lock (attach->dmabuf->resv,NULL ); ret = dmabuf->ops->pin (attach);if (ret) goto err_unlock;
@@ -872,8 +872,7 @@ dma_buf_dynamic_attach(struct dma_buf *dmabuf, struct device *dev, ret =PTR_ERR (sgt); goto err_unpin; } -if (dma_buf_is_dynamic (attach->dmabuf)) -dma_resv_unlock (attach->dmabuf->resv); +dma_resv_unlock (attach->dmabuf->resv); attach->sgt = sgt; attach->dir =DMA_BIDIRECTIONAL ; }
@@ -889,8 +888,7 @@ dma_buf_dynamic_attach(struct dma_buf *dmabuf, struct device *dev, dmabuf->ops->unpin (attach); err_unlock: -if (dma_buf_is_dynamic (attach->dmabuf)) -dma_resv_unlock (attach->dmabuf->resv); +dma_resv_unlock (attach->dmabuf->resv);dma_buf_detach (dmabuf, attach);return ERR_PTR (ret);
@@ -936,21 +934,19 @@ void dma_buf_detach(struct dma_buf *dmabuf, struct dma_buf_attachment *attach)if (WARN_ON (!dmabuf || !attach))return ; +dma_resv_lock (attach->dmabuf->resv,NULL ); +if (attach->sgt) { -if (dma_buf_is_dynamic (attach->dmabuf)) -dma_resv_lock (attach->dmabuf->resv,NULL );__unmap_dma_buf (attach, attach->sgt, attach->dir); -if (dma_buf_is_dynamic (attach->dmabuf)) { +if (dma_buf_is_dynamic (attach->dmabuf)) dmabuf->ops->unpin (attach); -dma_resv_unlock (attach->dmabuf->resv); - } } - -dma_resv_lock (dmabuf->resv,NULL );list_del (&attach->node); +dma_resv_unlock (dmabuf->resv); +if (dmabuf->ops->detach) dmabuf->ops->detach (dmabuf, attach);
Signature · 1 line
2.37.2
Re: [PATCH v4 16/21] dma-buf: Move dma_buf_attach() to dynamic locking specification
Am 31.08.22 um 17:37 schrieb Dmitry Osipenko:
Quoted 6 lines
Move dma-buf attachment API functions to the dynamic locking specification by taking the reservation lock around the mapping operations. The strict locking convention prevents deadlock situations for dma-buf importers and exporters.
Signed-off-by Dmitry Osipenko <[email protected]>
Quoted 65 lines
--- drivers/dma-buf/dma-buf.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-)drivers/dma-buf/dma-buf.c +8
-12@@ -858,8 +858,8 @@ dma_buf_dynamic_attach(struct dma_buf *dmabuf, struct device *dev, dma_buf_is_dynamic(dmabuf)) {struct sg_table *sgt; +dma_resv_lock (attach->dmabuf->resv,NULL );if (dma_buf_is_dynamic (attach->dmabuf)) { -dma_resv_lock (attach->dmabuf->resv,NULL ); ret = dmabuf->ops->pin (attach);if (ret) goto err_unlock;@@ -872,8 +872,7 @@ dma_buf_dynamic_attach(struct dma_buf *dmabuf, struct device *dev, ret =PTR_ERR (sgt); goto err_unpin; } -if (dma_buf_is_dynamic (attach->dmabuf)) -dma_resv_unlock (attach->dmabuf->resv); +dma_resv_unlock (attach->dmabuf->resv); attach->sgt = sgt; attach->dir =DMA_BIDIRECTIONAL ; }@@ -889,8 +888,7 @@ dma_buf_dynamic_attach(struct dma_buf *dmabuf, struct device *dev, dmabuf->ops->unpin (attach); err_unlock: -if (dma_buf_is_dynamic (attach->dmabuf)) -dma_resv_unlock (attach->dmabuf->resv); +dma_resv_unlock (attach->dmabuf->resv);dma_buf_detach (dmabuf, attach);return ERR_PTR (ret);@@ -936,21 +934,19 @@ void dma_buf_detach(struct dma_buf *dmabuf, struct dma_buf_attachment *attach)if (WARN_ON (!dmabuf || !attach))return ; +dma_resv_lock (attach->dmabuf->resv,NULL ); +if (attach->sgt) { -if (dma_buf_is_dynamic (attach->dmabuf)) -dma_resv_lock (attach->dmabuf->resv,NULL );__unmap_dma_buf (attach, attach->sgt, attach->dir); -if (dma_buf_is_dynamic (attach->dmabuf)) { +if (dma_buf_is_dynamic (attach->dmabuf)) dmabuf->ops->unpin (attach); -dma_resv_unlock (attach->dmabuf->resv); - } } - -dma_resv_lock (dmabuf->resv,NULL );list_del (&attach->node); +dma_resv_unlock (dmabuf->resv); +if (dmabuf->ops->detach) dmabuf->ops->detach (dmabuf, attach);
PATCH v4 17/21 dma-buf: Move dma_buf_map_attachment() to dynamic locking specification
In reply to Dmitry OsipenkoMove dma-buf attachment mapping functions to the dynamic locking specification by asserting that the reservation lock is held.
--- drivers/dma-buf/dma-buf.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-)
drivers/dma-buf/dma-buf.c +2 -8
@@ -1037,8 +1037,7 @@ struct sg_table *dma_buf_map_attachment(struct dma_buf_attachment *attach,if (WARN_ON (!attach || !attach->dmabuf))return ERR_PTR (-EINVAL ); -if (dma_buf_attachment_is_dynamic (attach)) -dma_resv_assert_held (attach->dmabuf->resv); +dma_resv_assert_held (attach->dmabuf->resv);if (attach->sgt) {/*
@@ -1053,7 +1052,6 @@ struct sg_table *dma_buf_map_attachment(struct dma_buf_attachment *attach, }if (dma_buf_is_dynamic (attach->dmabuf)) { -dma_resv_assert_held (attach->dmabuf->resv);if (!IS_ENABLED (CONFIG_DMABUF_MOVE_NOTIFY )) { r = attach->dmabuf->ops->pin (attach);if (r)
@@ -1142,15 +1140,11 @@ void dma_buf_unmap_attachment(struct dma_buf_attachment *attach,if (WARN_ON (!attach || !attach->dmabuf || !sg_table))return ; -if (dma_buf_attachment_is_dynamic (attach)) -dma_resv_assert_held (attach->dmabuf->resv); +dma_resv_assert_held (attach->dmabuf->resv);if (attach->sgt == sg_table)return ; -if (dma_buf_is_dynamic (attach->dmabuf)) -dma_resv_assert_held (attach->dmabuf->resv); -__unmap_dma_buf (attach, sg_table, direction); if (dma_buf_is_dynamic(attach->dmabuf) &&
Signature · 1 line
2.37.2
Re: [PATCH v4 17/21] dma-buf: Move dma_buf_map_attachment() to dynamic locking specification
Am 31.08.22 um 17:37 schrieb Dmitry Osipenko:
Quoted 4 lines
Move dma-buf attachment mapping functions to the dynamic locking specification by asserting that the reservation lock is held.
Signed-off-by Dmitry Osipenko <[email protected]>
Quoted 43 lines
--- drivers/dma-buf/dma-buf.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-)drivers/dma-buf/dma-buf.c +2
-8@@ -1037,8 +1037,7 @@ struct sg_table *dma_buf_map_attachment(struct dma_buf_attachment *attach,if (WARN_ON (!attach || !attach->dmabuf))return ERR_PTR (-EINVAL ); -if (dma_buf_attachment_is_dynamic (attach)) -dma_resv_assert_held (attach->dmabuf->resv); +dma_resv_assert_held (attach->dmabuf->resv);if (attach->sgt) {/* @@ -1053,7 +1052,6 @@ struct sg_table *dma_buf_map_attachment(struct dma_buf_attachment *attach, }if (dma_buf_is_dynamic (attach->dmabuf)) { -dma_resv_assert_held (attach->dmabuf->resv);if (!IS_ENABLED (CONFIG_DMABUF_MOVE_NOTIFY )) { r = attach->dmabuf->ops->pin (attach);if (r)@@ -1142,15 +1140,11 @@ void dma_buf_unmap_attachment(struct dma_buf_attachment *attach,if (WARN_ON (!attach || !attach->dmabuf || !sg_table))return ; -if (dma_buf_attachment_is_dynamic (attach)) -dma_resv_assert_held (attach->dmabuf->resv); +dma_resv_assert_held (attach->dmabuf->resv);if (attach->sgt == sg_table)return ; -if (dma_buf_is_dynamic (attach->dmabuf)) -dma_resv_assert_held (attach->dmabuf->resv); -__unmap_dma_buf (attach, sg_table, direction); if (dma_buf_is_dynamic(attach->dmabuf) &&
PATCH v4 18/21 dma-buf: Move dma_buf_mmap() to dynamic locking specification
In reply to Dmitry OsipenkoMove dma_buf_mmap() function to the dynamic locking specification by taking the reservation lock. Neither of the today's drivers take the reservation lock within the mmap() callback, hence it's safe to enforce the locking.
--- drivers/dma-buf/dma-buf.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/dma-buf/dma-buf.c +7 -1
@@ -1389,6 +1389,8 @@ EXPORT_SYMBOL_NS_GPL(dma_buf_end_cpu_access, DMA_BUF);int dma_buf_mmap (struct dma_buf *dmabuf,struct vm_area_struct *vma,unsigned long pgoff) { +int ret; +if (WARN_ON (!dmabuf || !vma))return -EINVAL ;
@@ -1409,7 +1411,11 @@ int dma_buf_mmap(struct dma_buf *dmabuf, struct vm_area_struct *vma,vma_set_file (vma, dmabuf->file); vma->vm_pgoff = pgoff; -return dmabuf->ops->mmap (dmabuf, vma); +dma_resv_lock (dmabuf->resv,NULL ); + ret = dmabuf->ops->mmap (dmabuf, vma); +dma_resv_unlock (dmabuf->resv); + +return ret; }EXPORT_SYMBOL_NS_GPL (dma_buf_mmap,DMA_BUF );
Signature · 1 line
2.37.2
PATCH v4 19/21 dma-buf: Document dynamic locking convention
In reply to Dmitry OsipenkoAdd documentation for the dynamic locking convention. The documentation tells dma-buf API users when they should take the reservation lock and when not.
--- Documentation/driver-api/dma-buf.rst | 6 +++ drivers/dma-buf/dma-buf.c | 64 ++++++++++++++++++++++++++++ 2 files changed, 70 insertions(+)
Documentation/driver-api/dma-buf.rst +6 -0
@@ -119,6 +119,12 @@ DMA Buffer ioctls .. kernel-doc:: include/uapi/linux/dma-buf.h +DMA-BUF locking convention +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. kernel-doc:: drivers/dma-buf/dma-buf.c + :doc: locking convention + Kernel Functions and Structures Reference ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/dma-buf/dma-buf.c +64 -0
70 lines not on this page · raw message
Signature · 1 line
2.37.2
Re: [PATCH v4 19/21] dma-buf: Document dynamic locking convention
Am 31.08.22 um 17:37 schrieb Dmitry Osipenko:
Quoted 5 lines
Add documentation for the dynamic locking convention. The documentation tells dma-buf API users when they should take the reservation lock and when not.
Signed-off-by Dmitry Osipenko <[email protected]>
Quoted 97 lines
--- Documentation/driver-api/dma-buf.rst | 6 +++ drivers/dma-buf/dma-buf.c | 64 ++++++++++++++++++++++++++++ 2 files changed, 70 insertions(+)Documentation/driver-api/dma-buf.rst +6
-0@@ -119,6 +119,12 @@ DMA Buffer ioctls .. kernel-doc:: include/uapi/linux/dma-buf.h +DMA-BUF locking convention +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. kernel-doc:: drivers/dma-buf/dma-buf.c + :doc: locking convention + Kernel Functions and Structures Reference ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~drivers/dma-buf/dma-buf.c +64
-0@@ -794,6 +794,70 @@ static struct sg_table * __map_dma_buf(struct dma_buf_attachment *attach,return sg_table; } +/** +* DOC: locking convention +* +* In order to avoid deadlock situations between dma-buf exports and importers, +* all dma-buf API users must follow the common dma-buf locking convention. +* +* Convention for importers +* +* 1. Importers must hold the dma-buf reservation lock when calling these +* functions: +* +* - dma_buf_pin() +* - dma_buf_unpin() +* - dma_buf_map_attachment() +* - dma_buf_unmap_attachment() +* - dma_buf_vmap() +* - dma_buf_vunmap() +* +* 2. Importers must not hold the dma-buf reservation lock when calling these +* functions: +* +* - dma_buf_attach() +* - dma_buf_dynamic_attach() +* - dma_buf_detach() +* - dma_buf_export( +* - dma_buf_fd() +* - dma_buf_get() +* - dma_buf_put() +* - dma_buf_mmap() +* - dma_buf_begin_cpu_access() +* - dma_buf_end_cpu_access() +* - dma_buf_map_attachment_unlocked() +* - dma_buf_unmap_attachment_unlocked() +* - dma_buf_vmap_unlocked() +* - dma_buf_vunmap_unlocked() +* +* Convention for exporters +* +* 1. These &dma_buf_ops callbacks are invoked with unlocked dma-buf +* reservation and exporter can take the lock: +* +* - &dma_buf_ops.attach() +* - &dma_buf_ops.detach() +* - &dma_buf_ops.release() +* - &dma_buf_ops.begin_cpu_access() +* - &dma_buf_ops.end_cpu_access() +* +* 2. These &dma_buf_ops callbacks are invoked with locked dma-buf +* reservation and exporter can't take the lock: +* +* - &dma_buf_ops.pin() +* - &dma_buf_ops.unpin() +* - &dma_buf_ops.map_dma_buf() +* - &dma_buf_ops.unmap_dma_buf() +* - &dma_buf_ops.mmap() +* - &dma_buf_ops.vmap() +* - &dma_buf_ops.vunmap() +* +* 3. Exporters must hold the dma-buf reservation lock when calling these +* functions: +* +* - dma_buf_move_notify() +*/ +/** * dma_buf_dynamic_attach - Add the device to dma_buf's attachments list * @dmabuf: [in] buffer to attach device to.
PATCH v4 20/21 media: videobuf2: Stop using internal dma-buf lock
In reply to Dmitry OsipenkoAll drivers that use dma-bufs have been moved to the updated locking specification and now dma-buf reservation is guaranteed to be locked by importers during the mapping operations. There is no need to take the internal dma-buf lock anymore. Remove locking from the videobuf2 memory allocators.
--- drivers/media/common/videobuf2/videobuf2-dma-contig.c | 11 +---------- drivers/media/common/videobuf2/videobuf2-dma-sg.c | 11 +---------- drivers/media/common/videobuf2/videobuf2-vmalloc.c | 11 +---------- 3 files changed, 3 insertions(+), 30 deletions(-)
drivers/media/common/videobuf2/videobuf2-dma-contig.c +1 -10
@@ -382,18 +382,12 @@ static struct sg_table *vb2_dc_dmabuf_ops_map( struct dma_buf_attachment *db_attach, enum dma_data_direction dma_dir) { struct vb2_dc_attachment *attach = db_attach->priv; -/* stealing dmabuf mutex to serialize map/unmap operations */ -struct mutex *lock = &db_attach->dmabuf->lock;struct sg_table *sgt; -mutex_lock (lock); - sgt = &attach->sgt;/* return previously mapped sg table */ -if (attach->dma_dir == dma_dir) { -mutex_unlock (lock); +if (attach->dma_dir == dma_dir)return sgt; - }/* release any previous cache */ if (attach->dma_dir !=DMA_NONE ) {
@@ -409,14 +403,11 @@ static struct sg_table *vb2_dc_dmabuf_ops_map(if (dma_map_sgtable (db_attach->dev, sgt, dma_dir,DMA_ATTR_SKIP_CPU_SYNC )) {pr_err ("failed to map scatterlist\n" ); -mutex_unlock (lock);return ERR_PTR (-EIO ); } attach->dma_dir = dma_dir; -mutex_unlock (lock); -return sgt; }
drivers/media/common/videobuf2/videobuf2-dma-sg.c +1 -10
@@ -424,18 +424,12 @@ static struct sg_table *vb2_dma_sg_dmabuf_ops_map( struct dma_buf_attachment *db_attach, enum dma_data_direction dma_dir) { struct vb2_dma_sg_attachment *attach = db_attach->priv; -/* stealing dmabuf mutex to serialize map/unmap operations */ -struct mutex *lock = &db_attach->dmabuf->lock;struct sg_table *sgt; -mutex_lock (lock); - sgt = &attach->sgt;/* return previously mapped sg table */ -if (attach->dma_dir == dma_dir) { -mutex_unlock (lock); +if (attach->dma_dir == dma_dir)return sgt; - }/* release any previous cache */ if (attach->dma_dir !=DMA_NONE ) {
@@ -446,14 +440,11 @@ static struct sg_table *vb2_dma_sg_dmabuf_ops_map(/* mapping to the client with new direction */ if (dma_map_sgtable (db_attach->dev, sgt, dma_dir,0 )) {pr_err ("failed to map scatterlist\n" ); -mutex_unlock (lock);return ERR_PTR (-EIO ); } attach->dma_dir = dma_dir; -mutex_unlock (lock); -return sgt; }
drivers/media/common/videobuf2/videobuf2-vmalloc.c +1 -10
@@ -267,18 +267,12 @@ static struct sg_table *vb2_vmalloc_dmabuf_ops_map( struct dma_buf_attachment *db_attach, enum dma_data_direction dma_dir) { struct vb2_vmalloc_attachment *attach = db_attach->priv; -/* stealing dmabuf mutex to serialize map/unmap operations */ -struct mutex *lock = &db_attach->dmabuf->lock;struct sg_table *sgt; -mutex_lock (lock); - sgt = &attach->sgt;/* return previously mapped sg table */ -if (attach->dma_dir == dma_dir) { -mutex_unlock (lock); +if (attach->dma_dir == dma_dir)return sgt; - }/* release any previous cache */ if (attach->dma_dir !=DMA_NONE ) {
@@ -289,14 +283,11 @@ static struct sg_table *vb2_vmalloc_dmabuf_ops_map(/* mapping to the client with new direction */ if (dma_map_sgtable (db_attach->dev, sgt, dma_dir,0 )) {pr_err ("failed to map scatterlist\n" ); -mutex_unlock (lock);return ERR_PTR (-EIO ); } attach->dma_dir = dma_dir; -mutex_unlock (lock); -return sgt; }
Signature · 1 line
2.37.2
Re: [PATCH v4 20/21] media: videobuf2: Stop using internal dma-buf lock
Am 31.08.22 um 17:37 schrieb Dmitry Osipenko:
Quoted 9 lines
All drivers that use dma-bufs have been moved to the updated locking specification and now dma-buf reservation is guaranteed to be locked by importers during the mapping operations. There is no need to take the internal dma-buf lock anymore. Remove locking from the videobuf2 memory allocators.
Acked-by Tomasz Figa <[email protected]>Acked-by Hans Verkuil <[email protected]>Signed-off-by Dmitry Osipenko <[email protected]>
Quoted 123 lines
--- drivers/media/common/videobuf2/videobuf2-dma-contig.c | 11 +---------- drivers/media/common/videobuf2/videobuf2-dma-sg.c | 11 +---------- drivers/media/common/videobuf2/videobuf2-vmalloc.c | 11 +---------- 3 files changed, 3 insertions(+), 30 deletions(-)drivers/media/common/videobuf2/videobuf2-dma-contig.c +1
-10@@ -382,18 +382,12 @@ static struct sg_table *vb2_dc_dmabuf_ops_map( struct dma_buf_attachment *db_attach, enum dma_data_direction dma_dir) { struct vb2_dc_attachment *attach = db_attach->priv; -/* stealing dmabuf mutex to serialize map/unmap operations */ -struct mutex *lock = &db_attach->dmabuf->lock;struct sg_table *sgt; -mutex_lock (lock); - sgt = &attach->sgt;/* return previously mapped sg table */ -if (attach->dma_dir == dma_dir) { -mutex_unlock (lock); +if (attach->dma_dir == dma_dir)return sgt; - }/* release any previous cache */ if (attach->dma_dir !=DMA_NONE ) {@@ -409,14 +403,11 @@ static struct sg_table *vb2_dc_dmabuf_ops_map(if (dma_map_sgtable (db_attach->dev, sgt, dma_dir,DMA_ATTR_SKIP_CPU_SYNC )) {pr_err ("failed to map scatterlist\n" ); -mutex_unlock (lock);return ERR_PTR (-EIO ); } attach->dma_dir = dma_dir; -mutex_unlock (lock); -return sgt; }drivers/media/common/videobuf2/videobuf2-dma-sg.c +1
-10@@ -424,18 +424,12 @@ static struct sg_table *vb2_dma_sg_dmabuf_ops_map( struct dma_buf_attachment *db_attach, enum dma_data_direction dma_dir) { struct vb2_dma_sg_attachment *attach = db_attach->priv; -/* stealing dmabuf mutex to serialize map/unmap operations */ -struct mutex *lock = &db_attach->dmabuf->lock;struct sg_table *sgt; -mutex_lock (lock); - sgt = &attach->sgt;/* return previously mapped sg table */ -if (attach->dma_dir == dma_dir) { -mutex_unlock (lock); +if (attach->dma_dir == dma_dir)return sgt; - }/* release any previous cache */ if (attach->dma_dir !=DMA_NONE ) {@@ -446,14 +440,11 @@ static struct sg_table *vb2_dma_sg_dmabuf_ops_map(/* mapping to the client with new direction */ if (dma_map_sgtable (db_attach->dev, sgt, dma_dir,0 )) {pr_err ("failed to map scatterlist\n" ); -mutex_unlock (lock);return ERR_PTR (-EIO ); } attach->dma_dir = dma_dir; -mutex_unlock (lock); -return sgt; }drivers/media/common/videobuf2/videobuf2-vmalloc.c +1
-10@@ -267,18 +267,12 @@ static struct sg_table *vb2_vmalloc_dmabuf_ops_map( struct dma_buf_attachment *db_attach, enum dma_data_direction dma_dir) { struct vb2_vmalloc_attachment *attach = db_attach->priv; -/* stealing dmabuf mutex to serialize map/unmap operations */ -struct mutex *lock = &db_attach->dmabuf->lock;struct sg_table *sgt; -mutex_lock (lock); - sgt = &attach->sgt;/* return previously mapped sg table */ -if (attach->dma_dir == dma_dir) { -mutex_unlock (lock); +if (attach->dma_dir == dma_dir)return sgt; - }/* release any previous cache */ if (attach->dma_dir !=DMA_NONE ) {@@ -289,14 +283,11 @@ static struct sg_table *vb2_vmalloc_dmabuf_ops_map(/* mapping to the client with new direction */ if (dma_map_sgtable (db_attach->dev, sgt, dma_dir,0 )) {pr_err ("failed to map scatterlist\n" ); -mutex_unlock (lock);return ERR_PTR (-EIO ); } attach->dma_dir = dma_dir; -mutex_unlock (lock); -return sgt; }
PATCH v4 21/21 dma-buf: Remove obsoleted internal lock
In reply to Dmitry OsipenkoThe internal dma-buf lock isn't needed anymore because the updated locking specification claims that dma-buf reservation must be locked by importers, and thus, the internal data is already protected by the reservation lock. Remove the obsoleted internal lock.
--- drivers/dma-buf/dma-buf.c | 14 ++++---------- include/linux/dma-buf.h | 9 --------- 2 files changed, 4 insertions(+), 19 deletions(-)
drivers/dma-buf/dma-buf.c +4 -10
@@ -656,7 +656,6 @@ struct dma_buf *dma_buf_export(const struct dma_buf_export_info *exp_info) dmabuf->file = file; -mutex_init (&dmabuf->lock);INIT_LIST_HEAD (&dmabuf->attachments);mutex_lock (&db_list.lock);
@@ -1502,7 +1501,7 @@ EXPORT_SYMBOL_NS_GPL(dma_buf_mmap, DMA_BUF);int dma_buf_vmap (struct dma_buf *dmabuf,struct iosys_map *map) {struct iosys_map ptr; -int ret =0 ; +int ret;iosys_map_clear (map);
@@ -1514,28 +1513,25 @@ int dma_buf_vmap(struct dma_buf *dmabuf, struct iosys_map *map)if (!dmabuf->ops->vmap)return -EINVAL ; -mutex_lock (&dmabuf->lock);if (dmabuf->vmapping_counter) { dmabuf->vmapping_counter++;BUG_ON (iosys_map_is_null (&dmabuf->vmap_ptr)); *map = dmabuf->vmap_ptr; - goto out_unlock; +return 0 ; }BUG_ON (iosys_map_is_set (&dmabuf->vmap_ptr)); ret = dmabuf->ops->vmap (dmabuf, &ptr);if (WARN_ON_ONCE (ret)) - goto out_unlock; +return ret; dmabuf->vmap_ptr = ptr; dmabuf->vmapping_counter =1 ; *map = dmabuf->vmap_ptr; -out_unlock: -mutex_unlock (&dmabuf->lock); -return ret; +return 0 ; }EXPORT_SYMBOL_NS_GPL (dma_buf_vmap,DMA_BUF );
@@ -1577,13 +1573,11 @@ void dma_buf_vunmap(struct dma_buf *dmabuf, struct iosys_map *map)BUG_ON (dmabuf->vmapping_counter ==0 );BUG_ON (!iosys_map_is_equal (&dmabuf->vmap_ptr, map)); -mutex_lock (&dmabuf->lock);if (--dmabuf->vmapping_counter ==0 ) {if (dmabuf->ops->vunmap) dmabuf->ops->vunmap (dmabuf, map);iosys_map_clear (&dmabuf->vmap_ptr); } -mutex_unlock (&dmabuf->lock); }EXPORT_SYMBOL_NS_GPL (dma_buf_vunmap,DMA_BUF );
include/linux/dma-buf.h +0 -9
@@ -326,15 +326,6 @@ struct dma_buf {/** @ops: dma_buf_ops associated with this buffer object. */ const struct dma_buf_ops *ops; -/** -* @lock: -* -* Used internally to serialize list manipulation, attach/detach and -* vmap/unmap. Note that in many cases this is superseeded by -* dma_resv_lock() on @resv. -*/ -struct mutex lock; -/** * @vmapping_counter: *
Signature · 1 line
2.37.2
Re: [PATCH v4 21/21] dma-buf: Remove obsoleted internal lock
Am 31.08.22 um 17:37 schrieb Dmitry Osipenko:
Quoted 7 lines
The internal dma-buf lock isn't needed anymore because the updated locking specification claims that dma-buf reservation must be locked by importers, and thus, the internal data is already protected by the reservation lock. Remove the obsoleted internal lock.
Acked-by Christian König <[email protected]>Signed-off-by Dmitry Osipenko <[email protected]>
Quoted 92 lines
--- drivers/dma-buf/dma-buf.c | 14 ++++---------- include/linux/dma-buf.h | 9 --------- 2 files changed, 4 insertions(+), 19 deletions(-)drivers/dma-buf/dma-buf.c +4
-10@@ -656,7 +656,6 @@ struct dma_buf *dma_buf_export(const struct dma_buf_export_info *exp_info) dmabuf->file = file; -mutex_init (&dmabuf->lock);INIT_LIST_HEAD (&dmabuf->attachments);mutex_lock (&db_list.lock);@@ -1502,7 +1501,7 @@ EXPORT_SYMBOL_NS_GPL(dma_buf_mmap, DMA_BUF);int dma_buf_vmap (struct dma_buf *dmabuf,struct iosys_map *map) {struct iosys_map ptr; -int ret =0 ; +int ret;iosys_map_clear (map);@@ -1514,28 +1513,25 @@ int dma_buf_vmap(struct dma_buf *dmabuf, struct iosys_map *map)if (!dmabuf->ops->vmap)return -EINVAL ; -mutex_lock (&dmabuf->lock);if (dmabuf->vmapping_counter) { dmabuf->vmapping_counter++;BUG_ON (iosys_map_is_null (&dmabuf->vmap_ptr)); *map = dmabuf->vmap_ptr; - goto out_unlock; +return 0 ; }BUG_ON (iosys_map_is_set (&dmabuf->vmap_ptr)); ret = dmabuf->ops->vmap (dmabuf, &ptr);if (WARN_ON_ONCE (ret)) - goto out_unlock; +return ret; dmabuf->vmap_ptr = ptr; dmabuf->vmapping_counter =1 ; *map = dmabuf->vmap_ptr; -out_unlock: -mutex_unlock (&dmabuf->lock); -return ret; +return 0 ; }EXPORT_SYMBOL_NS_GPL (dma_buf_vmap,DMA_BUF );@@ -1577,13 +1573,11 @@ void dma_buf_vunmap(struct dma_buf *dmabuf, struct iosys_map *map)BUG_ON (dmabuf->vmapping_counter ==0 );BUG_ON (!iosys_map_is_equal (&dmabuf->vmap_ptr, map)); -mutex_lock (&dmabuf->lock);if (--dmabuf->vmapping_counter ==0 ) {if (dmabuf->ops->vunmap) dmabuf->ops->vunmap (dmabuf, map);iosys_map_clear (&dmabuf->vmap_ptr); } -mutex_unlock (&dmabuf->lock); }EXPORT_SYMBOL_NS_GPL (dma_buf_vunmap,DMA_BUF );include/linux/dma-buf.h +0
-9@@ -326,15 +326,6 @@ struct dma_buf {/** @ops: dma_buf_ops associated with this buffer object. */ const struct dma_buf_ops *ops; -/** -* @lock: -* -* Used internally to serialize list manipulation, attach/detach and -* vmap/unmap. Note that in many cases this is superseeded by -* dma_resv_lock() on @resv. -*/ -struct mutex lock; -/** * @vmapping_counter: *
Christian König
maintainerHi Dmitry,
I've gone over this multiple times now and while it is still possible that we missed something I think that this should land now.
The whole topic is just to complicated that we can 100% sure guarantee that there isn't anything wrong with the locking, but lockdep and driver testing should allow us to quickly find remaining issues.
Do you have commit rights to drm-misc-next or should I push it?
Thanks,
Christian.
Am 31.08.22 um 17:37 schrieb Dmitry Osipenko:
Quoted 127 lines
Hello,
This series moves all drivers to a dynamic dma-buf locking specification.
From now on all dma-buf importers are made responsible for holding
dma-buf's reservation lock around all operations performed over dma-bufs in accordance to the locking specification. This allows us to utilize reservation lock more broadly around kernel without fearing of a potential deadlocks.This patchset passes all i915 selftests. It was also tested using VirtIO, Panfrost, Lima, Tegra, udmabuf, AMDGPU and Nouveau drivers. I tested cases of display+GPU, display+V4L and GPU+V4L dma-buf sharing (where appropriate), which covers majority of kernel drivers since rest of the drivers share same or similar code paths.
Changelog:
v4: - Added
dma_buf_mmap()to the "locking convention" documentation,
which was missed by accident in v3.- Added acks from Christian König, Tomasz Figa and Hans Verkuil that they gave to couple v3 patches.
- Dropped the "
_unlocked" postfix from function names that don't have the locked variant, as was requested by Christian König.- Factored out the per-driver preparations into separate patches to ease reviewing of the changes, which is now doable without the global dma-buf functions renaming.
- Factored out the dynamic locking convention enforcements into separate patches which add the final
dma_resv_assert_held(dmabuf->resv)to the dma-buf API functions.v3: - Factored out
dma_buf_mmap_unlocked()and attachment functions
into aseparate patches, like was suggested by Christian König.- Corrected and factored out dma-buf locking documentation into a separate patch, like was suggested by Christian König.
- Intel driver dropped the reservation locking fews days ago from its BO-release code path, but we need that locking for the imported GEMs because in the end that code path unmaps the imported GEM. So I added back the locking needed by the imported GEMs, updating the "dma-buf attachment locking specification" patch appropriately.
- Tested Nouveau+Intel dma-buf import/export combo.
- Tested udmabuf import to i915/Nouveau/AMDGPU.
- Fixed few places in Etnaviv, Panfrost and Lima drivers that I missed to switch to locked dma-buf vmapping in the drm/gem: Take reservation lock for vmap/vunmap operations" patch. In a result invalidated the Christian's r-b that he gave to v2.
- Added locked dma-buf vmap/vunmap functions that are needed for fixing vmappping of Etnaviv, Panfrost and Lima drivers mentioned above. I actually had this change stashed for the drm-shmem shrinker patchset, but then realized that it's already needed by the dma-buf patches. Also improved my tests to better cover these code paths.
v2: - Changed locking specification to avoid problems with a cross-driver
ww locking, like was suggested by Christian König. Now the attach/detach callbacks are invoked without the held lock and exporter should take the lock.- Added "locking convention" documentation that explains which dma-buf functions and callbacks are locked/unlocked for importers and exporters, which was requested by Christian König.
- Added ack from Tomasz Figa to the V4L patches that he gave to v1.
Dmitry Osipenko (21):
dma-buf: Add unlocked variant of vmapping functions
dma-buf: Add unlocked variant of attachment-mapping functions drm/gem: Take reservation lock for vmap/vunmap operations drm/prime: Prepare to dynamic dma-buf locking specification drm/armada: Prepare to dynamic dma-buf locking specification drm/i915: Prepare to dynamic dma-buf locking specification drm/omapdrm: Prepare to dynamic dma-buf locking specification drm/tegra: Prepare to dynamic dma-buf locking specification drm/etnaviv: Prepare to dynamic dma-buf locking specification RDMA/umem: Prepare to dynamic dma-buf locking specification
misc: fastrpc: Prepare to dynamic dma-buf locking specification xen/gntdev: Prepare to dynamic dma-buf locking specification
media: videobuf2: Prepare to dynamic dma-buf locking specification
media: tegra-vde: Prepare to dynamic dma-buf locking specification
dma-buf: Movedma_buf_vmap()to dynamic locking specification
dma-buf: Movedma_buf_attach()to dynamic locking specification
dma-buf: Movedma_buf_map_attachment()to dynamic locking
specification
dma-buf: Movedma_buf_mmap()to dynamic locking specification
dma-buf: Document dynamic locking convention
media: videobuf2: Stop using internal dma-buf lock
dma-buf: Remove obsoleted internal lockDocumentation/driver-api/dma-buf.rst | 6 + drivers/dma-buf/dma-buf.c | 211 +++++++++++++++--- drivers/gpu/drm/armada/armada_gem.c | 8 +- drivers/gpu/drm/drm_client.c | 4 +- drivers/gpu/drm/drm_gem.c | 24 ++ drivers/gpu/drm/drm_gem_dma_helper.c | 6 +- drivers/gpu/drm/drm_gem_framebuffer_helper.c | 6 +- drivers/gpu/drm/drm_gem_ttm_helper.c | 9 +- drivers/gpu/drm/drm_prime.c | 6 +- drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c | 2 +- drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c | 2 +- drivers/gpu/drm/i915/gem/i915_gem_object.c | 12 + .../drm/i915/gem/selftests/i915_gem_dmabuf.c | 16 +- drivers/gpu/drm/lima/lima_sched.c | 4 +- drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c | 4 +- drivers/gpu/drm/panfrost/panfrost_dump.c | 4 +- drivers/gpu/drm/panfrost/panfrost_perfcnt.c | 6 +- drivers/gpu/drm/qxl/qxl_object.c | 17 +- drivers/gpu/drm/qxl/qxl_prime.c | 4 +- drivers/gpu/drm/tegra/gem.c | 17 +- drivers/infiniband/core/umem_dmabuf.c | 7 +- .../common/videobuf2/videobuf2-dma-contig.c | 22 +- .../media/common/videobuf2/videobuf2-dma-sg.c | 19 +- .../common/videobuf2/videobuf2-vmalloc.c | 17 +- .../platform/nvidia/tegra-vde/dmabuf-cache.c | 6 +- drivers/misc/fastrpc.c | 6 +- drivers/xen/gntdev-dmabuf.c | 8 +- include/drm/drm_gem.h | 3 + include/linux/dma-buf.h | 17 +- 29 files changed, 318 insertions(+), 155 deletions(-)
Hello Christian,
Quoted 4 lines · Christian König
Hi Dmitry,
I've gone over this multiple times now and while it is still possible that we missed something I think that this should land now.
Thank you very much for the review!
Quoted 3 lines
The whole topic is just to complicated that we can 100% sure guarantee that there isn't anything wrong with the locking, but lockdep and driver testing should allow us to quickly find remaining issues.
At least the most popular drivers should be okay. If anyone will find issue introduced by this series, then indeed shouldn't be a problem to fix it later on.
Quoted 1 line
Do you have commit rights to drm-misc-next or should I push it?
I got the drm-misc commit right two weeks ago, haven't pushed anything there yet. Please let me try to do the push. I'll let you know if any kind of help will be needed from you.
I'll wait for more acks/r-bs and then do the push.
Signature · 2 lines
Best regards, Dmitry
Patchwork
CI[Intel-gfx] ✓ Fi.CI.BAT: success for Move all drivers to a common dma-buf locking convention
In reply to Dmitry Osipenko== Series Details ==
== Series Details ==
Series: Move all drivers to a common dma-buf locking convention
URL : https://patchwork.freedesktop.org/series/108187/
State : success
== Summary ==
CI Bug Log - changes from CI_DRM_12074 -> Patchwork_108187v1
====================================================
Summary
-------
**SUCCESS**
No regressions found.
External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/index.html
Participating hosts (44 -> 41)
------------------------------
Additional (1): fi-icl-u2
Missing (4): fi-cml-u2 fi-bsw-nick fi-bdw-samus bat-dg2-8
Known issues
------------
Here are the changes found in Patchwork_108187v1 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@gem_huc_copy@huc-copy:
- fi-icl-u2: NOTRUN -> [SKIP][1] ([i915#2190])
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/fi-icl-u2/igt@[email protected]
* igt@gem_lmem_swapping@random-engines:
- fi-icl-u2: NOTRUN -> [SKIP][2] ([i915#4613]) +3 similar issues
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/fi-icl-u2/igt@[email protected]
* igt@i915_selftest@live@requests:
- fi-blb-e6850: [PASS][3] -> [DMESG-FAIL][4] ([i915#4528])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12074/fi-blb-e6850/igt@i915_selftest@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/fi-blb-e6850/igt@i915_selftest@[email protected]
* igt@kms_chamelium@common-hpd-after-suspend:
- fi-bdw-5557u: NOTRUN -> [SKIP][5] ([fdo#109271] / [fdo#111827])
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/fi-bdw-5557u/igt@[email protected]
* igt@kms_chamelium@hdmi-hpd-fast:
- fi-icl-u2: NOTRUN -> [SKIP][6] ([fdo#111827]) +8 similar issues
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/fi-icl-u2/igt@[email protected]
* igt@kms_cursor_legacy@basic-busy-flip-before-cursor:
- fi-icl-u2: NOTRUN -> [SKIP][7] ([i915#4103])
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/fi-icl-u2/igt@[email protected]
* igt@kms_cursor_legacy@basic-busy-flip-before-cursor@atomic-transitions-varying-size:
- fi-bsw-kefka: [PASS][8] -> [FAIL][9] ([i915#6298])
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12074/fi-bsw-kefka/igt@kms_cursor_legacy@basic-busy-flip-before-cursor@atomic-transitions-varying-size.html
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/fi-bsw-kefka/igt@kms_cursor_legacy@basic-busy-flip-before-cursor@atomic-transitions-varying-size.html
* igt@kms_force_connector_basic@force-connector-state:
- fi-icl-u2: NOTRUN -> [WARN][10] ([i915#6008])
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/fi-icl-u2/igt@[email protected]
* igt@kms_force_connector_basic@force-load-detect:
- fi-icl-u2: NOTRUN -> [SKIP][11] ([fdo#109285])
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/fi-icl-u2/igt@[email protected]
* igt@kms_setmode@basic-clone-single-crtc:
- fi-icl-u2: NOTRUN -> [SKIP][12] ([i915#3555])
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/fi-icl-u2/igt@[email protected]
* igt@prime_vgem@basic-userptr:
- fi-icl-u2: NOTRUN -> [SKIP][13] ([fdo#109295] / [i915#3301])
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/fi-icl-u2/igt@[email protected]
* igt@runner@aborted:
- fi-blb-e6850: NOTRUN -> [FAIL][14] ([fdo#109271] / [i915#2403] / [i915#4312])
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/fi-blb-e6850/igt@[email protected]
#### Possible fixes ####
* igt@i915_selftest@live@hangcheck:
- {fi-jsl-1}: [INCOMPLETE][15] ([i915#5134]) -> [PASS][16]
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12074/fi-jsl-1/igt@i915_selftest@[email protected]
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/fi-jsl-1/igt@i915_selftest@[email protected]
* igt@i915_selftest@live@requests:
- {bat-rplp-1}: [INCOMPLETE][17] ([i915#6690]) -> [PASS][18]
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12074/bat-rplp-1/igt@i915_selftest@[email protected]
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/bat-rplp-1/igt@i915_selftest@[email protected]
#### Warnings ####
* igt@i915_suspend@basic-s3-without-i915:
- fi-rkl-11600: [FAIL][19] ([fdo#103375]) -> [INCOMPLETE][20] ([i915#5982])
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12074/fi-rkl-11600/igt@[email protected]
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/fi-rkl-11600/igt@[email protected]
{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).
[fdo#103375]: https://bugs.freedesktop.org/show_bug.cgi?id=103375
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#109285]: https://bugs.freedesktop.org/show_bug.cgi?id=109285
[fdo#109295]: https://bugs.freedesktop.org/show_bug.cgi?id=109295
[fdo#111827]: https://bugs.freedesktop.org/show_bug.cgi?id=111827
[i915#1845]: https://gitlab.freedesktop.org/drm/intel/issues/1845
[i915#2190]: https://gitlab.freedesktop.org/drm/intel/issues/2190
[i915#2403]: https://gitlab.freedesktop.org/drm/intel/issues/2403
[i915#2867]: https://gitlab.freedesktop.org/drm/intel/issues/2867
[i915#3301]: https://gitlab.freedesktop.org/drm/intel/issues/3301
[i915#3555]: https://gitlab.freedesktop.org/drm/intel/issues/3555
[i915#4103]: https://gitlab.freedesktop.org/drm/intel/issues/4103
[i915#4312]: https://gitlab.freedesktop.org/drm/intel/issues/4312
[i915#4528]: https://gitlab.freedesktop.org/drm/intel/issues/4528
[i915#4613]: https://gitlab.freedesktop.org/drm/intel/issues/4613
[i915#5134]: https://gitlab.freedesktop.org/drm/intel/issues/5134
[i915#5886]: https://gitlab.freedesktop.org/drm/intel/issues/5886
[i915#5982]: https://gitlab.freedesktop.org/drm/intel/issues/5982
[i915#6008]: https://gitlab.freedesktop.org/drm/intel/issues/6008
[i915#6298]: https://gitlab.freedesktop.org/drm/intel/issues/6298
[i915#6690]: https://gitlab.freedesktop.org/drm/intel/issues/6690
Build changes
-------------
* Linux: CI_DRM_12074 -> Patchwork_108187v1
CI-20190529: 20190529
CI_DRM_12074: c16b937da799ddbebf0d940aff159b96ce9fec0f @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_6644: 9a530abd8643805e586583b6cb1af522ddb43408 @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
Patchwork_108187v1: c16b937da799ddbebf0d940aff159b96ce9fec0f @ git://anongit.freedesktop.org/gfx-ci/linux
### Linux commits
747e17683a7a dma-buf: Remove obsoleted internal lock4c65409c03ea media: videobuf2: Stop using internal dma-buf lock ae48d192d9d7 dma-buf: Document dynamic locking conventionad56ae8c7e42 dma-buf: Move dma_buf_mmap() to dynamic locking specification c1a04a82d749 dma-buf: Move dma_buf_map_attachment() to dynamic locking specification a06cc03d3d16 dma-buf: Move dma_buf_attach() to dynamic locking specification 1555960f994f dma-buf: Move dma_buf_vmap() to dynamic locking specification 1cbe9cba072e media: tegra-vde: Prepare to dynamic dma-buf locking specification 8f13f19f34ed media: videobuf2: Prepare to dynamic dma-buf locking specification c8462efcda32 xen/gntdev: Prepare to dynamic dma-buf locking specification 93293f9e6f05 misc: fastrpc: Prepare to dynamic dma-buf locking specification f154e9f5a815 RDMA/umem: Prepare to dynamic dma-buf locking specification 2adf45c5ea9d drm/etnaviv: Prepare to dynamic dma-buf locking specification f6886e52e76d drm/tegra: Prepare to dynamic dma-buf locking specification 6effce960372 drm/omapdrm: Prepare to dynamic dma-buf locking specification 9557515fbc75 drm/i915: Prepare to dynamic dma-buf locking specification 5e44532e5794 drm/armada: Prepare to dynamic dma-buf locking specification 89cf1ff33c59 drm/prime: Prepare to dynamic dma-buf locking specification 9487f33537ad drm/gem: Take reservation lock for vmap/vunmap operations 30c04bc12f6d dma-buf: Add unlocked variant of attachment-mapping functions 3c516218484e dma-buf: Add unlocked variant of vmapping functions
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/index.html
Patchwork
CI[Intel-gfx] ✓ Fi.CI.IGT: success for Move all drivers to a common dma-buf locking convention
In reply to Dmitry Osipenko== Series Details ==
== Series Details ==
Series: Move all drivers to a common dma-buf locking convention
URL : https://patchwork.freedesktop.org/series/108187/
State : success
== Summary ==
CI Bug Log - changes from CI_DRM_12074_full -> Patchwork_108187v1_full
====================================================
Summary
-------
**SUCCESS**
No regressions found.
Participating hosts (12 -> 11)
------------------------------
Missing (1): shard-rkl
Known issues
------------
Here are the changes found in Patchwork_108187v1_full that come from known issues:
### CI changes ###
#### Issues hit ####
* boot:
- shard-glk: ([PASS][1], [PASS][2], [PASS][3], [PASS][4], [PASS][5], [PASS][6], [PASS][7], [PASS][8], [PASS][9], [PASS][10], [PASS][11], [PASS][12], [PASS][13], [PASS][14], [PASS][15], [PASS][16], [PASS][17], [PASS][18], [PASS][19], [PASS][20], [PASS][21], [PASS][22], [PASS][23], [PASS][24], [PASS][25]) -> ([PASS][26], [FAIL][27], [PASS][28], [PASS][29], [PASS][30], [PASS][31], [PASS][32], [PASS][33], [PASS][34], [PASS][35], [PASS][36], [PASS][37], [PASS][38], [PASS][39], [PASS][40], [PASS][41], [PASS][42], [PASS][43], [PASS][44], [PASS][45], [PASS][46], [PASS][47], [PASS][48], [PASS][49], [PASS][50]) ([i915#4392])
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12074/shard-glk9/boot.html
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12074/shard-glk1/boot.html
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12074/shard-glk1/boot.html
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12074/shard-glk1/boot.html
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12074/shard-glk2/boot.html
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12074/shard-glk2/boot.html
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12074/shard-glk2/boot.html
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12074/shard-glk2/boot.html
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12074/shard-glk3/boot.html
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12074/shard-glk3/boot.html
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12074/shard-glk3/boot.html
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12074/shard-glk5/boot.html
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12074/shard-glk5/boot.html
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12074/shard-glk6/boot.html
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12074/shard-glk6/boot.html
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12074/shard-glk6/boot.html
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12074/shard-glk7/boot.html
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12074/shard-glk7/boot.html
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12074/shard-glk7/boot.html
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12074/shard-glk7/boot.html
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12074/shard-glk8/boot.html
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12074/shard-glk9/boot.html
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12074/shard-glk8/boot.html
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12074/shard-glk8/boot.html
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12074/shard-glk9/boot.html
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-glk1/boot.html
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-glk1/boot.html
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-glk1/boot.html
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-glk1/boot.html
[30]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-glk2/boot.html
[31]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-glk2/boot.html
[32]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-glk2/boot.html
[33]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-glk2/boot.html
[34]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-glk3/boot.html
[35]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-glk3/boot.html
[36]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-glk3/boot.html
[37]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-glk5/boot.html
[38]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-glk5/boot.html
[39]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-glk5/boot.html
[40]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-glk6/boot.html
[41]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-glk6/boot.html
[42]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-glk6/boot.html
[43]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-glk7/boot.html
[44]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-glk7/boot.html
[45]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-glk7/boot.html
[46]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-glk8/boot.html
[47]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-glk8/boot.html
[48]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-glk9/boot.html
[49]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-glk9/boot.html
[50]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-glk9/boot.html
#### Possible fixes ####
* boot:
- shard-apl: ([PASS][51], [PASS][52], [PASS][53], [PASS][54], [PASS][55], [PASS][56], [PASS][57], [PASS][58], [PASS][59], [FAIL][60], [PASS][61], [PASS][62], [PASS][63], [PASS][64], [PASS][65], [PASS][66], [PASS][67], [PASS][68], [PASS][69], [PASS][70], [PASS][71], [PASS][72], [PASS][73], [PASS][74], [PASS][75]) ([i915#4386]) -> ([PASS][76], [PASS][77], [PASS][78], [PASS][79], [PASS][80], [PASS][81], [PASS][82], [PASS][83], [PASS][84], [PASS][85], [PASS][86], [PASS][87], [PASS][88], [PASS][89], [PASS][90], [PASS][91], [PASS][92], [PASS][93], [PASS][94], [PASS][95], [PASS][96], [PASS][97], [PASS][98], [PASS][99], [PASS][100])
[51]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12074/shard-apl7/boot.html
[52]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12074/shard-apl7/boot.html
[53]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12074/shard-apl7/boot.html
[54]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12074/shard-apl8/boot.html
[55]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12074/shard-apl8/boot.html
[56]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12074/shard-apl1/boot.html
[57]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12074/shard-apl1/boot.html
[58]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12074/shard-apl1/boot.html
[59]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12074/shard-apl1/boot.html
[60]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12074/shard-apl2/boot.html
[61]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12074/shard-apl2/boot.html
[62]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12074/shard-apl2/boot.html
[63]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12074/shard-apl2/boot.html
[64]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12074/shard-apl3/boot.html
[65]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12074/shard-apl3/boot.html
[66]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12074/shard-apl3/boot.html
[67]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12074/shard-apl3/boot.html
[68]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12074/shard-apl4/boot.html
[69]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12074/shard-apl4/boot.html
[70]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12074/shard-apl4/boot.html
[71]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12074/shard-apl4/boot.html
[72]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12074/shard-apl6/boot.html
[73]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12074/shard-apl6/boot.html
[74]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12074/shard-apl6/boot.html
[75]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12074/shard-apl6/boot.html
[76]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-apl2/boot.html
[77]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-apl2/boot.html
[78]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-apl3/boot.html
[79]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-apl6/boot.html
[80]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-apl4/boot.html
[81]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-apl6/boot.html
[82]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-apl6/boot.html
[83]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-apl7/boot.html
[84]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-apl6/boot.html
[85]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-apl7/boot.html
[86]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-apl7/boot.html
[87]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-apl8/boot.html
[88]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-apl8/boot.html
[89]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-apl8/boot.html
[90]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-apl4/boot.html
[91]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-apl8/boot.html
[92]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-apl4/boot.html
[93]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-apl1/boot.html
[94]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-apl4/boot.html
[95]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-apl1/boot.html
[96]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-apl3/boot.html
[97]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-apl1/boot.html
[98]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-apl1/boot.html
[99]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-apl1/boot.html
[100]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-apl3/boot.html
### IGT changes ###
#### Issues hit ####
* igt@gem_ccs@suspend-resume:
- shard-iclb: NOTRUN -> [SKIP][101] ([i915#5327])
[101]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-iclb2/igt@[email protected]
* igt@gem_eio@in-flight-10ms:
- shard-tglb: [PASS][102] -> [TIMEOUT][103] ([i915#3063])
[102]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12074/shard-tglb6/igt@[email protected]
[103]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-tglb3/igt@[email protected]
* igt@gem_eio@reset-stress:
- shard-tglb: [PASS][104] -> [FAIL][105] ([i915#5784])
[104]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12074/shard-tglb2/igt@[email protected]
[105]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-tglb5/igt@[email protected]
* igt@gem_exec_balancer@parallel-keep-submit-fence:
- shard-iclb: [PASS][106] -> [SKIP][107] ([i915#4525])
[106]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12074/shard-iclb1/igt@[email protected]
[107]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-iclb5/igt@[email protected]
* igt@gem_exec_fair@basic-none-solo@rcs0:
- shard-apl: [PASS][108] -> [FAIL][109] ([i915#2842])
[108]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12074/shard-apl1/igt@gem_exec_fair@[email protected]
[109]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-apl4/igt@gem_exec_fair@[email protected]
* igt@gem_exec_fair@basic-pace-share@rcs0:
- shard-glk: [PASS][110] -> [FAIL][111] ([i915#2842]) +2 similar issues
[110]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12074/shard-glk5/igt@gem_exec_fair@[email protected]
[111]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-glk8/igt@gem_exec_fair@[email protected]
* igt@gem_lmem_swapping@heavy-verify-multi-ccs:
- shard-glk: NOTRUN -> [SKIP][112] ([fdo#109271] / [i915#4613])
[112]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-glk3/igt@[email protected]
* igt@gem_lmem_swapping@heavy-verify-random:
- shard-iclb: NOTRUN -> [SKIP][113] ([i915#4613])
[113]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-iclb6/igt@[email protected]
* igt@gem_pxp@create-regular-context-2:
- shard-iclb: NOTRUN -> [SKIP][114] ([i915#4270])
[114]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-iclb6/igt@[email protected]
* igt@gem_render_copy@yf-tiled-to-vebox-y-tiled:
- shard-iclb: NOTRUN -> [SKIP][115] ([i915#768])
[115]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-iclb6/igt@[email protected]
* igt@gen7_exec_parse@oacontrol-tracking:
- shard-iclb: NOTRUN -> [SKIP][116] ([fdo#109289])
[116]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-iclb6/igt@[email protected]
* igt@gen9_exec_parse@bb-start-far:
- shard-iclb: NOTRUN -> [SKIP][117] ([i915#2856])
[117]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-iclb2/igt@[email protected]
* igt@i915_pm_rpm@pc8-residency:
- shard-iclb: NOTRUN -> [SKIP][118] ([fdo#109293] / [fdo#109506])
[118]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-iclb2/igt@[email protected]
* igt@kms_big_fb@4-tiled-max-hw-stride-32bpp-rotate-0:
- shard-iclb: NOTRUN -> [SKIP][119] ([i915#5286]) +1 similar issue
[119]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-iclb6/igt@[email protected]
* igt@kms_big_fb@linear-32bpp-rotate-270:
- shard-iclb: NOTRUN -> [SKIP][120] ([fdo#110725] / [fdo#111614])
[120]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-iclb2/igt@[email protected]
* igt@kms_big_fb@yf-tiled-8bpp-rotate-180:
- shard-iclb: NOTRUN -> [SKIP][121] ([fdo#110723]) +1 similar issue
[121]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-iclb6/igt@[email protected]
* igt@kms_ccs@pipe-a-ccs-on-another-bo-y_tiled_gen12_mc_ccs:
- shard-apl: NOTRUN -> [SKIP][122] ([fdo#109271] / [i915#3886]) +1 similar issue
[122]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-apl8/igt@kms_ccs@pipe-a-ccs-on-another-bo-y_tiled_gen12_mc_ccs.html
* igt@kms_ccs@pipe-b-bad-pixel-format-y_tiled_gen12_mc_ccs:
- shard-glk: NOTRUN -> [SKIP][123] ([fdo#109271] / [i915#3886]) +2 similar issues
[123]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-glk3/igt@kms_ccs@pipe-b-bad-pixel-format-y_tiled_gen12_mc_ccs.html
* igt@kms_ccs@pipe-b-bad-rotation-90-y_tiled_gen12_mc_ccs:
- shard-iclb: NOTRUN -> [SKIP][124] ([fdo#109278] / [i915#3886]) +2 similar issues
[124]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-iclb6/igt@kms_ccs@pipe-b-bad-rotation-90-y_tiled_gen12_mc_ccs.html
* igt@kms_ccs@pipe-c-random-ccs-data-4_tiled_dg2_mc_ccs:
- shard-iclb: NOTRUN -> [SKIP][125] ([fdo#109278]) +11 similar issues
[125]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-iclb6/igt@kms_ccs@pipe-c-random-ccs-data-4_tiled_dg2_mc_ccs.html
* igt@kms_chamelium@hdmi-hpd-storm:
- shard-apl: NOTRUN -> [SKIP][126] ([fdo#109271] / [fdo#111827]) +2 similar issues
[126]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-apl4/igt@[email protected]
- shard-iclb: NOTRUN -> [SKIP][127] ([fdo#109284] / [fdo#111827]) +2 similar issues
[127]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-iclb2/igt@[email protected]
* igt@kms_content_protection@content_type_change:
- shard-iclb: NOTRUN -> [SKIP][128] ([fdo#109300] / [fdo#111066]) +1 similar issue
[128]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-iclb6/igt@kms_content_protection@content_type_change.html
* igt@kms_content_protection@uevent:
- shard-apl: NOTRUN -> [FAIL][129] ([i915#2105])
[129]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-apl8/igt@[email protected]
* igt@kms_cursor_crc@cursor-suspend@pipe-c-dp-1:
- shard-apl: [PASS][130] -> [DMESG-WARN][131] ([i915#180]) +1 similar issue
[130]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12074/shard-apl1/igt@kms_cursor_crc@[email protected]
[131]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-apl8/igt@kms_cursor_crc@[email protected]
* igt@kms_draw_crc@draw-method-xrgb2101010-pwrite-4tiled:
- shard-iclb: NOTRUN -> [SKIP][132] ([i915#5287]) +1 similar issue
[132]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-iclb6/igt@[email protected]
* igt@kms_flip@2x-modeset-vs-vblank-race-interruptible:
- shard-iclb: NOTRUN -> [SKIP][133] ([fdo#109274]) +2 similar issues
[133]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-iclb2/igt@[email protected]
* igt@kms_flip@flip-vs-expired-vblank-interruptible@a-hdmi-a2:
- shard-glk: [PASS][134] -> [FAIL][135] ([i915#79])
[134]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12074/shard-glk6/igt@kms_flip@[email protected]
[135]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-glk1/igt@kms_flip@[email protected]
* igt@kms_flip_scaled_crc@flip-32bpp-4tile-to-64bpp-4tile-downscaling@pipe-a-valid-mode:
- shard-iclb: NOTRUN -> [SKIP][136] ([i915#2672]) +3 similar issues
[136]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-iclb4/igt@kms_flip_scaled_crc@flip-32bpp-4tile-to-64bpp-4tile-downscaling@pipe-a-valid-mode.html
* igt@kms_frontbuffer_tracking@psr-2p-primscrn-cur-indfb-move:
- shard-iclb: NOTRUN -> [SKIP][137] ([fdo#109280]) +12 similar issues
[137]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-iclb2/igt@[email protected]
* igt@kms_frontbuffer_tracking@psr-2p-scndscrn-spr-indfb-draw-render:
- shard-apl: NOTRUN -> [SKIP][138] ([fdo#109271]) +84 similar issues
[138]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-apl8/igt@kms_frontbuffer_tracking@psr-2p-scndscrn-spr-indfb-draw-render.html
* igt@kms_hdr@static-toggle-dpms:
- shard-iclb: NOTRUN -> [SKIP][139] ([i915#3555])
[139]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-iclb6/igt@[email protected]
* igt@kms_plane_alpha_blend@pipe-b-constant-alpha-max:
- shard-glk: NOTRUN -> [FAIL][140] ([fdo#108145] / [i915#265])
[140]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-glk3/igt@[email protected]
* igt@kms_plane_alpha_blend@pipe-c-alpha-transparent-fb:
- shard-apl: NOTRUN -> [FAIL][141] ([i915#265])
[141]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-apl4/igt@[email protected]
* igt@kms_prime@basic-crc-hybrid:
- shard-iclb: NOTRUN -> [SKIP][142] ([i915#6524])
[142]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-iclb6/igt@[email protected]
* igt@kms_psr2_sf@cursor-plane-update-sf:
- shard-apl: NOTRUN -> [SKIP][143] ([fdo#109271] / [i915#658]) +2 similar issues
[143]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-apl8/igt@[email protected]
* igt@kms_psr2_su@page_flip-nv12:
- shard-iclb: NOTRUN -> [FAIL][144] ([i915#5939])
[144]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-iclb2/igt@kms_psr2_su@page_flip-nv12.html
* igt@kms_psr2_su@page_flip-xrgb8888:
- shard-iclb: [PASS][145] -> [SKIP][146] ([fdo#109642] / [fdo#111068] / [i915#658])
[145]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12074/shard-iclb2/igt@kms_psr2_su@page_flip-xrgb8888.html
[146]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-iclb4/igt@kms_psr2_su@page_flip-xrgb8888.html
* igt@kms_psr@psr2_no_drrs:
- shard-iclb: NOTRUN -> [SKIP][147] ([fdo#109441])
[147]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-iclb6/igt@kms_psr@psr2_no_drrs.html
* igt@kms_psr_stress_test@invalidate-primary-flip-overlay:
- shard-tglb: [PASS][148] -> [SKIP][149] ([i915#5519])
[148]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12074/shard-tglb3/igt@[email protected]
[149]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-tglb6/igt@[email protected]
* igt@perf_pmu@event-wait@rcs0:
- shard-iclb: NOTRUN -> [SKIP][150] ([fdo#112283])
[150]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-iclb6/igt@perf_pmu@[email protected]
* igt@prime_nv_pcopy@test3_3:
- shard-glk: NOTRUN -> [SKIP][151] ([fdo#109271]) +25 similar issues
[151]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-glk3/igt@prime_nv_pcopy@test3_3.html
* igt@prime_udl:
- shard-iclb: NOTRUN -> [SKIP][152] ([fdo#109291])
[152]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-iclb6/igt@prime_udl.html
* igt@sysfs_clients@fair-0:
- shard-apl: NOTRUN -> [SKIP][153] ([fdo#109271] / [i915#2994])
[153]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-apl8/igt@[email protected]
* igt@sysfs_clients@recycle-many:
- shard-glk: NOTRUN -> [SKIP][154] ([fdo#109271] / [i915#2994])
[154]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-glk3/igt@[email protected]
* igt@sysfs_clients@sema-10:
- shard-iclb: NOTRUN -> [SKIP][155] ([i915#2994])
[155]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-iclb6/igt@[email protected]
#### Possible fixes ####
* igt@gem_ctx_exec@basic-nohangcheck:
- shard-tglb: [FAIL][156] ([i915#6268]) -> [PASS][157]
[156]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12074/shard-tglb2/igt@[email protected]
[157]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-tglb6/igt@[email protected]
* igt@gem_eio@kms:
- shard-tglb: [FAIL][158] ([i915#5784]) -> [PASS][159]
[158]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12074/shard-tglb3/igt@[email protected]
[159]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-tglb7/igt@[email protected]
* igt@gem_exec_fair@basic-none-share@rcs0:
- shard-iclb: [FAIL][160] ([i915#2842]) -> [PASS][161]
[160]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12074/shard-iclb3/igt@gem_exec_fair@[email protected]
[161]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-iclb7/igt@gem_exec_fair@[email protected]
* igt@gem_exec_fair@basic-none@vcs0:
- shard-glk: [FAIL][162] ([i915#2842]) -> [PASS][163]
[162]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12074/shard-glk6/igt@gem_exec_fair@[email protected]
[163]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-glk3/igt@gem_exec_fair@[email protected]
* igt@gem_exec_fair@basic-pace-solo@rcs0:
- shard-apl: [FAIL][164] ([i915#2842]) -> [PASS][165]
[164]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12074/shard-apl7/igt@gem_exec_fair@[email protected]
[165]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-apl1/igt@gem_exec_fair@[email protected]
* igt@gem_exec_whisper@basic-contexts-forked:
- shard-iclb: [INCOMPLETE][166] -> [PASS][167] +1 similar issue
[166]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12074/shard-iclb7/igt@[email protected]
[167]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-iclb2/igt@[email protected]
* igt@gem_huc_copy@huc-copy:
- shard-tglb: [SKIP][168] ([i915#2190]) -> [PASS][169]
[168]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12074/shard-tglb7/igt@[email protected]
[169]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-tglb2/igt@[email protected]
* igt@gen9_exec_parse@allowed-all:
- shard-glk: [DMESG-WARN][170] ([i915#5566] / [i915#716]) -> [PASS][171]
[170]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12074/shard-glk2/igt@[email protected]
[171]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-glk3/igt@[email protected]
* igt@i915_pm_dc@dc9-dpms:
- shard-iclb: [SKIP][172] ([i915#4281]) -> [PASS][173]
[172]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12074/shard-iclb3/igt@[email protected]
[173]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-iclb7/igt@[email protected]
* igt@kms_flip@flip-vs-suspend@c-dp1:
- shard-apl: [DMESG-WARN][174] ([i915#180]) -> [PASS][175] +2 similar issues
[174]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12074/shard-apl8/igt@kms_flip@[email protected]
[175]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-apl2/igt@kms_flip@[email protected]
* igt@perf@blocking:
- shard-tglb: [FAIL][176] ([i915#1542]) -> [PASS][177]
[176]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12074/shard-tglb6/igt@[email protected]
[177]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-tglb7/igt@[email protected]
#### Warnings ####
* igt@gem_eio@unwedge-stress:
- shard-tglb: [TIMEOUT][178] ([i915#3063]) -> [FAIL][179] ([i915#5784])
[178]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12074/shard-tglb6/igt@[email protected]
[179]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-tglb3/igt@[email protected]
* igt@kms_hdr@bpc-switch-suspend@pipe-a-dp-1:
- shard-apl: [FAIL][180] ([i915#1188]) -> [DMESG-FAIL][181] ([i915#180])
[180]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12074/shard-apl4/igt@kms_hdr@[email protected]
[181]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-apl8/igt@kms_hdr@[email protected]
* igt@kms_psr2_sf@cursor-plane-move-continuous-exceed-sf:
- shard-iclb: [SKIP][182] ([i915#2920]) -> [SKIP][183] ([i915#658])
[182]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12074/shard-iclb2/igt@[email protected]
[183]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108187v1/shard-iclb4/igt@[email protected]
{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).
[fdo#108145]: https://bugs.freedesktop.org/show_bug.cgi?id=108145
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#109274]: https://bugs.freedesktop.org/show_bug.cgi?id=109274
[fdo#109278]: https://bugs.freedesktop.org/show_bug.cgi?id=109278
[fdo#109280]: https://bugs.freedesktop.org/show_bug.cgi?id=109280
[fdo#109284]: https://bugs.freedesktop.org/show_bug.cgi?id=109284
[fdo#109285]: https://bugs.freedesktop.org/show_bug.cgi?id=109285
[fdo#109289]: https://bugs.freedesktop.org/show_bug.cgi?id=109289
[fdo#109291]: https://bugs.freedesktop.org/show_bug.cgi?id=109291
[fdo#109293]: https://bugs.freedesktop.org/show_bug.cgi?id=109293
[fdo#109295]: https://bugs.freedesktop.org/show_bug.cgi?id=109295
[fdo#109300]: https://bugs.freedesktop.org/show_bug.cgi?id=109300
[fdo#109441]: https://bugs.freedesktop.org/show_bug.cgi?id=109441
[fdo#109506]: https://bugs.freedesktop.org/show_bug.cgi?id=109506
[fdo#109642]: https://bugs.freedesktop.org/show_bug.cgi?id=109642
[fdo#110189]: https://bugs.freedesktop.org/show_bug.cgi?id=110189
[fdo#110723]: https://bugs.freedesktop.org/show_bug.cgi?id=110723
[fdo#110725]: https://bugs.freedesktop.org/show_bug.cgi?id=110725
[fdo#111066]: https://bugs.freedesktop.org/show_bug.cgi?id=111066
[fdo#111068]: https://bugs.freedesktop.org/show_bug.cgi?id=111068
[fdo#111614]: https://bugs.freedesktop.org/show_bug.cgi?id=111614
[fdo#111615]: https://bugs.freedesktop.org/show_bug.cgi?id=111615
[fdo#111644]: https://bugs.freedesktop.org/show_bug.cgi?id=111644
[fdo#111827]: https://bugs.freedesktop.org/show_bug.cgi?id=111827
[fdo#112283]: https://bugs.freedesktop.org/show_bug.cgi?id=112283
[i915#1063]: https://gitlab.freedesktop.org/drm/intel/issues/1063
[i915#1155]: https://gitlab.freedesktop.org/drm/intel/issues/1155
[i915#1188]: https://gitlab.freedesktop.org/drm/intel/issues/1188
[i915#1397]: https://gitlab.freedesktop.org/drm/intel/issues/1397
[i915#1542]: https://gitlab.freedesktop.org/drm/intel/issues/1542
[i915#180]: https://gitlab.freedesktop.org/drm/intel/issues/180
[i915#1839]: https://gitlab.freedesktop.org/drm/intel/issues/1839
[i915#2105]: https://gitlab.freedesktop.org/drm/intel/issues/2105
[i915#2190]: https://gitlab.freedesktop.org/drm/intel/issues/2190
[i915#2437]: https://gitlab.freedesktop.org/drm/intel/issues/2437
[i915#2527]: https://gitlab.freedesktop.org/drm/intel/issues/2527
[i915#2530]: https://gitlab.freedesktop.org/drm/intel/issues/2530
[i915#265]: https://gitlab.freedesktop.org/drm/intel/issues/265
[i915#2658]: https://gitlab.freedesktop.org/drm/intel/issues/2658
[i915#2672]: https://gitlab.freedesktop.org/drm/intel/issues/2672
[i915#2705]: https://gitlab.freedesktop.org/drm/intel/issues/2705
[i915#2842]: https://gitlab.freedesktop.org/drm/intel/issues/2842
[i915#2856]: https://gitlab.freedesktop.org/drm/intel/issues/2856
[i915#2920]: https://gitlab.freedesktop.org/drm/intel/issues/2920
[i915#2994]: https://gitlab.freedesktop.org/drm/intel/issues/2994
[i915#3063]: https://gitlab.freedesktop.org/drm/intel/issues/3063
[i915#3297]: https://gitlab.freedesktop.org/drm/intel/issues/3297
[i915#3376]: https://gitlab.freedesktop.org/drm/intel/issues/3376
[i915#3555]: https://gitlab.freedesktop.org/drm/intel/issues/3555
[i915#3637]: https://gitlab.freedesktop.org/drm/intel/issues/3637
[i915#3689]: https://gitlab.freedesktop.org/drm/intel/issues/3689
[i915#3742]: https://gitlab.freedesktop.org/drm/intel/issues/3742
[i915#3886]: https://gitlab.freedesktop.org/drm/intel/issues/3886
[i915#4270]: https://gitlab.freedesktop.org/drm/intel/issues/4270
[i915#4281]: https://gitlab.freedesktop.org/drm/intel/issues/4281
[i915#4386]: https://gitlab.freedesktop.org/drm/intel/issues/4386
[i915#4392]: https://gitlab.freedesktop.org/drm/intel/issues/4392
[i915#4525]: https://gitlab.freedesktop.org/drm/intel/issues/4525
[i915#4613]: https://gitlab.freedesktop.org/drm/intel/issues/4613
[i915#4991]: https://gitlab.freedesktop.org/drm/intel/issues/4991
[i915#5176]: https://gitlab.freedesktop.org/drm/intel/issues/5176
[i915#5182]: https://gitlab.freedesktop.org/drm/intel/issues/5182
[i915#5235]: https://gitlab.freedesktop.org/drm/intel/issues/5235
[i915#5286]: https://gitlab.freedesktop.org/drm/intel/issues/5286
[i915#5287]: https://gitlab.freedesktop.org/drm/intel/issues/5287
[i915#5327]: https://gitlab.freedesktop.org/drm/intel/issues/5327
[i915#5519]: https://gitlab.freedesktop.org/drm/intel/issues/5519
[i915#5566]: https://gitlab.freedesktop.org/drm/intel/issues/5566
[i915#5784]: https://gitlab.freedesktop.org/drm/intel/issues/5784
[i915#5939]: https://gitlab.freedesktop.org/drm/intel/issues/5939
[i915#6095]: https://gitlab.freedesktop.org/drm/intel/issues/6095
[i915#6230]: https://gitlab.freedesktop.org/drm/intel/issues/6230
[i915#6268]: https://gitlab.freedesktop.org/drm/intel/issues/6268
[i915#6344]: https://gitlab.freedesktop.org/drm/intel/issues/6344
[i915#6524]: https://gitlab.freedesktop.org/drm/intel/issues/6524
[i915#658]: https://gitlab.freedesktop.org/drm/intel/issues/658
[i915#6590]: https://gitlab.freedesktop.org/drm/intel/issues/6590
[i915#716]: https://gitlab.freedesktop.org/drm/intel/issues/716
[i915#768]: https://gitlab.freedesktop.org/drm/intel/issues/768
[i915#79]: https://gitlab.freedesktop.org/drm/intel/issues/79
Build changes
-------------
* Linux: CI_DRM_12074 -> Patchwork_108187v1
CI-20190529: 20190529
CI_DRM_12074: c16b937da799ddbebf0d940aff159b96ce9fec0f @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_6644: 9a530abd8643805e586583b6cb1af522ddb43408 @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
Patchwork_108187v1: c16b937da799ddbebf0d940aff159b96ce9fec0f @ 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_108187v1/index.html