drm/msm/disp/dpu1: fix display underruns during modeset.
authorKalyan Thota <kalyan_t@codeaurora.org>
Fri, 19 Mar 2021 12:54:06 +0000 (05:54 -0700)
committerRob Clark <robdclark@chromium.org>
Fri, 9 Apr 2021 19:02:35 +0000 (12:02 -0700)
During crtc disable, display perf structures are reset to 0
which includes state varibles which are immutable. On crtc
enable, we use the same structures and they don't refelect
the actual values

1) Fix is to avoid updating the state structures during disable.
2) Reset the perf structures during atomic check when there is no
modeset enable.

Signed-off-by: Kalyan Thota <kalyan_t@codeaurora.org>
Reported-by: Stephen Boyd <swboyd@chromium.org>
Tested-by: Douglas Anderson <dianders@chromium.org>
Link: https://lore.kernel.org/r/1616158446-19290-1-git-send-email-kalyan_t@codeaurora.org
Signed-off-by: Rob Clark <robdclark@chromium.org>
drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c
drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c

index b6b3bbab03336ec81e680ea0a8bb4d23f8a3a822..7cba5bbdf4b7addd2baf382b4281648997968abb 100644 (file)
@@ -380,7 +380,6 @@ int dpu_core_perf_crtc_update(struct drm_crtc *crtc,
        } else {
                DPU_DEBUG("crtc=%d disable\n", crtc->base.id);
                memset(old, 0, sizeof(*old));
-               memset(new, 0, sizeof(*new));
                update_bus = true;
                update_clk = true;
        }
index 8602b8507ec5054e32f9a8de17379fa3c34a40e0..5a74f93e29da51033e037ca8c902bd27aab537a9 100644 (file)
@@ -923,6 +923,7 @@ static int dpu_crtc_atomic_check(struct drm_crtc *crtc,
                DPU_DEBUG("crtc%d -> enable %d, active %d, skip atomic_check\n",
                                crtc->base.id, crtc_state->enable,
                                crtc_state->active);
+               memset(&cstate->new_perf, 0, sizeof(cstate->new_perf));
                goto end;
        }