linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/5] media: Access videobuf2 buffers via an accessor
@ 2019-06-10 20:55 Ezequiel Garcia
  2019-06-10 20:55 ` [PATCH v2 1/5] media: vb2: Introduce a vb2_get_buffer accessor Ezequiel Garcia
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Ezequiel Garcia @ 2019-06-10 20:55 UTC (permalink / raw)
  To: linux-media, Hans Verkuil
  Cc: kernel, Boris Brezillon, Kyungmin Park, Marek Szyprowski,
	Pawel Osciak, Ezequiel Garcia

Hi,

This patchset introduces a new vb2_get_buffer accessor and then
uses it on all the drivers that are accessing videobuf2
private buffer array directly.

I'm skipping Intel IPU3 driver here, since the code goes beyond
just accessing the buffer. It also modifies the buffer queue
directly. I believe this driver would need some more cleanup
and love from its maintainers.

Note that OMAP2/OMAP3 display driver is videobuf1 and so not
affected by this change.

Lastly, note that I'm doing the minimum changes to drivers I can't test,
only using the new accessor and avoiding any further changes.

Changes from v1:

* Address feedback from Boris, and drop redundant check.

Thanks,
Ezequiel

Ezequiel Garcia (5):
  media: vb2: Introduce a vb2_get_buffer accessor
  media: mtk-jpeg: Use vb2_get_buffer
  media: mtk-vcodec: Use vb2_get_buffer
  media: sti: Use vb2_get_buffer
  media: rockchip: Use vb2_get_buffer

 .../media/platform/mtk-jpeg/mtk_jpeg_core.c    |  2 +-
 .../media/platform/mtk-vcodec/mtk_vcodec_enc.c | 12 +++++++++---
 drivers/media/platform/sti/hva/hva-v4l2.c      |  4 +++-
 .../media/rockchip/vpu/rockchip_vpu_drv.c      |  9 ++++++---
 include/media/videobuf2-core.h                 | 18 ++++++++++++++++++
 5 files changed, 37 insertions(+), 8 deletions(-)

-- 
2.20.1


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

* [PATCH v2 1/5] media: vb2: Introduce a vb2_get_buffer accessor
  2019-06-10 20:55 [PATCH v2 0/5] media: Access videobuf2 buffers via an accessor Ezequiel Garcia
@ 2019-06-10 20:55 ` Ezequiel Garcia
  2019-06-11 12:27   ` Marek Szyprowski
  2019-06-10 20:55 ` [PATCH v2 2/5] media: mtk-jpeg: Use vb2_get_buffer Ezequiel Garcia
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 11+ messages in thread
From: Ezequiel Garcia @ 2019-06-10 20:55 UTC (permalink / raw)
  To: linux-media, Hans Verkuil
  Cc: kernel, Boris Brezillon, Kyungmin Park, Marek Szyprowski,
	Pawel Osciak, Ezequiel Garcia

Some drivers need to access a vb2 buffer from its
queue index. Introduce an accessor to abstract this,
and avoid drivers from accessing private members.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
---
Changes from v1:
* Drop redundant num_buffers > 0 check.
---
 include/media/videobuf2-core.h | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/include/media/videobuf2-core.h b/include/media/videobuf2-core.h
index c03ef7cc5071..640aabe69450 100644
--- a/include/media/videobuf2-core.h
+++ b/include/media/videobuf2-core.h
@@ -1163,6 +1163,24 @@ static inline void vb2_clear_last_buffer_dequeued(struct vb2_queue *q)
 	q->last_buffer_dequeued = false;
 }
 
+/**
+ * vb2_get_buffer() - get a buffer from a queue
+ * @q:		pointer to &struct vb2_queue with videobuf2 queue.
+ * @index:	buffer index
+ *
+ * This function obtains a buffer from a queue, by its index.
+ * Keep in mind that there is no refcounting involved in this
+ * operation, so the buffer lifetime should be taken into
+ * consideration.
+ */
+static inline struct vb2_buffer *vb2_get_buffer(struct vb2_queue *q,
+						unsigned int index)
+{
+	if (index < q->num_buffers)
+		return q->bufs[index];
+	return NULL;
+}
+
 /*
  * The following functions are not part of the vb2 core API, but are useful
  * functions for videobuf2-*.
-- 
2.20.1


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

* [PATCH v2 2/5] media: mtk-jpeg: Use vb2_get_buffer
  2019-06-10 20:55 [PATCH v2 0/5] media: Access videobuf2 buffers via an accessor Ezequiel Garcia
  2019-06-10 20:55 ` [PATCH v2 1/5] media: vb2: Introduce a vb2_get_buffer accessor Ezequiel Garcia
@ 2019-06-10 20:55 ` Ezequiel Garcia
  2019-06-10 20:55 ` [PATCH v2 3/5] media: mtk-vcodec: " Ezequiel Garcia
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 11+ messages in thread
From: Ezequiel Garcia @ 2019-06-10 20:55 UTC (permalink / raw)
  To: linux-media, Hans Verkuil
  Cc: kernel, Boris Brezillon, Kyungmin Park, Marek Szyprowski,
	Pawel Osciak, Ezequiel Garcia, Rick Chang, Bin Liu

Use the newly introduced vb2_get_buffer API and avoid
accessing buffers in the queue directly.

Cc: Rick Chang <rick.chang@mediatek.com>
Cc: Bin Liu <bin.liu@mediatek.com>
Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
---
 drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c b/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c
index 3b199662cb34..f8f808abada1 100644
--- a/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c
+++ b/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c
@@ -526,7 +526,7 @@ static int mtk_jpeg_qbuf(struct file *file, void *priv, struct v4l2_buffer *buf)
 		return -EINVAL;
 	}
 
-	vb = vq->bufs[buf->index];
+	vb = vb2_get_buffer(vq, buf->index);
 	jpeg_src_buf = mtk_jpeg_vb2_to_srcbuf(vb);
 	jpeg_src_buf->flags = (buf->m.planes[0].bytesused == 0) ?
 		MTK_JPEG_BUF_FLAGS_LAST_FRAME : MTK_JPEG_BUF_FLAGS_INIT;
-- 
2.20.1


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

* [PATCH v2 3/5] media: mtk-vcodec: Use vb2_get_buffer
  2019-06-10 20:55 [PATCH v2 0/5] media: Access videobuf2 buffers via an accessor Ezequiel Garcia
  2019-06-10 20:55 ` [PATCH v2 1/5] media: vb2: Introduce a vb2_get_buffer accessor Ezequiel Garcia
  2019-06-10 20:55 ` [PATCH v2 2/5] media: mtk-jpeg: Use vb2_get_buffer Ezequiel Garcia
@ 2019-06-10 20:55 ` Ezequiel Garcia
  2019-06-10 20:55 ` [PATCH v2 4/5] media: sti: " Ezequiel Garcia
  2019-06-10 20:55 ` [PATCH v2 5/5] media: rockchip: " Ezequiel Garcia
  4 siblings, 0 replies; 11+ messages in thread
From: Ezequiel Garcia @ 2019-06-10 20:55 UTC (permalink / raw)
  To: linux-media, Hans Verkuil
  Cc: kernel, Boris Brezillon, Kyungmin Park, Marek Szyprowski,
	Pawel Osciak, Ezequiel Garcia, Tiffany Lin, Andrew-CT Chen

Use the newly introduced vb2_get_buffer API and avoid
accessing buffers in the queue directly.

Cc: Tiffany Lin <tiffany.lin@mediatek.com>
Cc: Andrew-CT Chen <andrew-ct.chen@mediatek.com>
Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
---
 drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c
index 67e8a023ef41..5198912a1996 100644
--- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c
+++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c
@@ -860,11 +860,17 @@ static int vb2ops_venc_start_streaming(struct vb2_queue *q, unsigned int count)
 
 err_set_param:
 	for (i = 0; i < q->num_buffers; ++i) {
-		if (q->bufs[i]->state == VB2_BUF_STATE_ACTIVE) {
+		struct vb2_buffer *buf = vb2_get_buffer(q, i);
+
+		/*
+		 * FIXME: This check is not needed as only active buffers
+		 * can be marked as done.
+		 */
+		if (buf->state == VB2_BUF_STATE_ACTIVE) {
 			mtk_v4l2_debug(0, "[%d] id=%d, type=%d, %d -> VB2_BUF_STATE_QUEUED",
 					ctx->id, i, q->type,
-					(int)q->bufs[i]->state);
-			v4l2_m2m_buf_done(to_vb2_v4l2_buffer(q->bufs[i]),
+					(int)buf->state);
+			v4l2_m2m_buf_done(to_vb2_v4l2_buffer(buf),
 					VB2_BUF_STATE_QUEUED);
 		}
 	}
-- 
2.20.1


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

* [PATCH v2 4/5] media: sti: Use vb2_get_buffer
  2019-06-10 20:55 [PATCH v2 0/5] media: Access videobuf2 buffers via an accessor Ezequiel Garcia
                   ` (2 preceding siblings ...)
  2019-06-10 20:55 ` [PATCH v2 3/5] media: mtk-vcodec: " Ezequiel Garcia
@ 2019-06-10 20:55 ` Ezequiel Garcia
  2019-06-10 20:55 ` [PATCH v2 5/5] media: rockchip: " Ezequiel Garcia
  4 siblings, 0 replies; 11+ messages in thread
From: Ezequiel Garcia @ 2019-06-10 20:55 UTC (permalink / raw)
  To: linux-media, Hans Verkuil
  Cc: kernel, Boris Brezillon, Kyungmin Park, Marek Szyprowski,
	Pawel Osciak, Ezequiel Garcia, Jean-Christophe Trotin

Use the newly introduced vb2_get_buffer API and avoid
accessing buffers in the queue directly.

Cc: Jean-Christophe Trotin <jean-christophe.trotin@st.com>
Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
---
 drivers/media/platform/sti/hva/hva-v4l2.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/media/platform/sti/hva/hva-v4l2.c b/drivers/media/platform/sti/hva/hva-v4l2.c
index c42623dccfd6..64004d15a9c9 100644
--- a/drivers/media/platform/sti/hva/hva-v4l2.c
+++ b/drivers/media/platform/sti/hva/hva-v4l2.c
@@ -566,6 +566,7 @@ static int hva_qbuf(struct file *file, void *priv, struct v4l2_buffer *buf)
 		 */
 		struct vb2_queue *vq;
 		struct hva_stream *stream;
+		struct vb2_buffer *vb2_buf;
 
 		vq = v4l2_m2m_get_vq(ctx->fh.m2m_ctx, buf->type);
 
@@ -575,7 +576,8 @@ static int hva_qbuf(struct file *file, void *priv, struct v4l2_buffer *buf)
 			return -EINVAL;
 		}
 
-		stream = (struct hva_stream *)vq->bufs[buf->index];
+		vb2_buf = vb2_get_buffer(vq, buf->index);
+		stream = to_hva_stream(to_vb2_v4l2_buffer(vb2_buf));
 		stream->bytesused = buf->bytesused;
 	}
 
-- 
2.20.1


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

* [PATCH v2 5/5] media: rockchip: Use vb2_get_buffer
  2019-06-10 20:55 [PATCH v2 0/5] media: Access videobuf2 buffers via an accessor Ezequiel Garcia
                   ` (3 preceding siblings ...)
  2019-06-10 20:55 ` [PATCH v2 4/5] media: sti: " Ezequiel Garcia
@ 2019-06-10 20:55 ` Ezequiel Garcia
  2019-06-14  7:40   ` Hans Verkuil
  4 siblings, 1 reply; 11+ messages in thread
From: Ezequiel Garcia @ 2019-06-10 20:55 UTC (permalink / raw)
  To: linux-media, Hans Verkuil
  Cc: kernel, Boris Brezillon, Kyungmin Park, Marek Szyprowski,
	Pawel Osciak, Ezequiel Garcia

Use the newly introduced vb2_get_buffer API and avoid
accessing buffers in the queue directly.

Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
---
 drivers/staging/media/rockchip/vpu/rockchip_vpu_drv.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/media/rockchip/vpu/rockchip_vpu_drv.c b/drivers/staging/media/rockchip/vpu/rockchip_vpu_drv.c
index b94ff97451db..ad17e04e701a 100644
--- a/drivers/staging/media/rockchip/vpu/rockchip_vpu_drv.c
+++ b/drivers/staging/media/rockchip/vpu/rockchip_vpu_drv.c
@@ -45,12 +45,15 @@ void *rockchip_vpu_get_ctrl(struct rockchip_vpu_ctx *ctx, u32 id)
 
 dma_addr_t rockchip_vpu_get_ref(struct vb2_queue *q, u64 ts)
 {
+	struct vb2_buffer *buf;
 	int index;
 
 	index = vb2_find_timestamp(q, ts, 0);
-	if (index >= 0)
-		return vb2_dma_contig_plane_dma_addr(q->bufs[index], 0);
-	return 0;
+	if (index < 0)
+		return 0;
+
+	buf = vb2_get_buffer(q, index);
+	return vb2_dma_contig_plane_dma_addr(buf, 0);
 }
 
 static int
-- 
2.20.1


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

* Re: [PATCH v2 1/5] media: vb2: Introduce a vb2_get_buffer accessor
  2019-06-10 20:55 ` [PATCH v2 1/5] media: vb2: Introduce a vb2_get_buffer accessor Ezequiel Garcia
@ 2019-06-11 12:27   ` Marek Szyprowski
  0 siblings, 0 replies; 11+ messages in thread
From: Marek Szyprowski @ 2019-06-11 12:27 UTC (permalink / raw)
  To: Ezequiel Garcia, linux-media, Hans Verkuil
  Cc: kernel, Boris Brezillon, Kyungmin Park, Pawel Osciak


On 2019-06-10 22:55, Ezequiel Garcia wrote:
> Some drivers need to access a vb2 buffer from its
> queue index. Introduce an accessor to abstract this,
> and avoid drivers from accessing private members.
>
> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
> Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>

Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>

> ---
> Changes from v1:
> * Drop redundant num_buffers > 0 check.
> ---
>   include/media/videobuf2-core.h | 18 ++++++++++++++++++
>   1 file changed, 18 insertions(+)
>
> diff --git a/include/media/videobuf2-core.h b/include/media/videobuf2-core.h
> index c03ef7cc5071..640aabe69450 100644
> --- a/include/media/videobuf2-core.h
> +++ b/include/media/videobuf2-core.h
> @@ -1163,6 +1163,24 @@ static inline void vb2_clear_last_buffer_dequeued(struct vb2_queue *q)
>   	q->last_buffer_dequeued = false;
>   }
>   
> +/**
> + * vb2_get_buffer() - get a buffer from a queue
> + * @q:		pointer to &struct vb2_queue with videobuf2 queue.
> + * @index:	buffer index
> + *
> + * This function obtains a buffer from a queue, by its index.
> + * Keep in mind that there is no refcounting involved in this
> + * operation, so the buffer lifetime should be taken into
> + * consideration.
> + */
> +static inline struct vb2_buffer *vb2_get_buffer(struct vb2_queue *q,
> +						unsigned int index)
> +{
> +	if (index < q->num_buffers)
> +		return q->bufs[index];
> +	return NULL;
> +}
> +
>   /*
>    * The following functions are not part of the vb2 core API, but are useful
>    * functions for videobuf2-*.

Best regards
-- 
Marek Szyprowski, PhD
Samsung R&D Institute Poland


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

* Re: [PATCH v2 5/5] media: rockchip: Use vb2_get_buffer
  2019-06-10 20:55 ` [PATCH v2 5/5] media: rockchip: " Ezequiel Garcia
@ 2019-06-14  7:40   ` Hans Verkuil
  2019-06-18 23:12     ` [PATCH] media: hantro: " Ezequiel Garcia
  0 siblings, 1 reply; 11+ messages in thread
From: Hans Verkuil @ 2019-06-14  7:40 UTC (permalink / raw)
  To: Ezequiel Garcia, linux-media, Hans Verkuil
  Cc: kernel, Boris Brezillon, Kyungmin Park, Marek Szyprowski, Pawel Osciak

On 6/10/19 10:55 PM, Ezequiel Garcia wrote:
> Use the newly introduced vb2_get_buffer API and avoid
> accessing buffers in the queue directly.

Can you rebase this patch? It no longer applies after the hantro rename
was merged.

Thanks!

	Hans

> 
> Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
> ---
>  drivers/staging/media/rockchip/vpu/rockchip_vpu_drv.c | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/staging/media/rockchip/vpu/rockchip_vpu_drv.c b/drivers/staging/media/rockchip/vpu/rockchip_vpu_drv.c
> index b94ff97451db..ad17e04e701a 100644
> --- a/drivers/staging/media/rockchip/vpu/rockchip_vpu_drv.c
> +++ b/drivers/staging/media/rockchip/vpu/rockchip_vpu_drv.c
> @@ -45,12 +45,15 @@ void *rockchip_vpu_get_ctrl(struct rockchip_vpu_ctx *ctx, u32 id)
>  
>  dma_addr_t rockchip_vpu_get_ref(struct vb2_queue *q, u64 ts)
>  {
> +	struct vb2_buffer *buf;
>  	int index;
>  
>  	index = vb2_find_timestamp(q, ts, 0);
> -	if (index >= 0)
> -		return vb2_dma_contig_plane_dma_addr(q->bufs[index], 0);
> -	return 0;
> +	if (index < 0)
> +		return 0;
> +
> +	buf = vb2_get_buffer(q, index);
> +	return vb2_dma_contig_plane_dma_addr(buf, 0);
>  }
>  
>  static int
> 


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

* [PATCH] media: hantro: Use vb2_get_buffer
  2019-06-14  7:40   ` Hans Verkuil
@ 2019-06-18 23:12     ` Ezequiel Garcia
  2019-06-21 21:03       ` kbuild test robot
  2019-06-22  4:14       ` kbuild test robot
  0 siblings, 2 replies; 11+ messages in thread
From: Ezequiel Garcia @ 2019-06-18 23:12 UTC (permalink / raw)
  To: linux-media; +Cc: Hans Verkuil, kernel, Ezequiel Garcia

Use the newly introduced vb2_get_buffer API and avoid
accessing buffers in the queue directly.

Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
---
 drivers/staging/media/hantro/hantro_drv.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/media/hantro/hantro_drv.c b/drivers/staging/media/hantro/hantro_drv.c
index 1d3af881d088..c3665f0e87a2 100644
--- a/drivers/staging/media/hantro/hantro_drv.c
+++ b/drivers/staging/media/hantro/hantro_drv.c
@@ -45,12 +45,14 @@ void *hantro_get_ctrl(struct hantro_ctx *ctx, u32 id)
 
 dma_addr_t hantro_get_ref(struct vb2_queue *q, u64 ts)
 {
+	struct vb2_buffer *buf;
 	int index;
 
 	index = vb2_find_timestamp(q, ts, 0);
-	if (index >= 0)
-		return vb2_dma_contig_plane_dma_addr(q->bufs[index], 0);
-	return 0;
+	if (index < 0)
+		return 0;
+	buf = vb2_get_buffer(q, index);
+	return vb2_dma_contig_plane_dma_addr(buf, 0);
 }
 
 static int
-- 
2.20.1


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

* Re: [PATCH] media: hantro: Use vb2_get_buffer
  2019-06-18 23:12     ` [PATCH] media: hantro: " Ezequiel Garcia
@ 2019-06-21 21:03       ` kbuild test robot
  2019-06-22  4:14       ` kbuild test robot
  1 sibling, 0 replies; 11+ messages in thread
From: kbuild test robot @ 2019-06-21 21:03 UTC (permalink / raw)
  To: Ezequiel Garcia
  Cc: kbuild-all, linux-media, Hans Verkuil, kernel, Ezequiel Garcia

[-- Attachment #1: Type: text/plain, Size: 2042 bytes --]

Hi Ezequiel,

I love your patch! Yet something to improve:

[auto build test ERROR on linuxtv-media/master]
[also build test ERROR on next-20190621]
[cannot apply to v5.2-rc5]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Ezequiel-Garcia/media-hantro-Use-vb2_get_buffer/20190622-022557
base:   git://linuxtv.org/media_tree.git master
config: arm-allmodconfig (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 7.4.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        GCC_VERSION=7.4.0 make.cross ARCH=arm 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>

All error/warnings (new ones prefixed by >>):

   drivers/staging//media/hantro/hantro_drv.c: In function 'hantro_get_ref':
>> drivers/staging//media/hantro/hantro_drv.c:54:8: error: implicit declaration of function 'vb2_get_buffer'; did you mean 'vb2_expbuf'? [-Werror=implicit-function-declaration]
     buf = vb2_get_buffer(q, index);
           ^~~~~~~~~~~~~~
           vb2_expbuf
>> drivers/staging//media/hantro/hantro_drv.c:54:6: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
     buf = vb2_get_buffer(q, index);
         ^
   cc1: some warnings being treated as errors

vim +54 drivers/staging//media/hantro/hantro_drv.c

    45	
    46	dma_addr_t hantro_get_ref(struct vb2_queue *q, u64 ts)
    47	{
    48		struct vb2_buffer *buf;
    49		int index;
    50	
    51		index = vb2_find_timestamp(q, ts, 0);
    52		if (index < 0)
    53			return 0;
  > 54		buf = vb2_get_buffer(q, index);
    55		return vb2_dma_contig_plane_dma_addr(buf, 0);
    56	}
    57	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 70710 bytes --]

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

* Re: [PATCH] media: hantro: Use vb2_get_buffer
  2019-06-18 23:12     ` [PATCH] media: hantro: " Ezequiel Garcia
  2019-06-21 21:03       ` kbuild test robot
@ 2019-06-22  4:14       ` kbuild test robot
  1 sibling, 0 replies; 11+ messages in thread
From: kbuild test robot @ 2019-06-22  4:14 UTC (permalink / raw)
  To: Ezequiel Garcia
  Cc: kbuild-all, linux-media, Hans Verkuil, kernel, Ezequiel Garcia

[-- Attachment #1: Type: text/plain, Size: 2076 bytes --]

Hi Ezequiel,

I love your patch! Perhaps something to improve:

[auto build test WARNING on linuxtv-media/master]
[also build test WARNING on next-20190621]
[cannot apply to v5.2-rc5]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Ezequiel-Garcia/media-hantro-Use-vb2_get_buffer/20190622-022557
base:   git://linuxtv.org/media_tree.git master
config: nds32-allmodconfig (attached as .config)
compiler: nds32le-linux-gcc (GCC) 8.1.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        GCC_VERSION=8.1.0 make.cross ARCH=nds32 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   drivers/staging/media/hantro/hantro_drv.c: In function 'hantro_get_ref':
   drivers/staging/media/hantro/hantro_drv.c:54:8: error: implicit declaration of function 'vb2_get_buffer'; did you mean 'vb2_expbuf'? [-Werror=implicit-function-declaration]
     buf = vb2_get_buffer(q, index);
           ^~~~~~~~~~~~~~
           vb2_expbuf
>> drivers/staging/media/hantro/hantro_drv.c:54:6: warning: assignment to 'struct vb2_buffer *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
     buf = vb2_get_buffer(q, index);
         ^
   cc1: some warnings being treated as errors

vim +54 drivers/staging/media/hantro/hantro_drv.c

    45	
    46	dma_addr_t hantro_get_ref(struct vb2_queue *q, u64 ts)
    47	{
    48		struct vb2_buffer *buf;
    49		int index;
    50	
    51		index = vb2_find_timestamp(q, ts, 0);
    52		if (index < 0)
    53			return 0;
  > 54		buf = vb2_get_buffer(q, index);
    55		return vb2_dma_contig_plane_dma_addr(buf, 0);
    56	}
    57	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 52162 bytes --]

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

end of thread, other threads:[~2019-06-22  4:15 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-10 20:55 [PATCH v2 0/5] media: Access videobuf2 buffers via an accessor Ezequiel Garcia
2019-06-10 20:55 ` [PATCH v2 1/5] media: vb2: Introduce a vb2_get_buffer accessor Ezequiel Garcia
2019-06-11 12:27   ` Marek Szyprowski
2019-06-10 20:55 ` [PATCH v2 2/5] media: mtk-jpeg: Use vb2_get_buffer Ezequiel Garcia
2019-06-10 20:55 ` [PATCH v2 3/5] media: mtk-vcodec: " Ezequiel Garcia
2019-06-10 20:55 ` [PATCH v2 4/5] media: sti: " Ezequiel Garcia
2019-06-10 20:55 ` [PATCH v2 5/5] media: rockchip: " Ezequiel Garcia
2019-06-14  7:40   ` Hans Verkuil
2019-06-18 23:12     ` [PATCH] media: hantro: " Ezequiel Garcia
2019-06-21 21:03       ` kbuild test robot
2019-06-22  4:14       ` kbuild test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).