public inbox for imx@lists.linux.dev
 help / color / mirror / Atom feed
* [PATCH 0/2] drm/imx: ipuv3-plane: support underlay plane
@ 2026-02-16 12:44 Michael Tretter
  2026-02-16 12:44 ` [PATCH 1/2] drm/imx: ipuv3-plane: decouple zpos from plane type Michael Tretter
  2026-02-16 12:44 ` [PATCH 2/2] drm/imx: ipuv3-plane: support underlay plane Michael Tretter
  0 siblings, 2 replies; 6+ messages in thread
From: Michael Tretter @ 2026-02-16 12:44 UTC (permalink / raw)
  To: Philipp Zabel, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Shawn Guo,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam
  Cc: dri-devel, imx, linux-arm-kernel, Michael Tretter

The IPUv3 overlay plane may be placed over or under the primary plane.
This series allows user space tools to properly detect that the overlay
plane may be used as an underlay.

The first patch removes the assumption that the primary plane has the
default zpos 0 and the overlay plane has zpos 1. This allows changing
the zpos more freely.

The second patch changes the default zpos of the planes. The primary
plane always has the fixed zpos 1, which allows the overlay plane with
zpos 0 to 2 to be placed relative to this fixed primary plane.

Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
---
Michael Tretter (2):
      drm/imx: ipuv3-plane: decouple zpos from plane type
      drm/imx: ipuv3-plane: support underlay plane

 drivers/gpu/drm/imx/ipuv3/ipuv3-plane.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)
---
base-commit: 20e0c197802c545db220157fafd567a10f2b7672
change-id: 20260216-drm-imx-underlay-plane-460cbc9dd3ca

Best regards,
-- 
Michael Tretter <m.tretter@pengutronix.de>


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/2] drm/imx: ipuv3-plane: decouple zpos from plane type
  2026-02-16 12:44 [PATCH 0/2] drm/imx: ipuv3-plane: support underlay plane Michael Tretter
@ 2026-02-16 12:44 ` Michael Tretter
  2026-02-16 13:18   ` Philipp Zabel
  2026-02-16 12:44 ` [PATCH 2/2] drm/imx: ipuv3-plane: support underlay plane Michael Tretter
  1 sibling, 1 reply; 6+ messages in thread
From: Michael Tretter @ 2026-02-16 12:44 UTC (permalink / raw)
  To: Philipp Zabel, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Shawn Guo,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam
  Cc: dri-devel, imx, linux-arm-kernel, Michael Tretter

The overlay plane may be placed over or under the primary plane. Using
zpos to determine, if the plane is the primary or overlay plane is not
valid anymore.

Use the plane type for determining the name of the plane in the error
message.

Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
---
 drivers/gpu/drm/imx/ipuv3/ipuv3-plane.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/imx/ipuv3/ipuv3-plane.c b/drivers/gpu/drm/imx/ipuv3/ipuv3-plane.c
index db50eccea0ca..dfd036f3195e 100644
--- a/drivers/gpu/drm/imx/ipuv3/ipuv3-plane.c
+++ b/drivers/gpu/drm/imx/ipuv3/ipuv3-plane.c
@@ -915,7 +915,7 @@ struct ipu_plane *ipu_plane_init(struct drm_device *dev, struct ipu_soc *ipu,
 					       type, NULL);
 	if (IS_ERR(ipu_plane)) {
 		DRM_ERROR("failed to allocate and initialize %s plane\n",
-			  zpos ? "overlay" : "primary");
+			  (type == DRM_PLANE_TYPE_PRIMARY) ? "primary" : "overlay");
 		return ipu_plane;
 	}
 
@@ -949,7 +949,7 @@ struct ipu_plane *ipu_plane_init(struct drm_device *dev, struct ipu_soc *ipu,
 	ret = ipu_plane_get_resources(dev, ipu_plane);
 	if (ret) {
 		DRM_ERROR("failed to get %s plane resources: %pe\n",
-			  zpos ? "overlay" : "primary", &ret);
+			  (type == DRM_PLANE_TYPE_PRIMARY) ? "primary" : "overlay", &ret);
 		return ERR_PTR(ret);
 	}
 

-- 
2.47.3


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/2] drm/imx: ipuv3-plane: support underlay plane
  2026-02-16 12:44 [PATCH 0/2] drm/imx: ipuv3-plane: support underlay plane Michael Tretter
  2026-02-16 12:44 ` [PATCH 1/2] drm/imx: ipuv3-plane: decouple zpos from plane type Michael Tretter
@ 2026-02-16 12:44 ` Michael Tretter
  2026-02-16 13:18   ` Philipp Zabel
  1 sibling, 1 reply; 6+ messages in thread
From: Michael Tretter @ 2026-02-16 12:44 UTC (permalink / raw)
  To: Philipp Zabel, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Shawn Guo,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam
  Cc: dri-devel, imx, linux-arm-kernel, Michael Tretter

The IPUv3 overlay plane may be placed over or under the primary plane.
Use an immutable position of 1 for the primary plane and a mutable
position including 0 and 2 for the overlay plane, to allow placing the
overlay plane over and under the primary plane.

Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
---
 drivers/gpu/drm/imx/ipuv3/ipuv3-plane.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/imx/ipuv3/ipuv3-plane.c b/drivers/gpu/drm/imx/ipuv3/ipuv3-plane.c
index dfd036f3195e..ddad5ea92aad 100644
--- a/drivers/gpu/drm/imx/ipuv3/ipuv3-plane.c
+++ b/drivers/gpu/drm/imx/ipuv3/ipuv3-plane.c
@@ -890,7 +890,7 @@ struct ipu_plane *ipu_plane_init(struct drm_device *dev, struct ipu_soc *ipu,
 {
 	struct ipu_plane *ipu_plane;
 	const uint64_t *modifiers = ipu_format_modifiers;
-	unsigned int zpos = (type == DRM_PLANE_TYPE_PRIMARY) ? 0 : 1;
+	unsigned int primary_zpos = 1;
 	unsigned int format_count;
 	const uint32_t *formats;
 	int ret;
@@ -928,12 +928,14 @@ struct ipu_plane *ipu_plane_init(struct drm_device *dev, struct ipu_soc *ipu,
 	else
 		drm_plane_helper_add(&ipu_plane->base, &ipu_plane_helper_funcs);
 
-	if (dp == IPU_DP_FLOW_SYNC_BG || dp == IPU_DP_FLOW_SYNC_FG)
-		ret = drm_plane_create_zpos_property(&ipu_plane->base, zpos, 0,
-						     1);
+	if ((dp == IPU_DP_FLOW_SYNC_BG || dp == IPU_DP_FLOW_SYNC_FG) &&
+	    type != DRM_PLANE_TYPE_PRIMARY)
+		ret = drm_plane_create_zpos_property(&ipu_plane->base,
+						     primary_zpos + 1, 0,
+						     primary_zpos + 1);
 	else
 		ret = drm_plane_create_zpos_immutable_property(&ipu_plane->base,
-							       0);
+							       primary_zpos);
 	if (ret)
 		return ERR_PTR(ret);
 

-- 
2.47.3


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] drm/imx: ipuv3-plane: support underlay plane
  2026-02-16 12:44 ` [PATCH 2/2] drm/imx: ipuv3-plane: support underlay plane Michael Tretter
@ 2026-02-16 13:18   ` Philipp Zabel
  2026-02-19 11:05     ` Michael Tretter
  0 siblings, 1 reply; 6+ messages in thread
From: Philipp Zabel @ 2026-02-16 13:18 UTC (permalink / raw)
  To: Michael Tretter, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Shawn Guo,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam
  Cc: dri-devel, imx, linux-arm-kernel

On Mo, 2026-02-16 at 13:44 +0100, Michael Tretter wrote:
> The IPUv3 overlay plane may be placed over or under the primary plane.
> Use an immutable position of 1 for the primary plane and a mutable
> position including 0 and 2 for the overlay plane, to allow placing the
> overlay plane over and under the primary plane.
> 
> Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
> ---
>  drivers/gpu/drm/imx/ipuv3/ipuv3-plane.c | 12 +++++++-----
>  1 file changed, 7 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/imx/ipuv3/ipuv3-plane.c b/drivers/gpu/drm/imx/ipuv3/ipuv3-plane.c
> index dfd036f3195e..ddad5ea92aad 100644
> --- a/drivers/gpu/drm/imx/ipuv3/ipuv3-plane.c
> +++ b/drivers/gpu/drm/imx/ipuv3/ipuv3-plane.c
> @@ -890,7 +890,7 @@ struct ipu_plane *ipu_plane_init(struct drm_device *dev, struct ipu_soc *ipu,
>  {
>  	struct ipu_plane *ipu_plane;
>  	const uint64_t *modifiers = ipu_format_modifiers;
> -	unsigned int zpos = (type == DRM_PLANE_TYPE_PRIMARY) ? 0 : 1;
> +	unsigned int primary_zpos = 1;
>  	unsigned int format_count;
>  	const uint32_t *formats;
>  	int ret;
> @@ -928,12 +928,14 @@ struct ipu_plane *ipu_plane_init(struct drm_device *dev, struct ipu_soc *ipu,
>  	else
>  		drm_plane_helper_add(&ipu_plane->base, &ipu_plane_helper_funcs);
>  
> -	if (dp == IPU_DP_FLOW_SYNC_BG || dp == IPU_DP_FLOW_SYNC_FG)
> -		ret = drm_plane_create_zpos_property(&ipu_plane->base, zpos, 0,
> -						     1);
> +	if ((dp == IPU_DP_FLOW_SYNC_BG || dp == IPU_DP_FLOW_SYNC_FG) &&

These checks is not necessary anymore. The only overlay plane is (dp ==
IPU_DP_FLOW_SYNC_FG).


regards
Philipp

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] drm/imx: ipuv3-plane: decouple zpos from plane type
  2026-02-16 12:44 ` [PATCH 1/2] drm/imx: ipuv3-plane: decouple zpos from plane type Michael Tretter
@ 2026-02-16 13:18   ` Philipp Zabel
  0 siblings, 0 replies; 6+ messages in thread
From: Philipp Zabel @ 2026-02-16 13:18 UTC (permalink / raw)
  To: Michael Tretter, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Shawn Guo,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam
  Cc: dri-devel, imx, linux-arm-kernel

On Mo, 2026-02-16 at 13:44 +0100, Michael Tretter wrote:
> The overlay plane may be placed over or under the primary plane. Using
> zpos to determine, if the plane is the primary or overlay plane is not
> valid anymore.
> 
> Use the plane type for determining the name of the plane in the error
> message.
> 
> Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>

Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] drm/imx: ipuv3-plane: support underlay plane
  2026-02-16 13:18   ` Philipp Zabel
@ 2026-02-19 11:05     ` Michael Tretter
  0 siblings, 0 replies; 6+ messages in thread
From: Michael Tretter @ 2026-02-19 11:05 UTC (permalink / raw)
  To: Philipp Zabel
  Cc: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
	Simona Vetter, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, dri-devel, imx, linux-arm-kernel

On Mon, 16 Feb 2026 14:18:41 +0100, Philipp Zabel wrote:
> On Mo, 2026-02-16 at 13:44 +0100, Michael Tretter wrote:
> > The IPUv3 overlay plane may be placed over or under the primary plane.
> > Use an immutable position of 1 for the primary plane and a mutable
> > position including 0 and 2 for the overlay plane, to allow placing the
> > overlay plane over and under the primary plane.
> > 
> > Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
> > ---
> >  drivers/gpu/drm/imx/ipuv3/ipuv3-plane.c | 12 +++++++-----
> >  1 file changed, 7 insertions(+), 5 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/imx/ipuv3/ipuv3-plane.c b/drivers/gpu/drm/imx/ipuv3/ipuv3-plane.c
> > index dfd036f3195e..ddad5ea92aad 100644
> > --- a/drivers/gpu/drm/imx/ipuv3/ipuv3-plane.c
> > +++ b/drivers/gpu/drm/imx/ipuv3/ipuv3-plane.c
> > @@ -890,7 +890,7 @@ struct ipu_plane *ipu_plane_init(struct drm_device *dev, struct ipu_soc *ipu,
> >  {
> >  	struct ipu_plane *ipu_plane;
> >  	const uint64_t *modifiers = ipu_format_modifiers;
> > -	unsigned int zpos = (type == DRM_PLANE_TYPE_PRIMARY) ? 0 : 1;
> > +	unsigned int primary_zpos = 1;
> >  	unsigned int format_count;
> >  	const uint32_t *formats;
> >  	int ret;
> > @@ -928,12 +928,14 @@ struct ipu_plane *ipu_plane_init(struct drm_device *dev, struct ipu_soc *ipu,
> >  	else
> >  		drm_plane_helper_add(&ipu_plane->base, &ipu_plane_helper_funcs);
> >  
> > -	if (dp == IPU_DP_FLOW_SYNC_BG || dp == IPU_DP_FLOW_SYNC_FG)
> > -		ret = drm_plane_create_zpos_property(&ipu_plane->base, zpos, 0,
> > -						     1);
> > +	if ((dp == IPU_DP_FLOW_SYNC_BG || dp == IPU_DP_FLOW_SYNC_FG) &&
> 
> These checks is not necessary anymore. The only overlay plane is (dp ==
> IPU_DP_FLOW_SYNC_FG).

Thanks! That's even better. I'll simplify the check in v2.

Michael

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-02-19 11:05 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-16 12:44 [PATCH 0/2] drm/imx: ipuv3-plane: support underlay plane Michael Tretter
2026-02-16 12:44 ` [PATCH 1/2] drm/imx: ipuv3-plane: decouple zpos from plane type Michael Tretter
2026-02-16 13:18   ` Philipp Zabel
2026-02-16 12:44 ` [PATCH 2/2] drm/imx: ipuv3-plane: support underlay plane Michael Tretter
2026-02-16 13:18   ` Philipp Zabel
2026-02-19 11:05     ` Michael Tretter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox