drm/atomic: skip ww_acquire_done() for legacy paths
Subsystems (2)
PATCH 1/1 drm/atomic: skip ww_acquire_done() for legacy paths
The addition of ww_acquire_done() call to mark the point where all locks should already be held, added in:
commit 992cbf19b32900efa17850b9fa0031fd623edd4d
Author: Daniel Vetter <[email protected]>
AuthorDate: Thu Aug 6 15:06:40 2015 +0200
drm/atomic: Call ww_acquire_done after check phase is complete
missed the case that legacy paths (which are already called between drm_modeset_lock_all()/unlock_all()) re-use the single acquire ctx, even if there are multiple atomic updates. For example, restore_fbdev_mode() clearing rotation properties individually on each plane.
Inki already sent a patch which completely removed the ww_acquire_done() call, but I think this is less ideal (since it is a nice debugging feature of ww_mutex to confirm that everyone is following the rules). So instead, just skip the call only in the special legacy-path case.
--- drivers/gpu/drm/drm_atomic.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
drivers/gpu/drm/drm_atomic.c +9 -2
@@ -1230,8 +1230,15 @@ int drm_atomic_check_only(struct drm_atomic_state *state) } } -if (ret ==0 ) -ww_acquire_done (&state->acquire_ctx->ww_ctx); +if (ret ==0 ) { +/* in legacy paths, there can be multiple atomic updates, +* such as drm_mode_plane_set_obj_prop(), which happen +* under a single drm_modeset_lock_all(). In the legacy +* paths, skip marking acquire-done lest we anger ww-mutex: +*/ +if (state->acquire_ctx != dev->mode_config.acquire_ctx) +ww_acquire_done (&state->acquire_ctx->ww_ctx); + }return ret; }
Signature · 6 lines
2.4.3 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 14 lines · Rob Clark
The addition of
ww_acquire_done()call to mark the point where all locks should already be held, added in:commit
992cbf19b32900efa17850b9fa0031fd623edd4d
Author: Daniel Vetter <[email protected]>
AuthorDate: Thu Aug 6 15:06:40 2015 +0200drm/atomic: Call
ww_acquire_doneafter check phase is completemissed the case that legacy paths (which are already called between drm_modeset_lock_all()/unlock_all()) re-use the single acquire ctx, even if there are multiple atomic updates. For example,
restore_fbdev_mode()clearing rotation properties individually on each plane.
Quoted 8 lines
Inki already sent a patch which completely removed the
ww_acquire_done()call, but I think this is less ideal (since it is a nice debugging feature ofww_mutexto confirm that everyone is following the rules). So instead, just skip the call only in the special legacy-path case.Reported-by Inki Dae <[email protected]>Tested-by Bjorn Andersson <[email protected]>Signed-off-by Rob Clark <[email protected]>
Should we instead just do it in the atomic ioclt path? Your patch here is missing the legacy crtc-update case (where the acquire_ctx is stored in the drm_crtc). Also this won't work once we have a drm_modeset_lock_all_ctx.
-Daniel
Quoted 29 lines
--- drivers/gpu/drm/drm_atomic.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)drivers/gpu/drm/drm_atomic.c +9
-3@@ -1230,8 +1230,15 @@ int drm_atomic_check_only(struct drm_atomic_state *state) } } -if (ret ==0 ) -ww_acquire_done (&state->acquire_ctx->ww_ctx); +if (ret ==0 ) { +/* in legacy paths, there can be multiple atomic updates, +* such as drm_mode_plane_set_obj_prop(), which happen +* under a single drm_modeset_lock_all(). In the legacy +* paths, skip marking acquire-done lest we anger ww-mutex: +*/ +if (state->acquire_ctx != dev->mode_config.acquire_ctx) +ww_acquire_done (&state->acquire_ctx->ww_ctx); + }return ret; } --2.4.3
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 20 lines · Daniel Vetter
Quoted 19 lines · Rob Clark
The addition of
ww_acquire_done()call to mark the point where all locks should already be held, added in:commit
992cbf19b32900efa17850b9fa0031fd623edd4d
Author: Daniel Vetter <[email protected]>
AuthorDate: Thu Aug 6 15:06:40 2015 +0200drm/atomic: Call
ww_acquire_doneafter check phase is completemissed the case that legacy paths (which are already called between drm_modeset_lock_all()/unlock_all()) re-use the single acquire ctx, even if there are multiple atomic updates. For example,
restore_fbdev_mode()clearing rotation properties individually on each plane.Inki already sent a patch which completely removed the
ww_acquire_done()call, but I think this is less ideal (since it is a nice debugging feature ofww_mutexto confirm that everyone is following the rules). So instead, just skip the call only in the special legacy-path case.
Quoted 8 lines
Quoted 3 lines
Reported-by Inki Dae <[email protected]>Tested-by Bjorn Andersson <[email protected]>Signed-off-by Rob Clark <[email protected]>Should we instead just do it in the atomic ioclt path? Your patch here is missing the legacy crtc-update case (where the
acquire_ctxis stored in thedrm_crtc). Also this won't work once we have adrm_modeset_lock_all_ctx.
Well, doing it here (vs in ioctl fxn, outside of drm_atomic_commit()) is that it will catch cases where drivers try to acquire locks in ->commit()..
Maybe we just need to pass a legacy_dont_acquire_done flag down? Or just take Inki's patch for now until we sort out a better plan..
BR,
-R
Quoted 26 lines
-Daniel
Quoted 24 lines
--- drivers/gpu/drm/drm_atomic.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)drivers/gpu/drm/drm_atomic.c +9
-2@@ -1230,8 +1230,15 @@ int drm_atomic_check_only(struct drm_atomic_state *state) } } -if (ret ==0 ) -ww_acquire_done (&state->acquire_ctx->ww_ctx); +if (ret ==0 ) { +/* in legacy paths, there can be multiple atomic updates, +* such as drm_mode_plane_set_obj_prop(), which happen +* under a single drm_modeset_lock_all(). In the legacy +* paths, skip marking acquire-done lest we anger ww-mutex: +*/ +if (state->acquire_ctx != dev->mode_config.acquire_ctx) +ww_acquire_done (&state->acquire_ctx->ww_ctx); + }
Quoted 12 lines
Quoted 5 lines
drivers/gpu/drm/drm_atomic.c +0
-1return ret; } --2.4.3
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 30 lines · Rob Clark
Quoted 20 lines · Daniel Vetter
Quoted 19 lines · Rob Clark
The addition of
ww_acquire_done()call to mark the point where all locks should already be held, added in:commit
992cbf19b32900efa17850b9fa0031fd623edd4d
Author: Daniel Vetter <[email protected]>
AuthorDate: Thu Aug 6 15:06:40 2015 +0200drm/atomic: Call
ww_acquire_doneafter check phase is completemissed the case that legacy paths (which are already called between drm_modeset_lock_all()/unlock_all()) re-use the single acquire ctx, even if there are multiple atomic updates. For example,
restore_fbdev_mode()clearing rotation properties individually on each plane.Inki already sent a patch which completely removed the
ww_acquire_done()call, but I think this is less ideal (since it is a nice debugging feature ofww_mutexto confirm that everyone is following the rules). So instead, just skip the call only in the special legacy-path case.Quoted 8 lines
Quoted 3 lines
Reported-by Inki Dae <[email protected]>Tested-by Bjorn Andersson <[email protected]>Signed-off-by Rob Clark <[email protected]>Should we instead just do it in the atomic ioclt path? Your patch here is missing the legacy crtc-update case (where the
acquire_ctxis stored in thedrm_crtc). Also this won't work once we have adrm_modeset_lock_all_ctx.
Quoted 6 lines
Well, doing it here (vs in ioctl fxn, outside of
drm_atomic_commit()) is that it will catch cases where drivers try to acquire locks in ->commit()..Maybe we just need to pass a
legacy_dont_acquire_doneflag down? Or just take Inki's patch for now until we sort out a better plan..
actually, I don't think we'll hit it w/ legacy crtc-update paths..
but one possible approach is just stuff a no_acquire_fini flag in the state object..
BR,
-R
Quoted 41 lines
BR,
-RQuoted 38 lines
-Daniel
Quoted 27 lines
--- drivers/gpu/drm/drm_atomic.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)drivers/gpu/drm/drm_atomic.c +9
-3@@ -1230,8 +1230,15 @@ int drm_atomic_check_only(struct drm_atomic_state *state) } } -if (ret ==0 ) -ww_acquire_done (&state->acquire_ctx->ww_ctx); +if (ret ==0 ) { +/* in legacy paths, there can be multiple atomic updates, +* such as drm_mode_plane_set_obj_prop(), which happen +* under a single drm_modeset_lock_all(). In the legacy +* paths, skip marking acquire-done lest we anger ww-mutex: +*/ +if (state->acquire_ctx != dev->mode_config.acquire_ctx) +ww_acquire_done (&state->acquire_ctx->ww_ctx); + }return ret; } --Quoted 2 lines
2.4.3
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel