drm/vkms: Let shadow-plane helpers prepare the plane's FB
authorThomas Zimmermann <tzimmermann@suse.de>
Mon, 5 Jul 2021 07:46:32 +0000 (09:46 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 18 Sep 2021 11:41:59 +0000 (13:41 +0200)
commit4328794607d903fbb591e82809d6eb32bf28d49e
tree62fa389950ed0915dd2f96c044e3888e58ad2fbf
parent09156cf2613b44671fe4eaec6c6f2c3a9552d7c4
drm/vkms: Let shadow-plane helpers prepare the plane's FB

[ Upstream commit b43e2ec03b0de040d536591713ea9c875ff34ba9 ]

Replace vkms' prepare_fb and cleanup_fb functions with the generic
code for shadow-buffered planes. No functional changes.

This change also fixes a problem where IGT kms_flip tests would
create a segmentation fault within vkms. The driver's prepare_fb
function did not report an error if a BO's vmap operation failed.
The kernel later tried to operate on the non-mapped memory areas.
The shared shadow-plane helpers handle errors correctly, so that
the driver now avoids the segmantation fault.

v2:
* include paragraph about IGT tests in commit message (Melissa)

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Melissa Wen <melissa.srw@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210705074633.9425-4-tzimmermann@suse.de
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/vkms/vkms_plane.c