summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Hung <alex.hung@amd.com>2026-07-14 15:22:36 -0600
committerAlex Deucher <alexander.deucher@amd.com>2026-07-28 19:17:30 -0400
commitb99214c2d830adeb9720d3f46d781bad0c56c093 (patch)
tree55e5b34001a847e90f1a6ed8632dce12ea2da47b
parent298eb60f14d4be776c9e3c6759c834f5e327dca5 (diff)
downloadlinux-b99214c2d830adeb9720d3f46d781bad0c56c093.tar.gz
linux-b99214c2d830adeb9720d3f46d781bad0c56c093.zip
drm/amd/display: Add legacy plane LUT tests
[WHY] The legacy plane color path did not exercise successful shaper, 3D LUT, and blend LUT programming as a single transaction. [HOW] Provide valid legacy LUT blobs and verify that all three plane color-management stages are enabled. Assisted-by: Copilot:GPT-5.6-Sol Reviewed-by: Bhawanpreet Lakha <bhawanpreet.lakha@amd.com> Signed-off-by: Alex Hung <alex.hung@amd.com> Signed-off-by: Fangzhi Zuo <jerry.zuo@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_color_test.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_color_test.c b/drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_color_test.c
index 0835177c98d2..025e408a8ae6 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_color_test.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_color_test.c
@@ -2356,6 +2356,33 @@ static void dm_test_update_plane_color_mgmt_uses_color_caps(struct kunit *test)
}
/**
+ * dm_test_update_plane_color_mgmt_legacy_luts - Legacy shaper and blend LUTs succeed
+ * @test: KUnit test context
+ */
+static void dm_test_update_plane_color_mgmt_legacy_luts(struct kunit *test)
+{
+ const u32 lut3d_entries =
+ MAX_COLOR_3DLUT_SIZE * MAX_COLOR_3DLUT_SIZE * MAX_COLOR_3DLUT_SIZE;
+ struct dm_test_color_update_fixture f = dm_test_color_update_setup(test);
+ struct drm_plane_state *plane_state = &f.dm_plane_state->base;
+ int ret;
+
+ f.adev->dm.dc->caps.color.dpp.hw_3d_lut = true;
+ f.dm_plane_state->shaper_lut =
+ dm_test_make_lut_blob(test, MAX_COLOR_LUT_ENTRIES);
+ f.dm_plane_state->lut3d = dm_test_make_lut_blob(test, lut3d_entries);
+ f.dm_plane_state->blend_lut =
+ dm_test_make_lut_blob(test, MAX_COLOR_LUT_ENTRIES);
+
+ ret = amdgpu_dm_update_plane_color_mgmt(f.crtc_state, plane_state,
+ f.dc_plane_state);
+ KUNIT_EXPECT_EQ(test, ret, 0);
+ KUNIT_EXPECT_TRUE(test, f.dc_plane_state->cm.flags.bits.shaper_enable);
+ KUNIT_EXPECT_TRUE(test, f.dc_plane_state->cm.flags.bits.lut3d_enable);
+ KUNIT_EXPECT_TRUE(test, f.dc_plane_state->cm.flags.bits.blend_enable);
+}
+
+/**
* dm_test_update_plane_color_mgmt_plane_ctm - Plane CTM maps to gamut remap
* @test: KUnit test context
*
@@ -2734,6 +2761,7 @@ static struct kunit_case dm_color_test_cases[] = {
KUNIT_CASE(dm_test_update_plane_color_mgmt_plane_degamma_lut),
KUNIT_CASE(dm_test_update_plane_color_mgmt_rejects_dual_degamma),
KUNIT_CASE(dm_test_update_plane_color_mgmt_uses_color_caps),
+ KUNIT_CASE(dm_test_update_plane_color_mgmt_legacy_luts),
KUNIT_CASE(dm_test_update_plane_color_mgmt_plane_ctm),
KUNIT_CASE(dm_test_update_plane_color_mgmt_colorop_bypass_pipeline),
KUNIT_CASE(dm_test_update_plane_color_mgmt_colorop_missing_multiplier),