]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
gpu/drm: ingenic: Fix bogus crtc_atomic_check callback
authorPaul Cercueil <paul@crapouillou.net>
Sat, 16 May 2020 21:50:49 +0000 (23:50 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Jun 2020 06:23:15 +0000 (08:23 +0200)
[ Upstream commit a53bcc19876498bdd3b4ef796c787295dcc498b4 ]

The code was comparing the SoC's maximum height with the mode's width,
and vice-versa. D'oh.

Cc: stable@vger.kernel.org # v5.6
Fixes: a7c909b7c037 ("gpu/drm: ingenic: Check for display size in CRTC atomic check")
Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Link: https://patchwork.freedesktop.org/patch/msgid/20200516215057.392609-4-paul@crapouillou.net
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/ingenic/ingenic-drm.c

index bcba2f0248420c876476568505c249bd1bc02ae3..8f5077370a52db249a8f4fd52d212ac596bcbb91 100644 (file)
@@ -328,8 +328,8 @@ static int ingenic_drm_crtc_atomic_check(struct drm_crtc *crtc,
        if (!drm_atomic_crtc_needs_modeset(state))
                return 0;
 
-       if (state->mode.hdisplay > priv->soc_info->max_height ||
-           state->mode.vdisplay > priv->soc_info->max_width)
+       if (state->mode.hdisplay > priv->soc_info->max_width ||
+           state->mode.vdisplay > priv->soc_info->max_height)
                return -EINVAL;
 
        rate = clk_round_rate(priv->pix_clk,