aboutsummaryrefslogtreecommitdiffstats
path: root/include/drm/drm_atomic.h
diff options
context:
space:
mode:
authorYu Kuai <yukuai3@huawei.com>2021-05-29 17:28:16 +0800
committerAlex Deucher <alexander.deucher@amd.com>2021-06-01 22:55:39 -0400
commita6c3c37b661dae8f34cb7ed90aa3f88372cb1c75 (patch)
tree7c26adaf97bcf72ca89da4c7582ebfa5086fb269 /include/drm/drm_atomic.h
parentdrm/amd/display: Avoid HDCP over-read and corruption (diff)
downloadlinux-dev-a6c3c37b661dae8f34cb7ed90aa3f88372cb1c75.tar.xz
linux-dev-a6c3c37b661dae8f34cb7ed90aa3f88372cb1c75.zip
drm/amd/display: fix gcc set but not used warning of variable 'old_plane_state'
define a new macro for_each_new_plane_in_state_reverse to replace for_each_oldnew_plane_in_state_reverse, so that the unused variable 'old_plane_state' can be removed. Fix gcc warning: drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:10066:26: warning: variable ‘old_plane_state’ set but not used [-Wunused-but-set-variable] Signed-off-by: Yu Kuai <yukuai3@huawei.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'include/drm/drm_atomic.h')
-rw-r--r--include/drm/drm_atomic.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/drm/drm_atomic.h b/include/drm/drm_atomic.h
index ac5a28eff2c8..8f1350e599eb 100644
--- a/include/drm/drm_atomic.h
+++ b/include/drm/drm_atomic.h
@@ -896,6 +896,18 @@ void drm_state_dump(struct drm_device *dev, struct drm_printer *p);
(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
* @plane: &struct drm_plane iteration cursor