[PATCH] drm/i915/display: Avoid divide by zero
Kandpal, Suraj
suraj.kandpal at intel.com
Thu Aug 21 04:19:04 UTC 2025
> Subject: [PATCH] drm/i915/display: Avoid divide by zero
>
> 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.
>
> Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila at gmail.com>
LGTM,
Reviewed-by: Suraj Kandpal <suraj.kandpal at 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 def5150231a4..403783504ab3 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
More information about the Intel-xe
mailing list