[PATCH i-g-t v3 1/6] lib/igt_kms: clear colorop-changed flag after commit

Melissa Wen <[email protected]>
Newsgroups org.freedesktop.lists.igt-dev
Message-ID <[email protected]>
Don't request colorop updates if there is no change in the atomic
commit. It fixes atomic rejection after test skips that was caused by
incorrect attempts of changing inactive colorop properties, since
userspace can update only current active colorops or colorops that will
be activated or deactivated in the same commit. Active colorop means a
colorop that is in the chain of an active color pipeline, i.e.  the
pipeline in plane COLOR_PIPELINE property.

Assisted-by: Claude:claude-opus-4-7
Tested-by: Alex Hung <[email protected]>
Reviewed-by: Chaitanya Kumar Borah <[email protected]>
Signed-off-by: Melissa Wen <[email protected]>
---
 lib/igt_kms.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index 42cc7c3bd..1e3cea781 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -4862,6 +4862,7 @@ display_commit_changed(igt_display_t *display, enum igt_commit_style s)
 {
 	int i;
 	igt_crtc_t *crtc;
+	igt_colorop_t *colorop;
 
 	for_each_crtc(display, crtc) {
 		igt_plane_t *plane;
@@ -4891,6 +4892,20 @@ display_commit_changed(igt_display_t *display, enum igt_commit_style s)
 				int fd;
 				plane->changed = 0;
 
+				/* clear changed flags on every colorop in the assigned chain
+				 * so already-committed property values aren't re-emitted on
+				 * the next commit.
+				 */
+				colorop = plane->assigned_color_pipeline;
+				while (colorop) {
+					int next_val;
+
+					colorop->changed = 0;
+					next_val = igt_colorop_get_prop(display, colorop,
+									IGT_COLOROP_NEXT);
+					colorop = igt_find_colorop(display, next_val);
+				}
+
 				fd = plane->values[IGT_PLANE_IN_FENCE_FD];
 				if (fd != -1)
 					close(fd);
-- 
2.53.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.