All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Jani Nikula <jani.nikula@intel.com>
Cc: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org,
	Martin Hodo <martin.hodo@intel.com>,
	stable@vger.kernel.org,
	Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Subject: Re: [PATCH] drm/i915/vrr: require valid min/max vfreq for VRR
Date: Fri, 26 Jun 2026 16:40:30 +0300	[thread overview]
Message-ID: <aj6BTiskgYhSUGYd@intel.com> (raw)
In-Reply-To: <20260625131040.1051272-1-jani.nikula@intel.com>

On Thu, Jun 25, 2026 at 04:10:40PM +0300, Jani Nikula wrote:
> Ensure the EDID provided min/max vfreq are valid. Most scenarios are
> already covered (by coincidence) through the checks in
> intel_vrr_is_capable() and intel_vrr_is_in_range(), but be more explicit
> about it. At worst, a zero min_vfreq could lead to a division by zero in
> intel_vrr_compute_vmax().
> 
> Discovered using AI-assisted static analysis confirmed by Intel Product
> Security.
> 
> Reported-by: Martin Hodo <martin.hodo@intel.com>
> Fixes: 117cd09ba528 ("drm/i915/display/dp: Compute VRR state in atomic_check")
> Cc: <stable@vger.kernel.org> # v5.12+
> Cc: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_vrr.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_vrr.c b/drivers/gpu/drm/i915/display/intel_vrr.c
> index 5d9b11185296..bffbdee76ee1 100644
> --- a/drivers/gpu/drm/i915/display/intel_vrr.c
> +++ b/drivers/gpu/drm/i915/display/intel_vrr.c
> @@ -76,6 +76,10 @@ bool intel_vrr_is_capable(struct intel_connector *connector)
>  		return false;
>  	}
>  
> +	if (!info->monitor_range.min_vfreq || !info->monitor_range.max_vfreq ||
> +	    info->monitor_range.min_vfreq > info->monitor_range.max_vfreq)
> +		return false;

Perhaps it should be the responsibility of the EDID parser to make sure
the range isn't completely insane?

> +
>  	return info->monitor_range.max_vfreq - info->monitor_range.min_vfreq > 10;

I've been tempted to get rid of this completely arbitrary 10Hz thing as well.

>  }
>  
> -- 
> 2.47.3

-- 
Ville Syrjälä
Intel

  parent reply	other threads:[~2026-06-26 13:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-25 13:10 [PATCH] drm/i915/vrr: require valid min/max vfreq for VRR Jani Nikula
2026-06-25 13:21 ` ✗ CI.checkpatch: warning for " Patchwork
2026-06-25 13:22 ` ✓ CI.KUnit: success " Patchwork
2026-06-25 13:59 ` ✗ Xe.CI.BAT: failure " Patchwork
2026-06-25 15:28 ` ✓ i915.CI.BAT: success " Patchwork
2026-06-26  5:12 ` [PATCH] " Nautiyal, Ankit K
2026-06-26 13:40 ` Ville Syrjälä [this message]
2026-06-26 14:05   ` Jani Nikula

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=aj6BTiskgYhSUGYd@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=ankit.k.nautiyal@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=jani.nikula@intel.com \
    --cc=martin.hodo@intel.com \
    --cc=stable@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.