From: Alex Hung Date: Thu, 21 May 2026 02:10:42 +0000 (-0600) Subject: drm/amd/display: Fix gamma 2.2 colorop TF direction in tests X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=533de2d4d5879704cfe83f3b7929e6528fbfa95b;p=thirdparty%2Fkernel%2Fstable.git drm/amd/display: Fix gamma 2.2 colorop TF direction in tests [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 d8f9f42effd7 ("drm/amd/display: Fix gamma 2.2 colorop TFs"). Assisted-by: Copilot:Claude-Sonnet-4.6 Reviewed-by: Harry Wentland Signed-off-by: Alex Hung Signed-off-by: Ray Wu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher --- 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),