mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-21 04:53:46 -04:00
drm/atomic: integrate modeset lock with private objects
Follow the same pattern of locking as with other state objects. This avoids boilerplate in the driver. Signed-off-by: Rob Clark <robdclark@gmail.com> Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/20181022123122.30468-1-boris.brezillon@bootlin.com
This commit is contained in:
committed by
Boris Brezillon
parent
cb8ce71111
commit
b962a12050
@@ -22,6 +22,7 @@
|
||||
*/
|
||||
|
||||
#include <drm/drmP.h>
|
||||
#include <drm/drm_atomic.h>
|
||||
#include <drm/drm_crtc.h>
|
||||
#include <drm/drm_modeset_lock.h>
|
||||
|
||||
@@ -394,6 +395,7 @@ EXPORT_SYMBOL(drm_modeset_unlock);
|
||||
int drm_modeset_lock_all_ctx(struct drm_device *dev,
|
||||
struct drm_modeset_acquire_ctx *ctx)
|
||||
{
|
||||
struct drm_private_obj *privobj;
|
||||
struct drm_crtc *crtc;
|
||||
struct drm_plane *plane;
|
||||
int ret;
|
||||
@@ -414,6 +416,12 @@ int drm_modeset_lock_all_ctx(struct drm_device *dev,
|
||||
return ret;
|
||||
}
|
||||
|
||||
drm_for_each_privobj(privobj, dev) {
|
||||
ret = drm_modeset_lock(&privobj->lock, ctx);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(drm_modeset_lock_all_ctx);
|
||||
|
||||
Reference in New Issue
Block a user