dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/todo: Add entry for moving to dma_resv_lock
@ 2021-01-22 13:36 Daniel Vetter
  2021-01-22 13:40 ` [Linaro-mm-sig] " Christian König
  2021-01-22 14:06 ` Thomas Zimmermann
  0 siblings, 2 replies; 5+ messages in thread
From: Daniel Vetter @ 2021-01-22 13:36 UTC (permalink / raw)
  To: DRI Development
  Cc: David Airlie, Daniel Vetter, Christian König, linaro-mm-sig,
	Thomas Zimmermann, Daniel Vetter, linux-media

Requested by Thomas. I think it justifies a new level, since I tried
to make some forward progress on this last summer, and gave up (for
now). This is very tricky.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Maxime Ripard <mripard@kernel.org>
Cc: Thomas Zimmermann <tzimmermann@suse.de>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Cc: "Christian König" <christian.koenig@amd.com>
Cc: linux-media@vger.kernel.org
Cc: linaro-mm-sig@lists.linaro.org
---
 Documentation/gpu/todo.rst | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/Documentation/gpu/todo.rst b/Documentation/gpu/todo.rst
index dea9082c0e5f..f872d3d33218 100644
--- a/Documentation/gpu/todo.rst
+++ b/Documentation/gpu/todo.rst
@@ -23,6 +23,9 @@ Advanced: Tricky tasks that need fairly good understanding of the DRM subsystem
 and graphics topics. Generally need the relevant hardware for development and
 testing.
 
+Expert: Only attempt these if you've successfully completed some tricky
+refactorings already and are an expert in the specific area
+
 Subsystem-wide refactorings
 ===========================
 
@@ -168,6 +171,22 @@ Contact: Daniel Vetter, respective driver maintainers
 
 Level: Advanced
 
+Move Buffer Object Locking to dma_resv_lock()
+---------------------------------------------
+
+Many drivers have their own per-object locking scheme, usually using
+mutex_lock(). This causes all kinds of trouble for buffer sharing, since
+depending which driver is the exporter and importer, the locking hierarchy is
+reversed.
+
+To solve this we need one standard per-object locking mechanism, which is
+dma_resv_lock(). This lock needs to be called as the outermost lock, with all
+other driver specific per-object locks removed. The problem is tha rolling out
+the actual change to the locking contract is a flag day, due to struct dma_buf
+buffer sharing.
+
+Level: Expert
+
 Convert logging to drm_* functions with drm_device paramater
 ------------------------------------------------------------
 
-- 
2.30.0

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [Linaro-mm-sig] [PATCH] drm/todo: Add entry for moving to dma_resv_lock
  2021-01-22 13:36 [PATCH] drm/todo: Add entry for moving to dma_resv_lock Daniel Vetter
@ 2021-01-22 13:40 ` Christian König
  2021-01-22 13:45   ` Daniel Vetter
  2021-01-22 14:06 ` Thomas Zimmermann
  1 sibling, 1 reply; 5+ messages in thread
From: Christian König @ 2021-01-22 13:40 UTC (permalink / raw)
  To: Daniel Vetter, DRI Development
  Cc: Thomas Zimmermann, David Airlie, linaro-mm-sig, Daniel Vetter,
	Christian König, linux-media

Am 22.01.21 um 14:36 schrieb Daniel Vetter:
> Requested by Thomas. I think it justifies a new level, since I tried
> to make some forward progress on this last summer, and gave up (for
> now). This is very tricky.
>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Cc: Maxime Ripard <mripard@kernel.org>
> Cc: Thomas Zimmermann <tzimmermann@suse.de>
> Cc: David Airlie <airlied@linux.ie>
> Cc: Daniel Vetter <daniel@ffwll.ch>
> Cc: Sumit Semwal <sumit.semwal@linaro.org>
> Cc: "Christian König" <christian.koenig@amd.com>
> Cc: linux-media@vger.kernel.org
> Cc: linaro-mm-sig@lists.linaro.org
> ---
>   Documentation/gpu/todo.rst | 19 +++++++++++++++++++
>   1 file changed, 19 insertions(+)
>
> diff --git a/Documentation/gpu/todo.rst b/Documentation/gpu/todo.rst
> index dea9082c0e5f..f872d3d33218 100644
> --- a/Documentation/gpu/todo.rst
> +++ b/Documentation/gpu/todo.rst
> @@ -23,6 +23,9 @@ Advanced: Tricky tasks that need fairly good understanding of the DRM subsystem
>   and graphics topics. Generally need the relevant hardware for development and
>   testing.
>   
> +Expert: Only attempt these if you've successfully completed some tricky
> +refactorings already and are an expert in the specific area
> +
>   Subsystem-wide refactorings
>   ===========================
>   
> @@ -168,6 +171,22 @@ Contact: Daniel Vetter, respective driver maintainers
>   
>   Level: Advanced
>   
> +Move Buffer Object Locking to dma_resv_lock()
> +---------------------------------------------
> +
> +Many drivers have their own per-object locking scheme, usually using
> +mutex_lock(). This causes all kinds of trouble for buffer sharing, since
> +depending which driver is the exporter and importer, the locking hierarchy is
> +reversed.
> +
> +To solve this we need one standard per-object locking mechanism, which is
> +dma_resv_lock(). This lock needs to be called as the outermost lock, with all
> +other driver specific per-object locks removed. The problem is tha rolling out
> +the actual change to the locking contract is a flag day, due to struct dma_buf
> +buffer sharing.
> +
> +Level: Expert
> +

Could you name some examples of driver locks here? I'm not aware in 
anything like this in amdgpu, radeon or neveau.

And yes sounds like a job for the appropriate driver maintainer.

Thanks,
Christian.

>   Convert logging to drm_* functions with drm_device paramater
>   ------------------------------------------------------------
>   

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Linaro-mm-sig] [PATCH] drm/todo: Add entry for moving to dma_resv_lock
  2021-01-22 13:40 ` [Linaro-mm-sig] " Christian König
@ 2021-01-22 13:45   ` Daniel Vetter
  0 siblings, 0 replies; 5+ messages in thread
From: Daniel Vetter @ 2021-01-22 13:45 UTC (permalink / raw)
  To: Christian König
  Cc: David Airlie, moderated list:DMA BUFFER SHARING FRAMEWORK,
	DRI Development, Thomas Zimmermann, Daniel Vetter,
	open list:DMA BUFFER SHARING FRAMEWORK

On Fri, Jan 22, 2021 at 2:40 PM Christian König
<ckoenig.leichtzumerken@gmail.com> wrote:
>
> Am 22.01.21 um 14:36 schrieb Daniel Vetter:
> > Requested by Thomas. I think it justifies a new level, since I tried
> > to make some forward progress on this last summer, and gave up (for
> > now). This is very tricky.
> >
> > Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> > Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> > Cc: Maxime Ripard <mripard@kernel.org>
> > Cc: Thomas Zimmermann <tzimmermann@suse.de>
> > Cc: David Airlie <airlied@linux.ie>
> > Cc: Daniel Vetter <daniel@ffwll.ch>
> > Cc: Sumit Semwal <sumit.semwal@linaro.org>
> > Cc: "Christian König" <christian.koenig@amd.com>
> > Cc: linux-media@vger.kernel.org
> > Cc: linaro-mm-sig@lists.linaro.org
> > ---
> >   Documentation/gpu/todo.rst | 19 +++++++++++++++++++
> >   1 file changed, 19 insertions(+)
> >
> > diff --git a/Documentation/gpu/todo.rst b/Documentation/gpu/todo.rst
> > index dea9082c0e5f..f872d3d33218 100644
> > --- a/Documentation/gpu/todo.rst
> > +++ b/Documentation/gpu/todo.rst
> > @@ -23,6 +23,9 @@ Advanced: Tricky tasks that need fairly good understanding of the DRM subsystem
> >   and graphics topics. Generally need the relevant hardware for development and
> >   testing.
> >
> > +Expert: Only attempt these if you've successfully completed some tricky
> > +refactorings already and are an expert in the specific area
> > +
> >   Subsystem-wide refactorings
> >   ===========================
> >
> > @@ -168,6 +171,22 @@ Contact: Daniel Vetter, respective driver maintainers
> >
> >   Level: Advanced
> >
> > +Move Buffer Object Locking to dma_resv_lock()
> > +---------------------------------------------
> > +
> > +Many drivers have their own per-object locking scheme, usually using
> > +mutex_lock(). This causes all kinds of trouble for buffer sharing, since
> > +depending which driver is the exporter and importer, the locking hierarchy is
> > +reversed.
> > +
> > +To solve this we need one standard per-object locking mechanism, which is
> > +dma_resv_lock(). This lock needs to be called as the outermost lock, with all
> > +other driver specific per-object locks removed. The problem is tha rolling out
> > +the actual change to the locking contract is a flag day, due to struct dma_buf
> > +buffer sharing.
> > +
> > +Level: Expert
> > +
>
> Could you name some examples of driver locks here? I'm not aware in
> anything like this in amdgpu, radeon or neveau.

ttm based drivers are all fine. It's everything else which is a
problem, and it gets worse if you mix helpers (like shmem helpers,
which have their own locks internally) with render drivers (again with
their own mutexes).

> And yes sounds like a job for the appropriate driver maintainer.

The problem is, this one you can't do driver-by-driver because of the
dma-buf contract. I mean we tried for p2p at first, it's just too
much. I tried to do it last summer just for shmem gem helpers, and you
really have to tackle all the drivers in one go (even if you ignore
dma-buf for now, where we side-stepped the problem with pinning). This
is "scares danvet" levels of nasty.
-Daniel

> Thanks,
> Christian.
>
> >   Convert logging to drm_* functions with drm_device paramater
> >   ------------------------------------------------------------
> >
>


-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] drm/todo: Add entry for moving to dma_resv_lock
  2021-01-22 13:36 [PATCH] drm/todo: Add entry for moving to dma_resv_lock Daniel Vetter
  2021-01-22 13:40 ` [Linaro-mm-sig] " Christian König
@ 2021-01-22 14:06 ` Thomas Zimmermann
  2021-02-03 13:11   ` Daniel Vetter
  1 sibling, 1 reply; 5+ messages in thread
From: Thomas Zimmermann @ 2021-01-22 14:06 UTC (permalink / raw)
  To: Daniel Vetter, DRI Development
  Cc: David Airlie, linaro-mm-sig, linux-media, Christian König,
	Daniel Vetter


[-- Attachment #1.1.1: Type: text/plain, Size: 2688 bytes --]

Hi

Am 22.01.21 um 14:36 schrieb Daniel Vetter:
> Requested by Thomas. I think it justifies a new level, since I tried
> to make some forward progress on this last summer, and gave up (for
> now). This is very tricky.

Adding it to the TODO list is a first step. :)

Acked-by: Thomas Zimmermann <tzimmermann@suse.de>

> 
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Cc: Maxime Ripard <mripard@kernel.org>
> Cc: Thomas Zimmermann <tzimmermann@suse.de>
> Cc: David Airlie <airlied@linux.ie>
> Cc: Daniel Vetter <daniel@ffwll.ch>
> Cc: Sumit Semwal <sumit.semwal@linaro.org>
> Cc: "Christian König" <christian.koenig@amd.com>
> Cc: linux-media@vger.kernel.org
> Cc: linaro-mm-sig@lists.linaro.org
> ---
>   Documentation/gpu/todo.rst | 19 +++++++++++++++++++
>   1 file changed, 19 insertions(+)
> 
> diff --git a/Documentation/gpu/todo.rst b/Documentation/gpu/todo.rst
> index dea9082c0e5f..f872d3d33218 100644
> --- a/Documentation/gpu/todo.rst
> +++ b/Documentation/gpu/todo.rst
> @@ -23,6 +23,9 @@ Advanced: Tricky tasks that need fairly good understanding of the DRM subsystem
>   and graphics topics. Generally need the relevant hardware for development and
>   testing.
>   
> +Expert: Only attempt these if you've successfully completed some tricky
> +refactorings already and are an expert in the specific area
> +
>   Subsystem-wide refactorings
>   ===========================
>   
> @@ -168,6 +171,22 @@ Contact: Daniel Vetter, respective driver maintainers
>   
>   Level: Advanced
>   
> +Move Buffer Object Locking to dma_resv_lock()
> +---------------------------------------------
> +
> +Many drivers have their own per-object locking scheme, usually using
> +mutex_lock(). This causes all kinds of trouble for buffer sharing, since
> +depending which driver is the exporter and importer, the locking hierarchy is
> +reversed.
> +
> +To solve this we need one standard per-object locking mechanism, which is
> +dma_resv_lock(). This lock needs to be called as the outermost lock, with all
> +other driver specific per-object locks removed. The problem is tha rolling out
> +the actual change to the locking contract is a flag day, due to struct dma_buf
> +buffer sharing.
> +
> +Level: Expert
> +
>   Convert logging to drm_* functions with drm_device paramater
>   ------------------------------------------------------------
>   
> 

-- 
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer


[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] drm/todo: Add entry for moving to dma_resv_lock
  2021-01-22 14:06 ` Thomas Zimmermann
@ 2021-02-03 13:11   ` Daniel Vetter
  0 siblings, 0 replies; 5+ messages in thread
From: Daniel Vetter @ 2021-02-03 13:11 UTC (permalink / raw)
  To: Thomas Zimmermann
  Cc: David Airlie, Daniel Vetter, DRI Development, linaro-mm-sig,
	Daniel Vetter, Christian König, linux-media

On Fri, Jan 22, 2021 at 03:06:44PM +0100, Thomas Zimmermann wrote:
> Hi
> 
> Am 22.01.21 um 14:36 schrieb Daniel Vetter:
> > Requested by Thomas. I think it justifies a new level, since I tried
> > to make some forward progress on this last summer, and gave up (for
> > now). This is very tricky.
> 
> Adding it to the TODO list is a first step. :)
> 
> Acked-by: Thomas Zimmermann <tzimmermann@suse.de>

Applied.
-Daniel

> 
> > 
> > Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> > Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> > Cc: Maxime Ripard <mripard@kernel.org>
> > Cc: Thomas Zimmermann <tzimmermann@suse.de>
> > Cc: David Airlie <airlied@linux.ie>
> > Cc: Daniel Vetter <daniel@ffwll.ch>
> > Cc: Sumit Semwal <sumit.semwal@linaro.org>
> > Cc: "Christian König" <christian.koenig@amd.com>
> > Cc: linux-media@vger.kernel.org
> > Cc: linaro-mm-sig@lists.linaro.org
> > ---
> >   Documentation/gpu/todo.rst | 19 +++++++++++++++++++
> >   1 file changed, 19 insertions(+)
> > 
> > diff --git a/Documentation/gpu/todo.rst b/Documentation/gpu/todo.rst
> > index dea9082c0e5f..f872d3d33218 100644
> > --- a/Documentation/gpu/todo.rst
> > +++ b/Documentation/gpu/todo.rst
> > @@ -23,6 +23,9 @@ Advanced: Tricky tasks that need fairly good understanding of the DRM subsystem
> >   and graphics topics. Generally need the relevant hardware for development and
> >   testing.
> > +Expert: Only attempt these if you've successfully completed some tricky
> > +refactorings already and are an expert in the specific area
> > +
> >   Subsystem-wide refactorings
> >   ===========================
> > @@ -168,6 +171,22 @@ Contact: Daniel Vetter, respective driver maintainers
> >   Level: Advanced
> > +Move Buffer Object Locking to dma_resv_lock()
> > +---------------------------------------------
> > +
> > +Many drivers have their own per-object locking scheme, usually using
> > +mutex_lock(). This causes all kinds of trouble for buffer sharing, since
> > +depending which driver is the exporter and importer, the locking hierarchy is
> > +reversed.
> > +
> > +To solve this we need one standard per-object locking mechanism, which is
> > +dma_resv_lock(). This lock needs to be called as the outermost lock, with all
> > +other driver specific per-object locks removed. The problem is tha rolling out
> > +the actual change to the locking contract is a flag day, due to struct dma_buf
> > +buffer sharing.
> > +
> > +Level: Expert
> > +
> >   Convert logging to drm_* functions with drm_device paramater
> >   ------------------------------------------------------------
> > 
> 
> -- 
> Thomas Zimmermann
> Graphics Driver Developer
> SUSE Software Solutions Germany GmbH
> Maxfeldstr. 5, 90409 Nürnberg, Germany
> (HRB 36809, AG Nürnberg)
> Geschäftsführer: Felix Imendörffer
> 




-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-02-03 13:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-22 13:36 [PATCH] drm/todo: Add entry for moving to dma_resv_lock Daniel Vetter
2021-01-22 13:40 ` [Linaro-mm-sig] " Christian König
2021-01-22 13:45   ` Daniel Vetter
2021-01-22 14:06 ` Thomas Zimmermann
2021-02-03 13:11   ` Daniel Vetter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).