dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Sam Ravnborg <sam@ravnborg.org>
Cc: ludovic.desroches@microchip.com, hamohammed.sa@gmail.com,
	alexandre.belloni@bootlin.com, airlied@linux.ie,
	dri-devel@lists.freedesktop.org, linux@armlinux.org.uk,
	paul@crapouillou.net, linux-tegra@vger.kernel.org,
	thierry.reding@gmail.com, kraxel@redhat.com,
	linux-samsung-soc@vger.kernel.org, jy0922.shim@samsung.com,
	hjc@rock-chips.com, abrodkin@synopsys.com,
	sebastian.reichel@collabora.com, krzk@kernel.org,
	jonathanh@nvidia.com, linux-rockchip@lists.infradead.org,
	wens@csie.org, tomi.valkeinen@ti.com, linux-imx@nxp.com,
	xinliang.liu@linaro.org, kong.kongxinwei@hisilicon.com,
	kernel@pengutronix.de, puck.chen@hisilicon.com,
	s.hauer@pengutronix.de, alison.wang@nxp.com, jsarha@ti.com,
	linux-mediatek@lists.infradead.org, matthias.bgg@gmail.com,
	virtualization@lists.linux-foundation.org,
	jernej.skrabec@siol.net, rodrigosiqueiramelo@gmail.com,
	bbrezillon@kernel.org, jingoohan1@gmail.com,
	sw0312.kim@samsung.com, nicolas.ferre@microchip.com,
	kyungmin.park@samsung.com,
	kieran.bingham+renesas@ideasonboard.com, kgene@kernel.org,
	Thomas Zimmermann <tzimmermann@suse.de>,
	zourongrong@gmail.com, shawnguo@kernel.org
Subject: Re: [PATCH 00/22] drm: Convert drivers to drm_simple_encoder_init()
Date: Sat, 7 Mar 2020 22:34:45 +0200	[thread overview]
Message-ID: <20200307203445.GC5021@pendragon.ideasonboard.com> (raw)
In-Reply-To: <20200307200813.GA15363@ravnborg.org>

Hi Sam,

On Sat, Mar 07, 2020 at 09:08:13PM +0100, Sam Ravnborg wrote:
> On Fri, Mar 06, 2020 at 04:18:52PM +0100, Thomas Zimmermann wrote:
> > Am 06.03.20 um 15:22 schrieb Laurent Pinchart:
> > > On Thu, Mar 05, 2020 at 04:59:28PM +0100, Thomas Zimmermann wrote:
> > >> A call to drm_simple_encoder_init() initializes an encoder without
> > >> further functionality. It only provides the destroy callback to
> > >> cleanup the encoder's state. Only few drivers implement more
> > >> sophisticated encoders than that. Most drivers implement such a
> > >> simple encoder and can use drm_simple_encoder_init() instead.
> > >>
> > >> The patchset converts drivers where the encoder's instance is
> > >> embedded in a larger data structure. The driver releases the
> > >> memory during cleanup. Each patch replaces drm_encoder_init() with
> > >> drm_simple_encoder_init() and removes the (now unused) driver's
> > >> encoder functions.
> > >>
> > >> While the patchset is fairly large, the indiviual patches are self-
> > >> contained and can be merged independently from each other. The
> > >> simple-encoder functionality is currently in drm-misc-next, where
> > >> these patches could go as well.
> > > 
> > > I've reviewed the whole series, including verifying that the few
> > > instances of struct drm_encoder_funcs that were not declared const were
> > > not modified somewhere to add more function pointers.
> > > 
> > > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > 
> > Thanks for the detailed review.
> > 
> > > for all the patches.
> > > 
> > > However, I'd like to note that drm_simple_encoder_init() is a bit of a
> > > misnommer here. Several of the encoders in those drivers to implement
> > > additional functionality. They just expose them through
> > > drm_encoder_helper_funcs, not drm_encoder_funcs.
> > 
> > True. It's called 'simple encoder' for the lack of a better name. It's
> > part of the simple KMS helpers, so the name's at least consistent. OTOH
> > I always find drm_simple_display_pipe a bad name.
> > 
> > We can still rename the simple-encoder function without much effort. I'm
> > open for suggestions.
> 
> IMO this does not belong in drm_simple_kms - but in drm_encoder.
> This only occurs to me after looking a bit more on the patches,
> you would have loved to get this feedback earlier.
> 
> Most users do not need their owm drm_encoder_funcs definition,
> and would be happy with the default as provided by drm_simple_*
> 
> As the cleanup is handled automatically when the drm device
> is teared down (in mode_config_rest()) I considered if we could here
> use the drmm_ namespace - but that felt wrong.
> 
> My proposal is the following:
> - Move the implementation to drm_encoder.c
> - Name it drm_encoder_init_nofuncs()

Or better, rename the existing drm_encoder_init() to
drm_encoder_init_funcs(), and rename drm_simple_encoder_init() to
drm_encoder_init() ? It's the common case.

> The patches posted in this thread would be a little simpler
> as they would loose the added include file.
> And the three drivers using the current infrastructure would need a
> small update.
> 
> I you decide to keep the current approach where the
> functions are in drm_simple_* then the full series is:
> Acked-by: Sam Ravnborg <sam@ravnborg.org>
> 
> But I think moving it to drm_encoder.c would be the approach that would
> make it simpler to understand/follow. So that get my (biased) vote.

-- 
Regards,

Laurent Pinchart
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2020-03-07 20:34 UTC|newest]

Thread overview: 66+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-05 15:59 [PATCH 00/22] drm: Convert drivers to drm_simple_encoder_init() Thomas Zimmermann
2020-03-05 15:59 ` [PATCH 01/22] drm/arc: Use simple encoder Thomas Zimmermann
2020-03-05 23:48   ` kbuild test robot
2020-03-06 21:18   ` Sam Ravnborg
2020-03-09  7:55     ` Thomas Zimmermann
2020-03-05 15:59 ` [PATCH 02/22] drm/atmel-hlcdc: " Thomas Zimmermann
2020-03-06  0:32   ` kbuild test robot
2020-03-06 21:26   ` Sam Ravnborg
2020-03-05 15:59 ` [PATCH 03/22] drm/exynos: " Thomas Zimmermann
2020-03-06  0:55   ` kbuild test robot
2020-03-06  5:14   ` kbuild test robot
2020-03-06 21:28   ` Sam Ravnborg
2020-03-05 15:59 ` [PATCH 04/22] drm/fsl-dcu: " Thomas Zimmermann
2020-03-06  0:02   ` kbuild test robot
2020-03-05 15:59 ` [PATCH 05/22] drm/gma500: " Thomas Zimmermann
2020-03-06  0:44   ` kbuild test robot
2020-03-06 21:35   ` Sam Ravnborg
2020-03-09  7:32     ` Thomas Zimmermann
2020-03-05 15:59 ` [PATCH 06/22] drm/hisilicon/kirin: " Thomas Zimmermann
2020-03-06  6:16   ` kbuild test robot
2020-03-05 15:59 ` [PATCH 07/22] drm/i2c/tda998x: " Thomas Zimmermann
2020-03-06  7:30   ` kbuild test robot
2020-03-07 15:40   ` kbuild test robot
2020-03-05 15:59 ` [PATCH 08/22] drm/imx: " Thomas Zimmermann
2020-03-05 15:59 ` [PATCH 09/22] drm/ingenic: " Thomas Zimmermann
2020-03-05 15:59 ` [PATCH 10/22] drm/mediatek: " Thomas Zimmermann
2020-03-07 21:26   ` Matthias Brugger
2020-03-10  2:37   ` CK Hu
2020-03-05 15:59 ` [PATCH 11/22] drm/rcar-du: " Thomas Zimmermann
2020-03-06  8:43   ` kbuild test robot
2020-03-05 15:59 ` [PATCH 12/22] drm/rockchip: " Thomas Zimmermann
2020-03-05 23:59   ` kbuild test robot
2020-03-06 10:05   ` kbuild test robot
2020-03-05 15:59 ` [PATCH 13/22] drm/shmobile: " Thomas Zimmermann
2020-03-05 15:59 ` [PATCH 14/22] drm/sun4i: " Thomas Zimmermann
2020-03-06 11:12   ` kbuild test robot
2020-03-05 15:59 ` [PATCH 15/22] drm/tegra: " Thomas Zimmermann
2020-03-06 12:38   ` kbuild test robot
2020-03-05 15:59 ` [PATCH 16/22] drm/tidss: " Thomas Zimmermann
2020-03-06 16:02   ` Jyri Sarha
2020-03-05 15:59 ` [PATCH 17/22] drm/tilcdc: " Thomas Zimmermann
2020-03-06 16:03   ` Jyri Sarha
2020-03-05 15:59 ` [PATCH 18/22] drm/vc4: " Thomas Zimmermann
2020-03-05 17:03   ` Eric Anholt
2020-03-06 13:54   ` kbuild test robot
2020-03-05 15:59 ` [PATCH 19/22] drm/virtgpu: " Thomas Zimmermann
2020-03-07 15:40   ` kbuild test robot
2020-03-05 15:59 ` [PATCH 20/22] drm/vkms: " Thomas Zimmermann
2020-03-06  0:24   ` kbuild test robot
2020-03-07 13:59   ` kbuild test robot
2020-03-24 11:59   ` Rodrigo Siqueira
2020-03-31  9:20     ` Thomas Zimmermann
2020-04-01  7:17     ` Thomas Zimmermann
2020-03-05 15:59 ` [PATCH 21/22] drm/writeback: " Thomas Zimmermann
2020-03-06  0:54   ` kbuild test robot
2020-03-06  1:17   ` kbuild test robot
2020-03-06 14:54   ` kbuild test robot
2020-03-05 15:59 ` [PATCH 22/22] drm/zte: " Thomas Zimmermann
2020-03-06 10:56 ` [PATCH 00/22] drm: Convert drivers to drm_simple_encoder_init() Daniel Vetter
2020-03-06 15:10   ` Thomas Zimmermann
2020-03-06 14:22 ` Laurent Pinchart
2020-03-06 15:18   ` Thomas Zimmermann
2020-03-07 20:08     ` Sam Ravnborg
2020-03-07 20:34       ` Laurent Pinchart [this message]
2020-03-07 20:51         ` Sam Ravnborg
2020-03-09  7:24       ` Thomas Zimmermann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200307203445.GC5021@pendragon.ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=abrodkin@synopsys.com \
    --cc=airlied@linux.ie \
    --cc=alexandre.belloni@bootlin.com \
    --cc=alison.wang@nxp.com \
    --cc=bbrezillon@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hamohammed.sa@gmail.com \
    --cc=hjc@rock-chips.com \
    --cc=jernej.skrabec@siol.net \
    --cc=jingoohan1@gmail.com \
    --cc=jonathanh@nvidia.com \
    --cc=jsarha@ti.com \
    --cc=jy0922.shim@samsung.com \
    --cc=kernel@pengutronix.de \
    --cc=kgene@kernel.org \
    --cc=kieran.bingham+renesas@ideasonboard.com \
    --cc=kong.kongxinwei@hisilicon.com \
    --cc=kraxel@redhat.com \
    --cc=krzk@kernel.org \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-imx@nxp.com \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=ludovic.desroches@microchip.com \
    --cc=matthias.bgg@gmail.com \
    --cc=nicolas.ferre@microchip.com \
    --cc=paul@crapouillou.net \
    --cc=puck.chen@hisilicon.com \
    --cc=rodrigosiqueiramelo@gmail.com \
    --cc=s.hauer@pengutronix.de \
    --cc=sam@ravnborg.org \
    --cc=sebastian.reichel@collabora.com \
    --cc=shawnguo@kernel.org \
    --cc=sw0312.kim@samsung.com \
    --cc=thierry.reding@gmail.com \
    --cc=tomi.valkeinen@ti.com \
    --cc=tzimmermann@suse.de \
    --cc=virtualization@lists.linux-foundation.org \
    --cc=wens@csie.org \
    --cc=xinliang.liu@linaro.org \
    --cc=zourongrong@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).