From: "Gjorgji Rosikopulos (Consultant)" <gjorgji.rosikopulos@oss.qualcomm.com>
To: Loic Poulain <loic.poulain@oss.qualcomm.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Bryan O'Donoghue <bryan.odonoghue@linaro.org>,
Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>
Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-msm@vger.kernel.org
Subject: Re: [PATCH v4 08/14] media: qcom: camss: Timestamp buffers at start of frame
Date: Fri, 4 Dec 2026 09:59:53 +0200 [thread overview]
Message-ID: <a709655a-4cca-4478-9c79-ec4acf836c2a@oss.qualcomm.com> (raw)
In-Reply-To: <20261203-camss-hw-ts-v4-8-c271022b4b0d@oss.qualcomm.com>
Hi Loic,
On 12/3/2026 6:53 PM, Loic Poulain wrote:
> Buffers are stamped from the write master done interrupt, once the frame
> has been written out to memory, while V4L2 defines vb2_buf.timestamp as
> the time the first data byte was captured. Use the SOF time the CSID
> already computes instead, handed to the VFE the same way as the SOF
> sequence number. Hardware without SOF tracking keeps using the buf done
> time.
>
> Signed-off-by: Loic Poulain <loic.poulain@oss.qualcomm.com>
> ---
> drivers/media/platform/qcom/camss/camss-vfe-17x.c | 9 +++++----
> drivers/media/platform/qcom/camss/camss-vfe.c | 9 +++++----
> 2 files changed, 10 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/media/platform/qcom/camss/camss-vfe-17x.c b/drivers/media/platform/qcom/camss/camss-vfe-17x.c
> index 75f83601da8ef671d8a9f63e8df264729bf256f2..25840100a6565aef25140c7c472cd302573c9477 100644
> --- a/drivers/media/platform/qcom/camss/camss-vfe-17x.c
> +++ b/drivers/media/platform/qcom/camss/camss-vfe-17x.c
> @@ -472,7 +472,6 @@ static void vfe_isr_wm_done(struct vfe_device *vfe, u8 wm)
> struct vfe_output *output;
> unsigned long flags;
> u32 index;
> - u64 ts = ktime_get_ns();
>
> spin_lock_irqsave(&vfe->output_lock, flags);
>
> @@ -490,11 +489,13 @@ static void vfe_isr_wm_done(struct vfe_device *vfe, u8 wm)
> goto out_unlock;
> }
>
> - ready_buf->vb.vb2_buf.timestamp = ts;
> - if (line->sof)
> + if (line->sof) {
> + ready_buf->vb.vb2_buf.timestamp = atomic64_read(&line->sof->ts);
> ready_buf->vb.sequence = atomic_read(&line->sof->seq);
> - else
> + } else {
> + ready_buf->vb.vb2_buf.timestamp = ktime_get_ns();
> ready_buf->vb.sequence = output->sequence++;
> + }
>
> index = 0;
> output->buf[0] = output->buf[1];
> diff --git a/drivers/media/platform/qcom/camss/camss-vfe.c b/drivers/media/platform/qcom/camss/camss-vfe.c
> index 73320bffcd48936372a2b2c4f79b09d3575bdcec..87fc09f7849c6e147d2a3a8fc85233c2e1f52ebb 100644
> --- a/drivers/media/platform/qcom/camss/camss-vfe.c
> +++ b/drivers/media/platform/qcom/camss/camss-vfe.c
> @@ -456,7 +456,6 @@ void vfe_buf_done(struct vfe_device *vfe, int wm)
> struct vfe_output *output;
> unsigned long flags;
> u32 index;
> - u64 ts = ktime_get_ns();
>
> spin_lock_irqsave(&vfe->output_lock, flags);
>
> @@ -474,11 +473,13 @@ void vfe_buf_done(struct vfe_device *vfe, int wm)
> goto out_unlock;
> }
>
> - ready_buf->vb.vb2_buf.timestamp = ts;
> - if (line->sof)
> + if (line->sof) {
> + ready_buf->vb.vb2_buf.timestamp = atomic64_read(&line->sof->ts);
> ready_buf->vb.sequence = atomic_read(&line->sof->seq);
> - else
> + } else {
> + ready_buf->vb.vb2_buf.timestamp = ktime_get_ns();
> ready_buf->vb.sequence = output->sequence++;
> + }
>
> index = 0;
> output->buf[0] = output->buf[1];
Looks good to me.
Reviewed-by: Gjorgji Rosikopulos <gjorgji.rosikopulos@oss.qualcomm.com>
~Gjorgji
>
next prev parent reply other threads:[~2026-12-04 8:00 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-03 16:53 [PATCH v4 00/14] media: qcom: camss: Report the hardware SOF timestamp Loic Poulain
2026-12-03 16:53 ` [PATCH v4 01/14] media: qcom: camss: Add csid pad to port helper Loic Poulain
2026-12-03 16:53 ` [PATCH v4 02/14] media: qcom: camss: csid: Add an operation to read the SOF timestamp Loic Poulain
2026-12-04 7:31 ` Gjorgji Rosikopulos (Consultant)
2026-12-03 16:53 ` [PATCH v4 03/14] media: qcom: camss: csid-340: Report the hardware " Loic Poulain
2026-12-03 16:53 ` [PATCH v4 04/14] media: camss: Define timestamp registers for csid-gen2 Loic Poulain
2026-12-03 16:53 ` [PATCH v4 05/14] media: camss: csid-gen2: Report the hardware SOF timestamp Loic Poulain
2026-12-03 16:53 ` [PATCH v4 06/14] media: qcom: camss: csid-gen3: Fix the RDI timestamp controls on Titan 690 Loic Poulain
2026-12-04 7:44 ` Gjorgji Rosikopulos (Consultant)
2026-12-03 16:53 ` [PATCH v4 07/14] media: qcom: camss: csid-gen3: Report the hardware SOF timestamp Loic Poulain
2026-12-03 16:53 ` [PATCH v4 08/14] media: qcom: camss: Timestamp buffers at start of frame Loic Poulain
2026-12-04 7:59 ` Gjorgji Rosikopulos (Consultant) [this message]
2026-12-03 16:53 ` [PATCH v4 09/14] media: qcom: camss: Tell userspace we're using start-of-frame timestamps Loic Poulain
2026-12-04 8:54 ` Gjorgji Rosikopulos (Consultant)
2026-12-03 16:53 ` [PATCH v4 10/14] media: qcom: camss: csid: Let a consumer hook into the frame start Loic Poulain
2026-12-04 13:18 ` Gjorgji Rosikopulos (Consultant)
2026-12-03 16:53 ` [PATCH v4 11/14] media: qcom: camss: Stamp the buffer the write master is filling Loic Poulain
2026-12-04 13:31 ` Gjorgji Rosikopulos (Consultant)
2026-12-03 16:53 ` [PATCH v4 12/14] media: qcom: camss: vfe-gen3: Report the address of the current frame Loic Poulain
2026-12-04 13:32 ` Gjorgji Rosikopulos (Consultant)
2026-12-03 16:53 ` [PATCH v4 13/14] media: qcom: camss: vfe-680: " Loic Poulain
2026-12-04 14:49 ` Gjorgji Rosikopulos (Consultant)
2026-12-03 16:53 ` [PATCH v4 14/14] media: qcom: camss: vfe-340: " Loic Poulain
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=a709655a-4cca-4478-9c79-ec4acf836c2a@oss.qualcomm.com \
--to=gjorgji.rosikopulos@oss.qualcomm.com \
--cc=bryan.odonoghue@linaro.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=loic.poulain@oss.qualcomm.com \
--cc=mchehab@kernel.org \
--cc=vladimir.zapolskiy@linaro.org \
/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
all inboxes | Powered by JetHome®