Commit 34263c1b authored by Marek Szyprowski's avatar Marek Szyprowski Committed by Robert Foss

drm: bridge: panel: Register connector if DRM device is already registered

If panel_bridge_attach() happens after DRM device registration, the
created connector will not be registered by the DRM core anymore. Fix
this by registering it explicitly in such case.

This fixes the following issue observed on Samsung Exynos4210-based Trats
board with a DSI panel (the panel driver is registered after the Exynos DRM
component device is bound):

$ ./modetest -c -Mexynos
could not get connector 56: No such file or directory
Segmentation fault

While touching this, move the connector reset() call also under the DRM
device registered check, because otherwise it is not really needed.

Fixes: 934aef88 ("drm: bridge: panel: Reset the connector state pointer")
Signed-off-by: default avatarMarek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: default avatarJagan Teki <jagan@amarulasolutions.com>
Signed-off-by: default avatarRobert Foss <robert.foss@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20220419091422.4255-1-m.szyprowski@samsung.com
parent 04b19d32
...@@ -83,8 +83,11 @@ static int panel_bridge_attach(struct drm_bridge *bridge, ...@@ -83,8 +83,11 @@ static int panel_bridge_attach(struct drm_bridge *bridge,
drm_connector_attach_encoder(&panel_bridge->connector, drm_connector_attach_encoder(&panel_bridge->connector,
bridge->encoder); bridge->encoder);
if (connector->funcs->reset) if (bridge->dev->registered) {
connector->funcs->reset(connector); if (connector->funcs->reset)
connector->funcs->reset(connector);
drm_connector_register(connector);
}
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment