Hi Laurent,
On 12/03/2020 00:20, Laurent Pinchart wrote:
+ ret = load_firmware(mhdp);
+ if (ret)
+ goto phy_exit;
+
+ drm_bridge_add(&mhdp->bridge);
What if someone starts using the bridge before the firmware is
operational ? It seems that you should delay bridge registration until
the firmware is loaded. It may make it possible to remove
bridge_attached and solve the problem you mention in mhdp_fw_cb().
Handling the fw has been a bit of a pain... This is what we came up with to support all the
combinations (built-in/module, fw-userspace-helper/direct load, single-output/multiple-outputs).
The idea is that when the driver is loaded and probed (with or without fw), the DP is "ready". If we
don't have fw yet, everything looks fine, but the connector stays in disconnected state. When we get
the fw, connector will get connected (only if there's a cable connected, of course).
If we register the bridge only when we have fw, two things can happen:
- If we get the fw only rather late (in case userspace fw helper), a userspace app (e.g. weston)
could already have been started, and failed due to there being no DRM card.
- If we have two displays from the same display controller, say, DP and HDMI, the HDMI will only be
available when the DP is available. If the DP fw, for some reason, cannot be loaded, we never get HDMI.
Tomi
--
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki