[PATCH 32/33] drm/amd/display: Ensure that planes are in the same order
Qingqing Zhuo
qingqing.zhuo at amd.com
Fri Mar 3 15:40:21 UTC 2023
From: Rodrigo Siqueira <Rodrigo.Siqueira at amd.com>
The function dc_update_planes_and_stream handles multiple cases where DC
needs to remove and add planes in the commit tail phase. After Linux
started to use this function, some of the IGT kms_plane started to fail;
one good example to illustrate why the new sequence regressed IGT is the
subtest plane-position-hole which has the following diagram as a
template:
+--------------------+ +-----------------------+
| +-----+ | | +-----+ |
| | | | | | +-----+ |
| | +--+ | ==> | | | | | |
| |__| | | +-|---+ | |
| | | +-----+ |
| | | |
+--------------------+ +-----------------------+
(a) Final image (b) Composed image
IGT expects image (a) as the final result of two plane compositions as
described in figure (b). After the migration to the new sequence, the
last plane order is changed, and DC generates the following image:
+---------------------+
| +-----+ |
| | | |
| | | |
| +-----+ |
| |
+---------------------+
Notice that the generated image by DC is different because the small
square that should be composed on top of the primary plane is below the
primary plane. For this reason, the CRC will mismatch with the expected
value. Since the function dc_add_all_planes_for_stream re-append all the
new planes back to the dc_validation_set, this commit ensures that the
original sequence is maintained. After this change, all CI tests in all
ASICs start to pass again.
Reviewed-by: Harry Wentland <Harry.Wentland at amd.com>
Acked-by: Qingqing Zhuo <qingqing.zhuo at amd.com>
Suggested-by: Melissa Wen <mwen at igalia.com>
Signed-off-by: Rodrigo Siqueira <Rodrigo.Siqueira at amd.com>
---
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index 63d9d7ffb103..b472931cb7ca 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -348,6 +348,19 @@ static inline bool is_dc_timing_adjust_needed(struct dm_crtc_state *old_state,
return false;
}
+static inline void reverse_planes_order(struct dc_surface_update *array_of_surface_update,
+ int planes_count)
+{
+ int i, j;
+ struct dc_surface_update surface_updates_temp;
+
+ for (i = 0, j = planes_count - 1; i < j; i++, j--) {
+ surface_updates_temp = array_of_surface_update[i];
+ array_of_surface_update[i] = array_of_surface_update[j];
+ array_of_surface_update[j] = surface_updates_temp;
+ }
+}
+
/**
* update_planes_and_stream_adapter() - Send planes to be updated in DC
*
@@ -364,6 +377,8 @@ static inline bool update_planes_and_stream_adapter(struct dc *dc,
struct dc_stream_update *stream_update,
struct dc_surface_update *array_of_surface_update)
{
+ reverse_planes_order(array_of_surface_update, planes_count);
+
/*
* Previous frame finished and HW is ready for optimization.
*/
--
2.34.1
More information about the amd-gfx
mailing list