[PATCH 0/5] media: davinci: vpif fixes

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH 0/5] media: davinci: vpif fixes

Lad, Prabhakar
this patch series fixes several small issues in VPIF driver.

Lad, Prabhakar (5):
  media: davinci: vpif_display: drop setting of vb2 buffer state to
    ACTIVE
  media: davinci: vpif_capture: drop setting of vb2 buffer state to
    ACTIVE
  media: videobuf2-core.h: add a helper to get status of
    start_streaming()
  media: davinci: vpif_display: fix the check on suspend/resume
    callbacks
  media: davinci: vpif_capture: fix the check on suspend/resume
    callbacks

 drivers/media/platform/davinci/vpif_capture.c | 7 ++-----
 drivers/media/platform/davinci/vpif_display.c | 8 ++------
 include/media/videobuf2-core.h                | 9 +++++++++
 3 files changed, 13 insertions(+), 11 deletions(-)

--
1.9.1

_______________________________________________
Davinci-linux-open-source mailing list
[hidden email]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
Reply | Threaded
Open this post in threaded view
|

[PATCH 1/5] media: davinci: vpif_display: drop setting of vb2 buffer state to ACTIVE

Lad, Prabhakar
this patch drops setting of vb2 buffer state to VB2_BUF_STATE_ACTIVE,
as any buffer queued to the driver is marked ACTIVE by the vb2 core.

Signed-off-by: Lad, Prabhakar <[hidden email]>
---
 drivers/media/platform/davinci/vpif_display.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/media/platform/davinci/vpif_display.c b/drivers/media/platform/davinci/vpif_display.c
index 2ce3ddf..76f829d 100644
--- a/drivers/media/platform/davinci/vpif_display.c
+++ b/drivers/media/platform/davinci/vpif_display.c
@@ -196,8 +196,6 @@ static int vpif_start_streaming(struct vb2_queue *vq, unsigned int count)
 
  list_del(&common->cur_frm->list);
  spin_unlock_irqrestore(&common->irqlock, flags);
- /* Mark state of the current frame to active */
- common->cur_frm->vb.state = VB2_BUF_STATE_ACTIVE;
 
  addr = vb2_dma_contig_plane_dma_addr(&common->cur_frm->vb, 0);
  common->set_addr((addr + common->ytop_off),
@@ -306,8 +304,6 @@ static void process_progressive_mode(struct common_obj *common)
  /* Remove that buffer from the buffer queue */
  list_del(&common->next_frm->list);
  spin_unlock(&common->irqlock);
- /* Mark status of the buffer as active */
- common->next_frm->vb.state = VB2_BUF_STATE_ACTIVE;
 
  /* Set top and bottom field addrs in VPIF registers */
  addr = vb2_dma_contig_plane_dma_addr(&common->next_frm->vb, 0);
--
1.9.1

_______________________________________________
Davinci-linux-open-source mailing list
[hidden email]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
Reply | Threaded
Open this post in threaded view
|

[PATCH 2/5] media: davinci: vpif_capture: drop setting of vb2 buffer state to ACTIVE

Lad, Prabhakar
In reply to this post by Lad, Prabhakar
this patch drops setting of vb2 buffer state to VB2_BUF_STATE_ACTIVE,
as any buffer queued to the driver is marked ACTIVE by the vb2 core.

Signed-off-by: Lad, Prabhakar <[hidden email]>
---
 drivers/media/platform/davinci/vpif_capture.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/media/platform/davinci/vpif_capture.c b/drivers/media/platform/davinci/vpif_capture.c
index cf15bb1..881efcd 100644
--- a/drivers/media/platform/davinci/vpif_capture.c
+++ b/drivers/media/platform/davinci/vpif_capture.c
@@ -213,8 +213,6 @@ static int vpif_start_streaming(struct vb2_queue *vq, unsigned int count)
  /* Remove buffer from the buffer queue */
  list_del(&common->cur_frm->list);
  spin_unlock_irqrestore(&common->irqlock, flags);
- /* Mark state of the current frame to active */
- common->cur_frm->vb.state = VB2_BUF_STATE_ACTIVE;
 
  addr = vb2_dma_contig_plane_dma_addr(&common->cur_frm->vb, 0);
 
@@ -350,7 +348,6 @@ static void vpif_schedule_next_buffer(struct common_obj *common)
  /* Remove that buffer from the buffer queue */
  list_del(&common->next_frm->list);
  spin_unlock(&common->irqlock);
- common->next_frm->vb.state = VB2_BUF_STATE_ACTIVE;
  addr = vb2_dma_contig_plane_dma_addr(&common->next_frm->vb, 0);
 
  /* Set top and bottom field addresses in VPIF registers */
--
1.9.1

_______________________________________________
Davinci-linux-open-source mailing list
[hidden email]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
Reply | Threaded
Open this post in threaded view
|

[PATCH 3/5] media: videobuf2-core.h: add a helper to get status of start_streaming()

Lad, Prabhakar
In reply to this post by Lad, Prabhakar
this patch adds a helper to get the status if start_streaming()
was called successfully.

Signed-off-by: Lad, Prabhakar <[hidden email]>
Cc: Pawel Osciak <[hidden email]>
Cc: Marek Szyprowski <[hidden email]>
Cc: Kyungmin Park <[hidden email]>
Cc: Hans Verkuil <[hidden email]>
---
 include/media/videobuf2-core.h | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/include/media/videobuf2-core.h b/include/media/videobuf2-core.h
index 5a10d8d..b3c9973 100644
--- a/include/media/videobuf2-core.h
+++ b/include/media/videobuf2-core.h
@@ -590,6 +590,15 @@ vb2_plane_size(struct vb2_buffer *vb, unsigned int plane_no)
  return 0;
 }
 
+/**
+ * vb2_start_streaming_called() - return streaming status of driver
+ * @q: videobuf queue
+ */
+static inline bool vb2_start_streaming_called(struct vb2_queue *q)
+{
+ return q->start_streaming_called;
+}
+
 /*
  * The following functions are not part of the vb2 core API, but are simple
  * helper functions that you can use in your struct v4l2_file_operations,
--
1.9.1

_______________________________________________
Davinci-linux-open-source mailing list
[hidden email]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
Reply | Threaded
Open this post in threaded view
|

[PATCH 4/5] media: davinci: vpif_display: fix the check on suspend/resume callbacks

Lad, Prabhakar
In reply to this post by Lad, Prabhakar
It is possible to call STREAMON without having any buffers queued.
So vb2_is_streaming() can return true without start_streaming()
having been called. Only after at least one buffer has been
queued will start_streaming be called.

The check vb2_is_streaming() is incorrect as this would start
the DMA without having proper DMA pointers set up. this patch
uses vb2_start_streaming_called() instead to check is streaming
was called.

Signed-off-by: Lad, Prabhakar <[hidden email]>
---
 drivers/media/platform/davinci/vpif_display.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/platform/davinci/vpif_display.c b/drivers/media/platform/davinci/vpif_display.c
index 76f829d..8d6ced5 100644
--- a/drivers/media/platform/davinci/vpif_display.c
+++ b/drivers/media/platform/davinci/vpif_display.c
@@ -1400,7 +1400,7 @@ static int vpif_suspend(struct device *dev)
  ch = vpif_obj.dev[i];
  common = &ch->common[VPIF_VIDEO_INDEX];
 
- if (!vb2_is_streaming(&common->buffer_queue))
+ if (!vb2_start_streaming_called(&common->buffer_queue))
  continue;
 
  mutex_lock(&common->lock);
@@ -1432,7 +1432,7 @@ static int vpif_resume(struct device *dev)
  ch = vpif_obj.dev[i];
  common = &ch->common[VPIF_VIDEO_INDEX];
 
- if (!vb2_is_streaming(&common->buffer_queue))
+ if (!vb2_start_streaming_called(&common->buffer_queue))
  continue;
 
  mutex_lock(&common->lock);
--
1.9.1

_______________________________________________
Davinci-linux-open-source mailing list
[hidden email]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
Reply | Threaded
Open this post in threaded view
|

[PATCH 5/5] media: davinci: vpif_capture: fix the check on suspend/resume callbacks

Lad, Prabhakar
In reply to this post by Lad, Prabhakar
It is possible to call STREAMON without having any buffers queued.
So vb2_is_streaming() can return true without start_streaming()
having been called. Only after at least one buffer has been
queued will start_streaming be called.

The check vb2_is_streaming() is incorrect as this would start
the DMA without having proper DMA pointers set up. this patch
uses vb2_start_streaming_called() instead to check is streaming
was called.

Signed-off-by: Lad, Prabhakar <[hidden email]>
---
 drivers/media/platform/davinci/vpif_capture.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/platform/davinci/vpif_capture.c b/drivers/media/platform/davinci/vpif_capture.c
index 881efcd..3ccb26f 100644
--- a/drivers/media/platform/davinci/vpif_capture.c
+++ b/drivers/media/platform/davinci/vpif_capture.c
@@ -1596,7 +1596,7 @@ static int vpif_suspend(struct device *dev)
  ch = vpif_obj.dev[i];
  common = &ch->common[VPIF_VIDEO_INDEX];
 
- if (!vb2_is_streaming(&common->buffer_queue))
+ if (!vb2_start_streaming_called(&common->buffer_queue))
  continue;
 
  mutex_lock(&common->lock);
@@ -1630,7 +1630,7 @@ static int vpif_resume(struct device *dev)
  ch = vpif_obj.dev[i];
  common = &ch->common[VPIF_VIDEO_INDEX];
 
- if (!vb2_is_streaming(&common->buffer_queue))
+ if (!vb2_start_streaming_called(&common->buffer_queue))
  continue;
 
  mutex_lock(&common->lock);
--
1.9.1

_______________________________________________
Davinci-linux-open-source mailing list
[hidden email]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH 3/5] media: videobuf2-core.h: add a helper to get status of start_streaming()

Hans Verkuil
In reply to this post by Lad, Prabhakar
On 09/06/2014 05:26 PM, Lad, Prabhakar wrote:
> this patch adds a helper to get the status if start_streaming()
> was called successfully.

Nice! I've had the same idea for quite some time now, but for some reason
I never got around to actually adding it.

        Hans

>
> Signed-off-by: Lad, Prabhakar <[hidden email]>
> Cc: Pawel Osciak <[hidden email]>
> Cc: Marek Szyprowski <[hidden email]>
> Cc: Kyungmin Park <[hidden email]>
> Cc: Hans Verkuil <[hidden email]>
> ---
>  include/media/videobuf2-core.h | 9 +++++++++
>  1 file changed, 9 insertions(+)
>
> diff --git a/include/media/videobuf2-core.h b/include/media/videobuf2-core.h
> index 5a10d8d..b3c9973 100644
> --- a/include/media/videobuf2-core.h
> +++ b/include/media/videobuf2-core.h
> @@ -590,6 +590,15 @@ vb2_plane_size(struct vb2_buffer *vb, unsigned int plane_no)
>   return 0;
>  }
>  
> +/**
> + * vb2_start_streaming_called() - return streaming status of driver
> + * @q: videobuf queue
> + */
> +static inline bool vb2_start_streaming_called(struct vb2_queue *q)
> +{
> + return q->start_streaming_called;
> +}
> +
>  /*
>   * The following functions are not part of the vb2 core API, but are simple
>   * helper functions that you can use in your struct v4l2_file_operations,
>

_______________________________________________
Davinci-linux-open-source mailing list
[hidden email]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source