Re: [PATCH v2] drm/msm/dpu: count the pending frame before kicking it off
From: Dmitry Baryshkov
Date: Fri Nov 27 2026 - 07:06:48 EST
On Tue, Oct 13, 2026 at 12:27:00PM -0500, Michael Burch wrote:
> dpu_crtc_commit_kickoff() increments frame_pending only after
> dpu_encoder_kickoff() has sent the frame to the hardware. If the frame
> completes before the increment, dpu_crtc_frame_event_work() sees
> frame_pending == 0 and ignores the frame-done event. The increment that
> follows is never matched, so the count stays one too high until
> dpu_crtc_disable() resets it.
>
> With frame_pending stuck at 1 or more:
>
> - dpu_encoder_resource_control(FRAME_DONE) sees a pending count above 1
> on every frame and never queues delayed_off_work. A video-mode encoder
> therefore never reaches ENTER_IDLE and keeps its vsync interrupt
> registered for as long as the display is on.
> - dpu_crtc_frame_event_work() never sees the count drop to zero, so
> dpu_core_perf_crtc_release_bw() is never called.
>
> On an X1E80100 laptop with a 120 Hz eDP panel this left the vsync
> interrupt firing 120 times a second on an idle desktop: 14,407 vblank
> callbacks against 21 commits in 120 s, with no vblank events requested
> by userspace. Every frame-done took the frame_event_more_pending path
> (591 of 591 in one trace) and the encoder never entered idle. After a
> suspend cycle reset the count, the same desktop showed 3 commits, 3
> frame_event_done, 3 encoder idle transitions and 25 MDSS interrupts in
> 60 s.
>
> Until commit ad06972d5365 ("drm/msm/dpu: Reorder encoder kickoff for
> CWB") the increment came before the kickoff. Move it back: count the
> frame in each kickoff path just before its encoders are kicked off. A
> clone-mode commit that fails its encoder lookup is then never counted.
>
> Fixes: ad06972d5365 ("drm/msm/dpu: Reorder encoder kickoff for CWB")
> Cc: stable@xxxxxxxxxxxxxxx
> Assisted-by: Copilot:claude-opus-5.5
> Signed-off-by: Michael Burch <me@xxxxxxxxxxxxxxxx>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@xxxxxxxxxxxxxxxx>
--
With best wishes
Dmitry