From: "Borah, Chaitanya Kumar" <chaitanya.kumar.borah@intel.com>
To: Nemesa Garg <nemesa.garg@intel.com>,
<intel-gfx@lists.freedesktop.org>,
<intel-xe@lists.freedesktop.org>
Subject: Re: [PATCH 4/6] drm/i915/cursor: Program secondary cursor planes
Date: Wed, 29 Jul 2026 21:00:33 +0530 [thread overview]
Message-ID: <ce5db027-682a-4ea7-9b1f-56d2fe024f65@intel.com> (raw)
In-Reply-To: <20260706115629.2984258-5-nemesa.garg@intel.com>
On 7/6/2026 5:26 PM, Nemesa Garg wrote:
> Iterate over all joined pipes when arming/disabling the cursor plane so
> secondary pipes are updated together with the primary. The pin, check
> and state duplication for secondary pipes was already prepared in the
> previous commit; this converts the update_arm pass to a loop over the
> joined[] array.
>
> Because the whole loop runs inside a single primary vblank-evade,
> sample intel_crtc_get_vblank_counter() per pipe around each arm and
> emit a drm_err() if the counter ticks during that pipe's own
> programming.
>
> v2: Check primary and secondary pipe together. [Ville]
> v3: Use struct intel_cursor_pipe. [Ville]
> v4: Add per-pipe vblank straddle detection around the arm loop. [Chaitanya]
>
> Assisted-by: Claude:claude-sonnet-4.6
> Signed-off-by: Nemesa Garg <nemesa.garg@intel.com>
> ---
> drivers/gpu/drm/i915/display/intel_cursor.c | 26 +++++++++++++++++----
> 1 file changed, 21 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_cursor.c b/drivers/gpu/drm/i915/display/intel_cursor.c
> index fad5d5302b36..65e1fa60a606 100644
> --- a/drivers/gpu/drm/i915/display/intel_cursor.c
> +++ b/drivers/gpu/drm/i915/display/intel_cursor.c
> @@ -1039,11 +1039,27 @@ intel_legacy_cursor_update(struct drm_plane *_plane,
> local_irq_disable();
> }
>
> - if (new_plane_state->uapi.visible) {
> - intel_plane_update_noarm(NULL, plane, crtc_state, new_plane_state);
> - intel_plane_update_arm(NULL, plane, crtc_state, new_plane_state);
> - } else {
> - intel_plane_disable_arm(NULL, plane, crtc_state);
> + for (int i = 0; i < num_pipes; i++) {
> + u32 start_vbl_count = intel_crtc_get_vblank_counter(joined[i].crtc);
> + u32 end_vbl_count;
> +
> + if (joined[i].new_plane_state->uapi.visible) {
> + intel_plane_update_noarm(NULL, joined[i].plane,
> + joined[i].crtc_state,
> + joined[i].new_plane_state);
> + intel_plane_update_arm(NULL, joined[i].plane,
> + joined[i].crtc_state,
> + joined[i].new_plane_state);
> + } else {
> + intel_plane_disable_arm(NULL, joined[i].plane, joined[i].crtc_state);
> + }
> +
> + end_vbl_count = intel_crtc_get_vblank_counter(joined[i].crtc);
> + if (start_vbl_count != end_vbl_count)
> + drm_err(display->drm,
> + "Atomic update failure on pipe %c (start=%u end=%u)\n",
> + pipe_name(joined[i].crtc->pipe),
> + start_vbl_count, end_vbl_count);
The straddling logic should be outside the for loop. We want to make
sure all the updates went in the same frame. Not that write to each pipe
is done within the same frame.
Assuming that joiner pipes are always in sync, sampling the frame count
only from the primary pipe should be enough. Please call this out in a
comment - this and also that the evasion logic also depends on the
primary pipe.
Also no log printing when IRQs are disabled. It extends the period IRQs
are off and will make a straddle, if any, even worse.
> }
>
> local_irq_enable();
next prev parent reply other threads:[~2026-07-29 15:30 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-06 11:56 [PATCH 0/6] Enable joiner cursor fast updates Nemesa Garg
2026-07-06 11:56 ` [PATCH 1/6] drm/i915/cursor: Check joiner cursor commit status Nemesa Garg
2026-07-29 15:28 ` Borah, Chaitanya Kumar
2026-07-06 11:56 ` [PATCH 2/6] drm/i915/cursor: Add helper to update cursor plane Nemesa Garg
2026-07-06 11:56 ` [PATCH 3/6] drm/i915/cursor: Handle secondary cursor state Nemesa Garg
2026-07-29 15:29 ` Borah, Chaitanya Kumar
2026-07-06 11:56 ` [PATCH 4/6] drm/i915/cursor: Program secondary cursor planes Nemesa Garg
2026-07-29 15:30 ` Borah, Chaitanya Kumar [this message]
2026-07-06 11:56 ` [PATCH 5/6] drm/i915/cursor: Schedule cursor unpin per joined pipe Nemesa Garg
2026-07-06 11:56 ` [PATCH 6/6] drm/i915/cursor: Allow joiner cursor fast path update Nemesa Garg
2026-07-06 19:09 ` ✓ i915.CI.BAT: success for Enable joiner cursor fast updates (rev4) Patchwork
2026-07-07 0:20 ` ✗ i915.CI.Full: failure " Patchwork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ce5db027-682a-4ea7-9b1f-56d2fe024f65@intel.com \
--to=chaitanya.kumar.borah@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=nemesa.garg@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox