drm/imx: ipuv3-plane: fix PRG modifiers after drm managed resource conversion
authorLucas Stach <l.stach@pengutronix.de>
Mon, 10 May 2021 14:59:27 +0000 (16:59 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Jul 2021 15:06:56 +0000 (17:06 +0200)
commit2e023412a1502da37057b9f423a266cbaff18930
treef4b8ef63c27d0757e13fc6d94fb9a588b6135262
parent99631d4f4e9ad43562a2a0639c81a06be5e768d9
drm/imx: ipuv3-plane: fix PRG modifiers after drm managed resource conversion

[ Upstream commit 17b9a94656fe19aef3647c4f93d93be51697ceb1 ]

The conversion to drm managed resources introduced two bugs: the plane is now
always initialized with the linear-only list, while the list with the Vivante
GPU modifiers should have been used when the PRG/PRE engines are present. This
masked another issue, as ipu_plane_format_mod_supported() is now called before
the private plane data is set up, so if a non-linear modifier is supplied in
the plane modifier list, we run into a NULL pointer dereference checking for
the PRG presence. To fix this just remove the check from this function, as we
know that it will only be called with a non-linear modifier, if the plane init
code has already determined that the PRG/PRE is present.

Fixes: 699e7e543f1a ("drm/imx: ipuv3-plane: use drm managed resources")
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Link: https://lore.kernel.org/r/20210510145927.988661-1-l.stach@pengutronix.de
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/imx/ipuv3-plane.c