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: igt-dev@lists.freedesktop.org, kernel-dev@igalia.com,
	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>
Subject: [PATCH i-g-t v5 2/8] tests/kms_colorop_helper: only check if a given enum value exists
Date: Wed,  2 Sep 2026 19:58:02 +0200	[thread overview]
Message-ID: <20260902180016.303482-3-mwen@igalia.com> (raw)
In-Reply-To: <20260902180016.303482-1-mwen@igalia.com>

Don't trigger unnecessary colorop property changes just to probe that a
prop enum exists and can be applied. Make can_use_colorop() read-only,
preventing atomic commit rejections after test skips.

Assisted-by: Claude:claude-opus-4-7
Tested-by: Alex Hung <alex.hung@amd.com>
Reviewed-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
Signed-off-by: Melissa Wen <mwen@igalia.com>
---

v2:
- remove extra space (Chaitanya)
---
 lib/igt_kms.c              | 26 ++++++++++++++++++++++++++
 lib/igt_kms.h              |  4 ++++
 tests/kms_colorop_helper.c |  4 +++-
 3 files changed, 33 insertions(+), 1 deletion(-)

diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index cd0a42840..6039ad18a 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -4507,6 +4507,32 @@ igt_colorop_replace_prop_blob(igt_colorop_t *colorop, enum igt_atomic_colorop_pr
 	igt_colorop_set_prop_changed(colorop, prop);
 }
 
+/**
+ * igt_colorop_has_prop_enum_value:
+ * @colorop: Target colorop.
+ * @prop: Enum property to check.
+ * @val: Enum value (as string) to look up.
+ *
+ * Read-only counterpart to igt_colorop_try_prop_enum(): returns whether
+ * @colorop's @prop accepts the enum value @val, without setting it or
+ * marking @prop as changed in IGT's cache.
+ *
+ * Returns: true if @val is a valid value of the enum @prop on @colorop.
+ */
+bool igt_colorop_has_prop_enum_value(igt_colorop_t *colorop,
+				     enum igt_atomic_colorop_properties prop,
+				     const char *val)
+{
+	igt_display_t *display = colorop->plane->crtc->display;
+	uint64_t uval;
+
+	igt_assert(colorop->props[prop]);
+
+	return igt_mode_object_get_prop_enum_value(display->drm_fd,
+						   colorop->props[prop],
+						   val, &uval);
+}
+
 /**
  * igt_colorop_try_prop_enum:
  * @colorop: Target colorop.
diff --git a/lib/igt_kms.h b/lib/igt_kms.h
index 695f666ba..23615dd91 100644
--- a/lib/igt_kms.h
+++ b/lib/igt_kms.h
@@ -1028,6 +1028,10 @@ uint64_t igt_colorop_get_prop(igt_display_t *display, igt_colorop_t *colorop, en
 	} while (0)
 
 
+extern bool igt_colorop_has_prop_enum_value(igt_colorop_t *colorop,
+					    enum igt_atomic_colorop_properties prop,
+					    const char *val);
+
 extern bool igt_colorop_try_prop_enum(igt_colorop_t *colorop,
 				      enum igt_atomic_colorop_properties prop,
 				      const char *val);
diff --git a/tests/kms_colorop_helper.c b/tests/kms_colorop_helper.c
index 3243d01d3..da234410e 100644
--- a/tests/kms_colorop_helper.c
+++ b/tests/kms_colorop_helper.c
@@ -248,7 +248,9 @@ static bool can_use_colorop(igt_display_t *display, igt_colorop_t *colorop, kms_
 	switch (desired->type) {
 	case KMS_COLOROP_ENUMERATED_LUT1D:
 		if (igt_colorop_get_prop(display, colorop, IGT_COLOROP_TYPE) == DRM_COLOROP_1D_CURVE &&
-		    igt_colorop_try_prop_enum(colorop, IGT_COLOROP_CURVE_1D_TYPE, kms_colorop_lut1d_tf_names[desired->enumerated_lut1d_info.tf]))
+		    igt_colorop_has_prop_enum_value(colorop,
+						    IGT_COLOROP_CURVE_1D_TYPE,
+						    kms_colorop_lut1d_tf_names[desired->enumerated_lut1d_info.tf]))
 			return true;
 		return false;
 	case KMS_COLOROP_CTM_3X4:
-- 
2.53.0


  parent reply	other threads:[~2026-09-02 18:03 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-02 17:58 [PATCH i-g-t v5 0/8] test/kms_colorop_helper: don't request colorop updates indefinitely Melissa Wen
2026-09-02 17:58 ` [PATCH i-g-t v5 1/8] lib/igt_kms: clear colorop-changed flag after commit Melissa Wen
2026-09-02 17:58 ` Melissa Wen [this message]
2026-09-02 17:58 ` [PATCH i-g-t v5 3/8] tests/kms_properties: don't check colorop if no plane color pipeline prop Melissa Wen
2026-09-02 17:58 ` [PATCH i-g-t v5 4/8] tests/kms_properties: give non-primary planes their own fb Melissa Wen
2026-09-30 16:06   ` Harry Wentland
2026-09-30 19:37     ` Melissa Wen
2026-09-30 21:02       ` Harry Wentland
2026-09-02 17:58 ` [PATCH i-g-t v5 5/8] lib/igt_kms: extend igt_plane_set_color_pipeline to accept Bypass Melissa Wen
2026-09-09  7:54   ` Borah, Chaitanya Kumar
2026-09-30 15:43   ` Harry Wentland
2026-09-02 17:58 ` [PATCH i-g-t v5 6/8] tests/kms_properties: check colorop properties on active color pipelines Melissa Wen
2026-09-09  7:55   ` Borah, Chaitanya Kumar
2026-09-30 15:44   ` Harry Wentland
2026-09-02 17:58 ` [PATCH i-g-t v5 7/8] tests/intel/kms_color_pipeline: move driver-specific test to intel's folder Melissa Wen
2026-09-08 19:17   ` Sharma, Swati2
2026-09-09  7:56   ` Borah, Chaitanya Kumar
2026-09-30 15:45   ` Harry Wentland
2026-09-02 17:58 ` [PATCH i-g-t v5 8/8] lib/igt_kms: add macros to iterate color pipelines and colorops Melissa Wen
2026-09-03 10:44   ` Jani Nikula
2026-09-09  8:31     ` Jani Nikula
2026-09-09  7:56   ` Borah, Chaitanya Kumar
2026-09-02 23:19 ` ✓ Xe.CI.BAT: success for test/kms_colorop_helper: don't request colorop updates indefinitely (rev3) Patchwork
2026-09-02 23:22 ` ✗ i915.CI.BAT: failure " Patchwork
2026-09-03 15:30 ` ✗ Xe.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=20260902180016.303482-3-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=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