]> git.itanic.dy.fi Git - linux-stable/commit
drm: Auto-set allow_fb_modifiers when given modifiers at plane init
authorPaul Kocialkowski <paul.kocialkowski@bootlin.com>
Fri, 4 Jan 2019 08:56:10 +0000 (09:56 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 5 Apr 2019 20:31:39 +0000 (22:31 +0200)
commit0cab1159259016772dea259e6b92c36e190f63f0
treec7a04530729df5723bf8f6b46ec06cdd09653a2c
parent8fbaad2c87369820df1ff8bb1315e0ca6419ac60
drm: Auto-set allow_fb_modifiers when given modifiers at plane init

[ Upstream commit 890880ddfdbe256083170866e49c87618b706ac7 ]

When drivers pass non-empty lists of modifiers for initializing their
planes, we can infer that they allow framebuffer modifiers and set the
driver's allow_fb_modifiers mode config element.

In case the allow_fb_modifiers element was not set (some drivers tend
to set them after registering planes), the modifiers will still be
registered but won't be available to userspace unless the flag is set
later. However in that case, the IN_FORMATS blob won't be created.

In order to avoid this case and generally reduce the trouble associated
with the flag, always set allow_fb_modifiers when a non-empty list of
format modifiers is passed at plane init.

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190104085610.5829-1-paul.kocialkowski@bootlin.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/drm_plane.c