Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Cc: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org,
	Suraj Kandpal <suraj.kandpal@intel.com>
Subject: Re: [PATCH 3/3] drm/i915/display: Avoid divide by zero
Date: Fri, 5 Sep 2025 14:36:44 +0300	[thread overview]
Message-ID: <aLrLTMJa2DXep4Nl@intel.com> (raw)
In-Reply-To: <20250905104626.1274147-3-juhapekka.heikkila@gmail.com>

On Fri, Sep 05, 2025 at 01:46:26PM +0300, Juha-Pekka Heikkila wrote:
> skl_crtc_allocate_plane_ddb allow iter.data_rate to be zero
> which could cause divide by zero in skl_allocate_plane_ddb,
> check against that.

As I said I don't think the div-by-zero is really possible. 
So should say here that this is just to shut up some static
analysis noise.

> 
> Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
> Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
> ---
>  drivers/gpu/drm/i915/display/skl_watermark.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/skl_watermark.c b/drivers/gpu/drm/i915/display/skl_watermark.c
> index 33885d619a97..bfcd700b95e4 100644
> --- a/drivers/gpu/drm/i915/display/skl_watermark.c
> +++ b/drivers/gpu/drm/i915/display/skl_watermark.c
> @@ -1388,7 +1388,7 @@ skl_allocate_plane_ddb(struct skl_plane_ddb_iter *iter,
>  {
>  	u16 size, extra = 0;
>  
> -	if (data_rate) {
> +	if (data_rate && iter->data_rate) {
>  		extra = min_t(u16, iter->size,
>  			      DIV64_U64_ROUND_UP(iter->size * data_rate,
>  						 iter->data_rate));
> -- 
> 2.43.0

-- 
Ville Syrjälä
Intel

  reply	other threads:[~2025-09-05 11:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-05 10:46 [PATCH 1/3] drm/i915/display: take out dead code Juha-Pekka Heikkila
2025-09-05 10:46 ` [PATCH 2/3] drm/i915/display: log fail from intel_sdvo_enable_hotplug Juha-Pekka Heikkila
2025-09-05 10:46 ` [PATCH 3/3] drm/i915/display: Avoid divide by zero Juha-Pekka Heikkila
2025-09-05 11:36   ` Ville Syrjälä [this message]
2025-09-05 17:35 ` ✓ i915.CI.BAT: success for series starting with [1/3] drm/i915/display: take out dead code Patchwork
2025-09-06 23:21 ` ✗ 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=aLrLTMJa2DXep4Nl@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=juhapekka.heikkila@gmail.com \
    --cc=suraj.kandpal@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