drm/nouveau: Drop mutex_lock_nested for atomic
Subsystems (3)
PATCH 1/1 drm/nouveau: Drop mutex_lock_nested for atomic
Purely conjecture, but I think the original locking inversion with the legacy page flip code between flipping and ttm's bo move function shoudn't exist anymore with atomic: With atomic the bo pinning and actual modeset commit is completely separated in the code patsh.
This annotation was originally added in
commit 060810d7abaabcab282e062c595871d661561400
Author: Ben Skeggs <[email protected]> Date: Mon Jul 8 14:15:51 2013 +1000
drm/nouveau: fix locking issues in page flipping paths
due to
commit b580c9e2b7ba5030a795aa2fb73b796523d65a78
Author: Maarten Lankhorst <[email protected]> Date: Thu Jun 27 13:48:18 2013 +0200
drm/nouveau: make flipping lockdep safe
---
I might be totally wrong, so this definitely needs testing :-)
Cheers, Daniel
--- drivers/gpu/drm/nouveau/nouveau_bo.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/nouveau/nouveau_bo.c +5 -1
@@ -776,7 +776,11 @@ nouveau_bo_move_m2mf(struct ttm_buffer_object *bo, int evict, bool intr,return ret; } -mutex_lock_nested (&cli->mutex,SINGLE_DEPTH_NESTING ); +if (drm_drv_uses_atomic_modeset (drm->dev)) +mutex_lock (&cli->mutex); +else +mutex_lock_nested (&cli->mutex,SINGLE_DEPTH_NESTING ); + ret =nouveau_fence_sync (nouveau_bo (bo), chan, true, intr);if (ret ==0 ) { ret = drm->ttm.move (chan, bo, &bo->mem, new_reg);
Signature · 1 line
2.27.0
Op 02-08-2020 om 20:18 schreef Daniel Vetter:
Quoted 41 lines
Purely conjecture, but I think the original locking inversion with the legacy page flip code between flipping and ttm's bo move function shoudn't exist anymore with atomic: With atomic the bo pinning and actual modeset commit is completely separated in the code patsh.
This annotation was originally added in
commit
060810d7abaabcab282e062c595871d661561400Author: Ben Skeggs <[email protected]> Date: Mon Jul 8 14:15:51 2013 +1000drm/nouveau: fix locking issues in page flipping paths
due to
commit
b580c9e2b7ba5030a795aa2fb73b796523d65a78Author: Maarten Lankhorst <[email protected]> Date: Thu Jun 27 13:48:18 2013 +0200drm/nouveau: make flipping lockdep safe
Signed-off-by Daniel Vetter <[email protected]>Cc Maarten Lankhorst <[email protected]>Cc Ben Skeggs <[email protected]>Cc Dave Airlie <[email protected]>---
I might be totally wrong, so this definitely needs testing :-)Cheers, Daniel
--- drivers/gpu/drm/nouveau/nouveau_bo.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)drivers/gpu/drm/nouveau/nouveau_bo.c +0
-0@@ -776,7 +776,11 @@ nouveau_bo_move_m2mf(struct ttm_buffer_object *bo, int evict, bool intr,return ret; }
drivers/gpu/drm/nouveau/nouveau_bo.c nouveau_bo_move_m2mf(struct ttm_buffer_object *bo, int evict, bool intr, · line 786
Quoted 10 lines
drivers/gpu/drm/nouveau/nouveau_bo.c +5
-1-mutex_lock_nested (&cli->mutex,SINGLE_DEPTH_NESTING ); +if (drm_drv_uses_atomic_modeset (drm->dev)) +mutex_lock (&cli->mutex); +else +mutex_lock_nested (&cli->mutex,SINGLE_DEPTH_NESTING ); + ret =nouveau_fence_sync (nouveau_bo (bo), chan, true, intr);if (ret ==0 ) { ret = drm->ttm.move (chan, bo, &bo->mem, new_reg);
Well if you're certain it works now. :)
Ben, did you have a chance to look at this?
-Daniel
Quoted 58 lines · Maarten Lankhorst
Op 02-08-2020 om 20:18 schreef Daniel Vetter:
Quoted 41 lines
Purely conjecture, but I think the original locking inversion with the legacy page flip code between flipping and ttm's bo move function shoudn't exist anymore with atomic: With atomic the bo pinning and actual modeset commit is completely separated in the code patsh.
This annotation was originally added in
commit
060810d7abaabcab282e062c595871d661561400Author: Ben Skeggs <[email protected]> Date: Mon Jul 8 14:15:51 2013 +1000drm/nouveau: fix locking issues in page flipping paths
due to
commit
b580c9e2b7ba5030a795aa2fb73b796523d65a78Author: Maarten Lankhorst <[email protected]> Date: Thu Jun 27 13:48:18 2013 +0200drm/nouveau: make flipping lockdep safe
Signed-off-by Daniel Vetter <[email protected]>Cc Maarten Lankhorst <[email protected]>Cc Ben Skeggs <[email protected]>Cc Dave Airlie <[email protected]>---
I might be totally wrong, so this definitely needs testing :-)Cheers, Daniel
--- drivers/gpu/drm/nouveau/nouveau_bo.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)drivers/gpu/drm/nouveau/nouveau_bo.c +0
-0@@ -776,7 +776,11 @@ nouveau_bo_move_m2mf(struct ttm_buffer_object *bo, int evict, bool intr,return ret; }drivers/gpu/drm/nouveau/nouveau_bo.c nouveau_bo_move_m2mf(struct ttm_buffer_object *bo, int evict, bool intr, · line 786
Quoted 10 lines
drivers/gpu/drm/nouveau/nouveau_bo.c +5
-1-mutex_lock_nested (&cli->mutex,SINGLE_DEPTH_NESTING ); +if (drm_drv_uses_atomic_modeset (drm->dev)) +mutex_lock (&cli->mutex); +else +mutex_lock_nested (&cli->mutex,SINGLE_DEPTH_NESTING ); + ret =nouveau_fence_sync (nouveau_bo (bo), chan, true, intr);if (ret ==0 ) { ret = drm->ttm.move (chan, bo, &bo->mem, new_reg);Well if you're certain it works now. :)
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch
Quoted 2 lines · Daniel Vetter
Ben, did you have a chance to look at this?
Ping
-Daniel
Quoted 66 lines
Quoted 56 lines · Maarten Lankhorst
Op 02-08-2020 om 20:18 schreef Daniel Vetter:
Quoted 41 lines
Purely conjecture, but I think the original locking inversion with the legacy page flip code between flipping and ttm's bo move function shoudn't exist anymore with atomic: With atomic the bo pinning and actual modeset commit is completely separated in the code patsh.
This annotation was originally added in
commit
060810d7abaabcab282e062c595871d661561400Author: Ben Skeggs <[email protected]> Date: Mon Jul 8 14:15:51 2013 +1000drm/nouveau: fix locking issues in page flipping paths
due to
commit
b580c9e2b7ba5030a795aa2fb73b796523d65a78Author: Maarten Lankhorst <[email protected]> Date: Thu Jun 27 13:48:18 2013 +0200drm/nouveau: make flipping lockdep safe
Signed-off-by Daniel Vetter <[email protected]>Cc Maarten Lankhorst <[email protected]>Cc Ben Skeggs <[email protected]>Cc Dave Airlie <[email protected]>---
I might be totally wrong, so this definitely needs testing :-)Cheers, Daniel
--- drivers/gpu/drm/nouveau/nouveau_bo.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)drivers/gpu/drm/nouveau/nouveau_bo.c +0
-0@@ -776,7 +776,11 @@ nouveau_bo_move_m2mf(struct ttm_buffer_object *bo, int evict, bool intr,return ret; }drivers/gpu/drm/nouveau/nouveau_bo.c nouveau_bo_move_m2mf(struct ttm_buffer_object *bo, int evict, bool intr, · line 786
Quoted 10 lines
drivers/gpu/drm/nouveau/nouveau_bo.c +5
-1-mutex_lock_nested (&cli->mutex,SINGLE_DEPTH_NESTING ); +if (drm_drv_uses_atomic_modeset (drm->dev)) +mutex_lock (&cli->mutex); +else +mutex_lock_nested (&cli->mutex,SINGLE_DEPTH_NESTING ); + ret =nouveau_fence_sync (nouveau_bo (bo), chan, true, intr);if (ret ==0 ) { ret = drm->ttm.move (chan, bo, &bo->mem, new_reg);Well if you're certain it works now. :)
Quoted 2 lines
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch
Ben Skeggs
Acked-byQuoted 67 lines · Daniel Vetter
Quoted 2 lines · Daniel Vetter
Ben, did you have a chance to look at this?
Ping
-DanielQuoted 59 lines
Quoted 57 lines · Maarten Lankhorst
Op 02-08-2020 om 20:18 schreef Daniel Vetter:
Quoted 41 lines
Purely conjecture, but I think the original locking inversion with the legacy page flip code between flipping and ttm's bo move function shoudn't exist anymore with atomic: With atomic the bo pinning and actual modeset commit is completely separated in the code patsh.
This annotation was originally added in
commit
060810d7abaabcab282e062c595871d661561400Author: Ben Skeggs <[email protected]> Date: Mon Jul 8 14:15:51 2013 +1000drm/nouveau: fix locking issues in page flipping paths
due to
commit
b580c9e2b7ba5030a795aa2fb73b796523d65a78Author: Maarten Lankhorst <[email protected]> Date: Thu Jun 27 13:48:18 2013 +0200drm/nouveau: make flipping lockdep safe
Signed-off-by Daniel Vetter <[email protected]>Cc Maarten Lankhorst <[email protected]>Cc Ben Skeggs <[email protected]>Cc Dave Airlie <[email protected]>---
I might be totally wrong, so this definitely needs testing :-)Cheers, Daniel
--- drivers/gpu/drm/nouveau/nouveau_bo.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)drivers/gpu/drm/nouveau/nouveau_bo.c +0
-0@@ -776,7 +776,11 @@ nouveau_bo_move_m2mf(struct ttm_buffer_object *bo, int evict, bool intr,return ret; }drivers/gpu/drm/nouveau/nouveau_bo.c nouveau_bo_move_m2mf(struct ttm_buffer_object *bo, int evict, bool intr, · line 786
Quoted 10 lines
drivers/gpu/drm/nouveau/nouveau_bo.c +5
-1-mutex_lock_nested (&cli->mutex,SINGLE_DEPTH_NESTING ); +if (drm_drv_uses_atomic_modeset (drm->dev)) +mutex_lock (&cli->mutex); +else +mutex_lock_nested (&cli->mutex,SINGLE_DEPTH_NESTING ); + ret =nouveau_fence_sync (nouveau_bo (bo), chan, true, intr);if (ret ==0 ) { ret = drm->ttm.move (chan, bo, &bo->mem, new_reg);Well if you're certain it works now. :)
Quoted 18 lines
Quoted 7 lines
Quoted 1 line
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Nouveau mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/nouveau
Quoted 67 lines · Ben Skeggs
Quoted 66 lines · Daniel Vetter
Quoted 2 lines · Daniel Vetter
Ben, did you have a chance to look at this?
Ping
-DanielQuoted 58 lines
Quoted 56 lines · Maarten Lankhorst
Op 02-08-2020 om 20:18 schreef Daniel Vetter:
Quoted 41 lines
Purely conjecture, but I think the original locking inversion with the legacy page flip code between flipping and ttm's bo move function shoudn't exist anymore with atomic: With atomic the bo pinning and actual modeset commit is completely separated in the code patsh.
This annotation was originally added in
commit
060810d7abaabcab282e062c595871d661561400Author: Ben Skeggs <[email protected]> Date: Mon Jul 8 14:15:51 2013 +1000drm/nouveau: fix locking issues in page flipping paths
due to
commit
b580c9e2b7ba5030a795aa2fb73b796523d65a78Author: Maarten Lankhorst <[email protected]> Date: Thu Jun 27 13:48:18 2013 +0200drm/nouveau: make flipping lockdep safe
Signed-off-by Daniel Vetter <[email protected]>Cc Maarten Lankhorst <[email protected]>Cc Ben Skeggs <[email protected]>Cc Dave Airlie <[email protected]>---
I might be totally wrong, so this definitely needs testing :-)Cheers, Daniel
--- drivers/gpu/drm/nouveau/nouveau_bo.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)drivers/gpu/drm/nouveau/nouveau_bo.c +0
-0@@ -776,7 +776,11 @@ nouveau_bo_move_m2mf(struct ttm_buffer_object *bo, int evict, bool intr,return ret; }drivers/gpu/drm/nouveau/nouveau_bo.c nouveau_bo_move_m2mf(struct ttm_buffer_object *bo, int evict, bool intr, · line 786
Quoted 10 lines
drivers/gpu/drm/nouveau/nouveau_bo.c +5
-1-mutex_lock_nested (&cli->mutex,SINGLE_DEPTH_NESTING ); +if (drm_drv_uses_atomic_modeset (drm->dev)) +mutex_lock (&cli->mutex); +else +mutex_lock_nested (&cli->mutex,SINGLE_DEPTH_NESTING ); + ret =nouveau_fence_sync (nouveau_bo (bo), chan, true, intr);if (ret ==0 ) { ret = drm->ttm.move (chan, bo, &bo->mem, new_reg);Well if you're certain it works now. :)
Quoted 2 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Acked-by Ben Skeggs <[email protected]>
Can you pull this in through your tree and maybe give it a spin just to make sure? I don't really have nouveau hardware here.
Also it's entirely stand-alone, I was simply reviewing all the mutex_lock_nested we have in drm, and this one stuck out as probably not necessary anymore, at least with atomic.
I guess I can also just stuff it into drm-misc-next and if it blows up, figure out what to do then :-)
-Daniel
Quoted 19 lines
Quoted 19 lines
Quoted 8 lines
Quoted 2 lines
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Nouveau mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/nouveau
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch
Quoted 69 lines · Daniel Vetter
Quoted 67 lines · Ben Skeggs
Quoted 66 lines · Daniel Vetter
Quoted 2 lines · Daniel Vetter
Ben, did you have a chance to look at this?
Ping
-DanielQuoted 58 lines
Quoted 56 lines · Maarten Lankhorst
Op 02-08-2020 om 20:18 schreef Daniel Vetter:
Quoted 41 lines
Purely conjecture, but I think the original locking inversion with the legacy page flip code between flipping and ttm's bo move function shoudn't exist anymore with atomic: With atomic the bo pinning and actual modeset commit is completely separated in the code patsh.
This annotation was originally added in
commit
060810d7abaabcab282e062c595871d661561400Author: Ben Skeggs <[email protected]> Date: Mon Jul 8 14:15:51 2013 +1000drm/nouveau: fix locking issues in page flipping paths
due to
commit
b580c9e2b7ba5030a795aa2fb73b796523d65a78Author: Maarten Lankhorst <[email protected]> Date: Thu Jun 27 13:48:18 2013 +0200drm/nouveau: make flipping lockdep safe
Signed-off-by Daniel Vetter <[email protected]>Cc Maarten Lankhorst <[email protected]>Cc Ben Skeggs <[email protected]>Cc Dave Airlie <[email protected]>---
I might be totally wrong, so this definitely needs testing :-)Cheers, Daniel
--- drivers/gpu/drm/nouveau/nouveau_bo.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)drivers/gpu/drm/nouveau/nouveau_bo.c +0
-0@@ -776,7 +776,11 @@ nouveau_bo_move_m2mf(struct ttm_buffer_object *bo, int evict, bool intr,return ret; }drivers/gpu/drm/nouveau/nouveau_bo.c nouveau_bo_move_m2mf(struct ttm_buffer_object *bo, int evict, bool intr, · line 786
Quoted 10 lines
drivers/gpu/drm/nouveau/nouveau_bo.c +5
-1-mutex_lock_nested (&cli->mutex,SINGLE_DEPTH_NESTING ); +if (drm_drv_uses_atomic_modeset (drm->dev)) +mutex_lock (&cli->mutex); +else +mutex_lock_nested (&cli->mutex,SINGLE_DEPTH_NESTING ); + ret =nouveau_fence_sync (nouveau_bo (bo), chan, true, intr);if (ret ==0 ) { ret = drm->ttm.move (chan, bo, &bo->mem, new_reg);Well if you're certain it works now. :)
Quoted 5 lines
Quoted 2 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Acked-by Ben Skeggs <[email protected]>Can you pull this in through your tree and maybe give it a spin just to make sure? I don't really have nouveau hardware here.
Yeah, I can do that easily enough.
Ben.
Quoted 33 lines
Also it's entirely stand-alone, I was simply reviewing all the
mutex_lock_nestedwe have in drm, and this one stuck out as probably not necessary anymore, at least with atomic.I guess I can also just stuff it into drm-misc-next and if it blows up, figure out what to do then :-)
-DanielQuoted 11 lines
Quoted 11 lines
Quoted 8 lines
Quoted 2 lines
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.chQuoted 8 lines
Quoted 8 lines
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Nouveau mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/nouveau--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
Quoted 70 lines · Ben Skeggs
Quoted 69 lines · Daniel Vetter
Quoted 67 lines · Ben Skeggs
Quoted 66 lines · Daniel Vetter
Quoted 2 lines · Daniel Vetter
Ben, did you have a chance to look at this?
Ping
-DanielQuoted 58 lines
Quoted 56 lines · Maarten Lankhorst
Op 02-08-2020 om 20:18 schreef Daniel Vetter:
Quoted 41 lines
Purely conjecture, but I think the original locking inversion with the legacy page flip code between flipping and ttm's bo move function shoudn't exist anymore with atomic: With atomic the bo pinning and actual modeset commit is completely separated in the code patsh.
This annotation was originally added in
commit
060810d7abaabcab282e062c595871d661561400Author: Ben Skeggs <[email protected]> Date: Mon Jul 8 14:15:51 2013 +1000drm/nouveau: fix locking issues in page flipping paths
due to
commit
b580c9e2b7ba5030a795aa2fb73b796523d65a78Author: Maarten Lankhorst <[email protected]> Date: Thu Jun 27 13:48:18 2013 +0200drm/nouveau: make flipping lockdep safe
Signed-off-by Daniel Vetter <[email protected]>Cc Maarten Lankhorst <[email protected]>Cc Ben Skeggs <[email protected]>Cc Dave Airlie <[email protected]>---
I might be totally wrong, so this definitely needs testing :-)Cheers, Daniel
--- drivers/gpu/drm/nouveau/nouveau_bo.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)drivers/gpu/drm/nouveau/nouveau_bo.c +0
-0@@ -776,7 +776,11 @@ nouveau_bo_move_m2mf(struct ttm_buffer_object *bo, int evict, bool intr,return ret; }drivers/gpu/drm/nouveau/nouveau_bo.c nouveau_bo_move_m2mf(struct ttm_buffer_object *bo, int evict, bool intr, · line 786
Quoted 10 lines
drivers/gpu/drm/nouveau/nouveau_bo.c +5
-1-mutex_lock_nested (&cli->mutex,SINGLE_DEPTH_NESTING ); +if (drm_drv_uses_atomic_modeset (drm->dev)) +mutex_lock (&cli->mutex); +else +mutex_lock_nested (&cli->mutex,SINGLE_DEPTH_NESTING ); + ret =nouveau_fence_sync (nouveau_bo (bo), chan, true, intr);if (ret ==0 ) { ret = drm->ttm.move (chan, bo, &bo->mem, new_reg);Well if you're certain it works now. :)
Quoted 6 lines
Quoted 5 lines
Quoted 2 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Acked-by Ben Skeggs <[email protected]>Can you pull this in through your tree and maybe give it a spin just to make sure? I don't really have nouveau hardware here.
Yeah, I can do that easily enough.
Hi Ben,
I'm still hanging on this one, doesn't seem to have made it into drm-next. Got lost or still somewhere in a queue?
Thanks, Daniel
Quoted 36 lines
Ben.
Quoted 33 lines
Also it's entirely stand-alone, I was simply reviewing all the
mutex_lock_nestedwe have in drm, and this one stuck out as probably not necessary anymore, at least with atomic.I guess I can also just stuff it into drm-misc-next and if it blows up, figure out what to do then :-)
-DanielQuoted 11 lines
Quoted 11 lines
Quoted 8 lines
Quoted 2 lines
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.chQuoted 8 lines
Quoted 8 lines
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Nouveau mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/nouveau--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch