drm/msm/dpu: do not limit the zpos property
authorDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Wed, 9 Feb 2022 17:24:57 +0000 (20:24 +0300)
committerRob Clark <robdclark@chromium.org>
Sun, 18 Sep 2022 16:38:03 +0000 (09:38 -0700)
Stop limiting zpos property values, we use normalized_zpos anyway. And
nothing stops userspace from assigning several planes to a single zpos
(it is a userspace bug, but the kernel is forgiving about it).

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Patchwork: https://patchwork.freedesktop.org/patch/473147/
Link: https://lore.kernel.org/r/20220209172520.3719906-3-dmitry.baryshkov@linaro.org
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Rob Clark <robdclark@chromium.org>
drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c

index c7c1360462a77abc53c7b3d126989ec254bb6280..5135200ce1325188aee897d67e85b17376f962a8 100644 (file)
@@ -1478,7 +1478,6 @@ struct drm_plane *dpu_plane_init(struct drm_device *dev,
        struct dpu_plane *pdpu;
        struct msm_drm_private *priv = dev->dev_private;
        struct dpu_kms *kms = to_dpu_kms(priv->kms);
-       int zpos_max = DPU_ZPOS_MAX;
        uint32_t num_formats;
        uint32_t supported_rotations;
        int ret = -EINVAL;
@@ -1517,14 +1516,7 @@ struct drm_plane *dpu_plane_init(struct drm_device *dev,
 
        pdpu->catalog = kms->catalog;
 
-       if (kms->catalog->mixer_count &&
-               kms->catalog->mixer[0].sblk->maxblendstages) {
-               zpos_max = kms->catalog->mixer[0].sblk->maxblendstages - 1;
-               if (zpos_max > DPU_STAGE_MAX - DPU_STAGE_0 - 1)
-                       zpos_max = DPU_STAGE_MAX - DPU_STAGE_0 - 1;
-       }
-
-       ret = drm_plane_create_zpos_property(plane, 0, 0, zpos_max);
+       ret = drm_plane_create_zpos_property(plane, 0, 0, DPU_ZPOS_MAX);
        if (ret)
                DPU_ERROR("failed to install zpos property, rc = %d\n", ret);