9688bc868a5b2061c97b3574f77445cf0f2524ee
[openwrt/staging/linusw.git] /
1 From 483bef9dcddc4bcb9f4e250d91b31361a919b7ed Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.org>
3 Date: Mon, 24 Sep 2018 18:26:02 +0100
4 Subject: [PATCH] staging: vc04_services: Support sending data to MMAL
5 ports
6
7 Add the ability to send data to ports. This only supports
8 zero copy mode as the required bulk transfer setup calls
9 are not done.
10
11 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
12 ---
13 .../vc04_services/vchiq-mmal/mmal-vchiq.c | 18 +++++++++++++-----
14 1 file changed, 13 insertions(+), 5 deletions(-)
15
16 --- a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
17 +++ b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
18 @@ -428,11 +428,19 @@ buffer_from_host(struct vchiq_mmal_insta
19 m.u.buffer_from_host.buffer_header.data =
20 (u32)(unsigned long)buf->buffer;
21 m.u.buffer_from_host.buffer_header.alloc_size = buf->buffer_size;
22 - m.u.buffer_from_host.buffer_header.length = 0; /* nothing used yet */
23 - m.u.buffer_from_host.buffer_header.offset = 0; /* no offset */
24 - m.u.buffer_from_host.buffer_header.flags = 0; /* no flags */
25 - m.u.buffer_from_host.buffer_header.pts = MMAL_TIME_UNKNOWN;
26 - m.u.buffer_from_host.buffer_header.dts = MMAL_TIME_UNKNOWN;
27 + if (port->type == MMAL_PORT_TYPE_OUTPUT) {
28 + m.u.buffer_from_host.buffer_header.length = 0;
29 + m.u.buffer_from_host.buffer_header.offset = 0;
30 + m.u.buffer_from_host.buffer_header.flags = 0;
31 + m.u.buffer_from_host.buffer_header.pts = MMAL_TIME_UNKNOWN;
32 + m.u.buffer_from_host.buffer_header.dts = MMAL_TIME_UNKNOWN;
33 + } else {
34 + m.u.buffer_from_host.buffer_header.length = buf->length;
35 + m.u.buffer_from_host.buffer_header.offset = 0;
36 + m.u.buffer_from_host.buffer_header.flags = buf->mmal_flags;
37 + m.u.buffer_from_host.buffer_header.pts = buf->pts;
38 + m.u.buffer_from_host.buffer_header.dts = buf->dts;
39 + }
40
41 /* clear buffer type sepecific data */
42 memset(&m.u.buffer_from_host.buffer_header_type_specific, 0,