summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/drm_modeset_lock.c
diff options
context:
space:
mode:
authorRob Clark <robdclark@gmail.com>2018-10-22 14:31:22 +0200
committerBoris Brezillon <boris.brezillon@bootlin.com>2018-12-11 15:24:30 +0100
commitb962a12050a387e4bbf3a48745afe1d29d396b0d (patch)
tree175314ed87264ed37587a7eba43735394f50993e /drivers/gpu/drm/drm_modeset_lock.c
parentcb8ce7111117e16a87f3f55c014ccd1f19f81016 (diff)
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
Diffstat (limited to 'drivers/gpu/drm/drm_modeset_lock.c')
-rw-r--r--drivers/gpu/drm/drm_modeset_lock.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_modeset_lock.c b/drivers/gpu/drm/drm_modeset_lock.c
index 51f534db9107..81dd11901ffd 100644
--- a/drivers/gpu/drm/drm_modeset_lock.c
+++ b/drivers/gpu/drm/drm_modeset_lock.c
@@ -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);