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 20:28:53 +0000 (16:28 -0400)
commit21fc0ff38f571debdba6aaff944addb50f49a7f7
treeeefbd1b1965e41ac43135dde27a08d89d0346a8b
parent276641775848020c6e84166d1bc885e028a04680
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>
drivers/gpu/drm/amd/display/modules/power/power_helpers.c