drm/simpledrm: Preallocate format-conversion buffer in atomic_check
authorThomas Zimmermann <tzimmermann@suse.de>
Mon, 9 Oct 2023 14:06:34 +0000 (16:06 +0200)
committerThomas Zimmermann <tzimmermann@suse.de>
Tue, 14 Nov 2023 09:17:22 +0000 (10:17 +0100)
commite7c814d305e110d6db3f440d14490a8d0d9477d9
treebc982249e0f779773f53e8e695e99ae48aafa49e
parent58b184dcb3f4c52c15b6ff4fa2fa0d69d1e1313f
drm/simpledrm: Preallocate format-conversion buffer in atomic_check

Preallocate the format-conversion state's storage in the plane's
atomic_check function if a format conversion is necessary. Allows
the update to fail if no memory is available. Avoids the same
allocation within atomic_update, which may not fail.

Also inline drm_plane_helper_atomic_check() into the driver and thus
return early for invisible planes. Avoids memory allocation entirely
in this case.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20231009141018.11291-6-tzimmermann@suse.de
drivers/gpu/drm/tiny/simpledrm.c