summaryrefslogtreecommitdiff
path: root/samsung/exynos_drm_fb.c
diff options
context:
space:
mode:
authorAdrian Salido <salidoa@google.com>2021-05-18 14:58:41 -0700
committerTreeHugger Robot <treehugger-gerrit@google.com>2021-05-20 04:21:28 +0000
commit75ee1d99945716f435208b4cedab4415d7d3eca0 (patch)
treefb7497bdfd44bbbf7f7cabc3259da7a83974f41a /samsung/exynos_drm_fb.c
parent3e485340791fbcf204c14d9d4aa84c14bba833cd (diff)
downloaddisplay-75ee1d99945716f435208b4cedab4415d7d3eca0.tar.gz
drm: samsung: signal commit event on frame start
Currently commit event armed right after flush and signaled during vsync. This could incorrectly signal if vblank interrupt was pending while arming it. In order to guarantee commit done is signaled only if framebuffer is being fetched, we should wait until frame start interrupt from DECON in order to signal this event. Bug: 187993550 Signed-off-by: Adrian Salido <salidoa@google.com> Change-Id: Iccd247d7d6390845cb65673ffeaab45410f17346
Diffstat (limited to 'samsung/exynos_drm_fb.c')
-rw-r--r--samsung/exynos_drm_fb.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/samsung/exynos_drm_fb.c b/samsung/exynos_drm_fb.c
index 6ce9657..a860bcf 100644
--- a/samsung/exynos_drm_fb.c
+++ b/samsung/exynos_drm_fb.c
@@ -560,8 +560,9 @@ static void exynos_atomic_commit_tail(struct drm_atomic_state *old_state)
}
}
- for_each_new_crtc_in_state(old_state, crtc, new_crtc_state, i) {
+ for_each_oldnew_crtc_in_state(old_state, crtc, old_crtc_state, new_crtc_state, i) {
struct decon_mode *mode;
+ struct drm_crtc_commit *commit = new_crtc_state->commit;
int fps;
decon = crtc_to_decon(crtc);
@@ -569,20 +570,21 @@ static void exynos_atomic_commit_tail(struct drm_atomic_state *old_state)
if (!new_crtc_state->active)
continue;
+ if (WARN_ON(!commit))
+ continue;
+
fps = drm_mode_vrefresh(&new_crtc_state->mode);
if (old_crtc_state->active)
fps = min(fps, drm_mode_vrefresh(&old_crtc_state->mode));
- DPU_ATRACE_BEGIN("wait_for_frame_start");
- if (!wait_for_completion_timeout(&decon->framestart_done,
- fps_timeout(fps))) {
- DPU_EVENT_LOG(DPU_EVT_FRAMESTART_TIMEOUT,
- decon->id, NULL);
+ DPU_ATRACE_BEGIN("wait_for_crtc_flip");
+ if (!wait_for_completion_timeout(&commit->flip_done, fps_timeout(fps))) {
+ DPU_EVENT_LOG(DPU_EVT_FRAMESTART_TIMEOUT, decon->id, NULL);
pr_warn("decon%u framestart timeout (%d fps)\n",
decon->id, fps);
decon_dump_all(decon);
}
- DPU_ATRACE_END("wait_for_frame_start");
+ DPU_ATRACE_END("wait_for_crtc_flip");
mode = &decon->config.mode;
if (mode->op_mode == DECON_COMMAND_MODE && !decon->keep_unmask) {