intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/i915/display: Avoid divide by zero
@ 2025-08-20 13:29 Juha-Pekka Heikkila
  2025-08-21  4:19 ` Kandpal, Suraj
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Juha-Pekka Heikkila @ 2025-08-20 13:29 UTC (permalink / raw)
  To: intel-gfx, intel-xe; +Cc: Juha-Pekka Heikkila

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@gmail.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


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-08-26  9:21 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-20 13:29 [PATCH] drm/i915/display: Avoid divide by zero Juha-Pekka Heikkila
2025-08-21  4:19 ` Kandpal, Suraj
2025-08-21  8:01 ` ✓ i915.CI.BAT: success for " Patchwork
2025-08-21  9:55 ` ✗ i915.CI.Full: failure " Patchwork
2025-08-21 13:05 ` [PATCH] " Ville Syrjälä
2025-08-26  9:21   ` Juha-Pekka Heikkilä

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).