Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Rishikesh Donadkar" <r-donadkar@ti.com>
Cc: robh@kernel.org, devicetree@vger.kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v13 01/17] media: ti: j721e-csi2rx: Remove word size alignment on frame width
Date: Wed, 20 May 2026 12:27:39 +0000	[thread overview]
Message-ID: <20260520122739.C6CA11F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260520120022.539913-2-r-donadkar@ti.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Removing word-size alignment allows odd frame widths, violating V4L2 macro-pixel requirements for packed formats.
--

commit 1c8944cd1907204dbed865890aef72e4ff1103a8
Author: Rishikesh Donadkar <r-donadkar@ti.com>

media: ti: j721e-csi2rx: Remove word size alignment on frame width

This commit removes the limitation that the frame width must be a multiple
of the word size, as the hardware does not strictly enforce this constraint.
It updates the format clamping and stepwise frame sizes to a minimum and
step of 1.

Link: https://www.ti.com/lit/pdf/spruj16

> diff --git a/drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c b/drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c
> --- a/drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c
> +++ b/drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c
[ ... ]
> @@ -360,23 +352,15 @@ static int ti_csi2rx_enum_framesizes(struct file *file, void *fh,
>  				     struct v4l2_frmsizeenum *fsize)
>  {
[ ... ]
>  	fsize->type = V4L2_FRMSIZE_TYPE_STEPWISE;
> -	fsize->stepwise.min_width = pixels_in_word;
> -	fsize->stepwise.max_width = rounddown(MAX_WIDTH_BYTES * 8 / fmt->bpp,
> -					      pixels_in_word);
> -	fsize->stepwise.step_width = pixels_in_word;
> +	fsize->stepwise.min_width = 1;
> +	fsize->stepwise.max_width = MAX_WIDTH_BYTES * 8 / fmt->bpp;
> +	fsize->stepwise.step_width = 1;

[Severity: Medium]
Does removing this alignment entirely allow invalid widths for packed
macro-pixel formats?

For formats like YUYV (YUV 4:2:2), the V4L2 specification requires widths
to be an even number, because a single macro-pixel represents 2 pixels in
4 bytes.

By hardcoding step_width to 1 and removing the width rounddown in
ti_csi2rx_fill_fmt(), userspace could request an odd width like 3.
This results in a bytesperline calculation that physically cannot hold
full macro-pixels, which may lead to stream desynchronization or unread
data in the hardware FIFO.

Should we fall back to format-specific macro-pixel alignment using
something like v4l_bound_align_image() instead of removing all alignment
constraints?

>  	fsize->stepwise.min_height = 1;
>  	fsize->stepwise.max_height = MAX_HEIGHT_LINES;
>  	fsize->stepwise.step_height = 1;

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260520120022.539913-1-r-donadkar@ti.com?part=1

  reply	other threads:[~2026-05-20 12:27 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-20 12:00 [PATCH v13 00/17] media: cadence,ti: CSI2RX Multistream Support Rishikesh Donadkar
2026-05-20 12:00 ` [PATCH v13 01/17] media: ti: j721e-csi2rx: Remove word size alignment on frame width Rishikesh Donadkar
2026-05-20 12:27   ` sashiko-bot [this message]
2026-05-20 12:00 ` [PATCH v13 02/17] dt-bindings: media: ti,j721e-csi2rx-shim: Support 32 dma chans Rishikesh Donadkar
2026-05-20 12:00 ` [PATCH v13 03/17] media: ti: j721e-csi2rx: separate out device and context Rishikesh Donadkar
2026-05-20 12:37   ` sashiko-bot
2026-05-20 12:00 ` [PATCH v13 04/17] media: ti: j721e-csi2rx: prepare SHIM code for multiple contexts Rishikesh Donadkar
2026-05-20 12:00 ` [PATCH v13 05/17] media: ti: j721e-csi2rx: allocate DMA channel based on context index Rishikesh Donadkar
2026-05-20 12:32   ` sashiko-bot
2026-05-20 12:00 ` [PATCH v13 06/17] media: ti: j721e-csi2rx: add a subdev for the core device Rishikesh Donadkar
2026-05-20 12:28   ` Sakari Ailus
2026-05-20 12:49   ` sashiko-bot
2026-05-20 12:00 ` [PATCH v13 07/17] media: cadence: csi2rx: Move to .enable/disable_streams API Rishikesh Donadkar
2026-05-20 12:39   ` sashiko-bot
2026-05-20 12:00 ` [PATCH v13 08/17] media: ti: j721e-csi2rx: get number of contexts from device tree Rishikesh Donadkar
2026-05-20 12:45   ` sashiko-bot
2026-05-20 12:00 ` [PATCH v13 09/17] media: cadence: csi2rx: Add .get_frame_desc op Rishikesh Donadkar
2026-05-20 14:25   ` Jai Luthra
2026-05-20 12:00 ` [PATCH v13 10/17] media: ti: j721e-csi2rx: add support for processing virtual channels Rishikesh Donadkar
2026-05-20 12:44   ` sashiko-bot
2026-05-20 12:00 ` [PATCH v13 11/17] media: cadence: csi2rx: add multistream support Rishikesh Donadkar
2026-05-20 12:58   ` sashiko-bot
2026-05-20 12:00 ` [PATCH v13 12/17] media: ti: j721e-csi2rx: " Rishikesh Donadkar
2026-05-20 12:48   ` sashiko-bot
2026-05-20 12:00 ` [PATCH v13 13/17] media: ti: j721e-csi2rx: Submit all available buffers Rishikesh Donadkar
2026-05-20 12:59   ` sashiko-bot
2026-05-20 12:00 ` [PATCH v13 14/17] media: ti: j721e-csi2rx: Change the drain architecture for multistream Rishikesh Donadkar
2026-05-20 13:01   ` sashiko-bot
2026-05-20 12:00 ` [PATCH v13 15/17] media: cadence: csi2rx: Support runtime PM Rishikesh Donadkar
2026-05-20 13:00   ` sashiko-bot
2026-05-20 12:00 ` [PATCH v13 16/17] media: ti: j721e-csi2rx: Support runtime suspend Rishikesh Donadkar
2026-05-20 13:01   ` sashiko-bot
2026-05-20 12:00 ` [PATCH v13 17/17] media: ti: j721e-csi2rx: Support system suspend using pm_notifier Rishikesh Donadkar
2026-05-20 12:25   ` Sakari Ailus
2026-05-20 13:14   ` sashiko-bot

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=20260520122739.C6CA11F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=r-donadkar@ti.com \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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