summaryrefslogtreecommitdiff
path: root/include/drm/drm_crtc.h
diff options
context:
space:
mode:
authorRob Clark <robdclark@chromium.org>2020-10-21 01:26:00 +0300
committerRob Clark <robdclark@chromium.org>2020-11-01 21:13:09 +0300
commitcb21f3f882ad12811331c1067b9acfc4dd359d3f (patch)
treea71e1bfa236a2e8da1e132ad942637fa5de65b51 /include/drm/drm_crtc.h
parentb3d91800d9ac35014e0349292273a6fa7938d402 (diff)
downloadlinux-cb21f3f882ad12811331c1067b9acfc4dd359d3f.tar.xz
drm/msm/atomic: Drop per-CRTC locks in reverse order
lockdep dislikes seeing locks unwound in a non-nested fashion. Fixes: b3d91800d9ac ("drm/msm: Fix race condition in msm driver with async layer updates") Signed-off-by: Rob Clark <robdclark@chromium.org> Reviewed-by: Abhinav Kumar <abhinavk@codeaurora.org>
Diffstat (limited to 'include/drm/drm_crtc.h')
-rw-r--r--include/drm/drm_crtc.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
index 59b51a09cae6..cd42f79b2890 100644
--- a/include/drm/drm_crtc.h
+++ b/include/drm/drm_crtc.h
@@ -1266,4 +1266,14 @@ static inline struct drm_crtc *drm_crtc_find(struct drm_device *dev,
#define drm_for_each_crtc(crtc, dev) \
list_for_each_entry(crtc, &(dev)->mode_config.crtc_list, head)
+/**
+ * drm_for_each_crtc_reverse - iterate over all CRTCs in reverse order
+ * @crtc: a &struct drm_crtc as the loop cursor
+ * @dev: the &struct drm_device
+ *
+ * Iterate over all CRTCs of @dev.
+ */
+#define drm_for_each_crtc_reverse(crtc, dev) \
+ list_for_each_entry_reverse(crtc, &(dev)->mode_config.crtc_list, head)
+
#endif /* __DRM_CRTC_H__ */