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

Melissa Wen <[email protected]>
Newsgroups org.freedesktop.lists.igt-dev
Message-ID <[email protected]>
The userspace can update only currently 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.

Don't request colorop updates if there is no change in the atomic
commit. This fixes atomic commit rejections after test skips, caused by
incorrect attempts to change properties of inactive colorops.

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]>
---

v3:
- use uint32_t variable for igt_find_colorop (Alex H).
---
 lib/igt_kms.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index 42cc7c3bd..4b8f1c2a0 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) {
+					uint32_t 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.