From: Thomas Zimmermann Subject: Re: [PATCH 01/22] drm/arc: Use simple encoder Date: Mon, 9 Mar 2020 08:55:04 +0100 Message-ID: <2cded827-de52-6110-505d-eacab9f28772@suse.de> References: <20200305155950.2705-1-tzimmermann@suse.de> <20200305155950.2705-2-tzimmermann@suse.de> <20200306211802.GA17369@ravnborg.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="MGskBhwtfwJu2ES79w1QlBRF0CsXl3V4l" Return-path: In-Reply-To: <20200306211802.GA17369-uyr5N9Q2VtJg9hUCZPvPmw@public.gmane.org> Sender: linux-tegra-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Sam Ravnborg Cc: airlied-cv59FeDIM0c@public.gmane.org, daniel-/w4YWyX8dFk@public.gmane.org, abrodkin-HKixBCOQz3hWk0Htik3J/w@public.gmane.org, bbrezillon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, nicolas.ferre-UWL1GkI3JZL3oGB3hsPCZA@public.gmane.org, alexandre.belloni-LDxbnhwyfcJBDgjK7y7TUQ@public.gmane.org, ludovic.desroches-UWL1GkI3JZL3oGB3hsPCZA@public.gmane.org, maarten.lankhorst-VuQAYsv1563Yd54FQh9/CA@public.gmane.org, mripard-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, jingoohan1-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, inki.dae-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org, jy0922.shim-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org, sw0312.kim-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org, kyungmin.park-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org, kgene-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, krzk-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, stefan-XLVq0VzYD2Y@public.gmane.org, alison.wang-3arQi8VN3Tc@public.gmane.org, patrik.r.jakobsson-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, xinliang.liu-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org, zourongrong-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, john.stultz-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org, kong.kongxinwei-C8/M+/jPZTeaMJb+Lgu22Q@public.gmane.org, puck.chen-C8/M+/jPZTeaMJb+Lgu22Q@public.gmane.org, linux-I+IVW8TIWO2tmTQ+vhA3Yw@public.gmane.org, p.zabel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org, shawnguo-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org, kernel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org, festevam-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, linux-imx-3arQi8VN3Tc@public.gmane.org, paul-icTtO2rgO2OTuSrc4Mpeew@public.gmane.org, ck.hu-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org, matthias List-Id: linux-rockchip.vger.kernel.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --MGskBhwtfwJu2ES79w1QlBRF0CsXl3V4l Content-Type: multipart/mixed; boundary="dfC3HwP1w1SRemUUkRjXLmFHcLkGVwl1e"; protected-headers="v1" From: Thomas Zimmermann To: Sam Ravnborg Cc: airlied-cv59FeDIM0c@public.gmane.org, daniel-/w4YWyX8dFk@public.gmane.org, abrodkin-HKixBCOQz3hWk0Htik3J/w@public.gmane.org, bbrezillon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, nicolas.ferre-UWL1GkI3JZL3oGB3hsPCZA@public.gmane.org, alexandre.belloni-LDxbnhwyfcJBDgjK7y7TUQ@public.gmane.org, ludovic.desroches-UWL1GkI3JZL3oGB3hsPCZA@public.gmane.org, maarten.lankhorst-VuQAYsv1563Yd54FQh9/CA@public.gmane.org, mripard-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, jingoohan1-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, inki.dae-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org, jy0922.shim-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org, sw0312.kim-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org, kyungmin.park-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org, kgene-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, krzk-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, stefan-XLVq0VzYD2Y@public.gmane.org, alison.wang-3arQi8VN3Tc@public.gmane.org, patrik.r.jakobsson-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, xinliang.liu-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org, zourongrong-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, john.stultz-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org, kong.kongxinwei-C8/M+/jPZTeaMJb+Lgu22Q@public.gmane.org, puck.chen-C8/M+/jPZTeaMJb+Lgu22Q@public.gmane.org, linux-I+IVW8TIWO2tmTQ+vhA3Yw@public.gmane.org, p.zabel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org, shawnguo-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org, kernel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org, festevam-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, linux-imx-3arQi8VN3Tc@public.gmane.org, paul-icTtO2rgO2OTuSrc4Mpeew@public.gmane.org, ck.hu-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org, matthias.bgg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org, kieran.bingham+renesas-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org, hjc-TNX95d0MmH7DzftRWevZcw@public.gmane.org, heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org, wens-jdAy2FN1RRM@public.gmane.org, jernej.skrabec-gGgVlfcn5nU@public.gmane.org, thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, jonathanh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org, jsarha-l0cyMroinI0@public.gmane.org, tomi.valkeinen-l0cyMroinI0@public.gmane.org, eric-WhKQ6XTQaPysTnJN9+BGXg@public.gmane.org, kraxel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org, rodrigosiqueiramelo-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, hamohammed.sa-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, sebastian.reichel-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org, dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org, linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, virtualization-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Message-ID: <2cded827-de52-6110-505d-eacab9f28772-l3A5Bk7waGM@public.gmane.org> Subject: Re: [PATCH 01/22] drm/arc: Use simple encoder References: <20200305155950.2705-1-tzimmermann-l3A5Bk7waGM@public.gmane.org> <20200305155950.2705-2-tzimmermann-l3A5Bk7waGM@public.gmane.org> <20200306211802.GA17369-uyr5N9Q2VtJg9hUCZPvPmw@public.gmane.org> In-Reply-To: <20200306211802.GA17369-uyr5N9Q2VtJg9hUCZPvPmw@public.gmane.org> --dfC3HwP1w1SRemUUkRjXLmFHcLkGVwl1e Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable Hi Sam Am 06.03.20 um 22:18 schrieb Sam Ravnborg: > On Thu, Mar 05, 2020 at 04:59:29PM +0100, Thomas Zimmermann wrote: >> The arc driver uses empty implementations for its encoders. Replace >> the code with the generic simple encoder. >=20 > We should , as a follow-up patch, embed the encoder in > arcgpu_drm_private. > Then we drop the kzalloc() and avoid that life-time challenge. You're right, there's a devm_kzalloc() for the encoder. I didn't notice before. And from what I learned from the drmm_ patches, this doesn't work reliably. I'll drop this patch, as the series is supposed to handle embedded encoders. arcgpu will be fixed later when the managed API is ready. Best regards Thomas >=20 > This patch looks good for what it does. >=20 > Acked-by: Sam Ravnborg >=20 >> >> Signed-off-by: Thomas Zimmermann >> --- >> drivers/gpu/drm/arc/arcpgu_hdmi.c | 10 +++------- >> drivers/gpu/drm/arc/arcpgu_sim.c | 8 ++------ >> 2 files changed, 5 insertions(+), 13 deletions(-) >> >> diff --git a/drivers/gpu/drm/arc/arcpgu_hdmi.c b/drivers/gpu/drm/arc/a= rcpgu_hdmi.c >> index 52839934f2fb..780911765e2e 100644 >> --- a/drivers/gpu/drm/arc/arcpgu_hdmi.c >> +++ b/drivers/gpu/drm/arc/arcpgu_hdmi.c >> @@ -7,15 +7,12 @@ >> =20 >> #include >> #include >> -#include >> #include >> +#include >> +#include >> =20 >> #include "arcpgu.h" >> =20 >> -static struct drm_encoder_funcs arcpgu_drm_encoder_funcs =3D { >> - .destroy =3D drm_encoder_cleanup, >> -}; >> - >> int arcpgu_drm_hdmi_init(struct drm_device *drm, struct device_node *= np) >> { >> struct drm_encoder *encoder; >> @@ -34,8 +31,7 @@ int arcpgu_drm_hdmi_init(struct drm_device *drm, str= uct device_node *np) >> =20 >> encoder->possible_crtcs =3D 1; >> encoder->possible_clones =3D 0; >> - ret =3D drm_encoder_init(drm, encoder, &arcpgu_drm_encoder_funcs, >> - DRM_MODE_ENCODER_TMDS, NULL); >> + ret =3D drm_simple_encoder_init(drm, encoder, DRM_MODE_ENCODER_TMDS)= ; >> if (ret) >> return ret; >> =20 >> diff --git a/drivers/gpu/drm/arc/arcpgu_sim.c b/drivers/gpu/drm/arc/ar= cpgu_sim.c >> index 37d961668dfe..66ca2c26e339 100644 >> --- a/drivers/gpu/drm/arc/arcpgu_sim.c >> +++ b/drivers/gpu/drm/arc/arcpgu_sim.c >> @@ -8,6 +8,7 @@ >> #include >> #include >> #include >> +#include >> =20 >> #include "arcpgu.h" >> =20 >> @@ -50,10 +51,6 @@ static const struct drm_connector_funcs arcpgu_drm_= connector_funcs =3D { >> .atomic_destroy_state =3D drm_atomic_helper_connector_destroy_state,= >> }; >> =20 >> -static struct drm_encoder_funcs arcpgu_drm_encoder_funcs =3D { >> - .destroy =3D drm_encoder_cleanup, >> -}; >> - >> int arcpgu_drm_sim_init(struct drm_device *drm, struct device_node *n= p) >> { >> struct arcpgu_drm_connector *arcpgu_connector; >> @@ -68,8 +65,7 @@ int arcpgu_drm_sim_init(struct drm_device *drm, stru= ct device_node *np) >> encoder->possible_crtcs =3D 1; >> encoder->possible_clones =3D 0; >> =20 >> - ret =3D drm_encoder_init(drm, encoder, &arcpgu_drm_encoder_funcs, >> - DRM_MODE_ENCODER_VIRTUAL, NULL); >> + ret =3D drm_simple_encoder_init(drm, encoder, DRM_MODE_ENCODER_VIRTU= AL); >> if (ret) >> return ret; >> =20 >> --=20 >> 2.25.1 --=20 Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Maxfeldstr. 5, 90409 N=C3=BCrnberg, Germany (HRB 36809, AG N=C3=BCrnberg) Gesch=C3=A4ftsf=C3=BChrer: Felix Imend=C3=B6rffer --dfC3HwP1w1SRemUUkRjXLmFHcLkGVwl1e-- --MGskBhwtfwJu2ES79w1QlBRF0CsXl3V4l Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEchf7rIzpz2NEoWjlaA3BHVMLeiMFAl5l9lgACgkQaA3BHVML eiMBRAgApqR+Law2DXZaFiuIJ24c8VPSKEu7Giq7JYiLOVGmKsm1p0fLKQq8TmFi bwgTe5PfO3G5rI3dzNv1j7u/c5JmQoOr5HqaKBFYz212GbEf25k2r2I9QDiO4yOb y37Fc7QVRj2rGJXyS9Zal6hvTZKpHBGlxCNBW0xuL5xwNiIUXHKta+13mqb3+PEg Td2cB8ln0K0sQG6kHgzlc3abvBRu1s8z0hXfpIkxlwvBdq/w0bgNxKcPf51KkbZX JW6WnFBik8AmFzdbOueul3n0oR+ax7JhtbFqbgi3sipfBbVep3SptrkVgUG4XVqR yxbVG3sywas5MF21bJOKVgiEQP3f7A== =tCLj -----END PGP SIGNATURE----- --MGskBhwtfwJu2ES79w1QlBRF0CsXl3V4l--