From: Alex Hung <[email protected]>

[Why & How]
Correct the gamma 2.2 TF direction used in the supported-TF bitmask
tests. Degam and blnd use DRM_COLOROP_1D_CURVE_GAMMA22 (EOTF
direction); shaper uses DRM_COLOROP_1D_CURVE_GAMMA22_INV (inverse
EOTF direction).

This aligns the tests with commit b49814033cb5
("drm/amd/display: Fix gamma 2.2 colorop TFs").

Assisted-by: Copilot:Claude-Sonnet-4.6

Reviewed-by: Harry Wentland <[email protected]>
Signed-off-by: Alex Hung <[email protected]>
Signed-off-by: Ray Wu <[email protected]>
---
 .../amdgpu_dm/tests/amdgpu_dm_colorop_test.c  | 24 +++++++++----------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git 
a/drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_colorop_test.c 
b/drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_colorop_test.c
index 6c77a7159188..4245ebd3725b 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_colorop_test.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_colorop_test.c
@@ -30,10 +30,10 @@ static void 
dm_test_supported_degam_tfs_has_bt2020_inv_oetf(struct kunit *test)
                          BIT(DRM_COLOROP_1D_CURVE_BT2020_INV_OETF));
 }
 
-static void dm_test_supported_degam_tfs_has_gamma22_inv(struct kunit *test)
+static void dm_test_supported_degam_tfs_has_gamma22(struct kunit *test)
 {
        KUNIT_EXPECT_TRUE(test, amdgpu_dm_supported_degam_tfs &
-                         BIT(DRM_COLOROP_1D_CURVE_GAMMA22_INV));
+                         BIT(DRM_COLOROP_1D_CURVE_GAMMA22));
 }
 
 static void dm_test_supported_degam_tfs_no_extra_bits(struct kunit *test)
@@ -41,7 +41,7 @@ static void dm_test_supported_degam_tfs_no_extra_bits(struct 
kunit *test)
        u64 expected = BIT(DRM_COLOROP_1D_CURVE_SRGB_EOTF) |
                       BIT(DRM_COLOROP_1D_CURVE_PQ_125_EOTF) |
                       BIT(DRM_COLOROP_1D_CURVE_BT2020_INV_OETF) |
-                      BIT(DRM_COLOROP_1D_CURVE_GAMMA22_INV);
+                      BIT(DRM_COLOROP_1D_CURVE_GAMMA22);
 
        KUNIT_EXPECT_EQ(test, amdgpu_dm_supported_degam_tfs, expected);
 }
@@ -66,10 +66,10 @@ static void 
dm_test_supported_shaper_tfs_has_bt2020_oetf(struct kunit *test)
                          BIT(DRM_COLOROP_1D_CURVE_BT2020_OETF));
 }
 
-static void dm_test_supported_shaper_tfs_has_gamma22(struct kunit *test)
+static void dm_test_supported_shaper_tfs_has_gamma22_inv(struct kunit *test)
 {
        KUNIT_EXPECT_TRUE(test, amdgpu_dm_supported_shaper_tfs &
-                         BIT(DRM_COLOROP_1D_CURVE_GAMMA22));
+                         BIT(DRM_COLOROP_1D_CURVE_GAMMA22_INV));
 }
 
 static void dm_test_supported_shaper_tfs_no_extra_bits(struct kunit *test)
@@ -77,7 +77,7 @@ static void dm_test_supported_shaper_tfs_no_extra_bits(struct 
kunit *test)
        u64 expected = BIT(DRM_COLOROP_1D_CURVE_SRGB_INV_EOTF) |
                       BIT(DRM_COLOROP_1D_CURVE_PQ_125_INV_EOTF) |
                       BIT(DRM_COLOROP_1D_CURVE_BT2020_OETF) |
-                      BIT(DRM_COLOROP_1D_CURVE_GAMMA22);
+                      BIT(DRM_COLOROP_1D_CURVE_GAMMA22_INV);
 
        KUNIT_EXPECT_EQ(test, amdgpu_dm_supported_shaper_tfs, expected);
 }
@@ -102,10 +102,10 @@ static void 
dm_test_supported_blnd_tfs_has_bt2020_inv_oetf(struct kunit *test)
                          BIT(DRM_COLOROP_1D_CURVE_BT2020_INV_OETF));
 }
 
-static void dm_test_supported_blnd_tfs_has_gamma22_inv(struct kunit *test)
+static void dm_test_supported_blnd_tfs_has_gamma22(struct kunit *test)
 {
        KUNIT_EXPECT_TRUE(test, amdgpu_dm_supported_blnd_tfs &
-                         BIT(DRM_COLOROP_1D_CURVE_GAMMA22_INV));
+                         BIT(DRM_COLOROP_1D_CURVE_GAMMA22));
 }
 
 static void dm_test_supported_blnd_tfs_no_extra_bits(struct kunit *test)
@@ -113,7 +113,7 @@ static void dm_test_supported_blnd_tfs_no_extra_bits(struct 
kunit *test)
        u64 expected = BIT(DRM_COLOROP_1D_CURVE_SRGB_EOTF) |
                       BIT(DRM_COLOROP_1D_CURVE_PQ_125_EOTF) |
                       BIT(DRM_COLOROP_1D_CURVE_BT2020_INV_OETF) |
-                      BIT(DRM_COLOROP_1D_CURVE_GAMMA22_INV);
+                      BIT(DRM_COLOROP_1D_CURVE_GAMMA22);
 
        KUNIT_EXPECT_EQ(test, amdgpu_dm_supported_blnd_tfs, expected);
 }
@@ -130,19 +130,19 @@ static struct kunit_case dm_colorop_test_cases[] = {
        KUNIT_CASE(dm_test_supported_degam_tfs_has_srgb_eotf),
        KUNIT_CASE(dm_test_supported_degam_tfs_has_pq125_eotf),
        KUNIT_CASE(dm_test_supported_degam_tfs_has_bt2020_inv_oetf),
-       KUNIT_CASE(dm_test_supported_degam_tfs_has_gamma22_inv),
+       KUNIT_CASE(dm_test_supported_degam_tfs_has_gamma22),
        KUNIT_CASE(dm_test_supported_degam_tfs_no_extra_bits),
        /* shaper TFs */
        KUNIT_CASE(dm_test_supported_shaper_tfs_has_srgb_inv_eotf),
        KUNIT_CASE(dm_test_supported_shaper_tfs_has_pq125_inv_eotf),
        KUNIT_CASE(dm_test_supported_shaper_tfs_has_bt2020_oetf),
-       KUNIT_CASE(dm_test_supported_shaper_tfs_has_gamma22),
+       KUNIT_CASE(dm_test_supported_shaper_tfs_has_gamma22_inv),
        KUNIT_CASE(dm_test_supported_shaper_tfs_no_extra_bits),
        /* blnd TFs */
        KUNIT_CASE(dm_test_supported_blnd_tfs_has_srgb_eotf),
        KUNIT_CASE(dm_test_supported_blnd_tfs_has_pq125_eotf),
        KUNIT_CASE(dm_test_supported_blnd_tfs_has_bt2020_inv_oetf),
-       KUNIT_CASE(dm_test_supported_blnd_tfs_has_gamma22_inv),
+       KUNIT_CASE(dm_test_supported_blnd_tfs_has_gamma22),
        KUNIT_CASE(dm_test_supported_blnd_tfs_no_extra_bits),
        /* cross-check */
        KUNIT_CASE(dm_test_degam_and_blnd_tfs_match),
-- 
2.43.0

Reply via email to