]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/4.19.34/media-mx2_emmaprp-correct-return-type-for-mem2mem-bu.patch
Linux 4.19.34
[thirdparty/kernel/stable-queue.git] / releases / 4.19.34 / media-mx2_emmaprp-correct-return-type-for-mem2mem-bu.patch
1 From 0a4c97552eb4c52a16517b8a99aae9ae844ae4e4 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
5
6 [ Upstream commit 8d20dcefe471763f23ad538369ec65b51993ffff ]
7
8 Fix the assigned type of mem2mem buffer handling API.
9 Namely, these functions:
10
11 v4l2_m2m_next_buf
12 v4l2_m2m_last_buf
13 v4l2_m2m_buf_remove
14 v4l2_m2m_next_src_buf
15 v4l2_m2m_next_dst_buf
16 v4l2_m2m_last_src_buf
17 v4l2_m2m_last_dst_buf
18 v4l2_m2m_src_buf_remove
19 v4l2_m2m_dst_buf_remove
20
21 return a struct vb2_v4l2_buffer, and not a struct vb2_buffer.
22
23 Fixing this is necessary to fix the mem2mem buffer handling API,
24 changing the return to the correct struct vb2_v4l2_buffer instead
25 of a void pointer.
26
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>
31 ---
32 drivers/media/platform/mx2_emmaprp.c | 6 +++---
33 1 file changed, 3 insertions(+), 3 deletions(-)
34
35 diff --git a/drivers/media/platform/mx2_emmaprp.c b/drivers/media/platform/mx2_emmaprp.c
36 index 64195c4ddeaf..419e1cb10dc6 100644
37 --- a/drivers/media/platform/mx2_emmaprp.c
38 +++ b/drivers/media/platform/mx2_emmaprp.c
39 @@ -274,7 +274,7 @@ static void emmaprp_device_run(void *priv)
40 {
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 @@ -294,8 +294,8 @@ static void emmaprp_device_run(void *priv)
49 d_height = d_q_data->height;
50 d_size = d_width * d_height;
51
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");
59 --
60 2.19.1
61