drm/amd/display: fix a divided-by-zero error
authorAlex Hung <alex.hung@amd.com>
Mon, 3 Apr 2023 09:45:41 +0000 (17:45 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 18 Apr 2023 21:20:00 +0000 (17:20 -0400)
commit0b5dfe12755f87ec014bb4cc1930485026167430
tree1e46fec3690d3537d811647d2b809384186515f8
parent1e994cc0956b8dabd1b1fef315bbd722733b8aa8
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>
Cc: stable@vger.kernel.org
drivers/gpu/drm/amd/display/modules/power/power_helpers.c