On Wed, Mar 26, 2025 at 12:19:57PM +0200, Cristian Ciocaltea wrote:
> Introduce a few macros to facilitate setting custom (i.e. non-default)
> EDID data during connector initialization.
> 
> The actual conversion to use the new helpers is handled separately.
> 
> Signed-off-by: Cristian Ciocaltea <cristian.ciocal...@collabora.com>
> ---
>  drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c | 43 
> +++++++++++-----------
>  1 file changed, 21 insertions(+), 22 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 
> 7ffd666753b10bc991894e238206a3c5328d0e23..bcbd146fb655f4402529e59af09c99dbae7be0bf
>  100644
> --- a/drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c
> +++ b/drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c
> @@ -140,10 +140,12 @@ static const struct drm_connector_funcs 
> dummy_connector_funcs = {
>  
>  static
>  struct drm_atomic_helper_connector_hdmi_priv *
> -drm_kunit_helper_connector_hdmi_init_funcs(struct kunit *test,
> -                                        unsigned int formats,
> -                                        unsigned int max_bpc,
> -                                        const struct 
> drm_connector_hdmi_funcs *hdmi_funcs)
> +connector_hdmi_init_with_edid_funcs(struct kunit *test,
> +                                 unsigned int formats,
> +                                 unsigned int max_bpc,
> +                                 const struct drm_connector_hdmi_funcs 
> *hdmi_funcs,
> +                                 const char *edid_data,
> +                                 size_t edid_len)
>  {
>       struct drm_atomic_helper_connector_hdmi_priv *priv;
>       struct drm_connector *conn;
> @@ -197,30 +199,27 @@ drm_kunit_helper_connector_hdmi_init_funcs(struct kunit 
> *test,
>  
>       drm_mode_config_reset(drm);
>  
> +     if (edid_data && edid_len) {
> +             ret = set_connector_edid(test, &priv->connector, edid_data, 
> edid_len);
> +             KUNIT_ASSERT_GT(test, ret, 0);
> +     }
> +
>       return priv;
>  }
>  
> -static
> -struct drm_atomic_helper_connector_hdmi_priv *
> -drm_kunit_helper_connector_hdmi_init(struct kunit *test,
> -                                  unsigned int formats,
> -                                  unsigned int max_bpc)
> -{
> -     struct drm_atomic_helper_connector_hdmi_priv *priv;
> -     int ret;
> +#define drm_kunit_helper_connector_hdmi_init_funcs(test, formats, max_bpc, 
> funcs)            \
> +     connector_hdmi_init_with_edid_funcs(test, formats, max_bpc, funcs, 
> NULL, 0)

Again, we don't need that one. All current users would actually use
drm_kunit_helper_connector_hdmi_init_with_edid_funcs().

Maxime

Attachment: signature.asc
Description: PGP signature

Reply via email to