[Spice-devel] [PATCH v1 3/6] dma-buf: Move all dma-bufs to dynamic locking specification

2022-07-14 Thread Dmitry Osipenko
This patch moves the non-dynamic dma-buf users over to the dynamic locking specification. From now on all dma-buf importers are responsible for holding dma-buf's reservation lock around operations performed over dma-bufs. This strict locking convention prevents dead lock situation for dma-buf impor

[Spice-devel] [PATCH v1 2/6] drm/gem: Take reservation lock for vmap/vunmap operations

2022-07-14 Thread Dmitry Osipenko
The 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 QXL and i915 drivers to use the locked functions for the case where DRM core now holds the loc

[Spice-devel] [PATCH v1 1/6] dma-buf: Add _unlocked postfix to function names

2022-07-14 Thread Dmitry Osipenko
Add _unlocked postfix to the dma-buf API function names in a preparation to move all non-dynamic dma-buf users over to the dynamic locking specification. This patch only renames API functions, preparing drivers to the common locking convention. Later on we will make the "unlocked" functions to take

[Spice-devel] [PATCH v1 0/6] Move all drivers to a common dma-buf locking convention

2022-07-14 Thread Dmitry Osipenko
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. This common locking convention allows us to utilize reservation lock more b

[Spice-devel] [PATCH v1 6/6] dma-buf: Remove internal lock

2022-07-14 Thread Dmitry Osipenko
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. Signed-off-by: Dmitry Osipenko --- d

[Spice-devel] [PATCH v1 5/6] media: videobuf2: Stop using internal dma-buf lock

2022-07-14 Thread Dmitry Osipenko
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. Sig

[Spice-devel] [PATCH v1 4/6] dma-buf: Acquire wait-wound context on attachment

2022-07-14 Thread Dmitry Osipenko
Intel i915 GPU driver uses wait-wound mutex to lock multiple GEMs on the attachment to the i915 dma-buf. In order to let all drivers utilize shared wait-wound context during attachment in a general way, make dma-buf core to acquire the ww context internally for the attachment operation and update i