From patchwork Thu Jul 29 19:49:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 76094 X-Patchwork-Delegate: hverkuil@xs4all.nl Received: from vger.kernel.org ([23.128.96.18]) by www.linuxtv.org with esmtp (Exim 4.92) (envelope-from ) id 1m9C2D-00AVFn-G8; Thu, 29 Jul 2021 19:49:40 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229865AbhG2Tth (ORCPT + 1 other); Thu, 29 Jul 2021 15:49:37 -0400 Received: from smtp13.smtpout.orange.fr ([80.12.242.135]:48950 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229645AbhG2Ttg (ORCPT ); Thu, 29 Jul 2021 15:49:36 -0400 Received: from localhost.localdomain ([86.243.172.93]) by mwinf5d56 with ME id b7pU2500D21Fzsu037pUqA; Thu, 29 Jul 2021 21:49:31 +0200 X-ME-Helo: localhost.localdomain X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Thu, 29 Jul 2021 21:49:31 +0200 X-ME-IP: 86.243.172.93 From: Christophe JAILLET To: narmstrong@baylibre.com, mchehab@kernel.org, khilman@baylibre.com, jbrunet@baylibre.com, martin.blumenstingl@googlemail.com, hverkuil-cisco@xs4all.nl Cc: linux-media@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH] media: meson-ge2d: Fix rotation parameter changes detection in 'ge2d_s_ctrl()' Date: Thu, 29 Jul 2021 21:49:25 +0200 Message-Id: <6cb8efcadcf8c856efb32b7692fc9bf3241e3bc3.1627588010.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-LSpam-Score: -2.4 (--) X-LSpam-Report: No, score=-2.4 required=5.0 tests=BAYES_00=-1.9,FREEMAIL_FORGED_FROMDOMAIN=0.001,FREEMAIL_FROM=0.001,HEADER_FROM_DIFFERENT_DOMAINS=0.5,MAILING_LIST_MULTI=-1,RCVD_IN_DNSWL_NONE=-0.0001 autolearn=ham autolearn_force=no There is likely a typo here. To be consistent, we should compare 'fmt.height' with 'ctx->out.pix_fmt.height', not 'ctx->out.pix_fmt.width'. Fixes: 59a635327ca7 ("media: meson: Add M2M driver for the Amlogic GE2D Accelerator Unit") Signed-off-by: Christophe JAILLET Acked-by: Neil Armstrong --- I've not looked deeply in the code, but why is this test needed in the first place? Couldn't we assigned 'ctx->out.pix_fmt = fmt' un-conditionally? --- drivers/media/platform/meson/ge2d/ge2d.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/meson/ge2d/ge2d.c b/drivers/media/platform/meson/ge2d/ge2d.c index a1393fefa8ae..be22bb60e7cf 100644 --- a/drivers/media/platform/meson/ge2d/ge2d.c +++ b/drivers/media/platform/meson/ge2d/ge2d.c @@ -780,7 +780,7 @@ static int ge2d_s_ctrl(struct v4l2_ctrl *ctrl) * parameters, take them in account */ if (fmt.width != ctx->out.pix_fmt.width || - fmt.height != ctx->out.pix_fmt.width || + fmt.height != ctx->out.pix_fmt.height || fmt.bytesperline > ctx->out.pix_fmt.bytesperline || fmt.sizeimage > ctx->out.pix_fmt.sizeimage) ctx->out.pix_fmt = fmt;