Warnings with drm: Replace drm_modeset_lock/unlock_all with DRM_MODESET_LOCK_ALL_* helpers

Daniel Vetter daniel at ffwll.ch
Fri Aug 14 09:15:42 UTC 2020


On Thu, Aug 13, 2020 at 11:17:11PM -0400, Alex Deucher wrote:
> The non-atomic modesetting code in amdgpu now spews warnings[1] with
> this patch applied.  I haven't really paged the legacy locking stuff
> into my head in quite a while.  Thoughts on how to proceed?

Uh that mess.

So the problem (and it's really the same for atomic as for legacy) is that
we have shared state between connector probe and modeset code. Generally
that's solved by just copying stuff (like drm_connector->display_info) and
hoping we don't race badly.

All the probe state is protected by dev->mode_config.mutex, while all the
modeset stuff is protected by the various drm_modeset_lock.

I think the simplest duct-tape is to reapply the old locking scheme to the
new macro, but only for non-atomic drivers. I'll type up something. But
I'll go on vacations for 2 weeks, so if it doesn't work out you have to
respin (and also merge).

Cheers, Daniel
> 
> Thanks,
> 
> Alex
> 
> commit 9bcaa3fe58ab7559e71df798bcff6e0795158695
> Author: Michal Orzel <michalorzel.eng at gmail.com>
> Date:   Tue Apr 28 19:10:04 2020 +0200
> 
>     drm: Replace drm_modeset_lock/unlock_all with DRM_MODESET_LOCK_ALL_* helpers
> 
>     As suggested by the TODO list for the kernel DRM subsystem, replace
>     the deprecated functions that take/drop modeset locks with new helpers.
> 
>     Signed-off-by: Michal Orzel <michalorzel.eng at gmail.com>
>     Signed-off-by: Daniel Vetter <daniel.vetter at ffwll.ch>
>     Link: https://patchwork.freedesktop.org/patch/msgid/1588093804-30446-1-git-send-email-michalorzel.eng@gmail.com
> 
> 
> [1] https://gitlab.freedesktop.org/drm/amd/-/issues/1224
> _______________________________________________
> dri-devel mailing list
> dri-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch


More information about the dri-devel mailing list