]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/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)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 14 Aug 2019 09:18:49 +0000 (11:18 +0200)
commit2c942003a808df4b2cac2b6790bb1b17a022ddad
treef7bb2db25b6e5b4dc5c9aed376e0905a5f69e838
parent0c7b53e3b83fb75d3f789253f82da9ec5eee5e1c
drm: Auto-set allow_fb_modifiers when given modifiers at plane init

BugLink: https://bugs.launchpad.net/bugs/1838116
[ 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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/gpu/drm/drm_plane.c