drm/amd/display: fix a divided-by-zero error
[Why & How] timing.dsc_cfg.num_slices_v can be zero and it is necessary to check before using it. This fixes the error "divide error: 0000 [#1] PREEMPT SMP NOPTI". Reviewed-by: Aurabindo Pillai <Aurabindo.Pillai@amd.com> Acked-by: Qingqing Zhuo <qingqing.zhuo@amd.com> Signed-off-by: Alex Hung <alex.hung@amd.com> Tested-by: Daniel Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
2766417758
commit
21fc0ff38f
@ -927,6 +927,10 @@ bool psr_su_set_dsc_slice_height(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;
|
||||
config->dsc_slice_height = slice_height;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user