]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
drm/amd/display: check fb of primary plane
authorSefa Eyeoglu <contact@scrumplex.net>
Tue, 16 Mar 2021 21:50:06 +0000 (22:50 +0100)
committerKelsey Skunberg <kelsey.skunberg@canonical.com>
Mon, 24 May 2021 23:46:31 +0000 (17:46 -0600)
commitce117c3c1545d6f6e961c3b6058e20956419121f
treea9c4d90d9dc2307ebb3486f95b13ac3e797688a1
parente1abf940f0e57141f05f7228a90c0c5f86af502e
drm/amd/display: check fb of primary plane

BugLink: https://bugs.launchpad.net/bugs/1929455
[ Upstream commit 7df4ceb60fa9a3c5160cfd5b696657291934a2c9 ]

Sometimes the primary plane might not be initialized (yet), which
causes dm_check_crtc_cursor to divide by zero.
Apparently a weird state before a S3-suspend causes the aforementioned
divide-by-zero error when resuming from S3.  This was explained in
bug 212293 on Bugzilla.

To avoid this divide-by-zero error we check if the primary plane's fb
isn't NULL.  If it's NULL the src_w and src_h attributes will be 0,
which would cause a divide-by-zero.

This fixes Bugzilla report 212293
Bug: https://bugzilla.kernel.org/show_bug.cgi?id=212293

Fixes: 12f4849a1cfd69f3 ("drm/amd/display: check cursor scaling")
Reviewed-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c