linux-tegra.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sam Ravnborg <sam-uyr5N9Q2VtJg9hUCZPvPmw@public.gmane.org>
To: Thomas Zimmermann <tzimmermann-l3A5Bk7waGM@public.gmane.org>
Cc: Laurent Pinchart
	<laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org>,
	hamohammed.sa-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	alexandre.belloni-LDxbnhwyfcJBDgjK7y7TUQ@public.gmane.org,
	airlied-cv59FeDIM0c@public.gmane.org,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
	sebastian.reichel-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org,
	paul-icTtO2rgO2OTuSrc4Mpeew@public.gmane.org,
	matthias.bgg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	wens-jdAy2FN1RRM@public.gmane.org,
	thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	kraxel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
	linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	jy0922.shim-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org,
	linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	tomi.valkeinen-l0cyMroinI0@public.gmane.org,
	abrodkin-HKixBCOQz3hWk0Htik3J/w@public.gmane.org,
	linux-I+IVW8TIWO2tmTQ+vhA3Yw@public.gmane.org,
	krzk-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	jonathanh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org,
	xinliang.liu-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org,
	kong.kongxinwei-C8/M+/jPZTeaMJb+Lgu22Q@public.gmane.org,
	kgene-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	linux-imx-3arQi8VN3Tc@public.gmane.org,
	nicolas.ferre-UWL1GkI3JZL3oGB3hsPCZA@public.gmane.org,
	puck.chen-C8/M+/jPZTeaMJb+Lgu22Q@public.gmane.org,
	s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org,
	alison.wang-3arQi8VN3Tc@public.gmane.org,
	jsarha-l0cyMroinI0@public.gmane.org,
	linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, virtuali
Subject: Re: [PATCH 00/22] drm: Convert drivers to drm_simple_encoder_init()
Date: Sat, 7 Mar 2020 21:08:13 +0100	[thread overview]
Message-ID: <20200307200813.GA15363@ravnborg.org> (raw)
In-Reply-To: <bccc380a-8925-81a7-34fe-5a1744a766d0-l3A5Bk7waGM@public.gmane.org>

Hi Thomas.

On Fri, Mar 06, 2020 at 04:18:52PM +0100, Thomas Zimmermann wrote:
> Hi Laurent
> 
> Am 06.03.20 um 15:22 schrieb Laurent Pinchart:
> > Hi Thomas,
> > 
> > Thank you for the patch.
> > 
> > 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-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org>
> 
> 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()

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-uyr5N9Q2VtJg9hUCZPvPmw@public.gmane.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.

	Sam

  parent reply	other threads:[~2020-03-07 20:08 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 03/22] drm/exynos: Use simple encoder Thomas Zimmermann
     [not found]   ` <20200305155950.2705-4-tzimmermann-l3A5Bk7waGM@public.gmane.org>
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 08/22] drm/imx: " Thomas Zimmermann
     [not found] ` <20200305155950.2705-1-tzimmermann-l3A5Bk7waGM@public.gmane.org>
2020-03-05 15:59   ` [PATCH 01/22] drm/arc: " Thomas Zimmermann
     [not found]     ` <20200305155950.2705-2-tzimmermann-l3A5Bk7waGM@public.gmane.org>
2020-03-05 23:48       ` kbuild test robot
2020-03-06 21:18       ` Sam Ravnborg
     [not found]         ` <20200306211802.GA17369-uyr5N9Q2VtJg9hUCZPvPmw@public.gmane.org>
2020-03-09  7:55           ` Thomas Zimmermann
2020-03-05 15:59   ` [PATCH 02/22] drm/atmel-hlcdc: " Thomas Zimmermann
     [not found]     ` <20200305155950.2705-3-tzimmermann-l3A5Bk7waGM@public.gmane.org>
2020-03-06  0:32       ` kbuild test robot
2020-03-06 21:26       ` 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
     [not found]     ` <20200305155950.2705-6-tzimmermann-l3A5Bk7waGM@public.gmane.org>
2020-03-06  0:44       ` kbuild test robot
2020-03-06 21:35       ` Sam Ravnborg
     [not found]         ` <20200306213519.GD17369-uyr5N9Q2VtJg9hUCZPvPmw@public.gmane.org>
2020-03-09  7:32           ` Thomas Zimmermann
2020-03-05 15:59   ` [PATCH 06/22] drm/hisilicon/kirin: " Thomas Zimmermann
     [not found]     ` <20200305155950.2705-7-tzimmermann-l3A5Bk7waGM@public.gmane.org>
2020-03-06  6:16       ` kbuild test robot
2020-03-05 15:59   ` [PATCH 07/22] drm/i2c/tda998x: " Thomas Zimmermann
     [not found]     ` <20200305155950.2705-8-tzimmermann-l3A5Bk7waGM@public.gmane.org>
2020-03-06  7:30       ` kbuild test robot
2020-03-07 15:40       ` kbuild test robot
2020-03-05 15:59   ` [PATCH 09/22] drm/ingenic: " Thomas Zimmermann
2020-03-05 15:59   ` [PATCH 12/22] drm/rockchip: " Thomas Zimmermann
     [not found]     ` <20200305155950.2705-13-tzimmermann-l3A5Bk7waGM@public.gmane.org>
2020-03-05 23:59       ` kbuild test robot
2020-03-06 10:05       ` kbuild test robot
2020-03-05 15:59   ` [PATCH 14/22] drm/sun4i: " Thomas Zimmermann
     [not found]     ` <20200305155950.2705-15-tzimmermann-l3A5Bk7waGM@public.gmane.org>
2020-03-06 11:12       ` kbuild test robot
2020-03-05 15:59   ` [PATCH 19/22] drm/virtgpu: " Thomas Zimmermann
     [not found]     ` <20200305155950.2705-20-tzimmermann-l3A5Bk7waGM@public.gmane.org>
2020-03-07 15:40       ` kbuild test robot
2020-03-06 14:22   ` [PATCH 00/22] drm: Convert drivers to drm_simple_encoder_init() Laurent Pinchart
     [not found]     ` <20200306142212.GF4878-N3hz7ZxfLydczECFQUw77jytWr6r+dGw0E9HWUfgJXw@public.gmane.org>
2020-03-06 15:18       ` Thomas Zimmermann
     [not found]         ` <bccc380a-8925-81a7-34fe-5a1744a766d0-l3A5Bk7waGM@public.gmane.org>
2020-03-07 20:08           ` Sam Ravnborg [this message]
     [not found]             ` <20200307200813.GA15363-uyr5N9Q2VtJg9hUCZPvPmw@public.gmane.org>
2020-03-07 20:34               ` Laurent Pinchart
     [not found]                 ` <20200307203445.GC5021-N3hz7ZxfLydczECFQUw77jytWr6r+dGw0E9HWUfgJXw@public.gmane.org>
2020-03-07 20:51                   ` Sam Ravnborg
2020-03-09  7:24               ` Thomas Zimmermann
2020-03-05 15:59 ` [PATCH 10/22] drm/mediatek: Use simple encoder Thomas Zimmermann
     [not found]   ` <20200305155950.2705-11-tzimmermann-l3A5Bk7waGM@public.gmane.org>
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
     [not found]   ` <20200305155950.2705-12-tzimmermann-l3A5Bk7waGM@public.gmane.org>
2020-03-06  8:43     ` kbuild test robot
2020-03-05 15:59 ` [PATCH 13/22] drm/shmobile: " Thomas Zimmermann
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
     [not found]   ` <20200305155950.2705-17-tzimmermann-l3A5Bk7waGM@public.gmane.org>
2020-03-06 16:02     ` Jyri Sarha
2020-03-05 15:59 ` [PATCH 17/22] drm/tilcdc: " Thomas Zimmermann
     [not found]   ` <20200305155950.2705-18-tzimmermann-l3A5Bk7waGM@public.gmane.org>
2020-03-06 16:03     ` Jyri Sarha
2020-03-05 15:59 ` [PATCH 18/22] drm/vc4: " Thomas Zimmermann
     [not found]   ` <20200305155950.2705-19-tzimmermann-l3A5Bk7waGM@public.gmane.org>
2020-03-05 17:03     ` Eric Anholt
2020-03-06 13:54     ` kbuild test robot
2020-03-05 15:59 ` [PATCH 20/22] drm/vkms: " Thomas Zimmermann
     [not found]   ` <20200305155950.2705-21-tzimmermann-l3A5Bk7waGM@public.gmane.org>
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
     [not found]       ` <20200324115905.dp5jqzbmvhbmk2rn-TAvD023jEQEN+BqQ9rBEUg@public.gmane.org>
2020-04-01  7:17         ` Thomas Zimmermann
2020-03-05 15:59 ` [PATCH 21/22] drm/writeback: " Thomas Zimmermann
     [not found]   ` <20200305155950.2705-22-tzimmermann-l3A5Bk7waGM@public.gmane.org>
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
     [not found]   ` <20200306105659.GY2363188-dv86pmgwkMBes7Z6vYuT8azUEOm+Xw19@public.gmane.org>
2020-03-06 15:10     ` 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=20200307200813.GA15363@ravnborg.org \
    --to=sam-uyr5n9q2vtjg9huczpvpmw@public.gmane.org \
    --cc=abrodkin-HKixBCOQz3hWk0Htik3J/w@public.gmane.org \
    --cc=airlied-cv59FeDIM0c@public.gmane.org \
    --cc=alexandre.belloni-LDxbnhwyfcJBDgjK7y7TUQ@public.gmane.org \
    --cc=alison.wang-3arQi8VN3Tc@public.gmane.org \
    --cc=dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=hamohammed.sa-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=jonathanh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
    --cc=jsarha-l0cyMroinI0@public.gmane.org \
    --cc=jy0922.shim-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
    --cc=kgene-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=kong.kongxinwei-C8/M+/jPZTeaMJb+Lgu22Q@public.gmane.org \
    --cc=kraxel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=krzk-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org \
    --cc=linux-I+IVW8TIWO2tmTQ+vhA3Yw@public.gmane.org \
    --cc=linux-imx-3arQi8VN3Tc@public.gmane.org \
    --cc=linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=matthias.bgg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=nicolas.ferre-UWL1GkI3JZL3oGB3hsPCZA@public.gmane.org \
    --cc=paul-icTtO2rgO2OTuSrc4Mpeew@public.gmane.org \
    --cc=puck.chen-C8/M+/jPZTeaMJb+Lgu22Q@public.gmane.org \
    --cc=s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org \
    --cc=sebastian.reichel-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org \
    --cc=thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=tomi.valkeinen-l0cyMroinI0@public.gmane.org \
    --cc=tzimmermann-l3A5Bk7waGM@public.gmane.org \
    --cc=wens-jdAy2FN1RRM@public.gmane.org \
    --cc=xinliang.liu-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    /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).