1 From 30f64323484c3004f6cce2b42984431fc5c9b5a3 Mon Sep 17 00:00:00 2001
2 From: Ezequiel Garcia <ezequiel@collabora.com>
3 Date: Fri, 8 Feb 2019 11:17:42 -0500
4 Subject: media: mx2_emmaprp: Correct return type for mem2mem buffer helpers
6 [ Upstream commit 8d20dcefe471763f23ad538369ec65b51993ffff ]
8 Fix the assigned type of mem2mem buffer handling API.
9 Namely, these functions:
18 v4l2_m2m_src_buf_remove
19 v4l2_m2m_dst_buf_remove
21 return a struct vb2_v4l2_buffer, and not a struct vb2_buffer.
23 Fixing this is necessary to fix the mem2mem buffer handling API,
24 changing the return to the correct struct vb2_v4l2_buffer instead
27 Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
28 Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
29 Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
30 Signed-off-by: Sasha Levin <sashal@kernel.org>
32 drivers/media/platform/mx2_emmaprp.c | 6 +++---
33 1 file changed, 3 insertions(+), 3 deletions(-)
35 diff --git a/drivers/media/platform/mx2_emmaprp.c b/drivers/media/platform/mx2_emmaprp.c
36 index 03a1b606655d..009a4bb77d05 100644
37 --- a/drivers/media/platform/mx2_emmaprp.c
38 +++ b/drivers/media/platform/mx2_emmaprp.c
39 @@ -289,7 +289,7 @@ static void emmaprp_device_run(void *priv)
41 struct emmaprp_ctx *ctx = priv;
42 struct emmaprp_q_data *s_q_data, *d_q_data;
43 - struct vb2_buffer *src_buf, *dst_buf;
44 + struct vb2_v4l2_buffer *src_buf, *dst_buf;
45 struct emmaprp_dev *pcdev = ctx->dev;
46 unsigned int s_width, s_height;
47 unsigned int d_width, d_height;
48 @@ -309,8 +309,8 @@ static void emmaprp_device_run(void *priv)
49 d_height = d_q_data->height;
50 d_size = d_width * d_height;
52 - p_in = vb2_dma_contig_plane_dma_addr(src_buf, 0);
53 - p_out = vb2_dma_contig_plane_dma_addr(dst_buf, 0);
54 + p_in = vb2_dma_contig_plane_dma_addr(&src_buf->vb2_buf, 0);
55 + p_out = vb2_dma_contig_plane_dma_addr(&dst_buf->vb2_buf, 0);
56 if (!p_in || !p_out) {
57 v4l2_err(&pcdev->v4l2_dev,
58 "Acquiring kernel pointers to buffers failed\n");