From: Alexander Stein <alexander.stein@ew.tq-group.com>
To: Rui Miguel Silva <rmfrfs@gmail.com>,
Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Shawn Guo <shawnguo@kernel.org>,
Sascha Hauer <s.hauer@pengutronix.de>,
Fabio Estevam <festevam@gmail.com>,
Tim Harvey <tharvey@gateworks.com>
Cc: Alexander Stein <alexander.stein@ew.tq-group.com>,
Pengutronix Kernel Team <kernel@pengutronix.de>,
NXP Linux Team <linux-imx@nxp.com>,
linux-media@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/2] media: imx: imx7-media-csi: Fix applying format constraints
Date: Thu, 20 Jul 2023 09:41:29 +0200 [thread overview]
Message-ID: <20230720074129.3680269-2-alexander.stein@ew.tq-group.com> (raw)
In-Reply-To: <20230720074129.3680269-1-alexander.stein@ew.tq-group.com>
v4l_bound_align_image aligns to a multiple power of 2 of walign, but the
result only needs to be a multiple of walign. Fix this by using
v4l2_apply_frmsize_constraints() instead.
Reported-by: Tim Harvey <tharvey@gateworks.com>
Fixes: 6f482c4729d9 ("media: imx: imx7-media-csi: Get rid of superfluous call to imx7_csi_mbus_fmt_to_pix_fmt")
Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
---
Tim,
can you please test if this fixes your problem?
Apparently this issue only arises under specific conditions, e.g. 640/480/8bpp.
This issue does not show up for 640/480/10bpp.
drivers/media/platform/nxp/imx7-media-csi.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/media/platform/nxp/imx7-media-csi.c b/drivers/media/platform/nxp/imx7-media-csi.c
index 73f8f2a35422..523e5f039a5a 100644
--- a/drivers/media/platform/nxp/imx7-media-csi.c
+++ b/drivers/media/platform/nxp/imx7-media-csi.c
@@ -1141,8 +1141,8 @@ __imx7_csi_video_try_fmt(struct v4l2_pix_format *pixfmt,
* TODO: Implement configurable stride support.
*/
walign = 8 * 8 / cc->bpp;
- v4l_bound_align_image(&pixfmt->width, 1, 0xffff, walign,
- &pixfmt->height, 1, 0xffff, 1, 0);
+ v4l2_apply_frmsize_constraints(&pixfmt->width, &pixfmt->height,
+ &imx7_csi_frmsize_stepwise);
pixfmt->bytesperline = pixfmt->width * cc->bpp / 8;
pixfmt->sizeimage = pixfmt->bytesperline * pixfmt->height;
--
2.34.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2023-07-20 7:42 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-20 7:41 [PATCH 1/2] media: imx: imx7-media-csi: Move stepwise framesize into a dedicated struct Alexander Stein
2023-07-20 7:41 ` Alexander Stein [this message]
2023-07-20 10:19 ` [PATCH 2/2] media: imx: imx7-media-csi: Fix applying format constraints Alexander Stein
2023-07-20 16:43 ` kernel test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230720074129.3680269-2-alexander.stein@ew.tq-group.com \
--to=alexander.stein@ew.tq-group.com \
--cc=festevam@gmail.com \
--cc=kernel@pengutronix.de \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-imx@nxp.com \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=rmfrfs@gmail.com \
--cc=s.hauer@pengutronix.de \
--cc=shawnguo@kernel.org \
--cc=tharvey@gateworks.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox