mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-05 19:31:57 -04:00
disp: msm: Fix division by zero during ESD recovery
During ESD recovery, num_mixers becomes 0 for a few moments.
[ 34.758513] ================================================================================
[ 34.758519] UBSAN: division-overflow in ../techpack/display/msm/sde/sde_crtc.h:522:32
[ 34.758521] division by zero
[ 34.758524] CPU: 6 PID: 1039 Comm: SDM_EventThread Tainted: G S 5.4.302~positron/4565e293 #17
[ 34.758525] Hardware name: Qualcomm Technologies, Inc. Blair QRD NOPMI (DT)
[ 34.758526] Call trace:
[ 34.758531] dump_backtrace+0x0/0x298
[ 34.758532] __dump_stack+0x20/0x28
[ 34.758533] dump_stack+0x74/0x9c
[ 34.758535] ubsan_epilogue+0xc/0x48
[ 34.758538] __ubsan_handle_divrem_overflow+0x184/0x198
[ 34.758540] _sde_crtc_setup_lm_bounds+0x300/0x318
[ 34.758541] sde_crtc_atomic_check+0x260/0x253c
[ 34.758543] drm_atomic_helper_check_planes+0x1b0/0x224
[ 34.758544] sde_kms_atomic_check+0xb4/0x2f4
[ 34.758545] drm_atomic_check_only+0x410/0x778
[ 34.758546] drm_mode_atomic_ioctl+0xb24/0x1020
[ 34.758548] drm_ioctl_kernel+0x21c/0x2c0
[ 34.758549] drm_ioctl+0x2d0/0x434
[ 34.758551] do_vfs_ioctl+0x9b4/0xf9c
[ 34.758552] __arm64_sys_ioctl+0x128/0x144
[ 34.758553] el0_svc_common+0xdc/0x158
[ 34.758554] el0_svc+0x8/0x700
[ 34.758555] ================================================================================
Fixes: 4fef803aff ("disp: msm: sde: increase max number of mixers to 4")
Change-Id: Idb60e329ffb47d842bb0b4a16b3d086cc4ec16bc
Signed-off-by: Alexander Winkowski <dereference23@outlook.com>
This commit is contained in:
parent
8c29510d44
commit
3a757c1357
1 changed files with 2 additions and 1 deletions
|
|
@ -519,7 +519,8 @@ static inline int sde_crtc_get_mixer_width(struct sde_crtc *sde_crtc,
|
|||
if (cstate->num_ds_enabled)
|
||||
mixer_width = cstate->ds_cfg[0].lm_width;
|
||||
else
|
||||
mixer_width = mode->hdisplay / sde_crtc->num_mixers;
|
||||
mixer_width = sde_crtc->num_mixers ?
|
||||
mode->hdisplay / sde_crtc->num_mixers : mode->hdisplay;
|
||||
|
||||
return mixer_width;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue