summaryrefslogtreecommitdiff
path: root/tests/kms_atomic.c
diff options
context:
space:
mode:
authorRodrigo Siqueira <Rodrigo.Siqueira@amd.com>2021-08-18 09:38:52 -0400
committerRodrigo Siqueira <Rodrigo.Siqueira@amd.com>2021-08-31 09:55:22 -0400
commitc6375c387d512cf90f54a2fc38232728026950dd (patch)
treefa55e7f06e316fcfebdc2f14ae4fa5bebef0bd24 /tests/kms_atomic.c
parentfea0e38e690c30c668d3d6757193850fae1eb73e (diff)
tests/kms_atomic: Initialize array values before checking them
Currently, the subtest plane-immutable-zpos fails due to a lack of initialization of a set of arrays allocated in the stack. Later on in the test, there is a check if some of the array components are NULL which is always false because of the random values in the memory. This commit fixes this issue by initializing all arrays with zero at the beginning of the plane_immutable_zpos function, and now it passes for amdgpu. Cc: Harry Wentland <harry.wentland@amd.com> Cc: Nicholas Choi <Nicholas.Choi@amd.com> Cc: Sean Paul <seanpaul@chromium.org> Cc: Mark Yacoub <markyacoub@chromium.org> Cc: Melissa Wen <melissa.srw@gmail.com> Cc: Arkadiusz Hiler <arek@hiler.eu> Cc: Petri Latvala <petri.latvala@intel.com> Signed-off-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com> Reviewed-By: Nicholas Choi <Nicholas.Choi@amd.com>
Diffstat (limited to 'tests/kms_atomic.c')
-rw-r--r--tests/kms_atomic.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/kms_atomic.c b/tests/kms_atomic.c
index 81e20099..1e1bee4d 100644
--- a/tests/kms_atomic.c
+++ b/tests/kms_atomic.c
@@ -374,6 +374,8 @@ plane_immutable_zpos(igt_display_t *display, igt_pipe_t *pipe,
struct igt_fb fb_lower, fb_upper;
uint32_t w_lower, h_lower, w_upper, h_upper;
+ memset(plane_ptr, 0, n_planes * sizeof(igt_plane_t *));
+
igt_require(n_planes >= 2);
mode = igt_output_get_mode(output);