mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [RFC PATCH v1] media: rppx1: hist: Adjust configured LAST_MEAS_LINE
@ 2026-10-26 14:52 Barnabás Pőcze
  2026-11-04 10:16 ` Niklas Söderlund
  0 siblings, 1 reply; 2+ messages in thread
From: Barnabás Pőcze @ 2026-10-26 14:52 UTC (permalink / raw)
  To: Jacopo Mondi, Jai Luthra, Niklas Söderlund, Mauro Carvalho Chehab
  Cc: linux-media, linux-kernel, Barnabás Pőcze

The `LAST_MEAS_LINE` parameter determines at the end of which line the
interrupt is generated. The documentation states that it is usually
configured to the last line of the measurement window.

Currently it is programmed such that there is a margin of 2 lines after
the last measured line. This is more than what is required by the
documentation. So change it to the documentation suggested value.

Note, that this is in contrast to the "exm" module, where the last line
needs a margin of two lines on account of the division that is carried
out when calculating the average.

Signed-off-by: Barnabás Pőcze <barnabas.pocze+renesas@ideasonboard.com>
---

While this has worked in my testing, I'm sending this as an RFC because I'm
not sure if this is maybe a copy-paste issue from the "exm" module or if
someone has noticed scenarios where reality contradicts the documentation.

---
 drivers/media/platform/dreamchip/rppx1/rppx1_hist.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/platform/dreamchip/rppx1/rppx1_hist.c b/drivers/media/platform/dreamchip/rppx1/rppx1_hist.c
index 8fe8cbbc85df7..af82f31e4c86c 100644
--- a/drivers/media/platform/dreamchip/rppx1/rppx1_hist.c
+++ b/drivers/media/platform/dreamchip/rppx1/rppx1_hist.c
@@ -128,7 +128,7 @@ static int rppx1_hist_fill_params(struct rpp_module *mod,
 	 * Set last measurement line for ready interrupt. Ignore the value
 	 * from the parameters as it is only useful for fast-channel switching.
 	 */
-	write(priv, mod->base + HIST_LAST_MEAS_LINE_REG, v_offs + v_size + 1);
+	write(priv, mod->base + HIST_LAST_MEAS_LINE_REG, v_offs + v_size - 1);
 
 	/* Set measurement window weights. */
 	write(priv, mod->base + HIST_WEIGHT_00TO30_REG,
-- 
2.56.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [RFC PATCH v1] media: rppx1: hist: Adjust configured LAST_MEAS_LINE
  2026-10-26 14:52 [RFC PATCH v1] media: rppx1: hist: Adjust configured LAST_MEAS_LINE Barnabás Pőcze
@ 2026-11-04 10:16 ` Niklas Söderlund
  0 siblings, 0 replies; 2+ messages in thread
From: Niklas Söderlund @ 2026-11-04 10:16 UTC (permalink / raw)
  To: Barnabás Pőcze
  Cc: Jacopo Mondi, Jai Luthra, Mauro Carvalho Chehab, linux-media,
	linux-kernel

Hi Barnabás,

Thanks for your work.

On 2026-10-26 15:52:23 +0100, Barnabás Pőcze wrote:
> The `LAST_MEAS_LINE` parameter determines at the end of which line the
> interrupt is generated. The documentation states that it is usually
> configured to the last line of the measurement window.
> 
> Currently it is programmed such that there is a margin of 2 lines after
> the last measured line. This is more than what is required by the
> documentation. So change it to the documentation suggested value.
> 
> Note, that this is in contrast to the "exm" module, where the last line
> needs a margin of two lines on account of the division that is carried
> out when calculating the average.
> 
> Signed-off-by: Barnabás Pőcze <barnabas.pocze+renesas@ideasonboard.com>
> ---
> 
> While this has worked in my testing, I'm sending this as an RFC because I'm
> not sure if this is maybe a copy-paste issue from the "exm" module or if
> someone has noticed scenarios where reality contradicts the documentation.

I have re-checked the documentation and my notes, and most likely this 
is a copy-paste issue from the exm module. Thanks for fixing this. I 
have ran this thru my CI on SparrowHawk and no regressions detected.

Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>

> 
> ---
>  drivers/media/platform/dreamchip/rppx1/rppx1_hist.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/media/platform/dreamchip/rppx1/rppx1_hist.c b/drivers/media/platform/dreamchip/rppx1/rppx1_hist.c
> index 8fe8cbbc85df7..af82f31e4c86c 100644
> --- a/drivers/media/platform/dreamchip/rppx1/rppx1_hist.c
> +++ b/drivers/media/platform/dreamchip/rppx1/rppx1_hist.c
> @@ -128,7 +128,7 @@ static int rppx1_hist_fill_params(struct rpp_module *mod,
>  	 * Set last measurement line for ready interrupt. Ignore the value
>  	 * from the parameters as it is only useful for fast-channel switching.
>  	 */
> -	write(priv, mod->base + HIST_LAST_MEAS_LINE_REG, v_offs + v_size + 1);
> +	write(priv, mod->base + HIST_LAST_MEAS_LINE_REG, v_offs + v_size - 1);
>  
>  	/* Set measurement window weights. */
>  	write(priv, mod->base + HIST_WEIGHT_00TO30_REG,
> -- 
> 2.56.0
> 

-- 
Kind Regards,
Niklas Söderlund

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-11-04 10:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-26 14:52 [RFC PATCH v1] media: rppx1: hist: Adjust configured LAST_MEAS_LINE Barnabás Pőcze
2026-11-04 10:16 ` Niklas Söderlund

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®