All of lore.kernel.org
 help / color / mirror / Atom feed
From: Helen Koike <helen.koike@collabora.com>
To: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>,
	linux-media@vger.kernel.org
Cc: laurent.pinchart@ideasonboard.com, ezequiel@collabora.com,
	hverkuil@xs4all.nl, kernel@collabora.com, dafna3@gmail.com,
	sakari.ailus@linux.intel.com, linux-rockchip@lists.infradead.org,
	mchehab@kernel.org, tfiga@chromium.org
Subject: Re: [PATCH v2 08/14] media: staging: rkisp1: params: set vb.sequence to be the isp's frame_sequence + 1
Date: Mon, 17 Aug 2020 18:47:46 -0300	[thread overview]
Message-ID: <c6853613-0a08-44b0-6086-9805bb5ebd16@collabora.com> (raw)
In-Reply-To: <20200815103734.31153-9-dafna.hirschfeld@collabora.com>

Hi Dafna,

On 8/15/20 7:37 AM, Dafna Hirschfeld wrote:
> The params isr is called when a frame is out of the isp. The parameters
> are applied immediately since the isr updates the shadow registers.
> Therefore the params are first applied on the next frame.
> We want the vb.sequence to be the frame that the params are applied to.
> So we set vb.sequence to be the isp's frame_sequence + 1
> 
> Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>
> ---
>  drivers/staging/media/rkisp1/rkisp1-params.c | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/media/rkisp1/rkisp1-params.c b/drivers/staging/media/rkisp1/rkisp1-params.c
> index 134b5c9a94c1..4b4391c0a2a0 100644
> --- a/drivers/staging/media/rkisp1/rkisp1-params.c
> +++ b/drivers/staging/media/rkisp1/rkisp1-params.c
> @@ -1220,7 +1220,14 @@ void rkisp1_params_apply_params_cfg(struct rkisp1_params *params, unsigned int f
>  
>  void rkisp1_params_isr(struct rkisp1_device *rkisp1)
>  {
> -	unsigned int frame_sequence = atomic_read(&rkisp1->isp.frame_sequence);
> +	/*
> +	 * The params isr is called when a frame is out of the isp. The parameters
> +	 * are applied immediately since the isr updates the shadow registers.
> +	 * Therefore the params are first applied on the next frame.
> +	 * We want the vb.sequence to be the frame that the params are applied to.
> +	 * So we set vb.sequence to be the isp's frame_sequence + 1
> +	 */

I would just re-phrase this a bit, how about:

	This isr is called when the ISP finishes processing a frame.
	To configure the parameters, we update the shadow registers, which means
	that the next frame will already take these new configuration into consideration.
	Since frame_sequence is only updated on the vertical sync signal, we should use
	frame_sequence + 1 here to indicate to userspace which frame this parameters
	are being applied to.


Or maybe smaller:

	This isr is called when the ISP finishes processing a frame.
	Configurations performed here will be applied to the next frame.	
	Since frame_sequence is only updated on the vertical sync signal, we should use
	frame_sequence + 1 here to indicate to userspace which frame this parameters
	are being applied to.

What do you think?

With an improvement in the text (and also commit message):

Acked-by: Helen Koike <helen.koike@collabora.com>

Regards,
Helen

> +	unsigned int frame_sequence = atomic_read(&rkisp1->isp.frame_sequence) + 1;
>  	struct rkisp1_params *params = &rkisp1->params;
>  
>  	spin_lock(&params->config_lock);
> 

WARNING: multiple messages have this Message-ID (diff)
From: Helen Koike <helen.koike@collabora.com>
To: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>,
	linux-media@vger.kernel.org
Cc: mchehab@kernel.org, dafna3@gmail.com, tfiga@chromium.org,
	hverkuil@xs4all.nl, linux-rockchip@lists.infradead.org,
	laurent.pinchart@ideasonboard.com, sakari.ailus@linux.intel.com,
	kernel@collabora.com, ezequiel@collabora.com
Subject: Re: [PATCH v2 08/14] media: staging: rkisp1: params: set vb.sequence to be the isp's frame_sequence + 1
Date: Mon, 17 Aug 2020 18:47:46 -0300	[thread overview]
Message-ID: <c6853613-0a08-44b0-6086-9805bb5ebd16@collabora.com> (raw)
In-Reply-To: <20200815103734.31153-9-dafna.hirschfeld@collabora.com>

Hi Dafna,

On 8/15/20 7:37 AM, Dafna Hirschfeld wrote:
> The params isr is called when a frame is out of the isp. The parameters
> are applied immediately since the isr updates the shadow registers.
> Therefore the params are first applied on the next frame.
> We want the vb.sequence to be the frame that the params are applied to.
> So we set vb.sequence to be the isp's frame_sequence + 1
> 
> Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>
> ---
>  drivers/staging/media/rkisp1/rkisp1-params.c | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/media/rkisp1/rkisp1-params.c b/drivers/staging/media/rkisp1/rkisp1-params.c
> index 134b5c9a94c1..4b4391c0a2a0 100644
> --- a/drivers/staging/media/rkisp1/rkisp1-params.c
> +++ b/drivers/staging/media/rkisp1/rkisp1-params.c
> @@ -1220,7 +1220,14 @@ void rkisp1_params_apply_params_cfg(struct rkisp1_params *params, unsigned int f
>  
>  void rkisp1_params_isr(struct rkisp1_device *rkisp1)
>  {
> -	unsigned int frame_sequence = atomic_read(&rkisp1->isp.frame_sequence);
> +	/*
> +	 * The params isr is called when a frame is out of the isp. The parameters
> +	 * are applied immediately since the isr updates the shadow registers.
> +	 * Therefore the params are first applied on the next frame.
> +	 * We want the vb.sequence to be the frame that the params are applied to.
> +	 * So we set vb.sequence to be the isp's frame_sequence + 1
> +	 */

I would just re-phrase this a bit, how about:

	This isr is called when the ISP finishes processing a frame.
	To configure the parameters, we update the shadow registers, which means
	that the next frame will already take these new configuration into consideration.
	Since frame_sequence is only updated on the vertical sync signal, we should use
	frame_sequence + 1 here to indicate to userspace which frame this parameters
	are being applied to.


Or maybe smaller:

	This isr is called when the ISP finishes processing a frame.
	Configurations performed here will be applied to the next frame.	
	Since frame_sequence is only updated on the vertical sync signal, we should use
	frame_sequence + 1 here to indicate to userspace which frame this parameters
	are being applied to.

What do you think?

With an improvement in the text (and also commit message):

Acked-by: Helen Koike <helen.koike@collabora.com>

Regards,
Helen

> +	unsigned int frame_sequence = atomic_read(&rkisp1->isp.frame_sequence) + 1;
>  	struct rkisp1_params *params = &rkisp1->params;
>  
>  	spin_lock(&params->config_lock);
> 

_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

  reply	other threads:[~2020-08-17 21:47 UTC|newest]

Thread overview: 71+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-15 10:37 [PATCH v2 00/14] media: staging: rkisp1: various bug fixes Dafna Hirschfeld
2020-08-15 10:37 ` Dafna Hirschfeld
2020-08-15 10:37 ` [PATCH v2 01/14] media: staging: rkisp1: call params isr only upon frame out Dafna Hirschfeld
2020-08-15 10:37   ` Dafna Hirschfeld
2020-08-17 21:46   ` Helen Koike
2020-08-17 21:46     ` Helen Koike
2020-08-15 10:37 ` [PATCH v2 02/14] media: staging: rkisp1: params: use rkisp1_param_set_bits to set reg in isr Dafna Hirschfeld
2020-08-15 10:37   ` Dafna Hirschfeld
2020-08-17 21:46   ` Helen Koike
2020-08-17 21:46     ` Helen Koike
2020-08-15 10:37 ` [PATCH v2 03/14] media: staging: rkisp1: params: use the new effect value in cproc config Dafna Hirschfeld
2020-08-15 10:37   ` Dafna Hirschfeld
2020-08-17 21:46   ` Helen Koike
2020-08-17 21:46     ` Helen Koike
2020-08-15 10:37 ` [PATCH v2 04/14] media: staging: rkisp1: params: don't release lock in isr before buffer is done Dafna Hirschfeld
2020-08-15 10:37   ` Dafna Hirschfeld
2020-08-17 21:47   ` Helen Koike
2020-08-17 21:47     ` Helen Koike
2020-08-15 10:37 ` [PATCH v2 05/14] media: staging: rkisp1: params: upon stream stop, iterate a local list to return the buffers Dafna Hirschfeld
2020-08-15 10:37   ` Dafna Hirschfeld
2020-08-17 21:47   ` Helen Koike
2020-08-17 21:47     ` Helen Koike
2020-08-20  9:27     ` Hans Verkuil
2020-08-20  9:27       ` Hans Verkuil
2020-08-20 12:16       ` Helen Koike
2020-08-20 12:16         ` Helen Koike
2020-08-15 10:37 ` [PATCH v2 06/14] media: staging: rkisp1: params: in the isr, return if buffer list is empty Dafna Hirschfeld
2020-08-15 10:37   ` Dafna Hirschfeld
2020-08-17 21:47   ` Helen Koike
2020-08-17 21:47     ` Helen Koike
2020-08-15 10:37 ` [PATCH v2 07/14] media: staging: rkisp1: params: avoid using buffer if params is not streaming Dafna Hirschfeld
2020-08-15 10:37   ` Dafna Hirschfeld
2020-08-16  4:28   ` kernel test robot
2020-08-16  4:28     ` kernel test robot
2020-08-16  4:28     ` kernel test robot
2020-08-17 21:47   ` Helen Koike
2020-08-17 21:47     ` Helen Koike
2020-08-15 10:37 ` [PATCH v2 08/14] media: staging: rkisp1: params: set vb.sequence to be the isp's frame_sequence + 1 Dafna Hirschfeld
2020-08-15 10:37   ` Dafna Hirschfeld
2020-08-17 21:47   ` Helen Koike [this message]
2020-08-17 21:47     ` Helen Koike
2020-08-15 10:37 ` [PATCH v2 09/14] media: staging: rkisp1: remove atomic operations for frame sequence Dafna Hirschfeld
2020-08-15 10:37   ` Dafna Hirschfeld
2020-08-17 21:48   ` Helen Koike
2020-08-17 21:48     ` Helen Koike
2020-09-17 16:41     ` Dafna Hirschfeld
2020-09-17 16:41       ` Dafna Hirschfeld
2020-08-15 10:37 ` [PATCH v2 10/14] media: staging: rkisp1: isp: add a warning and debugfs var for irq delay Dafna Hirschfeld
2020-08-15 10:37   ` Dafna Hirschfeld
2020-08-17 21:48   ` Helen Koike
2020-08-17 21:48     ` Helen Koike
2020-08-18  6:46     ` Dafna Hirschfeld
2020-08-18  6:46       ` Dafna Hirschfeld
2020-08-15 10:37 ` [PATCH v2 11/14] media: staging: rkisp1: isp: don't enable signal RKISP1_CIF_ISP_FRAME_IN Dafna Hirschfeld
2020-08-15 10:37   ` Dafna Hirschfeld
2020-08-17 21:48   ` Helen Koike
2020-08-17 21:48     ` Helen Koike
2020-08-18  6:37     ` Dafna Hirschfeld
2020-08-18  6:37       ` Dafna Hirschfeld
2020-08-15 10:37 ` [PATCH v2 12/14] media: staging: rkisp1: stats: protect write to 'is_streaming' in start_streaming cb Dafna Hirschfeld
2020-08-15 10:37   ` Dafna Hirschfeld
2020-08-17 21:48   ` Helen Koike
2020-08-17 21:48     ` Helen Koike
2020-08-15 10:37 ` [PATCH v2 13/14] media: staging: rkisp1: call media_pipeline_start/stop from stats and params Dafna Hirschfeld
2020-08-15 10:37   ` Dafna Hirschfeld
2020-08-17 21:48   ` Helen Koike
2020-08-17 21:48     ` Helen Koike
2020-08-15 10:37 ` [PATCH v2 14/14] media: staging: rkisp1: params: no need to lock default config Dafna Hirschfeld
2020-08-15 10:37   ` Dafna Hirschfeld
2020-08-17 21:48   ` Helen Koike
2020-08-17 21:48     ` Helen Koike

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=c6853613-0a08-44b0-6086-9805bb5ebd16@collabora.com \
    --to=helen.koike@collabora.com \
    --cc=dafna.hirschfeld@collabora.com \
    --cc=dafna3@gmail.com \
    --cc=ezequiel@collabora.com \
    --cc=hverkuil@xs4all.nl \
    --cc=kernel@collabora.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=mchehab@kernel.org \
    --cc=sakari.ailus@linux.intel.com \
    --cc=tfiga@chromium.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.