diff options
| author | Alex Hung <[email protected]> | 2023-04-03 09:45:41 +0000 |
|---|---|---|
| committer | Alex Deucher <[email protected]> | 2023-04-18 20:28:53 +0000 |
| commit | 21fc0ff38f571debdba6aaff944addb50f49a7f7 (patch) | |
| tree | eefbd1b1965e41ac43135dde27a08d89d0346a8b /drivers/gpu/drm/amd/display/modules | |
| parent | drm/amd/display: [FW Promotion] Release 0.0.162.0 (diff) | |
| download | kernel-21fc0ff38f571debdba6aaff944addb50f49a7f7.tar.gz kernel-21fc0ff38f571debdba6aaff944addb50f49a7f7.zip | |
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 <[email protected]>
Acked-by: Qingqing Zhuo <[email protected]>
Signed-off-by: Alex Hung <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/display/modules')
| -rw-r--r-- | drivers/gpu/drm/amd/display/modules/power/power_helpers.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/display/modules/power/power_helpers.c b/drivers/gpu/drm/amd/display/modules/power/power_helpers.c index 0d3a983cb9ec..51e76bce92ea 100644 --- a/drivers/gpu/drm/amd/display/modules/power/power_helpers.c +++ b/drivers/gpu/drm/amd/display/modules/power/power_helpers.c @@ -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; |
