summaryrefslogtreecommitdiff
path: root/include/drm
diff options
context:
space:
mode:
authorRob Clark <robdclark@chromium.org>2020-10-20 15:26:00 -0700
committerRob Clark <robdclark@chromium.org>2020-11-01 10:13:09 -0800
commitcb21f3f882ad12811331c1067b9acfc4dd359d3f (patch)
treea71e1bfa236a2e8da1e132ad942637fa5de65b51 /include/drm
parentb3d91800d9ac35014e0349292273a6fa7938d402 (diff)
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')
-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__ */