artulab
projects
/
openbsd
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f057eb4
)
drm/amd/display: Fix division by zero in setup_dsc_config
author
jsg
<jsg@openbsd.org>
Mon, 27 May 2024 00:51:31 +0000
(
00:51
+0000)
committer
jsg
<jsg@openbsd.org>
Mon, 27 May 2024 00:51:31 +0000
(
00:51
+0000)
From Jose Fernandez
7e4f50dfc98c49b3dc6875a35c3112522fb25639
in linux-6.6.y/6.6.32
130afc8a886183a94cf6eab7d24f300014ff87ba
in mainline linux
sys/dev/pci/drm/amd/display/dc/dsc/dc_dsc.c
patch
|
blob
|
history
diff --git
a/sys/dev/pci/drm/amd/display/dc/dsc/dc_dsc.c
b/sys/dev/pci/drm/amd/display/dc/dsc/dc_dsc.c
index
3966845
..
230be29
100644
(file)
--- a/
sys/dev/pci/drm/amd/display/dc/dsc/dc_dsc.c
+++ b/
sys/dev/pci/drm/amd/display/dc/dsc/dc_dsc.c
@@
-1033,7
+1033,12
@@
static bool setup_dsc_config(
if (!is_dsc_possible)
goto done;
- dsc_cfg->num_slices_v = pic_height/slice_height;
+ if (slice_height > 0) {
+ dsc_cfg->num_slices_v = pic_height / slice_height;
+ } else {
+ is_dsc_possible = false;
+ goto done;
+ }
if (target_bandwidth_kbps > 0) {
is_dsc_possible = decide_dsc_target_bpp_x16(