From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sam Ravnborg Subject: Re: [PATCH 01/22] drm/arc: Use simple encoder Date: Fri, 6 Mar 2020 22:18:03 +0100 Message-ID: <20200306211802.GA17369@ravnborg.org> References: <20200305155950.2705-1-tzimmermann@suse.de> <20200305155950.2705-2-tzimmermann@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <20200305155950.2705-2-tzimmermann-l3A5Bk7waGM@public.gmane.org> Sender: linux-tegra-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Thomas Zimmermann 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: virtualization@lists.linuxfoundation.org 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. 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. This patch looks good for what it does. Acked-by: Sam Ravnborg > > 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/arcpgu_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 @@ > > #include > #include > -#include > #include > +#include > +#include > > #include "arcpgu.h" > > -static struct drm_encoder_funcs arcpgu_drm_encoder_funcs = { > - .destroy = 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, struct device_node *np) > > encoder->possible_crtcs = 1; > encoder->possible_clones = 0; > - ret = drm_encoder_init(drm, encoder, &arcpgu_drm_encoder_funcs, > - DRM_MODE_ENCODER_TMDS, NULL); > + ret = drm_simple_encoder_init(drm, encoder, DRM_MODE_ENCODER_TMDS); > if (ret) > return ret; > > diff --git a/drivers/gpu/drm/arc/arcpgu_sim.c b/drivers/gpu/drm/arc/arcpgu_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 > > #include "arcpgu.h" > > @@ -50,10 +51,6 @@ static const struct drm_connector_funcs arcpgu_drm_connector_funcs = { > .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, > }; > > -static struct drm_encoder_funcs arcpgu_drm_encoder_funcs = { > - .destroy = drm_encoder_cleanup, > -}; > - > int arcpgu_drm_sim_init(struct drm_device *drm, struct device_node *np) > { > struct arcpgu_drm_connector *arcpgu_connector; > @@ -68,8 +65,7 @@ int arcpgu_drm_sim_init(struct drm_device *drm, struct device_node *np) > encoder->possible_crtcs = 1; > encoder->possible_clones = 0; > > - ret = drm_encoder_init(drm, encoder, &arcpgu_drm_encoder_funcs, > - DRM_MODE_ENCODER_VIRTUAL, NULL); > + ret = drm_simple_encoder_init(drm, encoder, DRM_MODE_ENCODER_VIRTUAL); > if (ret) > return ret; > > -- > 2.25.1