Re: [PATCH] media: staging/imx: fill vb2_v4l2_buffer sequence entry

2018-03-14 Thread Dan Carpenter
We need a changelog.  How does this affect user space?  What bug does
this fix?

On Tue, Mar 13, 2018 at 09:00:54PM +0100, Peter Seiderer wrote:
> Signed-off-by: Peter Seiderer 
> ---
>  drivers/staging/media/imx/imx-media-csi.c | 5 +
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/staging/media/imx/imx-media-csi.c 
> b/drivers/staging/media/imx/imx-media-csi.c
> index 5a195f80a24d..3a6a645b9dce 100644
> --- a/drivers/staging/media/imx/imx-media-csi.c
> +++ b/drivers/staging/media/imx/imx-media-csi.c
> @@ -111,6 +111,7 @@ struct csi_priv {
>   struct v4l2_ctrl_handler ctrl_hdlr;
>  
>   int stream_count; /* streaming counter */
> + __u32 frame_sequence; /* frame sequence counter */

Use u32 because this is not a user space header.

>   bool last_eof;   /* waiting for last EOF at stream off */
>   bool nfb4eof;/* NFB4EOF encountered during streaming */
>   struct completion last_eof_comp;

regards,
dan carpenter




Re: [PATCH] media: staging/imx: fill vb2_v4l2_buffer sequence entry

2018-03-14 Thread Greg Kroah-Hartman
On Tue, Mar 13, 2018 at 09:00:54PM +0100, Peter Seiderer wrote:
> Signed-off-by: Peter Seiderer 
> ---
>  drivers/staging/media/imx/imx-media-csi.c | 5 +
>  1 file changed, 5 insertions(+)

I know I don't take patches with an empty changelog description, but
other maintainers might be much more forgiving... :)


Re: [PATCH] media: staging/imx: fill vb2_v4l2_buffer sequence entry

2018-03-13 Thread Steve Longerbeam



On 03/13/2018 03:24 PM, Peter Seiderer wrote:

Hello Steve,

On Tue, 13 Mar 2018 15:03:07 -0700, Steve Longerbeam  
wrote:


Hi Peter,

Thanks for the patch.

This needs to be done in imx-ic-prpencvf.c as well, see
prp_vb2_buf_done().

Ahh, I see, would you prefer an follow up patch or
an v2 patch doing the changes on mx-media-csi.c and
imx-ic-prpencvf.c at once?


Hi Peter, a v2 patch would be fine.

Steve



On 03/13/2018 01:00 PM, Peter Seiderer wrote:

Signed-off-by: Peter Seiderer 
---
   drivers/staging/media/imx/imx-media-csi.c | 5 +
   1 file changed, 5 insertions(+)

diff --git a/drivers/staging/media/imx/imx-media-csi.c 
b/drivers/staging/media/imx/imx-media-csi.c
index 5a195f80a24d..3a6a645b9dce 100644
--- a/drivers/staging/media/imx/imx-media-csi.c
+++ b/drivers/staging/media/imx/imx-media-csi.c
@@ -111,6 +111,7 @@ struct csi_priv {
struct v4l2_ctrl_handler ctrl_hdlr;
   
   	int stream_count; /* streaming counter */

+   __u32 frame_sequence; /* frame sequence counter */
bool last_eof;   /* waiting for last EOF at stream off */
bool nfb4eof;/* NFB4EOF encountered during streaming */
struct completion last_eof_comp;
@@ -234,8 +235,11 @@ static void csi_vb2_buf_done(struct csi_priv *priv)
struct vb2_buffer *vb;
dma_addr_t phys;
   
+	priv->frame_sequence++;

+
done = priv->active_vb2_buf[priv->ipu_buf_num];
if (done) {
+   done->vbuf.sequence = priv->frame_sequence;
vb = >vbuf.vb2_buf;
vb->timestamp = ktime_get_ns();
vb2_buffer_done(vb, priv->nfb4eof ?
@@ -543,6 +547,7 @@ static int csi_idmac_start(struct csi_priv *priv)
   
   	/* init EOF completion waitq */

init_completion(>last_eof_comp);
+   priv->frame_sequence = 0;
priv->last_eof = false;
priv->nfb4eof = false;
 




Re: [PATCH] media: staging/imx: fill vb2_v4l2_buffer sequence entry

2018-03-13 Thread Peter Seiderer
Hello Steve,

On Tue, 13 Mar 2018 15:03:07 -0700, Steve Longerbeam  
wrote:

> Hi Peter,
> 
> Thanks for the patch.
> 
> This needs to be done in imx-ic-prpencvf.c as well, see
> prp_vb2_buf_done().

Ahh, I see, would you prefer an follow up patch or
an v2 patch doing the changes on mx-media-csi.c and
imx-ic-prpencvf.c at once?

Regards,
Peter

> 
> Steve
> 
> 
> On 03/13/2018 01:00 PM, Peter Seiderer wrote:
> > Signed-off-by: Peter Seiderer 
> > ---
> >   drivers/staging/media/imx/imx-media-csi.c | 5 +
> >   1 file changed, 5 insertions(+)
> >
> > diff --git a/drivers/staging/media/imx/imx-media-csi.c 
> > b/drivers/staging/media/imx/imx-media-csi.c
> > index 5a195f80a24d..3a6a645b9dce 100644
> > --- a/drivers/staging/media/imx/imx-media-csi.c
> > +++ b/drivers/staging/media/imx/imx-media-csi.c
> > @@ -111,6 +111,7 @@ struct csi_priv {
> > struct v4l2_ctrl_handler ctrl_hdlr;
> >   
> > int stream_count; /* streaming counter */
> > +   __u32 frame_sequence; /* frame sequence counter */
> > bool last_eof;   /* waiting for last EOF at stream off */
> > bool nfb4eof;/* NFB4EOF encountered during streaming */
> > struct completion last_eof_comp;
> > @@ -234,8 +235,11 @@ static void csi_vb2_buf_done(struct csi_priv *priv)
> > struct vb2_buffer *vb;
> > dma_addr_t phys;
> >   
> > +   priv->frame_sequence++;
> > +
> > done = priv->active_vb2_buf[priv->ipu_buf_num];
> > if (done) {
> > +   done->vbuf.sequence = priv->frame_sequence;
> > vb = >vbuf.vb2_buf;
> > vb->timestamp = ktime_get_ns();
> > vb2_buffer_done(vb, priv->nfb4eof ?
> > @@ -543,6 +547,7 @@ static int csi_idmac_start(struct csi_priv *priv)
> >   
> > /* init EOF completion waitq */
> > init_completion(>last_eof_comp);
> > +   priv->frame_sequence = 0;
> > priv->last_eof = false;
> > priv->nfb4eof = false;
> > 
> 



Re: [PATCH] media: staging/imx: fill vb2_v4l2_buffer sequence entry

2018-03-13 Thread Steve Longerbeam

Hi Peter,

Thanks for the patch.

This needs to be done in imx-ic-prpencvf.c as well, see
prp_vb2_buf_done().

Steve


On 03/13/2018 01:00 PM, Peter Seiderer wrote:

Signed-off-by: Peter Seiderer 
---
  drivers/staging/media/imx/imx-media-csi.c | 5 +
  1 file changed, 5 insertions(+)

diff --git a/drivers/staging/media/imx/imx-media-csi.c 
b/drivers/staging/media/imx/imx-media-csi.c
index 5a195f80a24d..3a6a645b9dce 100644
--- a/drivers/staging/media/imx/imx-media-csi.c
+++ b/drivers/staging/media/imx/imx-media-csi.c
@@ -111,6 +111,7 @@ struct csi_priv {
struct v4l2_ctrl_handler ctrl_hdlr;
  
  	int stream_count; /* streaming counter */

+   __u32 frame_sequence; /* frame sequence counter */
bool last_eof;   /* waiting for last EOF at stream off */
bool nfb4eof;/* NFB4EOF encountered during streaming */
struct completion last_eof_comp;
@@ -234,8 +235,11 @@ static void csi_vb2_buf_done(struct csi_priv *priv)
struct vb2_buffer *vb;
dma_addr_t phys;
  
+	priv->frame_sequence++;

+
done = priv->active_vb2_buf[priv->ipu_buf_num];
if (done) {
+   done->vbuf.sequence = priv->frame_sequence;
vb = >vbuf.vb2_buf;
vb->timestamp = ktime_get_ns();
vb2_buffer_done(vb, priv->nfb4eof ?
@@ -543,6 +547,7 @@ static int csi_idmac_start(struct csi_priv *priv)
  
  	/* init EOF completion waitq */

init_completion(>last_eof_comp);
+   priv->frame_sequence = 0;
priv->last_eof = false;
priv->nfb4eof = false;
  




[PATCH] media: staging/imx: fill vb2_v4l2_buffer sequence entry

2018-03-13 Thread Peter Seiderer
Signed-off-by: Peter Seiderer 
---
 drivers/staging/media/imx/imx-media-csi.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/drivers/staging/media/imx/imx-media-csi.c 
b/drivers/staging/media/imx/imx-media-csi.c
index 5a195f80a24d..3a6a645b9dce 100644
--- a/drivers/staging/media/imx/imx-media-csi.c
+++ b/drivers/staging/media/imx/imx-media-csi.c
@@ -111,6 +111,7 @@ struct csi_priv {
struct v4l2_ctrl_handler ctrl_hdlr;
 
int stream_count; /* streaming counter */
+   __u32 frame_sequence; /* frame sequence counter */
bool last_eof;   /* waiting for last EOF at stream off */
bool nfb4eof;/* NFB4EOF encountered during streaming */
struct completion last_eof_comp;
@@ -234,8 +235,11 @@ static void csi_vb2_buf_done(struct csi_priv *priv)
struct vb2_buffer *vb;
dma_addr_t phys;
 
+   priv->frame_sequence++;
+
done = priv->active_vb2_buf[priv->ipu_buf_num];
if (done) {
+   done->vbuf.sequence = priv->frame_sequence;
vb = >vbuf.vb2_buf;
vb->timestamp = ktime_get_ns();
vb2_buffer_done(vb, priv->nfb4eof ?
@@ -543,6 +547,7 @@ static int csi_idmac_start(struct csi_priv *priv)
 
/* init EOF completion waitq */
init_completion(>last_eof_comp);
+   priv->frame_sequence = 0;
priv->last_eof = false;
priv->nfb4eof = false;
 
-- 
2.16.2