OSDN Git Service

drm/gem: Ignore color planes that are unused by framebuffer format
authorThomas Zimmermann <tzimmermann@suse.de>
Tue, 17 May 2022 11:33:24 +0000 (13:33 +0200)
committerThomas Zimmermann <tzimmermann@suse.de>
Thu, 19 May 2022 17:25:02 +0000 (19:25 +0200)
commit746b9c62cc8614fa59c23f3332682b5e9e1d801c
treec9c4bbce1089935a06f57e478e533e34453e9f9e
parentf159b1b22c8a2d3d7c1fa877fafc8aacff0deeba
drm/gem: Ignore color planes that are unused by framebuffer format

Only handle color planes that exist in a framebuffer's color format.
Ignore non-existing planes.

So far, several helpers assumed that all 4 planes are available and
silently ignored non-existing planes. This lead to subtil bugs with
uninitialized data in instances of struct iosys_map. [1]

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Tested-by: Noralf Trønnes <noralf@tronnes.org>
Acked-by: Christian König <christian.koenig@amd.com>
Link: https://lore.kernel.org/dri-devel/20210730183511.20080-1-tzimmermann@suse.de/T/#md0172b10bb588d8f20f4f456e304f08d2a4505f7
Link: https://patchwork.freedesktop.org/patch/msgid/20220517113327.26919-3-tzimmermann@suse.de
drivers/gpu/drm/drm_gem_atomic_helper.c
drivers/gpu/drm/drm_gem_framebuffer_helper.c
include/drm/drm_gem_framebuffer_helper.h