From 0565f79f80e21f58cb21c9a1439f3324aaa8d665 Mon Sep 17 00:00:00 2001 From: Alex Hung Date: Tue, 11 Aug 2026 14:05:21 -0600 Subject: [PATCH] drm/amd/display: Test dm_helpers_submit_i2c_over_aux [WHAT] Add a KUnit test for dm_helpers_submit_i2c_over_aux(), which is still an unimplemented stub, to pin down that it reports failure. Assisted-by: Copilot:Claude-Opus-5 Reviewed-by: Bhawanpreet Lakha Signed-off-by: Alex Hung Signed-off-by: Ivan Lipski Tested-by: Dan Wheeler Signed-off-by: Alex Deucher --- .../amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 1 + .../amdgpu_dm/tests/amdgpu_dm_helpers_test.c | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c index b05455498cbf..29f254cafae4 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c @@ -1927,3 +1927,4 @@ bool dm_helpers_submit_i2c_over_aux(struct ddc_service *ddc, uint32_t address, u //TODO: Implement this return false; } +EXPORT_IF_KUNIT(dm_helpers_submit_i2c_over_aux); diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_helpers_test.c b/drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_helpers_test.c index 6b4f6993ace9..0314ebb5c8ae 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_helpers_test.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_helpers_test.c @@ -3892,6 +3892,20 @@ static void dm_test_dp_handle_test_pattern_no_pipe(struct kunit *test) test_params)); } +/* Tests for dm_helpers_submit_i2c_over_aux() */ + +/** + * dm_test_submit_i2c_over_aux_unimplemented - Test the unimplemented stub returns false + * @test: The KUnit test context + */ +static void dm_test_submit_i2c_over_aux_unimplemented(struct kunit *test) +{ + u8 buffer[1] = { 0 }; + + KUNIT_EXPECT_FALSE(test, dm_helpers_submit_i2c_over_aux(NULL, 0x50, 0, buffer, + sizeof(buffer), true)); +} + static struct kunit_case amdgpu_dm_helpers_test_cases[] = { /* edid_extract_panel_id */ KUNIT_CASE(dm_test_edid_extract_panel_id_basic), @@ -4080,6 +4094,8 @@ static struct kunit_case amdgpu_dm_helpers_test_cases[] = { KUNIT_CASE(dm_test_dp_write_dsc_enable_pcon_disable), /* dm_helpers_dp_handle_test_pattern_request */ KUNIT_CASE(dm_test_dp_handle_test_pattern_no_pipe), + /* dm_helpers_submit_i2c_over_aux */ + KUNIT_CASE(dm_test_submit_i2c_over_aux_unimplemented), {} };