mbox series

[v4,00/19] drm: managed encoder/plane/crtc allocation

Message ID 20201208155451.8421-1-p.zabel@pengutronix.de (mailing list archive)
Headers show
Series drm: managed encoder/plane/crtc allocation | expand

Message

Philipp Zabel Dec. 8, 2020, 3:54 p.m. UTC
Hi,

this is an update of the drmm_(simple_)encoder_alloc(),
drmm_universal_plane_alloc(), and drmm_crtc_alloc_with_plane()
functions in v3 [1] together with the imx-drm managed allocation
conversion from [2] as an example usage.
a bit.

Changes since v3:
 - Allow encoder_funcs to be NULL and let drmm_encoder_alloc() accept a
   NULL value for the funcs parameter. This allows to
 - drop the now useless drmm_simple_encoder_funcs_empty structure.
 - Reorder and squash the imx-drm managed allocation conversion patches
   to use the new functions directly.
 - Fold functions into bind callbacks where they are the only remaining
   call.

[1] https://lore.kernel.org/dri-devel/20200911135724.25833-1-p.zabel@pengutronix.de/
[2] https://lore.kernel.org/dri-devel/20200911133855.29801-1-p.zabel@pengutronix.de/

regards
Philipp

Philipp Zabel (19):
  drm/encoder: make encoder control functions optional
  drm: add drmm_encoder_alloc()
  drm/simple_kms_helper: add drmm_simple_encoder_alloc()
  drm/plane: add drmm_universal_plane_alloc()
  drm/crtc: add drmm_crtc_alloc_with_planes()
  drm/imx: dw_hdmi-imx: move initialization into probe
  drm/imx: imx-ldb: use local connector variable
  drm/imx: imx-ldb: move initialization into probe
  drm/imx: imx-tve: use local encoder and connector variables
  drm/imx: imx-tve: move initialization into probe
  drm/imx: imx-tve: use devm_clk_register
  drm/imx: parallel-display: use local bridge and connector variables
  drm/imx: parallel-display: move initialization into probe
  drm/imx: dw_hdmi-imx: use drm managed resources
  drm/imx: imx-ldb: use drm managed resources
  drm/imx: imx-tve: use drm managed resources
  drm/imx: parallel-display: use drm managed resources
  drm/imx: ipuv3-plane: use drm managed resources
  drm/imx: ipuv3-crtc: use drm managed resources

 drivers/gpu/drm/drm_crtc.c              | 116 ++++++++++++++++-----
 drivers/gpu/drm/drm_encoder.c           | 105 ++++++++++++++-----
 drivers/gpu/drm/drm_mode_config.c       |   5 +-
 drivers/gpu/drm/drm_plane.c             | 126 +++++++++++++++++------
 drivers/gpu/drm/drm_simple_kms_helper.c |   9 ++
 drivers/gpu/drm/imx/dw_hdmi-imx.c       |  95 ++++++++---------
 drivers/gpu/drm/imx/imx-ldb.c           | 109 +++++++++++---------
 drivers/gpu/drm/imx/imx-tve.c           | 109 ++++++++++----------
 drivers/gpu/drm/imx/ipuv3-crtc.c        | 131 ++++++++----------------
 drivers/gpu/drm/imx/ipuv3-plane.c       |  69 ++++++-------
 drivers/gpu/drm/imx/ipuv3-plane.h       |   3 -
 drivers/gpu/drm/imx/parallel-display.c  |  91 ++++++++--------
 include/drm/drm_crtc.h                  |  33 ++++++
 include/drm/drm_encoder.h               |  32 +++++-
 include/drm/drm_plane.h                 |  42 ++++++++
 include/drm/drm_simple_kms_helper.h     |  24 +++++
 16 files changed, 684 insertions(+), 415 deletions(-)

Comments

Philipp Zabel Dec. 8, 2020, 3:59 p.m. UTC | #1
On Tue, 2020-12-08 at 16:54 +0100, Philipp Zabel wrote:
> Hi,
> 
> this is an update of the drmm_(simple_)encoder_alloc(),
> drmm_universal_plane_alloc(), and drmm_crtc_alloc_with_plane()
> functions in v3 [1] together with the imx-drm managed allocation
> conversion from [2] as an example usage.
> a bit.
  ^^^^^^
this is a left-over of ", reordered an squashed a bit." before I decided
to move it into the list of changes below.

> 
> Changes since v3:
[...]
>  - Reorder and squash the imx-drm managed allocation conversion patches
>    to use the new functions directly.

regards
Philipp
Daniel Vetter Dec. 9, 2020, 9:10 p.m. UTC | #2
On Tue, Dec 08, 2020 at 04:59:16PM +0100, Philipp Zabel wrote:
> On Tue, 2020-12-08 at 16:54 +0100, Philipp Zabel wrote:
> > Hi,
> > 
> > this is an update of the drmm_(simple_)encoder_alloc(),
> > drmm_universal_plane_alloc(), and drmm_crtc_alloc_with_plane()
> > functions in v3 [1] together with the imx-drm managed allocation
> > conversion from [2] as an example usage.
> > a bit.
>   ^^^^^^
> this is a left-over of ", reordered an squashed a bit." before I decided
> to move it into the list of changes below.
> 
> > 
> > Changes since v3:
> [...]
> >  - Reorder and squash the imx-drm managed allocation conversion patches
> >    to use the new functions directly.

imx parts all look good. One thing I spotted is that you could use
devm_drm_dev_alloc instead of drm_dev_alloc, at least my tree here doesn't
have that one yet. Feel free to add a-b: me on top of the imx patches too,
but probably not worth much :-)
-Daniel
Daniel Vetter Dec. 9, 2020, 9:13 p.m. UTC | #3
On Wed, Dec 09, 2020 at 10:10:47PM +0100, Daniel Vetter wrote:
> On Tue, Dec 08, 2020 at 04:59:16PM +0100, Philipp Zabel wrote:
> > On Tue, 2020-12-08 at 16:54 +0100, Philipp Zabel wrote:
> > > Hi,
> > > 
> > > this is an update of the drmm_(simple_)encoder_alloc(),
> > > drmm_universal_plane_alloc(), and drmm_crtc_alloc_with_plane()
> > > functions in v3 [1] together with the imx-drm managed allocation
> > > conversion from [2] as an example usage.
> > > a bit.
> >   ^^^^^^
> > this is a left-over of ", reordered an squashed a bit." before I decided
> > to move it into the list of changes below.
> > 
> > > 
> > > Changes since v3:
> > [...]
> > >  - Reorder and squash the imx-drm managed allocation conversion patches
> > >    to use the new functions directly.
> 
> imx parts all look good. One thing I spotted is that you could use
> devm_drm_dev_alloc instead of drm_dev_alloc, at least my tree here doesn't
> have that one yet. Feel free to add a-b: me on top of the imx patches too,
> but probably not worth much :-)

Oh also for merging, ack for merging through whatever tree you feel like.
Since 5.11 merge window is done already if you go through imx please make
sure to send a feature pull soon after -rc1 so it's not holding up
Laurent. Or coordinate with Laurent (and maybe others).
-Daniel
Laurent Pinchart Dec. 10, 2020, 12:19 p.m. UTC | #4
Hi Daniel,

On Wed, Dec 09, 2020 at 10:13:54PM +0100, Daniel Vetter wrote:
> On Wed, Dec 09, 2020 at 10:10:47PM +0100, Daniel Vetter wrote:
> > On Tue, Dec 08, 2020 at 04:59:16PM +0100, Philipp Zabel wrote:
> > > On Tue, 2020-12-08 at 16:54 +0100, Philipp Zabel wrote:
> > > > Hi,
> > > > 
> > > > this is an update of the drmm_(simple_)encoder_alloc(),
> > > > drmm_universal_plane_alloc(), and drmm_crtc_alloc_with_plane()
> > > > functions in v3 [1] together with the imx-drm managed allocation
> > > > conversion from [2] as an example usage.
> > > > a bit.
> > >   ^^^^^^
> > > this is a left-over of ", reordered an squashed a bit." before I decided
> > > to move it into the list of changes below.
> > > 
> > > > 
> > > > Changes since v3:
> > > [...]
> > > >  - Reorder and squash the imx-drm managed allocation conversion patches
> > > >    to use the new functions directly.
> > 
> > imx parts all look good. One thing I spotted is that you could use
> > devm_drm_dev_alloc instead of drm_dev_alloc, at least my tree here doesn't
> > have that one yet. Feel free to add a-b: me on top of the imx patches too,
> > but probably not worth much :-)
> 
> Oh also for merging, ack for merging through whatever tree you feel like.
> Since 5.11 merge window is done already if you go through imx please make
> sure to send a feature pull soon after -rc1 so it's not holding up
> Laurent. Or coordinate with Laurent (and maybe others).

I've sent my rcar-du fixes without depending on this series, to ease
backporting. I'll then submit additional cleanups using the new managed
allocators when these patches will hit the drm tree. There's thus no
need for a feature branch on my side.
Philipp Zabel Dec. 11, 2020, 10:19 a.m. UTC | #5
Hi Laurent, Daniel,

On Thu, 2020-12-10 at 14:19 +0200, Laurent Pinchart wrote:
> Hi Daniel,
> 
> On Wed, Dec 09, 2020 at 10:13:54PM +0100, Daniel Vetter wrote:
> > On Wed, Dec 09, 2020 at 10:10:47PM +0100, Daniel Vetter wrote:
> > > On Tue, Dec 08, 2020 at 04:59:16PM +0100, Philipp Zabel wrote:
> > > > On Tue, 2020-12-08 at 16:54 +0100, Philipp Zabel wrote:
> > > > > Hi,
> > > > > 
> > > > > this is an update of the drmm_(simple_)encoder_alloc(),
> > > > > drmm_universal_plane_alloc(), and drmm_crtc_alloc_with_plane()
> > > > > functions in v3 [1] together with the imx-drm managed allocation
> > > > > conversion from [2] as an example usage.
> > > > > a bit.
> > > >   ^^^^^^
> > > > this is a left-over of ", reordered an squashed a bit." before I decided
> > > > to move it into the list of changes below.
> > > > 
> > > > > Changes since v3:
> > > > [...]
> > > > >  - Reorder and squash the imx-drm managed allocation conversion patches
> > > > >    to use the new functions directly.
> > > 
> > > imx parts all look good. One thing I spotted is that you could use
> > > devm_drm_dev_alloc instead of drm_dev_alloc, at least my tree here doesn't
> > > have that one yet. Feel free to add a-b: me on top of the imx patches too,
> > > but probably not worth much :-)
> > 
> > Oh also for merging, ack for merging through whatever tree you feel like.
> > Since 5.11 merge window is done already if you go through imx please make
> > sure to send a feature pull soon after -rc1 so it's not holding up
> > Laurent.

If nobody minds, I'll do just that.

> >  Or coordinate with Laurent (and maybe others).
> 
> I've sent my rcar-du fixes without depending on this series, to ease
> backporting. I'll then submit additional cleanups using the new managed
> allocators when these patches will hit the drm tree. There's thus no
> need for a feature branch on my side.

regards
Philipp