drm: review locking for drm_fb_helper_restore_fbdev_mode
... it's required. Fix up exynos and the cma helper, and add a corresponding WARN_ON to drm_fb_helper_restore_fbdev_mode. Note that tegra calls the fbdev cma helper restore function also from it's driver-load callback. Which is a bit against current practice, since usually the call is only from ->lastclose, and initial setup is done by drm_fb_helper_initial_config. Also add the relevant drm DocBook entry. v2: Add promised WARN to restore_fbdev_mode. Reviewed-by: Rob Clark <robdclark@gmail.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This commit is contained in:
@@ -68,9 +68,23 @@ void drm_modeset_unlock_all(struct drm_device *dev)
|
||||
|
||||
mutex_unlock(&dev->mode_config.mutex);
|
||||
}
|
||||
|
||||
EXPORT_SYMBOL(drm_modeset_unlock_all);
|
||||
|
||||
/**
|
||||
* drm_warn_on_modeset_not_all_locked - check that all modeset locks are locked
|
||||
* @dev: device
|
||||
*/
|
||||
void drm_warn_on_modeset_not_all_locked(struct drm_device *dev)
|
||||
{
|
||||
struct drm_crtc *crtc;
|
||||
|
||||
list_for_each_entry(crtc, &dev->mode_config.crtc_list, head)
|
||||
WARN_ON(!mutex_is_locked(&crtc->mutex));
|
||||
|
||||
WARN_ON(!mutex_is_locked(&dev->mode_config.mutex));
|
||||
}
|
||||
EXPORT_SYMBOL(drm_warn_on_modeset_not_all_locked);
|
||||
|
||||
/* Avoid boilerplate. I'm tired of typing. */
|
||||
#define DRM_ENUM_NAME_FN(fnname, list) \
|
||||
char *fnname(int val) \
|
||||
|
Reference in New Issue
Block a user