[PATCH v2 4/5] drm/panel: panel-simple: Add function to look panel data up

Javier Martinez Canillas javierm at redhat.com
Fri Jun 27 09:12:43 UTC 2025


Maxime Ripard <mripard at kernel.org> writes:

> Commit de04bb0089a9 ("drm/panel/panel-simple: Use the new allocation in
> place of devm_kzalloc()") moved the call to drm_panel_init into the
> devm_drm_panel_alloc(), which needs a connector type to initialize
> properly.
>
> In the panel-dpi compatible case, the passed panel_desc structure is an
> empty one used as a discriminant, and the connector type it contains
> isn't actually initialized.
>
> It is initialized through a call to panel_dpi_probe() later in the
> function, which used to be before the call to drm_panel_init() that got
> merged into devm_drm_panel_alloc().
>
> So, we do need a proper panel_desc pointer before the call to
> devm_drm_panel_alloc() now. All cases associate their panel_desc with
> the panel compatible and use of_device_get_match_data, except for the
> panel-dpi compatible.
>
> In that case, we're expected to call panel_dpi_probe, which will
> allocate and initialize the panel_desc for us.
>
> Let's create such a helper function that would be called first in the
> driver and will lookup the desc by compatible, or allocate one if
> relevant.
>
> Reported-by: Francesco Dolcini <francesco at dolcini.it>
> Closes: https://lore.kernel.org/all/20250612081834.GA248237@francesco-nb/
> Fixes: de04bb0089a9 ("drm/panel/panel-simple: Use the new allocation in place of devm_kzalloc()")
> Signed-off-by: Maxime Ripard <mripard at kernel.org>
> ---

Reviewed-by: Javier Martinez Canillas <javierm at redhat.com>

-- 
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat



More information about the dri-devel mailing list