drm/imx: ipuv3-plane: Access old u/vbo properly in ->atomic_check for YU12/YV12
authorLiu Ying <gnuiyl@gmail.com>
Tue, 18 Oct 2016 08:44:03 +0000 (16:44 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Nov 2016 15:38:54 +0000 (16:38 +0100)
commitfa6227dbfd6a60587e5065e7df3e0571f4d1f31a
treef477c513c3f356c63d76928e090b1332ff59e7eb
parentd040374f3473124cadf2e44c0afd2c6ac5451c83
drm/imx: ipuv3-plane: Access old u/vbo properly in ->atomic_check for YU12/YV12

commit e73aca5184ad9fc948ba22b4d35dce11db35bb25 upstream.

Before accessing the u/v offset(aka, u/vbo for IPUv3) of the old plane state's
relevant fb, we should make sure the fb is in YU12 or YV12 pixel format(which
are the two YUV pixel formats we support only), otherwise, we are likely to
trigger BUG_ON() in drm_plane_state_to_u/vbo() since the fb's pixel format is
probably not YU12 or YV12.

Link: https://bugs.freedesktop.org/show_bug.cgi?id=98150
Fixes: c6c1f9bc798b ("drm/imx: Add active plane reconfiguration support")
Signed-off-by: Liu Ying <gnuiyl@gmail.com>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/imx/ipuv3-plane.c