From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tomi Valkeinen Subject: Re: [PATCH 1/7] drm/omap: ensure all displays have been probed Date: Wed, 16 Dec 2015 17:45:27 +0200 Message-ID: <56718717.2060104@ti.com> References: <1449675491-9184-1-git-send-email-tomi.valkeinen@ti.com> <1449675491-9184-2-git-send-email-tomi.valkeinen@ti.com> <55772991.Fz4XTGrJkY@avalon> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0527467330==" Return-path: Received: from devils.ext.ti.com (devils.ext.ti.com [198.47.26.153]) by gabe.freedesktop.org (Postfix) with ESMTPS id 11C6F6E54D for ; Wed, 16 Dec 2015 07:45:32 -0800 (PST) In-Reply-To: <55772991.Fz4XTGrJkY@avalon> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: Laurent Pinchart Cc: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org --===============0527467330== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Nv259oHd3eCu7sdo0mTtWIIbwCnETWmMC" --Nv259oHd3eCu7sdo0mTtWIIbwCnETWmMC Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 13/12/15 22:30, Laurent Pinchart wrote: > Hi Tomi, >=20 > Thank you for the patch. >=20 > On Wednesday 09 December 2015 17:38:05 Tomi Valkeinen wrote: >> DRM offers no ways to add new displays after the DRM driver has been >> loaded. This causes issues on boards that have multiple displays, and >> omapdrm is loaded when some of them are loaded but not all. The result= >> is that omapdrm starts with the displays that were loaded at that time= , >> ignoring the displays loaded later. >> >> This patch changes the behavior so that omapdrm ensures all display ar= e >> loaded which have an alias in the .dts file. >> >> The downside is that this prevents omapdrm from loading if, say, the >> user has not compiled a kernel module for one of the displays, or >> there's some kind of failure in one of the displays. Thus, after this >> patch, all the displays have to work, or none does. >> >> Signed-off-by: Tomi Valkeinen >> --- >> drivers/gpu/drm/omapdrm/omap_drv.c | 27 +++++++++++++++++++++++++++ >> 1 file changed, 27 insertions(+) >> >> diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c >> b/drivers/gpu/drm/omapdrm/omap_drv.c index 5c6609cbb6a2..c93c13e2c22d >> 100644 >> --- a/drivers/gpu/drm/omapdrm/omap_drv.c >> +++ b/drivers/gpu/drm/omapdrm/omap_drv.c >> @@ -242,11 +242,38 @@ static void omap_disconnect_dssdevs(void) >> dssdev->driver->disconnect(dssdev); >> } >> >> +static bool dssdev_with_alias_exists(const char *alias) >> +{ >> + struct omap_dss_device *dssdev =3D NULL; >> + >> + for_each_dss_dev(dssdev) { >> + if (strcmp(alias, dssdev->alias) =3D=3D 0) { >> + omap_dss_put_device(dssdev); >> + return true; >> + } >> + } >> + >> + return false; >> +} >> + >> static int omap_connect_dssdevs(void) >> { >> int r; >> struct omap_dss_device *dssdev =3D NULL; >> bool no_displays =3D true; >> + struct device_node *aliases; >> + struct property *pp; >> + >> + aliases =3D of_find_node_by_path("/aliases"); >> + if (aliases) { >> + for_each_property_of_node(aliases, pp) { >> + if (strncmp(pp->name, "display", 7) !=3D 0) >> + continue; >> + >> + if (dssdev_with_alias_exists(pp->name) =3D=3D false) >> + return -EPROBE_DEFER; >> + } >> + } >=20 > The DSS bindings document the aliases as optional, so this won't work i= n the=20 > general case. The best solution would be to travel the display graph th= rough=20 > the ports and use the components framework, but that would be more comp= lex to=20 > implement. Well, even with this patch aliases are optional. The difference is that if you don't have any aliases, and omapdrm starts, and one of the multiple displays has not been probed yet, that display will be unavailable. If you do have aliases, omapdrm ensures that the displays with an alias are probed. But... You are probably right, travelling the graph is better. Tomi --Nv259oHd3eCu7sdo0mTtWIIbwCnETWmMC Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJWcYcXAAoJEPo9qoy8lh71Wg4P/0+3rWdLjP6w2PRSJ4x3c9D0 6rcX0x8NDdoFLdlGNzqfAfEbhoVwII8K/HQAU0ZPsS15r5H845UW6lZg0/GD2egJ A2U9NTOhqUDb/8IWPhpiguizRmKoX68ObSjTpqlxlrQlS4R8h2IT6oQuXVeO3iO+ pH+9BrEnGXvDYhjTPLKJjonmbfnHiAyRoJGR2mlgYBg/NE/T3cafdLR/uaxVpUg8 5JenSxoPKyhvVdenZ4OzzgiIAPB6Vwe3WrcsmkWPUzwWBLXbXX/+bJ9iWVQvpRgp uqKzQze2wjcOAgO1PGRHHe4E58qJDavdjLioq0lundjZGMIJBReeZl5R6MC3VGKI OiUqf8R391pyH+w6oUpvqroqyIOfK5eYGSAUQlfIafMLF3RPo10SPli5aBDQhIJ0 gb073rj1D+/h2JKqucZTm0OFuW18Pv6CLuIcNAT2Jx/TJsr7M1d5FfLXQnflLuSH TfmgVlF6Jm3j1fdBHkxTCGWlDb9Ca5yOGpagPz8DUk7iUUgGd/fTfRAFCelA63HR RX4nCa6AYfIsRzBvl5Xr5Xr/ImVU7ixtO+qkZewrxmhnLR2IuLSGJZZyhu3X0Yla MQ8/ZNbUnSAOoHIlmblGYE/O2QrsaxlHim/AFvu1coHg5OlxL7Zp91ToYDTQY8BO 13vOwukpP9xKhe7cZwph =xwxC -----END PGP SIGNATURE----- --Nv259oHd3eCu7sdo0mTtWIIbwCnETWmMC-- --===============0527467330== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHA6Ly9saXN0 cy5mcmVlZGVza3RvcC5vcmcvbWFpbG1hbi9saXN0aW5mby9kcmktZGV2ZWwK --===============0527467330==--