drm/amd/display: fix gcc set but not used warning of variable 'old_plane_state'
[linux-2.6-microblaze.git] / include / drm / drm_atomic.h
index ac5a28e..8f1350e 100644 (file)
@@ -895,6 +895,18 @@ void drm_state_dump(struct drm_device *dev, struct drm_printer *p);
                              (old_plane_state) = (__state)->planes[__i].old_state,\
                              (new_plane_state) = (__state)->planes[__i].new_state, 1))
 
+/**
+ * for_each_new_plane_in_state_reverse - other than only tracking new state,
+ * it's the same as for_each_oldnew_plane_in_state_reverse
+ */
+#define for_each_new_plane_in_state_reverse(__state, plane, new_plane_state, __i) \
+       for ((__i) = ((__state)->dev->mode_config.num_total_plane - 1); \
+            (__i) >= 0;                                                \
+            (__i)--)                                                   \
+               for_each_if ((__state)->planes[__i].ptr &&              \
+                            ((plane) = (__state)->planes[__i].ptr,     \
+                             (new_plane_state) = (__state)->planes[__i].new_state, 1))
+
 /**
  * for_each_old_plane_in_state - iterate over all planes in an atomic update
  * @__state: &struct drm_atomic_state pointer