public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Cc: linux-media@vger.kernel.org, sakari.ailus@linux.intel.com,
	Jacopo Mondi <jacopo+renesas@jmondi.org>,
	niklas.soderlund+renesas@ragnatech.se,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Hans Verkuil <hverkuil-cisco@xs4all.nl>,
	Pratyush Yadav <p.yadav@ti.com>
Subject: Re: [PATCH 4/6] media: ti: cal: use CSI-2 frame number for seq number
Date: Fri, 22 Apr 2022 19:53:59 +0300	[thread overview]
Message-ID: <YmLdpwLfxpcXzVC6@pendragon.ideasonboard.com> (raw)
In-Reply-To: <7a43e054-5e9d-2858-929b-874b7c6a0c86@ideasonboard.com>

Hi Tomi,

On Fri, Apr 22, 2022 at 09:41:51AM +0300, Tomi Valkeinen wrote:
> On 22/04/2022 02:52, Laurent Pinchart wrote:
> > On Thu, Apr 21, 2022 at 05:34:47PM +0300, Tomi Valkeinen wrote:
> >> The userspace needs a way to match received metadata buffers to pixel
> >> data buffers. The obvious way to do this is to use the CSI-2 frame
> >> number, as both the metadata and the pixel data have the same frame
> >> number as they come from the same frame.
> >>
> >> However, we don't have means to convey the frame number to userspace. We
> >> do have the 'sequence' field, which with a few tricks can be used for
> >> this purpose.
> >>
> >> To achieve this, track the frame number for each virtual channel and
> >> increase the sequence for each virtual channel by frame-number -
> >> previous-frame-number, also taking into account the eventual wrap of the
> >> CSI-2 frame number.
> >>
> >> This way we get a monotonically increasing sequence number which is
> >> common to all streams using the same virtual channel.
> > 
> > I'd agree in principle, if it wasn't for the fact that sensors are not
> > required to produce a frame number :-S
> 
> In that case the CAL hardware will increment the register every frame. 
>  From CAL doc:
> 
> Frame number.
> Matches the frame number sent by the camera when the
> camera transmits it.
> Otherwise, incremented by one on every FS short packet
> for this context.

Is that only when the FS packet contains a frame number equal to 0 ? How
about the extreme case where the frame number counts up to 2 and resets
to 1, effectively toggling between 1 and 2 ? Does your patch support
this correctly ?

> Reset when the context is enabled.
> 
> I'll add a note about that to the desc.

-- 
Regards,

Laurent Pinchart

  reply	other threads:[~2022-04-22 16:54 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-21 14:34 [PATCH 0/6] media: ti: cal: misc fixes Tomi Valkeinen
2022-04-21 14:34 ` [PATCH 1/6] media: ti: cal: fix error paths in cal_camerarx_create() Tomi Valkeinen
2022-04-21 20:01   ` Laurent Pinchart
2022-04-22  6:50     ` Tomi Valkeinen
2022-04-21 14:34 ` [PATCH 2/6] media: ti: cal: fix useless variable init Tomi Valkeinen
2022-04-21 20:02   ` Laurent Pinchart
2022-04-21 14:34 ` [PATCH 3/6] media: ti: cal: rename sd_state to state Tomi Valkeinen
2022-04-21 23:48   ` Laurent Pinchart
2022-04-21 14:34 ` [PATCH 4/6] media: ti: cal: use CSI-2 frame number for seq number Tomi Valkeinen
2022-04-21 23:52   ` Laurent Pinchart
2022-04-22  6:41     ` Tomi Valkeinen
2022-04-22 16:53       ` Laurent Pinchart [this message]
2022-04-25  7:21         ` Tomi Valkeinen
2022-04-21 14:34 ` [PATCH 5/6] media: ti: cal: combine wdma irq handling Tomi Valkeinen
2022-04-21 23:54   ` Laurent Pinchart
2022-04-21 14:34 ` [PATCH 6/6] media: ti: cal: fix wdma irq for metadata Tomi Valkeinen

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=YmLdpwLfxpcXzVC6@pendragon.ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=jacopo+renesas@jmondi.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=niklas.soderlund+renesas@ragnatech.se \
    --cc=p.yadav@ti.com \
    --cc=sakari.ailus@linux.intel.com \
    --cc=tomi.valkeinen@ideasonboard.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