[PATCH 10/12] drm/i915: Complete no-op "async flips" by hand
Ville Syrjala
ville.syrjala at linux.intel.com
Mon Nov 16 01:11:28 PST 2026
From: Ville Syrjälä <ville.syrjala at linux.intel.com>
If no planes appear in an async flip commit there will be
no flip done interrupt. Complete the commit by hand in
that case. Shouldn't really matter where we do this exactly,
but just before the wait stuff near the end of the commit
seems reasonable.
This can't happen via the legacy page flip ioctl path,
but nothing prevents fully no-op (as far as planes are
concerned) "async flips" via the atomic ioctl.
TODO: igt tests for atomic+async uapi don't really exist :(
Cc: amd-gfx at lists.freedesktop.org
Cc: André Almeida <andrealmeid at igalia.com>
Cc: Boris Brezillon <bbrezillon at kernel.org>
Cc: Christopher Snowhill <chris at kode54.net>
Cc: Dave Stevenson <dave.stevenson at raspberrypi.com>
Cc: Dharma Balasubiramani <dharma.b at microchip.com>
Cc: Dmitry Baryshkov <lumag at kernel.org>
Cc: freedreno at lists.freedesktop.org
Cc: Gustavo Padovan <gustavo.padovan at collabora.com>
Cc: Huacai Chen <chenhuacai at kernel.org>
Cc: Icenowy Zheng <zhengxingda at iscas.ac.cn>
Cc: intel-gfx at lists.freedesktop.org
Cc: intel-xe at lists.freedesktop.org
Cc: Jianmin Lv <lvjianmin at loongson.cn>
Cc: linux-arm-msm at vger.kernel.org
Cc: linux-mediatek at lists.infradead.org
Cc: linux-rockchip at lists.infradead.org
Cc: linux-tegra at vger.kernel.org
Cc: Liviu Dudau <liviu.dudau at arm.com>
Cc: Maíra Canal <mcanal at igalia.com>
Cc: Manikandan Muralidharan <manikandan.m at microchip.com>
Cc: Maxime Ripard <mripard at kernel.org>
Cc: Mingcong Bai <jeffbai at aosc.io>
Cc: nouveau at lists.freedesktop.org
Cc: Qianhai Wu <wuqianhai at loongson.cn>
Cc: Raspberry Pi Kernel Maintenance <kernel-list at raspberrypi.com>
Cc: Simon Ser <contact at emersion.fr>
Cc: wayland-devel at lists.freedesktop.org
Cc: Xaver Hugl <xaver.hugl at kde.org>
Cc: Xi Ruoyao <xry111 at xry111.site>
Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
---
drivers/gpu/drm/i915/display/intel_display.c | 38 ++++++++++++++++++++
1 file changed, 38 insertions(+)
diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
index f4d9148efde3..afaaf3fc4646 100644
--- a/drivers/gpu/drm/i915/display/intel_display.c
+++ b/drivers/gpu/drm/i915/display/intel_display.c
@@ -1190,6 +1190,42 @@ static void intel_crtc_disable_flip_done(struct intel_atomic_state *state,
}
}
+static void intel_crtc_complete_noop_async_flip(struct intel_crtc_state *crtc_state)
+{
+ struct intel_display *display = to_intel_display(crtc_state);
+ struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
+
+ if (!crtc_state->do_async_flip)
+ return;
+
+ /*
+ * If there are planes actually performing the async flip then
+ * the commit will be completed via the flip done interrupt
+ * handler. For a fully no-op "async flip" the commit must
+ * be completed by hand as no interrupt will be raised.
+ */
+ if (crtc_state->update_planes)
+ return;
+
+ if (crtc_state->uapi.event) {
+ spin_lock_irq(&display->drm->event_lock);
+ drm_crtc_send_vblank_event(&crtc->base,
+ crtc_state->uapi.event);
+ spin_unlock_irq(&display->drm->event_lock);
+
+ crtc_state->uapi.event = NULL;
+ }
+}
+
+static void intel_atomic_complete_noop_async_flips(struct intel_atomic_state *state)
+{
+ struct intel_crtc_state *new_crtc_state;
+ struct intel_crtc *crtc;
+
+ for_each_new_intel_crtc_in_state(state, crtc, new_crtc_state)
+ intel_crtc_complete_noop_async_flip(new_crtc_state);
+}
+
static void intel_crtc_async_flip_disable_wa(struct intel_atomic_state *state,
struct intel_crtc *crtc)
{
@@ -7852,6 +7888,8 @@ static void intel_atomic_commit_tail(struct intel_atomic_state *state)
if (intel_display_power_dc3co_allowed(display))
intel_cmtg_program(state);
+ intel_atomic_complete_noop_async_flips(state);
+
intel_wait_for_vblank_workers(state);
/* FIXME: We should call drm_atomic_helper_commit_hw_done() here
--
2.56.0
More information about the Linux-rockchip
mailing list