From 76dfcf7ed090a6cdeda86aa566fa7b653925d01d Mon Sep 17 00:00:00 2001
From: Yannick Fertre <yannick.fertre@st.com>
Date: Fri, 24 Apr 2020 15:31:23 +0200
Subject: [PATCH 1/2] tests/modetest: set property in atomic mode

In atomic mode, the additional properties must be done after
call of functions atomic_set_mode & atomic_set_planes.

Signed-off-by: Yannick Fertre <yannick.fertre@st.com>
---
 tests/modetest/modetest.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/tests/modetest/modetest.c b/tests/modetest/modetest.c
index 018338c..26cd9d6 100644
--- a/tests/modetest/modetest.c
+++ b/tests/modetest/modetest.c
@@ -2108,8 +2108,10 @@ int main(int argc, char **argv)
 	dump_resource(&dev, planes);
 	dump_resource(&dev, framebuffers);
 
-	for (i = 0; i < prop_count; ++i)
-		set_property(&dev, &prop_args[i]);
+	if (!dev.use_atomic) {
+		for (i = 0; i < prop_count; ++i)
+			set_property(&dev, &prop_args[i]);
+	}
 
 	if (dev.use_atomic) {
 		dev.req = drmModeAtomicAlloc();
@@ -2126,6 +2128,9 @@ int main(int argc, char **argv)
 			atomic_set_mode(&dev, pipe_args, count);
 			atomic_set_planes(&dev, plane_args, plane_count, false);
 
+			for (i = 0; i < prop_count; ++i)
+				set_property(&dev, &prop_args[i]);
+
 			ret = drmModeAtomicCommit(dev.fd, dev.req, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
 			if (ret) {
 				fprintf(stderr, "Atomic Commit failed [1]\n");
-- 
2.7.4

