Skip to contentSkip to conversation

media: staging/imx: fill vb2_v4l2_buffer sequence entry

PATCH Superseded Peter Seiderer 4 participants 6 messages Mar 13, 2018 – Mar 14, 2018

Subsystems (4)

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 media: staging/imx: fill vb2_v4l2_buffer sequence entry

---
 drivers/staging/media/imx/imx-media-csi.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/staging/media/imx/imx-media-csi.c +5 -0
index 5a195f80a24d..3a6a645b9dce 100644
@@ -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 = &done->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(&priv->last_eof_comp);
+	priv->frame_sequence = 0;
 	priv->last_eof = false;
 	priv->nfb4eof = false;
 
Signature · 6 lines
2.16.2

_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
maintainer
#1 lore raw

Hi Peter,

Thanks for the patch.

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

Steve

Quoted 30 lines · Peter Seiderer
---
  drivers/staging/media/imx/imx-media-csi.c | 5 +++++
  1 file changed, 5 insertions(+)
drivers/staging/media/imx/imx-media-csi.c +4 -0
index 5a195f80a24d..3a6a645b9dce 100644
@@ -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 = &done->vbuf.vb2_buf;
  		vb->timestamp = ktime_get_ns();
  		vb2_buffer_done(vb, priv->nfb4eof ?

drivers/staging/media/imx/imx-media-csi.c static int csi_idmac_start(struct csi_priv *priv) · line 553

Quoted 7 lines
drivers/staging/media/imx/imx-media-csi.c +1 -0
@@ -543,6 +547,7 @@ static int csi_idmac_start(struct csi_priv *priv)
 
  	/* init EOF completion waitq */
  	init_completion(&priv->last_eof_comp);
+	priv->frame_sequence = 0;
  	priv->last_eof = false;
  	priv->nfb4eof = false;
 

_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

#2 lore raw

Hello Steve,

Quoted 6 lines · 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().

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

Quoted 43 lines

Steve

Quoted 37 lines · Peter Seiderer
---
  drivers/staging/media/imx/imx-media-csi.c | 5 +++++
  1 file changed, 5 insertions(+)
drivers/staging/media/imx/imx-media-csi.c +5 -0
index 5a195f80a24d..3a6a645b9dce 100644
@@ -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 = &done->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(&priv->last_eof_comp);
+	priv->frame_sequence = 0;
  	priv->last_eof = false;
  	priv->nfb4eof = false;
 
maintainer
#3 lore raw
Quoted 6 lines · Peter Seiderer

Hello Steve,

Quoted 2 lines · Steve Longerbeam

Hi Peter,

Quoted 7 lines
Quoted 4 lines

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

Quoted 32 lines · Peter Seiderer
Quoted 31 lines
Quoted 31 lines
---
   drivers/staging/media/imx/imx-media-csi.c | 5 +++++
   1 file changed, 5 insertions(+)
drivers/staging/media/imx/imx-media-csi.c +4 -0
index 5a195f80a24d..3a6a645b9dce 100644
@@ -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 = &done->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)
 
Quoted 6 lines
Quoted 6 lines

drivers/staging/media/imx/imx-media-csi.c static int csi_idmac_start(struct csi_priv *priv) · line 553

Quoted 6 lines
drivers/staging/media/imx/imx-media-csi.c +1 -0
   	/* init EOF completion waitq */
   	init_completion(&priv->last_eof_comp);
+	priv->frame_sequence = 0;
   	priv->last_eof = false;
   	priv->nfb4eof = false;
 

_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

#4 lore raw
In reply to Peter Seiderer
Quoted 4 lines · 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... :)
_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

#5 lore raw
In reply to Peter Seiderer

We need a changelog. How does this affect user space? What bug does this fix?

Quoted 10 lines · Peter Seiderer
---
 drivers/staging/media/imx/imx-media-csi.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/staging/media/imx/imx-media-csi.c +0 -0
index 5a195f80a24d..3a6a645b9dce 100644

drivers/staging/media/imx/imx-media-csi.c struct csi_priv { · line 114

Quoted 4 lines
drivers/staging/media/imx/imx-media-csi.c +1 -0
@@ -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.

drivers/staging/media/imx/imx-media-csi.c struct csi_priv { · line 117

Quoted 3 lines
drivers/staging/media/imx/imx-media-csi.c +0 -0
 	bool last_eof;   /* waiting for last EOF at stream off */
 	bool nfb4eof;    /* NFB4EOF encountered during streaming */
 	struct completion last_eof_comp;

regards,
dan carpenter

_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel