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 06/14] media: qcom: camss: csid-gen3: Fix the RDI timestamp controls on Titan 690
Date: Fri, 4 Dec 2026 09:44:47 +0200	[thread overview]
Message-ID: <39aeddf4-53b5-4057-beec-11d3ef4b1d94@oss.qualcomm.com> (raw)
In-Reply-To: <20261203-camss-hw-ts-v4-6-c271022b4b0d@oss.qualcomm.com>

Hi Loic,

On 12/3/2026 6:53 PM, Loic Poulain wrote:
> The RDI timestamp enable and strobe select bits are programmed at fixed
> positions in RDI_CFG0, but Titan 690 moved both controls to RDI_CFG1 and
> narrowed the strobe select from bits [9:8] to bits [1:0]. On 8775P and
> 8300 the current values therefore land on unrelated fields of RDI_CFG0
> and the timestamp latch is never armed.
> 
> Pick the register and the bit positions per SoC, and program them with a
> read-modify-write of their own rather than folding them into the
> RDI_CFG0 value, which is where they no longer necessarily belong.
> 
> No functional change on the SoCs that keep the controls in RDI_CFG0.
> 
> Signed-off-by: Loic Poulain <loic.poulain@oss.qualcomm.com>
> ---
>  .../media/platform/qcom/camss/camss-csid-gen3.c    | 23 +++++++++++++++++-----
>  1 file changed, 18 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/media/platform/qcom/camss/camss-csid-gen3.c b/drivers/media/platform/qcom/camss/camss-csid-gen3.c
> index 6a538d825f78be5cf64691c351149b0a8fa68c3d..5dce6f722d05817f43341d22560cbe32def08cf0 100644
> --- a/drivers/media/platform/qcom/camss/camss-csid-gen3.c
> +++ b/drivers/media/platform/qcom/camss/camss-csid-gen3.c
> @@ -80,8 +80,6 @@
>  #define CSID_RDI_CFG0(rdi)	(csid_is_lite(csid) && IS_CSID_690(csid) ?\
>  					(0x300 + 0x100 * (rdi)) :\
>  					(0x500 + 0x100 * (rdi)))
> -#define		RDI_CFG0_TIMESTAMP_EN		BIT(6)
> -#define		RDI_CFG0_TIMESTAMP_STB_SEL	BIT(8)
>  #define		RDI_CFG0_DECODE_FORMAT		12
>  #define		RDI_CFG0_DT			16
>  #define		RDI_CFG0_VC			22
> @@ -103,6 +101,17 @@
>  #define		RDI_CFG1_PIX_STORE		BIT(10)
>  #define		RDI_CFG1_PACKING_FORMAT_MIPI	BIT(15)
>  
> +/*
> + * Titan 690 moved the timestamp controls from RDI_CFG0 to RDI_CFG1, with the
> + * strobe selecting which event latches TIMESTAMP_CURRx at bits [1:0] instead
> + * of [9:8].
> + */
> +#define CSID_RDI_TIMESTAMP_CFG(rdi)	(IS_CSID_690(csid) ?\
> +						CSID_RDI_CFG1(rdi) :\
> +						CSID_RDI_CFG0(rdi))
> +#define		RDI_CFG_TIMESTAMP_EN		(IS_CSID_690(csid) ? BIT(4) : BIT(6))
> +#define		RDI_CFG_TIMESTAMP_STB_SEL	(IS_CSID_690(csid) ? BIT(0) : BIT(8))
> +
>  #define CSID_RDI_IRQ_SUBSAMPLE_PATTERN(rdi)	(csid_is_lite(csid) && IS_CSID_690(csid) ?\
>  							(0x348 + 0x100 * (rdi)) :\
>  							(0x548 + 0x100 * (rdi)))
> @@ -188,10 +197,8 @@ static void __csid_configure_rdi_stream(struct csid_device *csid, u8 enable, u8
>  	 */
>  	u8 dt_id = port & 0x03;
>  
> -	val = RDI_CFG0_TIMESTAMP_EN;
> -	val |= RDI_CFG0_TIMESTAMP_STB_SEL;
>  	/* note: for non-RDI path, this should be format->decode_format */
> -	val |= DECODE_FORMAT_PAYLOAD_ONLY << RDI_CFG0_DECODE_FORMAT;
> +	val = DECODE_FORMAT_PAYLOAD_ONLY << RDI_CFG0_DECODE_FORMAT;
>  	val |= vc << RDI_CFG0_VC;
>  	val |= format->data_type << RDI_CFG0_DT;
>  	val |= dt_id << RDI_CFG0_DT_ID;
> @@ -207,6 +214,12 @@ static void __csid_configure_rdi_stream(struct csid_device *csid, u8 enable, u8
>  
>  	writel(val, csid->base + CSID_RDI_CFG1(port));
>  
> +	/* Arm the SOF timestamp latch, whichever register holds its controls */
> +	val = readl(csid->base + CSID_RDI_TIMESTAMP_CFG(port));
> +	val |= RDI_CFG_TIMESTAMP_EN;
> +	val |= RDI_CFG_TIMESTAMP_STB_SEL;
> +	writel(val, csid->base + CSID_RDI_TIMESTAMP_CFG(port));
> +
>  	val = 0;
>  	writel(val, csid->base + CSID_RDI_IRQ_SUBSAMPLE_PERIOD(port));

Although i am not a fan of having all of those define wit is_lite IS_CSID etc. 
It makes code difficult to track. But that is my opinion.

That is not what this change introduces i am just noting. Appart from that:

Looks good to me.

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

~Gjorgji



>  
> 


  reply	other threads:[~2026-12-04  7:44 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) [this message]
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)
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=39aeddf4-53b5-4057-beec-11d3ef4b1d94@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®