mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
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 09/14] media: qcom: camss: Tell userspace we're using start-of-frame timestamps
Date: Fri, 4 Dec 2026 10:54:06 +0200	[thread overview]
Message-ID: <1d5a1947-5d8c-48dc-bdb5-c3e1297979d7@oss.qualcomm.com> (raw)
In-Reply-To: <20261203-camss-hw-ts-v4-9-c271022b4b0d@oss.qualcomm.com>

Hi Loic,

On 12/3/2026 6:53 PM, Loic Poulain wrote:
> On the SoCs whose CSID can track the start of frame, the buffer
> timestamp is taken when the reception of the frame begins, not once it
> has been written out to memory. Show this to userspace with the
> V4L2_BUF_FLAG_TSTAMP_SRC_SOE buffer flag, the closest the API has to
> offer, it is defined as the start of the exposure, which on a rolling
> shutter sensor precedes the start of the readout by the exposure time
> of the first row.
> 
> Signed-off-by: Loic Poulain <loic.poulain@oss.qualcomm.com>
> ---
>  drivers/media/platform/qcom/camss/camss-video.c | 2 ++
>  drivers/media/platform/qcom/camss/camss.c       | 6 ++++++
>  drivers/media/platform/qcom/camss/camss.h       | 1 +
>  3 files changed, 9 insertions(+)
> 
> diff --git a/drivers/media/platform/qcom/camss/camss-video.c b/drivers/media/platform/qcom/camss/camss-video.c
> index 5de6ff5ecc76a2863e536fca1c40ae6b2de6dc0c..4ce87527b9b984068f5c9a9cc3bbdca645cff1d3 100644
> --- a/drivers/media/platform/qcom/camss/camss-video.c
> +++ b/drivers/media/platform/qcom/camss/camss-video.c
> @@ -698,6 +698,8 @@ int msm_video_register(struct camss_video *video, struct v4l2_device *v4l2_dev,
>  	q->type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
>  	q->io_modes = VB2_DMABUF | VB2_MMAP | VB2_READ;
>  	q->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC;
> +	if (camss_has_frame_sync(video->camss))
> +		q->timestamp_flags |= V4L2_BUF_FLAG_TSTAMP_SRC_SOE;
>  	q->buf_struct_size = sizeof(struct camss_buffer);
>  	q->dev = video->camss->dev;
>  	q->lock = &video->q_lock;
> diff --git a/drivers/media/platform/qcom/camss/camss.c b/drivers/media/platform/qcom/camss/camss.c
> index 26e3f2aa3ef2485e0486eaa89f93b804926b6e32..e60aa29051e71cd70bd3564a01655251ba2f37e6 100644
> --- a/drivers/media/platform/qcom/camss/camss.c
> +++ b/drivers/media/platform/qcom/camss/camss.c
> @@ -4839,6 +4839,12 @@ int camss_get_pixel_clock(struct media_entity *entity, u64 *pixel_clock)
>  	return 0;
>  }
>  
> +bool camss_has_frame_sync(struct camss *camss)
> +{
> +	/* All the CSIDs of a given SoC have the same capability */
> +	return camss->res->csid_res[0].csid.frame_sync_en;
> +}

Maybe shall be moved to global resources. But that was not introduced in this series.
So maybe some cleanup latter.

> +
>  int camss_pm_domain_on(struct camss *camss, int id)
>  {
>  	int ret = 0;
> diff --git a/drivers/media/platform/qcom/camss/camss.h b/drivers/media/platform/qcom/camss/camss.h
> index 8154fab54f99b12456cb377dc4ddfcadfcf8278e..da1095c436323639bc0fda5ebac8026a09565108 100644
> --- a/drivers/media/platform/qcom/camss/camss.h
> +++ b/drivers/media/platform/qcom/camss/camss.h
> @@ -177,6 +177,7 @@ struct media_pad *camss_find_sensor_pad(struct media_entity *entity);
>  s64 camss_get_link_freq(struct media_entity *entity, unsigned int bpp,
>  			unsigned int lanes);
>  int camss_get_pixel_clock(struct media_entity *entity, u64 *pixel_clock);
> +bool camss_has_frame_sync(struct camss *camss);
>  int camss_pm_domain_on(struct camss *camss, int id);
>  void camss_pm_domain_off(struct camss *camss, int id);
>  int camss_vfe_get(struct camss *camss, int id);

Looks good to me.

Reviewed-by: Gjorgji Rosikopulos <gjorgji.rosikopulos@oss.qualcomm.com>

> 


  reply	other threads:[~2026-12-04  8:54 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)
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) [this message]
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=1d5a1947-5d8c-48dc-bdb5-c3e1297979d7@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®