public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Harry Wentland <harry.wentland@amd.com>
To: <igt-dev@lists.freedesktop.org>
Cc: Harry Wentland <harry.wentland@amd.com>
Subject: [RFC PATCH v2 09/11] tests/kms_colorop: Keep CRTC active between YUV tests with temp FB
Date: Mon, 30 Mar 2026 11:35:16 -0400	[thread overview]
Message-ID: <20260330153518.99898-10-harry.wentland@amd.com> (raw)
In-Reply-To: <20260330153518.99898-1-harry.wentland@amd.com>

Move output_fb creation to fixture and introduce temp_fb to keep the
plane/CRTC active between YUV subtests. This prevents the "framebuffer
without CRTC" error that occurred when removing input_fb caused IGT to
disable the CRTC, leaving the writeback connector detached but with FB
still set.

Each YUV test now:
- Creates input_fb with specific encoding/range
- Runs test
- Switches plane to temp_fb (commits to hardware)
- Removes input_fb safely

Assisted-by: Claude:claude-opus-4-6
Signed-off-by: Harry Wentland <harry.wentland@amd.com>
---
 tests/kms_colorop.c | 21 +++++++++++++++++----
 1 file changed, 17 insertions(+), 4 deletions(-)

diff --git a/tests/kms_colorop.c b/tests/kms_colorop.c
index fbf254b694bb..34c3b5d1fe5b 100644
--- a/tests/kms_colorop.c
+++ b/tests/kms_colorop.c
@@ -591,7 +591,7 @@ int igt_main_args("d", long_options, help_str, opt_handler, NULL)
 	for (j = 0; j < ARRAY_SIZE(formats_yuv); j++) {
 		igt_output_t *output;
 		igt_plane_t *plane;
-		igt_fb_t output_fb;
+		igt_fb_t temp_fb, output_fb;
 		unsigned int fb_id;
 		drmModeModeInfo mode;
 
@@ -611,7 +611,14 @@ int igt_main_args("d", long_options, help_str, opt_handler, NULL)
 				igt_assert(plane);
 				igt_require(igt_plane_has_prop(plane, IGT_PLANE_COLOR_PIPELINE));
 
-				/* create output fb */
+				/* Create temp fb to keep plane active between tests */
+				fb_id = igt_create_fb(display.drm_fd, mode.hdisplay, mode.vdisplay,
+							formats_yuv[j].fourcc_in,
+							igt_fb_mod_to_tiling(0),
+							&temp_fb);
+				igt_require(fb_id > 0);
+
+				/* Create output fb shared across tests */
 				fb_id = igt_create_fb(display.drm_fd, mode.hdisplay, mode.vdisplay,
 							formats_yuv[j].fourcc_out,
 							igt_fb_mod_to_tiling(0),
@@ -619,7 +626,7 @@ int igt_main_args("d", long_options, help_str, opt_handler, NULL)
 				igt_require(fb_id > 0);
 			}
 
-			/* Run YUV tests - create input_fb per test with correct encoding/range */
+			/* Run YUV tests - create input_fb per test */
 			for (i = 0; i < ARRAY_SIZE(tests_yuv); i++) {
 				igt_describe("Check YUV CSC colorop");
 				igt_subtest_f("plane-%s-%s", formats_yuv[j].name, tests_yuv[i].name) {
@@ -654,14 +661,20 @@ int igt_main_args("d", long_options, help_str, opt_handler, NULL)
 							formats_yuv[j].fourcc_out,
 							tests_yuv[i].colorops);
 
+					/* Switch plane back to temp_fb to keep CRTC active */
+					igt_plane_set_fb(plane, &temp_fb);
+					igt_display_commit_atomic(&display,
+								DRM_MODE_ATOMIC_ALLOW_MODESET,
+								NULL);
+
 					igt_remove_fb(display.drm_fd, &input_fb);
 				}
 			}
 
 			igt_fixture() {
 				igt_detach_crtc(&display, output);
+				igt_remove_fb(display.drm_fd, &temp_fb);
 				igt_remove_fb(display.drm_fd, &output_fb);
-
 			}
 		}
 	}
-- 
2.53.0


  parent reply	other threads:[~2026-03-30 15:36 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-30 15:35 [RFC PATCH v2 00/11] YUV Conversion Colorop tests Harry Wentland
2026-03-30 15:35 ` [RFC PATCH v2 01/11] include/drm-uapi: Add DRM_COLOROP_CSC_FF and drm_colorop_csc_ff_type Harry Wentland
2026-03-30 15:35 ` [RFC PATCH v2 02/11] lib/igt_kms, tests/kms_colorop_helper: Add CSC FF colorop infrastructure Harry Wentland
2026-03-30 15:35 ` [RFC PATCH v2 03/11] tests/kms_colorop_helper: Add helpers to get encoding/range from CSC FF name Harry Wentland
2026-03-30 15:35 ` [RFC PATCH v2 04/11] lib/igt_fb: Add YUV color pattern framebuffer support Harry Wentland
2026-03-30 15:35 ` [RFC PATCH v2 05/11] lib/igt_color_encoding: Add XRGB2101010 format support Harry Wentland
2026-03-30 15:35 ` [RFC PATCH v2 06/11] lib/igt_color: Add YUV pixel reading support Harry Wentland
2026-03-30 15:35 ` [RFC PATCH v2 07/11] lib/igt_color: Refactor transform_pixels for input/output FBs and CSC Harry Wentland
2026-03-30 15:35 ` [RFC PATCH v2 08/11] tests/kms_colorop: Add CSC FF colorop tests Harry Wentland
2026-03-30 15:35 ` Harry Wentland [this message]
2026-03-30 15:35 ` [RFC PATCH v2 10/11] tests/kms_colorop: Add bypass transition tests Harry Wentland
2026-03-30 15:35 ` [RFC PATCH v2 11/11] tests/kms_colorop: Increase VKMS bracket to 3 up Harry Wentland
2026-03-31  3:38 ` ✓ Xe.CI.BAT: success for YUV Conversion Colorop tests Patchwork
2026-03-31  3:57 ` ✓ i915.CI.BAT: " Patchwork
2026-03-31 13:21 ` ✓ i915.CI.Full: " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260330153518.99898-10-harry.wentland@amd.com \
    --to=harry.wentland@amd.com \
    --cc=igt-dev@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox