Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Melissa Wen <mwen@igalia.com>
To: Petri Latvala <adrinael@adrinael.net>,
	Arkadiusz Hiler <arek@hiler.eu>,
	Kamil Konieczny <kamil.konieczny@linux.intel.com>,
	Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>,
	Bhanuprakash Modem <bhanuprakash.modem@gmail.com>,
	Ashutosh Dixit <ashutosh.dixit@intel.com>,
	Karthik B S <karthik.b.s@intel.com>
Cc: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>,
	Alex Hung <alex.hung@amd.com>,
	Swati Sharma <swati2.sharma@intel.com>,
	John Harrison <John.Harrison@Igalia.com>,
	Rodrigo Siqueira <siqueira@igalia.com>,
	Simon Ser <contact@emersion.fr>, Xaver Hugl <xaver.hugl@kde.org>,
	Harry Wentland <harry.wentland@amd.com>,
	Uma Shankar <uma.shankar@intel.com>,
	Jani Nikula <jani.nikula@intel.com>,
	igt-dev@lists.freedesktop.org, kernel-dev@igalia.com
Subject: [PATCH i-g-t v6 4/8] tests/kms_properties: give non-primary planes their own fb
Date: Wed, 21 Oct 2026 17:18:28 +0200	[thread overview]
Message-ID: <20261021151929.62529-5-mwen@igalia.com> (raw)
In-Reply-To: <20261021151929.62529-1-mwen@igalia.com>

The properties of a colorop should only be tested or modified if its
color pipeline is active (i.e., selected in the COLOR_PIPELINE property
of the plane); consequently, the plane itself must also be active.

To follow this policy, we need to enable a plane and activate the color
pipeline of a given color in order to test its properties. Currently,
only the primary plane is active. Enable non-primary planes before
testing their properties using a framebuffer other than the primary one;
this prevents the primary plane — and, consequently, the CRTC associated
with it — from being disabled on AMD display driver.

This is groundwork for the next commit, which checks colorop properties
on an active color pipeline.

Signed-off-by: Melissa Wen <mwen@igalia.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
---
 tests/kms_properties.c | 22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)

diff --git a/tests/kms_properties.c b/tests/kms_properties.c
index 2b4cb152b..07594f669 100644
--- a/tests/kms_properties.c
+++ b/tests/kms_properties.c
@@ -237,7 +237,7 @@ static void run_colorop_property_tests(igt_display_t *display,
 				       igt_crtc_t *crtc, igt_output_t *output,
 				       bool atomic)
 {
-	struct igt_fb fb;
+	struct igt_fb fb, afb;
 	igt_plane_t *plane;
 	igt_colorop_t *colorop;
 	int i;
@@ -255,6 +255,19 @@ static void run_colorop_property_tests(igt_display_t *display,
 			 igt_crtc_name(crtc), plane->index,
 			 kmstest_plane_type_name(plane->type), output->name);
 
+		/* A non-primary plane needs an fb of its own: AMD keeps the
+		 * CRTC active only while the primary plane is enabled.
+		 */
+		if (plane->type != DRM_PLANE_TYPE_PRIMARY) {
+			drmModeModeInfo *mode = igt_output_get_mode(output);
+
+			igt_create_pattern_fb(display->drm_fd, mode->hdisplay, mode->vdisplay,
+					      DRM_FORMAT_XRGB8888, DRM_FORMAT_MOD_LINEAR, &afb);
+
+			igt_plane_set_fb(plane, &afb);
+			igt_display_commit2(display, COMMIT_ATOMIC);
+		}
+
 		/* iterate over all color pipelines on plane */
 		for (i = 0; i < plane->num_color_pipelines; ++i) {
 			/* iterate over all colorops in pipeline*/
@@ -272,6 +285,13 @@ static void run_colorop_property_tests(igt_display_t *display,
 				colorop = igt_find_colorop(display, colorop_id);
 			}
 		}
+
+		/* only the fb created above needs to go away here */
+		if (plane->type != DRM_PLANE_TYPE_PRIMARY) {
+			igt_plane_set_fb(plane, NULL);
+			igt_display_commit2(display, COMMIT_ATOMIC);
+			igt_remove_fb(display->drm_fd, &afb);
+		}
 	}
 
 	cleanup_crtc(display, crtc, output,
-- 
2.53.0


  parent reply	other threads:[~2026-10-21 15:25 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-21 15:18 [PATCH i-g-t v6 0/8] test/kms_colorop_helper: don't request colorop updates indefinitely Melissa Wen
2026-10-21 15:18 ` [PATCH i-g-t v6 1/8] lib/igt_kms: clear colorop-changed flag after commit Melissa Wen
2026-10-21 15:18 ` [PATCH i-g-t v6 2/8] tests/kms_colorop_helper: only check if a given enum value exists Melissa Wen
2026-10-21 15:18 ` [PATCH i-g-t v6 3/8] tests/kms_properties: don't check colorop if no plane color pipeline prop Melissa Wen
2026-10-21 15:18 ` Melissa Wen [this message]
2026-10-21 15:18 ` [PATCH i-g-t v6 5/8] lib/igt_kms: extend igt_plane_set_color_pipeline to accept Bypass Melissa Wen
2026-10-21 15:18 ` [PATCH i-g-t v6 6/8] tests/kms_properties: check colorop properties on active color pipelines Melissa Wen
2026-10-21 15:18 ` [PATCH i-g-t v6 7/8] tests/intel/kms_color_pipeline: move driver-specific test to intel's folder Melissa Wen
2026-10-21 15:18 ` [PATCH i-g-t v6 8/8] lib/igt_kms: add macros to iterate color pipelines and colorops Melissa Wen
2026-10-21 22:26 ` ✓ Xe.CI.BAT: success for test/kms_colorop_helper: don't request colorop updates indefinitely (rev4) Patchwork
2026-10-22  0:00 ` ✓ i915.CI.BAT: " Patchwork
2026-10-22  3:26 ` ✓ Xe.CI.FULL: " Patchwork
2026-10-22  6:59 ` ✓ 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=20261021151929.62529-5-mwen@igalia.com \
    --to=mwen@igalia.com \
    --cc=John.Harrison@Igalia.com \
    --cc=adrinael@adrinael.net \
    --cc=alex.hung@amd.com \
    --cc=arek@hiler.eu \
    --cc=ashutosh.dixit@intel.com \
    --cc=bhanuprakash.modem@gmail.com \
    --cc=chaitanya.kumar.borah@intel.com \
    --cc=contact@emersion.fr \
    --cc=harry.wentland@amd.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=jani.nikula@intel.com \
    --cc=juhapekka.heikkila@gmail.com \
    --cc=kamil.konieczny@linux.intel.com \
    --cc=karthik.b.s@intel.com \
    --cc=kernel-dev@igalia.com \
    --cc=siqueira@igalia.com \
    --cc=swati2.sharma@intel.com \
    --cc=uma.shankar@intel.com \
    --cc=xaver.hugl@kde.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