drm/ssd130x: Fix atomic_check for disabled planes
authorThomas Zimmermann <tzimmermann@suse.de>
Mon, 9 Oct 2023 14:06:35 +0000 (16:06 +0200)
committerJavier Martinez Canillas <javierm@redhat.com>
Fri, 13 Oct 2023 15:53:32 +0000 (17:53 +0200)
commita48e2cc92835fa1d9b373b804b2173c779387b8e
tree0edbf12dea6b953dee748f08a0c998a8c89e1b77
parente755d439c1b7f579dfb7a36e6c2d14d426e14b3a
drm/ssd130x: Fix atomic_check for disabled planes

The plane's atomic_check returns -EINVAL if the CRTC has not been
set. This is the case for disabled planes, for which atomic_check
should return 0. For disabled planes, it also omits the mandatory
call to drm_atomic_helper_check_plane_state().

Replace the test with the boiler-plate code that first invokes
drm_atomic_helper_check_plane_state() and then tests for the plane
to be visible. Return early for non-visible planes.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Fixes: d51f9fbd98b6 ("drm/ssd130x: Store the HW buffer in the driver-private CRTC state")
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Tested-by: Javier Martinez Canillas <javierm@redhat.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Javier Martinez Canillas <javierm@redhat.com>
Cc: Maxime Ripard <mripard@kernel.org>
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20231009141018.11291-7-tzimmermann@suse.de
drivers/gpu/drm/solomon/ssd130x.c