Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Uma Shankar" <uma.shankar@intel.com>
Cc: intel-xe@lists.freedesktop.org, intel-gfx@lists.freedesktop.org
Subject: Re: [v3 3/4] drm/i915/display: Reprogram AS SDP skip frames on seamless VRR transitions
Date: Mon, 31 Aug 2026 12:53:46 +0000	[thread overview]
Message-ID: <20260831125347.3F3EA1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260831125914.1736501-4-uma.shankar@intel.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Sleeping function mutex_lock() is called from atomic context during seamless VRR enable.
--

commit 130854c15003f92b491f6090e85bf6bc4afe74ed
Author: Uma Shankar <uma.shankar@intel.com>

drm/i915/display: Reprogram AS SDP skip frames on seamless VRR transitions

This commit factors out AS SDP skip-frame programming and exposes
intel_alpm_pr_as_sdp_update() to recompute fields for the current VRR
state. It calls this function from seamless VRR enable and disable sites
so the skip counter matches whether VRR is actively driving the refresh rate.

> diff --git a/drivers/gpu/drm/i915/display/intel_alpm.c b/drivers/gpu/drm/i915/display/intel_alpm.c
> index 5f635f14a5880..03d5bf5c526f6 100644
> --- a/drivers/gpu/drm/i915/display/intel_alpm.c
> +++ b/drivers/gpu/drm/i915/display/intel_alpm.c
> [ ... ]
> +void intel_alpm_pr_as_sdp_update(const struct intel_crtc_state *crtc_state)
> +{
> +	struct intel_display *display = to_intel_display(crtc_state);
> +	struct intel_encoder *encoder;
> +
> +	/* AS SDP skip frames field only exists on Xe3LPD+ */
> +	if (DISPLAY_VER(display) < 35)
> +		return;
> +
> +	for_each_intel_encoder_mask(display->drm, encoder,
> +				    crtc_state->uapi.encoder_mask) {
> +		struct intel_dp *intel_dp;
> +
> +		if (!intel_encoder_is_dp(encoder))
> +			continue;
> +
> +		intel_dp = enc_to_intel_dp(encoder);
> +
> +		if (!intel_dp->as_sdp_supported ||
> +		    !intel_alpm_is_alpm_aux_less(intel_dp, crtc_state))
> +			continue;
> +
> +		mutex_lock(&intel_dp->alpm.lock);
                ^^^^^^^^^^

[Severity: High]
Is it safe to acquire a mutex here? This function is called from
commit_pipe_post_planes() and intel_pre_plane_update() during seamless VRR
transitions.

Since these callers execute within the vblank evasion critical section,
local interrupts are disabled and we are in an atomic context:

intel_update_crtc() {
        intel_pipe_update_start(state, crtc); /* Disables local interrupts */
        ...
        commit_pipe_post_planes(state, crtc);
        ...
}

Calling a sleeping lock like mutex_lock() from this atomic context will
trigger a scheduling while atomic oops and can lead to a hard system
deadlock when dynamically toggling VRR on a supported display.

> +		intel_alpm_configure_pr_as_sdp(intel_dp, crtc_state);
> +		mutex_unlock(&intel_dp->alpm.lock);
> +	}
> +}
> [ ... ]
> diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
> index 9dfd095f325f7..a6b776da14b3a 100644
> --- a/drivers/gpu/drm/i915/display/intel_display.c
> +++ b/drivers/gpu/drm/i915/display/intel_display.c
> [ ... ]
> @@ -6796,8 +6804,17 @@ static void commit_pipe_post_planes(struct intel_atomic_state *state,
>  	    HAS_DOUBLE_BUFFERED_LUT(display))
>  		intel_color_load_luts(new_crtc_state);
>  
> -	if (intel_crtc_vrr_enabling(state, crtc))
> +	if (intel_crtc_vrr_enabling(state, crtc)) {
>  		intel_vrr_enable(new_crtc_state);
> +
> +		/*
> +		 * VRR is being enabled seamlessly (no modeset, Panel Replay
> +		 * stays enabled), so re-apply the AS SDP skip-frame programming
> +		 * for the new (VRR on) state.
> +		 */
> +		if (!modeset)
> +			intel_alpm_pr_as_sdp_update(new_crtc_state);
> +	}
>  }

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260831125914.1736501-1-uma.shankar@intel.com?part=3

  reply	other threads:[~2026-08-31 12:53 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-31 12:59 [v3 0/4] drm/i915/display: Enable AS SDP Skip Frames Uma Shankar
2026-08-31 12:59 ` [v3 1/4] drm/i915/display: Enable periodic AS SDP skip frames Uma Shankar
2026-08-31 12:52   ` sashiko-bot
2026-08-31 12:59 ` [v3 2/4] drm/i915/display: Force disable DC3co when AS SDP skip frames is enabled Uma Shankar
2026-08-31 12:57   ` sashiko-bot
2026-08-31 12:59 ` [v3 3/4] drm/i915/display: Reprogram AS SDP skip frames on seamless VRR transitions Uma Shankar
2026-08-31 12:53   ` sashiko-bot [this message]
2026-08-31 12:59 ` [v3 4/4] drm/i915/display: Gate periodic AS SDP skip frames behind a module parameter Uma Shankar
2026-08-31 12:52   ` sashiko-bot
2026-08-31 16:08 ` ✓ i915.CI.BAT: success for drm/i915/display: Enable AS SDP Skip Frames (rev3) Patchwork
2026-08-31 23:35 ` ✗ 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=20260831125347.3F3EA1F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=uma.shankar@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