Re: [PATCH] drm/amd/display: Fix division by zero in setup_dsc_config

2024-04-22 Thread Markus Elfring
… > +++ b/drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c > @@ -1055,7 +1055,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_

[PATCH] drm/amd/display: Fix division by zero in setup_dsc_config

2024-04-10 Thread Jose Fernandez
When slice_height is 0, the division by slice_height in the calculation of the number of slices will cause a division by zero driver crash. This leaves the kernel in a state that requires a reboot. This patch adds a check to avoid the division by zero. The stack trace below is for the 6.8.4 Kernel