Hi Sam,

Thank you for the patch.

On Sun, Jul 26, 2020 at 10:33:11PM +0200, Sam Ravnborg wrote:
> All panels shall report a connector type.
> panel-simple has a lot of panels with no connector_type,
> and for these fall back to DPI as the default.
> 
> v2:
>   - Rebased on top of validation of panel description
> 
> Signed-off-by: Sam Ravnborg <s...@ravnborg.org>
> Cc: Laurent Pinchart <laurent.pinch...@ideasonboard.com>
> Cc: Thierry Reding <thierry.red...@gmail.com>
> Cc: Sam Ravnborg <s...@ravnborg.org>

Reviewed-by: Laurent Pinchart <laurent.pinch...@ideasonboard.com>

> ---
>  drivers/gpu/drm/panel/panel-simple.c | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/panel/panel-simple.c 
> b/drivers/gpu/drm/panel/panel-simple.c
> index a8d68102931e..56ab073e4e6e 100644
> --- a/drivers/gpu/drm/panel/panel-simple.c
> +++ b/drivers/gpu/drm/panel/panel-simple.c
> @@ -500,6 +500,7 @@ static int panel_simple_probe(struct device *dev, const 
> struct panel_desc *desc)
>       struct panel_simple *panel;
>       struct display_timing dt;
>       struct device_node *ddc;
> +     int connector_type;
>       u32 bus_flags;
>       int err;
>  
> @@ -550,10 +551,12 @@ static int panel_simple_probe(struct device *dev, const 
> struct panel_desc *desc)
>                       panel_simple_parse_panel_timing_node(dev, panel, &dt);
>       }
>  
> +     connector_type = desc->connector_type;
>       /* Catch common mistakes for panels. */
> -     switch (desc->connector_type) {
> +     switch (connector_type) {
>       case 0:
>               dev_warn(dev, "Specify missing connector_type\n");
> +             connector_type = DRM_MODE_CONNECTOR_DPI;
>               break;
>       case DRM_MODE_CONNECTOR_LVDS:
>               WARN_ON(desc->bus_flags &
> @@ -600,11 +603,11 @@ static int panel_simple_probe(struct device *dev, const 
> struct panel_desc *desc)
>               break;
>       default:
>               dev_warn(dev, "Specify a valid connector_type: %d\n", 
> desc->connector_type);
> +             connector_type = DRM_MODE_CONNECTOR_DPI;
>               break;
>       }
>  
> -     drm_panel_init(&panel->base, dev, &panel_simple_funcs,
> -                    desc->connector_type);
> +     drm_panel_init(&panel->base, dev, &panel_simple_funcs, connector_type);
>  
>       err = drm_panel_of_backlight(&panel->base);
>       if (err)

-- 
Regards,

Laurent Pinchart
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Reply via email to