Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
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: Thu, 27 Aug 2026 15:16:20 +0530	[thread overview]
Message-ID: <b98de383-e076-47d4-ad67-c1c241dac687@intel.com> (raw)
In-Reply-To: <20260821044755.2234490-5-nemesa.garg@intel.com>



On 8/21/2026 10:17 AM, 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_pipe_state[] 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_joiner_state. [Ville]
> v4: Add per-pipe vblank straddle detection around the arm loop. [Chaitanya]
> v5: Move straddle check outside the loop to cover all pipes together.
>      Sample vblank counter from primary pipe only.
>      Move drm_err() after local_irq_enable(). [Chaitnaya]
> 

LGTM, except my name ;)
Reviewed-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>

> Assisted-by: Claude:claude-sonnet-4.6
> Signed-off-by: Nemesa Garg <nemesa.garg@intel.com>
> ---
>   drivers/gpu/drm/i915/display/intel_cursor.c | 33 +++++++++++++++++----
>   1 file changed, 28 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_cursor.c b/drivers/gpu/drm/i915/display/intel_cursor.c
> index 9cb8b0a8537c..f5625dabc8f6 100644
> --- a/drivers/gpu/drm/i915/display/intel_cursor.c
> +++ b/drivers/gpu/drm/i915/display/intel_cursor.c
> @@ -13,6 +13,7 @@
>   #include <drm/drm_vblank.h>
>   
>   #include "intel_atomic.h"
> +#include "intel_crtc.h"
>   #include "intel_cursor.h"
>   #include "intel_cursor_regs.h"
>   #include "intel_de.h"
> @@ -900,6 +901,7 @@ intel_legacy_cursor_update(struct drm_plane *_plane,
>   	struct intel_cursor_joiner_state joined_pipe_state[I915_MAX_PIPES] = {};
>   	struct intel_crtc *pipe_crtc;
>   	int num_pipes = 0;
> +	u32 start_vbl_count, end_vbl_count;
>   	int ret;
>   
>   	/*
> @@ -1040,15 +1042,36 @@ 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);
> +	/*
> +	 * Joiner pipes are vblank-synchronized, so sampling only the primary
> +	 * pipe is sufficient to detect a straddle across all joined pipes.
> +	 * The vblank evasion above also operates on the primary pipe only.
> +	 */
> +	start_vbl_count = intel_crtc_get_vblank_counter(joined_pipe_state[0].crtc);
> +
> +	for (int i = 0; i < num_pipes; i++) {
> +		if (joined_pipe_state[i].new_plane_state->uapi.visible) {
> +			intel_plane_update_noarm(NULL, joined_pipe_state[i].plane,
> +						 joined_pipe_state[i].crtc_state,
> +						 joined_pipe_state[i].new_plane_state);
> +			intel_plane_update_arm(NULL, joined_pipe_state[i].plane,
> +					       joined_pipe_state[i].crtc_state,
> +					       joined_pipe_state[i].new_plane_state);
> +		} else {
> +			intel_plane_disable_arm(NULL, joined_pipe_state[i].plane, joined_pipe_state[i].crtc_state);
> +		}
>   	}
>   
> +	end_vbl_count = intel_crtc_get_vblank_counter(joined_pipe_state[0].crtc);
> +
>   	local_irq_enable();
>   
> +	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_pipe_state[0].crtc->pipe),
> +			start_vbl_count, end_vbl_count);
> +
>   	intel_psr_unlock(crtc_state);
>   
>   	/*


  reply	other threads:[~2026-08-27  9:46 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-21  4:47 [PATCH 0/6] Enable joiner cursor fast updates Nemesa Garg
2026-08-21  4:47 ` [PATCH 1/6] drm/i915/cursor: Check joiner cursor commit status Nemesa Garg
2026-08-27  9:45   ` Borah, Chaitanya Kumar
2026-08-21  4:47 ` [PATCH 2/6] drm/i915/cursor: Add helper to update cursor plane Nemesa Garg
2026-08-27  9:45   ` Borah, Chaitanya Kumar
2026-08-21  4:47 ` [PATCH 3/6] drm/i915/cursor: Handle secondary cursor state Nemesa Garg
2026-08-27  9:45   ` Borah, Chaitanya Kumar
2026-08-21  4:47 ` [PATCH 4/6] drm/i915/cursor: Program secondary cursor planes Nemesa Garg
2026-08-27  9:46   ` Borah, Chaitanya Kumar [this message]
2026-08-21  4:47 ` [PATCH 5/6] drm/i915/cursor: Schedule cursor unpin per joined pipe Nemesa Garg
2026-08-27  9:46   ` Borah, Chaitanya Kumar
2026-08-21  4:47 ` [PATCH 6/6] drm/i915/cursor: Allow joiner cursor fast path update Nemesa Garg
2026-08-27  9:46   ` Borah, Chaitanya Kumar
2026-08-21  5:49 ` ✓ i915.CI.BAT: success for Enable joiner cursor fast updates (rev6) Patchwork
2026-08-21  9:05 ` ✗ i915.CI.Full: failure " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2026-08-18  8:42 [PATCH 0/6] Enable joiner cursor fast updates Nemesa Garg
2026-08-18  8:42 ` [PATCH 4/6] drm/i915/cursor: Program secondary cursor planes Nemesa Garg
2026-07-06 11:56 [PATCH 0/6] Enable joiner cursor fast updates Nemesa Garg
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

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=b98de383-e076-47d4-ad67-c1c241dac687@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