summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2023-05-12 11:00:23 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2023-05-12 11:00:23 +0000
commit4324ee3b17c9eaca1444788d4c9fbdb77a061f91 (patch)
tree805418069848a32b7c3ab5ef032ac43cd7c7b761 /sys/dev
parent20aa15dce537ab7fb7f380609e921c9ec20f07ac (diff)
drm/amd/display: fix a divided-by-zero error
From Alex Hung e43cf7abece2efaebe0a757909d258212d01c404 in linux-6.1.y/6.1.28 0b5dfe12755f87ec014bb4cc1930485026167430 in mainline linux
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/pci/drm/amd/display/modules/power/power_helpers.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/dev/pci/drm/amd/display/modules/power/power_helpers.c b/sys/dev/pci/drm/amd/display/modules/power/power_helpers.c
index 01fc6a368d2..9edd39322c8 100644
--- a/sys/dev/pci/drm/amd/display/modules/power/power_helpers.c
+++ b/sys/dev/pci/drm/amd/display/modules/power/power_helpers.c
@@ -924,6 +924,10 @@ bool psr_su_set_y_granularity(struct dc *dc, struct dc_link *link,
pic_height = stream->timing.v_addressable +
stream->timing.v_border_top + stream->timing.v_border_bottom;
+
+ if (stream->timing.dsc_cfg.num_slices_v == 0)
+ return false;
+
slice_height = pic_height / stream->timing.dsc_cfg.num_slices_v;
if (slice_height) {