summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Tretter <m.tretter@pengutronix.de>2026-02-19 14:32:58 +0300
committerPhilipp Zabel <p.zabel@pengutronix.de>2026-03-13 18:27:06 +0300
commitecbcceea4767dc11881986cb41a9962cac6f6c39 (patch)
tree83dc7cc27e1488082a25daff0e366bfa371b3b67
parenta872e90e3668f9f8d0bc9c2fae3c328835b98bf0 (diff)
downloadlinux-ecbcceea4767dc11881986cb41a9962cac6f6c39.tar.xz
drm/imx: ipuv3-plane: support underlay plane
The IPUv3 overlay plane may be placed over or under the primary plane. Set the zpos of the primary to an immutable position of 1 to have the possibility to place the other plane underneath it. Set the zpos of other planes (the overlay plane) to a mutable value between 0 (the lowest possible value of a zpos) and directly above the primary plane with the latter being the default. Signed-off-by: Michael Tretter <m.tretter@pengutronix.de> Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Link: https://patch.msgid.link/20260219-drm-imx-underlay-plane-v2-2-26ef829c5483@pengutronix.de
-rw-r--r--drivers/gpu/drm/imx/ipuv3/ipuv3-plane.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/drivers/gpu/drm/imx/ipuv3/ipuv3-plane.c b/drivers/gpu/drm/imx/ipuv3/ipuv3-plane.c
index ff483089b26b..c1c7be4e26c6 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;
@@ -923,17 +923,16 @@ struct ipu_plane *ipu_plane_init(struct drm_device *dev, struct ipu_soc *ipu,
ipu_plane->dma = dma;
ipu_plane->dp_flow = dp;
- if (type == DRM_PLANE_TYPE_PRIMARY)
+ if (type == DRM_PLANE_TYPE_PRIMARY) {
drm_plane_helper_add(&ipu_plane->base, &ipu_primary_plane_helper_funcs);
- 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);
- else
ret = drm_plane_create_zpos_immutable_property(&ipu_plane->base,
- 0);
+ primary_zpos);
+ } else {
+ drm_plane_helper_add(&ipu_plane->base, &ipu_plane_helper_funcs);
+ ret = drm_plane_create_zpos_property(&ipu_plane->base,
+ primary_zpos + 1, 0,
+ primary_zpos + 1);
+ }
if (ret)
return ERR_PTR(ret);