public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Alex Hung <alex.hung@amd.com>
To: <igt-dev@lists.freedesktop.org>, <harry.wentland@amd.com>,
	<alex.hung@amd.com>
Subject: [PATCH] lib/tests: Fix gamma 2.2 naming
Date: Wed, 11 Mar 2026 15:25:02 -0600	[thread overview]
Message-ID: <20260311212502.2487982-1-alex.hung@amd.com> (raw)

Rename gamma 2.2 helpers to match their behavior, and
update kms_colorop test names and transform references accordingly.

Signed-off-by: Alex Hung <alex.hung@amd.com>
---
Note: this requires the kernel patch "drm/amd/display: Fix gamma 2.2 colorop TFs"

 lib/igt_color.c            |  8 ++++----
 lib/igt_color.h            |  4 ++--
 tests/kms_colorop.c        | 12 ++++++------
 tests/kms_colorop_helper.c |  8 ++++----
 4 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/lib/igt_color.c b/lib/igt_color.c
index 05ca2d9b4..8c405275a 100644
--- a/lib/igt_color.c
+++ b/lib/igt_color.c
@@ -184,14 +184,14 @@ void igt_color_pq_125_inv_eotf(igt_pixel_t *pixel)
 	igt_color_pq_inv_eotf(pixel);
 }

-void igt_color_gamma_2_2_oetf(igt_pixel_t *pixel)
+void igt_color_gamma_2_2(igt_pixel_t *pixel)
 {
-	igt_color_powf(pixel, 1/2.2f);
+	igt_color_powf(pixel, 2.2f);
 }

-void igt_color_gamma_2_2_inv_oetf(igt_pixel_t *pixel)
+void igt_color_gamma_2_2_inv(igt_pixel_t *pixel)
 {
-	igt_color_powf(pixel, 2.2f);
+	igt_color_powf(pixel, 1/2.2f);
 }

 static void igt_color_apply_3x4_ctm(igt_pixel_t *pixel, const igt_matrix_3x4_t *matrix)
diff --git a/lib/igt_color.h b/lib/igt_color.h
index 919330c8b..722446400 100644
--- a/lib/igt_color.h
+++ b/lib/igt_color.h
@@ -108,8 +108,8 @@ void igt_color_pq_125_eotf(igt_pixel_t *pixel);
 void igt_color_bt2020_inv_oetf(igt_pixel_t *pixel);
 void igt_color_bt2020_oetf(igt_pixel_t *pixel);

-void igt_color_gamma_2_2_oetf(igt_pixel_t *pixel);
-void igt_color_gamma_2_2_inv_oetf(igt_pixel_t *pixel);
+void igt_color_gamma_2_2(igt_pixel_t *pixel);
+void igt_color_gamma_2_2_inv(igt_pixel_t *pixel);

 void igt_color_ctm_3x4_50_desat(igt_pixel_t *pixel);
 void igt_color_ctm_3x4_overdrive(igt_pixel_t *pixel);
diff --git a/tests/kms_colorop.c b/tests/kms_colorop.c
index d535be4e5..f94cfb407 100644
--- a/tests/kms_colorop.c
+++ b/tests/kms_colorop.c
@@ -51,9 +51,9 @@
  * @pq_125_inv_eotf:			PQ Inverse EOTF for [0.0, 125.0] optical range
  * @pq_125_eotf-pq_125_inv_eotf:	PQ EOTF -> PQ Inverse EOTF with [0.0, 125.0] optical range
  * @pq_125_eotf-pq_125_inv_eotf-pq_125_eotf: PQ EOTF -> PQ Inverse EOTF -> PQ EOTF with [0.0, 125.0] optical range
- * @gamma_2_2_inv_oetf:			Gamma 2.2 Inverse OETF
- * @gamma_2_2_inv_oetf-gamma_2_2_oetf:	Gamma 2.2 Inverse OETF -> Gamma 2.2 OETF
- * @gamma_2_2_inv_oetf-gamma_2_2_oetf-gamma_2_2_inv_oetf: Gamma 2.2 Inverse OETF -> Gamma 2.2 OETF -> Gamma 2.2 Inverse OETF
+ * @gamma_2_2:				Gamma 2.2
+ * @gamma_2_2-gamma_2_2_inv:		Gamma 2.2 -> Gamma 2.2 Inverse
+ * @gamma_2_2-gamma_2_2_inv-gamma_2_2:	Gamma 2.2 -> Gamma 2.2 Inverse -> Gamma 2.2
  * @ctm_3x4_50_desat:			3x4 matrix doing a 50% desaturation
  * @ctm_3x4_overdrive:			3x4 matrix overdring all values by 50%
  * @ctm_3x4_oversaturate:		3x4 matrix oversaturating values
@@ -382,9 +382,9 @@ int igt_main_args("d", long_options, help_str, opt_handler, NULL)
 		{ { &kms_colorop_pq_125_inv_eotf, NULL }, "pq_125_inv_eotf" },
 		{ { &kms_colorop_pq_125_eotf, &kms_colorop_pq_125_inv_eotf, NULL }, "pq_125_eotf-pq_125_inv_eotf" },
 		{ { &kms_colorop_pq_125_eotf, &kms_colorop_pq_125_inv_eotf, &kms_colorop_pq_125_eotf_2, NULL }, "pq_125_eotf-pq_125_inv_eotf-pq_125_eotf" },
-		{ { &kms_colorop_gamma_22_inv_oetf, NULL }, "gamma_2_2_inv_oetf" },
-		{ { &kms_colorop_gamma_22_inv_oetf, &kms_colorop_gamma_22_oetf, NULL }, "gamma_2_2_inv_oetf-gamma_2_2_oetf" },
-		{ { &kms_colorop_gamma_22_inv_oetf, &kms_colorop_gamma_22_oetf, &kms_colorop_gamma_22_inv_oetf, NULL }, "gamma_2_2_inv_oetf-gamma_2_2_oetf-gamma_2_2_inv_oetf" },
+		{ { &kms_colorop_gamma_22_oetf, NULL }, "gamma_2_2" },
+		{ { &kms_colorop_gamma_22_oetf, &kms_colorop_gamma_22_inv_oetf, NULL }, "gamma_2_2-gamma_2_2_inv" },
+		{ { &kms_colorop_gamma_22_oetf, &kms_colorop_gamma_22_inv_oetf, &kms_colorop_gamma_22_oetf, NULL }, "gamma_2_2-gamma_2_2_inv-gamma_2_2" },
 		{ { &kms_colorop_ctm_3x4_50_desat, NULL }, "ctm_3x4_50_desat" },
 		{ { &kms_colorop_ctm_3x4_overdrive, NULL }, "ctm_3x4_overdrive" },
 		{ { &kms_colorop_ctm_3x4_oversaturate, NULL }, "ctm_3x4_oversaturate" },
diff --git a/tests/kms_colorop_helper.c b/tests/kms_colorop_helper.c
index c3a2b8f13..aaee4e567 100644
--- a/tests/kms_colorop_helper.c
+++ b/tests/kms_colorop_helper.c
@@ -127,8 +127,8 @@ kms_colorop_t kms_colorop_gamma_22_oetf = {
 	.enumerated_lut1d_info = {
 		.tf = KMS_COLOROP_LUT1D_GAMMA_2_2_OETF
 	},
-	.name = "gamma_2_2_oetf",
-	.transform = &igt_color_gamma_2_2_oetf
+	.name = "gamma_2_2",
+	.transform = &igt_color_gamma_2_2
 };

 kms_colorop_t kms_colorop_gamma_22_inv_oetf = {
@@ -136,8 +136,8 @@ kms_colorop_t kms_colorop_gamma_22_inv_oetf = {
 	.enumerated_lut1d_info = {
 		.tf = KMS_COLOROP_LUT1D_GAMMA_2_2_INV_OETF
 	},
-	.name = "gamma_2_2_inv_oetf",
-	.transform = &igt_color_gamma_2_2_inv_oetf
+	.name = "gamma_2_2_inv",
+	.transform = &igt_color_gamma_2_2_inv
 };

 kms_colorop_t kms_colorop_ctm_3x4_50_desat = {
--
2.43.0


             reply	other threads:[~2026-03-11 21:25 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-11 21:25 Alex Hung [this message]
2026-03-12  2:33 ` ✓ Xe.CI.BAT: success for lib/tests: Fix gamma 2.2 naming Patchwork
2026-03-12  2:41 ` ✗ i915.CI.BAT: failure " Patchwork
2026-03-12 22:14 ` ✓ Xe.CI.FULL: success " Patchwork
2026-03-12 22:57 ` ✓ Xe.CI.BAT: success for lib/tests: Fix gamma 2.2 naming (rev2) Patchwork
2026-03-12 23:15 ` ✓ i915.CI.BAT: " Patchwork
2026-03-13 19:03 ` [PATCH] lib/tests: Fix gamma 2.2 naming Harry Wentland
2026-03-14  1:20 ` ✓ i915.CI.Full: success for lib/tests: Fix gamma 2.2 naming (rev2) Patchwork
2026-03-14  2:42 ` ✓ 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=20260311212502.2487982-1-alex.hung@amd.com \
    --to=alex.hung@amd.com \
    --cc=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