drm/bridge: panel: Infer connector type from panel by default
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Wed, 4 Sep 2019 13:28:04 +0000 (16:28 +0300)
committerSam Ravnborg <sam@ravnborg.org>
Sun, 8 Sep 2019 17:04:23 +0000 (19:04 +0200)
commit89958b7cd9555a5d82556cc9a1f4c62fffda6f96
tree84087677853e7fd3d43ffdba931bfb299d1fb173
parent9a2654c0f62a1704f36acb6329f9ccbd539f75ad
drm/bridge: panel: Infer connector type from panel by default

The drm panel bridge creates a connector using a connector type
explicitly passed by the display controller or bridge driver that
instantiates the panel bridge. Now that drm_panel reports its connector
type, we can use it to avoid passing an explicit (and often incorrect)
connector type to drm_panel_bridge_add() and
devm_drm_panel_bridge_add().

Several drivers report incorrect or unknown connector types to
userspace. Reporting a different type may result in a breakage. For that
reason, rename (devm_)drm_panel_bridge_add() to
(devm_)drm_panel_bridge_add_typed(), and add new
(devm_)drm_panel_bridge_add() functions that use the panel connector
type. Update all callers of (devm_)drm_panel_bridge_add() to the _typed
function, they will be converted one by one after testing.

The panel drivers have been updated with the following Coccinelle
semantic patch, with manual inspection and fixes to indentation.

@@
expression bridge;
expression dev;
expression panel;
identifier type;
@@
(
-bridge = drm_panel_bridge_add(panel, type);
+bridge = drm_panel_bridge_add_typed(panel, type);
|
-bridge = devm_drm_panel_bridge_add(dev, panel, type);
+bridge = devm_drm_panel_bridge_add_typed(dev, panel, type);
)

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20190904132804.29680-3-laurent.pinchart@ideasonboard.com
16 files changed:
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_output.c
drivers/gpu/drm/bridge/cdns-dsi.c
drivers/gpu/drm/bridge/lvds-encoder.c
drivers/gpu/drm/bridge/panel.c
drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c
drivers/gpu/drm/ingenic/ingenic-drm.c
drivers/gpu/drm/mcde/mcde_dsi.c
drivers/gpu/drm/pl111/pl111_drv.c
drivers/gpu/drm/rcar-du/rcar_du_encoder.c
drivers/gpu/drm/rockchip/rockchip_rgb.c
drivers/gpu/drm/stm/ltdc.c
drivers/gpu/drm/tilcdc/tilcdc_external.c
drivers/gpu/drm/tve200/tve200_drv.c
drivers/gpu/drm/vc4/vc4_dpi.c
drivers/gpu/drm/vc4/vc4_dsi.c
include/drm/drm_bridge.h