From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tomi Valkeinen Subject: Re: [PATCH v2 13/28] drm: omapdrm: dss: Initialize DSS internal features at probe time Date: Tue, 9 May 2017 12:48:57 +0300 Message-ID: References: <20170508113303.27521-1-laurent.pinchart@ideasonboard.com> <20170508113303.27521-14-laurent.pinchart@ideasonboard.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0663227774==" Return-path: Received: from fllnx209.ext.ti.com (fllnx209.ext.ti.com [198.47.19.16]) by gabe.freedesktop.org (Postfix) with ESMTPS id E2A886E30E for ; Tue, 9 May 2017 09:49:27 +0000 (UTC) In-Reply-To: <20170508113303.27521-14-laurent.pinchart@ideasonboard.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: Laurent Pinchart , dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org --===============0663227774== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="RPVfr538NklvG3APJCqKVpKVvhgWGcTjr" --RPVfr538NklvG3APJCqKVpKVvhgWGcTjr Content-Type: multipart/mixed; boundary="4c3mJeoAHOFglEltosomOpPuxX4M5sGkj"; protected-headers="v1" From: Tomi Valkeinen To: Laurent Pinchart , dri-devel@lists.freedesktop.org Message-ID: Subject: Re: [PATCH v2 13/28] drm: omapdrm: dss: Initialize DSS internal features at probe time References: <20170508113303.27521-1-laurent.pinchart@ideasonboard.com> <20170508113303.27521-14-laurent.pinchart@ideasonboard.com> In-Reply-To: <20170508113303.27521-14-laurent.pinchart@ideasonboard.com> --4c3mJeoAHOFglEltosomOpPuxX4M5sGkj Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 08/05/17 14:32, Laurent Pinchart wrote: > The DSS internal features are derived from the platform device > compatible string which is available at probe time. Don't delay > initialization until bind time. This prepares for the merge of the two > DSS features structures that will be needed before the DSS is bound. >=20 > Signed-off-by: Laurent Pinchart > --- > drivers/gpu/drm/omapdrm/dss/dss.c | 26 +++++++++++++------------- > 1 file changed, 13 insertions(+), 13 deletions(-) >=20 > diff --git a/drivers/gpu/drm/omapdrm/dss/dss.c b/drivers/gpu/drm/omapdr= m/dss/dss.c > index 7546ba8ab955..4fdb77dd90b8 100644 > --- a/drivers/gpu/drm/omapdrm/dss/dss.c > +++ b/drivers/gpu/drm/omapdrm/dss/dss.c > @@ -1183,23 +1183,10 @@ static const struct soc_device_attribute dss_so= c_devices[] =3D { > static int dss_bind(struct device *dev) > { > struct platform_device *pdev =3D to_platform_device(dev); > - const struct soc_device_attribute *soc; > struct resource *dss_mem; > u32 rev; > int r; > =20 > - dss.pdev =3D pdev; > - > - /* > - * The various OMAP3-based SoCs can be told apart from the compatible= > - * string, use SoC device matching. > - */ > - soc =3D soc_device_match(dss_soc_devices); > - if (soc) > - dss.feat =3D soc->data; > - else > - dss.feat =3D of_match_device(dss_of_match, &pdev->dev)->data; > - > dss_mem =3D platform_get_resource(dss.pdev, IORESOURCE_MEM, 0); > dss.base =3D devm_ioremap_resource(&pdev->dev, dss_mem); > if (!dss.base) > @@ -1331,9 +1318,22 @@ static int dss_add_child_component(struct device= *dev, void *data) > =20 > static int dss_probe(struct platform_device *pdev) > { > + const struct soc_device_attribute *soc; > struct component_match *match =3D NULL; > int r; > =20 > + dss.pdev =3D pdev; > + > + /* > + * The various OMAP3-based SoCs can be told apart from the compatible= > + * string, use SoC device matching. > + */ > + soc =3D soc_device_match(dss_soc_devices); > + if (soc) > + dss.feat =3D soc->data; > + else > + dss.feat =3D of_match_device(dss_of_match, &pdev->dev)->data; > + This has the problem that we should remove the static 'dss' variable, and allocate memory for each device. We can have more than one DSS in the future. Also, I haven't looked at the following patches yet, but dss_features was a failed attempt to manage the dss features. Since then, we've slowly been moving the bits and pieces from dss_features to each individual driver. So if this is needed for dss_features, we should instead move everything from dss_features and remove that altogether. Tomi --4c3mJeoAHOFglEltosomOpPuxX4M5sGkj-- --RPVfr538NklvG3APJCqKVpKVvhgWGcTjr 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 iQIcBAEBCAAGBQJZEZCJAAoJEPo9qoy8lh71eZEP/1TI7ju/k63YHAVclhRYty+L WZO5ZxBR7vh3NyZn29cY50uucDeEcwD/dbQWyN2MRMmfVEDc8gShmb7B3aD+7HMi yyt12ewntQewh3fLlqOU5Eztp7rTILcXImiSXA0/8NBlO9xMN1JUToPrID/TqWe4 v36kRA2b889p2ZhBx3/+GxSrh4YXhR0HvD+zY8DWH/oHkBfekxUsLwvdNz92mfad CO61i7RFZ6A/vpbNErqQiOd8O95qxfPabpcL8u4ADSDsG0mkyMTlYhbWXJ4GkkC1 oBjnQa+NIOcV8edOUbzIxAvNnCBJrOzM9n78EIP7eTTH0n4sEVMOgIc0OFpPjMmz 6/pDGkIEKPo7jFMEX8CqPrc0HQolMG0LEoBLCewKkMucmyvP0Lc2svJXGzFCJAWC G9TD5gih6pVSmez78hjfJGl98+D0A9606ufLVuCarrjZjm3ijg6r5+mYQI8Krvsj ks7EYPjG0WTWAuiaNj6sPbWUmi8J0tzG+hwRejxcEAd4NR5/8JXSiE2sHjt4EzF/ mpoqArEVmQ420Rc/7AUigrdSLdOUc55gpPwVNa6fl7i6dsVR3eFfuk5LU/kQBUNY 6qrZzr4u9qgCJ44Kj0eX3gros7c8M19KFjIBUyy/rdSxdumTnTRcqv1fkmM8IPeT 9wvmqK6i/P0fI+V3IwRu =K4Xs -----END PGP SIGNATURE----- --RPVfr538NklvG3APJCqKVpKVvhgWGcTjr-- --===============0663227774== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vZHJpLWRldmVsCg== --===============0663227774==--