[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210519183855.1523927-3-robdclark@gmail.com>
Date: Wed, 19 May 2021 11:38:53 -0700
From: Rob Clark <robdclark@...il.com>
To: dri-devel@...ts.freedesktop.org
Cc: freedreno@...ts.freedesktop.org, linux-arm-msm@...r.kernel.org,
Rob Clark <robdclark@...omium.org>,
Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
Maxime Ripard <mripard@...nel.org>,
Thomas Zimmermann <tzimmermann@...e.de>,
David Airlie <airlied@...ux.ie>,
Daniel Vetter <daniel@...ll.ch>,
linux-kernel@...r.kernel.org (open list)
Subject: [RFC 2/3] drm/atomic: Call dma_fence_boost() when we've missed a vblank
From: Rob Clark <robdclark@...omium.org>
Signed-off-by: Rob Clark <robdclark@...omium.org>
---
drivers/gpu/drm/drm_atomic_helper.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
index 560aaecba31b..fe10fc2e7f86 100644
--- a/drivers/gpu/drm/drm_atomic_helper.c
+++ b/drivers/gpu/drm/drm_atomic_helper.c
@@ -1435,11 +1435,15 @@ int drm_atomic_helper_wait_for_fences(struct drm_device *dev,
int i, ret;
for_each_new_plane_in_state(state, plane, new_plane_state, i) {
+ u64 vblank_count;
+
if (!new_plane_state->fence)
continue;
WARN_ON(!new_plane_state->fb);
+ vblank_count = drm_crtc_vblank_count(new_plane_state->crtc);
+
/*
* If waiting for fences pre-swap (ie: nonblock), userspace can
* still interrupt the operation. Instead of blocking until the
@@ -1449,6 +1453,13 @@ int drm_atomic_helper_wait_for_fences(struct drm_device *dev,
if (ret)
return ret;
+ /*
+ * Check if we've missed a vblank while waiting, and if we have
+ * signal the fence that it's signaler should be boosted
+ */
+ if (vblank_count != drm_crtc_vblank_count(new_plane_state->crtc))
+ dma_fence_boost(new_plane_state->fence);
+
dma_fence_put(new_plane_state->fence);
new_plane_state->fence = NULL;
}
--
2.30.2
Powered by blists - more mailing lists