Re: [PATCH v3 10/15] drm/tests: hdmi: Replace open coded EDID setup

From: Cristian Ciocaltea
Date: Thu Apr 10 2025 - 06:33:28 EST


On 4/9/25 6:15 PM, Maxime Ripard wrote:
> On Wed, Mar 26, 2025 at 12:19:59PM +0200, Cristian Ciocaltea wrote:
>> Make use of the recently introduced macros to reduce boilerplate code
>> around EDID setup. This also helps dropping the redundant calls to
>> set_connector_edid().
>>
>> No functional changes intended.
>>
>> Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@xxxxxxxxxxxxx>
>> ---
>> drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c | 220 ++++++++-------------
>> 1 file changed, 78 insertions(+), 142 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c b/drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c
>> index 284bd9b1418a454d05c4a38263519eb8ae450090..7b2aaee5009ce58e6edf2649e2182c43ba834523 100644
>> --- a/drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c
>> +++ b/drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c
>> @@ -751,19 +751,15 @@ static void drm_test_check_output_bpc_crtc_mode_changed(struct kunit *test)
>> struct drm_crtc *crtc;
>> int ret;
>>
>> - priv = drm_kunit_helper_connector_hdmi_init(test,
>> - BIT(HDMI_COLORSPACE_RGB),
>> - 10);
>> + priv = drm_kunit_helper_connector_hdmi_init_with_edid(test,
>> + BIT(HDMI_COLORSPACE_RGB),
>> + 10,
>> + test_edid_hdmi_1080p_rgb_yuv_dc_max_200mhz);
>> KUNIT_ASSERT_NOT_NULL(test, priv);
>>
>> drm = &priv->drm;
>> crtc = priv->crtc;
>> conn = &priv->connector;
>> - ret = set_connector_edid(test, conn,
>> - test_edid_hdmi_1080p_rgb_yuv_dc_max_200mhz,
>> - ARRAY_SIZE(test_edid_hdmi_1080p_rgb_yuv_dc_max_200mhz));
>> - KUNIT_ASSERT_GT(test, ret, 0);
>> -
>
> Yeah, ok, nvm what I said on the previous patch, it's needed.
>
>> preferred = find_preferred_mode(conn);
>> KUNIT_ASSERT_NOT_NULL(test, preferred);
>>
>> @@ -830,19 +826,15 @@ static void drm_test_check_output_bpc_crtc_mode_not_changed(struct kunit *test)
>> struct drm_crtc *crtc;
>> int ret;
>>
>> - priv = drm_kunit_helper_connector_hdmi_init(test,
>> - BIT(HDMI_COLORSPACE_RGB),
>> - 10);
>> + priv = drm_kunit_helper_connector_hdmi_init_with_edid(test,
>> + BIT(HDMI_COLORSPACE_RGB),
>> + 10,
>> + test_edid_hdmi_1080p_rgb_yuv_dc_max_200mhz);
>
> Alignment is off.

Yeah, that's a compromise to get rid of a bunch of checkpatch complaints:

WARNING: line length of ... exceeds 100 columns

So we ended up with the following instead:

CHECK: Alignment should match open parenthesis

But at least it's not a warning anymore.

Alternatively, we could maybe come up with a (very) short name for
drm_kunit_helper_connector_hdmi_init_with_edid(), though I'm not what
would that be :-(