]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
drm/msm/dpu: Fix scale params in plane validation
authorKalyan Thota <kalyan_t@codeaurora.org>
Thu, 30 Jul 2020 13:38:56 +0000 (19:08 +0530)
committerRob Clark <robdclark@chromium.org>
Mon, 17 Aug 2020 19:23:47 +0000 (12:23 -0700)
Plane validation uses an API drm_calc_scale which will
return src/dst value as a scale ratio.

when viewing the range on a scale the values should fall in as

Upscale ratio < Unity scale < Downscale ratio for src/dst formula

Fix the min and max scale ratios to suit the API accordingly.

Signed-off-by: Kalyan Thota <kalyan_t@codeaurora.org>
Tested-by: Kristian H. Kristensen <hoegsberg@google.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Signed-off-by: Rob Clark <robdclark@chromium.org>
drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c

index 33f6c56f01edac0172b6964b4f778e1bf872b762..29e373d2e7b5dcb08c36ae41e0d615108ccf6ea4 100644 (file)
@@ -866,9 +866,9 @@ static int dpu_plane_atomic_check(struct drm_plane *plane,
                crtc_state = drm_atomic_get_new_crtc_state(state->state,
                                                           state->crtc);
 
-       min_scale = FRAC_16_16(1, pdpu->pipe_sblk->maxdwnscale);
+       min_scale = FRAC_16_16(1, pdpu->pipe_sblk->maxupscale);
        ret = drm_atomic_helper_check_plane_state(state, crtc_state, min_scale,
-                                         pdpu->pipe_sblk->maxupscale << 16,
+                                         pdpu->pipe_sblk->maxdwnscale << 16,
                                          true, true);
        if (ret) {
                DPU_DEBUG_PLANE(pdpu, "Check plane state failed (%d)\n", ret);